| | |
| | | @keyup.enter.native="queryHandle" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="真实姓名"> |
| | | <el-input |
| | | v-model="queryForm.realname" |
| | | class="filter-item" |
| | | placeholder="" |
| | | style="width: 150px;" |
| | | @keyup.enter.native="queryHandle" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="单位"> |
| | | <el-input |
| | | v-model="queryForm.company" |
| | |
| | | icon="el-icon-upload2" |
| | | @click="showImportHandle" |
| | | >导入</el-button> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | v-if="getBtnPermission('export')" |
| | | v-show="userType != 3" |
| | | class="filter-item" |
| | | style="margin-left: 10px;" |
| | | type="primary" |
| | | icon="el-icon-upload2" |
| | | @click="showExportHandle" |
| | | >导出</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | <span>{{ scope.row.company }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="部门" prop="department" align="center" sortable="custom" width="100px"> |
| | | <el-table-column label="部门" prop="departmentname" align="center" sortable="custom" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.department }}</span> |
| | | <span>{{ scope.row.departmentname }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="职位" prop="job" align="center" sortable="custom" width="100px"> |
| | |
| | | <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> |
| | |
| | | <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"> |
| | |
| | | <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> |
| | |
| | | </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" |
| | | :key="item.id" |
| | | :value="item.department" |
| | | :value="item.id" |
| | | :label="item.department" |
| | | > |
| | | </el-option> |
| | |
| | | </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 |
| | |
| | | </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> |
| | |
| | | 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: '', |
| | | company:'', |
| | | department:'', |
| | |
| | | idcard:'', |
| | | email:'', |
| | | company:'', |
| | | companyid:'', |
| | | department:'', |
| | | job:'', |
| | | type:'', |
| | |
| | | lastmodifieddate:'', |
| | | empNo:'', |
| | | deviceNo:'', |
| | | issecurityofficer:'', |
| | | }, |
| | | cardDataForm:{ |
| | | username:'', |
| | |
| | | userRoleDataFormRules: { |
| | | userRoles: [{ type: 'array', required: true, message: '角色不能为空', trigger: 'change' }] |
| | | }, |
| | | typeList:[{id:1,name:'超级管理员'},{id:2,name:'管理员'},{id:3,name:'普通用户'}], |
| | | roleList: [], |
| | | passwordType: 'password', |
| | | confirmPasswordType: 'password', |
| | |
| | | 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 = {} |
| | |
| | | params['pageIndex'] = _this.currentPage |
| | | params['pageSize'] = _this.pageSize |
| | | params['type'] = _this.userType |
| | | params['realname'] = _this.realname |
| | | params['isMain'] = true |
| | | for (const i in _this.queryForm) { |
| | | if (_this.queryForm[i] != undefined && _this.queryForm[i].toString() != '') { |
| | |
| | | _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 => { |
| | |
| | | }) |
| | | _this.getUserList() |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | parseError({ error: res.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | parseError({ error: error, vm: _this }) |
| | |
| | | }) |
| | | _this.getUserList() |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | parseError({ error: res.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | parseError({ error: error, vm: _this }) |
| | |
| | | createddate:'', |
| | | lastmodifiedby:'', |
| | | lastmodifieddate:'', |
| | | issecurityofficer:'', |
| | | } |
| | | }, |
| | | getDepartmentData(){ |
| | |
| | | }) |
| | | _this.getUserList() |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | parseError({ error: res.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | parseError({ error: error, vm: _this }) |
| | |
| | | }) |
| | | _this.getUserList() |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | parseError({ error: res.message, vm: _this }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | 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() |
| | | }) |
| | |
| | | this.importDisabled = false |
| | | this.importDialogFormVisible = true |
| | | }, |
| | | |
| | | |
| | | showExportHandle() { |
| | | const _this = this |
| | | const params = {} |
| | | params['sort'] = _this.sort |
| | | params['order'] = _this.order |
| | | params['pageIndex'] = 0 |
| | | params['pageSize'] = 99999 |
| | | params['type'] = _this.userType |
| | | params['realname'] = _this.realname |
| | | params['isMain'] = true |
| | | for (const i in _this.queryForm) { |
| | | if (_this.queryForm[i] != undefined && _this.queryForm[i].toString() != '') { |
| | | params[i] = _this.queryForm[i] |
| | | } |
| | | } |
| | | userList(params) |
| | | .then((response) => { |
| | | const res = response.data |
| | | if (res.code == 200) { |
| | | const allData = res.result.result |
| | | if (allData.length == 0) { |
| | | parseError({ error: '没有录入数据', vm: _this }) |
| | | return |
| | | } |
| | | import('@/vendor/Export2Excel').then((excel) => { |
| | | const tHeader = [ |
| | | '用户名', |
| | | '真实姓名', |
| | | '身份证号', |
| | | '单位', |
| | | '部门', |
| | | '职位', |
| | | '用户类型', |
| | | '角色', |
| | | ] |
| | | |
| | | const data = allData.map(v=>{ |
| | | return [ |
| | | v.username, |
| | | v.realname, |
| | | v.idcard, |
| | | v.company, |
| | | v.department, |
| | | v.job, |
| | | this.typeList.find(item=>item.id === v.type).name, |
| | | v.roles.map(item=>item.name).join(","), |
| | | ] |
| | | }) |
| | | excel.export_json_to_excel({ |
| | | header: tHeader, |
| | | data, |
| | | filename: '用户' |
| | | }) |
| | | }) |
| | | } else { |
| | | parseError({ error: res.message, vm: _this }) |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | parseError({ error: error, vm: _this }) |
| | | }) |
| | | }, |
| | | viewHandle() { |
| | | window.open(exampleFile, '_blank') |
| | | }, |
| | |
| | | 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.data.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 |
| | |
| | | const _this = this; |
| | | bindCard(_this.cardDataForm).then(response => { |
| | | const res = response.data |
| | | debugger |
| | | if (res.code === '200'){ |
| | | _this.$message({ |
| | | message: '绑定成功', |