From 2a693c6842788d1011d69e62af3df6dfd06ecf16 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期五, 19 一月 2024 14:43:50 +0800
Subject: [PATCH] 增加汇报写入判断限制

---
 CanadaMes-ui/src/views/home/index.vue |  156 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 96 insertions(+), 60 deletions(-)

diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index b1e9558..c7eab6f 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -252,7 +252,7 @@
             <div style="display:flex;justify-content: space-around;width: 9zz5%;margin: 0 auto;">
                 <!-- <el-input style="width:15%;" :placeholder="$t('Enter the glass barcode')" v-model="glassid1"
                     :class="ManuallyInfeedGlass == true ? 'hide' : ''"></el-input> -->
-                <el-button type="primary" @click="SelectGlassByGlassIDs(2)" :disabled="ManuallyInfeedGlass"
+                <el-button type="primary" @click="SelectGlassByGlassIDs()" :disabled="ManuallyInfeedGlass"
                     :class="ManuallyInfeedGlass == true ? 'hide' : ''">
                     {{ $t('Manually Infeed Glass') }}</el-button>
                 <el-button type="primary" @click="showform2()" :disabled="OrderInfo"
@@ -375,37 +375,70 @@
                 <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="glass D01" style="top: 54px;left: 1055px;position: absolute;"
-                    @click="ClearGlassId('DB101.9.2', 0)">{{ ShowGlassIdList(0) }}</div>
-                <div class="glass D02" style="top: 132px;left: 1055px;position: absolute;"
-                    @click="ClearGlassId('DB101.9.2', 1)">{{ ShowGlassIdList(1) }}</div>
-                <div class="glass B01" style="top: 270px;left: 640px;position: absolute;"
-                    @click="ClearGlassId('DB101.10.2', 2)">
-                    B01:{{ ShowGlassIdList(2) }}</div>
-                <div class="glass B02" style="top: 290px;left: 640px;position: absolute;"
-                    @click="ClearGlassId('DB101.10.3', 3)">B02:{{ ShowGlassIdList(3) }}</div>
-                <div class="glass A01" style="top: 270px;left: 289px;position: absolute;"
-                    @click="ClearGlassId('DB101.10.0', 4)">
-                    A01.1:{{ ShowGlassIdList(4) }}</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)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
+                <div class="glass D02" style="top: 117px;left: 1055px;position: absolute;">{{ ShowGlassIdList(1) }}
+                    <br />
+                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.2', 1)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
+                <div class="glass B01" style="top: 270px;left: 640px;position: absolute;">
+                    B01:{{ ShowGlassIdList(2) }}
+                    <br />
+                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.2', 2)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
+                <div class="glass B02" style="top: 315px;left: 640px;position: absolute;">B02:{{ ShowGlassIdList(3) }}
+                    <br />
+                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.3', 3)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
+                <div class="glass A01" style="top: 270px;left: 289px;position: absolute;">
+                    A01.1:{{ ShowGlassIdList(4) }}
+                    <br />
+                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.0', 4)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
 
-                <div class="glass A01" style="top: 290px;left: 289px;position: absolute;"
-                    @click="ClearGlassId('DB101.10.1,5')">A01.2:{{ ShowGlassIdList(5) }}</div>
+                <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)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
 
-                <div class="glass A02" style="top: 310px;left: 289px;position: absolute;"
-                    @click="ClearGlassId('DB101.10.2,6')">A02:{{ ShowGlassIdList(6) }}</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)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
 
-                <div class="glass D03" style="top: 137px;left: 42px;position: absolute;"
-                    @click="ClearGlassId('DB101.9.4', 7)">
-                    {{ ShowGlassIdList(7) }}</div>
-                <div class="glass D04" style="top: 213px;left: 42px;position: absolute;"
-                    @click="ClearGlassId('DB101.9.5', 8)">
-                    {{ ShowGlassIdList(8) }}</div>
-                <div class="glass D05" style="top: 290px;left: 42px;position: absolute;"
-                    @click="ClearGlassId('DB101.9.6', 9)">
-                    {{ ShowGlassIdList(9) }}</div>
-                <div class="glass D06" style="top: 367px;left: 42px;position: absolute;"
-                    @click="ClearGlassId('DB101.9.5', 10)">
-                    {{ ShowGlassIdList(10) }}</div>
+                <div class="glass D03" style="top: 122px;left: 42px;position: absolute;">
+                    {{ ShowGlassIdList(7) }}
+                    <br />
+                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.4', 7)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
+                <div class="glass D04" style="top: 198px;left: 42px;position: absolute;">
+                    {{ ShowGlassIdList(8) }}
+                    <br />
+                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.5', 8)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
+                <div class="glass D05" style="top: 275px;left: 42px;position: absolute;">
+                    {{ ShowGlassIdList(9) }}
+                    <br />
+                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.6', 9)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
+                <div class="glass D06" style="top: 352px;left: 42px;position: absolute;">
+                    {{ ShowGlassIdList(10) }}
+                    <br />
+                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.5', 10)">
+                        {{ $t('Clear') }}</el-button>
+                </div>
 
 
             </div>
@@ -573,29 +606,29 @@
                         }}</el-button>
                     </el-form-item> -->
                     <el-form-item>
-                        {{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Not Allow') : $t('Allow') }}
+                        {{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}
                         <el-button type="primary" @click="isConfirmState()">
-                            {{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}</el-button>
+                            {{ this.isConfirm == true ? $t('Not Allow') : $t('Allow') }}</el-button>
                     </el-form-item>
                     <el-form-item>
-                        {{ $t('Current State') }}:{{ this.Scanningmethod==true?$t('Automatic'):$t('Hand Movement')}}
+                        {{ $t('Current State') }}:{{ this.Scanningmethod == false ? $t('Automatic') : $t('Hand Movement') }}
                         <el-button type="primary" @click="SwitchScanMethod()">{{ $t('Switch')
                         }}</el-button>
                     </el-form-item>
                     <el-form-item>
-                        <el-input style="width:70%;" maxlength="14" :placeholder="$t('Enter the glass barcode')"
+                        <el-input style="width:70%;" maxlength="13" :placeholder="$t('Enter the glass barcode')"
                             v-model="glassid1"></el-input>
-                        <el-button type="primary" :disabled="Scanningmethod" @click="WriteGlassID()">{{ $t('Add')
+                        <el-button type="primary" :disabled="!Scanningmethod" @click="WriteGlassID()">{{ $t('Add')
                         }}</el-button>
                     </el-form-item>
                     <el-form-item>
                         {{ $t('Barcode') }}:
-                        <el-input style="width:70%;" maxlength="14" :disabled="true" v-model="glassid1"></el-input>
+                        <el-input style="width:70%;" maxlength="14" :disabled="true" v-model="CurrrentGlassId"></el-input>
                     </el-form-item>
                 </div>
                 <div style="display: flex;justify-content: space-around;">
                     <label for="">{{ $t('Upper film position') }}</label>
-                    
+
                     <label for="">{{ $t('Scan Code Point') }}</label>
                 </div>
                 <div style="display: flex;justify-content: space-around;height: 40px;">
@@ -701,11 +734,11 @@
                         {{ $t('Confirm') }}</el-button>
                 </div>
             </el-form>
-            <template #footer>
+            <!-- <template #footer>
                 <span class="dialog-footer">
                     <el-button @click="cancel3()">{{ $t('cancel') }}</el-button>
                 </span>
-            </template>
+            </template> -->
         </el-dialog>
 
         <el-dialog :visible.sync="dialogFormVisible6" :title="$t('Outing Queue')" top="5vh">
@@ -980,12 +1013,12 @@
             CurrentFrame: [],
             DeviceList: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
             GlassIdList: [],
-            Scanningmethod: true
+            Scanningmethod: true,
+            CurrrentGlassId: ""
         };
     },
     created() {
         this.load();
-
         this.init();
     }
     ,
@@ -1028,12 +1061,13 @@
                     this.alarm = obj.alarmmg[0];
                     //鑾峰彇褰撳墠鎵爜鏂瑰紡
                     if (obj.Scanningmethod != null) {
-                        if (obj.Scanningmethod == 0) {
-                            this.Scanningmethod = true;
-                        }
-                        else {
-                            this.Scanningmethod = false;
-                        }
+                        this.Scanningmethod = obj.Scanningmethod[0];
+                    }
+
+                    //鑾峰彇褰撳墠鎵爜鏋幓鐠僫d
+                    if (obj.CurrrentGlassId != null) {
+                        const specialChars = /[^\w\s]/g;
+                        this.CurrrentGlassId = obj.CurrrentGlassId[0].replace(specialChars, "");
                     }
 
                     //鏌ヨ褰撳墠閾濇淇℃伅
@@ -1120,10 +1154,13 @@
                     } else {
                         this.form3 = {};
                     }
+
                     if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 0) {
                         this.loadglassheight1 = 70;
+                        if (this.form5.glassId != obj.form3[0].glassId) {
+                            this.showform3();
+                        }
                         this.form5 = obj.form3[0];
-                        this.showform3();
                         this.glassid1 = "";
                         if (this.D01RequestState == true) {
                             this.Sizerange(this.form5, 3);
@@ -1256,6 +1293,7 @@
         },
         //鎵嬪姩涓婄墖
         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'));
@@ -1318,17 +1356,17 @@
         },
         //鎵嬪姩鍐欏叆plc鎵爜浣嶇幓鐠僫d
         WriteGlassID() {
-            if (this.glassid1.length ==14) {
+            if (this.glassid1.length == 14) {
                 WriteGlassID(this.glassid1).then(res => {
                     console.log(res.data);
                     this.$message.success(this.$t('Successful operation'));
                 });
-            }else{
+            } else {
                 this.$message.error(this.$t('Please enter the correct glassID'));
             }
         },
         //鑾峰彇鎵爜浣嶅拰涓婄墖浣嶆暟鎹�
-        SelectGlassByGlassIDs(parameter) {
+        SelectGlassByGlassIDs() {
             this.showform3();
             // if (parameter == 1) {
             //     SelectGlassByGlassID(this.glassid2).then(res => {
@@ -1629,6 +1667,9 @@
                         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'));
                         }
@@ -2039,8 +2080,9 @@
         //娓呴櫎鐜荤拑id
         ClearGlassId(position, num) {
             if (this.ClearGlassID == false) {
-                if (this.DeviceList[position] == 0) {
-                    if (this.GlassIdList[num].length == 14) {
+                console.log(this.DeviceList, num);
+                if (this.DeviceList[num] == 0) {
+                    if (this.GlassIdList[num].length <= 14) {
                         this.$confirm(this.$t('Are you sure to clear this barcode ?'), this.$t('confirm'), {
                             confirmButtonText: this.$t('Yes'),
                             cancelButtonText: this.$t('No'),
@@ -2098,14 +2140,8 @@
             });
         },
         //鍒囨崲浜岀淮鐮佽幏鍙栨柟寮�
-        SwitchScanMethod(){
-            var Scanmethod;
-            if(this.Scanningmethod == true){
-                this.Scanmethod = 1;
-            }else{
-                this.Scanmethod = 0;
-            }
-            SwitchScanMethod(Scanmethod).then(res => {
+        SwitchScanMethod() {
+            SwitchScanMethod(!this.Scanningmethod).then(res => {
                 if (res.data.message == 200) {
                     this.$message.success(this.$t('Operation successful'));
                 }

--
Gitblit v1.8.0