|
@ -12,10 +12,13 @@ |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
<!-- <com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
@remove="updateData" @updateData="updateData" |
|
|
@remove="updateData" @updateData="updateData" |
|
|
:locationAreaTypeList='toLocationAreaTypeList'> |
|
|
:locationAreaTypeList='toLocationAreaTypeList'> |
|
|
</com-receipt-detail-card> |
|
|
</com-receipt-detail-card> --> |
|
|
|
|
|
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
|
|
@remove="updateData" @updateData="updateData" @openDetail="openDetail" :isShowFromLocation='false'> |
|
|
|
|
|
</comRecommendDetailCard> |
|
|
</view> |
|
|
</view> |
|
|
<view class='split_line'></view> |
|
|
<view class='split_line'></view> |
|
|
</view> |
|
|
</view> |
|
@ -76,6 +79,7 @@ |
|
|
import locationCompare from '@/mycomponents/location/locationCompare.vue' |
|
|
import locationCompare from '@/mycomponents/location/locationCompare.vue' |
|
|
import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue' |
|
|
import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue' |
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
|
|
import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue" |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'receipt_detail', |
|
|
name: 'receipt_detail', |
|
@ -84,7 +88,8 @@ |
|
|
winScanPack, |
|
|
winScanPack, |
|
|
comReceiptDetailCard, |
|
|
comReceiptDetailCard, |
|
|
locationCompare, |
|
|
locationCompare, |
|
|
jobTop |
|
|
jobTop, |
|
|
|
|
|
comRecommendDetailCard |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
@ -175,6 +180,9 @@ |
|
|
that.jobStatus = res.data.status |
|
|
that.jobStatus = res.data.status |
|
|
that.toLocationAreaTypeList =getDirectoryItemArray(that.jobContent.toAreaTypes); |
|
|
that.toLocationAreaTypeList =getDirectoryItemArray(that.jobContent.toAreaTypes); |
|
|
that.subList = res.data.subList; |
|
|
that.subList = res.data.subList; |
|
|
|
|
|
that.subList.forEach(item=>{ |
|
|
|
|
|
item.isRecommend = true |
|
|
|
|
|
}) |
|
|
that.jobToLocationCode = that.subList[0].toLocationCode |
|
|
that.jobToLocationCode = that.subList[0].toLocationCode |
|
|
that.detailSource =await getDataSource(that.subList) |
|
|
that.detailSource =await getDataSource(that.subList) |
|
|
//获取管理模式,封装参数 |
|
|
//获取管理模式,封装参数 |
|
@ -186,7 +194,7 @@ |
|
|
getManagementPrecisions(itemCodes, that.jobToLocationCode, res => { |
|
|
getManagementPrecisions(itemCodes, that.jobToLocationCode, res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
this.managementList = res.list; |
|
|
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 |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
@ -236,18 +244,50 @@ |
|
|
}, |
|
|
}, |
|
|
setDataBatch(result){ |
|
|
setDataBatch(result){ |
|
|
try { |
|
|
try { |
|
|
|
|
|
console.log(222,result) |
|
|
var packingNumber = result.label.packingNumber; |
|
|
var packingNumber = result.label.packingNumber; |
|
|
var batch = result.label.batch; |
|
|
var batch = result.label.batch; |
|
|
var qty = result.label.qty; |
|
|
var qty = result.label.qty; |
|
|
var itemCode = result.label.itemCode; |
|
|
var itemCode = result.label.itemCode; |
|
|
|
|
|
var locationCode = result.package.toLocationCode; |
|
|
|
|
|
// var inventoryStatus = result.balance.inventoryStatus; |
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
if (detail == undefined) { |
|
|
if (detail == undefined) { |
|
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
var itemDetail = detail.subList.find(r => r.batch == batch); |
|
|
// var itemDetail = detail.subList.find(r => r.batch == batch); |
|
|
|
|
|
var itemDetail = detail.subList.find(r => { |
|
|
|
|
|
return r.batch == batch && |
|
|
|
|
|
r.fromLocationCode == result.fromLocationCode&& |
|
|
|
|
|
r.isRecommend==false |
|
|
|
|
|
}) |
|
|
|
|
|
var itemDetail1 = detail.subList.find(r => { |
|
|
|
|
|
return r.batch == batch && |
|
|
|
|
|
r.fromLocationCode == result.fromLocationCode&& |
|
|
|
|
|
r.isRecommend==true |
|
|
|
|
|
}) |
|
|
if (itemDetail == undefined) { |
|
|
if (itemDetail == undefined) { |
|
|
this.showErrorMessage("批次【" + batch + "】" + "不在列表中") |
|
|
// this.showErrorMessage("批次【" + batch + "】" + "不在列表中") |
|
|
|
|
|
var newAdd = { |
|
|
|
|
|
...itemDetail1, |
|
|
|
|
|
itemCode:itemCode, |
|
|
|
|
|
packingNumber:packingNumber, |
|
|
|
|
|
batch:batch, |
|
|
|
|
|
handleQty:Number(result.label.qty), |
|
|
|
|
|
qty:detail.qty, |
|
|
|
|
|
toLocationCode:locationCode, |
|
|
|
|
|
// inventoryStatus:inventoryStatus, |
|
|
|
|
|
// toInventoryStatus:inventoryStatus, |
|
|
|
|
|
// balance:result.balance, |
|
|
|
|
|
isRecommend:false, |
|
|
|
|
|
isNewAdd:"newAdd" |
|
|
|
|
|
} |
|
|
|
|
|
// newAdd.balance.balanceQty = Number(result.balance.qty); |
|
|
|
|
|
// newAdd.balance.packQty = Number(result.package.packQty) |
|
|
|
|
|
// newAdd.balance.packUnit = result.package.packUnit |
|
|
|
|
|
newAdd.scaned = true; |
|
|
|
|
|
detail.subList.push(newAdd) |
|
|
} else { |
|
|
} else { |
|
|
if (itemDetail.scaned) { |
|
|
if (itemDetail.scaned) { |
|
|
// this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】" + "已经扫描") |
|
|
// this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】" + "已经扫描") |
|
@ -304,6 +344,68 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
commit() { |
|
|
commit() { |
|
|
|
|
|
if(this.managementType == 'BY_BATCH' ||this.managementType == 'BY_QUANTITY' ){ |
|
|
|
|
|
var scanCount=0; |
|
|
|
|
|
console.log(77,this.detailSource) |
|
|
|
|
|
this.detailSource.forEach((item) => { |
|
|
|
|
|
item.subList.forEach(cur => { |
|
|
|
|
|
if(cur.scaned){ |
|
|
|
|
|
scanCount++; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
if(scanCount==0){ |
|
|
|
|
|
this.showErrorMessage("扫描数为0,请先扫描") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
let str = '' |
|
|
|
|
|
let str1 = '' |
|
|
|
|
|
this.detailSource.forEach((item) => { |
|
|
|
|
|
item.subList.forEach(cur=>{ |
|
|
|
|
|
if(cur.scaned){ |
|
|
|
|
|
if(parseFloat(cur.qty)>parseFloat(cur.handleQty)){ |
|
|
|
|
|
str += `物料号【${item.itemCode}】实际提交数量【${cur.handleQty}】不可以小于任务数量【${cur.qty}】` |
|
|
|
|
|
} |
|
|
|
|
|
if(parseFloat(cur.qty)<parseFloat(cur.handleQty)){ |
|
|
|
|
|
str1 += `物料号【${item.itemCode}】实际提交数量【${cur.handleQty}】不可以大于任务数量【${cur.qty}】` |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
if(this.jobContent.allowBiggerQty == "FALSE"){ |
|
|
|
|
|
if(str1){ |
|
|
|
|
|
this.$refs.comMessage.showErrorMessage(str1); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(this.jobContent.allowSmallerQty == "FALSE"){ |
|
|
|
|
|
if(str){ |
|
|
|
|
|
this.$refs.comMessage.showErrorMessage(str); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
console.log(11,scanCount) |
|
|
|
|
|
console.log(11,this.subList.length) |
|
|
|
|
|
if (scanCount < this.subList.length){ |
|
|
|
|
|
if(this.jobContent.allowPartialComplete == "TRUE"){ |
|
|
|
|
|
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
this.submitJob() |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
//不允许部分提交,提示 |
|
|
|
|
|
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
this.openScanPopup(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.submitJob() |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
this.scanCount = getScanCount(this.subList); |
|
|
this.scanCount = getScanCount(this.subList); |
|
|
if (this.scanCount == 0) { |
|
|
if (this.scanCount == 0) { |
|
|
this.showErrorMessage("扫描数为0,请先扫描") |
|
|
this.showErrorMessage("扫描数为0,请先扫描") |
|
@ -334,8 +436,11 @@ |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkLocation() { |
|
|
checkLocation() { |
|
|
var isPass = true; |
|
|
var isPass = true; |
|
|
if (this.toLocationCode == "" || this.toLocationCode == null) { |
|
|
if (this.toLocationCode == "" || this.toLocationCode == null) { |
|
|