|
...
|
...
|
@@ -47,7 +47,50 @@ |
|
|
|
</el-card>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="18" :xs="24">
|
|
|
|
<PanelGroup :totalList="totalList" />
|
|
|
|
<!-- 个人车险 -->
|
|
|
|
<div style="font-weight: 500">{{ peopleCompany }}个人车险统计</div>
|
|
|
|
<div
|
|
|
|
v-hasRole="['admin', 'associationemployee']"
|
|
|
|
class="select_company"
|
|
|
|
>
|
|
|
|
<p>选择保险公司</p>
|
|
|
|
<el-select
|
|
|
|
v-model="queryParamsPeople.deptIds[0]"
|
|
|
|
placeholder="请选择保险公司"
|
|
|
|
style="width: 240px"
|
|
|
|
@change="getPeopleList"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in deptOptions"
|
|
|
|
:key="item.deptId"
|
|
|
|
:label="item.deptName"
|
|
|
|
:value="item.deptId"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</div>
|
|
|
|
<PanelGroup :totalList="peopleTotalList" />
|
|
|
|
<!-- 企业车险 -->
|
|
|
|
<div style="font-weight: 500">{{ businessCompany }}企业车险统计</div>
|
|
|
|
<div
|
|
|
|
v-hasRole="['admin', 'associationemployee']"
|
|
|
|
class="select_company"
|
|
|
|
>
|
|
|
|
<p>选择保险公司</p>
|
|
|
|
<el-select
|
|
|
|
v-model="queryParamsBusiness.deptIds[0]"
|
|
|
|
placeholder="请选择保险公司"
|
|
|
|
style="width: 240px"
|
|
|
|
@change="getBusinessList"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in deptOptions"
|
|
|
|
:key="item.deptId"
|
|
|
|
:label="item.deptName"
|
|
|
|
:value="item.deptId"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</div>
|
|
|
|
<PanelGroup :totalList="businessTotalList" />
|
|
|
|
<!-- 统计柱状图 -->
|
|
|
|
<div class="echarts_box">
|
|
|
|
<div
|
|
...
|
...
|
@@ -56,7 +99,7 @@ |
|
|
|
>
|
|
|
|
<p>选择保险公司</p>
|
|
|
|
<el-select
|
|
|
|
v-model="queryParams.deptIds[0]"
|
|
|
|
v-model="allQueryParams.deptIds[0]"
|
|
|
|
placeholder="请选择保险公司"
|
|
|
|
style="width: 240px"
|
|
|
|
@change="getList"
|
|
...
|
...
|
@@ -87,7 +130,13 @@ const { proxy } = getCurrentInstance(); |
|
|
|
const userStore = useUserStore();
|
|
|
|
const chartRef = ref(null);
|
|
|
|
const listData = ref([]);
|
|
|
|
const totalList = ref({
|
|
|
|
const peopleTotalList = ref({
|
|
|
|
0: 0,
|
|
|
|
1: 0,
|
|
|
|
2: 0,
|
|
|
|
3: 0,
|
|
|
|
});
|
|
|
|
const businessTotalList = ref({
|
|
|
|
0: 0,
|
|
|
|
1: 0,
|
|
|
|
2: 0,
|
|
...
|
...
|
@@ -95,9 +144,32 @@ const totalList = ref({ |
|
|
|
});
|
|
|
|
const xList = ref([]);
|
|
|
|
const company = ref("");
|
|
|
|
const businessCompany = ref("");
|
|
|
|
const peopleCompany = ref("");
|
|
|
|
const option = ref({});
|
|
|
|
const deptOptions = ref([]);
|
|
|
|
const queryParams = reactive({
|
|
|
|
// 个人车险请求参数
|
|
|
|
const queryParamsPeople = reactive({
|
|
|
|
deptIds: [""],
|
|
|
|
type: 1,
|
|
|
|
registrationType: 0,
|
|
|
|
startTime: proxy.parseTime(
|
|
|
|
new Date().setFullYear(new Date().getFullYear() - 1)
|
|
|
|
),
|
|
|
|
endTime: proxy.parseTime(new Date()),
|
|
|
|
});
|
|
|
|
// 个人车险请求参数
|
|
|
|
const queryParamsBusiness = reactive({
|
|
|
|
deptIds: [""],
|
|
|
|
type: 1,
|
|
|
|
registrationType: 1,
|
|
|
|
startTime: proxy.parseTime(
|
|
|
|
new Date().setFullYear(new Date().getFullYear() - 1)
|
|
|
|
),
|
|
|
|
endTime: proxy.parseTime(new Date()),
|
|
|
|
});
|
|
|
|
// 全部请求参数
|
|
|
|
const allQueryParams = reactive({
|
|
|
|
deptIds: [""],
|
|
|
|
type: 1,
|
|
|
|
startTime: proxy.parseTime(
|
|
...
|
...
|
@@ -113,6 +185,8 @@ const state = reactive({ |
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
getList();
|
|
|
|
getPeopleList();
|
|
|
|
getBusinessList();
|
|
|
|
if (proxy.$auth.hasRoleOr(["admin", "associationemployee"])) {
|
|
|
|
getDeptList();
|
|
|
|
}
|
|
...
|
...
|
@@ -142,7 +216,7 @@ const showText = (index) => { |
|
|
|
};
|
|
|
|
// 获取统计数据
|
|
|
|
const getList = async () => {
|
|
|
|
const { data } = await getStatistics(queryParams);
|
|
|
|
const { data } = await getStatistics(allQueryParams);
|
|
|
|
xList.value = data?.map((item) => item.month);
|
|
|
|
let newData = data?.map((data) => data.statisticsVo[0]);
|
|
|
|
let newArr = newData?.map((item) => {
|
|
...
|
...
|
@@ -157,7 +231,6 @@ const getList = async () => { |
|
|
|
for (let i = 0; i < 4; i++) {
|
|
|
|
for (let j = 0; j < 13; j++) {
|
|
|
|
arrList[i]?.push(newArr[j][i]);
|
|
|
|
totalList.value[i] += newArr[j][i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
listData.value = arrList.map((child, index) => {
|
|
...
|
...
|
@@ -174,6 +247,62 @@ const getList = async () => { |
|
|
|
init();
|
|
|
|
};
|
|
|
|
|
|
|
|
// 获个人车险统计
|
|
|
|
const getPeopleList = async () => {
|
|
|
|
peopleTotalList.value = {
|
|
|
|
0: 0,
|
|
|
|
1: 0,
|
|
|
|
2: 0,
|
|
|
|
3: 0,
|
|
|
|
};
|
|
|
|
const { data } = await getStatistics(queryParamsPeople);
|
|
|
|
let newData = data?.map((data) => data.statisticsVo[0]);
|
|
|
|
let newArr = newData?.map((item) => {
|
|
|
|
return [
|
|
|
|
item.toBeUndertaken,
|
|
|
|
item.undertaken,
|
|
|
|
item.notCompleted,
|
|
|
|
item.completed,
|
|
|
|
];
|
|
|
|
});
|
|
|
|
const arrList = [[], [], [], []];
|
|
|
|
for (let i = 0; i < 4; i++) {
|
|
|
|
for (let j = 0; j < 13; j++) {
|
|
|
|
arrList[i]?.push(newArr[j][i]);
|
|
|
|
peopleTotalList.value[i] += newArr[j][i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
peopleCompany.value = data[0]?.statisticsVo[0]?.deptName;
|
|
|
|
};
|
|
|
|
|
|
|
|
// 获取企业车险统计
|
|
|
|
const getBusinessList = async () => {
|
|
|
|
businessTotalList.value = {
|
|
|
|
0: 0,
|
|
|
|
1: 0,
|
|
|
|
2: 0,
|
|
|
|
3: 0,
|
|
|
|
};
|
|
|
|
const { data } = await getStatistics(queryParamsBusiness);
|
|
|
|
let newData = data?.map((data) => data.statisticsVo[0]);
|
|
|
|
let newArr = newData?.map((item) => {
|
|
|
|
return [
|
|
|
|
item.toBeUndertaken,
|
|
|
|
item.undertaken,
|
|
|
|
item.notCompleted,
|
|
|
|
item.completed,
|
|
|
|
];
|
|
|
|
});
|
|
|
|
const arrList = [[], [], [], []];
|
|
|
|
for (let i = 0; i < 4; i++) {
|
|
|
|
for (let j = 0; j < 13; j++) {
|
|
|
|
arrList[i]?.push(newArr[j][i]);
|
|
|
|
businessTotalList.value[i] += newArr[j][i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
businessCompany.value = data[0]?.statisticsVo[0]?.deptName;
|
|
|
|
};
|
|
|
|
|
|
|
|
const init = () => {
|
|
|
|
const myChart = proxy.echarts.init(chartRef.value);
|
|
|
|
option.value = {
|
...
|
...
|
|