handleOrder.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <div class="snapshot-statistics-handle-order-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <vxe-grid v-bind="gridOptions" ref="gridRef">
  5. <template #form>
  6. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline :disabled="gridOptions.loading">
  7. <el-form-item prop="crTime">
  8. <statistical-time v-model="state.queryParams.crTime" @change="handleQuery" ref="statisticalTimeRef" :disabled="state.loading" />
  9. </el-form-item>
  10. <el-form-item label="行业" prop="IndustryId">
  11. <el-select v-model="state.queryParams.IndustryId" class="w100" placeholder="请选择行业" @change="queryList" clearable>
  12. <el-option v-for="item in industry" :key="item.id" :label="item.name" :value="item.id" />
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item>
  16. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  17. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  18. <SvgIcon name="ele-Refresh" class="mr5" />重置
  19. </el-button>
  20. </el-form-item>
  21. </el-form>
  22. </template>
  23. </vxe-grid>
  24. </div>
  25. </div>
  26. </template>
  27. <script lang="tsx" setup name="snapshotStatisticsHandleOrder">
  28. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  29. import { FormInstance } from 'element-plus';
  30. import { defaultDate } from '@/utils/constants';
  31. import { getGridReplyCount } from '@/api/snapshot/statistics';
  32. import Other from '@/utils/other';
  33. // 引入组件
  34. const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
  35. // 定义变量内容
  36. const state = reactive<any>({
  37. loading: false,
  38. queryParams: {
  39. // 查询参数
  40. crTime: defaultDate, // 时间默认今天开始到今天结束
  41. StartTime: null,
  42. EndTime: null,
  43. IndustryId:null,
  44. },
  45. total: 0, // 总条数
  46. });
  47. const gridOptions = reactive<any>({
  48. loading: false,
  49. border: true,
  50. showOverflow: true,
  51. columnConfig: {
  52. resizable: true,
  53. },
  54. scrollY: {
  55. enabled: true,
  56. gt: 100,
  57. },
  58. toolbarConfig: {
  59. zoom: true,
  60. custom: true,
  61. refresh: {
  62. queryMethod: () => {
  63. handleQuery();
  64. },
  65. },
  66. },
  67. customConfig: {
  68. storage: true,
  69. },
  70. id: 'snapshotStatisticsHandleOrder',
  71. rowConfig: { isHover: true, height: 30, isCurrent: true, useKey: true },
  72. height: 'auto',
  73. columns: [
  74. {
  75. field: 'no',
  76. title: '部门名称',
  77. width: 200,
  78. fixed: 'left',
  79. },
  80. {
  81. field: 'no',
  82. title: '信件总量',
  83. width: 100,
  84. fixed: 'left',
  85. },
  86. {
  87. field: 'county',
  88. title: '已办件数',
  89. width: 100,
  90. slots: {
  91. default({ row }) {
  92. return (
  93. <el-button type="primary" onClick={() => linkDetail(row)} link>
  94. {row.sumCount}
  95. </el-button>
  96. );
  97. },
  98. },
  99. },
  100. {
  101. field: 'county',
  102. title: '在办件数',
  103. width: 100,
  104. slots: {
  105. default({ row }) {
  106. return (
  107. <el-button type="primary" onClick={() => linkDetail(row)} link>
  108. {row.sumCount}
  109. </el-button>
  110. );
  111. },
  112. },
  113. },
  114. {
  115. field: 'no',
  116. title: '办结率',
  117. width: 100,
  118. },
  119. {
  120. field: 'county',
  121. title: '20分钟内接件',
  122. width: 120,
  123. slots: {
  124. default({ row }) {
  125. return (
  126. <el-button type="primary" onClick={() => linkDetail(row)} link>
  127. {row.sumCount}
  128. </el-button>
  129. );
  130. },
  131. },
  132. },
  133. {
  134. field: 'county',
  135. title: '20分钟后接件',
  136. width: 120,
  137. slots: {
  138. default({ row }) {
  139. return (
  140. <el-button type="primary" onClick={() => linkDetail(row)} link>
  141. {row.sumCount}
  142. </el-button>
  143. );
  144. },
  145. },
  146. },
  147. {
  148. field: 'no',
  149. title: '工单及时响应率',
  150. width: 120,
  151. },
  152. {
  153. field: 'no',
  154. title: '退回件',
  155. width: 100,
  156. slots: {
  157. default({ row }) {
  158. return (
  159. <el-button type="primary" onClick={() => linkDetail(row)} link>
  160. {row.sumCount}
  161. </el-button>
  162. );
  163. },
  164. },
  165. },
  166. {
  167. field: 'no',
  168. title: '办件总时长(小时)',
  169. width: 140,
  170. },
  171. {
  172. field: 'no',
  173. title: '3日内办结',
  174. width: 100,
  175. slots: {
  176. default({ row }) {
  177. return (
  178. <el-button type="primary" onClick={() => linkDetail(row)} link>
  179. {row.sumCount}
  180. </el-button>
  181. );
  182. },
  183. },
  184. },
  185. {
  186. field: 'no',
  187. title: '3至5日办结',
  188. width: 100,
  189. slots: {
  190. default({ row }) {
  191. return (
  192. <el-button type="primary" onClick={() => linkDetail(row)} link>
  193. {row.sumCount}
  194. </el-button>
  195. );
  196. },
  197. },
  198. },
  199. {
  200. field: 'no',
  201. title: '5至7日办结',
  202. width: 100,
  203. slots: {
  204. default({ row }) {
  205. return (
  206. <el-button type="primary" onClick={() => linkDetail(row)} link>
  207. {row.sumCount}
  208. </el-button>
  209. );
  210. },
  211. },
  212. },
  213. {
  214. field: 'no',
  215. title: '7日外办结',
  216. width: 100,
  217. slots: {
  218. default({ row }) {
  219. return (
  220. <el-button type="primary" onClick={() => linkDetail(row)} link>
  221. {row.sumCount}
  222. </el-button>
  223. );
  224. },
  225. },
  226. },
  227. {
  228. field: 'no',
  229. title: '按时办结率',
  230. width: 100,
  231. },
  232. {
  233. field: 'no',
  234. title: '满意量',
  235. width: 100,
  236. slots: {
  237. default({ row }) {
  238. return (
  239. <el-button type="primary" onClick={() => linkDetail(row)} link>
  240. {row.sumCount}
  241. </el-button>
  242. );
  243. },
  244. },
  245. },
  246. {
  247. field: 'no',
  248. title: '不满意量',
  249. width: 100,
  250. slots: {
  251. default({ row }) {
  252. return (
  253. <el-button type="primary" onClick={() => linkDetail(row)} link>
  254. {row.sumCount}
  255. </el-button>
  256. );
  257. },
  258. },
  259. },
  260. {
  261. field: 'no',
  262. title: '满意率',
  263. width: 100,
  264. },
  265. {
  266. field: 'no',
  267. title: '二次办理',
  268. width: 100,
  269. slots: {
  270. default({ row }) {
  271. return (
  272. <el-button type="primary" onClick={() => linkDetail(row)} link>
  273. {row.sumCount}
  274. </el-button>
  275. );
  276. },
  277. },
  278. },
  279. ],
  280. data: [],
  281. });
  282. /** 搜索按钮操作 节流操作 */
  283. const handleQuery = () => {
  284. state.queryParams.PageIndex = 1;
  285. queryList();
  286. };
  287. const requestParams = ref<EmptyObjectType>({});
  288. // 获取参数列表
  289. const queryList = () => {
  290. state.loading = true;
  291. gridOptions.loading = true;
  292. requestParams.value = Other.deepClone(state.queryParams);
  293. requestParams.value.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0]; // 受理时间
  294. requestParams.value.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  295. Reflect.deleteProperty(requestParams.value, 'crTime'); // 删除无用的参数
  296. getGridReplyCount(requestParams.value)
  297. .then((res) => {
  298. state.loading = false;
  299. gridOptions.data = res.result.items ?? [];
  300. state.total = res.result.total ?? 0;
  301. gridOptions.loading = false;
  302. })
  303. .finally(() => {
  304. state.loading = false;
  305. gridOptions.loading = false;
  306. });
  307. };
  308. // 重置表单
  309. const ruleFormRef = ref<any>(null); // 表单ref
  310. const statisticalTimeRef = ref<RefType>();
  311. const resetQuery = (formEl: FormInstance | undefined) => {
  312. if (!formEl) return;
  313. formEl.resetFields();
  314. statisticalTimeRef.value.reset();
  315. queryList();
  316. };
  317. // 跳转详情
  318. const linkDetail = (row: any) => {};
  319. const industry = ref<EmptyArrayType>([]);
  320. // 页面加载时
  321. onMounted(() => {
  322. queryList();
  323. });
  324. </script>