|
|
@ -20,11 +20,10 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<comRecommendDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-if="managementType=='BY_BATCH'"> |
|
|
|
</comRecommendDetailCardBatch> |
|
|
|
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-else> |
|
|
|
|
|
|
|
<comRecommendDetailCard :dataContent="item" :index="index" |
|
|
|
:settingParam="jobContent" @remove="updateData" |
|
|
|
@updateData="updateData" @openDetail="openDetail"> |
|
|
|
</comRecommendDetailCard> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -64,10 +63,9 @@ import { |
|
|
|
} from 'decimal.js'; //引入 |
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' |
|
|
|
import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue" |
|
|
|
import comRecommendDetailCardBatch from "@/mycomponents/detail/comRecommendDetailCardBatch.vue" |
|
|
|
import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue' |
|
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import ComRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue" |
|
|
|
import DetailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue' |
|
|
|
import JobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import { useCountStore } from '@/store' |
|
|
|
// 获取自定义的store |
|
|
|
const store = useCountStore() |
|
|
@ -171,8 +169,9 @@ const getDetail = () => { |
|
|
|
await getManagementPrecisions(itemCodes, fromLocationCode.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 ? managementList.value[0].ManagementPrecision : 'BY_PACKAGING' |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
@ -213,22 +212,73 @@ const updateData = () => { |
|
|
|
const openDetail = (item) => { |
|
|
|
detailInfoPopupRef.value.openPopup(item) |
|
|
|
} |
|
|
|
const getScanResult = (result)=> { |
|
|
|
if(import.meta.env.VITE_MANAGE_MODEL == 'BY_BATCH'){ |
|
|
|
setDataBatch(result) |
|
|
|
}else{ |
|
|
|
setData(result) |
|
|
|
} |
|
|
|
} |
|
|
|
const setDataBatch = (result) => { |
|
|
|
try { |
|
|
|
const { packingNumber,batch, |
|
|
|
qty,itemCode, |
|
|
|
locationCode,inventoryStatus} = result.balance |
|
|
|
const detail = detailSource.value.find((r) => r.itemCode == itemCode) |
|
|
|
|
|
|
|
const getScanResult = (result) => { |
|
|
|
if (detail == undefined) { |
|
|
|
showErrorMessage(`物料号【${itemCode}】不在列表中`) |
|
|
|
} else { |
|
|
|
const itemDetail = detail.subList.find((r) => { |
|
|
|
return r.batch == batch && |
|
|
|
r.fromLocationCode == result.fromLocationCode && |
|
|
|
r.isRecommend==false |
|
|
|
}) |
|
|
|
if (itemDetail == undefined) { |
|
|
|
let newAdd = { |
|
|
|
itemCode:itemCode, |
|
|
|
packingNumber:packingNumber, |
|
|
|
batch:batch, |
|
|
|
handleQty:Number(result.label.qty), |
|
|
|
qty:detail.qty, |
|
|
|
fromLocationCode: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) { |
|
|
|
itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty)); |
|
|
|
} |
|
|
|
} |
|
|
|
calcHandleQty(); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
showMessage(e.message) |
|
|
|
} |
|
|
|
} |
|
|
|
const setData = (result) => { |
|
|
|
try { |
|
|
|
const { packingNumber } = result.balance |
|
|
|
const { batch } = result.balance |
|
|
|
const { qty } = result.balance |
|
|
|
const { itemCode } = result.balance |
|
|
|
const { locationCode } = result.balance |
|
|
|
const { inventoryStatus } = result.balance |
|
|
|
const { packingNumber,batch, |
|
|
|
qty,itemCode,locationCode, |
|
|
|
inventoryStatus } = result.balance |
|
|
|
const detail = detailSource.value.find((r) => r.itemCode == itemCode) |
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
|
showErrorMessage(`物料号【${itemCode}】不在列表中`) |
|
|
|
} else { |
|
|
|
const itemDetail = detail.subList.find((r) => { |
|
|
|
return r.packingNumber == packingNumber && r.batch == batch && r.fromLocationCode == result.fromLocationCode && r.isRecommend==false |
|
|
|
return r.packingNumber == packingNumber && |
|
|
|
r.batch == batch && |
|
|
|
r.fromLocationCode == result.fromLocationCode && |
|
|
|
r.isRecommend==false |
|
|
|
}) |
|
|
|
if (itemDetail == undefined) { |
|
|
|
let newAdd = { |
|
|
|