<template>
|
<el-dialog :close-on-click-modal="false" :visible.sync="visible" width="80%" @open="handleOpen" @close="handleClose">
|
<el-card class="top-card">
|
<el-row :gutter="24" class="top-info-row">
|
<el-col :span="6" class="info-col">
|
<div class="info-item">
|
<span class="label">菌种来源:</span>{{ detail.strainSource }}
|
</div>
|
<div class="info-item">
|
<span class="label">鉴别菌株编号:</span>{{ detail.identifyingStrainCode }}
|
</div>
|
<div class="info-item">
|
<span class="label">鉴别菌株名称:</span>{{ detail.identifyingStrainName }}
|
</div>
|
</el-col>
|
<el-col :span="6" class="info-col">
|
<div class="info-item">
|
<span class="label">验证实验编号:</span>{{ detail.validationExperimentCode }}
|
</div>
|
<div class="info-item">
|
<span class="label">实验时间:</span>{{ detail.experimentTime | formatDate }}
|
</div>
|
<div class="info-item"></div>
|
</el-col>
|
<el-col :span="6" class="info-col">
|
<div class="info-item sign-label">
|
<span class="label">菌种实验员签字</span>
|
</div>
|
<div class="info-item signature-item">
|
<div class="signature-area">
|
<img v-if="detail.handleSignature" :src="detail.handleSignature" alt="签字" />
|
<span v-else class="waiting-text">暂无签名</span>
|
</div>
|
</div>
|
</el-col>
|
<el-col :span="6" class="info-col">
|
<div class="info-item">
|
<span class="label">签字时间:</span>{{ detail.handleTime }}
|
</div>
|
</el-col>
|
</el-row>
|
</el-card>
|
<div class="section-card" style="margin-top: 24px">
|
<el-form ref="form" label-width="100px" :model="detail" label-position="top">
|
<el-form-item label="实验结论" prop="result">
|
<el-input type="textarea" :disabled="true" v-model="detail.result" :rows="3" placeholder="请输入" />
|
</el-form-item>
|
<el-form-item label="批准菌株用途" prop="purpose">
|
<el-checkbox-group :disabled="true" v-model="detail.purpose">
|
<el-checkbox label="1">传代</el-checkbox>
|
<el-checkbox label="2">菌种保藏</el-checkbox>
|
<el-checkbox label="3">废弃</el-checkbox>
|
</el-checkbox-group>
|
</el-form-item>
|
</el-form>
|
</div>
|
|
<div class="section-card" style="margin-top: 12px">
|
<el-table :data="tableData" border style="width: 100%" :row-class-name="getRowClassName">
|
<el-table-column prop="conditions" label="菌种培养工艺条件" />
|
<el-table-column prop="record" label="菌种培养工艺实况记录" />
|
<el-table-column prop="workmanship" label="菌种培养标准工艺" />
|
<el-table-column label="操作" width="120">
|
<template #default="{ row }">
|
<el-button type="text" @click="handleEdit(row)">详情</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
</el-dialog>
|
</template>
|
|
<script>
|
import DetailConditionDialog from "./DetailConditionDialog.vue";
|
import { detail } from "./service.js";
|
import moment from "moment";
|
|
export default {
|
name: "DetailConditionDialog",
|
components: { DetailConditionDialog },
|
props: {
|
visible: Boolean,
|
value: {
|
type: Object,
|
default: () => ({ condition: "", record: "", process: "" }),
|
},
|
value: {
|
type: Object,
|
default: () => ({})
|
},
|
},
|
data() {
|
return {
|
detail: {
|
strainSource: '',
|
identifyingStrainCode: '',
|
identifyingStrainName: '',
|
validationExperimentCode: '',
|
experimentTime: '',
|
handleSignature: '', // 签名图片url
|
result: '',
|
purpose: []
|
},
|
activeTab: "conditions",
|
initialTableData: [
|
{ conditions: '平板培养基', record: '', workmanship: '' },
|
{ conditions: '培养温度', record: '', workmanship: '' },
|
{ conditions: '培养时间', record: '', workmanship: '' },
|
{ conditions: '摇瓶培养基', record: '', workmanship: '' },
|
{ conditions: '接种量', record: '', workmanship: '' },
|
{ conditions: '培养时间', record: '', workmanship: '' },
|
{ conditions: '发酵时间', record: '', workmanship: '' },
|
{ conditions: '检测数据及结果', record: '', workmanship: '' }
|
],
|
tableData: [
|
{ conditions: '平板培养基', record: '', workmanship: '' },
|
{ conditions: '培养温度', record: '', workmanship: '' },
|
{ conditions: '培养时间', record: '', workmanship: '' },
|
{ conditions: '摇瓶培养基', record: '', workmanship: '' },
|
{ conditions: '接种量', record: '', workmanship: '' },
|
{ conditions: '培养时间', record: '', workmanship: '' },
|
{ conditions: '发酵时间', record: '', workmanship: '' },
|
{ conditions: '检测数据及结果', record: '', workmanship: '' }
|
],
|
dialogVisible: false,
|
dialogIsEdit: false,
|
dialogIsFixed: false,
|
dialogValue: {},
|
dialogIndex: null,
|
};
|
},
|
filters: {
|
formatDate(date) {
|
if(date){
|
return moment(date).format('YYYY-MM-DD')
|
}else{
|
return ''
|
}
|
},
|
},
|
methods: {
|
handleOpen() {
|
if (this.value.id) {
|
detail({ id: this.value.id }).then(res => {
|
this.detail = {
|
...res,
|
handleSignature: res.handleSignature || '', // 处理签名为空的情况
|
purpose:res.purpose && res.purpose.split(',') || [] // 处理 purpose 为空的情况
|
}
|
this.tableData = res.list || []
|
})
|
}
|
},
|
handleClose() {
|
this.$emit("update:visible", false);
|
},
|
handleEdit(row) {
|
|
this.$emit("viewDetail", row);
|
},
|
|
handleSave() {
|
this.dialogVisible = true;
|
this.dialogIsEdit = false;
|
this.dialogIsFixed = false;
|
this.dialogValue = { condition: "", record: "", process: "" };
|
this.dialogIndex = null;
|
},
|
handleDraft() {
|
// 存稿逻辑
|
},
|
handleDialogOk(val) {
|
if (this.dialogIsEdit && this.dialogIndex !== null) {
|
this.$set(this.tableData, this.dialogIndex, val);
|
} else {
|
this.tableData.push(val);
|
}
|
},
|
getRowClassName({ rowIndex }) {
|
return rowIndex < this.initialTableData.length ? "fixed-row" : "";
|
},
|
},
|
};
|
</script>
|
|
<style scoped lang="less">
|
.el-dialog__body {
|
padding-bottom: 0;
|
}
|
|
.top-card {
|
margin-bottom: 0;
|
min-height: 160px;
|
overflow-y: auto;
|
background: rgba(239, 239, 239, 1);
|
border-radius: 16px;
|
}
|
|
.top-info-row {
|
align-items: stretch;
|
}
|
|
.info-col {
|
display: flex;
|
flex-direction: column;
|
|
}
|
|
.info-item {
|
display: flex;
|
font-size: 15px;
|
height: 45px;
|
line-height: 45px;
|
}
|
|
.label {
|
color: #666;
|
font-weight: 500;
|
flex-shrink: 0;
|
}
|
|
.sign-col {
|
align-items: center;
|
text-align: center;
|
}
|
|
.sign-label {
|
justify-content: center;
|
}
|
|
.signature-item {
|
justify-content: center;
|
}
|
|
.signature-area {
|
min-height: 80px;
|
min-width: 120px;
|
background: #f5f7fa;
|
border: 1px solid #dcdfe6;
|
border-radius: 4px;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
margin-top: 8px;
|
}
|
|
.signature-area img {
|
max-width: 100%;
|
max-height: 100%;
|
display: block;
|
}
|
|
.waiting-text {
|
color: #909399;
|
font-size: 14px;
|
}
|
|
.sign-time {
|
justify-content: center;
|
text-align: center;
|
color: #666;
|
font-size: 14px;
|
}
|
|
.section-card {
|
margin-bottom: 0;
|
}
|
|
.footer-btns {
|
display: flex;
|
justify-content: center;
|
padding: 24px;
|
padding-bottom: 0;
|
gap: 24px;
|
|
.el-button {
|
width: 150px;
|
}
|
}
|
|
::v-deep(.fixed-row) {
|
background-color: rgb(228, 248, 250) !important;
|
}
|
|
@media (max-width: 900px) {
|
.info-col {
|
height: auto;
|
}
|
}
|
</style>
|