<template>
|
<div class="basic-info">
|
<el-form ref="demoFormRef" :disabled="disabled" :model="legalPersonForm" class="dialog_form">
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="项目总投额" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model="legalPersonForm.totalInvestment" class="item" clearable maxlength="255"
|
placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="项目单位" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model="legalPersonForm.projectUnit" class="item" clearable maxlength="255" placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="项目单位类型" label-width="120px" prop="projectType" style="width: 100%">
|
<el-select
|
v-model="legalPersonForm.projectUnitType"
|
clearable
|
placeholder="请选择"
|
style="width: 100%"
|
>
|
<el-option v-for="item in dict.type.sys_unit_type" :key="item.value" :label="item.label"
|
:value="item.value"/>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="登记注册类型" label-width="120px" prop="projectType" style="width: 100%">
|
<el-select
|
v-model="legalPersonForm.registrationType"
|
clearable
|
placeholder="请选择"
|
style="width: 100%"
|
>
|
<el-option v-for="item in dict.type.sys_registration_type" :key="item.value" :label="item.label"
|
:value="item.value"/>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="控股情况" label-width="120px" prop="projectType" style="width: 100%">
|
<el-select
|
v-model="legalPersonForm.holdingSituation"
|
clearable
|
placeholder="请选择"
|
style="width: 100%"
|
>
|
<el-option v-for="item in dict.type.sys_holding_situation" :key="item.value" :label="item.label"
|
:value="item.value"/>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="证照类型" label-width="120px" prop="projectstatus" style="width: 100%">
|
<el-select
|
v-model="legalPersonForm.certificateType"
|
clearable
|
placeholder="请选择"
|
style="width: 100%"
|
>
|
<el-option v-for="item in dict.type.sys_license_type" :key="item.value" :label="item.label"
|
:value="item.value"/>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="证件号码" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.certificateNumber" class="item" clearable maxlength="255"
|
placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="注册地址" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.registeredAddress" class="item" clearable maxlength="255"
|
placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="注册资金" label-width="120px" prop="projectType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.registeredCapital" class="item" clearable maxlength="255"
|
placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="法人代表" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.legalRepresentative" class="item" clearable maxlength="255"
|
placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="固定电话" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.fixedPhone" class="item" clearable maxlength="255"
|
placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="法人身份证号" label-width="120px" prop="projectType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.legalPersonIdcard" class="item" clearable maxlength="255"
|
placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="项目联系人" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.projectContactPerson" class="item" clearable maxlength="255"
|
placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="移动电话" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.phone" class="item" clearable maxlength="255" placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="联系人身份证号" label-width="120px" prop="projectType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.contactIdcard" class="item" clearable maxlength="255"
|
placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="微信号" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.wechat" class="item" clearable maxlength="255" placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="联系人通讯地址" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.contactAddress" class="item" clearable maxlength="255"
|
placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item label="邮政编码" label-width="120px" prop="projectType" style="width: 100%">
|
<el-input v-model.trim="legalPersonForm.postCode" class="item" clearable maxlength="255" placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-form-item label="电子邮箱" label-width="120px" prop="investmentType" style="width: 100%">
|
<el-input v-model="legalPersonForm.email" class="item" clearable maxlength="255" placeholder="请输入"/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
</div>
|
</template>
|
|
<script>
|
|
import Cookies from "js-cookie";
|
import {
|
addProjectUnitRegistrationInfo,
|
editProjectUnitRegistrationInfo,
|
getProjectUnitRegistrationInfoById
|
} from "@/api/projectEngineering/projectUnitRegistrationInfo";
|
|
export default {
|
dicts: ['sys_unit_type', 'sys_registration_type', 'sys_holding_situation', 'sys_license_type'],
|
name: 'LegalPersonForm',
|
props: {
|
disabled: {
|
type: Boolean,
|
default: false,
|
required: true
|
},
|
},
|
data() {
|
return {
|
legalPersonForm: {
|
// id: '',
|
// totalInvestment: '',
|
// projectUnit: '',
|
// projectUnitType: '',
|
// registrationType: '',
|
// holdingSituation: '',
|
// certificateType: '',
|
// certificateNumber: '',
|
// registeredAddress: '',
|
// registeredCapital: '',
|
// projectId: '',
|
// legalRepresentative: '',
|
// fixedPhone: '',
|
// legalPersonIdcard: '',
|
// projectContactPerson: '',
|
// phone: '',
|
// contactIdcard: '',
|
// wechat: '',
|
// contactAddress: '',
|
// postCode: '',
|
// email: ''
|
},
|
}
|
},
|
mounted() {
|
const legalPersonForm = localStorage.getItem("legalPersonForm");
|
const projectForm = localStorage.getItem("projectForm");
|
|
const parsedLegalPersonForm = legalPersonForm ? JSON.parse(legalPersonForm) : null;
|
const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null;
|
if (parsedLegalPersonForm) {
|
this.legalPersonForm = parsedLegalPersonForm
|
}
|
if (parsedProjectForm) {
|
this.projectForm = parsedProjectForm
|
}
|
// 如果路由存在id且没有缓存,视为编辑或查看,调用api
|
if (this.$route.query.projectId && !parsedLegalPersonForm) {
|
this.getProjectUnitRegistrationInfo();
|
}
|
|
},
|
beforeDestroy() {
|
if(Object.keys(this.legalPersonForm).length !==0) localStorage.setItem("legalPersonForm", JSON.stringify(this.legalPersonForm));
|
},
|
methods: {
|
getProjectUnitRegistrationInfo() {
|
getProjectUnitRegistrationInfoById(this.$route.query.projectId).then(res => {
|
this.legalPersonForm = res.data;
|
});
|
},
|
submit() {
|
if (!this.projectForm.id) {
|
this.$message.error("请先保存投资管理基本信息")
|
} else {
|
this.legalPersonForm.projectId = this.projectForm.id;
|
if (this.legalPersonForm.id) {
|
editProjectUnitRegistrationInfo(this.legalPersonForm).then(response => {
|
this.$modal.msgSuccess("修改成功");
|
//跳转到下个组件
|
this.$emit('toNext', 4);
|
});
|
} else {
|
addProjectUnitRegistrationInfo(this.legalPersonForm).then(response => {
|
this.$modal.msgSuccess("新增成功");
|
this.legalPersonForm.id = response.data
|
//跳转到下个组件
|
this.$emit('toNext', 4);
|
});
|
}
|
}
|
},
|
}
|
}
|
</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;
|
}
|
}
|
</style>
|