|
|
|
@ -1,7 +1,9 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="wrap"> |
|
|
|
|
<div class="side"> |
|
|
|
|
<org ref="org" @getSingle="getSingle" @getCheck="getCheck"></org> |
|
|
|
|
<org ref="org" |
|
|
|
|
@getSingle="getSingle" |
|
|
|
|
@getCheck="getCheck"></org> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="right"> |
|
|
|
@ -9,91 +11,171 @@ |
|
|
|
|
<div class="tool"> |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li> |
|
|
|
|
<el-input placeholder="请输入员工姓名/工号" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input> |
|
|
|
|
<el-input placeholder="请输入教师姓名/工号" |
|
|
|
|
prefix-icon="el-icon-search" |
|
|
|
|
v-model.trim="keyword" |
|
|
|
|
clearable></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
|
<el-button v-auth="'员工管理:新增员工'" type="info" round @click="addTeacher">新增员工</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:批量导入'" type="primary" round @click="batchImport">批量导入</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:批量删除'" type="primary" round @click="delAllSelection">批量删除</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:新增员工'" |
|
|
|
|
type="info" |
|
|
|
|
round |
|
|
|
|
@click="addTeacher">新增教师</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:批量导入'" |
|
|
|
|
type="primary" |
|
|
|
|
round |
|
|
|
|
@click="batchImport">批量导入</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:批量删除'" |
|
|
|
|
type="primary" |
|
|
|
|
round |
|
|
|
|
@click="delAllSelection">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> |
|
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|
|
|
|
<el-table-column type="index" label="序号" width="55" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="userName" label="职工姓名" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="workNumber" label="职工工号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="dept" label="部门" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="roleName" label="账号角色" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="logInNumber" label="登录次数" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="操作" width="200" align="center"> |
|
|
|
|
<el-table :data="listData" |
|
|
|
|
class="table" |
|
|
|
|
ref="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
width="55" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
label="序号" |
|
|
|
|
width="55" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="userName" |
|
|
|
|
label="教师姓名" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="workNumber" |
|
|
|
|
label="教师工号" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="dept" |
|
|
|
|
label="部门" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="roleName" |
|
|
|
|
label="账号角色" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="logInNumber" |
|
|
|
|
label="登录次数" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="lastLoginTime" |
|
|
|
|
label="上次登录时间" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
width="200" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button v-auth="'员工管理:员工查看'" type="text" @click="showTeacher(scope.row)">查看</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:员工编辑'" type="text" @click="editTeacher(scope.row)">编辑</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:重置密码'" type="text" @click="resetPassword(scope.row)">重置密码</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:员工删除'" type="text" @click="delTeacher(scope.row)">删除</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:员工查看'" |
|
|
|
|
type="text" |
|
|
|
|
@click="showTeacher(scope.row)">查看</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:员工编辑'" |
|
|
|
|
type="text" |
|
|
|
|
@click="editTeacher(scope.row)">编辑</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:重置密码'" |
|
|
|
|
type="text" |
|
|
|
|
@click="resetPassword(scope.row)">重置密码</el-button> |
|
|
|
|
<el-button v-auth="'员工管理:员工删除'" |
|
|
|
|
type="text" |
|
|
|
|
@click="delTeacher(scope.row)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background layout="total, prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination> |
|
|
|
|
<el-pagination background |
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
:current-page="page" |
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
:total="total"></el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog :title="isDetail ? '查看员工' : (isAdd ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible" |
|
|
|
|
width="30%" @close="closeTeacher" class="dialog" :close-on-click-modal="false"> |
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="150px" :disabled="isDetail" style='margin-right: 80px;'> |
|
|
|
|
<el-form-item prop="workNumber" label="工号"> |
|
|
|
|
<el-input v-model.trim="form.workNumber" placeholder="请输入职工工号" @blur="workNumberChange"></el-input> |
|
|
|
|
<el-dialog :title="isDetail ? '查看教师' : (isAdd ? '新增教师' : '编辑教师')" |
|
|
|
|
:visible.sync="teacherVisible" |
|
|
|
|
width="30%" |
|
|
|
|
@close="closeTeacher" |
|
|
|
|
class="dialog" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<el-form ref="form" |
|
|
|
|
:model="form" |
|
|
|
|
:rules="rules" |
|
|
|
|
label-width="150px" |
|
|
|
|
:disabled="isDetail" |
|
|
|
|
style='margin-right: 80px;'> |
|
|
|
|
<el-form-item prop="workNumber" |
|
|
|
|
label="工号"> |
|
|
|
|
<el-input v-model.trim="form.workNumber" |
|
|
|
|
placeholder="请输入教师工号" |
|
|
|
|
@blur="workNumberChange"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="userName" label="用户姓名"> |
|
|
|
|
<el-input v-model.trim="form.userName" placeholder="请输入员工姓名"></el-input> |
|
|
|
|
<el-form-item prop="userName" |
|
|
|
|
label="用户姓名"> |
|
|
|
|
<el-input v-model.trim="form.userName" |
|
|
|
|
placeholder="请输入教师姓名"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="roleValue" label="账号角色"> |
|
|
|
|
<el-select v-model="form.roleValue" @change="roleChange" @remove-tag="roleRemove" multiple style="width: 100%;height: 32px"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in roleList" |
|
|
|
|
<el-form-item prop="roleValue" |
|
|
|
|
label="账号角色"> |
|
|
|
|
<el-select v-model="form.roleValue" |
|
|
|
|
@change="roleChange" |
|
|
|
|
@remove-tag="roleRemove" |
|
|
|
|
multiple |
|
|
|
|
style="width: 100%;height: 32px"> |
|
|
|
|
<el-option v-for="item in roleList" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.roleName" |
|
|
|
|
:value="item.id"> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="uniqueIdentification" label="唯一标识"> |
|
|
|
|
<el-input disabled v-model.trim="form.uniqueIdentification" placeholder="请输入职工工号获取唯一标识"></el-input> |
|
|
|
|
<el-form-item prop="uniqueIdentification" |
|
|
|
|
label="唯一标识"> |
|
|
|
|
<el-input disabled |
|
|
|
|
v-model.trim="form.uniqueIdentification" |
|
|
|
|
placeholder="请输入教师工号获取唯一标识"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item v-for="item in form.roleAndDeptList" :label="`${item.roleName}所属部门`" :rules="{ |
|
|
|
|
<el-form-item v-for="item in form.roleAndDeptList" |
|
|
|
|
:label="`${item.roleName}所属部门`" |
|
|
|
|
:rules="{ |
|
|
|
|
required: true, message: '请选择', trigger: 'change' |
|
|
|
|
}"> |
|
|
|
|
<el-cascader |
|
|
|
|
v-model="item.cascaderValue" |
|
|
|
|
<el-cascader v-model="item.cascaderValue" |
|
|
|
|
:options="orgList" |
|
|
|
|
:props="casProps" |
|
|
|
|
style="width: 100%" |
|
|
|
|
></el-cascader> |
|
|
|
|
style="width: 100%"></el-cascader> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="phone" label="手机号"> |
|
|
|
|
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input> |
|
|
|
|
<el-form-item prop="phone" |
|
|
|
|
label="手机号"> |
|
|
|
|
<el-input v-model.trim="form.phone" |
|
|
|
|
placeholder="请输入手机号" |
|
|
|
|
maxlength="11"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="email" label="邮箱"> |
|
|
|
|
<el-input v-model.trim="form.email" placeholder="请输入邮箱"></el-input> |
|
|
|
|
<el-form-item prop="email" |
|
|
|
|
label="邮箱"> |
|
|
|
|
<el-input v-model.trim="form.email" |
|
|
|
|
placeholder="请输入邮箱"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer" v-if="!isDetail"> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer" |
|
|
|
|
v-if="!isDetail"> |
|
|
|
|
<el-button @click="closeTeacher">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="saveSure('form')">确 定</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="saveSure('form')">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"> |
|
|
|
|
<el-dialog title="批量导入" |
|
|
|
|
:visible.sync="importVisible" |
|
|
|
|
width="24%" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<div style="text-align: center"> |
|
|
|
|
<div style="margin-bottom: 10px;"> |
|
|
|
|
<el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-upload |
|
|
|
|
name="file" |
|
|
|
|
<el-upload name="file" |
|
|
|
|
accept=".xls,.xlsx" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" |
|
|
|
@ -103,15 +185,19 @@ |
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
:action="this.api.importStaff" |
|
|
|
|
:file-list="uploadList" |
|
|
|
|
:headers="headers" |
|
|
|
|
> |
|
|
|
|
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
|
:headers="headers"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
|
</el-upload> |
|
|
|
|
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败,查看失败原因</el-link> |
|
|
|
|
<el-link v-if="uploadFaild" |
|
|
|
|
type="primary" |
|
|
|
|
@click="showFaild">部分数据导入失败,查看失败原因</el-link> |
|
|
|
|
</div> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button @click="importVisible = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="uploadSure">确 定</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="uploadSure">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
@ -159,7 +245,7 @@ export default { |
|
|
|
|
{ required: true, message: "请输入工号", trigger: 'blur' }, |
|
|
|
|
{ |
|
|
|
|
pattern: /^[A-Za-z0-9]*$/, |
|
|
|
|
message: "职工工号必须为数字或英文", |
|
|
|
|
message: "教师工号必须为数字或英文", |
|
|
|
|
trigger: "blur" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
@ -500,7 +586,7 @@ export default { |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
util.errorMsg("请先选择员工 !"); |
|
|
|
|
util.errorMsg("请先选择教师 !"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
batchImport () { |
|
|
|
|