<template>
|
<el-dialog
|
title="提交确认"
|
:visible.sync="visible"
|
width="80%"
|
:close-on-click-modal="false"
|
@close="handleClose"
|
>
|
<div class="approval-dialog">
|
<div class="approval-content">
|
<Card class="approval-content-card">
|
<template>
|
<div class="sample-info">
|
<div class="info-item">
|
<span class="label">项目课题方案名称:</span>
|
<span class="value">{{ detailData.experimentDispatch?.projectName || '-' }}</span>
|
</div>
|
<div class="info-item">
|
<span class="label">申请项目执行方案编号:</span>
|
<span class="value">{{ detailData.experimentDispatch?.experimentCode || '-' }}</span>
|
</div>
|
<div class="info-item">
|
<span class="label">实验编号:</span>
|
<span class="value">{{ detailData.experimentDispatch?.experimentCode || '-' }}</span>
|
</div>
|
<div class="info-item">
|
<span class="label">实验名称:</span>
|
<span class="value">{{ detailData.experimentDispatch?.experimentName || '-' }}</span>
|
</div>
|
<div class="info-item">
|
<span class="label">取样单编号:</span>
|
<span class="value">{{ detailData.samplingCode || '-' }}</span>
|
</div>
|
</div>
|
|
<div class="header-title" >
|
<div class="header-title-left">
|
<el-button
|
type="primary"
|
class="el-icon-plus"
|
@click="showAdditives = !showAdditives"
|
>
|
{{ showAdditives ? "收起辅料详情" : "展开辅料详情" }}
|
</el-button>
|
</div>
|
</div>
|
<Table :data="sampleData" :total="0" :height="null">
|
<template>
|
<el-table-column
|
prop="index"
|
label="序号"
|
width="80"
|
></el-table-column>
|
<el-table-column
|
prop="processTime"
|
label="工艺时间"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="samplingName"
|
label="取样名称"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="sampleCode"
|
label="取样样品编号"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="temperature"
|
label="温度"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="samplePh"
|
label="PH"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="waterAddition"
|
label="加水量"
|
width="150"
|
></el-table-column>
|
<template v-if="showAdditives">
|
<el-table-column
|
prop="addAuxiliaryOne"
|
label="加辅1"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="addAuxiliaryTwo"
|
label="加辅2"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="addAuxiliaryThree"
|
label="加辅3"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="addAuxiliaryFour"
|
label="加辅4"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="addAuxiliaryFive"
|
label="加辅5"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="addAuxiliarySix"
|
label="加辅6"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="addAuxiliarySeven"
|
label="加辅7"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="addAuxiliaryEight"
|
label="加辅8"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="addAuxiliaryNine"
|
label="加辅9"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="addAuxiliaryTen"
|
label="加辅10"
|
width="150"
|
></el-table-column>
|
</template>
|
<el-table-column
|
prop="sampleAmount"
|
label="取样量"
|
width="150"
|
></el-table-column>
|
<el-table-column
|
prop="pictures"
|
label="拍照"
|
width="150"
|
>
|
<template slot-scope="scope">
|
<el-image
|
v-for="(url, index) in scope.row.pictures.split(',')"
|
:key="index"
|
:src="url"
|
:preview-src-list="[url]"
|
style="width: 50px; height: 50px;"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="handlePersonName"
|
fixed="right"
|
label="操作人员"
|
width="150"
|
></el-table-column>
|
</template>
|
</Table>
|
</template>
|
</Card>
|
</div>
|
</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 slot="footer" class="dialog-footer select-member-footer">
|
<el-button @click="handleClose">取 消</el-button>
|
<el-button type="primary" @click="handleConfirm">确 认</el-button>
|
</div>
|
|
<SignatureCanvas
|
:visible="signatureDialogVisible"
|
@confirm="handleSignatureConfirm"
|
/>
|
</el-dialog>
|
</template>
|
|
<script>
|
import SignatureCanvas from "@/components/SignatureCanvas.vue";
|
import moment from 'moment';
|
|
export default {
|
name: "ConfirmDialog",
|
components: {
|
SignatureCanvas,
|
},
|
props: {
|
visible: {
|
type: Boolean,
|
default: false,
|
},
|
formData: {
|
type: Object,
|
default: () => ({}),
|
},
|
sampleData: {
|
type: Array,
|
default: () => [],
|
},
|
detailData: {
|
type: Object,
|
default: () => ({}),
|
},
|
},
|
data() {
|
return {
|
signatureDialogVisible: false,
|
imgSrc: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
showAdditives: true,
|
};
|
},
|
methods: {
|
handleClose() {
|
this.$emit("update:visible", false);
|
this.imgSrc = "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg";
|
},
|
openSignature() {
|
this.signatureDialogVisible = true;
|
},
|
handleSignatureConfirm(imageData) {
|
this.signatureDialogVisible = false;
|
this.imgSrc = imageData;
|
},
|
handleConfirm() {
|
if (!this.imgSrc) {
|
this.$message.warning("请先完成签名确认");
|
return;
|
}
|
const now = new Date().toISOString();
|
const params = {
|
id: this.detailData.id,
|
commitPersonId: this.detailData.commitPersonId,
|
commitSign: this.imgSrc,
|
commitTime: moment().format('YYYY-MM-DD HH:mm:ss'),
|
dispatchId: this.detailData.experimentDispatch?.id,
|
samplingCode: this.detailData.samplingCode,
|
remark: this.formData.remark,
|
samplingRecordOperations: this.sampleData,
|
status: 2 // 已提交状态
|
};
|
this.$emit("confirm", params);
|
this.handleClose();
|
},
|
},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
::v-deep .el-dialog__header {
|
border-bottom: 1px solid #e4e7ed;
|
}
|
|
.approval-dialog {
|
display: flex;
|
max-height: 60vh;
|
overflow-y: auto;
|
|
.approval-content {
|
width: 100%;
|
flex: 1;
|
background: #ffffff;
|
box-shadow: 0px 4px 12px 4px rgba(0, 0, 0, 0.08);
|
border-radius: 10px;
|
}
|
}
|
|
.approval-content-card {
|
box-shadow: none !important;
|
padding-top: 0px !important;
|
padding-bottom: 0px !important;
|
height: calc(100% - 10px) !important;
|
// overflow: unset !important;
|
}
|
|
.header-title {
|
display: flex;
|
align-items: center;
|
gap: 13px;
|
margin-bottom: 20px;
|
|
.header-title-left {
|
display: flex;
|
align-items: center;
|
gap: 13px;
|
|
img {
|
width: 12px;
|
height: 19px;
|
}
|
|
span {
|
flex-shrink: 0;
|
font-weight: bold;
|
font-size: 18px;
|
color: #222222;
|
line-height: 27px;
|
font-family: "Source Han Sans CN Bold Bold";
|
}
|
}
|
}
|
|
.sample-info {
|
padding: 0 25px;
|
margin-bottom: 20px;
|
display: flex;
|
flex-wrap: wrap;
|
gap: 15px;
|
|
.info-item {
|
width: calc(50% - 7.5px);
|
display: flex;
|
align-items: center;
|
|
.label {
|
color: #606266;
|
margin-right: 10px;
|
white-space: nowrap;
|
}
|
|
.value {
|
color: #303133;
|
font-weight: 500;
|
}
|
}
|
}
|
|
.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>
|