123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- <template>
- <div class="judicial-statistics-event-calss-container layout-pd">
- <!-- 搜索 -->
- <el-card shadow="never">
- <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
- <el-form-item prop="AreaCode" label="区域">
- <el-select v-model="state.AreaCode" placeholder="请选择区域" @change="handleQuery" clearable>
- <el-option :label="item.areaName" :value="item.id" v-for="item in areaOptions" :key="item.id" />
- </el-select>
- </el-form-item>
- <el-form-item prop="crTime" label="生成时间">
- <el-date-picker
- v-model="state.queryParams.crTime"
- type="datetimerange"
- unlink-panels
- range-separator="至"
- start-placeholder="开始时间"
- end-placeholder="结束时间"
- :shortcuts="shortcuts"
- @change="handleQuery"
- value-format="YYYY-MM-DD[T]HH:mm:ss"
- :default-time="defaultTimeStartEnd"
- :clearable="false"
- />
- </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>
- </el-card>
- <el-row :gutter="20">
- <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
- <el-card shadow="never" v-loading="state.loading" class="statistics-item">
- <el-statistic :value="state.orderCount.theClueIsTrue">
- <template #title>
- <span class="color-info font14">线索属实</span>
- </template>
- </el-statistic>
- </el-card>
- </el-col>
- <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
- <el-card shadow="never" v-loading="state.loading" class="statistics-item">
- <el-statistic :value="state.orderCount.theClueIsNotTrue">
- <template #title>
- <span class="color-info font14">线索不属实</span>
- </template>
- </el-statistic>
- </el-card>
- </el-col>
- <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
- <el-card shadow="never" v-loading="state.loading" class="statistics-item">
- <el-statistic :value="state.orderCount.enforcementOrder">
- <template #title>
- <span class="color-info font14">行政执法工单</span>
- </template>
- </el-statistic>
- </el-card>
- </el-col>
- <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
- <el-card shadow="never" v-loading="state.loading" class="statistics-item">
- <el-statistic :value="state.orderCount.passTheBuckOrder">
- <template #title>
- <span class="color-info font14">推诿工单</span>
- </template>
- </el-statistic>
- </el-card>
- </el-col>
- <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
- <el-card shadow="never" v-loading="state.loading" class="statistics-item">
- <el-statistic :value="state.orderCount.toBeVerified">
- <template #title>
- <span class="color-info font14">待核实</span>
- </template>
- </el-statistic>
- </el-card>
- </el-col>
- </el-row>
- <el-card shadow="never">
- <ProTable
- ref="proTableRef"
- :columns="columns"
- :data="state.tableData"
- @updateTable="queryList"
- :loading="state.loading"
- border
- :pagination="false"
- lazy
- :load="load"
- :tree-props="{ children: 'children', hasChildren: 'sublevel' }"
- show-summary
- row-key="id"
- >
- </ProTable>
- </el-card>
- </div>
- </template>
- <script setup lang="tsx" name="judicialStatisticsEventClass">
- import { onMounted, reactive, ref } from 'vue';
- import { FormInstance } from 'element-plus';
- import { defaultDateTime, defaultTimeStartEnd, shortcuts } from '@/utils/constants';
- import { eventStatistics, getAreaChildren } from '@/api/judicial';
- import { useRouter } from 'vue-router';
- const columns = ref<any>([
- { prop: 'name', label: '事项类型' },
- {
- prop: 'num',
- label: '工单总量',
- width: 120,
- render: (scope) => {
- return (
- <el-button type="primary" link onClick={() => linkDetail(scope.row)}>
- {scope.row.num}
- </el-button>
- );
- },
- },
- ]); // 表头
- // 定义变量内容
- const ruleFormRef = ref<RefType>(); // 表单ref
- const state = reactive<any>({
- queryParams: {
- // 查询条件
- AreaCode: null,
- crTime: defaultDateTime, // 时间默认今天开始到今天结束
- },
- tableData: [], //表单
- loading: false, // 加载
- totalCount: {},
- orderCount: {
- theClueIsTrue: 0,
- theClueIsNotTrue: 0,
- enforcementOrder: 0,
- passTheBuckOrder: 0,
- toBeVerified: 0,
- },
- AreaCode: null,
- });
- /** 搜索按钮操作 */
- const handleQuery = () => {
- // state.queryParams.PageIndex = 1;
- state.tableData = [];
- queryList();
- };
- /** 获取列表 */
- const queryList = () => {
- state.loading = true;
- const StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
- const EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
- const request = {
- StartTime,
- EndTime,
- AreaCode: state.AreaCode,
- };
- state.tableData = [];
- eventStatistics(request)
- .then((res: any) => {
- state.tableData = res.result.list;
- state.orderCount = res.result.orderCount;
- state.totalCount = res.result.total;
- state.loading = false;
- })
- .catch(() => {
- state.loading = false;
- });
- };
- /** 重置按钮操作 */
- const resetQuery = (formEl: FormInstance | undefined) => {
- if (!formEl) return;
- formEl.resetFields();
- state.AreaCode = null;
- queryList();
- };
- // 懒加载
- const load = (row: any, treeNode: unknown, resolve: (date: any[]) => void) => {
- const StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
- const EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
- const request = {
- StartTime,
- EndTime,
- AreaCode: state.AreaCode,
- Id: row.id,
- };
- eventStatistics(request)
- .then((res: any) => {
- state.totalCount = res.result.total;
- state.orderCount = res.result.orderCount;
- resolve(res.result?.list ?? []);
- })
- .catch(() => {});
- };
- const areaOptions = ref<any>([]);
- const getBaseData = async () => {
- try {
- const res = await getAreaChildren();
- areaOptions.value = res.result ?? [];
- } catch (e) {
- console.log(e);
- }
- };
- // 查看详情
- const router = useRouter();
- const linkDetail = (row: any) => {
- const StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
- const EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
- router.push({
- name: 'judicialDetailEventClass',
- query: {
- StartTime,
- EndTime,
- AreaCode: state.AreaCode,
- EventTypeId: row.id,
- },
- });
- };
- onMounted(() => {
- getBaseData();
- queryList();
- });
- </script>
- <style lang="scss" scoped>
- .statistics-item {
- margin-bottom: 10px;
- }
- :deep(.el-statistic__content) {
- font-size: 32px;
- font-weight: bold;
- margin-top: 15px;
- }
- </style>
|