|
@ -8,7 +8,11 @@ |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class=""> |
|
|
<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> |
|
|
<view class="split_line"></view> |
|
|
<view class="split_line"></view> |
|
|
</view> |
|
|
</view> |
|
@ -54,7 +58,9 @@ import { goHome, getPackingNumberAndBatchByList, deepCopyData } from '@/common/b |
|
|
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js' |
|
|
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js' |
|
|
|
|
|
|
|
|
import { getPrecisionStrategyList } from '@/common/balance.js' |
|
|
import { getPrecisionStrategyList } from '@/common/balance.js' |
|
|
|
|
|
import { |
|
|
|
|
|
calc |
|
|
|
|
|
} from '@/common/calc.js'; |
|
|
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' |
|
|
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' |
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
@ -87,6 +93,7 @@ const scanLocationCodeRef = ref() |
|
|
const comMessageRef = ref() |
|
|
const comMessageRef = ref() |
|
|
const showCustomer = ref(false) |
|
|
const showCustomer = ref(false) |
|
|
const toWarehouseCode = ref('') |
|
|
const toWarehouseCode = ref('') |
|
|
|
|
|
const managementType = ref('') |
|
|
onLoad((option) => { |
|
|
onLoad((option) => { |
|
|
uni.setNavigationBarTitle({ |
|
|
uni.setNavigationBarTitle({ |
|
|
title: option.title |
|
|
title: option.title |
|
@ -123,7 +130,15 @@ onNavigationBarButtonTap((e) => { |
|
|
goHome() |
|
|
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 { balance } = result |
|
|
const { label } = result |
|
|
const { label } = result |
|
|
const pack = result.package |
|
|
const pack = result.package |
|
@ -154,6 +169,39 @@ const getScanResult = (result) => { |
|
|
} |
|
|
} |
|
|
handleCalcHandleQty() |
|
|
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 = () => { |
|
|
const handleCalcHandleQty = () => { |
|
|
calcHandleQty(detailSource.value) |
|
|
calcHandleQty(detailSource.value) |
|
@ -173,11 +221,15 @@ const removePack = () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const openScanPopup = () => { |
|
|
const openScanPopup = () => { |
|
|
if (fromLocationCode.value == '') { |
|
|
if (businessType.value) { |
|
|
showFromLocationPopup() |
|
|
if (fromLocationCode.value == "") { |
|
|
return |
|
|
showFromLocationPopup(); |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) |
|
|
|
|
|
} else { |
|
|
|
|
|
getBusinessType() |
|
|
} |
|
|
} |
|
|
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const showFromLocationPopup = () => { |
|
|
const showFromLocationPopup = () => { |
|
@ -228,8 +280,13 @@ const commit = () => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
console.log(5555) |
|
|
console.log(5555) |
|
|
managementList.value = res.list |
|
|
managementList.value = res.list |
|
|
|
|
|
|
|
|
const params = setParams() |
|
|
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) |
|
|
deliverRecordSubmit(params) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|