|
@@ -1,37 +1,38 @@
|
|
|
<template>
|
|
|
<div class="statistics-order-hotspot-container layout-padding">
|
|
|
- <div class="layout-padding-auto layout-padding-view pd20">
|
|
|
- <div class="table-search-content">
|
|
|
- <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
|
|
|
+ <div class="layout-padding-auto layout-padding-view pd20">
|
|
|
+ <div class="table-search-content">
|
|
|
+ <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
|
|
|
<el-form-item prop="crTime">
|
|
|
- <statistical-time v-model="state.queryParams.crTime" @change="handleQuery" ref="statisticalTimeRef" :disabled="state.loading"/>
|
|
|
+ <statistical-time v-model="state.queryParams.crTime" @change="handleQuery" ref="statisticalTimeRef" :disabled="state.loading" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
|
|
|
- <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
|
|
|
- <SvgIcon name="ele-Refresh" class="mr5" />重置
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
|
|
|
+ <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
|
|
|
+ <SvgIcon name="ele-Refresh" class="mr5" />重置
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
<div style="overflow: hidden; width: 100%; height: 100%; flex: 1">
|
|
|
<vxe-grid v-bind="gridOptions"> </vxe-grid>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-<script setup lang="ts" name="statisticsOrderOrgHotspot">
|
|
|
+<script setup lang="tsx" name="statisticsOrderOrgHotspot">
|
|
|
import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
|
|
|
import { FormInstance } from 'element-plus';
|
|
|
-import { departmentHotDetail } from '@/api/statistics/order';
|
|
|
-import { defaultDate, } from "@/utils/constants";
|
|
|
+import { departmentHotDetail, departmentUnsatisfiedExport } from '@/api/statistics/order';
|
|
|
+import { defaultDate } from '@/utils/constants';
|
|
|
import XEUtils from 'xe-utils';
|
|
|
-
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
+import Other from '@/utils/other';
|
|
|
|
|
|
const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
|
|
|
// 定义变量内容
|
|
|
const ruleFormRef = ref<RefType>(); // 表单ref
|
|
|
-const state = reactive(<any>{
|
|
|
+const state = reactive({
|
|
|
queryParams: {
|
|
|
// 查询条件
|
|
|
crTime: defaultDate, // 时间默认今天开始到今天结束
|
|
@@ -40,6 +41,7 @@ const state = reactive(<any>{
|
|
|
loading: false, // 加载
|
|
|
total: 0, // 总数
|
|
|
});
|
|
|
+const requestParams = ref<EmptyObjectType>({});
|
|
|
const gridOptions = reactive<any>({
|
|
|
loading: false,
|
|
|
border: true,
|
|
@@ -50,7 +52,7 @@ const gridOptions = reactive<any>({
|
|
|
},
|
|
|
scrollY: {
|
|
|
enabled: true,
|
|
|
- gt: 100
|
|
|
+ gt: 100,
|
|
|
},
|
|
|
toolbarConfig: {
|
|
|
zoom: true,
|
|
@@ -60,12 +62,13 @@ const gridOptions = reactive<any>({
|
|
|
queryList();
|
|
|
},
|
|
|
},
|
|
|
+ tools: [{ toolRender: { name: 'exportAll' } }],
|
|
|
},
|
|
|
customConfig: {
|
|
|
- storage: true
|
|
|
+ storage: true,
|
|
|
},
|
|
|
id: 'statisticsOrderOrgHotspot',
|
|
|
- rowConfig: { isHover: true, height: 30,isCurrent:true,useKey:true },
|
|
|
+ rowConfig: { isHover: true, height: 30, isCurrent: true, useKey: true },
|
|
|
height: 'auto',
|
|
|
columns: [],
|
|
|
data: [],
|
|
@@ -80,6 +83,11 @@ const gridOptions = reactive<any>({
|
|
|
}),
|
|
|
];
|
|
|
},
|
|
|
+ params: {
|
|
|
+ exportMethod: departmentUnsatisfiedExport,
|
|
|
+ exportParams: requestParams,
|
|
|
+ isSpecialExport: true,
|
|
|
+ },
|
|
|
});
|
|
|
/** 搜索按钮操作 */
|
|
|
const handleQuery = () => {
|
|
@@ -90,11 +98,11 @@ const handleQuery = () => {
|
|
|
const queryList = () => {
|
|
|
state.loading = true;
|
|
|
gridOptions.loading = true;
|
|
|
- let request:EmptyObjectType = {};
|
|
|
- request.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
|
|
|
- request.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
|
|
|
- Reflect.deleteProperty(request, 'crTime');
|
|
|
- departmentHotDetail(request)
|
|
|
+ requestParams.value = Other.deepClone(state.queryParams);
|
|
|
+ requestParams.value.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
|
|
|
+ requestParams.value.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
|
|
|
+ Reflect.deleteProperty(requestParams.value, 'crTime');
|
|
|
+ departmentHotDetail(requestParams.value)
|
|
|
.then((res: any) => {
|
|
|
const columns = res.result?.hotSpot ?? [];
|
|
|
gridOptions.columns = columns.map((item: any) => {
|
|
@@ -104,6 +112,15 @@ const queryList = () => {
|
|
|
id: item.id,
|
|
|
field: item.id,
|
|
|
title: item.hotSpotName,
|
|
|
+ slots: {
|
|
|
+ default(scope: any) {
|
|
|
+ return (
|
|
|
+ <el-button type="primary" onClick={() => linkDetail(scope)} link>
|
|
|
+ {scope.row[item.id]}
|
|
|
+ </el-button>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
});
|
|
|
gridOptions.columns.unshift(
|
|
@@ -120,8 +137,8 @@ const queryList = () => {
|
|
|
}
|
|
|
);
|
|
|
let tableData = res.result?.data ?? [];
|
|
|
+ let arr: EmptyArrayType = [];
|
|
|
// 判断部门名称是否重复 重复的合并数据 并去除重复数据
|
|
|
- const arr = <any>[];
|
|
|
tableData.forEach((item: any) => {
|
|
|
const index = arr.findIndex((v: any) => v.OrgName === item.OrgName);
|
|
|
if (index === -1) {
|
|
@@ -130,6 +147,7 @@ const queryList = () => {
|
|
|
arr[index] = Object.assign(arr[index], item);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
// 添加合计
|
|
|
arr.forEach((item: any) => {
|
|
|
item.sum = 0;
|
|
@@ -156,6 +174,24 @@ const resetQuery = (formEl: FormInstance | undefined) => {
|
|
|
statisticalTimeRef.value.reset();
|
|
|
queryList();
|
|
|
};
|
|
|
+// 查看详情
|
|
|
+const router = useRouter();
|
|
|
+const linkDetail = (scope: any) => {
|
|
|
+ const columnKey = Object.keys(scope.row).find((item) => item === scope.column.property);
|
|
|
+ const startTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
|
|
|
+ const endTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
|
|
|
+
|
|
|
+ router.push({
|
|
|
+ path: '/statistics/order/detailHotspotArea',
|
|
|
+ query: {
|
|
|
+ StartTime: requestParams.value.StartTime,
|
|
|
+ EndTime: requestParams.value.EndTime,
|
|
|
+ HotspotCode: row.hotspotCode,
|
|
|
+ tagsViewName: `热点类型部门统计明细`,
|
|
|
+ type: 'orgHotspot',
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
onMounted(() => {
|
|
|
queryList();
|
|
|
});
|