<template>
|
<el-dialog
|
title="提交确认"
|
:visible.sync="visible"
|
width="80%"
|
:close-on-click-modal="false"
|
@close="handleClose"
|
class="submit-confirm-dialog"
|
>
|
<div class="approval-content">
|
<div class="sample-info">
|
<div class="info-item" style="width: 100%">
|
<span class="label">所属项目课题方案:</span>
|
<span class="value">{{ formData.planName }}</span>
|
</div>
|
<div class="info-item">
|
<span class="label">所属实验编号:</span>
|
<span class="value">{{ formData.testCode }}</span>
|
</div>
|
<div class="info-item">
|
<span class="label">所属实验名称:</span>
|
<span class="value">{{ formData.testName }}</span>
|
</div>
|
</div>
|
|
<Table :tableData="sampleData" :total="0" :height="null">
|
<template>
|
<el-table-column prop="index" label="序号" width="60" align="center"></el-table-column>
|
<el-table-column prop="testName" label="检测项名称"></el-table-column>
|
<el-table-column prop="testCode" label="检测项编号"></el-table-column>
|
<el-table-column prop="testType" label="定性/定量" align="center">
|
<template slot-scope="scope">
|
{{ scope.row.testType === 1 ? '定性' : '定量' }}
|
</template>
|
</el-table-column>
|
<el-table-column prop="methodCode" label="检测方法编号"></el-table-column>
|
<el-table-column prop="methodName" label="检测方法"></el-table-column>
|
<el-table-column prop="requirements" label="收样要求" show-overflow-tooltip></el-table-column>
|
</template>
|
</Table>
|
|
<div class="signature-section">
|
<div class="signature-header">
|
<span class="required">*</span>
|
<span class="title">签字确认</span>
|
<el-button type="primary" @click="openSignature">签名</el-button>
|
</div>
|
<div v-if="imgSrc" class="signature-preview">
|
<img :src="imgSrc" alt="签名" />
|
</div>
|
</div>
|
</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"
|
@close="handleSignatureClose"
|
@confirm="handleSignatureConfirm"
|
/>
|
</el-dialog>
|
</template>
|
|
<script>
|
import SignatureCanvas from "@/components/SignatureCanvas.vue";
|
|
export default {
|
name: "ConfirmDialog",
|
components: {
|
SignatureCanvas,
|
},
|
props: {
|
visible: {
|
type: Boolean,
|
default: false,
|
},
|
formData: {
|
type: Object,
|
default: () => ({
|
planName: '',
|
planCode: '',
|
testCode: '',
|
testName: '',
|
sampleCode: ''
|
}),
|
},
|
sampleData: {
|
type: Array,
|
default: () => [],
|
},
|
},
|
data() {
|
return {
|
signatureDialogVisible: false,
|
imgSrc: "",
|
};
|
},
|
methods: {
|
handleClose() {
|
this.$emit("update:visible", false);
|
this.imgSrc = "";
|
},
|
openSignature() {
|
this.signatureDialogVisible = true;
|
},
|
handleSignatureClose() {
|
this.signatureDialogVisible = false;
|
},
|
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>
|
.submit-confirm-dialog {
|
:deep(.el-dialog__header) {
|
padding: 15px 20px;
|
border-bottom: 1px solid #e4e7ed;
|
margin-right: 0;
|
}
|
|
:deep(.el-dialog__body) {
|
padding: 20px;
|
}
|
}
|
|
.approval-content {
|
background: #ffffff;
|
}
|
|
.sample-info {
|
margin-bottom: 25px;
|
display: flex;
|
flex-wrap: wrap;
|
row-gap: 15px;
|
|
.info-item {
|
width: 50%;
|
display: flex;
|
align-items: center;
|
padding-right: 20px;
|
box-sizing: border-box;
|
|
.label {
|
color: #606266;
|
margin-right: 10px;
|
white-space: nowrap;
|
}
|
|
.value {
|
color: #303133;
|
font-weight: 500;
|
}
|
}
|
}
|
|
.signature-section {
|
margin-top: 25px;
|
padding: 0 20px;
|
|
.signature-header {
|
display: flex;
|
align-items: center;
|
margin-bottom: 15px;
|
|
.required {
|
color: #f56c6c;
|
margin-right: 5px;
|
}
|
|
.title {
|
font-size: 14px;
|
color: #606266;
|
margin-right: 15px;
|
}
|
}
|
|
.signature-preview {
|
img {
|
width: 200px;
|
height: 100px;
|
border: 2px dashed #009688;
|
border-radius: 4px;
|
}
|
}
|
}
|
|
.dialog-footer {
|
padding: 15px 20px;
|
text-align: center;
|
border-top: 1px solid #e4e7ed;
|
|
.el-button {
|
width: 120px;
|
|
& + .el-button {
|
margin-left: 12px;
|
}
|
}
|
}
|
</style>
|