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/InboundListRight.vue | 14 +++++++ src/views/tms/modules/inbound/InboundModel.vue | 41 +++++++++++++++++++- src/views/tms/InboundOrderList.vue | 26 ++++++------ src/views/tms/modules/toolLedger/ToolLedgerListRight.vue | 3 + 4 files changed, 69 insertions(+), 15 deletions(-) diff --git a/src/views/tms/InboundOrderList.vue b/src/views/tms/InboundOrderList.vue index 99bc473..adce8d0 100644 --- a/src/views/tms/InboundOrderList.vue +++ b/src/views/tms/InboundOrderList.vue @@ -190,20 +190,18 @@ return { on: { click: (e) => { - //灏嗗綋鍓嶉�変腑鐨勮褰曚紶鍒板瓙椤甸潰 - this.$bus.$emit('getToolingStorageData', record) - this.onSelectChange(record.id.split(","), [record]); + this.onSelectChange(record.id.split(","), [record]); //鐐瑰嚮褰撳墠琛屽彉鑹� - let oldList = document.querySelectorAll('.checked-td-of-add-table') - if (oldList) { - for (let j = 0; j < oldList.length; j++) { - oldList[j].classList.remove('checked-td-of-add-table') - } - } - let children = e.target.parentNode.children - for (let i = 0; i < children.length; i++) { - children[i].classList.add('checked-td-of-add-table') - } + // let oldList = document.querySelectorAll('.checked-td-of-add-table') + // if (oldList) { + // for (let j = 0; j < oldList.length; j++) { + // oldList[j].classList.remove('checked-td-of-add-table') + // } + // } + // let children = e.target.parentNode.children + // for (let i = 0; i < children.length; i++) { + // children[i].classList.add('checked-td-of-add-table') + // } }, }, } @@ -211,6 +209,8 @@ onSelectChange(selectedRowKeys, selectionRows) { this.selectedRowKeys = selectedRowKeys; this.selectionRows = selectionRows; + //灏嗗綋鍓嶉�変腑鐨勮褰曚紶鍒板瓙椤甸潰 + this.$bus.$emit('getToolingStorageData', this.selectionRows[0]) }, handleEdit: function (record) { this.$refs.modalForm.edit(record) diff --git a/src/views/tms/modules/inbound/InboundListRight.vue b/src/views/tms/modules/inbound/InboundListRight.vue index 247a0ab..2a56ce4 100644 --- a/src/views/tms/modules/inbound/InboundListRight.vue +++ b/src/views/tms/modules/inbound/InboundListRight.vue @@ -76,6 +76,7 @@ :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}" class="j-table-force-nowrap" + :customRow="customRow" @change="handleTableChange"> <template slot="htmlSlot" slot-scope="text"> @@ -338,6 +339,16 @@ this.$bus.$emit('queryTreeData') //鍒锋柊宸︿晶鏍� }, + customRow(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(","), [record]); + } + } + } + }, + onSelectChange(selectedRowKeys) { this.selectedRowKeys = selectedRowKeys; //閫氳繃id鏌ヨ绠$悊鍙傛暟鍜屽弬鏁版暟鎹� @@ -478,6 +489,9 @@ if (res.success) { this.dataSource = res.result.records; // 鏇存柊琛ㄦ牸鏁版嵁 this.ipagination.total = res.result.total + //榛樿閫変腑绗竴鏉℃暟鎹� + this.selectedRowKeys[0] = res.result.records[0].id + this.onSelectChange(this.selectedRowKeys) } else { this.$message.warning("璇烽�夋嫨鍙跺瓙鑺傜偣杩涜鏌ヨ"); this.ipagination.total = 0 diff --git a/src/views/tms/modules/inbound/InboundModel.vue b/src/views/tms/modules/inbound/InboundModel.vue index e2eda69..bbd4993 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() { @@ -325,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) @@ -412,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() { diff --git a/src/views/tms/modules/toolLedger/ToolLedgerListRight.vue b/src/views/tms/modules/toolLedger/ToolLedgerListRight.vue index e5e10e5..7c0a839 100644 --- a/src/views/tms/modules/toolLedger/ToolLedgerListRight.vue +++ b/src/views/tms/modules/toolLedger/ToolLedgerListRight.vue @@ -458,6 +458,9 @@ if (res.success) { this.dataSource = res.result.records; // 鏇存柊琛ㄦ牸鏁版嵁 this.ipagination.total = res.result.total + //榛樿閫変腑绗竴鏉℃暟鎹� + this.selectedRowKeys[0] = res.result.records[0].id + this.onSelectChange(this.selectedRowKeys) } else { this.$message.warning("璇烽�夋嫨鍙跺瓙鑺傜偣杩涜鏌ヨ"); this.ipagination.total = 0 -- Gitblit v1.9.3