From b773030f37dc06a92bdb80e8af9a408843d5b317 Mon Sep 17 00:00:00 2001
From: 懒羊羊 <15939171744@163.com>
Date: 星期五, 15 三月 2024 16:47:43 +0800
Subject: [PATCH] 操作看板

---
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue |   79 ++++++++++++++++++++-------------------
 1 files changed, 40 insertions(+), 39 deletions(-)

diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index 0f16945..55e2968 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -111,11 +111,11 @@
                </el-table-column>
                <el-table-column label="鎿嶄綔鍐呭" :show-overflow-tooltip='true' align="center" prop="operationSteps">
                </el-table-column>
-               <el-table-column label="浜у搧缂栧彿" width="150" align="center" prop="productCode">
+               <el-table-column label="浜у搧缂栧彿" align="center" prop="productCode">
                </el-table-column>
-               <el-table-column label="閲囬泦鍊�" width="150" align="center" prop="productCode">
+               <el-table-column label="閲囬泦鍊�" align="center" prop="collectData">
                </el-table-column>
-               <el-table-column label="缁撴灉" width="150" align="center" prop="results">
+               <el-table-column label="缁撴灉" align="center" prop="results">
                </el-table-column>
              </el-table>
            </el-col>
@@ -292,7 +292,13 @@
 <script>
 import {listWorkReport} from "@/api/main/om/workReport/workReport";
 import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
-import {listFormulaChild, releaseCheck, updateResults, workpieceRelease} from "@/api/main/bs/formulaChild/formulaChild";
+import {
+  listFormulaChild,
+  releaseCheck,
+  updateResults,
+  updateTighteningFormula,
+  workpieceRelease
+} from "@/api/main/bs/formulaChild/formulaChild";
 import MySerialPort from "@/utils/MySerialPort";
 import USBDevice from "@/utils/usb.json";
 import {listProductionOrde} from "@/api/main/om/productionOrde/productionOrde";
@@ -451,30 +457,28 @@
       // });
     },
     serialPortMethod(value){
-      console.log(value.includes('C'));
-      let formulaChilds = '';
-      console.log(this.formulaChildList)
-      this.formulaChildList.forEach((formulaChild) => {
-        formulaChilds = formulaChild;
-        let operationType = formulaChild.operationType;
-        let results = formulaChild.results;
-        let materialCode = formulaChild.materialCode;
-        if(operationType === '2' && value.includes(materialCode) && (results === '' || results === null || results === 'NG')){
-          return; // 浣跨敤return浠f浛break
-        }
-      });
-      console.log(formulaChilds)
-      // let formulaChildParams = {
-      //   scanBarcode: value,
-      //   sfcBarcode: this.headContent.sfcCode,
-      //   workOrderNo: this.workpieceInformation.workOrderNo,
-      //   productCode: this.workpieceInformation.productCode,
-      //   locationCode: this.headContent.processesCode,
-      //   collectionTime: new Date()
-      // }
-      // updateResults(formulaChildParams).then(response => {
-      //   this.getListFormulaChild()
+      // let formulaChilds = "";
+      // this.formulaChildList.forEach((formulaChild) => {
+      //   let operationType = formulaChild.operationType;
+      //   let results = formulaChild.results;
+      //   let materialCode = formulaChild.materialCode;
+      //   if(operationType === '2' && value.includes(materialCode) && (results === "" || results === null || results === 'NG')){
+      //     formulaChilds = formulaChild;
+      //     return; // 浣跨敤return浠f浛break
+      //   }
       // });
+      // console.log(formulaChilds)
+      let formulaChildParams = {
+        scanBarcode: value,
+        sfcBarcode: this.headContent.sfcCode,
+        workOrderNo: this.workpieceInformation.workOrderNo,
+        productCode: this.workpieceInformation.productCode,
+        locationCode: this.headContent.processesCode,
+        collectionTime: new Date()
+      }
+      updateResults(formulaChildParams).then(response => {
+        this.getListFormulaChild()
+      });
     },
     rowStyle({ row }) {
       if (row.results === 'OK') {
@@ -638,27 +642,21 @@
           this.formulaChildList = [];
           self.getListFormulaChild();
         } else if (event.data.includes("[")) {
+          // console.log('event.data'+event.data)
+          // let eventArr = event.data.split("[")[1].split("]")[0].split(", ");
+          // let eventArr1 = event.data.replace('[', '').replace(']', '').trim().split(', ');
+          // console.log(eventArr1)
+          // console.log(Array.isArray(eventArr))
           let formulaChilds = "";
-          // for(let i=0;i<self.formulaChildList.length;i++){
-          //   formulaChilds = self.formulaChildList[i];
-          //   let operationType = formulaChild.operationType;
-          //   let results = formulaChild.results;
-          //   if(operationType === '1' &&
-          //     (results === '' || results === null ||results === 'NG')){
-          //         break;
-          //   }
-          // }
           self.formulaChildList.forEach((formulaChild) => {
-            formulaChilds = formulaChild;
             let operationType = formulaChild.operationType;
             let results = formulaChild.results;
             if(operationType === '1' && (results === '' || results === null || results === 'NG')){
+              formulaChilds = formulaChild;
               return; // 浣跨敤return浠f浛break
             }
             // 鎵ц鍏朵粬鎿嶄綔
           });
-          console.log(formulaChilds)
-          console.log(formulaChilds.paramCode)
           const param = {
             tightenTheArray: event.data,
             paramCode: formulaChilds.paramCode,
@@ -668,6 +666,9 @@
             productBarcode: self.headContent.sfcCode,
           }
           addTighteningParameters(param).then(response => {});
+          updateTighteningFormula(param).then(response => {
+          });
+          self.getListFormulaChild()
         }
       };
     },

--
Gitblit v1.9.3