|
@@ -2,9 +2,9 @@
|
|
|
<el-dialog
|
|
|
class="create-task-apply"
|
|
|
:visible.sync="modalIsShow"
|
|
|
- :title="title"
|
|
|
+ title="新增命题申请"
|
|
|
top="10px"
|
|
|
- width="900px"
|
|
|
+ width="1000px"
|
|
|
:close-on-click-modal="false"
|
|
|
:close-on-press-escape="false"
|
|
|
append-to-body
|
|
@@ -15,7 +15,7 @@
|
|
|
ref="examTaskComp"
|
|
|
:model="examTask"
|
|
|
:rules="rules"
|
|
|
- label-width="100px"
|
|
|
+ label-width="120px"
|
|
|
>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
@@ -30,7 +30,7 @@
|
|
|
<el-form-item prop="courseCode" label="课程(代码):">
|
|
|
<course-select
|
|
|
v-model="examTask.courseCode"
|
|
|
- @change="clearCard"
|
|
|
+ @change="courseChange"
|
|
|
></course-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -71,10 +71,10 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="主讲教师/电话:">
|
|
|
+ <el-form-item label="主讲教师:">
|
|
|
<el-input
|
|
|
v-model.trim="examTask.lecturerName"
|
|
|
- placeholder="请输入主讲教师/电话"
|
|
|
+ placeholder="请输入主讲教师"
|
|
|
clearable
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
@@ -83,18 +83,6 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
|
|
|
- <div class="mb-4">
|
|
|
- <el-steps align-center>
|
|
|
- <el-step
|
|
|
- v-for="(step, index) in steps"
|
|
|
- :key="index"
|
|
|
- :title="step.title"
|
|
|
- :description="step.desc"
|
|
|
- :status="step.status"
|
|
|
- ></el-step>
|
|
|
- </el-steps>
|
|
|
- </div>
|
|
|
-
|
|
|
<div
|
|
|
class="part-box part-box-pad part-box-border apply-content task-detail"
|
|
|
v-if="modalIsShow"
|
|
@@ -136,7 +124,9 @@
|
|
|
}}
|
|
|
</span>
|
|
|
</td>
|
|
|
- <td>{{ createCardTypeName }}</td>
|
|
|
+ <td :rowspan="paperAttachments.length" v-if="index === 0">
|
|
|
+ {{ createCardTypeName }}
|
|
|
+ </td>
|
|
|
<td
|
|
|
class="td-link"
|
|
|
:rowspan="paperAttachments.length"
|
|
@@ -165,16 +155,18 @@
|
|
|
</tr>
|
|
|
</table>
|
|
|
|
|
|
- <el-form-item label="单次抽卷卷型数量:" label-width="150">
|
|
|
- <el-input-number
|
|
|
- v-model="examTaskDetail.drawCount"
|
|
|
- :min="1"
|
|
|
- :max="maxFetchCount"
|
|
|
- :step="1"
|
|
|
- step-strictly
|
|
|
- :controls="false"
|
|
|
- ></el-input-number>
|
|
|
- </el-form-item>
|
|
|
+ <el-form>
|
|
|
+ <el-form-item label="单次抽卷卷型数量:" label-width="150">
|
|
|
+ <el-input-number
|
|
|
+ v-model="examTaskDetail.drawCount"
|
|
|
+ :min="1"
|
|
|
+ :max="maxFetchCount"
|
|
|
+ :step="1"
|
|
|
+ step-strictly
|
|
|
+ :controls="false"
|
|
|
+ ></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
|
|
|
<h4 class="mb-2">备注说明:</h4>
|
|
|
<el-input
|
|
@@ -187,7 +179,6 @@
|
|
|
clearable
|
|
|
show-word-limit
|
|
|
placeholder="建议不超过100个字"
|
|
|
- :disabled="!IS_APPLY"
|
|
|
></el-input>
|
|
|
|
|
|
<h4 class="mb-2">上传入库审核表(最多4张)</h4>
|
|
@@ -211,7 +202,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div
|
|
|
- v-if="paperConfirmAttachments.length < 4 && IS_APPLY"
|
|
|
+ v-if="paperConfirmAttachments.length < 4"
|
|
|
class="image-item image-add"
|
|
|
title="上传入库审核表"
|
|
|
@click="toUploadPaperConfirm"
|
|
@@ -219,22 +210,6 @@
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- audit -->
|
|
|
- <h4 v-if="IS_AUDIT" class="mb-2">审核意见:</h4>
|
|
|
- <el-input
|
|
|
- v-if="IS_AUDIT"
|
|
|
- class="mb-2"
|
|
|
- v-model="reason"
|
|
|
- type="textarea"
|
|
|
- resize="none"
|
|
|
- :rows="5"
|
|
|
- :maxlength="1000"
|
|
|
- clearable
|
|
|
- show-word-limit
|
|
|
- placeholder="建议不超过1000个字"
|
|
|
- ref="ReasonInput"
|
|
|
- ></el-input>
|
|
|
</div>
|
|
|
<div class="task-action">
|
|
|
<el-button type="primary" :disabled="isSubmit" @click="submit"
|
|
@@ -247,20 +222,6 @@
|
|
|
@click="toSave"
|
|
|
>暂存</el-button
|
|
|
>
|
|
|
- <el-button
|
|
|
- v-if="IS_AUDIT"
|
|
|
- type="primary"
|
|
|
- :disabled="isSubmit"
|
|
|
- @click="toAuditApply('PASS')"
|
|
|
- >通过</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- v-if="IS_AUDIT"
|
|
|
- type="danger"
|
|
|
- plain
|
|
|
- @click="toAuditApply('NOT_PASS')"
|
|
|
- >不通过</el-button
|
|
|
- >
|
|
|
<el-button type="danger" @click="cancel" plain>取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -278,7 +239,6 @@
|
|
|
ref="CardOptionDialog"
|
|
|
:data="task"
|
|
|
@upload-sample-over="initData"
|
|
|
- @draft-task="silentSave"
|
|
|
@confirm="cardConfirm"
|
|
|
></card-option-dialog>
|
|
|
<!-- image-preview -->
|
|
@@ -293,7 +253,11 @@
|
|
|
|
|
|
<script>
|
|
|
import { examRuleDetail } from "../../base/api";
|
|
|
-import { teacherCreateTaskApply, switchCardCreateMethod } from "../api";
|
|
|
+import {
|
|
|
+ teacherCreateTaskApply,
|
|
|
+ teacherCancelTaskApply,
|
|
|
+ switchCardCreateMethod
|
|
|
+} from "../api";
|
|
|
import UploadPaperDialog from "./UploadPaperDialog";
|
|
|
import CardOptionDialog from "./CardOptionDialog";
|
|
|
import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
@@ -311,7 +275,7 @@ const initExamTask = {
|
|
|
};
|
|
|
|
|
|
const initExamTaskDetail = {
|
|
|
- operateType: "",
|
|
|
+ operateType: "STAGE",
|
|
|
paperType: "A",
|
|
|
cardId: "",
|
|
|
paperAttachmentIds: [],
|
|
@@ -327,68 +291,16 @@ const initExamTaskDetail = {
|
|
|
customCard: false
|
|
|
};
|
|
|
|
|
|
-const STEPS = [
|
|
|
- {
|
|
|
- title: "提交申请",
|
|
|
- status: {
|
|
|
- wait: {
|
|
|
- desc: "待进行",
|
|
|
- range: []
|
|
|
- },
|
|
|
- process: {
|
|
|
- desc: "进行中",
|
|
|
- range: ["NEW", "READY", "STAGE"]
|
|
|
- },
|
|
|
- success: {
|
|
|
- desc: "已完成",
|
|
|
- range: ["SUBMIT", "FINISH"]
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: "审核",
|
|
|
- status: {
|
|
|
- wait: {
|
|
|
- desc: "待进行",
|
|
|
- range: ["NEW", "READY", "STAGE"]
|
|
|
- },
|
|
|
- process: {
|
|
|
- desc: "进行中",
|
|
|
- range: ["SUBMIT"]
|
|
|
- },
|
|
|
- success: {
|
|
|
- desc: "已完成",
|
|
|
- range: ["FINISH"]
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: "入库",
|
|
|
- status: {
|
|
|
- wait: {
|
|
|
- desc: "待进行",
|
|
|
- range: ["NEW", "READY", "STAGE", "SUBMIT"]
|
|
|
- },
|
|
|
- process: {
|
|
|
- desc: "进行中",
|
|
|
- range: []
|
|
|
- },
|
|
|
- success: {
|
|
|
- desc: "已完成",
|
|
|
- range: ["FINISH"]
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-];
|
|
|
-
|
|
|
export default {
|
|
|
name: "create-task-apply",
|
|
|
components: { UploadPaperDialog, CardOptionDialog, SimpleImagePreview },
|
|
|
data() {
|
|
|
return {
|
|
|
modalIsShow: false,
|
|
|
+ isSubmit: false,
|
|
|
examTask: {},
|
|
|
needReview: false,
|
|
|
+ task: {},
|
|
|
examRule: {},
|
|
|
steps: [],
|
|
|
actStep: "",
|
|
@@ -432,21 +344,21 @@ export default {
|
|
|
computed: {
|
|
|
cardTodoName() {
|
|
|
let name = "创建答题卡";
|
|
|
- if (this.curTaskApply.cardId) {
|
|
|
- if (this.curTaskApply.makeMethod === "SELECT") {
|
|
|
+ if (this.examTaskDetail.cardId) {
|
|
|
+ if (this.examTaskDetail.makeMethod === "SELECT") {
|
|
|
name = "选择题卡";
|
|
|
- } else if (this.curTaskApply.makeMethod === "SELF") {
|
|
|
+ } else if (this.examTaskDetail.makeMethod === "SELF") {
|
|
|
name = "编辑题卡";
|
|
|
} else {
|
|
|
// 已经审核的题卡可以自行编辑,未审核的题卡只能查看
|
|
|
name =
|
|
|
- this.curTaskApply.status === "SUBMIT" ? "编辑题卡" : "查看题卡";
|
|
|
+ this.examTaskDetail.status === "SUBMIT" ? "编辑题卡" : "查看题卡";
|
|
|
}
|
|
|
}
|
|
|
return name;
|
|
|
},
|
|
|
createCardTypeName() {
|
|
|
- return CARD_SOURCE_TYPE[this.curTaskApply.makeMethod] || "";
|
|
|
+ return CARD_SOURCE_TYPE[this.examTaskDetail.makeMethod] || "";
|
|
|
},
|
|
|
maxFetchCount() {
|
|
|
return this.paperAttachments.length < 1
|
|
@@ -466,24 +378,9 @@ export default {
|
|
|
initData() {
|
|
|
this.examTask = { ...initExamTask };
|
|
|
this.examTaskDetail = { ...initExamTaskDetail };
|
|
|
- // this.buildSteps();
|
|
|
- },
|
|
|
- buildSteps() {
|
|
|
- // TODO:
|
|
|
- const curStatus = "";
|
|
|
- // 构建steps
|
|
|
- const stepList = this.needReview ? STEPS : [STEPS[0], STEPS[2]];
|
|
|
- this.steps = stepList.map(step => {
|
|
|
- const validStepStatus = Object.keys(step.status).find(key =>
|
|
|
- step.status[key].range.includes(curStatus)
|
|
|
- );
|
|
|
-
|
|
|
- return {
|
|
|
- title: step.title,
|
|
|
- status: validStepStatus,
|
|
|
- desc: step.status[validStepStatus].desc
|
|
|
- };
|
|
|
- });
|
|
|
+ this.examTaskDetail.includePaper = this.examRule.includePaper;
|
|
|
+ this.examTaskDetail.review = this.examRule.review;
|
|
|
+ this.examTaskDetail.customCard = this.examRule.customCard;
|
|
|
},
|
|
|
visibleChange() {
|
|
|
this.initData();
|
|
@@ -491,7 +388,14 @@ export default {
|
|
|
checkData() {
|
|
|
return this.$refs.examTaskComp.validate().catch(() => {});
|
|
|
},
|
|
|
- cancel() {
|
|
|
+ async cancel() {
|
|
|
+ if (this.examTask.id) {
|
|
|
+ await teacherCancelTaskApply(this.examTask.id);
|
|
|
+ this.$message.success("取消命题申请成功!");
|
|
|
+ }
|
|
|
+ this.close();
|
|
|
+ },
|
|
|
+ close() {
|
|
|
this.modalIsShow = false;
|
|
|
},
|
|
|
open() {
|
|
@@ -568,7 +472,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
cachePrepareTcpCard() {
|
|
|
- // TODO:
|
|
|
this.$ls.set("prepareTcPCard", {
|
|
|
examTaskId: this.examTask.id,
|
|
|
courseCode: this.examTask.courseCode,
|
|
@@ -579,8 +482,13 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async toCreateOrViewCard() {
|
|
|
- await this.toSave();
|
|
|
- this.task = this.getTaskDetailData();
|
|
|
+ const result = await this.toSave(1);
|
|
|
+ if (!result) return;
|
|
|
+ this.task = {
|
|
|
+ ...this.examTask,
|
|
|
+ ...this.examTaskDetail,
|
|
|
+ examTaskId: this.examTask.id
|
|
|
+ };
|
|
|
if (!this.examTaskDetail.cardId) {
|
|
|
this.$refs.CardOptionDialog.open();
|
|
|
return;
|
|
@@ -604,7 +512,7 @@ export default {
|
|
|
},
|
|
|
async changeCreateCardType() {
|
|
|
const h = this.$createElement;
|
|
|
- const result = await this.$confirm({
|
|
|
+ const result = await this.$msgbox({
|
|
|
title: "切换题卡操作说明",
|
|
|
message: h("div", null, [
|
|
|
h("p", null, "1、切换题卡会将之前选择题卡数据删除。"),
|
|
@@ -614,21 +522,28 @@ export default {
|
|
|
"2、之前选择专卡进行绘制,切换题卡后再次选择专卡,需要重新开始绘制。"
|
|
|
)
|
|
|
]),
|
|
|
+ showCancelButton: true,
|
|
|
cancelButtonClass: "el-button--danger is-plain",
|
|
|
confirmButtonClass: "el-button--primary",
|
|
|
type: "warning"
|
|
|
}).catch(() => {});
|
|
|
if (result !== "confirm") return;
|
|
|
- this.clearMakeMethod();
|
|
|
+
|
|
|
+ await this.clearMakeMethod();
|
|
|
this.toCreateOrViewCard();
|
|
|
},
|
|
|
async clearMakeMethod() {
|
|
|
// 清除后台记录的题卡
|
|
|
- if (this.examTask.id) await switchCardCreateMethod(this.examTask.id);
|
|
|
+ if (this.examTask.id && this.examTaskDetail.cardId)
|
|
|
+ await switchCardCreateMethod(this.examTask.id);
|
|
|
|
|
|
this.examTaskDetail.makeMethod = "";
|
|
|
this.examTaskDetail.cardId = "";
|
|
|
},
|
|
|
+ courseChange(val) {
|
|
|
+ this.examTask.courseName = val.name;
|
|
|
+ this.clearCard();
|
|
|
+ },
|
|
|
clearCard() {
|
|
|
this.clearMakeMethod();
|
|
|
},
|
|
@@ -641,7 +556,7 @@ export default {
|
|
|
data.paperConfirmAttachmentIds = JSON.stringify(
|
|
|
this.paperConfirmAttachments
|
|
|
);
|
|
|
- return data;
|
|
|
+ this.examTaskDetail = data;
|
|
|
},
|
|
|
checkDataValid() {
|
|
|
const attachmentValid = !this.paperAttachments.some(
|
|
@@ -671,23 +586,25 @@ export default {
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
- async toSave() {
|
|
|
+ async toSave(silent) {
|
|
|
const valid = await this.$refs.examTaskComp.validate().catch(() => {});
|
|
|
if (!valid) return;
|
|
|
|
|
|
if (this.isSubmit) return;
|
|
|
this.isSubmit = true;
|
|
|
- const examTaskDetail = this.getTaskDetailData();
|
|
|
- examTaskDetail.operateType = "STAGE";
|
|
|
+ this.getTaskDetailData();
|
|
|
const datas = {
|
|
|
- examTaskDetail,
|
|
|
+ examTaskDetail: this.examTaskDetail,
|
|
|
examTask: this.examTask
|
|
|
};
|
|
|
const data = await teacherCreateTaskApply(datas).catch(() => {});
|
|
|
this.isSubmit = false;
|
|
|
if (!data) return;
|
|
|
|
|
|
- this.$message.success("保存成功!");
|
|
|
+ this.examTask.id = data;
|
|
|
+
|
|
|
+ if (!silent) this.$message.success("保存成功!");
|
|
|
+ return true;
|
|
|
},
|
|
|
async submit() {
|
|
|
const valid = await this.$refs.examTaskComp.validate().catch(() => {});
|
|
@@ -705,17 +622,17 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
.then(async () => {
|
|
|
- const examTaskDetail = this.getTaskDetailData();
|
|
|
- examTaskDetail.operateType = "SUBMIT";
|
|
|
+ this.getTaskDetailData();
|
|
|
+ this.examTaskDetail.operateType = "SUBMIT";
|
|
|
const datas = {
|
|
|
- examTaskDetail,
|
|
|
+ examTaskDetail: this.examTaskDetail,
|
|
|
examTask: this.examTask
|
|
|
};
|
|
|
const data = await teacherCreateTaskApply(datas).catch(() => {});
|
|
|
|
|
|
if (!data) return;
|
|
|
this.$message.success("提交成功!");
|
|
|
- this.cancel();
|
|
|
+ this.close();
|
|
|
this.$emit("modified");
|
|
|
})
|
|
|
.catch(() => {});
|