|
|
@ -8,7 +8,11 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" :isShowLocation="true" @removeItem="removeItem(index, item)" @updateData="updateData" @removePack="removePack"> </record-com-detail-card> |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" |
|
|
|
:settingParam="dataContent" :isShowLocation="true" |
|
|
|
@removeItem="removeItem(index, item)" :isShowParentToLocation="false" |
|
|
|
@updateData="updateData" @removePack="removePack"> |
|
|
|
</record-com-detail-card> |
|
|
|
</view> |
|
|
|
<view class="split_line"></view> |
|
|
|
</view> |
|
|
@ -54,7 +58,9 @@ import { goHome, getPackingNumberAndBatchByList, deepCopyData } from '@/common/b |
|
|
|
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js' |
|
|
|
|
|
|
|
import { getPrecisionStrategyList } from '@/common/balance.js' |
|
|
|
|
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc.js'; |
|
|
|
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
@ -87,6 +93,7 @@ const scanLocationCodeRef = ref() |
|
|
|
const comMessageRef = ref() |
|
|
|
const showCustomer = ref(false) |
|
|
|
const toWarehouseCode = ref('') |
|
|
|
const managementType = ref('') |
|
|
|
onLoad((option) => { |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: option.title |
|
|
@ -123,7 +130,15 @@ onNavigationBarButtonTap((e) => { |
|
|
|
goHome() |
|
|
|
} |
|
|
|
}) |
|
|
|
const getScanResult = (result) => { |
|
|
|
const getScanResult = (result,managementTypeParams)=> { |
|
|
|
managementType.value = managementTypeParams |
|
|
|
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { |
|
|
|
setDataBatch(result) |
|
|
|
} else { |
|
|
|
setData(result) |
|
|
|
} |
|
|
|
} |
|
|
|
const setData = (result) => { |
|
|
|
const { balance } = result |
|
|
|
const { label } = result |
|
|
|
const pack = result.package |
|
|
@ -154,6 +169,39 @@ const getScanResult = (result) => { |
|
|
|
} |
|
|
|
handleCalcHandleQty() |
|
|
|
} |
|
|
|
const setDataBatch = (result)=>{ |
|
|
|
let balance = result.balance; |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
|
let labelQty =result.label.qty; |
|
|
|
let balanceQty =result.balance.qty; |
|
|
|
let item = detailSource.value.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
let itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
detailSource.value.push(itemp) |
|
|
|
} else { |
|
|
|
let detail = item.subList.find(r => { |
|
|
|
if (r.batch == balance.batch && |
|
|
|
r.locationCode == balance.locationCode && |
|
|
|
r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
item.subList.push(newDetail); |
|
|
|
} else { |
|
|
|
detail.handleQty = calc.add(detail.handleQty, result.label.qty) |
|
|
|
} |
|
|
|
} |
|
|
|
handleCalcHandleQty(); |
|
|
|
} |
|
|
|
|
|
|
|
const handleCalcHandleQty = () => { |
|
|
|
calcHandleQty(detailSource.value) |
|
|
@ -173,11 +221,15 @@ const removePack = () => { |
|
|
|
} |
|
|
|
|
|
|
|
const openScanPopup = () => { |
|
|
|
if (fromLocationCode.value == '') { |
|
|
|
showFromLocationPopup() |
|
|
|
if (businessType.value) { |
|
|
|
if (fromLocationCode.value == "") { |
|
|
|
showFromLocationPopup(); |
|
|
|
return |
|
|
|
} |
|
|
|
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) |
|
|
|
} else { |
|
|
|
getBusinessType() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const showFromLocationPopup = () => { |
|
|
@ -228,8 +280,13 @@ const commit = () => { |
|
|
|
if (res.success) { |
|
|
|
console.log(5555) |
|
|
|
managementList.value = res.list |
|
|
|
|
|
|
|
const params = setParams() |
|
|
|
let obj = params.subList.find(item=>item.balanceQty < item.handleQty) |
|
|
|
if(obj){ |
|
|
|
comMessageRef.value.showConfirmWarningModal('批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']') |
|
|
|
uni.hideLoading() |
|
|
|
return |
|
|
|
} |
|
|
|
deliverRecordSubmit(params) |
|
|
|
.then((res) => { |
|
|
|
uni.hideLoading() |
|
|
|