Commit a30a1365 authored by jingnan's avatar jingnan 👀

领用出库申请联调

parent c7abfcac
......@@ -89,14 +89,13 @@ export default {
}
},
data() {
const that = this
return {
componentProp: {
showSubType: true
},
dialogShow: false,
selectionRows: [],
tableData: that.basicData.inStorageRequestItems || [],
tableData: [],
dialogTitle: '',
componentName: '',
cmpOptions: {
......@@ -123,6 +122,17 @@ export default {
handler(val) {
this.$set(this.cmpOptions, 'layKey', `add_outStorageUseItem_${val}`)
}
},
'basicData.id': {
immediate: true,
handler(val) {
if (this.basicData.inStorageRequestItems && (!this.tableData || !this.tableData.length)) {
this.tableData = this.basicData.inStorageRequestItems.map(item => {
item.allocatedAmount = this.$utils.sumArray(item.inventoryJobResponses, 'allocatedAmount')
return item
})
}
}
}
},
created() {
......@@ -175,8 +185,8 @@ export default {
},
occupy() {
const form = Object.assign({}, this.form)
form.aircraftType = form.aircraftType.split('+')[1]
form.sorties = form.sorties.split('+')[1]
form.aircraftType = form.aircraftType.includes('+') && form.aircraftType.split('+')[1] || form.aircraftType
form.sorties = form.sorties.includes('+') && form.sorties.split('+')[1] || form.sorties
const param = {
...form,
......@@ -259,10 +269,11 @@ export default {
})
},
submitEvent({ formData, addContinue }) {
const extMaterialIds = this.tableData.map(item => item.extMaterialId).includes(formData[0].extMaterialId)
if (extMaterialIds) return this.$utils.showMessageWarning('相同物料不能重复添加,请重新选择!')
if (this.basicData.useRequestType === 'swapUse') {
this.tableData.forEach((item, index) => {
if (item.extSupportingItemVO && item.extSupportingItemVO.id === formData[0].extSupportingItemVO.id) {
// this.tableData[index] = formData[0]
this.$set(this.tableData, index, formData[0])
}
})
......
......@@ -119,19 +119,19 @@ export default {
'searchItems': {
'items': [
{
'fieldName': 'extSupporting.extProcessPlanId',
'fieldName': 'extSupporting.extProcessPlan.serialNumber',
'operator': 'EQ',
'value': this.form.aoNo
'value': this.form.aoNo || ''
},
{
'fieldName': 'extMaterial.resType2Id',
'operator': 'EQ',
'value': this.form.extResourceTypeId
'value': this.form.extResourceTypeId || ''
},
{
'fieldName': 'sorties',
'operator': 'EQ',
'value': this.form.sorties.split('+')[1]
'value': this.form.sorties.includes('+') && this.form.sorties.split('+')[1] || this.form.sorties || ''
}
// 勿删,测试所需数据
// {
......@@ -174,7 +174,12 @@ export default {
this.$api.searchApi(`ExtSupportingItem`, params).then(res => {
if (!res.items || !res.items.content) return
this.tableData = res.items.content.map(item => {
item.isSwapUse = '否'
if (this.basicData.inStorageRequestItems) {
const extSupportingItemIds = this.basicData.inStorageRequestItems.map(item => item.extSupportingItemId)
extSupportingItemIds && extSupportingItemIds.includes(item.id) ? (item.isSwapUse = '是') : (item.isSwapUse = '否')
} else {
item.isSwapUse = '否'
}
return item
})
// this.$bus.$emit('swapUseData', [])
......
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