From 121761d95c65b31e27253f72c3f0d07987069015 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 03 四月 2025 11:13:27 +0800
Subject: [PATCH] 流程设计按钮权限
---
src/views/projectEngineering/projectLibrary/component/InvestInfo.vue | 92 +++++++++++++++++++++++++++------------------
1 files changed, 55 insertions(+), 37 deletions(-)
diff --git a/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue b/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
index d792807..7b1b6e0 100644
--- a/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
+++ b/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
@@ -11,7 +11,7 @@
style="width: 100%"
>
<el-option v-for="item in dict.type.sys_cross_domain" :key="item.value" :label="item.label"
- :value="item.value"/>
+ :value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
@@ -46,7 +46,7 @@
style="width: 100%"
>
<el-option v-for="item in dict.type.sys_whether_project" :key="item.value" :label="item.label"
- :value="item.value"/>
+ :value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
@@ -137,7 +137,7 @@
style="width: 100%"
>
<el-option v-for="item in dict.type.sys_whether_project" :key="item.value" :label="item.label"
- :value="item.value"/>
+ :value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
@@ -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: '',
@@ -214,33 +213,44 @@
},
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瀵硅薄
- this.investmentForm = parsedInvestmentForm || {};
- this.projectForm = parsedProjectForm || {};
-
- // 濡傛灉projectForm瀛樺湪id涓旀病鏈夌紦瀛橈紝鍒欒皟鐢╝pi
- if (this.projectForm.id && !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.id).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() {
@@ -248,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("淇敼鎴愬姛");
//璺宠浆鍒颁笅涓粍浠�
@@ -264,6 +274,14 @@
}
}
},
+ },
+ watch: {
+ investmentForm: {
+ deep: true,
+ handler(newVal) {
+ this.$emit('investInfoForm', newVal)
+ }
+ }
}
};
--
Gitblit v1.8.0