Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory
| | |
| | | loginReq(this.loginForm).then(res => { |
| | | sessionStorage.setItem('token', res.token) |
| | | sessionStorage.setItem('userInfo', JSON.stringify(res.userInfo.user)) |
| | | this.$router.push('/projectList') |
| | | this.$router.replace('/middleground') |
| | | }) |
| | | } |
| | | } |
| | |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | <div class="card" style="margin-top: 30px"> |
| | | <Table :height="null" :total="0" :tableData="tableData"> |
| | | <el-table-column label="接种操作人" prop="strainSource" /> |
| | | <el-table-column label="接种操作时间" prop="strainCode" /> |
| | | <el-table-column label="传代菌种编号" prop="strainName" /> |
| | | <el-table-column label="传代菌种名称" prop="strainName" /> |
| | | <el-table-column label="接种菌种编号" prop="strainName" /> |
| | | <el-table-column label="接种菌种名称" prop="strainName" /> |
| | | <el-table-column label="入库总数" prop="strainName" /> |
| | | <el-table-column label="保存/废弃" prop="strainName" /> |
| | | <el-table-column label="入库时间" prop="strainName" /> |
| | | <el-table-column label="操作"> |
| | | <div class="card" v-if="roleType != 4" style="margin-top: 30px; display: block"> |
| | | <Table |
| | | :height="null" |
| | | :total="total" |
| | | :data="tableData" |
| | | :queryForm="queryForm" |
| | | @handleCurrentChange="handleCurrentChange" |
| | | @handleSizeChange="handleSizeChange" |
| | | > |
| | | <el-table-column label="菌种实验员" prop="experimenter" /> |
| | | <el-table-column label="菌种编号" prop="strainCode" /> |
| | | <el-table-column label="菌种名称" prop="strainName" /> |
| | | <el-table-column label="保存/废弃"> |
| | | <template #default="{ row }"> |
| | | <el-button type="text">确认入库</el-button> |
| | | {{ row.status === 1 ? "保存" : "废弃" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="菌种保存/废弃时间" prop="storageTime" /> |
| | | <el-table-column v-if="roleType == 3" label="操作"> |
| | | <template #default="{ row }"> |
| | | <el-button type="text" @click="handleConfirm(row)" |
| | | >确认入库</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </Table> |
| | |
| | | <el-button type="primary" class="el-icon-plus" @click="addNode"> |
| | | 新增</el-button |
| | | > |
| | | |
| | | <el-button type="primary" @click="setGenerationPlan" |
| | | >设置传代计划数</el-button |
| | | > |
| | | <el-button type="primary" @click="showDetail">详情</el-button> |
| | | <el-button type="primary" @click="handleEdit" v-if="roleType == 1">编辑</el-button> |
| | | <el-button type="primary" @click="handleDelete" v-if="roleType == 1">删除</el-button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="strain-flow-chart"> |
| | | <div id="mountNode"></div> |
| | | </div> |
| | | <el-button type="primary" @click="handleSubmit" style="width: 150px" |
| | | |
| | | <el-button type="primary" v-if="!$route.query.id" @click="handleSubmit" style="width: 150px" |
| | | >保存</el-button |
| | | > |
| | | </div> |
| | |
| | | name="菌种保藏人签字" |
| | | text="是否确认该项菌种信息入库" |
| | | :visible.sync="storageVisible" |
| | | @confirm="handleSignatureConfirm" |
| | | @confirm="handleSignatureConfirm1" |
| | | /> |
| | | </div> |
| | | </template> |
| | |
| | | import AddSublevelForm from "./components/AddSublevelForm.vue"; |
| | | import AddSublevelPlan from "./components/AddSublevelPlan.vue"; |
| | | import ConfirmStorageDialog from "@/components/confirm-storage-dialog"; |
| | | import { add } from "./service"; |
| | | import { |
| | | add, |
| | | getDetail, |
| | | addProgenitorChild, |
| | | addProgenitor, |
| | | pageListDetail, |
| | | confirmStorage, |
| | | deleteNode, |
| | | updateChild, |
| | | } from "./service"; |
| | | export default { |
| | | name: "AddPedigree", |
| | | components: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | queryForm: { |
| | | pageSize: 10, |
| | | pageNum: 1, |
| | | }, |
| | | signatureVisible: false, |
| | | form: { |
| | | strainSourceStart: "", |
| | |
| | | confirmStorageDialogVisible: false, |
| | | storageVisible: false, |
| | | treeData: [], |
| | | total: 0, |
| | | roleType: JSON.parse(sessionStorage.getItem('userInfo')).roleType || 1, // 1.超级管理员 2.审批人 3.工程师 4.实验员 |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | this.initGraph(); |
| | | this.initEvents(); |
| | | }, |
| | | created() { |
| | | |
| | | if (this.$route.query.id) { |
| | | this.reloadData(); |
| | | } |
| | | }, |
| | | beforeDestroy() { |
| | | this.graph?.destroy(); |
| | | window.removeEventListener("resize", this.handleResize); |
| | | }, |
| | | methods: { |
| | | handleEdit() { |
| | | if (!this.selectedNode) { |
| | | this.$message.warning("请先选择节点"); |
| | | return; |
| | | } |
| | | const nodeModel = this.selectedNode; |
| | | console.log(nodeModel); |
| | | |
| | | if (nodeModel.label === "母代") { |
| | | this.$refs.parentForm.openInitData({ |
| | | strainSourceStart: this.form.strainSourceStart, |
| | | strainSourceEnd: this.form.strainSourceEnd, |
| | | ...nodeModel.data, |
| | | formStatus: "edit", |
| | | }); |
| | | } else if (nodeModel.label === "子代" || nodeModel.label === "孙代") { |
| | | this.dialogTitle = `${nodeModel.label}详情`; |
| | | this.$refs.addSublevelForm.openInitData({ |
| | | strainCode1: this.form.strainCode, |
| | | strainName1: this.form.strainName, |
| | | title: `编辑${nodeModel.label}`, |
| | | form: { ...nodeModel.data }, |
| | | formStatus: "edit", |
| | | }); |
| | | } else if (nodeModel.label === "传代计划数") { |
| | | const nodeIndex = this.graphData.nodes.findIndex( |
| | | (n) => n.nodeId === nodeModel.nodeId |
| | | ); |
| | | if (this.graphData.nodes[nodeIndex - 1].label === "子代") { |
| | | this.$refs.addSublevelPlan.openInitData({ |
| | | strainSourceStart: this.form.strainSourceStart, |
| | | strainCode1: this.form.strainCode, |
| | | strainName1: this.form.strainName, |
| | | strainSourceEnd: this.form.strainSourceEnd, |
| | | confirmTime: this.form.confirmTime, |
| | | parentId: nodeModel.id, |
| | | formStatus: "edit", |
| | | }); |
| | | } else { |
| | | this.$refs.planForm.openInitData({ |
| | | strainSourceStart: this.form.strainSourceStart, |
| | | strainSourceEnd: this.form.strainSourceEnd, |
| | | strainCode1: this.form.strainCode, |
| | | strainName1: this.form.strainName, |
| | | ...nodeModel.data, |
| | | formStatus: "edit", |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | handleDelete() { |
| | | if (!this.selectedNode) { |
| | | this.$message.warning("请先选择节点"); |
| | | return; |
| | | } |
| | | this.$confirm("确定删除该节点吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | deleteNode({ id: this.selectedNode.id }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("删除成功"); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | handleConfirm(row) { |
| | | this.comfirmId = row.id; |
| | | this.storageVisible = true; |
| | | }, |
| | | handleSignatureConfirm1(signatureImage) { |
| | | confirmStorage({ |
| | | id: this.comfirmId, |
| | | preserveSignature: signatureImage.signature, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("确认入库成功"); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | }, |
| | | // 处理每页显示数量变化 |
| | | handleSizeChange(val) { |
| | | this.size = val; |
| | | this.queryForm.pageSize = val; |
| | | this.getList(); |
| | | }, |
| | | |
| | | // 处理页码变化 |
| | | handleCurrentChange(val) { |
| | | this.current = val; |
| | | this.queryForm.pageNum = val; |
| | | this.getList(); |
| | | }, |
| | | async getList() { |
| | | try { |
| | | // 获取列表数据 |
| | | const listRes = await pageListDetail({ |
| | | id: this.$route.query.id, |
| | | current: this.current, |
| | | size: this.size, |
| | | }); |
| | | |
| | | if (listRes.code === 200) { |
| | | this.tableData = listRes.data.records; |
| | | this.total = listRes.data.total; |
| | | this.current = listRes.data.current; |
| | | this.size = listRes.data.size; |
| | | } |
| | | |
| | | // ... 其他现有的 reloadData 代码 ... |
| | | } catch (error) { |
| | | console.error("Failed to reload data:", error); |
| | | this.$message.error("数据加载失败"); |
| | | } |
| | | }, |
| | | reloadData() { |
| | | this.getList(); |
| | | getDetail({ id: this.$route.query.id }).then((res) => { |
| | | console.log(JSON.stringify(res.pedigreeChartParentAllDetailDTO)); |
| | | |
| | | const nodeMap = new Map(); |
| | | const calculateLevel = (node) => { |
| | | if (node.parentId === "0") return 0; |
| | | const parent = nodeMap.get(node.parentId); |
| | | if (!parent) return 0; |
| | | return calculateLevel(parent) + 1; |
| | | }; |
| | | |
| | | // 首先创建所有节点的映射 |
| | | const createNodeMap = (nodes) => { |
| | | nodes.forEach((node) => { |
| | | nodeMap.set(node.id, node); |
| | | if (node.children) { |
| | | createNodeMap(node.children); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const processNode = (node) => { |
| | | const nodeId = node.id; // 直接使用后端返回的id |
| | | const level = calculateLevel(node); |
| | | let label = ""; |
| | | |
| | | if (level === 0) { |
| | | label = "母代"; |
| | | } else if (level === 1) { |
| | | label = node.generationCount !== null ? "传代计划数" : "子代"; |
| | | } else if (level === 2) { |
| | | label = "子代"; |
| | | } else if (level === 3) { |
| | | label = node.generationCount !== null ? "传代计划数" : "孙代"; |
| | | } else if (level === 4) { |
| | | label = "孙代"; |
| | | } |
| | | |
| | | return { |
| | | nodeId, |
| | | label, |
| | | number: node.strainCode, |
| | | data: node, |
| | | status: node.status, |
| | | planCount: node.generationCount, |
| | | currentCount: 0, |
| | | style: { |
| | | fill: node.status === 1 ? "#00B5AA" : "#999", |
| | | opacity: node.status === 1 ? (level === 0 ? 1 : level === 1 ? 0.6 : 0.4) : 0.3, |
| | | }, |
| | | }; |
| | | }; |
| | | |
| | | // 重置数据 |
| | | this.graphData.nodes = []; |
| | | this.graphData.edges = []; |
| | | |
| | | if (res.pedigreeChartParentAllDetailDTO && res.pedigreeChartParentAllDetailDTO.one) { |
| | | // 创建节点映射 |
| | | createNodeMap(res.pedigreeChartParentAllDetailDTO.one); |
| | | |
| | | // 处理所有节点 |
| | | const processAllNodes = (nodes) => { |
| | | nodes.forEach(node => { |
| | | const processedNode = processNode(node); |
| | | this.graphData.nodes.push(processedNode); |
| | | |
| | | // 根据parentId创建边,直接使用原始id |
| | | if (node.parentId !== "0") { |
| | | this.graphData.edges.push({ |
| | | source: node.parentId, |
| | | target: node.id, |
| | | style: { |
| | | stroke: "rgba(4, 156, 154, 1)", |
| | | lineWidth: 1, |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | if (node.children) { |
| | | processAllNodes(node.children); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 处理所有节点 |
| | | processAllNodes(res.pedigreeChartParentAllDetailDTO.one); |
| | | } |
| | | |
| | | this.form = { |
| | | strainSourceStart: res.strainSourceStart, |
| | | strainSourceEnd: res.strainSourceEnd, |
| | | strainCode: res.strainCode, |
| | | strainName: res.strainName, |
| | | }; |
| | | |
| | | // 更新图表 |
| | | this.updateGraphData(); |
| | | }); |
| | | }, |
| | | addNodeSign(value, type) { |
| | | this.nodeData = value; |
| | | this.nodeType = type; |
| | |
| | | } |
| | | |
| | | // 处理节点数据,将data字段中的数据提升到根级别 |
| | | const processNodeData = (node, level = 0) => { |
| | | const processNodeData = (node) => { |
| | | const processedNode = { |
| | | ...node, |
| | | ...node.data, |
| | | children: [], |
| | | level, |
| | | type: [1, 3, 5].includes(level + 1) ? 1 : 2, |
| | | }; |
| | | delete processedNode.data; |
| | | return processedNode; |
| | |
| | | const child = nodeMap.get(edge.target); |
| | | if (parent && child) { |
| | | child.level = parent.level + 1; |
| | | child.type = [1, 3, 5].includes(child.level + 1) ? 1 : 2; |
| | | parent.children.push(child); |
| | | } |
| | | }); |
| | | |
| | | // 返回根节点数组 |
| | | return nodes |
| | | .filter((node) => !childNodeIds.has(node.nodeId)) |
| | |
| | | }, |
| | | one: buildTree(this.graphData.nodes, this.graphData.edges), |
| | | }; |
| | | |
| | | console.log("提交的数据:", baseData, this.graphData); |
| | | add(baseData).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | }, |
| | | handleSignatureConfirm(signatureImage) { |
| | | this.confirmStorageDialogVisible = false; |
| | | console.log(this.nodeType); |
| | | |
| | | if (this.nodeType === 1) { |
| | | this.handleAddParent({ |
| | | ...this.nodeData, |
| | | preserveSignature: signatureImage.signature, |
| | | type: this.nodeType == 2 ? 2 : 1, |
| | | vaccinateSignature: signatureImage.signature, |
| | | }); |
| | | } else if (this.nodeType === 2) { |
| | | this.handleAddPlan({ |
| | | ...this.nodeData, |
| | | preserveSignature: signatureImage.signature, |
| | | type: this.nodeType == 2 ? 2 : 1, |
| | | vaccinateSignature: signatureImage.signature, |
| | | }); |
| | | } else if (this.nodeType === 3) { |
| | | this.handleAddSublevel({ |
| | | ...this.nodeData, |
| | | preserveSignature: signatureImage.signature, |
| | | type: this.nodeType == 2 ? 2 : 1, |
| | | vaccinateSignature: signatureImage.signature, |
| | | }); |
| | | this.$refs.addSublevelPlan.closeDialog(); |
| | | } |
| | |
| | | ...node, |
| | | id: node.nodeId, |
| | | level: 0, // 添加层级标记 |
| | | children: [] // 添加children数组 |
| | | }); |
| | | }); |
| | | |
| | |
| | | if (parent && child) { |
| | | // 设置子节点的层级 |
| | | child.level = parent.level + 1; |
| | | // 将子节点添加到父节点的children数组中 |
| | | parent.children.push(child); |
| | | } |
| | | }); |
| | | |
| | |
| | | |
| | | // 将所有节点按层级排序并设置type字段 |
| | | const allNodes = Array.from(nodeMap.values()); |
| | | allNodes.sort((a, b) => a.level - b.level); |
| | | allNodes.sort((a, b) => { |
| | | // 首先按层级排序 |
| | | if (a.level !== b.level) { |
| | | return a.level - b.level; |
| | | } |
| | | // 如果层级相同,按节点ID排序以保持稳定 |
| | | return a.nodeId.localeCompare(b.nodeId); |
| | | }); |
| | | |
| | | // 设置type字段:第1,3,5层为1,其他层级为2 |
| | | allNodes.forEach((node) => { |
| | | node.type = [1, 3, 5].includes(node.level + 1) ? 1 : 2; |
| | | }); |
| | | |
| | | return allNodes; // 返回所有节点,包含type字段 |
| | | return allNodes; |
| | | }; |
| | | |
| | | const treeData = buildTree(this.graphData.nodes, this.graphData.edges); |
| | | |
| | | // 更新图表数据 |
| | | this.graph.changeData({ |
| | | // 更新图表数据,确保边的连接关系正确 |
| | | const processedData = { |
| | | nodes: this.graphData.nodes.map((node) => ({ |
| | | ...node, |
| | | id: node.nodeId, |
| | |
| | | edges: this.graphData.edges.map((edge) => ({ |
| | | ...edge, |
| | | id: `${edge.source}-${edge.target}`, |
| | | // 确保边的样式一致 |
| | | style: { |
| | | stroke: "rgba(4, 156, 154, 1)", |
| | | lineWidth: 1, |
| | | opacity: 0.5, |
| | | endArrow: { |
| | | path: G6.Arrow.triangle(6, 6), |
| | | fill: "rgba(4, 156, 154, 1)", |
| | | stroke: "rgba(4, 156, 154, 1)", |
| | | }, |
| | | }, |
| | | })), |
| | | }); |
| | | }; |
| | | |
| | | // 更新图表数据 |
| | | this.graph.changeData(processedData); |
| | | |
| | | // 保存树形结构数据 |
| | | this.treeData = treeData; |
| | |
| | | strainCode: this.form.strainCode, |
| | | strainSourceStart: this.form.strainSourceStart, |
| | | strainSourceEnd: this.form.strainSourceEnd, |
| | | formStatus: 'add' |
| | | }); |
| | | } |
| | | }); |
| | |
| | | this.showDiscarded = true; |
| | | this.isAddingNode = true; |
| | | this.$refs.addSublevelForm.openInitData({ |
| | | parentId: nodeModel.id, |
| | | title: `新增${nextLevel}`, |
| | | strainName1: this.form.strainName, |
| | | strainCode1: this.form.strainCode, |
| | | form: { |
| | | strainName: this.form.strainName, |
| | | strainCode: this.form.strainCode, |
| | | isDiscarded: true, |
| | | }, |
| | | }); |
| | |
| | | } |
| | | }, |
| | | handleAddParent(value) { |
| | | if (this.$route.query.id) { |
| | | value.pedigreeChartId = this.$route.query.id; |
| | | value.parentId = "0"; |
| | | addProgenitor(value).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$refs.parentForm.closeDialog(); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | const parentId = `parent-${++this.nodeCount}`; |
| | | this.graphData.nodes.push({ |
| | | nodeId: parentId, |
| | |
| | | this.$refs.form.resetFields(); |
| | | }, |
| | | handleAddSublevel(value) { |
| | | if (value.formStatus == 'edit') { |
| | | updateChild(value).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$refs.addSublevelForm.closeDialog(); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | return |
| | | } |
| | | if (this.$route.query.id) { |
| | | addProgenitor(value).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$refs.addSublevelForm.closeDialog(); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | if (this.isAddingNode) { |
| | | // 新增节点的处理逻辑 |
| | | const nodeModel = this.selectedNode; |
| | |
| | | this.graphData.nodes.push({ |
| | | nodeId: childId, |
| | | label: nextLevel, |
| | | number: value.inoculateNo.trim(), |
| | | number: value.strainCode.trim(), |
| | | status: value.status, |
| | | data: value, |
| | | style: { |
| | |
| | | this.$refs.addSublevelPlan.openInitData({ |
| | | ...nodeModel.data, |
| | | label: nodeModel.label, |
| | | strainName: this.form.strainName, |
| | | strainCode: this.form.strainCode, |
| | | strainName1: this.form.strainName, |
| | | strainCode1: this.form.strainCode, |
| | | strainSourceStart: this.form.strainSourceStart, |
| | | strainSourceEnd: this.form.strainSourceEnd, |
| | | }); |
| | |
| | | } |
| | | }, |
| | | handleAddPlan(value) { |
| | | if (value.formStatus == 'edit') { |
| | | |
| | | console.log(value,'params'); |
| | | updateChild(value).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$refs.planForm.closeDialog(); |
| | | this.$refs.addSublevelPlan.closeDialog(); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | return |
| | | } |
| | | if (this.$route.query.id) { |
| | | let params = { |
| | | parentId: value.id, |
| | | generationCount: value.generationCount, |
| | | vaccinateSignature: value.vaccinateSignature, |
| | | }; |
| | | addProgenitorChild(params).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$refs.planForm.closeDialog(); |
| | | this.$refs.addSublevelPlan.closeDialog(); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | const nodeModel = this.selectedNode; |
| | | const generationId = `generation-${++this.nodeCount}`; |
| | | |
| | |
| | | } |
| | | |
| | | const nodeModel = this.selectedNode; |
| | | |
| | | if (nodeModel.label === "母代") { |
| | | this.$refs.parentForm.openInitData({ |
| | | strainSourceStart: this.form.strainSourceStart, |
| | | strainSourceEnd: this.form.strainSourceEnd, |
| | | ...nodeModel.data, |
| | | status: "detail", |
| | | formStatus: "detail", |
| | | }); |
| | | } else if (nodeModel.label === "子代" || nodeModel.label === "孙代") { |
| | | this.dialogTitle = `${nodeModel.label}详情`; |
| | | this.$refs.addSublevelForm.openInitData({ |
| | | strainCode1: this.form.strainCode, |
| | | strainName1: this.form.strainName, |
| | | title: `${nodeModel.label}详情`, |
| | | form: { ...nodeModel.data }, |
| | | }); |
| | | } else if (nodeModel.label === "传代计划数") { |
| | | return |
| | | const nodeIndex = this.graphData.nodes.findIndex( |
| | | (n) => n.nodeId === nodeModel.nodeId |
| | | ); |
| | | if (this.graphData.nodes[nodeIndex - 1].label === "子代") { |
| | | console.log(123); |
| | | |
| | | this.$refs.addSublevelPlan.openInitData({ |
| | | strainSourceStart: this.form.strainSourceStart, |
| | | strainCode1: this.form.strainCode, |
| | | strainName1: this.form.strainName, |
| | | strainSourceEnd: this.form.strainSourceEnd, |
| | | ...nodeModel.data, |
| | | status: "detail", |
| | | }); |
| | | } else { |
| | | console.log(123); |
| | | |
| | | this.$refs.planForm.openInitData({ |
| | | strainSourceStart: this.form.strainSourceStart, |
| | | strainSourceEnd: this.form.strainSourceEnd, |
| | | strainCode1: this.form.strainCode, |
| | | strainName1: this.form.strainName, |
| | | ...nodeModel.data, |
| | | status: "detail", |
| | | }); |
| | |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | <div class="card" style="margin-top: 30px"> |
| | | <Table :height="null" :total="0" :tableData="tableData"> |
| | | <el-table-column label="菌株类型" prop="strainSource" /> |
| | | <el-table-column label="来源获得/菌落编号" prop="strainCode" /> |
| | | <el-table-column label="菌种编号" prop="strainName" /> |
| | | <div class="card" style="margin-top: 30px; display: block" v-if="roleType != 4"> |
| | | <Table |
| | | :height="null" |
| | | :total="total" |
| | | :data="tableData" |
| | | :queryForm="queryForm" |
| | | @handleCurrentChange="handleCurrentChange" |
| | | @handleSizeChange="handleSizeChange" |
| | | > |
| | | <el-table-column label="菌种实验员" prop="experimenter" /> |
| | | <el-table-column label="菌种编号" prop="strainCode" /> |
| | | <el-table-column label="菌种名称" prop="strainName" /> |
| | | <el-table-column label="入库总数" prop="strainName" /> |
| | | <el-table-column label="保存/废弃" prop="strainName" /> |
| | | <el-table-column label="菌种入库时间" prop="strainName" /> |
| | | <el-table-column label="接种操作人" prop="strainName" /> |
| | | <el-table-column label="操作"> |
| | | <el-table-column label="保存/废弃"> |
| | | <template #default="{ row }"> |
| | | <el-button type="text">确认入库</el-button> |
| | | {{ row.status === 1 ? "保存" : "废弃" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="菌种保存/废弃时间" prop="storageTime" /> |
| | | <el-table-column label="操作" v-if="roleType == 3"> |
| | | <template #default="{ row }"> |
| | | <el-button type="text" @click="handleConfirm(row)" |
| | | >确认入库</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </Table> |
| | | </div> |
| | | |
| | | <div class="chart"> |
| | | <div class="header"> |
| | | <div class="title">菌种传代生产谱系图</div> |
| | |
| | | >设置传代计划数</el-button |
| | | > |
| | | <el-button type="primary" @click="showDetail">详情</el-button> |
| | | <el-button type="primary" @click="handleEdit" v-if="roleType == 1">编辑</el-button> |
| | | <el-button type="primary" @click="handleDelete" v-if="roleType == 1">删除</el-button> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | style="width: 150px" |
| | | >保存</el-button |
| | | > |
| | | </div> |
| | | <div class="end-btn"> |
| | | <!-- <el-button type="primary" @click="handleSubmit">提交</el-button> |
| | | <el-button @click="handleDraft">存草稿</el-button> |
| | | <el-button @click="handleCancel">取消</el-button> --> |
| | | </div> |
| | | </el-form> |
| | | |
| | |
| | | name="菌种保藏人签字" |
| | | text="是否确认该项菌种信息入库" |
| | | :visible.sync="storageVisible" |
| | | @confirm="handleSignatureConfirm" |
| | | @confirm="handleSignatureConfirm1" |
| | | /> |
| | | </div> |
| | | </template> |
| | |
| | | import AddAncestor from "./progenitorComponents/AddAncestor.vue"; |
| | | import AddSublevelForm from "./progenitorComponents/AddSublevelForm.vue"; |
| | | import ConfirmStorageDialog from "@/components/confirm-storage-dialog"; |
| | | import { add, getDetail, addProgenitorChild, addProgenitor } from "./service"; |
| | | import { |
| | | add, |
| | | getDetail, |
| | | addProgenitorChild, |
| | | addProgenitor, |
| | | pageListDetail, |
| | | confirmStorage, |
| | | deleteNode, |
| | | updateChild, |
| | | } from "./service"; |
| | | |
| | | export default { |
| | | name: "AddPedigree", |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | queryForm: { |
| | | pageSize: 10, |
| | | pageNum: 1, |
| | | }, |
| | | signatureVisible: false, |
| | | form: { |
| | | strainCode: "", |
| | |
| | | tableData: [], |
| | | confirmStorageDialogVisible: false, |
| | | storageVisible: false, |
| | | total: 0, |
| | | current: 1, |
| | | size: 10, |
| | | comfirmId: "", |
| | | roleType: Number(JSON.parse(sessionStorage.getItem('userInfo')).roleType || 1), // 1.超级管理员 2.审批人 3.工程师 4.实验员 |
| | | |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | window.removeEventListener("resize", this.handleResize); |
| | | }, |
| | | methods: { |
| | | handleDelete() { |
| | | if (!this.selectedNode) { |
| | | this.$message.warning("请先选择节点"); |
| | | return; |
| | | } |
| | | this.$confirm("确定删除该节点吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | deleteNode({ id: this.selectedNode.id }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("删除成功"); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | handleEdit() { |
| | | if (!this.selectedNode) { |
| | | this.$message.warning("请先选择节点"); |
| | | return; |
| | | } |
| | | |
| | | const nodeModel = this.selectedNode; |
| | | |
| | | if (nodeModel.label === "祖代") { |
| | | this.$refs.addAncestor.openInitData({ |
| | | ...nodeModel.data, |
| | | formStatus: "edit", |
| | | }); |
| | | } else if (nodeModel.label === "母代") { |
| | | nodeModel.data.strainCode1 = this.form.strainCode; |
| | | nodeModel.data.strainName1 = this.form.strainName; |
| | | this.$refs.addSublevelForm.openInitData({ |
| | | title: "编辑母代", |
| | | form: { ...nodeModel.data }, |
| | | formStatus: "edit", |
| | | }); |
| | | } else if (nodeModel.label === "传代计划数") { |
| | | this.$refs.planForm.openInitData({ |
| | | ...nodeModel.data, |
| | | formStatus: "edit", |
| | | }); |
| | | } |
| | | }, |
| | | handleConfirm(row) { |
| | | this.comfirmId = row.id; |
| | | this.storageVisible = true; |
| | | }, |
| | | // 处理每页显示数量变化 |
| | | handleSizeChange(val) { |
| | | this.size = val; |
| | | this.queryForm.pageSize = val; |
| | | this.getList(); |
| | | }, |
| | | |
| | | // 处理页码变化 |
| | | handleCurrentChange(val) { |
| | | this.current = val; |
| | | this.queryForm.pageNum = val; |
| | | this.getList(); |
| | | }, |
| | | async getList() { |
| | | try { |
| | | // 获取列表数据 |
| | | const listRes = await pageListDetail({ |
| | | id: this.$route.query.id, |
| | | current: this.current, |
| | | size: this.size, |
| | | }); |
| | | |
| | | if (listRes.code === 200) { |
| | | this.tableData = listRes.data.records; |
| | | this.total = listRes.data.total; |
| | | this.current = listRes.data.current; |
| | | this.size = listRes.data.size; |
| | | } |
| | | |
| | | // ... 其他现有的 reloadData 代码 ... |
| | | } catch (error) { |
| | | console.error("Failed to reload data:", error); |
| | | this.$message.error("数据加载失败"); |
| | | } |
| | | }, |
| | | async reloadData() { |
| | | this.getList(); |
| | | getDetail({ id: this.$route.query.id }).then((res) => { |
| | | const detailData = res.pedigreeChartParentAllDetailDTO; |
| | | // 设置基础表单数据 |
| | |
| | | return processedNode; |
| | | } |
| | | |
| | | // 构建完整的树形结构 |
| | | this.graphData.nodes = detailData.one.map((node) => processNode(node)); |
| | | // 构建完整的树形结构,添加空值校验 |
| | | this.graphData.nodes = detailData?.one |
| | | ? detailData.one.map((node) => processNode(node)) |
| | | : []; |
| | | |
| | | // 在数据加载完成后重新渲染图表 |
| | | this.$nextTick(() => { |
| | |
| | | parent: { ...this.form }, |
| | | one: processNodeData(this.graphData.nodes), |
| | | }; |
| | | |
| | | console.log("提交数据:", baseData); |
| | | add(baseData).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("保存成功"); |
| | |
| | | this.handleAddSublevel(this.nodeData); |
| | | } |
| | | // 处理提交逻辑 |
| | | }, |
| | | handleSignatureConfirm1(signatureImage) { |
| | | confirmStorage({ |
| | | id: this.comfirmId, |
| | | preserveSignature: signatureImage.signature, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("确认入库成功"); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | }, |
| | | addNode() { |
| | | // 如果没有节点,新增祖代 |
| | |
| | | |
| | | this.showDiscarded = true; |
| | | this.isAddingNode = true; |
| | | console.log(parentNode); |
| | | |
| | | this.$refs.addSublevelForm.openInitData({ |
| | | title: "新增菌种传代项", |
| | | form: { |
| | |
| | | } |
| | | }, |
| | | handleAddParent(value) { |
| | | if (value.formStatus == "edit") { |
| | | updateChild(value).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$refs.addAncestor.closeDialog(); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | if (this.$route.query.id) { |
| | | value.pedigreeChartId = this.$route.query.id; |
| | | value.parentId = "0"; |
| | | addProgenitor(value).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$refs.addAncestor.closeDialog(); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | const parentId = `parent-${++this.nodeCount}`; |
| | | const parentNode = { |
| | | id: parentId, |
| | |
| | | this.$refs.form.resetFields(); |
| | | }, |
| | | handleAddSublevel(value) { |
| | | if (value.formStatus == "edit") { |
| | | updateChild(value).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$refs.addSublevelForm.closeDialog(); |
| | | this.reloadData(); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | if (this.$route.query.id) { |
| | | addProgenitor(value).then((res) => { |
| | | if (res.code === 200) { |
| | |
| | | <template> |
| | | <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="40%" @close="closeDialog" |
| | | :close-on-click-modal="false"> |
| | | <el-form :model="form" :rules="rules" ref="form" label-position="top"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种操作人" prop="thisName"> |
| | | <el-input disabled v-model="form.thisName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种操作时间" prop="thisTime"> |
| | | <el-input disabled v-model="form.thisTime"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="传代菌种编号" prop="strainCode"> |
| | | <el-input disabled v-model="form.strainCode"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="传代菌种名称" prop="strainName"> |
| | | <el-input disabled v-model="form.strainName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种菌种编号" prop="inoculateNo"> |
| | | <el-input :disabled="!dialogTitle.includes('新增')" v-model="form.inoculateNo" |
| | | placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种菌种名称" prop="inoculateName"> |
| | | <el-input :disabled="!dialogTitle.includes('新增')" v-model="form.inoculateName" |
| | | placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item label="保存/废弃"> |
| | | <div class="flex-row"> |
| | | <div :class="form.status === 1 && 'active'" @click="handleStatus(1)">保存</div> |
| | | <div :class="form.status === 2 && 'active'" @click="handleStatus(2)">废弃</div> |
| | | </div> |
| | | </el-form-item> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="10"> |
| | | <el-form-item v-if="form.status === 2" label="废弃原因说明" required> |
| | | <el-input :disabled="!dialogTitle.includes('新增')" v-model="form.discardReason" |
| | | placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="菌种入库时间" prop="inTime" required> |
| | | <el-input disabled v-model="form.inTime"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- <el-row v-if="!dialogTitle.includes('新增')" :gutter="20"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种操作人签字"> |
| | | <el-image /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="菌种保藏人签字"> |
| | | <el-image /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> --> |
| | | </el-form> |
| | | <div v-if="dialogTitle.includes('新增')" class="dialog-footer"> |
| | | <el-button type="primary" @click="handleSubmit">提交签字</el-button> |
| | | <el-dialog |
| | | :title="dialogTitle" |
| | | :visible.sync="dialogVisible" |
| | | width="40%" |
| | | @close="closeDialog" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-form :model="form" :rules="rules" ref="form" label-position="top"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种操作人" prop="thisName"> |
| | | <el-input disabled v-model="form.thisName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种操作时间" prop="thisTime"> |
| | | <el-input disabled v-model="form.thisTime"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="传代菌种编号" prop="strainCode1"> |
| | | <el-input disabled v-model="form.strainCode1"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="传代菌种名称" prop="strainName1"> |
| | | <el-input disabled v-model="form.strainName1"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种菌种编号" prop="strainCode"> |
| | | <el-input |
| | | :disabled="dialogTitle.includes('详情')" |
| | | v-model="form.strainCode" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种菌种名称" prop="strainName"> |
| | | <el-input |
| | | :disabled="dialogTitle.includes('详情')" |
| | | v-model="form.strainName" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item label="保存/废弃"> |
| | | <div class="flex-row"> |
| | | <div :class="form.status === 1 && 'active'" @click="handleStatus(1)"> |
| | | 保存 |
| | | </div> |
| | | <div :class="form.status === 2 && 'active'" @click="handleStatus(2)"> |
| | | 废弃 |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | </el-form-item> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="10"> |
| | | <el-form-item v-if="form.status === 2" label="废弃原因说明" required> |
| | | <el-input |
| | | :disabled="dialogTitle.includes('详情')" |
| | | v-model="form.discardReason" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="菌种入库时间" prop="confirmTime" > |
| | | <el-input disabled v-model="form.confirmTime"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="!dialogTitle.includes('新增')" :gutter="20"> |
| | | <el-col v-if="form.vaccinateSignature" :span="10"> |
| | | <el-form-item label="接种操作人签字"> |
| | | <el-image :src="form.vaccinateSignature" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="form.preserveSignature" :span="10"> |
| | | <el-form-item label="菌种保藏人签字"> |
| | | <el-image :src="form.preserveSignature" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div v-if="!dialogTitle.includes('详情')" class="dialog-footer"> |
| | | <el-button type="primary" @click="handleSubmit">提交签字</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | dialogTitle: '', |
| | | form: { |
| | | thisName: '', |
| | | thisTime: '', |
| | | strainCode: '', |
| | | strainName: '', |
| | | inoculateNo: '', |
| | | inoculateName: '', |
| | | status: 1, |
| | | inTime: '', |
| | | discardReason: '' |
| | | }, |
| | | rules: { |
| | | thisName: [ |
| | | { required: true, message: '请输入接种操作人', trigger: 'blur' } |
| | | ], |
| | | thisTime: [ |
| | | { required: true, message: '请输入接种操作时间', trigger: 'blur' } |
| | | ], |
| | | strainCode: [ |
| | | { required: true, message: '请输入传代菌种编号', trigger: 'blur' } |
| | | ], |
| | | strainName: [ |
| | | { required: true, message: '请输入传代菌种名称', trigger: 'blur' } |
| | | ], |
| | | inoculateNo: [ |
| | | { required: true, message: '请输入接种菌种编号', trigger: 'blur' } |
| | | ], |
| | | inoculateName: [ |
| | | { required: true, message: '请输入接种菌种名称', trigger: 'blur' } |
| | | ] |
| | | } |
| | | } |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | dialogTitle: "", |
| | | form: { |
| | | thisName: "", |
| | | thisTime: "", |
| | | strainCode: "", |
| | | strainName: "", |
| | | strainCode1: "", |
| | | strainName1: "", |
| | | status: 1, |
| | | confirmTime: "", |
| | | discardReason: "", |
| | | }, |
| | | rules: { |
| | | thisName: [ |
| | | { required: true, message: "请输入接种操作人", trigger: "blur" }, |
| | | ], |
| | | thisTime: [ |
| | | { required: true, message: "请输入接种操作时间", trigger: "blur" }, |
| | | ], |
| | | strainCode: [ |
| | | { required: true, message: "请输入传代菌种编号", trigger: "blur" }, |
| | | ], |
| | | strainName: [ |
| | | { required: true, message: "请输入传代菌种名称", trigger: "blur" }, |
| | | ], |
| | | strainCode1: [ |
| | | { required: true, message: "请输入接种菌种编号", trigger: "blur" }, |
| | | ], |
| | | strainName1: [ |
| | | { required: true, message: "请输入接种菌种名称", trigger: "blur" }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | | openInitData(value) { |
| | | this.dialogTitle = value.title; |
| | | // 获取用户信息 |
| | | const userInfo = JSON.parse(sessionStorage.getItem("userInfo") || "{}"); |
| | | // 获取当前时间并格式化 |
| | | const now = new Date(); |
| | | const formatTime = `${now.getFullYear()}-${String( |
| | | now.getMonth() + 1 |
| | | ).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")} ${String( |
| | | now.getHours() |
| | | ).padStart(2, "0")}:${String(now.getMinutes()).padStart(2, "0")}:${String( |
| | | now.getSeconds() |
| | | ).padStart(2, "0")}`; |
| | | console.log(value); |
| | | |
| | | this.form = { |
| | | parentId: value.parentId, |
| | | ...this.form, |
| | | ...value.form, |
| | | formStatus: value.formStatus, |
| | | strainCode1: value.strainCode1, |
| | | strainName1: value.strainName1, |
| | | thisName: userInfo.nickName || "", |
| | | thisTime: value.form.vaccinateTime |
| | | ? value.form.vaccinateTime |
| | | : formatTime, |
| | | }; |
| | | this.dialogVisible = true; |
| | | }, |
| | | methods: { |
| | | openInitData(value) { |
| | | this.dialogTitle = value.title |
| | | // 获取用户信息 |
| | | const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}') |
| | | // 获取当前时间并格式化 |
| | | const now = new Date() |
| | | const formatTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}` |
| | | |
| | | this.form = { |
| | | ...this.form, |
| | | ...value.form, |
| | | thisName: userInfo.nickName || '', |
| | | thisTime: formatTime, |
| | | inTime: formatTime |
| | | } |
| | | this.dialogVisible = true |
| | | }, |
| | | closeDialog() { |
| | | this.dialogVisible = false |
| | | // 重置表单数据 |
| | | this.form = { |
| | | thisName: '', |
| | | thisTime: '', |
| | | strainCode: '', |
| | | strainName: '', |
| | | inoculateNo: '', |
| | | inoculateName: '', |
| | | status: 1, |
| | | inTime: '', |
| | | discardReason: '' |
| | | } |
| | | // 重置表单验证 |
| | | this.$refs.form && this.$refs.form.resetFields() |
| | | }, |
| | | handleSubmit() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.$emit('addNodeSign', this.form, 3) |
| | | } |
| | | }) |
| | | }, |
| | | handleStatus(status) { |
| | | if (!this.dialogTitle.includes('新增')) return |
| | | this.form.status = status |
| | | this.$forceUpdate() |
| | | closeDialog() { |
| | | this.dialogVisible = false; |
| | | // 重置表单数据 |
| | | this.form = { |
| | | thisName: "", |
| | | thisTime: "", |
| | | strainCode: "", |
| | | strainName: "", |
| | | strainCode1: "", |
| | | strainName1: "", |
| | | status: 1, |
| | | confirmTime: "", |
| | | discardReason: "", |
| | | }; |
| | | // 重置表单验证 |
| | | this.$refs.form && this.$refs.form.resetFields(); |
| | | }, |
| | | handleSubmit() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.$emit("addNodeSign", this.form, 3); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | handleStatus(status) { |
| | | if (this.dialogTitle.includes("详情")) return; |
| | | this.form.status = status; |
| | | this.$forceUpdate(); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | .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> |
| | |
| | | <template> |
| | | <!-- 设置传代计划数弹窗 --> |
| | | <el-dialog :title="planForm.status === 'detail' ? '传代计划数详情' : '设置菌种传代计划数'" :visible.sync="planDialogVisible" |
| | | <el-dialog :title="planForm.formStatus === '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="strainCode"> |
| | | <el-input disabled v-model="planForm.strainCode"></el-input> |
| | | <el-form-item label="传代菌种编号" prop="strainCode1"> |
| | | <el-input disabled v-model="planForm.strainCode1"></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 label="传代菌种名称" prop="strainName1"> |
| | | <el-input disabled v-model="planForm.strainName1"></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 label="接种菌种编号"> |
| | | <el-input disabled v-model="planForm.strainCode" 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 label="接种菌种名称"> |
| | | <el-input disabled v-model="planForm.strainName" placeholder="请输入"></el-input> |
| | | </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-input disabled v-model="planForm.confirmTime"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="传代计划数" prop="generationCount"> |
| | | <el-input-number :disabled="planForm.status === 'detail'" v-model="planForm.generationCount" |
| | | <el-input-number :disabled="planForm.formStatus === 'detail'" v-model="planForm.generationCount" |
| | | :controls="false" :min="1" placeholder="请输入" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div v-if="planForm.status !== 'detail'" class="dialog-footer"> |
| | | <div v-if="planForm.formStatus !== 'detail'" class="dialog-footer"> |
| | | <el-button type="primary" @click="handleSubmit">提交签字</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | status: '1', |
| | | strainCode: '', |
| | | strainName: '', |
| | | inoculateNo: '', |
| | | inoculateName: '', |
| | | strainCode1: '', |
| | | strainName1: '', |
| | | generationCount: 1, |
| | | isDiscarded: true, |
| | | inTime: '' |
| | | }, |
| | | planRules: { |
| | | strainCode: [ |
| | |
| | | strainName: [ |
| | | { required: true, message: '请输入传代菌种名称', trigger: 'blur' } |
| | | ], |
| | | inoculateNo: [ |
| | | strainCode1: [ |
| | | { required: true, message: '请输入接种菌种编号', trigger: 'blur' } |
| | | ], |
| | | inoculateName: [ |
| | | strainName1: [ |
| | | { required: true, message: '请输入接种菌种名称', trigger: 'blur' } |
| | | ], |
| | | generationCount: [ |
| | |
| | | status: '1', |
| | | strainCode: '', |
| | | strainName: '', |
| | | inoculateNo: '', |
| | | inoculateName: '', |
| | | strainCode1: '', |
| | | strainName1: '', |
| | | generationCount: 1, |
| | | isDiscarded: true, |
| | | inTime: '' |
| | | } |
| | | // 重置表单验证 |
| | | this.$refs.planForm && this.$refs.planForm.resetFields() |
| | |
| | | }) |
| | | }, |
| | | handleStatus(status) { |
| | | if (this.planForm.status === 'detail') return |
| | | if (this.planForm.formStatus === 'detail') return |
| | | this.planForm.isDiscarded = status === 'save' |
| | | this.$forceUpdate() |
| | | } |
| | |
| | | <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> |
| | | </style> |
| | |
| | | <template> |
| | | <!-- 设置传代计划数弹窗 --> |
| | | <el-dialog :title="planForm.status === 'detail' ? '传代计划数详情' : '设置传代计划数'" :visible.sync="planDialogVisible" |
| | | <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-form-item label="菌种源" prop="strainSourceStart"> |
| | |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-form-item label="传代计划数" prop="generationCount"> |
| | | <el-input-number :disabled="planForm.status === 'detail'" v-model="planForm.generationCount" |
| | | <el-input-number :disabled="planForm.formStatus === 'detail'" v-model="planForm.generationCount" |
| | | :controls="false" :min="1" placeholder="请输入" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div v-if="planForm.status !== 'detail'" class="dialog-footer"> |
| | | <div v-if="planForm.formStatus !== 'detail'" class="dialog-footer"> |
| | | <el-button type="primary" @click="handleSubmit">提交签字</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | }, |
| | | methods: { |
| | | openInitData(value) { |
| | | console.log(value); |
| | | |
| | | this.planForm = { |
| | | ...this.planForm, |
| | | ...value |
| | | } |
| | | if (value.formStatus == 'edit') { |
| | | this.planForm.strainCode = value.strainCode1 |
| | | this.planForm.strainName = value.strainName1 |
| | | } |
| | | this.openDialog() |
| | | }, |
| | | openDialog() { |
| | |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="handleDetail(scope.row)">详情</el-button> |
| | | <!-- 菌种超级管理员 --> |
| | | <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button> |
| | | <!-- 菌种超级管理员 --> |
| | | <el-button type="text" @click="handleDelete(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList } from "./service"; |
| | | import { getList,deleteProgenitor } from "./service"; |
| | | export default { |
| | | name: "PedigreeChart", |
| | | components: {}, |
| | |
| | | }, |
| | | handleDelete(row) { |
| | | // 实现删除逻辑 |
| | | console.log("删除数据:", row); |
| | | this.$confirm("确定删除该数据吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | deleteProgenitor({ id: row.id }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message.success("删除成功"); |
| | | this.resetForm(); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | handleDetail(row) { |
| | | if (row.generationType == 1) { |
| | |
| | | <template> |
| | | <!-- 设置传代计划数弹窗 --> |
| | | <el-dialog |
| | | :title="planForm.formStatus == 'add' ? '新增菌种传代项' : '菌种传代项详情'" |
| | | :title="planForm.formStatus == 'add' ? '新增菌种传代项' : planForm.formStatus == 'edit' ? '编辑菌种传代项' : '菌种传代项详情'" |
| | | :visible.sync="planDialogVisible" |
| | | width="40%" |
| | | :close-on-click-modal="false" |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="16"> |
| | | <el-form-item label="菌株类型" required> |
| | | <div class="type-box" v-if="planForm.formStatus == 'add'"> |
| | | <div class="type-box" v-if="planForm.formStatus != 'detail'"> |
| | | <div |
| | | @click="handleType(index)" |
| | | v-for="(item, index) in [ |
| | |
| | | <el-col :span="20" v-if="planForm.strainType == 1"> |
| | | <el-form-item label="来源获得" prop="source"> |
| | | <el-input |
| | | :disabled="planForm.formStatus != 'add'" |
| | | :disabled="planForm.formStatus == 'detail'" |
| | | v-model="planForm.source" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | <el-col :span="10" v-else> |
| | | <el-form-item label="菌落编号" prop="colonyNumber"> |
| | | <el-input |
| | | :disabled="planForm.formStatus != 'add'" |
| | | :disabled="planForm.formStatus == 'detail'" |
| | | v-model="planForm.colonyNumber" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | <el-col :span="10"> |
| | | <el-form-item label="菌种名称" prop="strainName"> |
| | | <el-input |
| | | :disabled="planForm.formStatus != 'add'" |
| | | :disabled="planForm.formStatus == 'detail'" |
| | | v-model="planForm.strainName" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | <el-col :span="10"> |
| | | <el-form-item label="菌种编号" prop="strainCode"> |
| | | <el-input |
| | | :disabled="planForm.formStatus != 'add'" |
| | | :disabled="planForm.formStatus == 'detail'" |
| | | v-model="planForm.strainCode" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="10"> |
| | | <el-form-item label="保存/废弃" required> |
| | | <div class="flex-row" v-if="planForm.formStatus == 'add'"> |
| | | <div class="flex-row" v-if="planForm.formStatus != 'detail'"> |
| | | <div |
| | | @click="handleStatus('save')" |
| | | :class="planForm.status === 1 && 'active'" |
| | |
| | | <el-col :span="10"> |
| | | <el-form-item label="废弃原因说明" required> |
| | | <el-input |
| | | :disabled="planForm.formStatus != 'add'" |
| | | :disabled="planForm.formStatus == 'detail'" |
| | | v-model="planForm.remark" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="planForm.formStatus != 'add'" :gutter="20"> |
| | | <el-row v-if="planForm.formStatus == 'detail'" :gutter="20"> |
| | | <el-col v-if="planForm.vaccinateSignature" :span="10"> |
| | | <el-form-item label="接种操作人签字"> |
| | | <el-image :src="planForm.vaccinateSignature" /> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div v-if="planForm.formStatus == 'add'" class="dialog-footer"> |
| | | <el-button>保存草稿</el-button> |
| | | <div v-if="planForm.formStatus != 'detail'" class="dialog-footer"> |
| | | <el-button type="primary" @click="handleAddPlan">提交</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | }); |
| | | }, |
| | | handleStatus(status) { |
| | | if (this.planForm.formStatus !== "add") return; |
| | | if (this.planForm.formStatus === "detail") return; |
| | | this.planForm.status = status === "save" ? 1 : 2; |
| | | this.$forceUpdate(); |
| | | }, |
| | | handleType(index) { |
| | | if (this.planForm.formStatus !== "add") return; |
| | | if (this.planForm.formStatus === "detail") return; |
| | | this.planForm.strainType = index + 1; |
| | | // 如果是分离菌落或祖代菌株,colonyNumber=source,否则清空 |
| | | this.planForm.colonyNumber = ""; |
| | |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种菌种编号" prop="strainCode"> |
| | | <el-input |
| | | :disabled="!dialogTitle.includes('新增')" |
| | | :disabled="dialogTitle.includes('详情')" |
| | | v-model="form.strainCode" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | <el-col :span="10"> |
| | | <el-form-item label="接种菌种名称" prop="strainName"> |
| | | <el-input |
| | | :disabled="!dialogTitle.includes('新增')" |
| | | :disabled="dialogTitle.includes('详情')" |
| | | v-model="form.strainName" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | prop="remark" |
| | | > |
| | | <el-input |
| | | :disabled="!dialogTitle.includes('新增')" |
| | | :disabled="dialogTitle.includes('详情')" |
| | | v-model="form.remark" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div v-if="dialogTitle.includes('新增')" class="dialog-footer"> |
| | | <div v-if="!dialogTitle.includes('详情')" class="dialog-footer"> |
| | | <el-button type="primary" @click="handleSubmit">提交</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | }, |
| | | methods: { |
| | | openInitData(value) { |
| | | console.log(value); |
| | | |
| | | this.dialogTitle = value.title; |
| | | // 获取用户信息 |
| | |
| | | this.form = { |
| | | ...this.form, |
| | | ...value.form, |
| | | strainCode1: value.strainCode1, |
| | | strainName1: value.strainName1, |
| | | formStatus:value.formStatus, |
| | | thisName: userInfo.nickName || "", |
| | | thisTime: value.form.vaccinateTime |
| | | ? value.form.vaccinateTime |
| | | : formatTime, |
| | | type: 1, |
| | | }; |
| | | |
| | | this.dialogVisible = true; |
| | | }, |
| | | closeDialog() { |
| | |
| | | }); |
| | | }, |
| | | handleStatus(status) { |
| | | if (!this.dialogTitle.includes("新增")) return; |
| | | if (this.dialogTitle.includes("详情")) return; |
| | | this.form.status = status; |
| | | this.$forceUpdate(); |
| | | }, |
| | |
| | | // 祖代-母代新增菌种传代项 |
| | | export const addProgenitor = (params) => { |
| | | return axios.post('/api/t-pedigree-chart/addProgenitorChild', { ...params }) |
| | | } |
| | | } |
| | | |
| | | // 谱系图-获取谱系图详情待入库菌种分页列表 |
| | | export const pageListDetail = (params) => { |
| | | return axios.post('/api/t-pedigree-chart/pageListDetail', { ...params }) |
| | | } |
| | | |
| | | // 谱系图-菌种工程师确认入库 |
| | | export const confirmStorage = (params) => { |
| | | return axios.post('/api/t-pedigree-chart/confirm', { ...params }) |
| | | } |
| | | |
| | | // 谱系图-删除节点 |
| | | export const deleteNode = (params) => { |
| | | return axios.delete('/open/t-pedigree-chart/deleteProgenitorChild', { params }) |
| | | } |
| | | |
| | | // 谱系图-编辑菌种传代-传代数项 |
| | | export const updateChild = (data) => { |
| | | return axios.post('/api/t-pedigree-chart/updateChild', { ...data }) |
| | | } |
| | | // 谱系图-删除谱系图 |
| | | export const deleteProgenitor = (params) => { |
| | | return axios.delete('/open/t-pedigree-chart/deleteProgenitor', { params }) |
| | | } |
| | |
| | | <div>一、培养皿分离记录</div> |
| | | </div> |
| | | <div class="header-title-right"> |
| | | <el-button @click="handleAddSeparation" v-if="!$route.query.isDetail&&[1,4].includes(roleType)" class="el-icon-circle-plus-outline" |
| | | type="primary"> |
| | | <el-button @click="handleAddSeparation" v-if="!$route.query.isDetail && [1, 4].includes(roleType)" |
| | | class="el-icon-circle-plus-outline" type="primary"> |
| | | 新增培养皿分离记录</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" label="操作时间" /> |
| | | <el-table-column prop="address" label="操作" v-if="!$route.query.isDetail"> |
| | | <template slot-scope="scope" v-if="[1,4].includes(roleType)"> |
| | | <template slot-scope="scope" v-if="[1, 4].includes(roleType)"> |
| | | <el-button type="text" @click="handleEditSeparation(scope.row, scope.$index)" |
| | | v-if="!$route.query.isDetail">编辑</el-button> |
| | | <el-button type="text" @click="handleDeleteSeparation(scope.$index)" |
| | |
| | | <div>二、培养皿生物学形态观察记录</div> |
| | | </div> |
| | | <div class="header-title-right"> |
| | | <el-button @click="handleAddObservation" v-if="!$route.query.isDetail&&[1,4].includes(roleType)" class="el-icon-circle-plus-outline" type="primary"> |
| | | <el-button @click="handleAddObservation" v-if="!$route.query.isDetail && [1, 4].includes(roleType)" |
| | | class="el-icon-circle-plus-outline" type="primary"> |
| | | 新增观察记录</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | <!-- <el-button type="text" @click="handleEditObservation(scope.row)" v-if="!$route.query.isDetail">编辑</el-button> --> |
| | | <el-button type="text" @click="handleEditObservation(scope.row)">形态记录</el-button> |
| | | <el-button type="text" @click="handleDeleteObservation(scope.$index)" |
| | | v-if="!$route.query.isDetail&&[1,4].includes(roleType)">删除</el-button> |
| | | v-if="!$route.query.isDetail && [1, 4].includes(roleType)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </Table> |
| | |
| | | <div>三、接种斜面记录</div> |
| | | </div> |
| | | <div class="header-title-right"> |
| | | <el-button @click="handleAddInoculation" v-if="!$route.query.isDetail&&[1,4].includes(roleType)" class="el-icon-circle-plus-outline" type="primary"> |
| | | <el-button @click="handleAddInoculation" v-if="!$route.query.isDetail && [1, 4].includes(roleType)" |
| | | class="el-icon-circle-plus-outline" type="primary"> |
| | | 新增斜面记录</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="preserveTime" label="入库保藏/废弃时间" /> |
| | | <el-table-column label="操作" v-if="[1,3,4].includes(roleType)&&!$route.query.isDetail"> |
| | | <el-table-column label="操作" v-if="[1, 3].includes(roleType) && $route.query.isDetail || (!$route.query.isDetail && [4].includes(roleType))"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="handleEditInoculation(scope.row, scope.$index)" v-if="!$route.query.isDetail&&[1,4].includes(roleType)">编辑</el-button> |
| | | <el-button type="text" @click="handleConfirmStorageClick(scope.row, scope.$index)" v-if="$route.query.isDetail&&[3].includes(roleType)">确认入库</el-button> |
| | | <el-button type="text" @click="handleDeleteInoculation(scope.$index)" v-if="!$route.query.isDetail&&!scope.row.preserveSignature&&[1,4].includes(roleType)">删除</el-button> |
| | | <el-button type="text" @click="handleEditInoculation(scope.row, scope.$index)" |
| | | v-if="!$route.query.isDetail && [1, 4].includes(roleType)">编辑</el-button> |
| | | <el-button type="text" @click="handleConfirmStorageClick(scope.row, scope.$index)" |
| | | v-if="$route.query.isDetail && [3].includes(roleType)">确认入库</el-button> |
| | | <el-button type="text" @click="handleDeleteInoculation(scope.$index)" |
| | | v-if="!$route.query.isDetail && !scope.row.preserveSignature && [1, 4].includes(roleType)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <div>四、菌种保藏记录</div> |
| | | </div> |
| | | <div class="header-title-right"> |
| | | <el-button @click="handleAddPreserve" v-if="!$route.query.isDetail&&[1,4].includes(roleType)" class="el-icon-circle-plus-outline" type="primary"> |
| | | <el-button @click="handleAddPreserve" v-if="!$route.query.isDetail && [1, 4].includes(roleType)" |
| | | class="el-icon-circle-plus-outline" type="primary"> |
| | | 新增菌种保藏记录</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="preserveTime" label="保藏时间" /> |
| | | <el-table-column label="操作" v-if="[1,3,4].includes(roleType)&&!$route.query.isDetail"> |
| | | <el-table-column label="操作" v-if="[1, 3].includes(roleType) && $route.query.isDetail || (!$route.query.isDetail && [4].includes(roleType))"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="handleEditPreserve(scope.row, scope.$index)" v-if="!$route.query.isDetail&&[1,4].includes(roleType)">编辑</el-button> |
| | | <el-button type="text" @click="handleConfirmPreserve(scope.row, scope.$index)" v-if="$route.query.isDetail&&[3].includes(roleType)">确认入库</el-button> |
| | | <el-button type="text" @click="handleDeletePreserve(scope.$index)" v-if="!$route.query.isDetail&&!scope.row.preserveSignature&&[1,4].includes(roleType)">删除</el-button> |
| | | <el-button type="text" @click="handleEditPreserve(scope.row, scope.$index)" |
| | | v-if="!$route.query.isDetail && [1, 4].includes(roleType)">编辑</el-button> |
| | | <el-button type="text" @click="handleConfirmPreserve(scope.row, scope.$index)" |
| | | v-if="$route.query.isDetail && [3].includes(roleType)">确认入库</el-button> |
| | | <el-button type="text" @click="handleDeletePreserve(scope.$index)" |
| | | v-if="!$route.query.isDetail && !scope.row.preserveSignature && [1, 4].includes(roleType)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </Table> |
| | |
| | | @confirm="handleConfirmStorage" /> |
| | | <ConfirmPreserveDialog :visible.sync="showConfirmPreserveDialog" :editData="editPreserveData" |
| | | @confirm="handleConfirmPreserveSubmit" /> |
| | | <div class="end-btn" style="margin-top: 20px;" v-if="!$route.query.isDetail"> |
| | | <div class="end-btn" style="margin-top: 20px;" v-if="$route.query.isDetail&& [3, 4].includes(roleType)"> |
| | | <el-button type="primary" @click="handleSubmit(1)">提交</el-button> |
| | | <el-button type="primary" @click="handleSubmit(3)">同步给保藏人</el-button> |
| | | <el-button type="default" @click="handleSubmit(2)">存草稿</el-button> |
| | |
| | | editInoculationData: null, |
| | | editPreserveIndex: null, |
| | | editPreserveData: null, |
| | | roleType: JSON.parse(sessionStorage.getItem('userInfo')).roleType, // 1.超级管理员 2.审批人 3.工程师 4.实验员 |
| | | roleType: Number(JSON.parse(sessionStorage.getItem('userInfo')).roleType || 1), // 1.超级管理员 2.审批人 3.工程师 4.实验员 |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | experimentName: '' |
| | | }, |
| | | tableData: [], |
| | | roleType: JSON.parse(sessionStorage.getItem('userInfo')).roleType, |
| | | roleType: Number(JSON.parse(sessionStorage.getItem('userInfo')).roleType || 0), |
| | | showDelConfirm: false, |
| | | rowId: '', |
| | | changeStatus: false, |
| | |
| | | pageSize: this.queryForm.pageSize, |
| | | teamName: this.form.teamName, |
| | | reportName: this.form.reportName, |
| | | time: this.form.time.length?moment(this.form.date[0]).format('YYYY-MM-DD 00:00:00') + ' - ' + moment(this.form.date[1]).format('YYYY-MM-DD 23:59:59'):'', |
| | | time: this.form.date?.length?moment(this.form.date[0]).format('YYYY-MM-DD 00:00:00') + ' - ' + moment(this.form.date[1]).format('YYYY-MM-DD 23:59:59'):'', |
| | | status: this.form.status, |
| | | isDraft: this.isDraft ? 1 : 0, |
| | | reportType: 1 |
| | |
| | | }, |
| | | tableData: [], |
| | | showDelConfirm: false, |
| | | roleType: JSON.parse(sessionStorage.getItem('userInfo')).roleType, |
| | | roleType: Number(JSON.parse(sessionStorage.getItem('userInfo')).roleType || 0), |
| | | rowId: '', |
| | | changeStatus: false, |
| | | showApproval: false, |
| | |
| | | }, |
| | | tableData: [], |
| | | showDelConfirm: false, |
| | | roleType: JSON.parse(sessionStorage.getItem('userInfo')).roleType, |
| | | roleType: Number(JSON.parse(sessionStorage.getItem('userInfo')).roleType || 0), |
| | | rowId: '', |
| | | changeStatus: false, |
| | | showApproval: false, |
| | |
| | | pageSize: this.queryForm.pageSize, |
| | | teamName: this.form.teamName, |
| | | reportName: this.form.reportName, |
| | | time: this.form.date.length?moment(this.form.date[0]).format('YYYY-MM-DD 00:00:00') + ' - ' + moment(this.form.date[1]).format('YYYY-MM-DD 23:59:59'):'', |
| | | time: this.form.date?.length?moment(this.form.date[0]).format('YYYY-MM-DD 00:00:00') + ' - ' + moment(this.form.date[1]).format('YYYY-MM-DD 23:59:59'):'', |
| | | status: this.form.status, |
| | | isDraft: this.isDraft ? 1 : 0, |
| | | reportType: 2 |
| | |
| | | }, |
| | | tableData: [], |
| | | showDelConfirm: false, |
| | | roleType: JSON.parse(sessionStorage.getItem('userInfo')).roleType, |
| | | roleType: Number(JSON.parse(sessionStorage.getItem('userInfo')).roleType || 0), |
| | | rowId: '', |
| | | changeStatus: false, |
| | | showApproval: false, |