|
|
@@ -1,36 +1,36 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
- <el-form-item label="员工姓名" prop="companyUserNickName">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px" size="small">
|
|
|
+ <el-form-item label="所属公司" prop="companyName">
|
|
|
<el-input
|
|
|
- v-model="queryParams.companyUserNickName"
|
|
|
- placeholder="请输入员工姓名"
|
|
|
+ v-model="queryParams.companyName"
|
|
|
+ placeholder="请输入公司名称"
|
|
|
clearable
|
|
|
- size="small"
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="手机号" prop="mobile">
|
|
|
+ <el-form-item label="分机号码" prop="extensionNum">
|
|
|
<el-input
|
|
|
- v-model="queryParams.mobile"
|
|
|
- placeholder="请输入手机号"
|
|
|
+ v-model="queryParams.extensionNum"
|
|
|
+ placeholder="请输入分机号码"
|
|
|
clearable
|
|
|
- size="small"
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="状态" prop="status">
|
|
|
- <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
|
|
|
- <el-option
|
|
|
- v-for="dict in statusOptions"
|
|
|
- :key="dict.dictValue"
|
|
|
- :label="dict.dictLabel"
|
|
|
- :value="dict.dictValue"
|
|
|
- />
|
|
|
+ <el-form-item label="分配状态" prop="assignStatus">
|
|
|
+ <el-select v-model="queryParams.assignStatus" placeholder="请选择" clearable style="width:120px">
|
|
|
+ <el-option label="分机池" :value="0" />
|
|
|
+ <el-option label="已分配" :value="1" />
|
|
|
</el-select>
|
|
|
- </el-form-item> -->
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态" prop="status">
|
|
|
+ <el-select v-model="queryParams.status" placeholder="请选择" clearable style="width:120px">
|
|
|
+ <el-option label="可用" :value="1" />
|
|
|
+ <el-option label="停用" :value="0" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button type="primary" 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>
|
|
|
@@ -39,371 +39,256 @@
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
- icon="el-icon-plus"
|
|
|
+ plain
|
|
|
+ icon="el-icon-connection"
|
|
|
size="mini"
|
|
|
- @click="handleBind"
|
|
|
+ :disabled="!canAssign"
|
|
|
+ @click="handleAssign"
|
|
|
v-hasPermi="['company:companyVoiceCaller:bind']"
|
|
|
- >绑定坐席</el-button>
|
|
|
+ >分配到公司</el-button>
|
|
|
</el-col>
|
|
|
- <!-- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- icon="el-icon-edit"
|
|
|
- size="mini"
|
|
|
- :disabled="single"
|
|
|
- @click="handleUpdate"
|
|
|
- v-hasPermi="['company:companyVoiceCaller:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ <el-col :span="1.5" v-if="selectedRows.length">
|
|
|
+ <span class="selected-tip">已选 {{ selectedRows.length }} 条</span>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- icon="el-icon-delete"
|
|
|
- size="mini"
|
|
|
- :disabled="multiple"
|
|
|
- @click="handleDelete"
|
|
|
- v-hasPermi="['company:companyVoiceCaller:remove']"
|
|
|
- >删除</el-button>
|
|
|
- </el-col> -->
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table height="500" border v-loading="loading" :data="companyCallerList" @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="companyUserNickName" />
|
|
|
- <el-table-column label="坐席号" align="center" prop="callerNo" />
|
|
|
- <el-table-column label="手机号" align="center" prop="mobile" />
|
|
|
- <!-- <el-table-column label="状态" align="center" prop="status" >
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="dataList"
|
|
|
+ border
|
|
|
+ size="small"
|
|
|
+ class="voice-seat-table"
|
|
|
+ height="500"
|
|
|
+ style="width:100%"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="45" align="center" :selectable="checkSelectable" />
|
|
|
+ <el-table-column label="ID" align="center" prop="id" width="70" />
|
|
|
+ <el-table-column label="所属公司" align="center" prop="companyName" min-width="120" show-overflow-tooltip />
|
|
|
+ <el-table-column label="分机号码" align="center" prop="extensionNum" width="110" />
|
|
|
+ <el-table-column label="绑定员工" align="center" prop="companyUserName" min-width="100" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.companyUserName || '-' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="绑定标识" align="center" prop="userCode" min-width="130" show-overflow-tooltip />
|
|
|
+ <el-table-column label="状态" align="center" prop="status" width="80">
|
|
|
<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>
|
|
|
+ <el-tag v-if="scope.row.status === 0 || scope.row.status === '0'" type="danger" size="mini">停用</el-tag>
|
|
|
+ <el-tag v-else type="success" size="mini">可用</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">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" width="155" />
|
|
|
+ <el-table-column label="操作" align="center" width="90">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['company:companyVoiceCaller:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">详情</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
+
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
+ 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="companyUserId">
|
|
|
- <el-select v-model="form.companyUserId" filterable placeholder="请选择员工" clearable size="small">
|
|
|
- <el-option
|
|
|
- @change="userChange"
|
|
|
- v-for="item in users"
|
|
|
- :key="item.userId"
|
|
|
- :label="item.nickName"
|
|
|
- :value="item.userId"
|
|
|
- />
|
|
|
- </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-dialog title="分配分机到公司" :visible.sync="assignOpen" width="480px" append-to-body @close="resetAssignForm">
|
|
|
+ <el-form ref="assignForm" :model="assignForm" :rules="assignRules" label-width="100px" size="small">
|
|
|
+ <el-form-item label="目标公司" prop="companyId">
|
|
|
+ <el-select v-model="assignForm.companyId" placeholder="请选择公司" filterable clearable style="width:100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in companyOptions"
|
|
|
+ :key="item.dictValue"
|
|
|
+ :label="item.dictLabel"
|
|
|
+ :value="Number(item.dictValue)"
|
|
|
+ />
|
|
|
</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="验证码" prop="code">
|
|
|
- <el-input v-model="form.code" maxlength="4" style="width: 215px" placeholder="请输入验证码" />
|
|
|
- <span v-if="codeShow" class="get-code" @click="getSmsCode">获取验证码</span>
|
|
|
- <span v-if="!codeShow" class="get-code">{{ codeCount }}s</span>
|
|
|
- </el-form-item> -->
|
|
|
- <!-- <el-form-item label="坐度有效期" prop="userLimitTime">
|
|
|
- <el-date-picker clearable size="small" style="width: 215px"
|
|
|
- v-model="form.userLimitTime"
|
|
|
- type="date"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- placeholder="选择坐度有效期">
|
|
|
- </el-date-picker>
|
|
|
- </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 label="已选分机">
|
|
|
+ <span>{{ assignForm.ids.length }} 个(分机池内可用分机)</span>
|
|
|
</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>
|
|
|
+ <el-button @click="assignOpen = false">取 消</el-button>
|
|
|
+ <el-button type="primary" :loading="assignLoading" @click="submitAssign">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 详情 -->
|
|
|
+ <el-dialog title="分机详情" :visible.sync="detailOpen" width="560px" append-to-body>
|
|
|
+ <el-form :model="detailForm" label-width="100px" size="small">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="ID"><span>{{ detailForm.id }}</span></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="所属公司"><span>{{ detailForm.companyName || '-' }}</span></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="分机号码"><span>{{ detailForm.extensionNum }}</span></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="分机密码"><span>{{ detailForm.extensionPass || '-' }}</span></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="流水编号"><span>{{ detailForm.extId || '-' }}</span></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="绑定标识"><span>{{ detailForm.userCode || '-' }}</span></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="绑定员工"><span>{{ detailForm.companyUserName || '-' }}</span></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="状态">
|
|
|
+ <el-tag v-if="detailForm.status === 0" type="danger">停用</el-tag>
|
|
|
+ <el-tag v-else type="success">可用</el-tag>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="创建时间"><span>{{ detailForm.createTime || '-' }}</span></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { bindCallerNo,listCompanyVoiceCaller, getCompanyVoiceCaller, delCompanyVoiceCaller, addCompanyVoiceCaller, updateCompanyVoiceCaller, exportCompanyVoiceCaller } from "@/api/company/companyVoiceCaller";
|
|
|
-import { getUserList } from "@/api/company/companyUser";
|
|
|
-import { getCallerList } from "@/api/company/companyVoiceCaller";
|
|
|
+import {
|
|
|
+ listVoiceSeat,
|
|
|
+ getVoiceSeat,
|
|
|
+ assignVoiceSeat,
|
|
|
+ getCompanyOptions
|
|
|
+} from '@/api/company/companyVoiceCaller'
|
|
|
|
|
|
-import { sendSmsCode } from "@/api/common";
|
|
|
export default {
|
|
|
- name: "CompanyCaller",
|
|
|
+ name: 'CompanyVoiceCaller',
|
|
|
data() {
|
|
|
return {
|
|
|
- callers:[],
|
|
|
- // codeShow: true, // 获取验证码样式
|
|
|
- // codeFlag:true,
|
|
|
- // codeCount: 60, // 验证码倒计时
|
|
|
- // codeText:"获取验证码",
|
|
|
- companys:[],
|
|
|
- users:[],
|
|
|
- statusOptions:[],
|
|
|
- // 遮罩层
|
|
|
loading: true,
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
+ assignLoading: false,
|
|
|
showSearch: true,
|
|
|
- // 总条数
|
|
|
total: 0,
|
|
|
- // 企业用户坐席表格数据
|
|
|
- companyCallerList: [],
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
- open: false,
|
|
|
- // 查询参数
|
|
|
+ dataList: [],
|
|
|
+ selectedRows: [],
|
|
|
+ companyOptions: [],
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
+ companyName: null,
|
|
|
+ extensionNum: null,
|
|
|
+ status: null,
|
|
|
+ assignStatus: null
|
|
|
+ },
|
|
|
+ assignOpen: false,
|
|
|
+ assignForm: {
|
|
|
companyId: null,
|
|
|
- userId: null,
|
|
|
- mobile: null,
|
|
|
- status: null
|
|
|
+ ids: []
|
|
|
},
|
|
|
- // 表单参数
|
|
|
- form: {},
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- companyUserId: [
|
|
|
- { required: true, message: "员工不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- mobile: [
|
|
|
- { required: true, message: "手机号不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- callerId: [
|
|
|
- { required: true, message: "坐席编号不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
-
|
|
|
- // code: [
|
|
|
- // { required: true, message: "验证码不能为空", trigger: "blur" }
|
|
|
- // ],
|
|
|
- // userLimitTime: [
|
|
|
- // { required: true, message: "坐席到期时间不能为空", trigger: "blur" }
|
|
|
- // ],
|
|
|
- }
|
|
|
- };
|
|
|
+ assignRules: {
|
|
|
+ companyId: [{ required: true, message: '请选择目标公司', trigger: 'change' }]
|
|
|
+ },
|
|
|
+ detailOpen: false,
|
|
|
+ detailForm: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ canAssign() {
|
|
|
+ return this.selectedRows.length > 0 && this.selectedRows.every(row => this.isAssignableRow(row))
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
- this.getDicts("sys_company_status").then((response) => {
|
|
|
- this.statusOptions = response.data;
|
|
|
- });
|
|
|
- this.getList();
|
|
|
- this.getUserList();
|
|
|
+ this.getList()
|
|
|
+ this.loadCompanyOptions()
|
|
|
},
|
|
|
methods: {
|
|
|
- // getSmsCode(){
|
|
|
- // if(!this.codeFlag){
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // if(this.form.mobile==null){
|
|
|
- // this.msgError("请输入手机号");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // this.codeFlag=false;
|
|
|
- // var that=this;
|
|
|
- // var data={mobile:this.form.mobile}
|
|
|
- // sendSmsCode(data).then(
|
|
|
- // response => {
|
|
|
- // if (response.code === 200) {
|
|
|
- // that.getCode()
|
|
|
- // }
|
|
|
- // else{
|
|
|
- // this.msgError(response.msg);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // ).catch(() => {
|
|
|
- // this.codeFlag = true;
|
|
|
- // });
|
|
|
- // },
|
|
|
- // // 获取验证码
|
|
|
- // getCode() {
|
|
|
- // const TIME_COUNT = 60;
|
|
|
- // var that=this;
|
|
|
- // if (!this.timer) {
|
|
|
- // this.codeCount = TIME_COUNT;
|
|
|
- // this.codeShow = false;
|
|
|
- // this.timer = setInterval(() => {
|
|
|
- // if (this.codeCount > 0 && this.codeCount <= TIME_COUNT) {
|
|
|
- // this.codeCount--;
|
|
|
- // } else {
|
|
|
- // that.codeFlag=true;
|
|
|
- // that.codeShow = true;
|
|
|
- // clearInterval(that.timer);
|
|
|
- // that.timer = null;
|
|
|
- // }
|
|
|
- // }, 1000)
|
|
|
- // }
|
|
|
- // },
|
|
|
- userChange(e){
|
|
|
- console.log(e)
|
|
|
- },
|
|
|
- getCallerList() {
|
|
|
- getCallerList().then(response => {
|
|
|
- this.callers = response.data;
|
|
|
- });
|
|
|
- },
|
|
|
- getUserList() {
|
|
|
- getUserList().then(response => {
|
|
|
- this.users = response.data;
|
|
|
- });
|
|
|
- },
|
|
|
- /** 查询企业用户坐席列表 */
|
|
|
getList() {
|
|
|
- this.loading = true;
|
|
|
- listCompanyVoiceCaller(this.queryParams).then(response => {
|
|
|
- this.companyCallerList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
+ this.loading = true
|
|
|
+ listVoiceSeat(this.queryParams).then(response => {
|
|
|
+ this.dataList = response.rows || []
|
|
|
+ this.total = response.total || 0
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {
|
|
|
- callerId: null,
|
|
|
- companyId: null,
|
|
|
- companyUserId: null,
|
|
|
- mobile: null,
|
|
|
- remark: null,
|
|
|
- status: "1"
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
+ loadCompanyOptions() {
|
|
|
+ getCompanyOptions().then(res => {
|
|
|
+ this.companyOptions = res.data || []
|
|
|
+ })
|
|
|
},
|
|
|
- /** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
+ this.getList()
|
|
|
},
|
|
|
- /** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
+ this.resetForm('queryForm')
|
|
|
+ this.handleQuery()
|
|
|
},
|
|
|
- // 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.callerId)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
+ this.selectedRows = selection
|
|
|
+ },
|
|
|
+ /** 分机池内且状态为可用的分机才允许勾选分配 */
|
|
|
+ isAssignableRow(row) {
|
|
|
+ if (!row) return false
|
|
|
+ const inPool = row.companyId === 0 || row.companyId === '0'
|
|
|
+ const enabled = row.status === 1 || row.status === '1'
|
|
|
+ return inPool && enabled
|
|
|
+ },
|
|
|
+ checkSelectable(row) {
|
|
|
+ return this.isAssignableRow(row)
|
|
|
},
|
|
|
- /** 新增按钮操作 */
|
|
|
- handleBind() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "员工坐席绑定";
|
|
|
- this.getCallerList();
|
|
|
+ handleAssign() {
|
|
|
+ if (!this.canAssign) {
|
|
|
+ this.msgError('请选择分机池内状态为可用的分机')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.assignForm = {
|
|
|
+ companyId: null,
|
|
|
+ ids: this.selectedRows.map(item => item.id)
|
|
|
+ }
|
|
|
+ this.assignOpen = true
|
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
- // handleUpdate(row) {
|
|
|
- // var that=this;
|
|
|
- // this.reset();
|
|
|
- // this.getCallerList();
|
|
|
- // const callerId = row.callerId || this.ids
|
|
|
- // getCompanyVoiceCaller(callerId).then(response => {
|
|
|
- // this.form = response.data;
|
|
|
- // this.form.nickName=row.companyUserNickName;
|
|
|
- // this.form.status = response.data.status.toString();
|
|
|
- // this.open = true;
|
|
|
- // this.title = "修改员工坐席";
|
|
|
- // });
|
|
|
- // },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- bindCallerNo(this.form).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.msgSuccess("操作成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ resetAssignForm() {
|
|
|
+ this.assignForm = { companyId: null, ids: [] }
|
|
|
+ if (this.$refs.assignForm) {
|
|
|
+ this.$refs.assignForm.resetFields()
|
|
|
+ }
|
|
|
},
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- const callerIds = row.callerId || this.ids;
|
|
|
- this.$confirm('是否确认删除坐席编号为"' + callerIds + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delCompanyVoiceCaller(callerIds);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(function() {});
|
|
|
+ submitAssign() {
|
|
|
+ this.$refs.assignForm.validate(valid => {
|
|
|
+ if (!valid) return
|
|
|
+ this.assignLoading = true
|
|
|
+ assignVoiceSeat(this.assignForm).then(res => {
|
|
|
+ this.msgSuccess(res.msg || '分配成功')
|
|
|
+ this.assignOpen = false
|
|
|
+ this.getList()
|
|
|
+ }).finally(() => {
|
|
|
+ this.assignLoading = false
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- const queryParams = this.queryParams;
|
|
|
- this.$confirm('是否确认导出所有企业用户坐席数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return exportCompanyVoiceCaller(queryParams);
|
|
|
- }).then(response => {
|
|
|
- this.download(response.msg);
|
|
|
- }).catch(function() {});
|
|
|
+ handleDetail(row) {
|
|
|
+ getVoiceSeat(row.id).then(response => {
|
|
|
+ this.detailForm = response.data || {}
|
|
|
+ this.detailOpen = true
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
-
|
|
|
+}
|
|
|
</script>
|
|
|
+
|
|
|
<style scoped>
|
|
|
-.get-code{
|
|
|
+.mb8 { margin-bottom: 8px; }
|
|
|
+.selected-tip {
|
|
|
display: inline-block;
|
|
|
- text-align: center;
|
|
|
- font-size: 14px;
|
|
|
- color: #0051ff;
|
|
|
- cursor: pointer;
|
|
|
+ line-height: 28px;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #909399;
|
|
|
}
|
|
|
</style>
|