|
@ -17,7 +17,8 @@ |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<view v-for="(toLocation, index) in detailSource"> |
|
|
<view v-for="(toLocation, index) in detailSource"> |
|
|
<comIssueDetailCardBatch ref='comIssueDetailCardBatch' :dataContent="toLocation" :settingParam="jobContent" |
|
|
<comIssueDetailCardBatch ref='comIssueDetailCardBatch' :dataContent="toLocation" :settingParam="jobContent" |
|
|
@updateData='updateData'> |
|
|
@updateData='updateData' |
|
|
|
|
|
> |
|
|
</comIssueDetailCardBatch> |
|
|
</comIssueDetailCardBatch> |
|
|
<view class="split_line"></view> |
|
|
<view class="split_line"></view> |
|
|
</view> |
|
|
</view> |
|
@ -53,7 +54,8 @@ |
|
|
takeIssueJob, |
|
|
takeIssueJob, |
|
|
cancleTakeIssueJob, |
|
|
cancleTakeIssueJob, |
|
|
getIssueJobDetail, |
|
|
getIssueJobDetail, |
|
|
issueJobSubmit |
|
|
issueJobSubmit, |
|
|
|
|
|
issueCheck |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -265,42 +267,63 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getScanResult(result, managementTypeParams) { |
|
|
getScanResult(result, managementTypeParams) { |
|
|
this.managementType = managementTypeParams |
|
|
if(!result.package.number){ |
|
|
let array1 = []//记录推荐的库位 |
|
|
this.showErrorMessage("包装号不能为空") |
|
|
let array2 = []//记录推荐的批次 |
|
|
return; |
|
|
this.detailSource.forEach(item=>{ |
|
|
|
|
|
item.subList.forEach(cur=>{ |
|
|
|
|
|
array1.push(cur.fromLocationCode) |
|
|
|
|
|
array2.push(cur.batch) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
// 扫描的库位是否在 |
|
|
|
|
|
const obj1 = array1.find(item=>item == result.fromLocationCode) |
|
|
|
|
|
const obj2 = array2.find(item=>item == result.label.batch) |
|
|
|
|
|
if(this.jobContent.allowModifyLocation == 'FALSE'){ |
|
|
|
|
|
if(!obj1){ |
|
|
|
|
|
this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
if(this.jobContent.allowModifyBatch == 'FALSE'){ |
|
|
uni.showLoading({ |
|
|
if(!obj2){ |
|
|
title:"校验中...", |
|
|
this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`) |
|
|
mask:true |
|
|
return |
|
|
}) |
|
|
|
|
|
//校验箱码是否已经发料 |
|
|
|
|
|
issueCheck(result.package.number).then(res=>{ |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
if(res.data.length==0){ |
|
|
|
|
|
this.managementType = managementTypeParams |
|
|
|
|
|
let array1 = []//记录推荐的库位 |
|
|
|
|
|
let array2 = []//记录推荐的批次 |
|
|
|
|
|
this.detailSource.forEach(item=>{ |
|
|
|
|
|
item.subList.forEach(cur=>{ |
|
|
|
|
|
array1.push(cur.fromLocationCode) |
|
|
|
|
|
array2.push(cur.batch) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
// 扫描的库位是否在 |
|
|
|
|
|
const obj1 = array1.find(item=>item == result.fromLocationCode) |
|
|
|
|
|
const obj2 = array2.find(item=>item == result.label.batch) |
|
|
|
|
|
if(this.jobContent.allowModifyLocation == 'FALSE'){ |
|
|
|
|
|
if(!obj1){ |
|
|
|
|
|
this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(this.jobContent.allowModifyBatch == 'FALSE'){ |
|
|
|
|
|
if(!obj2){ |
|
|
|
|
|
this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(!obj1){ |
|
|
|
|
|
this.recommendQty = 0 |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.recommendQty = result.balance.qty |
|
|
|
|
|
} |
|
|
|
|
|
// this.managementType = managementTypeParams |
|
|
|
|
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
|
|
|
|
|
this.setDataBatch(result) |
|
|
|
|
|
} |
|
|
|
|
|
}else { |
|
|
|
|
|
this.showErrorMessage("箱码["+result.package.number+"]已经发过料") |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if(!obj1){ |
|
|
}).catch(error=>{ |
|
|
this.recommendQty = 0 |
|
|
uni.hideLoading() |
|
|
}else{ |
|
|
this.showErrorMessage(error.message) |
|
|
this.recommendQty = result.balance.qty |
|
|
}) |
|
|
} |
|
|
|
|
|
// this.managementType = managementTypeParams |
|
|
|
|
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
|
|
|
|
|
this.setDataBatch(result) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
setDataBatch(result) { |
|
|
setDataBatch11(result) { |
|
|
console.log(result) |
|
|
console.log(result) |
|
|
try { |
|
|
try { |
|
|
let that = this |
|
|
let that = this |
|
@ -324,7 +347,9 @@ |
|
|
|
|
|
|
|
|
var itemDetail = detail.subList.find(r => { |
|
|
var itemDetail = detail.subList.find(r => { |
|
|
return r.batch == batch && |
|
|
return r.batch == batch && |
|
|
r.fromLocationCode == result.fromLocationCode |
|
|
r.fromLocationCode == result.fromLocationCode&& |
|
|
|
|
|
r.packingNumber==packingNumber |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
if (itemDetail == undefined) { |
|
|
if (itemDetail == undefined) { |
|
|
var isExit; |
|
|
var isExit; |
|
@ -348,6 +373,7 @@ |
|
|
// .fromLocationCode + "】不在列表中") |
|
|
// .fromLocationCode + "】不在列表中") |
|
|
detail.subList.push({ |
|
|
detail.subList.push({ |
|
|
scaned:true, |
|
|
scaned:true, |
|
|
|
|
|
packingNumber:packingNumber, |
|
|
fromLocationCode:this.fromLocationCode, |
|
|
fromLocationCode:this.fromLocationCode, |
|
|
toLocationCode:this.toLocationCode, |
|
|
toLocationCode:this.toLocationCode, |
|
|
batch:result.label.batch, |
|
|
batch:result.label.batch, |
|
@ -401,7 +427,9 @@ |
|
|
detail.subList.forEach(item=>{ |
|
|
detail.subList.forEach(item=>{ |
|
|
item.handleQty =item.handleQty || 0 |
|
|
item.handleQty =item.handleQty || 0 |
|
|
detail.handleQty = calc.add(detail.handleQty,item.handleQty) |
|
|
detail.handleQty = calc.add(detail.handleQty,item.handleQty) |
|
|
// item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty)
// }) |
|
|
// item.packList.forEach(cur=>{ |
|
|
|
|
|
// cur.handleQty = calc.add(detail.handleQty,item.handleQty) |
|
|
|
|
|
// }) |
|
|
}) |
|
|
}) |
|
|
// calcHandleQtyAdd(this.detailSource, result.label); |
|
|
// calcHandleQtyAdd(this.detailSource, result.label); |
|
|
} |
|
|
} |
|
@ -452,7 +480,9 @@ |
|
|
console.log(item.handleQty) |
|
|
console.log(item.handleQty) |
|
|
item.handleQty =item.handleQty || 0 |
|
|
item.handleQty =item.handleQty || 0 |
|
|
detail.handleQty = calc.add(detail.handleQty,item.handleQty) |
|
|
detail.handleQty = calc.add(detail.handleQty,item.handleQty) |
|
|
// item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty)
// }) |
|
|
// item.packList.forEach(cur=>{ |
|
|
|
|
|
// cur.handleQty = calc.add(detail.handleQty,item.handleQty) |
|
|
|
|
|
// }) |
|
|
}) |
|
|
}) |
|
|
// calcTreeHandleQty(this.detailSource); |
|
|
// calcTreeHandleQty(this.detailSource); |
|
|
this.continueScan() |
|
|
this.continueScan() |
|
@ -460,11 +490,80 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.detailSource.forEach(item => { |
|
|
// this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
// item.subList.forEach(detail => { |
|
|
detail.packingNumber = '' |
|
|
// detail.packingNumber = '' |
|
|
}) |
|
|
// }) |
|
|
}) |
|
|
// }) |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
this.showMessage(e.message) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setDataBatch(result) { |
|
|
|
|
|
try { |
|
|
|
|
|
let that = this |
|
|
|
|
|
this.balanceinfo = result.balance |
|
|
|
|
|
var packingNumber = result.label.packingNumber; |
|
|
|
|
|
var batch = result.label.batch; |
|
|
|
|
|
var qty = result.label.qty; |
|
|
|
|
|
var itemCode = result.label.itemCode; |
|
|
|
|
|
var locationCode = result.fromLocationCode; |
|
|
|
|
|
|
|
|
|
|
|
if (!result.balance) { |
|
|
|
|
|
this.showMessage("没有库存余额") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
// var inventoryStatus = "OK"; |
|
|
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
|
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
|
|
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
var itemDetail = detail.subList.find(r => { |
|
|
|
|
|
return r.batch == batch && |
|
|
|
|
|
r.fromLocationCode == result.fromLocationCode&& |
|
|
|
|
|
r.packingNumber==packingNumber |
|
|
|
|
|
}) |
|
|
|
|
|
//扫描的数据不在任务中,添加到列表 |
|
|
|
|
|
if (itemDetail == undefined) { |
|
|
|
|
|
var item ={ |
|
|
|
|
|
scaned:true, |
|
|
|
|
|
packingNumber:packingNumber, |
|
|
|
|
|
fromLocationCode:this.fromLocationCode, |
|
|
|
|
|
toLocationCode:this.toLocationCode, |
|
|
|
|
|
batch:result.label.batch, |
|
|
|
|
|
handleQty:result.label.qty, |
|
|
|
|
|
qty:0, |
|
|
|
|
|
inventoryStatus:result.balance.inventoryStatus, |
|
|
|
|
|
toLocation:result.balance.toLocation, |
|
|
|
|
|
balance:result.balance, |
|
|
|
|
|
balanceQty:result.balance.qty, |
|
|
|
|
|
packQty:result.package.packQty, |
|
|
|
|
|
packUnit:result.package.packUnit, |
|
|
|
|
|
uom:result.balance.uom, |
|
|
|
|
|
isRecommTaskItem:false,//不是推荐任务中的任务 |
|
|
|
|
|
} |
|
|
|
|
|
detail.subList.push(item) |
|
|
|
|
|
//计算数量 |
|
|
|
|
|
detail.handleQty = 0 |
|
|
|
|
|
detail.qty = 0 |
|
|
|
|
|
detail.subList.forEach(item=>{ |
|
|
|
|
|
item.handleQty =item.handleQty || 0 |
|
|
|
|
|
detail.handleQty = calc.add(detail.handleQty,item.handleQty) |
|
|
|
|
|
detail.qty = calc.add(detail.qty,item.qty) |
|
|
|
|
|
}) |
|
|
|
|
|
setTimeout(r => { |
|
|
|
|
|
that.resizeCollapse(); |
|
|
|
|
|
that.$forceUpdate() |
|
|
|
|
|
}, 100) |
|
|
|
|
|
}else { |
|
|
|
|
|
this.showErrorMessage("包装号["+packingNumber+"]已经扫描") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
this.showMessage(e.message) |
|
|
this.showMessage(e.message) |
|
|
} |
|
|
} |
|
@ -506,7 +605,6 @@ |
|
|
|
|
|
|
|
|
submitJob() { |
|
|
submitJob() { |
|
|
var params = this.setParams() |
|
|
var params = this.setParams() |
|
|
console.log(params) |
|
|
|
|
|
|
|
|
|
|
|
// if (!params.subList || params.subList.length == 0) { |
|
|
// if (!params.subList || params.subList.length == 0) { |
|
|
// uni.hideLoading() |
|
|
// uni.hideLoading() |
|
@ -563,7 +661,7 @@ |
|
|
obj1.qty =record.qty; |
|
|
obj1.qty =record.qty; |
|
|
obj1.scaned =record.scaned; |
|
|
obj1.scaned =record.scaned; |
|
|
obj1.toLocationCode =record.toLocationCode; |
|
|
obj1.toLocationCode =record.toLocationCode; |
|
|
obj1.fromPackingNumber =''; |
|
|
obj1.fromPackingNumber =record.packingNumber; |
|
|
obj1.fromBatch = record.batch; |
|
|
obj1.fromBatch = record.batch; |
|
|
obj1.toBatch = record.batch; |
|
|
obj1.toBatch = record.batch; |
|
|
obj1.toInventoryStatus = record.inventoryStatus; |
|
|
obj1.toInventoryStatus = record.inventoryStatus; |
|
@ -629,8 +727,71 @@ |
|
|
this.resizeCollapse(); |
|
|
this.resizeCollapse(); |
|
|
// this.autoCommit() |
|
|
// this.autoCommit() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
autoCommit(){ |
|
|
autoCommit(){ |
|
|
|
|
|
let str="" |
|
|
|
|
|
let str1="" |
|
|
|
|
|
let str2="" |
|
|
|
|
|
let str3="" |
|
|
|
|
|
let isTrue = true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.detailSource.forEach(detail=>{ |
|
|
|
|
|
var itemHandleQty=0 |
|
|
|
|
|
detail.subList.forEach(item=>{ |
|
|
|
|
|
//计算不是推荐的,而是扫描的 |
|
|
|
|
|
if(item.scaned){ |
|
|
|
|
|
itemHandleQty=calc.add(itemHandleQty,item.handleQty) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
if(itemHandleQty<detail.qty){ |
|
|
|
|
|
str += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许小于任务数量【${detail.qty}】\n` |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(itemHandleQty>detail.qty){ |
|
|
|
|
|
str1 += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许大于任务数量【${detail.qty}\n】` |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (this.jobContent.allowSmallerQty == "FALSE") { |
|
|
|
|
|
if (str) { |
|
|
|
|
|
str = '不允许提交\n' + str |
|
|
|
|
|
this.showErrorMessage(str) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (this.jobContent.allowBiggerQty == 'FALSE') { |
|
|
|
|
|
if (str1) { |
|
|
|
|
|
str1 = '不允许提交\n' + str1 |
|
|
|
|
|
this.showErrorMessage(str1) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (str2) { |
|
|
|
|
|
str2 = '不允许提交\n' + str2 |
|
|
|
|
|
this.showErrorMessage(str2) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
console.log(str3) |
|
|
|
|
|
if(str3){ |
|
|
|
|
|
str3 = str3+"是否提交" |
|
|
|
|
|
this.$refs.comMessage.showQuestionMessage1(str3, 'red', res => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
//防止重复点击 |
|
|
|
|
|
this.$throttle(this.submit, 2000, this)() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.scanPopupGetFocus() |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}else { |
|
|
|
|
|
//防止重复点击 |
|
|
|
|
|
this.$throttle(this.submit, 2000, this)() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
autoCommit11(){ |
|
|
// this.$throttle(this.submit, 2000, this)() |
|
|
// this.$throttle(this.submit, 2000, this)() |
|
|
// this.jobContent.allowSmallerQty = 'FALSE' |
|
|
// this.jobContent.allowSmallerQty = 'FALSE' |
|
|
// this.jobContent.allowBiggerQty = 'FALSE' |
|
|
// this.jobContent.allowBiggerQty = 'FALSE' |
|
|