From 1da9aafdf0d7fe00a6a91483cd4bdd5283dff0e1 Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期二, 19 三月 2024 11:50:40 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/Albania_Mes

---
 Albania_Mes-ui/src/views/home/index.vue |  228 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 205 insertions(+), 23 deletions(-)

diff --git a/Albania_Mes-ui/src/views/home/index.vue b/Albania_Mes-ui/src/views/home/index.vue
index c7de164..fe4231b 100644
--- a/Albania_Mes-ui/src/views/home/index.vue
+++ b/Albania_Mes-ui/src/views/home/index.vue
@@ -237,6 +237,74 @@
     height: 15px;
     position: absolute;
 }
+/*
+
+*/
+#fileinput .container {
+  width: 800px;
+  margin: 0 auto;
+}
+
+#fileinput .header {
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 10px;
+}
+
+#fileinput table {
+  width: 100%;
+  border-collapse: collapse;
+  border: 1px solid;
+}
+
+#fileinput tr,
+#fileinput th,
+#fileinput td {
+  border: 1px solid #000;
+  padding: 5px;
+}
+
+#fileinput button {
+  border: none;
+  padding: 5px;
+  background-color: #00a297;
+  color: #fff;
+  border-radius: 5px;
+  cursor: pointer;
+  margin: 0 5px;
+}
+
+#fileinput tr:nth-child(2n) {
+  background-color: #dcdcdc;
+}
+
+#fileinput .hide {
+  display: none;
+}
+
+#fileinput .c1 {
+  position: fixed;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  background: rgba(0, 0, 0, .5);
+  z-index: 2;
+}
+
+#fileinput .c2 {
+  background-color: white;
+  position: fixed;
+  width: 400px;
+  height: 300px;
+  top: 50%;
+  left: 50%;
+  z-index: 3;
+  margin-top: -150px;
+  margin-left: -200px;
+}
+
+
 </style>
 <template>
     <el-container>
@@ -252,20 +320,21 @@
                 </div>
             </div>
             <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
-                <el-button type="primary" @click="showform(1)" :disabled="SoftEmergencyStopState"
+                <el-button type="primary" @click="showform(1)" :disabled="SoftEmergencyStopState" style="z-index: 999;"
                     :class="SoftEmergencyStopState == true ? 'hide' : ''">
                     {{ $t('Import order') }}</el-button>
-                    
-                <el-button type="primary" @click="showform(2)" :disabled="SoftEmergencyStopState"
+
+                <el-button type="primary" @click="showform(2)" :disabled="SoftEmergencyStopState" style="z-index: 999;"
                     :class="SoftEmergencyStopState == true ? 'hide' : ''">
                     {{ $t('Measure') }}</el-button>
 
-                <el-button type="primary" @click="showform(3)" :disabled="SoftEmergencyStopState"
+                <el-button type="primary" @click="showform(3)" :disabled="SoftEmergencyStopState" style="z-index: 999;"
                     :class="SoftEmergencyStopState == true ? 'hide' : ''">
                     {{ $t('StorageCage') }}</el-button>
-                <el-button type="primary" @click="showform(4)" :disabled="SoftEmergencyStopState"
+                <el-button type="primary" @click="showform(4)" :disabled="SoftEmergencyStopState" style="z-index: 999;"
                     :class="SoftEmergencyStopState == true ? 'hide' : ''">
                     {{ $t('Task queue') }}</el-button>
+
             </div>
             <div style="display: flex;align-items: center;">
                 <div class="blocks" style="position: relative;width: 100%;">
@@ -324,6 +393,60 @@
 
         </el-main>
         <el-dialog :visible.sync="Importorder" :title="$t('Import order')" top="5vh">
+            <!--鏂囦欢瀵煎叆鏁版嵁椤甸潰-->
+            <div id="fileinput" class="container">
+                <div class="header">
+                    <div class="btn">
+                        <button @click="AllAdd">淇濆瓨</button>
+                    </div>
+                    <div class="inp">
+                        <input type="file" id="uploadExcel" multiple @change="Change" />
+                    </div>
+                </div>
+                <table id="table">
+                    <thead>
+                        <tr>
+                            <th>Customer</th>
+                            <th>order</th>
+                            <th>base</th>
+                            <th>height</th>
+                            <th>thickness</th>
+                            <th>films</th>
+                            <th>quantity</th>
+                            <th>tier</th>
+                            <th>matching</th>
+                            <th>glasstype</th>
+                            <th>productname</th>
+                        </tr>
+                    </thead>
+                    <tbody style="text-align: center">
+                        <tr v-for="item in dataList" :key="item.id">
+                            <!-- <td>{{ item[0] }}</td>
+                            <td>{{ item[1] }}</td>
+                            <td>{{ item[2] }}</td>
+                            <td>{{ item[3] }}</td>
+                            <td>{{ item[4] }}</td>
+                            <td>{{ item[5] }}</td>
+                            <td>{{ item[6] }}</td>
+                            <td>{{ item[7] }}</td>
+                            <td>{{ item[8] }}</td>
+                            <td>{{ item[9] }}</td>
+                            <td>{{ item[10] }}</td> -->
+                            <td>{{ item.Customer }}</td>
+                            <td>{{ item.order }}</td>
+                            <td>{{ item.base }}</td>
+                            <td>{{ item.height }}</td>
+                            <td>{{ item.thickness }}</td>
+                            <td>{{ item.films }}</td>
+                            <td>{{ item.quantity }}</td>
+                            <td>{{ item.tier }}</td>
+                            <td>{{ item.matching}}</td>
+                            <td>{{ item.glasstype }}</td>
+                            <td>{{ item.productname }}</td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
         </el-dialog>
 
         <el-dialog :visible.sync="Measure" :title="$t('Measure')" top="5vh"><!--娴嬮噺椤甸潰-->
@@ -331,15 +454,21 @@
             <div>
                 <!--鍔熻兘-->
                 <div>
-                    <button v-on:click="ManualMatching" style="width: 120px;height: 60px;background-color: aquamarine;border: 0px;border-radius: 5px;">浜哄伐鍖归厤</button>
+                    <el-button type="primary" @click="ManualMatching()" :disabled="SoftEmergencyStopState"
+                        style="z-index: 999;">浜哄伐鍖归厤</el-button>
+                    <el-button type="primary" @click="ManualTake()" :disabled="SoftEmergencyStopState"
+                        style="z-index: 999;">浜哄伐鍖归厤</el-button>
                 </div>
                 <!--鏄剧ず-->
-                <div style="width:100%;height: 600px;border: 1px solid black;">
-                    <!--鐜荤拑鍥�-->
-                    <div style="top:0;bottom: 0;left: 0;right: 0;margin: auto;position:absolute;width: 100px;height: 200px;background-color: aqua;line-height: 200px;text-align: center;">
-                        100*200
+                <div style="width:1000px;height: 720px;border: 2px solid #d1d1d1;margin: auto auto;">
+                    <!--鐜荤拑鍥�  #81b337-->
+                    <div :style="'top:10px;bottom: 10px;left: 10px;right: 10px;margin: auto;position:absolute;width:'
+                + (this.LastQueue.glasswidth / 25 * 7) + 'px;height:'
+                + (this.LastQueue.glassheight / 25 * 7) + 'px;line-height: '
+                + (this.LastQueue.glassheight / 25 * 7) + 'px;background-color: #93d2f3;text-align: center;'">
+                        {{ this.LastQueue.glasswidth }}*{{ this.LastQueue.glassheight }}
                     </div>
-                    
+
                 </div>
             </div>
         </el-dialog>
@@ -390,7 +519,7 @@
                 </el-table-column>
                 <el-table-column prop="number" :label="$t('Order No')">
                 </el-table-column>
-                <el-table-column prop="" :label="$t('No Of Cage')">
+                <el-table-column prop="cageno" :label="$t('No Of Cage')">
                 </el-table-column>
                 <el-table-column prop="finishnumber" :label="$t('Finish No')">
                 </el-table-column>
@@ -406,10 +535,14 @@
                 </el-table-column>
                 <el-table-column prop="state" :label="$t('Task State')">
                     <template slot-scope='scope'>
-                        {{ scope.state == 0 ? $t('Start') : $t('Finished') }}
+                        {{ scope.row.state >= 0 ? scope.row.state == 0 ? $t('Start') : $t('Stop') : "" }}
                     </template>
                 </el-table-column>
                 <el-table-column prop="method" :label="$t('Task Method')">
+                    <template slot-scope='scope'>
+                        {{ scope.row.state >= 0 ? scope.row.method == 0 ? $t('Out') : $t('All Out') : "" }}
+                    </template>
+
                 </el-table-column>
                 <el-table-column prop="line" :label="$t('Task Line')">
                 </el-table-column>
@@ -472,13 +605,15 @@
 } from "../../api/home";
 
 
-import LanguageMixin from '../../lang/LanguageMixin'
+import LanguageMixin from '../../lang/LanguageMixin';
+import * as XLSX from "../../../node_modules/xlsx/xlsx.mjs";
 let socket;
 export default {
     name: "Home",
     data() {
         return {
-            tableData1:[],
+            dataList: [],
+            tableData1: [],
             Measuermode: false,
             confirm1: false,
             confirm2: false,
@@ -572,7 +707,8 @@
             DeviceList: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             GlassIdList: [],
             Scanningmethod: true,
-            CurrrentGlassId: ""
+            CurrrentGlassId: "",
+            LastQueue: {}
         };
     },
     created() {
@@ -632,10 +768,10 @@
                     this.cagelist4 = obj.cagelist4[0];
                     this.tasklist2 = obj.StoragTaskeTaskFeed[0];
                     this.tasklist1 = obj.StoragTaskeTaskOut[0];
-                    console.log(this.tasklist1);
                     this.alarm = obj.alarmmg[0];
 
                     this.tableData1 = obj.OrderTask[0];
+                    this.LastQueue = obj.LastQueue[0];
 
 
                     //鏄惁鍏佽鍑虹墖
@@ -725,14 +861,16 @@
         StorageCageAddGlass(index) {
             if (this.Measuermode == true) {
                 StorageCageAddGlass(this.cell, this.StorageCageAddInfo[index]).then(res => {
-                    if (res.data.code == 200) {
+                    if (res.data.message == 200) {
                         this.$message.success(this.$t('Operation successful'));
                     }
                 })
             } else {
                 UpdateQueue(this.StorageCageAddInfo[index]).then(res => {
-                    if (res.data.code == 200) {
+                    if (res.data.message == 200) {
                         this.$message.success(this.$t('Operation successful'));
+                    } else {
+                        this.$message.error(this.$t('Operation failed'));
                     }
                 });
             }
@@ -740,9 +878,8 @@
         },
         //棰嗗彇/鏆傚仠浠诲姟
         ClaimTasks(flowcard, state) {
-            console.log(flowcard, state);
             ClaimTasks(flowcard, state).then(res => {
-                if (res.data.code == 200) {
+                if (res.data.message == 200) {
                     this.$message.success(this.$t('Operation successful'));
                 }
             });
@@ -750,7 +887,7 @@
         //淇敼鍑虹墖鏂瑰紡
         ModeChange(flowcard, method) {
             ModeChange(flowcard, method).then(res => {
-                if (res.data.code == 200) {
+                if (res.data.message == 200) {
                     this.$message.success(this.$t('Operation successful'));
                 }
             });
@@ -850,9 +987,54 @@
         },
         //浜哄伐鍖归厤
         ManualMatching() {
-            console.log(11111111);
+            this.StorageCageAdd = true;
+        },
+        //浜哄伐鎷胯蛋
+        ManualTake() {
+
+        },
+        Change(event) {
+            // 鑾峰彇鍒版枃浠跺す
+            let fileList = event.target.files;
+            // 濡傛灉鏁版嵁涓嶄负绌�
+            if (fileList) {
+                // FileReader鏄竴绉嶅紓姝ユ枃浠惰鍙栨満鍒讹紝缁撳悎input:file鍙互寰堟柟渚跨殑璇诲彇鏈湴鏂囦欢銆�
+                let reader = new FileReader();
+                let file = fileList[0]; //鎷垮埌绗竴鏉℃暟鎹�
+                reader.readAsBinaryString(file)// 灏嗘枃浠朵互浜岃繘鍒跺舰寮忚鍏ラ〉闈�
+                let _this = this //鎶奷ata閲岀殑鏁版嵁璧嬪�肩粰鏂扮殑鍙橀噺
+                // wb:wordbook 宸ヤ綔琛�  
+                reader.addEventListener("load", function (e) {
+                    
+                    var data = e.target.result; //璇诲彇鎴愬姛鍚巖esult涓殑鏁版嵁
+                    var wb = XLSX.read(data, { type: "binary" });  
+                    let sheetName = wb.SheetNames[0]; //鏄幏鍙朣heets涓涓�涓猄heet鐨勫悕瀛�
+                    let sheets = wb.Sheets[sheetName];
+                    let dataList2 = JSON.stringify(XLSX.utils.sheet_to_json(sheets));
+                    let dataList3 = (JSON.parse(dataList2));
+                    _this.dataList = dataList3;//璧嬪��
+                    //console.log(dataList2);  
+                    console.log(dataList3);
+
+                })
+            }
+        },
+        Add() {
+            
+        },
+        Hide() {
+            
+        },
+        AllAdd() {
+            //娣诲姞鏁版嵁杩涘悗鍙�
+            console.log(this.dataList);
+        },
+        del() {
+            
+            this.StorageCageAdd = true;
         }
 
+
     }
 }
 </script>

--
Gitblit v1.8.0