handle.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. <template>
  2. <div class="statistics-department-handle-container layout-pd">
  3. <el-card shadow="never">
  4. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
  5. <el-form-item label="来电主体" prop="TypeId">
  6. <el-select v-model="state.queryParams.TypeId" placeholder="请选择来电主体" @change="handleQuery">
  7. <el-option :value="0" label="全部" />
  8. <el-option :value="1" label="市民" />
  9. <el-option :value="2" label="企业" />
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item label="部门名称" prop="OrgName">
  13. <el-input v-model="state.queryParams.OrgName" placeholder="部门名称" clearable @keyup.enter="handleQuery" class="keyword-input" />
  14. </el-form-item>
  15. <el-form-item label="时间段" prop="crTime">
  16. <el-date-picker
  17. v-model="state.queryParams.crTime"
  18. type="daterange"
  19. unlink-panels
  20. range-separator="至"
  21. start-placeholder="开始时间"
  22. end-placeholder="结束时间"
  23. :shortcuts="shortcuts"
  24. @change="handleQuery"
  25. value-format="YYYY-MM-DD"
  26. :clearable="false"
  27. />
  28. </el-form-item>
  29. <el-form-item label="" prop="isProvince">
  30. <el-checkbox v-model="state.queryParams.isProvince" label="省来源" border @change="handleQuery" />
  31. </el-form-item>
  32. <el-form-item>
  33. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  34. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  35. <SvgIcon name="ele-Refresh" class="mr5" />重置
  36. </el-button>
  37. <el-button type="primary" @click="onDetailList" :loading="state.loading"> <SvgIcon name="ele-List" class="mr5" /> 列表明细 </el-button>
  38. </el-form-item>
  39. </el-form>
  40. </el-card>
  41. <el-card shadow="never">
  42. <ProTable
  43. ref="proTableRef"
  44. :pagination="false"
  45. :columns="columns"
  46. :data="state.tableData"
  47. @updateTable="queryList"
  48. :loading="state.loading"
  49. show-summary
  50. :summary-method="getSummaries"
  51. :toolButton="['refresh', 'setting', 'exportAll']"
  52. :exportMethod="departmentOrderExport"
  53. :exportParams="requestParams"
  54. >
  55. </ProTable>
  56. </el-card>
  57. </div>
  58. </template>
  59. <script setup lang="tsx" name="statisticsDepartmentHandle">
  60. import { onMounted, reactive, ref } from 'vue';
  61. import { FormInstance } from 'element-plus';
  62. import { departmentOrder, departmentOrderExport } from '@/api/statistics/department';
  63. import { defaultDate, shortcuts } from '@/utils/constants';
  64. import { useRouter } from 'vue-router';
  65. import Other from '@/utils/other';
  66. // 定义变量内容
  67. const ruleFormRef = ref<RefType>(); // 表单ref
  68. // ProTable 实例
  69. const proTableRef = ref<RefType>();
  70. // 表格配置项
  71. const columns = reactive<any[]>([
  72. {
  73. prop: 'orgName',
  74. label: '部门名称',
  75. align: 'center',
  76. fixed: 'left',
  77. minWidth: 200,
  78. render: (scope) => {
  79. return (
  80. <el-button type="primary" link onClick={() => linkDetail(scope)}>
  81. {scope.row.orgName}
  82. </el-button>
  83. );
  84. },
  85. },
  86. { prop: 'orgTypeText', label: '部门类别', align: 'center', fixed: 'left', minWidth: 100 },
  87. { prop: 'orderCountNum', label: '信件总量', align: 'center', fixed: 'left', minWidth: 90 },
  88. {
  89. prop: 'bjxx',
  90. label: '办件信息',
  91. align: 'center',
  92. _children: [
  93. {
  94. prop: 'ybOrderCountNum',
  95. label: '已办案件',
  96. align: 'center',
  97. minWidth: 90,
  98. render: (scope) => {
  99. return (
  100. <el-button type="primary" link onClick={() => linkDetail(scope, '0')}>
  101. {scope.row.ybOrderCountNum}
  102. </el-button>
  103. );
  104. },
  105. },
  106. {
  107. prop: 'zbOrderCountNum',
  108. label: '在办案件',
  109. align: 'center',
  110. minWidth: 90,
  111. render: (scope) => {
  112. return (
  113. <el-button type="primary" link onClick={() => linkDetail(scope, '1')}>
  114. {scope.row.zbOrderCountNum}
  115. </el-button>
  116. );
  117. },
  118. },
  119. {
  120. prop: 'orderCompletionRate',
  121. label: '办结率',
  122. align: 'center',
  123. minWidth: 90,
  124. },
  125. {
  126. prop: 'completeOnTimeRate',
  127. label: '按时办结率',
  128. align: 'center',
  129. minWidth: 120,
  130. },
  131. ],
  132. },
  133. {
  134. prop: 'yqcs',
  135. label: '延期次数',
  136. align: 'center',
  137. _children: [
  138. {
  139. prop: 'orderDelayCount',
  140. label: '延期次数',
  141. align: 'center',
  142. minWidth: 90,
  143. render: (scope) => {
  144. return (
  145. <el-button type="primary" link onClick={() => linkDetail(scope, '2')}>
  146. {scope.row.orderDelayCount}
  147. </el-button>
  148. );
  149. },
  150. },
  151. {
  152. prop: 'orderDelayRate',
  153. label: '延期率',
  154. align: 'center',
  155. minWidth: 90,
  156. },
  157. ],
  158. },
  159. {
  160. prop: 'cqxx',
  161. label: '超期信息',
  162. align: 'center',
  163. _children: [
  164. {
  165. prop: 'ybOverdue',
  166. label: '已办超期',
  167. align: 'center',
  168. minWidth: 90,
  169. render: (scope) => {
  170. return (
  171. <el-button type="primary" link onClick={() => linkDetail(scope, '3')}>
  172. {scope.row.ybOverdue}
  173. </el-button>
  174. );
  175. },
  176. },
  177. {
  178. prop: 'zbOverdue',
  179. label: '待办超期',
  180. align: 'center',
  181. minWidth: 90,
  182. render: (scope) => {
  183. return (
  184. <el-button type="primary" link onClick={() => linkDetail(scope, '4')}>
  185. {scope.row.zbOverdue}
  186. </el-button>
  187. );
  188. },
  189. },
  190. {
  191. prop: 'hqybOverdue',
  192. label: '会签已办超期',
  193. align: 'center',
  194. minWidth: 120,
  195. render: (scope) => {
  196. return (
  197. <el-button type="primary" link onClick={() => linkDetail(scope, '5')}>
  198. {scope.row.hqybOverdue}
  199. </el-button>
  200. );
  201. },
  202. },
  203. {
  204. prop: 'hqzbOverdue',
  205. label: '会签待办超期',
  206. align: 'center',
  207. minWidth: 120,
  208. render: (scope) => {
  209. return (
  210. <el-button type="primary" link onClick={() => linkDetail(scope, '6')}>
  211. {scope.row.hqzbOverdue}
  212. </el-button>
  213. );
  214. },
  215. },
  216. {
  217. prop: 'subtotalOverdue',
  218. label: '超期件数',
  219. align: 'center',
  220. minWidth: 120,
  221. render: (scope) => {
  222. return (
  223. <el-button type="primary" link onClick={() => linkDetail(scope, '7')}>
  224. {scope.row.subtotalOverdue}
  225. </el-button>
  226. );
  227. },
  228. },
  229. {
  230. prop: 'hqOverdueRate',
  231. label: '超期率',
  232. align: 'center',
  233. minWidth: 90,
  234. },
  235. ],
  236. },
  237. {
  238. prop: 'hqxx',
  239. label: '会签信息',
  240. align: 'center',
  241. _children: [
  242. {
  243. prop: 'delayWait',
  244. label: '会签待办',
  245. align: 'center',
  246. minWidth: 90,
  247. render: (scope) => {
  248. return (
  249. <el-button type="primary" link onClick={() => linkDetail(scope, '9')}>
  250. {scope.row.delayWait}
  251. </el-button>
  252. );
  253. },
  254. },
  255. {
  256. prop: 'delayEnd',
  257. label: '会签已办',
  258. align: 'center',
  259. minWidth: 90,
  260. render: (scope) => {
  261. return (
  262. <el-button type="primary" link onClick={() => linkDetail(scope, '8')}>
  263. {scope.row.delayEnd}
  264. </el-button>
  265. );
  266. },
  267. },
  268. ],
  269. },
  270. {
  271. prop: 'gdxx',
  272. label: '归档信息',
  273. align: 'center',
  274. _children: [
  275. {
  276. prop: 'toBeArchived',
  277. label: '待归档',
  278. align: 'center',
  279. minWidth: 90,
  280. render: (scope) => {
  281. return (
  282. <el-button type="primary" link onClick={() => linkDetail(scope, '10')}>
  283. {scope.row.toBeArchived}
  284. </el-button>
  285. );
  286. },
  287. },
  288. {
  289. prop: 'archived',
  290. label: '已归档',
  291. align: 'center',
  292. minWidth: 90,
  293. render: (scope) => {
  294. return (
  295. <el-button type="primary" link onClick={() => linkDetail(scope, '11')}>
  296. {scope.row.archived}
  297. </el-button>
  298. );
  299. },
  300. },
  301. ],
  302. },
  303. {
  304. prop: 'fbxx',
  305. label: '发布信息',
  306. align: 'center',
  307. _children: [
  308. {
  309. prop: 'waitPublished',
  310. label: '待发布',
  311. align: 'center',
  312. minWidth: 90,
  313. render: (scope) => {
  314. return (
  315. <el-button type="primary" link onClick={() => linkDetail(scope, '12')}>
  316. {scope.row.waitPublished}
  317. </el-button>
  318. );
  319. },
  320. },
  321. {
  322. prop: 'publishedOpen',
  323. label: '公开件',
  324. align: 'center',
  325. minWidth: 90,
  326. render: (scope) => {
  327. return (
  328. <el-button type="primary" link onClick={() => linkDetail(scope, '13')}>
  329. {scope.row.publishedOpen}
  330. </el-button>
  331. );
  332. },
  333. },
  334. {
  335. prop: 'publishedNoOpen',
  336. label: '不公开件',
  337. align: 'center',
  338. minWidth: 90,
  339. render: (scope) => {
  340. return (
  341. <el-button type="primary" link onClick={() => linkDetail(scope, '14')}>
  342. {scope.row.publishedNoOpen}
  343. </el-button>
  344. );
  345. },
  346. },
  347. ],
  348. },
  349. {
  350. prop: 'zbj',
  351. label: '甄别件',
  352. align: 'center',
  353. _children: [
  354. {
  355. prop: 'screenCount',
  356. label: '申请总量',
  357. align: 'center',
  358. minWidth: 90,
  359. render: (scope) => {
  360. return (
  361. <el-button type="primary" link onClick={() => linkDetail(scope, '15')}>
  362. {scope.row.screenCount}
  363. </el-button>
  364. );
  365. },
  366. },
  367. {
  368. prop: 'screenApproval',
  369. label: '待甄别',
  370. align: 'center',
  371. minWidth: 90,
  372. render: (scope) => {
  373. return (
  374. <el-button type="primary" link onClick={() => linkDetail(scope, '16')}>
  375. {scope.row.screenApproval}
  376. </el-button>
  377. );
  378. },
  379. },
  380. {
  381. prop: 'screenNotPass',
  382. label: '未同意',
  383. align: 'center',
  384. minWidth: 90,
  385. render: (scope) => {
  386. return (
  387. <el-button type="primary" link onClick={() => linkDetail(scope, '18')}>
  388. {scope.row.screenNotPass}
  389. </el-button>
  390. );
  391. },
  392. },
  393. {
  394. prop: 'screenPass',
  395. label: '已同意',
  396. align: 'center',
  397. minWidth: 90,
  398. render: (scope) => {
  399. return (
  400. <el-button type="primary" link onClick={() => linkDetail(scope, '17')}>
  401. {scope.row.screenPass}
  402. </el-button>
  403. );
  404. },
  405. },
  406. ],
  407. },
  408. {
  409. prop: 'satisfactionRate',
  410. label: '总满意率',
  411. align: 'center',
  412. minWidth: 90,
  413. },
  414. ]);
  415. const state = reactive<any>({
  416. queryParams: {
  417. // 查询条件
  418. OrgName: null, // 部门名称
  419. crTime: defaultDate, // 时间默认今天开始到今天结束
  420. isProvince: null,
  421. TypeId:0
  422. },
  423. tableData: [], //表单
  424. loading: false, // 加载
  425. totalCount: 0, // 总计
  426. IdentityType:0,
  427. });
  428. /** 搜索按钮操作 */
  429. const handleQuery = () => {
  430. // state.queryParams.PageIndex = 1;
  431. queryList();
  432. };
  433. /** 获取列表 */
  434. const requestParams = ref({});
  435. const queryList = () => {
  436. state.loading = true;
  437. requestParams.value = Other.deepClone(state.queryParams);
  438. requestParams.value.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  439. requestParams.value.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  440. Reflect.deleteProperty(requestParams.value, 'crTime');
  441. departmentOrder(requestParams.value)
  442. .then((res: any) => {
  443. state.tableData = res.result?.list ?? [];
  444. state.totalCount = res.result?.total;
  445. state.loading = false;
  446. })
  447. .catch(() => {
  448. state.loading = false;
  449. });
  450. };
  451. /** 重置按钮操作 */
  452. const resetQuery = (formEl: FormInstance | undefined) => {
  453. if (!formEl) return;
  454. formEl.resetFields();
  455. queryList();
  456. };
  457. // 合计
  458. const getSummaries = (param: any) => {
  459. const { columns } = param;
  460. const sums: string[] = [];
  461. columns.forEach((column: { property: string }, index: number) => {
  462. if (index === 0) {
  463. sums[index] = '合计';
  464. return;
  465. }
  466. switch (column.property) {
  467. case 'orgTypeText': // 部门类别
  468. sums[index] = state.totalCount?.orgTypeText;
  469. break;
  470. case 'orderCountNum': // 信件总量
  471. sums[index] = state.totalCount?.orderCountNum;
  472. break;
  473. case 'ybOrderCountNum': // 已办案件
  474. sums[index] = state.totalCount?.ybOrderCountNum;
  475. break;
  476. case 'zbOrderCountNum': // 在办案件
  477. sums[index] = state.totalCount?.zbOrderCountNum;
  478. break;
  479. case 'completeOnTimeRate': // 按时办结率
  480. sums[index] = state.totalCount?.completeOnTimeRate;
  481. break;
  482. case 'orderCompletionRate': // 办结率
  483. sums[index] = state.totalCount?.orderCompletionRate;
  484. break;
  485. case 'orderDelayCount': // 延期次数
  486. sums[index] = state.totalCount?.orderDelayCount;
  487. break;
  488. case 'orderDelayRate': // 延期率
  489. sums[index] = state.totalCount?.orderDelayRate;
  490. break;
  491. case 'ybOverdue': // 已办超期
  492. sums[index] = state.totalCount?.ybOverdue;
  493. break;
  494. case 'zbOverdue': // 待办超期
  495. sums[index] = state.totalCount?.zbOverdue;
  496. break;
  497. case 'hqybOverdue': // 会签已办超期
  498. sums[index] = state.totalCount?.hqybOverdue;
  499. break;
  500. case 'hqzbOverdue': // 会签待办超期
  501. sums[index] = state.totalCount?.hqzbOverdue;
  502. break;
  503. case 'subtotalOverdue': // 超期件数
  504. sums[index] = state.totalCount?.subtotalOverdue;
  505. break;
  506. case 'hqOverdueRate': // 超期率
  507. sums[index] = state.totalCount?.hqOverdueRate;
  508. break;
  509. case 'delayWait': // 会签待办
  510. sums[index] = state.totalCount?.delayWait;
  511. break;
  512. case 'delayEnd': // 会签已办
  513. sums[index] = state.totalCount?.delayEnd;
  514. break;
  515. case 'toBeArchived': // 待归档
  516. sums[index] = state.totalCount?.toBeArchived;
  517. break;
  518. case 'archived': // 已归档
  519. sums[index] = state.totalCount?.archived;
  520. break;
  521. case 'waitPublished': // 待发布
  522. sums[index] = state.totalCount?.waitPublished;
  523. break;
  524. case 'publishedOpen': // 公开件
  525. sums[index] = state.totalCount?.publishedOpen;
  526. break;
  527. case 'publishedNoOpen': // 不公开件
  528. sums[index] = state.totalCount?.publishedNoOpen;
  529. break;
  530. case 'screenCount': // 甄别申请总量
  531. sums[index] = state.totalCount?.screenCount;
  532. break;
  533. case 'screenApproval': // 待甄别
  534. sums[index] = state.totalCount?.screenApproval;
  535. break;
  536. case 'screenNotPass': // 未同意
  537. sums[index] = state.totalCount?.screenNotPass;
  538. break;
  539. case 'screenPass': // 已同意
  540. sums[index] = state.totalCount?.screenPass;
  541. break;
  542. case 'satisfactionRate': // 总满意率
  543. sums[index] = state.totalCount?.satisfactionRate;
  544. break;
  545. default:
  546. sums[index] = '';
  547. break;
  548. }
  549. });
  550. return sums;
  551. };
  552. // 查看详情
  553. const router = useRouter();
  554. const linkDetail = (scope, key?: string) => {
  555. let StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  556. let EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  557. if (key) {
  558. // 点击数字
  559. router.push({
  560. name: 'statisticsDepartmentDetailHandle',
  561. query: {
  562. StartTime,
  563. EndTime,
  564. OrgCode: scope.row.orgCode,
  565. StatisticsType: key,
  566. isProvince: state.queryParams.isProvince,
  567. },
  568. });
  569. } else {
  570. // 点击部门
  571. router.push({
  572. name: 'statisticsDepartmentDetailHandleOrg',
  573. query: {
  574. StartTime,
  575. EndTime,
  576. isProvince: state.queryParams.isProvince,
  577. id: scope.row.orgCode,
  578. },
  579. });
  580. }
  581. };
  582. // 跳转列表明细
  583. const onDetailList = () => {
  584. router.push({
  585. path: '/statistics/department/detailHandleList',
  586. });
  587. };
  588. onMounted(() => {
  589. queryList();
  590. });
  591. </script>