detailSatisfiedList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <div class="statistics-department-satisfaction-detail-list-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <ProTable
  5. ref="proTableRef"
  6. :columns="columns"
  7. :data="state.tableData"
  8. @updateTable="queryList"
  9. :loading="state.loading"
  10. :total="state.total"
  11. v-model:page-index="state.queryParams.PageIndex"
  12. v-model:page-size="state.queryParams.PageSize"
  13. :toolButton="['refresh', 'setting', 'exportCurrent', 'exportAll']"
  14. :exportMethod="departmentSatisfactionListExport"
  15. :exportParams="requestParams"
  16. >
  17. <template #table-search>
  18. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
  19. <el-form-item label="工单标题" prop="Keyword">
  20. <el-input v-model="state.queryParams.Keyword" placeholder="工单标题" clearable @keyup.enter="handleQuery" />
  21. </el-form-item>
  22. <el-form-item label="工单编码" prop="No">
  23. <el-input v-model="state.queryParams.No" placeholder="工单编码" clearable @keyup.enter="handleQuery" />
  24. </el-form-item>
  25. <el-form-item label="受理时间" prop="crTime">
  26. <el-date-picker
  27. v-model="state.queryParams.crTime"
  28. type="datetimerange"
  29. unlink-panels
  30. range-separator="至"
  31. start-placeholder="开始时间"
  32. end-placeholder="结束时间"
  33. :shortcuts="shortcuts"
  34. @change="handleQuery"
  35. value-format="YYYY-MM-DD[T]HH:mm:ss"
  36. :default-time="defaultTimeStartEnd"
  37. :clearable="false"
  38. />
  39. </el-form-item>
  40. <el-form-item label="" label-width="0">
  41. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  42. <el-button @click="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
  43. </el-form-item>
  44. </el-form>
  45. </template>
  46. <template #tableHeader="scope">
  47. <el-button type="primary" @click="onJbExport" :disabled="!scope.isSelected" :loading="state.loading"
  48. ><SvgIcon name="iconfont icon-daochu" class="mr5" />交办单导出
  49. </el-button>
  50. </template>
  51. <template #description>
  52. <el-popover :width="500" trigger="click">
  53. <template #reference>
  54. <el-button circle title="口径说明"><SvgIcon name="ele-QuestionFilled" /></el-button>
  55. </template>
  56. <el-descriptions title="" :column="1" border>
  57. <el-descriptions-item label="工单编码">工单编号</el-descriptions-item>
  58. <el-descriptions-item label="重办次数">发布是重办的次数</el-descriptions-item>
  59. <el-descriptions-item label="甄别">甄别中、未甄别、甄别退回、不同意、</el-descriptions-item>
  60. <el-descriptions-item label="回访信息"> 工单回访内容 </el-descriptions-item>
  61. <el-descriptions-item label="受理时间"> 工单新建时间 </el-descriptions-item>
  62. <el-descriptions-item label="工单标题"> 工单的标题(点击可查看工单详情)</el-descriptions-item>
  63. <el-descriptions-item label="话务员"> 工单回访话务员 </el-descriptions-item>
  64. <el-descriptions-item label="部门名称"> 新建工单用户所在部门 </el-descriptions-item>
  65. <el-descriptions-item label="评价工具"> 电话、门户网站、 </el-descriptions-item>
  66. <el-descriptions-item label="回访时间"> 工单回访时间 </el-descriptions-item>
  67. <el-descriptions-item label="满意度"> 回访时的满意度 </el-descriptions-item>
  68. <el-descriptions-item label="办结时间"> 工单办理完成的时间 </el-descriptions-item>
  69. </el-descriptions>
  70. </el-popover>
  71. </template>
  72. <template #title="{ row }">
  73. <order-detail :order="row" @updateList="queryList">{{ row.title }}</order-detail>
  74. </template>
  75. <template #operation="{ row }">
  76. <el-button link type="primary" @click="visitDetail(row)" title="查看回访详情"> 回访详情 </el-button>
  77. </template>
  78. </ProTable>
  79. </div>
  80. <!-- 回访详情 -->
  81. <visit-detail-com ref="visitDetailRef" @updateList="queryList" />
  82. <!-- 更多查询 -->
  83. <el-drawer v-model="drawer" title="更多查询" size="500px">
  84. <el-form :model="state.queryParams" ref="drawerRuleFormRef" @submit.native.prevent label-width="100px">
  85. <el-form-item label="回访人姓名" prop="VisitUser">
  86. <el-input v-model="state.queryParams.VisitUser" placeholder="回访人姓名" clearable @keyup.enter="handleQuery" />
  87. </el-form-item>
  88. <el-form-item label="办件结果" prop="OrgProcessingResults">
  89. <el-select
  90. v-model="state.queryParams.OrgProcessingResults"
  91. placeholder="请选择来办件结果"
  92. clearable
  93. class="w100"
  94. @change="handleQuery"
  95. >
  96. <el-option v-for="item in state.visitSatisfaction" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
  97. </el-select>
  98. </el-form-item>
  99. <el-form-item label="热点分类" prop="Hotspot">
  100. <el-input v-model="state.queryParams.Hotspot" placeholder="热点分类名称" clearable @keyup.enter="handleQuery" />
  101. </el-form-item>
  102. <el-form-item label="回访部门" prop="OrgId">
  103. <el-cascader
  104. :options="state.orgsOptions"
  105. filterable
  106. :show-all-levels="false"
  107. :props="{ checkStrictly: true, value: 'id', label: 'name', emitPath: false }"
  108. placeholder="请选择回访部门"
  109. clearable
  110. class="w100"
  111. v-model="state.queryParams.OrgId"
  112. @change="handleQuery"
  113. >
  114. </el-cascader>
  115. </el-form-item>
  116. <el-form-item label="办结时间" prop="doneTime">
  117. <el-date-picker
  118. v-model="state.queryParams.doneTime"
  119. type="datetimerange"
  120. unlink-panels
  121. range-separator="至"
  122. start-placeholder="开始时间"
  123. end-placeholder="结束时间"
  124. :shortcuts="shortcuts"
  125. @change="handleQuery"
  126. value-format="YYYY-MM-DD[T]HH:mm:ss"
  127. :default-time="defaultTimeStartEnd"
  128. />
  129. </el-form-item>
  130. <el-form-item label="来电主体" prop="TypeCode">
  131. <el-select v-model="state.queryParams.TypeCode" placeholder="请选择来电主体" @change="handleQuery">
  132. <el-option :value="0" label="全部" />
  133. <el-option :value="1" label="市民" />
  134. <el-option :value="2" label="企业" />
  135. </el-select>
  136. </el-form-item>
  137. </el-form>
  138. <template #footer>
  139. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  140. <el-button @click="resetQuery(drawerRuleFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
  141. </template>
  142. </el-drawer>
  143. </div>
  144. </template>
  145. <script setup lang="tsx" name="statisticsDepartmentSatisfiedDetailList">
  146. import { onMounted, reactive, ref, defineAsyncComponent } from 'vue';
  147. import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
  148. import { departmentSatisfactionDetailBase, departmentSatisfactionList, departmentSatisfactionListExport } from '@/api/statistics/department';
  149. import { formatDate } from '@/utils/formatTime';
  150. import { defaultDateOne, defaultTimeStartEnd, shortcuts } from '@/utils/constants';
  151. import { useRoute } from 'vue-router';
  152. import Other from '@/utils/other';
  153. import { exportJbOrder } from '@/api/business/order';
  154. import { downloadZip } from '@/utils/tools';
  155. // 引入组件
  156. const VisitDetailCom = defineAsyncComponent(() => import('@/views/business/visit/component/Visit-detail.vue')); // 回访
  157. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  158. // 表格配置项
  159. const columns = ref<any[]>([
  160. { type: 'selection', width: 40, align: 'center' },
  161. { prop: 'no', label: '工单编码', width: 140 },
  162. { prop: 'reTransactNum', label: '重办次数' },
  163. { prop: 'orderScreenStatusText', label: '甄别', minWidth: 100 },
  164. { prop: 'visitContent', label: '回访信息', minWidth: 150 },
  165. { prop: 'hotspotSpliceName', label: '热点全称', minWidth: 150 },
  166. { prop: 'orgLevelOneName', label: '一级部门', minWidth: 140 },
  167. { prop: 'currentHandleOrgName', label: '办结部门', minWidth: 140 },
  168. {
  169. prop: 'creationTime',
  170. label: '受理时间',
  171. minWidth: 160,
  172. render: (scope) => {
  173. return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  174. },
  175. },
  176. { prop: 'title', label: '工单标题', width: 200 },
  177. { prop: 'visitUser', label: '回访人', minWidth: 120 },
  178. { prop: 'visitOrgName', label: '回访部门', minWidth: 140 },
  179. { prop: 'visitTypeText', label: '回访方式', minWidth: 100 },
  180. {
  181. prop: 'visitTime',
  182. label: '回访时间',
  183. minWidth: 160,
  184. render: (scope) => {
  185. return <span>{formatDate(scope.row.visitTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  186. },
  187. },
  188. { prop: 'orgProcessingResults', label: '满意度', minWidth: 120 },
  189. { prop: 'content', label: '受理内容', minWidth: 150 },
  190. { prop: 'fileOpinion', label: '承办意见', minWidth: 150 },
  191. {
  192. prop: 'filedTime',
  193. label: '办结时间',
  194. minWidth: 160,
  195. render: (scope) => {
  196. return <span>{formatDate(scope.row.filedTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
  197. },
  198. },
  199. { prop: 'operation', label: '操作', fixed: 'right', width: 90, align: 'center' },
  200. ]);
  201. // 定义变量内容
  202. const state = reactive<any>({
  203. queryParams: {
  204. // 查询条件
  205. PageIndex: 1,
  206. PageSize: 20,
  207. HotspotIds: null,
  208. crTime: defaultDateOne,
  209. CreationTimeStart: null,
  210. CreationTimeEnd: null,
  211. doneTime: [], // 办结时间
  212. ActualHandleTimeStart: null,
  213. ActualHandleTimeEnd: null,
  214. VisitUser: null,
  215. OrgProcessingResults: null,
  216. OrgId:null,
  217. TypeId:'1',
  218. TypeCode:0
  219. },
  220. tableData: [], //表单
  221. loading: false, // 加载
  222. total: 0, // 总数
  223. });
  224. /** 搜索按钮操作 */
  225. const handleQuery = () => {
  226. state.queryParams.PageIndex = 1;
  227. queryList();
  228. };
  229. /** 获取列表 */
  230. const requestParams = ref({});
  231. const queryList = () => {
  232. state.loading = true;
  233. requestParams.value = Other.deepClone(state.queryParams);
  234. requestParams.value.CreationTimeStart = state.queryParams.crTime === null ? null : state.queryParams.crTime[0]; // 生成时间
  235. requestParams.value.CreationTimeEnd = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  236. Reflect.deleteProperty(requestParams.value, 'crTime'); // 删除无用的参数
  237. requestParams.value.ActualHandleTimeStart = state.queryParams.doneTime === null ? null : state.queryParams.doneTime[0]; // 生成时间
  238. requestParams.value.ActualHandleTimeEnd = state.queryParams.doneTime === null ? null : state.queryParams.doneTime[1];
  239. Reflect.deleteProperty(requestParams.value, 'doneTime'); // 删除无用的参数
  240. departmentSatisfactionList(requestParams.value)
  241. .then((res: any) => {
  242. state.tableData = res.result?.items ?? [];
  243. state.total = res.result.total ?? 0;
  244. state.loading = false;
  245. })
  246. .catch(() => {
  247. state.loading = false;
  248. });
  249. };
  250. /** 重置按钮操作 */
  251. const drawerRuleFormRef = ref();
  252. const ruleFormRef = ref<RefType>(); // 表单ref
  253. const drawer = ref(false);
  254. const resetQuery = (formEl: FormInstance | undefined) => {
  255. if (!formEl) return;
  256. formEl.resetFields();
  257. ruleFormRef.value?.resetFields();
  258. queryList();
  259. };
  260. // 回访详情
  261. const visitDetailRef = ref<RefType>();
  262. const visitDetail = (row: any) => {
  263. visitDetailRef.value.openDialog({ ...row, id: row.visitId }, '回访详情');
  264. };
  265. // 获取查询条件基础信息
  266. const getBaseData = async () => {
  267. try {
  268. const res: any = await departmentSatisfactionDetailBase();
  269. const mappings: any = {
  270. visitSatisfaction: 'visitSatisfaction',
  271. orgsOptions: 'orgsOptions',
  272. };
  273. for (const key in mappings) {
  274. state[key] = res.result?.[mappings[key]] ?? [];
  275. }
  276. } catch (error) {
  277. console.log(error);
  278. }
  279. };
  280. // 交办单导出
  281. const proTableRef = ref<RefType>();
  282. const onJbExport = () => {
  283. const ids = proTableRef.value.selectedList.map((item: any) => item.id);
  284. ElMessageBox.confirm(`您确定导出选中的${proTableRef.value.selectedList.length}个工单的交办单,是否继续?`, '提示', {
  285. confirmButtonText: '确认',
  286. cancelButtonText: '取消',
  287. type: 'warning',
  288. draggable: true,
  289. cancelButtonClass: 'default-button',
  290. autofocus: false,
  291. })
  292. .then(() => {
  293. state.loading = true;
  294. exportJbOrder(ids)
  295. .then((res: any) => {
  296. downloadZip(res);
  297. state.loading = false;
  298. ElMessage.success('导出成功');
  299. })
  300. .catch(() => {
  301. state.loading = false;
  302. });
  303. })
  304. .catch(() => {});
  305. };
  306. onMounted(() => {
  307. getBaseData();
  308. queryList();
  309. });
  310. </script>