From b097841d8c343edd2b6cb650d0693c502754ce26 Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期四, 23 六月 2022 12:33:45 +0800
Subject: [PATCH] '导入导出'

---
 src/views/systemManage/userManage/index.vue |   56 +++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/src/views/systemManage/userManage/index.vue b/src/views/systemManage/userManage/index.vue
index c21b3c1..44c892c 100644
--- a/src/views/systemManage/userManage/index.vue
+++ b/src/views/systemManage/userManage/index.vue
@@ -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>
@@ -656,6 +670,7 @@
                 listLoading: true,
                 isMain:false,
                 iscompanyList:[{id:1,name:'否'},{id:0,name:'是'}],
+                isSecurityOfficerList:[{id:1,name:'是'},{id:0,name:'否'}],
                 queryForm: {
                     realname:'',
                     username: '',
@@ -676,6 +691,7 @@
                     idcard:'',
                     email:'',
                     company:'',
+                    companyid:'',
                     department:'',
                     job:'',
                     type:'',
@@ -691,6 +707,7 @@
                     lastmodifieddate:'',
                     empNo:'',
                     deviceNo:'',
+                    issecurityofficer:'',
                 },
                 cardDataForm:{
                     username:'',
@@ -764,6 +781,7 @@
             },
             companyChange(val){
                 this.dataForm.company = val.company
+                this.dataForm.companyid = val.id
                 if (val.ismain === 1) {
                     this.isMain = true;
                 }else{
@@ -900,6 +918,7 @@
                     createddate:'',
                     lastmodifiedby:'',
                     lastmodifieddate:'',
+                    issecurityofficer:'',
                 }
             },
             getDepartmentData(){
@@ -1028,6 +1047,7 @@
                 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
@@ -1167,23 +1187,21 @@
                     formData.append('file', files[0])
                 }
                 formData.append('action', 'import')
-                importUser(formData)
-                    .then((response) => {
-                        const res = response.data
-                        if (res.code == 200) {
-                            _this.importDialogFormVisible = false
-                            _this.$message({
-                                message: '导入成功',
-                                type: 'success'
-                            })
-                            _this.getUserList()
-                        } else {
-                            parseError({ error: res.message, vm: _this })
-                        }
-                    })
-                    .catch((error) => {
-                        parseError({ error: error, vm: _this })
-                    })
+                importUser(formData).then((response) => {
+                    const res = response.data
+                    if (res.code == 200) {
+                        _this.importDialogFormVisible = false
+                        _this.$message({
+                            message: '导入成功',
+                            type: 'success'
+                        })
+                        _this.getUserList()
+                    } else {
+                        parseError({ error: res.message, vm: _this })
+                    }
+                }).catch((error) => {
+                    parseError({ error: error, vm: _this })
+                })
             },
             getProvince(){
                 const _this = this

--
Gitblit v1.9.2