|
|
@ -1,4 +1,3 @@ |
|
|
|
|
|
|
|
import { |
|
|
|
getManagementPrecision, |
|
|
|
getBalanceByFilter |
|
|
@ -38,7 +37,7 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
export function getBalanceByManagementPrecision(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
export function getBalanceByManagementPrecision(label, locationCode, fromInventoryStatuses, callback) { |
|
|
|
let result = { |
|
|
|
list: [], |
|
|
|
success: true, |
|
|
@ -53,25 +52,25 @@ export function getBalanceByManagementPrecision(label, locationCode,fromInventor |
|
|
|
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); |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'BY_BATCH': |
|
|
|
byBatch(label, locationCode,fromInventoryStatuses, res => { |
|
|
|
byBatch(label, locationCode, fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'BY_QUANTITY': |
|
|
|
byQuantity(label, locationCode,fromInventoryStatuses, res => { |
|
|
|
byQuantity(label, locationCode, fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'BY_UNIQUEID': |
|
|
|
byUniqueId(label,fromInventoryStatuses, res => { |
|
|
|
byUniqueId(label, fromInventoryStatuses, res => { |
|
|
|
res.managementPrecision = managementPrecision; |
|
|
|
callback(res); |
|
|
|
}); |
|
|
@ -90,7 +89,7 @@ export function getBalanceByManagementPrecision(label, locationCode,fromInventor |
|
|
|
* @param {Object} locationCode |
|
|
|
* @param {Object} callback |
|
|
|
*/ |
|
|
|
export function byPacking(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
export function byPacking(label, locationCode, fromInventoryStatuses, callback) { |
|
|
|
let result = { |
|
|
|
success: true, |
|
|
|
message: '', |
|
|
@ -117,7 +116,7 @@ export function byPacking(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
action: "==", |
|
|
|
value: locationCode |
|
|
|
}) |
|
|
|
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ |
|
|
|
if (fromInventoryStatuses != null && fromInventoryStatuses != "") { |
|
|
|
filters.push({ |
|
|
|
column: "inventoryStatus", |
|
|
|
action: "in", |
|
|
@ -157,7 +156,7 @@ export function byPacking(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
* @param {Object} locationCode |
|
|
|
* @param {Object} callback |
|
|
|
*/ |
|
|
|
export function byBatch(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
export function byBatch(label, locationCode, fromInventoryStatuses, callback) { |
|
|
|
var filters = [] |
|
|
|
filters.push({ |
|
|
|
column: "itemCode", |
|
|
@ -175,7 +174,7 @@ export function byBatch(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
value: locationCode |
|
|
|
}) |
|
|
|
|
|
|
|
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ |
|
|
|
if (fromInventoryStatuses != null && fromInventoryStatuses != "") { |
|
|
|
filters.push({ |
|
|
|
column: "inventoryStatus", |
|
|
|
action: "in", |
|
|
@ -218,7 +217,7 @@ export function byBatch(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
* @param {Object} locationCode |
|
|
|
* @param {Object} callback |
|
|
|
*/ |
|
|
|
export function byQuantity(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
export function byQuantity(label, locationCode, fromInventoryStatuses, callback) { |
|
|
|
let result = { |
|
|
|
success: true, |
|
|
|
message: '', |
|
|
@ -237,7 +236,7 @@ export function byQuantity(label, locationCode,fromInventoryStatuses, callback) |
|
|
|
value: locationCode |
|
|
|
}) |
|
|
|
|
|
|
|
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ |
|
|
|
if (fromInventoryStatuses != null && fromInventoryStatuses != "") { |
|
|
|
filters.push({ |
|
|
|
column: "inventoryStatus", |
|
|
|
action: "in", |
|
|
@ -274,7 +273,7 @@ export function byQuantity(label, locationCode,fromInventoryStatuses, callback) |
|
|
|
* @param {Object} locationCode |
|
|
|
* @param {Object} callback |
|
|
|
*/ |
|
|
|
export function byUniqueId(label, locationCode,fromInventoryStatuses, callback) { |
|
|
|
export function byUniqueId(label, locationCode, fromInventoryStatuses, callback) { |
|
|
|
let param = { |
|
|
|
packingNumber: label.packingNumber |
|
|
|
}; |
|
|
@ -291,7 +290,7 @@ export function byUniqueId(label, locationCode,fromInventoryStatuses, callback) |
|
|
|
value: label.packingNumber |
|
|
|
}) |
|
|
|
|
|
|
|
if(fromInventoryStatuses!=null&&fromInventoryStatuses!=""){ |
|
|
|
if (fromInventoryStatuses != null && fromInventoryStatuses != "") { |
|
|
|
filters.push({ |
|
|
|
column: "inventoryStatus", |
|
|
|
action: "in", |
|
|
|