Commit 7d7db309 authored by xioln's avatar xioln

供外出库问题修改

parent 8f443767
......@@ -27,6 +27,7 @@
layKey: 'table',
}"
@selectionChange="jobResponseSelectionChange"
@requestSuccess="onRequestSuccess"
/>
</div>
</template>
......@@ -55,7 +56,8 @@ export default {
data() {
return {
infoSelection: [],
jobResponseSelection: []
jobResponseSelection: [],
isRefresh: false
}
},
computed: {},
......@@ -107,8 +109,16 @@ export default {
}
},
refeach() {
this.isRefresh = true
this.$refs.adjustOccupyInfo.$refs.asCom.getData()
this.$refs.adjustOccupyjobResponse.$refs.asCom.getData()
},
onRequestSuccess(res) {
if (this.isRefresh) {
const inventoryJobResponses = res.items.content || []
this.$emit('refreshResponses', { inventoryJobResponses })
}
this.isRefresh = false
}
}
}
......
......@@ -19,7 +19,7 @@
<addOutStorageOfferDetailDialog ref="addOffer" :basic-data="form" @submitEvent="addData" />
</dee-dialog>
<dee-dialog width="70%" title="调整占用" :visible.sync="aoDialogVisible" @on-cancel="aoCancel">
<OutStorageOfferAdjustOccupy ref="adjustOffer" :select-datas="selectTableData" :form="form" @submitEvent="addData" />
<OutStorageOfferAdjustOccupy ref="adjustOffer" :select-datas="selectTableData" :form="form" @submitEvent="addData" @refreshResponses="refreshResponses" />
</dee-dialog>
<dee-dialog width="70%" title="查看占用" :visible.sync="viewVisible" @on-cancel="viewCancel">
<dee-as-com
......@@ -167,7 +167,8 @@ export default {
param: {},
aoDialogVisible: false,
selectTableData: [],
viewVisible: false
viewVisible: false,
applyId: null
}
},
computed: {
......@@ -223,7 +224,13 @@ export default {
subTypeName: 'OutStorageOut',
operator: 'ADD'
}
if (this.applyId) {
param.operator = 'MODIFY'
param.id = this.applyId
}
post('OutStorageRequest/outStorageOut/saveAndTake', param).then(res => {
this.$utils.findForm(this).applyId = res.items.id
this.applyId = res.items.id
this.$utils.showMessageSuccess('占用成功!')
const data = res.items.inStorageRequestItems
const tableData = [...this.tableData]
......@@ -265,45 +272,13 @@ export default {
})
},
getEditData() {
this.tableData.push(...this.basicData.inStorageRequestItems)
// const param = {
// 'searchItems': {
// 'items': [
// { 'fieldName': 'subTypeName', 'operator': 'EQ', 'value': 'OutStorageOut' },
// { 'fieldName': 'id', 'operator': 'EQ', 'value': id }
// ]
// },
// openProps: [{
// 'name': 'inStorageRequestItems',
// 'openProps': [{
// 'name': 'extMaterial',
// 'openProps': [{
// 'name': 'resType2'
// }, {
// 'name': 'extUnit'
// }]
// }, {
// 'name': 'extDxSipplier'
// }, {
// 'name': 'creator'
// }, {
// 'name': 'storageZone'
// },
// {
// 'name': 'inventoryJobResponses'
// }]
// }]
// }
// post('OutStorageRequest/search', param).then(res => {
// console.log('res', res)
// const data = res.items.content[0].inStorageRequestItems
// data.forEach(item => {
// item.allocatedAmount = this.sumArray(item.inventoryJobResponses, 'allocatedAmount')
// })
// this.tableData = data
// }).catch((err) => {
// console.log(err)
// })
const data = this.basicData.inStorageRequestItems
data.forEach(item => {
if (item.inventoryJobResponses) {
item.allocatedAmount = this.sumArray(item.inventoryJobResponses, 'allocatedAmount')
}
})
this.tableData = data
},
sumArray(array, key) {
let sum = 0
......@@ -311,6 +286,9 @@ export default {
sum += Number(array[i][key])
}
return sum
},
refreshResponses({ inventoryJobResponses }) {
this.selectTableData[0].allocatedAmount = this.$utils.sumArray(inventoryJobResponses, 'allocatedAmount')
}
}
}
......
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