diff --git a/src/pages/count/job/countLightDetail.vue b/src/pages/count/job/countLightDetail.vue
index cac0aec5..c74b69e1 100644
--- a/src/pages/count/job/countLightDetail.vue
+++ b/src/pages/count/job/countLightDetail.vue
@@ -8,7 +8,7 @@
库位代码
{{locationCode}}
-
+
管理精度
{{getManageMode(manageMode)}}
@@ -49,8 +49,7 @@
+ :pdaCountBalanceQuery="true" :isShowHistory="false" @getCountScanResult='getCountScanResult'>
{
-
- if(this.manageMode=="BY_BATCH"){
- let mainItem = this.dataList.find(r =>
- r.itemCode == subItem.itemCode &&
- r.batch == subItem.batch &&
- r.inventoryStatus == subItem.inventoryStatus)
- //主列表存在数据
+ //列表中删除了已经扫描的数据
+ if (returnData.recordList.length == 0) {
+ if (this.manageMode == "BY_BATCH") {
+ var mainItem = this.dataList.find(r =>
+ r.itemCode == returnData.itemCode &&
+ r.batch == returnData.batch &&
+ r.inventoryStatus == returnData.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
+ } else if (this.manageMode == "BY_QUANTITY") {
+ var mainItem = this.dataList.find(r =>
+ r.itemCode == returnData.itemCode &&
+ r.inventoryStatus == returnData.inventoryStatus)
+
+ if (mainItem) {
+ mainItem.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 = []
+ }
+ } else {
+ var addList = []
+ returnData.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 {
+ //主列表不存在数据,添加到主列表
+ 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)
}
- 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
+ } else if (this.manageMode == "BY_QUANTITY") {
+ var 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)
}
- detail.recordList.push(recordItem)
- addList.push(detail)
}
- }
-
-
-
- })
- if (addList.length > 0) {
- this.dataList = this.dataList.concat(addList)
+ })
+ if (addList.length > 0) {
+ this.dataList = this.dataList.concat(addList)
+ }
}
this.updateList(false);
@@ -429,7 +446,7 @@
//已经存在,数量累加
if (subItem) {
- subItem.handleQty = calc.add(Number(subItem.handleQty), Number(subItem.handleQty))
+ subItem.handleQty = calc.add(Number(subItem.handleQty), Number(scanItem.handleQty))
} else {
mainItem.recordList.unshift(scanItem)
}
@@ -483,7 +500,7 @@
//已经存在,数量累加
if (subItem) {
subItem.toPackingNumber = "",
- subItem.toBatch = ""
+ subItem.toBatch = ""
subItem.handleQty = calc.add(Number(subItem.handleQty), Number(scanItem.handleQty))
} else {
item.recordList.unshift(scanItem)
@@ -507,7 +524,7 @@
//已经存在,数量累加
if (subItem) {
subItem.toPackingNumber = "",
- subItem.toBatch = ""
+ subItem.toBatch = ""
subItem.handleQty = calc.add(Number(subItem.handleQty), Number(scanItem.handleQty))
} else {
detail.recordList.unshift(scanItem)
@@ -570,13 +587,13 @@
calcScanCount() {
this.dataList.forEach(main => {
+ var handleQty = 0;
if (main.recordList) {
- var handleQty = 0;
main.recordList.forEach(item => {
handleQty = calc.add(handleQty, Number(item.handleQty))
})
- main.currentQty = handleQty
}
+ main.currentQty = handleQty
})
},
diff --git a/src/pages/count/job/countRecord.vue b/src/pages/count/job/countRecord.vue
index 4bc9f809..20a23b14 100644
--- a/src/pages/count/job/countRecord.vue
+++ b/src/pages/count/job/countRecord.vue
@@ -69,6 +69,8 @@
this.dataContent.itemDesc1=this.dataList[0].itemDesc1;
this.dataContent.itemCode = this.dataList[0].itemCode;
this.dataContent.uom =this.dataList[0].uom;
+ this.dataContent.batch=this.dataList[0].batch;
+ this.dataContent.inventoryStatus=this.dataList[0].inventoryStatus;
var handleQty = 0;
this.dataList.forEach(item => {
handleQty = calc.add(Number(handleQty), Number(item.handleQty))
@@ -82,7 +84,17 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from === 'backbutton') {
- uni.$emit('refreshData',this.dataList);
+ var dataContent={
+ locationCode : this.fromLocationCode,
+ itemName :this.dataContent.itemName,
+ itemDesc1:this.dataContent.itemDesc1,
+ itemCode : this.dataContent.itemCode,
+ uom :this.dataContent.uom,
+ batch:this.dataContent.batch,
+ inventoryStatus:this.dataContent.inventoryStatus,
+ recordList:this.dataList
+ }
+ uni.$emit('refreshData', dataContent);
uni.navigateBack();
return true;
}