Commit 7d7db309 authored by xioln's avatar xioln

供外出库问题修改

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