|
|
@ -131,8 +131,58 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) { |
|
|
|
callback(result); |
|
|
|
}) |
|
|
|
} |
|
|
|
//通过父包装查询
|
|
|
|
export function getBalanceByManagementPrecisionByPacking(label, packageInfo,locationCode, fromInventoryStatuses, callback) { |
|
|
|
let result = { |
|
|
|
list: [], |
|
|
|
success: true, |
|
|
|
message: '' |
|
|
|
}; |
|
|
|
let params = { |
|
|
|
itemCodes: [label.itemCode], |
|
|
|
locationCode: locationCode |
|
|
|
}; |
|
|
|
// let jsonParem = JSON.stringify(param)
|
|
|
|
getManagementPrecision(params).then(res => { |
|
|
|
let managementPrecision = res.data[0].ManagementPrecision; |
|
|
|
switch (managementPrecision) { |
|
|
|
case 'BY_PACKAGING': |
|
|
|
byPacking(label, packageInfo,locationCode, fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'BY_BATCH': |
|
|
|
byBatch(label, locationCode, fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'BY_QUANTITY': |
|
|
|
byQuantity(label, locationCode, fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'BY_UNIQUEID': |
|
|
|
byUniqueId(label, fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
break; |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
let result = { |
|
|
|
success: false, |
|
|
|
message: error |
|
|
|
}; |
|
|
|
callback(result); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
export function getBalanceByManagementPrecision(label, locationCode, fromInventoryStatuses, callback) { |
|
|
|
|
|
|
|
|
|
|
|
export function getBalanceByManagementPrecision(label,locationCode, fromInventoryStatuses, callback) { |
|
|
|
let result = { |
|
|
|
list: [], |
|
|
|
success: true, |
|
|
@ -147,7 +197,7 @@ export function getBalanceByManagementPrecision(label, locationCode, fromInvento |
|
|
|
let managementPrecision = res.data[0].ManagementPrecision; |
|
|
|
switch (managementPrecision) { |
|
|
|
case 'BY_PACKAGING': |
|
|
|
byPacking(label, locationCode, fromInventoryStatuses, res => { |
|
|
|
byPacking(label, "",locationCode, fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
@ -184,18 +234,30 @@ export function getBalanceByManagementPrecision(label, locationCode, fromInvento |
|
|
|
* @param {Object} locationCode |
|
|
|
* @param {Object} callback |
|
|
|
*/ |
|
|
|
export function byPacking(label, locationCode, fromInventoryStatuses, callback) { |
|
|
|
export function byPacking(label, packageInfo,locationCode, fromInventoryStatuses, callback) { |
|
|
|
let result = { |
|
|
|
success: true, |
|
|
|
message: '', |
|
|
|
data: {} |
|
|
|
}; |
|
|
|
var filters = [] |
|
|
|
filters.push({ |
|
|
|
column: "packingNumber", |
|
|
|
action: "==", |
|
|
|
value: label.packingNumber |
|
|
|
}) |
|
|
|
|
|
|
|
if (packageInfo&&packageInfo.parentNumber) { |
|
|
|
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber; |
|
|
|
filters.push({ |
|
|
|
column: "packingNumber", |
|
|
|
action: "in", |
|
|
|
value: packingNumber |
|
|
|
}) |
|
|
|
} else { |
|
|
|
filters.push({ |
|
|
|
column: "packingNumber", |
|
|
|
action: "==", |
|
|
|
value: label.packingNumber |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
filters.push({ |
|
|
|
column: "itemCode", |
|
|
|
action: "==", |
|
|
|