|
@@ -107,11 +107,11 @@
|
|
</template>
|
|
</template>
|
|
</cloudTable>
|
|
</cloudTable>
|
|
<cloudDialog ref="dialog" :config="dialogConfig" :beforeClose="beforeClose">
|
|
<cloudDialog ref="dialog" :config="dialogConfig" :beforeClose="beforeClose">
|
|
- <el-form ref="form" :model="dialogForm" label-width="80px">
|
|
|
|
- <el-form-item label="教师名称">
|
|
|
|
|
|
+ <el-form ref="form" :model="dialogForm" label-width="80px" :rules="rules">
|
|
|
|
+ <el-form-item label="教师姓名" prop="name">
|
|
<el-input
|
|
<el-input
|
|
v-model="dialogForm.name"
|
|
v-model="dialogForm.name"
|
|
- placeholder="请输入教师名称"
|
|
|
|
|
|
+ placeholder="请输入教师姓名"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="性别">
|
|
<el-form-item label="性别">
|
|
@@ -126,13 +126,14 @@
|
|
placeholder="请输入年龄"
|
|
placeholder="请输入年龄"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="手机号">
|
|
|
|
|
|
+ <el-form-item label="手机号" prop="phone">
|
|
<el-input
|
|
<el-input
|
|
v-model="dialogForm.phone"
|
|
v-model="dialogForm.phone"
|
|
|
|
+ maxlength="11"
|
|
placeholder="请输入手机号"
|
|
placeholder="请输入手机号"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="学校">
|
|
|
|
|
|
+ <el-form-item label="学校" prop="sid">
|
|
<el-select
|
|
<el-select
|
|
v-model="dialogForm.sid"
|
|
v-model="dialogForm.sid"
|
|
placeholder="请选择学校"
|
|
placeholder="请选择学校"
|
|
@@ -147,7 +148,7 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="年级">
|
|
|
|
|
|
+ <el-form-item label="年级" prop="gid">
|
|
<el-select
|
|
<el-select
|
|
v-model="dialogForm.gid"
|
|
v-model="dialogForm.gid"
|
|
placeholder="请选择年级"
|
|
placeholder="请选择年级"
|
|
@@ -163,7 +164,7 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="班级">
|
|
|
|
|
|
+ <el-form-item label="班级" prop="cid">
|
|
<el-select
|
|
<el-select
|
|
v-model="dialogForm.cid"
|
|
v-model="dialogForm.cid"
|
|
placeholder="请选择班级"
|
|
placeholder="请选择班级"
|
|
@@ -178,7 +179,7 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="职务">
|
|
|
|
|
|
+ <el-form-item label="职务" prop="rid">
|
|
<el-select v-model="dialogForm.rid" placeholder="请选择职务">
|
|
<el-select v-model="dialogForm.rid" placeholder="请选择职务">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in metaData['roles']"
|
|
v-for="item in metaData['roles']"
|
|
@@ -189,7 +190,7 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="任教科目">
|
|
|
|
|
|
+ <el-form-item label="任教科目" prop="subject">
|
|
<el-select v-model="dialogForm.subject" placeholder="请选择科目">
|
|
<el-select v-model="dialogForm.subject" placeholder="请选择科目">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in metaData['subjects']"
|
|
v-for="item in metaData['subjects']"
|
|
@@ -373,6 +374,57 @@ export default {
|
|
btnTxt: ["取消", "上传"],
|
|
btnTxt: ["取消", "上传"],
|
|
},
|
|
},
|
|
selRows: "",
|
|
selRows: "",
|
|
|
|
+ rules: {
|
|
|
|
+ name: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请输入教师姓名",
|
|
|
|
+ trigger: "blur",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ sid: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请选择学校",
|
|
|
|
+ trigger: "change",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ gid: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请选择年级",
|
|
|
|
+ trigger: "change",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ cid: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请选择班级",
|
|
|
|
+ trigger: "change",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ rid: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请选择教师职务",
|
|
|
|
+ trigger: "change",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ phone: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请输入手机号",
|
|
|
|
+ trigger: "blur",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ subject: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请选择任教科目",
|
|
|
|
+ trigger: "blur",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -428,10 +480,25 @@ export default {
|
|
};
|
|
};
|
|
this.dialogForm = form;
|
|
this.dialogForm = form;
|
|
this.$refs.dialog.open((cancel) => {
|
|
this.$refs.dialog.open((cancel) => {
|
|
- TeacherApi.edit(this.dialogForm).then((res) => {
|
|
|
|
- this.getList();
|
|
|
|
- cancel();
|
|
|
|
- });
|
|
|
|
|
|
+ this.$refs["form"].validate((valid)=>{
|
|
|
|
+ if(valid){
|
|
|
|
+ TeacherApi.edit(this.dialogForm).then((res) => {
|
|
|
|
+ if(res.mess="success"){
|
|
|
|
+ this.$message({
|
|
|
|
+ type:"success",
|
|
|
|
+ message:"修改成功!"
|
|
|
|
+ })
|
|
|
|
+ this.getList();
|
|
|
|
+ cancel();
|
|
|
|
+ }else{
|
|
|
|
+ Message({
|
|
|
|
+ type:"error",
|
|
|
|
+ message:res.message
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
});
|
|
});
|
|
});
|
|
});
|
|
break;
|
|
break;
|