董国庆
2026-03-24 67392e14f3dbaeb66e9af6b8bb53201432fa7da1
修改 页面缓存
35个文件已修改
967 ■■■■■ 已修改文件
laboratory/src/components/AiEditor/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/components/SignatureCanvas.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/layouts/components/AppContent.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/router/index.js 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/pilotAndProduction/add.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/pilotAndProduction/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/productApproval/add.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/productApproval/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/projectTesting/add.vue 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/projectTesting/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/rawMaterials/add.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/chemistQa/rawMaterials/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/approvalPlan/addPlan.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/approvalPlan/list.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/dispatching/addDispatch.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/dispatching/list.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/inspectionReport/detail.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/inspectionReport/list.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/originalRecordTest/detail.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/sampleManage/addSample.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/sampleManage/list.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/schemeManagement/addPlan.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/schemeManagement/list.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/testResultReport/detail.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/dataManagement/testResultReport/list.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/deliveryAssessment/testerWorkerEvaluate/add.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/deliveryAssessment/testerWorkerEvaluate/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/projectList/addProject.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/projectList/editProject.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/feasibilityReport/add.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/feasibilityStudy/add.vue 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/processDevelopment/add.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/projectProposalLibrary/add.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/reportLibrary/verificationRelease/add.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/views/system/role/edit.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
laboratory/src/components/AiEditor/index.vue
@@ -203,7 +203,8 @@
                  }
                  resolve(data);
                }).catch((error) => {
                  // reject(error);
                  this.$message.error('图片上传失败');
                  reject(error);
                })
            });
          },
@@ -233,7 +234,8 @@
                  }
                  resolve(data);
                }).catch((error) => {
                  // reject(error);
                  this.$message.error('视频上传失败');
                  reject(error);
                })
            });
          },
laboratory/src/components/SignatureCanvas.vue
@@ -217,7 +217,7 @@
          })
        },
        onError: (err) => {
          // this.$message && this.$message.error ? this.$message.error('上传签名失败') : alert('上传签名失败');
          this.$message.error('上传签名失败');
        }
      });
    }
laboratory/src/layouts/components/AppContent.vue
@@ -1,7 +1,7 @@
<template>
  <div @click="foldFun" style="height: 100%;">
    <keep-alive :include="keepAliveList">
      <router-view />
      <router-view :key="$route.name" />
    </keep-alive>
  </div>
</template>
laboratory/src/router/index.js
@@ -88,6 +88,7 @@
                meta: {
                    title: "编辑角色",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/system/role/edit"),
            },
@@ -142,6 +143,7 @@
                meta: {
                    title: "编辑项目组",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/projectList/editProject"),
            },
@@ -183,18 +185,38 @@
                component: () => import("../views/dataManagement/approvalPlan/addPlan"),
            },
            {
                path: "editPlan",
                name: "editPlan",
                meta: {
                    title: "编辑项目课题方案",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/dataManagement/approvalPlan/addPlan"),
            },
            {
                path: "dispatching",
                meta: {
                    title: "实验调度管理",
                    keepAlive: true,
                      privilege:'dataManagement_dispatching'
                },
                component: () => import("../views/dataManagement/dispatching/list.vue"),
            },
            {
                path: "addDispatch",
                name: "AddDispatch",
                meta: {
                    title: "新增实验调度",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/dataManagement/dispatching/addDispatch"),
            },
            {
                path: "editDispatch",
                name: "EditDispatch",
                meta: {
                    title: "编辑实验调度",
                    hide: true,
                    keepAlive: true,
                },
@@ -237,12 +259,23 @@
                    keepAlive: true,
                },
                component: () => import("../views/dataManagement/schemeManagement/addPlan.vue"),
            },
            {
                path: "scheme-management/edit",
                name: "editSchemeManagement",
                meta: {
                    title: "编辑实验方案",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/dataManagement/schemeManagement/addPlan.vue"),
            }, {
                path: "scheme-management/stop-experiment",
                name: "schemeManagementStopExperiment",
                meta: {
                    title: "终止实验方案",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/dataManagement/schemeManagement/stop-experiment.vue"),
            },
@@ -258,7 +291,7 @@
                        path: "manage",
                        meta: {
                            title: "样品管理",
                            keepAlive: true,
                            // keepAlive: true,
                            privilege:'sampleManage',
                            // hide:JSON.parse(sessionStorage.getItem('userInfo'))&&JSON.parse(sessionStorage.getItem('userInfo')).roleType=='5'?true:false,
                              privilege:'sampleManage_manage'
@@ -267,9 +300,19 @@
                    },
                    {
                        path: "addSample",
                        name: "addPaddSamplelan",
                        name: "addSample",
                        meta: {
                            title: "新增样品",
                            hide: true,
                            keepAlive: true,
                        },
                        component: () => import("../views/dataManagement/sampleManage/addSample"),
                    },
                    {
                        path: "editSample",
                        name: "editSample",
                        meta: {
                            title: "编辑样品",
                            hide: true,
                            keepAlive: true,
                        },
@@ -278,7 +321,7 @@
                        path: "record",
                        meta: {
                            title: "取样操作记录列表",
                            keepAlive: true,
                            // keepAlive: true,
                            // privilege:'sampleManage'
                              privilege:'sampleManage_record'
                        },
@@ -320,7 +363,7 @@
                path: "deliveryRecord",
                meta: {
                    title: "取样送样记录",
                    keepAlive: true,
                    // keepAlive: true,
                     privilege:'dataManagement_deliveryRecord'
                },
                component: () => import("../views/dataManagement/SampleDeliveryRecord/list.vue"),
@@ -374,10 +417,20 @@
                component: () => import("../views/dataManagement/inspectionReport/detail.vue"),
            },
            {
                path: "inspectionReport/add",
                name: "inspectionReportAdd",
                meta: {
                    title: "新增检验报告",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/dataManagement/inspectionReport/detail.vue"),
            },
            {
                path: "testResultReport",
                meta: {
                    title: "实验结果汇报",
                    keepAlive: true,
                    // keepAlive: true,
                     privilege:'dataManagement_testResultReport'
                },
                component: () => import("../views/dataManagement/testResultReport/list.vue"),
@@ -393,10 +446,20 @@
                component: () => import("../views/dataManagement/testResultReport/detail.vue"),
            },
            {
                path: "testResultReport/add",
                name: "testResultReportAdd",
                meta: {
                    title: "新增实验结果汇报",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/dataManagement/testResultReport/detail.vue"),
            },
            {
                path: "suspendExperiment",
                meta: {
                    title: "实验中止审批",
                    keepAlive: true,
                    // keepAlive: true,
                     privilege:'dataManagement_suspendExperiment'
                },
                component: () => import("../views/dataManagement/suspendExperiment/list.vue"),
@@ -421,6 +484,7 @@
            },
            {
                path: "add",
                name: "AddFeasibilityStudy",
                meta: {
                    title: "新增可研报告",
                    hide: true,
@@ -430,6 +494,7 @@
            },
            {
                path: "edit",
                name: "EditFeasibilityStudy",
                meta: {
                    title: "编辑可研报告",
                    hide: true,
@@ -441,13 +506,14 @@
                path: "feasibilityReport",
                meta: {
                    title: "可行报告库",
                    keepAlive: true,
                    // keepAlive: true,
                      privilege:'reportLibrary_feasibilityReport'
                },
                component: () => import("../views/reportLibrary/feasibilityReport/index.vue"),
            },
            {
                path: "addFeasibility",
                name: "AddFeasibilityReport",
                meta: {
                    title: "新增可行报告",
                    hide: true,
@@ -457,6 +523,7 @@
            },
            {
                path: "editFeasibility",
                name: "EditFeasibilityReport",
                meta: {
                    title: "编辑可行报告",
                    hide: true,
@@ -470,7 +537,7 @@
                path: "processDevelopment",
                meta: {
                    title: "工艺开发工具",
                    keepAlive: true,
                    // keepAlive: true,
                      privilege:'reportLibrary_processDevelopment'
                },
                component: () => import("../views/reportLibrary/processDevelopment/index.vue"),
@@ -478,6 +545,7 @@
            {
                path: "addProcessDevelopment",
                name: "AddProcessDevelopment",
                meta: {
                    title: "新增工艺开发工具",
                    hide: true,
@@ -487,6 +555,7 @@
            },
            {
                path: "editProcessDevelopment",
                name: "EditProcessDevelopment",
                meta: {
                    title: "编辑工艺开发工具",
                    hide: true,
@@ -498,13 +567,14 @@
                path: "verificationRelease",
                meta: {
                    title: "验证与发布",
                    keepAlive: true,
                    // keepAlive: true,
                      privilege:'reportLibrary_verificationRelease'
                },
                component: () => import("../views/reportLibrary/verificationRelease/index.vue"),
            },
            {
                path: "addVerificationRelease",
                name: "AddVerificationRelease",
                meta: {
                    title: "新增验证与发布",
                    hide: true,
@@ -514,6 +584,7 @@
            },
            {
                path: "editVerificationRelease",
                name: "EditVerificationRelease",
                meta: {
                    title: "编辑验证与发布",
                    hide: true,
@@ -525,13 +596,14 @@
                path: "projectProposalLibrary",
                meta: {
                    title: "立项报告库",
                    keepAlive: true,
                    // keepAlive: true,
                      privilege:'reportLibrary_projectProposalLibrary'
                },
                component: () => import("../views/reportLibrary/projectProposalLibrary/index.vue"),
            },
            {
                path: "addProjectProposalLibrary",
                name: "AddProjectProposalLibrary",
                meta: {
                    title: "新增立项报告",
                    hide: true,
@@ -541,6 +613,7 @@
            },
            {
                path: "editProjectProposalLibrary",
                name: "EditProjectProposalLibrary",
                meta: {
                    title: "编辑立项报告",
                    hide: true,
@@ -561,15 +634,26 @@
                path: "projectTesting",
                meta: {
                    title: "项目检测项、检验包列表",
                    keepAlive: true,
                    // keepAlive: true,
                     privilege:'chemistQa_projectTesting'
                },
                component: () => import("../views/chemistQa/projectTesting/index.vue"),
            },
            {
                path: "add",
                name: "AddProjectTesting",
                meta: {
                    title: "新增检测项",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/chemistQa/projectTesting/add.vue"),
            },
            {
                path: "edit",
                name: "EditProjectTesting",
                meta: {
                    title: "编辑检测项",
                    hide: true,
                    keepAlive: true,
                },
@@ -595,8 +679,19 @@
            },
            {
                path: "addPilot",
                name: "AddPilotAndProduction",
                meta: {
                    title: "新增实验、中试、生产验证试验检验分析报告",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/chemistQa/pilotAndProduction/add.vue"),
            },
            {
                path: "editPilot",
                name: "EditPilotAndProduction",
                meta: {
                    title: "编辑实验、中试、生产验证试验检验分析报告",
                    hide: true,
                    keepAlive: true,
                },
@@ -606,15 +701,26 @@
                path: "rawMaterials",
                meta: {
                    title: "原辅料、包材、竞品检验分析报告",
                    keepAlive: true,
                    // keepAlive: true,
                     privilege:'chemistQa_rawMaterials'
                },
                component: () => import("../views/chemistQa/rawMaterials/index.vue"),
            },
            {
                path: "addRawMaterials",
                name: "AddRawMaterials",
                meta: {
                    title: "新增原辅料、包材、竞品检验分析报告",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/chemistQa/rawMaterials/add.vue"),
            },
            {
                path: "editRawMaterials",
                name: "EditRawMaterials",
                meta: {
                    title: "编辑原辅料、包材、竞品检验分析报告",
                    hide: true,
                    keepAlive: true,
                },
@@ -624,15 +730,26 @@
                path: "productApproval",
                meta: {
                    title: "产品报批及项目工作总计报告",
                    keepAlive: true,
                    // keepAlive: true,
                     privilege:'chemistQa_productApproval'
                },
                component: () => import("../views/chemistQa/productApproval/index.vue"),
            },
            {
                path: "addProductApproval",
                name: "AddProductApproval",
                meta: {
                    title: "新增产品报批及项目工作总计报告",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/chemistQa/productApproval/add.vue"),
            },
            {
                path: "editProductApproval",
                name: "EditProductApproval",
                meta: {
                    title: "编辑产品报批及项目工作总计报告",
                    hide: true,
                    keepAlive: true,
                },
@@ -771,6 +888,17 @@
            },
            {
                // 工艺工程师
                path: "editTesterWorkerEvaluate",
                name: 'EditTesterWorkerEvaluate',
                meta: {
                    title: "编辑实验员工作评定",
                    hide: true,
                    keepAlive: true,
                },
                component: () => import("../views/deliveryAssessment/testerWorkerEvaluate/add"),
            },
            {
                // 工艺工程师
                path: "chemistEvaluate",
                meta: {
                    title: "化验师工作评定",
laboratory/src/views/chemistQa/pilotAndProduction/add.vue
@@ -141,6 +141,7 @@
import moment from "moment";
export default {
  name: "AddPilotAndProduction",
  components: {
    AiEditor,
    chooseProject,
@@ -185,10 +186,21 @@
    ).userId;
    this.form.developDate = moment().format("YYYY-MM-DD HH:mm:ss");
    if (this.$route.query.id) {
    const routeName = this.$route.name;
    if (routeName === "EditPilotAndProduction" && this.$route.query.id) {
      this.getDetail();
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditPilotAndProduction" && routeId && routeId !== this.form.id) {
      this.getDetail();
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
  computed: {
    ...mapState(["tagList", "isFold"]),
  },
laboratory/src/views/chemistQa/pilotAndProduction/index.vue
@@ -167,7 +167,7 @@
        },
        handleEdit(row) {
            this.$router.push({
                path: '/chemistQa/addPilot',
                path: '/chemistQa/editPilot',
                query: { id: row.id, type: 'edit' }
            });
        },
laboratory/src/views/chemistQa/productApproval/add.vue
@@ -82,6 +82,7 @@
import apiConfig from '@/utils/baseurl';
export default {
  name: "AddProductApproval",
  components: {
    AiEditor,
    chooseProject,
@@ -126,9 +127,20 @@
    ).userId;
    this.form.developDate = new Date().toISOString().split("T")[0];
    if (this.$route.query.id) {
    const routeName = this.$route.name;
    if (routeName === "EditProductApproval" && this.$route.query.id) {
      this.getDetail();
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditProductApproval" && routeId && routeId !== this.form.id) {
      this.getDetail();
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
  computed: {
    ...mapState(["tagList", "isFold"]),
@@ -328,8 +340,8 @@
          }
        },
        onError: (err) => {
          // this.$message.error("文件上传失败");
          // onError(err);
          this.$message.error("文件上传失败");
          onError(err);
        },
      });
    },
laboratory/src/views/chemistQa/productApproval/index.vue
@@ -167,7 +167,7 @@
        },
        handleEdit(row) {
            this.$router.push({
                path: '/chemistQa/addProductApproval',
                path: '/chemistQa/editProductApproval',
                query: { id: row.id }
            });
        },
laboratory/src/views/chemistQa/projectTesting/add.vue
@@ -122,10 +122,11 @@
import { addData, editData, getDetail,revokedReport,deleteDetail } from './service'
export default {
    components: {
        AiEditor,
        chooseProject, ShowDelConfirm
    },
  name: "AddProjectTesting",
  components: {
    AiEditor,
    chooseProject, ShowDelConfirm
  },
    data() {
        return {
            isEdit: false,
@@ -163,22 +164,34 @@
        }
    },
    mounted() {
        if (this.$route.query.id) {
            if (this.$route.query.type === 'detail') {
                this.isDetail = true
                // getListByItemId({ id: this.$route.query.id }).then(res=>{
                //     this.reportTableData=res.data
                // })
            } else if (this.$route.query.type === 'edit') {
                this.isEdit = true
            }
            this.getDetail()
        }
        if (this.$route.query.itemId) {
            this.itemId = this.$route.query.itemId
        }
    },
    const routeName = this.$route.name;
    if (routeName === "EditProjectTesting" && this.$route.query.id) {
      if (this.$route.query.type === 'detail') {
        this.isDetail = true
      } else if (this.$route.query.type === 'edit') {
        this.isEdit = true
      }
      this.getDetail()
    }
    if (this.$route.query.itemId) {
      this.itemId = this.$route.query.itemId
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditProjectTesting" && routeId && routeId !== this.form.id) {
      if (this.$route.query.type === 'detail') {
        this.isDetail = true
      } else if (this.$route.query.type === 'edit') {
        this.isEdit = true
      }
      this.getDetail()
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
    methods: {
        getDetail() {
            getDetail(this.$route.query.id).then(res => {
laboratory/src/views/chemistQa/projectTesting/index.vue
@@ -307,7 +307,7 @@
        handleEdit(row) {
            // 编辑操作
            this.$router.push({
                path: '/chemistQa/add',
                path: '/chemistQa/edit',
                query: {
                    id: row.id,
                    type: 'edit'
laboratory/src/views/chemistQa/rawMaterials/add.vue
@@ -138,6 +138,7 @@
import { customUploadRequest, getFullUrl } from "@/utils/utils";
import { mapState } from "vuex";
export default {
  name: "AddRawMaterials",
  components: {
    AiEditor,
    chooseProject,
@@ -182,10 +183,21 @@
    ).userId;
    this.form.developDate = new Date().toISOString().split("T")[0];
    if (this.$route.query.id) {
    const routeName = this.$route.name;
    if (routeName === "EditRawMaterials" && this.$route.query.id) {
      this.getDetail();
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditRawMaterials" && routeId && routeId !== this.form.id) {
      this.getDetail();
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
  computed: {
    ...mapState(["tagList", "isFold"]),
  },
laboratory/src/views/chemistQa/rawMaterials/index.vue
@@ -166,7 +166,7 @@
        },
        handleEdit(row) {
            this.$router.push({
                path: '/chemistQa/addRawMaterials',
                path: '/chemistQa/editRawMaterials',
                query: { id: row.id }
            });
        },
laboratory/src/views/dataManagement/approvalPlan/addPlan.vue
@@ -142,7 +142,7 @@
import { mapState } from "vuex";
export default {
  name: "AddProject",
  name: "addPlan",
  components: {
    AiEditor,
  },
@@ -356,6 +356,37 @@
          });
      }
    },
    resetForm() {
      this.id = "";
      this.form = {
        projectName: "",
        projectStage: "",
        projectCode: "",
        experimentObjective: "",
        experimentMaterial: "",
        experimentDevice: "",
        experimentTestMethod: "",
        experimentProcedure: "",
        dataAcquisition: "",
        resultEvaluation: "",
        precautions: "",
        auditStatus: 1,
      };
      this.editorContents = {
        experimentObjective: "",
        experimentMaterial: "",
        experimentDevice: "",
        experimentTestMethod: "",
        experimentProcedure: "",
        dataAcquisition: "",
        resultEvaluation: "",
        precautions: "",
      };
      if (this.$refs.form) {
        this.$refs.form.resetFields();
      }
    },
  },
  created() {
    // 从路由参数中获取id
@@ -364,6 +395,22 @@
      this.getDetail();
    }
  },
  activated() {
    const routeName = this.$route.name;
    const routeId = this.$route.query.id;
    // 如果是编辑路由
    if (routeName === "editPlan") {
      // 如果 id 发生变化,重新加载数据
      if (routeId && routeId !== this.id) {
        this.id = routeId;
        this.getDetail();
      }
      // 如果 id 相同,保留当前编辑的数据(不重新加载)
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
    // 这样就可以实现新增页面的缓存效果
  },
};
</script>
laboratory/src/views/dataManagement/approvalPlan/list.vue
@@ -244,7 +244,7 @@
    },
    handleEdit(row) {
      this.$router.push({
        path: "/dataManagement/addPlan",
        path: "/dataManagement/editPlan",
        query: { id: row.id }
      });
    },
laboratory/src/views/dataManagement/dispatching/addDispatch.vue
@@ -268,7 +268,7 @@
} from "./service";
import { mapState } from "vuex";
export default {
  name: "AddProject",
  name: "addDispatch",
  components: {
    SelectMember,
    AddGroupDialog,
@@ -277,6 +277,7 @@
  },
  data() {
    return {
      dispatchId: "",
      id: "", // 用于编辑时存储id
      form: {
        projectName: "", // 课题方案名称
@@ -848,9 +849,12 @@
    },
    // 获取详情
    getDetail() {
      if (this.id) {
        getDetailById({ id: this.id })
    loadDetail() {
      const id = this.$route.query.id;
      if (id) {
        this.dispatchId = id;
        this.id = id;
        getDetailById({ id })
          .then((res) => {
            if (res) {
              const data = res;
@@ -947,12 +951,7 @@
    },
  },
  created() {
    // 从路由参数中获取id
    this.id = this.$route.query.id;
    if (this.id) {
      // TODO: 获取详情
      this.getDetail();
    }
    this.loadDetail();
    // 创建防抖的搜索方法
    this.debouncedSearch = this.debounce(this.handleProjectSearch, 300);
    // 初始化时自动添加当前用户为工艺工程师(如果是工艺工程师角色)
@@ -972,6 +971,15 @@
    }
    this.updateTaskTableData(); // 初始化时同步一次
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditDispatch" && routeId && routeId !== this.dispatchId) {
      this.loadDetail();
    }
  },
};
</script>
laboratory/src/views/dataManagement/dispatching/list.vue
@@ -259,7 +259,7 @@
    },
    handleEdit(row) {
      this.$router.push({
        path: "/dataManagement/addDispatch",
        path: "/dataManagement/editDispatch",
        query: {
          id: row.id,
          type: 'edit'
laboratory/src/views/dataManagement/inspectionReport/detail.vue
@@ -118,7 +118,7 @@
import { mapState } from "vuex";
export default {
  name: "AddProject",
  name: "inspectionReportDetail",
  components: {
    AddDialog,
    experimentalScheduling,
@@ -126,6 +126,7 @@
  },
  data() {
    return {
      reportId: "",
      dialogVisible: false,
      isEdit: false,
      currentEditIndex: -1,
@@ -165,11 +166,26 @@
  created() {
    // 从路由参数中获取id和type
    const { id, type } = this.$route.query;
    if (id) {
    const routeName = this.$route.name;
    if (routeName === "inspectionReportDetail" && id) {
      this.reportId = id;
      this.pageType = type || "view";
      this.getDetail(id);
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是详情路由,且id发生变化,重新加载数据
    if (routeName === "inspectionReportDetail" && routeId && routeId !== this.reportId) {
      this.reportId = routeId;
      this.pageType = this.$route.query.type || "view";
      this.getDetail(routeId);
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
  computed: {
    ...mapState(["tagList", "isFold"]),
  },
laboratory/src/views/dataManagement/inspectionReport/list.vue
@@ -187,7 +187,7 @@
    },
    handleAdd() {
      this.$router.push({
        path: "/dataManagement/inspectionReport/detail",
        path: "/dataManagement/inspectionReport/add",
        query: {
          type: 'add'
        }
laboratory/src/views/dataManagement/originalRecordTest/detail.vue
@@ -151,13 +151,14 @@
import { mapState } from "vuex";
export default {
  name: "AddProject",
  name: "OriginalRecordTestDetail",
  components: {
    AddDialog,
    AiEditor
  },
  data() {
    return {
      recordId: "",
      dialogVisible: false,
      isEdit: false,
      currentEditIndex: -1,
@@ -483,7 +484,19 @@
    }
  },
  created() {
    this.getDetail();
    const id = this.$route.query.id;
    if (id) {
      this.recordId = id;
      this.getDetail();
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    // 如果id发生变化,重新加载数据
    if (routeId && routeId !== this.recordId) {
      this.recordId = routeId;
      this.getDetail();
    }
  }
};
</script>
laboratory/src/views/dataManagement/sampleManage/addSample.vue
@@ -257,7 +257,7 @@
import { mapState } from "vuex";
export default {
  name: "AddSample",
  name: "addSample",
  components: {
    experimentalScheduling,
    addTime,
@@ -265,6 +265,7 @@
  },
  data() {
    return {
      sampleId: "",
      showScheduling: false,
      showAddTime: false,
      showAdditives: true,
@@ -320,6 +321,20 @@
      this.getDetailData(id);
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    console.log('routeName routeName',routeName)
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditSample" && routeId && routeId !== this.sampleId) {
      this.sampleId = routeId;
      const { type } = this.$route.query;
      this.pageType = type || 'detail';
      this.getDetailData(routeId);
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
  computed: {
    ...mapState(["tagList", "isFold"]),
    isEngineer() {
@@ -333,6 +348,7 @@
    getFullUrl,
    // 获取详情数据
    async getDetailData(id) {
      this.sampleId = id;
      try {
        const res = await getDetail({ id });
        if (res) {
laboratory/src/views/dataManagement/sampleManage/list.vue
@@ -213,7 +213,7 @@
    },
    handleEdit(row) {
      this.$router.push({
        path: "/sampleManage/addSample",
        path: "/sampleManage/editSample",
        query: {
          id: row.id,
          type: 'edit'
laboratory/src/views/dataManagement/schemeManagement/addPlan.vue
@@ -302,20 +302,63 @@
      holdInfo: {},
    };
  },
  async created() {
  async mounted() {
    const userInfo = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
    this.userRole = userInfo.roleType || "";
    // 检查是否为编辑模式
    if (this.$route.query.type === "edit" && this.$route.query.id) {
  },
  async activated() {
    const userInfo = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
    this.userRole = userInfo.roleType || "";
    const routeName = this.$route.name;
    // 如果是编辑路由,每次都重新加载数据
    if (routeName === "editSchemeManagement") {
      this.isEdit = this.userRole == 3 ? false : true;
      this.editId = this.$route.query.id;
      await this.loadEditData();
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
    // 这样就可以实现新增页面的缓存效果
  },
  computed: {
    ...mapState(["tagList", "isFold"]),
  },
  methods: {
    resetForm() {
      this.form = {
        experimentDate: "",
        experimentMaterial: null,
        experimentDevice: null,
        experimentObjective: "",
        experimentParamRoute: "",
        experimentStepRecord: [],
        experimentSchemePersons: [],
        dispatchId: "",
        status: -1,
        commitTime: "",
      };
      this.editorContents = {
        purpose: "",
        process: "",
      };
      this.stepList = [];
      this.editingStepIndex = -1;
      this.groupTableData = [];
      this.groupData = [];
      this.taskTableData = [];
      this.participantsData = [];
      this.selectedParticipants = [];
      this.isEdit = false;
      this.editId = null;
      this.viewMaterialData = [];
      this.viewEquipmentData = [];
      this.holdInfo = {};
      if (this.$refs.form) {
        this.$refs.form.resetFields();
      }
    },
    // ===== 人员相关方法 =====
    addMember() {
      this.$refs.selectMember.open(this.participantsData, []);
laboratory/src/views/dataManagement/schemeManagement/list.vue
@@ -64,6 +64,7 @@
            <template v-if="currentType === 'draft'">
              <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
              <el-button type="text" @click="handleDetail(scope.row)">详情</el-button>
              <el-button type="text" @click="handleDelete(scope.row)" style="color: #F56C6C;">删除</el-button>
            </template>
            <!-- 非草稿箱,按原有角色逻辑 -->
            <template v-else>
@@ -87,12 +88,20 @@
    </TableCustom>
    <!-- 审批弹窗 -->
    <approval-dialog :visible.sync="approvalDialogVisible" :type="approvalDialogType" :data="currentApprovalData" />
    <!-- 删除确认弹窗 -->
    <ShowDelConfirm
      :title="changeStatusTitle"
      :tip="changeStatusTip"
      :show="changeStatus"
      @close="changeStatus = false"
      @confirm="handleChangeStatusConfirm"
    />
  </div>
</template>
<script>
import ApprovalDialog from './components/approvalDialog.vue'
import { getList } from './service'
import { getList,deleteById } from './service'
export default {
  name: "ProjectList",
@@ -118,6 +127,11 @@
      approvalDialogType: 'view',
      currentApprovalData: null,
      userRole: '',
       changeStatus: false,
      changeStatusTitle: "",
      changeStatusTip: "",
      currentOperationRow: null, // 当前操作的行数据
    };
  },
  created() {
@@ -148,6 +162,18 @@
        this.form.status = -1;
      }
      this.getTableData();
    },
        handleChangeStatusConfirm() {
      // 处理删除逻辑
      deleteById({
        id: this.currentOperationRow.id
      }).then(() => {
        this.$message.success("删除成功");
        this.changeStatus = false;
        this.getTableData();
      }).catch(error => {
        this.$message.error("删除失败");
      });
    },
    resetForm() {
      this.form = {
@@ -263,7 +289,7 @@
    },
    handleEdit(row) {
      this.$router.push({
        path: "/dataManagement/scheme-management/add",
        path: "/dataManagement/scheme-management/edit",
        query: {
          id: row.id,
          type: 'edit'
@@ -275,6 +301,12 @@
      this.approvalDialogVisible = true;
      this.currentApprovalData = row;
    },
        handleDelete(row) {
      this.currentOperationRow = row;
      this.changeStatusTitle = "确认要删除这条信息吗?";
      this.changeStatusTip = "删除后信息无法找回";
      this.changeStatus = true;
    },
    handleApproveSubmit(data) {
      this.approvalDialogVisible = false;
      this.getTableData();
laboratory/src/views/dataManagement/testResultReport/detail.vue
@@ -295,7 +295,7 @@
} from "./service";
import { mapState } from "vuex";
export default {
  name: "AddProject",
  name: "testResultReportDetail",
  components: {
    ExperimentalScheduling,
    EvaluationDialog,
@@ -307,6 +307,7 @@
  },
  data() {
    return {
      reportId: "",
      showNewDialog: true,
      dialogVisible: false,
      schedulingDialogVisible: false,
@@ -392,12 +393,26 @@
    // 如果是编辑模式,获取详情数据
    const id = this.$route.query.id;
    if (id) {
    const routeName = this.$route.name;
    if (routeName === "testResultReportDetail" && id) {
      this.reportId = id;
      this.getDetailData(id);
    }
    const userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
    this.userRole = userInfo.roleType || "";
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "testResultReportDetail" && routeId && routeId !== this.reportId) {
      this.reportId = routeId;
      this.getDetailData(routeId);
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
  methods: {
    handleAddTask() {
      this.isEdit = false;
laboratory/src/views/dataManagement/testResultReport/list.vue
@@ -311,7 +311,7 @@
    },
    handleAddResult() {
      this.$router.push({
        path: "/dataManagement/testResultReport/detail",
        path: "/dataManagement/testResultReport/add",
        query: {
          type: "add",
        },
laboratory/src/views/deliveryAssessment/testerWorkerEvaluate/add.vue
@@ -131,6 +131,7 @@
  },
  data() {
    return {
      evaluateId: "",
      showScheduling: false,
      participantsData: [],
      selectedParticipants: [],
@@ -153,30 +154,27 @@
    };
  },
  activated() {
    this.participantsData = [];
    this.selectedParticipants = [];
    this.tableData = [];
    // this.isEdit = true; // 是否为编辑模式
    if (this.$route.query.id) {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditTesterWorkerEvaluate" && routeId && routeId !== this.evaluateId) {
      this.evaluateId = routeId;
      this.isEdit = this.$route.query.type == "view" ? false : true;
      console.log('this.$route.query.type == "view"',this.$route.query.type == "view")
      this.editId = this.$route.query.id;
      this.editId = routeId;
      this.loadEditData();
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
  mounted() {
    // const userInfo = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
    // this.userRole = userInfo.roleType || "";
    // 检查是否为编辑模式
    this.participantsData = [];
    this.selectedParticipants = [];
    this.tableData = [];
    // this.isEdit = true; // 是否为编辑模式
    if (this.$route.query.id) {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,加载数据
    if (routeName === "EditTesterWorkerEvaluate" && routeId) {
      this.evaluateId = routeId;
      this.isEdit = this.$route.query.type == "view" ? false : true;
      this.editId = this.$route.query.id;
      this.editId = routeId;
      this.loadEditData();
    }
  },
laboratory/src/views/deliveryAssessment/testerWorkerEvaluate/index.vue
@@ -195,7 +195,7 @@
    handleEdit(row) {
      // 编辑逻辑后续补充
      this.$router.push({
        path: "/deliveryAssessment/addTesterWorkerEvaluate",
        path: "/deliveryAssessment/editTesterWorkerEvaluate",
        query: { id: row.id, type: 'edit' },
      });
    },
laboratory/src/views/projectList/addProject.vue
@@ -87,8 +87,7 @@
                            roleType: member.roleType
                        }))
                    }
                    console.log('this.selectMemberData',this.selectMemberData)
                    return
                    addProject(data).then(res => {
                        if (res.code == 200) {
                            this.$message.success('添加成功')
laboratory/src/views/projectList/editProject.vue
@@ -44,6 +44,7 @@
    name: 'EddProject',
    data() {
        return {
            projectId: '',
            form: {
                teamName: '',
                personCharge: ''
@@ -67,19 +68,29 @@
        }
    },
    created() {
        getProjectDetail({ id: this.$route.query.id }).then(res => {
            this.form = {
                teamName: res.teamName,
                personCharge: res.personCharge
            }
            this.selectMemberData = res.staffs.map(item => ({
                userId: item.userId,
                roleName: ['审批人', '工艺工程师', '化验师', '实验员'][item.roleType - 2],
                nickName: item.nickName
            }))
        })
        this.loadProjectData();
    },
    activated() {
        const routeId = this.$route.query.id;
        if (routeId && routeId !== this.projectId) {
            this.loadProjectData();
        }
    },
    methods: {
        loadProjectData() {
            getProjectDetail({ id: this.$route.query.id }).then(res => {
                this.projectId = this.$route.query.id;
                this.form = {
                    teamName: res.teamName,
                    personCharge: res.personCharge
                }
                this.selectMemberData = res.staffs.map(item => ({
                    userId: item.userId,
                    roleName: ['审批人', '工艺工程师', '化验师', '实验员'][item.roleType - 2],
                    nickName: item.nickName
                }))
            })
        },
        submitForm() {
            this.$refs.form.validate((valid) => {
                if (valid) {
laboratory/src/views/reportLibrary/feasibilityReport/add.vue
@@ -121,12 +121,14 @@
import { mapState } from "vuex";
export default {
  name: "AddFeasibilityReport",
  components: {
    AiEditor,
    chooseProject,
  },
  data() {
    return {
      reportId: "",
      loading: false,
      form: {
        reportCode: "",
@@ -150,37 +152,52 @@
  },
  mounted() {
    if (this.$route.query.id) {
      this.getDetail();
    const routeName = this.$route.name;
    if (routeName === "EditFeasibilityReport") {
      this.loadDetail();
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditFeasibilityReport" && routeId && routeId !== this.reportId) {
      this.loadDetail();
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
  computed: {
    ...mapState(["tagList", "isFold"]),
  },
  methods: {
    getDetail() {
      getDetail(this.$route.query.id).then((res) => {
        this.form = res;
        this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }];
        if (
          res.feasibilityReportFiles &&
          res.feasibilityReportFiles.length > 0
        ) {
          this.fileList = res.feasibilityReportFiles.map((file) => {
            return {
              name: file.fileName,
              url: getFullUrl(file.fileUrl),
              uid: file.id,
            };
          });
          this.form.feasibilityReportFiles = res.feasibilityReportFiles;
        } else {
          this.fileList = [];
          this.form.feasibilityReportFiles = [];
        }
      });
    loadDetail() {
      const id = this.$route.query.id;
      if (id) {
        this.reportId = id;
        getDetail(id).then((res) => {
          this.form = res;
          this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }];
          if (
            res.feasibilityReportFiles &&
            res.feasibilityReportFiles.length > 0
          ) {
            this.fileList = res.feasibilityReportFiles.map((file) => {
              return {
                name: file.fileName,
                url: getFullUrl(file.fileUrl),
                uid: file.id,
              };
            });
            this.form.feasibilityReportFiles = res.feasibilityReportFiles;
          } else {
            this.fileList = [];
            this.form.feasibilityReportFiles = [];
          }
        });
      }
    },
    getProjectData(data) {
      this.tableData = [data];
laboratory/src/views/reportLibrary/feasibilityStudy/add.vue
@@ -84,12 +84,14 @@
import { mapState } from "vuex";
export default {
    name: "AddFeasibilityStudy",
    components: {
        AiEditor,
        chooseProject
    },
    data() {
        return {
            reportId: "",
            loading: false,
            form: {
                reportCode: "",
@@ -113,35 +115,50 @@
    },
    mounted() {
        if (this.$route.query.id) {
            this.getDetail()
        const routeName = this.$route.name;
        if (routeName === "EditFeasibilityStudy") {
            this.loadDetail();
        }
    },
    activated() {
        const routeId = this.$route.query.id;
        const routeName = this.$route.name;
        // 如果是编辑路由,且id发生变化,重新加载数据
        if (routeName === "EditFeasibilityStudy" && routeId && routeId !== this.reportId) {
            this.loadDetail();
        }
        // 如果是新增路由,不重置表单,保留用户填写的数据
    },
    computed: {
    ...mapState(["tagList", "isFold"]),
  },
    methods: {
        getDetail() {
            getDetail(this.$route.query.id).then(res => {
                this.form = res
                this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }]
                // 处理文件回显
                if (res.feasibilityReportFiles && res.feasibilityReportFiles.length > 0) {
                    this.fileList = res.feasibilityReportFiles.map(file => {
                        return {
                            name: file.fileName,
                            url: getFullUrl(file.fileUrl),
                            uid: file.id
                        }
                    })
                    this.form.feasibilityReportFiles = res.feasibilityReportFiles
                    console.log('res.feasibilityReportFiles',this.form.feasibilityReportFiles)
                } else {
                    this.fileList = []
                    this.form.feasibilityReportFiles = []
                }
            })
        loadDetail() {
            const id = this.$route.query.id;
            if (id) {
                this.reportId = id;
                getDetail(id).then(res => {
                    this.form = res
                    this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }]
                    // 处理文件回显
                    if (res.feasibilityReportFiles && res.feasibilityReportFiles.length > 0) {
                        this.fileList = res.feasibilityReportFiles.map(file => {
                            return {
                                name: file.fileName,
                                url: getFullUrl(file.fileUrl),
                                uid: file.id
                            }
                        })
                        this.form.feasibilityReportFiles = res.feasibilityReportFiles
                        console.log('res.feasibilityReportFiles',this.form.feasibilityReportFiles)
                    } else {
                        this.fileList = []
                        this.form.feasibilityReportFiles = []
                    }
                })
            }
        },
        //获取选择项目组数据
        getProjectData(data) {
laboratory/src/views/reportLibrary/processDevelopment/add.vue
@@ -83,12 +83,14 @@
import { customUploadRequest, getFullUrl } from '@/utils/utils'
import { mapState } from "vuex";
export default {
    components: {
        AiEditor,
        chooseProject
    },
  name: "AddProcessDevelopment",
  components: {
    AiEditor,
    chooseProject
  },
    data() {
        return {
            reportId: "",
            loading: false,
            form: {
                reportCode: "",
@@ -112,33 +114,48 @@
    },
    mounted() {
        if (this.$route.query.id) {
            this.getDetail()
        }
    },
    const routeName = this.$route.name;
    if (routeName === "EditProcessDevelopment") {
      this.loadDetail();
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditProcessDevelopment" && routeId && routeId !== this.reportId) {
      this.loadDetail();
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
    computed: {
    ...mapState(["tagList", "isFold"]),
  },
    methods: {
        getDetail() {
            getDetail(this.$route.query.id).then(res => {
                this.form = res
                this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }]
                if (res.feasibilityReportFiles && res.feasibilityReportFiles.length > 0) {
                    this.fileList = res.feasibilityReportFiles.map(file => {
                        return {
                            name: file.fileName,
                            url: getFullUrl(file.fileUrl),
                            uid: file.id
                        }
                    })
                    this.form.feasibilityReportFiles = res.feasibilityReportFiles
                } else {
                    this.fileList = []
                    this.form.feasibilityReportFiles = []
                }
            })
        loadDetail() {
            const id = this.$route.query.id;
            if (id) {
                this.reportId = id;
                getDetail(id).then(res => {
                    this.form = res
                    this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }]
                    if (res.feasibilityReportFiles && res.feasibilityReportFiles.length > 0) {
                        this.fileList = res.feasibilityReportFiles.map(file => {
                            return {
                                name: file.fileName,
                                url: getFullUrl(file.fileUrl),
                                uid: file.id
                            }
                        })
                        this.form.feasibilityReportFiles = res.feasibilityReportFiles
                    } else {
                        this.fileList = []
                        this.form.feasibilityReportFiles = []
                    }
                })
            }
        },
        //获取选择项目组数据
        getProjectData(data) {
laboratory/src/views/reportLibrary/projectProposalLibrary/add.vue
@@ -83,12 +83,14 @@
import { customUploadRequest, getFullUrl } from '@/utils/utils'
import { mapState } from "vuex";
export default {
    components: {
        AiEditor,
        chooseProject
    },
  name: "AddProjectProposalLibrary",
  components: {
    AiEditor,
    chooseProject
  },
    data() {
        return {
            reportId: "",
            loading: false,
            form: {
                reportCode: "",
@@ -111,34 +113,49 @@
    },
    mounted() {
        if (this.$route.query.id) {
            this.getDetail()
        }
    },
    const routeName = this.$route.name;
    if (routeName === "EditProjectProposalLibrary") {
      this.loadDetail();
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditProjectProposalLibrary" && routeId && routeId !== this.reportId) {
      this.loadDetail();
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
    computed: {
    ...mapState(["tagList", "isFold"]),
  },
    methods: {
        getDetail() {
            getDetail(this.$route.query.id).then(res => {
                this.form = res
                this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }]
                // 处理文件回显
                if (res.feasibilityReportFiles && res.feasibilityReportFiles.length > 0) {
                    this.fileList = res.feasibilityReportFiles.map(file => {
                        return {
                            name: file.fileName,
                            url: getFullUrl(file.fileUrl),
                            uid: file.id
                        }
                    })
                    this.form.feasibilityReportFiles = res.feasibilityReportFiles
                } else {
                    this.fileList = []
                    this.form.feasibilityReportFiles = []
                }
            })
        loadDetail() {
            const id = this.$route.query.id;
            if (id) {
                this.reportId = id;
                getDetail(id).then(res => {
                    this.form = res
                    this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }]
                    // 处理文件回显
                    if (res.feasibilityReportFiles && res.feasibilityReportFiles.length > 0) {
                        this.fileList = res.feasibilityReportFiles.map(file => {
                            return {
                                name: file.fileName,
                                url: getFullUrl(file.fileUrl),
                                uid: file.id
                            }
                        })
                        this.form.feasibilityReportFiles = res.feasibilityReportFiles
                    } else {
                        this.fileList = []
                        this.form.feasibilityReportFiles = []
                    }
                })
            }
        },
        //获取选择项目组数据
        getProjectData(data) {
laboratory/src/views/reportLibrary/verificationRelease/add.vue
@@ -83,12 +83,14 @@
import { customUploadRequest, getFullUrl } from '@/utils/utils'
import { mapState } from "vuex";
export default {
    components: {
        AiEditor,
        chooseProject
    },
  name: "AddVerificationRelease",
  components: {
    AiEditor,
    chooseProject
  },
    data() {
        return {
            reportId: "",
            loading: false,
            form: {
                reportCode: "",
@@ -112,34 +114,49 @@
    },
    mounted() {
        if (this.$route.query.id) {
            this.getDetail()
        }
    },
    const routeName = this.$route.name;
    if (routeName === "EditVerificationRelease") {
      this.loadDetail();
    }
  },
  activated() {
    const routeId = this.$route.query.id;
    const routeName = this.$route.name;
    // 如果是编辑路由,且id发生变化,重新加载数据
    if (routeName === "EditVerificationRelease" && routeId && routeId !== this.reportId) {
      this.loadDetail();
    }
    // 如果是新增路由,不重置表单,保留用户填写的数据
  },
    computed: {
    ...mapState(["tagList", "isFold"]),
  },
    methods: {
        getDetail() {
            getDetail(this.$route.query.id).then(res => {
                this.form = res
                this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }]
                // 处理文件回显
                if (res.feasibilityReportFiles && res.feasibilityReportFiles.length > 0) {
                    this.fileList = res.feasibilityReportFiles.map(file => {
                        return {
                            name: file.fileName,
                            url: getFullUrl(file.fileUrl),
                            uid: file.id
                        }
                    })
                    this.form.feasibilityReportFiles = res.feasibilityReportFiles
                } else {
                    this.fileList = []
                    this.form.feasibilityReportFiles = []
                }
            })
        loadDetail() {
            const id = this.$route.query.id;
            if (id) {
                this.reportId = id;
                getDetail(id).then(res => {
                    this.form = res
                    this.tableData = [{ ...res.projectTeam, staffName: res.staffNames }]
                    // 处理文件回显
                    if (res.feasibilityReportFiles && res.feasibilityReportFiles.length > 0) {
                        this.fileList = res.feasibilityReportFiles.map(file => {
                            return {
                                name: file.fileName,
                                url: getFullUrl(file.fileUrl),
                                uid: file.id
                            }
                        })
                        this.form.feasibilityReportFiles = res.feasibilityReportFiles
                    } else {
                        this.fileList = []
                        this.form.feasibilityReportFiles = []
                    }
                })
            }
        },
        //获取选择项目组数据
        getProjectData(data) {
laboratory/src/views/system/role/edit.vue
@@ -98,6 +98,7 @@
  props: {},
  data() {
    return {
      roleId: "",
      form: {
        roleName: "",
        remark: "",
@@ -118,23 +119,33 @@
  },
  watch: {},
  created() {
    roleInfoFromUserId({ userId: 1 }).then(res => {
      if (this.$route.query.roleId) {
        getRoleInfo({ roleId: this.$route.query.roleId }).then(resp => {
          this.menu = this.setSelectedIds(res, resp.menus || []);
          this.form = {
            roleName: resp.roleName,
            remark: resp.remark,
            roleId: resp.roleId
          }
        })
      } else {
        this.menu = res
      }
    })
    this.loadRoleData();
  },
  activated() {
    const routeId = this.$route.query.roleId;
    if (routeId && routeId !== this.roleId) {
      this.loadRoleData();
    }
  },
  mounted() { },
  methods: {
    loadRoleData() {
      roleInfoFromUserId({ userId: 1 }).then(res => {
        if (this.$route.query.roleId) {
          this.roleId = this.$route.query.roleId;
          getRoleInfo({ roleId: this.roleId }).then(resp => {
            this.menu = this.setSelectedIds(res, resp.menus || []);
            this.form = {
              roleName: resp.roleName,
              remark: resp.remark,
              roleId: resp.roleId
            }
          })
        } else {
          this.menu = res
        }
      })
    },
    setSelectedIds(arr, selectKeyList) {
      function traverse(item) {
        item.selected = selectKeyList.includes(item.menuId);