From 9969561611d9261c90728643d8a35287f79b57b9 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 05 十二月 2024 14:47:01 +0800
Subject: [PATCH] 调整标签打印为二维码

---
 src/main.js                                            |    4 
 src/components/do/b1-inspect-order-plan/Inspection.vue |   36 +++++---
 package.json                                           |    1 
 src/components/view/b1-inspect-order-plan.vue          |   46 +++++++++-
 src/components/view/b1-sample.vue                      |   53 ++++++++++--
 src/components/view/b1-inspection-order.vue            |   96 +++++++++++++----------
 6 files changed, 162 insertions(+), 74 deletions(-)

diff --git a/package.json b/package.json
index b630f65..adfde49 100644
--- a/package.json
+++ b/package.json
@@ -49,6 +49,7 @@
     "vue-axios": "^3.2.4",
     "vue-canvas-poster": "^1.2.1",
     "vue-qr": "^3.2.4",
+    "vue-qrcode-reader": "^5.5.11",
     "vue-router": "^3.0.1",
     "vuedraggable": "^2.24.3",
     "wangeditor": "^4.7.15",
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 038c937..b04a320 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -259,7 +259,7 @@
     <el-row class="title">
       <el-col :span="12" style="padding-left: 20px;text-align: left;" :class="{noShow:noBack}">妫�楠屽崟璇︽儏
       </el-col>
-      <el-col :span="12" style="text-align: right;display: flex;align-items: center;justify-content: end;margin-top: 0px;">
+      <el-col :span="12" style="text-align: right;display: flex;align-items: center;justify-content: end;margin-top: 16px;">
         <el-button size="small" type="primary" @click="versionDialogVisible=true" v-if="state==1&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName.includes('鐢佃矾璇曢獙')">鐢佃皟/闈炵數璋冩ā鏉垮垏鎹�</el-button>
         <el-select v-model="template" size="medium" placeholder="鐢佃矾棰勮妯℃澘" style="margin-right: 10px;margin-left: 10px;" v-if="state==1&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName.includes('鐢佃矾璇曢獙')"
           @change="selectInsProductTemplateById">
@@ -277,10 +277,11 @@
         <el-button size="small" type="primary" @click="handleSubmit" v-if="state==1"
           :loading="submitLoading">鎻愪氦</el-button>
         <!-- 澶嶆牳 -->
-        <el-button size="small" type="primary" @click="upInsReview(1,'缁х画璇曢獙')" :loading="reviewLoading"
-          v-if="state>1&&!isLook">缁х画璇曢獙</el-button>
+        <!-- <el-button size="small" type="primary" @click="upInsReview(1,'缁х画璇曢獙')" :loading="reviewLoading"
+          v-if="state>1&&!isLook">缁х画娴嬭瘯涓嬩竴涓牱鍝�</el-button>
         <el-button size="small" @click="upInsReview(0,'鍐嶆璇曢獙')" v-if="state>1&&!isLook" type="danger">鍐嶆璇曢獙</el-button>
-        <el-button size="small" @click="upInsReview(2,'缁撴潫璇曢獙')" v-if="state>1&&!isLook">缁撴潫璇曢獙</el-button>
+        <el-button size="small" @click="upInsReview(2,'缁撴潫璇曢獙')" v-if="state>1&&!isLook">姝ゅ鎵樺崟缁撴潫</el-button> -->
+        <el-button size="small" type="primary" @click="upInsReviewDia=true" v-if="state>1&&!isLook">澶嶆牳</el-button>
         <el-button size="small" @click="handleBack" v-if="!noBack">杩斿洖</el-button>
       </el-col>
     </el-row>
@@ -940,6 +941,18 @@
         <el-button type="primary" @click="addTemplateDia" :loading="templateLoading">纭� 瀹�</el-button>
       </span>
     </el-dialog>
+    <el-dialog title="澶嶆牳" :visible.sync="upInsReviewDia" width="400px">
+      <el-radio-group v-model="upInsReviewType" style="display: flex;flex-direction: column">
+        <el-radio :label="1" style="margin: 10px 0; ">缁х画娴嬭瘯涓嬩竴涓牱鍝佹垨鍏朵粬绔欑偣浠诲姟</el-radio>
+        <el-radio :label="0" style="margin: 10px 0; ">鍐嶆妫�楠岃鏍峰搧</el-radio>
+        <el-radio :label="2" style="margin: 10px 0; ">姝ゅ鎵樺崟缁撴潫</el-radio>
+        <p style="font-size: 12px;color:red">鎱庨噸锛氬鏋滆繕鏈夊叾浠栨牱鍝佸湪妫�锛岀偣鍑荤粨鏉熷彲鑳戒細涓柇锛岃纭繚鎵�鏈夋牱鍝侀兘妫�楠屼笖澶嶆牳瀹屾垚鍐嶇偣鍑�</p>
+      </el-radio-group>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="upInsReviewDia = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="upInsReview" :loading="reviewLoading">纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -967,6 +980,8 @@
         lookFileVisible:false,//棰勮鏂囦欢
         experimentDia:false,
         experimentDia0:false,
+        upInsReviewDia:false,
+        upInsReviewType:1,
         experimentInfo:{
           note:'',
           term:''
@@ -3224,23 +3239,19 @@
         })
       },
       // 澶嶆牳
-      upInsReview(e,type) {
-        this.$confirm(type=='缁撴潫璇曢獙'?'纭缁撴潫璇曢獙锛熺‘瀹氬悗姝ゅ鎵樺崟鍋滄璇曢獙锛屽苟涓旀棤娉曞啀娆℃楠岋紒':`鏄惁${type}?`, "鎻愮ず", {
-          confirmButtonText: "纭畾",
-          cancelButtonText: "鍙栨秷",
-          type: "warning"
-        }).then(() => {
-          if (e == 1||e==2) {
+      upInsReview() {
+        if (this.upInsReviewType == 1||this.upInsReviewType==2) {
           // 缁х画璇曢獙
           this.reviewLoading = true;
           this.$axios.post(this.$api.insOrderPlan.verifyPlan, {
             sampleId: this.orderId,
-            type: e,
+            type: this.upInsReviewType,
             laboratory: this.sonLaboratory,
             tell: null
           }).then(res => {
             if (res.code === 200) {
               this.$message.success("鎿嶄綔鎴愬姛")
+              this.upInsReviewDia = false;
               this.$emit('goback')
             }
             this.reviewLoading = false;
@@ -3252,7 +3263,6 @@
           // 鍐嶆璇曢獙
           this.reviewDia = true;
         }
-        })
       },
       handleReviewDia() {
         if (this.noReason) {
diff --git a/src/components/view/b1-inspect-order-plan.vue b/src/components/view/b1-inspect-order-plan.vue
index c96f0ae..2e0232d 100644
--- a/src/components/view/b1-inspect-order-plan.vue
+++ b/src/components/view/b1-inspect-order-plan.vue
@@ -391,6 +391,13 @@
             </el-input>
           </div>
         </el-col>
+        <el-col class="search_thing" :span="24">
+          <div class="search_label" style="width: 90px"><span class="required-span">* </span>璁㈠崟缂栧彿锛�</div>
+          <div class="search_input">
+            <el-input v-model="entrustCode" size="small" clearable :disabled="sampleCodeBtnDisabled">
+            </el-input>
+          </div>
+        </el-col>
       </el-row>
       <el-tree :data="storageList" ref="tree" :props="{ children: 'warehouseShelfList', label: 'name' }" node-key="id"
                :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen"
@@ -414,12 +421,19 @@
     <el-dialog title="鍑哄簱" :visible.sync="exportVisible" width="400px">
       <el-row>
         <el-col class="search_thing" :span="24">
-          <div class="search_label" style="width: 90px"><span class="required-span">* </span>鏍峰搧缂栧彿锛�</div>
+          <div class="search_label" style="width: 90px"><span class="required-span">* </span>濮旀墭缂栧彿锛�</div>
           <div class="search_input">
             <el-input v-model="sampleCode" size="small" clearable :disabled="sampleCodeBtnDisabled">
               <el-tooltip :content="sampleCodeBtnDisabled?'鎵嬪姩杈撳叆':'鎵爜鏋緭鍏�'" placement="top" slot="append">
                 <el-button type="primary" icon="el-icon-edit" @click="sampleCodeBtnDisabled=!sampleCodeBtnDisabled"></el-button>
               </el-tooltip>
+            </el-input>
+          </div>
+        </el-col>
+        <el-col class="search_thing" :span="24">
+          <div class="search_label" style="width: 90px"><span class="required-span">* </span>濮旀墭缂栧彿锛�</div>
+          <div class="search_input">
+            <el-input v-model="entrustCode" size="small" clearable :disabled="sampleCodeBtnDisabled">
             </el-input>
           </div>
         </el-col>
@@ -676,6 +690,7 @@
         scanInsOrderState:false,
         qrCodeVisible: false,
         sampleCode: '',
+        entrustCode:'',
         storageList:[],
         expandedKeys: [],
         selectTree: [],
@@ -695,6 +710,7 @@
         if(newVal){
             // this.$message.success('鎵爜锛氭墦寮�')
             this.sampleCode = null
+            this.entrustCode = null
             let input = document.getElementById('ScanCodeInfo');
             input.focus();
             this.startTime = setInterval(()=>{
@@ -710,6 +726,7 @@
         if(newVal){
             // this.$message.success('鎵爜锛氭墦寮�')
             this.sampleCode = null
+            this.entrustCode = null
             let input = document.getElementById('ScanCodeInfo');
             input.focus();
             this.startTime = setInterval(()=>{
@@ -725,7 +742,8 @@
         if(!val){
           this.startTime&&clearInterval(this.startTime)
         }else if(this.exportVisible||this.qrCodeVisible){
-          this.sampleCode = null
+          // this.sampleCode = null
+          // this.entrustCode = null
           let input = document.getElementById('ScanCodeInfo');
           input.focus();
           this.startTime = setInterval(()=>{
@@ -796,6 +814,10 @@
           this.$message.error('璇峰~鍐欐牱鍝佺紪鍙�')
           return
         }
+        if (!this.entrustCode) {
+          this.$message.error('璇峰~鍐欒鍗曠紪鍙�')
+          return
+        }
         if (this.selectTree.length < 4) {
           this.$message.error('璇烽�夋嫨鏍峰搧鍏ュ簱浣嶇疆')
           return
@@ -804,11 +826,13 @@
         this.$axios.post(this.$api.insOrderPlan.scanInsOrderState, {
           trees: this.selectTree.join('-'),
           sampleCode:this.sampleCode,
+          entrustCode:this.entrustCode,
           sonLaboratory: this.componentData.entity.sonLaboratory
         }).then(res => {
           this.upLoadStorage = false;
           this.qrCodeVisible = false
           this.sampleCode = '';
+          this.entrustCode = '';
           this.selectTree = []
           if (res.code == 201) {
             this.$message.error('娣诲姞澶辫触')
@@ -824,14 +848,20 @@
           this.$message.error('璇峰~鍐欐牱鍝佺紪鍙�')
           return
         }
+        if (!this.entrustCode) {
+          this.$message.error('璇峰~鍐欒鍗曠紪鍙�')
+          return
+        }
         this.upLoadExport = true;
         this.$axios.post(this.$api.insOrderPlan.outInsOrderState, {
           sampleCode:this.sampleCode,
+          entrustCode:this.entrustCode,
           sonLaboratory: this.componentData.entity.sonLaboratory
         }).then(res => {
           this.upLoadExport = false;
           this.exportVisible = false
           this.sampleCode = '';
+          this.entrustCode = '';
           if (res.code == 201) {
             this.$message.error('鍑哄簱澶辫触')
             return
@@ -842,13 +872,15 @@
       },
       // 鎵爜鏋寜涓�
       keyup(e){
-        var code = ''
+        var codeInfo = null
         try{
-          code = this.codeInfo.substring()
-          if(code==null||code==undefined||code==''){
-            this.$message.error('璇ヤ簩缁寸爜鏈夎')
+          console.log(2222,this.codeInfo)
+          codeInfo = JSON.parse(this.codeInfo)
+          if(!codeInfo||codeInfo.sampleCode==undefined||codeInfo.entrustCode==undefined){
+              this.$message.error('璇ヤ簩缁寸爜鏈夎')
           }else{
-            this.sampleCode = code
+              this.sampleCode = codeInfo.sampleCode
+              this.entrustCode = codeInfo.entrustCode
           }
         }catch(e){
           this.$message.error('璇疯皟鑷宠嫳鏂囬敭鐩�')
diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue
index 79b0741..3c82c0d 100644
--- a/src/components/view/b1-inspection-order.vue
+++ b/src/components/view/b1-inspection-order.vue
@@ -397,10 +397,27 @@
             <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>
-                <p style="text-align: center;font-size: 18px;font-weight: 700;">{{ item.sample }}</p>
-                <barcode :value="item.sampleCode" :height="34" :width="2" :displayValue="false" style="display: flex;justify-content: center;width: 100%;"></barcode>
-                <div>
-                  <div style="width: 100%;line-height: 30px;">
+                <p style="text-align: center;font-size: 26px;font-weight: 700;">{{ item.sample }}锛坽{item.model}}锛�</p>
+                <p style="text-align: center;font-size: 16px;">{{ item.sampleCode }}</p>
+                <el-divider></el-divider>
+                <el-row style="font-size: 16px;">
+                  <el-col :span="16" style="text-align: left;line-height: 28px;">
+                    <p><span>&nbsp;&nbsp;&nbsp;&nbsp;濮旀墭鍗曞彿:&nbsp; </span>{{ item.code }}</p>
+                    <p><span>&nbsp;&nbsp;&nbsp;&nbsp;鐢垫満缂栧彿:&nbsp; </span>{{ item.motorNumber }}</p>
+                    <p><span>&nbsp;&nbsp;&nbsp;&nbsp;鏍锋満瀹屾垚鏃堕棿:&nbsp; </span>{{ item.issueTime }}</p>
+                    <p><span>&nbsp;&nbsp;&nbsp;&nbsp;鏍锋満鍛�:&nbsp; </span>{{ item.issueName }}</p>
+                    <p class="ellipsis-multiline"><span>&nbsp;&nbsp;&nbsp;&nbsp;妫�娴嬮」鐩�:&nbsp; </span>{{ item.item }}</p>
+                  </el-col>
+                  <el-col :span="8" style="text-align: left;">
+                    <vueQr
+                      :text="item.str"
+                      :size="140"
+                      :margin="2"
+                    ></vueQr>
+                  </el-col>
+                </el-row>
+                <!-- <div>
+                  <div>
                     <el-row style="font-size: 16px;">
                       <el-col :span="16" style="text-align: left;"><span>&nbsp;&nbsp;&nbsp;&nbsp;鏍峰搧缂栧彿:&nbsp; </span>{{ item.sampleCode }}</el-col>
                       <el-col :span="8" style="text-align: left;"><span>&nbsp;&nbsp;&nbsp;&nbsp;瑙勬牸鍨嬪彿:&nbsp; </span>{{ item.model }}</el-col>
@@ -417,7 +434,7 @@
                       <el-col style="text-align: left;"><span>&nbsp;&nbsp;&nbsp;&nbsp;妫�娴嬮」鐩�:&nbsp; </span>{{ item.item }}</el-col>
                     </el-row>
                   </div>
-                </div>
+                </div> -->
               </div>
             </el-card>
           </el-checkbox-group>
@@ -434,28 +451,27 @@
         <div id="printMOrder" class="printMOrder" ref="printMOrder">
           <el-card class="box-card" v-for="(item, i) in checkDataList" :key="i+'uuuuu'" style="font-size: 16px !important;page-break-after: always;color: #000;box-shadow: none;margin: 0 !important;padding: 0 !important;">
             <div>
-              <p style="text-align: center;font-size: 18px;font-weight: 500;margin-top: 10px;">{{ item.sample }}</p>
-              <barcode :value="item.sampleCode" :height="34" :width="2" :displayValue="false" style="display: flex;justify-content: center;width: 100%;"></barcode>
-              <div>
-                <div style="width: 100%;line-height: 30px;">
-                  <el-row style="font-size: 16px;">
-                    <el-col :span="16" style="text-align: left;"><span>鏍峰搧缂栧彿:&nbsp; </span>{{ item.sampleCode }}</el-col>
-                    <el-col :span="7" style="text-align: left;"><span>瑙勬牸鍨嬪彿:&nbsp; </span>{{ item.model }}</el-col>
-                  </el-row>
-                  <el-row style="margin-top: 1px;font-size: 16px;">
-                    <el-col :span="16" style="text-align: left;"><span>濮旀墭鍗曞彿:&nbsp; </span>{{ item.code }}</el-col>
-                    <el-col :span="7" style="text-align: left;"><span>鐢垫満缂栧彿:&nbsp; </span>{{ item.motorNumber }}</el-col>
-                  </el-row>
-                  <el-row style="margin-top: 1px;font-size: 16px;">
-                    <el-col :span="16" style="text-align: left;"><span>鏍锋満瀹屾垚鏃堕棿:&nbsp; </span>{{ item.issueTime }}</el-col>
-                    <el-col :span="7" style="text-align: left;"><span>鏍锋満鍛�:&nbsp; </span>{{ item.issueName }}</el-col>
-                  </el-row>
-                  <el-row style="margin-top: 1px;font-size: 16px;" class="ellipsis-multiline">
-                    <el-col style="text-align: left;"><span>妫�娴嬮」鐩�:&nbsp; </span>{{ item.item }}</el-col>
-                  </el-row>
-                </div>
+                <p style="text-align: center;font-size: 26px;font-weight: 700;margin-top: 20px;">{{ item.sample }}锛坽{item.model}}锛�</p>
+                <p style="text-align: center;font-size: 16px;">{{ item.sampleCode }}</p>
+                <!-- <el-divider></el-divider> -->
+                 <p style="width: 100%;height:1px;background-color: #333333;margin: 6px 0;"></p>
+                <el-row style="font-size: 16px;">
+                  <el-col :span="16" style="text-align: left;line-height: 28px;">
+                    <p><span>&nbsp;&nbsp;&nbsp;&nbsp;濮旀墭鍗曞彿:&nbsp; </span>{{ item.code }}</p>
+                    <p><span>&nbsp;&nbsp;&nbsp;&nbsp;鐢垫満缂栧彿:&nbsp; </span>{{ item.motorNumber }}</p>
+                    <p><span>&nbsp;&nbsp;&nbsp;&nbsp;鏍锋満瀹屾垚鏃堕棿:&nbsp; </span>{{ item.issueTime }}</p>
+                    <p><span>&nbsp;&nbsp;&nbsp;&nbsp;鏍锋満鍛�:&nbsp; </span>{{ item.issueName }}</p>
+                    <p class="ellipsis-multiline"><span>&nbsp;&nbsp;&nbsp;&nbsp;妫�娴嬮」鐩�:&nbsp; </span>{{ item.item }}</p>
+                  </el-col>
+                  <el-col :span="8" style="text-align: left;">
+                    <vueQr
+                      :text="item.str"
+                      :size="140"
+                      :margin="2"
+                    ></vueQr>
+                  </el-col>
+                </el-row>
               </div>
-            </div>
           </el-card>
         </div>
     </div>
@@ -937,7 +953,13 @@
             })
             a.item = [...new Set(arr1)].join(',')
           })
-          this.qrData = arr
+          this.qrData = arr.map(m=>{
+            m.str = JSON.stringify({
+              sampleCode:m.sampleCode,
+              entrustCode:m.code
+            })
+            return m
+          })
           // console.log(this.qrData)
 				})
       },
@@ -972,27 +994,17 @@
           targetStyles: ["*"], // 浣跨敤dom鐨勬墍鏈夋牱寮忥紝寰堥噸瑕�
           printable: 'printMOrder',//椤甸潰
           type: "html",//鏂囨。绫诲瀷
-          maxWidth:720,
-          header: '',
+          documentTitle: "浜岀淮鐮�",
           style:
             `@page {
-              margin: 0.4cm;
-              margin-right: 0.4cm;
-              margin-top: 0.4cm;
-              margin-bottom: 0.4cm;
-              padding-bottom: 0px;
-              size: 800px 600px collapse;
+              margin: 0;
+              size: landscape;
             }
-            html{
+            body{
               zoom:100%;
-
-            }
-            @media print{
-              width: 800px;
-              height: 600px;
+              padding:30px 0;
               margin:0;
             }`,
-          font_size: '16px',
         });
       },
       async print(){
diff --git a/src/components/view/b1-sample.vue b/src/components/view/b1-sample.vue
index 0bc487e..e0f44c6 100644
--- a/src/components/view/b1-sample.vue
+++ b/src/components/view/b1-sample.vue
@@ -196,9 +196,13 @@
           <div class="search_label">鏍峰搧缂栧彿锛�</div>
           <div class="search_input">
             <el-input placeholder="璇疯緭鍏ユ牱鍝佺紪鍙�" v-model="searchSampleCode" size="small" autocomplete="off" ref="organization" readonly="readonly" @focus="remove('organization')" @blur="setType('organization')">
-              <el-button slot="append" icon="el-icon-search" @click="handleSearch"></el-button>
+              <!-- <el-button slot="append" icon="el-icon-search" @click="handleSearch"></el-button> -->
             </el-input>
           </div>
+        </div>
+        <div class="search_thing">
+          <el-button size="small" @click="handleShelf(entity.shelfId,''),searchSampleCode=''">閲嶇疆</el-button>
+          <el-button size="small" type="primary" @click="handleShelf(entity.shelfId,searchSampleCode)">鏌ヨ</el-button>
         </div>
         <!-- <div class="search_thing" style="padding-left: 30px;">
 					<el-button size="small" @click="refresh()">閲� 缃�</el-button>
@@ -262,6 +266,13 @@
             </el-input>
           </div>
         </el-col>
+        <el-col class="search_thing" :span="24">
+          <div class="search_label" style="width: 90px"><span class="required-span">* </span>璁㈠崟缂栧彿锛�</div>
+          <div class="search_input">
+            <el-input v-model="entrustCode" size="small" clearable :disabled="sampleCodeBtnDisabled">
+            </el-input>
+          </div>
+        </el-col>
       </el-row>
       <el-tree :data="storageList" ref="tree" :props="{ children: 'warehouseShelfList', label: 'name' }" node-key="id"
         :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen"
@@ -295,6 +306,13 @@
               <el-tooltip :content="sampleCodeBtnDisabled?'鎵嬪姩杈撳叆':'鎵爜鏋緭鍏�'" placement="top" slot="append">
                 <el-button type="primary" icon="el-icon-edit" @click="sampleCodeBtnDisabled=!sampleCodeBtnDisabled"></el-button>
               </el-tooltip>
+            </el-input>
+          </div>
+        </el-col>
+        <el-col class="search_thing" :span="24">
+          <div class="search_label" style="width: 90px"><span class="required-span">* </span>濮旀墭缂栧彿锛�</div>
+          <div class="search_input">
+            <el-input v-model="entrustCode" size="small" clearable :disabled="sampleCodeBtnDisabled">
             </el-input>
           </div>
         </el-col>
@@ -416,6 +434,7 @@
         currentEdit:null,//褰撳墠瑕佺淮鎶ょ殑淇℃伅
         tableLoading:false,
         sampleCode:'',
+        entrustCode:'',
         currentId:null,
         searchSampleCode:null,
         codeInfo:null,
@@ -425,6 +444,7 @@
       storageVisible(newVal){
         if(newVal){
             this.sampleCode = null
+            this.entrustCode = null
             // this.$message.success('鎵爜锛氭墦寮�')
             let input = document.getElementById('ScanCodeInfo0');
             input.focus();
@@ -441,6 +461,7 @@
         if(newVal){
             // this.$message.success('鎵爜锛氭墦寮�')
             this.sampleCode = null
+            this.entrustCode = null
             let input = document.getElementById('ScanCodeInfo0');
             input.focus();
             this.startTime = setInterval(()=>{
@@ -456,7 +477,6 @@
         if(!val){
           this.startTime&&clearInterval(this.startTime)
         }else if(this.exportVisible||this.storageVisible){
-          this.sampleCode = null
           let input = document.getElementById('ScanCodeInfo');
           input.focus();
           this.startTime = setInterval(()=>{
@@ -475,14 +495,15 @@
     },
     methods: {
       keyup(e){
-        var code = ''
+        var codeInfo = null
         try{
             console.log(2222,this.codeInfo)
-            code = this.codeInfo.substring()
-            if(code==null||code==undefined||code==''){
+            codeInfo = JSON.parse(this.codeInfo)
+            if(!codeInfo||codeInfo.sampleCode==undefined||codeInfo.entrustCode==undefined){
                 this.$message.error('璇ヤ簩缁寸爜鏈夎')
             }else{
-                this.sampleCode = code
+                this.sampleCode = codeInfo.sampleCode
+                this.entrustCode = codeInfo.entrustCode
             }
         }catch(e){
             this.$message.error('璇疯皟鑷宠嫳鏂囬敭鐩�')
@@ -555,6 +576,10 @@
           this.$message.error('璇峰~鍐欐牱鍝佺紪鍙�')
           return
         }
+        if (!this.entrustCode) {
+          this.$message.error('璇峰~鍐欒鍗曠紪鍙�')
+          return
+        }
         if (this.selectTree.length < 4) {
           this.$message.error('璇烽�夋嫨鏍峰搧鍏ュ簱浣嶇疆')
           return
@@ -562,11 +587,13 @@
         this.upLoadStorage = true;
         this.$axios.post(this.$api.warehouse.inWarehouse, {
             trees: this.selectTree.join('-'),
-            sampleCode:this.sampleCode
+            sampleCode:this.sampleCode,
+            entrustCode:this.entrustCode
           }).then(res => {
             this.upLoadStorage = false;
             this.storageVisible = false
             this.sampleCode = '';
+            this.entrustCode = '';
             this.selectTree = []
             if (res.code == 201) {
               this.$message.error('鍏ュ簱澶辫触')
@@ -582,13 +609,19 @@
           this.$message.error('璇峰~鍐欐牱鍝佺紪鍙�')
           return
         }
+        if (!this.entrustCode) {
+          this.$message.error('璇峰~鍐欒鍗曠紪鍙�')
+          return
+        }
         this.upLoadExport = true;
         this.$axios.post(this.$api.warehouse.outWarehouse, {
-            sampleCode:this.sampleCode
+            sampleCode:this.sampleCode,
+            entrustCode:this.entrustCode,
           }).then(res => {
             this.upLoadExport = false;
             this.exportVisible = false
             this.sampleCode = '';
+            this.entrustCode = '';
             if (res.code == 201) {
               this.$message.error('鍑哄簱澶辫触')
               return
@@ -783,10 +816,10 @@
         this.shelf = map.warehouseShelfList;
         this.entity.shelfId = '';
       },
-      handleShelf(e){
+      handleShelf(e,sampleCode=''){
         if(e){
           this.tableLoading = true;
-          this.$axios.get(this.$api.warehouse.getWarehouse+'?shelfId='+e).then(res => {
+          this.$axios.get(this.$api.warehouse.getWarehouse+'?shelfId='+e+'&sampleCode='+sampleCode).then(res => {
             this.tableLoading = false;
             let data = res.data;
             let set =new Set()
diff --git a/src/main.js b/src/main.js
index b6fd273..afa39b8 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