Forráskód Böngészése

去除主部门测试打印信息

cfort 1 éve
szülő
commit
84f697fe0e

+ 9 - 12
src/layout/header-aside/components/header-user/index.vue

@@ -132,7 +132,6 @@ import UserInfo from '@/views/platform/org/employee/edit'
 import request from '@/utils/request'
 import { getUserInfo } from '@/api/oauth2/user'
 
-
 export default {
     components: {
         ChangePassword,
@@ -259,7 +258,6 @@ export default {
             this.$router.replace('/tenantSelect')
         },
         handleMainChange (item) {
-            console.log(this.positions,this.users.account)
             getUserInfo(this.users.account).then(async response => {
                 if (!response) {
                     reject(response)
@@ -267,18 +265,18 @@ export default {
                 const info = response.data
                 info.positions.sort((a, b) => a.id - b.id)
                 this.positions.sort((a, b) => a.id - b.id)
-                if(info.positions.length!==this.positions.length){
+                if (info.positions.length !== this.positions.length) {
                     this.$message.warning('部门信息更新,请在刷新后重新选择!')
                     location.reload()
                     return
-                }else{
-                    info.positions.forEach((element,i) => {
-                        if(element.id!==this.positions[i].id || element.isMainPost!==this.positions[i].isMainPost){
+                } else {
+                    info.positions.forEach((element, i) => {
+                        if (element.id !== this.positions[i].id || element.isMainPost !== this.positions[i].isMainPost) {
                             this.$message.warning('部门信息更新,请在刷新后重新选择!')
                             location.reload()
                             return
                         }
-                    });
+                    })
                 }
                 if (this.$utils.isEmpty(this.mainPosition)) {
                     this.setMainPosition(item.id)
@@ -289,12 +287,11 @@ export default {
                 }
                 this.updateMainPosition(this.mainPosition.id, item.id)
             })
-            
         },
         setMainPosition (mid) {
-            let sql = `select * from ibps_party_rel where biz_ = 'mainPost' and SUB_PID_ = '${this.userId}'`
-            this.$common.request('sql', sql).then((r)=>{
-                if(r.variables.data.length===0){
+            const sql = `select * from ibps_party_rel where biz_ = 'mainPost' and SUB_PID_ = '${this.userId}'`
+            this.$common.request('sql', sql).then((r) => {
+                if (r.variables.data.length === 0) {
                     request({
                         url: '/platform/v3/rel/save',
                         method: 'post',
@@ -310,7 +307,7 @@ export default {
                         this.$message.success('设置主部门成功!')
                         location.reload()
                     })
-                }else{
+                } else {
                     this.$message.warning('部门信息更新,请在刷新后重新选择!')
                     location.reload()
                 }

+ 15 - 18
src/views/platform/org/employee/edit/index.vue

@@ -181,7 +181,7 @@ export default {
                 jiNengZhiCheng: 'inside'
             },
             employee: {},
-            oldEmployee: {},//未更改前全部信息
+            oldEmployee: {}, // 未更改前全部信息
             qrcodeVisible: false,
             personalInfo: '',
             toolbars: [
@@ -391,41 +391,39 @@ export default {
                     if (this.wxyhId) {
                         this.updateWxyh()
                     }
-                    //防止主部门多条起
-                    console.log(this.employee,this.oldEmployee,'2222')
-                    let obj = this.employee.posItemList.find(t=>t.isMainPost==="Y")
-                    let sql = `select * from ibps_party_rel where biz_ = 'mainPost' and SUB_PID_ = '${this.employee.id}'`
-                    this.$common.request('sql', sql).then((r)=>{
-                        let res = r.variables.data
+                    // 防止主部门多条起
+                    const obj = this.employee.posItemList.find(t => t.isMainPost === 'Y')
+                    const sql = `select * from ibps_party_rel where biz_ = 'mainPost' and SUB_PID_ = '${this.employee.id}'`
+                    this.$common.request('sql', sql).then((r) => {
+                        const res = r.variables.data
                         let old = false
-                        let oldArr = []
-                        if(res.length>0){
+                        const oldArr = []
+                        if (res.length > 0) {
                             old = true
-                            res.forEach((e,i)=>{
-                                if(i+1!==res.length){
+                            res.forEach((e, i) => {
+                                if (i + 1 !== res.length) {
                                     oldArr.push(e.MAIN_PID_)
                                 }
                             })
                         }
-                        if(typeof obj === "undefined"){
+                        if (typeof obj === 'undefined') {
                             const delParams = {
                                 tableName: 'ibps_party_rel',
                                 paramWhere: { SUB_PID_: this.employee.id }
                             }
                             this.$common.request('delete', delParams)
-                        }else if(typeof obj !== "undefined"&&old){
+                        } else if (typeof obj !== 'undefined' && old) {
                             const delParams = {
                                 tableName: 'ibps_party_rel',
-                                paramWhere: { SUB_PID_: this.employee.id,MAIN_PID_:oldArr.join(',') }
+                                paramWhere: { SUB_PID_: this.employee.id, MAIN_PID_: oldArr.join(',') }
                             }
                             this.$common.request('delete', delParams)
                         }
                         // 更新部门、岗位数据
                         this.$common.request('update', updateParams)
                     })
-                    //防止主部门多条止
+                    // 防止主部门多条止
 
-                    
                     // 启动培训
                     this.createTrain(response.variables.id)
                     this.$emit('dialog-callback', this)
@@ -529,10 +527,9 @@ export default {
                     })
                     this.employee.attrItemList = list
                 }
-                //保存更改前全部信息
+                // 保存更改前全部信息
                 this.oldEmployee = structuredClone(this.employee)
 
-
                 // 添加更新 t_wxyh 用于扫码签到
                 // if()
                 this.getWxyh(this.employee)