todo.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div class="business-supervise-todo-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 label="关键字" prop="Keyword">
  7. <el-input v-model="state.queryParams.Keyword" placeholder="工单编码/标题" clearable @keyup.enter="handleQuery" class="keyword-input" />
  8. </el-form-item>
  9. <el-form-item>
  10. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  11. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  12. <SvgIcon name="ele-Refresh" class="mr5" />重置
  13. </el-button>
  14. </el-form-item>
  15. </el-form>
  16. </el-card>
  17. <el-card shadow="never">
  18. <ProTable
  19. ref="proTableRef"
  20. :columns="columns"
  21. :data="state.tableData"
  22. @updateTable="queryList"
  23. :loading="state.loading"
  24. :total="state.total"
  25. v-model:page-index="state.queryParams.PageIndex"
  26. v-model:page-size="state.queryParams.PageSize"
  27. >
  28. <template #expiredStatusText="{ row }">
  29. <span :class="'overdue-status-' + row.order?.expiredStatus" :title="row.order?.expiredStatusText"></span>
  30. </template>
  31. <template #title="{ row }">
  32. <order-detail :order="row.order" @updateList="queryList">{{ row.order?.title }}</order-detail>
  33. </template>
  34. <!-- 表格操作 -->
  35. <template #operation="{ row }">
  36. <el-button link type="primary" @click="onReply(row)" title="回复督办" v-auth="'business:supervise:todo:reply'"> 回复 </el-button>
  37. <order-detail :order="row.order" @updateList="queryList" />
  38. </template>
  39. </ProTable>
  40. </el-card>
  41. <!-- 督办回复 -->
  42. <order-supervise-reply ref="orderSuperviseReplyRef" @updateList="queryList" />
  43. </div>
  44. </template>
  45. <script setup lang="tsx" name="businessSuperviseTodo">
  46. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  47. import { FormInstance } from 'element-plus';
  48. import { throttle } from '@/utils/tools';
  49. import { formatDate } from '@/utils/formatTime';
  50. import { superviseList } from '@/api/business/supervise';
  51. // 引入组件
  52. const OrderSuperviseReply = defineAsyncComponent(() => import('@/views/business/supervise/components/Order-supervise-reply.vue')); // 回复督办
  53. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  54. // 定义变量内容
  55. const ruleFormRef = ref<RefType>(); // 表单ref
  56. const proTableRef = ref<RefType>(); // 表格ref
  57. // 表格配置项
  58. const columns = ref<any[]>([
  59. { prop: 'order.expiredStatusText', label: '超期状态', align: 'center',fixed: 'left',width: 80},
  60. { prop: 'order.no', label: '工单编码', width: 150 },
  61. { prop: 'order.title', label: '工单标题', width: 300 },
  62. { prop: 'order.sourceChannel', label: '来源渠道', width: 100 },
  63. { prop: 'order.isProvinceText', label: '省/市工单', width: 100 },
  64. { prop: 'order.statusText', label: '工单状态', width: 100 },
  65. { prop: 'order.acceptType', label: '受理类型', width: 150 },
  66. { prop: 'order.acceptorName', label: '受理人', width: 120 },
  67. { prop: 'order.hotspotName', label: '热点分类', width: 200 },
  68. { prop: 'order.actualHandleOrgName', label: '接办部门', width: 150 },
  69. {
  70. prop: 'order.startTime',
  71. label: '受理时间',
  72. width: 170,
  73. render: (scope) => {
  74. return <span>{formatDate(scope.row.order?.startTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  75. },
  76. },
  77. {
  78. prop: 'order.expiredTime',
  79. label: '工单期满时间',
  80. width: 170,
  81. render: (scope) => {
  82. return <span>{formatDate(scope.row.order?.expiredTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  83. },
  84. },
  85. {
  86. prop: 'creationTime',
  87. label: '督办时间',
  88. width: 170,
  89. render: (scope) => {
  90. return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  91. },
  92. },
  93. {
  94. prop: 'replyLimitTime',
  95. label: '督办回复时限',
  96. width: 170,
  97. render: (scope) => {
  98. return <span>{formatDate(scope.row.replyLimitTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  99. },
  100. },
  101. { prop: 'launchOrgName', label: '督办部门', width: 150 },
  102. { prop: 'crUser', label: '督办人', width: 120 },
  103. { prop: 'launchOrgName', label: '被督办部门', width: 150 },
  104. { prop: 'applyContent', label: '督办意见', width: 200 },
  105. { prop: 'operation', label: '操作', fixed: 'right', width: 140, align: 'center' },
  106. ]);
  107. const state = reactive({
  108. queryParams: {
  109. // 查询条件
  110. PageIndex: 1,
  111. PageSize: 10,
  112. Keyword: null, // 关键字
  113. SuperviseState: '0', // 未回复督办
  114. },
  115. tableData: [], //表单
  116. loading: false, // 加载
  117. total: 0, // 总数
  118. });
  119. // 手动查询,将页码设置为1
  120. const handleQuery = () => {
  121. state.queryParams.PageIndex = 1;
  122. queryList();
  123. };
  124. /** 获取列表 */
  125. const queryList = () => {
  126. state.loading = true;
  127. superviseList(state.queryParams)
  128. .then((res: any) => {
  129. state.tableData = res.result?.items ?? [];
  130. state.total = res.result?.total ?? 0;
  131. state.loading = false;
  132. })
  133. .catch(() => {
  134. state.loading = false;
  135. });
  136. };
  137. /** 重置按钮操作 */
  138. const resetQuery = (formEl: FormInstance | undefined) => {
  139. if (!formEl) return;
  140. formEl.resetFields();
  141. queryList();
  142. };
  143. // 回复
  144. const orderSuperviseReplyRef = ref<RefType>();
  145. const onReply = (row: any) => {
  146. orderSuperviseReplyRef.value.openDialog(row);
  147. };
  148. onMounted(() => {
  149. queryList();
  150. });
  151. </script>