Jelajahi Sumber

员工绑定医生

wjj 8 jam lalu
induk
melakukan
a0fefd58a0

+ 17 - 0
src/api/company/companyUser.js

@@ -281,3 +281,20 @@ export function isAllowedAllRegister(status, data) {
     data: data
   })
 }
+
+// 绑定医生
+export function bindDoctorId(data) {
+  return request({
+    url: '/company/user/bindDoctorId',
+    method: 'post',
+    data: data
+  })
+}
+
+//解绑医生
+export function unBindDoctorId(userId) {
+  return request({
+    url: '/company/user/unBindDoctorId/'+userId,
+    method: 'get'
+  })
+}

+ 9 - 0
src/api/doctor/doctor.js

@@ -141,3 +141,12 @@ export function exportDoctor(query) {
     params: query
   })
 }
+
+// 查询医生管理列表
+export function listDoctorVO(query) {
+  return request({
+    url: '/his/doctor/getDocVoList',
+    method: 'get',
+    params: query
+  })
+}

+ 86 - 1
src/views/qw/user/index.vue

@@ -329,6 +329,34 @@
           >解绑AI客服</el-button>
         </template>
       </el-table-column>
+      <el-table-column label="医生" align="center" class-name="small-padding fixed-width" width="100px" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-connection"
+            plain
+            v-if="scope.row.doctorId!=null"
+            @click="handleUpdateDoctor(scope.row)"
+          >换绑医生</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            plain
+            icon="el-icon-link"
+            v-else
+            @click="handleUpdateDoctor(scope.row)"
+          >绑定医生</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-unlock"
+            plain
+            v-if="scope.row.doctorId!=null"
+            @click="handleUnBindUserId(scope.row)"
+          >解绑医生</el-button>
+        </template>
+      </el-table-column>
     </el-table>
 
     <pagination
@@ -531,6 +559,10 @@
         <el-button type="primary" @click="submitUpdateSendTypeForm">确 定</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog :title="doctor.title" :visible.sync="doctor.open" width="800px" append-to-body>
+      <selectDoctor ref="selectDoctor" @bindCompanyUserDoctorId="bindCompanyUserDoctorId"></selectDoctor>
+    </el-dialog>
   </div>
 </template>
 
@@ -556,13 +588,26 @@ import {
   qwBindCloudHost, qwUnbindCloudHost, handleAuthAppKey, handleInputAuthAppKey, selectCloudAP, staffListUser
 } from '../../../api/qw/user'
 import fastGptRole from "@/views/fastGpt/fastGptRole/fastGptRole";
+import  selectDoctor  from "@/views/qw/user/selectDoctor.vue";
+import {
+  bindDoctorId,
+  unBindDoctorId
+} from '@/api/company/companyUser'
 
 export default {
   name: "cuDeptIdIndex",
-  components: { fastGptRole},
+  components: { fastGptRole, selectDoctor},
   data() {
     return {
       isAutoOptions:[],
+      doctor: {
+        open: false,
+        title: '绑定医生'
+      },
+      doctorForm: {
+        userId: null,
+        doctorId: null
+      },
       updateIp:{
         open:false,
         title: "修改云主机IP"
@@ -748,6 +793,46 @@ export default {
 
     },
 
+    handleUpdateDoctor(row){
+        this.doctor.title="绑定医生"
+        this.doctor.open=true;
+        this.doctorForm.userId=row.companyUserId;
+    },
+
+    bindCompanyUserDoctorId(row){
+      console.log(row)
+      this.doctorForm.doctorId=row;
+      bindDoctorId(this.doctorForm).then(res=>{
+         if (res.code==200){
+           this.$message.success('绑定成功')
+         }else {
+           this.$message.error('绑定失败:',res.msg)
+         }
+         this.getList()
+         this.doctor.open=false;
+      })
+    },
+
+    handleUnBindUserId(val){
+      this.$confirm(
+        '确认解绑医生:<span style="color: green;">' + val.qwUserName + '' +
+        '</span> 的医生?',
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }
+      ).then(() => {
+        return unBindDoctorId(val.companyUserId);
+      }).then(response => {
+        this.getList();
+        this.msgSuccess("解绑成功");
+      }).finally(res=>{
+        this.getList();
+      })
+    },
+
     handleAppellation(val) {
       this.callOpen.open = true;
       this.callOpenFrom.welcomeText = val.welcomeText;

+ 152 - 0
src/views/qw/user/selectDoctor.vue

@@ -0,0 +1,152 @@
+<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
+          style="width:220px"
+          v-model="queryParams.doctorName"
+          placeholder="请输入医生名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="医生手机" prop="mobile">
+        <el-input
+        style="width:220px"
+          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-table  height="500" border v-loading="loading" :data="doctorList" ref="doctorList" >
+      <el-table-column label="医生名称" align="center" prop="doctorName" />
+      <el-table-column label="手机号码" align="center" prop="mobile" />
+      <el-table-column label="操作"   align="center" fixed="right" width="120px" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="medium"
+            type="primary"
+            plain
+            @click="handleBind(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"
+    />
+
+
+  </div>
+</template>
+
+<script>
+import { listDoctorVO } from "@/api/doctor/doctor";
+
+export default {
+  name: "miniCustomer",
+  components: {},
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 客户表格数据
+      doctorList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        doctorName: null,
+        mobile: null,
+      },
+      // 表单参数
+      form: {
+      },
+      // 表单校验
+      rules: {
+      },
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+
+    /** 查询客户列表 */
+    getList() {
+      this.loading = true;
+
+      listDoctorVO(this.queryParams).then(response => {
+        this.doctorList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+
+    //绑定选择
+    handleBind(row){
+      this.$emit("bindCompanyUserDoctorId",row.doctorId)
+      this.$refs.doctorList.clearSelection();
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+
+  }
+};
+</script>
+<style>
+  .el-tag + .el-tag {
+    margin-left: 10px;
+  }
+  .button-new-tag {
+    margin-left: 10px;
+    height: 32px;
+    line-height: 30px;
+    padding-top: 0;
+    padding-bottom: 0;
+  }
+  .input-new-tag {
+    width: 90px;
+    margin-left: 10px;
+    vertical-align: bottom;
+  }
+  .el-dialog__wrapper{
+    z-index: 100000;
+  }
+</style>