Bladeren bron

feat:将企微员工绑定医生功能移动到员工管理

caoliqin 5 dagen geleden
bovenliggende
commit
ad2ba0942c
2 gewijzigde bestanden met toevoegingen van 77 en 89 verwijderingen
  1. 76 2
      src/views/company/companyUser/index.vue
  2. 1 87
      src/views/qw/user/index.vue

+ 76 - 2
src/views/company/companyUser/index.vue

@@ -185,6 +185,30 @@
           </el-table-column>
           <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
             <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>
               <el-button
                 v-if="scope.row.qwStatus == 0"
                 size="mini"
@@ -551,6 +575,10 @@
       </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>
 
@@ -569,7 +597,7 @@ import {
   generateSubDomain,
   setIsRegisterMember,
   updateCompanyUserAreaList,
-  isAllowedAllRegister
+  isAllowedAllRegister, unBindDoctorId, bindDoctorId
 } from "@/api/company/companyUser";
 import { getToken } from "@/utils/auth";
 import { treeselect } from "@/api/company/companyDept";
@@ -582,11 +610,20 @@ import  selectUser  from "@/views/company/components/selectQwUser.vue";
 import { getConfigByKey } from "@/api/company/companyConfig";
 import axios from "axios";
 import {addCodeUrl} from "../../../api/company/companyUser";
+import selectDoctor from "@/views/qw/user/selectDoctor.vue";
 export default {
   name: "User",
-  components: { Treeselect ,selectUser},
+  components: {selectDoctor, Treeselect ,selectUser},
   data() {
     return {
+      doctor: {
+        open: false,
+        title: '绑定医生'
+      },
+      doctorForm: {
+        userId: null,
+        doctorId: null
+      },
       uploadUrl: process.env.VUE_APP_BASE_API+"/company/user/common/uploadOSS",
       // 遮罩层
       loading: false,
@@ -1403,6 +1440,43 @@ export default {
       }
       return isPic && isLt2M
     },
+    handleUpdateDoctor(row){
+      this.doctor.title="绑定医生"
+      this.doctor.open=true;
+      this.doctorForm.userId=row.userId;
+    },
+    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.nickName + '' +
+        '</span> 的医生?',
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }
+      ).then(() => {
+        return unBindDoctorId(val.userId);
+      }).then(response => {
+        this.getList();
+        this.msgSuccess("解绑成功");
+      }).finally(res=>{
+        this.getList();
+      })
+    },
   },
 };
 </script>

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

@@ -329,34 +329,6 @@
           >解绑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
@@ -559,10 +531,6 @@
         <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>
 
@@ -588,26 +556,13 @@ 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, selectDoctor},
+  components: { fastGptRole},
   data() {
     return {
       isAutoOptions:[],
-      doctor: {
-        open: false,
-        title: '绑定医生'
-      },
-      doctorForm: {
-        userId: null,
-        doctorId: null
-      },
       updateIp:{
         open:false,
         title: "修改云主机IP"
@@ -792,47 +747,6 @@ export default {
       }, 200);
 
     },
-
-    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;