From 9b6bd0c014b73456edb095ee53b22324437ae646 Mon Sep 17 00:00:00 2001 From: cuijian <cuijian@xalxzn.com> Date: 星期三, 09 七月 2025 10:59:45 +0800 Subject: [PATCH] 现场问题修改 --- src/views/tms/modules/inbound/InboundModel.vue | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 49 insertions(+), 8 deletions(-) diff --git a/src/views/tms/modules/inbound/InboundModel.vue b/src/views/tms/modules/inbound/InboundModel.vue index e2eda69..d4d8ad2 100644 --- a/src/views/tms/modules/inbound/InboundModel.vue +++ b/src/views/tms/modules/inbound/InboundModel.vue @@ -102,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> @@ -117,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', @@ -252,7 +261,8 @@ }, ], classifyId:'', - locationCodeOptions:[] + locationCodeOptions:[], + qrList: [] } }, created() { @@ -273,6 +283,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 +326,28 @@ }, 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) => ({ + 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) @@ -412,6 +434,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() { -- Gitblit v1.9.3