Commit e05695b9 authored by 黄卓's avatar 黄卓

联系人表格

parent ce828799
...@@ -82,7 +82,10 @@ export const DICT_TYPE = { ...@@ -82,7 +82,10 @@ export const DICT_TYPE = {
BRAND_REG_TYPE: 'brand_registry_type', BRAND_REG_TYPE: 'brand_registry_type',
BRAND_AUTH_STATUS: 'brand_authorization_status', BRAND_AUTH_STATUS: 'brand_authorization_status',
BRAND_CUSTOMER_CHARGING_MODEL: 'customer_charging_model', BRAND_CUSTOMER_CHARGING_MODEL: 'customer_charging_model',
COUNTRY: 'country', COUNTRY: 'country', // 国家地区
AREA_CODE: 'area_code', // 区号
SOCIAL: 'customer_social_tools', // 社交软件
IS_DEFAULT: 'is_default', // 默认联系人
} }
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
@pagination="getList"/> @pagination="getList"/>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="150px"> <el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>联系人</span> <span>联系人</span>
<el-button style="float: right;" size="small" type="primary">+</el-button> <el-button style="float: right;" size="small" type="primary" @click="form.customerContacts.push({department: undefined})">+</el-button>
</div> </div>
<el-table <el-table
:data="form.customerContacts" :data="form.customerContacts"
...@@ -273,27 +273,45 @@ ...@@ -273,27 +273,45 @@
label="部门" label="部门"
width="" width=""
> >
<template v-slot="{ row, column, $index }">
<el-input v-model="row.department" placeholder="请输入部门" size="mini"/>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="position" prop="position"
label="职位" label="职位"
width="" width=""
> >
<template v-slot="{row}">
<el-input v-model="row.position" placeholder="请输入职位" size="mini"/>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="name"
label="联系人" label="联系人"
> >
<template v-slot="{row}">
<el-input v-model="row.name" placeholder="请输入联系人" size="mini"/>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="areaCode" prop="areaCode"
label="区号" label="区号"
> >
<template v-slot="{row}">
<el-select v-model="row.areaCode" placeholder="请选择区号">
<el-option v-for="dict in getDictDatas(DICT_TYPE.AREA_CODE)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="" prop="phoneNew"
label="联系方式" label="联系方式"
> >
<template v-slot="{row}">
<el-input v-model="row.phoneNew" placeholder="请输入联系方式" size="mini"/>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="" prop=""
...@@ -304,26 +322,47 @@ ...@@ -304,26 +322,47 @@
prop="social" prop="social"
label="社交软件" label="社交软件"
> >
<template v-slot="{row}">
<el-select v-model="row.social" placeholder="请选择社交软件">
<el-option v-for="dict in getDictDatas(DICT_TYPE.SOCIAL)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="socialNumber" prop="socialNumber"
label="社交软件号码" label="社交软件号码"
> >
<template v-slot="{row}">
<el-input v-model="row.socialNumber" placeholder="请输入社交软件号码" size="mini"/>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="email" prop="email"
label="邮箱" label="邮箱"
> >
<template v-slot="{row}">
<el-input v-model="row.email" placeholder="请输入邮箱" size="mini"/>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="isDefault" prop="isDefault"
label="设为默认" label="设为默认"
> >
<template v-slot="{row}">
<el-select v-model="row.isDefault" placeholder="设为默认">
<el-option v-for="dict in getDictDatas(DICT_TYPE.IS_DEFAULT)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.isDefault)" />
</el-select>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="name"
label="操作" label="操作"
> >
<template v-slot="{ row, column, $index }">
<el-button type="danger" @click="form.customerContacts.splice($index, 1)">删除</el-button>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
...@@ -405,9 +444,7 @@ export default { ...@@ -405,9 +444,7 @@ export default {
department: null, department: null,
}, },
// 表单参数 // 表单参数
form: { form: {},
customerContacts: []
},
// 表单校验 // 表单校验
rules: { rules: {
name: [{ required: true, message: "客户名称不能为空", trigger: "blur" }], name: [{ required: true, message: "客户名称不能为空", trigger: "blur" }],
...@@ -458,6 +495,7 @@ export default { ...@@ -458,6 +495,7 @@ export default {
source: undefined, source: undefined,
picture: undefined, picture: undefined,
customerService: undefined, customerService: undefined,
customerContacts: [],
promoter: undefined, promoter: undefined,
status: undefined, status: undefined,
founder: undefined, founder: undefined,
...@@ -498,7 +536,7 @@ export default { ...@@ -498,7 +536,7 @@ export default {
this.reset(); this.reset();
const id = row.id; const id = row.id;
getCustomer(id).then(response => { getCustomer(id).then(response => {
this.form = response.data; this.form = { ...this.form, ...response.data };
this.open = true; this.open = true;
this.title = "修改客户"; this.title = "修改客户";
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment