Commit d55b0574 authored by jingnan's avatar jingnan 👀

打印标签组件修改(出库根据响应打印)

parent ae07e733
......@@ -97,30 +97,56 @@ export default {
// 获取需要打印的数据
this.config.prints = []
selection.forEach((row) => {
this.config = Object.assign({}, this.config, {
visible: true
})
let JobResponseInStorageEntryId = ''
// 打印标签二维码扫描结果展示入库响应的id
if (row.inventoryJobResponses && row.inventoryJobResponses.length) {
const entryResponse = row.inventoryJobResponses.find(el => el.subTypeName === 'JobResponseInEntry' || el.subTypeName.includes('JobResponseOutStorage'))
entryResponse && (JobResponseInStorageEntryId = entryResponse.id)
// 出库数据打印对应的响应信息
if (row.subTypeName.includes('OutStorage')) {
const targetJobResponses = row.inventoryJobResponses.filter(item => item.subTypeName.includes('JobResponseOutStorage')) || []
targetJobResponses.forEach((response) => {
this.config = Object.assign({}, this.config, {
visible: true
})
const responseInventory = response.inventory || {}
this.config.prints.push({
text: response.id || row.id,
propertys: [
{ label: '编码', value: row.extMaterial.resCode },
{ label: '名称', value: row.extMaterial.resName },
{ label: '型号/牌号/件号', value: row.extMaterial.modelNo },
{ label: '规格', value: row.extMaterial.spec },
{ label: '批号', value: responseInventory.lotNo },
{ label: '系列号/序列号', value: responseInventory.serno },
{ label: '机型', value: row.airModel },
{ label: '验收单号', value: responseInventory.testNo },
{ label: '库位号', value: responseInventory.workunit || '' },
{ label: '备注', value: row.remark || '' }
]
})
})
} else { // 入库打印标签
this.config = Object.assign({}, this.config, {
visible: true
})
let JobResponseInStorageEntryId = ''
// 打印标签二维码扫描结果展示入库响应的id
if (row.inventoryJobResponses && row.inventoryJobResponses.length) {
const entryResponse = row.inventoryJobResponses.find(el => el.subTypeName === 'JobResponseInEntry' || el.subTypeName.includes('JobResponseOutStorage'))
entryResponse && (JobResponseInStorageEntryId = entryResponse.id)
}
this.config.prints.push({
text: JobResponseInStorageEntryId || row.id,
propertys: [
{ label: '编码', value: row.extMaterial.resCode },
{ label: '名称', value: row.extMaterial.resName },
{ label: '型号/牌号/件号', value: row.extMaterial.modelNo },
{ label: '规格', value: row.extMaterial.spec },
{ label: '批号', value: row.lotNo },
{ label: '系列号/序列号', value: row.serialNo },
{ label: '机型', value: row.airModel },
{ label: '验收单号', value: row.inventory && row.inventory.testNo },
{ label: '库位号', value: row.inventory && row.inventory.workunit || '' },
{ label: '备注', value: row.remark || '' }
]
})
}
this.config.prints.push({
text: JobResponseInStorageEntryId || row.id,
propertys: [
{ label: '编码', value: row.extMaterial.resCode },
{ label: '名称', value: row.extMaterial.resName },
{ label: '型号/牌号/件号', value: row.extMaterial.modelNo },
{ label: '规格', value: row.extMaterial.spec },
{ label: '批号', value: row.lotNo },
{ label: '系列号/序列号', value: row.serialNo },
{ label: '机型', value: row.airModel },
{ label: '验收单号', value: row.inventory && row.inventory.testNo },
{ label: '库位号', value: row.inventory && row.inventory.workunit || '' },
{ label: '备注', value: row.remark || '' }
]
})
})
this.print()
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment