luohairen
2024-12-24 92b6d45b315ce11eb6c26889d5a4b6feb71348cc
优化
8个文件已修改
124 ■■■■■ 已修改文件
src/api/projectEngineering/projectInfo.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/component/BasicInfo.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/component/InvestInfo.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/component/investmentFunds.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/component/legalPerson.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/projectEngineering/projectLibrary/projectDetails.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/projectEngineering/projectInfo.js
@@ -65,3 +65,11 @@
  })
}
// 编辑新增项目
export function editProject(data) {
  return request({
    url: '/project/info/editProject',
    method: 'post',
    data: data
  })
}
src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
@@ -422,6 +422,7 @@
      getProject(id).then(res => {
        this.projectForm = res.data;
        this.$emit('updateIsShow', true);
      });
    },
    getApprovalList() {
@@ -532,6 +533,7 @@
            this.largeCategory = labels.join(',');
          }
        }, 1000);
        this.$emit('basicInfoForm', newVal)
      },
      deep: true
    }
src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue
@@ -76,10 +76,26 @@
    if (this.$route.query.projectId && !parsedDocumentsInfoForm) {
      this.getDocumentsInfo();
    }
    this.documentsInfoForm.projectId = this.projectForm.id;
  },
  beforeDestroy() {
    if(Object.keys(this.documentsInfoForm).length !==0) localStorage.setItem("documentsInfoForm", JSON.stringify(this.documentsInfoForm));
  },
  watch: {
    documentsInfoForm:{
      deep: true,
      handler(newVal) {
        this.$emit('documentsInfoForm', newVal)
      }
    },
    fileList: {
      deep: true,
      handler(newVal) {
        this.documentsInfoForm.fileList = newVal
      }
    }
  }
};
</script>
src/views/projectEngineering/projectLibrary/component/InvestInfo.vue
@@ -219,7 +219,6 @@
    // 尝试解析JSON数据
    const parsedInvestmentForm = investmentForm ? JSON.parse(investmentForm) : null;
    const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null;
    console.log(parsedInvestmentForm)
    // 设置investment和projectForm对象
    if(parsedInvestmentForm) {
      this.investmentForm = parsedInvestmentForm;
@@ -236,6 +235,8 @@
      this.investmentForm.plannedStartDate = this.projectForm.planStartTime;
      this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime;
    }
    this.investmentForm.projectId = this.projectForm.id;
  },
  beforeDestroy() {
    if(Object.keys(this.investmentForm).length !==0) localStorage.setItem("investmentForm", JSON.stringify(this.investmentForm));
@@ -273,6 +274,14 @@
        }
      }
    },
  },
  watch: {
    investmentForm: {
      deep: true,
      handler(newVal) {
        this.$emit('investInfoForm', newVal)
      }
    }
  }
};
src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue
@@ -164,6 +164,7 @@
  editProjectInvestmentPolicyCompliance,
  getProjectInvestmentPolicyComplianceById
} from "@/api/projectEngineering/projectInvestmentPolicyCompliance";
import {newline} from "js-beautify/js/src/javascript/acorn";
export default {
  name: 'PolicyComplianceForm',
@@ -176,6 +177,7 @@
  },
  data() {
    return {
      projectForm: {},
      policyInfoForm: {
        // id: '',
        // projectId: '',
@@ -219,6 +221,8 @@
      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));
@@ -259,6 +263,20 @@
      }
    }
  },
  watch: {
    policyInfoForm: {
      deep: true,
      handler(newVal) {
        this.$emit('policyInfoForm', newVal)
      }
    },
    fileList: {
      deep: true,
      handler(newVal) {
        this.policyInfoForm.fileList = newVal
      }
    }
  }
};
</script>
src/views/projectEngineering/projectLibrary/component/investmentFunds.vue
@@ -197,6 +197,7 @@
  editProjectInvestmentFunding,
  getProjectInvestmentFundingById
} from "@/api/projectEngineering/projectInvestmentFunding";
import {editProject} from "@/api/projectEngineering/projectInfo";
export default {
  name: 'InvestmentFundsForm',
@@ -285,10 +286,20 @@
    if (this.$route.query.projectId&& !parsedInvestmentFundsForm) {
      this.getInvestmentFunds();
    }
    this.investmentFundsForm.projectId = this.projectForm.id;
  },
  beforeDestroy() {
    if(Object.keys(this.investmentFundsForm).length !==0) localStorage.setItem("investmentFundsForm", JSON.stringify(this.investmentFundsForm));
  },
  watch: {
    investmentFundsForm: {
      deep: true,
      handler(newVal) {
        this.$emit('investmentFundsForm', newVal)
      }
    }
  }
}
</script>
src/views/projectEngineering/projectLibrary/component/legalPerson.vue
@@ -177,6 +177,7 @@
  },
  data() {
    return {
      projectForm: {},
      legalPersonForm: {
        // id: '',
        // totalInvestment: '',
@@ -219,6 +220,7 @@
      this.getProjectUnitRegistrationInfo();
    }
    this.legalPersonForm.projectId = this.projectForm.id;
  },
  beforeDestroy() {
    if(Object.keys(this.legalPersonForm).length !==0)  localStorage.setItem("legalPersonForm", JSON.stringify(this.legalPersonForm));
@@ -250,6 +252,14 @@
        }
      }
    },
  },
  watch: {
    legalPersonForm: {
      deep: true,
      handler(newVal) {
        this.$emit('legalPersonForm', newVal)
      }
    }
  }
}
</script>
src/views/projectEngineering/projectLibrary/projectDetails.vue
@@ -20,6 +20,12 @@
      :disabled="disabled"
      @toNext="changeTable"
      @updateIsShow="updateIsShow"
      @basicInfoForm="basicInfoForm"
      @investInfoForm="investInfoForm"
      @investmentFundsForm="investmentFundsForm"
      @legalPersonForm="legalPersonForm"
      @policyInfoForm="policyInfoForm"
      @documentsInfoForm="documentsInfoForm"
      :isShow="isShow"
      class="full-width custom-height"
    />
@@ -31,9 +37,10 @@
        @click="submit(0)"
        >草稿</el-button
      >
      <el-button class="save-button" type="primary" @click="submit(1)"
        >保存</el-button
      >
<!--      <el-button class="save-button" type="primary" @click="submit(1)"-->
<!--        >保存</el-button>-->
      <el-button class="save-button" type="primary" @click="saveProject"
      >保存</el-button>
      <el-button class="reset-button" @click="reset">重置</el-button>
      <!-- <el-button v-else class="cancel-button" @click="cancel">取消</el-button> -->
    </div>
@@ -47,6 +54,7 @@
import LegalPerson from "@/views/projectEngineering/projectLibrary/component/legalPerson";
import PolicyInfo from "@/views/projectEngineering/projectLibrary/component/PolicyInfo";
import DocumentsInfo from "@/views/projectEngineering/projectLibrary/component/DocumentsInfo";
import { editProject } from "@/api/projectEngineering/projectInfo";
export default {
  name: "ProjectDetails",
@@ -57,6 +65,7 @@
      disabled: false,
      projectForm: {},
      componentName: BasicInfo,
      projectId: null,
      TABS_DATA: [
        {
          label: "项目管理基础信息",
@@ -96,13 +105,38 @@
    updateIsShow(newValue) {
      this.isShow = newValue;
    },
    basicInfoForm(data) {
      this.projectForm.projectInfoForm = data;
      this.projectId = data.id;
    },
    investInfoForm(data) {
      this.projectForm.projectInvestmentInfoForm = data;
      this.projectForm.projectInvestmentInfoForm.projectId = this.projectId;
    },
    investmentFundsForm(data) {
      this.projectForm.projectInvestmentFundingForm = data;
      this.projectForm.projectInvestmentFundingForm.projectId = this.projectId;
    },
    documentsInfoForm(data){
      this.projectForm.documentInfoForm = data;
      this.projectForm.documentInfoForm.projectId = this.projectId;
    },
    legalPersonForm(data) {
      this.projectForm.projectUnitRegistrationInfoForm = data;
      this.projectForm.projectUnitRegistrationInfoForm.projectId = this.projectId;
    },
    policyInfoForm(data) {
      this.projectForm.projectInvestmentPolicyComplianceForm = data;
      this.projectForm.projectInvestmentPolicyComplianceForm.projectId = this.projectId;
    },
    handleClick(tabTarget) {
      this.componentName = this.TABS_DATA[tabTarget.index].componentName;
      console.log(this.projectForm);
    },
    changeTable(index) {
      this.componentName = this.TABS_DATA[index].componentName;
      this.currentTab = this.TABS_DATA[index].value;
    },
    submit(usedStatus) {
      this.$refs.childRef.submit(usedStatus);
@@ -110,6 +144,12 @@
    reset() {
      this.$refs.childRef.reset();
    },
    saveProject() {
      editProject(this.projectForm).then((res) => {
        this.$message.success("保存成功");
      })
      this.$router.push('/projectEngineering/project/projectLibrary')
    }
  },
  mounted() {
    if (this.$route.query.disabled) {