From cf2faab021222e1e345e8098da38f2c24ea8b504 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期四, 28 十一月 2024 06:07:40 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/projectEngineering/projectLibrary/projectDetails.vue | 121 ++++------------------------------------ 1 files changed, 12 insertions(+), 109 deletions(-) diff --git a/src/views/projectEngineering/projectLibrary/projectDetails.vue b/src/views/projectEngineering/projectLibrary/projectDetails.vue index 39a6a44..b486d1c 100644 --- a/src/views/projectEngineering/projectLibrary/projectDetails.vue +++ b/src/views/projectEngineering/projectLibrary/projectDetails.vue @@ -18,6 +18,7 @@ :is="componentName" ref="childRef" :disabled="disabled" + @toNext="changeTable" class="full-width custom-height" /> <div v-if="!disabled" class="button-container"> @@ -35,14 +36,14 @@ import LegalPerson from '@/views/projectEngineering/projectLibrary/component/legalPerson'; import PolicyInfo from '@/views/projectEngineering/projectLibrary/component/PolicyInfo'; import DocumentsInfo from '@/views/projectEngineering/projectLibrary/component/DocumentsInfo'; -import { addProject, getProject, updateProject, getProjectCode } from '@/api/projectInfo'; export default { + name: 'ProjectDetails', data() { return { currentTab: '椤圭洰绠$悊鍩虹淇℃伅', - id: this.$route.query.id || '', disabled: false, + projectForm:{}, componentName: BasicInfo, TABS_DATA: [ { @@ -52,11 +53,11 @@ }, { label: '鎶曡祫绠$悊鍩虹淇℃伅', - value: '浠诲姟涓嬪彂', + value: '鎶曡祫绠$悊鍩虹淇℃伅', componentName: InvestInfo }, { - label: ' 椤圭洰鎶曡祫鍙婅祫閲戞潵婧�', + label: '椤圭洰鎶曡祫鍙婅祫閲戞潵婧�', value: '椤圭洰鎶曡祫鍙婅祫閲戞潵婧�', componentName: InvestmentFunds }, @@ -83,117 +84,19 @@ handleClick(tabTarget) { this.componentName = this.TABS_DATA[tabTarget.index].componentName; }, - submit() { - if (!this.projectForm.projectName) { - this.$message.error('璇疯緭鍏ラ」鐩悕绉�'); - return; - } - if (this.projectForm.contact) { - const phoneRegex = /^1[3-9]\d{9}$/; - if (!phoneRegex.test(this.projectForm.contact)) { - this.$message.error('璇疯緭鍏ユ纭殑鎵嬫満鍙风爜'); - return; - } - } - if (this.$refs.childRef) { - this.$refs.childRef.$refs.demoFormRef.validate((valid) => { - if (valid) { - const payload = { - projectInfoInsertDTO: this.projectForm, - projectInvestmentInfo: this.investment, - projectInvestmentFunding: this.investmentFunds, - projectUnitRegistrationInfo: this.legalPerson, - investmentProjectPolicyComplianceDTO: this.investmentProjectPolicyComplianceDTO, - fileIdList: this.fileIdList - }; - if (this.id) { - updateProject(payload).then(res => { - if (res.code === 200) { - this.$message.success(res.msg); - this.$router.push({ path: '/projectEngineering/project/projectLibrary' }); - } else { - this.$message.error(res.msg); - } - }); - } else { - addProject(payload).then(res => { - if (res.code === 200) { - this.$message.success(res.msg); - this.$router.push({ path: '/projectEngineering/project/projectLibrary' }); - } else { - this.$message.error(res.msg); - } - }); - } - } - }); - } + changeTable(index) { + this.componentName = this.TABS_DATA[index].componentName; + this.currentTab = this.TABS_DATA[index].value; }, - getProjectInfo(id) { - getProject(id, 0).then(res => { - if (res.data) { - this.investment = res.data.projectInvestmentInfo || {}; - this.investmentFunds = res.data.projectInvestmentFunding || {}; - this.legalPerson = res.data.projectUnitRegistrationInfo || {}; - this.investmentProjectPolicyComplianceDTO = res.data.investmentProjectPolicyComplianceDTO || {}; - if (res.data.investmentProjectPolicyComplianceDTO && res.data.investmentProjectPolicyComplianceDTO.sysOssVos.length > 0) { - this.fileList = res.data.investmentProjectPolicyComplianceDTO.sysOssVos.map(item => ({ - fileId: item.ossId, - name: item.originalName, - url: item.url - })); - } else { - this.fileList = []; - } - - if (res.data.fileIdList) { - this.fileIdList = res.data.fileIdList; - this.documentsInfoList = res.data.sysOssVos.map(item => ({ - fileId: item.ossId, - name: item.originalName, - url: item.url - })); - } - this.projectForm = res.data.projectInfoInsertDTO || {}; - this.projectList = res.data.projectInfoInsertDTO.sysOssVos.map(item => ({ - fileId: item.ossId, - name: item.originalName, - url: item.url - })); - } - }); + submit() { + this.$refs.childRef.submit(); }, reset() { - if (this.id) { - this.getProjectInfo(this.id); - } else { - this.getProjectCodeApi(); - this.resetPlanLibrary(); - this.fileList = []; - this.fileIdList = []; - this.projectList = []; - this.documentsInfoList = []; - } - }, - cancel() { - this.$router.push({ path: '/projectEngineering/project/reserveProjects', query: { projectCategory: '1' } }); - localStorage.removeItem('fileIdList'); - }, - getProjectCodeApi() { - getProjectCode().then(res => { - if (res.code === 200) { - this.projectForm.projectCode = res.msg; - } - }); + this.$refs.childRef.reset(); }, }, created() { - // 鍦ㄧ粍浠跺垱寤烘椂鑾峰彇椤圭洰淇℃伅锛屽鏋� id 瀛樺湪 - if (this.id) { - this.getProjectInfo(this.id); - } else { - this.getProjectCodeApi(); - } + console.log("sss") }, }; -- Gitblit v1.8.0