diff --git a/src/common/detail.js b/src/common/detail.js
index 89721e7a..3171ca38 100644
--- a/src/common/detail.js
+++ b/src/common/detail.js
@@ -141,6 +141,7 @@ export function createRecordInfo(detail, balance) {
//计算实际数量
export function calcHandleQty(detailSource) {
+ console.log(999,detailSource)
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
@@ -190,6 +191,8 @@ export function calcTreeHandleQty(detailSource) {
detail.handleQty = calc.add(detail.handleQty, pack.handleQty);
}
}
+ }else{
+ detail.handleQty = new Decimal(0).toNumber();
}
if(detail.handleQty){
item.handleQty = calc.add(item.handleQty, detail.handleQty);
diff --git a/src/common/label.js b/src/common/label.js
index 4615e948..82bec5b7 100644
--- a/src/common/label.js
+++ b/src/common/label.js
@@ -14,7 +14,7 @@ import {
getManagementPrecisions
} from '@/common/balance.js';
-export function getLabelInfo(scanMsg, headerType, callBack,locationCode) {
+export function getLabelInfo(scanMsg, headerType, callBack,locationCode,isHavePackNumber) {
if (scanMsg.length == 0) {
return null
}
@@ -42,17 +42,17 @@ export function getLabelInfo(scanMsg, headerType, callBack,locationCode) {
let type = header.substring(header.length - 1, header.length);
if (type == 'Q') //qrcode
{
- getQRCodeInfo(header, version, scanMsg, callBack,locationCode);
+ getQRCodeInfo(header, version, scanMsg, callBack,locationCode,isHavePackNumber);
}
// else if (type == 'B') //barcode
// {
// getBarCodeInfo(header, version, items[2], callBack);
// }
else { //直接输入文本
- getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode);
+ getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode,isHavePackNumber);
}
} else {
- getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode);
+ getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode,isHavePackNumber);
// let labelResult = {
// label: {
// labelType: "",
@@ -67,7 +67,7 @@ export function getLabelInfo(scanMsg, headerType, callBack,locationCode) {
}
}
-export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
+export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode,isHavePackNumber) {
//获取包装信息
let labelItem = labelDic.find(r => r.header == header && r.version == version);
if (labelItem == undefined) {
@@ -92,7 +92,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
};
labelDic.push(newItem);
- getLabelItems(newItem, scanMsg, callBack,locationCode);
+ getLabelItems(newItem, scanMsg, callBack,locationCode,isHavePackNumber);
}
}).catch(err => {
labelResult.success = false;
@@ -100,7 +100,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
callBack(err);
})
} else {
- getLabelItems(labelItem, scanMsg, callBack,locationCode);
+ getLabelItems(labelItem, scanMsg, callBack,locationCode,isHavePackNumber);
}
}
@@ -117,7 +117,9 @@ export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
const managementList = res.list;
managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING'
if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){
- packingNumber = ''
+ if(!isHavePackNumber){
+ packingNumber = ''
+ }
}
}
})
diff --git a/src/mycomponents/package/packageCard.vue b/src/mycomponents/package/packageCard.vue
index 8e583b13..6e30e527 100644
--- a/src/mycomponents/package/packageCard.vue
+++ b/src/mycomponents/package/packageCard.vue
@@ -6,7 +6,8 @@
-
+
+
@@ -19,12 +20,12 @@
+ :handleQty="Number(dataContent.handleQty)" :isShowStdPack="false" :isShowStatus="isShowStatus" :isShowRecommendQty='isShowRecommendQty'>
-
+
@@ -90,7 +91,15 @@
type: String,
default: '库位'
},
-
+ // 采购订单单独显示的包装号
+ isShowPackingNumberProps:{
+ type:Boolean,
+ default:false
+ },
+ isShowRecommendQty: {
+ type: Boolean,
+ default: true
+ }
},
watch: {
// 模拟扫描功能
diff --git a/src/mycomponents/package/packageList.vue b/src/mycomponents/package/packageList.vue
index 9d39d966..a4458dd7 100644
--- a/src/mycomponents/package/packageList.vue
+++ b/src/mycomponents/package/packageList.vue
@@ -1,13 +1,13 @@
-
-
+
+
+ @click="swipeClick($event,item,'parent',index)">
@@ -19,12 +19,13 @@
style=" width: 100%; background-color: antiquewhite;">
-
+
+ :isShowStatus="isShowPackListStatus"
+ :isShowRecommendQty='false'
+ :isShowBatch="false">
@@ -113,6 +114,11 @@
isEdit: {
type: Boolean,
default: false
+ },
+ // 采购订单单独显示的包装号
+ isShowPackingNumberProps:{
+ type:Boolean,
+ default:false
}
},
@@ -120,14 +126,14 @@
},
methods: {
- swipeClick(e, item, type) {
+ swipeClick(e, item, type,index,ele) {
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
if (type == 'parent') {
this.removeParent(item);
} else {
- this.remove(item)
+ this.remove(item,index,ele)
}
}
},
@@ -150,13 +156,14 @@
- remove(item) {
+ remove(item,index,ele) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.handleQty = null;
- this.$emit('updateData')
+ this.collapseChange()
+ this.$emit('updateData',ele,index)
this.$forceUpdate()
}
});
@@ -164,6 +171,7 @@
edit(item) {
this.editItem = item;
+ console.log(777,item)
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
},
collapseChange() {
diff --git a/src/mycomponents/qty/recommendQty.vue b/src/mycomponents/qty/recommendQty.vue
index a1406e0d..62043ada 100644
--- a/src/mycomponents/qty/recommendQty.vue
+++ b/src/mycomponents/qty/recommendQty.vue
@@ -1,10 +1,10 @@
-
+
- {{Number(dataContent.qty)}}
+ {{Number(dataContent.qty) ? Number(dataContent.qty) : ''}}
diff --git a/src/mycomponents/scan/winComScan.vue b/src/mycomponents/scan/winComScan.vue
index 9f34d28d..5f2e2c31 100644
--- a/src/mycomponents/scan/winComScan.vue
+++ b/src/mycomponents/scan/winComScan.vue
@@ -92,7 +92,12 @@
locationCode:{
type: String,
default: ''
- }
+ },
+ // 批次默认不显示包装号,采购收货要显示
+ isHavePackNumber: {
+ type: Boolean,
+ default: false
+ },
},
data() {
return {
@@ -195,7 +200,7 @@
}
})
}
- },this.locationCode);
+ },this.locationCode,this.isHavePackNumber);
}, 200);
}
},
diff --git a/src/mycomponents/scan/winScanPack.vue b/src/mycomponents/scan/winScanPack.vue
index e901a25d..68af998f 100644
--- a/src/mycomponents/scan/winScanPack.vue
+++ b/src/mycomponents/scan/winScanPack.vue
@@ -15,7 +15,7 @@
+ :isShowHistory="isShowHistory" :clearResult="true" :locationCode='locationCode' :isHavePackNumber='isHavePackNumber'>
@@ -53,7 +53,8 @@
data() {
return {
show: false,
- locationCode:''
+ locationCode:'',
+ isHavePackNumber:false,//默认是没有包装号不走包装接口
}
},
created() {
@@ -70,9 +71,10 @@
})
},
- openScanPopup(locationCode1) {
+ openScanPopup(locationCode1,isHavePackNumber) {
this.$refs.popup.open('bottom')
this.locationCode = locationCode1
+ this.isHavePackNumber = isHavePackNumber
setTimeout(res => {
this.getfocus()
}, 500)
diff --git a/src/pages/inventoryMove/coms/comMoveRecord.vue b/src/pages/inventoryMove/coms/comMoveRecord.vue
index de73700c..520cff17 100644
--- a/src/pages/inventoryMove/coms/comMoveRecord.vue
+++ b/src/pages/inventoryMove/coms/comMoveRecord.vue
@@ -389,6 +389,16 @@
return res
}
})
+ // 库存余额是0不让添加
+ if(!balance.qty){
+ this.$refs.comMessage.showConfirmWarningModal("物料号[" + result.label.itemCode + "]库存余额数量是0")
+ return
+ }
+ // 不可以大于库存余额数量
+ if(result.label.qty > balance.qty){
+ this.$refs.comMessage.showConfirmWarningModal("物料号[" + result.label.itemCode + "]数量[" + result.label.qty + "]不可以大于库存余额数量[" + balance.qty + "]")
+ return
+ }
if (item == undefined) {
var itemp = createItemInfoForLabel(balance, result.label);
let newDetail = createDetailInfoForLabel(balance, pack, result.label);
@@ -406,6 +416,8 @@
newDetail.managementTypeParams = managementTypeParams;
newDetail.fromLocationCode = result.fromLocationCode
newDetail.handleQty = Number(result.label.qty)
+ newDetail.packQty = balance.packQty;
+ newDetail.packUnit = balance.packUnit;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
@@ -414,7 +426,6 @@
this.$refs.okToHoldRecordPackRef.showOne = false
} else {
var detail = ''
- console.log(9988,managementTypeParams)
if(managementTypeParams == 'BY_QUANTITY'){
detail = item.subList.find(r => {
if (r.fromLocationCode == balance.locationCode &&
@@ -447,6 +458,9 @@
newDetail.toLocationCode = this.toLocationCode;
newDetail.managementTypeParams = managementTypeParams;
newDetail.fromLocationCode = result.fromLocationCode
+ newDetail.handleQty = result.label.qty
+ newDetail.packQty = balance.packQty;
+ newDetail.packUnit = balance.packUnit;
item.subList.push(newDetail);
this.clearFromLocation()
this.$refs.okToHoldRecordPackRef.handleQty = 0
@@ -456,11 +470,11 @@
// detail.handleQty =calc.add(detail.handleQty, result.label.qty)
if(managementTypeParams == 'BY_QUANTITY'){
this.showErrorMessage(
- "批次[]\n" + "库位[" + detail.fromLocationCode + "]\n" +
+ "物料号[" + item.itemCode + "]\n" + "批次[]\n" + "库位[" + detail.fromLocationCode + "]\n" +
"已经存在")
}else if(managementTypeParams == 'BY_BATCH'){
this.showErrorMessage(
- "批次[" + detail.batch + "]\n" + "库位[" + detail.fromLocationCode + "]\n" +
+ "物料号[" + item.itemCode + "]\n" + "批次[" + detail.batch + "]\n" + "库位[" + detail.fromLocationCode + "]\n" +
"已经存在")
}
}
@@ -596,7 +610,7 @@
console.log("提交" ,params)
let obj = params.subList.find(item=>item.balanceQty < item.handleQty)
if(obj){
- this.$refs.comMessage.showConfirmWarningModal('批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']')
+ this.$refs.comMessage.showConfirmWarningModal('物料号[' +obj.itemCode + ']批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']')
uni.hideLoading()
return
}
diff --git a/src/pages/issue/job/issueDetail.vue b/src/pages/issue/job/issueDetail.vue
index 9ddc72ac..2a09a298 100644
--- a/src/pages/issue/job/issueDetail.vue
+++ b/src/pages/issue/job/issueDetail.vue
@@ -223,8 +223,7 @@
getManagementPrecisions(itemCodes, that.fromLocationCode, res => {
if (res.success) {
this.managementList = res.list;
- this.managementType = this.managementList.some(item => item.ManagementPrecision ==
- 'BY_BATCH') ? 'BY_BATCH' : ''
+ this.managementType = this.managementList&&this.managementList[0]&&this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
}
})
setTimeout(r => {
diff --git a/src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue b/src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue
index bd31d00b..2d37cfe3 100644
--- a/src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue
+++ b/src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue
@@ -1,7 +1,7 @@
-
+
-
+ :isShowFromLocation="false" :isShowPackingNumberProps='true'>
@@ -117,9 +117,9 @@
},
resizeCollapse() {
- this.$nextTick(r => {
+ setTimeout(() => {
this.$refs.collapse.resize()
- });
+ }, 500)
this.$forceUpdate();
},
@@ -200,8 +200,8 @@
this.editItem.handleQty = qty;
this.$emit('updateData')
},
- updateData() {
- this.$emit('updateData')
+ updateData(index,packList) {
+ this.$emit('updateData',index,packList)
}
}
}
diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue
index 43b5ff0d..2e755ac3 100644
--- a/src/pages/purchaseReceipt/job/receiptDetail.vue
+++ b/src/pages/purchaseReceipt/job/receiptDetail.vue
@@ -5,7 +5,7 @@
-
整单收货
@@ -32,7 +32,7 @@
-
@@ -178,8 +178,10 @@
reasonText: "",
packingNumberList:[],
source_type:'',
+ idValue:0
// printDeafult: {}, //默认打印机
// templateDeafult: {} //默认的模板
+
};
},
@@ -192,9 +194,6 @@
this.source_type = option.source_type;
this.switchCode = "purchasereceiptPrintPDA" //采购收货PDA打印开关
this.switchCode1 = "EnableQms" //根据开关中是否启用QMS去判断,如果为TRUE显示检验指引单,如果为FALSE不显示检验指引单
- },
-
- onShow() {
if (this.id != undefined) {
//新建的任务自动接收
if (this.status == "1") {
@@ -206,6 +205,10 @@
}
}
},
+
+ onShow() {
+
+ },
//返回首页
onNavigationBarButtonTap(e) {
if (e.index === 0) {
@@ -319,11 +322,8 @@
},
getScanResult(result) {
this.balanceInfo = result.balance
- console.log(this.managementType)
- if(this.managementType == 'BY_BATCH'){
+ if(this.managementType == 'BY_BATCH'||this.managementType == 'BY_QUANTITY'){
this.getScanResultAfterBatch(result)
- }else if(this.managementType == 'BY_QUANTITY' ){
- this.getScanResultAfterQuantity(result)
}else{
this.getScanResultAfter(result)
}
@@ -439,6 +439,7 @@
},
// 批次扫码之后逻辑
getScanResultAfterBatch(result){
+ console.log(222,result)
try {
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
@@ -469,7 +470,7 @@
}
}
} else if (result.label.labelType == "PurchaseLabel") {
- debugger
+ // debugger
var packingNumber = result.package.number;
var parentpackingNumber = result.package.parentNumber;
var batch = result.label.batch;
@@ -479,218 +480,84 @@
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
//物料在列表中
- var itemDetail = detail.subList.find(r => r.batch ==
+ const batchDetailList = detail.subList.filter(r => r.batch ==
batch);
- if (itemDetail == undefined) {
- itemDetail = detail.subList.find(r => r.batch ==
- batch);
-
- if (itemDetail == undefined) {
+ if (!batchDetailList || batchDetailList && batchDetailList.length == 0) {
this.showMessage("批次【" + batch + "】不在列表中")
} else {
- var pack = itemDetail.packList.find(p =>
- p.batch == batch)
- if (pack == undefined) {
- this.showMessage("批次【" + batch + "】不在列表中")
- } else {
- let isScan = false
- if(packingNumber){
- isScan = this.packList.some(item=>item == packingNumber)
- }else{
- isScan = false
- }
- if (isScan) {
- pack.scanDate = new Date();
- // this.showMessage("箱码【" + packingNumber + "】已经扫描");
+ // 箱码是否已经扫描
+ var isHavePackingNumber =this.packingNumberList.find(r => r.packingNumber == packingNumber);
+ if(isHavePackingNumber){
+ this.showMessage("箱码【" + packingNumber + "】已经扫描");
+ return
+ }
+ for(let i = 0 ; i {
+ pack.handleQty =pack.handleQty? pack.handleQty :0
+ packAllHandleQty = calc.add(packAllHandleQty,pack.handleQty)
+ })
+ // 批次任务数量减去当前扫描总箱码数量的差为该批次还有多少任务数量没有扫
+ let handleQtySub = calc.sub(parseFloat(batchDetailList[i].qty),parseFloat(packAllHandleQty))
+ let pack = {}
+ pack.packingNumber =packingNumber
+ pack.packQty = result.package.packQty
+ pack.packUnit = result.package.packUnit
+ pack.qty = batchDetailList[i].qty
- pack.handleQty = calc.add(pack.handleQty,result.label.qty)
- } else {
- this.packList.push(packingNumber)
- pack.packList.push(packingNumber)
- pack.scaned = true
- pack.scanDate = new Date();
- pack.handleQty = Number(result.label.qty);
pack.toLocationCode = this.toLocationCode;
- pack.labelQty = Number(result.label.qty);
+ pack.labelQty = Number(qty);
+ pack.scaned = true;
+ // 当前批次剩余可以扫进的数量大于当前扫描的标签数量的时候直接插入当前的批次
+ if(handleQtySub >= parseFloat(qty)){
+ pack.handleQty = Number(qty);
+ batchDetailList[i].packList.push(pack)
+ batchDetailList[i].scaned = true
+ const isHave = this.packingNumberList.find(item=>item.packingNumber == packingNumber)
+ if(!isHave){
+ this.packingNumberList.push(pack)
+ }
+ calcTreeHandleQty(this.detailSource);
+ break
+ }else{
+ // 如果扫描的数量大于每行的任务剩余扫进去的数量
+ if(handleQtySub != 0){
+ // 如果是最后一行所有数量直接放入最后一行
+ if(batchDetailList.length-1 == i){
+ pack.handleQty = qty;
+ }else{
+ // 不是最后一行取当前批次剩余可以扫进的数量
+ pack.handleQty = handleQtySub;
+ }
+ batchDetailList[i].packList.push(pack)
+ batchDetailList[i].scaned = true
+ qty = calc.sub(parseFloat(qty),parseFloat(handleQtySub))
+ // 如果箱码没有被扫过直接插入记录箱码的列表,扫过了不计入
+ const isHave = this.packingNumberList.find(item=>item.packingNumber == packingNumber)
+ if(!isHave){
+ this.packingNumberList.push(pack)
+ }
+ calcTreeHandleQty(this.detailSource);
+ }
}
- }
- calcHandleQty(this.detailSource);
- itemDetail.packList.sort(compareDesc('scanDate')); //按扫描信息排序
- this.$forceUpdate()
- }
-
- } else {
- //扫描的是外包装,将包装集合全部扫描
- var scanedLength = 0;
- itemDetail.packList.forEach(res => {
- if (res.scaned) {
- scanedLength++;
- }
- })
- let isScan = false
- if(packingNumber){
- isScan = this.packingNumberList.some(item=>item == packingNumber)
- }else{
- isScan = false
+
+
}
- if (isScan) {
- itemDetail.scanDate = new Date();
- // this.showMessage("箱码【" + packingNumber + "】已经扫描")
- itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
- } else {
- this.packingNumberList.push(packingNumber)
- itemDetail.scaned = true;
- itemDetail.scanDate = new Date();
- itemDetail.handleQty =itemDetail.handleQty ?itemDetail.handleQty:0
- itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
- console.log(itemDetail.handleQty)
- itemDetail.toLocationCode = this.toLocationCode;
- itemDetail.labelQty = Number(result.label.qty);
- itemDetail.packList.forEach(pac => {
- pac.scaned = true
- pac.scanDate = new Date();
- pac.handleQty = calc.add(pac.handleQty,result.label.qty);
- pac.toLocationCode = this.toLocationCode;
+ console.log(8777,this.detailSource)
+
+ setTimeout(()=>{
+ this.$refs.comReceiptDetailCardBacthRef.forEach(item=>{
+ item.resizeCollapse()
+
+ item.$refs.packageListRef.$refs.collapse2.forEach(cur=>{
+ cur.resize()
+ })
})
- detail.handleQty = itemDetail.handleQty
- this.detailSource[0].subList.sort(compareDesc('scanDate')); //按扫描信息排序
- this.continueScan()
- this.$forceUpdate()
- }
- calcHandleQty(this.detailSource);
- }
- }
- }
-
- } catch (e) {
- this.showErrorMessage(e.message)
- }
- },
- // 数量扫码之后逻辑
- getScanResultAfterQuantity(result){
- try {
- var itemCode = result.label.itemCode;
- var detail = this.detailSource.find(r => r.itemCode == itemCode);
- if (detail == undefined) {
- this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
- return;
- }
- detail.scaned = true;
- if (result.label.labelType == "ContainerLabel") {
- var containerNumber = result.label.container;
- var itemDetail = detail.subList.filter(r => r.containerNumber == containerNumber);
- if (itemDetail.length == 0) {
- this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】不在列表中")
- } else {
- if (itemDetail[0].scaned) {
- this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】已经扫描")
- } else {
- itemDetail.forEach(item => {
- item.scaned = true;
- itemDetail.scanDate = new Date();
- item.handleQty = calc.add(item.handleQty,result.label.qty)
- item.toLocationCode = this.toLocationCode;
- })
- // calcHandleQty(this.detailSource);
- this.detailSource[0].subList.sort(compareDesc('scanDate')); //按扫描信息排序
- this.continueScan()
- this.$forceUpdate()
+ },500)
+
}
- }
- } else if (result.label.labelType == "PurchaseLabel") {
- var packingNumber = result.package.number;
- var parentpackingNumber = result.package.parentNumber;
- var batch = result.label.batch;
- var qty = result.label.qty;
- var detail = this.detailSource.find(r => r.itemCode == itemCode);
- console.log(8989,this.detailSource)
- if (detail == undefined) {
- this.showMessage("物料号【" + itemCode + "】不在列表中")
- } else {
- //物料在列表中
- // var itemDetail = detail.subList.find(r => r.batch ==
- // batch);
- // if (itemDetail == undefined) {
- // itemDetail = detail.subList.find(r => r.batch ==
- // batch);
-
- // if (itemDetail == undefined) {
- // this.showMessage("批次【" + batch + "】不在列表中")
- // } else {
- // var pack = itemDetail.packList.find(p =>
- // p.batch == batch)
- // if (pack == undefined) {
- // this.showMessage("批次【" + batch + "】不在列表中")
- // } else {
- let isScan = false
- const itemDetail = detail.subList[0]
- let pack = detail.subList[0] && detail.subList[0].length>0 ?detail.subList[0] : {}
- if(packingNumber){
- isScan = this.packingNumberList.some(item=>item == packingNumber)
- }else{
- isScan = false
- }
- if (isScan) {
- detail.subList[0].scanDate = new Date();
- // this.showMessage("箱码【" + packingNumber + "】已经扫描");
-
- detail.subList[0].handleQty = calc.add(detail.subList[0].handleQty,result.label.qty)
- } else {
- this.packingNumberList.push(packingNumber)
- detail.subList[0].scaned = true
- detail.subList[0].scanDate = new Date();
- detail.subList[0].handleQty = Number(result.label.qty);
- detail.subList[0].toLocationCode = this.toLocationCode;
- detail.subList[0].labelQty = Number(result.label.qty);
- }
- // }
- calcHandleQty(this.detailSource);
- this.continueScan()
- // itemDetail.packList[0] = detail.subList[0]; //按扫描信息排序
- this.$forceUpdate()
- // }
- // } else {
- // //扫描的是外包装,将包装集合全部扫描
- // var scanedLength = 0;
- // itemDetail.packList.forEach(res => {
- // if (res.scaned) {
- // scanedLength++;
- // }
- // })
- // debugger
- // let isScan = false
- // if(packingNumber){
- // isScan = this.packingNumberList.some(item=>item == packingNumber)
- // }else{
- // isScan = false
- // }
- // if (isScan) {
- // itemDetail.scanDate = new Date();
- // // this.showMessage("箱码【" + packingNumber + "】已经扫描")
- // itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
- // } else {
- // this.packingNumberList.push(packingNumber)
- // itemDetail.scaned = true;
- // itemDetail.scanDate = new Date();
- // itemDetail.handleQty =itemDetail.handleQty ?itemDetail.handleQty:0
- // itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty)
- // console.log(itemDetail.handleQty)
- // itemDetail.toLocationCode = this.toLocationCode;
- // itemDetail.labelQty = Number(result.label.qty);
- // itemDetail.packList.forEach(pac => {
- // pac.scaned = true
- // pac.scanDate = new Date();
- // pac.handleQty = calc.add(pac.handleQty,result.label.qty);
- // pac.toLocationCode = this.toLocationCode;
- // })
- // detail.handleQty = itemDetail.handleQty
- // this.detailSource[0].subList.sort(compareDesc('scanDate')); //按扫描信息排序
- // this.continueScan()
- // this.$forceUpdate()
- // }
- // calcHandleQty(this.detailSource);
- // }
}
}
@@ -708,12 +575,20 @@
}
},
- updateData() {
+ updateData(ele,index) {
// if(this.managementType == 'BY_BATCH'){
// }else{
// calcTreeHandleQty(this.detailSource)
// }
- calcHandleQty(this.detailSource);
+ if(ele){
+ ele.packList.splice(index,1)
+ if(ele.packList.length == 0){
+ ele.scaned = false
+ }
+ this.packingNumberList.splice(index,1)
+ }
+
+ calcTreeHandleQty(this.detailSource);
},
scanLocationCode(location, code) {
@@ -737,6 +612,8 @@
},
commit() {
+ this.scanCount = getScanCount(this.detailSource);
+ console.log(this.scanCount )
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
@@ -794,9 +671,35 @@
//按批次的校验
checkBatch(){
//扫描数量和任务数量相等,直接提交
- const scanCount1 = this.detailSource
- const current = this.detailSource.find(item=> item.handleQty {
+ item.subList.forEach(cur=>{
+ if(cur.scaned){
+ scanCount++;
+ if(parseFloat(cur.qty)>parseFloat(cur.handleQty)){
+ str += `物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以小于任务数量【${cur.qty}】\n`
+ }
+ if(parseFloat(cur.qty) {
if (res.data) {
@@ -868,6 +770,7 @@
})
}else if(!isCheckPrint1 && !isCheckPrint){
this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number)
+ uni.hideLoading()
}else if(that.source_type!='TOOL'&&that.source_type!='Develop'){
// if (res.data == '打印任务已发送,等待打印机处理!') {
// this.showCommitSuccessMessage(res.data)
@@ -977,13 +880,15 @@ console.log(8787,this.detailSource)
pack.handleQty = 0
}
})
- detail.toLocationCode = this.toLocationCode ? this.toLocationCode :this.jobToLocationCode
+ let obj = {...detail}
+ obj.packList = []
+ obj.toLocationCode = this.toLocationCode ? this.toLocationCode :this.jobToLocationCode
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,detail.packingNumber, detail.batch);
- detail.toPackingNumber = info.packingNumber;
- detail.packingNumber = info.packingNumber;
- detail.formPackingNumber = info.packingNumber;
- detail.toBatch = info.batch;
- subList.push(detail)
+ obj.toPackingNumber = info.packingNumber;
+ obj.packingNumber = info.packingNumber;
+ obj.formPackingNumber = info.packingNumber;
+ obj.toBatch = info.batch;
+ subList.push(obj)
})
})
this.jobContent.subList = subList
@@ -1093,7 +998,8 @@ console.log(8787,this.detailSource)
},
openScanPopup() {
- this.$refs.scanPopup.openScanPopup(this.jobToLocationCode);
+ // 第一个参数是库位查精度,第二个参数是判断是否走包装信息接口
+ this.$refs.scanPopup.openScanPopup(this.jobToLocationCode,true);
},
closeScanPopup() {