From 46e29a50eccda9f92fb2feeb18fa8a0ea4092587 Mon Sep 17 00:00:00 2001
From: luohairen <3399054449@qq.com>
Date: 星期四, 28 十一月 2024 22:31:38 +0800
Subject: [PATCH] 页面传参bug

---
 src/views/projectManage/plan/planInfo.vue           |   20 +++++-----
 src/views/projectManage/progress/progressRecord.vue |   18 ++++----
 src/api/projectPlan/index.js                        |   25 ++++--------
 src/views/projectManage/plan/planInfoCheck.vue      |    6 +-
 src/views/projectManage/plan/planRecord.vue         |   39 ++++++++++---------
 5 files changed, 50 insertions(+), 58 deletions(-)

diff --git a/src/api/projectPlan/index.js b/src/api/projectPlan/index.js
index d3e00b2..7340072 100644
--- a/src/api/projectPlan/index.js
+++ b/src/api/projectPlan/index.js
@@ -9,6 +9,14 @@
   })
 }
 
+// 鑾峰彇涓荤鏍囪瘑
+export function getManagerFlag(recordId) {
+  return request({
+    url: '/project/info/getManagerFlag/'+ recordId,
+    method: 'get'
+  })
+}
+
 // 鏌ヨ璁″垝璁板綍鍒楄〃
 export function getPlanRecordList(id) {
   return request({
@@ -17,28 +25,11 @@
   })
 }
 
-// 鏌ヨ椤圭洰璁″垝璁板綍璇︾粏
-export function getRecord(id) {
-  return request({
-    url: '/plan/record/' + id,
-    method: 'get'
-  })
-}
-
 // 鏂板椤圭洰璁″垝璁板綍
 export function addRecord(data) {
   return request({
     url: '/api/project-plan-record',
     method: 'post',
-    data: data
-  })
-}
-
-// 淇敼椤圭洰璁″垝璁板綍
-export function updateRecord(data) {
-  return request({
-    url: '/plan/record',
-    method: 'put',
     data: data
   })
 }
diff --git a/src/views/projectManage/plan/planInfo.vue b/src/views/projectManage/plan/planInfo.vue
index 9608965..e28e4aa 100644
--- a/src/views/projectManage/plan/planInfo.vue
+++ b/src/views/projectManage/plan/planInfo.vue
@@ -1,8 +1,8 @@
 <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 v-show="projectInfoData && projectInfoData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ projectInfoData.projectName }} {{ projectInfoData.planTimeFlag === 0 ? '(鏈堝害璁″垝)' : projectInfoData.planTimeFlag === 1 ? '(瀛e害璁″垝)' : '(骞村害璁″垝)' }}</el-header>
+      <h4 v-show="projectInfoData && projectInfoData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ projectInfoData.projectCode }}</h4>
       <el-main>
         <el-card shadow="hover">
           <el-row :gutter="20">
@@ -30,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="projectInfoData.planTimeFlag === 0 ? '鏈堝害' : projectInfoData.planTimeFlag === 1 ? '瀛e害' : '骞村害' " width="100" align="center">
                   <template #default="scope">
-                    <span>{{ planRecordData.planTime }}{{ planRecordData.planTimeFlag === 0 ? '鏈堝害' : planRecordData.planTimeFlag === 1 ? '瀛e害' : '骞村害' }}</span>
+                    <span>{{ projectInfoData.planTime }}{{ projectInfoData.planTimeFlag === 0 ? '鏈堝害' : projectInfoData.planTimeFlag === 1 ? '瀛e害' : '骞村害' }}</span>
                   </template>
                 </el-table-column>
                 <el-table-column fixed="right" label="鎿嶄綔" align="center">
@@ -77,7 +77,7 @@
     return {
       loading: true,
       // 鎺ユ敹浼犻�掕繃鏉ョ殑椤圭洰璁″垝鏁版嵁
-      planRecordData: {},
+      projectInfoData: {},
       planInfoData: {},
       tableData: [
         {
@@ -103,9 +103,9 @@
       this.getPlanInfoData(this.planInfoData.id);
     },
     // 鑾峰彇浼犻�掕繃鏉ョ殑椤圭洰璁″垝璇︽儏
-    getPlanRecordData() {
+    getProjectInfoData() {
       // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁
-      this.planRecordData = this.$route.query.planRecordData
+      this.projectInfoData = this.$route.query.projectInfoData
       this.planInfoData = this.$route.query.data
       this.search();
     },
@@ -159,7 +159,7 @@
     },
     // 淇濆瓨褰撳墠琛屾暟鎹�
     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('淇濆瓨鎴愬姛');
@@ -170,13 +170,13 @@
       this.$router.push({
         path: '/projectManage/planRecord',
         query: {
-          data: this.planRecordData
+          data: this.projectInfoData
         }
       })
     }
   },
   created() {
-    this.getPlanRecordData();
+    this.getProjectInfoData();
   },
 };
 </script>
diff --git a/src/views/projectManage/plan/planInfoCheck.vue b/src/views/projectManage/plan/planInfoCheck.vue
index 08a6087..516be05 100644
--- a/src/views/projectManage/plan/planInfoCheck.vue
+++ b/src/views/projectManage/plan/planInfoCheck.vue
@@ -144,7 +144,7 @@
       loading: true,
       // 鎺ユ敹浼犻�掕繃鏉ョ殑椤圭洰璁″垝鏁版嵁
       planRecordData: {},
-      planInfoData: {},
+      projectInfoData: {},
       // 璁″垝椤规暟鎹�
       tableData: [
         {
@@ -179,7 +179,7 @@
     getPlanRecordData() {
       // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁
       this.planRecordData = this.$route.query.data
-      this.planInfoData = this.$route.query.planInfoData
+      this.projectInfoData = this.$route.query.projectInfoData
       this.search();
     },
     // 鑾峰彇椤圭洰璁″垝椤�
@@ -231,7 +231,7 @@
       this.$router.push({
         path: '/projectManage/planRecord',
         query: {
-          data: this.planRecordData
+          data: this.projectInfoData
         }
       })
     }
diff --git a/src/views/projectManage/plan/planRecord.vue b/src/views/projectManage/plan/planRecord.vue
index f2022b1..a28215b 100644
--- a/src/views/projectManage/plan/planRecord.vue
+++ b/src/views/projectManage/plan/planRecord.vue
@@ -1,8 +1,8 @@
 <template>
   <div class="app-container">
     <el-container>
-      <el-header v-show="planRecordData && planRecordData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ planRecordData.projectName }}</el-header>
-      <h4 v-show="planRecordData && planRecordData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ planRecordData.projectCode }}</h4>
+      <el-header v-show="projectInfoData && projectInfoData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ projectInfoData.projectName }}</el-header>
+      <h4 v-show="projectInfoData && projectInfoData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ projectInfoData.projectCode }}</h4>
       <el-main>
         <el-card shadow="hover">
           <el-row :gutter="20">
@@ -102,7 +102,7 @@
   data() {
     return {
       // 鎺ユ敹浼犻�掕繃鏉ョ殑椤圭洰璁″垝鏁版嵁
-      planRecordData: {},
+      projectInfoData: {},
       // 鏈堝害璁″垝鏁版嵁
       monthRecords: [],
       // 瀛e害璁″垝鏁版嵁
@@ -114,13 +114,13 @@
   methods: {
     // 椤甸潰鍔犺浇
     search() {
-      this.getPlanRecordData(this.planRecordData.id);
+      this.getPlanRecordData(this.projectInfoData.id);
     },
     // 鑾峰彇浼犻�掕繃鏉ョ殑椤圭洰璁″垝璇︽儏
-    getPlanInfoData() {
+    getProjectInfoData() {
       // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁
-      this.planRecordData = this.$route.query.data
-      this.getPlanRecordData(this.planRecordData.id);
+      this.projectInfoData = this.$route.query.data
+      this.getPlanRecordData(this.projectInfoData.id);
     },
     // 鑾峰彇椤圭洰璁″垝璁板綍鏁版嵁
     getPlanRecordData(id) {
@@ -136,13 +136,13 @@
     handleAddMonthPlan() {
       let planRecordData = {
         id: undefined,
-        projectInfoId: this.planRecordData.id,
+        projectInfoId: this.projectInfoData.id,
         planTimeFlag: 0
       }
       // 鍒ゆ柇鏈堝害璁″垝鏄惁涓虹┖
-      if (this.monthRecords.length === 0){
+      if (this.monthRecords.length === 0) {
         planRecordData.id = 0;
-      }else {
+      } else {
         planRecordData.id = this.monthRecords[this.monthRecords.length - 1].id;
       }
       // 鏂板涓�琛岃褰�
@@ -154,13 +154,13 @@
     handleAddSeasonPlan() {
       let planRecordData = {
         id: undefined,
-        projectInfoId: this.planRecordData.id,
+        projectInfoId: this.projectInfoData.id,
         planTimeFlag: 1
       }
       // 鍒ゆ柇瀛e害璁″垝鏄惁涓虹┖
-      if (this.seasonRecords.length === 0){
+      if (this.seasonRecords.length === 0) {
         planRecordData.id = 0;
-      }else {
+      } else {
         planRecordData.id = this.seasonRecords[this.seasonRecords.length - 1].id;
       }
       // 鏂板涓�琛岃褰�
@@ -172,13 +172,13 @@
     handleAddYearPlan() {
       let planRecordData = {
         id: undefined,
-        projectInfoId: this.planRecordData.id,
+        projectInfoId: this.projectInfoData.id,
         planTimeFlag: 2
       }
       // 鍒ゆ柇骞村害璁″垝鏄惁涓虹┖
-      if (this.yearRecords.length === 0){
+      if (this.yearRecords.length === 0) {
         planRecordData.id = 0;
-      }else {
+      } else {
         planRecordData.id = this.yearRecords[this.yearRecords.length - 1].id;
       }
       // 鏂板涓�琛岃褰�
@@ -192,7 +192,7 @@
         path: '/projectManage/planInfo',
         query: {
           data: row,
-          planRecordData: this.planRecordData
+          projectInfoData: this.projectInfoData
         }
       })
     },
@@ -204,17 +204,18 @@
     },
     // 鏌ョ湅椤圭洰璁″垝椤�
     handleCheckPlanInfo(row) {
+      console.log(this.projectInfoData);
       this.$router.push({
         path: '/projectManage/planInfoCheck',
         query: {
           data: row,
-          planRecordData: this.planRecordData
+          projectInfoData: this.projectInfoData
         }
       })
     }
   },
   created() {
-    this.getPlanInfoData();
+    this.getProjectInfoData();
   },
 };
 </script>
diff --git a/src/views/projectManage/progress/progressRecord.vue b/src/views/projectManage/progress/progressRecord.vue
index bd35447..693cb58 100644
--- a/src/views/projectManage/progress/progressRecord.vue
+++ b/src/views/projectManage/progress/progressRecord.vue
@@ -1,8 +1,8 @@
 <template>
   <div class="app-container">
     <el-container>
-      <el-header v-show="planRecordData && planRecordData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ planRecordData.projectName }}</el-header>
-      <h4 v-show="planRecordData && planRecordData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ planRecordData.projectCode }}</h4>
+      <el-header v-show="projectInfoData && projectInfoData.projectName" class="header-title">椤圭洰鍚嶇О锛歿{ projectInfoData.projectName }}</el-header>
+      <h4 v-show="projectInfoData && projectInfoData.projectCode" style="text-align: center">椤圭洰浠g爜锛歿{ projectInfoData.projectCode }}</h4>
       <el-main>
         <el-card shadow="hover">
           <el-row :gutter="20">
@@ -189,7 +189,7 @@
   data() {
     return {
       // 鎺ユ敹浼犻�掕繃鏉ョ殑椤圭洰璁″垝鏁版嵁
-      planRecordData: {},
+      projectInfoData: {},
       monthProgress: [],
       seasonProgress: [],
       yearProgress: [],
@@ -215,15 +215,15 @@
   },
   methods: {
     search() {
-      this.getPlanRecordData()
-      this.getProjectProgressForm(this.planRecordData.id);
+      this.getProjectInfoData()
+      this.getProjectProgressForm(this.projectInfoData.id);
     },
     // 鑾峰彇浼犻�掕繃鏉ョ殑椤圭洰璁″垝璇︽儏
-    getPlanRecordData() {
+    getProjectInfoData() {
       // 浠庢煡璇㈠弬鏁颁腑鑾峰彇鏁版嵁
       if (this.$route.query.data) {
-        this.planRecordData = JSON.parse(this.$route.query.data);
-        this.getProgressInfoList(this.planRecordData.id);
+        this.projectInfoData = JSON.parse(this.$route.query.data);
+        this.getProgressInfoList(this.projectInfoData.id);
       }
     },
     getProjectProgressForm(id) {
@@ -269,7 +269,7 @@
     },
     // 淇濆瓨
     handleSave() {
-      this.projectProgressForm.projectReportId = this.planRecordData.id;
+      this.projectProgressForm.projectReportId = this.projectInfoData.id;
       // 鍒ゆ柇鏂囦欢涓嶄负绌�
         saveProjectProgressFileLists(this.projectProgressForm).then(res => {
           this.$message.success('淇濆瓨鎴愬姛');

--
Gitblit v1.8.0