王志国
2 weeks ago
6 changed files with 282 additions and 112 deletions
@ -0,0 +1,151 @@ |
|||
<template> |
|||
<view class="" style="background-color: #fff;"> |
|||
<u-collapse ref="collapse1" @change=""> |
|||
<u-collapse-item :open="true"> |
|||
<template #title> |
|||
<u-swipe-action ref="swipeAction" |
|||
:options="removeOptions" |
|||
@click="removeData($event,dataContent)"> |
|||
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
|||
:isShowBalance="true"></item-qty> |
|||
</u-swipe-action> |
|||
</template> |
|||
<view class='split_line'></view> |
|||
<view class="" v-for="(item,index) in dataContent.subList"> |
|||
<u-swipe-action ref="swipeAction" |
|||
:options="item.scaned?scanOptions:detailOptions" |
|||
@click="swipeClick($event,item,index)"> |
|||
<balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true" |
|||
:isShowPack="true" :isShowFromLocation="true"></balance> |
|||
</u-swipe-action> |
|||
</view> |
|||
</u-collapse-item> |
|||
</u-collapse> |
|||
<!-- <recommend-qty-edit ref="recommendQtyEdit" :dataContent="editItem" :handleQty="editItem.qty" @confirm="confirm" :isShowStatus="isShowStatus"></recommend-qty-edit> --> |
|||
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm"></balance-qty-edit> |
|||
<package-detail-popup ref='packageDetailPopup'> |
|||
</package-detail-popup> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import itemQty from '@/mycomponents/item/itemQty.vue' |
|||
import Recommend from '@/mycomponents/recommend/recommend.vue' |
|||
import productionLabel from '@/mycomponents/balance/productionLabel.vue' |
|||
import Record from '@/mycomponents/record/record.vue' |
|||
import BalanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
|||
import RecommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' |
|||
import PackageDetailPopup from '@/mycomponents/package/packageDetailPopup.vue' |
|||
import balance from '@/mycomponents/balance/balance.vue' |
|||
|
|||
import { |
|||
getDetailOption, |
|||
getDetailEditRemoveOption, |
|||
getClearOption |
|||
} from '@/common/array.js'; |
|||
|
|||
import { ref, watch, onMounted, nextTick } from 'vue'; |
|||
|
|||
const props = defineProps({ |
|||
dataContent: { |
|||
type: Object, |
|||
default: () => ({}) |
|||
}, |
|||
settingParam: { |
|||
type: Object, |
|||
default: () => ({}) |
|||
}, |
|||
fromInventoryStatus: { |
|||
type: String, |
|||
default: "" |
|||
}, |
|||
toInventoryStatus: { |
|||
type: String, |
|||
default: "" |
|||
}, |
|||
isShowStatus: { |
|||
type: Boolean, |
|||
default: false |
|||
} |
|||
}); |
|||
const emit = defineEmits(['removeItem', 'removePack', 'updateData']); |
|||
|
|||
const option = ref([]); |
|||
const title = ref("推荐详情"); |
|||
const showItem = ref({}); |
|||
const editItem = ref({}); |
|||
const detailOptions = ref([]); |
|||
const scanOptions = ref([]); |
|||
const removeOptions = ref([]); |
|||
const dataList = ref([]); |
|||
|
|||
const collapse1 = ref(null); |
|||
const comMessage = ref(null); |
|||
const balanceQtyEdit = ref(null); |
|||
const recommendQtyEdit = ref(null); |
|||
const packageDetailPopup = ref(null); |
|||
|
|||
watch(() => props.dataContent, (newData, oldData) => { |
|||
if (newData.subList.length > 0) { |
|||
nextTick(() => { |
|||
if (collapse1.value) { |
|||
collapse1.value.resize(); |
|||
} |
|||
}); |
|||
} |
|||
}, { immediate: true, deep: true }); |
|||
|
|||
onMounted(() => { |
|||
detailOptions.value = getDetailOption(); |
|||
scanOptions.value = getDetailEditRemoveOption(); |
|||
removeOptions.value = getClearOption(); |
|||
}); |
|||
|
|||
const removeData = (e, dataContent) => { |
|||
if (e.content.text === "清空") { |
|||
comMessage.value.showQuestionMessage("确定清空物料及箱码信息?", (res) => { |
|||
if (res) { |
|||
emit('removeItem'); |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
const swipeClick = (e, item, index) => { |
|||
if (e.content.text === "详情") { |
|||
detail(item.package); |
|||
} else if (e.content.text === "编辑") { |
|||
edit(item); |
|||
} else if (e.content.text === "移除") { |
|||
remove(item, index); |
|||
} |
|||
}; |
|||
|
|||
const edit = (item) => { |
|||
editItem.value = item; |
|||
balanceQtyEdit.value.openEditPopup(editItem.value, editItem.value.handleQty); |
|||
}; |
|||
|
|||
const detail = (packageInfo) => { |
|||
showItem.value = packageInfo; |
|||
packageDetailPopup.value.openPopup(packageInfo); |
|||
}; |
|||
|
|||
const remove = (item, index) => { |
|||
comMessage.value.showQuestionMessage("确定移除扫描信息?", (res) => { |
|||
if (res) { |
|||
props.dataContent.subList.splice(index, 1); |
|||
emit('removePack'); |
|||
} |
|||
}); |
|||
}; |
|||
|
|||
const confirm = (qty) => { |
|||
editItem.value.handleQty = qty; |
|||
emit('updateData'); |
|||
}; |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
Loading…
Reference in new issue