From 77e95d7cd23dc9e7bb21268ba90f7b6717414a24 Mon Sep 17 00:00:00 2001
From: 13404089107 <puwei@sinata.cn>
Date: 星期四, 29 五月 2025 11:38:53 +0800
Subject: [PATCH] 对接菌种验证数据资料接口
---
culture/src/views/strain-library/validation/primitive-cell/EditConditionDialog.vue | 15 +-
culture/src/views/strain-library/validation/primitive-cell/DetailConditionDialog.vue | 131 +++++++++---------
culture/src/components/confirm-storage-dialog/index.vue | 8 +
culture/src/views/strainReportLibrary/reportLibraryOneTWO/index.vue | 3
culture/src/router/index.js | 12 +
culture/src/views/strain-library/validation/primitive-cell/add.vue | 17 ++
culture/src/views/strain-library/validation/primitive-cell/index.vue | 40 ++++-
culture/src/views/strainReportLibrary/reportLibraryOne/index.vue | 3
culture/src/views/strain-library/validation/primitive-cell/confirm-detail.vue | 128 ++++++++++-------
culture/src/views/strainReportLibrary/reportLibraryOneFour/index.vue | 3
culture/src/views/strainReportLibrary/reportLibraryOneThree/index.vue | 3
culture/package.json | 2
culture/src/views/strain-library/validation/primitive-cell/service.js | 10 +
13 files changed, 234 insertions(+), 141 deletions(-)
diff --git a/culture/package.json b/culture/package.json
index 8210228..9ff049e 100644
--- a/culture/package.json
+++ b/culture/package.json
@@ -2,7 +2,7 @@
"name": "appointment",
"version": "0.1.0",
"private": true,
- "scripts": {
+ "scripts": {
"serve:dev": "cross-env VUE_APP_ENV=development vue-cli-service serve --port 8087",
"serve:prod": "cross-env VUE_APP_ENV=production vue-cli-service serve",
"build:dev": "cross-env VUE_APP_ENV=development vue-cli-service build",
diff --git a/culture/src/components/confirm-storage-dialog/index.vue b/culture/src/components/confirm-storage-dialog/index.vue
index bff6741..f174fea 100644
--- a/culture/src/components/confirm-storage-dialog/index.vue
+++ b/culture/src/components/confirm-storage-dialog/index.vue
@@ -3,6 +3,7 @@
:visible.sync="visible"
title="签字确认"
width="520px"
+ @open="handleOpen"
:close-on-click-modal="false"
custom-class="record-detail-dialog"
@close="handleClose"
@@ -65,6 +66,10 @@
type: String,
default: "",
},
+ handleSignature: {
+ type: String,
+ default:"",
+ }
},
data() {
return {
@@ -78,6 +83,9 @@
};
},
methods: {
+ handleOpen() {
+ this.form.signature = this.handleSignature;
+ },
handleClose() {
this.$emit("update:visible", false);
},
diff --git a/culture/src/router/index.js b/culture/src/router/index.js
index 50e7391..0132bbd 100644
--- a/culture/src/router/index.js
+++ b/culture/src/router/index.js
@@ -334,6 +334,18 @@
),
},
{
+ path: "edit-primitive-cell",
+ name: "AddPrimitiveCell",
+ meta: {
+ title: "编辑原始细胞库资料",
+ hide: true,
+ },
+ component: () =>
+ import(
+ "../views/strain-library/validation/primitive-cell/add.vue"
+ ),
+ },
+ {
path: "confirm-detail",
name: "ConfirmDetail",
meta: {
diff --git a/culture/src/views/strain-library/validation/primitive-cell/DetailConditionDialog.vue b/culture/src/views/strain-library/validation/primitive-cell/DetailConditionDialog.vue
index 4947fbf..661e170 100644
--- a/culture/src/views/strain-library/validation/primitive-cell/DetailConditionDialog.vue
+++ b/culture/src/views/strain-library/validation/primitive-cell/DetailConditionDialog.vue
@@ -1,21 +1,21 @@
<template>
- <el-dialog :visible.sync="visible" width="80%" @close="handleClose">
+ <el-dialog :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="8" class="info-col">
<div class="info-item">
- <span class="label">菌种来源:</span>{{ detail.source }}
+ <span class="label">菌种来源:</span>{{ detail.strainSource }}
</div>
<div class="info-item">
- <span class="label">鉴别菌株编号:</span>{{ detail.strainNo }}
+ <span class="label">鉴别菌株编号:</span>{{ detail.identifyingStrainCode }}
</div>
<div class="info-item">
- <span class="label">鉴别菌株名称:</span>{{ detail.strainName }}
+ <span class="label">鉴别菌株名称:</span>{{ detail.identifyingStrainName }}
</div>
</el-col>
<el-col :span="8" class="info-col">
<div class="info-item">
- <span class="label">验证实验编号:</span>{{ detail.verifyNo }}
+ <span class="label">验证实验编号:</span>{{ detail.validationExperimentCode }}
</div>
<div class="info-item">
<span class="label">实验时间:</span>{{ detail.experimentTime }}
@@ -28,7 +28,7 @@
</div>
<div class="info-item signature-item">
<div class="signature-area">
- <img v-if="detail.signature" :src="detail.signature" alt="签字" />
+ <img v-if="detail.handleSignature" :src="detail.handleSignature" alt="签字" />
<span v-else class="waiting-text">暂无签名</span>
</div>
</div>
@@ -36,35 +36,25 @@
</el-row>
</el-card>
<div class="section-card" style="margin-top: 24px">
- <el-form label-width="100px" label-position="top">
- <el-form-item label="实验结论">
- <el-input
- type="textarea"
- v-model="detail.conclusion"
- :rows="3"
- placeholder="请输入"
- />
+ <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="批准菌株用途">
- <el-checkbox-group v-model="detail.usage">
- <el-checkbox label="传代" />
- <el-checkbox label="菌种保藏" />
- <el-checkbox label="废弃" />
+ <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="condition" label="菌种培养工艺条件" />
+ <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="process" 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>
@@ -77,6 +67,7 @@
<script>
import DetailConditionDialog from "./DetailConditionDialog.vue";
+import { detail } from "./service.js";
export default {
name: "DetailConditionDialog",
components: { DetailConditionDialog },
@@ -86,47 +77,43 @@
type: Object,
default: () => ({ condition: "", record: "", process: "" }),
},
+ value: {
+ type: Object,
+ default: () => ({})
+ },
},
data() {
return {
detail: {
- source: "内容的内容内容内容",
- strainNo: "3411234",
- strainName: "名称名称名称",
- verifyNo: "34133214",
- experimentTime: "2025-1-23 11:10:28",
- signature: "", // 签名图片url
- conclusion: "",
- usage: [],
+ strainSource: '',
+ identifyingStrainCode: '',
+ identifyingStrainName: '',
+ validationExperimentCode: '',
+ experimentTime: '',
+ handleSignature: '', // 签名图片url
+ result: '',
+ purpose: []
},
- activeTab: "condition",
+ activeTab: "conditions",
initialTableData: [
- {
- condition: "平板培养基",
- record: "文字内容文字内容文字内容文字内容文字内容文字内容",
- process: "文字内容文字内容文字内容文字内容文字内容文字内容",
- },
- { condition: "培养温度", record: "", process: "" },
- { condition: "培养时间", record: "", process: "" },
- { condition: "摇瓶培养基", record: "", process: "" },
- { condition: "接种量", record: "", process: "" },
- { condition: "培养时间", record: "", process: "" },
- { condition: "发酵时间", record: "", process: "" },
- { condition: "检测数据及结果", record: "", process: "" },
+ { 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: [
- {
- condition: "平板培养基",
- record: "文字内容文字内容文字内容文字内容文字内容文字内容",
- process: "文字内容文字内容文字内容文字内容文字内容文字内容",
- },
- { condition: "培养温度", record: "", process: "" },
- { condition: "培养时间", record: "", process: "" },
- { condition: "摇瓶培养基", record: "", process: "" },
- { condition: "接种量", record: "", process: "" },
- { condition: "培养时间", record: "", process: "" },
- { condition: "发酵时间", record: "", process: "" },
- { condition: "检测数据及结果", record: "", process: "" },
+ { 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,
@@ -136,18 +123,26 @@
};
},
methods: {
+ handleOpen() {
+ if (this.value.id) {
+ detail({ id: this.value.id }).then(res => {
+ this.detail = {
+ ...res,
+ handleSignature: res.handleSignature || '', // 处理签名为空的情况
+ purpose: res.purpose.split(',') || [] // 处理 purpose 为空的情况
+ }
+ this.tableData = res.list || []
+ })
+ }
+ },
handleClose() {
this.$emit("update:visible", false);
},
handleEdit(row) {
- const idx = this.tableData.indexOf(row);
- this.dialogVisible = true;
- this.dialogIsEdit = true;
- this.dialogIsFixed = idx < this.initialTableData.length;
- this.dialogValue = { ...row };
- this.dialogIndex = idx;
+
+ this.$emit("viewDetail", row);
},
-
+
handleSave() {
this.dialogVisible = true;
this.dialogIsEdit = false;
@@ -176,6 +171,7 @@
.el-dialog__body {
padding-bottom: 0;
}
+
.top-card {
margin-bottom: 0;
background: rgba(239, 239, 239, 1);
@@ -257,6 +253,7 @@
padding: 24px;
padding-bottom: 0;
gap: 24px;
+
.el-button {
width: 150px;
}
diff --git a/culture/src/views/strain-library/validation/primitive-cell/EditConditionDialog.vue b/culture/src/views/strain-library/validation/primitive-cell/EditConditionDialog.vue
index a841893..10a410a 100644
--- a/culture/src/views/strain-library/validation/primitive-cell/EditConditionDialog.vue
+++ b/culture/src/views/strain-library/validation/primitive-cell/EditConditionDialog.vue
@@ -2,17 +2,18 @@
<el-dialog :visible.sync="visible" width="800px" @close="handleClose">
<el-form label-width="120px" label-position="top">
<el-form-item label="菌种培养工艺条件">
- <el-input v-model="form.condition" :disabled="isFixed" placeholder="请输入" />
+ <el-input v-model="form.conditions" :disabled="isFixed || value.isDetail" placeholder="请输入" />
</el-form-item>
<el-form-item label="菌种培养工艺实况记录">
- <el-input type="textarea" v-model="form.record" :rows="7" placeholder="请输入文本内容" />
+ <el-input type="textarea" :disabled="value.isDetail" v-model="form.record" :rows="7" placeholder="请输入文本内容" />
</el-form-item>
<el-form-item label="菌种培养标准工艺">
- <el-input type="textarea" v-model="form.process" :rows="7" placeholder="请输入文本内容" />
+ <el-input type="textarea" :disabled="value.isDetail" v-model="form.workmanship" :rows="7" placeholder="请输入文本内容" />
</el-form-item>
</el-form>
<div style="text-align: center; margin-top: 24px;">
- <el-button type="primary" @click="handleOk">保存</el-button>
+ <el-button v-if="value.isDetail" @click="handleClose">关闭</el-button>
+ <el-button type="primary" v-if="!value.isDetail" @click="handleOk">保存</el-button>
</div>
</el-dialog>
</template>
@@ -26,12 +27,12 @@
isFixed: Boolean, // true: 固定的8个条件,false: 新增条件
value: {
type: Object,
- default: () => ({ condition: '', record: '', process: '' })
+ default: () => ({ conditions: '', record: '', workmanship: '' })
}
},
data() {
return {
- form: { condition: '', record: '', process: '' }
+ form: { conditions: '', record: '', workmanship: '' }
}
},
watch: {
@@ -43,7 +44,7 @@
},
visible(val) {
if (!val) {
- this.form = { condition: '', record: '', process: '' }
+ this.form = { conditions: '', record: '', workmanship: '' }
}
}
},
diff --git a/culture/src/views/strain-library/validation/primitive-cell/add.vue b/culture/src/views/strain-library/validation/primitive-cell/add.vue
index 473265d..aff75fe 100644
--- a/culture/src/views/strain-library/validation/primitive-cell/add.vue
+++ b/culture/src/views/strain-library/validation/primitive-cell/add.vue
@@ -38,8 +38,8 @@
</el-form>
<!-- 签字确认组件 -->
- <ConfirmStorageDialog :visible.sync="signatureVisible" @confirm="handleSignatureConfirm" name="操作人签字"
- text="是否确认提交该项原始细胞库资料信息?" />
+ <ConfirmStorageDialog :visible.sync="signatureVisible" :handleSignature="form.handleSignature"
+ @confirm="handleSignatureConfirm" name="操作人签字" text="是否确认提交该项原始细胞库资料信息?" />
</Card>
</template>
@@ -65,7 +65,8 @@
identifyingStrainCode: '', // 鉴别菌株编号
identifyingStrainName: '', // 鉴别菌株名称
validationExperimentCode: '', // 验证实验编号
- experimentTime: '' // 实验时间
+ experimentTime: '', // 实验时间
+ handleSignature: '', // 签名图片url
},
rules: {
strainSource: [{ required: true, message: '请输入菌种来源', trigger: 'blur' }],
@@ -76,6 +77,16 @@
}
}
},
+ mounted() {
+ if (this.$route.query.id) {
+ detail({ id: this.$route.query.id }).then(res => {
+ if (res) {
+ // 这里根据实际接口返回字段做适配
+ this.form = res
+ }
+ })
+ }
+ },
methods: {
handleSubmit() {
this.$refs.strainForm.validate((valid) => {
diff --git a/culture/src/views/strain-library/validation/primitive-cell/confirm-detail.vue b/culture/src/views/strain-library/validation/primitive-cell/confirm-detail.vue
index f6e0cec..755def6 100644
--- a/culture/src/views/strain-library/validation/primitive-cell/confirm-detail.vue
+++ b/culture/src/views/strain-library/validation/primitive-cell/confirm-detail.vue
@@ -3,12 +3,12 @@
<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.source }}</div>
- <div class="info-item"><span class="label">鉴别菌株编号:</span>{{ detail.strainNo }}</div>
- <div class="info-item"><span class="label">鉴别菌株名称:</span>{{ detail.strainName }}</div>
+ <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="8" class="info-col">
- <div class="info-item"><span class="label">验证实验编号:</span>{{ detail.verifyNo }}</div>
+ <div class="info-item"><span class="label">验证实验编号:</span>{{ detail.validationExperimentCode }}</div>
<div class="info-item"><span class="label">实验时间:</span>{{ detail.experimentTime }}</div>
<div class="info-item"></div>
</el-col>
@@ -16,7 +16,7 @@
<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.signature" :src="detail.signature" alt="签字" />
+ <img v-if="detail.handleSignature" :src="detail.handleSignature" alt="签字" />
<span v-else class="waiting-text">暂无签名</span>
</div>
</div>
@@ -24,15 +24,15 @@
</el-row>
</el-card>
<div class="section-card" style="margin-top: 24px;">
- <el-form label-width="100px" label-position="top">
- <el-form-item label="实验结论">
- <el-input type="textarea" v-model="detail.conclusion" :rows="3" placeholder="请输入" />
+ <el-form ref="form" label-width="100px" :model="detail" :rules="rules" label-position="top">
+ <el-form-item label="实验结论" prop="result">
+ <el-input type="textarea" v-model="detail.result" :rows="3" placeholder="请输入" />
</el-form-item>
- <el-form-item label="批准菌株用途">
- <el-checkbox-group v-model="detail.usage">
- <el-checkbox label="传代" />
- <el-checkbox label="菌种保藏" />
- <el-checkbox label="废弃" />
+ <el-form-item label="批准菌株用途" prop="purpose">
+ <el-checkbox-group 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>
@@ -48,13 +48,13 @@
<div class="section-card" style="margin-top: 12px;">
<el-table :data="tableData" border style="width: 100%;" :row-class-name="getRowClassName">
- <el-table-column prop="condition" label="菌种培养工艺条件" />
+ <el-table-column prop="conditions" label="菌种培养工艺条件" />
<el-table-column prop="record" label="菌种培养工艺实况记录" />
- <el-table-column prop="process" 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>
- <el-button type="text" @click="handleDetail(row)">详情2</el-button>
+ <el-button type="text" @click="handleEdit(row)">详情</el-button>
</template>
</el-table-column>
</el-table>
@@ -63,52 +63,60 @@
<el-button type="primary" @click="handleSave">保存</el-button>
<el-button @click="handleDraft">存稿</el-button>
</div>
- <DetailConditionDialog
+ <!-- <DetailConditionDialog
:visible.sync="detailDialogVisible"
:value="detailDialogValue"
- />
+ /> -->
</Card>
</template>
<script>
import EditConditionDialog from './EditConditionDialog.vue'
import DetailConditionDialog from './DetailConditionDialog.vue'
-import { detail } from './service'
+import { detail,confirm } from './service'
export default {
name: 'ConfirmDetail',
components: { EditConditionDialog, DetailConditionDialog },
data() {
return {
detail: {
- source: '内容的内容内容内容',
- strainNo: '3411234',
- strainName: '名称名称名称',
- verifyNo: '34133214',
- experimentTime: '2025-1-23 11:10:28',
- signature: '', // 签名图片url
- conclusion: '',
- usage: []
+ strainSource: '',
+ identifyingStrainCode: '',
+ identifyingStrainName: '',
+ validationExperimentCode: '',
+ experimentTime: '',
+ handleSignature: '', // 签名图片url
+ result:'',
+ purpose: []
},
- activeTab: 'condition',
+ activeTab: 'conditions',
+ rules: {
+ result: [
+ { required: true, message: '请输入实验结论', trigger: 'blur' }
+ ],
+ purpose: [
+ { required: true, message: '请选择菌种用途', trigger: 'change' }
+ ]
+ },
initialTableData: [
- { condition: '平板培养基', record: '文字内容文字内容文字内容文字内容文字内容文字内容', process: '文字内容文字内容文字内容文字内容文字内容文字内容' },
- { condition: '培养温度', record: '', process: '' },
- { condition: '培养时间', record: '', process: '' },
- { condition: '摇瓶培养基', record: '', process: '' },
- { condition: '接种量', record: '', process: '' },
- { condition: '培养时间', record: '', process: '' },
- { condition: '发酵时间', record: '', process: '' },
- { condition: '检测数据及结果', record: '', process: '' }
+ { 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: [
- { condition: '平板培养基', record: '文字内容文字内容文字内容文字内容文字内容文字内容', process: '文字内容文字内容文字内容文字内容文字内容文字内容' },
- { condition: '培养温度', record: '', process: '' },
- { condition: '培养时间', record: '', process: '' },
- { condition: '摇瓶培养基', record: '', process: '' },
- { condition: '接种量', record: '', process: '' },
- { condition: '培养时间', record: '', process: '' },
- { condition: '发酵时间', record: '', process: '' },
- { condition: '检测数据及结果', record: '', process: '' }
+ { 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,
@@ -125,14 +133,18 @@
methods: {
getDetail() {
detail({id: this.$route.query.id}).then(res => {
- this.detail = res.data
+ this.detail = {
+ ...res,
+ handleSignature: res.handleSignature || '', // 处理签名为空的情况
+ purpose: res.purpose || [] // 处理 purpose 为空的情况
+ }
})
},
handleEdit(row) {
const idx = this.tableData.indexOf(row)
this.dialogVisible = true
this.dialogIsEdit = true
- this.dialogIsFixed = idx < this.initialTableData.length
+ this.dialogIsFixed = idx < this.initialTableData?.length
this.dialogValue = { ...row }
this.dialogIndex = idx
},
@@ -141,11 +153,23 @@
this.detailDialogValue = { ...row }
},
handleSave() {
- this.dialogVisible = true
- this.dialogIsEdit = false
- this.dialogIsFixed = false
- this.dialogValue = { condition: '', record: '', process: '' }
- this.dialogIndex = null
+ this.$refs.form.validate((valid) => {
+ if (valid) {
+ this.detail.list = this.tableData || []
+ this.detail.purpose = this.detail.purpose.join(',')
+ confirm({...this.detail}).then(res => {
+ if (res.code == 200) {
+ this.$message.success('保存成功');
+ this.$router.back()
+ } else {
+ this.$message.error(res.msg);
+ }
+ })
+ } else {
+ this.$message.error('请填写必填项');
+ return false;
+ }
+ });
},
handleDraft() {
// 存稿逻辑
@@ -158,7 +182,7 @@
}
},
getRowClassName({ rowIndex }) {
- return rowIndex < this.initialTableData.length ? 'fixed-row' : '';
+ return rowIndex < this.initialTableData?.length ? 'fixed-row' : '';
}
}
}
diff --git a/culture/src/views/strain-library/validation/primitive-cell/index.vue b/culture/src/views/strain-library/validation/primitive-cell/index.vue
index 3f4d3fa..ad5052b 100644
--- a/culture/src/views/strain-library/validation/primitive-cell/index.vue
+++ b/culture/src/views/strain-library/validation/primitive-cell/index.vue
@@ -54,18 +54,20 @@
</el-table-column>
<el-table-column label="操作" width="200">
<template #default="{ row }">
- <el-button type="text" @click="$router.push('/strain/validation/confirm-detail')">确认</el-button>
+ <el-button type="text"
+ @click="$router.push('/strain/validation/confirm-detail?id=' + row.id)">确认</el-button>
<el-button type="text" @click="handleDetail(row)">详情</el-button>
<el-button type="text" @click="handleDetail2(row)">详情</el-button>
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
- <el-button type="text" @click="handleRecord(row)">删除</el-button>
+ <el-button type="text" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column>
</template>
</TableCustom>
<PrimitiveCellDetailDialog :visible.sync="detailVisible" :detail="currentDetail" />
- <DetailConditionDialog :visible.sync="detailDialogVisible" :value="detailDialogValue" />
+ <DetailConditionDialog @viewDetail="viewDetail" :visible.sync="detailDialogVisible" :value="detailDialogValue" />
<EditConditionDialog :visible.sync="editDialogVisible" :value="editDialogValue" />
+ <ShowDelConfirm :show="showDelConfirm" @close="showDelConfirm = false" @confirm="handleDelConfirm" />
</div>
</template>
@@ -74,7 +76,7 @@
import DetailConditionDialog from "./DetailConditionDialog.vue";
import EditConditionDialog from "./EditConditionDialog.vue";
-import { getList } from "./service";
+import { getList, delTwo } from "./service";
export default {
name: "PrimitiveCell",
components: {
@@ -89,6 +91,9 @@
dialogVisible: false,
currentType: "list",
detailVisible: false,
+ editDialogVisible: false,
+ showDelConfirm: false,
+ editDialogValue: {},
currentDetail: {},
form: {
identifyingStrainCode: "",
@@ -118,6 +123,11 @@
},
handleViewMore() {
this.dialogVisible = true;
+ },
+ viewDetail(row) {
+ row.isDetail = true;
+ this.editDialogValue = row;
+ this.editDialogVisible = true;
},
resetForm() {
this.form = {
@@ -154,15 +164,27 @@
// Implement batch add logic
},
handleEdit(row) {
- // Implement edit logic
- },
- handleRecord(row) {
this.$router.push({
- path: "/strain-library/strain-library-manage/record",
+ path: "/strain/validation/edit-primitive-cell",
query: {
- id: row.strainNo,
+ id: row.id,
},
});
+ // Implement edit logic
+ },
+ handleDelete(row) {
+ this.currentDetail = row;
+ this.showDelConfirm = true;
+ },
+ handleDelConfirm() {
+ delTwo({ id: this.currentDetail.id }).then(res => {
+ this.$message.success('删除成功')
+ this.showDelConfirm = false
+ if(this.tableData.length == 1 && this.queryForm.pageNum > 1) {
+ this.queryForm.pageNum -= 1;
+ }
+ this.searchData()
+ })
},
handleCurrentChange(page) {
this.queryForm.pageNum = page;
diff --git a/culture/src/views/strain-library/validation/primitive-cell/service.js b/culture/src/views/strain-library/validation/primitive-cell/service.js
index 9c87ddf..6905660 100644
--- a/culture/src/views/strain-library/validation/primitive-cell/service.js
+++ b/culture/src/views/strain-library/validation/primitive-cell/service.js
@@ -13,12 +13,12 @@
//编辑
export const edit = (data) => {
- return axios.post('/api/t-strain-validation-data/edit', { ...data })
+ return axios.post('/api/t-strain-validation-data/updateOriginal', { ...data })
}
//详情
export const detail = (data) => {
- return axios.get('/api/t-strain-validation-data/detail', { params: { id: data.id } })
+ return axios.get('/open/t-strain-validation-data/getDetailById', { params: { id: data.id } })
}
//主细胞删除
@@ -32,4 +32,10 @@
}
+// 确认
+export const confirm = (data) => {
+ console.log('data', data)
+ return axios.post('/api/t-strain-validation-data/confirm', { ...data })
+}
+
diff --git a/culture/src/views/strainReportLibrary/reportLibraryOne/index.vue b/culture/src/views/strainReportLibrary/reportLibraryOne/index.vue
index d95bda6..27363ec 100644
--- a/culture/src/views/strainReportLibrary/reportLibraryOne/index.vue
+++ b/culture/src/views/strainReportLibrary/reportLibraryOne/index.vue
@@ -163,6 +163,9 @@
deleteReport({ id: this.rowId }).then(res => {
this.showDelConfirm = false
this.$message.success('删除成功')
+ if (this.queryForm.pageNum > 1 && this.tableData.length === 1) {
+ this.queryForm.pageNum = this.queryForm.pageNum - 1
+ }
this.rowId = ''
this.getLists()
})
diff --git a/culture/src/views/strainReportLibrary/reportLibraryOneFour/index.vue b/culture/src/views/strainReportLibrary/reportLibraryOneFour/index.vue
index c52cbbe..498bae6 100644
--- a/culture/src/views/strainReportLibrary/reportLibraryOneFour/index.vue
+++ b/culture/src/views/strainReportLibrary/reportLibraryOneFour/index.vue
@@ -179,6 +179,9 @@
deleteReport({ id: this.rowId }).then(res => {
this.showDelConfirm = false
this.$message.success('删除成功')
+ if (this.queryForm.pageNum > 1 && this.tableData.length === 1) {
+ this.queryForm.pageNum = this.queryForm.pageNum - 1
+ }
this.rowId = ''
this.getLists()
})
diff --git a/culture/src/views/strainReportLibrary/reportLibraryOneTWO/index.vue b/culture/src/views/strainReportLibrary/reportLibraryOneTWO/index.vue
index 5147c40..4e8c129 100644
--- a/culture/src/views/strainReportLibrary/reportLibraryOneTWO/index.vue
+++ b/culture/src/views/strainReportLibrary/reportLibraryOneTWO/index.vue
@@ -178,6 +178,9 @@
deleteReport({ id: this.rowId }).then(res => {
this.showDelConfirm = false
this.$message.success('删除成功')
+ if (this.queryForm.pageNum > 1 && this.tableData.length === 1) {
+ this.queryForm.pageNum = this.queryForm.pageNum - 1
+ }
this.rowId = ''
this.getLists()
})
diff --git a/culture/src/views/strainReportLibrary/reportLibraryOneThree/index.vue b/culture/src/views/strainReportLibrary/reportLibraryOneThree/index.vue
index 07790f2..4ef6c49 100644
--- a/culture/src/views/strainReportLibrary/reportLibraryOneThree/index.vue
+++ b/culture/src/views/strainReportLibrary/reportLibraryOneThree/index.vue
@@ -179,6 +179,9 @@
deleteReport({ id: this.rowId }).then(res => {
this.showDelConfirm = false
this.$message.success('删除成功')
+ if (this.queryForm.pageNum > 1 && this.tableData.length === 1) {
+ this.queryForm.pageNum = this.queryForm.pageNum - 1
+ }
this.rowId = ''
this.getLists()
})
--
Gitblit v1.7.1