Commit cd04336c authored by jingnan's avatar jingnan 👀

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

parent 841daf1d
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
</template> </template>
<script> <script>
import VueQr from 'vue-qr' import VueQr from 'vue-qr'
import { post } from '@/utils/http'
export default { export default {
name: 'PrintTagForConfig', name: 'PrintTagForConfig',
components: { components: {
...@@ -91,63 +92,177 @@ export default { ...@@ -91,63 +92,177 @@ export default {
}, },
tbPrintCode(selectRows) { tbPrintCode(selectRows) {
const selection = selectRows const selection = selectRows
if (selection[0].subTypeName === 'InStorageMatchBackItem' || selection[0].subTypeName === 'InStorageUseBackItem' || selection[0].subTypeName === 'InStorageOutBackItem') { if (selection[0].subTypeName === 'OutStorageMatchItem') { // 打印AO标签
if (selection.find(item => !item.inventory || !item.inventory.workunit)) return this.$utils.showMessageWarning('请选择库位后打印!') const ids = selection.map((item) => item.outStorageRequestId) || []
} const params = {
// 获取需要打印的数据 'searchItems': {
this.config.prints = [] 'children': [
selection.forEach((row) => { {
'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('请选择库位后打印!')
}
// 获取需要打印的数据
this.config.prints = []
selection.forEach((row) => {
// 出库数据打印对应的响应信息 // 出库数据打印对应的响应信息
if (row.subTypeName.includes('OutStorage')) { if (row.subTypeName === 'JobResponseOutStorageMatch') {
const targetJobResponses = row.inventoryJobResponses.filter(item => item.subTypeName.includes('JobResponseOutStorage')) || []
targetJobResponses.forEach((response) => {
this.config = Object.assign({}, this.config, { this.config = Object.assign({}, this.config, {
visible: true visible: true
}) })
const responseInventory = response.inventory || {} 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({ this.config.prints.push({
text: response.id || row.id, 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, {
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')
entryResponse && (JobResponseInStorageEntryId = entryResponse.id)
}
this.config.prints.push({
text: JobResponseInStorageEntryId || row.id,
propertys: [ propertys: [
{ label: '编码', value: row.extMaterial.resCode }, { label: '编码', value: row.extMaterial.resCode },
{ label: '名称', value: row.extMaterial.resName }, { label: '名称', value: row.extMaterial.resName },
{ label: '型号/牌号/件号', value: row.extMaterial.modelNo }, { label: '型号/牌号/件号', value: row.extMaterial.modelNo },
{ label: '规格', value: row.extMaterial.spec }, { label: '规格', value: row.extMaterial.spec },
{ label: '批号', value: responseInventory.lotNo }, { label: '批号', value: row.lotNo },
{ label: '系列号/序列号', value: responseInventory.serno }, { label: '系列号/序列号', value: row.serialNo },
{ label: '机型', value: row.airModel }, { label: '机型', value: row.airModel },
{ label: '验收单号', value: responseInventory.testNo }, { label: '验收单号', value: row.inventory && row.inventory.testNo || row.testNo || '' },
{ label: '库位号', value: responseInventory.workunit || '' }, { label: '库位号', value: row.inventory && row.inventory.workunit || row.extWorkUnitCode || '' },
{ label: '备注', value: row.remark || '' } { 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')
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 || row.testNo || '' },
{ label: '库位号', value: row.inventory && row.inventory.workunit || row.extWorkUnitCode || '' },
{ label: '备注', value: row.remark || '' }
]
})
}
})
this.print() this.print()
}, },
print() { print() {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
> >
<el-form-item label="架次"> <el-form-item label="架次">
<el-input <el-input
v-model="form.reqNo" v-model="form.sorties"
clearable clearable
type="input" type="input"
placeholder="请输入" placeholder="请输入"
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
</el-form-item> </el-form-item>
<el-form-item label="AO号"> <el-form-item label="AO号">
<el-input <el-input
v-model="form.reqBill" v-model="form.serialNumber"
clearable clearable
type="input" type="input"
placeholder="请输入" placeholder="请输入"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitForm()">查询</el-button> <el-button type="primary" @click="searchForm()">查询</el-button>
<el-button @click="resetForm()">重置</el-button> <el-button @click="resetForm()">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -47,13 +47,12 @@ ...@@ -47,13 +47,12 @@
<!-- 带复选框 --> <!-- 带复选框 -->
<template v-for="(item, subIndex) in request.lists"> <template v-for="(item, subIndex) in request.lists">
<li <li
v-if="item.pbo"
:key="item.id" :key="item.id"
class="blue" class="blue"
:class="{active: subIndex === active,'active-background':item.activeBackground}" :class="{active: subIndex === active,'active-background':item.activeBackground}"
:style="{ color: item.pbo.hasLostItem?'blue':'red' }"
@click="checkClick(item)" @click="checkClick(item)"
> >
<!-- :style="{ color: item.pbo.hasLostItem?'blue':'red' }" -->
<el-checkbox <el-checkbox
v-model="item.checked" v-model="item.checked"
style="margin-right: 6px;" style="margin-right: 6px;"
...@@ -61,11 +60,8 @@ ...@@ -61,11 +60,8 @@
@change="v => checkboxChange(v, index, subIndex,item)" @change="v => checkboxChange(v, index, subIndex,item)"
/> />
<i class="el-icon-document" /> <i class="el-icon-document" />
{{ item.pbo.ao.sorties }} ,{{ item.pbo.ao.serialNumber || '暂无' }}, {{ item.sorties }} ,{{ item.serialNumber || '暂无' }},
{{ item.pbo && item.pbo.commitName }}, {{ item.plannerName }}
{{
item.pbo && item.pbo.commitTime.split(' ')[0]
}}
</li> </li>
</template> </template>
</ul> </ul>
...@@ -75,11 +71,17 @@ ...@@ -75,11 +71,17 @@
</div> </div>
</template> </template>
<script> <script>
import { post } from '@/utils/http'
export default { export default {
name: 'MatchConfirmLeft', name: 'MatchConfirmLeft',
components: { components: {
}, },
props: {
selectData: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
loading: false, loading: false,
...@@ -99,297 +101,70 @@ export default { ...@@ -99,297 +101,70 @@ export default {
}, },
// 申请列表 // 申请列表
requests: [ requests: [
{ name: '配套出库', lists: [ { name: '配套出库', lists: [] }
{
'processTask': null,
'pbo': {
'dxClassname': 'com.tf.mes.vo.storage.OutStorageRequestVo',
'id': 214793230327000,
'createTime': '2021-10-22 00:47:10',
'modifyTime': null,
'creatorId': null,
'creator': null,
'modifierId': null,
'modifier': null,
'subTypeName': 'RequestOutStorageMatch',
'subTypeDisplayName': null,
'operator': null,
'contextId': null,
'dxContextId': null,
'dxContextIdType': null,
'dxContext': null,
'sandboxId': null,
'lifecycleTemplateId': null,
'state': 'Outside',
'sourceInventoryRequestProductUnitLink': null,
'remark': null,
'scheduleRequestLinks': null,
'reqNo': 'AO-CAS-CA-31-D2303001-0200',
'seqNo': null,
'billTypeCode': null,
'billType': null,
'sourceInventoryRequestUsageLink': null,
'targetInventoryRequestUsageLink': null,
'dynamicAttrs': null,
'needTime': null,
'reqStatusCode': null,
'isRejectCode': null,
'isReject': null,
'ao': {
'dxClassname': 'com.tf.mes.vo.gy.DxProcessPlanVo',
'id': null,
'createTime': null,
'modifyTime': null,
'creatorId': null,
'creator': null,
'modifierId': null,
'modifier': null,
'subTypeName': null,
'subTypeDisplayName': null,
'operator': null,
'contextId': null,
'dxContextId': null,
'dxContextIdType': null,
'dxContext': null,
'sandboxId': null,
'lifecycleTemplateId': null,
'state': null,
'masterId': null,
'master': null,
'versionId': null,
'version': null,
'versionKey': null,
'latest': null,
'iterationId': null,
'note': null,
'predecessorId': null,
'originId': null,
'origin': null,
'predecessor': null,
'displayVersion': 'null.null',
'checkOuted': null,
'lockerId': null,
'locker': null,
'lockNote': null,
'lockDate': null,
'sourceDxProcessUsageLink': null,
'targetDxProcessUsageLink': null,
'description': null,
'longDescription': null,
'views': null,
'objFileLinks': null,
'dxProcessExecutorRoutes': null,
'dxProcessExecutorRoutes1': null,
'dxProcessExecutorRoutes2': null,
'sourceDxProcessPartLink': null,
'serialNumber': 'AO-CAS-CA-31-D2303001-0200',
'dynamicAttrs': null,
'targetDxPartProcessPlanLink': null,
'gaceVersion': null,
'versionChangeDesc': null,
'keyOperation': null,
'firstCheckFlag': null,
'workHour': null,
'carryCount': null,
'undoneCount': null,
'completeCount': null,
'fitRatesCount': null,
'notFitRatesCount': null,
'fitRates': null,
'countWorkHour': null,
'planeType': null,
'sorties': '1003',
'serialNo': null,
'stateDisplayName': null,
'materName': null,
'materNo': null,
'executorVoList': null,
'dxProcessOperationVos': null,
'parenId': null,
'dxProcessPlanVos': null,
'wrProductionVo': null,
'sandboxPlanWrVo': null,
'joExecutePlanVo': null,
'sandboxPlanExecPlanVo': null,
'workDescription': null,
'businessNo': null,
'needTime': null,
'prepareDescription': null,
'itemFitRates': 0,
'itemState': 0,
'changeBasis': null,
'dictSeq': null,
'isRenew': null,
'dxProcessPlanChanges': null,
'ppId': null,
'problemStatus': null,
'receiveTime': null,
'jdName': null,
'shName': null,
'zsName': null,
'pzName': null,
'scheduledEnd': null,
'scheduledStart': null,
'requestVo': null,
'progress': null,
'startCount': null,
'zuofei': null,
'isRunning': null,
'number': null,
'name': null,
'dxViewId': null
},
'reqBill': null,
'aoNumber': null,
'reqDept': null,
'reqStatus': null,
'aoId': null,
'aoIdType': null,
'reqDeptId': null,
'reqDeptIdType': null,
'aircraftType': null,
'receiveUser': null,
'phone': null,
'deliveryTime': null,
'gaceVer': null,
'receiveAddress': null,
'stateDisplayName': null,
'orProduction': null,
'orProductionId': null,
'orProductionIdType': null,
'dxProductArea': null,
'dxProductAreaId': null,
'dxProductAreaIdType': null,
'keyID': null,
'dxProductWorkCenter': null,
'materialType': null,
'materialTypeId': null,
'materialTypeIdType': null,
'dxProductWorkCenterId': null,
'dxProductWorkCenterIdType': null,
'scheduledStart': null,
'scheduledEnd': null,
'dxProcessPlanPositionId': null,
'fitRates': null,
'withdrawal': null,
'hasItem': null,
'hasLostItem': true,
'outFitRates': null,
'componentsFitRates': null,
'standardComponentFitRates': null,
'isOk': null,
'commitName': '齐鑫思',
'commitTime': '2021-12-25 12:05:21',
'taskId': 'e0ddc711-6537-11ec-9f21-0cda411d949c',
'note': null,
'isOpen': null,
'typeName': null,
'objFileLinks': null
}
}] }
] ]
} }
}, },
mounted() { mounted() {
// this.init() this.init()
this.$bus.$on('reloadModuleList', (hasFlag) => {
this.$nextTick(() => {
this.init()
})
})
}, },
methods: { methods: {
// 加载左侧申请表 // 加载左侧申请表
init() { init() {
this.loading = true // const searchData = obtainedParams.searchFormData ? obtainedParams.searchFormData.items : []
Promise.all([ // const extraItems = obtainedParams.extraBaseParams || []
// 配套出库
this.match()
]).then(result => {
const [match] = result
this.requests.find(item => item.name === '配套出库').lists = match
}).catch(error => error).finally(() => {
this.loading = false
})
},
// 配套出库
match() {
const params = { const params = {
'searchQueryCondition': { 'pageFrom': 1,
'indices': [ 'pageSize': 9999,
'RequestOutStorageMatch' 'searchItems': {
], 'children': [],
'pageFrom': 1, 'items': [
'pageSize': 999,
'searchItems': {
'items': [
{
'fieldName': 'state',
'operator': 'EQ',
'value': 'Outside'
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': 'RequestOutStorageMatch'
}
],
'operator': 'AND'
},
'openProps': [
{ {
'pageFrom': 1, 'fieldName': 'serialNumber',
'pageSize': 1, 'operator': 'LIKE',
'name': 'ao', 'value': this.form.serialNumber || ''
'openProps': [ },
{
'pageFrom': 1,
'pageSize': 1,
'name': 'master',
'searchItems': {
'items': [
{
'fieldName': 'number',
'operator': 'LIKE',
'value': this.form.ao
},
{
'fieldName': 'sorties',
'operator': 'LIKE',
'value': this.form.sorties
}
],
'operator': 'OR'
},
'parentFilter': true
}
],
'parentFilter': true
}
],
'sortItem': [
{ {
'fieldName': 'modifyTime', 'fieldName': 'sorties',
'sortOrder': 'desc' 'operator': 'LIKE',
'value': this.form.sorties || ''
} }
] ],
'operator': 'AND'
}, },
'taskSearchVO': { 'openProps': [
'assignee': localStorage.getItem('userId') {
} 'name': 'joExecutePlan'
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
} }
return new Promise((resolve, reject) => { this.loading = true
this.HttpRequest( // return new Promise((resolve, reject) => {
'/DxWorkflowTask/outStorageTaskList/match/confirm', post(`OutStorageRequest/search/matchStorageExpireToAo?taskDefinitionKey=${this.selectData.taskKey}`, params).then(res => {
params, const data = res.items.content.map(item => {
'post' return {
).then(res => { ...item,
resolve(res.items.content.map(item => { plannerName: item.joExecutePlan && item.joExecutePlan[0] && item.joExecutePlan[0].planner && item.joExecutePlan[0].planner.name,
return { checked: false
...item, }
checked: false })
} this.requests.find(item => item.name === '配套出库').lists = data
})) }).catch(err => console.log(err)).finally(() => {
}).catch(err => console.log(err)).finally(() => {}) this.loading = false
}) })
}, },
// 提交表单 searchForm() {
submitForm() {
this.init() this.init()
}, },
// 重置表单 // 重置表单
...@@ -404,9 +179,9 @@ export default { ...@@ -404,9 +179,9 @@ export default {
// 手风琴切换 // 手风琴切换
collapseChange(active) { collapseChange(active) {
// 三期出库 // 三期出库
active === '4' && this.$emit('type2:init', 'RequestOutStorageExpire') // active === '4' && this.$emit('type2:init', 'RequestOutStorageExpire')
// 召回出库 // // 召回出库
active === '5' && this.$emit('type2:init', 'RequestOutStorageRecall') // active === '5' && this.$emit('type2:init', 'RequestOutStorageRecall')
}, },
// 切换复选框 // 切换复选框
checkboxChange(v, index, subIndex, item) { checkboxChange(v, index, subIndex, item) {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<dee-as-com <dee-as-com
ref="outStorageMatch" ref="outStorageMatch"
table-height="auto" table-height="auto"
:basic-data=" { selectData: selectData }"
:lay-config="{ typeName: 'OutStorageMatch', layKey: 'batchSign_OutStorageMatch'}" :lay-config="{ typeName: 'OutStorageMatch', layKey: 'batchSign_OutStorageMatch'}"
@selectionChange="selectionChange" @selectionChange="selectionChange"
/> />
...@@ -47,15 +48,20 @@ export default { ...@@ -47,15 +48,20 @@ export default {
methods: { methods: {
selectionChange(val) { selectionChange(val) {
this.selectionRows = val this.selectionRows = val
const requestIds = val && val.map(item => item.id)
this.$refs.outStorageMatchItem.$refs.asCom.getData(requestIds)
}, },
selectionChange_item(val) { selectionChange_item(val) {
this.selectionItemRows = val this.selectionItemRows = val
const itemIds = val && val.map(item => item.id)
this.$refs.jobResponseOutStorageMatch.$refs.asCom.getData(itemIds)
}, },
selectionChange_jobRes(val) { selectionChange_jobRes(val) {
this.selectionJobResRows = val this.selectionJobResRows = val
}, },
init() { init(checkList) {
this.$refs.outStorageMatch.$refs.asCom.getData() const aoIds = checkList && checkList.map(item => item.id)
this.$refs.outStorageMatch.$refs.asCom.getData(aoIds)
} }
} }
} }
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<template slot="paneL"> <template slot="paneL">
<Left <Left
ref="left" ref="left"
:select-data="selectData"
@checkbox:change="checkboxChange" @checkbox:change="checkboxChange"
/> />
</template> </template>
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
<Right <Right
v-show="subTypeName === '1'" v-show="subTypeName === '1'"
ref="right" ref="right"
:select-data="selectData"
@left:init="() => this.$refs.left.init()" @left:init="() => this.$refs.left.init()"
/> />
<!-- empty --> <!-- 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