personalSeatsDetail.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div class="statistics-call-personal-seats-date-detail-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <vxe-grid v-bind="gridOptions">
  5. <template #form>
  6. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline :disabled="gridOptions.loading">
  7. <el-form-item prop="crTime">
  8. <statistical-time v-model="state.queryParams.crTime" @change="handleQuery" ref="statisticalTimeRef" :disabled="state.loading" />
  9. </el-form-item>
  10. <el-form-item>
  11. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  12. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  13. <SvgIcon name="ele-Refresh" class="mr5" />重置
  14. </el-button>
  15. </el-form-item>
  16. </el-form>
  17. </template>
  18. <template #toolbar_buttons>
  19. <el-popover :width="500" trigger="click">
  20. <template #reference>
  21. <el-button type="primary" title="口径说明"><SvgIcon name="ele-QuestionFilled" class="mr5" />口径说明</el-button>
  22. </template>
  23. <el-descriptions title="" :column="1" border style="max-height: 400px; overflow: auto">
  24. <el-descriptions-item label="个人服务呼入总量">进入IVR以后,已按了1键的所有电话量</el-descriptions-item>
  25. <el-descriptions-item label="个人服务接通量">通过个人服务通道后,话务人员接通的所有电话量</el-descriptions-item>
  26. <el-descriptions-item label="个人服务挂断总量">已按了1键,但是在话务人员接通前挂断的电话量</el-descriptions-item>
  27. <el-descriptions-item label="个人服务队列挂断">已进入个人服务通道,在队列中挂断的电话量</el-descriptions-item>
  28. <el-descriptions-item label="个人服务等待挂断">已进入个人服务话机,等待话务人员接听过程中挂断的电话量</el-descriptions-item>
  29. <el-descriptions-item label="个人服务接通率"> 个人服务接通量/个人服务呼入总量 </el-descriptions-item>
  30. </el-descriptions>
  31. </el-popover>
  32. </template>
  33. </vxe-grid>
  34. </div>
  35. </div>
  36. </template>
  37. <script setup lang="tsx" name="statisticsCallPersonalSeatDetail">
  38. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  39. import { FormInstance } from 'element-plus';
  40. import { defaultDate } from '@/utils/constants';
  41. import Other from '@/utils/other';
  42. import { callPersonal, callPersonalExport } from '@/api/statistics/call';
  43. import XEUtils from 'xe-utils';
  44. const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
  45. // 定义变量内容
  46. const ruleFormRef = ref<RefType>(); // 表单ref
  47. const state = reactive<any>({
  48. queryParams: {
  49. // 查询条件
  50. crTime: defaultDate,
  51. },
  52. tableData: [], //表单
  53. loading: false, // 加载
  54. total: 0, // 总数
  55. callForwardingSource: [],
  56. totalCount: {},
  57. });
  58. const requestParams = ref<EmptyObjectType>({});
  59. const gridOptions = reactive<any>({
  60. loading: false,
  61. border: true,
  62. showOverflow: true,
  63. columnConfig: {
  64. resizable: true,
  65. },
  66. scrollY: {
  67. enabled: true,
  68. gt: 100,
  69. },
  70. toolbarConfig: {
  71. zoom: true,
  72. custom: true,
  73. refresh: {
  74. queryMethod: () => {
  75. handleQuery();
  76. },
  77. },
  78. tools: [{ toolRender: { name: 'exportAll' } }],
  79. slots: {
  80. buttons: 'toolbar_buttons',
  81. },
  82. },
  83. customConfig: {
  84. storage: true,
  85. },
  86. id: 'statisticsCallPersonalSeatDetail',
  87. rowConfig: { isHover: true, height: 30, isCurrent: true, useKey: true },
  88. height: 'auto',
  89. align: 'center',
  90. columns: [
  91. {
  92. field: 'date',
  93. title: '日期',
  94. },
  95. {
  96. field: 'personCallInCount',
  97. title: '个人服务呼入总量',
  98. },
  99. {
  100. field: 'personCallInPutthroughCount',
  101. title: '个人服务接通量',
  102. },
  103. {
  104. field: 'personRingOffCount',
  105. title: '个人服务挂断总量',
  106. },
  107. {
  108. title: '挂断类型',
  109. children: [
  110. {
  111. field: 'personQueueOffCount',
  112. title: '个人服务队列挂断',
  113. },
  114. {
  115. field: 'personWaitOffCount',
  116. title: '个人服务等待挂断',
  117. },
  118. ],
  119. },
  120. {
  121. field: 'personCallPutthorughRateText',
  122. title: '个人服务接通率',
  123. },
  124. ],
  125. data: [],
  126. params: {
  127. exportMethod: callPersonalExport,
  128. exportParams: requestParams,
  129. },
  130. sortConfig: {
  131. remote: true,
  132. },
  133. showFooter: true,
  134. footerMethod: ({ columns, data }) => {
  135. return [
  136. columns.map((column: any, columnIndex: number) => {
  137. if (columnIndex === 0) {
  138. return '合计';
  139. }
  140. // 后端返回了数据集合 state.totalCount 所以不需要计算 直接进行赋值
  141. return XEUtils.get(state.totalCount, column.property);
  142. }),
  143. ];
  144. },
  145. });
  146. /** 搜索按钮操作 */
  147. const handleQuery = () => {
  148. // state.queryParams.PageIndex = 1;
  149. queryList();
  150. };
  151. /** 获取列表 */
  152. const queryList = async () => {
  153. state.loading = true;
  154. gridOptions.loading = true;
  155. try {
  156. requestParams.value = Other.deepClone(state.queryParams);
  157. requestParams.value.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  158. requestParams.value.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  159. Reflect.deleteProperty(requestParams.value, 'crTime');
  160. const { result } = await callPersonal(requestParams.value);
  161. state.tableData = result.list ?? [];
  162. state.totalCount = result.total;
  163. gridOptions.data = state.tableData;
  164. state.loading = false;
  165. gridOptions.loading = false;
  166. } catch (e) {
  167. state.loading = false;
  168. gridOptions.loading = false;
  169. console.log(e);
  170. }
  171. };
  172. /** 重置按钮操作 */
  173. const statisticalTimeRef = ref<RefType>();
  174. const resetQuery = (formEl: FormInstance | undefined) => {
  175. if (!formEl) return;
  176. formEl.resetFields();
  177. statisticalTimeRef.value.reset();
  178. queryList();
  179. };
  180. onMounted(() => {
  181. queryList();
  182. });
  183. </script>