|
|
|
@ -47,7 +47,7 @@ |
|
|
|
|
width="30%" @close="closeTeacher" class="dialog" :close-on-click-modal="false"> |
|
|
|
|
<el-form ref="teacherForm" :model="teacherForm" :rules="rules" label-width="140px" :disabled="isDetail"> |
|
|
|
|
<el-form-item prop="account" label="账号"> |
|
|
|
|
<el-input v-model.trim="teacherForm.account" placeholder="请输入职工账号" @blur="accountChange"></el-input> |
|
|
|
|
<el-input v-model.trim="teacherForm.account" placeholder="请输入职工账号"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="userName" label="用户姓名"> |
|
|
|
|
<el-input v-model.trim="teacherForm.userName" placeholder="请输入员工姓名"></el-input> |
|
|
|
@ -66,7 +66,7 @@ |
|
|
|
|
<el-input disabled v-model.trim="teacherForm.uniqueIdentification" placeholder="请输入职工工号获取唯一标识"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="workNumber" label="工号"> |
|
|
|
|
<el-input v-model.trim="teacherForm.workNumber" placeholder="请输入职工工号" @blur="workNumberChange"></el-input> |
|
|
|
|
<el-input v-model.trim="teacherForm.workNumber" placeholder="请输入职工工号"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<template v-for="item in teacherForm.roleAndDeptList"> |
|
|
|
|
<el-form-item :label="`${item.roleName}所属部门`"> |
|
|
|
@ -127,6 +127,32 @@ import TeacherSide from "./staffSide"; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
var accountPass = (rule, value, callback) => { |
|
|
|
|
if (value === '') { |
|
|
|
|
callback(new Error('请输入账号')); |
|
|
|
|
} else { |
|
|
|
|
var pattern = /^[A-Za-z0-9]*$/; |
|
|
|
|
if(pattern.test(value)){ |
|
|
|
|
this.accountChange(); |
|
|
|
|
callback(); |
|
|
|
|
}else{ |
|
|
|
|
callback(new Error('请输入正确账号格式')); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
var workNumberPass = (rule, value, callback) => { |
|
|
|
|
if (value === '') { |
|
|
|
|
callback(new Error('请输入职工工号')); |
|
|
|
|
} else { |
|
|
|
|
var pattern = /^[0-9]*$/; |
|
|
|
|
if(pattern.test(value)){ |
|
|
|
|
this.workNumberChange(); |
|
|
|
|
callback(); |
|
|
|
|
}else{ |
|
|
|
|
callback(new Error('职工工号必须为数字')); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
return { |
|
|
|
|
exportCode: "", |
|
|
|
|
headers: { |
|
|
|
@ -150,12 +176,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
rules: { |
|
|
|
|
account: [ |
|
|
|
|
{ required: true, message: "请输入职工账号", trigger: "blur" }, |
|
|
|
|
{ |
|
|
|
|
pattern: /^[A-Za-z0-9]*$/, |
|
|
|
|
message: "请输入正确的账号", |
|
|
|
|
trigger: "blur" |
|
|
|
|
} |
|
|
|
|
{ validator: accountPass, trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
userName: [ |
|
|
|
|
{ required: true, message: "请输入用户姓名", trigger: "blur" } |
|
|
|
@ -164,8 +185,7 @@ export default { |
|
|
|
|
{ required: true, message: "请选择账号角色", trigger: "change" } |
|
|
|
|
], |
|
|
|
|
workNumber: [ |
|
|
|
|
{ required: true, message: "请输入职工工号", trigger: "blur" }, |
|
|
|
|
// { pattern: /^[0-9]*$/, message: "职工工号必须为数字", trigger: "blur"} |
|
|
|
|
{ validator: workNumberPass , trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
uniqueIdentification: [ |
|
|
|
|
// { required: true, message: '请输入唯一标识', trigger: 'blur' }, |
|
|
|
|