|
@@ -26,7 +26,7 @@
|
|
<tr v-for="(attachment, index) in curPaperAttachments" :key="index">
|
|
<tr v-for="(attachment, index) in curPaperAttachments" :key="index">
|
|
<td>{{ attachment.name }}卷</td>
|
|
<td>{{ attachment.name }}卷</td>
|
|
<td class="td-link" v-if="task.examPaper">
|
|
<td class="td-link" v-if="task.examPaper">
|
|
- <span @click="toUpload(attachment, 'paper')" title="点击上传试卷">
|
|
|
|
|
|
+ <span @click="toUpload(attachment)" title="点击上传试卷">
|
|
<i
|
|
<i
|
|
:class="[
|
|
:class="[
|
|
'icon',
|
|
'icon',
|
|
@@ -40,22 +40,23 @@
|
|
}}
|
|
}}
|
|
</span>
|
|
</span>
|
|
</td>
|
|
</td>
|
|
- <td class="td-link" v-if="task.examPaper">
|
|
|
|
- <span
|
|
|
|
- @click="toUpload(attachment, 'paperConfirm')"
|
|
|
|
- title="点击上传确认书文件"
|
|
|
|
- >
|
|
|
|
|
|
+ <td
|
|
|
|
+ class="td-link"
|
|
|
|
+ :rowspan="pTypeEnable ? curPaperAttachments.length : 1"
|
|
|
|
+ v-if="index === 0 && task.examPaper"
|
|
|
|
+ >
|
|
|
|
+ <span @click="toUploadPaperConfirm" title="点击上传确认书文件">
|
|
<i
|
|
<i
|
|
:class="[
|
|
:class="[
|
|
'icon',
|
|
'icon',
|
|
- attachment.paperConfirmAttachmentId
|
|
|
|
|
|
+ paperConfirmAttachmentId.attachmentId
|
|
? 'icon-files-act'
|
|
? 'icon-files-act'
|
|
: 'icon-files'
|
|
: 'icon-files'
|
|
]"
|
|
]"
|
|
></i
|
|
></i
|
|
>{{
|
|
>{{
|
|
- attachment.paperConfirmAttachmentId
|
|
|
|
- ? attachment.paperConfirmFilename
|
|
|
|
|
|
+ paperConfirmAttachmentId.attachmentId
|
|
|
|
+ ? paperConfirmAttachmentId.filename
|
|
: "点击上传确认书文件"
|
|
: "点击上传确认书文件"
|
|
}}
|
|
}}
|
|
</span>
|
|
</span>
|
|
@@ -92,10 +93,19 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="task-action">
|
|
<div class="task-action">
|
|
- <el-button type="primary" style="width:105px;" @click="toSubmit"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ style="width:105px;"
|
|
|
|
+ @click="toSubmit"
|
|
|
|
+ :disabled="!curPaperAttachments.length"
|
|
>确认提交</el-button
|
|
>确认提交</el-button
|
|
>
|
|
>
|
|
- <el-button style="width:88px;" @click="toSave">暂存</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ style="width:88px;"
|
|
|
|
+ @click="toSave"
|
|
|
|
+ :disabled="!curPaperAttachments.length"
|
|
|
|
+ >暂存</el-button
|
|
|
|
+ >
|
|
<el-button @click="goback" style="width:88px;">取消</el-button>
|
|
<el-button @click="goback" style="width:88px;">取消</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -173,6 +183,7 @@ export default {
|
|
auditStatus: 0,
|
|
auditStatus: 0,
|
|
remark: ""
|
|
remark: ""
|
|
},
|
|
},
|
|
|
|
+ paperConfirmAttachmentId: { attachmentId: "", filename: "" },
|
|
paperAttachments: [],
|
|
paperAttachments: [],
|
|
curPaperAttachments: [],
|
|
curPaperAttachments: [],
|
|
curAttachment: {},
|
|
curAttachment: {},
|
|
@@ -224,10 +235,13 @@ export default {
|
|
|
|
|
|
const paperAttachment =
|
|
const paperAttachment =
|
|
this.task.paperAttachmentId && JSON.parse(this.task.paperAttachmentId);
|
|
this.task.paperAttachmentId && JSON.parse(this.task.paperAttachmentId);
|
|
- this.paperAttachments = paperAttachment && paperAttachment.paper;
|
|
|
|
|
|
+ this.paperAttachments = paperAttachment ? paperAttachment.paper : [];
|
|
this.curPaperAttachments = this.paperAttachments.map(item => {
|
|
this.curPaperAttachments = this.paperAttachments.map(item => {
|
|
return { ...item };
|
|
return { ...item };
|
|
});
|
|
});
|
|
|
|
+ this.paperConfirmAttachmentId = this.task.paperConfirmAttachmentId
|
|
|
|
+ ? JSON.parse(this.task.paperConfirmAttachmentId)
|
|
|
|
+ : { attachmentId: "", filename: "" };
|
|
this.task.enablePaperType = this.getEnablePaperType();
|
|
this.task.enablePaperType = this.getEnablePaperType();
|
|
|
|
|
|
if (this.task.review && this.task.auditStatus === 2)
|
|
if (this.task.review && this.task.auditStatus === 2)
|
|
@@ -242,9 +256,7 @@ export default {
|
|
const newAttachment = {
|
|
const newAttachment = {
|
|
name: this.abc[this.curPaperAttachments.length],
|
|
name: this.abc[this.curPaperAttachments.length],
|
|
attachmentId: "",
|
|
attachmentId: "",
|
|
- filename: "",
|
|
|
|
- paperConfirmAttachmentId: "",
|
|
|
|
- paperConfirmFilename: ""
|
|
|
|
|
|
+ filename: ""
|
|
};
|
|
};
|
|
this.curPaperAttachments.push(newAttachment);
|
|
this.curPaperAttachments.push(newAttachment);
|
|
},
|
|
},
|
|
@@ -258,38 +270,32 @@ export default {
|
|
item.name = this.abc[itemIndex];
|
|
item.name = this.abc[itemIndex];
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- toUpload(attachment, uploadType) {
|
|
|
|
- this.curUploadType = uploadType;
|
|
|
|
|
|
+ toUpload(attachment) {
|
|
|
|
+ this.curUploadType = "paper";
|
|
this.curAttachment = {
|
|
this.curAttachment = {
|
|
- name: attachment.name,
|
|
|
|
- attachmentId:
|
|
|
|
- uploadType === "paper"
|
|
|
|
- ? attachment.attachmentId
|
|
|
|
- : attachment.paperConfirmAttachmentId,
|
|
|
|
- filename:
|
|
|
|
- uploadType === "paper"
|
|
|
|
- ? attachment.filename
|
|
|
|
- : attachment.paperConfirmFilename
|
|
|
|
|
|
+ ...attachment
|
|
|
|
+ };
|
|
|
|
+ this.$refs.UploadPaperDialog.open();
|
|
|
|
+ },
|
|
|
|
+ toUploadPaperConfirm() {
|
|
|
|
+ this.curUploadType = "paperConfirm";
|
|
|
|
+ this.curAttachment = {
|
|
|
|
+ ...this.paperConfirmAttachmentId
|
|
};
|
|
};
|
|
this.$refs.UploadPaperDialog.open();
|
|
this.$refs.UploadPaperDialog.open();
|
|
},
|
|
},
|
|
uploadConfirm(attachment, uploadType) {
|
|
uploadConfirm(attachment, uploadType) {
|
|
- if (uploadType !== "paper")
|
|
|
|
- attachment = {
|
|
|
|
- name: attachment.name,
|
|
|
|
- paperConfirmAttachmentId: attachment.attachmentId,
|
|
|
|
- paperConfirmFilename: attachment.filename
|
|
|
|
- };
|
|
|
|
- const index = this.curPaperAttachments.findIndex(
|
|
|
|
- item => item.name === attachment.name
|
|
|
|
- );
|
|
|
|
- const curAttachment = Object.assign(
|
|
|
|
- this.curPaperAttachments[index],
|
|
|
|
- attachment
|
|
|
|
- );
|
|
|
|
- this.curPaperAttachments.splice(index, 1, { ...curAttachment });
|
|
|
|
|
|
+ if (uploadType === "paper") {
|
|
|
|
+ const index = this.curPaperAttachments.findIndex(
|
|
|
|
+ item => item.name === attachment.name
|
|
|
|
+ );
|
|
|
|
+ this.curPaperAttachments.splice(index, 1, { ...attachment });
|
|
|
|
+ } else {
|
|
|
|
+ this.paperConfirmAttachmentId = { ...attachment };
|
|
|
|
+ }
|
|
},
|
|
},
|
|
toCreateCard() {
|
|
toCreateCard() {
|
|
|
|
+ this.task = this.getTaskData().tcPExamTaskDetail;
|
|
if (this.task.cardId) {
|
|
if (this.task.cardId) {
|
|
if (this.task.cardSource === 0) {
|
|
if (this.task.cardSource === 0) {
|
|
this.$refs.CardOptionDialog.open();
|
|
this.$refs.CardOptionDialog.open();
|
|
@@ -336,15 +342,22 @@ export default {
|
|
datas.paperAttachmentId = JSON.stringify({
|
|
datas.paperAttachmentId = JSON.stringify({
|
|
paper: this.curPaperAttachments
|
|
paper: this.curPaperAttachments
|
|
});
|
|
});
|
|
|
|
+ datas.paperConfirmAttachmentId = JSON.stringify(
|
|
|
|
+ this.paperConfirmAttachmentId
|
|
|
|
+ );
|
|
datas.enablePaperType = this.getEnablePaperType();
|
|
datas.enablePaperType = this.getEnablePaperType();
|
|
return { tcPExamTaskDetail: datas };
|
|
return { tcPExamTaskDetail: datas };
|
|
},
|
|
},
|
|
checkDataValid() {
|
|
checkDataValid() {
|
|
const attachmentValid = !this.curPaperAttachments.some(
|
|
const attachmentValid = !this.curPaperAttachments.some(
|
|
- item => !item.attachmentId || !item.paperConfirmAttachmentId
|
|
|
|
|
|
+ item => !item.attachmentId
|
|
);
|
|
);
|
|
if (this.task.examPaper && !attachmentValid) {
|
|
if (this.task.examPaper && !attachmentValid) {
|
|
- this.$message.error("请完成试卷文件和试卷审核确认书上传!");
|
|
|
|
|
|
+ this.$message.error("请完成试卷文件上传!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (this.task.examPaper && !this.paperConfirmAttachmentId.attachmentId) {
|
|
|
|
+ this.$message.error("请完成试卷审核确认书上传!");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|