Ver código fonte

八爪鱼增加登录系统按钮

seyason 7 meses atrás
pai
commit
97c5130fd6

+ 51 - 30
fhKeeper/formulahousekeeper/octopus/src/views/customer/list.vue

@@ -80,6 +80,7 @@
                     <el-button size="mini"  @click="editClick('D', scope.row)">{{scope.row.setMeal ? '设为未签约' : '设为已签约'}}</el-button>
                     <el-button size="mini"  @click="editClick('G', scope.row)">其他设置</el-button>
                     <el-button size="mini"  @click="editClick('H', scope.row)">报表配置</el-button>
+                    <el-button size="mini"  @click="editClick('K', scope.row)" v-if="user.phone=='15895914665'">登录系统</el-button>
                     <el-button size="mini"  @click="editClick('I', scope.row)"  v-if="scope.row.canDelete">删除企业</el-button>
                     <el-button size="mini"  @click="editClick('E', scope.row)" v-loading="dingdingSync" v-if="scope.row.dingdingCorpid">同步钉钉人员</el-button>
                 </template>
@@ -325,7 +326,7 @@ import App from '../../App.vue';
                 editDialogG: false,
                 editDialogH: false,
 
-
+                user: JSON.parse(sessionStorage.user),
 
                 dialogData: null,
                 // 增加人数上限
@@ -501,37 +502,57 @@ import App from '../../App.vue';
                 }
                 else if(i == 'I'){
                     this.$confirm('此操作将永久删除该企业及相关数据, 是否继续?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                    }).then(() => {
-                    this.http.post('/company/deleteCompany', { companyId:this.dialogData.id},
-                res => {
-                    if (res.code == "ok") {
-                        this.$message({
-                            message: "删除成功",
-                            type: "success"
-                        });
-                        this.getList();
-                    } else {
-                        this.$message({
-                            message: res.msg,
-                            type: "error"
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                        }).then(() => {
+                        this.http.post('/company/deleteCompany', { companyId:this.dialogData.id},
+                        res => {
+                            if (res.code == "ok") {
+                                this.$message({
+                                    message: "删除成功",
+                                    type: "success"
+                                });
+                                this.getList();
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: "error"
+                                });
+                            }
+                        },
+                        error => {
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
                         });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
+                        }).catch(() => {
+                            this.$message({
+                            type: 'info',
+                            message: '已取消删除'
+                        });          
                     });
-                });
-                    }).catch(() => {
-                    this.$message({
-                        type: 'info',
-                        message: '已取消删除'
-                    });          
-        });
+                }else if (i == 'K') {
+                    this.http.post('/company/getSuperManagerId', { companyId:this.dialogData.id},
+                        res => {
+                            if (res.code == "ok") {
+                                var sid = res.data;
+                                // 打开一个新窗口,并导航到指定的网址
+                                window.open('https://worktime.ttkuaiban.com?userId='+sid, '_blank');
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: "error"
+                                });
+                            }
+                        },
+                        error => {
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
+                        });
                 }
                 
             },

+ 5 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/controller/CompanyController.java

@@ -233,5 +233,10 @@ public class CompanyController {
     public HttpRespMsg addFeiShuInfo(FeiShuInfoVO feiShuInfoVO){
         return companyService.addFeiShuInfo(feiShuInfoVO);
     }
+
+    @RequestMapping("/getSuperManagerId")
+    public HttpRespMsg getSuperManagerId(Integer companyId){
+        return companyService.getSuperManagerId(companyId);
+    }
 }
 

+ 2 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/CompanyService.java

@@ -33,4 +33,6 @@ public interface CompanyService extends IService<Company> {
     HttpRespMsg deleteCompany(Integer companyId);
 
     HttpRespMsg addFeiShuInfo(FeiShuInfoVO feiShuInfoVO);
+
+    HttpRespMsg getSuperManagerId(Integer companyId);
 }

+ 12 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/impl/CompanyServiceImpl.java

@@ -485,4 +485,16 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
         }
         return msg;
     }
+
+    @Override
+    public HttpRespMsg getSuperManagerId(Integer companyId) {
+        HttpRespMsg msg=new HttpRespMsg();
+        User user = userMapper.selectOne(new QueryWrapper<User>().eq("company_id", companyId).eq("role_name", "超级管理员"));
+        if(user==null){
+            msg.setError("超级管理员不存在");
+            return msg;
+        }
+        msg.setData(user.getId());
+        return msg;
+    }
 }

+ 4 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/util/HttpRespMsg.java

@@ -27,6 +27,10 @@ public class HttpRespMsg implements Serializable {
         msg = errorMsg;
     }
 
+    public void setData(Object data) {
+        this.data = data;
+    }
+
 
     public String toJSONStr() {
         JSONObject json = new JSONObject();