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.

130 lines
3.1 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>
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty>
</template>
<u-line />
1 year ago
<view class="" v-for="(item,index) in dataContent.subList">
1 year ago
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
1 year ago
<recommend :detail="item" ></recommend>
1 year ago
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</uni-collapse-item>
</uni-collapse>
1 year ago
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"></balance-qty-edit>
1 year ago
<scrap-detail-info-popup ref="jobDetailPopup" :dataContent="showItem"></scrap-detail-info-popup>
<com-message ref="message"></com-message>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import scrapDetailInfoPopup from '@/pages/scrap/coms/scrapDetailInfoPopup.vue'
1 year ago
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
1 year ago
import {
getDetailOption,
getDetailRemoveOption,
getDetailEditRemoveOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
jobDetailPopup,
comMessage,
1 year ago
scrapDetailInfoPopup,
balanceQtyEdit
1 year ago
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
},
watch: {
},
data() {
return {
showItem: {},
editItem: {
record: {
}
},
detailOptions: [],
scanOptions: []
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
1 year ago
if (this.settingParam.allowModifyQty == "TRUE") {
1 year ago
this.scanOptions = getDetailEditRemoveOption();
} else {
this.scanOptions = getDetailRemoveOption();
}
}
},
methods: {
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
1 year ago
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
1 year ago
},
detail(item) {
this.showItem = item;
console.log("提交参数", JSON.stringify(item));
1 year ago
this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
1 year ago
this.$emit('updateData')
}
}
}
</script>
<style>
</style>