|
|
@ -8,7 +8,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" :isShowLocation="true" |
|
|
|
<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> |
|
|
@ -32,7 +42,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> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
|
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> |
|
|
@ -63,8 +73,11 @@ |
|
|
|
getBusinessType, |
|
|
|
createItemInfo, |
|
|
|
createDetailInfo, |
|
|
|
calcHandleQty |
|
|
|
calcHandleQty, |
|
|
|
} from '@/common/record.js'; |
|
|
|
import { |
|
|
|
calc |
|
|
|
} from '@/common/calc' |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
@ -73,6 +86,7 @@ |
|
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
|
import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
@ -82,7 +96,8 @@ |
|
|
|
comBlankView, |
|
|
|
winScanLocation, |
|
|
|
winScanPackAndLocation, |
|
|
|
recordComDetailCard |
|
|
|
recordComDetailCard, |
|
|
|
recordComDetailCardBatch |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -98,7 +113,8 @@ |
|
|
|
businessType: {}, |
|
|
|
managementList: [], |
|
|
|
dataContent: {}, |
|
|
|
toWarehouseCode: '' |
|
|
|
toWarehouseCode: '', |
|
|
|
managementType:"" |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
@ -131,7 +147,17 @@ |
|
|
|
onPullDownRefresh() {}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
getScanResult(result) { |
|
|
|
getScanResult(result,managementTypeParams) { |
|
|
|
this.managementType = managementTypeParams |
|
|
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
|
|
|
this.setDataBatch(result) |
|
|
|
}else{ |
|
|
|
this.setData(result) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setData(result){ |
|
|
|
let balance = result.balance; |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
@ -166,6 +192,46 @@ |
|
|
|
} |
|
|
|
this.calcHandleQty(); |
|
|
|
}, |
|
|
|
setDataBatch(result){ |
|
|
|
let balance = result.balance; |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
|
var item = this.detailSource.find(res => { |
|
|
|
if (res.itemCode == balance.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
newDetail.inventoryStatus = "OK" |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
} else { |
|
|
|
var 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) |
|
|
|
} |
|
|
|
} |
|
|
|
this.calcHandleQty(this.detailSource) |
|
|
|
}, |
|
|
|
|
|
|
|
showScanToLocation(item) { |
|
|
|
this.editItem = item; |
|
|
|
setTimeout(r => { |
|
|
|
this.$refs.scanToLocationCode.openScanPopup(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|