<template>
|
<div class="basic-info">
|
<el-form ref="demoFormRef" :disabled="disabled" :model="investmentFundsForm" :rules="rules" class="dialog_form">
|
<!-- 保持原有模板内容不变 -->
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="项目总投资额" label-width="130px" prop="totalInvestment" required style="width: 100%">
|
<el-input v-model.trim="totalInvestment" class="item" clearable disabled style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="项目本金" label-width="130px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.principal" type="number" class="item" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="18">
|
<el-form-item label="一、政府投资" label-width="130px" prop="projectType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.governmentInvestmentTotal" type="number" class="item" clearable style="width: 90%"
|
maxlength="255" placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="18">
|
<el-form-item label="(一)中央投资" label-width="130px" prop="projectType" style="width: 100%">
|
<el-input v-model.trim="centralInvestmentTotal" class="item" clearable disabled style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="1.中央预算投资" label-width="160px" prop="fundsType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.centralBudgetInvestment" type="number" class="item" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="2.中央财政" label-width="130px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.centralFiscalInvestment" type="number" class="item" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item class="items" label="3.中央专项债券筹集的专项建设资金" label-width="130px" prop="investmentType"
|
style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.centralSpecialBondInvestment" type="number" class="item" clearable style="width: 90%"
|
maxlength="255" placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="4.中央专项建设基金" label-width="180px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.centralSpecialFundInvestment" type="number" class="item" clearable style="width: 90%"
|
maxlength="255" placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="5.超长期特别国债资金" label-width="150px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.nationalDebt" class="item" type="number" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="6.2023年增发国债资金" label-width="150px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.additionalNationalDebt" type="number" class="item" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="18">
|
<el-form-item label="(二)省级投资" label-width="130px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="provincialInvestmentTotal" class="item" type="number" clearable disabled style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="1.省预算内投资" label-width="160px" prop="fundsType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.provincialBudgetInvestment" type="number" class="item" clearable style="width: 90%"
|
maxlength="255" placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="2.省财政性建设投资" label-width="130px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.provincialFiscalInvestment" type="number" class="item" clearable style="width: 90%"
|
maxlength="255" placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="3.省专项建设资金" label-width="130px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.provincialSpecialFundInvestment" type="number" class="item" clearable style="width: 90%"
|
maxlength="255" placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="18">
|
<el-form-item label="(三)市(州)投资" label-width="130px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="cityInvestmentTotal" class="item" type="number" clearable disabled style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="1.市(州)预算内投资" label-width="170px" prop="fundsType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.cityBudgetInvestment" type="number" class="item" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="2.市(州)财政性投资" label-width="130px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.cityFiscalInvestment" type="number" class="item" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="3.市(州)专项资金" label-width="130px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.citySpecialFundInvestment" type="number" class="item" clearable style="width: 90%"
|
maxlength="255" placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="18">
|
<el-form-item label="(四)县(市、区)投资" label-width="130px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="countyInvestmentTotal" class="item" type="number" disabled style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="1.区(县)预算内投资" label-width="180px" prop="fundsType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.countyBudgetInvestment" type="number" class="item" clearable style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="2.区(县)财政性建设资金" label-width="170px" prop="investmentType"
|
style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.countyFiscalInvestment" type="number" class="item" clearable style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="3.区(县)专项资金" label-width="130px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.countySpecialFundInvestment" type="number" class="item" clearable style="width: 90%" placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="4.地方政府专项债券" label-width="180px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.deptBond" type="number" class="item" clearable style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="18">
|
<el-form-item label="二、国内贷款" label-width="130px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.domesticLoanTotal" type="number" class="item" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="18">
|
<el-form-item label="银行贷款" label-width="130px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.bankLoan" type="number" class="item" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="18">
|
<el-form-item label="三、外商投资" label-width="130px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.foreignInvestmentTotal" type="number" class="item" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="18">
|
<el-form-item label="四、企业自筹" label-width="130px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.enterpriseSelfRaisedTotal" type="number" class="item" clearable style="width: 90%"
|
maxlength="255" placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="18">
|
<el-form-item label="五、其他投资" label-width="130px" prop="engineering" style="width: 100%">
|
<el-input v-model.trim="investmentFundsForm.otherInvestmentTotal" type="number" class="item" clearable maxlength="255" style="width: 90%"
|
placeholder="请输入"/>
|
<span class="money">万元</span>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
</el-form>
|
</div>
|
</template>
|
|
<script>
|
import Cookies from "js-cookie";
|
import {
|
addProjectInvestmentFunding,
|
editProjectInvestmentFunding,
|
getProjectInvestmentFundingById
|
} from "@/api/projectEngineering/projectInvestmentFunding";
|
import {editProject} from "@/api/projectEngineering/projectInfo";
|
|
export default {
|
name: 'InvestmentFundsForm',
|
props: {
|
disabled: {
|
type: Boolean,
|
default: false,
|
required: true
|
},
|
},
|
computed: {
|
totalInvestment() {
|
this.investmentFundsForm.totalInvestment =
|
parseFloat(this.investmentFundsForm.governmentInvestmentTotal ? this.investmentFundsForm.governmentInvestmentTotal : 0) +
|
this.centralInvestmentTotal +
|
this.provincialInvestmentTotal +
|
this.cityInvestmentTotal +
|
this.countyInvestmentTotal +
|
parseFloat(this.investmentFundsForm.domesticLoanTotal ? this.investmentFundsForm.domesticLoanTotal : 0) +
|
parseFloat(this.investmentFundsForm.bankLoan ? this.investmentFundsForm.bankLoan : 0) +
|
parseFloat(this.investmentFundsForm.foreignInvestmentTotal ? this.investmentFundsForm.foreignInvestmentTotal : 0) +
|
parseFloat(this.investmentFundsForm.enterpriseSelfRaisedTotal ? this.investmentFundsForm.enterpriseSelfRaisedTotal : 0) +
|
parseFloat(this.investmentFundsForm.otherInvestmentTotal ? this.investmentFundsForm.otherInvestmentTotal : 0)
|
return this.investmentFundsForm.totalInvestment;
|
},
|
centralInvestmentTotal() {
|
this.investmentFundsForm.centralInvestmentTotal =
|
parseFloat(this.investmentFundsForm.centralBudgetInvestment ? this.investmentFundsForm.centralBudgetInvestment : 0) +
|
parseFloat(this.investmentFundsForm.centralFiscalInvestment ? this.investmentFundsForm.centralFiscalInvestment : 0) +
|
parseFloat(this.investmentFundsForm.centralSpecialBondInvestment ? this.investmentFundsForm.centralSpecialBondInvestment : 0) +
|
parseFloat(this.investmentFundsForm.centralSpecialFundInvestment ? this.investmentFundsForm.centralSpecialFundInvestment : 0) +
|
parseFloat(this.investmentFundsForm.nationalDebt ? this.investmentFundsForm.nationalDebt : 0) +
|
parseFloat(this.investmentFundsForm.additionalNationalDebt ? this.investmentFundsForm.additionalNationalDebt : 0)
|
return this.investmentFundsForm.centralInvestmentTotal;
|
},
|
provincialInvestmentTotal() {
|
this.investmentFundsForm.provincialInvestmentTotal =
|
parseFloat(this.investmentFundsForm.provincialBudgetInvestment ? this.investmentFundsForm.provincialBudgetInvestment : 0) +
|
parseFloat(this.investmentFundsForm.provincialFiscalInvestment ? this.investmentFundsForm.provincialFiscalInvestment : 0) +
|
parseFloat(this.investmentFundsForm.provincialSpecialFundInvestment ? this.investmentFundsForm.provincialSpecialFundInvestment : 0)
|
return this.investmentFundsForm.provincialInvestmentTotal;
|
},
|
cityInvestmentTotal() {
|
this.investmentFundsForm.cityInvestmentTotal =
|
parseFloat(this.investmentFundsForm.cityBudgetInvestment ? this.investmentFundsForm.cityBudgetInvestment : 0) +
|
parseFloat(this.investmentFundsForm.cityFiscalInvestment ? this.investmentFundsForm.cityFiscalInvestment : 0) +
|
parseFloat(this.investmentFundsForm.citySpecialFundInvestment ? this.investmentFundsForm.citySpecialFundInvestment : 0)
|
return this.investmentFundsForm.cityInvestmentTotal;
|
},
|
countyInvestmentTotal() {
|
this.investmentFundsForm.countyInvestmentTotal =
|
parseFloat(this.investmentFundsForm.countyBudgetInvestment ? this.investmentFundsForm.countyBudgetInvestment : 0) +
|
parseFloat(this.investmentFundsForm.countyFiscalInvestment ? this.investmentFundsForm.countyFiscalInvestment : 0) +
|
parseFloat(this.investmentFundsForm.countySpecialFundInvestment ? this.investmentFundsForm.countySpecialFundInvestment : 0) +
|
parseFloat(this.investmentFundsForm.deptBond ? this.investmentFundsForm.deptBond : 0)
|
return this.investmentFundsForm.countyInvestmentTotal;
|
}
|
},
|
data() {
|
return {
|
projectForm: {},
|
rules: {
|
|
},
|
investmentFundsForm: {
|
// id: '',
|
// projectId: '',
|
// totalInvestment: '',
|
// principal: '',
|
// governmentInvestmentTotal: '',
|
// centralInvestmentTotal: '',
|
// centralBudgetInvestment: '',
|
// centralFiscalInvestment: '',
|
// centralSpecialBondInvestment: '',
|
// centralSpecialFundInvestment: '',
|
// provincialInvestmentTotal: '',
|
// provincialBudgetInvestment: '',
|
// provincialFiscalInvestment: '',
|
// provincialSpecialFundInvestment: '',
|
// cityInvestmentTotal: '',
|
// cityBudgetInvestment: '',
|
// cityFiscalInvestment: '',
|
// citySpecialFundInvestment: '',
|
// countyInvestmentTotal: '',
|
// countyBudgetInvestment: '',
|
// countyFiscalInvestment: '',
|
// countySpecialFundInvestment: '',
|
// domesticLoanTotal: '',
|
// bankLoan: '',
|
// foreignInvestmentTotal: '',
|
// enterpriseSelfRaisedTotal: '',
|
// otherInvestmentTotal: ''
|
}
|
};
|
},
|
methods: {
|
getInvestmentFunds() {
|
getProjectInvestmentFundingById(this.$route.query.projectId).then(res => {
|
this.investmentFundsForm = res.data;
|
});
|
},
|
submit() {
|
if (!this.projectForm.id) {
|
this.$message.error("请先保存投资管理基本信息")
|
} else {
|
this.investmentFundsForm.projectId = this.projectForm.id;
|
if (this.investmentFundsForm.id) {
|
editProjectInvestmentFunding(this.investmentFundsForm).then(response => {
|
this.$modal.msgSuccess("修改成功");
|
//跳转到下个组件
|
this.$emit('toNext', 3);
|
});
|
} else {
|
addProjectInvestmentFunding(this.investmentFundsForm).then(response => {
|
this.$modal.msgSuccess("新增成功");
|
this.investmentFundsForm.id = response.data
|
//跳转到下个组件
|
this.$emit('toNext', 3);
|
});
|
}
|
}
|
},
|
},
|
mounted() {
|
const investmentFundsForm = localStorage.getItem("investmentFundsForm");
|
const projectForm = localStorage.getItem("projectForm");
|
|
const parsedInvestmentFundsForm = investmentFundsForm ? JSON.parse(investmentFundsForm) : null;
|
const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null;
|
if (parsedInvestmentFundsForm) {
|
this.investmentFundsForm = parsedInvestmentFundsForm
|
}
|
if (parsedProjectForm) {
|
this.projectForm = parsedProjectForm
|
}
|
// 如果路由存在id且没有缓存,视为编辑或查看,调用api
|
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>
|
|
<style lang="scss" scoped>
|
.item {
|
width: 100%;
|
}
|
|
.input-row {
|
display: flex;
|
width: 100%;
|
|
.input-item {
|
width: 100%;
|
}
|
}
|
|
.map-btn {
|
width: 32px;
|
height: 32px;
|
background: #c6d6ff;
|
border: 1px solid #3369ff;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
cursor: pointer;
|
|
img {
|
width: 20px;
|
}
|
}
|
.money {
|
font-size: 12px;
|
margin-left: 2px;
|
color: #909399;
|
}
|
.items {
|
::v-deep .el-form-item__label {
|
line-height: 16px;
|
text-align: right;
|
}
|
}
|
</style>
|