|
@@ -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>
|