|
|
@ -21,7 +21,7 @@ |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
@ -34,7 +34,8 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button> |
|
|
|
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'> |
|
|
|
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData' |
|
|
|
@afterScan='afterScan'> |
|
|
|
</com-scan-issue-pack> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
@ -64,7 +65,7 @@ |
|
|
|
import { |
|
|
|
getManagementPrecisions |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc.js'; |
|
|
@ -94,7 +95,7 @@ |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
detailOptions: [], |
|
|
|
scanOptions: [], |
|
|
|
jobStatus:"" |
|
|
|
jobStatus: "" |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@ -126,7 +127,7 @@ |
|
|
|
onBackPress(e) { |
|
|
|
//已经接收但是没提交任务 |
|
|
|
if (e.from === 'backbutton') { |
|
|
|
if (this.jobStatus=="2") { |
|
|
|
if (this.jobStatus == "2") { |
|
|
|
//取消承接任务 |
|
|
|
cancleTakeIssueJob(this.id).then(res => { |
|
|
|
uni.navigateBack(); |
|
|
@ -136,10 +137,10 @@ |
|
|
|
} else { |
|
|
|
uni.navigateBack(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
@ -243,7 +244,6 @@ |
|
|
|
// }, |
|
|
|
|
|
|
|
submit() { |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
@ -277,7 +277,7 @@ |
|
|
|
|
|
|
|
submitJob() { |
|
|
|
var params = this.setParams() |
|
|
|
if(!params.subList||params.subList.length==0){ |
|
|
|
if (!params.subList || params.subList.length == 0) { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage("请扫描您需要提交的发料任务") |
|
|
|
return |
|
|
@ -289,7 +289,7 @@ |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成发料记录<br>" + res.data) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg+"]") |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
@ -335,16 +335,15 @@ |
|
|
|
record.singlePrice = single_price; |
|
|
|
record.amount = single_price * r.qty; |
|
|
|
|
|
|
|
// //使用在途库不改变管理模式 |
|
|
|
// if (this.jobContent |
|
|
|
// .useOnTheWayLocation == |
|
|
|
// 'TRUE') { |
|
|
|
// record.toPackingNumber = r |
|
|
|
// .packingNumber; |
|
|
|
// record.toBatch = r.batch; |
|
|
|
// } else { |
|
|
|
debugger |
|
|
|
var info = getPackingNumberAndBatch( |
|
|
|
//使用在途库不改变管理模式 |
|
|
|
if (this.jobContent |
|
|
|
.useOnTheWayLocation == 'TRUE') { |
|
|
|
record.toPackingNumber = r |
|
|
|
.packingNumber; |
|
|
|
record.toBatch = r.batch; |
|
|
|
} else { |
|
|
|
var info = |
|
|
|
getPackingNumberAndBatch( |
|
|
|
this.managementList, r |
|
|
|
.itemCode, |
|
|
|
r.packingNumber, r |
|
|
@ -352,7 +351,7 @@ |
|
|
|
record.toPackingNumber = info |
|
|
|
.packingNumber; |
|
|
|
record.toBatch = info.batch; |
|
|
|
// } |
|
|
|
} |
|
|
|
subItem.recordList.push(record); |
|
|
|
}) |
|
|
|
subList.push(subItem); |
|
|
@ -400,24 +399,25 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
updateData(record) { |
|
|
|
console.log('updateData',record) |
|
|
|
console.log('this.detailSource',this.detailSource) |
|
|
|
|
|
|
|
console.log('updateData', record) |
|
|
|
console.log('this.detailSource', this.detailSource) |
|
|
|
|
|
|
|
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode); |
|
|
|
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode); |
|
|
|
let itemHandleQty = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (item != undefined) { |
|
|
|
item.Locations.forEach(l => { |
|
|
|
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b.packingNumber == null || b.packingNumber == '') && b.batch == record.batch); |
|
|
|
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b |
|
|
|
.packingNumber == null || b.packingNumber == '') && b.batch == record.batch); |
|
|
|
let handleQty = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (batch != undefined) { |
|
|
|
batch.Records.forEach(res => { |
|
|
|
handleQty = calc.add(handleQty,res.qty) |
|
|
|
handleQty = calc.add(handleQty, res.qty) |
|
|
|
}) |
|
|
|
batch.handleQty = handleQty; |
|
|
|
itemHandleQty = calc.add(itemHandleQty,handleQty) |
|
|
|
itemHandleQty = calc.add(itemHandleQty, handleQty) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -425,6 +425,31 @@ |
|
|
|
item.handleQty = itemHandleQty; |
|
|
|
}, |
|
|
|
|
|
|
|
afterScan() { |
|
|
|
this.detailSource.forEach(detail => { |
|
|
|
let s = ''; |
|
|
|
detail.Items.forEach(item => { |
|
|
|
let totalHandleQty = 0; |
|
|
|
item.Locations.forEach(lco => { |
|
|
|
lco.Batchs.forEach(batch => { |
|
|
|
totalHandleQty = calc.add(totalHandleQty, batch.handleQty) |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (item.qty == totalHandleQty) { |
|
|
|
this.submit(); |
|
|
|
} else { |
|
|
|
this.$refs.comMessage.showQuestionMessage('实际扫描数量【' + totalHandleQty + |
|
|
|
'】与物料需求数量【' + item.qty + |
|
|
|
'】不一致,是否继续提交', res => { |
|
|
|
if (res) { |
|
|
|
this.submit(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.getfocus(); |
|
|
@ -524,4 +549,4 @@ |
|
|
|
// border-bottom-width: 1px; |
|
|
|
// border-bottom-color: #ebeef5; |
|
|
|
// } |
|
|
|
</style> |
|
|
|
</style> |