<template>
|
<el-dialog
|
title="审核检测方法确认单"
|
:visible.sync="visible"
|
width="80%"
|
:close-on-click-modal="false"
|
@close="handleClose"
|
>
|
<div class="approval-dialog">
|
<div class="approval-content">
|
<div class="approval-content-card">
|
<template>
|
<!-- 基本信息 -->
|
<div class="basic-info">
|
<div class="info-header">
|
<div class="info-item">
|
<span class="label">所属项目课题方案:{{ formData.planName }}</span>
|
</div>
|
<div class="info-item">
|
<span class="label">实验名称:{{ formData.testName }}</span>
|
</div>
|
<div class="info-item">
|
<span class="label">所属实验编号:{{ formData.testCode }}</span>
|
</div>
|
</div>
|
<div class="info-header">
|
<div class="info-item">
|
<span class="label">提交人:{{ formData.submitter }}</span>
|
</div>
|
<div class="info-item">
|
<span class="label">提交人签名:{{ formData.submitterSignature }}</span>
|
</div>
|
<div class="info-item">
|
<span class="label">提交时间:{{ formData.submitTime }}</span>
|
</div>
|
</div>
|
</div>
|
|
<!-- 检测项表格 -->
|
<div class="table-wrapper">
|
<Table :tableData="sampleData" :total="0" :height="null">
|
<template>
|
<el-table-column prop="index" label="序号" width="60" fixed></el-table-column>
|
<el-table-column prop="processTime" label="检验项名称"></el-table-column>
|
<el-table-column prop="sampleName" label="检验项编号"></el-table-column>
|
<el-table-column prop="sampleCode" label="定性/定量"></el-table-column>
|
<el-table-column prop="temperature" label="检测方法编号"></el-table-column>
|
<el-table-column prop="ph" label="检测方法"></el-table-column>
|
<el-table-column prop="waterAmount" label="收样要求"></el-table-column>
|
</template>
|
</Table>
|
</div>
|
</template>
|
</div>
|
</div>
|
|
<div class="approval-flow">
|
<div class="flow-content">
|
<approval-process
|
:status="formData.status"
|
:submit-time="formData.submitTime"
|
:approver="formData.approver"
|
:approve-time="formData.approveTime"
|
/>
|
</div>
|
</div>
|
</div>
|
|
<div class="approval-dialog-approve" v-if="type === 'review'">
|
<div class="add-group">
|
<div class="required">*</div>
|
<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"
|
/>
|
</div>
|
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="handleClose">取 消</el-button>
|
<el-button type="primary" @click="handleConfirm" :disabled="!imgSrc">确 认</el-button>
|
</div>
|
|
<SignatureCanvas
|
:visible="signatureDialogVisible"
|
@confirm="handleSignatureConfirm"
|
/>
|
</el-dialog>
|
</template>
|
|
<script>
|
import SignatureCanvas from "@/components/SignatureCanvas.vue";
|
import ApprovalProcess from "@/components/approvalProcess";
|
|
export default {
|
name: "ReviewDialog",
|
components: {
|
SignatureCanvas,
|
ApprovalProcess
|
},
|
props: {
|
visible: {
|
type: Boolean,
|
default: false,
|
},
|
type: {
|
type: String,
|
default: "review",
|
},
|
formData: {
|
type: Object,
|
default: () => ({
|
planName: '',
|
testCode: '',
|
testName: '',
|
submitter: '',
|
submitterSignature: '',
|
submitTime: '',
|
status: '',
|
approver: '',
|
approveTime: ''
|
}),
|
},
|
sampleData: {
|
type: Array,
|
default: () => [],
|
},
|
},
|
data() {
|
return {
|
signatureDialogVisible: false,
|
imgSrc: "",
|
};
|
},
|
methods: {
|
handleClose() {
|
this.$emit("update:visible", false);
|
this.imgSrc = "";
|
},
|
openSignature() {
|
this.signatureDialogVisible = true;
|
},
|
handleSignatureConfirm(imageData) {
|
this.signatureDialogVisible = false;
|
this.imgSrc = imageData;
|
},
|
handleConfirm() {
|
if (!this.imgSrc) {
|
this.$message.warning("请先完成签名确认");
|
return;
|
}
|
this.$emit("confirm", this.imgSrc);
|
this.handleClose();
|
},
|
},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
|
.approval-dialog {
|
display: flex;
|
min-height: 60vh;
|
max-height: 80vh;
|
overflow: hidden;
|
|
@media screen and (max-width: 1024px) {
|
flex-direction: column;
|
}
|
|
.approval-content {
|
flex: 1;
|
margin: 20px;
|
background: #ffffff;
|
box-shadow: 0px 4px 12px 4px rgba(0,0,0,0.08);
|
border-radius: 10px;
|
overflow-y: auto;
|
|
@media screen and (max-width: 1024px) {
|
margin-right: 0;
|
margin-bottom: 20px;
|
max-height: calc(60vh - 200px);
|
}
|
}
|
|
.approval-flow {
|
width: 405px;
|
background: #ffffff;
|
box-shadow: 0px 4px 12px 4px rgba(0,0,0,0.08);
|
border-radius: 10px;
|
padding: 40px 20px;
|
margin: 20px;
|
margin-left: 0;
|
@media screen and (max-width: 1024px) {
|
width: 100%;
|
padding: 20px;
|
}
|
|
.flow-content {
|
height: calc(100% - 40px);
|
overflow-y: auto;
|
}
|
}
|
}
|
|
.basic-info {
|
padding: 28px 20px;
|
background: linear-gradient( 180deg, #05A0C1 0%, #05F2C2 100%);
|
border-radius: 10px 10px 0 0;
|
color: #fff;
|
|
.info-header {
|
display: flex;
|
flex-wrap: wrap;
|
margin-bottom: 28px;
|
gap: 15px;
|
|
@media screen and (max-width: 768px) {
|
flex-direction: column;
|
gap: 10px;
|
}
|
|
&:last-child {
|
margin-bottom: 0;
|
}
|
|
.info-item {
|
flex: 1;
|
min-width: 250px;
|
|
@media screen and (max-width: 768px) {
|
min-width: 100%;
|
}
|
|
.label {
|
font-size: 14px;
|
white-space: normal;
|
word-break: break-all;
|
}
|
}
|
}
|
}
|
|
.table-wrapper {
|
padding: 20px;
|
background: #ffffff;
|
border-radius: 4px;
|
overflow-x: auto;
|
::v-deep .el-table {
|
width: 100%;
|
min-width: 800px;
|
}
|
}
|
|
.approval-dialog-approve {
|
margin-top: 26px;
|
padding: 0 20px;
|
|
.add-group {
|
display: flex;
|
align-items: center;
|
margin-bottom: 15px;
|
|
.required {
|
color: #f56c6c;
|
margin-right: 4px;
|
}
|
|
span {
|
margin-right: 15px;
|
font-size: 14px;
|
color: #303133;
|
}
|
}
|
|
.signature-preview {
|
width: 200px;
|
height: 100px;
|
border: 2px dashed #049c9a;
|
border-radius: 4px;
|
object-fit: contain;
|
}
|
}
|
|
.dialog-footer {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
padding-top: 20px;
|
|
.el-button {
|
width: 150px;
|
margin: 0 10px;
|
}
|
}
|
|
.approval-content-card {
|
height: calc(100% - 100px) !important;
|
box-shadow: none !important;
|
}
|
::v-deep .el-dialog__body {
|
padding: 0;
|
@media screen and (max-width: 768px) {
|
padding: 15px;
|
}
|
}
|
|
::v-deep .el-dialog {
|
@media screen and (max-width: 1024px) {
|
width: 95% !important;
|
margin-top: 20px !important;
|
}
|
}
|
|
::v-deep .el-table {
|
.cell {
|
white-space: normal;
|
line-height: 1.5;
|
}
|
}
|
</style>
|