|
@@ -3,48 +3,51 @@
|
|
|
:visible.sync="modalIsShow"
|
|
|
title="同步成绩"
|
|
|
top="10vh"
|
|
|
- width="500px"
|
|
|
+ width="600px"
|
|
|
:close-on-click-modal="false"
|
|
|
:close-on-press-escape="false"
|
|
|
append-to-body
|
|
|
@open="visibleChange"
|
|
|
>
|
|
|
- <el-form ref="modalFormComp" :model="modalForm" label-width="60px">
|
|
|
- <el-form-item
|
|
|
- prop="paperNumber"
|
|
|
- label="试卷:"
|
|
|
- :rules="{
|
|
|
- required: true,
|
|
|
- message: '请选择试卷',
|
|
|
- trigger: 'change',
|
|
|
- }"
|
|
|
- >
|
|
|
- <el-select
|
|
|
- v-model="modalForm.paperNumber"
|
|
|
- placeholder="选择试卷"
|
|
|
- clearable
|
|
|
- class="width-full"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="paper in papers"
|
|
|
- :key="paper.paperNumber"
|
|
|
- :value="paper.paperNumber"
|
|
|
- :label="paper.paperNumber"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-form ref="FilterForm" label-position="left" inline label-width="0px">
|
|
|
+ <el-form-item>
|
|
|
+ <exam-select
|
|
|
+ v-model="filter.examId"
|
|
|
+ :semester-id="filter.semesterId"
|
|
|
+ placeholder="考试"
|
|
|
+ :clearable="false"
|
|
|
+ ></exam-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="getList">查询</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <div slot="footer">
|
|
|
- <el-button type="primary" :disabled="isSubmit" @click="submit"
|
|
|
- >确认</el-button
|
|
|
- >
|
|
|
- <el-button @click="cancel">取消</el-button>
|
|
|
- </div>
|
|
|
+
|
|
|
+ <el-table ref="TableList" :data="dataList">
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="序号"
|
|
|
+ width="70"
|
|
|
+ :index="indexMethod"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="paperNumber" label="试卷编号"> </el-table-column>
|
|
|
+ <el-table-column class-name="action-column" label="操作" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button class="btn-primary" type="text" @click="toSync(scope.row)"
|
|
|
+ >同步</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <div slot="footer"></div>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { endScoreSyncPaperList, endScoreSync } from "../../api";
|
|
|
+const initFilter = { semesterId: "", examId: "", courseId: "" };
|
|
|
|
|
|
export default {
|
|
|
name: "SyncPaperDialog",
|
|
@@ -59,20 +62,18 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
modalIsShow: false,
|
|
|
- isSubmit: false,
|
|
|
- modalForm: { paperNumber: "" },
|
|
|
- papers: [],
|
|
|
+ loading: false,
|
|
|
+ filter: { ...initFilter },
|
|
|
+ dataList: [],
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- async getPapers() {
|
|
|
- if (this.papers.length) return;
|
|
|
- const res = await endScoreSyncPaperList(this.course);
|
|
|
- this.papers = res || [];
|
|
|
+ async getList() {
|
|
|
+ const res = await endScoreSyncPaperList(this.filter);
|
|
|
+ this.dataList = res || [];
|
|
|
},
|
|
|
visibleChange() {
|
|
|
- this.getPapers();
|
|
|
- this.modalForm = { paperNumber: "" };
|
|
|
+ this.filter = this.$objAssign(initFilter, this.course);
|
|
|
},
|
|
|
cancel() {
|
|
|
this.modalIsShow = false;
|
|
@@ -80,20 +81,17 @@ export default {
|
|
|
open() {
|
|
|
this.modalIsShow = true;
|
|
|
},
|
|
|
- async submit() {
|
|
|
- const valid = await this.$refs.modalFormComp.validate().catch(() => {});
|
|
|
- if (!valid) return;
|
|
|
-
|
|
|
- if (this.isSubmit) return;
|
|
|
- this.isSubmit = true;
|
|
|
+ async toSync(row) {
|
|
|
+ if (this.loading) return;
|
|
|
+ this.loading = true;
|
|
|
|
|
|
const datas = {
|
|
|
cultureProgramId: this.course.cultureProgramId,
|
|
|
courseId: this.course.courseId,
|
|
|
- paperNumber: this.modalForm.paperNumber,
|
|
|
+ paperNumber: row.paperNumber,
|
|
|
};
|
|
|
const res = await endScoreSync(datas).catch(() => {});
|
|
|
- this.isSubmit = false;
|
|
|
+ this.loading = false;
|
|
|
|
|
|
if (!res) return;
|
|
|
|