|
@ -14,7 +14,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class="page-footer" v-if="jobList.length>0"> |
|
|
<view class="page-footer" v-if="jobList.length>0"> |
|
|
<button class="btn_single_clear" hover-class="btn_commit_after" @click="clearAll">清空</button> |
|
|
<button class="btn_single_clear" hover-class="btn_commit_after" @click="clearAll">清空</button> |
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit" :disabled="ishsowLoading">提交</button> |
|
|
</view> |
|
|
</view> |
|
|
<receipt-info-popup ref='jobInfoPopup'></receipt-info-popup> |
|
|
<receipt-info-popup ref='jobInfoPopup'></receipt-info-popup> |
|
|
<receipt-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></receipt-job-list-popup> |
|
|
<receipt-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></receipt-job-list-popup> |
|
@ -69,6 +69,7 @@ |
|
|
jobList: [], |
|
|
jobList: [], |
|
|
detailOptions: [], |
|
|
detailOptions: [], |
|
|
detailRemoveOption: [], |
|
|
detailRemoveOption: [], |
|
|
|
|
|
ishsowLoading:false |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onShow() {}, |
|
|
onShow() {}, |
|
@ -82,6 +83,7 @@ |
|
|
this.$nextTick(()=>{ |
|
|
this.$nextTick(()=>{ |
|
|
this.openScanPopup() |
|
|
this.openScanPopup() |
|
|
}) |
|
|
}) |
|
|
|
|
|
// this.getList() |
|
|
}, |
|
|
}, |
|
|
onNavigationBarButtonTap(e) { |
|
|
onNavigationBarButtonTap(e) { |
|
|
if (e.index === 0) { |
|
|
if (e.index === 0) { |
|
@ -275,12 +277,9 @@ |
|
|
} |
|
|
} |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
this.showMessage(error + "\n扫描[" + result.scanMessage + "]") |
|
|
this.showMessage(error + "\n扫描[" + result.scanMessage + "]") |
|
|
|
|
|
|
|
|
this.scanPopupGetFocus() |
|
|
|
|
|
}) |
|
|
}) |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
this.showMessage(e.message) |
|
|
this.showMessage(e.message) |
|
|
this.scanPopupGetFocus() |
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
calcHandleQty(detailSource) { |
|
|
calcHandleQty(detailSource) { |
|
@ -388,48 +387,103 @@ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
commit(){ |
|
|
//展示的数据 |
|
|
let str ='' |
|
|
showTableData () { |
|
|
let str1 ='' |
|
|
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 = [] |
|
|
this.params = [] |
|
|
let obj = {} |
|
|
let obj = {} |
|
|
let obj1 = {} |
|
|
let obj1 = {} |
|
|
let count = 0 |
|
|
let kkkkk=0 |
|
|
|
|
|
console.log(99,this.jobList) |
|
|
this.jobList.forEach(item=>{ |
|
|
this.jobList.forEach(item=>{ |
|
|
if(item.scaned){ |
|
|
if(item.scaned){ |
|
|
count++ |
|
|
|
|
|
obj = {...item} |
|
|
obj = {...item} |
|
|
obj.id = item.masterId |
|
|
obj.id = item.masterId |
|
|
let isHaveObj = this.params.find(i => i.asnNumber == item.asnNumber) |
|
|
let isHaveObj = this.params.find(i => i.asnNumber == item.asnNumber) |
|
|
if(isHaveObj){ |
|
|
if(isHaveObj){ |
|
|
console.log(22,isHaveObj) |
|
|
|
|
|
item.packageDOS.forEach(cur=>{ |
|
|
item.packageDOS.forEach(cur=>{ |
|
|
if(cur.scaned){ |
|
|
if(cur.scaned){ |
|
|
obj1 = { |
|
|
obj1 = { |
|
|
...cur, |
|
|
// ...cur, |
|
|
...item, |
|
|
// ...item,item |
|
|
packingNumber:cur.number, |
|
|
id: item.id, |
|
|
number:'', |
|
|
arriveDate: item.arriveDate, |
|
|
deliNo:item.deliNo, |
|
|
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, |
|
|
itemCode:item.itemCode, |
|
|
itemDesc:item.itemDesc, |
|
|
itemName:item.itemName, |
|
|
itemDesc1:item.itemDesc1, |
|
|
itemDesc1:item.itemDesc1, |
|
|
itemDesc2:item.itemDesc2, |
|
|
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, |
|
|
itemName:item.itemName, |
|
|
backNumber:item.backNumber, |
|
|
backNumber:item.backNumber, |
|
|
packQty:cur.packQty, |
|
|
|
|
|
packUnit:cur.packUnit, |
|
|
|
|
|
purchaseQty:cur.purchaseQty, |
|
|
purchaseQty:cur.purchaseQty, |
|
|
purchaseStdQty:cur.purchaseStdQty, |
|
|
purchaseStdQty:cur.purchaseStdQty, |
|
|
purchaseUom:cur.purchaseUom, |
|
|
purchaseUom:cur.purchaseUom, |
|
|
qty:item.qty, |
|
|
|
|
|
remark:cur.remark, |
|
|
remark:cur.remark, |
|
|
supplierBatch:cur.supplierBatch, |
|
|
supplierBatch:cur.supplierBatch, |
|
|
supplierCode:cur.supplierCode, |
|
|
supplierCode:cur.supplierCode, |
|
|
toLocationCode:item.toLocationCode, |
|
|
toLocationCode:item.toLocationCode, |
|
|
uom:item.uom, |
|
|
|
|
|
handleQty:cur.handleQty, |
|
|
handleQty:cur.handleQty, |
|
|
qty:item.qty, |
|
|
|
|
|
} |
|
|
} |
|
|
isHaveObj.subList.push(obj1) |
|
|
isHaveObj.subList.push(obj1) |
|
|
} |
|
|
} |
|
@ -439,53 +493,109 @@ |
|
|
item.packageDOS.forEach(cur=>{ |
|
|
item.packageDOS.forEach(cur=>{ |
|
|
if(cur.scaned){ |
|
|
if(cur.scaned){ |
|
|
obj1 = { |
|
|
obj1 = { |
|
|
...cur, |
|
|
// ...cur, |
|
|
...item, |
|
|
// ...item, |
|
|
packingNumber:cur.number, |
|
|
// packingNumber:cur.number, |
|
|
number:'', |
|
|
// number:'', |
|
|
deliNo:item.deliNo, |
|
|
// 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, |
|
|
itemCode:item.itemCode, |
|
|
itemDesc:item.itemDesc, |
|
|
itemName:item.itemName, |
|
|
itemDesc1:item.itemDesc1, |
|
|
itemDesc1:item.itemDesc1, |
|
|
itemDesc2:item.itemDesc2, |
|
|
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, |
|
|
itemName:item.itemName, |
|
|
backNumber:item.backNumber, |
|
|
backNumber:item.backNumber, |
|
|
packQty:cur.packQty, |
|
|
|
|
|
packUnit:cur.packUnit, |
|
|
|
|
|
purchaseQty:cur.purchaseQty, |
|
|
purchaseQty:cur.purchaseQty, |
|
|
purchaseStdQty:cur.purchaseStdQty, |
|
|
purchaseStdQty:cur.purchaseStdQty, |
|
|
purchaseUom:cur.purchaseUom, |
|
|
purchaseUom:cur.purchaseUom, |
|
|
qty:item.qty, |
|
|
|
|
|
remark:cur.remark, |
|
|
remark:cur.remark, |
|
|
supplierBatch:cur.supplierBatch, |
|
|
supplierBatch:cur.supplierBatch, |
|
|
supplierCode:cur.supplierCode, |
|
|
supplierCode:cur.supplierCode, |
|
|
toLocationCode:item.toLocationCode, |
|
|
toLocationCode:item.toLocationCode, |
|
|
uom:item.uom, |
|
|
|
|
|
handleQty:cur.handleQty, |
|
|
handleQty:cur.handleQty, |
|
|
qty:item.qty, |
|
|
|
|
|
} |
|
|
} |
|
|
obj.subList.push(obj1) |
|
|
obj.subList.push(obj1) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
console.log(obj) |
|
|
|
|
|
this.params.push(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=>{ |
|
|
this.params.forEach(item=>{ |
|
|
delete item.packageDOS |
|
|
delete item.packageDOS |
|
|
item.subList.forEach(cur=>{ |
|
|
item.subList.forEach(cur=>{ |
|
|
|
|
|
kkkkk++ |
|
|
delete cur.packageDOS, |
|
|
delete cur.packageDOS, |
|
|
delete item.masterId |
|
|
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){ |
|
|
if(count == 0){ |
|
|
this.$refs.comMessage.showMessage('扫描数量为0,请先扫描') |
|
|
this.$refs.comMessage.showMessage('扫描数量为0,请先扫描') |
|
|
return |
|
|
return |
|
@ -502,6 +612,7 @@ |
|
|
if (res) { |
|
|
if (res) { |
|
|
this.submitJob() |
|
|
this.submitJob() |
|
|
} |
|
|
} |
|
|
|
|
|
this.ishsowLoading =false |
|
|
}); |
|
|
}); |
|
|
}else{ |
|
|
}else{ |
|
|
this.submitJob() |
|
|
this.submitJob() |
|
@ -512,7 +623,9 @@ |
|
|
title: "加载中....", |
|
|
title: "加载中....", |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
purchaseReceiptJobSubmitASN(this.params).then(res => { |
|
|
const params1 = this.getParams() |
|
|
|
|
|
console.log(99,JSON.stringify(params1)) |
|
|
|
|
|
purchaseReceiptJobSubmitASN(params1).then(res => { |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
// this.showCommitSuccessMessage("提交成功\n生成采购上架记录\n" + res.data) |
|
|
// this.showCommitSuccessMessage("提交成功\n生成采购上架记录\n" + res.data) |
|
|
let str ='' |
|
|
let str ='' |
|
@ -525,6 +638,7 @@ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
|
|
|
this.ishsowLoading =false |
|
|
if(str){ |
|
|
if(str){ |
|
|
this.showCommitSuccessMessage(str+str1) |
|
|
this.showCommitSuccessMessage(str+str1) |
|
|
}else{ |
|
|
}else{ |
|
|