|
|
@ -13,11 +13,13 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
|
|
|
|
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
@remove="updateData" @updateData="updateData" |
|
|
|
:locationAreaTypeList='toLocationAreaTypeList'> |
|
|
|
</com-receipt-detail-card> |
|
|
|
<!-- <com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent"--> |
|
|
|
<!-- @remove="updateData" @updateData="updateData"--> |
|
|
|
<!-- :locationAreaTypeList='toLocationAreaTypeList'>--> |
|
|
|
<!-- </com-receipt-detail-card>--> |
|
|
|
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
@remove="updateData" @updateData="updateData" @openDetail="openDetail" :isShowFromLocation='false'> |
|
|
|
</comRecommendDetailCard> |
|
|
|
</view> |
|
|
|
<view class="split_line"></view> |
|
|
|
</view> |
|
|
@ -53,9 +55,10 @@ import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/ |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
import locationCompare from '@/mycomponents/location/locationCompare.vue' |
|
|
|
import LocationCompare from '@/mycomponents/location/locationCompare.vue' |
|
|
|
import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue' |
|
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import ComRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue" |
|
|
|
import JobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import { useCountStore } from '@/store' |
|
|
|
// 获取自定义的store |
|
|
|
const store = useCountStore() |
|
|
@ -149,6 +152,9 @@ const getDetail = () => { |
|
|
|
jobContent.value = res.data |
|
|
|
jobStatus.value = res.data.status |
|
|
|
subList.value = res.data.subList |
|
|
|
subList.value.forEach(item=>{ |
|
|
|
item.isRecommend = true |
|
|
|
}) |
|
|
|
detailSource.value = getDataSource(subList.value) |
|
|
|
jobToLocationCode.value = subList.value[0].toLocationCode |
|
|
|
toLocationAreaTypeList.value = await getDirectoryItemArray(jobContent.value.toAreaTypes) |
|
|
@ -161,7 +167,9 @@ const getDetail = () => { |
|
|
|
getManagementPrecisions(itemCodes, jobToLocationCode.value, res => { |
|
|
|
if (res.success) { |
|
|
|
managementList.value = res.list; |
|
|
|
managementType.value = managementList.value.some(item => item.ManagementPrecision == 'BY_BATCH') ? 'BY_BATCH' : '' |
|
|
|
managementType.value = managementList.value && |
|
|
|
managementList.value[0] && |
|
|
|
managementList.value[0].ManagementPrecision |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
@ -209,14 +217,41 @@ const setDataBatch = (result)=>{ |
|
|
|
const batch = result.label.batch; |
|
|
|
const qty = result.label.qty; |
|
|
|
const itemCode = result.label.itemCode; |
|
|
|
const locationCode = result.package.toLocationCode; |
|
|
|
const detail = detailSource.value.find(r => r.itemCode == itemCode); |
|
|
|
if (detail == undefined) { |
|
|
|
showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
} else { |
|
|
|
|
|
|
|
var itemDetail = detail.subList.find(r => r.batch == batch); |
|
|
|
const itemDetail = detail.subList.find(r => { |
|
|
|
return r.batch == batch && |
|
|
|
r.fromLocationCode == result.fromLocationCode&& |
|
|
|
r.isRecommend==false |
|
|
|
}) |
|
|
|
const itemDetail1 = detail.subList.find(r => { |
|
|
|
return r.batch == batch && |
|
|
|
r.fromLocationCode == result.fromLocationCode&& |
|
|
|
r.isRecommend==true |
|
|
|
}) |
|
|
|
if (itemDetail == undefined) { |
|
|
|
showErrorMessage("批次【" + batch + "】" + "不在列表中") |
|
|
|
let 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 { |
|
|
|
if (itemDetail.scaned) { |
|
|
|
// this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】" + "已经扫描") |
|
|
@ -269,6 +304,64 @@ const setData = (result) => { |
|
|
|
} |
|
|
|
|
|
|
|
const commit = () => { |
|
|
|
if(managementType.value == 'BY_BATCH' || managementType.value == 'BY_QUANTITY' ){ |
|
|
|
let scanCount = 0; |
|
|
|
detailSource.value.forEach((item) => { |
|
|
|
item.subList.forEach(cur => { |
|
|
|
if(cur.scaned){ |
|
|
|
scanCount++; |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if(scanCount==0){ |
|
|
|
showErrorMessage("扫描数为0,请先扫描") |
|
|
|
return; |
|
|
|
} |
|
|
|
let str = '' |
|
|
|
let str1 = '' |
|
|
|
detailSource.value.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(jobContent.value.allowBiggerQty == "FALSE"){ |
|
|
|
if(str1){ |
|
|
|
comMessageRef.value.showErrorMessage(str1); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(jobContent.value.allowSmallerQty == "FALSE"){ |
|
|
|
if(str){ |
|
|
|
comMessageRef.value.showErrorMessage(str); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (scanCount < subList.value.length){ |
|
|
|
if(jobContent.value.allowPartialComplete == "TRUE"){ |
|
|
|
comMessageRef.value.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => { |
|
|
|
if (res) { |
|
|
|
submitJob() |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
//不允许部分提交,提示 |
|
|
|
comMessageRef.value.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { |
|
|
|
if (res) { |
|
|
|
openScanPopup(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
submitJob() |
|
|
|
} |
|
|
|
}else { |
|
|
|
scanCount.value = getScanCount(subList.value) |
|
|
|
if (scanCount.value == 0) { |
|
|
|
showErrorMessage('扫描数为0,请先扫描') |
|
|
@ -300,6 +393,7 @@ const commit = () => { |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const checkLocation = () => { |
|
|
|