| | |
| | | class="filter-item search-item date-range-item" |
| | | type="daterange" |
| | | /> |
| | | <el-button class="filter-item" type="primary" @click="search"> |
| | | <el-button class="hr-but-all" type="primary" @click="search"> |
| | | {{ $t('table.search') }} |
| | | </el-button> |
| | | <el-button class="filter-item" type="success" @click="reset"> |
| | | <el-button class="hr-but-all" type="success" @click="reset"> |
| | | {{ $t('table.reset') }} |
| | | </el-button> |
| | | <el-button v-has-permission="['user:add']" class="filter-item" type="success" @click.native="add"> |
| | | <el-button v-has-permission="['user:add']" class="hr-but-all" type="success" @click.native="add"> |
| | | {{ $t('table.add') }} |
| | | </el-button> |
| | | <el-button v-has-permission="['user:delete']" class="filter-item" type="success" @click.native="batchDelete"> |
| | | <el-button v-has-permission="['user:delete']" type="primary" @click.native="batchDelete"> |
| | | {{ $t('table.delete') }} |
| | | </el-button> |
| | | <el-button v-has-permission="['user:reset']" class="filter-item" type="success" @click.native="resetPassword"> |
| | | <el-button v-has-permission="['user:reset']" class="hr-but-all" type="success" @click.native="resetPassword"> |
| | | {{ $t('table.resetPassword') }} |
| | | </el-button> |
| | | <el-button v-has-permission="['user:export']" class="filter-item" type="success" @click.native="exportExcel"> |
| | | <el-button v-has-permission="['user:export']" class="hr-but-all" type="success" @click.native="exportExcel"> |
| | | {{ $t('table.export') }} |
| | | </el-button> |
| | | |
| | | <el-button class="hr-but-all" type="primary" @click="templateDownload"> |
| | | {{ $t('table.templateDownload') }} |
| | | </el-button> |
| | | <el-upload |
| | | class="upload" |
| | | :action="uploadAction" |
| | | :headers="headers" |
| | | list-type="picture" |
| | | :show-file-list="false" |
| | | :before-upload="beforeUpload" |
| | | :on-success="uploadSuccess" |
| | | :on-error="uploadError" |
| | | :on-progress="uploadProgress" |
| | | > |
| | | <el-button v-has-permission="['user:import']" class="hr-but-all" icon="el-icon-upload2" type="success" plain> |
| | | {{ $t('table.import') }} |
| | | </el-button> |
| | | </el-upload> |
| | | <!-- <el-dropdown v-has-any-permission="['user:add','user:delete','user:reset','user:export']" trigger="click" class="filter-item"> |
| | | <el-button> |
| | | {{ $t('table.more') }}<i class="el-icon-arrow-down el-icon--right" /> |
| | |
| | | @sort-change="sortChange" |
| | | > |
| | | <el-table-column type="selection" align="center" width="40px" /> |
| | | <el-table-column :label="$t('table.operation')" align="center" min-width="150px" class-name="small-padding fixed-width"> |
| | | <template slot-scope="{row}"> |
| | | <i v-hasPermission="['user:view']" class="el-icon-view table-operation" style="color: #87d068;" @click="view(row)" /> |
| | | <i v-hasPermission="['user:update']" class="el-icon-setting table-operation" style="color: #2db7f5;" @click="edit(row)" /> |
| | | <i v-hasPermission="['user:delete']" class="el-icon-delete table-operation" style="color: #f50;" @click="singleDelete(row)" /> |
| | | <el-link v-has-no-permission="['user:view','user:update','user:delete']" class="no-perm"> |
| | | {{ $t('tips.noPermission') }} |
| | | </el-link> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="部门(护卫点)" align="center" min-width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.deptName }}</span> |
| | |
| | | <span>{{ scope.row.username }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="员工姓名" prop="nickName" :show-overflow-tooltip="true" align="center" min-width="120px"> |
| | | <el-table-column label="姓名" prop="nickName" :show-overflow-tooltip="true" align="center" min-width="120px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.nickName }}</span> |
| | | </template> |
| | |
| | | <span>{{ scope.row.certificateNumb }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="手机" :show-overflow-tooltip="true" align="center" min-width="120px" /> |
| | | <el-table-column label="手机" :show-overflow-tooltip="true" align="center" min-width="120px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.mobile }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :label="$t('table.user.email')" :show-overflow-tooltip="true" align="center" min-width="150px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.email }}</span> |
| | |
| | | <span>{{ scope.row.createTime }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column :label="$t('table.operation')" align="center" min-width="150px" class-name="small-padding fixed-width"> |
| | | <template slot-scope="{row}"> |
| | | <!--<i v-hasPermission="['user:view']" class="el-icon-view table-operation" style="color: #87d068;" @click="view(row)" />--> |
| | | <i v-hasPermission="['user:update']" class="el-icon-setting table-operation" style="color: #2db7f5;" @click="edit(row)" /> |
| | | <i v-hasPermission="['user:delete']" class="el-icon-delete table-operation" style="color: #f50;" @click="singleDelete(row)" /> |
| | | <el-link v-has-no-permission="['user:view','user:update','user:delete']" class="no-perm"> |
| | | {{ $t('tips.noPermission') }} |
| | | </el-link> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="total>0" :total="total" :page.sync="pagination.num" :limit.sync="pagination.size" @pagination="search" /> |
| | | <user-edit |
| | |
| | | import Pagination from '@/components/Pagination' |
| | | import UserEdit from './Edit' |
| | | import UserView from './View' |
| | | |
| | | import { getFileType } from '@/utils' |
| | | import { getToken } from '@/utils/auth' |
| | | import NProgress from 'nprogress' |
| | | export default { |
| | | name: 'UserManage', |
| | | components: { Pagination, UserEdit, UserView }, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | uploadAction: `${process.env.VUE_APP_BASE_API}system/user/import`, |
| | | headers: { |
| | | Authorization: `bearer ${getToken()}` |
| | | }, |
| | | dialog: { |
| | | isVisible: false, |
| | | title: '' |
| | |
| | | sort: {}, |
| | | selection: [], |
| | | pagination: { |
| | | size: 10, |
| | | size: 15, |
| | | num: 1 |
| | | } |
| | | } |
| | |
| | | this.fetch() |
| | | }, |
| | | methods: { |
| | | templateDownload() { |
| | | this.$download('system/user/template', {}, 'excel_import_user.xlsx') |
| | | }, |
| | | beforeUpload(file) { |
| | | const type = getFileType(file.name) |
| | | if (type !== 'xlsx') { |
| | | this.$message({ |
| | | message: this.$t('tips.onlySupportXlsx'), |
| | | type: 'error' |
| | | }) |
| | | return false |
| | | } else { |
| | | return true |
| | | } |
| | | }, |
| | | uploadError() { |
| | | this.$message({ |
| | | message: this.$t('tips.uploadFailed'), |
| | | type: 'error' |
| | | }) |
| | | NProgress.done() |
| | | }, |
| | | uploadSuccess(response) { |
| | | const data = response.data |
| | | this.data = data.data |
| | | this.error = data.error |
| | | this.time = data.time |
| | | NProgress.done() |
| | | this.fetch() |
| | | this.dialogVisible = true |
| | | }, |
| | | uploadProgress() { |
| | | NProgress.start() |
| | | }, |
| | | transSex(sex) { |
| | | switch (sex) { |
| | | case '0': |