From 94e971bad93246e5e6730d3a8bb009a7d0595a5e Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期一, 11 九月 2023 17:32:47 +0800
Subject: [PATCH] 系统主界面添加点击理片笼显示玻璃信息,进行玻璃,出片操作

---
 CanadaMes-ui/src/views/home/index.vue |  104 +++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 70 insertions(+), 34 deletions(-)

diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index 6695ee4..4fcd763 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -150,7 +150,6 @@
                     </label>
                 </div>
             </div>
-
             <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
                 <el-input style="width:15%;" placeholder="Enter the glass lD" v-model="glassid"></el-input>
                 <el-button type="primary" @click="showform()">Manually feed the glass</el-button>
@@ -197,23 +196,23 @@
         <el-footer>
             <div class="blocks" style="position: relative;">
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:328px;">
-                    <div :class="getStatusClass(item.state)" v-for="item in cagelist1" :key="item['date']"></div>
+                    <div :class="getStatusClass(item.state)" v-for="item in cagelist1" :key="item['date']"
+                        @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:885px;">
-                    <div :class="getStatusClass(item.state)" v-for="item in cagelist2" :key="item['date']"></div>
+                    <div :class="getStatusClass(item.state)" v-for="item in cagelist2" :key="item['date']"
+                        @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:154px;left:328px;">
-                    <div :class="getStatusClass(item.state)" v-for="item in cagelist3" :key="item['date']"></div>
+                    <div :class="getStatusClass(item.state)" v-for="item in cagelist3" :key="item['date']"
+                        @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:154px;left:885px;">
-                    <div :class="getStatusClass(item.state)" v-for="item in cagelist4" :key="item['date']"></div>
+                    <div :class="getStatusClass(item.state)" v-for="item in cagelist4" :key="item['date']"
+                        @click="showcageinfo(item['cage'])"></div>
                 </div>
-                <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }">
-
-                </div>
-                <div class="blocks-img" :style="{ left: car2 + 'px', top: '194px' }">
-
-                </div>
+                <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
+                <div class="blocks-img" :style="{ left: car2 + 'px', top: '194px' }"></div>
             </div>
         </el-footer>
         <el-dialog :visible.sync="dialogFormVisible" title="Please confirm the information">
@@ -263,12 +262,31 @@
                 <el-table-column prop="endTime" label="endTime"></el-table-column>
             </el-table>
         </el-dialog>
+        <el-dialog :visible.sync="dialogFormVisible3" title="Ordering Information">
+            <el-table :data="this.cageinfo" border style="width: 100%;height: 700px;overflow: auto;">
+                <el-table-column :width="150" prop="cage" label="the grille number"></el-table-column>
+                <el-table-column prop="cell" label="cell"></el-table-column>
+                <el-table-column prop="tier" label="tier"></el-table-column>
+                <el-table-column prop="glassId" label="glassid"></el-table-column>
+                <el-table-column :width="130" prop="orderId" label="order number"></el-table-column>
+                <el-table-column :width="150" prop="lengthWidth" label="length and width"></el-table-column>
+                <el-table-column prop="coating" label="coating"></el-table-column>
+                <el-table-column :width="150" label="operate">
+                    <template slot-scope='scope'>
+                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
+                            @click="deleteglass(scope.row.glassId, scope.row.state)">delete</el-button>
+                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
+                            @click="outglass(scope.row.glassId,scope.row.state)">out</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </el-dialog>
     </el-container>
 </template>
-  
 <script>
 
-import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo } from "../../api/home";
+import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID } from "../../api/home";
+
 
 import LanguageMixin from '../../lang/LanguageMixin'
 let socket;
@@ -280,6 +298,7 @@
             dialogFormVisible: false,
             dialogFormVisible1: false,
             dialogFormVisible2: false,
+            dialogFormVisible3: false,
             form: {
                 orderno: "NG2210210",
                 length: 800,
@@ -306,7 +325,9 @@
             car1: 150,
             car2: 242,
             incell: "",
-            outcell: ""
+            outcell: "",
+            cageinfo: [],
+            cage: 0
         };
     },
     created() {
@@ -337,9 +358,11 @@
 
                     //console.log("鏀跺埌鏁版嵁====" + msg.data);
                     let obj = JSON.parse(msg.data);
+                    if (obj.params != null) {
+                        this.car1 = 150 + 24.6 * obj.params[0][0];
+                        this.car2 = 242 + 24.6 * obj.params[0][1];
+                    }
 
-                    this.car1 = 150 + 24.6 * obj.params[0][0];
-                    this.car2 = 242 + 24.6 * obj.params[0][1];
                     this.tableData = obj.tableData[0];
                     this.cagelist1 = obj.cagelist1[0];
                     this.cagelist2 = obj.cagelist2[0];
@@ -354,16 +377,11 @@
                         this.outcell = this.tasklist2[0]['cell'];
                     }
                     this.alarm = obj.alarmmg[0];
-                    // for (let a = 0; a <= this.record.params.length - 1; a++) {
-                    //     // this.record.xyData[a] = [this.record.canshu[a], this.record.params[0][a]];
-                    //     // this.record.xyData[a] = { name: this.record.canshu[a], value: this.record.params[0][a] };
 
-                    //     // this.record.xyData[a].value = this.record.params[0][a];
-                    //     this.car1=this.record.params[0][a];
-                    //     console.log(this.record.params[0][a]);
+                    SelectCageInfo(this.cage).then(res => {
+                        this.cageinfo = res.data.cageinfo;
+                    });
 
-
-                    // }
                     this.$forceUpdate();
 
                 }.bind(this);
@@ -496,17 +514,35 @@
                 });
             }
 
-
         },
-        formatDate(timestamp) {
-            const date = new Date(timestamp);
-            const year = date.getFullYear();
-            const month = date.getMonth() + 1;
-            const day = date.getDate();
-            const hours = date.getHours();
-            const minutes = date.getMinutes();
-            const seconds = date.getSeconds();
-            return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+        showcageinfo(cage) {
+            this.cage = cage;
+            SelectCageInfo(cage).then(res => {
+                this.cageinfo = res.data.cageinfo;
+                this.dialogFormVisible3 = true;
+            });
+        },
+        deleteglass(glassid, state) {
+            if (state == 1) {
+                DeleteByGlassID(glassid).then(res=>{
+                    if (res.data.message3 == 200) {
+                        this.$message.success("Operation successful");
+                    }
+                });
+            } else {
+                this.$message.success("No out allowed");
+            }
+        },
+        outglass(glassid,state){
+            if (state == 1) {
+                OutByGlassID(glassid).then(res=>{
+                    if (res.data.message3 == 200) {
+                        this.$message.success("Operation successful");
+                    }
+                });
+            } else {
+                this.$message.success("No out allowed");
+            }
         }
 
     }

--
Gitblit v1.8.0