Преглед на файлове

record表添加pk字段,在上传图片时候需要上传

zhangxike преди 4 дни
родител
ревизия
3a60d1a87f
променени са 4 файла, в които са добавени 8 реда и са изтрити 5 реда
  1. 1 1
      api/work.uts
  2. 4 3
      pages/work/record/InfoList.uvue
  3. BIN
      static/db/QT800.db
  4. 3 1
      utils/dataProcessor.uts

+ 1 - 1
api/work.uts

@@ -180,7 +180,7 @@ export async function saveMediaRecord(values : string) : Promise<UTSJSONObject>
 	const tableName = 'app_media_record';
 
 	// 构造字段名字符串
-	const fields = 'senum,photoitem,productno,part,partno,descb,num,status,date,urlspl,imgname,urlpdt,createtime,createuser,updatetime,updateuser,pid';
+	const fields = 'senum,photoitem,productno,part,partno,pk,descb,num,status,date,urlspl,imgname,urlpdt,createtime,createuser,updatetime,updateuser,pid';
 
 	try {
 		// 调用sqlite的插入方法

+ 4 - 3
pages/work/record/InfoList.uvue

@@ -33,7 +33,7 @@
         </view>
         <view class="info-row">
           <text class="label">物料编码:</text>
-          <text class="value">{{ item.productno }}</text>
+          <text class="value">{{ item.graphid }}</text>
         </view>
         <view class="info-row">
           <text class="label">路卡号:</text>
@@ -41,7 +41,7 @@
         </view>
         <view class="info-row">
           <text class="label">产品码:</text>
-          <text class="value">{{ item.processno }}</text>
+          <text class="value">{{ item.productno }}</text>
         </view>
         <view class="info-row">
           <text class="label">最近更新时间:</text>
@@ -68,7 +68,7 @@
   import { downloadDataFromAPI } from '@/utils/dataProcessor';
 
   // 产品号输入框数据
-  const productNo = ref('');
+  const productNo = ref('YH07202507000005');
   
   const backPressOptions = reactive({
     from: 'backbutton'
@@ -90,6 +90,7 @@
     workorder : string,
     invname : string,
     productno : string,
+    graphid : string,
     cardno : string,
     processno : string,
     updatetime : string,

BIN
static/db/QT800.db


+ 3 - 1
utils/dataProcessor.uts

@@ -31,6 +31,7 @@ export type MediaRecordData = {
 	photoitem ?: string;
 	part ?: string;
 	partno ?: string;
+	pk : string;
 	descb ?: string;
 	num ?: number;
 	urlspl ?: string;
@@ -138,6 +139,7 @@ export const downloadDataFromAPI = async (productCode: string, callback ?: () =>
                             const photoitem = record.photoitem;
                             const part = record.part;
                             const partno = record.partno;
+							const pk = record.pk;
                             const descb = record.descb;
                             const num = record.num;
                             const urlspl = record.urlspl;
@@ -149,7 +151,7 @@ export const downloadDataFromAPI = async (productCode: string, callback ?: () =>
                             const updateuser = record.updateuser;
 
                             // 使用三目运算符判断,当值为null时直接插入null,否则用单引号括起来
-                            var values = `${senum === null ? '1' : `'${senum}'`}, ${photoitem === null ? 'null' : `'${photoitem}'`}, ${data?.['productcode'] === null ? 'null' : `'${data?.['productcode']}'`},${part === null ? 'null' : `'${part}'`},${partno === null ? 'null' : `'${partno}'`},${descb === null ? 'null' : `'${descb}'`},${num === null ? 0 : num},1,'', ${urlspl === null ? 'null' : `'${urlspl}'`},${imgname === null ? 'null' : `'${imgname}'`},${urlpdt === null ? 'null' : `'${urlpdt}'`}, ${createtime === null ? 'null' : `'${createtime}'`}, ${createuser === null ? 'null' : `'${createuser}'`}, ${updatetime === null ? 'null' : `'${updatetime}'`}, ${updateuser === null ? 'null' : `'${updateuser}'`}, ${lastId === null ? 0 : lastId}`;
+                            var values = `${senum === null ? '1' : `'${senum}'`}, ${photoitem === null ? 'null' : `'${photoitem}'`}, ${data?.['productcode'] === null ? 'null' : `'${data?.['productcode']}'`},${part === null ? 'null' : `'${part}'`},${partno === null ? 'null' : `'${partno}'`},${pk === null ? 'null' : `'${pk}'`},${descb === null ? 'null' : `'${descb}'`},${num === null ? 0 : num},1,'', ${urlspl === null ? 'null' : `'${urlspl}'`},${imgname === null ? 'null' : `'${imgname}'`},${urlpdt === null ? 'null' : `'${urlpdt}'`}, ${createtime === null ? 'null' : `'${createtime}'`}, ${createuser === null ? 'null' : `'${createuser}'`}, ${updatetime === null ? 'null' : `'${updatetime}'`}, ${updateuser === null ? 'null' : `'${updateuser}'`}, ${lastId === null ? 0 : lastId}`;
                             saveMediaRecord(values);
                           }
                           // 延迟显示完成提示,确保所有数据保存完成