From d328bd467ffcb660e81d546a0b242e39320acb6d Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 05 六月 2025 09:53:30 +0800
Subject: [PATCH] 系统名称调整、登录页调整、项目新增发起依据

---
 src/views/projectEngineering/projectLibrary/projectDetails.vue |  243 ++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 204 insertions(+), 39 deletions(-)

diff --git a/src/views/projectEngineering/projectLibrary/projectDetails.vue b/src/views/projectEngineering/projectLibrary/projectDetails.vue
index 593af4b..31e3678 100644
--- a/src/views/projectEngineering/projectLibrary/projectDetails.vue
+++ b/src/views/projectEngineering/projectLibrary/projectDetails.vue
@@ -1,5 +1,6 @@
 <template>
-  <el-card class="card-container" >
+  <div>
+  <el-card class="card-container">
     <div class="flex-container mb-4">
       <el-tabs v-model="currentTab" @tab-click="handleClick" v-show="isShow">
         <el-tab-pane
@@ -20,92 +21,256 @@
       :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="audit" class="button-container">
+      <el-button
+        class="save-button"
+        type="primary"
+        @click="saveProject(2)"
+      >閫氳繃</el-button>
+      <el-button
+        class="save-button"
+        type="danger"
+        @click="showDialog"
+      >椹冲洖</el-button>
+    </div>
+
     <div v-if="!disabled" class="button-container">
-      <el-button class="save-button" type="primary" @click="submit">淇濆瓨</el-button>
+      <el-button
+        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>
   </el-card>
+    <el-dialog :visible.sync="remarkShow" width="1000px" title="椹冲洖淇℃伅" append-to-body>
+      <el-form ref="form" label-width="80px">
+        <el-form-item label="椹冲洖鍘熷洜">
+          <el-input type="textarea" v-model="remark"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelAuditing">鍙� 娑�</el-button>
+        <el-button type="primary" @click="submitAuditing">纭� 瀹�</el-button>
+      </div>
+    </el-dialog>
+</div>
 </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 '@/views/projectEngineering/projectLibrary/component/DocumentsInfo';
+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 ProjectFrom from "@/views/projectEngineering/projectLibrary/component/ProjectFrom";
+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',
+  name: "ProjectDetails",
   data() {
     return {
       isShow: false,
-      currentTab: '椤圭洰绠$悊鍩虹淇℃伅',
+      currentTab: "椤圭洰绠$悊鍩虹淇℃伅",
       disabled: false,
-      projectForm:{},
+      remarkShow: false,
+      audit: false,
+      remark: '',
+      projectForm: {},
       componentName: BasicInfo,
+      projectId: null,
       TABS_DATA: [
         {
-          label: '椤圭洰绠$悊鍩虹淇℃伅',
-          value: '椤圭洰绠$悊鍩虹淇℃伅',
-          componentName: BasicInfo
+          label: "椤圭洰绠$悊鍩虹淇℃伅",
+          value: "椤圭洰绠$悊鍩虹淇℃伅",
+          componentName: BasicInfo,
+        },
+        // {
+        //   label: "鎶曡祫绠$悊鍩虹淇℃伅",
+        //   value: "鎶曡祫绠$悊鍩虹淇℃伅",
+        //   componentName: InvestInfo,
+        // },
+        {
+          label: "椤圭洰鎶曡祫鍙婅祫閲戞潵婧�",
+          value: "椤圭洰鎶曡祫鍙婅祫閲戞潵婧�",
+          componentName: InvestmentFunds,
         },
         {
-          label: '鎶曡祫绠$悊鍩虹淇℃伅',
-          value: '鎶曡祫绠$悊鍩虹淇℃伅',
-          componentName: InvestInfo
+          label: "椤圭洰(娉曚汉)鍗曚綅鐧昏淇℃伅",
+          value: "椤圭洰(娉曚汉)鍗曚綅鐧昏淇℃伅",
+          componentName: LegalPerson,
         },
         {
-          label: '椤圭洰鎶曡祫鍙婅祫閲戞潵婧�',
-          value: '椤圭洰鎶曡祫鍙婅祫閲戞潵婧�',
-          componentName: InvestmentFunds
+          label: "椤圭洰鍙戣捣渚濇嵁",
+          value: "椤圭洰鍙戣捣渚濇嵁",
+          componentName: ProjectFrom,
         },
-        {
-          label: '椤圭洰(娉曚汉)鍗曚綅鐧昏淇℃伅',
-          value: '椤圭洰(娉曚汉)鍗曚綅鐧昏淇℃伅',
-          componentName: LegalPerson
-        },
-        {
-          label: '鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌',
-          value: '鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌',
-          componentName: PolicyInfo
-        },
-        {
-          label: '鐩稿叧鏂囦功',
-          value: '鐩稿叧鏂囦功',
-          componentName: DocumentsInfo
-        }
+        // {
+        //   label: "鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌",
+        //   value: "鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌",
+        //   componentName: PolicyInfo,
+        // },
+        // {
+        //   label: "鐩稿叧鏂囦功",
+        //   value: "鐩稿叧鏂囦功",
+        //   componentName: DocumentsInfo,
+        // },
       ],
       childRef: null,
+      baseInfoRules: [
+        {name: 'projectName', message: '璇疯緭鍏ラ」鐩悕绉�'},
+        {name: 'content', message: '璇疯緭鍏ュ缓璁惧唴瀹�'},
+        {name: 'fundTypeList', message: '璇烽�夋嫨璧勯噾绫诲瀷'},
+        {name: 'investType', message: '璇烽�夋嫨椤圭洰鎶曡祫绫诲埆'},
+        {name: 'constructionNature', message: '璇烽�夋嫨寤鸿鎬ц川'},
+        {name: 'attractInvestment', message: '璇烽�夋嫨鏄惁鎷涘晢寮曡祫椤圭洰'},
+        {name: 'projectType', message: '璇烽�夋嫨椤圭洰鎺ㄨ繘绫诲瀷'},
+        {name: 'projectStatus', message: '璇烽�夋嫨椤圭洰鐘舵��'},
+        {name: 'projectPhase', message: '璇烽�夋嫨椤圭洰闃舵'},
+        {name: 'projectContactPerson', message: '璇疯緭鍏ラ」鐩仈绯讳汉'},
+        {name: 'contact', message: '璇疯緭鍏ラ」鐩仈绯绘柟寮�'},
+        {name: 'projectOwnerUnit', message: '璇烽�夋嫨椤圭洰涓氫富鍗曚綅'},
+        {name: 'competentDepartment', message: '璇烽�夋嫨涓荤閮ㄩ棬'},
+        {name: 'competentDepartmentPerson', message: '璇烽�夋嫨涓荤閮ㄩ棬鑱旂郴浜�'},
+        {name: 'competentDepartmentPhone', message: '璇疯緭鍏ヤ富绠¢儴闂ㄨ仈绯绘柟寮�'},
+        {name: 'area', message: '璇烽�夋嫨琛屾斂鍖哄垝'},
+        {name: 'managementCentralizationList', message: '璇烽�夋嫨绠$悊褰掑彛'},
+        {name: 'projectApprovalType', message: '璇烽�夋嫨椤圭洰瀹℃壒绫诲瀷'},
+        {name: 'importanceTypeList', message: '璇烽�夋嫨閲嶇偣鍒嗙被'},
+        {name: 'planStartTime', message: '璇烽�夋嫨璁″垝寮�宸ユ椂闂�'},
+        {name: 'planCompleteTime', message: '璇烽�夋嫨璁″垝绔e伐鏃堕棿'},
+        {name: 'industryCompetentDepartment', message: '璇烽�夋嫨琛屼笟涓荤閮ㄩ棬'},
+        {name: 'industryCompetentDepartmentPerson', message: '璇疯緭鍏ヨ涓氫富绠¢儴闂ㄨ仈绯讳汉'},
+        {name: 'departmentPersonPhone', message: '璇疯緭鍏ヨ涓氫富绠¢儴闂ㄨ仈绯绘柟寮�'},
+      ],
+      investmentFundsFormRules: [
+        {name: 'totalInvestment', message: '椤圭洰鎬绘姇璧勯涓嶈兘涓虹┖(涓斿ぇ浜�0)'},
+      ]
     };
   },
   methods: {
+    showDialog(){
+      this.remark = null;
+      this.remarkShow = true;
+    },
+    cancelAuditing(){
+      this.remark = null;
+      this.remarkShow = false;
+    },
+    submitAuditing(){
+      this.projectForm.projectInfoForm.remark = this.remark
+      this.saveProject(3)
+      this.remark = null
+      this.remarkShow = false;
+    },
     updateIsShow(newValue) {
       this.isShow = newValue;
     },
+    basicInfoForm(data) {
+      this.projectForm.projectInfoForm = data;
+      this.projectId = data.id;
+      this.audit = this.$route.query.audit == 1 && this.projectForm.projectInfoForm.auditRole;
+    },
+    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;
+      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() {
-      this.$refs.childRef.submit();
+    submit(usedStatus) {
+      this.$refs.childRef.submit(usedStatus);
     },
     reset() {
       this.$refs.childRef.reset();
     },
+    saveProject(num) {
+      this.projectForm.projectInfoForm.usedStatus = num;
+
+      const msg = this.formValidate()
+      if (msg && num != 0) {  // 鑽夌涓嶆牎楠�
+        this.$message.error(msg)
+      } else {
+        editProject(this.projectForm).then((res) => {
+          this.$message.success("淇濆瓨鎴愬姛");
+          this.$store.dispatch("tagsView/delView", this.$route);
+          this.$router.push('/projectEngineering/project/projectLibrary')
+        })
+      }
+    },
+    /**
+     * 涓存椂浣跨敤杩欑鏂瑰紡鏍¢獙
+     */
+    formValidate() {
+      let msg = "";
+      for (let i = 0; i < this.baseInfoRules.length; i++) {
+        if (! this.projectForm.projectInfoForm[this.baseInfoRules[i].name]) {
+          msg = this.baseInfoRules[i].message
+          return msg
+        }
+      }
+      console.log(this.projectForm, "椤圭洰淇℃伅")
+      if (this.projectForm.projectInvestmentFundingForm) {
+        for (let i = 0; i < this.investmentFundsFormRules.length; i++) {
+          const name = this.investmentFundsFormRules[i].name
+          if (! this.projectForm.projectInvestmentFundingForm[name]) {
+            msg = this.investmentFundsFormRules[i].message
+            return msg
+          } else if (name == 'totalInvestment' && parseFloat(this.projectForm.projectInvestmentFundingForm[name]) <= 0) {
+            // 濡傛灉鏄�绘姇璧勯锛屼笉浠呬笉鑳戒负绌鸿繕蹇呴』澶т簬0
+            msg = this.investmentFundsFormRules[i].message
+            return msg
+          }
+        }
+      }
+      return msg;
+    },
+  },
+  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