telephone.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <div class="statistics-call-telephone-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. >
  14. <template #table-search>
  15. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent label-width="100px">
  16. <el-row :gutter="10">
  17. <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
  18. <el-form-item label="时间段" prop="crTime">
  19. <el-date-picker
  20. v-model="state.queryParams.crTime"
  21. type="daterange"
  22. unlink-panels
  23. range-separator="至"
  24. start-placeholder="开始时间"
  25. end-placeholder="结束时间"
  26. :shortcuts="shortcuts"
  27. @change="handleQuery"
  28. value-format="YYYY-MM-DD"
  29. :clearable="false"
  30. />
  31. </el-form-item>
  32. </el-col>
  33. <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
  34. <el-form-item label="坐席人员" prop="Keyword">
  35. <el-input v-model="state.queryParams.Keyword" placeholder="坐席人员" clearable @keyup.enter="handleQuery" />
  36. </el-form-item>
  37. </el-col>
  38. <transition name="el-zoom-in-top">
  39. <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" v-show="!searchCol">
  40. <el-form-item label="工号" prop="Keyword">
  41. <el-input v-model="state.queryParams.Keyword" placeholder="工号" clearable @keyup.enter="handleQuery" />
  42. </el-form-item>
  43. </el-col>
  44. </transition>
  45. <transition name="el-zoom-in-top">
  46. <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" v-show="!searchCol">
  47. <el-form-item label="工作组" prop="Keyword">
  48. <el-input v-model="state.queryParams.Keyword" placeholder="工作组" clearable @keyup.enter="handleQuery" />
  49. </el-form-item>
  50. </el-col>
  51. </transition>
  52. <transition name="el-zoom-in-top">
  53. <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" v-show="!searchCol">
  54. <el-form-item label="动作类型" prop="DelayState">
  55. <el-select v-model="state.queryParams.DelayState" placeholder="动作类型" class="w100">
  56. <el-option v-for="item in delayStateOptions" :value="item.key" :key="item.key" :label="item.value" />
  57. </el-select>
  58. </el-form-item>
  59. </el-col>
  60. </transition>
  61. <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="8">
  62. <el-form-item label=" ">
  63. <div class="flex-end w100">
  64. <el-button type="primary" @click="handleQuery" :loading="state.loading">
  65. <SvgIcon name="ele-Search" class="mr5" />查询
  66. </el-button>
  67. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  68. <SvgIcon name="ele-Refresh" class="mr5" />重置
  69. </el-button>
  70. <el-button link type="primary" @click="closeSearch" :loading="state.loading">
  71. {{ searchCol ? '展开' : '收起' }}
  72. <SvgIcon :class="{ 'is-reverse': searchCol }" name="ele-ArrowUp" class="mr5 arrow" size="18px" />
  73. </el-button>
  74. </div>
  75. </el-form-item>
  76. </el-col>
  77. </el-row>
  78. </el-form>
  79. </template>
  80. </ProTable>
  81. </div>
  82. </div>
  83. </template>
  84. <script setup lang="tsx" name="statisticsCallTel">
  85. import { onMounted, reactive, ref } from 'vue';
  86. import { FormInstance } from 'element-plus';
  87. import { knowledgeList } from '@/api/statistics/knowledge';
  88. import { defaultDate, shortcuts } from '@/utils/constants';
  89. import { formatDate } from '@/utils/formatTime';
  90. import Other from "@/utils/other";
  91. const proTableRef = ref<RefType>(); // 表格ref
  92. // 表格配置项
  93. const columns = ref<any[]>([
  94. { prop: 'orgName', label: '坐席人员', align: 'center' },
  95. { prop: 'addNum', label: '工号', align: 'center', sortable: 'custom' },
  96. { prop: 'addNum', label: '工作组', align: 'center', sortable: 'custom' },
  97. { prop: 'addNum', label: '工作类型', align: 'center', sortable: 'custom' },
  98. {
  99. prop: 'addNum',
  100. label: '开始时间',
  101. align: 'center',
  102. sortable: 'custom',
  103. render: (scope) => <span>{formatDate(scope.row.expiredTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
  104. },
  105. {
  106. prop: 'deleteNum',
  107. label: '结束时间',
  108. align: 'center',
  109. sortable: 'custom',
  110. render: (scope) => <span>{formatDate(scope.row.expiredTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
  111. },
  112. { prop: 'deleteNum', label: '使用时间(秒)', align: 'center', sortable: 'custom' },
  113. ]);
  114. // 定义变量内容
  115. const ruleFormRef = ref<RefType>(); // 表单ref
  116. const state = reactive<any>({
  117. queryParams: {
  118. // 查询条件
  119. PageIndex: 1,
  120. PageSize: 10,
  121. Keyword: null, // 关键词
  122. crTime: defaultDate, // 时间默认今天开始到今天结束
  123. DelayState:null
  124. },
  125. tableData: [], //表单
  126. loading: false, // 加载
  127. total: 0, // 总数
  128. });
  129. const delayStateOptions = ref<EmptyArrayType>([]); // 延期状态
  130. const searchCol = ref(true); // 展开/收起
  131. // 展开/收起
  132. const closeSearch = () => {
  133. searchCol.value = !searchCol.value;
  134. };
  135. /** 搜索按钮操作 */
  136. const handleQuery = () => {
  137. // state.queryParams.PageIndex = 1;
  138. queryList();
  139. };
  140. /** 获取列表 */
  141. const requestParams = ref<EmptyObjectType>({});
  142. const queryList = () => {
  143. state.loading = true;
  144. requestParams.value = Other.deepClone(state.queryParams);
  145. requestParams.value.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  146. requestParams.value.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  147. Reflect.deleteProperty(requestParams.value, 'crTime');
  148. knowledgeList(requestParams.value)
  149. .then((res: any) => {
  150. state.tableData = res.result?.items ?? [];
  151. state.total = res.result?.total ?? 0;
  152. state.loading = false;
  153. })
  154. .catch(() => {
  155. state.loading = false;
  156. });
  157. };
  158. /** 重置按钮操作 */
  159. const resetQuery = (formEl: FormInstance | undefined) => {
  160. if (!formEl) return;
  161. formEl.resetFields();
  162. queryList();
  163. };
  164. onMounted(() => {
  165. queryList();
  166. });
  167. </script>
  168. <style lang="scss" scoped>
  169. .statistics-call-telephone-container {
  170. .arrow {
  171. transition: transform var(--el-transition-duration);
  172. cursor: pointer;
  173. }
  174. .arrow.is-reverse {
  175. transform: rotateZ(-180deg);
  176. }
  177. }
  178. </style>