lmx hace 17 horas
padre
commit
8428b29a9f

+ 8 - 0
src/api/company/callphone.js

@@ -115,6 +115,14 @@ export function getCallphoneDetailSummary(query) {
     })
 }
 
+// 同步AI外呼数据(异步补偿)
+export function syncAiCallData() {
+    return request({
+        url: '/company/callphoneLog/syncAiCallData',
+        method: 'post'
+    })
+}
+
 // // 查询调用日志_ai打电话详细
 // export function getCallphone(logId) {
 //   return request({

+ 18 - 1
src/views/taskStatistics/callLog/callLogDetail.vue

@@ -146,6 +146,13 @@
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+        <el-button
+          v-hasPermi="['company:callphoneDetail:list']"
+          type="primary"
+          icon="el-icon-refresh"
+          :loading="syncLoading"
+          @click="handleSyncAiCallData"
+        >同步AI外呼数据</el-button>
         <el-button
           v-hasPermi="['company:callphonelog:exportPhone']"
           type="warning"
@@ -317,7 +324,8 @@ import {
   listCallphoneDetail,
   getCallphoneDetailSummary,
   exportDetailPhone,
-  queryCallphoneLogPhone
+  queryCallphoneLogPhone,
+  syncAiCallData
 } from '@/api/company/callphone'
 import { listRoboticSelectOptions, getRobotic } from '@/api/company/companyVoiceRobotic'
 import { queryPhone } from '@/api/crm/customer'
@@ -330,6 +338,7 @@ export default {
     return {
       loading: false,
       exportLoading: false,
+      syncLoading: false,
       total: 0,
       list: [],
       roboticList: [],
@@ -544,6 +553,14 @@ export default {
         this.exportLoading = false
       }).catch(() => {})
     },
+    handleSyncAiCallData() {
+      this.syncLoading = true
+      syncAiCallData().then(res => {
+        this.$message.success(res.msg || '正在同步中')
+      }).finally(() => {
+        this.syncLoading = false
+      })
+    },
     parseCallTime(val) {
       if (val === null || val === undefined || val === '') return null
       const num = Number(val)