|
@@ -34,10 +34,10 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="所属行业" prop="industryGroup">
|
|
|
- <el-select v-model="form.industryGroup" placeholder="请选择所属行业">
|
|
|
+ <el-form-item label="所属行业" prop="industry">
|
|
|
+ <el-select v-model="form.industry" placeholder="请选择所属行业">
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.porject_group"
|
|
|
+ v-for="dict in dict.type.CUSTOMER_TRADE"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
@@ -62,85 +62,115 @@
|
|
|
</el-form-item>
|
|
|
<h3>项目公司信息</h3>
|
|
|
<el-divider></el-divider>
|
|
|
- <el-form-item label="公司名称" prop="companyName">
|
|
|
- <el-input v-model="form.companyName" placeholder="请输入公司名称" />
|
|
|
+ <el-form-item label="公司名称" prop="tProjectCompany.companyName">
|
|
|
+ <el-input
|
|
|
+ v-model="form.tProjectCompany.companyName"
|
|
|
+ placeholder="请输入公司名称"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="统一社会信用代码" prop="companyCode">
|
|
|
+ <el-form-item label="统一社会信用代码" prop="tProjectCompany.companyCode">
|
|
|
<el-input
|
|
|
- v-model="form.companyCode"
|
|
|
+ v-model="form.tProjectCompany.companyCode"
|
|
|
placeholder="请输入企业统一社会信用代码"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="营业开始时间" prop="startTime">
|
|
|
+ <el-form-item label="营业开始时间" prop="tProjectCompany.startTime">
|
|
|
<el-date-picker
|
|
|
clearable
|
|
|
- v-model="form.startTime"
|
|
|
+ v-model="form.tProjectCompany.startTime"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="请选择营业开始时间"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="营业结束时间" prop="endTime">
|
|
|
+ <el-form-item label="营业结束时间" prop="tProjectCompany.endTime">
|
|
|
<el-date-picker
|
|
|
clearable
|
|
|
- v-model="form.endTime"
|
|
|
+ v-model="form.tProjectCompany.endTime"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
placeholder="请选择营业结束时间"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="注册资本" prop="registeredCapital">
|
|
|
+ <el-form-item label="注册资本" prop="tProjectCompany.registeredCapital">
|
|
|
<el-input
|
|
|
- v-model="form.registeredCapital"
|
|
|
+ v-model="form.tProjectCompany.registeredCapital"
|
|
|
placeholder="请输入注册资本"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="注册地址" prop="registeredAddress">
|
|
|
+ <el-form-item label="注册地址" prop="tProjectCompany.registeredAddress">
|
|
|
<el-input
|
|
|
- v-model="form.registeredAddress"
|
|
|
+ v-model="form.tProjectCompany.registeredAddress"
|
|
|
placeholder="请输入注册地址"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="实缴资本" prop="paidCapital">
|
|
|
- <el-input v-model="form.paidCapital" placeholder="请输入实缴资本" />
|
|
|
+ <el-form-item label="实缴资本" prop="tProjectCompany.paidCapital">
|
|
|
+ <el-input
|
|
|
+ v-model="form.tProjectCompany.paidCapital"
|
|
|
+ placeholder="请输入实缴资本"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="办公地址" prop="businessAddress">
|
|
|
- <el-input v-model="form.businessAddress" placeholder="请输入办公地址" />
|
|
|
+ <el-form-item label="办公地址" prop="tProjectCompany.businessAddress">
|
|
|
+ <el-input
|
|
|
+ v-model="form.tProjectCompany.businessAddress"
|
|
|
+ placeholder="请输入办公地址"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="实控人" prop="actualBod">
|
|
|
- <el-input v-model="form.actualBod" placeholder="请输入实控人" />
|
|
|
+ <el-form-item label="实控人" prop="tProjectCompany.actualBod">
|
|
|
+ <el-input
|
|
|
+ v-model="form.tProjectCompany.actualBod"
|
|
|
+ placeholder="请输入实控人"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="联系电话" prop="phone">
|
|
|
- <el-input v-model="form.phone" placeholder="请输入联系电话" />
|
|
|
+ <el-form-item label="联系电话" prop="tProjectCompany.phone">
|
|
|
+ <el-input
|
|
|
+ v-model="form.tProjectCompany.phone"
|
|
|
+ placeholder="请输入联系电话"
|
|
|
+ maxlength="11"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="所属类型" prop="type">
|
|
|
- <el-input v-model="form.type" placeholder="请输入所属类型" />
|
|
|
+ <el-form-item label="所属类型" prop="tProjectCompany.type">
|
|
|
+ <el-input
|
|
|
+ v-model="form.tProjectCompany.type"
|
|
|
+ placeholder="请输入所属类型"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="附件" prop="file">
|
|
|
+ <el-form-item label="附件" prop="tProjectCompany.files">
|
|
|
<el-upload
|
|
|
class="upload-demo"
|
|
|
action=""
|
|
|
:on-preview="handlePreview"
|
|
|
:on-remove="handleRemove"
|
|
|
:before-remove="beforeRemove"
|
|
|
+ :on-change="handleChange"
|
|
|
multiple
|
|
|
:file-list="fileList"
|
|
|
+ :auto-upload="false"
|
|
|
>
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
<h3>项目公司联系人信息</h3>
|
|
|
<el-divider></el-divider>
|
|
|
- <el-form-item label="联系人姓名" prop="name">
|
|
|
- <el-input v-model="form.name" placeholder="请输入联系人姓名" />
|
|
|
+ <el-form-item label="联系人姓名" prop="tProjectContacts.name">
|
|
|
+ <el-input
|
|
|
+ v-model="form.tProjectContacts.name"
|
|
|
+ placeholder="请输入联系人姓名"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="职位" prop="position">
|
|
|
- <el-input v-model="form.position" placeholder="请输入职位" />
|
|
|
+ <el-form-item label="职位" prop="tProjectContacts.position">
|
|
|
+ <el-input
|
|
|
+ v-model="form.tProjectContacts.position"
|
|
|
+ placeholder="请输入职位"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="联系电话/微信" prop="contact">
|
|
|
- <el-input v-model="form.contact" placeholder="请输入联系电话/微信" />
|
|
|
+ <el-form-item label="联系电话/微信" prop="tProjectContacts.contact">
|
|
|
+ <el-input
|
|
|
+ v-model="form.tProjectContacts.contact"
|
|
|
+ placeholder="请输入联系电话/微信"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<h3>项目融资信息</h3>
|
|
|
<el-divider></el-divider>
|
|
@@ -249,7 +279,7 @@ export default {
|
|
|
default: "1", //1可编辑 2不可编辑
|
|
|
},
|
|
|
},
|
|
|
- dicts: ["porject_group"],
|
|
|
+ dicts: ["CUSTOMER_TRADE", "porject_group"],
|
|
|
data() {
|
|
|
return {
|
|
|
title: "新增项目",
|
|
@@ -259,27 +289,32 @@ export default {
|
|
|
id: null,
|
|
|
porjectName: null,
|
|
|
porjectGroup: null,
|
|
|
+ industry: null,
|
|
|
recordDate: null,
|
|
|
porjectCode: null,
|
|
|
channel: null,
|
|
|
contactDate: null,
|
|
|
projectDate: null,
|
|
|
decisionDate: null,
|
|
|
- industry: null,
|
|
|
- companyName: null,
|
|
|
- companyCode: null,
|
|
|
- startTime: null,
|
|
|
- endTime: null,
|
|
|
- registeredCapital: null,
|
|
|
- registeredAddress: null,
|
|
|
- paidCapital: null,
|
|
|
+ tProjectCompany: {
|
|
|
+ companyName: null,
|
|
|
+ companyCode: null,
|
|
|
+ startTime: null,
|
|
|
+ endTime: null,
|
|
|
+ registeredCapital: null,
|
|
|
+ registeredAddress: null,
|
|
|
+ paidCapital: null,
|
|
|
+ businessAddress: null,
|
|
|
+ actualBod: null,
|
|
|
+ phone: null,
|
|
|
+ type: null,
|
|
|
+ },
|
|
|
+ tProjectContacts: {
|
|
|
+ name: null,
|
|
|
+ position: null,
|
|
|
+ contact: null,
|
|
|
+ },
|
|
|
|
|
|
- name: null,
|
|
|
- position: null,
|
|
|
- contact: null,
|
|
|
-
|
|
|
- businessAddress: null,
|
|
|
- actualBod: null,
|
|
|
description: null,
|
|
|
projectContacts: null,
|
|
|
investHead: null,
|
|
@@ -303,6 +338,7 @@ export default {
|
|
|
createTime: null,
|
|
|
updateBy: null,
|
|
|
updateTime: null,
|
|
|
+ files:null
|
|
|
},
|
|
|
// 表单校验
|
|
|
rules1: {},
|
|
@@ -313,27 +349,37 @@ export default {
|
|
|
porjectGroup: [
|
|
|
{ required: true, trigger: "change", message: "请选择" },
|
|
|
],
|
|
|
- industryGroup: [
|
|
|
- { required: true, trigger: "change", message: "请选择" },
|
|
|
- ],
|
|
|
+ industry: [{ required: true, trigger: "change", message: "请选择" }],
|
|
|
investHead: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
// description: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
- companyName: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
- companyCode: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
- startTime: [{ required: true, trigger: "blur", message: "请选择" }],
|
|
|
- endTime: [{ required: true, trigger: "blur", message: "请选择" }],
|
|
|
- registeredCapital: [
|
|
|
+ "tProjectCompany.companyName": [
|
|
|
+ { required: true, trigger: "blur", message: "请输入" },
|
|
|
+ ],
|
|
|
+ "tProjectCompany.companyCode": [
|
|
|
+ { required: true, trigger: "blur", message: "请输入" },
|
|
|
+ ],
|
|
|
+ "tProjectCompany.startTime": [
|
|
|
+ { required: true, trigger: "blur", message: "请选择" },
|
|
|
+ ],
|
|
|
+ "tProjectCompany.endTime": [
|
|
|
+ { required: true, trigger: "blur", message: "请选择" },
|
|
|
+ ],
|
|
|
+ "tProjectCompany.registeredCapital": [
|
|
|
{ required: true, trigger: "blur", message: "请输入" },
|
|
|
],
|
|
|
- registeredAddress: [
|
|
|
+ "tProjectCompany.registeredAddress": [
|
|
|
{ required: true, trigger: "blur", message: "请输入" },
|
|
|
],
|
|
|
- paidCapital: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
- businessAddress: [
|
|
|
+ "tProjectCompany.paidCapital": [
|
|
|
{ required: true, trigger: "blur", message: "请输入" },
|
|
|
],
|
|
|
- actualBod: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
- phone: [
|
|
|
+ "tProjectCompany.businessAddress": [
|
|
|
+ { required: true, trigger: "blur", message: "请输入" },
|
|
|
+ ],
|
|
|
+ "tProjectCompany.actualBod": [
|
|
|
+ { required: true, trigger: "blur", message: "请输入" },
|
|
|
+ ],
|
|
|
+ "tProjectCompany.phone": [
|
|
|
{ required: true, trigger: "blur", message: "请输入手机号" },
|
|
|
{
|
|
|
pattern: /^1[3456789]\d{9}$/,
|
|
@@ -341,11 +387,19 @@ export default {
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- type: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
- // file: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
- name: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
- position: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
- contact: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
+ "tProjectCompany.type": [
|
|
|
+ { required: true, trigger: "blur", message: "请输入" },
|
|
|
+ ],
|
|
|
+ // files: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
+ "tProjectContacts.name": [
|
|
|
+ { required: true, trigger: "blur", message: "请输入" },
|
|
|
+ ],
|
|
|
+ "tProjectContacts.position": [
|
|
|
+ { required: true, trigger: "blur", message: "请输入" },
|
|
|
+ ],
|
|
|
+ "tProjectContacts.contact": [
|
|
|
+ { required: true, trigger: "blur", message: "请输入" },
|
|
|
+ ],
|
|
|
financingStage: [
|
|
|
{ required: true, trigger: "blur", message: "请输入" },
|
|
|
],
|
|
@@ -368,7 +422,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log("------mounted------");
|
|
|
+ console.log("------mounted------", this.id);
|
|
|
if (this.id) {
|
|
|
this.getPoolDetail(this.id);
|
|
|
} else {
|
|
@@ -379,6 +433,9 @@ export default {
|
|
|
getPoolDetail(id) {
|
|
|
getPool(id).then((response) => {
|
|
|
this.form = response.data;
|
|
|
+ if (this.form.files ) {
|
|
|
+ this.fileList = this.form.files;
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
handleRemove(file, fileList) {
|
|
@@ -390,25 +447,45 @@ export default {
|
|
|
beforeRemove(file, fileList) {
|
|
|
return this.$confirm(`确定移除 ${file.name}?`);
|
|
|
},
|
|
|
+ handleChange(file, fileList) {
|
|
|
+ this.fileList = fileList;
|
|
|
+ },
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
let that = this;
|
|
|
this.$refs["form"].validate((valid, rules) => {
|
|
|
if (valid) {
|
|
|
+ // this.form.tProjectCompany.files = this.fileList;
|
|
|
+ // const formData = new FormData();
|
|
|
+ // Object.keys(that.form).map((key) => {
|
|
|
+ // formData.append(key, that.form[key]);
|
|
|
+ // });
|
|
|
+
|
|
|
+ //使用
|
|
|
+ var r = this.JsonToFormData("", this.form, null);
|
|
|
+ this.fileList.forEach((item) => {
|
|
|
+ //文件信息中raw才是真的文件
|
|
|
+ r.append("files", item.raw);
|
|
|
+ //console.log(item.raw)
|
|
|
+ });
|
|
|
+ //打印转换后的结果
|
|
|
+ for (var [key, value] of r) {
|
|
|
+ console.log("=====", key, value);
|
|
|
+ }
|
|
|
+ // console.log(formData);
|
|
|
if (this.form.id != null) {
|
|
|
- updatePool(this.form).then((response) => {
|
|
|
+ updatePool(r).then((response) => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
+ setTimeout(() => {
|
|
|
+ that.goBack();
|
|
|
+ }, 1500);
|
|
|
});
|
|
|
} else {
|
|
|
- addPool(this.form).then((response) => {
|
|
|
+ addPool(r).then((response) => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
setTimeout(() => {
|
|
|
that.goBack();
|
|
|
}, 1500);
|
|
|
- // this.open = false;
|
|
|
- // this.getList();
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
@@ -438,27 +515,32 @@ export default {
|
|
|
id: null,
|
|
|
porjectName: null,
|
|
|
porjectGroup: null,
|
|
|
+ industry: null,
|
|
|
recordDate: null,
|
|
|
porjectCode: null,
|
|
|
channel: null,
|
|
|
contactDate: null,
|
|
|
projectDate: null,
|
|
|
decisionDate: null,
|
|
|
- industry: null,
|
|
|
- companyName: null,
|
|
|
- companyCode: null,
|
|
|
- startTime: null,
|
|
|
- endTime: null,
|
|
|
- registeredCapital: null,
|
|
|
- registeredAddress: null,
|
|
|
- paidCapital: null,
|
|
|
-
|
|
|
- name: null,
|
|
|
- position: null,
|
|
|
- contact: null,
|
|
|
+ tProjectCompany: {
|
|
|
+ companyName: null,
|
|
|
+ companyCode: null,
|
|
|
+ startTime: null,
|
|
|
+ endTime: null,
|
|
|
+ registeredCapital: null,
|
|
|
+ registeredAddress: null,
|
|
|
+ paidCapital: null,
|
|
|
+ businessAddress: null,
|
|
|
+ actualBod: null,
|
|
|
+ phone: null,
|
|
|
+ type: null,
|
|
|
+ },
|
|
|
+ tProjectContacts: {
|
|
|
+ name: null,
|
|
|
+ position: null,
|
|
|
+ contact: null,
|
|
|
+ },
|
|
|
|
|
|
- businessAddress: null,
|
|
|
- actualBod: null,
|
|
|
description: null,
|
|
|
projectContacts: null,
|
|
|
investHead: null,
|
|
@@ -482,9 +564,51 @@ export default {
|
|
|
createTime: null,
|
|
|
updateBy: null,
|
|
|
updateTime: null,
|
|
|
+ files:null
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
+ /*
|
|
|
+ 复杂json转为FormData
|
|
|
+ parent:key值,data:数据值,form:FormData实例
|
|
|
+ 使用:JsonToFormData("", a, null);
|
|
|
+ */
|
|
|
+ JsonToFormData(parent, data, form) {
|
|
|
+ form = form || new FormData();
|
|
|
+ //循环传入的值转换formData
|
|
|
+ let index = 0;
|
|
|
+ Object.keys(data).forEach((key) => {
|
|
|
+ let val = data[key];
|
|
|
+ // console.log(key, typeof val, val.length);
|
|
|
+ if (val == null) {
|
|
|
+ let pk = parent ? `${parent}[${key}]` : key;
|
|
|
+ form.append(pk, this.NVL(val, ""));
|
|
|
+ } else if (typeof val === "object") {
|
|
|
+ if (val.length == 0) {
|
|
|
+ } else if (val.length >= 1) {
|
|
|
+ //数组
|
|
|
+ let pk = parent ? `${parent}[${index}][${key}]` : key;
|
|
|
+ this.JsonToFormData(pk, val, form);
|
|
|
+ } else {
|
|
|
+ //纯对象
|
|
|
+ let pk = parent ? `${parent}[${key}]` : key;
|
|
|
+ this.JsonToFormData(pk, val, form);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let pk = parent ? `${parent}[${key}]` : key;
|
|
|
+ form.append(pk, this.NVL(val, ""));
|
|
|
+ }
|
|
|
+ index++;
|
|
|
+ });
|
|
|
+ if (parent == "") return form;
|
|
|
+ },
|
|
|
+ NVL(obj, newValue) {
|
|
|
+ return obj === null || obj === undefined
|
|
|
+ ? newValue
|
|
|
+ ? newValue
|
|
|
+ : ""
|
|
|
+ : obj;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|