Browse Source

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

syhx_app_vue3
王志国 2 weeks ago
parent
commit
0a43c7fde3
  1. 68
      src/pages/scrap/record/scrapRecord.vue

68
src/pages/scrap/record/scrapRecord.vue

@ -19,7 +19,17 @@
<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" :isShowFromLocation="true" @removeItem="removeItem(index, item)" @updateData="updateData" :isShowToLocation="false" @removePack="removePack"> </record-com-detail-card> <record-com-detail-card-batch :dataContent="item" :index="index" :isShowFromLocation="true"
:isShowParentToLocation="false" @removeItem="removeItem(index,item)"
:isShowToLocation="false" @updateData="updateData" @removePack="removePack"
:allowModifyQty="true"
v-if="managementType == 'BY_BATCH' || managementType =='BY_QUANTITY' ">
</record-com-detail-card-batch>
<record-com-detail-card :dataContent="item" :index="index" v-else
:settingParam="dataContent" :isShowFromLocation="true"
@removeItem="removeItem(index, item)" @updateData="updateData"
:isShowToLocation="false" @removePack="removePack">
</record-com-detail-card>
</view> </view>
<view class="split_line"></view> <view class="split_line"></view>
</view> </view>
@ -46,7 +56,9 @@ import { onLoad, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRef
import { scrapRecordSubmit } from '@/api/request2.js' import { scrapRecordSubmit } from '@/api/request2.js'
import { goHome, deepCopyData } from '@/common/basic.js' import { goHome, deepCopyData } from '@/common/basic.js'
import {
calc
} from '@/common/calc'
import { getInventoryStatusDesc, getDirectoryItemArray, getScarpReasonList } from '@/common/directory.js' import { getInventoryStatusDesc, getDirectoryItemArray, getScarpReasonList } from '@/common/directory.js'
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
@ -56,7 +68,8 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue' import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.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' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -77,6 +90,7 @@ const comMessageRef = ref()
const scanPopup = ref() const scanPopup = ref()
const scanLocationCode = ref() const scanLocationCode = ref()
const managementList = ref([]) const managementList = ref([])
const managementType = ref('')
const show = ref(false) const show = ref(false)
const reasonCode = ref('') const reasonCode = ref('')
onLoad((option) => { onLoad((option) => {
@ -102,8 +116,46 @@ onNavigationBarButtonTap((e) => {
goHome() goHome()
} }
}) })
const getScanResult = (result, managementTypeParams)=> {
const getScanResult = (result) => { managementType.value = managementTypeParams
console.log("模式" + managementTypeParams)
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") {
setDataBatch(result)
} else {
setData(result)
}
}
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) {
const itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail);
detailSource.value.push(itemp)
} else {
const 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 setData = (result) => {
const { balance } = result const { balance } = result
const { label } = result const { label } = result
const pack = result.package const pack = result.package
@ -157,11 +209,17 @@ const removePack = () => {
} }
const openScanPopup = () => { const openScanPopup = () => {
if (this.businessType) {
if (fromLocationCode.value == '') { if (fromLocationCode.value == '') {
showFromLocationPopup() showFromLocationPopup()
return return
} }
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value)
}else {
//TODO
// getBusinessType()
}
} }
const showFromLocationPopup = () => { const showFromLocationPopup = () => {
nextTick(() => { nextTick(() => {

Loading…
Cancel
Save