zgCallLog.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <div class="tels-callLog-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <el-tabs v-model="state.queryParams.type" @tab-change="changeTba">
  5. <el-tab-pane name="1" label="呼入列表"></el-tab-pane>
  6. <el-tab-pane name="2" label="呼出列表"></el-tab-pane>
  7. <el-tab-pane name="3" label="未接列表"></el-tab-pane>
  8. </el-tabs>
  9. <ProTable
  10. ref="proTableRef"
  11. :columns="inColumns"
  12. :data="state.tableData"
  13. @updateTable="queryList"
  14. :loading="state.loading"
  15. :pagination="false"
  16. v-if="state.queryParams.type === '1'"
  17. >
  18. <template #table-search>
  19. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent label-minWidth="100px" inline>
  20. <el-form-item prop="FromNo">
  21. <el-input v-model="state.queryParams.FromNo" placeholder="主叫号码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  22. </el-form-item>
  23. <el-form-item prop="ToNo">
  24. <el-input v-model="state.queryParams.ToNo" placeholder="被叫号码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  25. </el-form-item>
  26. <el-form-item prop="IsMissOrder">
  27. <el-checkbox v-model="IsMissOrder" border @change="changeMissOrder">失联工单</el-checkbox>
  28. </el-form-item>
  29. <el-form-item label="" label-width="">
  30. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  31. <el-button @click="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
  32. </el-form-item>
  33. </el-form>
  34. </template>
  35. <template #operation="{ row }">
  36. <template v-if="['1', '2'].includes(state.queryParams.type)">
  37. <el-button link type="primary" @click="onCreate(row)" title="创建失联工单" v-auth="'tels:callLog:connectOrder'" v-if="!row.orderId">
  38. 失联工单
  39. </el-button>
  40. <!-- <el-button link type="primary" @click="onConnect(row)" title="关联业务" v-auth="'tels:callLog:connect'" v-if="!row.orderId">
  41. 关联业务
  42. </el-button>-->
  43. <el-button type="primary" @click="onPlaySoundRecording(row)" title="播放录音" link v-if="row.audioFile">播放录音</el-button>
  44. <el-button link type="primary" @click="onDownload(row)" title="下载录音" v-if="row.audioFile"> 下载录音 </el-button>
  45. </template>
  46. <template v-else>
  47. <el-button type="primary" @click="onPlaySoundRecording(row)" title="播放录音" link v-if="row.audioFile">播放录音</el-button>
  48. <el-button link type="primary" @click="onDownload(row)" title="下载录音" v-if="row.audioFile"> 下载录音 </el-button>
  49. </template>
  50. </template>
  51. <template #title="{ row }">
  52. <order-detail :order="{ ...row, id: row.orderId }" @updateList="queryList">{{ row.title }}</order-detail>
  53. </template>
  54. <template #pagination>
  55. <div class="flex-end mt10">
  56. <!-- <el-button class="default-button" @click="onChangeTotal">展示总数</el-button>-->
  57. <el-pagination
  58. layout="prev, pager, next"
  59. :total="state.total"
  60. @current-change="handleCurrentChange"
  61. :page-size="state.queryParams.PageSize"
  62. :current-page="state.queryParams.PageIndex"
  63. />
  64. </div>
  65. </template>
  66. </ProTable>
  67. <ProTable
  68. ref="proTableRef"
  69. :columns="outColumns"
  70. :data="state.tableData"
  71. @updateTable="queryList"
  72. :loading="state.loading"
  73. v-if="state.queryParams.type === '2'"
  74. :pagination="false"
  75. >
  76. <template #table-search>
  77. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent label-minWidth="100px" inline>
  78. <el-form-item prop="FromNo">
  79. <el-input v-model="state.queryParams.FromNo" placeholder="主叫号码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  80. </el-form-item>
  81. <el-form-item prop="ToNo">
  82. <el-input v-model="state.queryParams.ToNo" placeholder="被叫号码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  83. </el-form-item>
  84. <el-form-item label="" label-width="">
  85. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  86. <el-button @click="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
  87. </el-form-item>
  88. </el-form>
  89. </template>
  90. <template #operation="{ row }">
  91. <template v-if="['1', '2'].includes(state.queryParams.type)">
  92. <el-button link type="primary" @click="onCreate(row)" title="创建失联工单" v-auth="'tels:callLog:connectOrder'" v-if="!row.orderId">
  93. 失联工单
  94. </el-button>
  95. <!-- <el-button link type="primary" @click="onConnect(row)" title="关联业务" v-auth="'tels:callLog:connect'" v-if="!row.orderId">
  96. 关联业务
  97. </el-button>-->
  98. <el-button type="primary" @click="onPlaySoundRecording(row)" title="播放录音" link v-if="row.audioFile">播放录音</el-button>
  99. <el-button link type="primary" @click="onDownload(row)" title="下载录音" v-if="row.audioFile"> 下载录音 </el-button>
  100. </template>
  101. <template v-else>
  102. <el-button type="primary" @click="onPlaySoundRecording(row)" title="播放录音" link v-if="row.audioFile">播放录音</el-button>
  103. <el-button link type="primary" @click="onDownload(row)" title="下载录音" v-if="row.audioFile"> 下载录音 </el-button>
  104. </template>
  105. </template>
  106. <template #title="{ row }">
  107. <order-detail :order="{ ...row, id: row.orderId }" @updateList="queryList">{{ row.title }}</order-detail>
  108. </template>
  109. <template #pagination>
  110. <div class="flex-end mt10">
  111. <!-- <el-button class="default-button" @click="onChangeTotal">展示总数</el-button>-->
  112. <el-pagination
  113. layout="prev, pager, next"
  114. :total="state.total"
  115. @current-change="handleCurrentChange"
  116. :page-size="state.queryParams.PageSize"
  117. :current-page="state.queryParams.PageIndex"
  118. />
  119. </div>
  120. </template>
  121. </ProTable>
  122. <ProTable
  123. ref="proTableRef"
  124. :columns="noColumns"
  125. :data="state.tableData"
  126. @updateTable="queryList"
  127. :loading="state.loading"
  128. v-if="state.queryParams.type === '3'"
  129. :pagination="false"
  130. >
  131. <template #table-search>
  132. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent label-minWidth="100px" inline>
  133. <el-form-item prop="FromNo">
  134. <el-input v-model="state.queryParams.FromNo" placeholder="主叫号码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  135. </el-form-item>
  136. <el-form-item prop="ToNo">
  137. <el-input v-model="state.queryParams.ToNo" placeholder="被叫号码" clearable @keyup.enter="handleQuery" class="keyword-input" />
  138. </el-form-item>
  139. <el-form-item label="" label-width="">
  140. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  141. <el-button @click="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
  142. </el-form-item>
  143. </el-form>
  144. </template>
  145. <template #operation="{ row }">
  146. <template v-if="['1', '2'].includes(state.queryParams.type)">
  147. <el-button link type="primary" @click="onCreate(row)" title="创建失联工单" v-auth="'tels:callLog:connectOrder'" v-if="!row.orderId">
  148. 失联工单
  149. </el-button>
  150. <!-- <el-button link type="primary" @click="onConnect(row)" title="关联业务" v-auth="'tels:callLog:connect'" v-if="!row.orderId">
  151. 关联业务
  152. </el-button>-->
  153. <el-button type="primary" @click="onPlaySoundRecording(row)" title="播放录音" link v-if="row.audioFile">播放录音</el-button>
  154. <el-button link type="primary" @click="onDownload(row)" title="下载录音" v-if="row.audioFile"> 下载录音 </el-button>
  155. </template>
  156. <template v-else>
  157. <el-button type="primary" @click="onPlaySoundRecording(row)" title="播放录音" link v-if="row.audioFile">播放录音</el-button>
  158. <el-button link type="primary" @click="onDownload(row)" title="下载录音" v-if="row.audioFile"> 下载录音 </el-button>
  159. </template>
  160. </template>
  161. <template #title="{ row }">
  162. <order-detail :order="{ ...row, id: row.orderId }" @updateList="queryList">{{ row.title }}</order-detail>
  163. </template>
  164. <template #pagination>
  165. <div class="flex-end mt10">
  166. <!-- <el-button class="default-button" @click="onChangeTotal">展示总数</el-button>-->
  167. <el-pagination
  168. layout="prev, pager, next"
  169. :total="state.total"
  170. @current-change="handleCurrentChange"
  171. :page-size="state.queryParams.PageSize"
  172. :current-page="state.queryParams.PageIndex"
  173. />
  174. </div>
  175. </template>
  176. </ProTable>
  177. <el-drawer v-model="drawer" title="更多查询" size="500px">
  178. <el-form :model="state.queryParams" ref="drawerRuleFormRef" @submit.native.prevent label-width="100px">
  179. <el-form-item prop="TelNo" label="响应分机">
  180. <el-input v-model="state.queryParams.TelNo" placeholder="响应分机" clearable @keyup.enter="handleQuery" />
  181. </el-form-item>
  182. <el-form-item prop="crTime" label="时间段">
  183. <el-date-picker
  184. v-model="state.queryParams.crTime"
  185. type="datetimerange"
  186. unlink-panels
  187. range-separator="至"
  188. start-placeholder="开始时间"
  189. end-placeholder="挂断时间"
  190. :shortcuts="shortcuts"
  191. @change="handleQuery"
  192. value-format="YYYY-MM-DD[T]HH:mm:ss"
  193. :default-time="defaultTimeStartEnd"
  194. />
  195. </el-form-item>
  196. <el-form-item prop="Direction" v-show="['3'].includes(state.queryParams.type)" label="电话方向">
  197. <el-select v-model="state.queryParams.Direction" placeholder="电话方向" clearable class="w100" @change="handleQuery">
  198. <el-option v-for="item in state.callDirectionOption" :value="item.key" :key="item.key" :label="item.value" />
  199. </el-select>
  200. </el-form-item>
  201. <el-form-item prop="EndBy" v-show="['4'].includes(state.queryParams.type)" label="挂断状态">
  202. <el-select v-model="state.queryParams.EndBy" placeholder="挂断状态" clearable class="w100" @change="handleQuery">
  203. <el-option v-for="item in state.endByOptions" :value="item.key" :key="item.key" :label="item.value" />
  204. </el-select>
  205. </el-form-item>
  206. <el-form-item prop="UserName" v-show="['1'].includes(state.queryParams.type)" label="话务员名称">
  207. <el-input v-model="state.queryParams.UserName" placeholder="话务员名称" clearable @keyup.enter="handleQuery" />
  208. </el-form-item>
  209. <el-form-item prop="OrderNo" v-show="['0', '1'].includes(state.queryParams.type)" label="工单编码">
  210. <el-input v-model="state.queryParams.OrderNo" placeholder="工单编码" clearable @keyup.enter="handleQuery" />
  211. </el-form-item>
  212. <el-form-item prop="Title" v-show="['0', '1'].includes(state.queryParams.type)" label="工单标题">
  213. <el-input v-model="state.queryParams.Title" placeholder="工单标题" clearable @keyup.enter="handleQuery" />
  214. </el-form-item>
  215. <el-form-item prop="WaitDurationStart" v-show="['3'].includes(state.queryParams.type)" label="等待时长">
  216. <el-row :gutter="10">
  217. <el-col :span="12">
  218. <el-input placeholder="等待时长开始" v-model.number="state.queryParams.WaitDurationStart" clearable />
  219. </el-col>
  220. <el-col :span="12">
  221. <el-input placeholder="等待时长结束" v-model.number="state.queryParams.WaitDurationEnd" clearable />
  222. </el-col>
  223. </el-row>
  224. </el-form-item>
  225. </el-form>
  226. <template #footer>
  227. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  228. <el-button @click="resetQuery(drawerRuleFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
  229. </template>
  230. </el-drawer>
  231. </div>
  232. <!-- 播放录音 -->
  233. <play-record ref="playRecordRef" />
  234. <!-- 业务关联 -->
  235. <connect-business ref="connectBusinessRef" @updateList="queryList" />
  236. </div>
  237. </template>
  238. <script lang="tsx" setup name="callLog">
  239. import { defineAsyncComponent, onMounted, reactive, ref, onActivated, onBeforeUnmount } from 'vue';
  240. import type { FormInstance } from 'element-plus';
  241. import { ElMessageBox } from 'element-plus';
  242. import { downloadFileBySrc, getNeedArr } from '@/utils/tools';
  243. import { formatDate } from '@/utils/formatTime';
  244. import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
  245. import { useRouter } from 'vue-router';
  246. import mittBus from '@/utils/mitt';
  247. import Other from '@/utils/other';
  248. import { getCallCenterCallRecord, getCallCenterCallRecordBaseData } from '@/api/callCenter';
  249. import { useThemeConfig } from '@/stores/themeConfig';
  250. import { storeToRefs } from 'pinia';
  251. // 引入组件
  252. const PlayRecord = defineAsyncComponent(() => import('@/components/PlayRecord/index.vue')); // 播放录音
  253. const ConnectBusiness = defineAsyncComponent(() => import('@/views/tels/callLog/components/Connect-business.vue')); // 关联工单还是回访
  254. const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
  255. const proTableRef = ref<RefType>(); // 表格ref
  256. // 表格配置项
  257. // 定义变量内容
  258. const state = reactive<any>({
  259. queryParams: {
  260. PageIndex: 1, // 当前页
  261. PageSize: 20, // 每页条数
  262. type: '1', // 默认呼入列表
  263. IsConnected: null, // 接通状态
  264. FromNo: null, // 主叫
  265. ToNo: null, // 被叫
  266. UserName: null, // 话务员名称
  267. TelNo: null, // 分机号
  268. EndBy: null, //挂断
  269. Direction: null, // 通话方向
  270. crTime: [], // 时间
  271. CallStartTimeStart: null,
  272. CallStartTimeEnd: null,
  273. WaitDurationStart: null,
  274. WaitDurationEnd: null,
  275. IsMissOrder:null,
  276. },
  277. tableData: [], // 列表数据
  278. loading: false, // 加载
  279. total: 0, // 总条数
  280. callDirection: [],
  281. onState: [],
  282. endByOptions: [],
  283. });
  284. const ruleFormRef = ref<FormInstance>(); // 表单ref
  285. // 呼入列表表头(已接通)
  286. const inColumns = ref<any[]>([
  287. { prop: 'fromNo', label: '主叫号码', minWidth: 120 },
  288. { prop: 'toNo', label: '被叫号码', minWidth: 120 },
  289. { prop: 'orderNo', label: '工单编码', minWidth: 140 },
  290. { prop: 'title', label: '工单标题', minWidth: 200 },
  291. { prop: 'telNo', label: '响应分机' },
  292. { prop: 'mobileAreaName', label: '号码归属地', minWidth: 120 },
  293. { prop: 'userName', label: '话务员', minWidth: 100 },
  294. { prop: 'groupId', label: '功能组号码', minWidth: 120 },
  295. { prop: 'duration', label: '通话时间(秒)', minWidth: 110 },
  296. { prop: 'endByText', label: '挂断状态', minWidth: 100 },
  297. {
  298. prop: 'beginIvrTime',
  299. label: '开始时间',
  300. minWidth: 160,
  301. render: (scope: any) => <span>{formatDate(scope.row.beginIvrTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
  302. },
  303. {
  304. prop: 'answeredTime',
  305. label: '接通时间',
  306. minWidth: 160,
  307. render: (scope: any) => <span>{formatDate(scope.row.answeredTime, ' YYYY-mm-dd HH:MM:SS')}</span>,
  308. },
  309. { prop: 'endTime', label: '挂断时间', minWidth: 160, render: (scope: any) => <span>{formatDate(scope.row.endTime, 'YYYY-mm-dd HH:MM:SS')}</span> },
  310. { prop: 'operation', label: '操作', fixed: 'right', minWidth: 240, align: 'center' },
  311. ]);
  312. // 呼出列表表头(已接通)
  313. const outColumns = ref<any[]>([
  314. { prop: 'fromNo', label: '主叫号码', minWidth: 120 },
  315. { prop: 'toNo', label: '被叫号码', minWidth: 120 },
  316. { prop: 'telNo', label: '响应分机' },
  317. { prop: 'orderNo', label: '工单编码', minWidth: 140 },
  318. { prop: 'title', label: '工单标题', minWidth: 200 },
  319. { prop: 'endByText', label: '挂断状态', minWidth: 100 },
  320. { prop: 'groupId', label: '功能组号码', minWidth: 120 },
  321. { prop: 'duration', label: '通话时间(秒)', minWidth: 110 },
  322. {
  323. prop: 'beginIvrTime',
  324. label: '开始时间',
  325. minWidth: 160,
  326. render: (scope: any) => <span>{formatDate(scope.row.beginIvrTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
  327. },
  328. {
  329. prop: 'answeredTime',
  330. label: '接通时间',
  331. minWidth: 160,
  332. render: (scope: any) => <span>{formatDate(scope.row.answeredTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
  333. },
  334. { prop: 'endTime', label: '挂断时间', minWidth: 160, render: (scope: any) => <span>{formatDate(scope.row.endTime, 'YYYY-mm-dd HH:MM:SS')}</span> },
  335. { prop: 'operation', label: '操作', fixed: 'right', minWidth: 240, align: 'center' },
  336. ]);
  337. // 未接表头
  338. const noColumns = ref<any[]>([
  339. { prop: 'directionText', label: '呼叫方向' },
  340. { prop: 'fromNo', label: '主叫号码', minWidth: 120 },
  341. { prop: 'toNo', label: '被叫号码', minWidth: 120 },
  342. { prop: 'telNo', label: '响应分机' },
  343. { prop: 'groupId', label: '功能组号码', minWidth: 120 },
  344. {
  345. prop: 'beginIvrTime',
  346. label: '开始时间',
  347. minWidth: 160,
  348. render: (scope: any) => <span>{formatDate(scope.row.beginIvrTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
  349. },
  350. { prop: 'endTime', label: '挂断时间', minWidth: 160, render: (scope: any) => <span>{formatDate(scope.row.endTime, 'YYYY-mm-dd HH:MM:SS')}</span> },
  351. { prop: 'waitDuration', label: '等待时长(秒)', minWidth: 110 },
  352. { prop: 'operation', label: '操作', fixed: 'right', minWidth: 160, align: 'center' },
  353. ]);
  354. const changeTba = () => {
  355. ruleFormRef.value?.resetFields();
  356. drawerRuleFormRef.value?.resetFields();
  357. handleQuery();
  358. };
  359. // 手动查询,将页码设置为1
  360. const handleQuery = () => {
  361. state.queryParams.PageIndex = 1;
  362. queryIndex.value = 0;
  363. queryList(true);
  364. };
  365. // 改变页码
  366. const queryIndex = ref(0); // 数据批次
  367. const totalTable = ref([]); // 数据总数
  368. const handleCurrentChange = (val: number) => {
  369. state.queryParams.PageIndex = val;
  370. // 判断当前页是否是数据的最后一页
  371. if (val === Math.ceil(state.total / state.queryParams.PageSize)) {
  372. queryList();
  373. } else {
  374. state.tableData = getNeedArr(totalTable.value, state.queryParams.PageSize)[state.queryParams.PageIndex - 1]; //当前页的表格数据
  375. }
  376. };
  377. /** 通话记录列表 */
  378. const requestParams = ref<EmptyObjectType>({});
  379. const queryList = async (isQuery: boolean = false) => {
  380. state.loading = true;
  381. requestParams.value = Other.deepClone(state.queryParams);
  382. requestParams.value.CallStartTimeStart = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  383. requestParams.value.CallStartTimeEnd = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  384. Reflect.deleteProperty(requestParams.value, 'crTime'); // 通话开始和结束时间段
  385. requestParams.value.QueryIndex = queryIndex.value; // 数据批次
  386. state.loading = true;
  387. getCallCenterCallRecord(requestParams.value)
  388. .then((response: any) => {
  389. if (isQuery) {
  390. // 如果是查询
  391. totalTable.value = []; // 先清空
  392. totalTable.value = response?.result;
  393. state.total = totalTable.value.length;
  394. state.tableData = getNeedArr(totalTable.value, state.queryParams.PageSize)[state.queryParams.PageIndex - 1]; //当前页的表格数据
  395. queryIndex.value = 1;
  396. } else {
  397. if (response?.result.length) queryIndex.value++;
  398. totalTable.value = totalTable.value.concat(response?.result);
  399. state.total = totalTable.value.length;
  400. state.tableData = getNeedArr(totalTable.value, state.queryParams.PageSize)[state.queryParams.PageIndex - 1]; //当前页的表格数据
  401. }
  402. state.loading = false;
  403. })
  404. .catch(() => {
  405. state.loading = false;
  406. });
  407. };
  408. // 失联工单
  409. const IsMissOrder = ref(false);
  410. const changeMissOrder = (val: any)=>{
  411. if(!val) state.queryParams.IsMissOrder = null;
  412. else state.queryParams.IsMissOrder = val;
  413. handleQuery();
  414. }
  415. /** 重置按钮操作 */
  416. const drawer = ref(false);
  417. const drawerRuleFormRef = ref();
  418. const resetQuery = (formEl: FormInstance | undefined) => {
  419. if (!formEl) return;
  420. formEl.resetFields();
  421. queryIndex.value = 0;
  422. ruleFormRef.value?.resetFields();
  423. IsMissOrder.value = false;
  424. queryList(true);
  425. };
  426. // 播放录音
  427. const playRecordRef = ref<RefType>();
  428. const storesThemeConfig = useThemeConfig();
  429. const { themeConfig } = storeToRefs(storesThemeConfig);
  430. const onPlaySoundRecording = (val: any) => {
  431. playRecordRef.value.openDialog(val.id);
  432. };
  433. // 下载录音
  434. const onDownload = (row: any) => {
  435. ElMessageBox.confirm(`您确定要下载此录音吗?`, '提示', {
  436. confirmButtonText: '确认',
  437. cancelButtonText: '取消',
  438. type: 'warning',
  439. draggable: true,
  440. cancelButtonClass: 'default-button',
  441. autofocus: false,
  442. })
  443. .then(() => {
  444. // window.open(themeConfig.value.recordPrefix + row.audioFile);
  445. downloadFileBySrc(themeConfig.value.recordPrefix + row.audioFile, row.audioFile);
  446. })
  447. .catch(() => {});
  448. };
  449. // 失联工单
  450. const router = useRouter();
  451. const onCreate = (row: any) => {
  452. router.push({
  453. name: 'orderAccept',
  454. query: {
  455. createBy: 'tel',
  456. fromTel: row.fromNo,
  457. callId: row.id,
  458. transfer: row.toNo,
  459. telArea: '',
  460. },
  461. });
  462. };
  463. // 基础信息
  464. const getBaseData = async () => {
  465. try {
  466. const { result } = await getCallCenterCallRecordBaseData();
  467. state.callDirectionOption = result.direction;
  468. state.endByOptions = result.endBy;
  469. } catch (e) {
  470. console.log(e);
  471. }
  472. };
  473. onMounted(() => {
  474. getBaseData();
  475. queryList();
  476. });
  477. onActivated(() => {
  478. mittBus.on('clearCachePage', () => {
  479. //清除缓存
  480. queryList();
  481. });
  482. });
  483. onBeforeUnmount(() => {
  484. mittBus.off('clearCachePage');
  485. });
  486. </script>
  487. <style lang="scss" scoped>
  488. .tels-callLog-container {
  489. :deep(.pro-table-main) {
  490. height: calc(100% - 42px);
  491. }
  492. }
  493. </style>