From ee5553f438eadb34a3261b718145e9e7f8a27580 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期五, 29 十一月 2024 14:43:44 +0800
Subject: [PATCH] 项目库导出之导出目标列表内容

---
 src/views/projectEngineering/projectLibrary/projectDetails.vue |  159 ++++++++++------------------------------------------
 1 files changed, 31 insertions(+), 128 deletions(-)

diff --git a/src/views/projectEngineering/projectLibrary/projectDetails.vue b/src/views/projectEngineering/projectLibrary/projectDetails.vue
index b688ebd..6494775 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">
+  <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,6 +18,9 @@
       :is="componentName"
       ref="childRef"
       :disabled="disabled"
+      @toNext="changeTable"
+      @updateIsShow="updateIsShow"
+      :isShow="isShow"
       class="full-width custom-height"
     />
     <div v-if="!disabled" class="button-container">
@@ -31,18 +34,19 @@
 <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.vue';
-// import LegalPerson from '@/components/legalPerson.vue';
-// import PolicyInfo from '@/components/PolicyInfo.vue';
-// import DocumentsInfo from '@/components/DocumentsInfo.vue';
-import { addProject, getProject, updateProject, getProjectCode } from '@/api/projectInfo';
+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';
 
 export default {
+  name: 'ProjectDetails',
   data() {
     return {
+      isShow: false,
       currentTab: '椤圭洰绠$悊鍩虹淇℃伅',
-      id: this.$route.query.id || '',
       disabled: false,
+      projectForm:{},
       componentName: BasicInfo,
       TABS_DATA: [
         {
@@ -52,157 +56,56 @@
         },
         {
           label: '鎶曡祫绠$悊鍩虹淇℃伅',
-          value: '浠诲姟涓嬪彂',
+          value: '鎶曡祫绠$悊鍩虹淇℃伅',
           componentName: InvestInfo
         },
         {
-          label: ' 椤圭洰鎶曡祫鍙婅祫閲戞潵婧�',
+          label: '椤圭洰鎶曡祫鍙婅祫閲戞潵婧�',
           value: '椤圭洰鎶曡祫鍙婅祫閲戞潵婧�',
           componentName: InvestmentFunds
         },
         {
           label: '椤圭洰(娉曚汉)鍗曚綅鐧昏淇℃伅',
           value: '椤圭洰(娉曚汉)鍗曚綅鐧昏淇℃伅',
-          componentName: 'LegalPerson'
+          componentName: LegalPerson
         },
         {
           label: '鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌',
           value: '鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌',
-          componentName: 'PolicyInfo'
+          componentName: PolicyInfo
         },
         {
           label: '鐩稿叧鏂囦功',
           value: '鐩稿叧鏂囦功',
-          componentName: 'DocumentsInfo'
+          componentName: DocumentsInfo
         }
       ],
       childRef: null,
-      // 鍋囪杩欎簺鐘舵�佹槸浠� Vuex 涓幏鍙栫殑锛屾垨鑰呬綘鍙互鐩存帴鍦� data 涓畾涔夊畠浠�
-      // projectForm, investment, investmentFunds, legalPerson, resetPlanLibrary, investmentProjectPolicyComplianceDTO, fileIdList, documentsInfoList, projectList, fileList
     };
   },
   methods: {
+    updateIsShow(newValue) {
+      this.isShow = newValue;
+    },
     handleClick(tabTarget) {
-      this.componentName = this.TABS_DATA[tabTarget.index].componentName;
+        this.componentName = this.TABS_DATA[tabTarget.index].componentName;
+    },
+    changeTable(index) {
+      this.componentName = this.TABS_DATA[index].componentName;
+      this.currentTab = this.TABS_DATA[index].value;
     },
     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 = [];
-          }
-
-          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
-          }));
-        }
-      });
+      this.$refs.childRef.submit();
     },
     reset() {
-      if (this.id) {
-        this.getProjectInfo(this.id);
-      } else {
-        this.getProjectCodeApi();
-        // 鍋囪 resetPlanLibrary 鏄竴涓柟娉曪紝鐢ㄤ簬閲嶇疆鐘舵��
-        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();
+  mounted() {
+    if(this.$route.query.disabled){
+      this.disabled = true
     }
-  },
-
+  }
 };
 </script>
 

--
Gitblit v1.8.0