Browse Source

增加修改按钮

master
rose 4 years ago
parent
commit
a1fbeb79d9
  1. 10
      src/components/EntityApply/Detail.vue
  2. 22
      src/components/EntityApply/EntityApplyAdd.vue
  3. 32
      src/components/EntityApply/EntityApplyDate.vue
  4. 355
      src/components/EntityApply/EntityApplyEdit.vue
  5. 3
      src/config/api.js

10
src/components/EntityApply/Detail.vue

@ -1,9 +1,10 @@
<template> <template>
<div style="width:100%" v-if="record"> <div style="width:100%" v-if="record">
<div class="d-flex flex-nowrap mb-3"> <div class="d-flex flex-nowrap mb-3">
<div class="flex-1"> <div class="flex-1">
<span class="font-bold-14">成立时间</span> <span class="font-bold-14">成立时间</span>
{{ record.buildTime }} {{ $moment(+record.buildTime).format('YYYY-MM-DD') }}
</div> </div>
<div class="flex-1"> <div class="flex-1">
<span class="font-bold-14">营业收入</span> <span class="font-bold-14">营业收入</span>
@ -133,7 +134,12 @@ export default {
return {}; return {};
}, },
methods: {}, methods: {
test(){
console.log(this.record.buildTime)
}
},
}; };
</script> </script>

22
src/components/EntityApply/EntityApplyAdd.vue

@ -123,9 +123,9 @@
<!-- 电子邮箱 --> <!-- 电子邮箱 -->
<a-input @change="changeEamil" placeholder="请输入电子邮箱..." type="email" v-decorator="['email', { rules: emailRules }]" /> <a-input @change="changeEamil" placeholder="请输入电子邮箱..." type="email" v-decorator="['email', { rules: emailRules }]" />
</a-form-item> </a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="身份证号" required> <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="身份证号">
<!-- 身份证号 --> <!-- 身份证号 -->
<a-input @change="changeIdCard" placeholder="请输入身份证号..." v-decorator="['idCard', { rules: idCardRules }]" /> <a-input @change="changeIdCard" placeholder="请输入身份证号..." v-decorator="['idCard']" />
</a-form-item> </a-form-item>
</a-form> </a-form>
<a-steps :current="current"> <a-steps :current="current">
@ -219,14 +219,14 @@ export default {
message: '请输入正确的邮箱格式', message: '请输入正确的邮箱格式',
}, },
], ],
idCardRules: [ // idCardRules: [
{ // {
required: true, // required: true,
pattern: new RegExp(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/), // pattern: new RegExp(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/),
whitespace: true, // whitespace: true,
message: '请输入身份证号', // message: '',
}, // },
], // ],
codeNum: '', codeNum: '',
showInterval: false, showInterval: false,
codeTimer: null, codeTimer: null,
@ -342,8 +342,6 @@ export default {
this.$message.error('请输入职务'); this.$message.error('请输入职务');
} else if (this.platform.isTel === false) { } else if (this.platform.isTel === false) {
this.$message.error('请输入联系电话'); this.$message.error('请输入联系电话');
} else if (this.platform.idCard === '') {
this.$message.error('请输入身份证号');
} else { } else {
for (var i = 0; i < this.fileList.length; i++) { for (var i = 0; i < this.fileList.length; i++) {
this.platform.files = this.platform.files.concat(this.fileList[i].response.data[0].id); this.platform.files = this.platform.files.concat(this.fileList[i].response.data[0].id);

32
src/components/EntityApply/EntityApplyDate.vue

@ -40,6 +40,7 @@
<!-- 操作 --> <!-- 操作 -->
<template slot="edit" slot-scope="text, record"> <template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<!-- <a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" /> --> <!-- <a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" /> -->
<a-button @click="handleApply(record.id, 2)" class="ml-3" size="small" type="primary" v-if="record.dealStatus === 1"> <a-button @click="handleApply(record.id, 2)" class="ml-3" size="small" type="primary" v-if="record.dealStatus === 1">
通过 通过
@ -58,12 +59,22 @@
</a-table> </a-table>
</div> </div>
<a-empty v-else /> <a-empty v-else />
<!-- 编辑 -->
<!-- EntityApplyEdit -->
<entity-apply-edit
:edit-data="editData"
:edit-visible="editVisible"
@closeModal="closeModal"
@getData="getData"
/>
</div> </div>
</template> </template>
<script> <script>
import EditableCellSelect from 'components/EditableCellSelect/EditableCellSelect.vue'; import EditableCellSelect from 'components/EditableCellSelect/EditableCellSelect.vue';
import Detail from 'components/EntityApply/Detail.vue'; import Detail from 'components/EntityApply/Detail.vue';
import EntityApplyEdit from 'components/EntityApply/EntityApplyEdit.vue';
import { changeStatus, deletePlace } from 'config/api'; import { changeStatus, deletePlace } from 'config/api';
const columns = [ const columns = [
@ -120,6 +131,7 @@ export default {
components: { components: {
EditableCellSelect, EditableCellSelect,
Detail, Detail,
EntityApplyEdit
}, },
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } }, props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
@ -130,6 +142,8 @@ export default {
loading: false, loading: false,
height: '', height: '',
editable: false, editable: false,
editData: {},
editVisible: false,
}; };
}, },
@ -146,9 +160,27 @@ export default {
}, },
methods: { methods: {
showEditModal(data) { showEditModal(data) {
console.log(data); console.log(data);
this.editData = data;
this.editVisible = true;
}, },
closeModal() {
this.editVisible = false;
},
getData() {
this.$emit('entityApplicationSearch');
},
// showEditModal(data) {
// console.log(data);
// },
handleTableChange(pagination) { handleTableChange(pagination) {
const { current, pageSize } = pagination; const { current, pageSize } = pagination;
const condition = { current, pageSize }; const condition = { current, pageSize };

355
src/components/EntityApply/EntityApplyEdit.vue

@ -0,0 +1,355 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 编辑 -->
<!-- <div>{{ editData}}</div> -->
<a-modal
@cancel="$emit('closeModal')"
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>
<a-input placeholder="请输入公司名称..." v-model.trim="platform.company" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="成立时间" required>
<!-- 时间选择器时间点 -->
<!-- <div>{{ platform.buildTime}}</div> -->
<a-date-picker :default-value="$moment(+platform.buildTime).format('YYYY-MM-DD HH:mm:ss')" @change="changeBirthday" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="法人代码" required>
<a-input placeholder="请输入法人代码..." v-model.trim="platform.legalPerson" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="现注册地址" required>
<a-input placeholder="请输入现注册地址..." v-model.trim="platform.registerSite" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="注册资金(单位:万)">
<a-input placeholder="请输入注册资金..." type="number" v-model.trim="platform.registerMoney" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="员工人数">
<a-input placeholder="请输入员工人数..." type="number" v-model.trim="platform.staffCount" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="其中研发人数">
<a-input placeholder="请输入研发人数..." type="number" v-model.trim="platform.resarchStaff" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="大专以上人员">
<a-input placeholder="请输入员工人数..." type="number" v-model.trim="platform.juniorCollege" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="主营业务">
<a-input placeholder="请输入主营业务..." v-model.trim="platform.mainBusiness" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="营业收入(单位:万)">
<a-input placeholder="请输入营业收入..." type="number" v-model.trim="platform.businessIncome" />
</a-form-item>
</a-form>
<a-form :form="form" v-if="current === 1">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="产品/技术阶段" required>
<!-- 单选 -->
<a-radio-group v-model="platform.productTech">
<a-radio :value="0" style="margin-right: 20px">创意阶段</a-radio>
<a-radio :value="1" style="margin-right: 20px">研发阶段</a-radio>
<a-radio :value="2" style="margin-right: 20px">转化阶段</a-radio>
<a-radio :value="3" style="margin-right: 20px">原型样品</a-radio>
<a-radio :value="4">产业化开发</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="申请专利数">
<a-input placeholder="请输入申请专利数..." type="number" v-model.trim="platform.patentApply" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="授权专利数">
<a-input placeholder="请输入授权专利数..." type="number" v-model.trim="platform.patentGrented" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="发明专利数">
<a-input placeholder="请输入发明专利数..." type="number" v-model.trim="platform.patentInvent" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="软件著作权">
<a-input placeholder="请输入软件著作权..." v-model.trim="platform.softwareRegister" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="动植物新品种">
<a-input placeholder="请输入动植物新品种..." v-model.trim="platform.plantKind" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="集成电路布图设计">
<a-input placeholder="请输入集成电路布图设计..." v-model.trim="platform.electricDesign" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="合作单位">
<a-input placeholder="请输入合作单位..." v-model.trim="platform.friendCompany" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="上传附件">
<a-upload
:action="action"
:before-upload="beforeUpload"
:default-file-list="fileList"
@change="fileChange"
list-type="picture"
name="files"
>
<p>1.营业执照复印件尚无注册的无需梯控</p>
<p>2.法定代表或授权代表身份证复印件</p>
<p>3.主导产品或技术简介</p>
<a-button> <a-icon type="upload" />点击上传附件 </a-button>
</a-upload>
</a-form-item>
</a-form>
<a-form :form="form" v-if="current === 2">
<!-- <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="公司名称">
<a-input v-model.trim="platform.companyName" placeholder="请输入公司名称..." />
</a-form-item>-->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="姓名" required>
<a-input placeholder="请输入申请人姓名..." v-model.trim="platform.manName" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="性别" required>
<!-- 单选 -->
<a-radio-group v-model="platform.sex">
<a-radio :value="1" style="margin-right: 100px"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="职务" required>
<a-input placeholder="请输入申请人职务..." v-model.trim="platform.position" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="联系电话" required>
<a-input @change="changePhone" placeholder="请输入联系电话.." type="tel" v-decorator="['tel', { rules: phoneRules }]" />
</a-form-item>
<!-- <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片验证码" required>
<div class="d-flex flex-nowrap">
<a-input placeholder="图片验证码" type="number" v-model="codeNum" />
<img :src="picCode.imageBase64" @click="changePicCode" class="code_img ml-2" v-if="picCode && picCode.imageBase64" />
<a-button @click="changePicCode" class="code_img ml-2" size="small" v-else>获取验证码</a-button>
</div>
</a-form-item> -->
<!-- <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="短信验证码" required>
<div class="d-flex flex-nowrap">
<a-input placeholder="请输入验证码" type="number" v-model="platform.code" />
<a-button class="code_img ml-2" disabled type="primary" v-if="showInterval">重新发送 {{ interval }}</a-button>
<a-button :disabled="platform.isTel === false" @click="getCode" class="code_img ml-2" type="primary" v-else
>获取验证码</a-button
>
</div>
</a-form-item> -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="电子邮箱">
<!-- 电子邮箱 -->
<a-input @change="changeEamil" placeholder="请输入电子邮箱..." type="email" v-decorator="['email', { rules: emailRules }]" />
</a-form-item>
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="身份证号">
<!-- 身份证号 -->
<a-input @change="changeIdCard" placeholder="请输入身份证号..." v-decorator="['idCard']" />
</a-form-item>
</a-form>
<a-steps :current="current">
<a-step @click="current = 0" style="cursor: pointer">
<template slot="title">
<span v-if="current === 0">Waiting...</span>
<span v-else>完成</span>
</template>
<span slot="description">企业基本信息</span>
</a-step>
<a-step :title="current > 1 ? '完成' : 'Waiting...'" @click="current = 1" description="企业详细信息" style="cursor: pointer" />
<a-step :title="current > 2 ? '完成' : 'Waiting...'" @click="current = 2" description="申请人基本信息" style="cursor: pointer" />
</a-steps>
</a-modal>
</div>
</template>
<script>
import { upload, updatePlace} from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: 'EntityApplyEdit',
props: {
editVisible: { type: Boolean, default: false },
editData: { type: Object, default: () => {} },
contents: { type: String, default: '' },
showFile: { type: Boolean, default: true },
},
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-member-add' }),
upload: upload,
fileList: [],
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,
};
},
watch: {
editData(val) {
console.log("wacth")
console.log(val)
this.platform = val
if( this.platform.buildTime === null){
this.platform.buildTime = 0
}
console.log("========>",this.platform)
},
},
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 {
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;
}
},
},
};
</script>
<style scoped lang="stylus"></style>

3
src/config/api.js

@ -197,6 +197,9 @@ export const entityApplicationSearch = params => axios.post(`${place}/search`, p
// 入驻企业申请的处理状态 // 入驻企业申请的处理状态
export const changeStatus = params => axios.post(`${place}/status`, params); export const changeStatus = params => axios.post(`${place}/status`, params);
// 入驻企业修改
export const updatePlace = params => axios.post(`${place}/update`, params);
// 入驻企业申请的删除 // 入驻企业申请的删除
export const deletePlace = params => axios.post(`${place}/delete`, params); export const deletePlace = params => axios.post(`${place}/delete`, params);

Loading…
Cancel
Save