|
@@ -3,55 +3,26 @@
|
|
|
class="print-plan-batch-push-dialog page-dialog"
|
|
|
:visible.sync="modalIsShow"
|
|
|
title="推送课程"
|
|
|
- width="800px"
|
|
|
+ width="600px"
|
|
|
:close-on-click-modal="false"
|
|
|
:close-on-press-escape="false"
|
|
|
append-to-body
|
|
|
@open="visibleChange"
|
|
|
>
|
|
|
- <div class="part-box part-box-filter part-box-flex">
|
|
|
- <el-form ref="modalFormComp" :model="modalForm" :rules="rules" inline>
|
|
|
- <el-form-item label="选择考试:">
|
|
|
- <el-select
|
|
|
- v-model="examType"
|
|
|
- placeholder="请选择"
|
|
|
- filterable
|
|
|
- style="width: 100%"
|
|
|
- @change="examTypeChange"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in examTypes"
|
|
|
- :key="item.code"
|
|
|
- :value="item.code"
|
|
|
- :label="item.name"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="thirdRelateId" v-if="examType === 'list'">
|
|
|
- <el-select
|
|
|
- v-model="modalForm.thirdRelateId"
|
|
|
- placeholder="请选择"
|
|
|
- filterable
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in thirdRelateExams"
|
|
|
- :key="index"
|
|
|
- :value="item.examId"
|
|
|
- :label="`${item.examId}-${item.examName}`"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <el-button type="primary" @click="refresh">刷新</el-button>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="thirdRelateName" v-if="examType === 'create'">
|
|
|
+ <div class="part-box part-box-pad">
|
|
|
+ <el-form
|
|
|
+ ref="modalFormComp"
|
|
|
+ :model="modalForm"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="90px"
|
|
|
+ >
|
|
|
+ <el-form-item prop="thirdRelateName" label="考试名称:">
|
|
|
<el-input
|
|
|
v-model="modalForm.thirdRelateName"
|
|
|
placeholder="请输入云阅卷考试名称"
|
|
|
- clearable
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="examTime" v-if="examType === 'create'">
|
|
|
+ <el-form-item prop="examTime" label="考试时间:">
|
|
|
<el-date-picker
|
|
|
v-model="modalForm.examTime"
|
|
|
type="datetime"
|
|
@@ -72,14 +43,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {
|
|
|
- printPlanSyncStmms,
|
|
|
- printPlanSyncRelateExamList,
|
|
|
- printPlanRelateExamList,
|
|
|
-} from "../api";
|
|
|
+import { printPlanSyncStmms } from "../api";
|
|
|
|
|
|
const initModalForm = {
|
|
|
- thirdRelateId: "",
|
|
|
thirdRelateName: "",
|
|
|
list: [],
|
|
|
examTime: null,
|
|
@@ -94,30 +60,13 @@ export default {
|
|
|
return [];
|
|
|
},
|
|
|
},
|
|
|
- orgCode: {
|
|
|
- type: [String, Number],
|
|
|
- default: "",
|
|
|
- },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
modalIsShow: false,
|
|
|
isSubmit: false,
|
|
|
modalForm: { ...initModalForm },
|
|
|
- examTypes: [
|
|
|
- { code: "create", name: "云阅卷创建新的考试" },
|
|
|
- { code: "list", name: "选择云阅卷存在考试" },
|
|
|
- ],
|
|
|
- examType: "list",
|
|
|
- thirdRelateExams: [],
|
|
|
rules: {
|
|
|
- thirdRelateId: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择云阅卷考试",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
thirdRelateName: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -143,23 +92,18 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
initData() {
|
|
|
- this.modalForm = { ...initModalForm };
|
|
|
- this.modalForm.list = this.courses;
|
|
|
+ this.modalForm = {
|
|
|
+ thirdRelateName: `${this.courses[0].semesterName}-${this.courses[0].examName}`,
|
|
|
+ list: this.courses,
|
|
|
+ examTime: Date.now(),
|
|
|
+ };
|
|
|
+
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.modalFormComp.clearValidate();
|
|
|
});
|
|
|
},
|
|
|
visibleChange() {
|
|
|
this.initData();
|
|
|
- this.getExams();
|
|
|
- },
|
|
|
- async getExams() {
|
|
|
- const data = await printPlanRelateExamList({ orgCode: this.orgCode });
|
|
|
- this.thirdRelateExams = data || [];
|
|
|
- },
|
|
|
- async refresh() {
|
|
|
- const data = await printPlanSyncRelateExamList({ orgCode: this.orgCode });
|
|
|
- this.thirdRelateExams = data || [];
|
|
|
},
|
|
|
cancel() {
|
|
|
this.modalIsShow = false;
|
|
@@ -167,9 +111,6 @@ export default {
|
|
|
open() {
|
|
|
this.modalIsShow = true;
|
|
|
},
|
|
|
- examTypeChange() {
|
|
|
- this.initData();
|
|
|
- },
|
|
|
async confirm() {
|
|
|
const valid = await this.$refs.modalFormComp.validate().catch(() => {});
|
|
|
if (!valid) return;
|