diff --git a/src/api/httpRequest3.js b/src/api/httpRequest3.js index ea11f417..259148f3 100644 --- a/src/api/httpRequest3.js +++ b/src/api/httpRequest3.js @@ -113,7 +113,6 @@ function service(options = {}) { }) // #endif // #ifdef H5 - console.log("网s络H5", navigator.onLine) if (navigator.onLine) { uni.request(options); } else { diff --git a/src/common/balance.js b/src/common/balance.js index d6f9b4a8..da7d7e16 100644 --- a/src/common/balance.js +++ b/src/common/balance.js @@ -132,7 +132,7 @@ export async function getManagementPrecisions(itemCodes, locationCode, callback) }) } //通过父包装查询 -export function getBalanceByManagementPrecisionByPacking(label, packageInfo,locationCode, fromInventoryStatuses, callback) { +export function getBalanceByManagementPrecisionByPacking(label, packageInfo,locationCode, fromInventoryStatuses, pdaCountBalanceQuery,callback) { let result = { list: [], success: true, @@ -147,25 +147,25 @@ export function getBalanceByManagementPrecisionByPacking(label, packageInfo,loca let managementPrecision = res.data[0].ManagementPrecision; switch (managementPrecision) { case 'BY_PACKAGING': - byPacking(label, packageInfo,locationCode, fromInventoryStatuses, res => { + byPacking(label, packageInfo,locationCode, fromInventoryStatuses,pdaCountBalanceQuery, res => { res.managementPrecision = managementPrecision; callback(res); }); break; case 'BY_BATCH': - byBatch(label, locationCode, fromInventoryStatuses, res => { + byBatch(label, locationCode, fromInventoryStatuses,pdaCountBalanceQuery, res => { res.managementPrecision = managementPrecision; callback(res); }); break; case 'BY_QUANTITY': - byQuantity(label, locationCode, fromInventoryStatuses, res => { + byQuantity(label, locationCode, fromInventoryStatuses,pdaCountBalanceQuery, res => { res.managementPrecision = managementPrecision; callback(res); }); break; case 'BY_UNIQUEID': - byUniqueId(label, fromInventoryStatuses, res => { + byUniqueId(label, fromInventoryStatuses,pdaCountBalanceQuery, res => { res.managementPrecision = managementPrecision; callback(res); }); @@ -234,7 +234,7 @@ export function getBalanceByManagementPrecision(label,locationCode, fromInventor * @param {Object} locationCode * @param {Object} callback */ -export function byPacking(label, packageInfo,locationCode, fromInventoryStatuses, callback) { +export function byPacking(label, packageInfo,locationCode, fromInventoryStatuses,pdaCountBalanceQuery, callback) { let result = { success: true, message: '', @@ -281,7 +281,14 @@ export function byPacking(label, packageInfo,locationCode, fromInventoryStatuses value: status }) } - + + if(pdaCountBalanceQuery){ + filters.push({ + column: "pdaCountBalanceQuery", + action: "==", + value: "true" + }) + } var params = { @@ -315,7 +322,7 @@ export function byPacking(label, packageInfo,locationCode, fromInventoryStatuses * @param {Object} locationCode * @param {Object} callback */ -export function byBatch(label, locationCode, fromInventoryStatuses, callback) { +export function byBatch(label, locationCode, fromInventoryStatuses,pdaCountBalanceQuery, callback) { var filters = [] filters.push({ column: "itemCode", @@ -346,6 +353,14 @@ export function byBatch(label, locationCode, fromInventoryStatuses, callback) { value: status }) } + + if(pdaCountBalanceQuery){ + filters.push({ + column: "pdaCountBalanceQuery", + action: "==", + value: "true" + }) + } var params = { filters: filters, @@ -382,7 +397,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,pdaCountBalanceQuery, callback) { let result = { success: true, message: '', @@ -419,6 +434,14 @@ export function byQuantity(label, locationCode, fromInventoryStatuses, callback) value: status }) } + + if(pdaCountBalanceQuery){ + filters.push({ + column: "pdaCountBalanceQuery", + action: "==", + value: "true" + }) + } var params = { filters: filters, @@ -449,7 +472,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,pdaCountBalanceQuery, callback) { let param = { packingNumber: label.packingNumber }; @@ -474,6 +497,14 @@ export function byUniqueId(label, locationCode, fromInventoryStatuses, callback) value: status }) } + + if(pdaCountBalanceQuery){ + filters.push({ + column: "pdaCountBalanceQuery", + action: "==", + value: "true" + }) + } var params = { filters: filters, diff --git a/src/mycomponents/scan/winComScanBalance.vue b/src/mycomponents/scan/winComScanBalance.vue index 04d835e2..6944e35e 100644 --- a/src/mycomponents/scan/winComScanBalance.vue +++ b/src/mycomponents/scan/winComScanBalance.vue @@ -28,9 +28,6 @@ diff --git a/src/pages/count/job/countLightDetail.vue b/src/pages/count/job/countLightDetail.vue index 8fcdce0f..cac0aec5 100644 --- a/src/pages/count/job/countLightDetail.vue +++ b/src/pages/count/job/countLightDetail.vue @@ -7,7 +7,11 @@ 库位代码 {{locationCode}} - + + + + 管理精度 + {{getManageMode(manageMode)}} @@ -45,6 +49,7 @@ @@ -128,8 +133,8 @@ index: 0, dataList: [], managementList: [], - managementType: '', - isOpen: false + isOpen: false, + manageMode:"" }; }, @@ -165,7 +170,15 @@ computed() {}, methods: { - + getManageMode(value){ + var manageMode="" + if(value=='BY_BATCH'){ + manageMode="按批次" + }else if(value=='BY_QUANTITY') { + manageMode="按数量" + } + return manageMode + }, getDetail() { var that = this; uni.showLoading({ @@ -179,6 +192,7 @@ } else { that.jobContent = res.data; that.jobContent.status = "2"; + that.manageMode=that.jobContent.manageMode that.locationCode = that.jobContent.locationCode; that.dataList = res.data.subList; @@ -198,19 +212,25 @@ refreshData(recordList) { //记录的数据刷新列表 var addList = [] - - this.dataList.forEach(mainItem => { - mainItem.recordList = []; - recordList.forEach(subItem => { - //在主表中,添加到recordList - if (mainItem.itemCode == subItem.itemCode && - mainItem.batch == subItem.batch && - mainItem.inventoryStatus == subItem.inventoryStatus) - { + recordList.forEach(subItem => { + + if(this.manageMode=="BY_BATCH"){ + let mainItem = this.dataList.find(r => + r.itemCode == subItem.itemCode && + r.batch == subItem.batch && + r.inventoryStatus == subItem.inventoryStatus) + //主列表存在数据 + if (mainItem) { + mainItem.scaned = true; + mainItem.recordList = [] mainItem.recordList.push(subItem) - }else { - //不在主表中,添加主表明细 + } else { + //主列表不存在数据,添加到主列表 var detail = this.createBackAddDetailInfo(subItem) + + if (!detail.recordList) { + detail.recordList = [] + } var recordItem = { scaned: true, isNewJobDetail: "true", @@ -231,18 +251,59 @@ balanceQty: subItem.balanceQty, locationCode: subItem.locationCode } - detail.recordList=[]; detail.recordList.push(recordItem) addList.push(detail) } - }) + }else if(this.manageMode=="BY_QUANTITY"){ + let mainItem = this.dataList.find(r => + r.itemCode == subItem.itemCode && + r.inventoryStatus == subItem.inventoryStatus) + //主列表存在数据 + if (mainItem) { + mainItem.scaned = true; + mainItem.recordList = [] + mainItem.recordList.push(subItem) + } else { + //主列表不存在数据,添加到主列表 + var detail = this.createBackAddDetailInfo(subItem) + + if (!detail.recordList) { + detail.recordList = [] + } + var recordItem = { + scaned: true, + isNewJobDetail: "true", + itemCode: subItem.itemCode, + itemName: subItem.itemName, + itemDesc1: subItem.itemDesc1, + itemDesc2: subItem.itemDesc2, + packingNumber: subItem.packingNumber, + toPackingNumber: subItem.toPackingNumber, + toBatch: subItem.toBatch, + batch: subItem.batch, + inventoryStatus: subItem.inventoryStatus, + qty: subItem.qty, + handleQty: subItem.handleQty, + uom: subItem.uom, + packUnit: subItem.packUnit, + packQty: subItem.packQty, + balanceQty: subItem.balanceQty, + locationCode: subItem.locationCode + } + detail.recordList.push(recordItem) + addList.push(detail) + } + } + + + + }) - if (addList.length > 0) { this.dataList = this.dataList.concat(addList) } - this.updateList(false); + this.updateList(false); }, @@ -307,11 +368,10 @@ var batch = result.label.batch var inventoryStatus = result.balance ? result.balance.inventoryStatus : "OK" var qty = result.balance ? result.balance.qty : 0; - var handleQty =qty!=0?qty:result.label.qty - + var handleQty = result.label.qty + var uom = pack.uom var locationCode = this.locationCode - this.managementType = managementPrecision; var recordItem = { scaned: true, @@ -344,7 +404,7 @@ if (this.isOpen) { this.isOpen = false //按批次管理 - if (this.managementType == 'BY_BATCH') { + if (this.manageMode == 'BY_BATCH') { //按物料、箱码、批次、状态匹配 let mainItem = this.dataList.find(r => r.itemCode == scanItem.itemCode && @@ -398,11 +458,10 @@ detail.recordList.unshift(scanItem) } - this.dataList.unshift(detail) } - } else if (this.managementType == 'BY_QUANTITY') { + } else if (this.manageMode == 'BY_QUANTITY') { let item = this.dataList.find(r => r.itemCode == scanItem.itemCode && r.locationCode == scanItem.locationCode && @@ -420,10 +479,11 @@ res.locatioCode == scanItem.locatioCode && res.inventoryStatus == scanItem.inventoryStatus ) - subItem.toPackingNumber = "", - subItem.toBatch = "" + //已经存在,数量累加 if (subItem) { + subItem.toPackingNumber = "", + subItem.toBatch = "" subItem.handleQty = calc.add(Number(subItem.handleQty), Number(scanItem.handleQty)) } else { item.recordList.unshift(scanItem) @@ -443,10 +503,11 @@ res.batch == scanItem.batch && res.inventoryStatus == scanItem.inventoryStatus ) - subItem.toPackingNumber = "", - subItem.toBatch = "" + //已经存在,数量累加 if (subItem) { + subItem.toPackingNumber = "", + subItem.toBatch = "" subItem.handleQty = calc.add(Number(subItem.handleQty), Number(scanItem.handleQty)) } else { detail.recordList.unshift(scanItem)