detailHandleList.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <div class="statistics-department-satisfaction-detail-list-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
  5. <el-form-item prop="crTime">
  6. <statistical-time v-model="state.queryParams.crTime" @change="handleQuery" ref="statisticalTimeRef" :disabled="state.loading" />
  7. </el-form-item>
  8. <el-form-item label="来电主体" prop="TypeId">
  9. <el-select v-model="state.queryParams.TypeId" placeholder="请选择来电主体" @change="handleQuery">
  10. <el-option :value="0" label="全部" />
  11. <el-option :value="1" label="市民" />
  12. <el-option :value="2" label="企业" />
  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. <vxe-toolbar
  23. ref="toolbarRef"
  24. :loading="state.loading"
  25. custom
  26. :refresh="{
  27. queryMethod: handleQuery,
  28. }"
  29. :tools="[{ toolRender: { name: 'exportCurrent' } }, { toolRender: { name: 'exportAll' } }]"
  30. >
  31. <template #buttons>
  32. <el-button type="primary" @click="onJbExport" :disabled="isChecked" :loading="state.loading"
  33. ><SvgIcon name="iconfont icon-daochu" class="mr5" />交办单导出
  34. </el-button>
  35. </template>
  36. </vxe-toolbar>
  37. <div style="overflow: hidden; width: 100%; height: 100%; flex: 1">
  38. <vxe-table
  39. border
  40. :loading="state.loading"
  41. :data="state.tableData"
  42. :column-config="{ resizable: true }"
  43. :row-config="{ isCurrent: true, isHover: true, height: 30,useKey: true }"
  44. ref="tableRef"
  45. height="auto"
  46. auto-resize
  47. show-overflow
  48. :scrollY="{ enabled: true, gt: 100 }"
  49. id="statisticsDepartmentDetailHandleList"
  50. :custom-config="{
  51. storage: true,
  52. }"
  53. showHeaderOverflow
  54. :sort-config="{ remote: true }"
  55. @sort-change="sortChange"
  56. :params="{ exportMethod: departmentOrderListExport, exportParams: requestParams }"
  57. @checkbox-all="selectAllChangeEvent"
  58. @checkbox-change="selectChangeEvent"
  59. >
  60. <vxe-column type="checkbox" width="50" align="center"></vxe-column>
  61. <vxe-column field="expiredStatusText" title="状态" width="60" align="center">
  62. <template #default="{ row }">
  63. <span :class="'overdue-status-' + row.expiredStatus" :title="row.expiredStatusText"></span>
  64. </template>
  65. </vxe-column>
  66. <vxe-column field="no" title="工单编码" width="140"></vxe-column>
  67. <vxe-column field="isProvinceText" title="省/市工单" width="90"></vxe-column>
  68. <vxe-column field="currentStepName" title="当前节点" width="100"></vxe-column>
  69. <vxe-column field="statusText" title="工单状态" width="100">
  70. <template #default="{ row }">
  71. <el-text type="danger" tag="b" v-if="[1, 2, 3, 9, 101, 102, 103, 104, 105, 200].includes(row.status)">{{ row.statusText }}</el-text>
  72. <span v-else>{{ row.statusText }}</span>
  73. </template>
  74. </vxe-column>
  75. <vxe-column field="title" title="工单标题" width="200">
  76. <template #default="{ row }">
  77. <order-detail :order="row" @updateList="queryList(true)">{{ row.title }}</order-detail>
  78. </template>
  79. </vxe-column>
  80. <vxe-column field="creationTime" title="受理时间" width="160" sortable>
  81. <template #default="{ row }">
  82. {{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}
  83. </template>
  84. </vxe-column>
  85. <vxe-column field="expiredTime" title="期满时间" width="160" sortable>
  86. <template #default="{ row }">
  87. {{ formatDate(row.expiredTime, 'YYYY-mm-dd HH:MM:SS') }}
  88. </template>
  89. </vxe-column>
  90. <vxe-column field="filedTime" title="办结时间" width="160" sortable>
  91. <template #default="{ row }">
  92. {{ formatDate(row.filedTime, 'YYYY-mm-dd HH:MM:SS') }}
  93. </template>
  94. </vxe-column>
  95. <vxe-column field="orgLevelOneName" title="一级部门" width="140"></vxe-column>
  96. <vxe-column field="actualHandleOrgName" title="接办部门" width="140"></vxe-column>
  97. <vxe-column field="acceptType" title="受理类型" width="110"></vxe-column>
  98. <vxe-column field="sourceChannel" title="来源渠道" width="100"></vxe-column>
  99. <vxe-column field="hotspotSpliceName" title="热点全称" width="150"></vxe-column>
  100. <vxe-column field="hotspotName" title="热点分类" width="150"></vxe-column>
  101. <vxe-column field="oneHotspotName" title="一级热点" width="150"></vxe-column>
  102. <vxe-column field="twoHotspotName" title="二级热点" width="150"></vxe-column>
  103. <vxe-column field="threeHotspotName" title="三级热点" width="150"></vxe-column>
  104. <vxe-column field="fourHotspotName" title="四级热点" width="150"></vxe-column>
  105. <vxe-column field="fiveHotspotName" title="五级热点" width="150"></vxe-column>
  106. <vxe-column field="acceptorName" title="受理人" width="100"></vxe-column>
  107. </vxe-table>
  108. </div>
  109. <pagination
  110. @pagination="queryList"
  111. :total="state.total"
  112. v-model:current-page="state.queryParams.PageIndex"
  113. v-model:page-size="state.queryParams.PageSize"
  114. :disabled="state.loading"
  115. />
  116. </div>
  117. </div>
  118. </template>
  119. <script setup lang="tsx" name="statisticsDepartmentDetailHandleList">
  120. import { onMounted, reactive, ref, defineAsyncComponent, computed } from 'vue';
  121. import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
  122. import { departmentOrderDetailExport, departmentOrderList, departmentOrderListExport } from '@/api/statistics/department';
  123. import { formatDate } from '@/utils/formatTime';
  124. import { defaultDateTime } from '@/utils/constants';
  125. import { listBaseData } from '@/api/judicial';
  126. import Other from '@/utils/other';
  127. import { exportJbOrder } from '@/api/business/order';
  128. import { downloadZip, exportAssignment } from '@/utils/tools';
  129. // 引入组件
  130. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  131. const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
  132. const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
  133. // 定义变量内容
  134. const ruleFormRef = ref<RefType>(); // 表单ref
  135. const state = reactive<any>({
  136. queryParams: {
  137. // 查询条件
  138. PageIndex: 1,
  139. PageSize: 20,
  140. crTime: defaultDateTime,
  141. StartTime: null,
  142. EndTime: null,
  143. TypeId: 0,
  144. SortField: null,
  145. SortRule: null,
  146. },
  147. tableData: [], //表单
  148. loading: false, // 加载
  149. total: 0, // 总数
  150. });
  151. // 排序
  152. const sortChange = (val: any) => {
  153. state.queryParams.SortField = val.order ? val.field : null;
  154. // 0 升序 1 降序
  155. state.queryParams.SortRule = val.order ? (val.order == 'desc' ? 1 : 0) : null;
  156. queryList();
  157. };
  158. /** 搜索按钮操作 */
  159. const handleQuery = () => {
  160. state.queryParams.PageIndex = 1;
  161. queryList();
  162. };
  163. /** 获取列表 */
  164. const requestParams = ref<EmptyObjectType>({});
  165. const queryList = () => {
  166. state.loading = true;
  167. requestParams.value = Other.deepClone(state.queryParams);
  168. requestParams.value.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  169. requestParams.value.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  170. Reflect.deleteProperty(requestParams.value, 'crTime'); // 删除无用的参数
  171. departmentOrderList(requestParams.value)
  172. .then((res: any) => {
  173. state.tableData = res.result?.items ?? [];
  174. state.total = res.result.total ?? 0;
  175. state.loading = false;
  176. })
  177. .catch(() => {
  178. state.loading = false;
  179. });
  180. };
  181. /** 重置按钮操作 */
  182. const statisticalTimeRef = ref<RefType>();
  183. const resetQuery = (formEl: FormInstance | undefined) => {
  184. if (!formEl) return;
  185. formEl.resetFields();
  186. statisticalTimeRef.value.reset();
  187. queryList();
  188. };
  189. // 获取查询条件基础信息
  190. const getBaseData = async () => {
  191. try {
  192. const res: any = await listBaseData();
  193. const mappings: any = {
  194. acceptTypeOptions: 'acceptTypeOptions',
  195. channelOptions: 'channelOptions',
  196. orgsOptions: 'orgsOptions',
  197. pushTypeOptions: 'pushTypeOptions',
  198. orderStatusOptions: 'orderStatusOptions',
  199. identityTypeOptions: 'identityTypeOptions',
  200. currentStepOptions: 'currentStepOptions',
  201. };
  202. for (const key in mappings) {
  203. state[key] = res.result?.[mappings[key]] ?? [];
  204. }
  205. } catch (error) {
  206. console.log(error);
  207. }
  208. };
  209. // 交办单导出
  210. const onJbExport = () => {
  211. const ids = checkTable.value.map((item: any) => item.id);
  212. exportAssignment(ids);
  213. };
  214. const checkTable = ref<EmptyArrayType>([]);
  215. const selectAllChangeEvent = ({ checked }) => {
  216. if (tableRef.value) {
  217. const records = tableRef.value.getCheckboxRecords();
  218. checkTable.value = records;
  219. console.log(checked ? '所有勾选事件' : '所有取消事件', records);
  220. }
  221. };
  222. const selectChangeEvent = ({ checked }) => {
  223. if (tableRef.value) {
  224. const records = tableRef.value.getCheckboxRecords();
  225. checkTable.value = records;
  226. console.log(checked ? '勾选事件' : '取消事件', records);
  227. }
  228. };
  229. const isChecked = computed(() => {
  230. return !Boolean(checkTable.value.length);
  231. });
  232. const toolbarRef = ref<RefType>();
  233. const tableRef = ref<RefType>();
  234. onMounted(() => {
  235. queryList();
  236. if (tableRef.value && toolbarRef.value) {
  237. tableRef.value.connect(toolbarRef.value);
  238. }
  239. getBaseData();
  240. });
  241. </script>