| | |
| | | <Card class="confirm-detail-page"> |
| | | <el-card class="top-card"> |
| | | <el-row :gutter="24" class="top-info-row"> |
| | | <el-col :span="8" class="info-col"> |
| | | <!-- <div class="info-item"><span class="label">菌种来源:</span>{{ detail.strainSource }}</div>--> |
| | | <el-col :span="24" class="info-col source-col"> |
| | | <div class="info-item source-item"> |
| | | <span class="label">菌种来源:</span> |
| | | <el-tooltip |
| | |
| | | <span class="source-text">{{ detail.strainSource || '暂无数据' }}</span> |
| | | </el-tooltip> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="8" class="info-col"> |
| | | <div class="info-item"><span class="label">鉴别菌株编号:</span>{{ detail.identifyingStrainCode }}</div> |
| | | <div class="info-item"><span class="label">鉴别菌株名称:</span>{{ detail.identifyingStrainName }}</div> |
| | | </el-col> |
| | |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="6" class="info-col"> |
| | | <el-col :span="8" class="info-col"> |
| | | <div class="info-item"> |
| | | <span class="label">签字时间:</span>{{ detail.handleTime }} |
| | | </div> |
| | |
| | | components: { EditConditionDialog, DetailConditionDialog }, |
| | | data() { |
| | | return { |
| | | cacheForm: null, |
| | | detail: { |
| | | strainSource: '', |
| | | identifyingStrainCode: '', |
| | |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getDetail() |
| | | activated() { |
| | | if (this.cacheForm) { |
| | | this.detail = this.cacheForm; |
| | | } |
| | | if (this.$route.query.id && !this.cacheForm) { |
| | | this.getDetail(); |
| | | } |
| | | }, |
| | | deactivated() { |
| | | this.cacheForm = JSON.parse(JSON.stringify(this.detail)); |
| | | }, |
| | | methods: { |
| | | getFullUrl(url) { |
| | |
| | | }, |
| | | getDetail() { |
| | | detail({id: this.$route.query.id}).then(res => { |
| | | const data = res.data || res |
| | | const purpose = Array.isArray(data.purpose) |
| | | ? data.purpose |
| | | : String(data.purpose || '').split(',').filter(Boolean).map(Number) |
| | | this.detail = { |
| | | ...res, |
| | | handleSignature: res.handleSignature || '', // 处理签名为空的情况 |
| | | purpose: res.purpose || [] // 处理 purpose 为空的情况 |
| | | ...data, |
| | | handleSignature: data.handleSignature || '', |
| | | purpose |
| | | } |
| | | if (Array.isArray(data.list) && data.list.length) { |
| | | this.tableData = data.list.map(item => ({ ...item })) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | handleSave() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.detail.list = this.tableData || [] |
| | | this.detail.purpose = this.detail.purpose.join(',') |
| | | confirm({...this.detail}).then(res => { |
| | | const payload = { |
| | | ...this.detail, |
| | | list: this.tableData || [], |
| | | purpose: (this.detail.purpose || []).join(','), |
| | | isDraft: 0 |
| | | } |
| | | confirm(payload).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('保存成功'); |
| | | this.$router.back() |
| | | this.cacheForm = null |
| | | this.$closeCurrentView('/strain/validation/chief-cell') |
| | | } else { |
| | | this.$message.error(res.msg); |
| | | } |