diff --git a/src/pages/purchaseReceipt/job/purchaseReceiptAsn.vue b/src/pages/purchaseReceipt/job/purchaseReceiptAsn.vue
index 8ea9aeec..d9604051 100644
--- a/src/pages/purchaseReceipt/job/purchaseReceiptAsn.vue
+++ b/src/pages/purchaseReceipt/job/purchaseReceiptAsn.vue
@@ -14,7 +14,7 @@
@@ -69,6 +69,7 @@
jobList: [],
detailOptions: [],
detailRemoveOption: [],
+ ishsowLoading:false
};
},
onShow() {},
@@ -82,6 +83,7 @@
this.$nextTick(()=>{
this.openScanPopup()
})
+ // this.getList()
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
@@ -275,12 +277,9 @@
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
-
- this.scanPopupGetFocus()
})
} catch (e) {
this.showMessage(e.message)
- this.scanPopupGetFocus()
}
},
calcHandleQty(detailSource) {
@@ -388,48 +387,103 @@
}
},
- commit(){
- let str =''
- let str1 =''
+ //展示的数据
+ showTableData () {
+ return this.jobList.slice(0,9)
+ },
+ // 仅用于数据量多获取测试数据用
+ getList(type) {
+ let that = this;
+ this.loadingType = "loading";
+ var filters = []
+ filters.push({
+ column: "status",
+ action: "in",
+ value: '1,2'
+ })
+ getPurchaseReceiptASNJobList({
+ filters: filters,
+ pageNo: 1,
+ pageSize: 50,
+ }).then(async res => {
+ let resultList = res.data.list;
+ resultList.forEach(item=>{
+ item.scaned=true
+ item.packageDOS.forEach(cur=>{
+ cur.scaned=true
+ })
+ })
+ this.jobList = [...resultList,...resultList,...resultList,...resultList,...resultList,...resultList,...resultList,...resultList,...resultList,...resultList]
+ let k=0
+ this.jobList.forEach(item=>{
+ item.packageDOS.forEach(cur=>{
+ cur.scaned=true
+ k++
+ })
+ })
+ console.log(3444,k)
+ }).catch(error => {
+ })
+ },
+ getParams(){
this.params = []
let obj = {}
let obj1 = {}
- let count = 0
+ let kkkkk=0
+ console.log(99,this.jobList)
this.jobList.forEach(item=>{
if(item.scaned){
- count++
obj = {...item}
obj.id = item.masterId
let isHaveObj = this.params.find(i => i.asnNumber == item.asnNumber)
if(isHaveObj){
- console.log(22,isHaveObj)
item.packageDOS.forEach(cur=>{
if(cur.scaned){
obj1 = {
- ...cur,
- ...item,
- packingNumber:cur.number,
- number:'',
- deliNo:item.deliNo,
+ // ...cur,
+ // ...item,item
+ id: item.id,
+ arriveDate: item.arriveDate,
+ produceDate: cur.produceDate,
+ expireDate: cur.expireDate,
+ inventoryStatus: item.inventoryStatus,
+ toLocationCode: cur.toLocationCode,
+ poNumber: cur.poNumber,
+ poLine: cur.poLine,
+ packQty:cur.packQty,
+ packUnit:cur.packUnit,
+ qty:item.qty,
+ orderQty:item.orderQty,
+ uom:item.uom,
+ supplierQty:item.supplierQty,
+ supplierUom:item.supplierUom,
+ convertRate:cur.convertRate,
+ jobDetailId: cur.detailId,
itemCode:item.itemCode,
- itemDesc:item.itemDesc,
+ itemName:item.itemName,
itemDesc1:item.itemDesc1,
itemDesc2:item.itemDesc2,
+ masterId:item.id,
+ number:'',
+ projectCode:item.projectCode,
+ fromOwnerCode:item.fromOwnerCode,
+ toOwnerCode:item.toOwnerCode,
+ packingNumber:cur.number,
+ parentPackingNumber:item.parentPackingNumber,
+ poLineType:item.poLineType,
+ tenantId:cur.tenantId,
+ sourceType:item.sourceType,
+ deliNo:item.deliNo,
itemName:item.itemName,
backNumber:item.backNumber,
- packQty:cur.packQty,
- packUnit:cur.packUnit,
purchaseQty:cur.purchaseQty,
purchaseStdQty:cur.purchaseStdQty,
purchaseUom:cur.purchaseUom,
- qty:item.qty,
remark:cur.remark,
supplierBatch:cur.supplierBatch,
supplierCode:cur.supplierCode,
toLocationCode:item.toLocationCode,
- uom:item.uom,
handleQty:cur.handleQty,
- qty:item.qty,
}
isHaveObj.subList.push(obj1)
}
@@ -439,53 +493,109 @@
item.packageDOS.forEach(cur=>{
if(cur.scaned){
obj1 = {
- ...cur,
- ...item,
- packingNumber:cur.number,
- number:'',
- deliNo:item.deliNo,
+ // ...cur,
+ // ...item,
+ // packingNumber:cur.number,
+ // number:'',
+ // deliNo:item.deliNo,
+ // itemCode:item.itemCode,
+ // itemDesc:item.itemDesc,
+ // itemDesc1:item.itemDesc1,
+ // itemDesc2:item.itemDesc2,
+ // itemName:item.itemName,
+ // backNumber:item.backNumber,
+ // packQty:cur.packQty,
+ // packUnit:cur.packUnit,
+ // purchaseQty:cur.purchaseQty,
+ // purchaseStdQty:cur.purchaseStdQty,
+ // purchaseUom:cur.purchaseUom,
+ // qty:item.qty,
+ // remark:cur.remark,
+ // supplierBatch:cur.supplierBatch,
+ // supplierCode:cur.supplierCode,
+ // toLocationCode:item.toLocationCode,
+ // uom:item.uom,
+ // handleQty:cur.handleQty,
+ // qty:item.qty,
+ id: item.id,
+ arriveDate: item.arriveDate,
+ produceDate: cur.produceDate,
+ expireDate: cur.expireDate,
+ inventoryStatus: item.inventoryStatus,
+ toLocationCode: cur.toLocationCode,
+ poNumber: cur.poNumber,
+ poLine: cur.poLine,
+ packQty:cur.packQty,
+ packUnit:cur.packUnit,
+ qty:item.qty,
+ orderQty:item.orderQty,
+ uom:item.uom,
+ supplierQty:item.supplierQty,
+ supplierUom:item.supplierUom,
+ convertRate:cur.convertRate,
+ jobDetailId: cur.detailId,
itemCode:item.itemCode,
- itemDesc:item.itemDesc,
+ itemName:item.itemName,
itemDesc1:item.itemDesc1,
itemDesc2:item.itemDesc2,
+ number:'',
+ projectCode:item.projectCode,
+ fromOwnerCode:item.fromOwnerCode,
+ toOwnerCode:item.toOwnerCode,
+ packingNumber:cur.number,
+ parentPackingNumber:item.parentPackingNumber,
+ poLineType:item.poLineType,
+ tenantId:cur.tenantId,
+ sourceType:item.sourceType,
+ deliNo:item.deliNo,
itemName:item.itemName,
backNumber:item.backNumber,
- packQty:cur.packQty,
- packUnit:cur.packUnit,
purchaseQty:cur.purchaseQty,
purchaseStdQty:cur.purchaseStdQty,
purchaseUom:cur.purchaseUom,
- qty:item.qty,
remark:cur.remark,
supplierBatch:cur.supplierBatch,
supplierCode:cur.supplierCode,
toLocationCode:item.toLocationCode,
- uom:item.uom,
handleQty:cur.handleQty,
- qty:item.qty,
}
obj.subList.push(obj1)
}
})
- console.log(obj)
this.params.push(obj)
}
}
- if(item.handleQty>0 && item.handleQty < item.qty){
- str += `ASN单号【${item.asnNumber}】物料代码【${item.itemCode}】实际收货数量【${item.handleQty}】小于任务数量【${item.qty}】,\n`
- }
- if(!item.handleQty){
- str1 += `ASN单号【${item.asnNumber}】物料代码【${item.itemCode}】实际收货数量为0,\n`
- }
- })
+ })
this.params.forEach(item=>{
delete item.packageDOS
item.subList.forEach(cur=>{
+ kkkkk++
delete cur.packageDOS,
delete item.masterId
})
})
+ console.log('count:'+kkkkk)
+ return this.params
+ },
+ commit(){
+ let str =''
+ let str1 =''
+ let count = 0
+ if(this.ishsowLoading)return;
+ this.ishsowLoading =true
+ this.jobList.forEach(item=>{
+ if(item.scaned){
+ count++
+ }
+ if(item.handleQty>0 && item.handleQty < item.qty){
+ str += `ASN单号【${item.asnNumber}】物料代码【${item.itemCode}】实际收货数量【${item.handleQty}】小于任务数量【${item.qty}】,\n`
+ }
+ if(!item.handleQty){
+ str1 += `ASN单号【${item.asnNumber}】物料代码【${item.itemCode}】实际收货数量为0,\n`
+ }
+ })
+
if(count == 0){
this.$refs.comMessage.showMessage('扫描数量为0,请先扫描')
return
@@ -502,6 +612,7 @@
if (res) {
this.submitJob()
}
+ this.ishsowLoading =false
});
}else{
this.submitJob()
@@ -512,7 +623,9 @@
title: "加载中....",
mask: true
});
- purchaseReceiptJobSubmitASN(this.params).then(res => {
+ const params1 = this.getParams()
+ console.log(99,JSON.stringify(params1))
+ purchaseReceiptJobSubmitASN(params1).then(res => {
if (res.data) {
// this.showCommitSuccessMessage("提交成功\n生成采购上架记录\n" + res.data)
let str =''
@@ -525,6 +638,7 @@
}
})
uni.hideLoading()
+ this.ishsowLoading =false
if(str){
this.showCommitSuccessMessage(str+str1)
}else{