| | |
| | | } |
| | | resolve(data); |
| | | }).catch((error) => { |
| | | // reject(error); |
| | | this.$message.error('图片上传失败'); |
| | | reject(error); |
| | | }) |
| | | }); |
| | | }, |
| | |
| | | } |
| | | resolve(data); |
| | | }).catch((error) => { |
| | | // reject(error); |
| | | this.$message.error('视频上传失败'); |
| | | reject(error); |
| | | }) |
| | | }); |
| | | }, |
| | |
| | | }) |
| | | }, |
| | | onError: (err) => { |
| | | // this.$message && this.$message.error ? this.$message.error('上传签名失败') : alert('上传签名失败'); |
| | | this.$message.error('上传签名失败'); |
| | | } |
| | | }); |
| | | } |
| | |
| | | <template> |
| | | <div @click="foldFun" style="height: 100%;"> |
| | | <keep-alive :include="keepAliveList"> |
| | | <router-view /> |
| | | <router-view :key="$route.name" /> |
| | | </keep-alive> |
| | | </div> |
| | | </template> |
| | |
| | | meta: { |
| | | title: "编辑角色", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/system/role/edit"), |
| | | }, |
| | |
| | | meta: { |
| | | title: "编辑项目组", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/projectList/editProject"), |
| | | }, |
| | |
| | | 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, |
| | | }, |
| | |
| | | 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"), |
| | | }, |
| | |
| | | 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' |
| | |
| | | }, |
| | | { |
| | | 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, |
| | | }, |
| | |
| | | path: "record", |
| | | meta: { |
| | | title: "取样操作记录列表", |
| | | keepAlive: true, |
| | | // keepAlive: true, |
| | | // privilege:'sampleManage' |
| | | privilege:'sampleManage_record' |
| | | }, |
| | |
| | | path: "deliveryRecord", |
| | | meta: { |
| | | title: "取样送样记录", |
| | | keepAlive: true, |
| | | // keepAlive: true, |
| | | privilege:'dataManagement_deliveryRecord' |
| | | }, |
| | | component: () => import("../views/dataManagement/SampleDeliveryRecord/list.vue"), |
| | |
| | | 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"), |
| | |
| | | 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"), |
| | |
| | | }, |
| | | { |
| | | path: "add", |
| | | name: "AddFeasibilityStudy", |
| | | meta: { |
| | | title: "新增可研报告", |
| | | hide: true, |
| | |
| | | }, |
| | | { |
| | | path: "edit", |
| | | name: "EditFeasibilityStudy", |
| | | meta: { |
| | | title: "编辑可研报告", |
| | | hide: true, |
| | |
| | | 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, |
| | |
| | | }, |
| | | { |
| | | path: "editFeasibility", |
| | | name: "EditFeasibilityReport", |
| | | meta: { |
| | | title: "编辑可行报告", |
| | | hide: true, |
| | |
| | | path: "processDevelopment", |
| | | meta: { |
| | | title: "工艺开发工具", |
| | | keepAlive: true, |
| | | // keepAlive: true, |
| | | privilege:'reportLibrary_processDevelopment' |
| | | }, |
| | | component: () => import("../views/reportLibrary/processDevelopment/index.vue"), |
| | |
| | | |
| | | { |
| | | path: "addProcessDevelopment", |
| | | name: "AddProcessDevelopment", |
| | | meta: { |
| | | title: "新增工艺开发工具", |
| | | hide: true, |
| | |
| | | }, |
| | | { |
| | | path: "editProcessDevelopment", |
| | | name: "EditProcessDevelopment", |
| | | meta: { |
| | | title: "编辑工艺开发工具", |
| | | hide: true, |
| | |
| | | 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, |
| | |
| | | }, |
| | | { |
| | | path: "editVerificationRelease", |
| | | name: "EditVerificationRelease", |
| | | meta: { |
| | | title: "编辑验证与发布", |
| | | hide: true, |
| | |
| | | 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, |
| | |
| | | }, |
| | | { |
| | | path: "editProjectProposalLibrary", |
| | | name: "EditProjectProposalLibrary", |
| | | meta: { |
| | | title: "编辑立项报告", |
| | | hide: true, |
| | |
| | | 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, |
| | | }, |
| | |
| | | }, |
| | | { |
| | | 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, |
| | | }, |
| | |
| | | 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, |
| | | }, |
| | |
| | | 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, |
| | | }, |
| | |
| | | }, |
| | | { |
| | | // 工艺工程师 |
| | | path: "editTesterWorkerEvaluate", |
| | | name: 'EditTesterWorkerEvaluate', |
| | | meta: { |
| | | title: "编辑实验员工作评定", |
| | | hide: true, |
| | | keepAlive: true, |
| | | }, |
| | | component: () => import("../views/deliveryAssessment/testerWorkerEvaluate/add"), |
| | | }, |
| | | { |
| | | // 工艺工程师 |
| | | path: "chemistEvaluate", |
| | | meta: { |
| | | title: "化验师工作评定", |
| | |
| | | import moment from "moment"; |
| | | |
| | | export default { |
| | | name: "AddPilotAndProduction", |
| | | components: { |
| | | AiEditor, |
| | | chooseProject, |
| | |
| | | ).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"]), |
| | | }, |
| | |
| | | }, |
| | | handleEdit(row) { |
| | | this.$router.push({ |
| | | path: '/chemistQa/addPilot', |
| | | path: '/chemistQa/editPilot', |
| | | query: { id: row.id, type: 'edit' } |
| | | }); |
| | | }, |
| | |
| | | import apiConfig from '@/utils/baseurl'; |
| | | |
| | | export default { |
| | | name: "AddProductApproval", |
| | | components: { |
| | | AiEditor, |
| | | chooseProject, |
| | |
| | | ).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"]), |
| | |
| | | } |
| | | }, |
| | | onError: (err) => { |
| | | // this.$message.error("文件上传失败"); |
| | | // onError(err); |
| | | this.$message.error("文件上传失败"); |
| | | onError(err); |
| | | }, |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | handleEdit(row) { |
| | | this.$router.push({ |
| | | path: '/chemistQa/addProductApproval', |
| | | path: '/chemistQa/editProductApproval', |
| | | query: { id: row.id } |
| | | }); |
| | | }, |
| | |
| | | import { addData, editData, getDetail,revokedReport,deleteDetail } from './service' |
| | | |
| | | export default { |
| | | components: { |
| | | AiEditor, |
| | | chooseProject, ShowDelConfirm |
| | | }, |
| | | name: "AddProjectTesting", |
| | | components: { |
| | | AiEditor, |
| | | chooseProject, ShowDelConfirm |
| | | }, |
| | | data() { |
| | | return { |
| | | isEdit: false, |
| | |
| | | } |
| | | }, |
| | | 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 => { |
| | |
| | | handleEdit(row) { |
| | | // 编辑操作 |
| | | this.$router.push({ |
| | | path: '/chemistQa/add', |
| | | path: '/chemistQa/edit', |
| | | query: { |
| | | id: row.id, |
| | | type: 'edit' |
| | |
| | | import { customUploadRequest, getFullUrl } from "@/utils/utils"; |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | name: "AddRawMaterials", |
| | | components: { |
| | | AiEditor, |
| | | chooseProject, |
| | |
| | | ).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"]), |
| | | }, |
| | |
| | | }, |
| | | handleEdit(row) { |
| | | this.$router.push({ |
| | | path: '/chemistQa/addRawMaterials', |
| | | path: '/chemistQa/editRawMaterials', |
| | | query: { id: row.id } |
| | | }); |
| | | }, |
| | |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddProject", |
| | | name: "addPlan", |
| | | components: { |
| | | AiEditor, |
| | | }, |
| | |
| | | }); |
| | | } |
| | | }, |
| | | 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 |
| | |
| | | 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> |
| | | |
| | |
| | | }, |
| | | handleEdit(row) { |
| | | this.$router.push({ |
| | | path: "/dataManagement/addPlan", |
| | | path: "/dataManagement/editPlan", |
| | | query: { id: row.id } |
| | | }); |
| | | }, |
| | |
| | | } from "./service"; |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | name: "AddProject", |
| | | name: "addDispatch", |
| | | components: { |
| | | SelectMember, |
| | | AddGroupDialog, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | dispatchId: "", |
| | | id: "", // 用于编辑时存储id |
| | | form: { |
| | | projectName: "", // 课题方案名称 |
| | |
| | | }, |
| | | |
| | | // 获取详情 |
| | | 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; |
| | |
| | | }, |
| | | }, |
| | | created() { |
| | | // 从路由参数中获取id |
| | | this.id = this.$route.query.id; |
| | | if (this.id) { |
| | | // TODO: 获取详情 |
| | | this.getDetail(); |
| | | } |
| | | this.loadDetail(); |
| | | // 创建防抖的搜索方法 |
| | | this.debouncedSearch = this.debounce(this.handleProjectSearch, 300); |
| | | // 初始化时自动添加当前用户为工艺工程师(如果是工艺工程师角色) |
| | |
| | | } |
| | | 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> |
| | | |
| | |
| | | }, |
| | | handleEdit(row) { |
| | | this.$router.push({ |
| | | path: "/dataManagement/addDispatch", |
| | | path: "/dataManagement/editDispatch", |
| | | query: { |
| | | id: row.id, |
| | | type: 'edit' |
| | |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddProject", |
| | | name: "inspectionReportDetail", |
| | | components: { |
| | | AddDialog, |
| | | experimentalScheduling, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | reportId: "", |
| | | dialogVisible: false, |
| | | isEdit: false, |
| | | currentEditIndex: -1, |
| | |
| | | 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"]), |
| | | }, |
| | |
| | | }, |
| | | handleAdd() { |
| | | this.$router.push({ |
| | | path: "/dataManagement/inspectionReport/detail", |
| | | path: "/dataManagement/inspectionReport/add", |
| | | query: { |
| | | type: 'add' |
| | | } |
| | |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddProject", |
| | | name: "OriginalRecordTestDetail", |
| | | components: { |
| | | AddDialog, |
| | | AiEditor |
| | | }, |
| | | data() { |
| | | return { |
| | | recordId: "", |
| | | dialogVisible: false, |
| | | isEdit: false, |
| | | currentEditIndex: -1, |
| | |
| | | } |
| | | }, |
| | | 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> |
| | |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddSample", |
| | | name: "addSample", |
| | | components: { |
| | | experimentalScheduling, |
| | | addTime, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | sampleId: "", |
| | | showScheduling: false, |
| | | showAddTime: false, |
| | | showAdditives: true, |
| | |
| | | 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() { |
| | |
| | | getFullUrl, |
| | | // 获取详情数据 |
| | | async getDetailData(id) { |
| | | this.sampleId = id; |
| | | try { |
| | | const res = await getDetail({ id }); |
| | | if (res) { |
| | |
| | | }, |
| | | handleEdit(row) { |
| | | this.$router.push({ |
| | | path: "/sampleManage/addSample", |
| | | path: "/sampleManage/editSample", |
| | | query: { |
| | | id: row.id, |
| | | type: 'edit' |
| | |
| | | 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, []); |
| | |
| | | <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> |
| | |
| | | </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", |
| | |
| | | approvalDialogType: 'view', |
| | | currentApprovalData: null, |
| | | userRole: '', |
| | | |
| | | changeStatus: false, |
| | | changeStatusTitle: "", |
| | | changeStatusTip: "", |
| | | currentOperationRow: null, // 当前操作的行数据 |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | 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 = { |
| | |
| | | }, |
| | | handleEdit(row) { |
| | | this.$router.push({ |
| | | path: "/dataManagement/scheme-management/add", |
| | | path: "/dataManagement/scheme-management/edit", |
| | | query: { |
| | | id: row.id, |
| | | type: 'edit' |
| | |
| | | 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(); |
| | |
| | | } from "./service"; |
| | | import { mapState } from "vuex"; |
| | | export default { |
| | | name: "AddProject", |
| | | name: "testResultReportDetail", |
| | | components: { |
| | | ExperimentalScheduling, |
| | | EvaluationDialog, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | reportId: "", |
| | | showNewDialog: true, |
| | | dialogVisible: false, |
| | | schedulingDialogVisible: false, |
| | |
| | | |
| | | // 如果是编辑模式,获取详情数据 |
| | | 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; |
| | |
| | | }, |
| | | handleAddResult() { |
| | | this.$router.push({ |
| | | path: "/dataManagement/testResultReport/detail", |
| | | path: "/dataManagement/testResultReport/add", |
| | | query: { |
| | | type: "add", |
| | | }, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | evaluateId: "", |
| | | showScheduling: false, |
| | | participantsData: [], |
| | | selectedParticipants: [], |
| | |
| | | }; |
| | | }, |
| | | 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(); |
| | | } |
| | | }, |
| | |
| | | handleEdit(row) { |
| | | // 编辑逻辑后续补充 |
| | | this.$router.push({ |
| | | path: "/deliveryAssessment/addTesterWorkerEvaluate", |
| | | path: "/deliveryAssessment/editTesterWorkerEvaluate", |
| | | query: { id: row.id, type: 'edit' }, |
| | | }); |
| | | }, |
| | |
| | | roleType: member.roleType |
| | | })) |
| | | } |
| | | console.log('this.selectMemberData',this.selectMemberData) |
| | | return |
| | | |
| | | addProject(data).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('添加成功') |
| | |
| | | name: 'EddProject', |
| | | data() { |
| | | return { |
| | | projectId: '', |
| | | form: { |
| | | teamName: '', |
| | | personCharge: '' |
| | |
| | | } |
| | | }, |
| | | 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) { |
| | |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddFeasibilityReport", |
| | | components: { |
| | | AiEditor, |
| | | chooseProject, |
| | | }, |
| | | data() { |
| | | return { |
| | | reportId: "", |
| | | loading: false, |
| | | form: { |
| | | reportCode: "", |
| | |
| | | }, |
| | | |
| | | 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]; |
| | |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | name: "AddFeasibilityStudy", |
| | | components: { |
| | | AiEditor, |
| | | chooseProject |
| | | }, |
| | | data() { |
| | | return { |
| | | reportId: "", |
| | | loading: false, |
| | | form: { |
| | | reportCode: "", |
| | |
| | | }, |
| | | |
| | | 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) { |
| | |
| | | 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: "", |
| | |
| | | }, |
| | | |
| | | 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) { |
| | |
| | | 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: "", |
| | |
| | | }, |
| | | |
| | | 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) { |
| | |
| | | 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: "", |
| | |
| | | }, |
| | | |
| | | 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) { |
| | |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | roleId: "", |
| | | form: { |
| | | roleName: "", |
| | | remark: "", |
| | |
| | | }, |
| | | 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); |