From 4e83fa344f6cba81412fb354e7f32a88a8f34fde Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期二, 09 七月 2024 09:39:11 +0800
Subject: [PATCH] -切换大模组代码更改

---
 jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue |  156 +++++++++++++++++++++++++++++++++++----------------
 1 files changed, 107 insertions(+), 49 deletions(-)

diff --git a/jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue b/jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue
index 243a025..87359ce 100644
--- a/jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/heatingFilmTerminal/index.vue
@@ -9,11 +9,13 @@
      <el-col :span="7">
        <el-card shadow="never">
          <span class="head-font">宸ヤ綅鍚嶇О : {{headContent.processesName}}</span>
+<!--         <el-button type="primary" style="float: right" icon="el-icon-search" size="mini" @click="serialLink">涓插彛杩炴帴</el-button>-->
+<!--         <el-button @click="clearClick" style="float: right" type="danger" size="mini">娓呴櫎</el-button>-->
        </el-card>
      </el-col>
      <el-col :span="10">
        <el-card shadow="never">
-         <span class="head-font">浜у搧搴忓垪鍙� : {{headContent.sfcCode}}</span>
+         <span class="head-font">妯$粍鐮� : {{headContent.module}}</span>
 <!--         <el-input v-model="content" style="float: right;width: 150px;" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>-->
 <!--         <el-button @click="scanCompleted" style="float: right" type="primary">鎵爜瀹屾垚</el-button>-->
          <el-button type="primary" style="float: right" icon="el-icon-search" size="mini" @click="serialLink">涓插彛杩炴帴</el-button>
@@ -29,6 +31,12 @@
            <i class="el-icon-tickets"></i>
            <span style="font-weight: bold">褰撳墠宸ヤ綅淇℃伅</span>
          </div>
+         <el-descriptions :column="1" border :content-style="{'min-width': '140px'}">
+           <el-descriptions-item label="寮�濮嬫椂闂�">
+             <span>{{workpieceInformation.inboundTime}}</span>
+           </el-descriptions-item>
+         </el-descriptions>
+         <el-divider></el-divider>
          <el-row>
            <el-col :span="12">
              <el-button class="circle-button" :class="cakeLamp.plcState ? 'circle-green-animate':'circle-red'" circle></el-button>
@@ -65,13 +73,6 @@
              <span>&nbsp;鍏佽鏀捐</span>
            </el-col>
 
-         </el-row>
-         <el-divider></el-divider>
-         <el-row style="margin-top: 20px">
-           <span style="width: 130px;" class="head-font">妯$粍鐮丄 : {{headContent.moduleA}}</span>
-         </el-row>
-         <el-row style="margin-top: 20px">
-           <span style="width: 130px;" class="head-font">妯$粍鐮丅 : {{headContent.moduleB}}</span>
          </el-row>
        </el-card>
 
@@ -243,7 +244,8 @@
 import {listWorkReport} from "@/api/main/om/workReport/workReport";
 import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
 import {
-  jrmUpdateResults,
+  clearWorkpieceRelease,
+  jrmUpdateResults, jrmWorkpieceRelease,
   listFormulaChild,
   noPageListFormulaChild,
   releaseCheck,
@@ -268,7 +270,7 @@
   addParamCollection,
   addTighteningParameters,
   saveCampaignTimeParameters,
-  replaceAssemblyCode,
+  replaceAssemblyCode, jrmSaveCampaignTimeParameters,
 } from "@/api/main/da/paramCollection/paramCollection";
 
 export default {
@@ -297,15 +299,15 @@
         sfcCode: '',
         yzSfcCode: '',
         cardCode: '',
-        moduleA: '',
-        moduleB: '',
+        module: '',
+        // moduleB: '',
       },
       workpieceInformation: {
         workOrderNo: null,
         productCode: null,
         productModel: null,
         productName: null,
-        beat: null,
+        inboundTime: null,
       },
       // 鏌ヨ鍙傛暟
       queryParams: {
@@ -329,7 +331,8 @@
       },
       content: '',
       activeName: 'first',
-      url: "ws://192.168.2.76:8080/websocket/message/",
+      url: "ws://10.103.210.248:8080/websocket/message/",
+      // url: "ws://192.168.2.76:8080/websocket/message/",
       message: "",
       text_content: "",
       ws: null,
@@ -407,19 +410,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"){
@@ -433,9 +423,9 @@
     serialPortMethod(value){
       let formulaChildParams = {
         scanBarcode: value,
-        sfcBarcode: this.headContent.moduleA+','+this.headContent.moduleB,
+        sfcBarcode: this.headContent.module,
         // workOrderNo: this.workpieceInformation.workOrderNo,
-        productCode: '1P102S',
+        productCode: 'PE01B',
         locationCode: this.headContent.processesCode,
         collectionTime: new Date()
       }
@@ -455,14 +445,59 @@
       }
       return '';
     },
+    getCurrentTime() {
+      const now = new Date();
+      const year = now.getFullYear();
+      const month = this.padTimeUnit(now.getMonth() + 1); // 鏈堜唤鏄粠0寮�濮嬬殑
+      const day = this.padTimeUnit(now.getDate());
+      const hours = this.padTimeUnit(now.getHours());
+      const minutes = this.padTimeUnit(now.getMinutes());
+      const seconds = this.padTimeUnit(now.getSeconds());
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+    },
+    padTimeUnit(value) {
+      return value.toString().padStart(2, '0');
+    },
+    getElement() {
+      let temp33 = document.getElementsByClassName('el-table__row')
+      console.log('temp33',temp33)
+      console.log('len',temp33.item(12))
+      if (temp33.length > 0){
+        console.log('1111111111111111')
+        let arr = temp33[12]
+        console.log('srr',arr)
+        arr.scrollIntoView({ block: 'center' })
+      }
+    },
     /** 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛� */
     getListFormulaChild() {
+      console.log('getListFormulaChild')
       // this.formulaChildList = []
-      this.formulaChildParams.productCode = '1P102S'
+      this.formulaChildParams.productCode = 'PE01B'
       this.formulaChildParams.processesCode = this.headContent.processesCode
       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(){
@@ -477,13 +512,25 @@
       this.workpieceInformation.productModel = null;
       this.workpieceInformation.productName = null;
       this.headContent.sfcCode = '';
+      this.workpieceInformation.inboundTime = null;
+      this.headContent.module = '';
     },
     changeMenu(tab, event) {
       console.log(tab, event);
     },
     clearClick(){
+      const param = {
+        productCode: "PE01B",
+        locationCode: this.headContent.processesCode,
+      }
+      // jrmSaveCampaignTimeParameters(param).then(response => {});
+      // this.cakeLamp.release = 1;
+      this.endClear()
+      clearWorkpieceRelease(param).then(response => {});
+      // workpieceRelease(param).then(response => {});
+      // jrmWorkpieceRelease(param).then(response => {});
       this.$message('杩欐槸涓�鏉℃竻闄ゆ秷鎭彁绀�');
-      this.headContent.sfcCode = null
+      // this.headContent.sfcCode = null
     },
     scanCompleted(){
       this.$message('鎵爜瀹屾垚'+this.content);
@@ -497,12 +544,14 @@
     },
     /** 鏌ヨ宸ュ崟鍒楄〃 */
     async getList() {
+      this.workpieceInformation.inboundTime = this.getCurrentTime()
       this.getListFormulaChild()
-      this.addOverStationCollection()
+      // this.addOverStationCollection()
     },
 
     /** 鍏ョ珯澧炲姞杩囩珯閲囬泦璁板綍 **/
     addOverStationCollection(){
+      console.log('addOverStationCollection')
       this.passingStationForm = {
         id: null,
         // workOrderNo: this.workpieceInformation.workOrderNo,
@@ -510,10 +559,9 @@
         locationCode: this.headContent.processesCode,
         // model: this.workpieceInformation.productModel,
         // productBarcode: this.headContent.sfcCode,
-        sfcCode: this.headContent.moduleA+','+this.headContent.moduleB,
+        sfcCode: this.headContent.module,
         inboundTime: new Date()
       }
-      // addPassingStationCollection(this.passingStationForm).then(response => {});
       jrmAddPassingStationCollection(this.passingStationForm).then(response => {});
       // addBasicParameters(this.passingStationForm).then(response => {});
     },
@@ -569,16 +617,29 @@
         } else if (event.data === "OUT") {
           self.cakeLamp.release = 1;
         } else if (event.data === "END") {
-          const param = {
-            workOrderNo: self.workpieceInformation.workOrderNo,
-            productCode: self.workpieceInformation.productCode,
-            locationCode: self.headContent.processesCode,
-            productBarcode: self.headContent.sfcCode,
+          const formulaChildIndex = self.formulaChildList.length-1
+
+          if(self.headContent.module=== ''||self.headContent.module=== null){
+            self.$message.error('妯$粍鐮佷负绌猴紝璇锋壂鐮侊紒')
+            return;
           }
-          saveCampaignTimeParameters(param).then(response => {});
+
+          if(self.formulaChildList[formulaChildIndex].results !== 'OK'){
+            self.$message('鏈仛瀹屽伐搴忕姝㈡斁琛�');
+            return;
+          }
+
+          const param = {
+            productCode: "PE01B",
+            locationCode: self.headContent.processesCode,
+            productBarcode: self.headContent.module,
+            inboundTime: self.workpieceInformation.inboundTime
+          }
+          jrmSaveCampaignTimeParameters(param).then(response => {});
           self.cakeLamp.release = 1;
           self.endClear()
-          workpieceRelease(param).then(response => {});
+          // workpieceRelease(param).then(response => {});
+          jrmWorkpieceRelease(param).then(response => {});
         } else if (event.data.includes("[")) {
           let formulaChilds = "";
           self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort);
@@ -595,8 +656,8 @@
           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,
           }
@@ -619,17 +680,14 @@
         const scanValue = this.myserialport.hex2atostr(value).replace(/[\r\n]/g, '');
         console.log("涓插彛鏀跺埌鏁版嵁-------------------"+scanValue)
 
-        if(this.headContent.moduleA !== '' && this.headContent.moduleB !== '' ){
+        if(this.headContent.module !== ''){
           this.serialPortMethod(scanValue)
         } else {
-          if(scanValue.includes("9900168135")){
-            this.headContent.moduleA = scanValue;
-          }
           if(scanValue.includes("9900168136")){
-            this.headContent.moduleB = scanValue;
+            this.headContent.module = scanValue;
             this.$message('鎵爜璇嗗埆浜у搧搴忓垪鍙�'+scanValue);
             this.getList()
-            this.cakeLamp.InPlace = 1
+            // this.cakeLamp.InPlace = 1
             this.cakeLamp.scanFinish = 1
             this.cakeLamp.startWork = 1
           }

--
Gitblit v1.9.3