|
|
@ -10,8 +10,8 @@ |
|
|
|
<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" |
|
|
|
:isShowStatus="false" @removeItem="removeItem(index,item)" @updateData="updateData" |
|
|
|
@removePack="removePack"> |
|
|
|
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)" |
|
|
|
@updateData="updateData" @removePack="removePack"></record-com-detail-card> |
|
|
|
</view> |
|
|
|
<view class="split_line"></view> |
|
|
|
</view> |
|
|
@ -31,9 +31,7 @@ |
|
|
|
</view> |
|
|
|
<win-scan-button @goScan="openScanPopup"></win-scan-button> |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package> |
|
|
|
|
|
|
|
<com-message ref="comMessageRef" /> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -50,12 +48,8 @@ |
|
|
|
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
|
|
import comProductionRecord from '@/pages/productionReceipt/coms/comProductionRecord.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 winScanPackage from '@/mycomponents/scan/winScanPackage.vue' |
|
|
|
|
|
|
@ -111,35 +105,44 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
const getScanResult = (result) => { |
|
|
|
const { balance } = result |
|
|
|
const { label } = result |
|
|
|
const pack = result.package |
|
|
|
const item = detailSource.value.find((res) => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
const itemp = createItemInfo(balance, pack) |
|
|
|
const newDetail = createDetailInfo(balance, pack) // |
|
|
|
newDetail.fromInventoryStatus = balance.inventoryStatus |
|
|
|
itemp.subList.push(newDetail) |
|
|
|
detailSource.value.push(itemp) |
|
|
|
} else { |
|
|
|
const detail = item.subList.find((r) => { |
|
|
|
if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
return r |
|
|
|
} |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
const newDetail = createDetailInfo(balance, pack) |
|
|
|
newDetail.fromInventoryStatus = balance.inventoryStatus |
|
|
|
item.subList.push(newDetail) |
|
|
|
} else if (detail.scaned == true) { |
|
|
|
showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`) |
|
|
|
} |
|
|
|
} |
|
|
|
handleCalcHandleQty() |
|
|
|
result.balance.forEach( |
|
|
|
balance => { |
|
|
|
var item = detailSource.value.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
newDetail.fromInventoryStatus = balance.inventoryStatus; |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
detailSource.value.push(itemp) |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.packingNumber == balance.packingNumber && |
|
|
|
r.batch == balance.batch && |
|
|
|
r.locationCode == balance.locationCode && |
|
|
|
r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
newDetail.fromInventoryStatus = balance.inventoryStatus; |
|
|
|
item.subList.push(newDetail); |
|
|
|
} else { |
|
|
|
if (detail.scaned == true) { |
|
|
|
showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + |
|
|
|
"]已经在列表中") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
handleCalcHandleQty(); |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
const handleCalcHandleQty = () => { |
|
|
@ -192,6 +195,17 @@ |
|
|
|
// } |
|
|
|
|
|
|
|
const commit = () => { |
|
|
|
if (toLocationCode.value == "") { |
|
|
|
showQuestionMessage('未指定目标库位,系统将按上架策略推荐库位是否继续提交?', res => { |
|
|
|
if (res) { |
|
|
|
commitRecord(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
commitRecord(); |
|
|
|
} |
|
|
|
} |
|
|
|
const commitRecord = ()=>{ |
|
|
|
if (detailSource.value.length > 0 && detailSource.value[0].subList.length > 0) { |
|
|
|
// 查询管理模式 |
|
|
|
|
|
|
@ -335,6 +349,13 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
const showQuestionMessage = (hint) => { |
|
|
|
comMessageRef.value.showQuestionMessage(hint, (res) => { |
|
|
|
if (res) { |
|
|
|
clearData() |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const clearData = () => { |
|
|
|
fromLocationCode.value = '' |
|
|
|