detailSourceOrder.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div class="statistics-order-detail-accept-type layout-pd">
  3. <el-card shadow="never">
  4. <!-- 表格 -->
  5. <ProTable
  6. ref="proTableRef"
  7. :columns="columns"
  8. :data="state.tableData"
  9. @updateTable="queryList"
  10. :loading="state.loading"
  11. :total="state.total"
  12. v-model:page-index="state.queryParams.PageIndex"
  13. v-model:page-size="state.queryParams.PageSize"
  14. @export-current="exportCurrent"
  15. @export-all="exportAll"
  16. :key="Math.random()"
  17. >
  18. <template #expiredStatusText="{ row }">
  19. <span :class="'overdue-status-' + row.expiredStatus" :title="row.expiredStatusText"></span>
  20. </template>
  21. <template #title="{ row }">
  22. <order-detail :order="row" @updateList="queryList">{{ row.title }}</order-detail>
  23. </template>
  24. </ProTable>
  25. </el-card>
  26. </div>
  27. </template>
  28. <script setup lang="tsx" name="statisticsDetailSourceOrder">
  29. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  30. import type { FormInstance } from 'element-plus';
  31. import other from '@/utils/other';
  32. import { useRoute, useRouter } from 'vue-router';
  33. import { formatDate } from '@/utils/formatTime';
  34. import { departmentAcceptTypeDetail } from '@/api/statistics/order';
  35. // 引入组件
  36. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  37. // 定义变量内容
  38. const state = reactive<any>({
  39. queryParams: {
  40. PageIndex: 1, // 当前页
  41. PageSize: 10, // 每页条数
  42. },
  43. tableData: [], //表单
  44. loading: false, // 加载
  45. total: 0, // 总数
  46. });
  47. const ruleFormRef = ref<RefType>(); // 表单ref
  48. const route = useRoute(); // 路由
  49. const router = useRouter(); // 路由
  50. const proTableRef = ref<RefType>(); // 表格ref
  51. // 表格配置项
  52. const columns = ref<any[]>([
  53. { prop: 'expiredStatusText', label: '超期状态', align: 'center' ,width: 80,fixed:'left'},
  54. { prop: 'statusText', label: '工单状态', width: 100 },
  55. { prop: 'sourceChannel', label: '来源方式' },
  56. { prop: 'actualHandleStepName', label: '当前节点', width: 120 },
  57. { prop: 'reTransactNum',label: '重办次数',},
  58. { prop: 'no', label: '工单编码', width: 150 },
  59. {
  60. prop: 'startTime',
  61. label: '受理时间',
  62. width: 170,
  63. render: (scope) => {
  64. return <span>{formatDate(scope.row.startTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  65. },
  66. },
  67. { prop: 'title', label: '工单标题', width: 300 },
  68. {
  69. prop: 'expiredTime',
  70. label: '工单期满时间',
  71. width: 170,
  72. render: (scope) => {
  73. return <span>{formatDate(scope.row.expiredTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  74. },
  75. },
  76. { prop: 'actualHandleOrgName', label: '接办部门', width: 170 },
  77. {
  78. prop: 'actualHandleTime',
  79. label: '接办时间',
  80. width: 170,
  81. render: (scope) => {
  82. return <span>{formatDate(scope.row.actualHandleTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  83. },
  84. },
  85. {
  86. prop: 'filedTime',
  87. label: '办结时间',
  88. width: 170,
  89. render: (scope) => {
  90. return <span>{formatDate(scope.row.filedTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  91. },
  92. },
  93. { prop: 'acceptType', label: '受理类型', width: 150 },
  94. { prop: 'hotspotName', label: '热点分类', width: 200 },
  95. { prop: 'acceptorName', label: '受理人', width: 120 }
  96. ]);
  97. // 手动查询,将页码设置为1
  98. const handleQuery = () => {
  99. state.queryParams.PageIndex = 1;
  100. queryList();
  101. };
  102. const historyParams = history.state;
  103. /** 获取列表 */
  104. const queryList = () => {
  105. let request = other.deepClone(state.queryParams);
  106. request.StartDate = historyParams.StartDate;
  107. request.EndDate = historyParams.EndDate;
  108. request.OrgCode = historyParams.OrgCode;
  109. request.AcceptTypeCode = historyParams.AcceptTypeCode;
  110. request.TypeCode = historyParams.TypeCode;
  111. state.loading = true;
  112. console.log(historyParams)
  113. departmentAcceptTypeDetail(request)
  114. .then((response: any) => {
  115. state.tableData = response?.result.items ?? [];
  116. state.total = response?.result.total;
  117. state.loading = false;
  118. })
  119. .catch(() => {
  120. state.loading = false;
  121. });
  122. };
  123. /** 重置按钮操作 */
  124. const resetQuery = (formEl: FormInstance | undefined) => {
  125. if (!formEl) return;
  126. formEl.resetFields();
  127. queryList();
  128. };
  129. const exportCurrent = () => {
  130. console.log('导出当前页', proTableRef.value);
  131. };
  132. const exportAll = () => {
  133. console.log('导出全部', proTableRef.value);
  134. };
  135. onMounted(() => {
  136. queryList();
  137. });
  138. </script>