Commit 19bfe2ae authored by Marcus's avatar Marcus

全部客户新增编辑弹窗

parent 69ddd604
......@@ -34,6 +34,15 @@ export function getNode(id) {
})
}
// 获得服务网点分页
export function getNodeList(query) {
return request({
url: '/ecw/node/list',
method: 'get',
params: query
})
}
// 获得服务网点分页
export function getNodePage(query) {
return request({
......
......@@ -70,7 +70,7 @@
</el-table-column>
<el-table-column label="国家" align="center" prop="country">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.country" />
<dict-tag :type="DICT_TYPE.COUNTRY" :value="scope.row.country" />
</template>
</el-table-column>
<el-table-column label="跟进客服" align="center" prop="customerService">
......@@ -103,7 +103,7 @@
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
<el-dialog :title="title" :visible.sync="open" width="90%" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row :gutter="10">
<el-col :span="12">
......@@ -127,14 +127,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属代理" prop="agentId">
<el-select v-model="form.agentId" placeholder="请选择所属代理">
<el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系地址" prop="address">
<el-input v-model="form.address" placeholder="请输入联系地址" />
......@@ -148,10 +140,19 @@
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="所属代理" prop="agentId">-->
<!-- <el-select v-model="form.agentId" placeholder="请选择所属代理">-->
<!-- <el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"-->
<!-- :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="常用提货网点" prop="pickupPoint">
<el-select v-model="form.pickupPoint" placeholder="请输入常用提货网点">
<el-option label="请选择字典生成" value="" />
<el-option v-for="node in nodeList"
:key="node.value" :label="node.label" :value="node.value" />
</el-select>
</el-form-item>
</el-col>
......@@ -164,21 +165,31 @@
<el-col :span="12">
<el-form-item label="客户生日" prop="birthday">
<el-input v-model="form.birthday" placeholder="请输入客户生日" />
<el-date-picker
v-model="form.birthday"
type="date"
value-format="timestamp"
placeholder="请输入客户生日">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品类型" prop="productType">
<el-select v-model="form.productType" placeholder="请选择产品类型">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="产品id" prop="productId">
<el-input v-model="form.productId" placeholder="请输入产品id" />
<el-form-item label="主营类别" prop="productType">
<el-row :gutter="10">
<el-col :span="11">
<el-select v-model="form.productType" placeholder="请选择产品类别">
<!-- <el-option label="请选择字典生成" value="" />-->
</el-select>
</el-col>
<el-col :span="11">
<el-select v-model="form.productType" placeholder="请选择主营类别">
<!-- <el-option label="请选择字典生成" value="" />-->
</el-select>
</el-col>
</el-row>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户来源" prop="source">
<el-select v-model="form.source" placeholder="请选择客户来源">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
......@@ -187,7 +198,6 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结算方式" prop="balance">
<el-select v-model="form.balance" placeholder="请选择结算方式">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
......@@ -196,7 +206,6 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="跟进客服" prop="customerService">
<el-select v-model="form.customerService" placeholder="请选择跟进客服">
<el-option v-for="dict in getDictDatas(DICT_TYPE.COMMON_STATUS)"
......@@ -205,9 +214,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="图片" prop="picture">
<el-input v-model="form.picture" placeholder="请输入图片" />
<upload v-model="form.picture" :limit="1"></upload>
</el-form-item>
</el-col>
......@@ -231,7 +239,12 @@
</el-col>
<el-col :span="12">
<el-form-item label="创建时间" prop="founder">
<el-input v-model="form.founder" placeholder="请输入创建人" />
<el-date-picker
v-model="form.createTime"
type="datetime"
value-format="timestamp"
placeholder="选择创建时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -249,16 +262,27 @@
<el-input v-model="form.weightUnit" placeholder="请输入重货标准(CBM)" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="指定线路" prop="line">
<el-switch v-model="showLine"></el-switch>
<el-table
v-show="showLine"
border
:data="form.customerLines"
style="width: 500px">
<el-table-column
prop="departureId"
label="始发地">
</el-table-column>
<el-table-column
prop="objectiveId"
label="目的地">
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="关联会员账号" prop="memberId">
<el-input v-model="form.memberId" placeholder="请输入关联会员账号" />
</el-form-item>
<el-form-item label="部门" prop="department">
<el-input v-model="form.department" placeholder="请输入部门" />
</el-form-item>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>联系人</span>
......@@ -290,6 +314,9 @@
prop="name"
label="联系人"
>
<template v-slot:header>
联系人 <span style="color: #ff0000">*</span>
</template>
<template v-slot="{row}">
<el-input v-model="row.name" placeholder="请输入联系人" size="mini"/>
</template>
......@@ -298,6 +325,9 @@
prop="areaCode"
label="区号"
>
<template v-slot:header>
区号 <span style="color: #ff0000">*</span>
</template>
<template v-slot="{row}">
<el-select v-model="row.areaCode" placeholder="请选择区号">
<el-option v-for="dict in getDictDatas(DICT_TYPE.AREA_CODE)"
......@@ -309,6 +339,9 @@
prop="phoneNew"
label="联系方式"
>
<template v-slot:header>
联系方式 <span style="color: #ff0000">*</span>
</template>
<template v-slot="{row}">
<el-input v-model="row.phoneNew" placeholder="请输入联系方式" size="mini"/>
</template>
......@@ -367,30 +400,48 @@
</el-table>
</el-card>
<el-form-item label="发票抬头" prop="invoiceTitle">
<el-input v-model="form.invoiceTitle" placeholder="请输入发票抬头" />
</el-form-item>
<el-form-item label="纳税人识别号" prop="licenseNumber">
<el-input v-model="form.licenseNumber" placeholder="请输入纳税人识别号" />
</el-form-item>
<el-form-item label="开户行" prop="bank">
<el-input v-model="form.bank" placeholder="请输入开户行" />
</el-form-item>
<el-form-item label="账户" prop="bankNumber">
<el-input v-model="form.bankNumber" placeholder="请输入账户" />
</el-form-item>
<el-form-item label="项目" prop="project">
<el-input v-model="form.project" placeholder="请输入项目" />
</el-form-item>
<el-form-item label="开票地址" prop="billingAddress">
<el-input v-model="form.billingAddress" placeholder="请输入开票地址" />
</el-form-item>
<el-form-item label="开票电话" prop="billingTell">
<el-input v-model="form.billingTell" placeholder="请输入开票电话" />
</el-form-item>
<el-form-item label="税率" prop="taxRate">
<el-input v-model="form.taxRate" placeholder="请输入税率" />
</el-form-item>
<el-row :gutter="10" style="margin-top: 15px">
<el-col :span="12">
<el-form-item label="发票抬头" prop="invoiceTitle">
<el-input v-model="form.invoiceTitle" placeholder="请输入发票抬头" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="纳税人识别号" prop="licenseNumber">
<el-input v-model="form.licenseNumber" placeholder="请输入纳税人识别号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开户行" prop="bank">
<el-input v-model="form.bank" placeholder="请输入开户行" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="账户" prop="bankNumber">
<el-input v-model="form.bankNumber" placeholder="请输入账户" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目" prop="project">
<el-input v-model="form.project" placeholder="请输入项目" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开票地址" prop="billingAddress">
<el-input v-model="form.billingAddress" placeholder="请输入开票地址" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开票电话" prop="billingTell">
<el-input v-model="form.billingTell" placeholder="请输入开票电话" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="税率" prop="taxRate">
<el-input v-model="form.taxRate" placeholder="请输入税率" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
......@@ -407,10 +458,13 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants'
import { uploadFile } from "@/api/infra/file";
import upload from '@/components/ImageUpload'
import {getNodeList} from "@/api/ecw/node"
export default {
name: "Customer",
components: {
upload
},
data() {
return {
......@@ -448,12 +502,25 @@ export default {
// 表单校验
rules: {
name: [{ required: true, message: "客户名称不能为空", trigger: "blur" }],
weightUnit: [{ required: true, message: "重货标准(CBM)不能为空", trigger: "blur" }],
}
country: [{ required: true, message: "国家不能为空", trigger: "blur" }],
level: [{ required: true, message: "客户等级不能为空", trigger: "blur" }],
type: [{ required: true, message: "客户类别不能为空", trigger: "blur" }],
// createTime: [{ required: true, message: "创建时间不能为空", trigger: "blur" }],
source: [{ required: true, message: "客户来源不能为空", trigger: "blur" }],
customerService: [{ required: true, message: "跟进客服不能为空", trigger: "blur" }],
status: [{ required: true, message: "客户状态不能为空", trigger: "blur" }],
founder: [{ required: true, message: "创建人不能为空", trigger: "blur" }],
},
// 网点
nodeList: [],
showLine: false
};
},
created() {
this.getList();
// getNodeList().then(r => {
// this.nodeList = r.data
// })
},
methods: {
/** 查询列表 */
......@@ -496,6 +563,7 @@ export default {
picture: undefined,
customerService: undefined,
customerContacts: [],
customerLines: [],
promoter: undefined,
status: undefined,
founder: undefined,
......@@ -545,7 +613,7 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
// return;
}
// 修改的提交
if (this.form.id != null) {
......
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