浏览代码

红德堂-润天天天外呼相关代码迁移

Long 1 周之前
父节点
当前提交
fcb08c0760

+ 11 - 3
src/api/company/companyVoiceApi.js

@@ -1,5 +1,5 @@
 import request from '@/utils/request'
- 
+
 
 export function callMobile(query) {
 
@@ -10,7 +10,7 @@ export function callMobile(query) {
 
   })
 }
- 
+
 export function callOffMobile(voiceId) {
 
   return request({
@@ -26,6 +26,14 @@ export function getSipAccount() {
   })
 }
 
+export function manualDialingCallMobile3(query) {
+
+  return request({
+    url: '/company/companyVoiceApi/manualDialingCallMobile' ,
+    method: 'get',
+    params: query
+
+  })
+}
 
 
- 

+ 70 - 0
src/api/doctor/doctorVoiceCaller.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+// 查询企业用户坐席列表
+export function listDoctorVoiceCaller(query) {
+  return request({
+    url: '/company/doctorVoice/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询企业用户坐席详细
+export function getDoctorVoiceCaller(callerId) {
+  return request({
+    url: '/company/doctorVoice/' + callerId,
+    method: 'get'
+  })
+}
+
+// 新增企业用户坐席
+export function addDoctorVoiceCaller(data) {
+  return request({
+    url: '/company/doctorVoice',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改企业用户坐席
+export function updateDoctorVoiceCaller(data) {
+  return request({
+    url: '/company/doctorVoice',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除企业用户坐席
+export function delDoctorVoiceCaller(callerId) {
+  return request({
+    url: '/company/doctorVoice/' + callerId,
+    method: 'delete'
+  })
+}
+
+// 导出企业用户坐席
+export function exportDoctorVoiceCaller(query) {
+  return request({
+    url: '/company/doctorVoice/export',
+    method: 'get',
+    params: query
+  })
+}
+
+export function bindCallerNo(data) {
+  return request({
+    url: '/company/doctorVoice/bindCallerNo',
+    method: 'post',
+    data: data
+  })
+}
+
+  // 获取企业下医生
+export function getCompanyDoctor(companyId) {
+  return request({
+    url: '/company/doctorVoice/getCompanyDoctor/' + companyId,
+    method: 'get'
+  })
+}
+

+ 53 - 0
src/api/doctor/doctorVoiceLogs.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询通话记录列表
+export function listDoctorVoiceLogs(query) {
+  return request({
+    url: '/company/doctor/logs/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询通话记录详细
+export function getDoctorVoiceLogs(voiceId) {
+  return request({
+    url: '/company/doctor/logs/' + voiceId,
+    method: 'get'
+  })
+}
+
+// 新增通话记录
+export function addDoctorVoiceLogs(data) {
+  return request({
+    url: '/company/doctor/logs',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改通话记录
+export function updateDoctorVoiceLogs(data) {
+  return request({
+    url: '/company/doctor/logs',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除通话记录
+export function delDoctorVoiceLogs(voiceId) {
+  return request({
+    url: '/company/doctor/logs/' + voiceId,
+    method: 'delete'
+  })
+}
+
+// 导出通话记录
+export function exportDoctorVoiceLogs(query) {
+  return request({
+    url: '/company/doctor/logs/export',
+    method: 'get',
+    params: query
+  })
+}

+ 76 - 5
src/utils/call.js

@@ -1,14 +1,15 @@
 import store from '@/store'
+import {manualDialingCallMobile3} from "../api/company/companyVoiceApi";
 
 var _phone=null;
-var server = 'call.yjf.runtzh.com'; // OPEN的IP地址和端口 
+var server = 'call.yjf.runtzh.com'; // OPEN的IP地址和端口
 function webphoneHandle(type, data, options) {
 	console.log("sip:"+type, JSON.stringify(data), options);
 	if(type=="outgoing.connecting"){     //正在尝试呼出
-		 
+
 	}
 	else if(type=="outgoing.progress"){  //开始振铃了
-		 
+
 	}
 	else if(type=="outgoing.accecpted"){ //被接听
 		store.dispatch('CallStatus',{
@@ -30,9 +31,9 @@ export function callNumber(customerId,contactsId,orderId,packageOrderId){
 	console.log("calluser:"+ callUser);
 	console.log("callRealm:"+callRealm);
 	console.log("callHa1:"+callHa1);
-	
+
 	if(_phone==null){
-		
+
 		_phone = new WebPhoneSDK({
 				lib: JsSIP,
 				debug: true,
@@ -88,3 +89,73 @@ export function callNumber(customerId,contactsId,orderId,packageOrderId){
 		_phone.reject();
 	}
   }
+
+export function manualDialingCallMobile(mobile,type){
+  // 如果 mobile 为空直接取消执行
+  if (!mobile || String(mobile).trim() === '') {
+    console.log("手机号为空,取消拨号");
+    return;
+  }
+
+  // 转为字符串类型
+  mobile = String(mobile).trim();
+
+  const callUser = store.getters && store.getters.callUser
+  const callRealm = store.getters && store.getters.callRealm
+  const callHa1 = store.getters && store.getters.callHa1
+  JsSIP.C.SESSION_EXPIRES=120,JsSIP.C.MIN_SESSION_EXPIRES=360;
+  console.log("calluser:"+ callUser);
+  console.log("callRealm:"+callRealm);
+  console.log("callHa1:"+callHa1);
+  if(_phone==null){
+
+    _phone = new WebPhoneSDK({
+      lib: JsSIP,
+      debug: true,
+      debugLib: true,
+      user: callUser,
+      ha1: callHa1,
+      realm: callRealm,
+      server: server,
+      audioElement: document.getElementById('remoteAudio'),
+      httpsConfirmFrame: 'httpsConfirmFrame',
+      pcConfig:{"iceServers":[{"urls":["stun:211.159.161.254"]}]},
+      events: {
+        'ua.connecting': (type, data) => webphoneHandle(type, data),
+        'ua.connected': (type, data) => webphoneHandle(type, data), //WEBPHONE链接OK
+        'ua.disconnected': (type, data) => webphoneHandle(type, data), //WEBPHONE链接断开
+        'reg.registered': (type, data) => webphoneHandle(type, data),  //WEBPHONE 分机注册
+        'reg.unregistered': (type, data) => webphoneHandle(type, data), //WEBPHONE 分机取消注册
+        'reg.failed': (type, data) => webphoneHandle(type, data),  //WEBPHONE 注册失败
+        'incoming.notify': (type, data, options) => webphoneHandle(type, data, options),  //有电话进来了
+        'incoming.failed': (type, data, options) => webphoneHandle(type, data, options),//WEBPHONE 有电话进来,然后处理失败了(如,我们拒绝了,或者客户侧直接挂断了)
+        'incoming.ended': (type, options) => webphoneHandle(type, options),// WEBPHONE 有电话进来了,呼叫正常结束了
+        'incoming.accecpted': (type, options) => webphoneHandle(type, options),//有电话进来了,呼叫接听了额
+        'outgoing.connecting': (type, options) => webphoneHandle(type, options),//WEBPHONE正在尝试呼出
+        'outgoing.progress': (type, options) => webphoneHandle(type, options),//WEBPHONE开始振铃了
+        'outgoing.failed': (type, data, options) => webphoneHandle(type, data, options),//WEBPHONE呼出失败了,如被叫拒绝了,线路异常呼出失败了
+        'outgoing.ended': (type, options) => webphoneHandle(type, options),  //呼出正常结束
+        'outgoing.accecpted': (type, data, options) => webphoneHandle(type, data, options),  //呼出被叫接听
+        'call.hold': (type, data) => webphoneHandle(type, data), //呼叫保持
+        'call.unhold': (type, data) => webphoneHandle(type, data),  //呼叫解除保持
+      }
+    });
+    _phone.start({});
+  }
+  var data={phoneNumber:mobile};
+  manualDialingCallMobile3(data).then(response => {
+    if(response.code==200){
+      _phone.call(response.mobile,{userdata:response.logs.sessionId});
+      this.$store.dispatch('Call', {
+        mobile: response.displayMobile,
+        sessionId: response.logs.sessionId
+      })
+    }
+    else{
+      that.$notify.error({
+        title: response.msg,
+        showClose: false
+      });
+    }
+  });
+}

+ 242 - 0
src/views/company/CompanyManualDialingr/index.vue

@@ -0,0 +1,242 @@
+<template>
+  <div class="manual-dialing-container">
+    <el-card class="dialing-card">
+      <div slot="header" class="card-header">
+        <span class="header-icon">📞</span>
+        <span class="header-title">手动拨号</span>
+      </div>
+
+      <div class="dialing-content">
+        <div class="input-row">
+          <el-form :model="form" label-position="top" class="phone-form">
+            <el-form-item label="请输入手机号">
+              <el-input
+                v-model="phoneNumber"
+                placeholder="手机号仅支持 11 位"
+                maxlength="11"
+                clearable
+                prefix-icon="el-icon-phone"
+                class="phone-input"
+                @blur="validatePhone"
+              >
+              </el-input>
+            </el-form-item>
+          </el-form>
+          
+          <div class="reset-btn-wrapper">
+            <el-button
+              @click="resetForm"
+              icon="el-icon-refresh-left"
+              class="reset-button-inline"
+              size="large"
+            >
+              重置
+            </el-button>
+          </div>
+        </div>
+
+        <div class="button-group">
+          <el-button
+            type="primary"
+            @click="manualDialingCallMobile(phoneNumber,1)"
+            :disabled="!isValidPhone"
+            icon="el-icon-phone-outline"
+            class="dial-button"
+            size="large"
+          >
+            开始拨号
+          </el-button>
+        </div>
+      </div>
+
+    </el-card>
+  </div>
+</template>
+
+<script>
+
+import {manualDialingCallMobile} from "../../../utils/call";
+
+export default {
+  name: "ManualDialing",
+  data() {
+    return {
+      phoneNumber: '',
+      isReceive: true // 控制是否显示拨号按钮
+    };
+  },
+  computed: {
+    isValidPhone() {
+      const phoneReg = /^1[3-9]\d{9}$/;
+      return this.phoneNumber && phoneReg.test(this.phoneNumber);
+    }
+  },
+  methods: {
+    manualDialingCallMobile,
+    // 验证手机号
+    validatePhone() {
+      const phoneReg = /^1[3-9]\d{9}$/;
+      if (this.phoneNumber && !phoneReg.test(this.phoneNumber)) {
+        this.$message.error('手机号格式不正确');
+        return false;
+      }
+      return true;
+    },
+
+    // 重置表单
+    resetForm() {
+      this.phoneNumber = '';
+    },
+  },
+  mounted() {
+    // 页面加载时检查是否显示拨号按钮
+    this.isReceive = true;
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.manual-dialing-container {
+  padding: 20px;
+  min-height: calc(100vh - 84px);
+  background: #f5f7fa;
+  display: flex;
+  justify-content: center;
+  align-items: flex-start;
+  padding-top: calc((100vh - 84px) / 5);
+}
+
+.dialing-card {
+  width: 100%;
+  max-width: 500px;
+  border-radius: 8px;
+  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
+  border: 2px solid #000000;
+
+  .card-header {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding: 16px 0;
+
+    .header-icon {
+      font-size: 24px;
+      margin-right: 12px;
+    }
+
+    .header-title {
+      font-size: 20px;
+      font-weight: 500;
+      color: #303133;
+    }
+  }
+}
+
+.dialing-content {
+  padding: 30px 20px;
+
+  .input-row {
+    display: flex;
+    gap: 12px;
+    align-items: flex-end;
+
+    .phone-form {
+      flex: 1;
+      min-width: 0;
+      margin-bottom: 0;
+
+      ::v-deep .el-form-item {
+        margin-bottom: 0;
+      }
+
+      .phone-input {
+        width: 100%;
+
+        ::v-deep .el-input__inner {
+          height: 40px;
+          font-size: 14px;
+          border-radius: 4px;
+          transition: all 0.3s ease;
+
+          &:focus {
+            border-color: #409EFF;
+          }
+        }
+      }
+    }
+
+    .reset-btn-wrapper {
+      display: flex;
+      align-items: flex-end;
+      padding-bottom: 0;
+
+      .reset-button-inline {
+        height: 40px;
+        padding: 0 20px;
+        font-size: 14px;
+        border-radius: 4px;
+        transition: all 0.3s ease;
+        flex-shrink: 0;
+
+        &:hover {
+          background-color: #f5f7fa;
+          border-color: #c0c4cc;
+        }
+      }
+    }
+  }
+}
+
+.button-group {
+  display: flex;
+  justify-content: center;
+  margin-top: 24px;
+
+  .dial-button {
+    min-width: 140px;
+    height: 40px;
+    font-size: 14px;
+    font-weight: 500;
+    border-radius: 4px;
+    transition: all 0.3s ease;
+
+    &:hover:not(:disabled) {
+      background-color: #66b1ff;
+      border-color: #66b1ff;
+    }
+
+    &:active:not(:disabled) {
+      transform: scale(0.98);
+    }
+  }
+}
+
+// 响应式设计
+@media (max-width: 768px) {
+  .manual-dialing-container {
+    padding: 15px;
+  }
+
+  .dialing-card {
+    margin-top: 20px;
+  }
+
+  .input-row {
+    flex-direction: column;
+
+    .phone-form {
+      width: 100%;
+    }
+
+    .reset-button-inline {
+      width: 100%;
+    }
+  }
+
+  .button-group {
+    .dial-button {
+      width: 100%;
+    }
+  }
+}
+</style>

+ 366 - 0
src/views/company/doctorVoiceCaller/caller.vue

@@ -0,0 +1,366 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+<!--      <el-form-item label="销售公司" prop="companyId" >-->
+<!--        <el-select filterable style="width: 220px" v-model="queryParams.companyId" placeholder="请选择销售公司" clearable size="small" @visible-change="companyTitleChange">-->
+<!--          <el-option-->
+<!--            v-for="item in companys"-->
+<!--            :key="item.companyId"-->
+<!--            :label="item.companyName"-->
+<!--            :value="item.companyId"-->
+<!--          />-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+      <el-form-item label="医生姓名" prop="doctorName">
+        <el-input
+          v-model="queryParams.doctorName"
+          placeholder="请输入医生姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="员工姓名" prop="companyUserName">
+        <el-input
+          v-model="queryParams.companyUserName"
+          placeholder="请输入员工姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="手机号" prop="mobile">
+        <el-input
+          v-model="queryParams.mobile"
+          placeholder="请输入手机号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleBind"
+        >绑定医生</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table  height="500" border v-loading="loading" :data="doctorCallerList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="callerId" />
+      <el-table-column label="销售公司" align="center" prop="companyName" />
+      <el-table-column label="医生姓名" align="center" prop="doctorName" />
+      <el-table-column label="员工姓名" align="center" prop="companyUserName" />
+      <el-table-column label="坐席号" align="center" prop="callerNo" />
+      <el-table-column label="手机号" align="center" prop="mobile" />
+<!--      <el-table-column label="状态" align="center" prop="status" >-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-tag prop="status" v-for="(item, index) in statusOptions"  :type="scope.row.status==1?'success':'danger'"  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-column label="操作"   width="120px" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改企业用户坐席对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="销售公司" prop="companyId">
+        <el-select v-model="form.companyId">
+          <el-option
+            v-if="myCompany"
+            :key="myCompany.companyId"
+            :label="myCompany.companyName"
+            :value="myCompany.companyId"
+          />
+        </el-select>
+        </el-form-item>
+        <el-form-item v-if="showDoctorSelect" label="医生" prop="doctorId">
+          <el-select v-model="form.doctorId" filterable placeholder="请选择医生" clearable size="small">
+            <el-option
+              v-for="item in doctors"
+              :key="item.doctorId"
+              :label="item.doctorName"
+              :value="item.doctorId"
+            />
+          </el-select>
+        </el-form-item>
+
+
+        <el-form-item label="坐席" prop="callerId">
+          <el-select v-model="form.callerId"    placeholder="请选择坐席" clearable size="small">
+            <el-option
+              v-for="item in callers"
+              :key="item.callerId"
+              :label="item.callerNo"
+              :value="item.callerId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="手机号" prop="mobile">
+          <el-input v-model="form.mobile" maxlength="11" style="width: 215px" placeholder="请输入手机号" />
+        </el-form-item>
+<!--        <el-form-item label="状态">-->
+<!--          <el-radio-group v-model="form.status">-->
+<!--            <el-radio v-for="dict in statusOptions" :label="dict.dictValue">{{dict.dictLabel}}</el-radio>-->
+<!--          </el-radio-group>-->
+<!--        </el-form-item>-->
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { bindCallerNo,listDoctorVoiceCaller, delDoctorVoiceCaller, exportDoctorVoiceCaller,getCompanyDoctor } from "@/api/doctor/doctorVoiceCaller";
+import {getCallerList} from "../../../api/company/companyVoiceCaller";
+import {getCompanyInfo, getCompanyList} from "../../../api/company/company";
+export default {
+  name: "doctorCaller",
+  data() {
+    return {
+      callers:[],
+      doctors:[],
+      companys: [],//  所有企业列表
+      myCompany: null,
+      showDoctorSelect: false,  // 控制医生下拉框是否显示
+      statusOptions:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 企业用户坐席表格数据
+      doctorCallerList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        doctorId: null,
+        doctorName: null,
+        companyUserName: null,
+        status: null,
+        mobile: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        doctorId: [
+          { required: true, message: "医生不能为空", trigger: "blur" }
+        ],
+        companyId: [
+          { required: true, message: "销售公司不能为空", trigger: "blur" }
+        ],
+        mobile: [
+          { required: true, message: "手机号不能为空", trigger: "blur" }
+        ],
+        callerId: [
+          { required: true, message: "坐席编号不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getDicts("sys_company_status").then((response) => {
+      this.statusOptions = response.data;
+    });
+    this.getList();
+  },
+  methods: {
+    companyTitleChange(){
+      getCompanyList().then(response => {
+        this.companys = response.data;
+      });
+    },
+    companyChange(companyId){
+      if (!companyId) {
+        // 如果没有选择公司,隐藏医生下拉框
+        this.showDoctorSelect = false;
+        this.doctors = [];
+        this.form.doctorId = null;
+        return;
+      }
+      // 根据公司ID获取医生列表
+      getCompanyDoctor(companyId).then(response => {
+        this.doctors = response.data;
+        // 显示医生下拉框
+        this.showDoctorSelect = true;
+      });
+    },
+    getCompanyInfo(){
+      getCompanyInfo().then(response => {
+        this.myCompany = response.data;
+        // 默认选中第一条记录
+        if (this.myCompany) {
+          this.queryParams.companyId = this.myCompany.companyId;
+          // 如果在对话框中打开,也默认选中
+          if (this.open && !this.form.companyId) {
+            this.form.companyId = this.myCompany.companyId;
+            // 自动触发公司变更事件以加载医生列表
+            this.companyChange(this.myCompany.companyId);
+          }
+        }
+      });
+    },
+    getCallerList() {
+      getCallerList().then(response => {
+        this.callers = response.data;
+      });
+    },
+    /** 查询企业用户坐席列表 */
+    getList() {
+      this.loading = true;
+      listDoctorVoiceCaller(this.queryParams).then(response => {
+        this.doctorCallerList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        callerId: null,
+        doctorId: null,
+        doctorName: null,
+        companyUserName: null,
+        remark: null,
+        status: "1"
+      };
+      this.showDoctorSelect = false;  // 重置医生显示状态
+      this.doctors = [];        // 清空医生列表
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.callerId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleBind() {
+      this.reset();
+      this.open = true;
+      this.title = "医生绑定";
+      this.getCallerList();
+      this.getCompanyInfo();
+      // 重置下拉框显示状态
+      this.showDoctorSelect = false;
+      this.doctors = [];
+      this.form.doctorId = null;
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          bindCallerNo(this.form).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("操作成功");
+              this.open = false;
+              this.getList();
+            }
+          });
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const callerIds = row.callerId || this.ids;
+      this.$confirm('是否确认删除坐席编号为"' + callerIds + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delDoctorVoiceCaller(callerIds);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有企业用户坐席数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return exportDoctorVoiceCaller(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      }).catch(function() {});
+    }
+  }
+};
+
+</script>
+<style scoped>
+.get-code{
+  display: inline-block;
+  text-align: center;
+  font-size: 14px;
+  color: #0051ff;
+  cursor: pointer;
+}
+</style>

+ 326 - 0
src/views/company/doctorVoiceLogs/logs.vue

@@ -0,0 +1,326 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+       <el-form-item label="医生姓名" prop="doctorName">
+        <el-input
+          v-model="queryParams.doctorName"
+          placeholder="请输入医生姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+        <el-form-item label="病人姓名" prop="patientName">
+          <el-input
+            v-model="queryParams.patientName"
+            placeholder="请输入病人姓名"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-form-item>
+      <el-form-item label="主叫" prop="callerPhone">
+        <el-input
+          v-model="queryParams.callerPhone"
+          placeholder="请输入主叫"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="被叫" prop="calleePhone">
+        <el-input
+          v-model="queryParams.calleePhone"
+          placeholder="请输入被叫"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+        <el-form-item label="开始时间" prop="startTime">
+          <el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+        </el-form-item>
+
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['company:doctor:logs:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table  height="500" border v-loading="loading" :data="doctorVoiceLogsList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="voiceId" />
+      <el-table-column label="医生姓名" align="center" prop="doctorName" />
+      <el-table-column label="病人姓名" align="center" prop="patientName" />
+      <!-- <el-table-column label="通话音频" align="center" prop="voiceUrl" width="380">
+        <template slot-scope="scope">
+          <audio :src="scope.row.voiceUrl" controls  ></audio>
+        </template>
+      </el-table-column> -->
+      <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="150">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.startTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="结束时间" align="center" prop="finishTime" width="150">
+        <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="150">
+        <template slot-scope="scope">
+          <span v-if="scope.row.voiceUrl!=null">{{  formatTime(scope.row.times) }} </span>
+        </template>
+      </el-table-column>
+      <el-table-column label="计费时长(分)" align="center" prop="billingTime" width="150">
+      </el-table-column>
+      <el-table-column label="备注"  show-overflow-tooltip  align="center" prop="remark" />
+      <el-table-column label="主叫显示号" align="center" prop="displayCallerNumber" />
+      <el-table-column label="被叫显示号" align="center" prop="displayCalleeNumber" />
+        <el-table-column label="创建时间" align="center" prop="createTime" width="150">
+        </el-table-column>
+
+       <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="操作" fixed="right" align="center" prop="查看" >
+        <template slot-scope="scope">
+              <el-link  v-if="scope.row.voiceUrl!=null" :href="scope.row.voiceUrl" target="_blank" >下载录音</el-link>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+
+  </div>
+</template>
+
+<script>
+import { listDoctorVoiceLogs, getDoctorVoiceLogs, delDoctorVoiceLogs, addDoctorVoiceLogs, updateDoctorVoiceLogs, exportDoctorVoiceLogs } from "@/api/doctor/doctorVoiceLogs";
+export default {
+  name: "companyDoctorVoiceLogs",
+  data() {
+    return {
+      statusOptions:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 通话记录表格数据
+      doctorVoiceLogsList: [],
+      // 弹出层标题
+      title: "",
+      dateRange: [],
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        doctorId: null,
+        voiceTitle: null,
+        voiceUrl: null,
+        startTime: null,
+        endTime: null,
+        voiceType: null,
+        callerPhone: null,
+        calleePhone: null,
+        times: null,
+        moeny: null,
+        displayCallerNumber: null,
+        companyUserName: null,
+        patientName: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getDicts("sys_company_voice_logs_status").then((response) => {
+      this.statusOptions = response.data;
+    });
+    this.getList();
+  },
+  methods: {
+    formatTime(value) {
+      const hours = Math.floor(value / 3600);
+      const minutes = Math.floor((value % 3600) / 60);
+      const seconds = value % 60;
+      if(hours == 0 && minutes == 0 ){
+        return `${seconds}秒`;
+      }else if(hours == 0 && minutes != 0 ){
+        return `${minutes}分钟${seconds}秒`;
+      }else{
+        return `${hours}小时${minutes}分钟${seconds}秒`;
+      }
+
+    },
+    /** 查询通话记录列表 */
+    getList() {
+      this.loading = true;
+      listDoctorVoiceLogs(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+        this.doctorVoiceLogsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        voiceId: null,
+        doctorId: null,
+        voiceTitle: null,
+        voiceUrl: null,
+        startTime: null,
+        endTime: null,
+        voiceType: null,
+        remark: null,
+        callerPhone: null,
+        calleePhone: null,
+        times: null,
+        moeny: null,
+        displayCallerNumber: null,
+        companyUserName: null,
+        patientName: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams.beginTime = null;
+      this.queryParams.endTime = null;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.voiceId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加通话记录";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const voiceId = row.voiceId || this.ids
+      getDoctorVoiceLogs(voiceId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改通话记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.voiceId != null) {
+            updateDoctorVoiceLogs(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addDoctorVoiceLogs(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const voiceIds = row.voiceId || this.ids;
+      this.$confirm('是否确认删除通话记录编号为"' + voiceIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delDoctorVoiceLogs(voiceIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有通话记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportDoctorVoiceLogs(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  }
+};
+</script>
+<style scoped>
+
+</style>