index.vue 5.8 KB

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