Commit a30a1365 authored by jingnan's avatar jingnan 👀

领用出库申请联调

parent c7abfcac
...@@ -89,14 +89,13 @@ export default { ...@@ -89,14 +89,13 @@ export default {
} }
}, },
data() { data() {
const that = this
return { return {
componentProp: { componentProp: {
showSubType: true showSubType: true
}, },
dialogShow: false, dialogShow: false,
selectionRows: [], selectionRows: [],
tableData: that.basicData.inStorageRequestItems || [], tableData: [],
dialogTitle: '', dialogTitle: '',
componentName: '', componentName: '',
cmpOptions: { cmpOptions: {
...@@ -123,6 +122,17 @@ export default { ...@@ -123,6 +122,17 @@ export default {
handler(val) { handler(val) {
this.$set(this.cmpOptions, 'layKey', `add_outStorageUseItem_${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() { created() {
...@@ -175,8 +185,8 @@ export default { ...@@ -175,8 +185,8 @@ export default {
}, },
occupy() { occupy() {
const form = Object.assign({}, this.form) const form = Object.assign({}, this.form)
form.aircraftType = form.aircraftType.split('+')[1] form.aircraftType = form.aircraftType.includes('+') && form.aircraftType.split('+')[1] || form.aircraftType
form.sorties = form.sorties.split('+')[1] form.sorties = form.sorties.includes('+') && form.sorties.split('+')[1] || form.sorties
const param = { const param = {
...form, ...form,
...@@ -259,10 +269,11 @@ export default { ...@@ -259,10 +269,11 @@ export default {
}) })
}, },
submitEvent({ formData, addContinue }) { 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') { if (this.basicData.useRequestType === 'swapUse') {
this.tableData.forEach((item, index) => { this.tableData.forEach((item, index) => {
if (item.extSupportingItemVO && item.extSupportingItemVO.id === formData[0].extSupportingItemVO.id) { if (item.extSupportingItemVO && item.extSupportingItemVO.id === formData[0].extSupportingItemVO.id) {
// this.tableData[index] = formData[0]
this.$set(this.tableData, index, formData[0]) this.$set(this.tableData, index, formData[0])
} }
}) })
......
...@@ -119,19 +119,19 @@ export default { ...@@ -119,19 +119,19 @@ export default {
'searchItems': { 'searchItems': {
'items': [ 'items': [
{ {
'fieldName': 'extSupporting.extProcessPlanId', 'fieldName': 'extSupporting.extProcessPlan.serialNumber',
'operator': 'EQ', 'operator': 'EQ',
'value': this.form.aoNo 'value': this.form.aoNo || ''
}, },
{ {
'fieldName': 'extMaterial.resType2Id', 'fieldName': 'extMaterial.resType2Id',
'operator': 'EQ', 'operator': 'EQ',
'value': this.form.extResourceTypeId 'value': this.form.extResourceTypeId || ''
}, },
{ {
'fieldName': 'sorties', 'fieldName': 'sorties',
'operator': 'EQ', '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 { ...@@ -174,7 +174,12 @@ export default {
this.$api.searchApi(`ExtSupportingItem`, params).then(res => { this.$api.searchApi(`ExtSupportingItem`, params).then(res => {
if (!res.items || !res.items.content) return if (!res.items || !res.items.content) return
this.tableData = res.items.content.map(item => { 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 return item
}) })
// this.$bus.$emit('swapUseData', []) // 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