123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773 |
- <template>
- <div class="tels-callLog-container layout-pd">
- <el-card shadow="never">
- <el-tabs v-model="state.queryParams.type" @tab-change="changeTba">
- <el-tab-pane name="0" label="全部"></el-tab-pane>
- <el-tab-pane name="1" label="呼入已接"></el-tab-pane>
- <el-tab-pane name="2" label="呼出已接"></el-tab-pane>
- <el-tab-pane name="3" label="未接"></el-tab-pane>
- </el-tabs>
- <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent label-width="20px">
- <el-row :gutter="10">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
- <el-form-item prop="CPN">
- <el-input v-model="state.queryParams.CPN" placeholder="主叫号码" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
- <el-form-item prop="CDPN">
- <el-input v-model="state.queryParams.CDPN" placeholder="被叫号码" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="['0', '1', '3'].includes(state.queryParams.type)">
- <el-form-item prop="TelNo">
- <el-input v-model="state.queryParams.TelNo" placeholder="响应分机" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- </el-col>
- <!-- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
- <el-form-item prop="gateway">
- <el-input v-model="state.queryParams.gateway" placeholder="中继号码" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- </el-col>-->
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
- <el-form-item prop="UserName">
- <el-input v-model="state.queryParams.UserName" placeholder="话务员名称" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- </el-col>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0', '3'].includes(state.queryParams.type)">
- <el-form-item prop="CallDirection">
- <el-select v-model="state.queryParams.CallDirection" placeholder="电话方向" clearable class="w100" @change="handleQuery">
- <el-option v-for="item in state.callDirection" :value="item.key" :key="item.key" :label="item.value" />
- </el-select>
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0'].includes(state.queryParams.type)">
- <el-form-item prop="OnState">
- <el-select v-model="state.queryParams.OnState" placeholder="通话结果" clearable class="w100" @change="handleQuery">
- <el-option v-for="item in state.onState" :value="item.key" :key="item.key" :label="item.value" />
- </el-select>
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
- <el-form-item prop="EndBy">
- <el-select v-model="state.queryParams.EndBy" placeholder="挂机类型" clearable class="w100" @change="handleQuery">
- <el-option v-for="item in state.endByOptions" :value="item.key" :key="item.key" :label="item.value" />
- </el-select>
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
- <el-form-item prop="callTime">
- <el-date-picker
- v-model="state.queryParams.callTime"
- type="datetimerange"
- unlink-panels
- range-separator="至"
- start-placeholder="开始开始时间"
- end-placeholder="开始结束时间"
- :shortcuts="shortcuts"
- @change="callTimeChange"
- value-format="YYYY-MM-DD[T]HH:mm:ss"
- />
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0', '1', '2'].includes(state.queryParams.type)">
- <el-form-item prop="answeredTime">
- <el-date-picker
- v-model="state.queryParams.answeredTime"
- type="datetimerange"
- unlink-panels
- range-separator="至"
- start-placeholder="接通开始时间"
- end-placeholder="接通结束时间"
- :shortcuts="shortcuts"
- @change="answeredTimeChange"
- value-format="YYYY-MM-DD[T]HH:mm:ss"
- />
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol">
- <el-form-item prop="overTime">
- <el-date-picker
- v-model="state.queryParams.overTime"
- type="datetimerange"
- unlink-panels
- range-separator="至"
- start-placeholder="挂断开始时间"
- end-placeholder="挂断结束时间"
- :shortcuts="shortcuts"
- @change="overTimeChange"
- value-format="YYYY-MM-DD[T]HH:mm:ss"
- />
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0', '1', '3'].includes(state.queryParams.type)">
- <el-form-item prop="beginIvrTime">
- <el-date-picker
- v-model="state.queryParams.beginIvrTime"
- type="datetimerange"
- unlink-panels
- range-separator="至"
- start-placeholder="ivr开始开始时间"
- end-placeholder="ivr开始结束时间"
- :shortcuts="shortcuts"
- @change="beginIvrTimeChange"
- value-format="YYYY-MM-DD[T]HH:mm:ss"
- />
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0', '1', '3'].includes(state.queryParams.type)">
- <el-form-item prop="endIvrTime">
- <el-date-picker
- v-model="state.queryParams.endIvrTime"
- type="datetimerange"
- unlink-panels
- range-separator="至"
- start-placeholder="ivr结束开始时间"
- end-placeholder="ivr结束结束时间"
- :shortcuts="shortcuts"
- @change="endIvrTimeChange"
- value-format="YYYY-MM-DD[T]HH:mm:ss"
- />
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0', '1', '3'].includes(state.queryParams.type)">
- <el-form-item prop="beginQueueTime">
- <el-date-picker
- v-model="state.queryParams.beginQueueTime"
- type="datetimerange"
- unlink-panels
- range-separator="至"
- start-placeholder="队列开始开始时间"
- end-placeholder="队列开始结束时间"
- :shortcuts="shortcuts"
- @change="beginQueueTimeChange"
- value-format="YYYY-MM-DD[T]HH:mm:ss"
- />
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0', '1', '3'].includes(state.queryParams.type)">
- <el-form-item prop="endQueueTime">
- <el-date-picker
- v-model="state.queryParams.endQueueTime"
- type="datetimerange"
- unlink-panels
- range-separator="至"
- start-placeholder="队列结束开始时间"
- end-placeholder="队列结束结束时间"
- :shortcuts="shortcuts"
- @change="endQueueTimeChange"
- value-format="YYYY-MM-DD[T]HH:mm:ss"
- />
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0', '1', '3'].includes(state.queryParams.type)">
- <el-form-item prop="beginRingTime">
- <el-date-picker
- v-model="state.queryParams.beginRingTime"
- type="datetimerange"
- unlink-panels
- range-separator="至"
- start-placeholder="振铃开始开始时间"
- end-placeholder="振铃开始结束时间"
- :shortcuts="shortcuts"
- @change="beginRingTimeChange"
- value-format="YYYY-MM-DD[T]HH:mm:ss"
- />
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0', '1', '3'].includes(state.queryParams.type)">
- <el-form-item prop="endRingTime">
- <el-date-picker
- v-model="state.queryParams.endRingTime"
- type="datetimerange"
- unlink-panels
- range-separator="至"
- start-placeholder="振铃结束开始时间"
- end-placeholder="振铃结束结束时间"
- :shortcuts="shortcuts"
- @change="endRingTimeChange"
- value-format="YYYY-MM-DD[T]HH:mm:ss"
- />
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0', '1'].includes(state.queryParams.type)">
- <el-form-item prop="OrderNo">
- <el-input v-model="state.queryParams.OrderNo" placeholder="工单编码" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- </el-col>
- </transition>
- <transition name="el-zoom-in-top">
- <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" v-show="!searchCol && ['0', '1'].includes(state.queryParams.type)">
- <el-form-item prop="Title">
- <el-input v-model="state.queryParams.Title" placeholder="工单标题" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- </el-col>
- </transition>
- </el-row>
- <div class="w100 ml20">
- <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
- <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
- <SvgIcon name="ele-Refresh" class="mr5" />重置
- </el-button>
- <el-button link type="primary" @click="closeSearch" :loading="state.loading">
- {{ searchCol ? '展开' : '收起' }}
- <SvgIcon :class="{ 'is-reverse': searchCol }" name="ele-ArrowUp" class="mr5 arrow" size="18px" />
- </el-button>
- </div>
- </el-form>
- </el-card>
- <el-card shadow="never">
- <ProTable
- ref="proTableRef"
- :columns="columns"
- :data="state.tableData"
- @updateTable="queryList"
- :loading="state.loading"
- :total="state.total"
- v-model:page-index="state.queryParams.PageIndex"
- v-model:page-size="state.queryParams.PageSize"
- :key="Math.random()"
- >
- <!-- 表格操作 -->
- <template #operation="{ row }">
- <template v-if="['0', '1'].includes(state.queryParams.type)">
- <el-button link type="primary" @click="onCreate(row)" title="创建失联工单" v-auth="'tels:callLog:connectOrder'" v-if="!row.externalId">
- 失联工单
- </el-button>
- <el-button link type="primary" @click="onConnect(row)" title="关联业务" v-auth="'tels:callLog:connect'" v-if="!row.externalId">
- 关联业务
- </el-button>
- <el-button type="primary" @click="onPlaySoundRecording(row)" title="播放录音" link v-if="row.recordingAbsolutePath">播放录音</el-button>
- <el-button link type="primary" @click="onDownload(row)" title="下载录音" v-if="row.recordingAbsolutePath"> 下载录音 </el-button>
- </template>
- <template v-else>
- <el-button type="primary" @click="onPlaySoundRecording(row)" title="播放录音" link v-if="row.recordingAbsolutePath">播放录音</el-button>
- <el-button link type="primary" @click="onDownload(row)" title="下载录音" v-if="row.recordingAbsolutePath"> 下载录音 </el-button>
- </template>
- </template>
- <template #title="{ row }">
- <order-detail :order="row.order" @updateList="queryList">{{ row.order?.title }}</order-detail>
- </template>
- </ProTable>
- </el-card>
- <!-- 播放录音 -->
- <play-record ref="playRecordRef" />
- <!-- 业务关联 -->
- <connect-business ref="connectBusinessRef" @updateList="queryList" />
- </div>
- </template>
- <script lang="tsx" setup name="callLog">
- import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
- import type { FormInstance } from 'element-plus';
- import { ElMessageBox } from 'element-plus';
- import { downloadFileByStream } from '@/utils/tools';
- import { callBaseData, callLogPaged } from '@/api/tels/callLog';
- import { formatDate } from '@/utils/formatTime';
- import { shortcuts } from '@/utils/constants';
- import other from '@/utils/other';
- import { useRouter } from 'vue-router';
- import { fileDownload } from '@/api/public/file';
- // 引入组件
- const PlayRecord = defineAsyncComponent(() => import('@/views/tels/callLog/component/Play-record.vue')); // 播放录音
- const ConnectBusiness = defineAsyncComponent(() => import('@/views/tels/callLog/component/Connect-business.vue')); // 关联工单还是回访
- const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
- const proTableRef = ref<RefType>(); // 表格ref
- // 表格配置项
- const columns = ref<any[]>([]);
- // 定义变量内容
- const state = reactive({
- queryParams: {
- PageIndex: 1, // 当前页
- PageSize: 10, // 每页条数
- type: '0',
- StaffNo: null, // 分机号
- CPN: null, // 中继号码
- CDPN: null, // 分机号
- callDirection: null, // 呼叫类型
- OnState: null, // 结果
- callTime: [], // 通话时间
- answeredTime: [], // 接通时间
- overTime: [], // 挂断时间段
- beginIvrTime: [], // ivr开始时间段
- endIvrTime: [], // ivr结束时间段
- beginQueueTime: [], // 队列开始时间段
- endQueueTime: [], // 队列结束时间段
- beginRingTime: [], // 振铃开始时间段
- endRingTime: [], // 振铃结束时间段
- CallTimeStart: null, // 通话开始时间
- CallTimeEnd: null, // 通话结束时间
- OverTimeStart: null, // 挂断开始时间
- OverTimeEnd: null, // 挂断结束时间
- AnsweredTimeStart: null, // 接通开始时间
- AnsweredTimeEnd: null, // 接通结束时间
- BeginIvrTimeStart: null, // ivr开始开始时间
- BeginIvrTimeEnd: null, // ivr开始结束时间
- EndIvrTimeStart: null, // ivr结束开始时间
- EndIvrTimeEnd: null, // ivr结束结束时间
- BeginQueueTimeStart: null, // 队列开始开始时间
- BeginQueueTimeEnd: null, // 队列开始结束时间
- EndQueueTimeStart: null, // 队列结束开始时间
- EndQueueTimeEnd: null, // 队列结束结束时间
- BeginRingTimeStart: null, // 振铃开始开始时间
- BeginRingTimeEnd: null, // 振铃开始结束时间
- EndRingTimeStart: null, // 振铃结束开始时间
- EndRingTimeEnd: null, // 振铃结束结束时间
- },
- tableData: [], // 列表数据
- loading: false, // 加载
- total: 0, // 总条数
- callDirection: [],
- onState: [],
- endByOptions: [],
- });
- const ruleFormRef = ref<FormInstance>(); // 表单ref
- const searchCol = ref(true); // 展开/收起
- // 展开/收起
- const closeSearch = () => {
- searchCol.value = !searchCol.value;
- };
- const handleTimeChange = (val: string[], startKey: string, endKey: string) => {
- if (val) {
- state.queryParams[startKey] = val[0];
- state.queryParams[endKey] = val[1];
- } else {
- state.queryParams[startKey] = null;
- state.queryParams[endKey] = null;
- }
- handleQuery();
- };
- // 通话开始和结束时间段
- const callTimeChange = (val: string[]) => {
- handleTimeChange(val, 'CallTimeStart', 'CallTimeEnd');
- };
- // 接通开始和结束时间段
- const answeredTimeChange = (val: string[]) => {
- handleTimeChange(val, 'AnsweredTimeStart', 'AnsweredTimeEnd');
- };
- // 挂断开始和结束时间段
- const overTimeChange = (val: string[]) => {
- handleTimeChange(val, 'OverTimeStart', 'OverTimeEnd');
- };
- // IVR开始时间段
- const beginIvrTimeChange = (val: string[]) => {
- handleTimeChange(val, 'BeginIvrTimeStart', 'BeginIvrTimeEnd');
- };
- // IVR结束时间段
- const endIvrTimeChange = (val: string[]) => {
- handleTimeChange(val, 'EndIvrTimeStart', 'EndIvrTimeEnd');
- };
- // 队列开始时间段
- const beginQueueTimeChange = (val: string[]) => {
- handleTimeChange(val, 'BeginQueueTimeStart', 'BeginQueueTimeEnd');
- };
- // 队列结束时间段
- const endQueueTimeChange = (val: string[]) => {
- handleTimeChange(val, 'EndQueueTimeStart', 'EndQueueTimeEnd');
- };
- // 振铃开始和结束时间段
- const beginRingTimeChange = (val: string[]) => {
- handleTimeChange(val, 'BeginRingTimeStart', 'BeginRingTimeEnd');
- };
- // 振铃结束时间段
- const endRingTimeChange = (val: string[]) => {
- handleTimeChange(val, 'EndRingTimeStart', 'EndRingTimeEnd');
- };
- // 全部表头
- const allColumns = [
- { prop: 'cpn', label: '主叫号码', width: 120 },
- { prop: 'cdpn', label: '被叫号码', width: 120 },
- { prop: 'order.no', label: '工单编码', width: 150 },
- { prop: 'title', label: '工单标题', width: 300 },
- { prop: 'telNo', label: '响应分机', width: 120 },
- { prop: 'gateway', label: '中继号码', width: 120 },
- { prop: 'userName', label: '话务员', width: 120 },
- { prop: 'duration', label: '通话时间(秒)', width: 120 },
- { prop: 'onStateText', label: '通话结果' },
- { prop: 'callDirectionText', label: '电话方向' },
- { prop: 'endByText', label: '挂机类型', width: 120 },
- {
- prop: 'createdTime',
- label: '开始时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.createdTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'answeredTime',
- label: '接通时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.answeredTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- { prop: 'overTime', label: '挂断时间', width: 170, render: (scope) => <span>{formatDate(scope.row.overTime, 'YYYY-mm-dd HH:MM:SS')}</span> },
- {
- prop: 'beginIvrTime',
- label: 'ivr开始时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.beginIvrTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'endIvrTime',
- label: 'ivr结束时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.endIvrTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'beginQueueTime',
- label: '队列开始时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.beginQueueTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'endQueueTime',
- label: '队列结束时间',
- width: 170,
- render: (scope) => {
- return <span>{formatDate(scope.row.endQueueTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- {
- prop: 'beginRingTime',
- label: '开始振铃时间',
- width: 170,
- render: (scope) => {
- return <span>{formatDate(scope.row.beginRingTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- {
- prop: 'endRingTimg',
- label: '结束振铃时间',
- width: 170,
- render: (scope) => {
- return <span>{formatDate(scope.row.endRingTimg, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- { prop: 'operation', label: '操作', fixed: 'right', width: 310, align: 'center' },
- ];
- // 呼入表头
- const inColumns = [
- { prop: 'cpn', label: '主叫号码', width: 120 },
- { prop: 'cdpn', label: '被叫号码', width: 120 },
- { prop: 'order.no', label: '工单编码', width: 150 },
- { prop: 'title', label: '工单标题', width: 300 },
- { prop: 'telNo', label: '响应分机', width: 120 },
- { prop: 'gateway', label: '中继号码', width: 120 },
- { prop: 'userName', label: '话务员', width: 120 },
- { prop: 'duration', label: '通话时间(秒)', width: 120 },
- { prop: 'endByText', label: '挂机类型', width: 120 },
- {
- prop: 'createdTime',
- label: '开始时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.createdTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'answeredTime',
- label: '接通时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.answeredTime, ' YYYY-mm-dd HH:MM:SS')}</span>,
- },
- { prop: 'overTime', label: '挂断结束时间', width: 170, render: (scope) => <span>{formatDate(scope.row.overTime, 'YYYY-mm-dd HH:MM:SS')}</span> },
- {
- prop: 'beginIvrTime',
- label: 'ivr开始时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.beginIvrTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'endIvrTime',
- label: 'ivr结束时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.endIvrTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'beginQueueTime',
- label: '队列开始时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.beginQueueTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'endQueueTime',
- label: '队列结束时间',
- width: 170,
- render: (scope) => {
- return <span>{formatDate(scope.row.endQueueTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- {
- prop: 'beginRingTime',
- label: '开始振铃时间',
- width: 170,
- render: (scope) => {
- return <span>{formatDate(scope.row.beginRingTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- {
- prop: 'endRingTimg',
- label: '结束振铃时间',
- width: 170,
- render: (scope) => {
- return <span>{formatDate(scope.row.endRingTimg, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- { prop: 'operation', label: '操作', fixed: 'right', width: 310, align: 'center' },
- ];
- // 呼出表头
- const outColumns = [
- { prop: 'cpn', label: '主叫号码', width: 120 },
- { prop: 'cdpn', label: '被叫号码', width: 120 },
- { prop: 'telNo', label: '响应分机' },
- { prop: 'gateway', label: '中继号码', width: 120 },
- { prop: 'userName', label: '话务员' },
- { prop: 'duration', label: '通话时间(秒)', width: 120 },
- { prop: 'endByText', label: '挂机类型', width: 120 },
- {
- prop: 'createdTime',
- label: '开始时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.createdTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'answeredTime',
- label: '接通时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.answeredTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- { prop: 'overTime', label: '挂断时间', width: 170, render: (scope) => <span>{formatDate(scope.row.overTime, 'YYYY-mm-dd HH:MM:SS')}</span> },
- { prop: 'operation', label: '操作', fixed: 'right', width: 180, align: 'center' },
- ];
- // 未接表头
- const noColumns = [
- { prop: 'cpn', label: '主叫号码', width: 120 },
- { prop: 'cdpn', label: '被叫号码', width: 120 },
- { prop: 'telNo', label: '响应分机' },
- { prop: 'gateway', label: '中继号码', width: 120 },
- { prop: 'userName', label: '话务员' },
- { prop: 'callDirectionText', label: '电话方向' },
- {
- prop: 'createdTime',
- label: '开始时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.createdTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- { prop: 'overTime', label: '挂断时间', width: 170, render: (scope) => <span>{formatDate(scope.row.overTime, 'YYYY-mm-dd HH:MM:SS')}</span> },
- {
- prop: 'beginIvrTime',
- label: 'ivr开始时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.beginIvrTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'endIvrTime',
- label: 'ivr结束时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.endIvrTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'beginQueueTime',
- label: '队列开始时间',
- width: 170,
- render: (scope) => <span>{formatDate(scope.row.beginQueueTime, 'YYYY-mm-dd HH:MM:SS')}</span>,
- },
- {
- prop: 'endQueueTime',
- label: '队列结束时间',
- width: 170,
- render: (scope) => {
- return <span>{formatDate(scope.row.endQueueTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- {
- prop: 'beginRingTime',
- label: '开始振铃时间',
- width: 170,
- render: (scope) => {
- return <span>{formatDate(scope.row.beginRingTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- {
- prop: 'endRingTimg',
- label: '结束振铃时间',
- width: 170,
- render: (scope) => {
- return <span>{formatDate(scope.row.endRingTimg, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- ];
- const changeTba = () => {
- ruleFormRef.value.resetFields();
- handleQuery();
- };
- // 手动查询,将页码设置为1
- const handleQuery = () => {
- state.queryParams.PageIndex = 1;
- queryList();
- };
- /** 通话记录列表 */
- const queryList = async () => {
- state.loading = true;
- try {
- let request = other.deepClone(state.queryParams);
- Reflect.deleteProperty(request, 'callTime'); // 删除无用的参数
- Reflect.deleteProperty(request, 'answeredTime'); // 删除无用的参数
- Reflect.deleteProperty(request, 'overTime'); // 删除无用的参数
- Reflect.deleteProperty(request, 'beginIvrTime'); // 删除无用的参数
- Reflect.deleteProperty(request, 'endIvrTime'); // 删除无用的参数
- Reflect.deleteProperty(request, 'beginQueueTime'); // 删除无用的参数
- Reflect.deleteProperty(request, 'endQueueTime'); // 删除无用的参数
- Reflect.deleteProperty(request, 'beginRingTime'); // 删除无用的参数
- Reflect.deleteProperty(request, 'endRingTime'); // 删除无用的参数
- Reflect.deleteProperty(request, 'type'); // 删除无用的参数
- switch (state.queryParams.type) {
- case '0':
- columns.value = allColumns;
- break;
- case '1':
- columns.value = inColumns;
- request.CallDirection = 0;
- request.OnState = 1;
- break;
- case '2':
- columns.value = outColumns;
- request.CallDirection = 1;
- request.OnState = 1;
- break;
- case '3':
- columns.value = noColumns;
- request.OnState = 2;
- break;
- default:
- columns.value = allColumns;
- break;
- }
- const response = await callLogPaged(request);
- state.tableData = response.result?.items ?? [];
- state.total = response.result?.total ?? 0;
- state.loading = false;
- } catch (e) {
- state.loading = false;
- console.log(e);
- }
- };
- /** 重置按钮操作 */
- const resetQuery = (formEl: FormInstance | undefined) => {
- if (!formEl) return;
- formEl.resetFields();
- state.queryParams.CallTimeStart = null;
- state.queryParams.CallTimeEnd = null;
- state.queryParams.AnsweredTimeStart = null;
- state.queryParams.AnsweredTimeEnd = null;
- state.queryParams.OverTimeStart = null;
- state.queryParams.OverTimeEnd = null;
- state.queryParams.BeginIvrTimeStart = null;
- state.queryParams.BeginIvrTimeEnd = null;
- state.queryParams.EndIvrTimeStart = null;
- state.queryParams.EndIvrTimeEnd = null;
- state.queryParams.BeginQueueTimeStart = null;
- state.queryParams.BeginQueueTimeEnd = null;
- state.queryParams.EndQueueTimeStart = null;
- state.queryParams.EndQueueTimeEnd = null;
- state.queryParams.BeginRingTimeStart = null;
- state.queryParams.BeginRingTimeEnd = null;
- state.queryParams.EndRingTimeStart = null;
- state.queryParams.EndRingTimeEnd = null;
- queryList();
- };
- // 播放录音
- const playRecordRef = ref<RefType>();
- const onPlaySoundRecording = (val: any) => {
- playRecordRef.value.openDialog(
- import.meta.env.VITE_RECORD_PREFIX + val.recordingAbsolutePath,
- val.recordingFileName,
- val.recordingAbsolutePath,
- val.cpn,
- val.createdTime
- );
- };
- // 下载录音
- const onDownload = (row: any) => {
- ElMessageBox.confirm(`您确定要下载此录音吗?`, '提示', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- draggable: true,
- cancelButtonClass: 'default-button',
- autofocus: false,
- })
- .then(() => {
- fileDownload({ path: import.meta.env.VITE_RECORD_DOWNLOAD_PREFIX + row.recordingAbsolutePath }).then((res: any) => {
- downloadFileByStream(res, row.recordingFileName);
- });
- })
- .catch(() => {});
- };
- // 关联业务
- const connectBusinessRef = ref<RefType>();
- const onConnect = (row: any) => {
- connectBusinessRef.value.openDialog(row);
- };
- // 失联工单
- const router = useRouter();
- const onCreate = (row: any) => {
- router.push({
- name: 'orderAccept',
- state: {
- createBy: 'tel',
- fromTel: row.cpn,
- telGuid: row.callAccept,
- transfer: row.gateway,
- telArea: '',
- },
- params: {
- callId: row.callAccept,
- tagsViewName: '创建失联工单',
- },
- });
- };
- // 基础信息
- const getBaseData = async () => {
- const response = await callBaseData();
- state.callDirection = response.result.callDirection;
- state.onState = response.result.onState;
- state.endByOptions = response.result.endBy;
- };
- onMounted(() => {
- getBaseData();
- queryList();
- });
- </script>
- <style lang="scss" scoped>
- .arrow {
- transition: transform var(--el-transition-duration);
- cursor: pointer;
- }
- .arrow.is-reverse {
- transform: rotateZ(-180deg);
- }
- </style>
|