|
|
@ -13,7 +13,7 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<recordDetailCard :dataContent="item" :index="index" :settingParam="dataContent" :isShowFromLocation="false" @removeItem="removeItem(index, item)" @updateData="updateData" @removePack="removePack"> </recordDetailCard> |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" :isShowFromLocation="false" @removeItem="removeItem(index, item)" :isShowToLocation="false" @updateData="updateData" @removePack="removePack"> </record-com-detail-card> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
@ -53,7 +53,7 @@ import { calc } from '@/common/calc.js' |
|
|
|
|
|
|
|
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js' |
|
|
|
|
|
|
|
import { getBusinessType, createItemInfo, createDetailInfo, calcTreeHandleQty } from '@/common/record.js' |
|
|
|
import { getBusinessType, createItemInfo, createDetailInfo, calcTreeHandleQty, calcHandleQty } from '@/common/record.js' |
|
|
|
|
|
|
|
import { getManagementPrecisions, getPrecisionStrategyList, getPrecisionStrategyParams } from '@/common/balance.js' |
|
|
|
|
|
|
@ -139,6 +139,8 @@ const getScanResult = (result) => { |
|
|
|
const { balance } = result |
|
|
|
const { label } = result |
|
|
|
const pack = result.package |
|
|
|
const { packUnit } = pack |
|
|
|
const { packQty } = pack |
|
|
|
const item = detailSource.value.find((res) => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
return res |
|
|
@ -148,34 +150,29 @@ const getScanResult = (result) => { |
|
|
|
fromWarehouseCode.value = balance.warehouseCode |
|
|
|
} |
|
|
|
if (item == undefined) { |
|
|
|
// 获取推荐库位 |
|
|
|
// this.getRecommendLocation(balance, pack, toLocation => { |
|
|
|
const itemp = createItemInfo(balance, pack) |
|
|
|
const newDetail = createDetailInfo(balance, pack) // |
|
|
|
// newDetail.toLocationCode = toLocation.code; |
|
|
|
// newDetail.toWarehouseCode = toLocation.warehouseCode; |
|
|
|
const newDetail = createDetailInfo(balance, pack) |
|
|
|
newDetail.packUnit = packUnit || '' |
|
|
|
newDetail.packQty = packQty || '' |
|
|
|
itemp.subList.push(newDetail) |
|
|
|
const dataList = pack.subList |
|
|
|
detailSource.value.push(itemp) |
|
|
|
detailSource.value.forEach((res) => { |
|
|
|
res.subList.forEach((pack) => { |
|
|
|
pack.packList = dataList.filter((c) => c.parentNumber == pack.packingNumber) |
|
|
|
pack.packList.forEach((pac) => { |
|
|
|
pac.parentPackingNumber = pac.parentNumber |
|
|
|
pac.packingNumber = pac.number |
|
|
|
pac.inventoryStatus = 'OK' |
|
|
|
pac.scaned = true |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
// }) |
|
|
|
calcHandleQty(detailSource.value) |
|
|
|
} else { |
|
|
|
const itemDetail = item.subList.find((r) => r.packingNumber == balance.packingNumber && r.batch == balance.batch) |
|
|
|
if (itemDetail != undefined) { |
|
|
|
const detail = item.subList.find((r) => { |
|
|
|
if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
return r |
|
|
|
} |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
const newDetail = createDetailInfo(balance, pack) |
|
|
|
newDetail.packUnit = packUnit |
|
|
|
newDetail.packQty = packQty |
|
|
|
item.subList.push(newDetail) |
|
|
|
calcHandleQty(detailSource.value) |
|
|
|
} else if (detail.scaned == true) { |
|
|
|
showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`) |
|
|
|
} |
|
|
|
} |
|
|
|
// calcTreeHandleQty(this.detailSource); |
|
|
|
} |
|
|
|
|
|
|
|
// 获取推荐库位 |
|
|
@ -272,10 +269,6 @@ const confirmSelect = (e) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// const updateData = () => { |
|
|
|
// calcTreeHandleQty() |
|
|
|
// } |
|
|
|
|
|
|
|
const removeItem = (index, item) => { |
|
|
|
detailSource.value.splice(index, 1) |
|
|
|
} |
|
|
@ -343,33 +336,6 @@ const commit = () => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const getItemAndLocationRelations = () => { |
|
|
|
const itemList = [] |
|
|
|
detailSource.value.forEach((item) => { |
|
|
|
item.subList.forEach((detail) => { |
|
|
|
if (detail.scaned) { |
|
|
|
detail.toLocationCode = toLocationCode |
|
|
|
const filterResult = itemList.filter((res) => { |
|
|
|
if (res.itemCode == item.itemCode && res.locationCode == detail.toLocationCode && res.batch == detail.batch && res.inventoryStatus == detail.inventoryStatus) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
// 去掉重复元素 |
|
|
|
if (filterResult.length == 0) { |
|
|
|
const result = { |
|
|
|
itemCode: item.itemCode, |
|
|
|
locationCode: detail.toLocationCode, |
|
|
|
batch: detail.batch, |
|
|
|
inventoryStatus: detail.inventoryStatus |
|
|
|
} |
|
|
|
itemList.push(result) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
return itemList |
|
|
|
} |
|
|
|
|
|
|
|
const setRecordParams = () => { |
|
|
|
const subList = [] |
|
|
|
const creator = store.id |
|
|
@ -402,7 +368,11 @@ const setRecordParams = () => { |
|
|
|
toBatch: info.batch, |
|
|
|
fromLocationCode: detail.locationCode, |
|
|
|
toLocationCode: detail.toLocationCode, |
|
|
|
handleQty: detail.handleQty |
|
|
|
handleQty: detail.handleQty, |
|
|
|
fromPackUnit: detail.packUnit, |
|
|
|
toPackUnit: detail.packUnit, |
|
|
|
fromPackQty: detail.packQty, |
|
|
|
toPackQty: detail.packQty |
|
|
|
} |
|
|
|
] |
|
|
|
subList.push(submitItem) |
|
|
@ -468,7 +438,7 @@ const showCommitSuccessMessage = (hint) => { |
|
|
|
} |
|
|
|
|
|
|
|
const updateData = () => { |
|
|
|
// this.calcTreeHandleQty(); |
|
|
|
calcHandleQty(detailSource.value) |
|
|
|
for (let i = 0; i < detailSource.value.length; i++) { |
|
|
|
const item = detailSource.value[i] |
|
|
|
if (item.qty == 0) { |
|
|
|