| | |
| | | * @Author: lzhe lzhe@example.com |
| | | * @Date: 2024-03-26 10:28:33 |
| | | * @LastEditors: lzhe lzhe@example.com |
| | | * @LastEditTime: 2024-04-09 20:46:11 |
| | | * @LastEditTime: 2024-04-10 15:44:08 |
| | | * @FilePath: /smart-web/src/views/master/person/main/index.vue |
| | | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
| | | --> |
| | |
| | | <div class="right-top"> |
| | | <div class="right-bottom"> |
| | | <el-button type="primary" @click="addPerson">+ 添加岗位</el-button> |
| | | <!-- 导入 --> |
| | | <import-table class="exportBtn" :exportUrl="exportUrl" :uploadUrl="uploadUrl"></import-table> |
| | | <!-- 导出 --> |
| | | <el-button type="primary" @click="getExport">导出</el-button> |
| | | <el-button type="danger" plain @click="delPerson">删除</el-button> |
| | | </div> |
| | | <div> |
| | | <el-select v-model="postSearchData.status" placeholder="状态" class="searchStatus"> |
| | | <el-option v-for="item in statusList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" size="small"/> |
| | | <el-option key="1" label="启用" value="1" size="small"/> |
| | | <el-option key="0" label="停用" value="0" size="small"/> |
| | | </el-select> |
| | | <el-input v-model="postSearchData.keywords" style="width: 200px" size="small" placeholder="请输入关键字进行过滤"> |
| | | <template #append> |
| | | <el-button :icon="searchIcon" @click="searchPerson" /> |
| | | <el-button @click="getPost"> |
| | | <i class="el-icon"><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704z"></path></svg></i> |
| | | </el-button> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | |
| | | </el-dialog> |
| | | </template> |
| | | <script> |
| | | import importTable from '@/layout/components/importTable.vue' |
| | | import saveDialog from './post' |
| | | export default { |
| | | name: "bakalaka", |
| | | data(){ |
| | | return { |
| | | uploadUrl: "/api/blade-system/post/import-post", |
| | | exportUrl: "/api/blade-system/post/export-template", |
| | | totle: "0", |
| | | statusList: [], |
| | | postSearchData: { |
| | | current: 1, |
| | | size: 15, |
| | |
| | | keywords: "" |
| | | }, |
| | | isSaveing: false, |
| | | groups: [], |
| | | departmentFrom: { |
| | | department: "" |
| | | }, |
| | | departmentVisibleRules: { |
| | | department:[ |
| | | {required: true, message: '请选择部门'} |
| | | ] |
| | | }, |
| | | departmentVisible: false, |
| | | dialog: { |
| | | save: false |
| | | }, |
| | |
| | | |
| | | }, |
| | | mounted(){ |
| | | this.getStatus(); |
| | | this.getPost(); |
| | | }, |
| | | components: { |
| | | saveDialog |
| | | saveDialog,importTable |
| | | }, |
| | | methods: { |
| | | getExport() { |
| | | this.$HTTP.get(`/api/blade-system/post/export-post?`+this.$TOOL.qsStringify(this.postSearchData)).then(res=> { |
| | | if(res.code == 200) { |
| | | window.open(res.data.link); |
| | | } |
| | | }) |
| | | }, |
| | | delData(type) { |
| | | this.$HTTP.post(`/api/blade-system/post/remove?ids=${this.selectId}&type=${type}`).then(res=> { |
| | | if(res.code == 200) { |
| | |
| | | postHandleSuccess() { |
| | | this.getPost(); |
| | | }, |
| | | getStatus() { //获取全部账号 |
| | | this.$HTTP.get(`/api/blade-system/dict/dictionary?code=employee_status`).then(res=> { |
| | | if(res.code == 200) { |
| | | this.statusList = res.data; |
| | | } |
| | | }) |
| | | }, |
| | | getPost() { //岗位 |
| | | this.$HTTP.get(`/api/blade-system/post/page?`+this.$TOOL.qsStringify(this.postSearchData)).then(res=> { |
| | | if(res.code == 200) { |
| | |
| | | this.totle = res.data.total; |
| | | } |
| | | }) |
| | | }, |
| | | departmentSubmit() { |
| | | this.departmentVisible=false; //部门调整 |
| | | }, |
| | | //添加 |
| | | addPerson(){ |
| | |
| | | }) |
| | | this.selectId = selStr.replace(/,$/, ''); |
| | | this.delPersonModel = true; |
| | | }, |
| | | changeDepartment() { |
| | | this.departmentVisible = true; |
| | | }, |
| | | handleSizeChange(val) { |
| | | console.log(`每页 ${val} 条`); |
| | |
| | | line-height: 20px; |
| | | margin-right: 6px; |
| | | } |
| | | .exportBtn { |
| | | margin-left:8px; |
| | | margin-right:8px; |
| | | } |
| | | </style> |