Commit 024c30d7 authored by jingnan's avatar jingnan 👀

供外出库明细取值修改

parent a17b65f7
......@@ -185,7 +185,7 @@ export default {
},
mounted() {
if (this.basicData.id) {
this.getEditData()
this.getEditData(this.basicData.id)
}
},
methods: {
......@@ -270,14 +270,63 @@ export default {
})
})
},
getEditData() {
const data = this.basicData.inStorageRequestItems
getEditData(id) {
const params = {
'pageFrom': 1,
'pageSize': 999,
'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)
})
},
sumArray(array, key) {
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