Commit 024c30d7 authored by jingnan's avatar jingnan 👀

供外出库明细取值修改

parent a17b65f7
...@@ -185,7 +185,7 @@ export default { ...@@ -185,7 +185,7 @@ export default {
}, },
mounted() { mounted() {
if (this.basicData.id) { if (this.basicData.id) {
this.getEditData() this.getEditData(this.basicData.id)
} }
}, },
methods: { methods: {
...@@ -270,14 +270,63 @@ export default { ...@@ -270,14 +270,63 @@ export default {
}) })
}) })
}, },
getEditData() { getEditData(id) {
const data = this.basicData.inStorageRequestItems const params = {
data.forEach(item => { 'pageFrom': 1,
if (item.inventoryJobResponses) { 'pageSize': 999,
item.allocatedAmount = this.sumArray(item.inventoryJobResponses, 'allocatedAmount') 'searchItems': {
} 'children': [
{
'items': [
{
'fieldName': 'outStorageRequestId',
'operator': 'EQ',
'value': id
}
],
'operator': 'AND'
}
],
'items': [],
'operator': 'AND'
},
'openProps': [
{
'name': 'extMaterial',
'openProps': [
{
'name': 'extUnit'
},
{
'name': 'resType2'
}
]
},
{
'name': 'inventory'
},
{
'name': 'inventoryJobResponses'
}
],
'sortItem': [
{
'fieldName': 'modifyTime',
'sortOrder': 'desc'
}
]
}
this.$api.searchApi(`InStorageRequestItem`, params).then(res => {
const data = res.items.content || []
data.forEach(item => {
if (item.inventoryJobResponses) {
item.allocatedAmount = this.sumArray(item.inventoryJobResponses, 'allocatedAmount')
}
})
this.tableData = data
}).catch((err) => {
console.log(err)
}) })
this.tableData = data
}, },
sumArray(array, key) { sumArray(array, key) {
let sum = 0 let sum = 0
......
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