|
|
|
@ -68,15 +68,18 @@ |
|
|
|
|
<el-form-item prop="workNumber" label="工号"> |
|
|
|
|
<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}所属部门`"> |
|
|
|
|
<el-cascader |
|
|
|
|
v-model="item.cascaderValue" |
|
|
|
|
:options="majorList" |
|
|
|
|
style="width: 100%" |
|
|
|
|
></el-cascader> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
<el-form-item v-for="item in teacherForm.roleAndDeptList" :label="`${item.roleName}所属部门`" :rules="{ |
|
|
|
|
required: true, message: '请选择', trigger: 'change' |
|
|
|
|
}"> |
|
|
|
|
<el-cascader |
|
|
|
|
v-model="item.cascaderValue" |
|
|
|
|
:options="majorList" |
|
|
|
|
style="width: 100%" |
|
|
|
|
></el-cascader> |
|
|
|
|
</el-form-item> |
|
|
|
|
<!-- <template v-for="item in teacherForm.roleAndDeptList">--> |
|
|
|
|
<!-- --> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
|
|
|
|
|
<el-form-item prop="phone" label="手机号"> |
|
|
|
|
<el-input v-model.trim="teacherForm.phone" placeholder="请输入手机号" maxlength="11" @blur="phoneChange"></el-input> |
|
|
|
@ -471,10 +474,15 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
roleRemove(value) { // 处理移除角色 |
|
|
|
|
let index = this.teacherForm.roleAndDeptList.findIndex(i => i.roleName === value); |
|
|
|
|
if (index !== -1) { |
|
|
|
|
this.teacherForm.roleAndDeptList.splice(index, 1); |
|
|
|
|
let list = []; |
|
|
|
|
for(var i=0;i<this.teacherForm.roleAndDeptList.length;i++){ |
|
|
|
|
if (this.teacherForm.roleAndDeptList[i].roleId == value){ |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
list.push(this.teacherForm.roleAndDeptList[i]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.teacherForm.roleAndDeptList = list |
|
|
|
|
}, |
|
|
|
|
async saveSure(teacherForm) { |
|
|
|
|
this.$refs[teacherForm].validate((valid) => { |
|
|
|
|