Browse Source

修改样式

master
rose 4 years ago
parent
commit
89b2620d47
  1. 8
      src/components/EntityApply/EntityApplyDate.vue
  2. 179
      src/components/EntityApply/EntityApplyEdit.vue
  3. 3
      src/config/api.js

8
src/components/EntityApply/EntityApplyDate.vue

@ -67,6 +67,7 @@
:editData="editData"
:editVisible="editVisible"
@closeModal="closeModal"
@getData="getData"
/>
</div>
@ -143,7 +144,7 @@ export default {
loading: false,
height: '',
editable: false,
editData: '',
editData: {},
editVisible: false,
};
},
@ -162,6 +163,11 @@ export default {
methods: {
getData() {
this.$emit('entityApplicationSearch');
},
//
async deleteEditModal(id) {

179
src/components/EntityApply/EntityApplyEdit.vue

@ -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;
}
},
},
};

3
src/config/api.js

@ -196,6 +196,9 @@ export const deleteCompany = params => axios.post(`${place}/delete`, params);
// 入驻企业删除
export const changeStatus = params => axios.post(`${place}/status`, params);
// 入驻企业修改
export const updatePlace = params => axios.post(`${place}/update`, params);
// 入驻企业申请(管理员用)
export const handleApplyBackend = params => axios.post(`${place}/applyBackend`, params);

Loading…
Cancel
Save