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