index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <div class="quality-done-container layout-pd">
  3. <el-card shadow="never">
  4. <el-tabs v-model="state.queryParams.Source" class="demo-tabs" @tab-change="queryList">
  5. <el-tab-pane label="受理已质检" :name="1"></el-tab-pane>
  6. <el-tab-pane label="派单已质检" :name="2"></el-tab-pane>
  7. <el-tab-pane label="回访已质检" :name="3"></el-tab-pane>
  8. </el-tabs>
  9. <el-form :model="state.queryParams" ref="ruleFormRef" :inline="true" @submit.native.prevent>
  10. <el-form-item label="关键词" prop="Keyword">
  11. <el-input v-model="state.queryParams.Keyword" placeholder="关键词" clearable @keyup.enter="queryList" />
  12. </el-form-item>
  13. <el-form-item label="创建时间" prop="exTime">
  14. <el-date-picker
  15. v-model="state.queryParams.exTime"
  16. type="datetimerange"
  17. unlink-panels
  18. range-separator="至"
  19. start-placeholder="开始时间"
  20. end-placeholder="结束时间"
  21. :shortcuts="shortcuts"
  22. @change="timeStartChangeCr"
  23. value-format="YYYY-MM-DD[T]HH:mm:ss"
  24. />
  25. </el-form-item>
  26. <el-form-item>
  27. <el-button type="primary" @click="queryList" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  28. <el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
  29. </el-form-item>
  30. </el-form>
  31. <!-- 表格 -->
  32. <el-table :data="state.tableData" v-loading="state.loading" row-key="id" ref="multipleTableRef" @selection-change="handleSelectionChange">
  33. <el-table-column type="selection" width="55" />
  34. <template v-if="state.queryParams.Source === 1">
  35. <el-table-column prop="order.no" label="工单编码" show-overflow-tooltip width="150"></el-table-column>
  36. <el-table-column prop="name" label="质检方式" show-overflow-tooltip></el-table-column>
  37. <el-table-column prop="order.sourceChannel" label="来源方式" show-overflow-tooltip></el-table-column>
  38. <el-table-column label="受理时间" show-overflow-tooltip width="170">
  39. <template #default="{ row }">
  40. <span>{{ formatDate(row.order?.startTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column prop="order.acceptType" label="受理类型" show-overflow-tooltip></el-table-column>
  44. <el-table-column prop="order.statusText" label="工单状态" show-overflow-tooltip></el-table-column>
  45. <el-table-column label="工单标题" show-overflow-tooltip width="300">
  46. <template #default="{ row }">
  47. <span class="color-primary">{{ row.order?.title }}</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="order.hotspotName" label="热点分类" show-overflow-tooltip></el-table-column>
  51. <el-table-column prop="employeeName" label="受理人" show-overflow-tooltip width="120">
  52. <template #default="{ row }">
  53. <span>{{ row.order?.acceptorName}} <span v-if="row.order?.acceptorStaffNo">[{{row.order?.acceptorStaffNo}}]</span> </span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column prop="order.fromPhone" label="来电电话" show-overflow-tooltip></el-table-column>
  57. <el-table-column prop="order.fromPhone" label="质检人" show-overflow-tooltip></el-table-column>
  58. <el-table-column label="质检时间" show-overflow-tooltip width="170">
  59. <template #default="{ row }">
  60. <span>{{ formatDate(row.order?.startTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="order.fromPhone" label="质检得分" show-overflow-tooltip></el-table-column>
  64. </template>
  65. <template v-if="state.queryParams.Source === 2">
  66. <el-table-column prop="order.no" label="工单编码" show-overflow-tooltip width="150"></el-table-column>
  67. <el-table-column prop="name" label="质检方式" show-overflow-tooltip></el-table-column>
  68. <el-table-column prop="order.sourceChannel" label="来源方式" show-overflow-tooltip></el-table-column>
  69. <el-table-column label="受理时间" show-overflow-tooltip width="170">
  70. <template #default="{ row }">
  71. <span>{{ formatDate(row.order?.startTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column prop="order.acceptType" label="受理类型" show-overflow-tooltip></el-table-column>
  75. <el-table-column prop="order.statusText" label="工单状态" show-overflow-tooltip></el-table-column>
  76. <el-table-column label="工单标题" show-overflow-tooltip width="300">
  77. <template #default="{ row }">
  78. <span class="color-primary">{{ row.order?.title }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column prop="order.hotspotName" label="热点分类" show-overflow-tooltip></el-table-column>
  82. <el-table-column prop="employeeName" label="受理人" show-overflow-tooltip width="120">
  83. <template #default="{ row }">
  84. <span>{{ row.order?.acceptorName}} <span v-if="row.order?.acceptorStaffNo">[{{row.order?.acceptorStaffNo}}]</span> </span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column prop="creationTime" label="交办时间" show-overflow-tooltip width="170">
  88. <template #default="{ row }">
  89. <span>{{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column prop="order.fromPhone" label="来电电话" show-overflow-tooltip></el-table-column>
  93. <el-table-column prop="order.fromPhone" label="质检人" show-overflow-tooltip></el-table-column>
  94. <el-table-column label="质检时间" show-overflow-tooltip width="170">
  95. <template #default="{ row }">
  96. <span>{{ formatDate(row.order?.startTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column prop="order.fromPhone" label="质检得分" show-overflow-tooltip></el-table-column>
  100. </template>
  101. <template v-if="state.queryParams.Source === 3">
  102. <el-table-column prop="order.no" label="工单编码" show-overflow-tooltip width="150"></el-table-column>
  103. <el-table-column prop="name" label="质检方式" show-overflow-tooltip></el-table-column>
  104. <el-table-column label="工单标题" show-overflow-tooltip width="300">
  105. <template #default="{ row }">
  106. <span class="color-primary">{{ row.order?.title }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column prop="order.sourceChannel" label="来源方式" show-overflow-tooltip></el-table-column>
  110. <el-table-column prop="visit.visitStateText" label="回访状态" show-overflow-tooltip></el-table-column>
  111. <el-table-column prop="visit.visitTypeText" label="回访方式" show-overflow-tooltip width="100"></el-table-column>
  112. <el-table-column prop="order.acceptType" label="受理类型" show-overflow-tooltip></el-table-column>
  113. <el-table-column prop="order.hotspotName" label="热点分类" show-overflow-tooltip width="120"></el-table-column>
  114. <el-table-column prop="employeeName" label="受理人" show-overflow-tooltip width="120">
  115. <template #default="{ row }">
  116. <span>{{ row.order?.acceptorName}} <span v-if="row.order?.acceptorStaffNo">[{{row.order?.acceptorStaffNo}}]</span> </span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column prop="order.actualHandleOrgName" label="接办部门" show-overflow-tooltip width="170"></el-table-column>
  120. <el-table-column label="受理时间" show-overflow-tooltip width="170">
  121. <template #default="{ row }">
  122. <span>{{ formatDate(row.order?.startTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column prop="startTime" label="办结时间" show-overflow-tooltip width="170">
  126. <template #default="{ row }">
  127. <span>{{ formatDate(row.startTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column prop="startTime" label="发布时间" show-overflow-tooltip width="170">
  131. <template #default="{ row }">
  132. <span>{{ formatDate(row.visit?.publishTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="回访任务创建时间" show-overflow-tooltip width="170">
  136. <template #default="{ row }">
  137. <span>{{ formatDate(row.visit?.creationTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  138. </template>
  139. </el-table-column>
  140. <el-table-column prop="visit.employeeName" label="回访人" show-overflow-tooltip width="170"></el-table-column>
  141. <el-table-column label="回访时间" show-overflow-tooltip width="170">
  142. <template #default="{ row }">
  143. <span>{{ formatDate(row.visit?.visitTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  144. </template>
  145. </el-table-column>
  146. <el-table-column prop="actualHandleOrgName" label="中心会签" show-overflow-tooltip></el-table-column>
  147. <el-table-column prop="order.fromPhone" label="质检人" show-overflow-tooltip></el-table-column>
  148. <el-table-column label="质检时间" show-overflow-tooltip width="170">
  149. <template #default="{ row }">
  150. <span>{{ formatDate(row.order?.startTime, 'YYYY-mm-dd HH:MM:SS') }}</span>
  151. </template>
  152. </el-table-column>
  153. <el-table-column prop="order.fromPhone" label="质检得分" show-overflow-tooltip></el-table-column>
  154. </template>
  155. <el-table-column label="操作" width="120" fixed="right" align="center">
  156. <template #default="{ row }">
  157. <el-button link type="primary" @click="onQualityView(row)" v-auth="'quality:done:view'" title="查看质检详情"> 查看 </el-button>
  158. <el-button link type="primary" @click="onQualityEdit(row)" v-auth="'quality:done:edit'" title="编辑质检"> 编辑 </el-button>
  159. </template>
  160. </el-table-column>
  161. <template #empty>
  162. <Empty />
  163. </template>
  164. </el-table>
  165. <!-- 分页 -->
  166. <pagination
  167. :total="state.total"
  168. v-model:page="state.queryParams.PageIndex"
  169. v-model:limit="state.queryParams.PageSize"
  170. @pagination="queryList"
  171. />
  172. </el-card>
  173. <!-- 质检 -->
  174. <quality-inspection ref="qualityInspectionRef" @updateList="queryList"/>
  175. </div>
  176. </template>
  177. <script lang="ts" setup name="qualityDone">
  178. import { reactive, ref, onMounted, defineAsyncComponent } from 'vue';
  179. import { ElMessage, FormInstance } from 'element-plus';
  180. import { formatDate } from '/@/utils/formatTime';
  181. import {auth} from "/@/utils/authFunction";
  182. import {qualityBaseData,qualityList} from '/@/api/quality'
  183. import {shortcuts} from "/@/utils/constants";
  184. // 引入组件
  185. const QualityInspection = defineAsyncComponent(() => import('/@/views/quality/done/components/Quality-inspection.vue')); // 质检
  186. // 定义变量内容
  187. const state = reactive<any>({
  188. loading: false, // 加载状态
  189. queryParams: {
  190. // 查询参数
  191. PageIndex: 1,
  192. PageSize: 10,
  193. Source: 1,
  194. CreationTimeStart: '', // 创建时间 开始
  195. CreationTimeEnd: '', // 创建时间 结束
  196. exTime: [], // 办理期限
  197. State: 1, // 待质检
  198. Keyword:''
  199. },
  200. total: 0, // 总条数
  201. tableData: [], // 表格数据
  202. });
  203. const ruleFormRef = ref<RefType>(null); // 表单ref
  204. const qualitySourceOptions = ref<EmptyArrayType>([]); // 违禁词分类
  205. const qualityStateOptions = ref<EmptyArrayType>([]); // 违禁词属性
  206. const getBaseData = async ()=>{
  207. try {
  208. const res = await qualityBaseData();
  209. qualitySourceOptions.value = res.result?.qualitySource ?? [];
  210. qualityStateOptions.value = res.result?.qualityState ?? [];
  211. } catch (error) {
  212. console.log(error);
  213. }
  214. }
  215. const handleTimeChange = (val: string[], startKey: string, endKey: string) => {
  216. if (val) {
  217. state.queryParams[startKey] = val[0];
  218. state.queryParams[endKey] = val[1];
  219. } else {
  220. state.queryParams[startKey] = '';
  221. state.queryParams[endKey] = '';
  222. }
  223. };
  224. // 甄别时间
  225. const timeStartChangeCr = (val: string[]) => {
  226. handleTimeChange(val, 'CreationTimeStart', 'CreationTimeEnd');
  227. };
  228. // 获取参数列表
  229. const queryList = () => {
  230. state.loading = true;
  231. if (!auth('quality:query')) ElMessage.error('抱歉,您没有权限获取质检词库列表!');
  232. else {
  233. qualityList(state.queryParams)
  234. .then((res) => {
  235. state.loading = false;
  236. state.tableData = res.result.items ?? [];
  237. state.total = res.result.total ?? 0;
  238. })
  239. .finally(() => {
  240. state.loading = false;
  241. });
  242. }
  243. };
  244. // 重置表单
  245. const resetQuery = (formEl: FormInstance | undefined) => {
  246. if (!formEl) return;
  247. formEl.resetFields();
  248. state.queryParams.CreationTimeStart = '';
  249. state.queryParams.CreationTimeEnd = '';
  250. queryList();
  251. };
  252. // 质检查看
  253. const qualityInspectionRef = ref<RefType>();
  254. const onQualityView = (row:any) => {
  255. qualityInspectionRef.value.openDialog(row,state.queryParams.Source,true);
  256. };
  257. // 质检编辑
  258. const onQualityEdit = (row: any) => {
  259. qualityInspectionRef.value.openDialog(row,state.queryParams.Source);
  260. };
  261. // 表格多选
  262. const multipleTableRef = ref<RefType>();
  263. const multipleSelection = ref<any>([]);
  264. const handleSelectionChange = (val: any[]) => {
  265. multipleSelection.value = val;
  266. };
  267. // 页面加载时
  268. onMounted(() => {
  269. getBaseData();
  270. queryList();
  271. });
  272. </script>
  273. <style lang="scss" scoped>
  274. .quality-done-container {
  275. }
  276. </style>