Commit cd04336c authored by jingnan's avatar jingnan 👀

批量签审配套出库确认联调

parent 841daf1d
......@@ -57,6 +57,7 @@
</template>
<script>
import VueQr from 'vue-qr'
import { post } from '@/utils/http'
export default {
name: 'PrintTagForConfig',
components: {
......@@ -91,6 +92,77 @@ export default {
},
tbPrintCode(selectRows) {
const selection = selectRows
if (selection[0].subTypeName === 'OutStorageMatchItem') { // 打印AO标签
const ids = selection.map((item) => item.outStorageRequestId) || []
const params = {
'searchItems': {
'children': [
{
'items': [
{
'fieldName': 'extSupportings.outStorageRequests.id',
'operator': 'IN',
'value': ids
}
],
'operator': 'OR'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'extSupportings',
'openProps': [
{
'name': 'outStorageRequests',
'openProps': [
{
'name': 'extWorkCenter'
}
]
}
]
}
]
}
post(`ExtProcessPlan/search`, params).then((res) => {
// 获取需要打印的数据
this.config.prints = []
res.items.content.forEach((item) => {
let extWorkCenterName = ''
if (item.extSupportings && item.extSupportings[0] && item.extSupportings[0].outStorageRequests && item.extSupportings[0].outStorageRequests.length) {
const selectedItems = []
const allWorkCenterName = item.extSupportings[0].outStorageRequests.map(el => el.extWorkCenter && el.extWorkCenter.extname || '') || []
allWorkCenterName.forEach(m => {
if (!selectedItems.find(d => d.id === m.id)) {
selectedItems.push(m)
}
})
extWorkCenterName = allWorkCenterName.join(',')
} else {
extWorkCenterName = ''
}
this.config = Object.assign({}, this.config, {
visible: true
})
this.config.prints.push({
text: item.id || '',
propertys: [
{ label: '机型', value: item.planeType },
{ label: '架次', value: item.sorties },
{ label: 'AO号', value: item.serialNumber },
{ label: 'AO名称', value: item.name },
{ label: '库房', value: extWorkCenterName }
]
})
})
})
.catch((err) => console.log(err))
.finally(() => {})
} else {
if (selection[0].subTypeName === 'InStorageMatchBackItem' || selection[0].subTypeName === 'InStorageUseBackItem' || selection[0].subTypeName === 'InStorageOutBackItem') {
if (selection.find(item => !item.inventory || !item.inventory.workunit)) return this.$utils.showMessageWarning('请选择库位后打印!')
}
......@@ -98,7 +170,49 @@ export default {
this.config.prints = []
selection.forEach((row) => {
// 出库数据打印对应的响应信息
if (row.subTypeName.includes('OutStorage')) {
if (row.subTypeName === 'JobResponseOutStorageMatch') {
this.config = Object.assign({}, this.config, {
visible: true
})
const jobOrderData = row.inventory && row.inventory.jobResponse && row.inventory.jobResponse.jobOrder || {}
const jobResInTest = jobOrderData && jobOrderData.inventoryJobResponses && jobOrderData.inventoryJobResponses.find(job => job.subTypeName === 'JobResponseInTest')
this.config.prints.push({
text: row.id,
propertys: [
{ label: '编码', value: jobOrderData.extMaterial.resCode },
{ label: '名称', value: jobOrderData.extMaterial.resName },
{ label: '型号/牌号/件号', value: jobOrderData.extMaterial.modelNo },
{ label: '规格', value: jobOrderData.extMaterial.spec },
{ label: '批号', value: jobOrderData.lotNo },
{ label: '系列/序列号', value: jobOrderData.serialNo },
{ label: '机型', value: jobOrderData.airModel },
{ label: '验收单号', value: row.inventory && row.inventory.testNo },
{ label: '保证保管期', value: jobResInTest.guaranteePeriod && jobResInTest.guaranteePeriod.replace(' 00:00:00', '') },
{ label: '贮存期', value: jobResInTest.qualityPeriod && jobResInTest.qualityPeriod.replace(' 00:00:00', '') },
{ label: '库位号', value: jobOrderData.workunit || '' },
{ label: '出库数量', value: row.allocatedAmount || '' },
{
label: '计量单位', value: jobOrderData.extMaterial.extUnit.unitName || '' },
{
label: 'AO号',
value: row.jobOrder && row.jobOrder.extSupportingItemVO &&
row.jobOrder.extSupportingItemVO.extSupporting &&
row.jobOrder.extSupportingItemVO.extSupporting.extProcessPlan &&
row.jobOrder.extSupportingItemVO.extSupporting.extProcessPlan.serialNumber
},
{
label: '领用依据',
value:
row.jobOrder && row.jobOrder.outStorageRequest && row.jobOrder.outStorageRequest.reqBill
},
{
label: '备注',
value: jobOrderData.remark || ''
}
]
})
// })
} else if (row.subTypeName.includes('OutStorage')) {
const targetJobResponses = row.inventoryJobResponses.filter(item => item.subTypeName.includes('JobResponseOutStorage')) || []
targetJobResponses.forEach((response) => {
this.config = Object.assign({}, this.config, {
......@@ -148,6 +262,7 @@ export default {
})
}
})
}
this.print()
},
print() {
......
......@@ -3,6 +3,7 @@
<dee-as-com
ref="outStorageMatch"
table-height="auto"
:basic-data=" { selectData: selectData }"
:lay-config="{ typeName: 'OutStorageMatch', layKey: 'batchSign_OutStorageMatch'}"
@selectionChange="selectionChange"
/>
......@@ -47,15 +48,20 @@ export default {
methods: {
selectionChange(val) {
this.selectionRows = val
const requestIds = val && val.map(item => item.id)
this.$refs.outStorageMatchItem.$refs.asCom.getData(requestIds)
},
selectionChange_item(val) {
this.selectionItemRows = val
const itemIds = val && val.map(item => item.id)
this.$refs.jobResponseOutStorageMatch.$refs.asCom.getData(itemIds)
},
selectionChange_jobRes(val) {
this.selectionJobResRows = val
},
init() {
this.$refs.outStorageMatch.$refs.asCom.getData()
init(checkList) {
const aoIds = checkList && checkList.map(item => item.id)
this.$refs.outStorageMatch.$refs.asCom.getData(aoIds)
}
}
}
......
......@@ -14,6 +14,7 @@
<template slot="paneL">
<Left
ref="left"
:select-data="selectData"
@checkbox:change="checkboxChange"
/>
</template>
......@@ -21,6 +22,7 @@
<Right
v-show="subTypeName === '1'"
ref="right"
:select-data="selectData"
@left:init="() => this.$refs.left.init()"
/>
<!-- empty -->
......
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