From a3dbb8fe40e06f9abd9718f14aaa7311bddbc150 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 13 二月 2025 21:46:05 +0800
Subject: [PATCH] 除了项目中心,其它项目页面都不显示审核状态
---
src/views/projectEngineering/projectLibrary/component/InvestInfo.vue | 89 ++++++++++++++++++++++++++------------------
1 files changed, 53 insertions(+), 36 deletions(-)
diff --git a/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue b/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
index 0e7abec..7b1b6e0 100644
--- a/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
+++ b/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
@@ -164,7 +164,6 @@
</template>
<script>
-import Cookies from "js-cookie";
import {
addProjectInvestmentInfo,
editProjectInvestmentInfo,
@@ -179,28 +178,28 @@
type: Boolean,
default: false,
required: true
- }
+ },
},
data() {
return {
projectForm: {},
investmentForm: {
- id: '',
- beCrossRegion: '',
- constructionLocation: '',
- detailedAddress: '',
- beCompensationProject: '',
- compensationReason: '',
- plannedStartDate: '',
- expectedCompletionDate: '',
- nationalIndustryClassification: '',
- industryClassification: '',
- projectNature: '',
- projectAttribute: '',
- useEarth: '',
- contentScale: '',
- code: '',
- projectId: '',
+ // id: '',
+ // beCrossRegion: '',
+ // constructionLocation: '',
+ // detailedAddress: '',
+ // beCompensationProject: '',
+ // compensationReason: '',
+ // plannedStartDate: '',
+ // expectedCompletionDate: '',
+ // nationalIndustryClassification: '',
+ // industryClassification: '',
+ // projectNature: '',
+ // projectAttribute: '',
+ // useEarth: '',
+ // contentScale: '',
+ // code: '',
+ // projectId: '',
},
plannedStartDate: '',
expectedCompletionDate: '',
@@ -212,36 +211,46 @@
sys_administrative_divisions: []
};
},
- created() {
- this.investmentForm.projectId = this.$route.query.projectId
+ mounted() {
// 浠嶤ookies涓幏鍙栫紦瀛樻暟鎹�
- const investmentForm = Cookies.get("investmentForm");
- const projectForm = Cookies.get("projectForm");
+ const investmentForm = localStorage.getItem("investmentForm");
+ const projectForm = localStorage.getItem("projectForm");
// 灏濊瘯瑙f瀽JSON鏁版嵁
const parsedInvestmentForm = investmentForm ? JSON.parse(investmentForm) : null;
const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null;
-
// 璁剧疆investment鍜宲rojectForm瀵硅薄
- if(parsedInvestmentForm) this.investmentForm = parsedInvestmentForm;
- if(parsedProjectForm) this.projectForm = parsedProjectForm;
-
- // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛橈紝瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api
- if (this.investmentForm.projectId && !investmentForm) {
- this.getInvestment();
+ if(parsedInvestmentForm) {
+ this.investmentForm = parsedInvestmentForm;
}
- this.investmentForm.constructionLocation = this.projectForm.area;
- this.investmentForm.detailedAddress = this.projectForm.projectAddress;
- this.investmentForm.plannedStartDate = this.projectForm.planStartTime;
- this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime;
+ if(parsedProjectForm) {
+ this.projectForm = parsedProjectForm;
+ }
+ // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛橈紝瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api
+ if (this.$route.query.projectId && !investmentForm) {
+ this.getInvestment();
+ }else {
+ this.investmentForm.constructionLocation = this.projectForm.area;
+ this.investmentForm.detailedAddress = this.projectForm.projectAddress;
+ this.investmentForm.plannedStartDate = this.projectForm.planStartTime;
+ this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime;
+ }
+
+ this.investmentForm.projectId = this.projectForm.id;
},
beforeDestroy() {
- Cookies.set("investmentForm", JSON.stringify(this.investmentForm));
+ if(Object.keys(this.investmentForm).length !==0) localStorage.setItem("investmentForm", JSON.stringify(this.investmentForm));
},
methods: {
getInvestment() {
- getProjectInvestmentInfoById(this.investmentForm.projectId ).then(res => {
+ getProjectInvestmentInfoById(this.$route.query.projectId).then(res => {
this.investmentForm = res.data;
+ this.$nextTick(() => {
+ this.investmentForm.constructionLocation = this.projectForm.area;
+ this.investmentForm.detailedAddress = this.projectForm.projectAddress;
+ this.investmentForm.plannedStartDate = this.projectForm.planStartTime;
+ this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime;
+ })
});
},
submit() {
@@ -249,7 +258,7 @@
this.$message.error("璇峰厛淇濆瓨鎶曡祫绠$悊鍩烘湰淇℃伅")
} else {
this.investmentForm.projectId = this.projectForm.id;
- if (this.investmentForm.id != null) {
+ if (this.investmentForm.id) {
editProjectInvestmentInfo(this.investmentForm).then(response => {
this.$modal.msgSuccess("淇敼鎴愬姛");
//璺宠浆鍒颁笅涓粍浠�
@@ -265,6 +274,14 @@
}
}
},
+ },
+ watch: {
+ investmentForm: {
+ deep: true,
+ handler(newVal) {
+ this.$emit('investInfoForm', newVal)
+ }
+ }
}
};
--
Gitblit v1.8.0