From 7a1893afe6bfb94965a8aa7463d2d3068caa274e Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 12 二月 2025 15:07:49 +0800
Subject: [PATCH] 督办
---
src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue | 175 ++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 121 insertions(+), 54 deletions(-)
diff --git a/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue b/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue
index 2aa6cf7..b5ad508 100644
--- a/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue
+++ b/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue
@@ -1,9 +1,9 @@
<template>
<div class="policy-info">
<el-form
- ref="demoFormRef"
+ ref="policyInfoFormRef"
:disabled="disabled"
- :model="investmentProjectPolicyComplianceDTO"
+ :model="policyInfoForm"
:rules="rules"
>
<el-row :gutter="0">
@@ -14,17 +14,18 @@
:fileType="accept"
:isShowTip="false"/>
<div v-if="fileList.length === 0" style="color: #a9afbc; margin-left: 10px">
- 鏀寔涓嬭浇PDF鏍煎紡鏂囦欢
+ 鏀寔涓婁紶PDF鏍煎紡鏂囦欢
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="20">
- <el-form-item class="custom-form-item" label=" " label-position="right" label-width="180px" style="width: 100%; margin-top: -20px">
+ <el-form-item class="custom-form-item" label=" " label-position="right" label-width="180px"
+ style="width: 100%; margin-top: -20px">
<div class="input-row policy-items">
- <el-radio-group v-model="investmentProjectPolicyComplianceDTO.belongsToIndustryAdjustmentDirectory" class="radio-item">
- <el-radio size="large" style="margin-bottom: 25px" :label="true">灞炰簬銆婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬩笅鐨勯」鐩� </el-radio>
+ <el-radio-group v-model="policyInfoForm.belongsToIndustryAdjustmentDirectory" class="radio-item">
+ <el-radio size="large" style="margin-bottom: 25px" :label="true">灞炰簬銆婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬩笅鐨勯」鐩�</el-radio>
<el-radio size="large" :label="false">灞炰簬鏈垪鍏ャ�婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬬殑鍏佽绫婚」鐩�</el-radio>
</el-radio-group>
</div>
@@ -32,10 +33,11 @@
</el-col>
<el-col :span="20">
- <el-form-item class="custom-form-item" label=" " label-width="180px" style="width: 100%; margin-top: -20px; height: 50px">
+ <el-form-item class="custom-form-item" label=" " label-width="180px"
+ style="width: 100%; margin-top: -20px; height: 50px">
<div class="input-row policy-items">
<el-checkbox
- v-model="investmentProjectPolicyComplianceDTO.belongsToWesternEncouragedDirectory"
+ v-model="policyInfoForm.belongsToWesternEncouragedDirectory"
label="灞炰簬銆婅タ閮ㄥ湴鍖洪紦鍔辩被浜т笟鐩綍銆嬬殑椤圭洰"
size="large"
style="margin-right: 70px"
@@ -44,10 +46,11 @@
</el-form-item>
</el-col>
<el-col :span="20">
- <el-form-item class="custom-form-item" label=" " label-width="180px" style="width: 100%; margin-top: -20px; height: 30px">
+ <el-form-item class="custom-form-item" label=" " label-width="180px"
+ style="width: 100%; margin-top: -20px; height: 30px">
<div class="input-row policy-items" style="height: 52px">
<el-checkbox
- v-model="investmentProjectPolicyComplianceDTO.notBannedOrControlledProject"
+ v-model="policyInfoForm.notBannedOrControlledProject"
disabled
label="涓嶅睘浜庝骇涓氭斂绛栫姝㈡姇璧勫缓璁炬垨瀹炶鏍稿噯銆佸鎵圭鐞嗙殑椤圭洰"
size="large"
@@ -58,11 +61,12 @@
</el-form-item>
</el-col>
<el-col :span="20">
- <el-form-item class="custom-form-item" label="濉姤淇℃伅鐪熷疄" label-width="180px" style="width: 100%; margin-top: 20px">
+ <el-form-item class="custom-form-item" label="濉姤淇℃伅鐪熷疄" label-width="180px"
+ style="width: 100%; margin-top: 20px">
<div class="policy-items">
<div style="color: #a9afbc">澶囨鑰呮壙璇�:</div>
<el-checkbox
- v-model="investmentProjectPolicyComplianceDTO.informationIsTrue"
+ v-model="policyInfoForm.informationIsTrue"
disabled
label="鎵�鎻愪緵鐨勫妗堜俊鎭槸鐪熷疄銆佸噯纭�佸畬鏁村拰鏈夋晥鐨�,鏃犻殣鐬掋�佽櫄鍋囧拰閲嶅ぇ閫犳紡涔嬪锛屽澶囨椤圭洰淇℃伅鐨勭湡瀹炴�ц礋璐�"
size="large"
@@ -76,7 +80,7 @@
<el-form-item label="涓撻」瑙勫垝绗﹀悎鎯呭喌:" label-width="180px" prop="specialPlanningCompliance" style="width: 100%">
<div class="input-row">
<el-input
- v-model.trim="investmentProjectPolicyComplianceDTO.specialPlanningCompliance"
+ v-model.trim="policyInfoForm.specialPlanningCompliance"
class="input-item"
maxlength="200"
placeholder="璇疯緭鍏�"
@@ -88,20 +92,23 @@
<el-col :span="20">
<el-form-item label="椤圭洰鑳借�楁儏鍐�:" label-width="180px" prop="projectEnergyConsumption" style="width: 100%">
<div class="policy-items" style="height: 320px">
- <div style="line-height: 20px;color: #a9afbc">
+ <div style="line-height: 20px;color: #a9afbc">
骞寸患鍚堣兘婧愭秷璐归噺涓嶆弧1000鍚ㄦ爣鍑嗙叅锛屼笖骞寸數鍔涙秷鑰楅噺涓嶆弧500涓囧崈鐡︽椂鐨勫浘瀹氳祫浜ф姇璧勯」鐩�佷互鍙婄敤鑳藉伐鑹虹畝鍗曘�佽妭鑳芥綔鍔涘皬鐨勮涓�(鎸夌収鍥藉鍙戞敼瑕佹寚瀹氬苟鍏竷鐨勫叿浣撹涓氱洰褰�)鐨勫洜瀹氳祫浜ф姇璧勯」鐩簲鎸夌収鐩稿叧鑺傝兘鏍囧噯銆佽鑼冨缓璁撅紝涓嶅啀鍗曠嫭杩涜鑺傝兘瀹℃煡銆�
</div>
<div style="display: flex;width: 100%;">
- <el-radio-group v-model="investmentProjectPolicyComplianceDTO.energyCheck" style="display: flex;flex-direction: column;margin-top: 10px">
- <el-radio size="large" style="margin-bottom: 20px" :label="true"> 闇�杩涜鑺傝兘瀹℃煡鐨勯」鐩紝涓嶅湪濉姤銆婇」鐩兘婧愭秷璐规儏鍐佃〃銆� </el-radio>
- <el-radio size="large" style="margin-bottom: 10px" :label="false"> 涓嶅崟鐙繘琛岃妭鑳藉鏌ョ殑椤圭洰锛岄渶濉姤銆婇」鐩兘婧愭秷璐规儏鍐佃〃銆� </el-radio>
+ <el-radio-group v-model="policyInfoForm.energyCheck"
+ style="display: flex;flex-direction: column;margin-top: 10px">
+ <el-radio size="large" style="margin-bottom: 20px" :label="true"> 闇�杩涜鑺傝兘瀹℃煡鐨勯」鐩紝涓嶅湪濉姤銆婇」鐩兘婧愭秷璐规儏鍐佃〃銆�
+ </el-radio>
+ <el-radio size="large" style="margin-bottom: 10px" :label="false"> 涓嶅崟鐙繘琛岃妭鑳藉鏌ョ殑椤圭洰锛岄渶濉姤銆婇」鐩兘婧愭秷璐规儏鍐佃〃銆�
+ </el-radio>
</el-radio-group>
</div>
<div style="display: flex;gap: 2px">
<div style="width: 160px">1.椤圭洰骞寸患鍚堣兘婧愭秷璐归噺:</div>
<el-input
style="width: 300px"
- v-model.trim="investmentProjectPolicyComplianceDTO.annualEnergyConsumption"
+ v-model.trim="policyInfoForm.annualEnergyConsumption"
maxlength="255"
placeholder="璇疯緭鍏�"
></el-input>
@@ -111,7 +118,7 @@
<div style="width: 160px">2.椤圭洰骞寸數鍔涙秷鑰楅噺:</div>
<el-input
style="width: 300px"
- v-model.trim="investmentProjectPolicyComplianceDTO.annualElectricityConsumption"
+ v-model.trim="policyInfoForm.annualElectricityConsumption"
maxlength="255"
placeholder="璇疯緭鍏�"
></el-input>
@@ -119,7 +126,7 @@
</div>
<div style="line-height: 20px;color: #a9afbc;margin-top: 5px">涓嶅啀鍗曠嫭杩涜鑺傝兘瀹℃煡鐨勭被鍨嬪涓�:</div>
<div class="input-row">
- <el-radio-group v-model="investmentProjectPolicyComplianceDTO.noOnlyCheckType" class="radio-item">
+ <el-radio-group v-model="policyInfoForm.noOnlyCheckType" class="radio-item">
<el-radio size="large" :label="1">
骞寸患鍚堣兘婧愭秷璐归噺涓嶆弧1000鍚ㄦ爣鍑嗙叅涓斿勾鐢靛姏娑堣垂閲忎笉婊�500涓囧崈鐡︽椂鐨勫浐瀹氳祫浜ф姇璧勯」鐩�
</el-radio>
@@ -135,7 +142,7 @@
<el-form-item label="澶囨敞:" label-width="180px" prop="remark" style="width: 100%">
<div class="input-row">
<el-input
- v-model.trim="investmentProjectPolicyComplianceDTO.remark"
+ v-model.trim="policyInfoForm.remarks"
class="item"
clearable
maxlength="255"
@@ -152,6 +159,13 @@
<script>
+import {
+ addProjectInvestmentPolicyCompliance,
+ editProjectInvestmentPolicyCompliance,
+ getProjectInvestmentPolicyComplianceById
+} from "@/api/projectEngineering/projectInvestmentPolicyCompliance";
+import {newline} from "js-beautify/js/src/javascript/acorn";
+
export default {
name: 'PolicyComplianceForm',
props: {
@@ -159,54 +173,107 @@
type: Boolean,
default: false,
required: true
- }
+ },
},
data() {
return {
- investmentProjectPolicyComplianceDTO: {
- fileIdList: [],
- belongsToIndustryAdjustmentDirectory: null,
- belongsToWesternEncouragedDirectory: false,
- notBannedOrControlledProject: true,
- informationIsTrue: true,
- specialPlanningCompliance: '',
- energyCheck: null,
- annualEnergyConsumption: '',
- annualElectricityConsumption: '',
- noOnlyCheckType: null,
- remark: ''
+ projectForm: {},
+ policyInfoForm: {
+ // id: '',
+ // projectId: '',
+ // fileList: [],
+ // belongsToIndustryAdjustmentDirectory: null,
+ // belongsToWesternEncouragedDirectory: null,
+ // notBannedOrControlledProject: true,
+ // informationIsTrue: true,
+ // specialPlanningCompliance: '',
+ // energyCheck: null,
+ // annualEnergyConsumption: '',
+ // annualElectricityConsumption: '',
+ // noOnlyCheckType: null,
+ // remarks: ''
},
fileList: [],
accept: ['pdf'],
rules: {
- industrialPolicyProhibition: [{ required: true, message: '璇烽�夋嫨', trigger: 'change' }],
- reportedInformation: [{ required: true, message: '璇烽�夋嫨', trigger: 'change' }]
+ industrialPolicyProhibition: [{required: true, message: '璇烽�夋嫨', trigger: 'change'}],
+ reportedInformation: [{required: true, message: '璇烽�夋嫨', trigger: 'change'}]
}
};
},
- watch: {
- fileList: {
- deep: true,
- handler(newFileList) {
- if (newFileList) {
- this.investmentProjectPolicyComplianceDTO.fileIdList = newFileList.map(item => item.fileId);
- }
+ mounted() {
+ const policyInfoForm = localStorage.getItem("policyInfoForm");
+ const projectForm = localStorage.getItem("projectForm");
+
+ const parsedPolicyInfoForm = policyInfoForm ? JSON.parse(policyInfoForm) : null;
+ const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null;
+ if (parsedPolicyInfoForm) {
+ this.policyInfoForm = parsedPolicyInfoForm
+ if(this.policyInfoForm.fileList) this.fileList = this.policyInfoForm.fileList
+ }
+ if (parsedProjectForm) {
+ this.projectForm = parsedProjectForm
+ }
+ // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛�,瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api
+ if (this.$route.query.projectId && !parsedPolicyInfoForm) {
+ this.getProjectInvestmentPolicyCompliance();
+ } else {
+ this.policyInfoForm.informationIsTrue= true;
+ this.policyInfoForm.notBannedOrControlledProject = true;
+ }
+
+ this.policyInfoForm.projectId = this.projectForm.id;
+ },
+ beforeDestroy() {
+ if(Object.keys(this.policyInfoForm).length !==0) localStorage.setItem("policyInfoForm", JSON.stringify(this.policyInfoForm));
+ },
+ methods: {
+ getProjectInvestmentPolicyCompliance() {
+ getProjectInvestmentPolicyComplianceById(this.$route.query.projectId).then(res => {
+ this.policyInfoForm = res.data;
+ this.policyInfoForm.notBannedOrControlledProject = true
+ this.policyInfoForm.informationIsTrue = true
+ this.fileList =this.policyInfoForm.fileList
+ });
+ },
+ submit() {
+ if (!this.projectForm.id) {
+ this.$message.error("璇峰厛淇濆瓨鎶曡祫绠$悊鍩烘湰淇℃伅")
+ } else {
+ this.$refs["policyInfoFormRef"].validate(valid => {
+ if (valid) {
+ this.policyInfoForm.projectId = this.projectForm.id;
+ this.policyInfoForm.fileList = this.fileList
+ if (this.policyInfoForm.id) {
+ editProjectInvestmentPolicyCompliance(this.policyInfoForm).then(response => {
+ this.$modal.msgSuccess("淇敼鎴愬姛");
+ //璺宠浆鍒颁笅涓粍浠�
+ this.$emit('toNext', 5);
+ });
+ } else {
+ addProjectInvestmentPolicyCompliance(this.policyInfoForm).then(response => {
+ this.$modal.msgSuccess("鏂板鎴愬姛");
+ this.policyInfoForm.id = response.data
+ //璺宠浆鍒颁笅涓粍浠�
+ this.$emit('toNext', 5);
+ });
+ }
+ }
+ });
}
}
},
- methods: {
- submit() {
- console.log("鏀跨瓥submit")
- },
- handleRemove(file) {
- if (file) {
- this.investmentProjectPolicyComplianceDTO.fileIdList = this.fileList.map(item => item.fileId);
- localStorage.setItem('fileList', JSON.stringify(file));
+ watch: {
+ policyInfoForm: {
+ deep: true,
+ handler(newVal) {
+ this.$emit('policyInfoForm', newVal)
}
},
- handleAdd(file) {
- if (file) {
- localStorage.setItem('fileList', JSON.stringify(file));
+ fileList: {
+ deep: true,
+ handler(newVal) {
+ this.policyInfoForm.fileList = newVal
}
}
}
--
Gitblit v1.8.0