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.7 KiB

1 year ago
<template>
12 months ago
<view>
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
<view v-for="(item,index) in dataContent.Items">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>
<!-- 物品 -->
<item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty>
</template>
<u-line />
<view v-for="(loacation,index) in item.Locations">
<view>
<view class="uni-flex uni-row space-between">
<!-- 推荐库位 -->
<location :locationCode="loacation.fromLocationCode">
</location>
</view>
<view v-for="(batch,index) in loacation.Batchs">
<recommend-balance style='margin-left: 20px;' :detail="batch"
:isShowLocation="false" :isShowPack="batch.packingNumber!=null && batch.packingNumber!=''">
</recommend-balance>
<view class="uni-flex uni-row" v-if='batch.Records.length>0'>
<view class="center " style=" width: 20px; color: #0CC2B6; margin-left: 40px;">
实际
</view>
<view class="uni-flex uni-column" style="width: 100%;">
<view v-for="(record,index) in batch.Records">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="scanOptions">
<handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null">
</handle-balance>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
1 year ago
</view>
12 months ago
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage>
1 year ago
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
12 months ago
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue'
import handleBalance from '@/mycomponents/balance/handleBalance.vue'
1 year ago
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
12 months ago
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import location from '@/mycomponents/balance/location.vue'
1 year ago
import comMessage from '@/mycomponents/common/comMessage.vue'
12 months ago
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
1 year ago
import {
getDetailOption,
12 months ago
getEditRemoveOption
1 year ago
} from '@/common/array.js';
export default {
12 months ago
emits: ['updateData'],
1 year ago
components: {
itemQty,
recommend,
12 months ago
recommendBalance,
handleBalance,
1 year ago
recommendQtyEdit,
12 months ago
requiredLocation,
1 year ago
balanceQtyEdit,
12 months ago
location,
comMessage,
detailInfoPopup
1 year ago
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
},
watch: {
},
data() {
return {
option: [],
showItem: {},
12 months ago
editItem: {},
batchItem: {},
1 year ago
detailOptions: [],
scanOptions: []
}
},
mounted() {
12 months ago
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
1 year ago
},
methods: {
12 months ago
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse.forEach(r => {
r.childrens.forEach(i => {
i.init();
})
r.resize();
})
});
},
swipeClick(e, batch, record, index) {
if (e.content.text == "编辑") {
this.edit(batch, record)
1 year ago
} else if (e.content.text == "移除") {
12 months ago
this.remove(batch, record, index)
1 year ago
}
},
12 months ago
edit(batch, item) {
let that = this;
that.editItem = item;
that.batchItem = batch;
item.balance.balanceQty=item.balance.qty;
that.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
1 year ago
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
12 months ago
remove(batch, record, index) {
1 year ago
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
12 months ago
batch.Records.splice(index, 1);
this.resizeCollapse();
this.$emit('updateData', record)
1 year ago
}
});
},
12 months ago
confirm(val) {
this.editItem.qty = val;
this.$emit('updateData', this.editItem)
// let qty = 0;
// this.batchItem.Records.forEach(r => {
// qty += Number(r.qty);
// })
// this.batchItem.handleQty = qty;
1 year ago
}
}
}
</script>
<style>
</style>