Tang 4 anos atrás
pai
commit
2948b527cb

+ 9 - 7
src/layout/permission.js

@@ -3,6 +3,7 @@ import router from '@/router'
 import { Message, MessageBox } from 'element-ui'
 import cookie from '@/utils/cookie'
 import NProgress from 'nprogress';//加载进度条
+import methods from '@/utils/methodsTool';
 import 'nprogress/nprogress.css';//加载进度条
 // const TenantId = '867735392558919680'
 NProgress.configure({
@@ -57,17 +58,18 @@ router.beforeEach((to, from, next) => {
         if (to.path === '/login') {
                 next()
         } else {
-            let TenantId = 0
-            if(router.history.current){
-                TenantId = router.history.current.query.TenantId
-            }
             localStorage.clear()
             store.state.tabberLists = []
             store.state.routes = []
             store.state.allRoutes = []
-            next({path:'/login',query:{
-                TenantId: TenantId
-            }})
+            if(methods.getQueryVariable('TenantId')){
+                next({path:'/login',query:{
+                    TenantId: methods.getQueryVariable('TenantId')
+                }})
+            }else{
+                next({path:'/login'})
+            }
+            
             Message({
                 type: 'info',
                 message: '登录已过期,请重新登录'

+ 16 - 5
src/store/index.js

@@ -19,7 +19,7 @@ const store = new Vuex.Store({
         routes: [],//新增路由
         allRoutes: [],// 总路由
         userInfo: [],//用户信息
-        UserDict: [],//字典数据
+        UserDict: {},//字典数据
     },
     getters: {
         addRouters(state) {
@@ -33,7 +33,10 @@ const store = new Vuex.Store({
         },
         userInfo(state) {
             return state.userInfo
-        }
+        },
+        UserDict(state){
+            return state.UserDict
+        } 
     },
     mutations: {
         // 获取最新路由情况
@@ -41,8 +44,6 @@ const store = new Vuex.Store({
             state.routes = routes
             state.allRoutes = constantRouterMap.concat(routes)
             router.options.routes = state.allRoutes
-            // }
-
         },
         userData(state, data) {
             var a = []
@@ -124,7 +125,17 @@ const store = new Vuex.Store({
         },
         GetUserDict(state) {
             api.obtaindictdata().then(res => {
-                state.UserDict = res.rows
+                let newList = {}
+                let list = res.rows
+                for(let i =0 ;i<list.length;i++){
+                    let item = list[i]
+                    if(newList.hasOwnProperty(item.dictType)){
+                        newList[item.dictType].push(item)
+                    }else{
+                        newList[item.dictType] = [item]
+                    }
+                }
+                state.UserDict = newList;
             })
         },
     },

+ 14 - 5
src/utils/methodsTool.js

@@ -16,7 +16,7 @@ export default {
 		}
 		return BASE_IMG_URL + '/' + url
 	},
-	onlyForma(timeStamp,Diszing = true) {
+	onlyForma(timeStamp, Diszing = true) {
 		var date = new Date(timeStamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
 		var Y = date.getFullYear() + '-';
 		var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
@@ -24,16 +24,25 @@ export default {
 		var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
 		var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
 		var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
-		if(Diszing){
+		if (Diszing) {
 			return Y + M + D + ' ' + h + m + s; //时分秒可以根据自己的需求加上
 		}
 		return Y + M + D;
 	},
 	computedAge(birthday) {
-		let birthDayTime = new Date(birthday).getTime(); 
+		let birthDayTime = new Date(birthday).getTime();
 		//当前时间 毫秒
-		let nowTime = new Date().getTime(); 
+		let nowTime = new Date().getTime();
 		//一年毫秒数(365 * 86400000 = 31536000000)
-		return Math.ceil((nowTime-birthDayTime)/31536000000);
+		return Math.ceil((nowTime - birthDayTime) / 31536000000);
+	},
+	getQueryVariable(variable) {
+		var query = window.location.search.substring(1);
+		var vars = query.split("&");
+		for (var i = 0; i < vars.length; i++) {
+			var pair = vars[i].split("=");
+			if (pair[0] == variable) { return pair[1]; }
+		}
+		return (false);
 	}
 }

+ 7 - 7
src/utils/request.js

@@ -29,18 +29,18 @@ service.interceptors.request.use(
             }
         }
         if (sessionStorage.TenantId && sessionStorage.TenantId !== 'undefined') {
-            config.headers.TenantId = sessionStorage.TenantId; 
-        } else if (router.history.current !== null && router.history.current.query.TenantId) {
-            config.headers.TenantId = router.history.current.query.TenantId
-            sessionStorage.TenantId = router.history.current.query.TenantId;
+            config.headers.TenantId = sessionStorage.TenantId;
+        } else if (methods.getQueryVariable('TenantId')) {
+            config.headers.TenantId = methods.getQueryVariable('TenantId')
+            sessionStorage.TenantId = methods.getQueryVariable('TenantId')
         } else {
             if (router.history._startLocation.indexOf("?TenantId=") !== -1) {
-                var a = router.history._startLocation.slice(router.history._startLocation.indexOf("=") +1, router.history._startLocation.indexOf("?TenantId=").length)
+                var a = router.history._startLocation.slice(router.history._startLocation.indexOf("=") + 1, router.history._startLocation.indexOf("?TenantId=").length)
                 config.headers.TenantId = a
                 sessionStorage.TenantId = a
             }
-            console.log('router.history:',router.history)
-            console.log('sessionStorage.TenantId:',sessionStorage.TenantId)
+            console.log('router.history:', router.history)
+            console.log('sessionStorage.TenantId:', sessionStorage.TenantId)
         }
         return config;   //  然后把配置返回
     },

+ 4 - 10
src/view/jobSearchManagement/companyManagement/index.vue

@@ -204,6 +204,7 @@ import searchBox from "@/components/searchBox";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 import VDistpicker from "v-distpicker";
+import { mapGetters } from "vuex";
 export default {
   components: { searchBox, tableList, pagination, VDistpicker },
   data() {
@@ -438,6 +439,7 @@ export default {
       beif: {},
     };
   },
+  computed: { ...mapGetters(["UserDict"]) },
   created() {
     this.companyGM();
     this.companyLX();
@@ -471,12 +473,8 @@ export default {
       this.psCity.district = v.value;
     },
     companyGM() {
-      var arays = [];
       var newArrays = [];
-      arays = this.$store.state.UserDict.filter((item, index) => {
-        return item.dictType == "company_size";
-      });
-      arays.forEach((item, index) => {
+      this.UserDict['company_size'].forEach((item, index) => {
         let arrayList = {
           label: item.dictLabel,
           value: item.dictCode,
@@ -495,12 +493,8 @@ export default {
       }
     },
     companyLX() {
-      var arays = [];
       var newArrays = [];
-      arays = this.$store.state.UserDict.filter((item, index) => {
-        return item.dictType == "company_type";
-      });
-      arays.forEach((item, index) => {
+      this.UserDict['company_type'].forEach((item, index) => {
         let arrayList = {
           label: item.dictLabel,
           value: item.dictCode,

+ 20 - 34
src/view/jobSearchManagement/jobTemplate/index.vue

@@ -74,7 +74,7 @@
             <el-select
               :placeholder="items.placeholder"
               :disabled="statusPop === 2"
-              v-else-if="items.scope === 'select'"
+              v-else-if="items.scope === 'selectComy'"
               v-model="listData[items.prop]"
             >
               <el-option
@@ -85,6 +85,20 @@
               >
               </el-option>
             </el-select>
+            <el-select
+              :placeholder="items.placeholder"
+              :disabled="statusPop === 2"
+              v-else-if="items.scope === 'select'"
+              v-model="listData[items.prop]"
+            >
+              <el-option
+                v-for="(item, index) in UserDict[items.dictLabel]"
+                :key="index"
+                :label="item.dictLabel"
+                :value="Number(item.dictCode)"
+              >
+              </el-option>
+            </el-select>
             <div v-else-if="items.scope === 'moreInputs'">
               <el-select
                 v-model="listData[items.prop]"
@@ -174,6 +188,7 @@
 import searchBox from "@/components/searchBox";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { mapGetters } from "vuex";
 export default {
   components: { searchBox, tableList, pagination },
   data() {
@@ -291,7 +306,7 @@ export default {
         {
           label: "公司名称",
           prop: "companyId",
-          scope: "select",
+          scope: "selectComy",
           options: [],
           placeholder: "请输入公司名称",
         },
@@ -341,12 +356,14 @@ export default {
           prop: "workingYearsDict",
           scope: "select",
           options: [],
+          dictLabel:'working_years'
         },
         {
           label: "最低学历要求",
           prop: "minimumEduDict",
           scope: "select",
           options: [],
+          dictLabel:'edu_level'
         },
         {
           label: "专业",
@@ -400,6 +417,7 @@ export default {
       },
     };
   },
+  computed: { ...mapGetters(["UserDict"]) },
   created() {
     this.getDict();
   },
@@ -422,9 +440,6 @@ export default {
       }
     },
     getDict() {
-      var arays = []; //学历
-      var workYears = []; //工作年限
-      var newArrays = []; //学历转换
       var companysArrays = [
         {
           label: this.$store.state.userInfo[0].tenant.tenantName,
@@ -441,36 +456,7 @@ export default {
         });
       });
 
-      var workYearsArrays = []; //工作年限转换
-      this.$store.state.UserDict.forEach((item, index) => {
-        if (item.dictType == "edu_level") {
-          arays.push(item);
-        }
-        if (item.dictType == "working_years") {
-          workYears.push(item);
-        }
-      });
-      arays.forEach((item, index) => {
-        let arrayList = {
-          label: item.dictLabel,
-          value: item.dictCode,
-        };
-        newArrays.push(arrayList);
-      });
-      workYears.forEach((item, index) => {
-        let arrayList = {
-          label: item.dictLabel,
-          value: item.dictCode,
-        };
-        workYearsArrays.push(arrayList);
-      });
       for (let i = 0; i < this.listitem.length; i++) {
-        if (this.listitem[i].label === "最低学历要求") {
-          this.listitem[i].options = newArrays;
-        }
-        if (this.listitem[i].label === "工作年限") {
-          this.listitem[i].options = workYearsArrays;
-        }
         if (this.listitem[i].label === "公司名称") {
           this.listitem[i].options = companysArrays;
         }

+ 22 - 41
src/view/jobSearchManagement/recruitmentManagement/index.vue

@@ -120,7 +120,7 @@
             <el-select
               :placeholder="items.placeholder"
               :disabled="statusPop === 2"
-              v-else-if="items.scope === 'select'"
+              v-else-if="items.scope === 'selectComy'"
               v-model="listData[items.prop]"
             >
               <el-option
@@ -131,6 +131,20 @@
               >
               </el-option>
             </el-select>
+            <el-select
+              :placeholder="items.placeholder"
+              :disabled="statusPop === 2"
+              v-else-if="items.scope === 'select'"
+              v-model="listData[items.prop]"
+            >
+              <el-option
+                v-for="(item, index) in UserDict[items.dictLabel]"
+                :key="index"
+                :label="item.dictLabel"
+                :value="Number(item.dictCode)"
+              >
+              </el-option>
+            </el-select>
             <div v-else-if="items.scope === 'zmPeople'">
               <el-radio-group v-model="listData[items.prop]">
                 <el-radio
@@ -320,6 +334,7 @@
 </template>
 
 <script>
+import { mapGetters } from "vuex";
 import searchBox from "@/components/searchBox";
 import VDistpicker from "v-distpicker";
 import tableList from "@/components/tableList";
@@ -495,7 +510,7 @@ export default {
         {
           label: "公司名称",
           prop: "companyId",
-          scope: "select",
+          scope: "selectComy",
           options: [],
           placeholder: "请输入公司名称",
         },
@@ -584,12 +599,14 @@ export default {
           prop: "workingYearsDict",
           scope: "select",
           options: [],
+          dictLabel:'working_years'
         },
         {
           label: "最低学历要求",
           prop: "minimumEduDict",
           scope: "select",
           options: [],
+          dictLabel:'edu_level'
         },
         {
           label: "联系人",
@@ -703,13 +720,11 @@ export default {
       },
     };
   },
-  created() {
-    this.getDict();
-  },
+  computed: { ...mapGetters(["UserDict"]) },
   mounted() {
+    this.getDict();
     this.search();
     this.initCascader();
-    // this.stopStatusssss()
   },
   methods: {
     changeJob(v) {
@@ -829,12 +844,6 @@ export default {
       this.psCity.district = v.value;
     },
     getDict() {
-      var arays = []; //学历
-      var newArrays = []; //学历转换
-
-      var workYears = []; //工作年限
-      var workYearsArrays = []; //工作年限转换
-
       var companys = []; //公司名称
       var companysArrays = [
         {
@@ -853,29 +862,6 @@ export default {
       });
       var zpmb = []; //招聘模板
       var zpmbArrays = [];
-
-      this.$store.state.UserDict.forEach((item, index) => {
-        if (item.dictType == "edu_level") {
-          arays.push(item);
-        }
-        if (item.dictType == "working_years") {
-          workYears.push(item);
-        }
-      });
-      arays.forEach((item, index) => {
-        let arrayList = {
-          label: item.dictLabel,
-          value: item.dictCode,
-        };
-        newArrays.push(arrayList);
-      });
-      workYears.forEach((item, index) => {
-        let arrayList = {
-          label: item.dictLabel,
-          value: item.dictCode,
-        };
-        workYearsArrays.push(arrayList);
-      });
       this.$api.recruittemplatelist().then((res) => {
         this.zpmb = res.rows;
         res.rows.forEach((item, index) => {
@@ -887,13 +873,8 @@ export default {
         });
       });
       for (let i = 0; i < this.listitem.length; i++) {
-        if (this.listitem[i].label === "最低学历要求") {
-          this.listitem[i].options = newArrays;
-        }
-        if (this.listitem[i].label === "工作年限") {
-          this.listitem[i].options = workYearsArrays;
-        }
         if (this.listitem[i].label === "公司名称") {
+          console.log(companysArrays)
           this.listitem[i].options = companysArrays;
         }
         if (this.listitem[i].label === "岗位") {

+ 3 - 4
src/view/jobSearchManagement/resumeCenter/index.vue

@@ -173,6 +173,7 @@ import searchBox from "@/components/searchBox";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 import resumes from "@/components/resumexq";
+import { mapGetters } from "vuex";
 export default {
   components: { searchBox, tableList, pagination, resumes },
   data() {
@@ -404,6 +405,7 @@ export default {
       statusIndexList:[0,1,2,3,4,5,6,7,8,9,10,11,12],
     };
   },
+    computed: { ...mapGetters(["UserDict"]) },
   created() {},
   mounted() {
     this.search();
@@ -413,11 +415,8 @@ export default {
   },
   methods: {
     pushDict() {
-      var dictList = this.$store.state.UserDict.filter((item, index) => {
-        return item.dictType === "edu_level";
-      });
       var arrays = [];
-      dictList.forEach((item, index) => {
+      this.UserDict['edu_level'].forEach((item, index) => {
         arrays.push({ label: item.dictLabel, value: item.dictLabel });
       });
       this.formList.forEach((item, index) => {

+ 3 - 3
src/view/login/login.vue

@@ -127,9 +127,9 @@ export default {
         return;
       }
       var data = {
-        code: this.loginData.code,
-        username: this.loginData.username,
-        password: this.loginData.password,
+        code: this.loginData.code.trim(),
+        username: this.loginData.username.trim(),
+        password: this.loginData.password.trim(),
         uuid: this.uuid,
       };
       this.$api

+ 5 - 5
src/view/systemSettings/department/index.vue

@@ -59,7 +59,7 @@
               v-model="listData[items.prop]"
             >
               <el-radio
-                v-for="(item, index) in items.options" 
+                v-for="(item, index) in items.options"
                 :key="index"
                 :label="item.value"
                 >{{ item.label }}</el-radio
@@ -345,9 +345,9 @@ export default {
           });
         }
       }
-      this.$nextTick(()=>{
-this.$refs.listData.clearValidate();
-})
+      this.$nextTick(() => {
+        this.$refs.listData.clearValidate();
+      });
       this.dialogVisible = true;
     },
     submit(formName) {
@@ -380,7 +380,7 @@ this.$refs.listData.clearValidate();
       }
     },
     close() {
-          this.dialogVisible = false;
+      this.dialogVisible = false;
     },
     normalizer(node) {
       if (node.children && !node.children.length) {

+ 19 - 12
src/view/systemSettings/roleInfoManagement/index.vue

@@ -340,25 +340,32 @@ export default {
         });
     },
     addClick(v, int) {
-      this.initData();
+      var self = this;
+      self.initData();
       if (v === undefined) {
-        this.statusPop = 1;
-        this.getMenuList();
-        this.dialogVisible = true;
+        self.statusPop = 1;
+        self.getMenuList();
+        self.dialogVisible = true;
+        self.$nextTick(() => {
+          self.$refs.listData.clearValidate();
+        });
       } else {
-        this.statusPop = int;
+        self.statusPop = int;
         var data = v.roleId;
-        this.$api.obtainRoleId(data).then(async (res) => {
+        self.$api.obtainRoleId(data).then(async (res) => {
           if (res.code === 200) {
-            const getCheckList = await this.getUserMenuList(v.roleId);
-            this.menuOptions = getCheckList.menus;
+            const getCheckList = await self.getUserMenuList(v.roleId);
+            self.menuOptions = getCheckList.menus;
             getCheckList.checkedKeys.forEach((v) => {
-              this.$nextTick(() => {
-                this.$refs.menu[0].setChecked(v, true, false);
+              self.$nextTick(() => {
+                self.$refs.menu[0].setChecked(v, true, false);
               });
             });
-            this.listData = res.data;
-            this.dialogVisible = true;
+            self.listData = res.data;
+            self.dialogVisible = true;
+            self.$nextTick(() => {
+              self.$refs.listData.clearValidate();
+            });
           }
         });
       }

+ 4 - 6
src/view/systemSettings/usermanagement/index.vue

@@ -167,6 +167,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import searchBox from "@/components/searchBox";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { mapGetters } from "vuex";
 export default {
   components: { Treeselect, searchBox, tableList, pagination },
   data() {
@@ -362,6 +363,7 @@ export default {
       },
     };
   },
+    computed: { ...mapGetters(["UserDict"]) },
   watch: {
     filterText(val) {
       this.$refs.tree.filter(val);
@@ -500,17 +502,13 @@ export default {
       this.$api.obtainRoleList(data).then((res) => {
         this.listitem.forEach((item, index) => {
           if (item.prop === "roleIds") {
-            item.options = res.rows;
+            item.options1 = res.rows;
           }
         });
       });
-      var arays = [];
-      arays = this.$store.state.UserDict.filter((item, index) => {
-        return item.dictType == "sys_user_sex";
-      });
       this.listitem.forEach((item, index) => {
         if (item.label === "用户性别") {
-          item.options = arays;
+          item.options = this.UserDict['sys_user_sex'];
         }
       });
     },

+ 44 - 32
src/view/userManagement/personalManagement/index.vue

@@ -206,7 +206,11 @@
           style="max-height: 680px; overflow: auto; margin: 20px 0px"
         >
           <el-form-item label="学校名称" prop="schoolName">
-            <el-select v-model="poppleData2.schoolName" filterable placeholder="请选择">
+            <el-select
+              v-model="poppleData2.schoolName"
+              filterable
+              placeholder="请选择"
+            >
               <el-option
                 v-for="item in schoolNameList"
                 :key="item.value"
@@ -288,7 +292,11 @@
             </el-select>
           </el-form-item>
           <el-form-item label="院系" prop="department">
-            <el-select v-model="poppleData2.department" filterable placeholder="请选择">
+            <el-select
+              v-model="poppleData2.department"
+              filterable
+              placeholder="请选择"
+            >
               <el-option
                 v-for="item in departmentList"
                 :key="item.value"
@@ -356,6 +364,7 @@ import pagination from "@/components/pagination";
 import userInfo from "@/components/userInfoS";
 import userStudyInfo from "@/components/userStudyInfo";
 import VDistpicker from "v-distpicker";
+import { mapGetters } from "vuex";
 export default {
   components: {
     searchBox,
@@ -531,6 +540,7 @@ export default {
       },
     };
   },
+  computed: { ...mapGetters(["UserDict"]) },
   mounted() {
     this.search();
     this.getDictData();
@@ -601,31 +611,29 @@ export default {
       let academicDegree = [];
       let educationalSystem = [];
       let departm = [];
-      this.$store.state.UserDict.forEach((item, index) => {
-        if (item.dictType == "marry_status") {
-          marryArrays.push({ value: item.dictLabel, label: item.dictLabel });
-        }
-        if (item.dictType == "politic_status") {
-          politicArrays.push({ value: item.dictLabel, label: item.dictLabel });
-        }
-        if (item.dictType == "full_time_school") {
-          fullTime.push({ value: item.dictLabel, label: item.dictLabel });
-        }
-        if (item.dictType == "edu_level") {
-          eduLevel.push({ value: item.dictLabel, label: item.dictLabel });
-        }
-        if (item.dictType == "academic_degree") {
-          academicDegree.push({ value: item.dictLabel, label: item.dictLabel });
-        }
-        if (item.dictType == "educational_system") {
-          educationalSystem.push({
-            value: item.dictLabel,
-            label: item.dictLabel,
-          });
-        }
-        if (item.dictType == "department") {
-          departm.push({ value: item.dictLabel, label: item.dictLabel });
-        }
+      this.UserDict["marry_status"].forEach((item, index) => {
+        marryArrays.push({ value: item.dictLabel, label: item.dictLabel });
+      });
+      this.UserDict["politic_status"].forEach((item, index) => {
+        politicArrays.push({ value: item.dictLabel, label: item.dictLabel });
+      });
+      this.UserDict["full_time_school"].forEach((item, index) => {
+        fullTime.push({ value: item.dictLabel, label: item.dictLabel });
+      });
+      this.UserDict["edu_level"].forEach((item, index) => {
+        eduLevel.push({ value: item.dictLabel, label: item.dictLabel });
+      });
+      this.UserDict["academic_degree"].forEach((item, index) => {
+        academicDegree.push({ value: item.dictLabel, label: item.dictLabel });
+      });
+      this.UserDict["educational_system"].forEach((item, index) => {
+        educationalSystem.push({
+          value: item.dictLabel,
+          label: item.dictLabel,
+        });
+      });
+      this.UserDict["department"].forEach((item, index) => {
+        departm.push({ value: item.dictLabel, label: item.dictLabel });
       });
       this.marryList = marryArrays;
       this.politic = politicArrays;
@@ -657,6 +665,10 @@ export default {
         }
       });
       this.dialogBox = true;
+      this.$nextTick(() => {
+        this.$refs.poppleData1.clearValidate();
+        this.$refs.poppleData2.clearValidate();
+      });
     },
     async submit(formName) {
       var self = this;
@@ -765,8 +777,8 @@ export default {
         studentStatusImg: this.poppleData2.studentStatusImg,
         userSchoolId: this.poppleData2.userSchoolId,
       };
-      console.log(data1,9);
-      console.log(data2,8);
+      console.log(data1, 9);
+      console.log(data2, 8);
       this.$api.editappuser(data1).then((res) => {
         if (res.code === 200) {
           self.$api.editappuserschoolinfo(data2).then((resb) => {
@@ -787,9 +799,9 @@ export default {
       this.activeIndex = 0;
     },
     close() {
-      this.poppleData1 = {}
-          this.dialogBox = false;
-          this.activeIndex = 0;
+      this.poppleData1 = {};
+      this.dialogBox = false;
+      this.activeIndex = 0;
     },
     handleSizeChange(v) {
       this.pageSize = v;