From 5cc7ea9822c4e2fab38d587dfe7f1b224187959c Mon Sep 17 00:00:00 2001
From: clll <1320612696@qq.com>
Date: 星期五, 03 十一月 2023 17:05:17 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

---
 CanadaMes-ui/src/views/home/index.vue |  353 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 342 insertions(+), 11 deletions(-)

diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index ec6e292..8b8aa91 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -194,8 +194,8 @@
                 </div>
             </div>
             <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
-                <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid"></el-input>
-                <el-button type="primary" @click="showform(1)">{{ $t('Infeed barcodid') }}</el-button>
+                <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid1"></el-input>
+                <el-button type="primary" @click="SelectGlassByGlassIDs(2)">{{ $t('Infeed barcodid') }}</el-button>
                 <el-input style="width:15%;" :placeholder="$t('Enter the order number')" v-model="order"></el-input>
                 <el-button type="warning" @click="showform1();">{{ $t('Exit the glass by order number') }}</el-button>
             </div>
@@ -304,7 +304,6 @@
         </el-footer>
         <el-dialog :visible.sync="dialogFormVisible" :title="$t('Please confirm the glass information')">
             <el-form :model="form" label-width="100px" style="padding-right: 30px">
-
                 <el-form-item :label="$t('Barcodid')">
                     <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid"></el-input>
                     <el-button type="primary" @click="showform(3)">{{ $t('Query') }}</el-button>
@@ -334,6 +333,110 @@
                 </span>
             </template>
         </el-dialog>
+
+        <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: space-around;">
+                    <el-form-item>
+                        <label for="">{{ $t('Upper film position') }}</label>
+                        <label for="">{{ $t('Scan Code Point') }}</label>
+                    </el-form-item>
+                </div>
+                <div style="display: flex;justify-content: space-around;height: 40px;">
+                    <label for="">{{ $t('current Information') }}</label>
+                    <label for="">{{ $t('Modify Information') }}</label>
+                    <label for="">{{ $t('current Information') }}</label>
+                    <label for="">{{ $t('Modify Information') }}</label>
+                </div>
+                <div style="display: flex;justify-content: space-around;">
+                    <el-form-item>
+                        <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass lD')"
+                            v-model="glassid2"></el-input>
+                        <el-button type="primary" @click="SelectGlassByGlassIDs(1)" :disabled="disabled">{{ $t('Query')
+                        }}</el-button>
+                    </el-form-item>
+                    <el-form-item>
+                        <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass lD')"
+                            v-model="glassid1"></el-input>
+                        <el-button type="primary" @click="SelectGlassByGlassIDs(2)" :disabled="disabled">{{ $t('Query')
+                        }}</el-button>
+                    </el-form-item>
+                </div>
+                <div style="display: flex;justify-content: space-around;">
+                    <el-form-item :label="$t('Barcodid')">
+                        <el-input v-model="form2.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>
+                    <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="form5.glassId" readonly autocomplete="off" />
+                    </el-form-item>
+                </div>
+                <div style="display: flex;justify-content: space-around;">
+                    <el-form-item :label="$t('order')">
+                        <el-input v-model="form2.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>
+                    <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="form5.orderId" readonly autocomplete="off" />
+                    </el-form-item>
+                </div>
+                <div style="display: flex;justify-content: space-around;">
+                    <el-form-item :label="$t('length')">
+                        <el-input v-model="form2.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>
+                    <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="form5.height" readonly autocomplete="off" />
+                    </el-form-item>
+                </div>
+                <div style="display: flex;justify-content: space-around;">
+                    <el-form-item :label="$t('width')">
+                        <el-input v-model="form2.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>
+                    <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="form5.width" readonly autocomplete="off" />
+                    </el-form-item>
+                </div>
+                <div style="display: flex;justify-content: space-around;">
+                    <el-button @click="DeleteQueueGlasss(2)" type="primary" :disabled="disabled1">{{ $t('Clear Current')
+                    }}</el-button>
+                    <el-button @click="InsertQueueGlass(2)" type="primary" :disabled="disabled1">
+                        {{ $t('Confirm Modification') }}</el-button>
+                    <el-button @click="DeleteQueueGlasss(1)" type="primary" :disabled="disabled1">{{ $t('Clear Current')
+                    }}</el-button>
+                    <el-button @click="InsertQueueGlass(1)" type="primary" :disabled="disabled1">
+                        {{ $t('Confirm Modification') }}</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="dialogFormVisible1" :title="$t('Please confirm the Ordering Information')">
             <el-form :model="form1" label-width="100px" style="padding-right: 30px">
                 <el-form-item :label="$t('order')">
@@ -387,21 +490,46 @@
         <el-dialog :visible.sync="dialogFormVisible4" :title="$t('OrderInfo')" top="5vh">
             <el-input style="width:15%;" :placeholder="$t('Enter the Order lD')" v-model="orderid"></el-input>
             <el-button type="primary" @click="selectglassinfo()">{{ $t('Query') }}</el-button>
-            <el-table :data="this.GlassInfo" :height="700" border style="width: 100%;overflow: auto;">
-
+            <el-table :data="GlassInfo.slice((currentPage - 1) * pagesize, currentPage * pagesize)
+                " :height="700" border style="width: 100%;overflow: auto;">
                 <el-table-column prop="glassId" :label="$t('Barcodid')"></el-table-column>
                 <el-table-column prop="orderId" :label="$t('Order Number')"></el-table-column>
                 <el-table-column prop="width" :label="$t('length')"></el-table-column>
                 <el-table-column prop="height" :label="$t('width')"></el-table-column>
             </el-table>
+
+
+            <!-- <el-table :data="tableDatas.slice((currentPage - 1) * pagesize, currentPage * pagesize)
+                " style="width: 100%">
+                <el-table-column label="Date" prop="date"> </el-table-column>
+                <el-table-column label="Name" prop="name"> </el-table-column>
+                <el-table-column label="鎿嶄綔">
+                    <template slot-scope="scope">
+                        <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">Edit</el-button>
+                        <el-button size="mini" type="danger"
+                            @click="handleDelete(scope.$index, scope.row)">Delete</el-button>
+                    </template>
+                </el-table-column>
+            </el-table> -->
+
+            <!-- 琛ㄦ牸鍒嗛〉 -->
+            <!-- pager-count pager-count灞炴�у彲浠ヨ缃渶澶ч〉鐮佹寜閽暟,瓒呭嚭鎶樺彔,榛樿涓�7-->
+            <!-- 娉ㄦ剰锛氳嫢鏁版嵁鏄悗绔帴鍙h繑鍥炵殑鍒欐鏃�:total="pageCount"-->
+            <el-pagination :style="'margin-top:-2px'" @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                :pager-count="7" :current-page="currentPage" :page-sizes="[5, 10, 15, 20]" :page-size="pagesize"
+                layout="total, sizes, prev, pager, next, jumper" :total="GlassInfo.length > 0 ? GlassInfo.length : null"
+                background style="float: right; margin-top: 20px">
+            </el-pagination>
+
+
         </el-dialog>
     </el-container>
 </template>
 <script>
 //: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
+    home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist,
+    SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId, UpdateQueueState, DeleteQueueGlass
 } from "../../api/home";
 
 
@@ -423,6 +551,7 @@
             dialogFormVisible2: false,
             dialogFormVisible3: false,
             dialogFormVisible4: false,
+            dialogFormVisible5: false,
             form: {
                 orderId: "",
                 glassId: "",
@@ -432,6 +561,30 @@
             form1: {
                 order: "NG2210210",
                 number: 800,
+            },
+            form2: {
+                orderId: "",
+                glassId: "",
+                height: "",
+                width: ""
+            },
+            form3: {
+                orderId: "",
+                glassId: "",
+                height: "",
+                width: ""
+            },
+            form4: {
+                orderId: "",
+                glassId: "",
+                height: "",
+                width: ""
+            },
+            form5: {
+                orderId: "",
+                glassId: "",
+                height: "",
+                width: ""
             },
             alarm: [],
             tableData: [],
@@ -445,6 +598,8 @@
             tasklist2: [],
             order: "",
             glassid: "",
+            glassid1: "",
+            glassid2: "",
             url: "../../img/bigcar01.png",
             car1: 145,
             car2: 210,
@@ -458,7 +613,12 @@
             text: "",
             zhuangtai: "",
             orderid: "",
-            GlassInfo: []
+            GlassInfo: [],
+            disabled: false,
+            disabled1: false,
+            currentPage: 1,  //榛樿鍒濆椤�
+            pagesize: 15,    //姣忛〉榛樿鏄剧ず鐨勬暟鎹�
+            pageCount: 0
         };
     },
     created() {
@@ -486,7 +646,6 @@
                 };
                 //  娴忚鍣ㄧ鏀舵秷鎭紝鑾峰緱浠庢湇鍔$鍙戦�佽繃鏉ョ殑鏂囨湰娑堟伅
                 socket.onmessage = function (msg) {
-
                     //console.log("鏀跺埌鏁版嵁====" + msg.data);
                     let obj = JSON.parse(msg.data);
                     if (obj.params != null) {
@@ -504,7 +663,50 @@
                     this.tasklist2 = obj.tasklist2[0];
                     this.alarm = obj.alarmmg[0];
                     this.loadglassheight = obj.loadglassheight;
-                    this.zhuangtai = obj.zhuangtai[0];
+                    if (obj.zhuangtai != null) {
+                        this.zhuangtai = obj.zhuangtai[0];
+                    }
+
+                    // 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];
+                    } else {
+                        this.form2 = {
+                            orderId: "",
+                            glassId: "",
+                            height: "",
+                            width: ""
+                        };
+                    }
+
+                    if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 1) {
+                        this.form3 = obj.form3[0];
+                    } else {
+                        this.form3 = {
+                            orderId: "",
+                            glassId: "",
+                            height: "",
+                            width: ""
+                        };
+                    }
+                    if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 0) {
+                        this.form5 = obj.form3[0];
+                    }
                     //if (obj.dbconnected == "false") {
                     this.text = this.$t('DataBase Connection failed');
                     // }
@@ -632,7 +834,7 @@
                 if (res.data.form != null) {
                     this.form = res.data.form;
                     this.dialogFormVisible = true;
-                    this.$message.success('query was successful');
+                    this.$message.success(this.$t('query was successful'));
                 } else {
                     this.dialogFormVisible = true;
                     this.$message.error(this.$t('There is no such glass'));
@@ -649,6 +851,50 @@
                 };
                 this.dialogFormVisible1 = true;
             }
+        },
+        //鏄剧ず鎵爜浣嶅拰涓婄墖浣�
+        showform3() {
+            this.dialogFormVisible5 = true;
+        },
+        //鑾峰彇鎵爜浣嶅拰涓婄墖浣嶆暟鎹�
+        SelectGlassByGlassIDs(parameter) {
+            this.showform3();
+            if (parameter == 1) {
+                SelectGlassByGlassID(this.glassid2).then(res => {
+                    if (res.data.form != null) {
+                        this.form4 = res.data.form;
+                        this.$message.success(this.$t('query was successful'));
+                    } else {
+                        this.$message.error(this.$t('There is no such glass'));
+                    }
+                    if (this.form4.length > 0) {
+                        if (this.form4.glassId == "") {
+                            this.disabled = false;
+                        } else {
+                            this.disabled = true;
+                        }
+                    }
+
+                });
+            } else {
+                SelectGlassByGlassID(this.glassid1).then(res => {
+                    if (res.data.form != null) {
+                        this.form5 = res.data.form;
+                        this.$message.success(this.$t('query was successful'));
+                    } else {
+                        this.$message.error(this.$t('There is no such glass'));
+                    }
+                    if (this.form5.length > 0) {
+                        if (this.form5.glassId == "") {
+                            this.disabled = false;
+                        } else {
+                            this.disabled = true;
+                        }
+                    }
+
+                });
+            }
+
         },
         selectglassinfo() {
             SelectGlass(this.orderid).then(res => {
@@ -674,6 +920,10 @@
         //鍙栨秷鎿嶄綔鏃跺叧闂〉闈�
         cancel1() {
             this.dialogFormVisible1 = false;
+            this.form1 = {};
+        },
+        cancel3() {
+            this.dialogFormVisible5 = false;
             this.form1 = {};
         },
         //缁撴潫杩�/鍑虹墖浠诲姟
@@ -821,6 +1071,87 @@
                     this.$message.success(this.$t('Operation successful'));
                 }
             });
+        },
+        handleEdit(index, row) {
+            console.log(index, row);
+        },
+        //琛ㄦ牸鍒犻櫎
+        handleDelete(index, row) {
+            console.log(index, row);
+        },
+        //鏀瑰彉姣忛〉瀹圭撼鐨勬暟鎹噺
+        handleSizeChange: function (size) {
+            this.pagesize = size;
+        },
+        //鍒囨崲椤电爜
+        handleCurrentChange: function (currentPage) {
+            this.currentPage = currentPage;
+        },
+        //鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
+        InsertQueueGlass(parameter) {
+            if (parameter == 1 && this.form5.glassId != "") {
+                if (this.form5.glassId != this.form2.glassId) {
+                    InsertQueueGlassId(this.form5.glassId, 1).then(res => {
+                        if (res.data.message == 200) {
+                            this.form5 = {
+                                orderId: "",
+                                glassId: "",
+                                height: "",
+                                width: ""
+                            };
+                            this.$message.success(this.$t('Operation successful'));
+                        }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'));
+                }
+            } else if (parameter == 2 && this.form4.glassId != "") {
+                if (this.form4.glassId != this.form3.glassId) {
+                    InsertQueueGlassId(this.form4.glassId, 2).then(res => {
+                        if (res.data.message == 200) {
+                            this.form4 = {
+                                orderId: "",
+                                glassId: "",
+                                height: "",
+                                width: ""
+                            };
+                            this.$message.success(this.$t('Operation successful'));
+                        }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'));
+                }
+
+
+            }
+        },
+        //娓呴櫎涓婄墖闃熷垪鐜荤拑
+        DeleteQueueGlasss(parameter) {
+            if (parameter == 1) {
+                DeleteQueueGlass(1).then(res => {
+                    if (res.data.message == 200) {
+                        this.$message.success(this.$t('Operation successful'));
+                    }
+                });
+            } else {
+                DeleteQueueGlass(2).then(res => {
+                    if (res.data.message == 200) {
+                        this.$message.success(this.$t('Operation successful'));
+                    }
+                });
+            }
+        },
+        //淇敼鎵爜浣嶇幓鐠冪姸鎬�
+        UpdateQueueStates() {
+            UpdateQueueState().then(res => {
+                if (res.data.message == 200) {
+                    this.$message.success(this.$t('Operation successful'));
+                }
+            });
         }
     }
 }

--
Gitblit v1.8.0