lmx před 2 dny
rodič
revize
794080fe8d

+ 7 - 0
src/api/company/companyVoiceRobotic.js

@@ -125,3 +125,10 @@ export function taskRun(params) {
     params
   })
 }
+
+export function getSmsTempList() {
+  return request({
+    url: '/company/companySmsTemp/getSmsTempList',
+    method: 'get'
+  })
+}

+ 31 - 4
src/views/company/companyVoiceRobotic/index.vue

@@ -217,10 +217,13 @@
             <el-radio v-model="form.addType" :label="0">平均</el-radio>
             <el-radio v-model="form.addType" :label="1">意向</el-radio>
           </el-form-item>
+          <el-form-item label="加微等待时间" prop="addWxTime" >
+              <el-input style="width:240px"  v-model="form.addWxTime" placeholder="加微等待时间"/>
+          </el-form-item>
           <el-form-item label="分配账号">
             <el-button @click="addQwUser">添加</el-button>
             <el-row :gutter="24" v-for="(item, index) in form.qwUser" style="margin-top: 5px">
-              <el-col :span="5">
+              <el-col :span="5" v-if="form.addType == 1">
                 <el-select v-model="item.intention" placeholder="意向等级" filterable clearable>
                   <el-option v-for="item in levelList" :label="item.dictLabel" :value="item.dictValue"/>
                 </el-select>
@@ -233,6 +236,11 @@
                   <el-option v-for="item in wxDialogList" :label="item.name" :value="item.id"/>
                 </el-select>
               </el-col>
+              <el-col :span="5">
+                <el-select v-model="item.smsTempId" placeholder="短信模板" filterable>
+                  <el-option v-for="item in smsTempList" :label="item.title" :value="item.tempId"/>
+                </el-select>
+              </el-col>
               <el-col :span="3">
                 <el-button type="danger" icon="el-icon-delete" circle @click="removeQwUser(index)"></el-button>
               </el-col>
@@ -346,7 +354,8 @@ import {
   companyUserList,
   wxList,
   taskRun,
-  getTypes
+  getTypes,
+  getSmsTempList
 } from "@/api/company/companyVoiceRobotic";
 import draggable from 'vuedraggable'
 import { listAll } from '@/api/company/wxDialog';
@@ -452,7 +461,8 @@ export default {
         },
       },
       // 表单校验
-      rules: {}
+      rules: {},
+      smsTempList:[]
     };
   },
   created() {
@@ -470,8 +480,17 @@ export default {
       this.levelList = e.data;
     })
     this.getList();
+    this.getSmsTempDropList();
   },
   methods: {
+    getSmsTempDropList(){
+      getSmsTempList().then(res=>{
+        this.smsTempList = res.data;
+        console.log(this.smsTempList);
+      }).catch(res=>{
+        console.log(res);
+      })
+    },
     /** 查询机器人外呼任务列表 */
     getList() {
       this.loading = true;
@@ -570,9 +589,17 @@ export default {
           }
           let list = [];
           this.form.qwUser.forEach(l => {
-            list = list.concat(l.companyUserId.map(e => {return {intention: l.intention, companyUserId: e,wxDialogId: l.wxDialogId}}))
+            list = list.concat(l.companyUserId.map(e => {return {intention: l.intention, companyUserId: e,wxDialogId: l.wxDialogId,smsTempId:l.smsTempId}}))
           })
           this.form.qwUserList = list;
+          console.log(this.form);
+          if(this.form.addType != 0 ){
+           let firstTask = taskFlowList[0];
+            if(firstTask.key != "cellPhone"){
+              this.msgError("【意向】加微方式下,任务流程第一步必须为外呼!");
+              return;
+            }
+          }
           if(!this.form.qwUserList || this.form.qwUserList.length == 0){
             this.msgError("请选者加微方案");
             return;

+ 97 - 0
src/views/crm/components/aiCallVoiceLog.vue

@@ -0,0 +1,97 @@
+<template>
+    <div>
+        <el-table border v-loading="loading" :data="list" >
+            <el-table-column label="ID" align="center" prop="voiceId" />
+            <el-table-column label="公司名" align="center" prop="companyName" />
+            <el-table-column label="员工姓名" align="center" prop="userNickName" />
+            <el-table-column label="录制地址" align="center"  show-overflow-tooltip prop="voiceUrl" width="350">
+                <template slot-scope="scope">
+                    <audio  v-if="scope.row.voiceUrl!=null"   controls :src="scope.row.voiceUrl"></audio>
+                </template>
+            </el-table-column>
+            <el-table-column label="开始时间" align="center" prop="startTime" width="180">
+                <template slot-scope="scope">
+                <span>{{ parseTime(scope.row.startTime) }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="结束时间" align="center" prop="finishTime" width="180">
+                <template slot-scope="scope">
+                <span>{{ parseTime(scope.row.finishTime) }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="主叫" align="center" prop="callerPhone" />
+            <el-table-column label="被叫" align="center" prop="calleePhone" />
+            <el-table-column label="时长(秒)" align="center" prop="times" width="180">
+                <template slot-scope="scope">
+                <span v-if="scope.row.voiceUrl!=null">{{ scope.row.times}}秒 </span>
+                </template>
+            </el-table-column>
+            <el-table-column label="计费时长(分)" align="center" prop="billingTime" width="180">
+            </el-table-column>
+            <el-table-column label="主叫显示号" align="center" prop="displayCallerNumber" />
+            <el-table-column label="被叫显示号" align="center" prop="displayCalleeNumber" />
+            <el-table-column label="状态" align="center" prop="status" >
+                <template slot-scope="scope">
+                    <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>
+            <el-table-column label="备注" align="center" prop="remark" />
+        </el-table>
+        <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+        />
+
+    </div>
+</template>
+  
+<script>
+import { listCompanyVoiceLogs, getCompanyVoiceLogs, delCompanyVoiceLogs, addCompanyVoiceLogs, updateCompanyVoiceLogs, exportCompanyVoiceLogs } from "@/api/company/companyVoiceLogs";
+export default {
+        name: "customerVisit",
+        data() {
+            return {
+                 
+                statusOptions:[],
+                // 遮罩层
+                loading: true,
+                // 总条数
+                total: 0,
+                list: [],
+                // 查询参数
+                queryParams: {
+                    pageNum: 1,
+                    pageSize: 10,
+                    customerId: null,
+                },
+            };
+        },
+        created() {
+            this.getDicts("company_voice_logs_status").then((response) => {
+                this.statusOptions = response.data;
+            });
+          
+        },
+        methods: {
+            getData(customerId){
+                this.queryParams.customerId=customerId;
+                this.queryParams.pageNum=1;
+                this.getList();
+            },
+            getList() {
+                this.loading = true;
+                listCompanyVoiceLogs(this.queryParams).then(response => {
+                    this.list = response.rows;
+                    this.total = response.total;
+                    this.loading = false;
+                });
+            },
+        }
+    };
+</script>
+<style lang="scss" scoped> 
+</style>
+ 

+ 5 - 1
src/views/crm/components/customerDetails.vue

@@ -194,6 +194,9 @@
             <el-tab-pane label="历史订单" name="hisOrder">
                 <customer-his-order-list ref="hisOrder"></customer-his-order-list>
             </el-tab-pane>
+            <el-tab-pane label="AI通话记录" name="aiVoiceLogs">
+                <ai-call-voice-log ref="aiVoiceRef"></ai-call-voice-log>
+            </el-tab-pane>
         </el-tabs>
 
         <el-dialog :title="addTag.title" :visible.sync="addTag.open" width="600px" append-to-body>
@@ -231,6 +234,7 @@
     import duplicateCustomer from '../components/duplicateCustomer.vue';
     import customerContacts from './customerContacts.vue';
     import customerHisOrderList from '../components/customerHisOrderList.vue';
+    import aiCallVoiceLog from './aiCallVoiceLog';
     import { getCustomerDetails1,updateCustomer,getCustomer1 } from "@/api/crm/customer";
     import addTag from './addTag.vue';
     import addRemark from './addRemark.vue';
@@ -238,7 +242,7 @@
     import addOrEditCustomer from '../components/addOrEditCustomer.vue';
     export default {
         name: "customer",
-        components: {customerHisOrderList,addOrEditCustomer,addSms,addTag,addRemark, customerContacts,customerVisitList,customerLogsList,customerVoiceLogsList,customerStoreOrderList,customerSmsLogsList,duplicateCustomer },
+        components: {customerHisOrderList,addOrEditCustomer,addSms,addTag,addRemark, customerContacts,customerVisitList,customerLogsList,customerVoiceLogsList,customerStoreOrderList,customerSmsLogsList,duplicateCustomer,aiCallVoiceLog },
         data() {
             return {
                 customer:{