Explorar o código

Merge remote-tracking branch 'origin/qingban' into qingban

jxq hai 2 meses
pai
achega
1e24bcd721

+ 7 - 0
src/api/process/index.ts

@@ -140,3 +140,10 @@ export function setLineSortList(params: any) {
     data: params,
   });
 }
+
+export function testData(processId: string,deviceNo: string) {
+  return request({
+    url: `/api/v1/testData/syncSeqNo/get/${processId}/${deviceNo}`,
+    method: "get",
+  });
+}

+ 18 - 3
src/views/pro/traceability/components/testData.vue

@@ -58,6 +58,7 @@ import {
   useDictionaryStore,
   useUserStoreHook,
 } from "@/store";
+import {testData} from "@/api/process/index";
 
 // 数据字典相关
 const { dicts } = useDictionaryStore();
@@ -152,9 +153,23 @@ option.value = Object.assign(option.value, {
 const dialogVisible = ref(false);
 const tableData = ref([]);
 const lookData = (row) => {
-  tableData.value = JSON.parse(row.testData);
-  console.log(tableData.value);
-  dialogVisible.value = true;
+  if(row.testData&&"[]"!==row.testData){
+      tableData.value = JSON.parse(row.testData);
+      console.log(tableData.value);
+      dialogVisible.value = true;
+      return;
+  }
+  testData(row.processId,row.deviceNo).then(
+    (res)=>{
+        if(res.code==='200'){
+            tableData.value = JSON.parse(res.testData);
+            console.log(tableData.value);
+            dialogVisible.value = true;
+        }
+    }
+
+  )
+
 };
 
 const handleDialogCancel = () => {