From a06fc9ad238199d601ae86795188151f56fdd3fe Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期三, 27 十一月 2024 15:22:11 +0800
Subject: [PATCH] 修改样品出入库

---
 src/components/tool/file-preview.vue          |   29 ---------
 src/main.js                                   |    4 
 src/components/view/b1-inspect-order-plan.vue |   32 ++++++++++
 src/components/view/b1-sample.vue             |   71 ++++++++++++-----------
 src/components/view/b1-inspection-order.vue   |    4 
 5 files changed, 73 insertions(+), 67 deletions(-)

diff --git a/src/components/tool/file-preview.vue b/src/components/tool/file-preview.vue
index 38ea63e..84c00c0 100644
--- a/src/components/tool/file-preview.vue
+++ b/src/components/tool/file-preview.vue
@@ -67,7 +67,6 @@
 import VueOfficeExcel from '@vue-office/excel'
 //寮曞叆鐩稿叧鏍峰紡
 import '@vue-office/excel/lib/index.css'
-import * as XLSX from "xlsx";
 export default {
   components: {
     VueOfficeDocx,
@@ -156,6 +155,7 @@
             column:[]
           }
           obj.tableData = this.formatCSVToTable(m.content.replaceAll('null',' '))
+          // .replaceAll('MIN','=MIN').replaceAll('MAX','=MAX').replaceAll('AVERAGE','=AVERAGE')
           for (let item in obj.tableData[0]) {
             obj.column.push({
               label: item,
@@ -165,11 +165,6 @@
           return obj
         })
         this.csvList = arr
-        // console.log(333,this.csvList)
-        this.csvList.forEach(m=>{
-          console.log(this.calculateFormulas(m.column,m.tableData))
-          m.tableData = this.calculateFormulas(m.column,m.tableData)
-        })
       }).catch( err => {
         console.log(err)
       })
@@ -210,28 +205,6 @@
         }
       }
       return result
-    },
-    /**
-     * 璁$畻琛ㄦ牸鍏紡
-     *
-     * @param tableHeaders 琛ㄥご鏁版嵁
-     * @param tableData 琛ㄦ牸鏁版嵁
-     */
-    calculateFormulas(tableHeaders,tableData){
-      // 鐢熸垚 Excel Sheet 鏍煎紡
-      const sheetData = [tableHeaders.map(m=>m.label), ...tableData.map((row) => Object.values(row))];
-      const worksheet = XLSX.utils.aoa_to_sheet(sheetData);
-      // 璁$畻鍏紡
-      XLSX.utils.sheet_add_aoa(worksheet, [], { origin: -1 });
-      const newSheetData = XLSX.utils.sheet_to_json(worksheet, { header: 1 });
-      // 鏇存柊琛ㄥご鍜岃〃鏍兼暟鎹�
-      tableData = newSheetData.slice(1).map((row) =>
-        row.reduce((obj, value, index) => {
-          obj[newSheetData[0][index]] = value;
-          return obj;
-        }, {})
-      );
-      return tableData
     },
     resetStyle(){
       const elements = document.querySelectorAll('[style*="pt"]');
diff --git a/src/components/view/b1-inspect-order-plan.vue b/src/components/view/b1-inspect-order-plan.vue
index 644055e..fd3ede4 100644
--- a/src/components/view/b1-inspect-order-plan.vue
+++ b/src/components/view/b1-inspect-order-plan.vue
@@ -421,6 +421,7 @@
         <el-button type="primary" @click="confirmExport" :loading="upLoadExport">纭� 瀹�</el-button>
       </span>
     </el-dialog>
+    <input id="ScanCodeInfo" v-model="codeInfo" @keyup.enter="keyup" style="opacity: 0;height: 0px;margin: 0px;padding: 0px;position: absolute;top: 0;"></input>
   </div>
 </template>
 
@@ -680,6 +681,36 @@
         }
 			}
 		},
+    watch:{
+      qrCodeVisible(newVal){
+        if(newVal){
+            // this.$message.success('鎵爜锛氭墦寮�')
+            this.sampleCode = null
+            let input = document.getElementById('ScanCodeInfo');
+            input.focus();
+            this.startTime = setInterval(()=>{
+                input.focus()
+            },1000)
+        }else{
+            // this.$message.warning('鎵爜锛氬叧闂�')
+            clearInterval(this.startTime)
+        }
+      },
+      exportVisible(newVal){
+        if(newVal){
+            // this.$message.success('鎵爜锛氭墦寮�')
+            this.sampleCode = null
+            let input = document.getElementById('ScanCodeInfo');
+            input.focus();
+            this.startTime = setInterval(()=>{
+                input.focus()
+            },1000)
+        }else{
+            // this.$message.warning('鎵爜锛氬叧闂�')
+            clearInterval(this.startTime)
+        }
+      },
+    },
 		created() {
 			this.getLaboratoryDicts()
 			this.getTypeDicts()
@@ -790,7 +821,6 @@
       keyup(e){
         var code = ''
         try{
-          // console.log(2222,this.codeInfo)
           code = this.codeInfo.substring()
           if(code==null||code==undefined||code==''){
             this.$message.error('璇ヤ簩缁寸爜鏈夎')
diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue
index 7996d58..d320c71 100644
--- a/src/components/view/b1-inspection-order.vue
+++ b/src/components/view/b1-inspection-order.vue
@@ -389,11 +389,11 @@
       <div style="width:100%;height: 400px;overflow-y: auto;" v-loading="loadPint">
         <div class="dia_body">
           <el-checkbox
-          style="margin: 10px 5px;"
+          style="margin: 10px 5px;text-align: left;"
           :indeterminate="isIndeterminate"
           v-model="checkAll"
           @change="handleCheckAllChange">鍏ㄩ��</el-checkbox>
-          <el-checkbox-group @change="changePrintCode()" v-model="checkIndexList">
+          <el-checkbox-group @change="changePrintCode()" v-model="checkIndexList" style="text-align: left;">
             <el-card class="box-card" v-for="(item, i) in qrData" :key="i+'wwwww'" style="margin-bottom: 15px; font-size: 16px !important;">
               <el-checkbox :label="i" :key="i" style="position: relative;top:-10px;left:5px"><br></el-checkbox>
               <div>
diff --git a/src/components/view/b1-sample.vue b/src/components/view/b1-sample.vue
index 1db786b..b2f0a0d 100644
--- a/src/components/view/b1-sample.vue
+++ b/src/components/view/b1-sample.vue
@@ -366,7 +366,7 @@
         <el-button type="primary" @click="confirmShelves" :loading="upLoadShelves">纭� 瀹�</el-button>
       </span>
     </el-dialog>
-    <!-- <input type="password" id="ScanCodeInfo" v-model="codeInfo" @keyup.enter="keyup" style="opacity: 0;height: 0px;margin: 0px;padding: 0px;position: absolute;top: 0;"></input> -->
+    <input  id="ScanCodeInfo0" v-model="codeInfo" @keyup.enter="keyup" style="opacity: 0;height: 0px;margin: 0px;padding: 0px;position: absolute;top: 0;"></input>
   </div>
 </template>
 
@@ -412,39 +412,41 @@
         codeInfo:null,
       }
     },
-    // watch:{
-    //   storageVisible(newVal){
-    //     if(newVal){
-    //         // this.$message.success('鎵爜锛氭墦寮�')
-    //         let input = document.getElementById('ScanCodeInfo');
-    //         input.focus();
-    //         this.startTime = setInterval(()=>{
-    //             input.focus()
-    //         },1000)
-    //     }else{
-    //         // this.$message.warning('鎵爜锛氬叧闂�')
-    //         clearInterval(this.startTime)
-    //     }
-    //   },
-    //   exportVisible(newVal){
-    //     if(newVal){
-    //         // this.$message.success('鎵爜锛氭墦寮�')
-    //         let input = document.getElementById('ScanCodeInfo');
-    //         input.focus();
-    //         this.startTime = setInterval(()=>{
-    //             input.focus()
-    //         },1000)
-    //     }else{
-    //         // this.$message.warning('鎵爜锛氬叧闂�')
-    //         clearInterval(this.startTime)
-    //     }
-    //   },
-    //   isEdit(newVal){
-    //     if(!newVal){
-    //       this.shelves = {}
-    //     }
-    //   }
-    // },
+    watch:{
+      storageVisible(newVal){
+        if(newVal){
+            this.sampleCode = null
+            // this.$message.success('鎵爜锛氭墦寮�')
+            let input = document.getElementById('ScanCodeInfo0');
+            input.focus();
+            this.startTime = setInterval(()=>{
+                input.focus()
+            },1000)
+        }else{
+            // this.$message.warning('鎵爜锛氬叧闂�')
+            clearInterval(this.startTime)
+        }
+      },
+      exportVisible(newVal){
+        if(newVal){
+            // this.$message.success('鎵爜锛氭墦寮�')
+            this.sampleCode = null
+            let input = document.getElementById('ScanCodeInfo0');
+            input.focus();
+            this.startTime = setInterval(()=>{
+                input.focus()
+            },1000)
+        }else{
+            // this.$message.warning('鎵爜锛氬叧闂�')
+            clearInterval(this.startTime)
+        }
+      },
+      isEdit(newVal){
+        if(!newVal){
+          this.shelves = {}
+        }
+      }
+    },
     mounted() {
       this.selectList()
     },
@@ -452,6 +454,7 @@
       keyup(e){
         var code = ''
         try{
+            console.log(2222,this.codeInfo)
             code = this.codeInfo.substring()
             if(code==null||code==undefined||code==''){
                 this.$message.error('璇ヤ簩缁寸爜鏈夎')
diff --git a/src/main.js b/src/main.js
index afa39b8..b6fd273 100644
--- a/src/main.js
+++ b/src/main.js
@@ -21,11 +21,11 @@
 //鏈湴
 // Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
 // const javaApi = 'http://127.0.0.1:8001';
-const javaApi = 'http://172.20.10.5:8001';
+// const javaApi = 'http://172.20.10.5:8001';
 
 // //閫氫俊娴嬭瘯搴�
 // Vue.prototype.LOCATIONVUE = "http://10.1.13.77:8080";
-// const javaApi = 'http://10.1.13.77:8001';
+const javaApi = 'http://10.1.13.77:8001';
 
 // 閫氫俊姝e紡搴�
 // Vue.prototype.LOCATIONVUE = "https://ztwxlims.ztt.cn:7443";

--
Gitblit v1.9.3