index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <div class="business-secondVisit-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)" v-waves 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 #title="{ row }">
  29. <order-detail :order="row.order" @updateList="queryList">{{ row.order?.title }}</order-detail>
  30. </template>
  31. <template #employeeName="{ row }">
  32. <span>{{ row.orderVisit?.order?.acceptorName }}</span>
  33. </template>
  34. <template #orgProcessingResults="{ row }">
  35. <span>{{ row.orgProcessingResults?.value }}</span>
  36. </template>
  37. <template #orgHandledAttitude="{ row }">
  38. <span>{{ row.orgHandledAttitude?.value }}</span>
  39. </template>
  40. <template #orgNoSatisfiedReason="{ row }">
  41. <span>
  42. {{ row.orgNoSatisfiedReason?.map((item) => item.value).join(',') }}
  43. </span>
  44. </template>
  45. <!-- 表格操作 -->
  46. <template #operation="{ row }">
  47. <el-button link type="primary" @click="onSecondVisit(row)" title="二次回访" v-auth="'business:secondVisit:apply'"> 二次回访 </el-button>
  48. <order-detail :order="row.order" @updateList="queryList" />
  49. </template>
  50. </ProTable>
  51. </el-card>
  52. <!-- 二次回访 -->
  53. <second-visit ref="secondVisitRef" @updateList="queryList" />
  54. </div>
  55. </template>
  56. <script setup lang="tsx" name="secondVisit">
  57. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  58. import { FormInstance } from 'element-plus';
  59. import { formatDate } from '@/utils/formatTime';
  60. import { useRouter } from 'vue-router';
  61. import { secondVisitagainlist } from '@/api/business/secondVisit';
  62. // 引入组件
  63. const SecondVisit = defineAsyncComponent(() => import('@/views/business/secondVisit/components/Visit.vue'));
  64. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  65. const proTableRef = ref<RefType>(); // 表格ref
  66. // 表格配置项
  67. const columns = ref<any[]>([
  68. { type: 'selection', fixed: 'left', width: 40 },
  69. { prop: 'order.no', label: '工单编码', minWidth: 140 },
  70. { prop: 'order.statusText', label: '回访状态', minWidth: 100 },
  71. { prop: 'order.isProvinceText', label: '省/市工单', minWidth: 90 },
  72. { prop: 'order.title', label: '工单标题', minWidth: 200 },
  73. { prop: 'order.sourceChannel', label: '来源渠道', minWidth: 100 },
  74. { prop: 'order.acceptType', label: '受理类型', minWidth: 100 },
  75. { prop: 'order.hotspotName', label: '热点分类', minWidth: 150 },
  76. { prop: 'acceptorName', label: '受理人', minWidth: 120 },
  77. { prop: 'order.orgLevelOneName', label: '一级部门', minWidth: 140 },
  78. { prop: 'order.actualHandleOrgName', label: '接办部门', minWidth: 140 },
  79. {
  80. prop: 'order.startTime',
  81. label: '受理时间',
  82. minWidth: 160,
  83. render: (scope) => {
  84. return <span>{formatDate(scope.row.order?.startTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  85. },
  86. },
  87. {
  88. prop: 'order.filedTime',
  89. label: '办结时间',
  90. minWidth: 160,
  91. render: (scope) => {
  92. return <span>{formatDate(scope.row.order?.filedTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  93. },
  94. },
  95. {
  96. prop: 'orderVisit.publishTime',
  97. label: '发布时间',
  98. minWidth: 160,
  99. render: (scope) => {
  100. return <span>{formatDate(scope.row.orderVisit?.publishTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  101. },
  102. },
  103. {
  104. prop: 'orderVisit.visitTime',
  105. label: '回访时间',
  106. minWidth: 160,
  107. render: (scope) => {
  108. return <span>{formatDate(scope.row.orderVisit?.visitTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  109. },
  110. },
  111. { prop: 'visitOrgName', label: '被回访部门', minWidth: 140 },
  112. { prop: 'orgProcessingResults', label: '部门办件结果', minWidth: 120 },
  113. { prop: 'orgHandledAttitude', label: '部门办件态度', minWidth: 120 },
  114. { prop: 'orgNoSatisfiedReason', label: '不满意原因', minWidth: 150 },
  115. { prop: 'operation', label: '操作', fixed: 'right', width: 160, align: 'center' },
  116. ]);
  117. // 定义变量内容
  118. const ruleFormRef = ref<RefType>(); // 表单ref
  119. const router = useRouter(); // 路由
  120. const state = reactive({
  121. queryParams: {
  122. // 查询条件
  123. PageIndex: 1,
  124. PageSize: 10,
  125. Keyword: null, // 关键字
  126. VisitApplyState: null, // 回访状态
  127. },
  128. tableData: [], //表单
  129. loading: false, // 加载
  130. total: 0, // 总数
  131. });
  132. // 手动查询,将页码设置为1
  133. const handleQuery = () => {
  134. state.queryParams.PageIndex = 1;
  135. queryList();
  136. };
  137. /** 获取列表 */
  138. const queryList = () => {
  139. state.loading = true;
  140. secondVisitagainlist(state.queryParams)
  141. .then((res) => {
  142. state.tableData = res.result?.items ?? [];
  143. state.total = res.result?.total ?? 0;
  144. state.loading = false;
  145. })
  146. .catch((err) => {
  147. console.log(err);
  148. state.loading = false;
  149. });
  150. };
  151. /** 重置按钮操作 */
  152. const resetQuery = (formEl: FormInstance | undefined) => {
  153. if (!formEl) return;
  154. formEl.resetFields();
  155. queryList();
  156. };
  157. // 导出
  158. const onExport = () => {
  159. console.log('导出');
  160. };
  161. // 二次回访
  162. const secondVisitRef = ref<RefType>();
  163. const onSecondVisit = (row: any) => {
  164. secondVisitRef.value.openDialog(row);
  165. };
  166. onMounted(() => {
  167. queryList();
  168. });
  169. </script>