| | |
| | | @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> |
| | |
| | | listLoading: true, |
| | | iscompanyList:[{id:1,name:'否'},{id:0,name:'是'}], |
| | | queryForm: { |
| | | realname:'', |
| | | username: '', |
| | | company:'', |
| | | department:'', |
| | |
| | | userRoleDataFormRules: { |
| | | userRoles: [{ type: 'array', required: true, message: '角色不能为空', trigger: 'change' }] |
| | | }, |
| | | typeList:[{id:1,name:'超级管理员'},{id:2,name:'管理员'},{id:3,name:'普通用户'}], |
| | | roleList: [], |
| | | passwordType: 'password', |
| | | confirmPasswordType: 'password', |
| | |
| | | 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.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') |
| | | }, |