From 718a13554dbb2f99e27adeb7b95edfc3096dacc5 Mon Sep 17 00:00:00 2001 From: 董国庆 <364620639@qq.com> Date: 星期四, 26 六月 2025 14:24:27 +0800 Subject: [PATCH] 删除打印和路由返回 --- laboratory/src/views/dataManagement/sampleManage/addSample.vue | 35 +++++++++++------------------------ 1 files changed, 11 insertions(+), 24 deletions(-) diff --git a/laboratory/src/views/dataManagement/sampleManage/addSample.vue b/laboratory/src/views/dataManagement/sampleManage/addSample.vue index 81dc6ac..ee30b16 100644 --- a/laboratory/src/views/dataManagement/sampleManage/addSample.vue +++ b/laboratory/src/views/dataManagement/sampleManage/addSample.vue @@ -254,6 +254,7 @@ import ReceiveConfirmDialog from "./components/receiveConfirmDialog.vue"; import { add, getDetail, update, batchCollectSamples } from "./service"; import {getFullUrl} from '@/utils/utils.js' +import { mapState } from "vuex"; export default { name: "AddSample", @@ -320,6 +321,7 @@ } }, computed: { + ...mapState(["tagList", "isFold"]), isEngineer() { return this.userRole == '3'; // 工艺工程师 }, @@ -350,24 +352,18 @@ // 设置取样操作记录 if (detail.samplingRecordOperations && detail.samplingRecordOperations.length > 0) { - console.log('原始取样操作记录:', detail.samplingRecordOperations); - - // 如果是化验师角色,需要将数据分为待接收和已接收 if (this.isAssayer) { // 确保status是字符串类型 this.pendingSamples = detail.samplingRecordOperations .filter(item => { const status = String(item.status); - console.log('过滤待接收样品:', item.id, status); return status == '2'; }) .map(item => ({ ...item, status: String(item.status) })); - console.log('处理后的待接收样品:', this.pendingSamples); this.pendingSamplesTotal = this.pendingSamples.length; - this.receivedSamples = detail.samplingRecordOperations .filter(item => String(item.status) == '3') .map(item => ({ @@ -384,16 +380,6 @@ })); } } - - // 如果是详情模式,禁用所有输入 - // if (this.pageType == 'detail') { - // this.$nextTick(() => { - // const inputs = document.querySelectorAll('input, textarea, select'); - // inputs.forEach(input => { - // input.disabled = true; - // }); - // }); - // } } } catch (error) { console.error('获取详情失败:', error); @@ -460,10 +446,6 @@ samplingCode: this.form.sampleCode, id: this.form.id, }; - - // 打印提交数据 - console.log('保存提交数据:',submitData); - let res; if (this.pageType == 'edit') { // 编辑模式调用update接口 @@ -475,7 +457,7 @@ if (res.code == 200) { this.$message.success(this.pageType == 'edit' ? '编辑成功' : '保存成功'); - this.$router.go(-1); + this.back(); } else { this.$message.error(res.msg || (this.pageType == 'edit' ? '编辑失败' : '保存失败')); } @@ -485,6 +467,13 @@ } } }); + }, + back() { + this.$router.back(); + this.$store.commit( + "SET_TAGLIST", + this.tagList.filter((item) => item.path !== this.$route.path) + ); }, // 添加存草稿方法 async handleSaveDraft() { @@ -518,7 +507,7 @@ if (res.code == 200) { this.$message.success(this.pageType == 'edit' ? '草稿保存成功' : '存草稿成功'); - this.$router.go(-1); + this.back() } else { this.$message.error(res.msg || (this.pageType == 'edit' ? '草稿保存失败' : '存草稿失败')); } @@ -528,9 +517,7 @@ } }, handlePendingSelectionChange(selection) { - console.log("pending samples data:", this.pendingSamples); this.selectedSamples = selection; - // 强制更新视图 this.$nextTick(() => { this.$forceUpdate(); }); -- Gitblit v1.7.1