|
@ -1,12 +1,12 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="page-wraper"> |
|
|
<view class="page-wraper"> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<com-blank-view @goScan="showFromLocationPopup" v-if="detailSource.length == 0"></com-blank-view> |
|
|
<com-blank-view @goScan="getBusinessType" v-if="detailSource.length == 0"></com-blank-view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="page-wraper" v-if="detailSource.length > 0"> |
|
|
<view class="page-wraper" v-if="detailSource.length > 0"> |
|
|
<view class="page-header"> |
|
|
<view class="page-header"> |
|
|
<view class="page-header-box"> |
|
|
<view class="page-header-box"> |
|
|
<view class="header_item u-p-t-20"> 来源库位 : {{ fromLocationCode }} </view> |
|
|
<view class="header_item u-p-t-20" style="font-size: 35rpx; padding: 10rpx"> 来源库位 : {{ fromLocationCode }} </view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="page-main"> |
|
|
<view class="page-main"> |
|
@ -30,10 +30,8 @@ |
|
|
</view> |
|
|
</view> |
|
|
<win-scan-button @goScan="openScanPopup"></win-scan-button> |
|
|
<win-scan-button @goScan="openScanPopup"></win-scan-button> |
|
|
</view> |
|
|
</view> |
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult="getScanResult" :allowModifyLocation="false" :queryBalance="false"> </win-scan-pack-and-location> |
|
|
<winComScanBalance ref="scanPopup" @getBalance="getScanResult" :bussinessCode="businessTypeCode"> </winComScanBalance> |
|
|
<com-message ref="comMessageRef" /> |
|
|
<com-message ref="comMessageRef" /> |
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation="getLocation" :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> |
|
|
|
|
|
<balance-select ref="balanceSelectRef" @onSelectItem="selectBalanceItem"></balance-select> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -61,6 +59,7 @@ import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.v |
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' |
|
|
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' |
|
|
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
|
|
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
|
|
|
|
|
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' |
|
|
import { useCountStore } from '@/store' |
|
|
import { useCountStore } from '@/store' |
|
|
// 获取自定义的store |
|
|
// 获取自定义的store |
|
|
const store = useCountStore() |
|
|
const store = useCountStore() |
|
@ -81,6 +80,7 @@ const fromWarehouseCode = ref('') // 来源仓库 |
|
|
const businessTypeCode = ref('Repleinment') |
|
|
const businessTypeCode = ref('Repleinment') |
|
|
const toLocationCode = ref('') |
|
|
const toLocationCode = ref('') |
|
|
const resultData = ref({}) |
|
|
const resultData = ref({}) |
|
|
|
|
|
const itemCode = ref('') |
|
|
const balanceSelectRef = ref({}) |
|
|
const balanceSelectRef = ref({}) |
|
|
|
|
|
|
|
|
const managementList = ref([]) |
|
|
const managementList = ref([]) |
|
@ -93,23 +93,26 @@ const scanPopup = ref() |
|
|
const scanLocationCode = ref() |
|
|
const scanLocationCode = ref() |
|
|
onLoad((option) => { |
|
|
onLoad((option) => { |
|
|
clear() |
|
|
clear() |
|
|
|
|
|
getBusinessType() |
|
|
|
|
|
}) |
|
|
|
|
|
// 返回首页 |
|
|
|
|
|
onNavigationBarButtonTap((e) => { |
|
|
|
|
|
if (e.index === 0) { |
|
|
|
|
|
goHome() |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
const getBusinessType = () => { |
|
|
getBusinessType(businessTypeCode.value, (res) => { |
|
|
getBusinessType(businessTypeCode.value, (res) => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
businessType.value = res.businessType |
|
|
businessType.value = res.businessType |
|
|
|
|
|
fromInventoryStatuses.value = getDirectoryItemArray(res.fromInventoryStatuses) |
|
|
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList |
|
|
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList |
|
|
toLocationAreaTypeList.value = res.toLocationAreaTypeList |
|
|
openScanPopup() |
|
|
showFromLocationPopup() |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
showErrorMessage(res.message) |
|
|
showErrorMessage(res.message) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
// 返回首页 |
|
|
|
|
|
onNavigationBarButtonTap((e) => { |
|
|
|
|
|
if (e.index === 0) { |
|
|
|
|
|
goHome() |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
const getBalance = (label, packageInfo, callback) => { |
|
|
const getBalance = (label, packageInfo, callback) => { |
|
|
const filters = [] |
|
|
const filters = [] |
|
|
|
|
|
|
|
@ -161,104 +164,43 @@ const getBalance = (label, packageInfo, callback) => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
const getScanResult = (result) => { |
|
|
const getScanResult = (result) => { |
|
|
resultData.value = result |
|
|
setData(result) |
|
|
const packageInfo = result.package |
|
|
|
|
|
getBalance(result.label, packageInfo, (balances) => { |
|
|
|
|
|
// 扫描的是外包装 |
|
|
|
|
|
const s = '' |
|
|
|
|
|
if (!result.package.parentNumber) { |
|
|
|
|
|
if (balances.list.length == 0) { |
|
|
|
|
|
showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
|
|
|
} else { |
|
|
|
|
|
const newBalances = balances.list.filter((b) => b.locationCode == fromLocationCode.value) |
|
|
|
|
|
if (newBalances.length == 0) { |
|
|
|
|
|
showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
|
|
|
} else if (newBalances.length == 1) { |
|
|
|
|
|
const balance = newBalances[0] |
|
|
|
|
|
result.balance = balance |
|
|
|
|
|
afterGetBalance(result) |
|
|
|
|
|
} else { |
|
|
|
|
|
showBalanceSelect(newBalances) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 扫描的是小包装 |
|
|
|
|
|
if (balances.list.length == 0) { |
|
|
|
|
|
showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
|
|
|
} else { |
|
|
|
|
|
// 小包装库存 |
|
|
|
|
|
const subPackitems = balances.list.filter((r) => r.packingNumber == packageInfo.number) |
|
|
|
|
|
// 外包装库存 |
|
|
|
|
|
const subParentPackitems = balances.list.filter((r) => r.packingNumber == packageInfo.parentNumber && r.locationCode == fromLocationCode.value) |
|
|
|
|
|
|
|
|
|
|
|
// 小包装没有库存, |
|
|
|
|
|
if (subPackitems.length == 0) { |
|
|
|
|
|
// 外包装有库存,出库后剩余库存未转换为出库包装规格 |
|
|
|
|
|
|
|
|
|
|
|
if (subParentPackitems.length > 0) { |
|
|
|
|
|
if (subParentPackitems.length == 1) { |
|
|
|
|
|
const balance = subParentPackitems[0] |
|
|
|
|
|
balance.qty = packageInfo.qty |
|
|
|
|
|
result.balance = balance |
|
|
|
|
|
afterGetBalance(result) |
|
|
|
|
|
} else { |
|
|
|
|
|
showBalanceSelect(subParentPackitems) |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
showErrorMessage(`按外包装【${packageInfo.parentNumber}】和子包装【${packageInfo.number}】都未查找到库存余额`) |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
let locationCode = fromLocationCode.value |
|
|
|
|
|
if (balances.list == 1) { |
|
|
|
|
|
locationCode = balances.list[0].locationCode |
|
|
|
|
|
} else { |
|
|
|
|
|
const manyBlances = balances.list.filter((r) => r.locationCode != fromLocationCode.value) |
|
|
|
|
|
if (manyBlances.length > 0) { |
|
|
|
|
|
locationCode = manyBlances[0].locationCode |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
showErrorMessage(`该包装【${packageInfo.number}】在库位【${locationCode}】已经有库存余额,请重新扫描`) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const showBalanceSelect = (items) => { |
|
|
|
|
|
balanceSelectRef.value.openPopup(items) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const selectBalanceItem = (balance) => { |
|
|
|
|
|
resultData.value.balance = balance |
|
|
|
|
|
afterGetBalance(resultData.value) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
const setData = (result) => { |
|
|
const afterGetBalance = (result) => { |
|
|
|
|
|
const { balance } = result |
|
|
const { balance } = result |
|
|
const { label } = result |
|
|
const { label } = result |
|
|
const pack = result.package |
|
|
const pack = result.package |
|
|
const { packUnit } = pack |
|
|
if (fromLocationCode.value && fromLocationCode.value != balance.locationCode) { |
|
|
const { packQty } = pack |
|
|
showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]在库位[${fromLocationCode.value}]没有库存余额`) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const item = detailSource.value.find((res) => { |
|
|
const item = detailSource.value.find((res) => { |
|
|
if (res.itemCode == balance.itemCode) { |
|
|
if (res.itemCode == balance.itemCode) { |
|
|
return res |
|
|
return res |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
if (item == undefined) { |
|
|
|
|
|
if (itemCode.value != '' && itemCode.value != balance.itemCode) { |
|
|
|
|
|
showErrorMessage(`请扫描物料为【${itemCode.value}】的箱码`) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
if (fromWarehouseCode.value == '') { |
|
|
if (fromWarehouseCode.value == '') { |
|
|
fromWarehouseCode.value = balance.warehouseCode |
|
|
fromWarehouseCode.value = balance.warehouseCode |
|
|
} |
|
|
} |
|
|
if (item == undefined) { |
|
|
|
|
|
const itemp = createItemInfo(balance, pack) |
|
|
const itemp = createItemInfo(balance, pack) |
|
|
const newDetail = createDetailInfo(balance, pack) |
|
|
const newDetail = createDetailInfo(balance, pack) // |
|
|
newDetail.packUnit = packUnit || '' |
|
|
newDetail.parentNumber = pack.parentNumber |
|
|
newDetail.packQty = packQty |
|
|
newDetail.packingNumber = pack.number |
|
|
|
|
|
newDetail.packUnit = pack.packUnit |
|
|
|
|
|
newDetail.packQty = pack.packQty |
|
|
itemp.subList.push(newDetail) |
|
|
itemp.subList.push(newDetail) |
|
|
const dataList = pack.subList |
|
|
|
|
|
detailSource.value.push(itemp) |
|
|
detailSource.value.push(itemp) |
|
|
calcHandleQty(detailSource.value) |
|
|
itemCode.value = balance.itemCode |
|
|
|
|
|
fromLocationCode.value = balance.locationCode.scanPopupGetFocus() |
|
|
} else { |
|
|
} else { |
|
|
const detail = item.subList.find((r) => { |
|
|
const detail = item.subList.find((r) => { |
|
|
if (r.packingNumber == pack.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { |
|
|
if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { |
|
|
return r |
|
|
return r |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -266,16 +208,15 @@ const afterGetBalance = (result) => { |
|
|
const newDetail = createDetailInfo(balance, pack) |
|
|
const newDetail = createDetailInfo(balance, pack) |
|
|
newDetail.parentNumber = pack.parentNumber |
|
|
newDetail.parentNumber = pack.parentNumber |
|
|
newDetail.packingNumber = pack.number |
|
|
newDetail.packingNumber = pack.number |
|
|
newDetail.parentNumber = pack.parentNumber |
|
|
newDetail.packUnit = pack.packUnit |
|
|
newDetail.packingNumber = pack.number |
|
|
newDetail.packQty = pack.packQty |
|
|
newDetail.packUnit = packUnit |
|
|
|
|
|
newDetail.packQty = packQty |
|
|
|
|
|
item.subList.push(newDetail) |
|
|
item.subList.push(newDetail) |
|
|
calcHandleQty(detailSource.value) |
|
|
scanPopupGetFocus() |
|
|
} else if (detail.scaned == true) { |
|
|
} else if (detail.scaned == true) { |
|
|
showErrorMessage(`箱码[${detail.packingNumber}]批次[${balance.batch}]已经在列表中`) |
|
|
showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
calcHandleQty(detailSource.value) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const updateData = () => { |
|
|
const updateData = () => { |
|
@ -303,27 +244,21 @@ const removePack = () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const openScanPopup = () => { |
|
|
const openScanPopup = () => { |
|
|
if (fromLocationCode.value == '') { |
|
|
if (businessType.value) { |
|
|
showFromLocationPopup() |
|
|
scanPopup.value.openScanPopup(businessType.value) |
|
|
return |
|
|
} else { |
|
|
} |
|
|
getBusinessType() |
|
|
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const showFromLocationPopup = () => { |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
scanLocationCode.value.openScanPopup() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const closeScanPopup = () => { |
|
|
const closeScanPopup = () => { |
|
|
if (scanPopup.value != undefined) { |
|
|
if (scanPopup.value) { |
|
|
scanPopup.value.closeScanPopup() |
|
|
scanPopup.value.closeScanPopup() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const scanPopupGetFocus = () => { |
|
|
const scanPopupGetFocus = () => { |
|
|
if (scanPopup.value != undefined) { |
|
|
if (scanPopup.value) { |
|
|
scanPopup.value.getfocus() |
|
|
scanPopup.value.getfocus() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -449,14 +384,6 @@ const closeScanMessage = () => { |
|
|
scanPopupGetFocus() |
|
|
scanPopupGetFocus() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const getLocation = (location, code) => { |
|
|
|
|
|
getFromLocationCode(location, code) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getFromLocationCode = (location, code) => { |
|
|
|
|
|
fromLocationCode.value = code |
|
|
|
|
|
openScanPopup() |
|
|
|
|
|
} |
|
|
|
|
|
const getToLocationCode = (location, code) => { |
|
|
const getToLocationCode = (location, code) => { |
|
|
if (fromLocationCode.value == code) { |
|
|
if (fromLocationCode.value == code) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|