From bc4a9c7700fbda51a57207fd445a02ad21e85911 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期四, 25 一月 2024 08:08:13 +0800
Subject: [PATCH] 自动确认状态下改为从后台直接发送进片任务

---
 CanadaMes-ui/src/views/home/index.vue |  187 ++++++++++++----------------------------------
 1 files changed, 49 insertions(+), 138 deletions(-)

diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index 64b1e31..14792be 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -375,6 +375,17 @@
                 <div class="device" :style="'top: 262px;left: 150px;background-color: ' + ShowDeviceList(8) + ';'">D05</div>
                 <div class="device" :style="'top: 339px;left: 150px;background-color: ' + ShowDeviceList(9) + ';'">D06</div>
 
+                <div class="device" :style="'top: 395px;left: 90px;background-color: ;'">E01</div>
+                <div class="device" :style="'top: 395px;left: 243px;background-color: ;'">E02</div>
+                <div class="device" :style="'top: 395px;left: 395px;background-color: ;'">E03</div>
+                <div class="device" :style="'top: 345px;left: 655px;background-color: ;'">E04</div>
+                <div class="device" :style="'top: 345px;left: 810px;background-color: ;'">E05</div>
+                <div class="device" :style="'top: 345px;left: 960px;background-color: ;'">E06</div>
+
+                <div class="device" :style="'top: 345px;left: 525px;background-color: ;'">J01</div>
+                <div class="device" :style="'top: 345px;left: 1100px;background-color: ;'">F01</div>
+                <div class="device" :style="'top: 275px;left: 1100px;background-color: ;'">G01</div>
+
                 <div class="glass D01" style="top: 39px;left: 1055px;position: absolute;">{{ ShowGlassIdList(0) }}
                     <br />
                     <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.2', 0)">
@@ -405,13 +416,13 @@
 
                 <div class="glass A01" style="top: 315px;left: 289px;position: absolute;">A01.2:{{ ShowGlassIdList(5) }}
                     <br />
-                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.1,5', 5)">
+                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.0', 5)">
                         {{ $t('Clear') }}</el-button>
                 </div>
 
                 <div class="glass A02" style="top: 360px;left: 289px;position: absolute;">A02:{{ ShowGlassIdList(6) }}
                     <br />
-                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.2,6', 6)">
+                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.1', 6)">
                         {{ $t('Clear') }}</el-button>
                 </div>
 
@@ -599,12 +610,6 @@
         <el-dialog :visible.sync="dialogFormVisible5" :title="$t('Please confirm the glass information')">
             <el-form :model="form" label-width="100px" style="padding-right: 30px">
                 <div style="display: flex;justify-content: center;">
-                    <!-- <el-form-item>
-                        <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass barcode')"
-                            v-model="glassid2"></el-input>
-                        <el-button type="primary" @click="SelectGlassByGlassIDs(1)">{{ $t('Query')
-                        }}</el-button>
-                    </el-form-item> -->
                     <el-form-item>
                         {{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}
                         <el-button type="primary" @click="isConfirmState()">
@@ -723,22 +728,11 @@
                     </el-form-item>
                 </div>
                 <div style="display: flex;justify-content: right;">
-                    <!-- <el-button @click="DeleteQueueGlasss(2)" type="primary">{{ $t('Clear Current')
-                    }}</el-button>
-                    <el-button @click="InsertQueueGlass(2)" type="primary" :disabled="disabled">
-                        {{ $t('Confirm') }}</el-button>
-                    <el-button @click="DeleteQueueGlasss(1)" type="primary">{{ $t('Clear Current')
-                    }}</el-button> -->
                     <el-button @click="InsertQueueGlass(1)" style="margin-right: 100px;" type="primary"
                         :disabled="disabled1">
                         {{ $t('Confirm') }}</el-button>
                 </div>
             </el-form>
-            <!-- <template #footer>
-                <span class="dialog-footer">
-                    <el-button @click="cancel3()">{{ $t('cancel') }}</el-button>
-                </span>
-            </template> -->
         </el-dialog>
 
         <el-dialog :visible.sync="dialogFormVisible6" :title="$t('Outing Queue')" top="5vh">
@@ -761,9 +755,6 @@
             <label style="background-color:yellow;font-size: 23px;" for="">
                 {{ isQueueWarning == true ? $t('The cage is disabled') : "" }}
             </label>
-            <!-- <span style="background-color:yellow;">
-                {{ isQueueWarning== true ? $t('The cage is disabled') : $t('The cage is disabled') }}
-            </span> -->
             <div style="display:flex;">
                 <div style="width:70%;">
                     <el-table :data="this.OutSlice" :height="700" :span-method="objectSpanMethod" border
@@ -793,45 +784,12 @@
                                     }}</el-button>
                             </template>
                         </el-table-column>
-                        <!-- <el-table-column :min-width="300" prop="position" :label="$t('Position')" style="font-size: 20px;">
-                    <template slot-scope='scope'>
-                        <div
-                            :style="'width:' + (scope.row.position == 1 ? '300' : '100') + 'px;height:' + (scope.row.position == 1 ? '100' : '200') + 'px;background-Color:gray;margin:0 auto;'">
-                            
-                        </div>
-                    </template>
-                </el-table-column> -->
-                        <!-- <el-table-column prop="position" :label="$t('Flipped')" :min-width="200">
-                    <template slot-scope='scope'>
-                        {{ scope.row.flip == true ? $t('EXTERIQR OUT AND BYPASS TO THE LEFT')
-                            : $t('EXTERIQR OUT AND BYPASS TO THE RIGHT') }}
-                    </template>
-                </el-table-column> -->
 
                         <el-table-column :width="100" :label="$t('Operate')">
                             <template slot-scope='scope'>
-                                <!-- <el-button type="text" size="small" @click="getTopMove(scope.row, scope.$index)"
-                            style="font-size: 15px;"
-                            :disabled="(scope.$index == 0 || isAllowReordering == true || scope.row.state == 1)">
-                            {{ $t('Top') }}
-                        </el-button>
-                        <el-button type="text" size="small" @click="getUpMove(scope.row, scope.$index)"
-                            style="font-size: 15px;"
-                            :disabled="(scope.$index == 0 || isAllowReordering == true || scope.row.state == 1)">
-                            {{ $t('Up') }}
-                        </el-button>
-                        <el-button type="text" size="small" @click="getDownMove(scope.row, scope.$index)"
-                            style="font-size: 15px;"
-                            :disabled="(OutSlice.length - 1 == scope.$index || isAllowReordering == true || scope.row.state == 1)">
-                            {{ $t('Down') }}
-                        </el-button> -->
                                 <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                                     :disabled="isAllowQueue" @click="deleteproductionqueueglass(scope.row.barcode)">{{
                                         $t('Delete') }}</el-button>
-
-                                <!-- <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" :disabled="isAllowQueue"
-                            @click="FrameStateUpdate(scope.row.barcode,scope.row.framestate)">{{
-                            scope.row.framestate == 0 ? $t('Stop') : $t('Start') }}</el-button> -->
                             </template>
                         </el-table-column>
                     </el-table>
@@ -881,7 +839,6 @@
                     </template>
                 </el-table-column>
 
-                <!-- <el-table-column prop="Flip" :label="$t('Flipped')"></el-table-column> -->
                 <el-table-column prop="out_slice.state" :label="$t('In the queue')">
                     <template slot-scope='scope'>
                         {{ scope.row.out_slice != null ? $t('Yes') : $t('No') }}
@@ -893,12 +850,6 @@
                         {{ scope.row.storageCage != null ? $t('Yes') : $t('No') }}
                     </template>
                 </el-table-column>
-                <!-- <el-table-column :width="80" :label="$t('Operate')">
-                    <template slot-scope='scope'>
-                        <el-checkbox label="" :disabled="!(scope.row.storageCage != null && scope.row.out_slice == null)"
-                            :checked="scope.row.isCheck" @change="CheckBoxchange(scope.row.barcode, $event)"></el-checkbox>
-                    </template>
-                </el-table-column> -->
             </el-table>
         </el-dialog>
         <el-dialog :visible.sync="dialogFormCountDown" :title="$t('Approximately resettable time')" top="5vh">
@@ -1019,6 +970,9 @@
     },
     created() {
         this.load();
+
+    },
+    activated() {
         this.init();
     }
     ,
@@ -1045,14 +999,14 @@
                     //console.log("鏀跺埌鏁版嵁====" + msg.data);
                     let obj = JSON.parse(msg.data);
                     if (obj.params != null) {
-                        var zhi1=obj.params[0][0];
-                        var zhi2=obj.params[0][1];
+                        var zhi1 = obj.params[0][0];
+                        var zhi2 = obj.params[0][1];
                         this.car1 = 145 + 8.15 * Math.abs(zhi1 - this.carlist[0]['start']) / Math.abs(this.carlist[0]['end'] - this.carlist[0]['start']) * 100;
                         this.car2 = 210 + 8.15 * Math.abs(zhi2 - this.carlist[1]['start']) / Math.abs(this.carlist[1]['end'] - this.carlist[1]['start']) * 100;
                         // this.car1 = 210 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100;
                         // this.car2 = 300 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100;
                     }
-                    
+
                     this.tableData = obj.tableData[0];
                     this.cagelist1 = obj.cagelist1[0];
                     this.cagelist2 = obj.cagelist2[0];
@@ -1074,11 +1028,11 @@
 
                     //鏌ヨ褰撳墠閾濇淇℃伅
                     this.CurrentFrame = obj.CurrentFrame;
-                    
-                    //鑾峰彇璁惧鐘舵��
-                    // if (obj.DeviceList != null) {
-                    //     this.DeviceList = obj.DeviceList[0];
-                    // }
+
+                    // 鑾峰彇璁惧鐘舵��
+                    if (obj.DeviceList != null) {
+                        this.DeviceList = obj.DeviceList[0];
+                    }
                     //鑾峰彇璁惧涓婄殑鐜荤拑id
                     if (obj.GlassIdList != null) {
                         this.GlassIdList = obj.GlassIdList[0];
@@ -1196,6 +1150,10 @@
                 socket.onerror = function () {
                     console.log("websocket鍙戠敓浜嗛敊璇�");
                 }
+                //璺宠浆椤甸潰鏃跺叧闂璼ocket
+                this.$router.afterEach(function () {
+                    socket.close();
+                });
             }
         },
         load() {
@@ -1248,14 +1206,6 @@
                 this.cagelist3 = res.data.list3;
                 this.cagelist4 = res.data.list4;
             });
-            // //鍔犺浇杩涚墖浠诲姟鏁版嵁
-            // loadtask(this.task1).then(res => {
-            //     this.tasklist1 = res.data.list;
-            // });
-            // //鍔犺浇杩涘嚭鐗囦换鍔℃暟鎹�
-            // loadtask(this.task2).then(res => {
-            //     this.tasklist2 = res.data.list;
-            // });
             //鍔犺浇鎶ヨ淇℃伅
             SelectAlarmmgInfo().then(res => {
                 this.alarm = res.data.alarmmg;
@@ -1296,7 +1246,6 @@
         },
         //鎵嬪姩涓婄墖
         sbumitglassid() {
-            console.log(1111111);
             if (this.form.order != "") {
                 if (this.form.height < 380 || this.form.width < 390 || this.form.height > 1810 || this.form.width > 2760) {
                     this.$message.error(this.$t('The glass size is not within the range'));
@@ -1371,36 +1320,6 @@
         //鑾峰彇鎵爜浣嶅拰涓婄墖浣嶆暟鎹�
         SelectGlassByGlassIDs() {
             this.showform3();
-            // if (parameter == 1) {
-            //     SelectGlassByGlassID(this.glassid2).then(res => {
-            //         if (res.data.form != null) {
-            //             if (res.data.form.glassId != null) {
-            //                 this.form4 = res.data.form;
-            //                 this.$message.success(this.$t('query was successful'));
-            //                 this.Sizerange(this.form4, 2);
-            //             } else {
-            //                 this.$message.error(this.$t('There is no such glass'));
-            //             }
-
-            //         } else {
-            //             this.$message.error(this.$t('There is no such glass'));
-            //         }
-            //     });
-            // } else {
-            //     SelectGlassByGlassID(this.glassid1).then(res => {
-            //         if (res.data.form != null) {
-            //             if (res.data.form.glassId != null) {
-            //                 this.form5 = res.data.form;
-            //                 this.$message.success(this.$t('query was successful'));
-            //                 this.Sizerange(this.form5, 1);
-            //             } else {
-            //                 this.$message.error(this.$t('There is no such glass'));
-            //             }
-            //         } else {
-            //             this.$message.error(this.$t('There is no such glass'));
-            //         }
-            //     });
-            // }
 
         },
         //鏌ヨ瀹㈡埛鐜荤拑淇℃伅
@@ -1426,16 +1345,6 @@
             //鏌ヨ閾濇id瀵瑰簲鐜荤拑淇℃伅
             SelectAluminumFrameInfoById(this.framebarcode).then(res => {
                 this.AluminumFrame = res.data.AluminumFrame;
-                console.log(this.AluminumFrame);
-                // this.AluminumFrame.forEach(item => {
-                //     if (item.storageCage != null && item.out_slice == null) {
-                //         item.isCheck = true;
-                //     } else {
-                //         item.isCheck = false;
-                //     }
-                //     item.Flip = res.data.flip;
-                //     item.FrameNo = this.framebarcode;
-                // });
             });
             this.dialogFormVisible7 = true;
         },
@@ -1632,7 +1541,7 @@
                     DeleteProductionQueueGlass(id).then(res => {
                         if (res.data.message == 200) {
                             this.$message.success(this.$t('Operation successful'));
-                        }else{
+                        } else {
                             this.$message.error(this.$t('This frame has glass that is currently outing'));
                         }
                     });
@@ -1668,17 +1577,19 @@
         InsertQueueGlass(parameter) {
             if (parameter == 1 && this.form5.glassId != "") {
                 if (this.form5.glassId != this.form2.glassId && this.form5.glassId != this.form3.glassId) {
-                    InsertQueueGlassId(1, this.form5).then(res => {
-                        if (res.data.message == 200) {
-                            this.form5 = {};
-                            this.$message.success(this.$t('Operation successful'));
-                        }
-                        else if (res.data.message == 400) {
-                            this.$message.error(this.$t('The glass size is not within the range'));
-                        } else {
-                            this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
-                        }
-                    });
+                    if (this.dialogFormVisible5 == true) {
+                        InsertQueueGlassId(1, this.form5).then(res => {
+                            if (res.data.message == 200) {
+                                this.form5 = {};
+                                this.$message.success(this.$t('Operation successful'));
+                            }
+                            else if (res.data.message == 400) {
+                                this.$message.error(this.$t('The glass size is not within the range'));
+                            } else {
+                                this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
+                            }
+                        });
+                    }
                 } else {
                     this.$message.error(this.$t('The glass ID already exists in the loading queue'));
                 }
@@ -1854,7 +1765,7 @@
             }
             this.UpdateSequence(Sequence);
         },
-        //淇敼椤哄簭
+        //淇敼鍑虹墖椤哄簭
         UpdateSequence(Sequence) {
             let i = 0;
             this.OutSlice.forEach(item => {
@@ -1969,9 +1880,9 @@
                     } else {
                         this.disabled = false;
                     }
-                    if (position == 3 && this.isConfirm == true && this.D01RequestState == true) {
-                        this.InsertQueueGlass(1);
-                    }
+                    // if (position == 3 && this.isConfirm == true && this.D01RequestState == true && this.dialogFormVisible5 == true) {
+                    //     this.InsertQueueGlass(1);
+                    // }
                 }
             }
         },
@@ -1987,9 +1898,9 @@
                 }
             });
         },
-        //45绉掑浣嶅�掓暟璁℃椂
+        //60绉掑浣嶅�掓暟璁℃椂
         CountDown() {
-            let count = 45;
+            let count = 60;
             let timer = setInterval(
                 () => {
                     if (this.EmergencyStop == true) {
@@ -2094,7 +2005,7 @@
                             type: 'warning'
                         }).then(() => {
                             ClearGlassId(position, this.GlassIdList[num]).then(res => {
-                                if (res.data.message3 == 200) {
+                                if (res.data.message == 200) {
                                     this.$message.success(this.$t('Operation successful'));
                                 } else {
                                     this.$message.success(this.$t('operation failed'));

--
Gitblit v1.8.0