<template>
|
<!-- 设置传代计划数弹窗 -->
|
<el-dialog :title="planForm.status === 'detail' ? '传代计划数详情' : '设置菌种传代计划数'" :visible.sync="planDialogVisible"
|
width="40%" :close-on-click-modal="false">
|
<el-form :model="planForm" :rules="planRules" ref="planForm" label-position="top">
|
<el-row :gutter="20">
|
<el-col :span="10">
|
<el-form-item label="传代菌种编号" prop="strainNo">
|
<el-input disabled v-model="planForm.strainNo"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="10">
|
<el-form-item label="传代菌种名称" prop="strainName">
|
<el-input disabled v-model="planForm.strainName"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="10">
|
<el-form-item label="接种菌种编号" prop="inoculateNo">
|
<el-input disabled v-model="planForm.inoculateNo" placeholder="请输入"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="10">
|
<el-form-item label="接种菌种名称" prop="inoculateName">
|
<el-input disabled v-model="planForm.inoculateName" placeholder="请输入"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="10">
|
<el-form-item label="保存/废弃">
|
<div class="flex-row">
|
<div :class="planForm.isDiscarded && 'active'">保存</div>
|
<div :class="!planForm.isDiscarded && 'active'">废弃</div>
|
</div>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="10">
|
<el-form-item label="菌种入库时间">
|
<el-input disabled v-model="planForm.inTime"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="10">
|
<el-form-item label="传代计划数" prop="count">
|
<el-input-number :disabled="planForm.status === 'detail'" v-model="planForm.count"
|
:controls="false" :min="1" placeholder="请输入" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
<div v-if="planForm.status !== 'detail'" class="dialog-footer">
|
<el-button type="primary" @click="handleAddPlan">提交签字</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
<script>
|
export default {
|
data() {
|
return {
|
planDialogVisible: false,
|
planForm: {
|
status: 'add',
|
},
|
planRules: {
|
count: [
|
{ required: true, message: '请输入传代计划数', trigger: 'blur' }
|
]
|
}
|
}
|
},
|
methods: {
|
openInitData(value) {
|
this.planForm = value
|
this.openDialog()
|
},
|
openDialog() {
|
this.planDialogVisible = true
|
},
|
closeDialog() {
|
this.planDialogVisible = false
|
},
|
handleAddPlan() {
|
this.$refs.planForm.validate((valid) => {
|
if (valid) {
|
this.$emit('addNodeSign', this.planForm, 2)
|
}
|
})
|
}
|
}
|
}
|
</script>
|
<style scoped lang="less">
|
.flex-row {
|
display: flex;
|
align-items: center;
|
flex-wrap: wrap;
|
|
@media (max-width: 768px) {
|
flex-direction: column;
|
align-items: flex-start;
|
width: 100%;
|
}
|
}
|
|
.input-wrapper {
|
@media (min-width: 769px) {
|
width: 290px;
|
min-width: 290px;
|
}
|
|
@media (max-width: 768px) {
|
width: 100%;
|
}
|
}
|
|
.fixed-width-input {
|
width: 100%;
|
|
@media (min-width: 769px) {
|
width: 290px !important;
|
min-width: 290px !important;
|
}
|
}
|
|
.form-text {
|
margin: 0 8px;
|
white-space: nowrap;
|
|
@media (max-width: 768px) {
|
margin: 8px 0;
|
}
|
}
|
|
.dialog-footer {
|
margin-top: 39px;
|
display: flex;
|
justify-content: center;
|
|
.el-button--primary {
|
width: 150px;
|
height: 40px;
|
background: #049C9A;
|
border-radius: 4px;
|
}
|
}
|
|
::v-deep .el-input-number .el-input__inner {
|
text-align: left;
|
}
|
|
.el-input-number--small {
|
width: 100%;
|
}
|
|
.flex-row {
|
width: 370px;
|
display: flex;
|
align-items: center;
|
font-size: 16px;
|
color: #333333;
|
padding: 4px;
|
border-radius: 10px;
|
border: 2px solid rgba(4, 156, 154, 0.5);
|
font-family: 'PingFangSCRegular';
|
|
.flex-row-save {
|
background: #049C9A;
|
color: #fff;
|
}
|
|
div {
|
width: 183px;
|
height: 32px;
|
text-align: center;
|
flex-shrink: 0;
|
cursor: pointer;
|
}
|
|
.active {
|
font-family: 'SourceHanSansCN-Medium';
|
color: #049C9A;
|
background: #EBFEFD;
|
box-shadow: 0px 0px 6px 0px rgba(10, 109, 108, 0.25);
|
border-radius: 10px;
|
}
|
}
|
</style>
|