From e5563c1f4416abb6063b3549f21d31f6168c38a5 Mon Sep 17 00:00:00 2001 From: "[li_she]" <[li.she@xujiesoft.com]> Date: Sun, 15 May 2022 16:00:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=8F=82=E6=95=B0=E7=BC=93?= =?UTF-8?q?=E5=AD=98=202022-05-15=20sxm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../labelPrint/outer-box-label-roll.vue | 18 +++++++---- .../modules/labelPrint/outer-box-label.vue | 30 ++++++++++++++----- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/views/modules/labelPrint/outer-box-label-roll.vue b/src/views/modules/labelPrint/outer-box-label-roll.vue index d8352ea..b08dca7 100644 --- a/src/views/modules/labelPrint/outer-box-label-roll.vue +++ b/src/views/modules/labelPrint/outer-box-label-roll.vue @@ -417,8 +417,8 @@ export default { // 手工参数 param:[] }, - // 临时参数记录 - tempParamList:[], + // 记录打印参数 + printParamList: [], // 模板参数列表 reportParamList: [], buttons: { @@ -557,7 +557,7 @@ export default { } this.orderInfo.reportFileList = this.selectReportFileList this.orderInfo.param = this.reportParamList - this.tempParamList = this.reportParamList + this.printParamList = JSON.parse(JSON.stringify(this.reportParamList)) ouBoxPrintLabel(this.orderInfo).then(({data}) =>{ if (data.code === 0 ){ this.$message.success(data.msg) @@ -644,12 +644,18 @@ export default { }, // 获取柱模版打印参数 searchReportParameters(val) { + let printParamList = JSON.parse(JSON.stringify(this.printParamList)) getReportParameters(val.reportId).then(({data}) => { if (data.code === 0) { this.reportParamList = data.data - this.tempParamList - for (let item of this.tempParamList) { - + if (printParamList){ + for (let item1 of printParamList) { + for (let item2 of this.reportParamList) { + if (item1.parametername === item2.parametername){ + item2.optionvalue = item1.optionvalue + } + } + } } } }) diff --git a/src/views/modules/labelPrint/outer-box-label.vue b/src/views/modules/labelPrint/outer-box-label.vue index d3aee17..5311453 100644 --- a/src/views/modules/labelPrint/outer-box-label.vue +++ b/src/views/modules/labelPrint/outer-box-label.vue @@ -415,10 +415,12 @@ export default { // 选中模板列表 reportFileList: [], // 手工参数 - param:[] + param: [] }, // 模板参数列表 reportParamList: [], + // 记录打印参数 + printParamList: [], buttons: { settingLanguageList: '按语言设置', edit: '编辑', @@ -555,10 +557,11 @@ export default { } this.orderInfo.reportFileList = this.selectReportFileList this.orderInfo.param = this.reportParamList - ouBoxPrintLabel(this.orderInfo).then(({data}) =>{ - if (data.code === 0 ){ - this.$message.success(data.msg) - }else { + this.printParamList = JSON.parse(JSON.stringify(this.reportParamList)) + ouBoxPrintLabel(this.orderInfo).then(({data}) => { + if (data.code === 0) { + this.$message.success(data.msg) + } else { this.$message.warning(data.msg) } }) @@ -569,7 +572,7 @@ export default { getBoxLabelSO(this.orderNo).then(({data}) => { if (data.code === 0) { this.orderInfo.customerId = data.data.customerId ? data.data.customerId : '*' - this.orderInfo.totalQty = data.data.sumQty + this.orderInfo.totalQty = data.data.sumQty this.orderInfo.perBoxQty = data.data.boxQty this.orderInfo.orderNo = this.orderNo let query = { @@ -639,11 +642,24 @@ export default { }) }, - // 获取柱模版打印参数 + // 获取主模版打印参数 searchReportParameters(val) { + let printParamList = JSON.parse(JSON.stringify(this.printParamList)) + // 本次打印参数 getReportParameters(val.reportId).then(({data}) => { if (data.code === 0) { + // 上次保留打印参数 this.reportParamList = data.data + if (printParamList){ + for (let item1 of printParamList) { + for (let item2 of this.reportParamList) { + if (item1.parametername === item2.parametername){ + item2.optionvalue = item1.optionvalue + } + } + } + } + } }) },