zhang_li
4 weeks ago
3 changed files with 334 additions and 10 deletions
@ -0,0 +1,225 @@ |
|||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
<uni-collapse ref="collapse1"> |
||||
|
<uni-collapse-item :open="true"> |
||||
|
<template v-slot:title> |
||||
|
<uni-swipe-action> |
||||
|
<uni-swipe-action-item @click="removeItem($event,dataContent)" :right-options="removeOptions"> |
||||
|
<item-qty :dataContent="dataContent" :isShowBalance="true" |
||||
|
:isShowBalanceQty="isShowBalanceQty" |
||||
|
:isShowRecommendQty="false" |
||||
|
></item-qty> |
||||
|
<view style="margin-left: 10px; margin-top: 5px;"> |
||||
|
<pack title='父包装' v-if="dataContent.containerNumber" :packingCode='dataContent.containerNumber'></pack> |
||||
|
<location v-if="isShowParentToLocation" title='目标库位' |
||||
|
:locationCode='dataContent.toLocationCode'></location> |
||||
|
</view> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
</template> |
||||
|
<view class='split_line'></view> |
||||
|
<view class="" v-for="(detail,index) in dataContent.subList" :key="index"> |
||||
|
<uni-swipe-action> |
||||
|
<uni-swipe-action-item @click="swipeClick($event,detail,index)" |
||||
|
:right-options="detail.scaned?scanOptions:detailOptions"> |
||||
|
<balance :dataContent="detail" :isShowStdPack="false" :isShowStatus="isShowStatus" |
||||
|
:isShowPack="true" :isShowFromLocation="isShowFromLocation" |
||||
|
:isShowToLocation="isShowToLocation" :isShowParentPack="isShowParentPack"> |
||||
|
</balance> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
<!-- <view class='split_line'></view> --> |
||||
|
</view> |
||||
|
</uni-collapse-item> |
||||
|
</uni-collapse> |
||||
|
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" ></balance-qty-edit> |
||||
|
<record-detail-popup ref="recordDetailPopup"></record-detail-popup> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemQty from '@/mycomponents/item/itemQty.vue' |
||||
|
import balance from '@/mycomponents/balance/balance.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
||||
|
import balanceDetailPopup from '@/mycomponents/balance/balanceDetailPopup.vue' |
||||
|
import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import recordDetailPopup from '@/mycomponents/detail/recordDetailPopup.vue' |
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue' |
||||
|
|
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getDetailEditRemoveOption, |
||||
|
getClearOption, |
||||
|
getEditLocationRemoveOption, |
||||
|
getRecordOption |
||||
|
} from '@/common/array.js'; |
||||
|
export default { |
||||
|
components: { |
||||
|
itemQty, |
||||
|
recommend, |
||||
|
balance, |
||||
|
balanceQtyEdit, |
||||
|
balanceDetailPopup, |
||||
|
purchaseLabel, |
||||
|
location, |
||||
|
recordDetailPopup, |
||||
|
pack, |
||||
|
PackageAndItemCard |
||||
|
// winListHint |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
|
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
|
||||
|
isShowFromLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
|
||||
|
isShowToLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowParentToLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
|
||||
|
isShowBalanceQty: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
|
||||
|
isShowParentPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
|
||||
|
isShowModifedLocation: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
allowModifyQty: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
allowModifyLocation: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
dataContent: { |
||||
|
handler(newName, oldName) { |
||||
|
if (this.dataContent.subList.length > 0) { |
||||
|
this.$nextTick(res => { |
||||
|
setTimeout(() => { |
||||
|
if (this.$refs.collapse1) { |
||||
|
this.$refs.collapse1.resize(); |
||||
|
} |
||||
|
}, 500) |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
immediate: true, |
||||
|
deep: true |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
option: [], |
||||
|
title: "推荐详情", |
||||
|
showItem: {}, |
||||
|
editItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
removeOptions: [], |
||||
|
dataList: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
this.scanOptions = getRecordOption(this.allowModifyQty,this.allowModifyLocation); |
||||
|
this.removeOptions = this.isShowModifedLocation ?getEditLocationRemoveOption():getClearOption(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
removeItem(e, dataContent) { |
||||
|
if (e.content.text == "移除") { |
||||
|
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
this.$emit('removeItem', dataContent) |
||||
|
// this.$emit('removeItem', this.dataContent) |
||||
|
} |
||||
|
}); |
||||
|
} else { |
||||
|
this.editLocation(dataContent) |
||||
|
} |
||||
|
}, |
||||
|
swipeClick(e, item, index) { |
||||
|
if (e.content.text == "详情") { |
||||
|
this.detail(item) |
||||
|
} else if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(item, index) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.handleQty); |
||||
|
}, |
||||
|
|
||||
|
detail(item) { |
||||
|
this.showItem = item; |
||||
|
this.$refs.recordDetailPopup.openPopup(item); |
||||
|
}, |
||||
|
|
||||
|
remove(item, index) { |
||||
|
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
this.dataContent.subList.splice(index, 1) |
||||
|
this.$emit('removePack') |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
editLocation(item) { |
||||
|
this.editItem = item; |
||||
|
this.$emit('editLocation', item) |
||||
|
}, |
||||
|
|
||||
|
confirm(qty) { |
||||
|
// this.editItem.qty = qty; |
||||
|
this.editItem.handleQty = qty; |
||||
|
this.$emit('updateData') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
Loading…
Reference in new issue