From 47819106bfd6c0be7cae581e5dec7f1926293d8c Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 03 一月 2025 17:12:44 +0800
Subject: [PATCH] 首页样式优化、流程待办表格数据完善
---
src/views/projectEngineering/projectLibrary/projectDetails.vue | 242 +++++++++++++++++++----------------------------
1 files changed, 98 insertions(+), 144 deletions(-)
diff --git a/src/views/projectEngineering/projectLibrary/projectDetails.vue b/src/views/projectEngineering/projectLibrary/projectDetails.vue
index c319965..6204cbf 100644
--- a/src/views/projectEngineering/projectLibrary/projectDetails.vue
+++ b/src/views/projectEngineering/projectLibrary/projectDetails.vue
@@ -1,7 +1,7 @@
<template>
<el-card class="card-container">
<div class="flex-container mb-4">
- <el-tabs v-model="currentTab" @tab-click="handleClick">
+ <el-tabs v-model="currentTab" @tab-click="handleClick" v-show="isShow">
<el-tab-pane
v-for="item in TABS_DATA"
:key="item.value"
@@ -18,10 +18,29 @@
:is="componentName"
ref="childRef"
:disabled="disabled"
+ @toNext="changeTable"
+ @updateIsShow="updateIsShow"
+ @basicInfoForm="basicInfoForm"
+ @investInfoForm="investInfoForm"
+ @investmentFundsForm="investmentFundsForm"
+ @legalPersonForm="legalPersonForm"
+ @policyInfoForm="policyInfoForm"
+ @documentsInfoForm="documentsInfoForm"
+ :isShow="isShow"
class="full-width custom-height"
/>
<div v-if="!disabled" class="button-container">
- <el-button class="save-button" type="primary" @click="submit">淇濆瓨</el-button>
+ <el-button
+ v-if="componentName.name == 'BasicInfo'"
+ class="save-button"
+ type="primary"
+ @click="saveProject(0)"
+ >鑽夌</el-button
+ >
+<!-- <el-button class="save-button" type="primary" @click="submit(1)"-->
+<!-- >淇濆瓨</el-button>-->
+ <el-button class="save-button" type="primary" @click="saveProject(1)"
+ >淇濆瓨</el-button>
<el-button class="reset-button" @click="reset">閲嶇疆</el-button>
<!-- <el-button v-else class="cancel-button" @click="cancel">鍙栨秷</el-button> -->
</div>
@@ -29,184 +48,119 @@
</template>
<script>
-import BasicInfo from '@/views/projectEngineering/projectLibrary/component/BasicInfo';
-import InvestInfo from '@/views/projectEngineering/projectLibrary/component/InvestInfo';
-import InvestmentFunds from '@/views/projectEngineering/projectLibrary/component/investmentFunds';
-import LegalPerson from '@/views/projectEngineering/projectLibrary/component/legalPerson';
-import PolicyInfo from '@/views/projectEngineering/projectLibrary/component/PolicyInfo';
-// import DocumentsInfo from '@/components/DocumentsInfo.vue';
-import { addProject, getProject, updateProject, getProjectCode } from '@/api/projectInfo';
+import BasicInfo from "@/views/projectEngineering/projectLibrary/component/BasicInfo";
+import InvestInfo from "@/views/projectEngineering/projectLibrary/component/InvestInfo";
+import InvestmentFunds from "@/views/projectEngineering/projectLibrary/component/investmentFunds";
+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 { editProject } from "@/api/projectEngineering/projectInfo";
export default {
+ name: "ProjectDetails",
data() {
return {
- currentTab: '椤圭洰绠$悊鍩虹淇℃伅',
- id: this.$route.query.id || '',
+ isShow: false,
+ currentTab: "椤圭洰绠$悊鍩虹淇℃伅",
disabled: false,
+ projectForm: {},
componentName: BasicInfo,
+ projectId: null,
TABS_DATA: [
{
- label: '椤圭洰绠$悊鍩虹淇℃伅',
- value: '椤圭洰绠$悊鍩虹淇℃伅',
- componentName: BasicInfo
+ label: "椤圭洰绠$悊鍩虹淇℃伅",
+ value: "椤圭洰绠$悊鍩虹淇℃伅",
+ componentName: BasicInfo,
},
{
- label: '鎶曡祫绠$悊鍩虹淇℃伅',
- value: '浠诲姟涓嬪彂',
- componentName: InvestInfo
+ label: "鎶曡祫绠$悊鍩虹淇℃伅",
+ value: "鎶曡祫绠$悊鍩虹淇℃伅",
+ componentName: InvestInfo,
},
{
- label: ' 椤圭洰鎶曡祫鍙婅祫閲戞潵婧�',
- value: '椤圭洰鎶曡祫鍙婅祫閲戞潵婧�',
- componentName: InvestmentFunds
+ label: "椤圭洰鎶曡祫鍙婅祫閲戞潵婧�",
+ value: "椤圭洰鎶曡祫鍙婅祫閲戞潵婧�",
+ componentName: InvestmentFunds,
},
{
- label: '椤圭洰(娉曚汉)鍗曚綅鐧昏淇℃伅',
- value: '椤圭洰(娉曚汉)鍗曚綅鐧昏淇℃伅',
- componentName: LegalPerson
+ label: "椤圭洰(娉曚汉)鍗曚綅鐧昏淇℃伅",
+ value: "椤圭洰(娉曚汉)鍗曚綅鐧昏淇℃伅",
+ componentName: LegalPerson,
},
{
- label: '鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌',
- value: '鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌',
- componentName: PolicyInfo
+ label: "鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌",
+ value: "鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌",
+ componentName: PolicyInfo,
},
{
- label: '鐩稿叧鏂囦功',
- value: '鐩稿叧鏂囦功',
- componentName: 'DocumentsInfo'
- }
+ label: "鐩稿叧鏂囦功",
+ value: "鐩稿叧鏂囦功",
+ componentName: DocumentsInfo,
+ },
],
childRef: null,
- // 鍋囪杩欎簺鐘舵�佹槸浠� Vuex 涓幏鍙栫殑锛屾垨鑰呬綘鍙互鐩存帴鍦� data 涓畾涔夊畠浠�
- // projectForm, investment, investmentFunds, legalPerson, resetPlanLibrary, investmentProjectPolicyComplianceDTO, fileIdList, documentsInfoList, projectList, fileList
};
},
methods: {
+ updateIsShow(newValue) {
+ this.isShow = newValue;
+ },
+ basicInfoForm(data) {
+ this.projectForm.projectInfoForm = data;
+ this.projectId = data.id;
+ },
+ investInfoForm(data) {
+ this.projectForm.projectInvestmentInfoForm = data;
+ this.projectForm.projectInvestmentInfoForm.projectId = this.projectId;
+ },
+ investmentFundsForm(data) {
+ this.projectForm.projectInvestmentFundingForm = data;
+ this.projectForm.projectInvestmentFundingForm.projectId = this.projectId;
+ },
+ documentsInfoForm(data){
+ this.projectForm.documentInfoForm = data;
+ this.projectForm.documentInfoForm.projectId = this.projectId;
+ },
+ legalPersonForm(data) {
+ this.projectForm.projectUnitRegistrationInfoForm = data;
+ this.projectForm.projectUnitRegistrationInfoForm.projectId = this.projectId;
+ },
+ policyInfoForm(data) {
+ this.projectForm.projectInvestmentPolicyComplianceForm = data;
+ this.projectForm.projectInvestmentPolicyComplianceForm.projectId = this.projectId;
+ },
handleClick(tabTarget) {
this.componentName = this.TABS_DATA[tabTarget.index].componentName;
+ console.log(this.projectForm);
},
- 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);
- }
- });
- }
- }
- });
- }
- },
- 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 = [];
- }
+ changeTable(index) {
+ this.componentName = this.TABS_DATA[index].componentName;
+ this.currentTab = this.TABS_DATA[index].value;
- 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(usedStatus) {
+ this.$refs.childRef.submit(usedStatus);
},
reset() {
- if (this.id) {
- this.getProjectInfo(this.id);
- } else {
- this.getProjectCodeApi();
- this.resetPlanLibrary();
- this.fileList = [];
- this.fileIdList = [];
- this.projectList = [];
- this.documentsInfoList = [];
- }
+ this.$refs.childRef.reset();
},
- 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;
- }
- });
- },
- // 鍋囪 resetPlanLibrary 鏄粠鏌愪釜鍦版柟寮曞叆鎴栧畾涔夌殑锛屼綘闇�瑕佺‘淇濆畠鍦ㄤ綘鐨勭粍浠朵腑鍙敤
- // resetPlanLibrary() { ... }
- },
- created() {
- // 鍦ㄧ粍浠跺垱寤烘椂鑾峰彇椤圭洰淇℃伅锛屽鏋� id 瀛樺湪
- if (this.id) {
- this.getProjectInfo(this.id);
- } else {
- this.getProjectCodeApi();
- // 鍒濆鍖栨垨閲嶇疆鐘舵��
- // this.resetPlanLibrary();
+ saveProject(num) {
+ this.projectForm.projectInfoForm.usedStatus = num;
+ editProject(this.projectForm).then((res) => {
+ this.$message.success("淇濆瓨鎴愬姛");
+ })
+ this.$router.push('/projectEngineering/project/projectLibrary')
}
},
-
+ mounted() {
+ if (this.$route.query.disabled) {
+ this.disabled = true;
+ }
+ },
};
</script>
<style scoped>
-
::v-deep .el-tabs__nav-wrap::after {
background-color: rgba(0, 0, 0, 0) !important;
}
--
Gitblit v1.8.0