From d06205a8e488c1857ff0c02cf3f59fea720688bb Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期一, 30 十月 2023 15:52:13 +0800
Subject: [PATCH] 调整手动确认扫码位信息与上片位玻璃信息显示

---
 CanadaMes-ui/src/views/home/index.vue |  106 +++++++++++++++++++++++++++++------------------------
 1 files changed, 58 insertions(+), 48 deletions(-)

diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index 7012203..3571edc 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -338,12 +338,12 @@
             <el-form :model="form" label-width="100px" style="padding-right: 30px">
                 <el-form-item style="text-align: center;">
                     <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid1"></el-input>
-                    <el-button type="primary" @click="SelectGlassByGlassIDs()">{{ $t('Query') }}</el-button>
+                    <el-button type="primary" @click="SelectGlassByGlassIDs()" :disabled="disabled">{{ $t('Query')
+                    }}</el-button>
                 </el-form-item>
                 <div style="display: flex;justify-content: space-around;height: 40px;">
                     <label for="">{{ $t('Scan Code Point') }}</label>
                     <label for="">{{ $t('Upper film position') }}</label>
-                    <label for="">{{ $t('Glass Information') }}</label>
                 </div>
                 <div style="display: flex;justify-content: space-around;">
                     <el-form-item :label="$t('Barcodid')">
@@ -351,9 +351,6 @@
                     </el-form-item>
                     <el-form-item :label="$t('Barcodid')">
                         <el-input v-model="form3.glassId" readonly autocomplete="off" />
-                    </el-form-item>
-                    <el-form-item :label="$t('Barcodid')">
-                        <el-input v-model="form4.glassId" readonly autocomplete="off" />
                     </el-form-item>
                 </div>
                 <div style="display: flex;justify-content: space-around;">
@@ -363,9 +360,6 @@
                     <el-form-item :label="$t('order')">
                         <el-input v-model="form3.orderId" readonly autocomplete="off" />
                     </el-form-item>
-                    <el-form-item :label="$t('order')">
-                        <el-input v-model="form4.orderId" readonly autocomplete="off" />
-                    </el-form-item>
                 </div>
                 <div style="display: flex;justify-content: space-around;">
                     <el-form-item :label="$t('length')">
@@ -373,9 +367,6 @@
                     </el-form-item>
                     <el-form-item :label="$t('length')">
                         <el-input v-model="form3.height" readonly autocomplete="off" />
-                    </el-form-item>
-                    <el-form-item :label="$t('length')">
-                        <el-input v-model="form4.height" readonly autocomplete="off" />
                     </el-form-item>
                 </div>
                 <div style="display: flex;justify-content: space-around;">
@@ -385,17 +376,12 @@
                     <el-form-item :label="$t('width')">
                         <el-input v-model="form3.width" readonly autocomplete="off" />
                     </el-form-item>
-                    <el-form-item :label="$t('width')">
-                        <el-input v-model="form4.width" readonly autocomplete="off" />
-                    </el-form-item>
                 </div>
 
             </el-form>
             <template #footer>
                 <span class="dialog-footer">
-                    <el-button @click="InsertQueueGlass()" type="primary" :disabled="disabled">{{ $t('confirm')
-                    }}</el-button>
-                    <el-button @click="InsertQueueGlass()" type="primary" :disabled="disabled">{{ $t('confirm')
+                    <el-button @click="InsertQueueGlass()" type="primary" :disabled="disabled1">{{ $t('confirm')
                     }}</el-button>
                     <el-button @click="cancel3()">{{ $t('cancel') }}</el-button>
                 </span>
@@ -494,7 +480,7 @@
 //:disabled="scope.row.glassId > 0 || scope.row.disabled == 1 ? true : false"
 import {
     home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist,
-    SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId
+    SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId, UpdateQueueState
 } from "../../api/home";
 
 
@@ -528,18 +514,12 @@
                 number: 800,
             },
             form2: {
-                orderId: "1145",
-                glassId: "112",
-                height: "59.06",
-                width: "48.03"
+                orderId: "",
+                glassId: "",
+                height: "",
+                width: ""
             },
             form3: {
-                orderId: "1",
-                glassId: "2",
-                height: "3",
-                width: "4"
-            },
-            form4: {
                 orderId: "",
                 glassId: "",
                 height: "",
@@ -576,7 +556,8 @@
             disabled1: true,
             currentPage: 1,  //榛樿鍒濆椤�
             pagesize: 15,    //姣忛〉榛樿鏄剧ず鐨勬暟鎹�
-            pageCount: 0
+            pageCount: 0,
+            state: true
         };
     },
     created() {
@@ -621,16 +602,32 @@
                     this.tasklist2 = obj.tasklist2[0];
                     this.alarm = obj.alarmmg[0];
                     this.loadglassheight = obj.loadglassheight;
-                    this.zhuangtai = obj.zhuangtai[0];
-
-                    this.glassid1 = obj.queid[0];
-                    if (this.glassid1 != "") {
-                        this.disabled1=false;
-                        this.showform3();
+                    if (obj.zhuangtai != null) {
+                        this.zhuangtai = obj.zhuangtai[0];
                     }
-                    this.form2 = obj.form2;
-                    this.form2 = obj.form3;
 
+                    // this.glassid1 = obj.queid[0];
+                    if (obj.queid[0] != "" && obj.queid[0] != null && obj.state[0] == 0) {
+                        this.state = false;
+                        this.disabled = true;
+                        this.disabled1 = false;
+                        this.showform3();
+                    } else if (obj.queid[0] != "" && obj.queid[0] != null && obj.state[0] == 1) {
+                        this.state = true;
+                        this.disabled = true;
+                        this.disabled1 = true;
+                    }
+                    else {
+                        this.state = true;
+                        this.disabled = false;
+                        this.disabled1 = false;
+                    }
+                    if (obj.form2 != null && obj.form2 != "") {
+                        this.form2 = obj.form2[0];
+                    } 
+                    if (obj.form3 != null && obj.form3 != "") {
+                        this.form3 = obj.form3[0];
+                    }
                     //if (obj.dbconnected == "false") {
                     this.text = this.$t('DataBase Connection failed');
                     // }
@@ -777,7 +774,7 @@
             }
         },
         //鏄剧ず鎵爜浣嶅拰涓婄墖浣�
-        showform3(){
+        showform3() {
             this.dialogFormVisible5 = true;
         },
         //鑾峰彇鎵爜浣嶅拰涓婄墖浣嶆暟鎹�
@@ -785,16 +782,19 @@
             this.showform3();
             SelectGlassByGlassID(this.glassid1).then(res => {
                 if (res.data.form != null) {
-                    this.form4 = res.data.form;
+                    this.form2 = res.data.form;
                     this.$message.success(this.$t('query was successful'));
                 } else {
                     this.$message.error(this.$t('There is no such glass'));
                 }
-                if (this.form2.glassId == "") {
-                    this.disabled = false;
-                } else {
-                    this.disabled = true;
+                if (this.form2.length > 0) {
+                    if (this.form2.glassId == "") {
+                        this.disabled = false;
+                    } else {
+                        this.disabled = true;
+                    }
                 }
+
             });
         },
         selectglassinfo() {
@@ -988,12 +988,22 @@
         handleCurrentChange: function (currentPage) {
             this.currentPage = currentPage;
         },
+        //鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
         InsertQueueGlass() {
-            InsertQueueGlassId(this.glassid1).then(res => {
-                if (res.data.message == 200) {
-                    this.$message.success(this.$t('Operation successful'));
-                }
-            });
+            if (this.state == true) {
+                InsertQueueGlassId(this.form2.glassId).then(res => {
+                    if (res.data.message == 200) {
+                        this.$message.success(this.$t('Operation successful'));
+                    }
+                });
+            } else {
+                UpdateQueueState().then(res => {
+                    if (res.data.message == 200) {
+                        this.$message.success(this.$t('Operation successful'));
+                    }
+                });
+            }
+
         }
     }
 }

--
Gitblit v1.8.0