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,63 +92,177 @@ export default {
},
tbPrintCode(selectRows) {
const selection = selectRows
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 (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('请选择库位后打印!')
}
// 获取需要打印的数据
this.config.prints = []
selection.forEach((row) => {
// 出库数据打印对应的响应信息
if (row.subTypeName.includes('OutStorage')) {
const targetJobResponses = row.inventoryJobResponses.filter(item => item.subTypeName.includes('JobResponseOutStorage')) || []
targetJobResponses.forEach((response) => {
if (row.subTypeName === 'JobResponseOutStorageMatch') {
this.config = Object.assign({}, this.config, {
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({
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: [
{ 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.lotNo },
{ label: '系列号/序列号', value: row.serialNo },
{ label: '机型', value: row.airModel },
{ label: '验收单号', value: responseInventory.testNo },
{ label: '库位号', value: responseInventory.workunit || '' },
{ label: '验收单号', value: row.inventory && row.inventory.testNo || row.testNo || '' },
{ label: '库位号', value: row.inventory && row.inventory.workunit || row.extWorkUnitCode || '' },
{ 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()
},
print() {
......
......@@ -9,7 +9,7 @@
>
<el-form-item label="架次">
<el-input
v-model="form.reqNo"
v-model="form.sorties"
clearable
type="input"
placeholder="请输入"
......@@ -17,14 +17,14 @@
</el-form-item>
<el-form-item label="AO号">
<el-input
v-model="form.reqBill"
v-model="form.serialNumber"
clearable
type="input"
placeholder="请输入"
/>
</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-form-item>
</el-form>
......@@ -47,13 +47,12 @@
<!-- 带复选框 -->
<template v-for="(item, subIndex) in request.lists">
<li
v-if="item.pbo"
:key="item.id"
class="blue"
:class="{active: subIndex === active,'active-background':item.activeBackground}"
:style="{ color: item.pbo.hasLostItem?'blue':'red' }"
@click="checkClick(item)"
>
<!-- :style="{ color: item.pbo.hasLostItem?'blue':'red' }" -->
<el-checkbox
v-model="item.checked"
style="margin-right: 6px;"
......@@ -61,11 +60,8 @@
@change="v => checkboxChange(v, index, subIndex,item)"
/>
<i class="el-icon-document" />
{{ item.pbo.ao.sorties }} ,{{ item.pbo.ao.serialNumber || '暂无' }},
{{ item.pbo && item.pbo.commitName }},
{{
item.pbo && item.pbo.commitTime.split(' ')[0]
}}
{{ item.sorties }} ,{{ item.serialNumber || '暂无' }},
{{ item.plannerName }}
</li>
</template>
</ul>
......@@ -75,11 +71,17 @@
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
name: 'MatchConfirmLeft',
components: {
},
props: {
selectData: {
type: Object,
default: () => {}
}
},
data() {
return {
loading: false,
......@@ -99,297 +101,70 @@ export default {
},
// 申请列表
requests: [
{ 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
}
}] }
{ name: '配套出库', lists: [] }
]
}
},
mounted() {
// this.init()
this.init()
this.$bus.$on('reloadModuleList', (hasFlag) => {
this.$nextTick(() => {
this.init()
})
})
},
methods: {
// 加载左侧申请表
init() {
this.loading = true
Promise.all([
// 配套出库
this.match()
]).then(result => {
const [match] = result
this.requests.find(item => item.name === '配套出库').lists = match
}).catch(error => error).finally(() => {
this.loading = false
})
},
// 配套出库
match() {
// const searchData = obtainedParams.searchFormData ? obtainedParams.searchFormData.items : []
// const extraItems = obtainedParams.extraBaseParams || []
const params = {
'searchQueryCondition': {
'indices': [
'RequestOutStorageMatch'
],
'pageFrom': 1,
'pageSize': 999,
'searchItems': {
'items': [
{
'fieldName': 'state',
'operator': 'EQ',
'value': 'Outside'
},
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': 'RequestOutStorageMatch'
}
],
'operator': 'AND'
},
'openProps': [
'pageFrom': 1,
'pageSize': 9999,
'searchItems': {
'children': [],
'items': [
{
'pageFrom': 1,
'pageSize': 1,
'name': 'ao',
'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': 'serialNumber',
'operator': 'LIKE',
'value': this.form.serialNumber || ''
},
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
'fieldName': 'sorties',
'operator': 'LIKE',
'value': this.form.sorties || ''
}
]
],
'operator': 'AND'
},
'taskSearchVO': {
'assignee': localStorage.getItem('userId')
}
'openProps': [
{
'name': 'joExecutePlan'
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
return new Promise((resolve, reject) => {
this.HttpRequest(
'/DxWorkflowTask/outStorageTaskList/match/confirm',
params,
'post'
).then(res => {
resolve(res.items.content.map(item => {
return {
...item,
checked: false
}
}))
}).catch(err => console.log(err)).finally(() => {})
this.loading = true
// return new Promise((resolve, reject) => {
post(`OutStorageRequest/search/matchStorageExpireToAo?taskDefinitionKey=${this.selectData.taskKey}`, params).then(res => {
const data = res.items.content.map(item => {
return {
...item,
plannerName: item.joExecutePlan && item.joExecutePlan[0] && item.joExecutePlan[0].planner && item.joExecutePlan[0].planner.name,
checked: false
}
})
this.requests.find(item => item.name === '配套出库').lists = data
}).catch(err => console.log(err)).finally(() => {
this.loading = false
})
},
// 提交表单
submitForm() {
searchForm() {
this.init()
},
// 重置表单
......@@ -404,9 +179,9 @@ export default {
// 手风琴切换
collapseChange(active) {
// 三期出库
active === '4' && this.$emit('type2:init', 'RequestOutStorageExpire')
// 召回出库
active === '5' && this.$emit('type2:init', 'RequestOutStorageRecall')
// active === '4' && this.$emit('type2:init', 'RequestOutStorageExpire')
// // 召回出库
// active === '5' && this.$emit('type2:init', 'RequestOutStorageRecall')
},
// 切换复选框
checkboxChange(v, index, subIndex, item) {
......
......@@ -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