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.

173 lines
4.4 KiB

1 year ago
<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="removeItem($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalance="true" :showItemQty="isShowItemQty"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<u-line />
1 year ago
<view class="" v-for="(detail,index) in dataContent.subList">
1 year ago
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,detail,index)"
:right-options="detail.scaned?scanOptions:detailOptions">
12 months ago
<balance :dataContent="detail" :isShowStdPack="false" :isShowStatus="true"
11 months ago
:isShowPack="true" :isShowLocation="isShowLocation" :isShowToLocation="true"></balance>
1 year ago
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm"></balance-qty-edit>
<!-- <job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup> -->
<balance-detail-popup ref="balanceDetailPopup"></balance-detail-popup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
// import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue'
12 months ago
import recommend from '@/mycomponents/recommend/recommend.vue'
1 year ago
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import balanceDetailPopup from '@/mycomponents/balance/balanceDetailPopup.vue'
import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
11 months ago
import location from '@/mycomponents/balance/location.vue'
1 year ago
import {
getDetailOption,
12 months ago
getDetailEditRemoveOption,
1 year ago
getClearOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
balance,
balanceQtyEdit,
balanceDetailPopup,
purchaseLabel,
11 months ago
comMessage,
location
1 year ago
// winListHint
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
isShowStatus: {
type: Boolean,
default: false
},
isShowLocation: {
type: Boolean,
default: true
},
isShowItemQty: {
type: Boolean,
default: true
},
},
watch: {
dataContent: {
handler(newName, oldName) {
1 year ago
if (this.dataContent.subList.length > 0) {
1 year ago
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();
12 months ago
this.scanOptions = getDetailEditRemoveOption();
1 year ago
this.removeOptions = getClearOption();
},
methods: {
removeItem(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
// this.$emit('removeItem', this.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.qty);
},
detail(item) {
this.showItem = item;
this.$refs.balanceDetailPopup.openPopup(item);
// console.log(JSON.stringify(item));
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
1 year ago
this.dataContent.subList.splice(index, 1)
1 year ago
this.$emit('removePack')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>