Browse Source

fix: src\pages\transfer\record 文件修改 Vue2升级Vue3 10/25-11-11

syhx_app_vue3
王志国 1 week ago
parent
commit
29bbcee1b2
  1. 79
      src/pages/transfer/record/deliverRecord.vue
  2. 17
      src/pages/transfer/record/receiptRecord.vue

79
src/pages/transfer/record/deliverRecord.vue

@ -8,7 +8,19 @@
<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" :isShowLocation="true" @removeItem="removeItem(index, item)" @updateData="updateData" @removePack="removePack"> </record-com-detail-card>
<record-com-detail-card-batch :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowModifedLocation="false"
:isShowParentToLocation="false"
@updateData="updateData"
@editLocation="showScanToLocation"
@removePack="removePack"
v-if="managementType == 'BY_BATCH'||managementType =='BY_QUANTITY' ">
</record-com-detail-card-batch>
<record-com-detail-card v-else :dataContent="item" :index="index"
:isShowLocation="true" @removeItem="removeItem(index, item)"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
<view class="split_line"></view>
</view>
@ -28,7 +40,7 @@
<win-scan-button @goScan="openScanPopup"></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult="getScanResult"></win-scan-pack-and-location>
<win-scan-pack-and-location ref="scanPopup" @getResult="getScanResult" :allowModifyLocation='false'></win-scan-pack-and-location>
<com-message ref="comMessageRef" />
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation="getLocation" :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
</view>
@ -42,7 +54,9 @@ import { getPrecisionStrategyList } from '@/common/balance.js'
import { goHome, deepCopyData, getPackingNumberAndBatchByList } from '@/common/basic.js'
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js'
import {
calc
} from '@/common/calc'
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -51,7 +65,8 @@ import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import RecordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import RecordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
@ -67,11 +82,14 @@ const inInventoryStatus = ref('') // 目标入库库存状态
const outInventoryStatus = ref('') //
const businessType = ref({})
const managementList = ref([])
const managementType = ref('')
const toWarehouseCode = ref('')
const comMessageRef = ref()
const scanPopup = ref()
const fromLocationCode = ref()
const scanLocationCode = ref()
const scanLocationCode = ref(null)
const editItem = ref()
onLoad((option) => {
uni.setNavigationBarTitle({
title: option.title
@ -94,7 +112,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
@ -124,7 +150,44 @@ const getScanResult = (result) => {
}
handleCalcHandleQty()
}
const setDataBatch = (result)=>{
let { balance,label } = result
let pack = result.package;
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); //
newDetail.inventoryStatus = "OK"
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)
}
}
calcHandleQty(detailSource.value)
}
const showScanToLocation = (item)=> {
editItem.value = item;
setTimeout(r => {
scanLocationCode.value.openScanPopup();
})
}
const handleCalcHandleQty = () => {
calcHandleQty(detailSource.value)
}
@ -143,11 +206,15 @@ const removePack = () => {
}
const openScanPopup = () => {
if (this.businessType) {
if (fromLocationCode.value == '') {
showFromLocationPopup()
return
}
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value)
} else {
getBusinessType()
}
}
const showFromLocationPopup = () => {

17
src/pages/transfer/record/receiptRecord.vue

@ -8,7 +8,12 @@
<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" :isShowFromLocation="false" :isShowToLocation="false" @removeItem="removeItem(index, item)" @updateData="updateData" @removePack="removePack"> </record-com-detail-card>
<record-com-detail-card :dataContent="item" :index="index"
:isShowFromLocation="false" :isShowParentToLocation="false"
:allowModifyQty="true" :queryBalance="false"
:isShowToLocation="false" @removeItem="removeItem(index, item)"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
<view class="split_line"></view>
</view>
@ -41,7 +46,7 @@ import { getPrecisionStrategyList } from '@/common/balance.js'
import { goHome, deepCopyData, getPackingNumberAndBatchByList } from '@/common/basic.js'
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js'
import { calc } from '@/common/calc'
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -88,8 +93,10 @@ onNavigationBarButtonTap((e) => {
goHome()
}
})
const getScanResult = (result)=> {
setData(result)
}
const setData = (result) => {
const { label } = result
const pack = result.package
const item = detailSource.value.find((res) => {
@ -266,10 +273,6 @@ const showErrorMessage = (message) => {
})
}
const showScanMessage = (message) => {
comMessageRef.value.showScanMessage(message)
}
const afterCloseMessage = () => {
scanPopupGetFocus()
}

Loading…
Cancel
Save