dpSatisfied.vue 13 KB

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