Commit 375c9135 authored by jingnan's avatar jingnan 👀

打印标签相关代码修改

parent c18a3b0d
...@@ -70,6 +70,14 @@ export default { ...@@ -70,6 +70,14 @@ export default {
value: { value: {
type: [Number, String, Object], type: [Number, String, Object],
default: () => '' default: () => ''
},
formAttrs: {
type: Object,
default: () => {}
},
scope: {
type: Object,
default: () => {}
} }
}, },
data() { data() {
...@@ -189,7 +197,8 @@ export default { ...@@ -189,7 +197,8 @@ export default {
this.$api.searchApi('ExtDxProductWorkUnit', querys).then(res => { this.$api.searchApi('ExtDxProductWorkUnit', querys).then(res => {
this.options = res.items.content.map(row => { this.options = res.items.content.map(row => {
return { return {
value: row.id, // 批量移库打印标签需要使用到code
value: this.scope && this.scope.column && this.scope.column.property === 'currExtWorkUnitId' ? `${row.id}/${row.extcode}` : row.id,
label: row.extcode label: row.extcode
} }
}) })
...@@ -214,14 +223,16 @@ export default { ...@@ -214,14 +223,16 @@ export default {
if (querys.pageNumber === 1) { if (querys.pageNumber === 1) {
options = arr.map(row => { options = arr.map(row => {
return { return {
value: row.id, // 批量移库打印标签需要使用到code
value: this.scope && this.scope.column && this.scope.column.property === 'currExtWorkUnitId' ? `${row.id}/${row.extcode}` : row.id,
label: row.extcode label: row.extcode
} }
}) })
} else { } else {
options = [...this.options, ...arr.map(row => { options = [...this.options, ...arr.map(row => {
return { return {
value: row.id, // 批量移库打印标签需要使用到code
value: this.scope && this.scope.column && this.scope.column.property === 'currExtWorkUnitId' ? `${row.id}/${row.extcode}` : row.id,
label: row.extcode label: row.extcode
} }
})] })]
......
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
return { return {
inventoryId: item.id, inventoryId: item.id,
extWorkCenterId: extWorkCenterId, extWorkCenterId: extWorkCenterId,
extWorkUnitId: item.currExtWorkUnitId, extWorkUnitId: item.currExtWorkUnitId && item.currExtWorkUnitId.split('/') && Number(item.currExtWorkUnitId.split('/')[0]),
outsideAmount: item.currOutsideAmount, outsideAmount: item.currOutsideAmount,
disposeDes: item.currDisposeDes || '' disposeDes: item.currDisposeDes || ''
} }
...@@ -69,6 +69,7 @@ export default { ...@@ -69,6 +69,7 @@ export default {
} }
const reponse = await post('InventoryRequest/moveApplication/createMoveStorage', params) const reponse = await post('InventoryRequest/moveApplication/createMoveStorage', params)
this.$utils.showMessageSuccess(reponse.items) this.$utils.showMessageSuccess(reponse.items)
this.$bus.$emit('refreshMoveWarehouse')
this.$emit('cancel') this.$emit('cancel')
}, },
cancelEvent() { cancelEvent() {
......
...@@ -93,6 +93,20 @@ export default { ...@@ -93,6 +93,20 @@ export default {
tbPrintCode(selectRows) { tbPrintCode(selectRows) {
const selection = selectRows const selection = selectRows
if (selection[0].subTypeName === 'OutStorageMatchItem') { // 打印AO标签 if (selection[0].subTypeName === 'OutStorageMatchItem') { // 打印AO标签
this.printAoLabel(selection)
} else if (selection[0].subTypeName === 'InventoryFlow') { // 打印流水标签
this.printFlowLable(selection)
} else if (selection[0].subTypeName === 'Inventory') { // 打印移库标签
this.printMoveLibraryLabel(selection)
} else if (selection[0].subTypeName === 'JobResponseOutStorageMatch') { // 批量签审_配套出库响应打印标签
this.printBatchSignMatchJob(selection)
} else if (selection[0].subTypeName.includes('OutStorage')) { // 打印出库标签
this.printOutStorageLabel(selection)
} else { // 打印入库标签
this.printInStorageLabel(selection)
}
},
printAoLabel(selection) {
const ids = selection.map((item) => item.outStorageRequestId) || [] const ids = selection.map((item) => item.outStorageRequestId) || []
const params = { const params = {
'searchItems': { 'searchItems': {
...@@ -158,24 +172,130 @@ export default { ...@@ -158,24 +172,130 @@ export default {
{ label: '库房', value: extWorkCenterName } { label: '库房', value: extWorkCenterName }
] ]
}) })
this.print()
}) })
}) })
.catch((err) => console.log(err)) .catch((err) => console.log(err))
.finally(() => {}) .finally(() => {})
},
printFlowLable(selection) {
// 获取需要打印的数据
this.config.prints = []
selection.forEach((item) => {
this.$message.closeAll()
this.config = Object.assign({}, this.config, {
visible: true
})
// 出库
if (item.flowType.includes('Out')) {
this.config.prints.push({
text: item.inJobResponseId || '',
propertys: [
{ label: '编码', value: item.materialName || '' },
{ label: '名称', value: item.materialCode || '' },
{
label: '型号/牌号/件号',
value: item.modelNo || ''
},
{ label: '规格', value: item.spec || '' },
{ label: '批号', value: item.lotNo || '' },
{ label: '系列号/序列号', value: item.serialNo || '' },
{ label: '机型', value: item.airModel || '' },
{ label: '验收单号', value: item.testNo || '' },
{ label: '保证保管期', value: item.guaranteePeriod &&
item.guaranteePeriod.replace(' 00:00:00', '') || '' },
{
label: '贮存期',
value:
item.qualityPeriod &&
item.qualityPeriod.replace(' 00:00:00', '') || ''
},
{ label: '库位号', value: item.workerUnit || '' },
{ label: '出库数量', value: item.amount || '' },
{
label: '计量单位',
value: item.unit || ''
},
{ label: 'AO号', value: item.seqNo && item.seqNo.split('-P') && item.seqNo.split('-P')[0] || '' },
{ label: '备注', value: item.remark || '' }
]
})
// 入库
} else { } else {
if (selection[0].subTypeName === 'InStorageMatchBackItem' || selection[0].subTypeName === 'InStorageUseBackItem' || selection[0].subTypeName === 'InStorageOutBackItem') { this.config.prints.push({
if (selection.find(item => !item.inventory || !item.inventory.workunit)) return this.$utils.showMessageWarning('请选择库位后打印!') text: item.inJobResponseId || '',
propertys: [
{ label: '编码', value: item.materialName || '' },
{ label: '名称', value: item.materialCode || '' },
{
label: '型号/牌号/件号',
value: item.modelNo || ''
},
{ label: '规格', value: item.spec || '' },
{ label: '批号', value: item.lotNo || '' },
{ label: '系列号/序列号', value: item.serialNo || '' },
{ label: '机型', value: item.airModel || '' },
{ label: '验收单号', value: item.testNo || '' },
{ label: '保证保管期', value: item.guaranteePeriod || '' },
{
label: '贮存期',
value:
item.qualityPeriod &&
item.qualityPeriod.replace(' 00:00:00', '')
},
{ label: '库位号', value: item.workerUnit || '' },
{ label: '备注', value: item.remark || '' }
]
})
} }
})
this.print()
},
printMoveLibraryLabel(selection) {
if (selection.find(item => (!item.currExtWorkUnitId))) return this.$utils.showMessageWarning('请选择库位后打印!')
// 获取需要打印的数据 // 获取需要打印的数据
this.config.prints = []
selection.forEach((item) => {
this.config = Object.assign({}, this.config, {
visible: true
})
this.config.prints.push({
text: item.jobResponseId || '',
propertys: [
{ label: '编码', value: item.materialName || '' },
{ label: '名称', value: item.materialCode || '' },
{
label: '型号/牌号/件号',
value: item.modelNo || ''
},
{ label: '规格', value: item.spec || '' },
{ label: '批号', value: item.lotNo || '' },
{ label: '系列号/序列号', value: item.serno || '' },
{ label: '机型', value: item.aircraftType || '' },
{ label: '验收单号', value: item.testNo || '' },
{ label: '保证保管期', value: item.guaranteePeriod || '' },
{
label: '贮存期',
value:
item.qualityPeriod &&
item.qualityPeriod.replace(' 00:00:00', '')
},
{ label: '库位号', value: item.currExtWorkUnitId && item.currExtWorkUnitId.split('/') && item.currExtWorkUnitId.split('/')[1] || '' },
{ label: '备注', value: item.remark || '' }
]
})
})
this.print()
},
printBatchSignMatchJob(selection) {
this.config.prints = [] this.config.prints = []
selection.forEach((row) => { selection.forEach((row) => {
// 出库数据打印对应的响应信息
if (row.subTypeName === 'JobResponseOutStorageMatch') {
this.config = Object.assign({}, this.config, { this.config = Object.assign({}, this.config, {
visible: true visible: true
}) })
const jobOrderData = row.inventory && row.inventory.jobResponse && row.inventory.jobResponse.jobOrder || {} const jobOrderData = row.inventory && row.inventory.jobResponse && row.inventory.jobResponse.jobOrder || null
const jobResInTest = jobOrderData && jobOrderData.inventoryJobResponses && jobOrderData.inventoryJobResponses.find(job => job.subTypeName === 'JobResponseInTest') if (jobOrderData) {
const jobResInTest = jobOrderData.inventoryJobResponses && jobOrderData.inventoryJobResponses.find(job => job.subTypeName === 'JobResponseInTest')
this.config.prints.push({ this.config.prints.push({
text: row.id, text: row.id,
propertys: [ propertys: [
...@@ -200,19 +320,24 @@ export default { ...@@ -200,19 +320,24 @@ export default {
row.jobOrder.extSupportingItemVO.extSupporting.extProcessPlan && row.jobOrder.extSupportingItemVO.extSupporting.extProcessPlan &&
row.jobOrder.extSupportingItemVO.extSupporting.extProcessPlan.serialNumber row.jobOrder.extSupportingItemVO.extSupporting.extProcessPlan.serialNumber
}, },
{ // {
label: '领用依据', // label: '领用依据',
value: // value:
row.jobOrder && row.jobOrder.outStorageRequest && row.jobOrder.outStorageRequest.reqBill // row.jobOrder && row.jobOrder.outStorageRequest && row.jobOrder.outStorageRequest.reqBill
}, // },
{ {
label: '备注', label: '备注',
value: jobOrderData.remark || '' value: jobOrderData.remark || ''
} }
] ]
}) })
// }) }
} else if (row.subTypeName.includes('OutStorage')) { })
this.print()
},
printOutStorageLabel(selection) {
this.config.prints = []
selection.forEach((row) => {
const targetJobResponses = row.inventoryJobResponses.filter(item => item.subTypeName.includes('JobResponseOutStorage')) || [] const targetJobResponses = row.inventoryJobResponses.filter(item => item.subTypeName.includes('JobResponseOutStorage')) || []
targetJobResponses.forEach((response) => { targetJobResponses.forEach((response) => {
this.config = Object.assign({}, this.config, { this.config = Object.assign({}, this.config, {
...@@ -235,14 +360,26 @@ export default { ...@@ -235,14 +360,26 @@ export default {
] ]
}) })
}) })
} else { // 入库打印标签 })
this.print()
},
printInStorageLabel(selection) {
if (selection[0].subTypeName === 'InStorageMatchBackItem' || selection[0].subTypeName === 'InStorageUseBackItem' || selection[0].subTypeName === 'InStorageOutBackItem') {
if (selection.find(item => ((!item.inventory || !item.inventory.workunit) && !item.extWorkUnitCods))) return this.$utils.showMessageWarning('请选择库位后打印!')
}
// 获取需要打印的数据
this.config.prints = []
selection.forEach((row) => {
this.config = Object.assign({}, this.config, { this.config = Object.assign({}, this.config, {
visible: true visible: true
}) })
let JobResponseInStorageEntryId = '' let JobResponseInStorageEntryId = ''
let testResponse = {}
let entryResponse = {}
// 打印标签二维码扫描结果展示入库响应的id // 打印标签二维码扫描结果展示入库响应的id
if (row.inventoryJobResponses && row.inventoryJobResponses.length) { if (row.inventoryJobResponses && row.inventoryJobResponses.length) {
const entryResponse = row.inventoryJobResponses.find(el => el.subTypeName === 'JobResponseInEntry') entryResponse = row.inventoryJobResponses.find(el => el.subTypeName === 'JobResponseInEntry')
testResponse = row.inventoryJobResponses.find(el => el.subTypeName === 'JobResponseInTest') || {}
entryResponse && (JobResponseInStorageEntryId = entryResponse.id) entryResponse && (JobResponseInStorageEntryId = entryResponse.id)
} }
this.config.prints.push({ this.config.prints.push({
...@@ -256,13 +393,13 @@ export default { ...@@ -256,13 +393,13 @@ export default {
{ label: '系列号/序列号', value: row.serialNo }, { label: '系列号/序列号', value: row.serialNo },
{ label: '机型', value: row.airModel }, { label: '机型', value: row.airModel },
{ label: '验收单号', value: row.inventory && row.inventory.testNo || row.testNo || '' }, { label: '验收单号', value: row.inventory && row.inventory.testNo || row.testNo || '' },
{ label: '保证保管期', value: testResponse.guaranteePeriod && testResponse.guaranteePeriod.replace(' 00:00:00', '') },
{ label: '贮存期', value: testResponse.qualityPeriod && testResponse.qualityPeriod.replace(' 00:00:00', '') },
{ label: '库位号', value: row.inventory && row.inventory.workunit || row.extWorkUnitCode || '' }, { label: '库位号', value: row.inventory && row.inventory.workunit || row.extWorkUnitCode || '' },
{ label: '备注', value: row.remark || '' } { label: '备注', value: row.remark || '' }
] ]
}) })
}
}) })
}
this.print() this.print()
}, },
print() { 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