|
@@ -52,7 +52,12 @@
|
|
|
class="icon icon-download mr-1"
|
|
|
v-if="attachment.attachmentId"
|
|
|
></i>
|
|
|
- <i>{{ attachment.filename }}</i>
|
|
|
+ <i
|
|
|
+ :class="{
|
|
|
+ 'color-primary': auditLogCache.paper[attachment.attachmentId],
|
|
|
+ }"
|
|
|
+ >{{ attachment.filename }}</i
|
|
|
+ >
|
|
|
</el-button>
|
|
|
</td>
|
|
|
<td>
|
|
@@ -139,7 +144,12 @@
|
|
|
type="text"
|
|
|
class="btn-primary"
|
|
|
@click="toViewCard(attachment)"
|
|
|
- >{{ attachment.cardTitle || "预览" }}</el-button
|
|
|
+ ><i
|
|
|
+ :class="{
|
|
|
+ 'color-primary': auditLogCache.card[attachment.cardId],
|
|
|
+ }"
|
|
|
+ >{{ attachment.cardTitle || "预览" }}</i
|
|
|
+ ></el-button
|
|
|
>
|
|
|
</td>
|
|
|
<td v-if="IS_APPLY">
|
|
@@ -514,6 +524,7 @@ import {
|
|
|
updateTaskApply,
|
|
|
taskAuditApply,
|
|
|
cardForSelectList,
|
|
|
+ savePreviewLog,
|
|
|
} from "../api";
|
|
|
import { attachmentPreview } from "../../login/api";
|
|
|
import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
@@ -648,6 +659,7 @@ export default {
|
|
|
exchangeUsers: [],
|
|
|
selectUserType: "exchange", // exchange:转审,approve:下一节点审核
|
|
|
curSelectedUsers: [],
|
|
|
+ auditLogCache: { paper: {}, card: {} },
|
|
|
// 选择下一节点审批人
|
|
|
IS_NEED_SELECT_APPROVE_USER: false,
|
|
|
nextFlowTaskResult: {}, //下一节点信息
|
|
@@ -728,12 +740,16 @@ export default {
|
|
|
let exposedPaperTypes = exposedPaperType.split(",");
|
|
|
exposedPaperTypes.sort((a, b) => (a > b ? -1 : 1));
|
|
|
const maxExposedPaperType = exposedPaperTypes[0];
|
|
|
+ let auditLogCache = { paper: {}, card: {} };
|
|
|
this.paperAttachments.forEach((paper) => {
|
|
|
paper.canDelete = maxExposedPaperType
|
|
|
? paper.name > maxExposedPaperType
|
|
|
: true;
|
|
|
paper.isExposed = exposedPaperTypes.includes(paper.name);
|
|
|
+ auditLogCache.paper[paper.attachmentId] = false;
|
|
|
+ auditLogCache.card[paper.cardId] = false;
|
|
|
});
|
|
|
+ this.auditLogCache = auditLogCache;
|
|
|
|
|
|
this.paperConfirmAttachments = this.curTaskApply.paperConfirmAttachmentIds
|
|
|
? JSON.parse(this.curTaskApply.paperConfirmAttachmentIds)
|
|
@@ -918,6 +934,7 @@ export default {
|
|
|
this.paperConfirmAttachments.splice(index, 1);
|
|
|
},
|
|
|
toViewCard(attachment) {
|
|
|
+ this.addPreviewLog(attachment, "card");
|
|
|
window.open(
|
|
|
this.getRouterPath({
|
|
|
name: "CardPreview",
|
|
@@ -1012,6 +1029,7 @@ export default {
|
|
|
},
|
|
|
async downloadPaper(attachment) {
|
|
|
if (!attachment.attachmentId) return;
|
|
|
+ this.addPreviewLog(attachment, "paper");
|
|
|
const data = await attachmentPreview(attachment.attachmentId);
|
|
|
window.open(data.url);
|
|
|
},
|
|
@@ -1144,6 +1162,13 @@ export default {
|
|
|
this.$emit("modified");
|
|
|
},
|
|
|
async toAuditSubmit() {
|
|
|
+ if (this.IS_AUDIT && !this.checkAllFilePreview()) {
|
|
|
+ this.$message.error(
|
|
|
+ "还有未被查看过的题卡或试卷,请点击试卷及题卡进行查看审核"
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
const valid = await this.$refs.auditModalComp.validate().catch(() => {});
|
|
|
if (!valid) return;
|
|
|
|
|
@@ -1207,6 +1232,23 @@ export default {
|
|
|
this.$message.success("审批成功!");
|
|
|
this.$emit("modified");
|
|
|
},
|
|
|
+ // audit preview log
|
|
|
+ async addPreviewLog(attachment, type) {
|
|
|
+ if (!this.IS_AUDIT) return;
|
|
|
+ const id = type === "paper" ? attachment.attachmentId : attachment.cardId;
|
|
|
+ this.auditLogCache[type][id] = true;
|
|
|
+ await savePreviewLog({
|
|
|
+ examTaskId: this.curTaskApply.examTaskId,
|
|
|
+ paperType: attachment.name,
|
|
|
+ type,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ checkAllFilePreview() {
|
|
|
+ return (
|
|
|
+ !Object.values(this.auditLogCache.paper).some((item) => !item) &&
|
|
|
+ !Object.values(this.auditLogCache.card).some((item) => !item)
|
|
|
+ );
|
|
|
+ },
|
|
|
// image-preview
|
|
|
toPreview(index) {
|
|
|
this.curImageIndex = index;
|