会员统计
This commit is contained in:
parent
aba4340ff3
commit
9b80f11d1d
|
@ -62,11 +62,6 @@
|
||||||
const detailVisible = ref(false);
|
const detailVisible = ref(false);
|
||||||
const detailData = ref([]);
|
const detailData = ref([]);
|
||||||
|
|
||||||
const pagination = {
|
|
||||||
current: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
};
|
|
||||||
|
|
||||||
const parmas = reactive<any>({
|
const parmas = reactive<any>({
|
||||||
beginTime: '',
|
beginTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
|
|
|
@ -0,0 +1,237 @@
|
||||||
|
import {BasicColumn} from '/@/components/Table';
|
||||||
|
import {FormSchema} from '/@/components/Table';
|
||||||
|
import { rules} from '/@/utils/helper/validator';
|
||||||
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
|
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||||
|
import {ref} from "vue";
|
||||||
|
//列表数据
|
||||||
|
|
||||||
|
export const xzrsColumns : BasicColumn[] =[
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: 'rowNumber',
|
||||||
|
key: 'rowNumber',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '日期',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '新增会员',
|
||||||
|
dataIndex: 'value',
|
||||||
|
key: 'value',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
align: 'center',
|
||||||
|
width: '150px',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
export const detailXzhyColumns : BasicColumn[] =[
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: 'rowNumber',
|
||||||
|
key: 'rowNumber',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '小区名称',
|
||||||
|
dataIndex: 'housingestateName',
|
||||||
|
key: 'housingestateName',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备地点',
|
||||||
|
dataIndex: 'content',
|
||||||
|
key: 'content',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '电话',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
key: 'phone',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '注册时间',
|
||||||
|
dataIndex: 'registerDate',
|
||||||
|
key: 'registerDate',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '投递次数',
|
||||||
|
dataIndex: 'deliveries',
|
||||||
|
key: 'deliveries',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '违规次数',
|
||||||
|
dataIndex: 'violations',
|
||||||
|
key: 'violations',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '最后投递时间',
|
||||||
|
dataIndex: 'deliveredAt',
|
||||||
|
key: 'deliveredAt',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
key: 'status',
|
||||||
|
align: 'center',
|
||||||
|
customRender: function ({ text }) {
|
||||||
|
//0:拉黑 1:正常
|
||||||
|
if (text == '0') {
|
||||||
|
return '拉黑';
|
||||||
|
} else {
|
||||||
|
return '正常';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
export const tdcsColumns : BasicColumn[] =[
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: 'rowNumber',
|
||||||
|
key: 'rowNumber',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '会员',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '投递次数',
|
||||||
|
dataIndex: 'value',
|
||||||
|
key: 'value',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
align: 'center',
|
||||||
|
width: '150px',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
export const tdzlColumns : BasicColumn[] =[
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: 'rowNumber',
|
||||||
|
key: 'rowNumber',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '小区名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '投递重量(公斤)',
|
||||||
|
dataIndex: 'value',
|
||||||
|
key: 'value',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
align: 'center',
|
||||||
|
width: '150px',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
export const detailTdcsColumns : BasicColumn[] =[
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: 'rowNumber',
|
||||||
|
key: 'rowNumber',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '小区名称',
|
||||||
|
dataIndex: 'housingestateName',
|
||||||
|
key: 'housingestateName',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备地点',
|
||||||
|
dataIndex: 'content',
|
||||||
|
key: 'content',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '会员手机号',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
key: 'phone',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '投递时间',
|
||||||
|
dataIndex: 'addTime',
|
||||||
|
key: 'addTime',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '重量',
|
||||||
|
dataIndex: 'weight',
|
||||||
|
key: 'weight',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '金额',
|
||||||
|
dataIndex: 'money',
|
||||||
|
key: 'money',
|
||||||
|
align: 'center',
|
||||||
|
customRender: function ({ text, record, index}) {
|
||||||
|
return (record.money - record.deductMoney).toFixed(2)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '扣除金额',
|
||||||
|
// dataIndex: 'deductMoney',
|
||||||
|
// key: 'deductMoney',
|
||||||
|
// align: 'center'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '订单状态',
|
||||||
|
dataIndex: 'invalid',
|
||||||
|
key: 'invalid',
|
||||||
|
align: 'center',
|
||||||
|
customRender: function ({ text }) {
|
||||||
|
if (text == '0') {
|
||||||
|
return '正常';
|
||||||
|
} else if (text == '1') {
|
||||||
|
return '违规';
|
||||||
|
} else if (text == '2') {
|
||||||
|
return '部分违规';
|
||||||
|
} else if (text == '3') {
|
||||||
|
return '待审核';
|
||||||
|
} else if (text == '4') {
|
||||||
|
return '异常';
|
||||||
|
} else if (text == '5') {
|
||||||
|
return '忽略';
|
||||||
|
}else{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '原因',
|
||||||
|
dataIndex: 'cause',
|
||||||
|
key: 'cause',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
<a-card :bordered="false" style="height: 100%">
|
<a-card :bordered="false" style="height: 100%">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="21" v-show="!izList">
|
<a-col :span="20">
|
||||||
<a-radio-group v-model:value="parmas.type" @change="changeType">
|
<a-radio-group v-model:value="parmas.type" @change="changeType">
|
||||||
<a-radio-button value="1">当天</a-radio-button>
|
<a-radio-button value="1">当天</a-radio-button>
|
||||||
<a-radio-button value="2">近3天</a-radio-button>
|
<a-radio-button value="2">近3天</a-radio-button>
|
||||||
|
@ -20,20 +20,8 @@
|
||||||
item.housingestateName }}</a-select-option>
|
item.housingestateName }}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="21" v-show="izList">
|
|
||||||
<a-form layout="inline" :model="parmas" :labelCol="{ style: { width: 'auto', paddingRight: '90px' } }"
|
|
||||||
:wrapperCol="{ style: { display: 'flex', alignItems: 'center' } }">
|
|
||||||
<a-form-item label="投递次数">
|
|
||||||
<a-input-number v-model:value="parmas.countMin" placeholder="最小次数" :min="0" />
|
|
||||||
<span class="ant-form-text" style="margin: 0 8px;">至</span>
|
|
||||||
<a-input-number v-model:value="parmas.countMax" placeholder="最大次数" :min="0" />
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
<a-button type="link" @click="loadListDate">查询</a-button>
|
|
||||||
<a-button type="link" @click="resetListData">重置</a-button>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="3">
|
<a-col :span="3">
|
||||||
<a-radio-group v-model:value="izList" button-style="solid">
|
<a-radio-group v-model:value="izList" button-style="solid" @change="loadDate">
|
||||||
<a-radio-button :value="false">统计图</a-radio-button>
|
<a-radio-button :value="false">统计图</a-radio-button>
|
||||||
<a-radio-button :value="true">列表页</a-radio-button>
|
<a-radio-button :value="true">列表页</a-radio-button>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
|
@ -42,25 +30,38 @@
|
||||||
<Bar v-show="!izList" :chartData="dataSource" height="80vh"
|
<Bar v-show="!izList" :chartData="dataSource" height="80vh"
|
||||||
:option="{ title: { text: '会员投递次数排行榜', left: 'center' } }"
|
:option="{ title: { text: '会员投递次数排行榜', left: 'center' } }"
|
||||||
:itemStyle="{ normal: { label: { show: true, position: 'top' } } }" :seriesName="'投递次数'"></Bar>
|
:itemStyle="{ normal: { label: { show: true, position: 'top' } } }" :seriesName="'投递次数'"></Bar>
|
||||||
<a-table v-show="izList" :dataSource="tableData" :columns="columns">
|
<div v-show="izList" style="margin-top: 20px;">
|
||||||
|
<a-table :dataSource="dataSource" :columns="tdcsColumns">
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-button type="link" @click="handleView(record)">查看</a-button>
|
<a-button type="link" @click="handleView(record)">查看</a-button>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
<!-- 查看详情弹窗 -->
|
<!-- 查看详情弹窗 -->
|
||||||
<a-modal v-model:visible="detailVisible" title="会员投递详情" width="80%" :footer="null">
|
<a-modal v-model:visible="detailVisible" title="会员投递详情" width="80%" :footer="null">
|
||||||
<a-table :dataSource="detailData" :columns="detailColumns" rowKey="phone">
|
<a-row>
|
||||||
<template #bodyCell="{ column, record }">
|
<a-col :span="20">
|
||||||
<template v-if="column.key === 'action'">
|
<div style="margin: 5px 0px 5px 20px">订单状态
|
||||||
<a-space>
|
<a-select ref="select"
|
||||||
<a-button type="link" @click="handleMark(record)">标记</a-button>
|
placeholder="请选订单状态"
|
||||||
<a-button type="link" danger @click="handleBlock(record)">屏蔽</a-button>
|
v-model:value="detailParmas.invalid"
|
||||||
</a-space>
|
style="width: 200px;margin-left: 5px;"
|
||||||
</template>
|
@change="loadDetailDate">
|
||||||
</template>
|
<a-select-option value="" >全部</a-select-option>
|
||||||
|
<a-select-option value="0">正常</a-select-option>
|
||||||
|
<a-select-option value="1">违规</a-select-option>
|
||||||
|
<a-select-option value="2">部分违规</a-select-option>
|
||||||
|
<a-select-option value="3">待审核</a-select-option>
|
||||||
|
<a-select-option value="4">异常</a-select-option>
|
||||||
|
<a-select-option value="5">忽略</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</div>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-table :dataSource="detailData" :columns="detailTdcsColumns" rowKey="rowNumber">
|
||||||
</a-table>
|
</a-table>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</div>
|
</div>
|
||||||
|
@ -69,7 +70,8 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, unref, reactive, onMounted } from 'vue';
|
import { ref, unref, reactive, onMounted } from 'vue';
|
||||||
import Bar from '/@/components/chart/Bar.vue';
|
import Bar from '/@/components/chart/Bar.vue';
|
||||||
import { tdcsList, allTdcsList, housingestateList, queryHyjlList } from '../hy.api';
|
import { tdcsList, housingestateList, queryHyjlList } from '../hy.api';
|
||||||
|
import { tdcsColumns,detailTdcsColumns } from '../hy.data';
|
||||||
import type { Dayjs } from 'dayjs';
|
import type { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
const valueFormat = 'YYYY-MM-DD';
|
const valueFormat = 'YYYY-MM-DD';
|
||||||
|
@ -77,94 +79,9 @@ const dataSource = ref([]);
|
||||||
const dateValue = ref();
|
const dateValue = ref();
|
||||||
const housingestates = ref();
|
const housingestates = ref();
|
||||||
const izList = ref(false)
|
const izList = ref(false)
|
||||||
const tableData = ref([])
|
|
||||||
const detailVisible = ref(false);
|
const detailVisible = ref(false);
|
||||||
const detailData = ref([]);
|
const detailData = ref([]);
|
||||||
|
|
||||||
const columns = ref([
|
|
||||||
{
|
|
||||||
title: '会员',
|
|
||||||
dataIndex: 'name',
|
|
||||||
key: 'name',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '投递次数',
|
|
||||||
dataIndex: 'value',
|
|
||||||
key: 'value',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
key: 'action',
|
|
||||||
align: 'center',
|
|
||||||
width: '150px',
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
const detailColumns = ref([
|
|
||||||
{
|
|
||||||
title: '会员手机号',
|
|
||||||
dataIndex: 'phone',
|
|
||||||
key: 'phone',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '金额',
|
|
||||||
dataIndex: 'money',
|
|
||||||
key: 'money',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '重量',
|
|
||||||
dataIndex: 'weight',
|
|
||||||
key: 'weight',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '投递时间',
|
|
||||||
dataIndex: 'addTime',
|
|
||||||
key: 'addTime',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '订单是否有效',
|
|
||||||
dataIndex: 'invalid',
|
|
||||||
key: 'invalid',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '订单开始重量',
|
|
||||||
dataIndex: 'startWeight',
|
|
||||||
key: 'startWeight',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '订单结束重量',
|
|
||||||
dataIndex: 'endWeight',
|
|
||||||
key: 'endWeight',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '厂家更新时间',
|
|
||||||
dataIndex: 'updatedAt',
|
|
||||||
key: 'updatedAt',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '扣除金额',
|
|
||||||
dataIndex: 'deductMoney',
|
|
||||||
key: 'deductMoney',
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
key: 'action',
|
|
||||||
align: 'center',
|
|
||||||
width: '200px',
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
async function getHousingestates() {
|
async function getHousingestates() {
|
||||||
housingestates.value = await housingestateList();
|
housingestates.value = await housingestateList();
|
||||||
}
|
}
|
||||||
|
@ -172,9 +89,14 @@ async function getHousingestates() {
|
||||||
const parmas = reactive<any>({
|
const parmas = reactive<any>({
|
||||||
beginTime: '',
|
beginTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
|
housingestateId: '',
|
||||||
|
pageSize: 10,
|
||||||
type: '1',
|
type: '1',
|
||||||
countMin: null,
|
})
|
||||||
countMax: null,
|
|
||||||
|
const detailParmas = reactive<any>({
|
||||||
|
phone: '',
|
||||||
|
invalid: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
function changeType() {
|
function changeType() {
|
||||||
|
@ -208,44 +130,40 @@ function handleHousinges() {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function loadDate() {
|
async function loadDate() {
|
||||||
const res = await tdcsList(parmas);
|
if(izList.value){
|
||||||
|
parmas.pageSize=-1
|
||||||
|
}else{
|
||||||
|
parmas.pageSize=10
|
||||||
|
}
|
||||||
|
const resData = await tdcsList(parmas);
|
||||||
|
const res = resData.records;
|
||||||
dataSource.value = [];
|
dataSource.value = [];
|
||||||
for (let i = 0; i < res.length; i++) {
|
for (let i = 0; i < res.length; i++) {
|
||||||
dataSource.value.push({
|
dataSource.value.push({
|
||||||
|
rowNumber: res[i].rowNumber,
|
||||||
name: `${res[i].phone}`,
|
name: `${res[i].phone}`,
|
||||||
value: res[i].cn,
|
value: res[i].cn,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadListDate() {
|
|
||||||
const res = await allTdcsList({ countMin: parmas.countMin, countMax: parmas.countMax });
|
|
||||||
tableData.value = [];
|
|
||||||
for (let i = 0; i < res.length; i++) {
|
|
||||||
tableData.value.push({
|
|
||||||
name: `${res[i].phone}`,
|
|
||||||
value: res[i].cn,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//重置
|
|
||||||
function resetListData() {
|
|
||||||
parmas.countMin = null
|
|
||||||
parmas.countMax = null
|
|
||||||
loadListDate()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查看详情
|
// 查看详情
|
||||||
const handleView = async (record) => {
|
const handleView = async (record) => {
|
||||||
|
detailParmas.phone = record.name;
|
||||||
|
loadDetailDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查看详情
|
||||||
|
async function loadDetailDate(){
|
||||||
try {
|
try {
|
||||||
const res = await queryHyjlList({ phone: record.name });
|
detailData.value = [];
|
||||||
|
const res = await queryHyjlList({ beginTime:parmas.beginTime,endTime:parmas.endTime,housingestateId:parmas.housingestateId,phone:detailParmas.phone,invalid:detailParmas.invalid });
|
||||||
detailData.value = res;
|
detailData.value = res;
|
||||||
detailVisible.value = true;
|
detailVisible.value = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取详情失败:', error);
|
console.error('获取详情失败:', error);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
function getPreviousDate(days) {
|
function getPreviousDate(days) {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
|
@ -257,27 +175,12 @@ function getPreviousDate(days) {
|
||||||
return formattedDate;
|
return formattedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增的方法
|
|
||||||
const handleMark = (record) => {
|
|
||||||
console.log('标记记录:', record);
|
|
||||||
// 这里可以添加标记逻辑,如调用API等
|
|
||||||
// 示例: markRecord(record.phone);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleBlock = (record) => {
|
|
||||||
console.log('屏蔽记录:', record);
|
|
||||||
// 这里可以添加屏蔽逻辑,如调用API等
|
|
||||||
// 示例: blockRecord(record.phone);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (parmas.type == '1') {
|
if (parmas.type == '1') {
|
||||||
parmas.beginTime = getPreviousDate(0) + ' 00:00:00';
|
parmas.beginTime = getPreviousDate(0) + ' 00:00:00';
|
||||||
parmas.endTime = getPreviousDate(0) + ' 23:59:59';
|
parmas.endTime = getPreviousDate(0) + ' 23:59:59';
|
||||||
}
|
}
|
||||||
loadDate();
|
loadDate();
|
||||||
loadListDate();
|
|
||||||
getHousingestates();
|
getHousingestates();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,29 @@
|
||||||
<a-range-picker :value-format="valueFormat" @change="changeDate" />
|
<a-range-picker :value-format="valueFormat" @change="changeDate" />
|
||||||
</span>
|
</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="3">
|
||||||
|
<a-radio-group v-model:value="izList" button-style="solid">
|
||||||
|
<a-radio-button :value="false">统计图</a-radio-button>
|
||||||
|
<a-radio-button :value="true">列表页</a-radio-button>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<BaseAreaLine :chartData="dataSource" height="80vh" :option="{ title: { text: '新增会员统计', left: 'center' }}" :seriesLabel="{show: true, position: 'top'}" :seriesName="'个数'"></BaseAreaLine>
|
<BaseAreaLine v-show="!izList" :chartData="dataSource" height="80vh" :option="{ title: { text: '新增会员统计', left: 'center' }}" :seriesLabel="{show: true, position: 'top'}" :seriesName="'新增会员'"></BaseAreaLine>
|
||||||
|
<div v-show="izList" style="margin-top: 20px;">
|
||||||
|
<a-table :dataSource="dataSource" :columns="xzrsColumns">
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-button type="link" @click="handleView(record)">查看</a-button>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</a-table>
|
||||||
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
<!-- 查看详情弹窗 -->
|
||||||
|
<a-modal v-model:visible="detailVisible" title="新增会员详情" width="80%" :footer="null">
|
||||||
|
<a-table :dataSource="detailData" :columns="detailXzhyColumns" rowKey="rowNumber">
|
||||||
|
</a-table>
|
||||||
|
</a-modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -23,11 +43,15 @@
|
||||||
import {ref, unref, reactive, onMounted} from 'vue';
|
import {ref, unref, reactive, onMounted} from 'vue';
|
||||||
import BaseAreaLine from '/@/components/chart/BaseAreaLine.vue';
|
import BaseAreaLine from '/@/components/chart/BaseAreaLine.vue';
|
||||||
import { xzList } from '../hy.api';
|
import { xzList } from '../hy.api';
|
||||||
|
import { xzrsColumns,detailXzhyColumns } from '../hy.data';
|
||||||
import type { Dayjs } from 'dayjs';
|
import type { Dayjs } from 'dayjs';
|
||||||
|
import {queryXzhyDetailList} from "@/views/zh/housingestateInfo/HousingestateInfo.api";
|
||||||
const valueFormat = 'YYYY-MM-DD';
|
const valueFormat = 'YYYY-MM-DD';
|
||||||
const dataSource = ref([]);
|
const dataSource = ref([]);
|
||||||
const dateValue = ref();
|
const dateValue = ref();
|
||||||
|
const izList = ref(false);
|
||||||
|
const detailVisible = ref(false);
|
||||||
|
const detailData = ref([]);
|
||||||
const parmas = reactive<any>({
|
const parmas = reactive<any>({
|
||||||
beginTime: '',
|
beginTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
|
@ -65,12 +89,33 @@
|
||||||
dataSource.value = [];
|
dataSource.value = [];
|
||||||
for (let i = 0; i < res.length; i++) {
|
for (let i = 0; i < res.length; i++) {
|
||||||
dataSource.value.push({
|
dataSource.value.push({
|
||||||
|
rowNumber: res[i].rowNumber,
|
||||||
name: `${res[i].shortDay}`,
|
name: `${res[i].shortDay}`,
|
||||||
value: res[i].cn,
|
value: res[i].cn,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查看详情
|
||||||
|
const handleView = async (record) => {
|
||||||
|
console.log("🚀 ~ handleView ~ record:", record);
|
||||||
|
try {
|
||||||
|
let detailParams = {
|
||||||
|
beginTime:record.name+' 00:00:00',
|
||||||
|
endTime:record.name+' 23:59:59',
|
||||||
|
pageSize: -1
|
||||||
|
}
|
||||||
|
detailData.value = [];
|
||||||
|
const res = await queryXzhyDetailList(detailParams);
|
||||||
|
detailData.value = res.records;
|
||||||
|
console.log("🚀 ~ handleView ~ res:", res);
|
||||||
|
detailVisible.value = true;
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取详情失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function getPreviousDate(days){
|
function getPreviousDate(days){
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
date.setDate(date.getDate() - days);
|
date.setDate(date.getDate() - days);
|
||||||
|
|
Loading…
Reference in New Issue