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.

145 lines
3.6 KiB

10 months 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 />
10 months ago
<view class="" v-for="(item,index) in dataContent.subList">
10 months ago
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item :right-options="item.scaned?scanOptions:detailOptions"
@click="swipeClick($event,item)">
10 months ago
<recommend :detail="item" :isShowFromLocation="true" :isShowToLocation="true"></recommend>
10 months ago
</uni-swipe-action-item>
</uni-swipe-action>
</view>
10 months ago
<u-line />
10 months ago
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm" :allowEditStatus="true"></balance-qty-edit>
10 months ago
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
></win-scan-location>
10 months ago
<detail-info-popup ref="detailInfoPopup"></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 balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
10 months ago
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
10 months ago
import {
getDetailOption,
10 months ago
getPurchaseReceiptOption
10 months ago
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
balanceQtyEdit,
detailInfoPopup,
10 months ago
comMessage,
winScanLocation
10 months ago
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {
10 months ago
10 months ago
},
detailOptions: [],
scanOptions: []
}
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
},
watch: {
// dataContent: {
// handler(newName, oldName) {},
// immediate: true,
// deep: true
// }
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
10 months ago
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
10 months ago
}
},
methods: {
openDetailCardPopup() {
this.$refs.winHint.openScanPopup()
},
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
10 months ago
} else if (e.content.text == "库位") {
this.showLocation(item)
10 months ago
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
10 months ago
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
10 months ago
},
detail(item) {
10 months ago
this.$emit('openDetail', item);
10 months ago
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.balance = {}
10 months ago
item.handleQty = 0;
10 months ago
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
10 months ago
this.$emit('updateData')
},
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//扫描源库位
getLocation(location, code) {
this.locatonItem.toLocationCode =code;
this.$emit('updateData')
},
10 months ago
}
}
</script>
<style>
</style>