From fe2617a36f52c16f83e7d3cb19d911bb91a3b79f Mon Sep 17 00:00:00 2001
From: lyfO_o <764716047@qq.com>
Date: 星期一, 13 六月 2022 09:00:28 +0800
Subject: [PATCH] 删除固定菜单

---
 src/views/systemManage/userManage/index.vue |   67 ++++++++++++++++++++++++++-------
 1 files changed, 52 insertions(+), 15 deletions(-)

diff --git a/src/views/systemManage/userManage/index.vue b/src/views/systemManage/userManage/index.vue
index 4a265a2..719e7d8 100644
--- a/src/views/systemManage/userManage/index.vue
+++ b/src/views/systemManage/userManage/index.vue
@@ -200,7 +200,7 @@
                         <span>{{ scope.row.roles | parseRoles }}</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="人员MAC地址" prop="deviceNo" align="center" width="100px">
+                <!-- <el-table-column label="人员MAC地址" prop="deviceNo" align="center" width="100px">
                     <template slot-scope="scope">
                         <span>{{ scope.row.deviceNo}}</span>
                     </template>
@@ -226,7 +226,7 @@
                         <span>{{ scope.row.endtime}}</span>
                     </template>
 
-                </el-table-column>
+                </el-table-column> -->
                 <el-table-column label="是否单位负责人" prop="iscompany" align="center" width="100px">
                     <template slot-scope="scope">
                         <div v-for="item in isList">
@@ -348,11 +348,11 @@
                 <el-row>
                     <el-col :span="12">
                         <el-form-item label="单位:" prop="company">
-                            <el-select v-model.trim="dataForm.company"  auto-complete="on" style="width:100%;">
+                            <el-select v-model.trim="dataForm.company"  value-key="item" auto-complete="on" style="width:100%;" @change="companyChange">
                                 <el-option
                                     v-for="item in companyList"
                                     :key="item.id"
-                                    :value="item.company"
+                                    :value="item"
                                     :label="item.company"
                                 >
                                 </el-option>
@@ -360,7 +360,7 @@
                         </el-form-item>
                     </el-col>
                     <el-col :span="12">
-                        <el-form-item label="部门:" prop="department">
+                        <el-form-item label="部门:" prop="department" v-if="isMain">
                             <el-select v-model.trim="dataForm.department"  auto-complete="on" style="width:100%;">
                                 <el-option
                                     v-for="item in departmentList"
@@ -425,6 +425,19 @@
                 </el-row>
                 <el-row>
                     <el-col :span="12">
+                        <el-form-item label="是否安全员:" prop="issecurityofficer">
+                            <el-select v-model.trim="dataForm.issecurityofficer"  auto-complete="on" style="width:100%;">
+                                <el-option
+                                    v-for="item in isSecurityOfficerList"
+                                    :key="item.id"
+                                    :value="item.id"
+                                    :label="item.name"
+                                >
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
                         <el-form-item label="状态:" prop="status">
                             <el-select v-model.trim="dataForm.status"  auto-complete="on" style="width:100%;">
                                 <el-option
@@ -437,13 +450,14 @@
                             </el-select>
                         </el-form-item>
                     </el-col>
+
+                </el-row>
+                <el-row>
                     <el-col :span="12">
                         <el-form-item label="定位卡编号:" prop="empNo">
                             <el-input v-model.trim="dataForm.empNo"></el-input>
                         </el-form-item>
                     </el-col>
-                </el-row>
-                <el-row>
                     <el-col :span="12">
                         <el-form-item label="定位卡MAC地址:" prop="deviceNo">
                             <el-input v-model.trim="dataForm.deviceNo"></el-input>
@@ -654,7 +668,9 @@
                 tableKey: 0,
                 userData: null,
                 listLoading: true,
+                isMain:false,
                 iscompanyList:[{id:1,name:'否'},{id:0,name:'是'}],
+                isSecurityOfficerList:[{id:1,name:'是'},{id:0,name:'否'}],
                 queryForm: {
                     realname:'',
                     username: '',
@@ -675,6 +691,7 @@
                     idcard:'',
                     email:'',
                     company:'',
+                    companyid:'',
                     department:'',
                     job:'',
                     type:'',
@@ -690,6 +707,7 @@
                     lastmodifieddate:'',
                     empNo:'',
                     deviceNo:'',
+                    issecurityofficer:'',
                 },
                 cardDataForm:{
                     username:'',
@@ -761,6 +779,16 @@
                 this.order = param.order;
                 this.getUserList()
             },
+            companyChange(val){
+                this.dataForm.company = val.company
+                this.dataForm.companyid = val.id
+                if (val.ismain === 1) {
+                    this.isMain = true;
+                }else{
+                    this.isMain = false;
+                    this.dataForm.department = ''
+                }
+            },
             getUserList() {
                 const _this = this
                 const params = {}
@@ -786,8 +814,14 @@
                         _this.pageTotal = computePageCount(result.totalCount, result.pageSize)
                         _this.currentPage = result.pageIndex
                         _this.userData = result.result
-                    } else {
-                        parseError({ error: res.data.message, vm: _this })
+                    }else if(res.code === '100'){
+                            this.$store.dispatch('LogOut').then(() => {
+                            location.reload()// In order to re-instantiate the vue-router object to avoid bugs
+                            parseError({ error: res.message, vm: _this })
+                        })
+                    }
+                     else {
+                        parseError({ error: res.message, vm: _this })
                     }
                     _this.listLoading = false
                 }).catch(error => {
@@ -820,7 +854,7 @@
                                 })
                                 _this.getUserList()
                             } else {
-                                parseError({ error: res.data.message, vm: _this })
+                                parseError({ error: res.message, vm: _this })
                             }
                         }).catch(error => {
                             parseError({ error: error, vm: _this })
@@ -856,7 +890,7 @@
                         })
                         _this.getUserList()
                     } else {
-                        parseError({ error: res.data.message, vm: _this })
+                        parseError({ error: res.message, vm: _this })
                     }
                 }).catch(error => {
                     parseError({ error: error, vm: _this })
@@ -884,6 +918,7 @@
                     createddate:'',
                     lastmodifiedby:'',
                     lastmodifieddate:'',
+                    issecurityofficer:'',
                 }
             },
             getDepartmentData(){
@@ -944,7 +979,7 @@
                                 })
                                 _this.getUserList()
                             } else {
-                                parseError({ error: res.data.message, vm: _this })
+                                parseError({ error: res.message, vm: _this })
                             }
                         }).catch(error => {
                             parseError({ error: error, vm: _this })
@@ -1002,7 +1037,7 @@
                                 })
                                 _this.getUserList()
                             } else {
-                                parseError({ error: res.data.message, vm: _this })
+                                parseError({ error: res.message, vm: _this })
                             }
                         })
                     }
@@ -1012,8 +1047,11 @@
                 this.resetDataForm()
                 this.dataForm = row
                 this.dataForm.password = null
+                this.dataForm.companyid = row.companyInfo.id
                 this.dialogStatus = 'update'
                 this.dialogFormVisible = true
+                let ismain = this.companyList.find(item=>item.company === row.company).ismain
+                this.isMain = ismain === 1;
                 this.$nextTick(() => {
                     this.$refs['dataForm'].clearValidate()
                 })
@@ -1160,7 +1198,7 @@
                             })
                             _this.getUserList()
                         } else {
-                            parseError({ error: res.data.message, vm: _this })
+                            parseError({ error: res.message, vm: _this })
                         }
                     })
                     .catch((error) => {
@@ -1331,7 +1369,6 @@
                 const _this = this;
                 bindCard(_this.cardDataForm).then(response => {
                     const res = response.data
-                    debugger
                     if (res.code === '200'){
                         _this.$message({
                             message: '绑定成功',

--
Gitblit v1.9.2