|
|
@ -19,7 +19,17 @@ |
|
|
|
<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" :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 class="split_line"></view> |
|
|
|
</view> |
|
|
@ -46,7 +56,9 @@ import { onLoad, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRef |
|
|
|
import { scrapRecordSubmit } from '@/api/request2.js' |
|
|
|
|
|
|
|
import { goHome, deepCopyData } from '@/common/basic.js' |
|
|
|
|
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc' |
|
|
|
import { getInventoryStatusDesc, getDirectoryItemArray, getScarpReasonList } from '@/common/directory.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 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() |
|
|
@ -77,6 +90,7 @@ const comMessageRef = ref() |
|
|
|
const scanPopup = ref() |
|
|
|
const scanLocationCode = ref() |
|
|
|
const managementList = ref([]) |
|
|
|
const managementType = ref('') |
|
|
|
const show = ref(false) |
|
|
|
const reasonCode = ref('') |
|
|
|
onLoad((option) => { |
|
|
@ -102,8 +116,46 @@ onNavigationBarButtonTap((e) => { |
|
|
|
goHome() |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
const getScanResult = (result) => { |
|
|
|
const getScanResult = (result, managementTypeParams)=> { |
|
|
|
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 { label } = result |
|
|
|
const pack = result.package |
|
|
@ -157,11 +209,17 @@ const removePack = () => { |
|
|
|
} |
|
|
|
|
|
|
|
const openScanPopup = () => { |
|
|
|
if (this.businessType) { |
|
|
|
if (fromLocationCode.value == '') { |
|
|
|
showFromLocationPopup() |
|
|
|
return |
|
|
|
} |
|
|
|
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) |
|
|
|
}else { |
|
|
|
//TODO 没有定义 |
|
|
|
// getBusinessType() |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
const showFromLocationPopup = () => { |
|
|
|
nextTick(() => { |
|
|
|