From 1ff7e79fccfc7396941e3a5a7d6cc24bc952fd32 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期三, 18 六月 2025 14:02:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/tms/modules/inbound/InboundModel.vue |   67 ++++++++++++++++++++++++++++++++-
 1 files changed, 64 insertions(+), 3 deletions(-)

diff --git a/src/views/tms/modules/inbound/InboundModel.vue b/src/views/tms/modules/inbound/InboundModel.vue
index 7548919..bbd4993 100644
--- a/src/views/tms/modules/inbound/InboundModel.vue
+++ b/src/views/tms/modules/inbound/InboundModel.vue
@@ -46,6 +46,18 @@
             </a-form-model-item>
           </a-col>
         </a-row>
+
+        <a-row style="width: 100%">
+          <a-col :span="24 / 2">
+            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="搴撲綅鍙�" prop="locationCodeId">
+              <a-select
+                :triggerChange="true"
+                :options="locationCodeOptions"
+                v-model="model.locationCodeId"
+              />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
       </a-form-model>
     </a-spin>
     <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectReturnList()" v-show="returnShow && !disableSubmit">閫夋嫨鍊熷嚭宸ュ叿</a-button>
@@ -90,7 +102,15 @@
     <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">
+        <img :src="item.base64" alt="QR Code">
+        <p>{{ item.content }}</p>
+      </div>
+    </div>
   </a-modal>
+  
 </template>
 
 <script>
@@ -105,6 +125,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',
@@ -174,6 +195,12 @@
               message: '璇烽�夋嫨鐢宠鍏ュ簱鏃ユ湡!',
             },
           ],
+          locationCodeId:[
+            {
+              required: true,
+              message: '璇烽�夋嫨搴撲綅鍙�!',
+            },
+          ]
       },
       url: {
         addInStorage: '/tms/inboundOrder/addInStorage',
@@ -233,12 +260,19 @@
           scopedSlots: { customRender: 'action' },
         },
       ],
-      classifyId:''
+      classifyId:'',
+      locationCodeOptions:[],
+      qrList: []
     }
   },
   created() {
     //澶囦唤model鍘熷鍊�
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    ajaxGetDictItems("tms_goods_shelves,location_code,id", null).then((res) => {
+        if (res.success) {
+          this.locationCodeOptions = res.result
+        }
+      })
   },
   methods: {
     modalFormOk() {
@@ -301,7 +335,15 @@
           postAction(this.url.addInStorage, formData)
             .then((res) => {
               if (res.success) {
-                that.$message.success(res.message)
+                if(formData.inStorehouseType === '1'){
+                  this.qrList = res.result.map((content, i) => ({
+                  content:res.result[i].content,
+                  base64: res.result[i].image
+                  }));
+                  this.handleBacthPrint();
+                }else{
+                   that.$message.success("淇濆瓨鎴愬姛")
+                }
                 that.$emit('ok', new Date())
               } else {
                 that.$message.warning(res.message)
@@ -388,6 +430,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() {
@@ -402,7 +463,7 @@
           toolModel: data[i].toolModel,
           applicationType: data[i].applicationTypeName,
           onlyCode:data[i].onlyCode,
-          inStorageQuantity:data[i].storageQuantity || data[i].quantity,
+          inStorageQuantity:data[i].storageQuantity || data[i].quantity || 1,
           quantity:data[i].quantity,
           accuracyClass:data[i].accuracyClass
         })

--
Gitblit v1.9.3