2 changed files with 408 additions and 0 deletions
@ -0,0 +1,186 @@ |
|||||
|
<!-- 采购上架任务详情按批次显示详情的组件 --> |
||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
<uni-swipe-action> |
||||
|
<uni-swipe-action-item |
||||
|
:right-options="(dataContent.scaned&&isEdit)?editAndRemoveOptions : dataContent.scaned? removeOptions:options" |
||||
|
@click="swipeClick($event,dataContent,'parent')"> |
||||
|
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="true"> |
||||
|
</itemCompareQty> |
||||
|
<batch v-if="dataContent.subList[0].batch" :batch="dataContent.subList[0].batch"></batch> |
||||
|
<location title="来源库位" v-if="dataContent.subList[0].fromLocationCode" |
||||
|
:locationCode="dataContent.subList[0].fromLocationCode"> |
||||
|
</location> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
|
||||
|
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> |
||||
|
</recommend-qty-edit> |
||||
|
<comMessage ref="message"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' |
||||
|
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue' |
||||
|
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue' |
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import detailList from '@/mycomponents/detail/detailList.vue' |
||||
|
import packageList from '@/mycomponents/package/packageList.vue' |
||||
|
import packageListBatch from '@/mycomponents/package/packageListBatch.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import toLocation from '@/mycomponents/balance/toLocation.vue' |
||||
|
import batch from '@/mycomponents/balance/batch.vue' |
||||
|
import { |
||||
|
getRemoveOption, |
||||
|
getEditRemoveOption |
||||
|
} from '@/common/array.js'; |
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getPurchaseReceiptOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
export default { |
||||
|
emits: ["updateData"], |
||||
|
components: { |
||||
|
itemCompareQty, |
||||
|
recommend, |
||||
|
recommendQtyEdit, |
||||
|
jobDetailPopup, |
||||
|
receiptDetailInfoPopup, |
||||
|
detailList, |
||||
|
packageList, |
||||
|
packageListBatch, |
||||
|
location, |
||||
|
toLocation, |
||||
|
batch, |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
locationAreaTypeList: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowPackListStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isEdit: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
showItem: {}, |
||||
|
editItem: { |
||||
|
record: { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
locatonItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
options: [], |
||||
|
removeOptions: [], |
||||
|
editAndRemoveOptions: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
if (this.detailOptions.length == 0) { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
} |
||||
|
if (this.scanOptions.length == 0) { |
||||
|
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam |
||||
|
.allowModifyLocation) |
||||
|
} |
||||
|
this.removeOptions = getRemoveOption(); |
||||
|
this.editAndRemoveOptions = getEditRemoveOption() |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
|
||||
|
updated() { |
||||
|
console.log('updated') |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
collapseChange() { |
||||
|
setTimeout(() => { |
||||
|
this.resizeCollapse(); |
||||
|
}, 500) |
||||
|
}, |
||||
|
|
||||
|
resizeCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.collapse.resize() |
||||
|
}); |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
refreshCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.collapse.forEach(r => { |
||||
|
r.childrens.forEach(i => { |
||||
|
i.init(); |
||||
|
}) |
||||
|
r.resize(); |
||||
|
}) |
||||
|
}); |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
swipeClick(e, item, type) { |
||||
|
if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(item) |
||||
|
} |
||||
|
}, |
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty); |
||||
|
}, |
||||
|
remove(item) { |
||||
|
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
item.scaned = false |
||||
|
item.handleQty = null |
||||
|
this.$forceUpdate() |
||||
|
this.$emit('remove', item) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
confirm(qty) { |
||||
|
this.editItem.handleQty = qty; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
updateData() { |
||||
|
this.$emit('updateData') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,222 @@ |
|||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
<uni-collapse ref="collapse"> |
||||
|
<uni-collapse-item :open="true"> |
||||
|
<template v-slot:title> |
||||
|
<uni-swipe-action> |
||||
|
<uni-swipe-action-item :right-options="dataContent.handleQty>0? removeOptions:options" |
||||
|
@click="swipeClick($event,dataContent)"> |
||||
|
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
||||
|
:isShowPackUnit="false"></itemCompareQty> |
||||
|
|
||||
|
<batch v-if="dataContent.subList[0].batch" :batch="dataContent.subList[0].batch"></batch> |
||||
|
<location title="来源库位" v-if="dataContent.subList[0].fromLocationCode" :locationCode="dataContent.subList[0].fromLocationCode"> |
||||
|
</location> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
</template> |
||||
|
</uni-collapse-item> |
||||
|
</uni-collapse> |
||||
|
|
||||
|
<recommend-qty-edit ref=" receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> |
||||
|
</recommend-qty-edit> |
||||
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
||||
|
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> |
||||
|
<receipt-detail-info-popup ref="jobDetailPopup" :dataContent="showItem"></receipt-detail-info-popup> |
||||
|
<comMessage ref="message"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' |
||||
|
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue' |
||||
|
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue' |
||||
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
||||
|
import detailList from '@/mycomponents/detail/detailList.vue' |
||||
|
import packageList from '@/mycomponents/package/packageList.vue' |
||||
|
|
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import toLocation from '@/mycomponents/balance/toLocation.vue' |
||||
|
import batch from '@/mycomponents/balance/batch.vue' |
||||
|
|
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getPurchaseReceiptOption, |
||||
|
getRemoveOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
export default { |
||||
|
|
||||
|
components: { |
||||
|
itemCompareQty, |
||||
|
recommend, |
||||
|
recommendQtyEdit, |
||||
|
jobDetailPopup, |
||||
|
receiptDetailInfoPopup, |
||||
|
winScanLocation, |
||||
|
detailList, |
||||
|
packageList, |
||||
|
pack, |
||||
|
location, |
||||
|
toLocation, |
||||
|
batch |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
locationAreaTypeList: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
showItem: {}, |
||||
|
editItem: { |
||||
|
record: { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
locatonItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
options: [], |
||||
|
removeOptions: [], |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
this.$nextTick(()=>{ |
||||
|
console.log(this.dataContent) |
||||
|
}) |
||||
|
if (this.detailOptions.length == 0) { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
} |
||||
|
if (this.scanOptions.length == 0) { |
||||
|
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam |
||||
|
.allowModifyLocation) |
||||
|
} |
||||
|
|
||||
|
if (this.removeOptions.length == 0) { |
||||
|
this.removeOptions = getRemoveOption(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
updated() { |
||||
|
console.log('updated') |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
collapseChange() { |
||||
|
setTimeout(() => { |
||||
|
this.resizeCollapse(); |
||||
|
}, 500) |
||||
|
}, |
||||
|
|
||||
|
resizeCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.collapse.resize() |
||||
|
}); |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
refreshCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.collapse.forEach(r => { |
||||
|
r.childrens.forEach(i => { |
||||
|
i.init(); |
||||
|
}) |
||||
|
r.resize(); |
||||
|
}) |
||||
|
}); |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
swipeClick(e, item) { |
||||
|
if (e.content.text == "详情") { |
||||
|
this.detail(item) |
||||
|
} else if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "库位") { |
||||
|
this.showLocation(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.removeScan(item) |
||||
|
} |
||||
|
}, |
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty); |
||||
|
}, |
||||
|
showLocation(item) { |
||||
|
this.locatonItem = item; |
||||
|
this.$refs.scanLocationCode.openScanPopup(); |
||||
|
}, |
||||
|
//扫描源库位 |
||||
|
getLocation(location, code) { |
||||
|
this.locatonItem.toLocationCode = code; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
|
||||
|
detail(item) { |
||||
|
this.showItem = item; |
||||
|
this.$refs.jobDetailPopup.openPopup(item) |
||||
|
}, |
||||
|
|
||||
|
removeScan(item) { |
||||
|
this.$refs.message.showQuestionMessage("确定移除物料的所有扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
item.handleQty = null |
||||
|
item.subList.forEach(lst => { |
||||
|
lst.scaned = false; |
||||
|
lst.handleQty = null; |
||||
|
lst.packList.forEach(pack => { |
||||
|
pack.scaned = false; |
||||
|
pack.handleQty = null; |
||||
|
}) |
||||
|
}) |
||||
|
// this.$forceUpdate() |
||||
|
// this.$emit('remove', item) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
// remove(item) { |
||||
|
// this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
||||
|
// res => { |
||||
|
// if (res) { |
||||
|
// item.scaned = false |
||||
|
// item.handleQty = null |
||||
|
// this.$forceUpdate() |
||||
|
// this.$emit('remove', item) |
||||
|
// } |
||||
|
// }); |
||||
|
// }, |
||||
|
confirm(qty) { |
||||
|
this.editItem.handleQty = qty; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
updateData() { |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
Loading…
Reference in new issue