seatsMoth.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div class="statistics-call-seats-moth-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
  5. <el-form-item label="坐席" prop="Role">
  6. <el-select-v2
  7. v-model="state.queryParams.Role"
  8. filterable
  9. :options="state.roleOptions"
  10. :props="{
  11. label: 'displayName',
  12. value: 'id',
  13. }"
  14. placeholder="请选择坐席"
  15. clearable
  16. @change="handleQuery"
  17. />
  18. </el-form-item>
  19. <el-form-item prop="crTime">
  20. <statistical-time v-model="state.queryParams.crTime" @change="handleQuery" ref="statisticalTimeRef" :disabled="state.loading" />
  21. </el-form-item>
  22. <el-form-item>
  23. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  24. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  25. <SvgIcon name="ele-Refresh" class="mr5" />重置
  26. </el-button>
  27. </el-form-item>
  28. </el-form>
  29. <vxe-toolbar
  30. ref="toolbarRef"
  31. :loading="state.loading"
  32. custom
  33. :refresh="{
  34. queryMethod: handleQuery,
  35. }"
  36. :tools="[{ toolRender: { name: 'exportAll' } }]"
  37. >
  38. <template #buttons>
  39. <el-button type="primary" @click="onLink">通话时段明细</el-button>
  40. <el-popover :width="500" trigger="click">
  41. <template #reference>
  42. <el-button type="primary" title="口径说明"><SvgIcon name="ele-QuestionFilled" class="mr5"/>口径说明</el-button>
  43. </template>
  44. <el-descriptions title="" :column="1" border style="max-height: 400px; overflow: auto">
  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>
  53. </el-popover>
  54. </template>
  55. </vxe-toolbar>
  56. <div style="overflow: hidden; width: 100%; height: 100%; flex: 1">
  57. <vxe-table
  58. border
  59. :loading="state.loading"
  60. :data="state.tableData"
  61. :column-config="{ resizable: true }"
  62. :row-config="{ isCurrent: true, isHover: true, height: 30, useKey: true }"
  63. ref="tableRef"
  64. height="auto"
  65. auto-resize
  66. :scrollY="{ enabled: true, gt: 100 }"
  67. show-overflow
  68. id="statisticsOrderCenter"
  69. :custom-config="{ storage: true }"
  70. show-footer
  71. :footer-method="footerMethod"
  72. :params="{ exportMethod: centerListExport, exportParams: requestParams }"
  73. :sort-config="{ remote: true }"
  74. @sort-change="sortChange"
  75. >
  76. <vxe-column field="userName" title="坐席"></vxe-column>
  77. <vxe-column title="呼入总量" field="centreArchive" sortable></vxe-column>
  78. <vxe-column title="呼入总量" field="centreCareOf" sortable></vxe-column>
  79. <vxe-column title="有效接通量" field="noCentreCareOf" sortable></vxe-column>
  80. <vxe-column title="接通秒挂量" field="noCentreCareOf" sortable></vxe-column>
  81. <vxe-column title="超时接通量" field="noCentreCareOf" sortable></vxe-column>
  82. <vxe-column title="按时接通量" field="noCentreCareOf" sortable></vxe-column>
  83. <vxe-column title="呼入未接通总量" field="noCentreCareOf" sortable></vxe-column>
  84. <vxe-column title="未接通秒挂量" field="noCentreCareOf" sortable></vxe-column>
  85. <vxe-column title="超时未接通量" field="noCentreCareOf" sortable></vxe-column>
  86. <vxe-column title="接通率" field="noCentreCareOf" sortable></vxe-column>
  87. </vxe-table>
  88. </div>
  89. </div>
  90. </div>
  91. </template>
  92. <script setup lang="tsx" name="statisticsCallSeatsMoth">
  93. import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
  94. import { FormInstance } from 'element-plus';
  95. import { centerList, centerListExport } from '@/api/statistics/order';
  96. import { defaultDate } from '@/utils/constants';
  97. import Other from '@/utils/other';
  98. import XEUtils from 'xe-utils';
  99. import { useRouter } from 'vue-router';
  100. const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
  101. // 定义变量内容
  102. const ruleFormRef = ref<RefType>(); // 表单ref
  103. const state = reactive<any>({
  104. queryParams: {
  105. // 查询条件
  106. Keyword: null, // 关键词
  107. crTime: defaultDate,
  108. SortField: null,
  109. SortRule: null,
  110. },
  111. tableData: [], //表单
  112. loading: false, // 加载
  113. total: 0, // 总数
  114. roleOptions: [],
  115. });
  116. /** 搜索按钮操作 */
  117. const handleQuery = () => {
  118. // state.queryParams.PageIndex = 1;
  119. queryList();
  120. };
  121. /** 获取列表 */
  122. const requestParams = ref<EmptyObjectType>({});
  123. const queryList = () => {
  124. state.loading = true;
  125. requestParams.value = Other.deepClone(state.queryParams);
  126. requestParams.value.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  127. requestParams.value.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  128. Reflect.deleteProperty(requestParams.value, 'crTime');
  129. centerList(requestParams.value)
  130. .then((res: any) => {
  131. state.tableData = res.result;
  132. state.loading = false;
  133. })
  134. .catch(() => {
  135. state.loading = false;
  136. });
  137. };
  138. // 排序
  139. const sortChange = (val: any) => {
  140. state.queryParams.SortField = val.order ? val.field : null;
  141. // 0 升序 1 降序
  142. state.queryParams.SortRule = val.order ? (val.order == 'desc' ? 1 : 0) : null;
  143. queryList();
  144. };
  145. /** 重置按钮操作 */
  146. const statisticalTimeRef = ref<RefType>();
  147. const resetQuery = (formEl: FormInstance | undefined) => {
  148. if (!formEl) return;
  149. formEl.resetFields();
  150. statisticalTimeRef.value.reset();
  151. queryList();
  152. };
  153. // 计算合计
  154. const footerMethod = ({ columns, data }) => {
  155. return [
  156. columns.map((column: any, columnIndex: number) => {
  157. if (columnIndex === 0) {
  158. return '合计';
  159. }
  160. if (['centreArchive', 'centreCareOf', 'noCentreCareOf', 'invalid', 'repeat', 'subtotal'].includes(column.property)) {
  161. return XEUtils.sum(data, column.property);
  162. }
  163. }),
  164. ];
  165. };
  166. const router = useRouter();
  167. // 跳转明细
  168. const onLink = () => {
  169. router.push({
  170. path: '/statistics/call/detailSeatsMoth',
  171. });
  172. };
  173. const toolbarRef = ref<RefType>();
  174. const tableRef = ref<RefType>();
  175. onMounted(() => {
  176. queryList();
  177. if (tableRef.value && toolbarRef.value) {
  178. tableRef.value.connect(toolbarRef.value);
  179. }
  180. });
  181. </script>