From bdb4046a1ed5358a94cc9ce846f2a1ec88e5d5ec Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期二, 18 六月 2024 10:51:57 +0800
Subject: [PATCH] -

---
 jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue |  164 +++++++++++++++++++++++++++---------------------------
 1 files changed, 82 insertions(+), 82 deletions(-)

diff --git a/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue b/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
index 66292a4..68e47eb 100644
--- a/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
@@ -43,34 +43,7 @@
                </el-table-column>
              </el-table>
            </el-col>
-<!--           <el-col :span="14">-->
-<!--             <el-image style="height: 520px;width: 100%" :src="imgSrc"></el-image>-->
-<!--           </el-col>-->
          </el-tab-pane>
-<!--         <el-tab-pane name="second">-->
-<!--           <span slot="label"> <b class="el-icon-date"></b>鐗╂枡BOM</span>-->
-<!--           <el-empty>-->
-<!--             <span slot="description">鏆傛棤鏁版嵁</span>-->
-<!--           </el-empty>-->
-<!--         </el-tab-pane>-->
-<!--         <el-tab-pane name="third">-->
-<!--           <span slot="label"> <b class="el-icon-date"></b>閲囬泦娓呭崟</span>-->
-<!--           <el-empty>-->
-<!--             <span slot="description">鏆傛棤鏁版嵁</span>-->
-<!--           </el-empty>-->
-<!--         </el-tab-pane>-->
-<!--         <el-tab-pane name="fourth">-->
-<!--           <span slot="label"> <b class="el-icon-date"></b>瀹夌伅鐘舵��</span>-->
-<!--           <el-empty>-->
-<!--             <span slot="description">鏆傛棤鏁版嵁</span>-->
-<!--           </el-empty>-->
-<!--         </el-tab-pane>-->
-<!--         <el-tab-pane name="fifth">-->
-<!--           <span slot="label"> <b class="el-icon-date"></b>宸ヨ壓閰嶆柟</span>-->
-<!--           <el-empty>-->
-<!--             <span slot="description">鏆傛棤鏁版嵁</span>-->
-<!--           </el-empty>-->
-<!--         </el-tab-pane>-->
        </el-tabs>
      </el-col>
    </el-row>
@@ -214,26 +187,24 @@
   </div>
 </template>
 <script>
-import {listWorkReport} from "@/api/main/om/workReport/workReport";
-import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
+import {getIpv4, listStationConf} from "@/api/main/sc/stationConf";
 import {
-  listFormulaChild,
+  checkMaterialCode,
+  clearWorkpieceRelease,
+  fistSetpNumber,
   noPageListFormulaChild,
-  releaseCheck,
-  updateResults,
-  updateTighteningFormula,
-  workpieceRelease, yzUpdateResults, yzUpdateTighteningFormula
+  workpieceRelease,
+  yzUpdateResults,
+  yzUpdateTighteningFormula
 } 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";
 import {addPassingStationCollection} from "@/api/main/da/passingStationCollection/passingStationCollection";
 import {
-  addBasicParameters,
-  addParamCollection,
   addTighteningParameters,
-  saveCampaignTimeParameters,
   replaceAssemblyCode,
+  saveCampaignTimeParameters,
+  yzAddBasicParameters,
 } from "@/api/main/da/paramCollection/paramCollection";
 
 export default {
@@ -288,7 +259,7 @@
       },
       content: '',
       activeName: 'first',
-      url: "ws://192.168.2.248:8080/websocket/message/",
+      url: "ws://192.168.2.76:8080/websocket/message/",
       message: "",
       text_content: "",
       ws: null,
@@ -356,19 +327,6 @@
     serialLink() {
       this.open1 = true
     },
-    bindYzSfc(){
-      if(this.headContent.sfcCode!==""&&this.headContent.yzSfcCode!==""){
-        let param = {
-          sfcCode: this.headContent.sfcCode,
-          locationCode: this.headContent.processesCode,
-          yzSfcCode: this.headContent.yzSfcCode
-        }
-        this.$message('鍙互缁戝畾锛�');
-        replaceAssemblyCode(param).then(response => {
-
-        });
-      }
-    },
     Release(){
       // this.$message('portsList锛�'+this.portsList.length);
       if(this.btnType === "danger"){
@@ -408,6 +366,25 @@
       console.log(this.formulaChildParams)
       noPageListFormulaChild(this.formulaChildParams).then(response => {
         this.formulaChildList = response.rows;
+        if (this.formulaChildList.length >0){
+          let pos = 0
+          const tempArr = this.formulaChildList.filter(x=> 'OK' === x.results)
+          if (tempArr.length>0){
+            pos = tempArr.length
+            this.$nextTick(() => {
+              let temp33 = document.getElementsByClassName('el-table__row')
+              console.log('temp33',temp33)
+              console.log('len',temp33.item(pos))
+              if (temp33.length > 0){
+                console.log('1111111111111111')
+                let arr = temp33[pos-1]
+                console.log('srr',arr)
+                arr.scrollIntoView({ block: 'center' })
+              }
+            })
+          }
+
+        }
       });
     },
     endClear(){
@@ -417,8 +394,14 @@
       console.log(tab, event);
     },
     clearClick(){
-      this.$message('杩欐槸涓�鏉℃竻闄ゆ秷鎭彁绀�');
-      this.headContent.sfcCode = null
+      const param = {
+        productCode: '1P102S',
+        locationCode: this.headContent.processesCode,
+      }
+      clearWorkpieceRelease(param).then(response => {});
+      this.headContent.sfcCode = ''
+      this.formulaChildList = [];
+      this.$message('娓呴櫎鎴愬姛锛�');
     },
     scanCompleted(){
       this.$message('鎵爜瀹屾垚'+this.content);
@@ -432,24 +415,28 @@
     },
     /** 鏌ヨ宸ュ崟鍒楄〃 */
     async getList() {
+      const param = {
+        processesCode: this.headContent.processesCode,
+      }
+      fistSetpNumber(param).then(response => {});
       this.getListFormulaChild()
-      // this.addOverStationCollection()
+      this.addOverStationCollection()
     },
 
     /** 鍏ョ珯澧炲姞杩囩珯閲囬泦璁板綍 **/
     addOverStationCollection(){
       this.passingStationForm = {
         id: null,
-        workOrderNo: this.workpieceInformation.workOrderNo,
-        productCode: this.workpieceInformation.productCode,
+        // workOrderNo: this.workpieceInformation.workOrderNo,
+        productCode: "1P102S",
         locationCode: this.headContent.processesCode,
-        model: this.workpieceInformation.productModel,
+        // model: this.workpieceInformation.productModel,
         productBarcode: this.headContent.sfcCode,
         sfcCode: this.headContent.sfcCode,
         inboundTime: new Date()
       }
       addPassingStationCollection(this.passingStationForm).then(response => {});
-      addBasicParameters(this.passingStationForm).then(response => {});
+      yzAddBasicParameters(this.passingStationForm).then(response => {});
     },
     exit() {
       if (this.ws) {
@@ -535,33 +522,46 @@
           const param = {
             tightenTheArray: event.data,
             paramCode: formulaChilds.paramCode,
-            workOrderNo: self.workpieceInformation.workOrderNo,
-            productCode: self.workpieceInformation.productCode,
+            // workOrderNo: self.workpieceInformation.workOrderNo,
+            productCode: "1P102S",
             locationCode: self.headContent.processesCode,
             productBarcode: self.headContent.sfcCode,
           }
-          addTighteningParameters(param).then(response => {});
-          yzUpdateTighteningFormula(param).then(response => {
-          //   self.getListFormulaChild()
-          // }).catch(error =>{
-          //   self.getListFormulaChild()
-            console.log(response.msg)
-            if(response.msg === "1"){
-                self.getListFormulaChild()
-
-            }else {
-              const param = {
-                workOrderNo: self.workpieceInformation.workOrderNo,
-                productCode: "1P102S",
-                locationCode: self.headContent.processesCode,
-                productBarcode: self.headContent.sfcCode,
-              }
-              saveCampaignTimeParameters(param).then(response => {});
-              workpieceRelease(param).then(response => {});
-              self.formulaChildList = [];
-              self.headContent.sfcCode = '';
+          if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){
+            self.$message('鏈壘鍒板弬鏁扮爜锛岃妫�鏌ュ弬鏁扮爜鏄惁姝g‘');
+            return;
+          }
+          if(self.headContent.sfcCode === null||self.headContent.sfcCode ===''){
+            self.$message('鏈壘鍒版�绘垚鐮侊紝璇峰厛鎵爜锛�');
+            return;
+          }
+          checkMaterialCode(param).then(response => {
+            if(response.msg === "2"){
+              self.$message('鏈壂鎻忕墿鏂欑爜瀹屾瘯锛�');
+              return;
             }
           });
+
+          yzUpdateTighteningFormula(param).then(response => {
+          console.log(response)
+          if(response.msg === "1" || response.msg === "3"){
+              self.getListFormulaChild()
+          }else {
+            const param = {
+              workOrderNo: self.workpieceInformation.workOrderNo,
+              productCode: "1P102S",
+              locationCode: self.headContent.processesCode,
+              productBarcode: self.headContent.sfcCode,
+            }
+            saveCampaignTimeParameters(param).then(response => {});
+            workpieceRelease(param).then(response => {});
+            self.formulaChildList = [];
+            self.headContent.sfcCode = '';
+          }
+        });
+        addTighteningParameters(param).then(response => {});
+        // self.getListFormulaChild()
+
         }
       };
     },
@@ -576,7 +576,7 @@
         console.log("涓插彛鏀跺埌鏁版嵁-------------------"+scanValue)
 
         if(this.headContent.sfcCode !== ''){
-          this.$message('鎵弿鐗╂枡缂栫爜'+scanValue);
+          this.$message('棰勮宸ヤ綅鎵弿鐗╂枡缂栫爜'+scanValue);
           console.log(scanValue)
           this.serialPortMethod(scanValue)
         } else {

--
Gitblit v1.9.3