|
@@ -12,28 +12,54 @@
|
|
<el-form
|
|
<el-form
|
|
ref="modalFormComp"
|
|
ref="modalFormComp"
|
|
:model="modalForm"
|
|
:model="modalForm"
|
|
- :key="modalForm.id"
|
|
|
|
:rules="rules"
|
|
:rules="rules"
|
|
label-width="120px"
|
|
label-width="120px"
|
|
>
|
|
>
|
|
- <el-form-item prop="outlineName" label="课程大纲名称:">
|
|
|
|
|
|
+ <el-form-item prop="courseOutlineName" label="课程大纲名称:">
|
|
<el-input
|
|
<el-input
|
|
- v-model.trim="modalForm.outlineName"
|
|
|
|
|
|
+ v-model.trim="modalForm.courseOutlineName"
|
|
placeholder="课程大纲名称"
|
|
placeholder="课程大纲名称"
|
|
clearable
|
|
clearable
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item prop="cultureProgramId" label="所属培养方案:">
|
|
|
|
+ <training-plan-select
|
|
|
|
+ v-model="modalForm.cultureProgramId"
|
|
|
|
+ placeholder="培养方案"
|
|
|
|
+ class="width-full"
|
|
|
|
+ @change="trainingPlanChange"
|
|
|
|
+ ></training-plan-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item prop="semesterId" label="修读学期:">
|
|
|
|
+ <semester-select
|
|
|
|
+ v-model="modalForm.semesterId"
|
|
|
|
+ placeholder="修读学期"
|
|
|
|
+ class="width-full"
|
|
|
|
+ ></semester-select>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item prop="courseId" label="课程:">
|
|
<el-form-item prop="courseId" label="课程:">
|
|
- <course-select
|
|
|
|
|
|
+ <el-select
|
|
v-model="modalForm.courseId"
|
|
v-model="modalForm.courseId"
|
|
- placeholder="课程"
|
|
|
|
- ></course-select>
|
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ filterable
|
|
|
|
+ clearable
|
|
|
|
+ class="width-full"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in courses"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item prop="evaluationMode" label="考核方式:">
|
|
<el-form-item prop="evaluationMode" label="考核方式:">
|
|
<el-select
|
|
<el-select
|
|
v-model="modalForm.evaluationMode"
|
|
v-model="modalForm.evaluationMode"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
clearable
|
|
clearable
|
|
|
|
+ style="width: 240px"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="(val, key) in EVALUATION_MODE"
|
|
v-for="(val, key) in EVALUATION_MODE"
|
|
@@ -49,6 +75,7 @@
|
|
v-model="modalForm.courseType"
|
|
v-model="modalForm.courseType"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
clearable
|
|
clearable
|
|
|
|
+ style="width: 240px"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="(val, key) in COURSE_TYPE"
|
|
v-for="(val, key) in COURSE_TYPE"
|
|
@@ -59,19 +86,6 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item prop="semesterId" label="修读学期:">
|
|
|
|
- <semester-select
|
|
|
|
- v-model="modalForm.semesterId"
|
|
|
|
- placeholder="修读学期"
|
|
|
|
- ></semester-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item prop="cultureProgramId" label="所属专业:">
|
|
|
|
- <professional-select
|
|
|
|
- v-model="modalForm.cultureProgramId"
|
|
|
|
- placeholder="所属专业"
|
|
|
|
- :org-id="userOrgId"
|
|
|
|
- ></professional-select>
|
|
|
|
- </el-form-item>
|
|
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer">
|
|
<div slot="footer">
|
|
<el-button type="primary" :disabled="isSubmit" @click="submit"
|
|
<el-button type="primary" :disabled="isSubmit" @click="submit"
|
|
@@ -84,15 +98,19 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { updateCourseOutline } from "../../api";
|
|
import { updateCourseOutline } from "../../api";
|
|
|
|
+import { conditionTrainingPlanCourseList } from "../../../../modules/base/api";
|
|
|
|
+
|
|
import { EVALUATION_MODE, COURSE_TYPE } from "@/constants/enumerate";
|
|
import { EVALUATION_MODE, COURSE_TYPE } from "@/constants/enumerate";
|
|
|
|
|
|
const initModalForm = {
|
|
const initModalForm = {
|
|
id: null,
|
|
id: null,
|
|
- outlineName: "",
|
|
|
|
|
|
+ courseOutlineName: "",
|
|
courseId: "",
|
|
courseId: "",
|
|
evaluationMode: "",
|
|
evaluationMode: "",
|
|
courseType: "",
|
|
courseType: "",
|
|
cultureProgramId: "",
|
|
cultureProgramId: "",
|
|
|
|
+ professionalId: "",
|
|
|
|
+ semesterId: "",
|
|
};
|
|
};
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -112,9 +130,9 @@ export default {
|
|
EVALUATION_MODE,
|
|
EVALUATION_MODE,
|
|
COURSE_TYPE,
|
|
COURSE_TYPE,
|
|
modalForm: { ...initModalForm },
|
|
modalForm: { ...initModalForm },
|
|
- userOrgId: this.$ls.get("orgId", ""),
|
|
|
|
|
|
+ courses: [],
|
|
rules: {
|
|
rules: {
|
|
- outlineName: [
|
|
|
|
|
|
+ courseOutlineName: [
|
|
{ required: true, message: "请输入课程大纲名称", trigger: "change" },
|
|
{ required: true, message: "请输入课程大纲名称", trigger: "change" },
|
|
{
|
|
{
|
|
message: "课程大纲名称不能超过30个字",
|
|
message: "课程大纲名称不能超过30个字",
|
|
@@ -135,7 +153,7 @@ export default {
|
|
{ required: true, message: "请选择修读学期", trigger: "change" },
|
|
{ required: true, message: "请选择修读学期", trigger: "change" },
|
|
],
|
|
],
|
|
cultureProgramId: [
|
|
cultureProgramId: [
|
|
- { required: true, message: "请选择所属专业", trigger: "change" },
|
|
|
|
|
|
+ { required: true, message: "请选择所属培养方案", trigger: "change" },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -151,6 +169,12 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
visibleChange() {
|
|
visibleChange() {
|
|
this.modalForm = this.$objAssign(initModalForm, this.instance);
|
|
this.modalForm = this.$objAssign(initModalForm, this.instance);
|
|
|
|
+ this.modalForm.courseOutlineName = this.instance.outlineName || "";
|
|
|
|
+ this.getCourses();
|
|
|
|
+
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.modalFormComp.clearValidate();
|
|
|
|
+ });
|
|
},
|
|
},
|
|
cancel() {
|
|
cancel() {
|
|
this.modalIsShow = false;
|
|
this.modalIsShow = false;
|
|
@@ -158,6 +182,20 @@ export default {
|
|
open() {
|
|
open() {
|
|
this.modalIsShow = true;
|
|
this.modalIsShow = true;
|
|
},
|
|
},
|
|
|
|
+ async getCourses() {
|
|
|
|
+ this.courses = [];
|
|
|
|
+ if (!this.modalForm.professionalId || !this.modalForm.cultureProgramId)
|
|
|
|
+ return;
|
|
|
|
+ const res = await conditionTrainingPlanCourseList({
|
|
|
|
+ professionalId: this.modalForm.professionalId,
|
|
|
|
+ cultureProgramId: this.modalForm.cultureProgramId,
|
|
|
|
+ });
|
|
|
|
+ this.courses = res || [];
|
|
|
|
+ },
|
|
|
|
+ trainingPlanChange(val) {
|
|
|
|
+ this.modalForm.professionalId = val?.professionalId;
|
|
|
|
+ this.getCourses();
|
|
|
|
+ },
|
|
async submit() {
|
|
async submit() {
|
|
const valid = await this.$refs.modalFormComp.validate().catch(() => {});
|
|
const valid = await this.$refs.modalFormComp.validate().catch(() => {});
|
|
if (!valid) return;
|
|
if (!valid) return;
|