|
@@ -278,6 +278,8 @@
|
|
ref="PreviewAttachment"
|
|
ref="PreviewAttachment"
|
|
:attachment-ids="attachmentIds"
|
|
:attachment-ids="attachmentIds"
|
|
></preview-attachment>
|
|
></preview-attachment>
|
|
|
|
+ <!-- PreviewFile -->
|
|
|
|
+ <preview-file ref="PreviewFile" :data="curFile"></preview-file>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -286,7 +288,10 @@ import UploadPaperDialog from "./UploadPaperDialog";
|
|
import ModifyCard from "../../card/components/ModifyCard";
|
|
import ModifyCard from "../../card/components/ModifyCard";
|
|
import CardPreviewDialog from "../../card/components/CardPreviewDialog.vue";
|
|
import CardPreviewDialog from "../../card/components/CardPreviewDialog.vue";
|
|
import PreviewAttachment from "@/components/PreviewAttachment.vue";
|
|
import PreviewAttachment from "@/components/PreviewAttachment.vue";
|
|
|
|
+import PreviewFile from "@/components/PreviewFile.vue";
|
|
|
|
+
|
|
import { taskApplyDetail, taskPaperApplyEdit, cardForSelectList } from "../api";
|
|
import { taskApplyDetail, taskPaperApplyEdit, cardForSelectList } from "../api";
|
|
|
|
+import { attachmentPreview } from "../../login/api";
|
|
import { COMMON_CARD_RULE_ID } from "@/constants/enumerate";
|
|
import { COMMON_CARD_RULE_ID } from "@/constants/enumerate";
|
|
import { copyCard } from "../../card/api";
|
|
import { copyCard } from "../../card/api";
|
|
|
|
|
|
@@ -318,6 +323,7 @@ export default {
|
|
ModifyCard,
|
|
ModifyCard,
|
|
CardPreviewDialog,
|
|
CardPreviewDialog,
|
|
PreviewAttachment,
|
|
PreviewAttachment,
|
|
|
|
+ PreviewFile,
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
instance: {
|
|
instance: {
|
|
@@ -381,6 +387,11 @@ export default {
|
|
user: this.$ls.get("user", {}),
|
|
user: this.$ls.get("user", {}),
|
|
// attachmentId preview
|
|
// attachmentId preview
|
|
attachmentIds: [],
|
|
attachmentIds: [],
|
|
|
|
+ // preview file
|
|
|
|
+ curFile: {
|
|
|
|
+ url: "",
|
|
|
|
+ type: "",
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -485,11 +496,25 @@ export default {
|
|
this.paperAttachments.splice(index, 1, { ...attachment });
|
|
this.paperAttachments.splice(index, 1, { ...attachment });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- toViewAttachment(attachment) {
|
|
|
|
|
|
+ async toViewAttachment(attachment) {
|
|
if (!attachment.jpgAttachmentId) {
|
|
if (!attachment.jpgAttachmentId) {
|
|
- this.$message.error("附件丢失!");
|
|
|
|
|
|
+ if (!attachment.attachmentId) {
|
|
|
|
+ this.$message.error("附件丢失!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const data = await attachmentPreview(attachment.attachmentId);
|
|
|
|
+ if (!data[0].url) {
|
|
|
|
+ this.$message.error("附件丢失!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.curFile = {
|
|
|
|
+ url: data[0].url,
|
|
|
|
+ type: "application/pdf",
|
|
|
|
+ };
|
|
|
|
+ this.$refs.PreviewFile.open();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
const datas = JSON.parse(attachment.jpgAttachmentId);
|
|
const datas = JSON.parse(attachment.jpgAttachmentId);
|
|
this.attachmentIds = datas.map((item) => item.attachmentId);
|
|
this.attachmentIds = datas.map((item) => item.attachmentId);
|
|
this.$refs.PreviewAttachment.open();
|
|
this.$refs.PreviewAttachment.open();
|