From 6f81691ab09d586470426ee0bfa99cec83797f7b Mon Sep 17 00:00:00 2001 From: 董国庆 <364620639@qq.com> Date: 星期一, 23 六月 2025 15:52:24 +0800 Subject: [PATCH] 实验运行模块 图片换真实上传 --- laboratory/src/views/dataManagement/confirmation-sheet/components/review-dialog.vue | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) diff --git a/laboratory/src/views/dataManagement/confirmation-sheet/components/review-dialog.vue b/laboratory/src/views/dataManagement/confirmation-sheet/components/review-dialog.vue index db3b069..e261ba7 100644 --- a/laboratory/src/views/dataManagement/confirmation-sheet/components/review-dialog.vue +++ b/laboratory/src/views/dataManagement/confirmation-sheet/components/review-dialog.vue @@ -1,5 +1,5 @@ <template> - <el-dialog title="审核检测方法确认单" :visible="dialogVisible" width="80%" :close-on-click-modal="false" @close="handleClose" + <el-dialog title="审核检测方法确认单" :visible="dialogVisible" width="80%" @open='open' :close-on-click-modal="false" @close="handleClose" v-loading="loading"> <div class="approval-dialog"> <div class="approval-content"> @@ -69,7 +69,7 @@ <span>签字确认</span> <el-button type="primary" class="el-icon-plus" @click="openSignature">签名</el-button> </div> - <img v-if="imgSrc" :src="imgSrc" alt="签名" class="signature-preview" /> + <img v-if="imgSrc" :src="getFullUrl(imgSrc)" alt="签名" class="signature-preview" /> </div> <div slot="footer" class="dialog-footer"> @@ -77,7 +77,7 @@ <el-button type="primary" @click="handleConfirm" :disabled="!imgSrc" v-if="type === 'review'">确 认</el-button> </div> - <SignatureCanvas :visible="signatureDialogVisible" @confirm="handleSignatureConfirm" /> + <SignatureCanvas :visible="signatureDialogVisible" @close="signatureDialogVisible=false" @confirm="handleSignatureConfirm" /> </el-dialog> </template> @@ -85,6 +85,8 @@ import SignatureCanvas from "@/components/SignatureCanvas.vue"; import ApprovalProcess from "@/components/approvalProcess"; import { getDetail, sign } from '../service'; +import {getFullUrl} from '@/utils/utils.js' +import {queryDetail} from '@/components/service.js' export default { name: "ReviewDialog", @@ -136,14 +138,24 @@ } } }, - methods: { + methods: {getFullUrl, + open(){ + queryDetail().then(res=>{ + if(res){ + this.imgSrc=res.signPicture + } + }) + }, async getDetailData() { try { this.loading = true; const res = await getDetail({ id: this.id }); console.log('res', res) if (res) { - this.formData = res + this.formData = { + ...res, + confirmSign: getFullUrl(res.confirmSign) + } // 组装流程数据 let processData = []; // 提交节点 @@ -152,7 +164,7 @@ mode: "list", fields: [ { label: "提交人:", value: res.createBy || "" }, - { label: ' ', value: res.confirmSign || "", type: 'img' }, + { label: ' ', value: getFullUrl(res.confirmSign) || "", type: 'img' }, { label: "提交时间:", value: res.createTime || "" }, ], }); @@ -162,7 +174,7 @@ mode: "list", fields: [ { label: "审核人:", value: res.auditPersonName || "" }, - { label: ' ', value: res.auditSign || "", type: 'img' }, + { label: ' ', value: getFullUrl(res.auditSign) || "", type: 'img' }, { label: "审核时间:", value: res.auditTime || "" }, ], }); @@ -188,6 +200,7 @@ }, handleClose() { this.dialogVisible = false; + this.signatureDialogVisible=false this.$emit("close", false); this.imgSrc = ""; this.formData = { @@ -210,7 +223,10 @@ }, handleSignatureConfirm(imageData) { this.signatureDialogVisible = false; - this.imgSrc = 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'; + this.imgSrc = ""; // 先清空 + this.$nextTick(() => { + this.imgSrc = imageData; + }); }, handleConfirm() { if (!this.imgSrc) { -- Gitblit v1.7.1