You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
195 lines
4.7 KiB
195 lines
4.7 KiB
<template>
|
|
<view class="" style="background-color: #fff;">
|
|
<uni-collapse ref="collapse1" @change="">
|
|
<uni-collapse-item :open="true">
|
|
<template v-slot:title>
|
|
<uni-swipe-action ref="swipeAction">
|
|
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
|
|
<item-qty :dataContent="dataContent"
|
|
:showBalanceQty="false"
|
|
:isShowBalance="true"></item-qty>
|
|
</uni-swipe-action-item>
|
|
</uni-swipe-action>
|
|
</template>
|
|
|
|
<view class="" v-for="(item,index) in dataContent.subList">
|
|
<uni-swipe-action ref="swipeAction">
|
|
<uni-swipe-action-item @click="swipeClick($event,item,index)"
|
|
:right-options="item.scaned?scanOptions:detailOptions">
|
|
<comMovebalance :dataContent="item" :isShowStdPack="false" :isShowPack="true"
|
|
:fromInventoryStatus="item.inventoryStatus" :toInventoryStatus="item.toInventoryStatus"
|
|
:isShowLocation="true" :allowEditStatus='allowEditStatus'></comMovebalance>
|
|
</uni-swipe-action-item>
|
|
</uni-swipe-action>
|
|
<u-line color="#D8D8D8"></u-line>
|
|
</view>
|
|
</uni-collapse-item>
|
|
</uni-collapse>
|
|
<balanceQtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="isShowStatus"
|
|
:allowEditStatus="allowEditStatus">
|
|
</balanceQtyEdit>
|
|
<job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup>
|
|
<comMessage ref="comMessage"></comMessage>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import itemQty from '@/mycomponents/item/itemQty.vue'
|
|
import recommend from '@/mycomponents/recommend/recommend.vue'
|
|
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
|
|
import balance from '@/mycomponents/balance/balance.vue'
|
|
import balanceMove from '@/mycomponents/balance/balanceMove.vue'
|
|
import comMovebalance from '@/pages/inventoryMove/coms/comMovebalance.vue'
|
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
|
|
import comMessage from '@/mycomponents/common/comMessage.vue'
|
|
|
|
import {
|
|
getDetailOption,
|
|
getDetailEditRemoveOption,
|
|
getRemoveOption
|
|
} from '@/common/array.js';
|
|
export default {
|
|
components: {
|
|
itemQty,
|
|
recommend,
|
|
jobDetailPopup,
|
|
balance,
|
|
balanceQtyEdit,
|
|
balanceMove,
|
|
comMovebalance,
|
|
comMessage
|
|
},
|
|
props: {
|
|
dataContent: {
|
|
type: Object,
|
|
default: {}
|
|
},
|
|
settingParam: {
|
|
type: Object,
|
|
default: {}
|
|
},
|
|
fromInventoryStatus: {
|
|
type: String,
|
|
default: ""
|
|
},
|
|
toInventoryStatus: {
|
|
type: String,
|
|
default: ""
|
|
},
|
|
isShowStatus: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
allowEditStatus: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
|
|
},
|
|
watch: {
|
|
dataContent: {
|
|
handler(newName, oldName) {
|
|
if (this.dataContent.subList.length > 0) {
|
|
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
|
|
this.$nextTick(res => {
|
|
this.$refs.collapse1.resize()
|
|
})
|
|
}
|
|
}
|
|
},
|
|
immediate: true,
|
|
deep: true
|
|
}
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
option: [],
|
|
title: "推荐详情",
|
|
showItem: {},
|
|
editItem: {},
|
|
detailOptions: [],
|
|
scanOptions: [],
|
|
removeOptions: [],
|
|
dataList: []
|
|
}
|
|
},
|
|
|
|
mounted() {
|
|
this.detailOptions = getDetailOption();
|
|
this.scanOptions = getDetailEditRemoveOption();
|
|
this.removeOptions = getRemoveOption();
|
|
},
|
|
|
|
methods: {
|
|
removeData(e, dataContent) {
|
|
if (e.content.text == "移除") {
|
|
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
|
|
res => {
|
|
if (res) {
|
|
this.$emit('removeData', 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(item, item.qty);
|
|
},
|
|
|
|
detail(item) {
|
|
this.showItem = item;
|
|
this.dataList = [
|
|
|
|
{
|
|
title: "箱码",
|
|
content: item.packingNumber
|
|
},
|
|
{
|
|
title: "批次",
|
|
content: item.batch
|
|
},
|
|
{
|
|
title: "库位",
|
|
content: item.locationCode
|
|
},
|
|
{
|
|
title: "数量",
|
|
content: item.qty
|
|
},
|
|
{
|
|
title: "单位",
|
|
content: item.uom
|
|
}
|
|
]
|
|
this.$refs.winHint.openScanPopup(this.showItem)
|
|
},
|
|
remove(item, index) {
|
|
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
|
|
res => {
|
|
if (res) {
|
|
this.dataContent.subList.splice(index, 1)
|
|
this.$emit('removePack', item)
|
|
}
|
|
});
|
|
},
|
|
confirm(qty) {
|
|
this.editItem.handleQty = qty;
|
|
this.$emit('updateData')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
</style>
|
|
|