|
|
|
@ -2,11 +2,34 @@ |
|
|
|
|
<div> |
|
|
|
|
<div class="page"> |
|
|
|
|
<div class="page-content"> |
|
|
|
|
<div class="tool"> |
|
|
|
|
<div class="tool" style="margin-bottom: 0;"> |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li> |
|
|
|
|
<label>创建时间:</label> |
|
|
|
|
<el-select v-model="month" placeholder="请选择创建时间" size="small" clearable class="w-150"> |
|
|
|
|
<el-option v-for="(item,index) in monthList" :key="index" :label="item.label" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>时间范围:</label> |
|
|
|
|
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable size="small"></el-date-picker> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>角色:</label> |
|
|
|
|
<el-select v-model="role" placeholder="请选择角色" size="small" clearable class="w-150" @change="initData"> |
|
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
|
<el-option v-for="(item,index) in roleList" :key="index" :label="item.roleName" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>状态:</label> |
|
|
|
|
<el-select v-model="status" placeholder="请选择状态" size="small" clearable class="w-150" @change="initData"> |
|
|
|
|
<el-option v-for="(item,index) in statusList" :key="index" :label="item.label" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</li> |
|
|
|
|
<li> |
|
|
|
|
<label>搜索:</label> |
|
|
|
|
<el-input style="width: 250px" placeholder="请输入员工姓名/工号/角色名称" v-model="keyword" suffix-icon="el-icon-search" clearable size="small"></el-input> |
|
|
|
|
<el-input style="width: 250px" placeholder="请输入员工账号/姓名/工号" v-model="keyword" suffix-icon="el-icon-search" clearable size="small"></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
@ -23,20 +46,29 @@ |
|
|
|
|
<el-table-column prop="account" label="账号" 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="roleName" label="账号角色" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="权限状态" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{scope.row.disableAccount ? '禁用' : '启用'}} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="账号角色" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{roleList.find(n => n.id == scope.row.roleId) ? roleList.find(n => n.id == scope.row.roleId).roleName : ''}} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="loginNumber" label="登录次数" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{scope.row.loginNumber ? scope.row.loginNumber : 0}} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="lastLoginTime" label="上次登录时间" width="160" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="200"> |
|
|
|
|
<el-table-column label="操作" align="center" width="260"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="showTeacher(scope.row)" v-auth="'/system/list:员工管理:查看'">查看</el-button> |
|
|
|
|
<el-button type="text" @click="editTeacher(scope.row)" v-auth="'/system/list:员工管理:编辑'">编辑</el-button> |
|
|
|
|
<el-button type="text" @click="resetPassword(scope.row)" v-auth="'/system/list:员工管理:重置密码'">重置密码</el-button> |
|
|
|
|
<el-button type="text" @click="delTeacher(scope.row)" v-auth="'/system/list:员工管理:删除'">删除</el-button> |
|
|
|
|
<el-switch v-model="scope.row.isDisable" :active-value="0" :inactive-value="1" style="margin: 0 10px 0 5px" :active-text="scope.row.isDisable ? '关' : '开'" @change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
|
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'/system/list:员工管理:删除'">删除</el-button> |
|
|
|
|
<el-switch v-model="scope.row.disableAccount" :active-value="0" :inactive-value="1" style="margin: 0 10px 0 5px" :active-text="scope.row.disableAccount ? '关' : '开'" @change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -44,35 +76,35 @@ |
|
|
|
|
<el-pagination background layout="total,prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog :title="isDetail ? '查看员工' : (isAddteacher ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible" width="500px" @close="closeTeacher" class="dialog" :close-on-click-modal="false"> |
|
|
|
|
<el-form ref="teacherForm" :model="teacherForm" :rules="rules" label-width="110px" label-suffix=":" :disabled="isDetail"> |
|
|
|
|
<el-form-item prop="userAccount" label="账号"> |
|
|
|
|
<el-input v-model="teacherForm.userAccount" ref="account" placeholder="请输入职工账号" @change="accountChange"></el-input> |
|
|
|
|
<el-dialog :title="isDetail ? '查看员工' : (form.userId ? '新增员工' : '编辑员工')" :visible.sync="userVisible" width="500px" @close="closeUser" class="dialog" :close-on-click-modal="false"> |
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px" label-suffix=":" :disabled="isDetail"> |
|
|
|
|
<el-form-item prop="account" label="账号"> |
|
|
|
|
<el-input v-model="form.account" ref="account" placeholder="请输入职工账号" @change="accountChange"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="userName" label="用户姓名"> |
|
|
|
|
<el-input v-model="teacherForm.userName" placeholder="请输入员工姓名"></el-input> |
|
|
|
|
<el-input v-model="form.userName" placeholder="请输入员工姓名"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="roleValue" label="账号角色"> |
|
|
|
|
<el-select v-model="teacherForm.roleValue" placeholder="请选择账号角色" :disabled="!isAddteacher"> |
|
|
|
|
<el-form-item prop="roleId" label="账号角色"> |
|
|
|
|
<el-select v-model="form.roleId" placeholder="请选择账号角色"> |
|
|
|
|
<el-option v-for="(item,index) in roleList" :key="index" :label="item.roleName" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="uniqueIdentificationAccount" label="唯一标识"> |
|
|
|
|
<el-input disabled v-model="teacherForm.uniqueIdentificationAccount" placeholder="请输入工号/学号获取唯一标识"></el-input> |
|
|
|
|
<el-form-item prop="uniqueIdentification" label="唯一标识"> |
|
|
|
|
<el-input disabled v-model="form.uniqueIdentification" placeholder="唯一标识"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="phone" label="手机号"> |
|
|
|
|
<el-input v-model="teacherForm.phone" placeholder="请输入手机号" maxlength="11"></el-input> |
|
|
|
|
<el-input v-model="form.phone" placeholder="请输入手机号" maxlength="11"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="email" label="邮箱"> |
|
|
|
|
<el-input v-model="teacherForm.email" placeholder="请输入邮箱"></el-input> |
|
|
|
|
<el-input v-model="form.email" placeholder="请输入邮箱"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="workNumber" label="工号/学号"> |
|
|
|
|
<el-input v-model="teacherForm.workNumber" placeholder="请输入职工工号" @change="workNumberChange"></el-input> |
|
|
|
|
<el-input v-model="form.workNumber" placeholder="请输入职工工号" @change="workNumberChange"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer" v-if="!isDetail"> |
|
|
|
|
<el-button size="small" @click="teacherVisible = false">取 消</el-button> |
|
|
|
|
<el-button size="small" type="primary" @click="saveSure('teacherForm')">确 定</el-button> |
|
|
|
|
<el-button size="small" @click="userVisible = false">取 消</el-button> |
|
|
|
|
<el-button size="small" type="primary" @click="confirm">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
@ -102,32 +134,60 @@ import util from '@/libs/util' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
pages: 10, |
|
|
|
|
schoolId: 1001, |
|
|
|
|
month: '', |
|
|
|
|
monthList: [ |
|
|
|
|
{ |
|
|
|
|
id: '', |
|
|
|
|
label: '不限' |
|
|
|
|
},{ |
|
|
|
|
id: 3, |
|
|
|
|
label: '近3个月' |
|
|
|
|
},{ |
|
|
|
|
id: 6, |
|
|
|
|
label: '近6个月' |
|
|
|
|
},{ |
|
|
|
|
id: 12, |
|
|
|
|
label: '近1年' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
date: [], |
|
|
|
|
startTime: '', |
|
|
|
|
endTime: '', |
|
|
|
|
role: '', |
|
|
|
|
status: '', |
|
|
|
|
statusList: [ |
|
|
|
|
{ |
|
|
|
|
id: '', |
|
|
|
|
label: '不限' |
|
|
|
|
},{ |
|
|
|
|
id: 0, |
|
|
|
|
label: '启用' |
|
|
|
|
},{ |
|
|
|
|
id: 1, |
|
|
|
|
label: '禁用' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
isDetail: false, |
|
|
|
|
props: { multiple: true }, |
|
|
|
|
orgList: [], |
|
|
|
|
isAddteacher: false, |
|
|
|
|
teacherVisible: false, |
|
|
|
|
staffShowVisible: false, |
|
|
|
|
userVisible: false, |
|
|
|
|
roleList: [], |
|
|
|
|
teacherForm: { |
|
|
|
|
teacherId: '', |
|
|
|
|
form: { |
|
|
|
|
platformId: Setting.platformId, |
|
|
|
|
// type: 1, // 可不传 |
|
|
|
|
account: '', |
|
|
|
|
userId: '', |
|
|
|
|
userName: '', |
|
|
|
|
roleValue: '', |
|
|
|
|
roleId: '', |
|
|
|
|
phone: '', |
|
|
|
|
uniqueIdentificationAccount: '', |
|
|
|
|
uniqueIdentification: '', |
|
|
|
|
workNumber: '', |
|
|
|
|
email: '', |
|
|
|
|
major: '', |
|
|
|
|
department: '', |
|
|
|
|
userAccount: '', |
|
|
|
|
major: '', |
|
|
|
|
clientId: this.clientId, |
|
|
|
|
clientName: this.clientName, |
|
|
|
|
schoolId: this.schoolId, |
|
|
|
|
password: '' |
|
|
|
|
}, |
|
|
|
|
rules: { |
|
|
|
|
userAccount: [ |
|
|
|
|
{ required: true, message: '请输入账号', trigger: 'blur' }, |
|
|
|
|
account: [ |
|
|
|
|
{ required: true, message: '请输入职工账号', trigger: 'blur' }, |
|
|
|
|
{ |
|
|
|
|
pattern: /^[A-Za-z0-9]+$/, |
|
|
|
|
message: '请输入正确的账号', |
|
|
|
@ -137,45 +197,31 @@ export default { |
|
|
|
|
userName: [ |
|
|
|
|
{ required: true, message: '请输入用户姓名', trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
roleValue: [ |
|
|
|
|
roleId: [ |
|
|
|
|
{ required: true, message: '请选择账号角色', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
uniqueIdentificationAccount: [ |
|
|
|
|
// { required: true, message: '请输入唯一标识', trigger: 'blur' }, |
|
|
|
|
], |
|
|
|
|
major: [ |
|
|
|
|
{ required: true, message: '请选择一级部门', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
workNumber: [ |
|
|
|
|
{ required: true, message: '请输入职工工号', trigger: 'blur' }, |
|
|
|
|
{ required: true, message: '请输入工号/学号', trigger: 'blur' }, |
|
|
|
|
{ |
|
|
|
|
pattern: /^[A-Za-z0-9]+$/, |
|
|
|
|
message: '请输入正确的职工工号', |
|
|
|
|
trigger: 'blur' |
|
|
|
|
pattern: /^[A-Za-z0-9]+$/, |
|
|
|
|
message: '请输入正确的工号/学号', |
|
|
|
|
trigger: 'blur' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
department: [ |
|
|
|
|
{ required: true, message: '请选择二级部门', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
phone: [ |
|
|
|
|
// { required: true, message: '请输入职工手机号', trigger: 'blur' }, |
|
|
|
|
{ |
|
|
|
|
pattern: /^1[3456789]\d{9}$/, |
|
|
|
|
message: '请输入正确的手机号', |
|
|
|
|
trigger: 'blur' |
|
|
|
|
pattern: /^1[3456789]\d{9}$/, |
|
|
|
|
message: '请输入正确的手机号', |
|
|
|
|
trigger: 'blur' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
email: [ |
|
|
|
|
// { required: true, message: '请输入邮箱', trigger: 'blur' }, |
|
|
|
|
{ |
|
|
|
|
pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/, |
|
|
|
|
message: '请输入正确的邮箱', |
|
|
|
|
trigger: 'blur' |
|
|
|
|
pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/, |
|
|
|
|
message: '请输入正确的邮箱', |
|
|
|
|
trigger: 'blur' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
// schoolId: [ |
|
|
|
|
// { required: true, message: '请选择所在院校', trigger: 'change' } |
|
|
|
|
// ], |
|
|
|
|
}, |
|
|
|
|
listData: [], |
|
|
|
|
importVisible: false, |
|
|
|
@ -183,32 +229,12 @@ export default { |
|
|
|
|
page: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
total: 0, |
|
|
|
|
departmentList: [], |
|
|
|
|
teacherDepartmentList: [], |
|
|
|
|
staffstateProfessId: '', |
|
|
|
|
staffGradeId: '', |
|
|
|
|
multipleSelection: [], |
|
|
|
|
uploadList: [], |
|
|
|
|
provinceId: this.$store.state.provinceId, |
|
|
|
|
cityId: this.$store.state.cityId, |
|
|
|
|
userId: this.$store.state.userId, |
|
|
|
|
oneDepartmentIds: '', |
|
|
|
|
twoDepartmentIds: '', |
|
|
|
|
ProfessionalClassList: [], |
|
|
|
|
subjectList: [], |
|
|
|
|
ProfessionalList: [], |
|
|
|
|
NoAdd: '', |
|
|
|
|
AccountNoAdd: '', |
|
|
|
|
NumberNoAdd: '', |
|
|
|
|
platformId: this.$store.state.platformId, |
|
|
|
|
schoolList: [], |
|
|
|
|
uploadFaild: false, |
|
|
|
|
token: '', |
|
|
|
|
accountRepeat: false, |
|
|
|
|
workNumberRepeat: false, |
|
|
|
|
originalAccount: '', |
|
|
|
|
originalWorkNumber: '', |
|
|
|
|
password: Setting.initialPassword |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -225,59 +251,45 @@ export default { |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.initData() |
|
|
|
|
},500) |
|
|
|
|
}, |
|
|
|
|
month: function(val){ |
|
|
|
|
if(val){ |
|
|
|
|
let unit = 24 * 60 * 60 * 1000 |
|
|
|
|
this.date = [util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] |
|
|
|
|
}else{ |
|
|
|
|
this.date = [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
date: function(val){ |
|
|
|
|
if(val.length){ |
|
|
|
|
this.startTime = val[0] |
|
|
|
|
this.endTime = val[1] |
|
|
|
|
}else{ |
|
|
|
|
this.startTime = '' |
|
|
|
|
this.endTime = '' |
|
|
|
|
} |
|
|
|
|
this.initData() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted(){ |
|
|
|
|
this.getOrg() |
|
|
|
|
this.teacherForm.clientId = this.clientId |
|
|
|
|
this.teacherForm.clientName = this.clientName |
|
|
|
|
this.form.schoolId = this.schoolId |
|
|
|
|
this.getData() |
|
|
|
|
this.getRoles() |
|
|
|
|
this.getRole() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getOrg(){ |
|
|
|
|
let data = { |
|
|
|
|
schoolId: this.clientId |
|
|
|
|
} |
|
|
|
|
this.$get(this.api.queryStaffPro,data).then(res => { |
|
|
|
|
let firList = res.data.StaffProfessionalArchitectureList |
|
|
|
|
if(firList){ |
|
|
|
|
firList.map(e => { |
|
|
|
|
e.isParent = true |
|
|
|
|
e.value = e.staffProfessionalArchitectureId |
|
|
|
|
e.label = e.staffProfessionalArchitectureName |
|
|
|
|
let data = { |
|
|
|
|
staffProfessionalArchitectureId: e.staffProfessionalArchitectureId |
|
|
|
|
} |
|
|
|
|
this.$get(this.api.queryStaffGrade,data).then(res1 => { |
|
|
|
|
res1.data.staffGradeList.map(e => { |
|
|
|
|
e.value = e.staffGradeId |
|
|
|
|
e.label = e.staffGradeName |
|
|
|
|
}) |
|
|
|
|
e.children = res1.data.staffGradeList |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.orgList = firList |
|
|
|
|
},500) |
|
|
|
|
} |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
getData(){ |
|
|
|
|
let totalPage = Math.ceil((this.total - 1) / this.pageSize) |
|
|
|
|
let currentPage = this.page > totalPage ? totalPage : this.page |
|
|
|
|
this.page = currentPage < 1 ? 1 : currentPage |
|
|
|
|
let data = { |
|
|
|
|
staffProfessionalArchitectureIds: this.oneDepartmentIds, |
|
|
|
|
staffGradeIds: this.twoDepartmentIds, |
|
|
|
|
searchContent: this.keyword, |
|
|
|
|
schoolId: this.clientId, |
|
|
|
|
this.$post(this.api.getUserList,{ |
|
|
|
|
createTime: this.startTime, |
|
|
|
|
disableAccount: this.status, |
|
|
|
|
endTime: this.endTime, |
|
|
|
|
keyWord: this.keyword, |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize |
|
|
|
|
} |
|
|
|
|
this.$get(`${this.api.queryStaff}/${this.page}/${this.pageSize}`,data).then(res => { |
|
|
|
|
this.listData = res.data.staffList.list |
|
|
|
|
this.total = res.data.staffList.totalCount |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
platformId: Setting.platformId, |
|
|
|
|
roleId: this.role, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.listData = res.pageList.records |
|
|
|
|
this.total = res.pageList.total |
|
|
|
|
if(!this.listData.length && this.total){ |
|
|
|
|
this.page-- |
|
|
|
|
this.getData() |
|
|
|
@ -288,16 +300,9 @@ export default { |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
orgChange(node){ |
|
|
|
|
this.twoDepartmentIds = node.map(n => n[1]).toString() |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
getRoles(){ |
|
|
|
|
let data = { |
|
|
|
|
clientId: this.clientId |
|
|
|
|
} |
|
|
|
|
this.$get(`${this.api.queryRoles}/1/100`,data).then(res => { |
|
|
|
|
this.roleList = res.data.items |
|
|
|
|
getRole(){ |
|
|
|
|
this.$get(this.api.getRoles).then(res => { |
|
|
|
|
this.roleList = res.list |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
resetPassword(row){ |
|
|
|
@ -319,173 +324,107 @@ export default { |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}, |
|
|
|
|
accountChange(){ |
|
|
|
|
if(this.teacherForm.userAccount !== this.originalAccount){ |
|
|
|
|
this.$get(`${this.api.getAccount}?account=${this.teacherForm.userAccount}`).then(res => { |
|
|
|
|
if(res.data.userInfo){ |
|
|
|
|
// if(this.form.account !== this.originalAccount){ |
|
|
|
|
this.$get(`${this.api.checkAccount}?account=${this.form.account}&type=1`).then(res => { |
|
|
|
|
if(res.status == 200){ |
|
|
|
|
this.accountRepeat = false |
|
|
|
|
}else{ |
|
|
|
|
this.accountRepeat = true |
|
|
|
|
util.warningMsg('该账号已存在') |
|
|
|
|
}else{ |
|
|
|
|
this.accountRepeat = false |
|
|
|
|
} |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}else{ |
|
|
|
|
this.accountRepeat = false |
|
|
|
|
} |
|
|
|
|
// }else{ |
|
|
|
|
// this.accountRepeat = false |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
workNumberChange(){ |
|
|
|
|
if(this.teacherForm.workNumber !== this.originalWorkNumber){ |
|
|
|
|
this.$get(`${this.api.getWorkNumber}?workNumber=${this.teacherForm.workNumber}`).then(res => { |
|
|
|
|
if(res.data.staff){ |
|
|
|
|
// if(this.form.workNumber !== this.originalWorkNumber){ |
|
|
|
|
this.$get(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2`).then(res => { |
|
|
|
|
if(res.status == 200){ |
|
|
|
|
this.workNumberRepeat = false |
|
|
|
|
}else{ |
|
|
|
|
this.workNumberRepeat = true |
|
|
|
|
util.warningMsg('该工号已存在') |
|
|
|
|
}else{ |
|
|
|
|
this.workNumberRepeat = false |
|
|
|
|
} |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}else{ |
|
|
|
|
this.workNumberRepeat = false |
|
|
|
|
} |
|
|
|
|
// }else{ |
|
|
|
|
// this.workNumberRepeat = false |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
closeTeacher(){ |
|
|
|
|
this.$refs.teacherForm.resetFields() |
|
|
|
|
this.teacherForm.clientId = this.clientId |
|
|
|
|
this.teacherForm.clientName = this.clientName |
|
|
|
|
this.teacherForm.department = '' |
|
|
|
|
this.teacherForm.major = '' |
|
|
|
|
this.teacherForm.workNumber = '' |
|
|
|
|
this.teacherForm.userId = '' |
|
|
|
|
this.teacherForm.staffId = '' |
|
|
|
|
closeUser(){ |
|
|
|
|
this.$refs.form.resetFields() |
|
|
|
|
console.log(11,this.form) |
|
|
|
|
}, |
|
|
|
|
addTeacher(){ |
|
|
|
|
this.isDetail = false |
|
|
|
|
this.teacherVisible = true |
|
|
|
|
this.userVisible = true |
|
|
|
|
this.isAddteacher = true |
|
|
|
|
this.teacherForm.teacherId = '' |
|
|
|
|
}, |
|
|
|
|
getStaffDetail(userId){ |
|
|
|
|
this.$get(`${this.api.getStaff}/${userId}`).then(res => { |
|
|
|
|
let user = res.data.userInfo; |
|
|
|
|
let or = res.data.staff; |
|
|
|
|
this.teacherForm.uniqueIdentificationAccount = user.uniqueIdentificationAccount |
|
|
|
|
this.teacherForm.clientId = user.clientId |
|
|
|
|
this.teacherForm.clientName = user.clientName |
|
|
|
|
this.teacherForm.userName = user.userName |
|
|
|
|
this.teacherForm.phone = user.phone |
|
|
|
|
this.teacherForm.email = user.email |
|
|
|
|
this.teacherForm.userAccount = user.account |
|
|
|
|
this.form.uniqueIdentification = user.uniqueIdentification |
|
|
|
|
this.form.userName = user.userName |
|
|
|
|
this.form.phone = user.phone |
|
|
|
|
this.form.email = user.email |
|
|
|
|
this.form.account = user.account |
|
|
|
|
this.originalAccount = user.account |
|
|
|
|
this.teacherForm.userId = user.userId |
|
|
|
|
this.teacherForm.schoolId = user.schoolId |
|
|
|
|
this.teacherForm.roleValue = user.roleId |
|
|
|
|
this.form.userId = user.userId |
|
|
|
|
this.form.schoolId = user.schoolId |
|
|
|
|
|
|
|
|
|
this.teacherForm.major = or.staffProfessionalArchitectureId |
|
|
|
|
this.teacherForm.department = or.staffGradeId |
|
|
|
|
this.teacherForm.workNumber = or.workNumber |
|
|
|
|
this.form.workNumber = or.workNumber |
|
|
|
|
this.originalWorkNumber = or.workNumber |
|
|
|
|
this.isManager = true |
|
|
|
|
this.teacherForm.staffId = or.staffId |
|
|
|
|
this.getDepartment() |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
editTeacher(row){ |
|
|
|
|
this.isDetail = false |
|
|
|
|
this.teacherVisible = true |
|
|
|
|
this.userVisible = true |
|
|
|
|
this.isAddteacher = false |
|
|
|
|
this.AccountNoAdd = false |
|
|
|
|
this.teacherForm.teacherId = row.staffId |
|
|
|
|
this.getStaffDetail(row.staffId) |
|
|
|
|
this.form.userId = row.userId |
|
|
|
|
this.getStaffDetail(row.userId) |
|
|
|
|
}, |
|
|
|
|
showTeacher(row){ |
|
|
|
|
this.staffShowVisible = true |
|
|
|
|
this.isDetail = true |
|
|
|
|
this.isAddManage = false |
|
|
|
|
this.AccountNoAdd = false |
|
|
|
|
this.teacherForm.manageId = row.staffId |
|
|
|
|
this.getStaffDetail(row.staffId) |
|
|
|
|
this.getStaffDetail(row.userId) |
|
|
|
|
}, |
|
|
|
|
getDepartment(){ |
|
|
|
|
let data = { |
|
|
|
|
staffProfessionalArchitectureId: this.teacherForm.major |
|
|
|
|
} |
|
|
|
|
this.$get(this.api.queryStaffGrade,data).then(res => { |
|
|
|
|
this.departmentList = res.data.staffGradeList |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}, |
|
|
|
|
async saveSure(teacherForm){ |
|
|
|
|
this.$refs[teacherForm].validate((valid) => { |
|
|
|
|
confirm(){ |
|
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
if(this.accountRepeat) return util.warningMsg('该账号已存在') |
|
|
|
|
if(this.workNumberRepeat) return util.warningMsg('该工号已存在') |
|
|
|
|
let isTeacher = false |
|
|
|
|
let isManager = false |
|
|
|
|
let data = { |
|
|
|
|
userInfo: { |
|
|
|
|
userId: this.teacherForm.userId, |
|
|
|
|
userName: this.teacherForm.userName, |
|
|
|
|
account: this.teacherForm.userAccount, |
|
|
|
|
clientId: this.teacherForm.clientId, |
|
|
|
|
clientName: this.teacherForm.clientName, |
|
|
|
|
roleId: this.teacherForm.roleValue, |
|
|
|
|
phone: this.teacherForm.phone, |
|
|
|
|
email: this.teacherForm.email, |
|
|
|
|
isPort: 2, |
|
|
|
|
uniqueIdentificationAccount: this.teacherForm.uniqueIdentificationAccount ? this.teacherForm.uniqueIdentificationAccount : Date.parse(new Date()), |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
let oneDepartmentName = ''; |
|
|
|
|
for(let i in this.orgList){ |
|
|
|
|
if(this.orgList[i].staffProfessionalArchitectureId == this.teacherForm.major) { |
|
|
|
|
oneDepartmentName = this.orgList[i].staffProfessionalArchitectureName |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
let twoDepartmentName = this.departmentList.find((n) => { |
|
|
|
|
return n.staffGradeId == this.teacherForm.department |
|
|
|
|
}).staffGradeName; |
|
|
|
|
data.staff = { |
|
|
|
|
roleId: this.teacherForm.roleValue, |
|
|
|
|
isPort: 2, |
|
|
|
|
schoolId: this.teacherForm.clientId, |
|
|
|
|
staffId: this.teacherForm.staffId, |
|
|
|
|
userId: this.teacherForm.userId, |
|
|
|
|
workNumber: this.teacherForm.workNumber, |
|
|
|
|
staffProfessionalArchitectureId: this.teacherForm.major, |
|
|
|
|
staffGradeId: this.teacherForm.department, |
|
|
|
|
staffProfessionalArchitectureName: oneDepartmentName, |
|
|
|
|
staffGradeName: twoDepartmentName, |
|
|
|
|
}; |
|
|
|
|
if(this.teacherForm.teacherId){ |
|
|
|
|
let data = this.form |
|
|
|
|
if(!data.uniqueIdentification) data.uniqueIdentification = new Date().getTime() |
|
|
|
|
console.log(22,data) |
|
|
|
|
if(this.form.userId){ |
|
|
|
|
this.$post(this.api.updateStaff,data).then(res => { |
|
|
|
|
this.teacherVisible = false |
|
|
|
|
util.successMsg('编辑成功'); |
|
|
|
|
this.userVisible = false |
|
|
|
|
util.successMsg('编辑成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}else{ |
|
|
|
|
this.$post(this.api.addStaff,data).then(res => { |
|
|
|
|
this.teacherVisible = false |
|
|
|
|
util.successMsg('添加成功'); |
|
|
|
|
this.$post(this.api.saveUser,data).then(res => { |
|
|
|
|
this.userVisible = false |
|
|
|
|
util.successMsg('添加成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
delTeacher(row){ |
|
|
|
|
handleDelete(row){ |
|
|
|
|
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
}).then(() => { |
|
|
|
|
let data = { |
|
|
|
|
staffIds: row.staffId |
|
|
|
|
} |
|
|
|
|
this.$del(this.api.deleteStaffs,data).then(res => { |
|
|
|
|
util.successMsg('删除成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}); |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}, |
|
|
|
|
switchOff(val,row,index) { |
|
|
|
|
let data = { |
|
|
|
@ -493,24 +432,22 @@ export default { |
|
|
|
|
isDisable: val |
|
|
|
|
} |
|
|
|
|
this.$post(this.api.updateClient,data).then((res) => { |
|
|
|
|
val == 1 ? util.warningMsg('该院校系统使用权限已关闭') : util.successMsg('该院校系统使用权限已激活') |
|
|
|
|
val == 1 ? util.warningMsg('该用户权限已关闭') : util.successMsg('该用户权限已激活') |
|
|
|
|
}).catch((res) => { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange(val) { |
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
this.multipleSelection = val |
|
|
|
|
}, |
|
|
|
|
delAllSelection() { |
|
|
|
|
if(this.multipleSelection.length != ''){ |
|
|
|
|
let newArr = this.multipleSelection |
|
|
|
|
let delList = newArr.map(item => { |
|
|
|
|
return item.staffId |
|
|
|
|
return item.userId |
|
|
|
|
}) |
|
|
|
|
// 批量删除 |
|
|
|
|
this.$confirm(`此批量删除操作不可逆,是否确认删除${util.ellipsisStr(newArr[0].userName)}等${newArr.length}个选中项?`, '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
}).then(() => { |
|
|
|
|
let data = { |
|
|
|
|
staffIds: delList.join(',') |
|
|
|
|
} |
|
|
|
@ -518,8 +455,8 @@ export default { |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
util.successMsg('删除成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}).catch(() => {}); |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}else{ |
|
|
|
|
util.errorMsg('请先选择数据 !') |
|
|
|
|
} |
|
|
|
@ -544,7 +481,6 @@ export default { |
|
|
|
|
showFaild(){ |
|
|
|
|
location.href = `${this.api.exportFailureStaff}?token=${this.token}` |
|
|
|
|
}, |
|
|
|
|
// 上传文件 |
|
|
|
|
handleExceed(files, fileList) { |
|
|
|
|
util.warningMsg( |
|
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
@ -590,6 +526,13 @@ export default { |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.filter{ |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
li{ |
|
|
|
|
width: 30%; |
|
|
|
|
margin-bottom: 16px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/deep/.dialog{ |
|
|
|
|
.el-form-item{ |
|
|
|
|
.el-form-item__label{ |
|
|
|
@ -605,23 +548,4 @@ export default { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.list{ |
|
|
|
|
li{ |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|
margin: 32px 0; |
|
|
|
|
.name,.val{ |
|
|
|
|
font-size: 16px; |
|
|
|
|
color: rgba(0, 0, 0, 0.65); |
|
|
|
|
} |
|
|
|
|
.name{ |
|
|
|
|
width: 45%; |
|
|
|
|
text-align: right; |
|
|
|
|
} |
|
|
|
|
.val{ |
|
|
|
|
width: 55%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
</style> |