freight-web/src/PagesStatistics/components/ProductDialog.vue

110 lines
2.5 KiB
Vue
Raw Normal View History

2024-03-04 07:10:11 +00:00
<template>
<u-popup :show="show" mode="left" :closeable="true" @close="handleClose">
<view class="c-dialog-filter">
<view class="title">收货产品</view>
<view class="dialog-product-layout">
2024-03-15 02:40:59 +00:00
<text v-for="(item, index) in state.list" :class="{ active: state.current === item.id }" @click="handleSelect(item)" :key="index"
>{{ item.reProductsName }}</text
2024-03-04 07:10:11 +00:00
>
</view>
2024-03-15 02:40:59 +00:00
<!-- <view class="btn-confirm">
2024-03-04 07:10:11 +00:00
<view class="btn">
<u-button type="primary" :text="'确认'"></u-button>
</view>
2024-03-15 02:40:59 +00:00
</view> -->
2024-03-04 07:10:11 +00:00
</view>
</u-popup>
</template>
<script setup lang="ts">
2024-03-15 02:40:59 +00:00
import { ReceiveProductApi } from '@/services';
2024-03-04 07:10:11 +00:00
const props = defineProps<{
show: boolean,
}>()
2024-03-15 02:40:59 +00:00
const emit = defineEmits(['handleDialog', 'changeProduct']);
2024-03-04 07:10:11 +00:00
const handleClose = () => {
emit('handleDialog', false)
}
2024-03-15 02:40:59 +00:00
const state = reactive<any>({
list: [],
current: -1,
})
const handleSelect = (item:any) => {
state.current = item.id
emit('changeProduct', item)
emit('handleDialog', false)
}
const getList = () => {
ReceiveProductApi.getAllReProducts().then(res => {
if (res.code === 200) {
state.list = res.data
}
})
}
onMounted(() => {
getList()
})
2024-03-04 07:10:11 +00:00
</script>
<style lang="scss" scoped>
.c-dialog-filter {
width: 95vw;
padding: 25rpx;
.title {
font-weight: 500;
font-size: 32rpx;
color: #000000;
text-align: center;
}
}
// 产品dialog
.dialog-product-layout {
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12);
border-radius: 13rpx;
margin: 42rpx 25rpx;
padding: 19rpx;
display: flex;
justify-content: flex-start;
align-items: center;
flex-flow: row wrap;
max-height: 70vh;
overflow: auto;
text {
font-weight: 400;
2024-03-15 02:40:59 +00:00
font-size: 26rpx;
2024-03-04 07:10:11 +00:00
color: #999999;
background: #ffffff;
border-radius: 6rpx;
border: 1px solid rgba(153, 153, 153, 0.64);
text-align: center;
cursor: pointer;
padding: 10rpx 20rpx;
margin-bottom: 20rpx;
margin-left: 10rpx;
margin-right: 10rpx;
}
.active {
border-color: $u-primary;
color: $u-primary;
}
}
.btn-confirm {
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 56, 93, 0.12);
border-radius: 13rpx 13rpx 0rpx 0rpx;
position: absolute;
bottom: 0rpx;
width: 100%;
left: 0rpx;
padding: 27.56rpx;
.btn {
text-align: center;
::v-deep button {
width: 80%;
border-radius: 43rpx;
}
}
}
</style>