From 7fbe0f95cf428eb516f9015adae8bbe4baf539d4 Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期五, 25 七月 2025 11:01:15 +0800
Subject: [PATCH] 安灯管理列表筛选条件修改

---
 src/views/tms/modules/inbound/InboundModel.vue |   74 +++++++++++++++++++++++++++++++------
 1 files changed, 62 insertions(+), 12 deletions(-)

diff --git a/src/views/tms/modules/inbound/InboundModel.vue b/src/views/tms/modules/inbound/InboundModel.vue
index e2eda69..55980de 100644
--- a/src/views/tms/modules/inbound/InboundModel.vue
+++ b/src/views/tms/modules/inbound/InboundModel.vue
@@ -47,7 +47,7 @@
           </a-col>
         </a-row>
 
-        <a-row style="width: 100%">
+        <!-- <a-row style="width: 100%">
           <a-col :span="24 / 2">
             <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="搴撲綅鍙�" prop="locationCodeId">
               <a-select
@@ -57,7 +57,7 @@
               />
             </a-form-model-item>
           </a-col>
-        </a-row>
+        </a-row> -->
       </a-form-model>
     </a-spin>
     <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectReturnList()" v-show="returnShow && !disableSubmit">閫夋嫨鍊熷嚭宸ュ叿</a-button>
@@ -78,7 +78,7 @@
         <div :key="col.dataIndex">
           <a-input-number
             v-if="col.dataIndex == 'inStorageQuantity'"
-            :disabled="record.accuracyClass == '1'"
+            
             :value="text"
             @change="(e) => handleChange(e, record, col, index)"
             :min="1"
@@ -102,7 +102,16 @@
     <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk" :classifyId="classifyId"></j-select-tooling-modal>
     <j-select-return-list-modal ref="returnModalForm" @ok="modalFormOk" :classifyId="classifyId"></j-select-return-list-modal>
     <j-select-sharpen-list-modal ref="sharpenModalForm" @ok="modalFormOk" :classifyId="classifyId"></j-select-sharpen-list-modal>
+  
+    <div id="printArea" style="display: block;">
+      <div v-for="(item, index) in qrList" :key="index" class="qrcode-item">
+        <p>{{ item.onlyCode }}</p>
+        <p>{{ item.toolName }}</p>
+        <img :src="item.base64" alt="QR Code">
+      </div>
+    </div>
   </a-modal>
+  
 </template>
 
 <script>
@@ -117,6 +126,7 @@
 import { filterObj } from '@/utils/util'
 import JSelectReturnListModal from '.././inboundOrder/JSelectReturnListModal'
 import JSelectSharpenListModal from '.././inboundOrder/JSelectSharpenListModal'
+import printJS from 'print-js';
 
 export default {
   name: 'InboundModel',
@@ -239,6 +249,12 @@
           width: 150,
         },
         {
+          title: '搴撲綅鍙�',
+          align: 'center',
+          dataIndex: 'goodsShelvesId',
+          width: 150,
+        },
+        {
           title: '鍏ュ簱鏁伴噺',
           align: 'center',
           dataIndex: 'inStorageQuantity',
@@ -252,7 +268,8 @@
         },
       ],
       classifyId:'',
-      locationCodeOptions:[]
+      locationCodeOptions:[],
+      qrList: []
     }
   },
   created() {
@@ -273,6 +290,7 @@
       return filterObj(this.param)
     },
     add (nodeSelected) {
+      this.qrList = []
       this.classifyId = nodeSelected.key
       this.model.classifyNum =  nodeSelected.entity.classifyId
       this.model.typeName =  nodeSelected.entity.typeName
@@ -315,17 +333,29 @@
     },
     handleOk() {
       const that = this
+      if(this.dataSource.length == 0){
+        that.$message.error("璇峰厛閫夋嫨闇�瑕佸叆搴撶殑宸ュ叿!")
+        return
+      }
       // 瑙﹀彂琛ㄥ崟楠岃瘉
-      this.form.validateFields((err, values) => {
-        if (!err) {
+      this.$refs.form.validate(valid => {
+        if (valid) {
           that.confirmLoading = true
-          let formData = Object.assign(this.model, values)
-          formData.detailData = this.dataSource
-          formData.classifyId = this.classifyId
-          postAction(this.url.addInStorage, formData)
+          this.model.detailData = this.dataSource
+          this.model.classifyId = this.classifyId
+          postAction(this.url.addInStorage, this.model)
             .then((res) => {
               if (res.success) {
-                that.$message.success(res.message)
+                if(this.model.inStorehouseType === '1'){
+                  this.qrList = res.result.map((content, i) => ({
+                  onlyCode:res.result[i].onlyCode,
+                  toolName:res.result[i].toolName,
+                  base64: res.result[i].image
+                  }));
+                  this.handleBacthPrint();
+                }else{
+                   that.$message.success("淇濆瓨鎴愬姛")
+                }
                 that.$emit('ok', new Date())
               } else {
                 that.$message.warning(res.message)
@@ -412,6 +442,25 @@
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       );
     },
+    
+    // 鎵ц鎵撳嵃
+    handleBacthPrint() {
+      this.$nextTick(() => {
+        printJS({
+          printable: 'printArea',
+          type: 'html',
+          style: `
+            .qrcode-item { 
+              page-break-inside: avoid;
+              margin: 10px; 
+              text-align: center;
+            }
+            img { width: 100px; height: 100px; }
+          `,
+          scanStyles: false
+        });
+      });
+    }
   },
   watch: {},
   mounted() {
@@ -428,7 +477,8 @@
           onlyCode:data[i].onlyCode,
           inStorageQuantity:data[i].storageQuantity || data[i].quantity || 1,
           quantity:data[i].quantity,
-          accuracyClass:data[i].accuracyClass
+          accuracyClass:data[i].accuracyClass,
+          goodsShelvesId:data[i].positionCode
         })
       }
       //this.ipaginationm.total = this.dataSource.length

--
Gitblit v1.9.3