|
|
|
@ -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> |
|
|
|
@ -122,7 +208,7 @@ import util from "@/libs/util"; |
|
|
|
|
import org from "./staffSide" |
|
|
|
|
import { mapState } from "vuex"; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
exportCode: "", |
|
|
|
|
headers: { |
|
|
|
@ -159,7 +245,7 @@ export default { |
|
|
|
|
{ required: true, message: "请输入工号", trigger: 'blur' }, |
|
|
|
|
{ |
|
|
|
|
pattern: /^[A-Za-z0-9]*$/, |
|
|
|
|
message: "职工工号必须为数字或英文", |
|
|
|
|
message: "教师工号必须为数字或英文", |
|
|
|
|
trigger: "blur" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
@ -167,7 +253,7 @@ export default { |
|
|
|
|
// { required: true, message: '请输入唯一标识', trigger: 'blur' }, |
|
|
|
|
], |
|
|
|
|
phone: [ |
|
|
|
|
{ pattern: /^1[3456789]\d{9}$/, message: "请输入正确的手机号", trigger: "blur"} |
|
|
|
|
{ pattern: /^1[3456789]\d{9}$/, message: "请输入正确的手机号", trigger: "blur" } |
|
|
|
|
], |
|
|
|
|
email: [ |
|
|
|
|
{ |
|
|
|
@ -206,25 +292,25 @@ export default { |
|
|
|
|
]) |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
keyword: function(val) { |
|
|
|
|
keyword: function (val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.initData(); |
|
|
|
|
}, 500); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
mounted () { |
|
|
|
|
this.originForm = JSON.parse(JSON.stringify(this.form)) |
|
|
|
|
this.getRoleData() |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getSingle(data) { |
|
|
|
|
getSingle (data) { |
|
|
|
|
this.staffArchitectureId = data.gradeId ? '' : data.staffArchitectureId |
|
|
|
|
this.gradeId = data.gradeId || '' |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
getCheck(data) { |
|
|
|
|
getCheck (data) { |
|
|
|
|
const marjorIds = [] |
|
|
|
|
const depIds = [] |
|
|
|
|
data.forEach(e => { |
|
|
|
@ -234,12 +320,12 @@ export default { |
|
|
|
|
this.gradeId = depIds.toString() |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
initData() { |
|
|
|
|
initData () { |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
getData() { // 获取员工列表数据 |
|
|
|
|
getData () { // 获取员工列表数据 |
|
|
|
|
let data = { |
|
|
|
|
keyWord: this.keyword, |
|
|
|
|
pageNum: this.page, |
|
|
|
@ -250,22 +336,22 @@ export default { |
|
|
|
|
this.$post(this.api.staffList, data).then(res => { |
|
|
|
|
this.listData = res.page.records; |
|
|
|
|
this.total = res.page.total; |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}).catch(res => { }); |
|
|
|
|
}, |
|
|
|
|
getRoleData() { // 获取角色数据 |
|
|
|
|
this.roleList =[]; |
|
|
|
|
getRoleData () { // 获取角色数据 |
|
|
|
|
this.roleList = []; |
|
|
|
|
this.$get(`${this.api.roleList}?page=1&size=100&name=&platformId=1&port=0`).then(res => { |
|
|
|
|
for(var i=0;i<res.rolePage.records.length;i++){ |
|
|
|
|
if (res.rolePage.records[i].roleName == '超级管理员'){ |
|
|
|
|
for (var i = 0; i < res.rolePage.records.length; i++) { |
|
|
|
|
if (res.rolePage.records[i].roleName == '超级管理员') { |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.roleList.push(res.rolePage.records[i]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// this.roleList = res.rolePage.records; |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}).catch(res => { }); |
|
|
|
|
}, |
|
|
|
|
closeTeacher() { // 关闭新增/编辑员工对话框 |
|
|
|
|
closeTeacher () { // 关闭新增/编辑员工对话框 |
|
|
|
|
this.form = { |
|
|
|
|
accountId: "", |
|
|
|
|
account: "", |
|
|
|
@ -280,13 +366,13 @@ export default { |
|
|
|
|
this.$refs.form.clearValidate(); |
|
|
|
|
this.teacherVisible = false; |
|
|
|
|
}, |
|
|
|
|
addTeacher() { // 新增员工 |
|
|
|
|
addTeacher () { // 新增员工 |
|
|
|
|
this.isDetail = false; |
|
|
|
|
this.isAdd = true; |
|
|
|
|
this.teacherVisible = true; |
|
|
|
|
this.orgList = this.$refs.org.orgList; |
|
|
|
|
}, |
|
|
|
|
getStaffDetail(accountId) { // 获取员工详情 |
|
|
|
|
getStaffDetail (accountId) { // 获取员工详情 |
|
|
|
|
this.$get(`${this.api.staffDetail}?accountId=${accountId}`).then(res => { |
|
|
|
|
let { data } = res; |
|
|
|
|
this.form = data; |
|
|
|
@ -296,9 +382,9 @@ export default { |
|
|
|
|
return i; |
|
|
|
|
}); |
|
|
|
|
console.log(22, this.form) |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}).catch(res => { }); |
|
|
|
|
}, |
|
|
|
|
resetPassword(row) { // 重置密码 |
|
|
|
|
resetPassword (row) { // 重置密码 |
|
|
|
|
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => { |
|
|
|
|
this.$get(`${this.api.resetPassword}?userId=${row.userId}&newPwd=1122aa`).then(res => { |
|
|
|
|
util.successMsg("重置成功"); |
|
|
|
@ -307,14 +393,14 @@ export default { |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
editTeacher(row) { // 处理编辑 |
|
|
|
|
editTeacher (row) { // 处理编辑 |
|
|
|
|
this.isDetail = false; |
|
|
|
|
this.isAdd = false; |
|
|
|
|
this.teacherVisible = true; |
|
|
|
|
this.orgList = this.$refs.org.orgList; |
|
|
|
|
this.getStaffDetail(row.accountId); |
|
|
|
|
}, |
|
|
|
|
showTeacher(row) { // 处理查看 |
|
|
|
|
showTeacher (row) { // 处理查看 |
|
|
|
|
this.isDetail = true; |
|
|
|
|
this.isAdd = false; |
|
|
|
|
this.teacherVisible = true; |
|
|
|
@ -322,12 +408,12 @@ export default { |
|
|
|
|
this.getStaffDetail(row.accountId); |
|
|
|
|
}, |
|
|
|
|
// 组合账号 |
|
|
|
|
renderAccount() { |
|
|
|
|
renderAccount () { |
|
|
|
|
const form = this.form |
|
|
|
|
// 平台id-端id-schoolId-workNumber组成账号 |
|
|
|
|
form.account = `${Setting.platformId}-0-${this.schoolId}-${form.workNumber}` |
|
|
|
|
}, |
|
|
|
|
workNumberChange() { // 切换工号 |
|
|
|
|
workNumberChange () { // 切换工号 |
|
|
|
|
const form = this.form |
|
|
|
|
const { workNumber, accountId } = form |
|
|
|
|
if (workNumber) { |
|
|
|
@ -336,14 +422,14 @@ export default { |
|
|
|
|
this.workNumberReapeat = false |
|
|
|
|
this.renderAccount() |
|
|
|
|
} |
|
|
|
|
}).catch( err => { |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.workNumberReapeat = true |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.renderAccount() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
phoneChange() { // 切换手机号 |
|
|
|
|
phoneChange () { // 切换手机号 |
|
|
|
|
let regex = /^1[3456789]\d{9}$/; |
|
|
|
|
if (regex.test(this.form.phone)) { |
|
|
|
|
let url = ""; |
|
|
|
@ -356,12 +442,12 @@ export default { |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
this.phoneRepeat = false; |
|
|
|
|
} |
|
|
|
|
}).catch( err => { |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.phoneRepeat = true; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
emailChange() { // 切换邮箱 |
|
|
|
|
emailChange () { // 切换邮箱 |
|
|
|
|
let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; |
|
|
|
|
if (regex.test(this.form.email)) { |
|
|
|
|
let url = ""; |
|
|
|
@ -374,12 +460,12 @@ export default { |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
this.emailRepeat = false; |
|
|
|
|
} |
|
|
|
|
}).catch( err => { |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.emailRepeat = true; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
roleChange(value) { // 处理切换角色 |
|
|
|
|
roleChange (value) { // 处理切换角色 |
|
|
|
|
console.log(this.form.roleValue) |
|
|
|
|
if (value.length) { |
|
|
|
|
let ids = this.form.roleAndDeptList.map(e => e.roleId); |
|
|
|
@ -400,18 +486,18 @@ export default { |
|
|
|
|
this.form.roleAndDeptList.splice(0); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
roleRemove(value) { // 处理移除角色 |
|
|
|
|
roleRemove (value) { // 处理移除角色 |
|
|
|
|
let list = []; |
|
|
|
|
for(var i=0;i<this.form.roleAndDeptList.length;i++){ |
|
|
|
|
if (this.form.roleAndDeptList[i].roleId == value){ |
|
|
|
|
for (var i = 0; i < this.form.roleAndDeptList.length; i++) { |
|
|
|
|
if (this.form.roleAndDeptList[i].roleId == value) { |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
list.push(this.form.roleAndDeptList[i]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.form.roleAndDeptList = list |
|
|
|
|
}, |
|
|
|
|
async saveSure(form) { |
|
|
|
|
async saveSure (form) { |
|
|
|
|
this.$refs[form].validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.submiting) return false |
|
|
|
@ -428,7 +514,7 @@ export default { |
|
|
|
|
phone: this.form.phone, |
|
|
|
|
email: this.form.email |
|
|
|
|
}; |
|
|
|
|
if (this.form.roleAndDeptList.length){ |
|
|
|
|
if (this.form.roleAndDeptList.length) { |
|
|
|
|
for (let i = 0; i < this.form.roleAndDeptList.length; i++) { |
|
|
|
|
if (this.form.roleAndDeptList[i].cascaderValue.length < 2) { |
|
|
|
|
util.warningMsg(`请选择${this.form.roleAndDeptList[i].roleName}所属部门`) |
|
|
|
@ -468,20 +554,20 @@ export default { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
delTeacher(row) { |
|
|
|
|
delTeacher (row) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => { |
|
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
this.getData(); |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}).catch(() => {}); |
|
|
|
|
}).catch(res => { }); |
|
|
|
|
}).catch(() => { }); |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange(val) { |
|
|
|
|
handleSelectionChange (val) { |
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
}, |
|
|
|
|
delAllSelection() { |
|
|
|
|
delAllSelection () { |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
// 批量删除 |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
@ -500,35 +586,35 @@ export default { |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
util.errorMsg("请先选择员工 !"); |
|
|
|
|
util.errorMsg("请先选择教师 !"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
batchImport() { |
|
|
|
|
batchImport () { |
|
|
|
|
this.importVisible = true; |
|
|
|
|
this.uploadList = []; |
|
|
|
|
this.uploadFaild = false; |
|
|
|
|
}, |
|
|
|
|
searchTeacher() { |
|
|
|
|
searchTeacher () { |
|
|
|
|
this.page = 1; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
handleCurrentChange (val) { |
|
|
|
|
this.page = val; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
downLoad() { |
|
|
|
|
downLoad () { |
|
|
|
|
location.href = this.api.staffTemplate; |
|
|
|
|
}, |
|
|
|
|
showFaild() { |
|
|
|
|
showFaild () { |
|
|
|
|
location.href = `${this.api.exportFailureStaff}?exportCode=${this.exportCode}`; |
|
|
|
|
}, |
|
|
|
|
// 上传文件 |
|
|
|
|
handleExceed(files, fileList) { |
|
|
|
|
handleExceed (files, fileList) { |
|
|
|
|
util.warningMsg( |
|
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
|
uploadSuccess (res, file, fileList) { |
|
|
|
|
console.log(res); |
|
|
|
|
this.uploadFaild = false; |
|
|
|
|
if (res.status === 200) { |
|
|
|
@ -541,21 +627,21 @@ export default { |
|
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
uploadError(err, file, fileList) { |
|
|
|
|
uploadError (err, file, fileList) { |
|
|
|
|
this.$message({ |
|
|
|
|
message: "上传出错,请重试!", |
|
|
|
|
type: "error", |
|
|
|
|
center: true |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
beforeRemove(file, fileList) { |
|
|
|
|
beforeRemove (file, fileList) { |
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
|
}, |
|
|
|
|
handleRemove(file, fileList) { |
|
|
|
|
handleRemove (file, fileList) { |
|
|
|
|
this.uploadList = fileList; |
|
|
|
|
this.uploadFaild = false; |
|
|
|
|
}, |
|
|
|
|
uploadSure() { |
|
|
|
|
uploadSure () { |
|
|
|
|
this.importVisible = false; |
|
|
|
|
this.page = 1; |
|
|
|
|
this.keyword = ""; |
|
|
|
@ -579,7 +665,7 @@ export default { |
|
|
|
|
padding: 24px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.el-input__inner{ |
|
|
|
|
.el-input__inner { |
|
|
|
|
height: 32px; |
|
|
|
|
} |
|
|
|
|
</style> |