Kaynağa Gözat

权限文件真假删除全公司日报

Lijy 3 yıl önce
ebeveyn
işleme
d97ae885df

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/permissions.js

@@ -24,6 +24,7 @@ const StringUtil = {
         reportsCompany: false, // 查看全公司工时 // 后台
         reportsPersonnel: false, // 查看相关人员工时 // 后台
         reportsFillOut: false, // 代填日报 //
+        reportsDeleteAll: false, // 删除全公司日报
 
         // 财务核算成本 
         financialCustom: false, // 自定义薪资项 // 

+ 27 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -60,7 +60,8 @@
                         {{sysUserName}}
                     </span>
                     <el-dropdown-menu slot="dropdown">
-                        <el-dropdown-item disabled ><span style="font-size:12px;"><i class="el-icon-view" ></i>{{roleArray[user.role]}}</span></el-dropdown-item>
+                        <!-- <el-dropdown-item disabled ><span style="font-size:12px;"><i class="el-icon-view" ></i>{{roleArray[user.role]}}</span></el-dropdown-item> -->
+                        <el-dropdown-item disabled ><span style="font-size:12px;"><i class="el-icon-view" ></i>{{roleIdName}}</span></el-dropdown-item>
                         <el-dropdown-item @click.native="reset">修改密码</el-dropdown-item>
                         <!-- <el-dropdown-item @click.native="editInfoOpen">修改信息</el-dropdown-item> -->
                         <el-dropdown-item divided @click.native="logout">退出登录</el-dropdown-item>
@@ -204,9 +205,33 @@
                 tableHeight: 0,
                 popoverData: [],
                 num: 0,
+                roleIdName: '',
             };
         },
         methods: {
+            // 获取权限
+            getRoleList() {
+                this.http.post('/permission/getRoleList', {
+                    companyId: this.user.companyId
+                },
+                    res => {
+                        if(res) {
+                            for(var i in res.data) {
+                                if(res.data[i].id == this.user.roleId) {
+                                    this.roleIdName = res.data[i].rolename
+                                }
+                            }
+                        }
+                    },
+                    error => {
+                    this.editLoading = false;
+                    this.editPassWord = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
             //退出登录
             logout: function() {
                 var _this = this;
@@ -430,6 +455,7 @@
             } else {
                 this.$router.push("/login");
             }
+            this.getRoleList()
         },
     };
 </script>

+ 58 - 43
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -65,14 +65,17 @@
         created() {
             if (localStorage.userInfo != null) {
                 var user = JSON.parse(localStorage.userInfo);
-                if (user.role == 3 ) {
-                    //公司高层
-                    this.$router.push({ path: '/cost' });
-                } else if (user.role == 4) {
-                    //财务管理员
-                    this.$router.push({ path: '/team' });
-                } else {
-                    this.$router.push({ path: '/daily' });
+                // if (user.role == 3 ) {
+                //     //公司高层
+                //     this.$router.push({ path: '/cost' });
+                // } else if (user.role == 4) {
+                //     //财务管理员
+                //     this.$router.push({ path: '/team' });
+                // } else {
+                //     this.$router.push({ path: '/daily' });
+                // }
+                if(user.moduleList.length > 0) {
+                    this.$router.push({ path: user.moduleList[0].path })
                 }
             }
         },
@@ -83,14 +86,17 @@
             } 
             if (localStorage.userInfo != null) {
                 var user = JSON.parse(localStorage.userInfo);
-                if (user.role == 3) {
-                    //公司高层
-                    this.$router.push({ path: '/cost' });
-                } else if (user.role == 4) {
-                    //财务管理员
-                    this.$router.push({ path: '/team' });
-                } else {
-                    this.$router.push({ path: '/daily' });
+                // if (user.role == 3) {
+                //     //公司高层
+                //     this.$router.push({ path: '/cost' });
+                // } else if (user.role == 4) {
+                //     //财务管理员
+                //     this.$router.push({ path: '/team' });
+                // } else {
+                //     this.$router.push({ path: '/daily' });
+                // }
+                if(user.moduleList.length > 0) {
+                    this.$router.push({ path: user.moduleList[0].path })
                 }
             } else {
                 if (this.isCorpWX) {
@@ -192,14 +198,17 @@
                                 var user = res.data;
                                 localStorage.user = JSON.stringify(res.data);
                                 sessionStorage.setItem('user', JSON.stringify(res.data));
-                                if (user.role == 3) {
-                                    //公司高层
-                                    this.$router.push({ path: '/cost' });
-                                } else if (user.role == 4) {
-                                    //财务管理员
-                                    this.$router.push({ path: '/team' });
-                                } else {
-                                    this.$router.push({ path: '/daily' });
+                                // if (user.role == 3) {
+                                //     //公司高层
+                                //     this.$router.push({ path: '/cost' });
+                                // } else if (user.role == 4) {
+                                //     //财务管理员
+                                //     this.$router.push({ path: '/team' });
+                                // } else {
+                                //     this.$router.push({ path: '/daily' });
+                                // }
+                                if(user.moduleList.length > 0) {
+                                    this.$router.push({ path: user.moduleList[0].path })
                                 }
                             } else {
                                 this.$message({
@@ -220,14 +229,17 @@
                                 var user = res.data;
                                 localStorage.user = JSON.stringify(res.data);
                                 sessionStorage.setItem('user', JSON.stringify(res.data));
-                                if (user.role == 3) {
-                                    //公司高层
-                                    this.$router.push({ path: '/cost' });
-                                } else if (user.role == 4) {
-                                    //财务管理员
-                                    this.$router.push({ path: '/team' });
-                                } else {
-                                    this.$router.push({ path: '/daily' });
+                                // if (user.role == 3) {
+                                //     //公司高层
+                                //     this.$router.push({ path: '/cost' });
+                                // } else if (user.role == 4) {
+                                //     //财务管理员
+                                //     this.$router.push({ path: '/team' });
+                                // } else {
+                                //     this.$router.push({ path: '/daily' });
+                                // }
+                                if(user.moduleList.length > 0) {
+                                    this.$router.push({ path: user.moduleList[0].path })
                                 }
                             } else {
                                 this.$message({
@@ -262,17 +274,20 @@
                                 var user = res.data;
                                 sessionStorage.setItem('user', JSON.stringify(res.data));
                                 this.permissionsList(res.data)
-                                if (user.company.packageSimple == 1) {
-                                    //简易模式,直接进入工时统计表
-                                    this.$router.push({ path: '/simple' });
-                                } else if (user.role == 3) {
-                                    //公司高层
-                                    this.$router.push({ path: '/cost' });
-                                } else if (user.role == 4) {
-                                    //财务管理员
-                                    this.$router.push({ path: '/team' });
-                                } else {
-                                    this.$router.push({ path: '/daily' });
+                                // if (user.company.packageSimple == 1) {
+                                //     //简易模式,直接进入工时统计表
+                                //     this.$router.push({ path: '/simple' });
+                                // } else if (user.role == 3) {
+                                //     //公司高层
+                                //     this.$router.push({ path: '/cost' });
+                                // } else if (user.role == 4) {
+                                //     //财务管理员
+                                //     this.$router.push({ path: '/team' });
+                                // } else {
+                                //     this.$router.push({ path: '/daily' });
+                                // }
+                                if(user.moduleList.length > 0) {
+                                    this.$router.push({ path: user.moduleList[0].path })
                                 }
                             } else {
                                 this.$message({

+ 10 - 10
fhKeeper/formulahousekeeper/timesheet/src/views/customer/list.vue

@@ -13,7 +13,7 @@
                     </el-input>
                     </div>
                 </el-form-item>
-                <el-form-item style="float:right;" v-if="user.role == 1||user.role == 2||user.role == 5">
+                <el-form-item style="float:right;">
                     <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增客户</el-link>
                 </el-form-item>
             </el-form>
@@ -38,10 +38,10 @@
             <el-table-column prop="address" label="地址" >
             </el-table-column>
             
-            <el-table-column label="操作" width="150" v-if="user.role == 1||user.role == 2||user.role == 5 || user.leader">
+            <el-table-column label="操作" width="150">
                 <template slot-scope="scope">
-                    <el-button size="mini" v-if="user.role>0" type="primary" @click="handleAdd(scope.$index, scope.row)">编辑</el-button>
-                    <el-button v-if="user.role>0" size="mini"  @click="deletePro(scope.$index, scope.row)">删除</el-button>
+                    <el-button size="mini" type="primary" @click="handleAdd(scope.$index, scope.row)">编辑</el-button>
+                    <el-button size="mini"  @click="deletePro(scope.$index, scope.row)">删除</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -63,22 +63,22 @@
         <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
             <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
                 <el-form-item label="客户编号" >
-                    <el-input v-model="addForm.customerCode" :max="20" :disabled="user.role==0" placeholder="请输入客户编号" clearable></el-input>
+                    <el-input v-model="addForm.customerCode" :max="20" placeholder="请输入客户编号" clearable></el-input>
                 </el-form-item>
                 <el-form-item label="客户名称" prop="customerName">
-                    <el-input v-model="addForm.customerName" :max="20" :disabled="user.role==0" placeholder="请输入客户名称" clearable></el-input>
+                    <el-input v-model="addForm.customerName" :max="20" placeholder="请输入客户名称" clearable></el-input>
                 </el-form-item>
                 <el-form-item label="联系人" prop="contactName">
-                    <el-input v-model="addForm.contactName" :max="20" :disabled="user.role==0" placeholder="请输入客户联系人" clearable></el-input>
+                    <el-input v-model="addForm.contactName" :max="20" placeholder="请输入客户联系人" clearable></el-input>
                 </el-form-item>
                 <el-form-item label="联系电话" prop="contactPhone">
-                    <el-input v-model="addForm.contactPhone" :max="20" :disabled="user.role==0" placeholder="请输入客户联系电话" clearable></el-input>
+                    <el-input v-model="addForm.contactPhone" :max="20" placeholder="请输入客户联系电话" clearable></el-input>
                 </el-form-item>
                 <el-form-item label="邮箱" prop="email">
-                    <el-input v-model="addForm.email" :max="25" :disabled="user.role==0" placeholder="请输入客户邮箱" clearable></el-input>
+                    <el-input v-model="addForm.email" :max="25" placeholder="请输入客户邮箱" clearable></el-input>
                 </el-form-item>
                 <el-form-item label="地址" prop="address">
-                    <el-input v-model="addForm.address" :max="50"  :disabled="user.role==0" placeholder="请输入客户联系地址" clearable></el-input>
+                    <el-input v-model="addForm.address" :max="50"  placeholder="请输入客户联系地址" clearable></el-input>
                 </el-form-item>
 
             </el-form>