From acf78f6ef785df7f5fa15d1ee0fc62c0bbbe74f6 Mon Sep 17 00:00:00 2001
From: luohairen <3399054449@qq.com>
Date: 星期五, 29 十一月 2024 02:37:42 +0800
Subject: [PATCH] 项目计划审批

---
 src/views/projectManage/plan/planInfo.vue |   37 ++++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/src/views/projectManage/plan/planInfo.vue b/src/views/projectManage/plan/planInfo.vue
index 3fd438b..bf620a5 100644
--- a/src/views/projectManage/plan/planInfo.vue
+++ b/src/views/projectManage/plan/planInfo.vue
@@ -1,12 +1,13 @@
 <template>
   <div class="app-container">
     <el-container>
-      <el-header v-show="planRecordData && planRecordData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ planRecordData.projectName }} {{ planRecordData.planTimeFlag === 0 ? '(鏈堝害璁″垝)' : planRecordData.planTimeFlag === 1 ? '(瀛e害璁″垝)' : '(骞村害璁″垝)' }}</el-header>
-      <h4 v-show="planRecordData && planRecordData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ planRecordData.projectCode }}</h4>
+      <el-header class="header-title">椤圭洰鍚嶇О锛歿{ planInfoData.projectName }} ({{planInfoData.planTime}} {{ planInfoData.planTimeFlag === 0 ? '鏈堝害璁″垝' : planInfoData.planTimeFlag === 1 ? '瀛e害璁″垝' : '骞村害璁″垝' }})</el-header>
+      <h4 style="text-align: center">椤圭洰浠g爜锛歿{ planInfoData.projectCode }}</h4>
       <el-main>
         <el-card shadow="hover">
           <el-row :gutter="20">
             <el-col :span="24" class="mb-4">
+              <el-button type="primary" size="small" @click="handlePlanRecord" style="float: right; margin-bottom: 10px; margin-left: 10px">杩斿洖</el-button>
               <el-button type="primary" size="small" @click="handleAdd" style="float: right; margin-bottom: 10px">鏂板</el-button>
               <el-table :data="tableData" border stripe style="width: 100%; margin-bottom: 20px">
                 <el-table-column prop="index" label="搴忓彿" width="50" align="center">
@@ -29,9 +30,9 @@
                     <el-date-picker v-model="scope.row.endTime" type="date" placeholder="閫夋嫨鏃ユ湡" size="small" style="width: 130px" />
                   </template>
                 </el-table-column>
-                <el-table-column :label="planRecordData.planTimeFlag === 0 ? '鏈堝害' : planRecordData.planTimeFlag === 1 ? '瀛e害' : '骞村害' " width="100" align="center">
+                <el-table-column :label="planInfoData.planTimeFlag === 0 ? '鏈堝害' : planInfoData.planTimeFlag === 1 ? '瀛e害' : '骞村害' " width="100" align="center">
                   <template #default="scope">
-                    <span>{{ planRecordData.planTime }}{{ planRecordData.planTimeFlag === 0 ? '鏈堝害' : planRecordData.planTimeFlag === 1 ? '瀛e害' : '骞村害' }}</span>
+                    <span>{{ planInfoData.planTime }}{{ planInfoData.planTimeFlag === 0 ? '鏈堝害' : planInfoData.planTimeFlag === 1 ? '瀛e害' : '骞村害' }}</span>
                   </template>
                 </el-table-column>
                 <el-table-column fixed="right" label="鎿嶄綔" align="center">
@@ -71,12 +72,12 @@
 import { getPlanInfoData, addPlanInfo, savePlanInfo } from "@/api/projectPlan/index";
 
 export default {
-  name: "planInfo",
+  name: "PlanInfo",
   data() {
     return {
       loading: true,
       // 鎺ユ敹浼犻�掕繃鏉ョ殑椤圭洰璁″垝鏁版嵁
-      planRecordData: {},
+      projectInfoData: {},
       planInfoData: {},
       tableData: [
         {
@@ -99,15 +100,13 @@
   methods: {
     // 椤甸潰鍔犺浇
     search() {
-      this.getPlanInfoData(this.planRecordData.id);
+      this.getPlanInfoData(this.planInfoData.id);
     },
     // 鑾峰彇浼犻�掕繃鏉ョ殑椤圭洰璁″垝璇︽儏
-    getPlanRecordData() {
+    getProjectInfoData() {
       // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁
-      if (this.$route.query.data) {
-        this.planRecordData = JSON.parse(this.$route.query.data)
-      }
-      this.planInfoData = this.$route.query.planInfoData
+      this.projectInfoData = this.$route.query.projectInfoData
+      this.planInfoData = this.$route.query.data
       this.search();
     },
     // 鑾峰彇椤圭洰璁″垝椤�
@@ -134,12 +133,12 @@
       // 閬嶅巻tableData锛岃幏寰楀�间笉涓虹┖瀛楃涓茬殑琛�
       const validList = this.tableData.filter(item => item.title !== '' || item.startTime !== '' || item.endTime !== '');
       this.addData = {
-        projectPlanRecordId: this.planRecordData.id,
+        projectPlanRecordId: this.planInfoData.id,
         actualInvest: this.actualInvest,
         addList: validList
       }
       addPlanInfo(this.addData).then(response => {
-        this.handlePlanRecord(this.planInfoData)
+        this.handlePlanRecord()
       })
     },
     // 閲嶇疆褰撳墠琛屾暟鎹�
@@ -160,24 +159,24 @@
     },
     // 淇濆瓨褰撳墠琛屾暟鎹�
     handleSave(index) {
-      this.tableData[index].projectPlanRecordId = this.planRecordData.id;
+      this.tableData[index].projectPlanRecordId = this.projectInfoData.id;
       savePlanInfo(this.tableData[index]).then(response => {
         this.search();
         this.$message.success('淇濆瓨鎴愬姛');
       });
     },
     /** 杩斿洖椤圭洰璁″垝璁板綍 */
-    handlePlanRecord(planInfoData) {
+    handlePlanRecord() {
       this.$router.push({
-        name: '/projectManage/planRecord',
+        path: '/projectManage/planRecord',
         query: {
-          data: JSON.stringify(planInfoData)
+          data: this.projectInfoData
         }
       })
     }
   },
   created() {
-    this.getPlanRecordData();
+    this.getProjectInfoData();
   },
 };
 </script>

--
Gitblit v1.8.0