index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div class="business-secondVisitAudit-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 label="审批状态" prop="VisitApplyState">
  10. <el-select v-model="state.queryParams.VisitApplyState" placeholder="请选择审批状态" clearable class="w100">
  11. <el-option v-for="item in visitApplyState" :value="item.key" :key="item.key" :label="item.value" />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item>
  15. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  16. <el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button" :loading="state.loading">
  17. <SvgIcon name="ele-Refresh" class="mr5" />重置
  18. </el-button>
  19. </el-form-item>
  20. </el-form>
  21. </el-card>
  22. <el-card shadow="never">
  23. <ProTable
  24. ref="proTableRef"
  25. :columns="columns"
  26. :data="state.tableData"
  27. @updateTable="queryList"
  28. :loading="state.loading"
  29. :total="state.total"
  30. v-model:page-index="state.queryParams.PageIndex"
  31. v-model:page-size="state.queryParams.PageSize"
  32. >
  33. <template #isProvince="{ row }">
  34. <span>{{ row.order?.isProvince ? '省工单' : '市工单' }}</span>
  35. </template>
  36. <template #title="{ row }">
  37. <order-detail :order="row.order" @updateList="queryList">{{ row.order?.title }}</order-detail>
  38. </template>
  39. <template #employeeName="{ row }">
  40. <span>{{ row.orderVisit?.order?.acceptorName }}</span>
  41. </template>
  42. <template #orgProcessingResults="{ row }">
  43. <span>{{ row.orgProcessingResults?.value }}</span>
  44. </template>
  45. <template #orgHandledAttitude="{ row }">
  46. <span>{{ row.orgHandledAttitude?.value }}</span>
  47. </template>
  48. <template #orgNoSatisfiedReason="{ row }">
  49. <span>
  50. {{ row.orgNoSatisfiedReason?.map((item) => item.value).join(',') }}
  51. </span>
  52. </template>
  53. <!-- 表格操作 -->
  54. <template #operation="{ row }">
  55. <el-button
  56. link
  57. type="primary"
  58. @click="onAudit(row)"
  59. title="审批"
  60. v-if="[0].includes(row.visitApplyState)"
  61. v-auth="'business:secondVisitAudit:audit'"
  62. >
  63. 审批
  64. </el-button>
  65. <el-button link type="primary" @click="onDetail(row)" title="查看审批详情" v-if="[1, 2].includes(row.visitApplyState)">
  66. 二次回访详情
  67. </el-button>
  68. <order-detail :order="row.order" @updateList="queryList" />
  69. </template>
  70. </ProTable>
  71. </el-card>
  72. <!-- 二次回访 -->
  73. <second-visit ref="secondVisitRef" @updateList="queryList" />
  74. <!-- 回访详情 -->
  75. <second-visit-detail ref="secondVisitDetailRef" />
  76. </div>
  77. </template>
  78. <script setup lang="tsx" name="secondVisitAudit">
  79. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  80. import { ElMessage, FormInstance } from 'element-plus';
  81. import { throttle } from '@/utils/tools';
  82. import { formatDate } from '@/utils/formatTime';
  83. import { useRouter } from 'vue-router';
  84. import { secondVisitBaseData, secondVisitList } from '@/api/business/secondVisit';
  85. // 引入组件
  86. const SecondVisit = defineAsyncComponent(() => import('@/views/business/secondVisit/components/Visit.vue'));
  87. const SecondVisitDetail = defineAsyncComponent(() => import('@/views/business/secondVisit/components/Visit-detail.vue'));
  88. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  89. const proTableRef = ref<RefType>(); // 表格ref
  90. // 表格配置项
  91. const columns = ref<any[]>([
  92. { type: 'selection', fixed: 'left', width: 55 },
  93. { prop: 'orderVisit.no', label: '工单编码', width: 150 },
  94. { prop: 'isProvince', label: '省/市工单', width: 100 },
  95. { prop: 'title', label: '工单标题', width: 300 },
  96. { prop: 'orderVisit.sourceChannel', label: '来源方式', width: 100 },
  97. { prop: 'orderVisit.visitStateText', label: '回访方式', width: 100 },
  98. { prop: 'orderVisit.acceptType', label: '受理类型', width: 150 },
  99. { prop: 'orderVisit.hotspotName', label: '热点分类', width: 100 },
  100. { prop: 'acceptorName', label: '受理人', width: 170 },
  101. { prop: 'orderVisit.orgLevelOneName', label: '一级部门', width: 170 },
  102. { prop: 'orderVisit.actualHandleOrgName', label: '接办部门', width: 170 },
  103. {
  104. prop: 'orderVisit.startTime',
  105. label: '受理时间',
  106. width: 170,
  107. render: (scope) => {
  108. return <span>{formatDate(scope.row.order?.startTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  109. },
  110. },
  111. {
  112. prop: 'orderVisit.filedTime',
  113. label: '办结时间',
  114. width: 170,
  115. render: (scope) => {
  116. return <span>{formatDate(scope.row.order?.filedTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  117. },
  118. },
  119. {
  120. prop: 'orderVisit.publishTime',
  121. label: '发布时间',
  122. width: 170,
  123. render: (scope) => {
  124. return <span>{formatDate(scope.row.orderVisit?.publishTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  125. },
  126. },
  127. {
  128. prop: 'orderVisit.visitTime',
  129. label: '回访时间',
  130. width: 170,
  131. render: (scope) => {
  132. return <span>{formatDate(scope.row.orderVisit?.visitTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  133. },
  134. },
  135. { prop: 'orderVisit.visitOrgName', label: '被回访部门', width: 150 },
  136. { prop: 'orgProcessingResults', label: '部门办件结果', width: 150 },
  137. { prop: 'orgHandledAttitude', label: '部门办件态度', width: 150 },
  138. { prop: 'orgNoSatisfiedReason', label: '不满意原因', width: 150 },
  139. { prop: 'creatorName', label: '申请人', width: 120 },
  140. { prop: 'creatorOrgName', label: '申请部门', width: 150 },
  141. { prop: 'visitReason', label: '申请理由', width: 200 },
  142. { prop: 'examinOpinion', label: '审批意见', width: 200 },
  143. { prop: 'operation', label: '操作', fixed: 'right', width: 190, align: 'center' },
  144. ]);
  145. // 定义变量内容
  146. const ruleFormRef = ref<RefType>(); // 表单ref
  147. const router = useRouter(); // 路由
  148. const state = reactive({
  149. queryParams: {
  150. // 查询条件
  151. PageIndex: 1,
  152. PageSize: 10,
  153. Keyword: null, // 关键字
  154. VisitApplyState: null, // 审批中
  155. },
  156. tableData: [], //表单
  157. loading: false, // 加载
  158. total: 0, // 总数
  159. });
  160. // 基础信息
  161. const visitApplyState = ref<EmptyArrayType>([]); // 回访状态
  162. const getBaseData = async () => {
  163. try {
  164. const res = await secondVisitBaseData();
  165. visitApplyState.value = res.result?.visitApplyState ?? [];
  166. } catch (error) {
  167. console.log(error);
  168. }
  169. };
  170. // 手动查询,将页码设置为1
  171. const handleQuery = () => {
  172. state.queryParams.PageIndex = 1;
  173. queryList();
  174. };
  175. /** 获取列表 */
  176. const queryList = () => {
  177. secondVisitList(state.queryParams)
  178. .then((res) => {
  179. state.tableData = res.result?.items ?? [];
  180. state.total = res.result?.total ?? 0;
  181. })
  182. .catch((err) => {
  183. console.log(err);
  184. });
  185. };
  186. /** 重置按钮操作 */
  187. const resetQuery = (formEl: FormInstance | undefined) => {
  188. if (!formEl) return;
  189. formEl.resetFields();
  190. queryList();
  191. };
  192. // 导出
  193. const onExport = () => {
  194. console.log('导出');
  195. };
  196. // 审批
  197. const secondVisitRef = ref<RefType>();
  198. const onAudit = (row: any) => {
  199. secondVisitRef.value.openDialog(row, true);
  200. };
  201. // 查看审批详情
  202. const secondVisitDetailRef = ref<RefType>();
  203. const onDetail = (row: any) => {
  204. secondVisitDetailRef.value.openDialog(row);
  205. };
  206. onMounted(() => {
  207. getBaseData();
  208. queryList();
  209. });
  210. </script>