Browse Source

打印参数缓存 2022-05-15 sxm

master
[li_she] 4 years ago
parent
commit
e5563c1f44
  1. 18
      src/views/modules/labelPrint/outer-box-label-roll.vue
  2. 26
      src/views/modules/labelPrint/outer-box-label.vue

18
src/views/modules/labelPrint/outer-box-label-roll.vue

@ -417,8 +417,8 @@ export default {
// 手工参数 // 手工参数
param:[] param:[]
}, },
// 临时参数记录
tempParamList:[],
// 记录打印参数
printParamList: [],
// 模板参数列表 // 模板参数列表
reportParamList: [], reportParamList: [],
buttons: { buttons: {
@ -557,7 +557,7 @@ export default {
} }
this.orderInfo.reportFileList = this.selectReportFileList this.orderInfo.reportFileList = this.selectReportFileList
this.orderInfo.param = this.reportParamList this.orderInfo.param = this.reportParamList
this.tempParamList = this.reportParamList
this.printParamList = JSON.parse(JSON.stringify(this.reportParamList))
ouBoxPrintLabel(this.orderInfo).then(({data}) =>{ ouBoxPrintLabel(this.orderInfo).then(({data}) =>{
if (data.code === 0 ){ if (data.code === 0 ){
this.$message.success(data.msg) this.$message.success(data.msg)
@ -644,12 +644,18 @@ export default {
}, },
// 获取柱模版打印参数 // 获取柱模版打印参数
searchReportParameters(val) { searchReportParameters(val) {
let printParamList = JSON.parse(JSON.stringify(this.printParamList))
getReportParameters(val.reportId).then(({data}) => { getReportParameters(val.reportId).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
this.reportParamList = data.data 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
}
}
}
} }
} }
}) })

26
src/views/modules/labelPrint/outer-box-label.vue

@ -415,10 +415,12 @@ export default {
// 选中模板列表 // 选中模板列表
reportFileList: [], reportFileList: [],
// 手工参数 // 手工参数
param:[]
param: []
}, },
// 模板参数列表 // 模板参数列表
reportParamList: [], reportParamList: [],
// 记录打印参数
printParamList: [],
buttons: { buttons: {
settingLanguageList: '按语言设置', settingLanguageList: '按语言设置',
edit: '编辑', edit: '编辑',
@ -555,10 +557,11 @@ export default {
} }
this.orderInfo.reportFileList = this.selectReportFileList this.orderInfo.reportFileList = this.selectReportFileList
this.orderInfo.param = this.reportParamList this.orderInfo.param = this.reportParamList
ouBoxPrintLabel(this.orderInfo).then(({data}) =>{
if (data.code === 0 ){
this.printParamList = JSON.parse(JSON.stringify(this.reportParamList))
ouBoxPrintLabel(this.orderInfo).then(({data}) => {
if (data.code === 0) {
this.$message.success(data.msg) this.$message.success(data.msg)
}else {
} else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
}) })
@ -639,11 +642,24 @@ export default {
}) })
}, },
// 获取柱模版打印参数
// 获取主模版打印参数
searchReportParameters(val) { searchReportParameters(val) {
let printParamList = JSON.parse(JSON.stringify(this.printParamList))
// 本次打印参数
getReportParameters(val.reportId).then(({data}) => { getReportParameters(val.reportId).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
// 上次保留打印参数
this.reportParamList = data.data 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
}
}
}
}
} }
}) })
}, },

Loading…
Cancel
Save