|
|
@ -1,7 +1,9 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="wrap"> |
|
|
|
<div class="wrap"> |
|
|
|
<div class="side"> |
|
|
|
<div class="side"> |
|
|
|
<org ref="org" @getSingle="getSingle" @getCheck="getCheck"></org> |
|
|
|
<org ref="org" |
|
|
|
|
|
|
|
@getSingle="getSingle" |
|
|
|
|
|
|
|
@getCheck="getCheck"></org> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="right"> |
|
|
|
<div class="right"> |
|
|
@ -9,91 +11,171 @@ |
|
|
|
<div class="tool"> |
|
|
|
<div class="tool"> |
|
|
|
<ul class="filter"> |
|
|
|
<ul class="filter"> |
|
|
|
<li> |
|
|
|
<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> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-button v-auth="'员工管理:新增员工'" type="info" round @click="addTeacher">新增员工</el-button> |
|
|
|
<el-button v-auth="'员工管理:新增员工'" |
|
|
|
<el-button v-auth="'员工管理:批量导入'" type="primary" round @click="batchImport">批量导入</el-button> |
|
|
|
type="info" |
|
|
|
<el-button v-auth="'员工管理:批量删除'" type="primary" round @click="delAllSelection">批量删除</el-button> |
|
|
|
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> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> |
|
|
|
<el-table :data="listData" |
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|
|
|
class="table" |
|
|
|
<el-table-column type="index" label="序号" width="55" align="center"></el-table-column> |
|
|
|
ref="table" |
|
|
|
<el-table-column prop="userName" label="职工姓名" align="center"></el-table-column> |
|
|
|
stripe |
|
|
|
<el-table-column prop="workNumber" label="职工工号" align="center"></el-table-column> |
|
|
|
header-align="center" |
|
|
|
<el-table-column prop="dept" label="部门" align="center"></el-table-column> |
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
<el-table-column prop="roleName" label="账号角色" align="center"></el-table-column> |
|
|
|
<el-table-column type="selection" |
|
|
|
<el-table-column prop="logInNumber" label="登录次数" align="center"></el-table-column> |
|
|
|
width="55" |
|
|
|
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center"></el-table-column> |
|
|
|
align="center"></el-table-column> |
|
|
|
<el-table-column label="操作" width="200" align="center"> |
|
|
|
<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"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-auth="'员工管理:员工查看'" type="text" @click="showTeacher(scope.row)">查看</el-button> |
|
|
|
<el-button v-auth="'员工管理:员工查看'" |
|
|
|
<el-button v-auth="'员工管理:员工编辑'" type="text" @click="editTeacher(scope.row)">编辑</el-button> |
|
|
|
type="text" |
|
|
|
<el-button v-auth="'员工管理:重置密码'" type="text" @click="resetPassword(scope.row)">重置密码</el-button> |
|
|
|
@click="showTeacher(scope.row)">查看</el-button> |
|
|
|
<el-button v-auth="'员工管理:员工删除'" type="text" @click="delTeacher(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> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
<div class="pagination"> |
|
|
|
<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> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :title="isDetail ? '查看员工' : (isAdd ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible" |
|
|
|
<el-dialog :title="isDetail ? '查看教师' : (isAdd ? '新增教师' : '编辑教师')" |
|
|
|
width="30%" @close="closeTeacher" class="dialog" :close-on-click-modal="false"> |
|
|
|
:visible.sync="teacherVisible" |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="150px" :disabled="isDetail" style='margin-right: 80px;'> |
|
|
|
width="30%" |
|
|
|
<el-form-item prop="workNumber" label="工号"> |
|
|
|
@close="closeTeacher" |
|
|
|
<el-input v-model.trim="form.workNumber" placeholder="请输入职工工号" @blur="workNumberChange"></el-input> |
|
|
|
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> |
|
|
|
<el-form-item prop="userName" label="用户姓名"> |
|
|
|
<el-form-item prop="userName" |
|
|
|
<el-input v-model.trim="form.userName" placeholder="请输入员工姓名"></el-input> |
|
|
|
label="用户姓名"> |
|
|
|
|
|
|
|
<el-input v-model.trim="form.userName" |
|
|
|
|
|
|
|
placeholder="请输入教师姓名"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="roleValue" label="账号角色"> |
|
|
|
<el-form-item prop="roleValue" |
|
|
|
<el-select v-model="form.roleValue" @change="roleChange" @remove-tag="roleRemove" multiple style="width: 100%;height: 32px"> |
|
|
|
label="账号角色"> |
|
|
|
<el-option |
|
|
|
<el-select v-model="form.roleValue" |
|
|
|
v-for="item in roleList" |
|
|
|
@change="roleChange" |
|
|
|
|
|
|
|
@remove-tag="roleRemove" |
|
|
|
|
|
|
|
multiple |
|
|
|
|
|
|
|
style="width: 100%;height: 32px"> |
|
|
|
|
|
|
|
<el-option v-for="item in roleList" |
|
|
|
:key="item.id" |
|
|
|
:key="item.id" |
|
|
|
:label="item.roleName" |
|
|
|
:label="item.roleName" |
|
|
|
:value="item.id"> |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="uniqueIdentification" label="唯一标识"> |
|
|
|
<el-form-item prop="uniqueIdentification" |
|
|
|
<el-input disabled v-model.trim="form.uniqueIdentification" placeholder="请输入职工工号获取唯一标识"></el-input> |
|
|
|
label="唯一标识"> |
|
|
|
|
|
|
|
<el-input disabled |
|
|
|
|
|
|
|
v-model.trim="form.uniqueIdentification" |
|
|
|
|
|
|
|
placeholder="请输入教师工号获取唯一标识"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</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' |
|
|
|
required: true, message: '请选择', trigger: 'change' |
|
|
|
}"> |
|
|
|
}"> |
|
|
|
<el-cascader |
|
|
|
<el-cascader v-model="item.cascaderValue" |
|
|
|
v-model="item.cascaderValue" |
|
|
|
|
|
|
|
:options="orgList" |
|
|
|
:options="orgList" |
|
|
|
:props="casProps" |
|
|
|
:props="casProps" |
|
|
|
style="width: 100%" |
|
|
|
style="width: 100%"></el-cascader> |
|
|
|
></el-cascader> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="phone" label="手机号"> |
|
|
|
<el-form-item prop="phone" |
|
|
|
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input> |
|
|
|
label="手机号"> |
|
|
|
|
|
|
|
<el-input v-model.trim="form.phone" |
|
|
|
|
|
|
|
placeholder="请输入手机号" |
|
|
|
|
|
|
|
maxlength="11"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="email" label="邮箱"> |
|
|
|
<el-form-item prop="email" |
|
|
|
<el-input v-model.trim="form.email" placeholder="请输入邮箱"></el-input> |
|
|
|
label="邮箱"> |
|
|
|
|
|
|
|
<el-input v-model.trim="form.email" |
|
|
|
|
|
|
|
placeholder="请输入邮箱"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</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 @click="closeTeacher">取 消</el-button> |
|
|
|
<el-button type="primary" @click="saveSure('form')">确 定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="saveSure('form')">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</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="text-align: center"> |
|
|
|
<div style="margin-bottom: 10px;"> |
|
|
|
<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> |
|
|
|
</div> |
|
|
|
<el-upload |
|
|
|
<el-upload name="file" |
|
|
|
name="file" |
|
|
|
|
|
|
|
accept=".xls,.xlsx" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-error="uploadError" |
|
|
@ -103,15 +185,19 @@ |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:action="this.api.importStaff" |
|
|
|
:action="this.api.importStaff" |
|
|
|
:file-list="uploadList" |
|
|
|
:file-list="uploadList" |
|
|
|
:headers="headers" |
|
|
|
:headers="headers"> |
|
|
|
> |
|
|
|
<el-button type="primary" |
|
|
|
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
</el-upload> |
|
|
|
</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> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="importVisible = false">取 消</el-button> |
|
|
|
<el-button @click="importVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="uploadSure">确 定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="uploadSure">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -122,7 +208,7 @@ import util from "@/libs/util"; |
|
|
|
import org from "./staffSide" |
|
|
|
import org from "./staffSide" |
|
|
|
import { mapState } from "vuex"; |
|
|
|
import { mapState } from "vuex"; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
exportCode: "", |
|
|
|
exportCode: "", |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
@ -159,7 +245,7 @@ export default { |
|
|
|
{ required: true, message: "请输入工号", trigger: 'blur' }, |
|
|
|
{ required: true, message: "请输入工号", trigger: 'blur' }, |
|
|
|
{ |
|
|
|
{ |
|
|
|
pattern: /^[A-Za-z0-9]*$/, |
|
|
|
pattern: /^[A-Za-z0-9]*$/, |
|
|
|
message: "职工工号必须为数字或英文", |
|
|
|
message: "教师工号必须为数字或英文", |
|
|
|
trigger: "blur" |
|
|
|
trigger: "blur" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
@ -167,7 +253,7 @@ export default { |
|
|
|
// { required: true, message: '请输入唯一标识', trigger: 'blur' }, |
|
|
|
// { required: true, message: '请输入唯一标识', trigger: 'blur' }, |
|
|
|
], |
|
|
|
], |
|
|
|
phone: [ |
|
|
|
phone: [ |
|
|
|
{ pattern: /^1[3456789]\d{9}$/, message: "请输入正确的手机号", trigger: "blur"} |
|
|
|
{ pattern: /^1[3456789]\d{9}$/, message: "请输入正确的手机号", trigger: "blur" } |
|
|
|
], |
|
|
|
], |
|
|
|
email: [ |
|
|
|
email: [ |
|
|
|
{ |
|
|
|
{ |
|
|
@ -206,25 +292,25 @@ export default { |
|
|
|
]) |
|
|
|
]) |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
keyword: function(val) { |
|
|
|
keyword: function (val) { |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.initData(); |
|
|
|
this.initData(); |
|
|
|
}, 500); |
|
|
|
}, 500); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
this.originForm = JSON.parse(JSON.stringify(this.form)) |
|
|
|
this.originForm = JSON.parse(JSON.stringify(this.form)) |
|
|
|
this.getRoleData() |
|
|
|
this.getRoleData() |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getSingle(data) { |
|
|
|
getSingle (data) { |
|
|
|
this.staffArchitectureId = data.gradeId ? '' : data.staffArchitectureId |
|
|
|
this.staffArchitectureId = data.gradeId ? '' : data.staffArchitectureId |
|
|
|
this.gradeId = data.gradeId || '' |
|
|
|
this.gradeId = data.gradeId || '' |
|
|
|
this.initData() |
|
|
|
this.initData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
getCheck(data) { |
|
|
|
getCheck (data) { |
|
|
|
const marjorIds = [] |
|
|
|
const marjorIds = [] |
|
|
|
const depIds = [] |
|
|
|
const depIds = [] |
|
|
|
data.forEach(e => { |
|
|
|
data.forEach(e => { |
|
|
@ -234,12 +320,12 @@ export default { |
|
|
|
this.gradeId = depIds.toString() |
|
|
|
this.gradeId = depIds.toString() |
|
|
|
this.initData() |
|
|
|
this.initData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
initData() { |
|
|
|
initData () { |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
getData() { // 获取员工列表数据 |
|
|
|
getData () { // 获取员工列表数据 |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
keyWord: this.keyword, |
|
|
|
keyWord: this.keyword, |
|
|
|
pageNum: this.page, |
|
|
|
pageNum: this.page, |
|
|
@ -250,22 +336,22 @@ export default { |
|
|
|
this.$post(this.api.staffList, data).then(res => { |
|
|
|
this.$post(this.api.staffList, data).then(res => { |
|
|
|
this.listData = res.page.records; |
|
|
|
this.listData = res.page.records; |
|
|
|
this.total = res.page.total; |
|
|
|
this.total = res.page.total; |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => { }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
getRoleData() { // 获取角色数据 |
|
|
|
getRoleData () { // 获取角色数据 |
|
|
|
this.roleList =[]; |
|
|
|
this.roleList = []; |
|
|
|
this.$get(`${this.api.roleList}?page=1&size=100&name=&platformId=1&port=0`).then(res => { |
|
|
|
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++){ |
|
|
|
for (var i = 0; i < res.rolePage.records.length; i++) { |
|
|
|
if (res.rolePage.records[i].roleName == '超级管理员'){ |
|
|
|
if (res.rolePage.records[i].roleName == '超级管理员') { |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.roleList.push(res.rolePage.records[i]) |
|
|
|
this.roleList.push(res.rolePage.records[i]) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// this.roleList = res.rolePage.records; |
|
|
|
// this.roleList = res.rolePage.records; |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => { }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
closeTeacher() { // 关闭新增/编辑员工对话框 |
|
|
|
closeTeacher () { // 关闭新增/编辑员工对话框 |
|
|
|
this.form = { |
|
|
|
this.form = { |
|
|
|
accountId: "", |
|
|
|
accountId: "", |
|
|
|
account: "", |
|
|
|
account: "", |
|
|
@ -280,13 +366,13 @@ export default { |
|
|
|
this.$refs.form.clearValidate(); |
|
|
|
this.$refs.form.clearValidate(); |
|
|
|
this.teacherVisible = false; |
|
|
|
this.teacherVisible = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
addTeacher() { // 新增员工 |
|
|
|
addTeacher () { // 新增员工 |
|
|
|
this.isDetail = false; |
|
|
|
this.isDetail = false; |
|
|
|
this.isAdd = true; |
|
|
|
this.isAdd = true; |
|
|
|
this.teacherVisible = true; |
|
|
|
this.teacherVisible = true; |
|
|
|
this.orgList = this.$refs.org.orgList; |
|
|
|
this.orgList = this.$refs.org.orgList; |
|
|
|
}, |
|
|
|
}, |
|
|
|
getStaffDetail(accountId) { // 获取员工详情 |
|
|
|
getStaffDetail (accountId) { // 获取员工详情 |
|
|
|
this.$get(`${this.api.staffDetail}?accountId=${accountId}`).then(res => { |
|
|
|
this.$get(`${this.api.staffDetail}?accountId=${accountId}`).then(res => { |
|
|
|
let { data } = res; |
|
|
|
let { data } = res; |
|
|
|
this.form = data; |
|
|
|
this.form = data; |
|
|
@ -296,9 +382,9 @@ export default { |
|
|
|
return i; |
|
|
|
return i; |
|
|
|
}); |
|
|
|
}); |
|
|
|
console.log(22, this.form) |
|
|
|
console.log(22, this.form) |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => { }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
resetPassword(row) { // 重置密码 |
|
|
|
resetPassword (row) { // 重置密码 |
|
|
|
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => { |
|
|
|
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => { |
|
|
|
this.$get(`${this.api.resetPassword}?userId=${row.userId}&newPwd=1122aa`).then(res => { |
|
|
|
this.$get(`${this.api.resetPassword}?userId=${row.userId}&newPwd=1122aa`).then(res => { |
|
|
|
util.successMsg("重置成功"); |
|
|
|
util.successMsg("重置成功"); |
|
|
@ -307,14 +393,14 @@ export default { |
|
|
|
}).catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
editTeacher(row) { // 处理编辑 |
|
|
|
editTeacher (row) { // 处理编辑 |
|
|
|
this.isDetail = false; |
|
|
|
this.isDetail = false; |
|
|
|
this.isAdd = false; |
|
|
|
this.isAdd = false; |
|
|
|
this.teacherVisible = true; |
|
|
|
this.teacherVisible = true; |
|
|
|
this.orgList = this.$refs.org.orgList; |
|
|
|
this.orgList = this.$refs.org.orgList; |
|
|
|
this.getStaffDetail(row.accountId); |
|
|
|
this.getStaffDetail(row.accountId); |
|
|
|
}, |
|
|
|
}, |
|
|
|
showTeacher(row) { // 处理查看 |
|
|
|
showTeacher (row) { // 处理查看 |
|
|
|
this.isDetail = true; |
|
|
|
this.isDetail = true; |
|
|
|
this.isAdd = false; |
|
|
|
this.isAdd = false; |
|
|
|
this.teacherVisible = true; |
|
|
|
this.teacherVisible = true; |
|
|
@ -322,12 +408,12 @@ export default { |
|
|
|
this.getStaffDetail(row.accountId); |
|
|
|
this.getStaffDetail(row.accountId); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 组合账号 |
|
|
|
// 组合账号 |
|
|
|
renderAccount() { |
|
|
|
renderAccount () { |
|
|
|
const form = this.form |
|
|
|
const form = this.form |
|
|
|
// 平台id-端id-schoolId-workNumber组成账号 |
|
|
|
// 平台id-端id-schoolId-workNumber组成账号 |
|
|
|
form.account = `${Setting.platformId}-0-${this.schoolId}-${form.workNumber}` |
|
|
|
form.account = `${Setting.platformId}-0-${this.schoolId}-${form.workNumber}` |
|
|
|
}, |
|
|
|
}, |
|
|
|
workNumberChange() { // 切换工号 |
|
|
|
workNumberChange () { // 切换工号 |
|
|
|
const form = this.form |
|
|
|
const form = this.form |
|
|
|
const { workNumber, accountId } = form |
|
|
|
const { workNumber, accountId } = form |
|
|
|
if (workNumber) { |
|
|
|
if (workNumber) { |
|
|
@ -336,14 +422,14 @@ export default { |
|
|
|
this.workNumberReapeat = false |
|
|
|
this.workNumberReapeat = false |
|
|
|
this.renderAccount() |
|
|
|
this.renderAccount() |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch( err => { |
|
|
|
}).catch(err => { |
|
|
|
this.workNumberReapeat = true |
|
|
|
this.workNumberReapeat = true |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.renderAccount() |
|
|
|
this.renderAccount() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
phoneChange() { // 切换手机号 |
|
|
|
phoneChange () { // 切换手机号 |
|
|
|
let regex = /^1[3456789]\d{9}$/; |
|
|
|
let regex = /^1[3456789]\d{9}$/; |
|
|
|
if (regex.test(this.form.phone)) { |
|
|
|
if (regex.test(this.form.phone)) { |
|
|
|
let url = ""; |
|
|
|
let url = ""; |
|
|
@ -356,12 +442,12 @@ export default { |
|
|
|
if (res.status === 200) { |
|
|
|
if (res.status === 200) { |
|
|
|
this.phoneRepeat = false; |
|
|
|
this.phoneRepeat = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch( err => { |
|
|
|
}).catch(err => { |
|
|
|
this.phoneRepeat = true; |
|
|
|
this.phoneRepeat = true; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
emailChange() { // 切换邮箱 |
|
|
|
emailChange () { // 切换邮箱 |
|
|
|
let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; |
|
|
|
let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; |
|
|
|
if (regex.test(this.form.email)) { |
|
|
|
if (regex.test(this.form.email)) { |
|
|
|
let url = ""; |
|
|
|
let url = ""; |
|
|
@ -374,12 +460,12 @@ export default { |
|
|
|
if (res.status === 200) { |
|
|
|
if (res.status === 200) { |
|
|
|
this.emailRepeat = false; |
|
|
|
this.emailRepeat = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch( err => { |
|
|
|
}).catch(err => { |
|
|
|
this.emailRepeat = true; |
|
|
|
this.emailRepeat = true; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
roleChange(value) { // 处理切换角色 |
|
|
|
roleChange (value) { // 处理切换角色 |
|
|
|
console.log(this.form.roleValue) |
|
|
|
console.log(this.form.roleValue) |
|
|
|
if (value.length) { |
|
|
|
if (value.length) { |
|
|
|
let ids = this.form.roleAndDeptList.map(e => e.roleId); |
|
|
|
let ids = this.form.roleAndDeptList.map(e => e.roleId); |
|
|
@ -400,18 +486,18 @@ export default { |
|
|
|
this.form.roleAndDeptList.splice(0); |
|
|
|
this.form.roleAndDeptList.splice(0); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
roleRemove(value) { // 处理移除角色 |
|
|
|
roleRemove (value) { // 处理移除角色 |
|
|
|
let list = []; |
|
|
|
let list = []; |
|
|
|
for(var i=0;i<this.form.roleAndDeptList.length;i++){ |
|
|
|
for (var i = 0; i < this.form.roleAndDeptList.length; i++) { |
|
|
|
if (this.form.roleAndDeptList[i].roleId == value){ |
|
|
|
if (this.form.roleAndDeptList[i].roleId == value) { |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
list.push(this.form.roleAndDeptList[i]) |
|
|
|
list.push(this.form.roleAndDeptList[i]) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.form.roleAndDeptList = list |
|
|
|
this.form.roleAndDeptList = list |
|
|
|
}, |
|
|
|
}, |
|
|
|
async saveSure(form) { |
|
|
|
async saveSure (form) { |
|
|
|
this.$refs[form].validate((valid) => { |
|
|
|
this.$refs[form].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
if (this.submiting) return false |
|
|
|
if (this.submiting) return false |
|
|
@ -428,7 +514,7 @@ export default { |
|
|
|
phone: this.form.phone, |
|
|
|
phone: this.form.phone, |
|
|
|
email: this.form.email |
|
|
|
email: this.form.email |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (this.form.roleAndDeptList.length){ |
|
|
|
if (this.form.roleAndDeptList.length) { |
|
|
|
for (let i = 0; i < this.form.roleAndDeptList.length; i++) { |
|
|
|
for (let i = 0; i < this.form.roleAndDeptList.length; i++) { |
|
|
|
if (this.form.roleAndDeptList[i].cascaderValue.length < 2) { |
|
|
|
if (this.form.roleAndDeptList[i].cascaderValue.length < 2) { |
|
|
|
util.warningMsg(`请选择${this.form.roleAndDeptList[i].roleName}所属部门`) |
|
|
|
util.warningMsg(`请选择${this.form.roleAndDeptList[i].roleName}所属部门`) |
|
|
@ -468,20 +554,20 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
delTeacher(row) { |
|
|
|
delTeacher (row) { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => { |
|
|
|
this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => { |
|
|
|
util.successMsg("删除成功"); |
|
|
|
util.successMsg("删除成功"); |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => { }); |
|
|
|
}).catch(() => {}); |
|
|
|
}).catch(() => { }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSelectionChange(val) { |
|
|
|
handleSelectionChange (val) { |
|
|
|
this.multipleSelection = val; |
|
|
|
this.multipleSelection = val; |
|
|
|
}, |
|
|
|
}, |
|
|
|
delAllSelection() { |
|
|
|
delAllSelection () { |
|
|
|
if (this.multipleSelection.length) { |
|
|
|
if (this.multipleSelection.length) { |
|
|
|
// 批量删除 |
|
|
|
// 批量删除 |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
@ -500,35 +586,35 @@ export default { |
|
|
|
}).catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
util.errorMsg("请先选择员工 !"); |
|
|
|
util.errorMsg("请先选择教师 !"); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
batchImport() { |
|
|
|
batchImport () { |
|
|
|
this.importVisible = true; |
|
|
|
this.importVisible = true; |
|
|
|
this.uploadList = []; |
|
|
|
this.uploadList = []; |
|
|
|
this.uploadFaild = false; |
|
|
|
this.uploadFaild = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
searchTeacher() { |
|
|
|
searchTeacher () { |
|
|
|
this.page = 1; |
|
|
|
this.page = 1; |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCurrentChange(val) { |
|
|
|
handleCurrentChange (val) { |
|
|
|
this.page = val; |
|
|
|
this.page = val; |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
downLoad() { |
|
|
|
downLoad () { |
|
|
|
location.href = this.api.staffTemplate; |
|
|
|
location.href = this.api.staffTemplate; |
|
|
|
}, |
|
|
|
}, |
|
|
|
showFaild() { |
|
|
|
showFaild () { |
|
|
|
location.href = `${this.api.exportFailureStaff}?exportCode=${this.exportCode}`; |
|
|
|
location.href = `${this.api.exportFailureStaff}?exportCode=${this.exportCode}`; |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 上传文件 |
|
|
|
// 上传文件 |
|
|
|
handleExceed(files, fileList) { |
|
|
|
handleExceed (files, fileList) { |
|
|
|
util.warningMsg( |
|
|
|
util.warningMsg( |
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
uploadSuccess (res, file, fileList) { |
|
|
|
console.log(res); |
|
|
|
console.log(res); |
|
|
|
this.uploadFaild = false; |
|
|
|
this.uploadFaild = false; |
|
|
|
if (res.status === 200) { |
|
|
|
if (res.status === 200) { |
|
|
@ -541,21 +627,21 @@ export default { |
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); |
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadError(err, file, fileList) { |
|
|
|
uploadError (err, file, fileList) { |
|
|
|
this.$message({ |
|
|
|
this.$message({ |
|
|
|
message: "上传出错,请重试!", |
|
|
|
message: "上传出错,请重试!", |
|
|
|
type: "error", |
|
|
|
type: "error", |
|
|
|
center: true |
|
|
|
center: true |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
beforeRemove (file, fileList) { |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleRemove(file, fileList) { |
|
|
|
handleRemove (file, fileList) { |
|
|
|
this.uploadList = fileList; |
|
|
|
this.uploadList = fileList; |
|
|
|
this.uploadFaild = false; |
|
|
|
this.uploadFaild = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSure() { |
|
|
|
uploadSure () { |
|
|
|
this.importVisible = false; |
|
|
|
this.importVisible = false; |
|
|
|
this.page = 1; |
|
|
|
this.page = 1; |
|
|
|
this.keyword = ""; |
|
|
|
this.keyword = ""; |
|
|
@ -579,7 +665,7 @@ export default { |
|
|
|
padding: 24px; |
|
|
|
padding: 24px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.el-input__inner{ |
|
|
|
.el-input__inner { |
|
|
|
height: 32px; |
|
|
|
height: 32px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |