<template>
|
<el-dialog
|
title="发送签字确认"
|
:visible.sync="visible"
|
width="500px"
|
:close-on-click-modal="false"
|
@close="handleClose"
|
>
|
<div class="receive-dialog">
|
<div class="receive-tip">
|
您已选中 <span class="sample-count">{{ sampleCount }}</span> 条样品发送,请签字确认
|
</div>
|
|
<div class="approval-dialog-approve">
|
<div class="add-group">
|
<div>*</div>
|
<span>签字确认</span>
|
<el-button type="primary" class="el-icon-plus" @click="openSignature">签名</el-button>
|
</div>
|
<img
|
v-if="imgSrc"
|
style="width: 200px; height: 100px; margin-left: 25px"
|
:src="imgSrc"
|
fit="fit"
|
/>
|
</div>
|
</div>
|
|
<div slot="footer" class="dialog-footer select-member-footer">
|
<el-button @click="handleClose">取 消</el-button>
|
<el-button type="primary" @click="handleConfirm" :disabled="!imgSrc">
|
确认发送
|
</el-button>
|
</div>
|
|
<SignatureCanvas
|
:visible="signatureDialogVisible"
|
@confirm="handleSignatureConfirm"
|
@close="signatureDialogVisible = false"
|
/>
|
</el-dialog>
|
</template>
|
|
<script>
|
import SignatureCanvas from "@/components/SignatureCanvas.vue";
|
|
export default {
|
name: "ReceiveConfirmDialog",
|
components: {
|
SignatureCanvas,
|
},
|
props: {
|
visible: {
|
type: Boolean,
|
default: false,
|
},
|
sampleCount: {
|
type: Number,
|
default: 1,
|
},
|
},
|
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>
|
::v-deep .el-dialog__header {
|
border-bottom: 1px solid #e4e7ed;
|
}
|
|
.receive-dialog {
|
padding: 20px;
|
|
.receive-tip {
|
font-size: 14px;
|
color: #333;
|
margin-bottom: 20px;
|
|
.sample-count {
|
color: #409EFF;
|
font-weight: bold;
|
}
|
}
|
}
|
|
.approval-dialog-approve {
|
margin-top: 26px;
|
|
img {
|
border: 2px dashed #049c9a;
|
}
|
}
|
|
.add-group {
|
padding-left: 25px;
|
margin-top: 14px;
|
display: flex;
|
align-items: center;
|
margin-bottom: 19px;
|
|
div {
|
color: #f56c6c;
|
}
|
|
span {
|
font-weight: 500;
|
font-size: 14px;
|
color: #222222;
|
line-height: 21px;
|
margin: 0 32px 0 8px;
|
}
|
}
|
|
.dialog-footer {
|
align-items: center;
|
display: flex;
|
justify-content: center;
|
|
button {
|
width: 150px;
|
}
|
}
|
</style>
|