|
|
@ -2,16 +2,13 @@ |
|
|
|
<div class="d-flex flex-wrap pb-3"> |
|
|
|
<!-- 编辑 --> |
|
|
|
<!-- <div>{{ editData}}</div> --> |
|
|
|
<a-modal |
|
|
|
:mask-closable="false" |
|
|
|
<a-modal |
|
|
|
@cancel="$emit('closeModal')" |
|
|
|
destroy-on-close |
|
|
|
footer |
|
|
|
title="修改企业基本信息" |
|
|
|
v-model="editVisible" |
|
|
|
width="700px" |
|
|
|
:confirm-loading="confirmLoading" |
|
|
|
|
|
|
|
@ok="handleOk" |
|
|
|
> |
|
|
|
<a-form :form="form" v-if="current === 0"> |
|
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="公司名称" required> |
|
|
@ -155,7 +152,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { upload, updateService } from 'config/api'; |
|
|
|
import { upload, updatePlace} from 'config/api'; |
|
|
|
|
|
|
|
const formItemLayout = { |
|
|
|
labelCol: { span: 6 }, |
|
|
@ -179,25 +176,32 @@ export default { |
|
|
|
form: this.$form.createForm(this, { name: 'r-d-member-add' }), |
|
|
|
upload: upload, |
|
|
|
fileList: [], |
|
|
|
//限制文件上传的格式 |
|
|
|
beforeUpload: file => { |
|
|
|
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; |
|
|
|
if (!isJpgOrPng) { |
|
|
|
this.$message.error('仅支持 JPG/PNG 格式的图片!'); |
|
|
|
} |
|
|
|
return isJpgOrPng; |
|
|
|
}, |
|
|
|
recStatusList: ['正常', '禁用'], |
|
|
|
serviceTypeList: ['创新平台', '孵化平台', '产业平台'], |
|
|
|
serviceName: '', |
|
|
|
content: '', |
|
|
|
intro: '', |
|
|
|
orders: '', |
|
|
|
picId: '', |
|
|
|
recStatus: 0, |
|
|
|
serviceType: 0, |
|
|
|
phoneRules: [ |
|
|
|
{ required: true, pattern: new RegExp(/^[1][3,4,5,6,7,8,9][0-9]{9}$/), whitespace: true, message: '请输入正确的手机号' }, |
|
|
|
], |
|
|
|
codeRules: [ |
|
|
|
{ required: true, message: '请输入验证码' }, |
|
|
|
{ min: 4, max: 4, message: '请输入4位短信验证码' }, |
|
|
|
], |
|
|
|
emailRules: [ |
|
|
|
{ |
|
|
|
pattern: new RegExp(/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/), |
|
|
|
whitespace: true, |
|
|
|
message: '请输入正确的邮箱格式', |
|
|
|
}, |
|
|
|
], |
|
|
|
idCardRules: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
pattern: new RegExp(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/), |
|
|
|
whitespace: true, |
|
|
|
message: '请输入身份证号', |
|
|
|
}, |
|
|
|
], |
|
|
|
action: upload, |
|
|
|
platform: {}, |
|
|
|
current: 0, |
|
|
|
confirmLoading: false, |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
@ -208,11 +212,140 @@ export default { |
|
|
|
console.log("wacth") |
|
|
|
console.log(val) |
|
|
|
this.platform = val |
|
|
|
this.platform.buildTime = 0 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
beforeUpload(file) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
const isLt5M = file.size / 1024 / 1024 < 5; |
|
|
|
if (!isLt5M) { |
|
|
|
this.$message.warning('上传附件大小不能超过5m!'); |
|
|
|
return reject(false); |
|
|
|
} |
|
|
|
return resolve(true); |
|
|
|
}); |
|
|
|
}, |
|
|
|
fileChange(info) { |
|
|
|
this.fileList = info.fileList; |
|
|
|
}, |
|
|
|
// 验证电话 |
|
|
|
changePhone(e) { |
|
|
|
this.platform.tel = e.target.value; |
|
|
|
this.platform.isTel = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.platform.tel); |
|
|
|
}, |
|
|
|
// 验证电子邮箱 |
|
|
|
changeEamil(e) { |
|
|
|
this.platform.email = e.target.value; |
|
|
|
this.platform.isEmail = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(this.platform.email); |
|
|
|
}, |
|
|
|
// 验证身份证号 |
|
|
|
changeIdCard(e) { |
|
|
|
this.platform.idCard = e.target.value; |
|
|
|
this.platform.isIdCard = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(this.platform.idCard); |
|
|
|
}, |
|
|
|
// 成立时间 |
|
|
|
changeBirthday(date, dateString) { |
|
|
|
this.platform.buildTime = this.$moment(date).unix() * 1000; |
|
|
|
}, |
|
|
|
// 点击确定 |
|
|
|
handleOk() { |
|
|
|
if (this.current !== 2) { |
|
|
|
this.current++; |
|
|
|
} else { |
|
|
|
if (this.platform.company === '') { |
|
|
|
this.$message.error('请输入公司名称'); |
|
|
|
} else if (this.platform.buildTime === 0) { |
|
|
|
this.$message.error('请选择成立时间'); |
|
|
|
} else if (this.platform.legalPerson === '') { |
|
|
|
this.$message.error('请输入法人代码'); |
|
|
|
} else if (this.platform.registerSite === '') { |
|
|
|
this.$message.error('请输入现注册地址'); |
|
|
|
} else if (this.platform.manName === '') { |
|
|
|
this.$message.error('请输入姓名'); |
|
|
|
} else if (this.platform.position === '') { |
|
|
|
this.$message.error('请输入职务'); |
|
|
|
} else if (this.platform.isTel === false) { |
|
|
|
this.$message.error('请输入联系电话'); |
|
|
|
} else if(this.platform.email === ''){ |
|
|
|
this.$message.error('请输入邮箱'); |
|
|
|
} else if(this.platform.sex === undefined){ |
|
|
|
this.$message.error('请输入申请人性别'); |
|
|
|
} else if (this.platform.idCard === '') { |
|
|
|
this.$message.error('请输入身份证号'); |
|
|
|
} else { |
|
|
|
for (var i = 0; i < this.fileList.length; i++) { |
|
|
|
this.platform.files = this.platform.files.concat(this.fileList[i].response.data[0].id); |
|
|
|
} |
|
|
|
this.updateSettled(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async updateSettled() { |
|
|
|
this.confirmLoading = true; |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
param: { |
|
|
|
id: this.editData.id, |
|
|
|
buildTime: this.platform.buildTime, |
|
|
|
businessIncome: this.platform.businessIncome, |
|
|
|
company: this.platform.company, |
|
|
|
electricDesign: this.platform.electricDesign, |
|
|
|
email: this.platform.email, |
|
|
|
fileList: this.platform.files, |
|
|
|
friendCompany: this.platform.friendCompany, |
|
|
|
gender: this.platform.sex, |
|
|
|
idCard: this.platform.idCard, |
|
|
|
juniorCollege: this.platform.juniorCollege, |
|
|
|
legalPerson: this.platform.legalPerson, |
|
|
|
mainBusiness: this.platform.mainBusiness, |
|
|
|
name: this.platform.manName, |
|
|
|
patentApply: this.platform.patentApply, |
|
|
|
patentGrented: this.platform.patentGrented, |
|
|
|
patentInvent: this.platform.patentInvent, |
|
|
|
phone: this.platform.tel, |
|
|
|
placeType: this.placeType, // store里面的 0:虚拟,1:实体 |
|
|
|
plantKind: this.platform.plantKind, |
|
|
|
position: this.platform.position, |
|
|
|
productTech: this.platform.productTech, |
|
|
|
registerMoney: this.platform.registerMoney, |
|
|
|
registerSite: this.platform.registerSite, |
|
|
|
resarchStaff: this.platform.resarchStaff, |
|
|
|
softwareRegister: this.platform.softwareRegister, |
|
|
|
staffCount: this.platform.staffCount, |
|
|
|
}, |
|
|
|
}; |
|
|
|
console.log(params); |
|
|
|
const res = await updatePlace(params); |
|
|
|
// console.log(res); |
|
|
|
const { code, msg, data } = res.data; |
|
|
|
if (code === 200) { |
|
|
|
this.$emit('getData'); |
|
|
|
this.$emit('closeModal'); |
|
|
|
this.$message.success('修改成功'); |
|
|
|
this.confirmLoading = false; |
|
|
|
|
|
|
|
} else { |
|
|
|
throw msg; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
// console.log('失败2'); |
|
|
|
this.$message.error(error); |
|
|
|
this.confirmLoading = false; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}; |
|
|
|