|
|
|
<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 />
|
|
|
|
<view class="" v-for="(item,index) in dataContent.subList">
|
|
|
|
<uni-swipe-action ref="swipeAction">
|
|
|
|
<uni-swipe-action-item @click="swipeClick($event,item)"
|
|
|
|
:right-options="item.scaned?scanOptions:detailOptions">
|
|
|
|
<recommend :detail="item" ></recommend>
|
|
|
|
</uni-swipe-action-item>
|
|
|
|
</uni-swipe-action>
|
|
|
|
</view>
|
|
|
|
</uni-collapse-item>
|
|
|
|
</uni-collapse>
|
|
|
|
<balance-qty-edit ref="qtyEdit" :dataContent="editItem" :settingParam="settingParam"
|
|
|
|
:handleQty="editItem.record.qty" @confirm="confirm"></balance-qty-edit>
|
|
|
|
<job-detail-popup ref="receiptHint" :dataContent="showItem"></job-detail-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 recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
|
|
|
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
|
|
|
|
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
|
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue'
|
|
|
|
import {
|
|
|
|
getDetailOption,
|
|
|
|
getDetailEditRemoveOption
|
|
|
|
} from '@/common/array.js';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
itemQty,
|
|
|
|
recommend,
|
|
|
|
recommendQtyEdit,
|
|
|
|
balanceQtyEdit,
|
|
|
|
jobDetailPopup,
|
|
|
|
comMessage
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
dataContent: {
|
|
|
|
type: Object,
|
|
|
|
default: {}
|
|
|
|
},
|
|
|
|
settingParam: {
|
|
|
|
type: Object,
|
|
|
|
default: {}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
option: [],
|
|
|
|
title: "推荐详情",
|
|
|
|
showItem: {},
|
|
|
|
editItem: {
|
|
|
|
record: {
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
detailOptions: [],
|
|
|
|
scanOptions: []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
this.detailOptions = getDetailOption();
|
|
|
|
this.scanOptions = getDetailEditRemoveOption();
|
|
|
|
},
|
|
|
|
|
|
|
|
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;
|
|
|
|
this.$refs.qtyEdit.openEditPopup(item.balance, item.record.qty);
|
|
|
|
},
|
|
|
|
|
|
|
|
detail(item) {
|
|
|
|
this.showItem = item;
|
|
|
|
this.$refs.receiptHint.openScanPopup()
|
|
|
|
},
|
|
|
|
remove(item) {
|
|
|
|
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
|
|
|
|
res => {
|
|
|
|
if (res) {
|
|
|
|
item.scaned = false
|
|
|
|
item.record = {}
|
|
|
|
item.balance = {}
|
|
|
|
item.inventoryStatus = item.RecommendInventoryStatus
|
|
|
|
// item.record.qty = 0;
|
|
|
|
this.$forceUpdate()
|
|
|
|
this.$emit('remove', item)
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
confirm(qty) {
|
|
|
|
this.editItem.record.qty = qty;
|
|
|
|
this.$emit('updateData')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|