|
@@ -1,13 +1,15 @@
|
|
|
<template>
|
|
|
<div class="apply-content task-detail">
|
|
|
<div class="task-body">
|
|
|
- <div v-if="IS_APPLY" class="mb-2 text-right">
|
|
|
+ <div class="mb-4 tab-btns">
|
|
|
<el-button
|
|
|
- type="info"
|
|
|
- icon="el-icon-circle-plus-outline"
|
|
|
- @click="addAtachment"
|
|
|
- >增加卷型</el-button
|
|
|
- >
|
|
|
+ v-for="tab in tabs"
|
|
|
+ :key="tab.val"
|
|
|
+ size="medium"
|
|
|
+ :type="curTab == tab.val ? 'primary' : 'default'"
|
|
|
+ @click="selectMenu(tab.val)"
|
|
|
+ >{{ tab.name }}
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<table class="table mb-2">
|
|
|
<tr>
|
|
@@ -23,142 +25,230 @@
|
|
|
>(已曝光)</span
|
|
|
>
|
|
|
</td>
|
|
|
- <td>
|
|
|
- <el-button
|
|
|
- v-if="!attachment.isExposed && IS_APPLY"
|
|
|
- type="text"
|
|
|
- class="btn-primary"
|
|
|
- @click="toUpload(attachment)"
|
|
|
- >
|
|
|
- <i
|
|
|
- :class="[
|
|
|
- 'icon',
|
|
|
- attachment.attachmentId ? 'icon-files-act' : 'icon-files',
|
|
|
- ]"
|
|
|
- ></i
|
|
|
- >{{
|
|
|
- attachment.attachmentId
|
|
|
- ? attachment.filename
|
|
|
- : "点击上传试卷文件"
|
|
|
- }}
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-else
|
|
|
- type="text"
|
|
|
- class="btn-primary"
|
|
|
- @click="downloadPaper(attachment)"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="icon icon-download mr-1"
|
|
|
- v-if="attachment.attachmentId"
|
|
|
- ></i>
|
|
|
- <i
|
|
|
- :class="{
|
|
|
- 'color-primary': auditLogCache.paper[attachment.attachmentId],
|
|
|
- }"
|
|
|
- >{{ attachment.filename }}</i
|
|
|
+ <template v-if="IS_TIKU_TAB">
|
|
|
+ <td>
|
|
|
+ <el-button
|
|
|
+ v-if="!attachment.isExposed && IS_APPLY"
|
|
|
+ type="text"
|
|
|
+ class="btn-primary"
|
|
|
+ @click="toSelect(attachment)"
|
|
|
>
|
|
|
- </el-button>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <template v-if="IS_APPLY">
|
|
|
- <el-select
|
|
|
- class="mr-2"
|
|
|
- v-model="attachment.cardId"
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 200px"
|
|
|
- filterable
|
|
|
- @visible-change="
|
|
|
- (visible) => cardOptionOpened(visible, attachment)
|
|
|
- "
|
|
|
- @change="cardChange(attachment)"
|
|
|
+ <i
|
|
|
+ :class="[
|
|
|
+ 'icon',
|
|
|
+ attachment.attachmentId ? 'icon-files-act' : 'icon-files',
|
|
|
+ ]"
|
|
|
+ ></i
|
|
|
+ >{{ attachment.filename || "选择试卷" }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-else
|
|
|
+ type="text"
|
|
|
+ class="btn-primary"
|
|
|
+ @click="downloadPaper(attachment)"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in cards"
|
|
|
- :key="item.id"
|
|
|
- :value="item.id"
|
|
|
- :label="item.title"
|
|
|
- :disabled="item.disabled"
|
|
|
+ <i
|
|
|
+ class="icon icon-download mr-1"
|
|
|
+ v-if="attachment.attachmentId"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ :class="{
|
|
|
+ 'color-primary':
|
|
|
+ auditLogCache.paper[attachment.attachmentId],
|
|
|
+ }"
|
|
|
+ >{{ attachment.filename }}</i
|
|
|
>
|
|
|
- <span
|
|
|
- :class="[
|
|
|
- item.type === 'GENERIC'
|
|
|
- ? 'color-success'
|
|
|
- : 'color-primary',
|
|
|
- 'mr-1',
|
|
|
- {
|
|
|
- 'color-danger': item.used,
|
|
|
- },
|
|
|
- ]"
|
|
|
- >[{{ item.type === "GENERIC" ? "通" : "专" }}]</span
|
|
|
+ </el-button>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <template v-if="IS_APPLY">
|
|
|
+ <el-select
|
|
|
+ v-model="attachment.cardId"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 260px; margin-right: 10px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-if="attachment.cardId"
|
|
|
+ :value="attachment.cardId"
|
|
|
+ :label="attachment.cardTitle"
|
|
|
>
|
|
|
- {{ item.title }}
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <span
|
|
|
- v-if="attachment.cardId"
|
|
|
- :class="[
|
|
|
- attachment.cardType === 'GENERIC'
|
|
|
- ? 'color-success'
|
|
|
- : 'color-primary',
|
|
|
- 'mr-1',
|
|
|
- {
|
|
|
- 'color-danger': attachment.used,
|
|
|
- },
|
|
|
- ]"
|
|
|
- >[{{ attachment.cardType === "GENERIC" ? "通" : "专" }}]</span
|
|
|
- >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ :disabled="!attachment.cardId"
|
|
|
+ @click="toViewCard(attachment)"
|
|
|
+ >预览</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ :disabled="!attachment.cardId"
|
|
|
+ @click="toEditCard(attachment)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
<el-button
|
|
|
- class="btn-primary"
|
|
|
+ v-else
|
|
|
type="text"
|
|
|
- :disabled="!attachment.cardId"
|
|
|
+ class="btn-primary"
|
|
|
@click="toViewCard(attachment)"
|
|
|
- >预览</el-button
|
|
|
+ ><i
|
|
|
+ :class="{
|
|
|
+ 'color-primary': auditLogCache.card[attachment.cardId],
|
|
|
+ }"
|
|
|
+ >{{ attachment.cardTitle || "预览" }}</i
|
|
|
+ ></el-button
|
|
|
>
|
|
|
+ </td>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <td>
|
|
|
<el-button
|
|
|
- class="btn-primary"
|
|
|
+ v-if="!attachment.isExposed && IS_APPLY"
|
|
|
type="text"
|
|
|
- :disabled="
|
|
|
- !attachment.cardId ||
|
|
|
- (attachment.cardType === 'GENERIC' &&
|
|
|
- attachment.createMethod !== 'STANDARD')
|
|
|
- "
|
|
|
- @click="toCopyCard(attachment)"
|
|
|
- >复制</el-button
|
|
|
+ class="btn-primary"
|
|
|
+ @click="toUpload(attachment)"
|
|
|
>
|
|
|
+ <i
|
|
|
+ :class="[
|
|
|
+ 'icon',
|
|
|
+ attachment.attachmentId ? 'icon-files-act' : 'icon-files',
|
|
|
+ ]"
|
|
|
+ ></i
|
|
|
+ >{{
|
|
|
+ attachment.attachmentId
|
|
|
+ ? attachment.filename
|
|
|
+ : "点击上传试卷文件"
|
|
|
+ }}
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
- class="btn-primary"
|
|
|
+ v-else
|
|
|
type="text"
|
|
|
- :disabled="
|
|
|
- !attachment.cardId ||
|
|
|
- attachment.cardType === 'GENERIC' ||
|
|
|
- !(!attachment.used && attachment.createId === user.id)
|
|
|
- "
|
|
|
- @click="toEditCard(attachment)"
|
|
|
- >编辑</el-button
|
|
|
+ class="btn-primary"
|
|
|
+ @click="downloadPaper(attachment)"
|
|
|
>
|
|
|
+ <i
|
|
|
+ class="icon icon-download mr-1"
|
|
|
+ v-if="attachment.attachmentId"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ :class="{
|
|
|
+ 'color-primary':
|
|
|
+ auditLogCache.paper[attachment.attachmentId],
|
|
|
+ }"
|
|
|
+ >{{ attachment.filename }}</i
|
|
|
+ >
|
|
|
+ </el-button>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <template v-if="IS_APPLY">
|
|
|
+ <el-select
|
|
|
+ class="mr-2"
|
|
|
+ v-model="attachment.cardId"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 200px"
|
|
|
+ filterable
|
|
|
+ @visible-change="
|
|
|
+ (visible) => cardOptionOpened(visible, attachment)
|
|
|
+ "
|
|
|
+ @change="cardChange(attachment)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in cards"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.title"
|
|
|
+ :disabled="item.disabled"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ :class="[
|
|
|
+ item.type === 'GENERIC'
|
|
|
+ ? 'color-success'
|
|
|
+ : 'color-primary',
|
|
|
+ 'mr-1',
|
|
|
+ {
|
|
|
+ 'color-danger': item.used,
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ >[{{ item.type === "GENERIC" ? "通" : "专" }}]</span
|
|
|
+ >
|
|
|
+ {{ item.title }}
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <span
|
|
|
+ v-if="attachment.cardId"
|
|
|
+ :class="[
|
|
|
+ attachment.cardType === 'GENERIC'
|
|
|
+ ? 'color-success'
|
|
|
+ : 'color-primary',
|
|
|
+ 'mr-1',
|
|
|
+ {
|
|
|
+ 'color-danger': attachment.used,
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ >[{{ attachment.cardType === "GENERIC" ? "通" : "专" }}]</span
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ :disabled="!attachment.cardId"
|
|
|
+ @click="toViewCard(attachment)"
|
|
|
+ >预览</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ :disabled="
|
|
|
+ !attachment.cardId ||
|
|
|
+ (attachment.cardType === 'GENERIC' &&
|
|
|
+ attachment.createMethod !== 'STANDARD')
|
|
|
+ "
|
|
|
+ @click="toCopyCard(attachment)"
|
|
|
+ >复制</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ :disabled="
|
|
|
+ !attachment.cardId ||
|
|
|
+ attachment.cardType === 'GENERIC' ||
|
|
|
+ !(!attachment.used && attachment.createId === user.id)
|
|
|
+ "
|
|
|
+ @click="toEditCard(attachment)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ :disabled="!canCreateCard"
|
|
|
+ @click="toCreateCard(attachment)"
|
|
|
+ >新建</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
<el-button
|
|
|
- class="btn-primary"
|
|
|
+ v-else
|
|
|
type="text"
|
|
|
- :disabled="!canCreateCard"
|
|
|
- @click="toCreateCard(attachment)"
|
|
|
- >新建</el-button
|
|
|
+ class="btn-primary"
|
|
|
+ @click="toViewCard(attachment)"
|
|
|
+ ><i
|
|
|
+ :class="{
|
|
|
+ 'color-primary': auditLogCache.card[attachment.cardId],
|
|
|
+ }"
|
|
|
+ >{{ attachment.cardTitle || "预览" }}</i
|
|
|
+ ></el-button
|
|
|
>
|
|
|
- </template>
|
|
|
+ </td>
|
|
|
+ </template>
|
|
|
+ <td v-if="IS_APPLY" class="text-right">
|
|
|
<el-button
|
|
|
- v-else
|
|
|
+ v-if="index === paperAttachments.length - 1"
|
|
|
+ class="btn-primary btn-icon"
|
|
|
type="text"
|
|
|
- class="btn-primary"
|
|
|
- @click="toViewCard(attachment)"
|
|
|
- ><i
|
|
|
- :class="{
|
|
|
- 'color-primary': auditLogCache.card[attachment.cardId],
|
|
|
- }"
|
|
|
- >{{ attachment.cardTitle || "预览" }}</i
|
|
|
- ></el-button
|
|
|
- >
|
|
|
- </td>
|
|
|
- <td v-if="IS_APPLY">
|
|
|
+ icon="el-icon-circle-plus"
|
|
|
+ @click="addAtachment"
|
|
|
+ ></el-button>
|
|
|
<el-button
|
|
|
v-if="attachment.canDelete"
|
|
|
class="btn-danger"
|
|
@@ -531,11 +621,27 @@
|
|
|
></select-user-dialog>
|
|
|
<!-- ModifyCard -->
|
|
|
<modify-card ref="ModifyCard" @modified="cardModified"></modify-card>
|
|
|
+
|
|
|
+ <!-- SelectTikuPaperDialog -->
|
|
|
+ <select-tiku-paper-dialog
|
|
|
+ ref="SelectTikuPaperDialog"
|
|
|
+ :row="curAttachment"
|
|
|
+ @confirm="tikuPaperSelected"
|
|
|
+ ></select-tiku-paper-dialog>
|
|
|
+ <!-- CardBuildDialog -->
|
|
|
+ <card-build-dialog
|
|
|
+ ref="CardBuildDialog"
|
|
|
+ :presetData="cardBuildPresetData"
|
|
|
+ @confirm="cardBuildConfirm"
|
|
|
+ ></card-build-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import UploadPaperDialog from "./UploadPaperDialog";
|
|
|
+import SelectTikuPaperDialog from "./createExamAndPrintTask/SelectTikuPaperDialog.vue";
|
|
|
+import CardBuildDialog from "../../card/components/CardBuildDialog.vue";
|
|
|
+
|
|
|
import {
|
|
|
taskApplyDetail,
|
|
|
updateTaskApply,
|
|
@@ -597,6 +703,8 @@ export default {
|
|
|
SimpleImagePreview,
|
|
|
SelectUserDialog,
|
|
|
ModifyCard,
|
|
|
+ CardBuildDialog,
|
|
|
+ SelectTikuPaperDialog,
|
|
|
},
|
|
|
props: {
|
|
|
examTask: {
|
|
@@ -613,6 +721,17 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
isSubmit: false,
|
|
|
+ tabs: [
|
|
|
+ {
|
|
|
+ name: "上传本地试卷",
|
|
|
+ val: "upload",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "从题库选择试卷",
|
|
|
+ val: "tiku",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ curTab: "upload",
|
|
|
user: {},
|
|
|
curTaskApply: { ...initTaskApply },
|
|
|
paperConfirmAttachmentId: { attachmentId: "", filename: "", url: "" },
|
|
@@ -681,6 +800,8 @@ export default {
|
|
|
selectUserType: "exchange", // exchange:转审,approve:下一节点审核
|
|
|
curSelectedUsers: [],
|
|
|
auditLogCache: { paper: {}, card: {} },
|
|
|
+ // card-build
|
|
|
+ cardBuildPresetData: {},
|
|
|
// 选择下一节点审批人
|
|
|
IS_NEED_SELECT_APPROVE_USER: false,
|
|
|
nextFlowTaskResult: {}, //下一节点信息
|
|
@@ -712,6 +833,9 @@ export default {
|
|
|
FLOW_IS_OVER() {
|
|
|
return ["END", "FINISH"].includes(this.curTaskApply.flowStatus);
|
|
|
},
|
|
|
+ IS_TIKU_TAB() {
|
|
|
+ return this.curTab === "tiku";
|
|
|
+ },
|
|
|
maxFetchCount() {
|
|
|
return this.paperAttachments.length < 1
|
|
|
? 1
|
|
@@ -763,6 +887,14 @@ export default {
|
|
|
? JSON.parse(this.curTaskApply.paperAttachmentIds)
|
|
|
: [];
|
|
|
|
|
|
+ const pAttachment = this.paperAttachments.some((item) => !!item.paperId);
|
|
|
+ if (pAttachment) {
|
|
|
+ this.curTab = "tiku";
|
|
|
+ this.curTaskApply.uuid = pAttachment.uuid || this.$randomCode(32);
|
|
|
+ } else {
|
|
|
+ this.curTab = "upload";
|
|
|
+ }
|
|
|
+
|
|
|
const exposedPaperType = data.exposedPaperType || "";
|
|
|
let exposedPaperTypes = exposedPaperType.split(",");
|
|
|
exposedPaperTypes.sort((a, b) => (a > b ? -1 : 1));
|
|
@@ -800,6 +932,23 @@ export default {
|
|
|
|
|
|
// if (this.IS_AUDIT) this.getCurFlowNodeInfo();
|
|
|
},
|
|
|
+ async selectMenu(tab) {
|
|
|
+ if (!this.IS_APPLY) return;
|
|
|
+
|
|
|
+ const attachment = this.paperAttachments[0];
|
|
|
+ if (attachment.cardId || attachment.attachmentId) {
|
|
|
+ const result = await this.$confirm(
|
|
|
+ "更改类型会清空已设置数据,确定要更改类型?",
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ ).catch(() => {});
|
|
|
+ if (result !== "confirm") return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.curTab = tab;
|
|
|
+ },
|
|
|
async getCardList() {
|
|
|
if (!this.curTaskApply.courseCode || !this.curTaskApply.examId) return;
|
|
|
const data = await cardForSelectList({
|
|
@@ -908,6 +1057,8 @@ export default {
|
|
|
name,
|
|
|
attachmentId: "",
|
|
|
filename: "",
|
|
|
+ paperId: null,
|
|
|
+ uuid: null,
|
|
|
cardId: "",
|
|
|
cardType: "",
|
|
|
createMethod: "",
|
|
@@ -982,7 +1133,7 @@ export default {
|
|
|
attachment.cardId,
|
|
|
this.curTaskApply.courseCode
|
|
|
);
|
|
|
- this.cardModified(newCardId);
|
|
|
+ this.cardModified({ id: newCardId });
|
|
|
},
|
|
|
toEditCard(attachment) {
|
|
|
this.curAttachment = { ...attachment };
|
|
@@ -998,10 +1149,20 @@ export default {
|
|
|
});
|
|
|
this.$refs.ModifyCard.open();
|
|
|
},
|
|
|
- async cardModified(cardId) {
|
|
|
- if (!cardId) return;
|
|
|
+ async cardModified(data) {
|
|
|
+ // data: {id,title}
|
|
|
+ if (!data.id) return;
|
|
|
+
|
|
|
+ if (this.IS_TIKU_TAB) {
|
|
|
+ const aind = this.paperAttachments.findIndex(
|
|
|
+ (item) => item.name === this.curAttachment.name
|
|
|
+ );
|
|
|
+ this.paperAttachments[aind].cardTitle = card.title;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
await this.getCardList();
|
|
|
- let card = this.cards.find((item) => item.id === cardId);
|
|
|
+ let card = this.cards.find((item) => item.id === data.id);
|
|
|
|
|
|
const aind = this.paperAttachments.findIndex(
|
|
|
(item) => item.name === this.curAttachment.name
|
|
@@ -1121,48 +1282,45 @@ export default {
|
|
|
return data;
|
|
|
},
|
|
|
checkDataValid() {
|
|
|
- // 设置了入库强制包含试卷时,校验试卷是否上传。
|
|
|
- // 未设置入库强制包含试卷时,若有试卷上传,则需要上传全部。若无试卷上传,则通过。
|
|
|
- if (this.curTaskApply.includePaper) {
|
|
|
+ if (this.IS_TIKU_TAB) {
|
|
|
const attachmentValid = !this.paperAttachments.some(
|
|
|
- (item) => !item.attachmentId
|
|
|
+ (item) => !item.cardId
|
|
|
);
|
|
|
if (!attachmentValid) {
|
|
|
- this.$message.error("请完成试卷文件上传!");
|
|
|
+ this.$message.error("请完成试卷选择!");
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
- const hasUploadPaperAttachments = this.paperAttachments.filter(
|
|
|
- (item) => item.attachmentId
|
|
|
- );
|
|
|
- if (
|
|
|
- hasUploadPaperAttachments.length > 0 &&
|
|
|
- hasUploadPaperAttachments.length !== this.paperAttachments.length
|
|
|
- ) {
|
|
|
- this.$message.error("有试卷文件未完成上传!");
|
|
|
- return;
|
|
|
+ // 设置了入库强制包含试卷时,校验试卷是否上传。
|
|
|
+ // 未设置入库强制包含试卷时,若有试卷上传,则需要上传全部。若无试卷上传,则通过。
|
|
|
+ if (this.curTaskApply.includePaper) {
|
|
|
+ const attachmentValid = !this.paperAttachments.some(
|
|
|
+ (item) => !item.attachmentId
|
|
|
+ );
|
|
|
+ if (!attachmentValid) {
|
|
|
+ this.$message.error("请完成试卷文件上传!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const hasUploadPaperAttachments = this.paperAttachments.filter(
|
|
|
+ (item) => item.attachmentId
|
|
|
+ );
|
|
|
+ if (
|
|
|
+ hasUploadPaperAttachments.length > 0 &&
|
|
|
+ hasUploadPaperAttachments.length !== this.paperAttachments.length
|
|
|
+ ) {
|
|
|
+ this.$message.error("有试卷文件未完成上传!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- // if (!this.paperConfirmAttachments.length) {
|
|
|
- // this.$message.error("请上传附件!");
|
|
|
- // return;
|
|
|
- // }
|
|
|
|
|
|
- let cardValid = !this.paperAttachments.some((item) => !item.cardId);
|
|
|
- if (!cardValid) {
|
|
|
- this.$message.error("有试卷类型未选择题卡!");
|
|
|
- return;
|
|
|
+ const cardValid = !this.paperAttachments.some((item) => !item.cardId);
|
|
|
+ if (!cardValid) {
|
|
|
+ this.$message.error("有试卷类型未选择题卡!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- // const usedCards = this.paperAttachments
|
|
|
- // .filter((item) => item.cardId && item.used)
|
|
|
- // .map((item) => item.name);
|
|
|
- // if (usedCards.length) {
|
|
|
- // this.$message.error(`${usedCards.join()}卷选择的题卡已经被使用过!`);
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
if (this.IS_NEED_SELECT_APPROVE_USER && !this.approveUsers.length) {
|
|
|
this.$message.error("请设置审核人员!");
|
|
|
return;
|
|
@@ -1170,6 +1328,54 @@ export default {
|
|
|
|
|
|
return true;
|
|
|
},
|
|
|
+ // select-paper
|
|
|
+ toSelect(attachment) {
|
|
|
+ this.curAttachment = {
|
|
|
+ ...attachment,
|
|
|
+ courseCode: this.examTask.courseCode,
|
|
|
+ };
|
|
|
+ this.$refs.SelectTikuPaperDialog.open();
|
|
|
+ },
|
|
|
+ async tikuPaperSelected(data) {
|
|
|
+ this.cardBuildPresetData = {
|
|
|
+ examId: this.examTask.examId,
|
|
|
+ courseCode: this.examTask.courseCode,
|
|
|
+ courseName: this.examTask.courseName,
|
|
|
+ schoolName: this.$ls.get("schoolName"),
|
|
|
+ makeMethod: "SELF",
|
|
|
+ cardName: "",
|
|
|
+ cardRuleId: this.examTask.cardRuleId,
|
|
|
+ type: "CUSTOM",
|
|
|
+ createMethod: "STANDARD",
|
|
|
+ paperId: data.id,
|
|
|
+ paperName: data.name,
|
|
|
+ uuid: this.curTaskApply.uuid,
|
|
|
+ };
|
|
|
+ this.$refs.CardBuildDialog.open();
|
|
|
+ },
|
|
|
+ cardBuildConfirm(data) {
|
|
|
+ if (!data.success) {
|
|
|
+ this.$message.error(data.message);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const ind = this.paperAttachments.findIndex(
|
|
|
+ (item) => item.name === this.curAttachment.name
|
|
|
+ );
|
|
|
+ if (ind === -1) return;
|
|
|
+
|
|
|
+ const info = data.data;
|
|
|
+ this.curAttachment = { ...this.paperAttachments[ind] };
|
|
|
+ this.paperAttachments[ind] = Object.assign(this.paperAttachments[ind], {
|
|
|
+ paperId: this.cardBuildPresetData.paperId,
|
|
|
+ cardType: this.cardBuildPresetData.type,
|
|
|
+ createMethod: this.cardBuildPresetData.createMethod,
|
|
|
+ filename: this.cardBuildPresetData.paperName,
|
|
|
+ cardId: info.id,
|
|
|
+ cardTitle: info.title,
|
|
|
+ uuid: info.uuid,
|
|
|
+ attachmentId: info.attachmentId,
|
|
|
+ });
|
|
|
+ },
|
|
|
async toSave() {
|
|
|
if (this.isSubmit) return;
|
|
|
this.isSubmit = true;
|