eventClass.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <div class="judicial-statistics-event-calss-container layout-pd">
  3. <!-- 搜索 -->
  4. <el-card shadow="never">
  5. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
  6. <el-form-item prop="AreaCode" label="区域">
  7. <el-select v-model="state.AreaCode" placeholder="请选择区域" @change="handleQuery" clearable>
  8. <el-option :label="item.areaName" :value="item.id" v-for="item in areaOptions" :key="item.id" />
  9. </el-select>
  10. </el-form-item>
  11. <el-form-item prop="crTime" label="生成时间">
  12. <el-date-picker
  13. v-model="state.queryParams.crTime"
  14. type="datetimerange"
  15. unlink-panels
  16. range-separator="至"
  17. start-placeholder="开始时间"
  18. end-placeholder="结束时间"
  19. :shortcuts="shortcuts"
  20. @change="handleQuery"
  21. value-format="YYYY-MM-DD[T]HH:mm:ss"
  22. :default-time="defaultTimeStartEnd"
  23. :clearable="false"
  24. />
  25. </el-form-item>
  26. <el-form-item>
  27. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  28. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  29. <SvgIcon name="ele-Refresh" class="mr5" />重置
  30. </el-button>
  31. </el-form-item>
  32. </el-form>
  33. </el-card>
  34. <el-row :gutter="20">
  35. <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
  36. <el-card shadow="never" v-loading="state.loading" class="statistics-item">
  37. <el-statistic :value="state.orderCount.theClueIsTrue">
  38. <template #title>
  39. <span class="color-info font14">线索属实</span>
  40. </template>
  41. </el-statistic>
  42. </el-card>
  43. </el-col>
  44. <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
  45. <el-card shadow="never" v-loading="state.loading" class="statistics-item">
  46. <el-statistic :value="state.orderCount.theClueIsNotTrue">
  47. <template #title>
  48. <span class="color-info font14">线索不属实</span>
  49. </template>
  50. </el-statistic>
  51. </el-card>
  52. </el-col>
  53. <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
  54. <el-card shadow="never" v-loading="state.loading" class="statistics-item">
  55. <el-statistic :value="state.orderCount.enforcementOrder">
  56. <template #title>
  57. <span class="color-info font14">行政执法工单</span>
  58. </template>
  59. </el-statistic>
  60. </el-card>
  61. </el-col>
  62. <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
  63. <el-card shadow="never" v-loading="state.loading" class="statistics-item">
  64. <el-statistic :value="state.orderCount.passTheBuckOrder">
  65. <template #title>
  66. <span class="color-info font14">推诿工单</span>
  67. </template>
  68. </el-statistic>
  69. </el-card>
  70. </el-col>
  71. <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
  72. <el-card shadow="never" v-loading="state.loading" class="statistics-item">
  73. <el-statistic :value="state.orderCount.toBeVerified">
  74. <template #title>
  75. <span class="color-info font14">待核实</span>
  76. </template>
  77. </el-statistic>
  78. </el-card>
  79. </el-col>
  80. </el-row>
  81. <el-card shadow="never">
  82. <ProTable
  83. ref="proTableRef"
  84. :columns="columns"
  85. :data="state.tableData"
  86. @updateTable="queryList"
  87. :loading="state.loading"
  88. border
  89. :pagination="false"
  90. lazy
  91. :load="load"
  92. :tree-props="{ children: 'children', hasChildren: 'sublevel' }"
  93. show-summary
  94. row-key="id"
  95. >
  96. </ProTable>
  97. </el-card>
  98. </div>
  99. </template>
  100. <script setup lang="tsx" name="judicialStatisticsEventClass">
  101. import { onMounted, reactive, ref } from 'vue';
  102. import { FormInstance } from 'element-plus';
  103. import { defaultDateTime, defaultTimeStartEnd, shortcuts } from '@/utils/constants';
  104. import { eventStatistics, getAreaChildren } from '@/api/judicial';
  105. import { useRouter } from 'vue-router';
  106. const columns = ref<any>([
  107. { prop: 'name', label: '事项类型' },
  108. {
  109. prop: 'num',
  110. label: '工单总量',
  111. width: 120,
  112. render: (scope) => {
  113. return (
  114. <el-button type="primary" link onClick={() => linkDetail(scope.row)}>
  115. {scope.row.num}
  116. </el-button>
  117. );
  118. },
  119. },
  120. ]); // 表头
  121. // 定义变量内容
  122. const ruleFormRef = ref<RefType>(); // 表单ref
  123. const state = reactive<any>({
  124. queryParams: {
  125. // 查询条件
  126. AreaCode: null,
  127. crTime: defaultDateTime, // 时间默认今天开始到今天结束
  128. },
  129. tableData: [], //表单
  130. loading: false, // 加载
  131. totalCount: {},
  132. orderCount: {
  133. theClueIsTrue: 0,
  134. theClueIsNotTrue: 0,
  135. enforcementOrder: 0,
  136. passTheBuckOrder: 0,
  137. toBeVerified: 0,
  138. },
  139. AreaCode: null,
  140. });
  141. /** 搜索按钮操作 */
  142. const handleQuery = () => {
  143. // state.queryParams.PageIndex = 1;
  144. state.tableData = [];
  145. queryList();
  146. };
  147. /** 获取列表 */
  148. const queryList = () => {
  149. state.loading = true;
  150. const StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  151. const EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  152. const request = {
  153. StartTime,
  154. EndTime,
  155. AreaCode: state.AreaCode,
  156. };
  157. state.tableData = [];
  158. eventStatistics(request)
  159. .then((res: any) => {
  160. state.tableData = res.result.list;
  161. state.orderCount = res.result.orderCount;
  162. state.totalCount = res.result.total;
  163. state.loading = false;
  164. })
  165. .catch(() => {
  166. state.loading = false;
  167. });
  168. };
  169. /** 重置按钮操作 */
  170. const resetQuery = (formEl: FormInstance | undefined) => {
  171. if (!formEl) return;
  172. formEl.resetFields();
  173. state.AreaCode = null;
  174. queryList();
  175. };
  176. // 懒加载
  177. const load = (row: any, treeNode: unknown, resolve: (date: any[]) => void) => {
  178. const StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  179. const EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  180. const request = {
  181. StartTime,
  182. EndTime,
  183. AreaCode: state.AreaCode,
  184. Id: row.id,
  185. };
  186. eventStatistics(request)
  187. .then((res: any) => {
  188. state.totalCount = res.result.total;
  189. state.orderCount = res.result.orderCount;
  190. resolve(res.result?.list ?? []);
  191. })
  192. .catch(() => {});
  193. };
  194. const areaOptions = ref<any>([]);
  195. const getBaseData = async () => {
  196. try {
  197. const res = await getAreaChildren();
  198. areaOptions.value = res.result ?? [];
  199. } catch (e) {
  200. console.log(e);
  201. }
  202. };
  203. // 查看详情
  204. const router = useRouter();
  205. const linkDetail = (row: any) => {
  206. const StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  207. const EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  208. router.push({
  209. name: 'judicialDetailEventClass',
  210. query: {
  211. StartTime,
  212. EndTime,
  213. AreaCode: state.AreaCode,
  214. EventTypeId: row.id,
  215. },
  216. });
  217. };
  218. onMounted(() => {
  219. getBaseData();
  220. queryList();
  221. });
  222. </script>
  223. <style lang="scss" scoped>
  224. .statistics-item {
  225. margin-bottom: 10px;
  226. }
  227. :deep(.el-statistic__content) {
  228. font-size: 32px;
  229. font-weight: bold;
  230. margin-top: 15px;
  231. }
  232. </style>