From 013c63b6a07231bb4456106e31715b0982167abd Mon Sep 17 00:00:00 2001 From: 董国庆 <364620639@qq.com> Date: 星期三, 04 六月 2025 09:38:46 +0800 Subject: [PATCH] Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory --- culture/src/views/pedigree-chart/components/ParentForm.vue | 354 +++++++++++++++++++++++++++++++--------------------------- 1 files changed, 190 insertions(+), 164 deletions(-) diff --git a/culture/src/views/pedigree-chart/components/ParentForm.vue b/culture/src/views/pedigree-chart/components/ParentForm.vue index dc309c5..ebd0156 100644 --- a/culture/src/views/pedigree-chart/components/ParentForm.vue +++ b/culture/src/views/pedigree-chart/components/ParentForm.vue @@ -1,195 +1,221 @@ <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="24"> - <el-form-item label="菌种源" prop="strainSourceStart"> - <div class="input-group"> - <div class="input-wrapper"> - <el-input disabled v-model="planForm.strainSourceStart" class="fixed-width-input"></el-input> - </div> - <span class="form-text">代—</span> - <div class="input-wrapper"> - <el-input disabled v-model="planForm.strainSourceEnd" class="fixed-width-input"></el-input> - </div> - <span class="form-text">细胞库</span> - </div> - </el-form-item> - </el-col> - <el-col :span="10"> - <el-form-item label="传代菌种编号" prop="strainCode"> - <el-input disabled v-model="planForm.strainCode"></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-row> - </el-form> - <div v-if="planForm.status !== 'detail'" class="dialog-footer"> - <el-button type="primary" @click="handleSubmit">提交</el-button> - </div> - </el-dialog> + <!-- 新增母代弹窗 --> + <el-dialog + :title="planForm.formStatus == 'add' ? '新增母代' : planForm.formStatus == 'edit' ? '编辑母代' : '母代详情'" + :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="24"> + <el-form-item label="菌种源" prop="strainSourceStart"> + <div class="input-group"> + <div class="input-wrapper"> + <el-input + disabled + v-model="planForm.strainSourceStart" + class="fixed-width-input" + ></el-input> + </div> + <span class="form-text">代—</span> + <div class="input-wrapper"> + <el-input + disabled + v-model="planForm.strainSourceEnd" + class="fixed-width-input" + ></el-input> + </div> + <span class="form-text">细胞库</span> + </div> + </el-form-item> + </el-col> + <el-col :span="10"> + <el-form-item label="传代菌种编号" prop="strainCode"> + <el-input disabled v-model="planForm.strainCode"></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 v-if="planForm.vaccinateSignature && planForm.formStatus == 'detail'" :span="10"> + <el-form-item label="接种操作人签字"> + <el-image :src="planForm.vaccinateSignature" /> + </el-form-item> + </el-col> + <el-col v-if="planForm.preserveSignature && planForm.formStatus == 'detail'" :span="10"> + <el-form-item label="菌种保藏人签字"> + <el-image :src="planForm.preserveSignature" /> + </el-form-item> + </el-col> + </el-row> + </el-form> + <div v-if="planForm.formStatus == 'add'" class="dialog-footer"> + <el-button type="primary" @click="handleSubmit">提交</el-button> + </div> + </el-dialog> </template> <script> export default { - data() { - return { - planDialogVisible: false, - planForm: { - strainCode: '', - strainName: '', - strainSourceStart: '', - strainSourceEnd: '', - isDiscarded: true - }, - planRules: { - strainCode: [ - { required: true, message: '请输入传代菌种编号', trigger: 'blur' } - ], - strainName: [ - { required: true, message: '请输入传代菌种名称', trigger: 'blur' } - ], - strainSourceStart: [ - { required: true, message: '请输入菌种源起始', trigger: 'blur' } - ], - strainSourceEnd: [ - { required: true, message: '请输入菌种源结束', trigger: 'blur' } - ] - } - } + data() { + return { + planDialogVisible: false, + planForm: { + strainCode: "", + strainName: "", + strainSourceStart: "", + strainSourceEnd: "", + isDiscarded: true, + }, + planRules: { + strainCode: [ + { required: true, message: "请输入传代菌种编号", trigger: "blur" }, + ], + strainName: [ + { required: true, message: "请输入传代菌种名称", trigger: "blur" }, + ], + strainSourceStart: [ + { required: true, message: "请输入菌种源起始", trigger: "blur" }, + ], + strainSourceEnd: [ + { required: true, message: "请输入菌种源结束", trigger: "blur" }, + ], + }, + }; + }, + methods: { + openInitData(value) { + this.planForm = { + ...this.planForm, + ...value, + }; + this.openDialog(); }, - methods: { - openInitData(value) { - this.planForm = { - ...this.planForm, - ...value - } - this.openDialog() - }, - openDialog() { - this.planDialogVisible = true - }, - closeDialog() { - this.planDialogVisible = false - // 重置表单数据 - this.planForm = { - strainCode: '', - strainName: '', - strainSourceStart: '', - strainSourceEnd: '', - isDiscarded: true - } - // 重置表单验证 - this.$refs.planForm && this.$refs.planForm.resetFields() - }, - handleSubmit() { - this.$refs.planForm.validate((valid) => { - if (valid) { - console.log(this.planForm,'22'); - - this.$emit('addNodeSign', this.planForm, 1) - } - }) - }, - handleStatus(status) { - if (this.planForm.status === 'detail') return - this.planForm.isDiscarded = status === 'save' - this.$forceUpdate() + openDialog() { + this.planDialogVisible = true; + }, + closeDialog() { + this.planDialogVisible = false; + // 重置表单数据 + this.planForm = { + strainCode: "", + strainName: "", + strainSourceStart: "", + strainSourceEnd: "", + isDiscarded: true, + }; + // 重置表单验证 + this.$refs.planForm && this.$refs.planForm.resetFields(); + }, + handleSubmit() { + this.$refs.planForm.validate((valid) => { + if (valid) { + console.log(this.planForm, "22"); + + this.$emit("addNodeSign", this.planForm, 1); } - } -} + }); + }, + handleStatus(status) { + if (this.planForm.formStatus === "detail") return; + this.planForm.isDiscarded = status === "save"; + this.$forceUpdate(); + }, + }, +}; </script> <style scoped lang="less"> .input-group { - display: flex; - align-items: center; - flex-wrap: wrap; + display: flex; + align-items: center; + flex-wrap: wrap; - @media (max-width: 768px) { - flex-direction: column; - align-items: flex-start; - width: 100%; - } + @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 (min-width: 769px) { + width: 290px; + min-width: 290px; + } - @media (max-width: 768px) { - width: 100%; - } + @media (max-width: 768px) { + width: 100%; + } } .fixed-width-input { - width: 100%; + width: 100%; - @media (min-width: 769px) { - width: 290px !important; - min-width: 290px !important; - } + @media (min-width: 769px) { + width: 290px !important; + min-width: 290px !important; + } } .form-text { - margin: 0 8px; - white-space: nowrap; + margin: 0 8px; + white-space: nowrap; - @media (max-width: 768px) { - margin: 8px 0; - } + @media (max-width: 768px) { + margin: 8px 0; + } } .dialog-footer { - margin-top: 39px; - display: flex; - justify-content: center; + margin-top: 39px; + display: flex; + justify-content: center; - .el-button--primary { - width: 150px; - height: 40px; - background: #049C9A; - border-radius: 4px; - } + .el-button--primary { + width: 150px; + height: 40px; + background: #049c9a; + border-radius: 4px; + } } .flex-row { - width: 370px; - display: flex; - align-items: center; - font-size: 16px; - color: #333333; - padding: 4px; + 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; - 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> \ No newline at end of file +</style> -- Gitblit v1.7.1