Commit c0474454 authored by yujinyao's avatar yujinyao

客户列表搜索

parent 715aee08
......@@ -167,6 +167,7 @@ export const DICT_TYPE = {
CUSTOMER_FOLLOWUP_METHOD: 'customer_followup_method', //跟进方式
CUSTOMER_FOLLOWUP_RESULT_TYPE: 'customer_followup_result_type', //跟进结果
CUSTOMER_FOLLOWUP_STATUS: 'customer_followup_status', //跟进状态
CUSTOMER_QUERY_NUMBER_FIELD: "customer_query_number_field", //客户查询数字字段
// order
ORDER_TYPE: "order_type", // 订单类型
PRODUCT_RECORD_ATTRIBUTE: "product_record_attribute", //产品备案属性
......
......@@ -5,7 +5,6 @@
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="130px"
>
<el-form-item :label="$t('客户编号')" prop="number">
......@@ -14,7 +13,6 @@
:placeholder="$t('请输入客户编号')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<el-form-item :label="$t('客户名称')" prop="name">
......@@ -23,9 +21,9 @@
:placeholder="$t('请输入客户名称')"
clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
/>
</el-form-item>
<!--
<el-form-item :label="$t('客户等级')" prop="level">
<el-select
multiple
......@@ -43,6 +41,25 @@
/>
</el-select>
</el-form-item>
-->
<el-form-item :label="$t('区号')">
<el-select
v-model="queryParams.areaCode"
:placeholder="$t('请选择区号')"
>
<el-option
v-for="(item, index) in countryList"
:key="index"
:label="
item.nameShort +
(isChinese ? item.nameZh : item.nameEn) +
' +' +
item.tel
"
:value="item.tel"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('联系方式')">
<el-input
:placeholder="$t('请输入联系方式')"
......@@ -59,6 +76,11 @@
@change="handleQuery"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('部门')" v-if="path != '/customer/department-customers'">
<el-select v-model="queryParams.deptIds" :placeholder="$t('请选择部门')">
<el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select
multiple
......@@ -93,12 +115,12 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('国')" prop="source">
<el-form-item :label="$t('国')" prop="source">
<el-select
multiple
clearable
v-model="queryParams.country"
:placeholder="$t('请选择国家')"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
......@@ -126,7 +148,18 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')">
<el-form-item :label="$t('创建人')" v-show="showSearch">
<el-select v-model="queryParams.founder">
<el-option
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
......@@ -138,6 +171,7 @@
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<!--
<el-form-item :label="$t('信用等级')" prop="department">
<el-select multiple clearable v-model="queryParams.creditLevel">
<el-option
......@@ -189,7 +223,55 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('入公海时间')">
-->
<el-form-item :label="$t('角色')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.CUSTOMER_ROLE"
v-model="queryParams.role"
formatter="number"
@change="handleQuery"
:placeholder="$t('请选择')"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('出货渠道')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE"
v-model="queryParams.transportType"
formatter="number"
@change="handleQuery"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('业务国家')" v-show="showSearch">
<el-select
multiple
clearable
v-model="queryParams.busiCountryIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('常用提货网点')" v-show="showSearch">
<el-select multiple v-model="queryParams.pickupPoints">
<el-option
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('入公海时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
......@@ -201,13 +283,94 @@
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('业绩类型')">
<el-form-item :label="$t('业绩类型')" v-show="showSearch">
<el-select clearable v-model="queryParams.isNew">
<el-option :value="true">{{ $t('新客户') }}</el-option>
<el-option :value="false">{{ $t('老客户') }}</el-option>
<el-option :label="$t('新客户')" :value="true" />
<el-option :label="$t('老客户')" :value="false" />
</el-select>
</el-form-item>
<el-form-item :label="$t('推介人')">
<el-form-item :label="$t('年度发货量')" v-show="showSearch">
<el-input
v-model.trim="weightYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="weightYearly.key"
class="w-50"
/>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('商品类别')" v-show="showSearch">
<el-select
@change="handleSelectProductType"
multiple
v-model="queryParams.productTypes"
:placeholder="$t('请选择产品类别')"
>
<el-option
:label="item.titleZh"
:value="item.id"
v-for="item in productTypeList"
:key="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('商品名称')" v-show="showSearch">
<el-select
multiple
filterable
clearable
v-model="queryParams.productIds"
:placeholder="$t('请选择商品名称')"
>
<el-option
:label="item.titleZh"
:value="parseInt(item.id)"
v-for="item in productList"
:key="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('主要竞争对手')" v-show="showSearch">
<el-select
clearable
multiple
v-model="queryParams.competitorIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="item in competitorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货次数')" v-show="showSearch">
<el-input
v-model.trim="numYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="numYearly.key"
class="w-50"
/>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('推介人')" v-show="showSearch">
<el-select
clearable
remote
......@@ -225,16 +388,16 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('控货无收货人')">
<el-form-item :label="$t('控货无收货人')" v-show="showSearch">
<el-switch v-model="queryParams.noConsignee" />
</el-form-item>
<el-form-item :label="$t('默认付款')">
<el-form-item :label="$t('默认付款')" v-show="showSearch">
<el-switch v-model="queryParams.defaultPay" />
</el-form-item>
<el-form-item :label="$t('是否显示提单价格')">
<el-form-item :label="$t('是否显示提单价格')" v-show="showSearch">
<el-switch v-model="queryParams.isShowTidanPrice" />
</el-form-item>
<el-form-item :label="$t('归属时间')">
<el-form-item :label="$t('归属时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
......@@ -246,7 +409,7 @@
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('首次成交时间')">
<el-form-item :label="$t('首次成交时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
......@@ -258,7 +421,7 @@
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('获取方式')" prop="getMethod">
<el-form-item :label="$t('获取方式')" v-show="showSearch">
<el-select
v-model="queryParams.getMethods"
multiple
......@@ -272,7 +435,7 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建入口')" prop="createFrom">
<el-form-item :label="$t('创建入口')" v-show="showSearch">
<el-select
v-model="queryParams.createFroms"
multiple
......@@ -286,7 +449,7 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('结算方式')">
<el-form-item :label="$t('结算方式')" v-show="showSearch">
<el-select
v-model="queryParams.balances"
multiple
......@@ -1206,6 +1369,7 @@ import {
deptExportExcel,
recycleUnconfirmedCustomer,
updatecustomerToOld,
competitorListAll
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import { CommonStatusEnum } from "@/utils/constants";
......@@ -1214,7 +1378,7 @@ import upload from "@/components/ImageUpload";
import { getNodeList } from "@/api/ecw/node";
import CustomerFollowList from "./components/customerFollow";
import customerComplaints from "@/components/customerComplaints";
import { listServiceUser } from "@/api/system/user";
import { listServiceUser, getUserProfile, listAllSimpl } from "@/api/system/user";
import { getCountryListAll } from "@/api/ecw/country";
import { getCreditPage } from "@/api/customer/credit";
import { customerExportExcel, changeCustomerDefaultPay, changeCustomerNoConsignee,changeCustomerDefaultBilling} from "@/api/ecw/customer";
......@@ -1222,10 +1386,12 @@ import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue";
import AddPotentialCustom from "@/views/ecw/customer/addPotentialCustom.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
import { getUserProfile } from "@/api/system/user";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import { getCustomerSelect } from "@/api/ecw/customer";
import { getProductTypeList } from "@/api/ecw/productType";
import { getProductList } from "@/api/ecw/product";
import {listSimpleDepts} from "@/api/system/dept";
export default {
name: "EcwCustomerIndex",
components: {
......@@ -1354,6 +1520,20 @@ export default {
firstDealTime: [],
customerSelect: [],
recommended: [],
getNodeLists: [],
allSimplList: [],
weightYearly: {
key: "eqNumberKey",
value: "",
},
numYearly: {
key: "eqNumberKey",
value: "",
},
productTypeList: [],
productList: [],
competitorList: [],
deptList: [],
};
},
computed: {
......@@ -1409,20 +1589,38 @@ export default {
combinedQueryParams() {
let queryParams = {}
if (this.enterOpenSeaTime && this.enterOpenSeaTime.length == 2) {
this.queryParams.beginEnterOpenSeaTime = this.enterOpenSeaTime[0]
this.queryParams.endEnterOpenSeaTime = this.enterOpenSeaTime[1]
queryParams.beginEnterOpenSeaTime = this.enterOpenSeaTime[0]
queryParams.endEnterOpenSeaTime = this.enterOpenSeaTime[1]
}
if (this.customerServiceConfirmedTime && this.customerServiceConfirmedTime.length == 2) {
this.queryParams.beginCustomerServiceConfirmedTime = this.enterOpenSeaTime[0]
this.queryParams.endCustomerServiceConfirmedTime = this.enterOpenSeaTime[1]
queryParams.beginCustomerServiceConfirmedTime = this.enterOpenSeaTime[0]
queryParams.endCustomerServiceConfirmedTime = this.enterOpenSeaTime[1]
}
if (this.dateRangeCreateTime && this.dateRangeCreateTime.length == 2) {
this.queryParams.beginCreateTime = this.dateRangeCreateTime[0]
this.queryParams.endCreateTime = this.dateRangeCreateTime[1]
queryParams.beginCreateTime = this.dateRangeCreateTime[0]
queryParams.endCreateTime = this.dateRangeCreateTime[1]
}
if (this.firstDealTime && this.firstDealTime.length == 2) {
this.queryParams.beginFirstDealTime = this.firstDealTime[0]
this.queryParams.endFirstDealTime = this.firstDealTime[1]
queryParams.beginFirstDealTime = this.firstDealTime[0]
queryParams.endFirstDealTime = this.firstDealTime[1]
}
if (this.weightYearly.value) {
let key = 'eqWeightYearly'
if (this.weightYearly.key == 'leNumberKey') {
key = 'leWeightYearly'
} else if (this.weightYearly.key == 'geNumberKey') {
key = 'geWeightYearly'
}
queryParams[key] = this.weightYearly.value;
}
if (this.numYearly.value) {
let key = 'eqNumYearly'
if (this.numYearly.key == 'leNumberKey') {
key = 'leNumYearly'
} else if (this.numYearly.key == 'geNumberKey') {
key = 'geNumYearly'
}
queryParams[key] = this.numYearly.value;
}
return queryParams;
......@@ -1452,6 +1650,21 @@ export default {
this.userId = res.data.id;
});
this.getCustomerSelect();
getNodeList().then((r) => {
this.getNodeLists = r.data;
});
listAllSimpl().then((r) => {
this.allSimplList = r.data;
});
getProductTypeList().then((r) => {
this.productTypeList = r.data;
});
competitorListAll().then((r) => {
this.competitorList = r.data;
})
listSimpleDepts().then(response => {
this.deptList = response.data
})
},
activated() {
this.getList();
......@@ -1582,6 +1795,12 @@ export default {
}
);
},
handleSelectProductType(val) {
this.queryParams.productIds = [];
getProductList({ typeIds: val }).then((r) => {
this.productList = r.data;
});
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push("/customer/add-edit/0");
......@@ -1710,24 +1929,16 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.enterOpenSeaTime = []
this.customerServiceConfirmedTime = []
this.firstDealTime = []
this.resetForm("queryForm");
this.queryParams = {
pageNo: 1,
pageSize: 10,
number: null,
name: null,
level: null,
source: null,
customerService: null,
status: null,
department: null,
creditLevel: null,
country: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
};
this.weightYearly.value = "";
this.numYearly.value = "";
this.handleQuery();
},
/** 调入公海池测试用 */
......
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="130px">
<el-form-item :label="$t('客户编号')" prop="number">
<el-input v-model.trim="queryParams.number" :placeholder="$t('请输入客户编号')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"/>
</el-form-item>
<el-form-item :label="$t('客户名称')" prop="name">
<el-input v-model.trim="queryParams.name" :placeholder="$t('请输入客户名称')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"/>
</el-form-item>
<!--
<el-form-item :label="$t('客户等级')" prop="level">
<el-select multiple v-model="queryParams.level" :placeholder="$t('请选择客户等级')" clearable size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
</el-select>
</el-form-item>
-->
<el-form-item :label="$t('区号')">
<el-select
v-model="queryParams.areaCode"
:placeholder="$t('请选择区号')"
>
<el-option
v-for="(item, index) in countryList"
:key="index"
:label="
item.nameShort +
(isChinese ? item.nameZh : item.nameEn) +
' +' +
item.tel
"
:value="item.tel"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('联系方式')">
<el-input :placeholder="$t('请输入联系方式')" v-model.trim="queryParams.defaultContactPhone" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"></el-input>
<el-input :placeholder="$t('请输入联系方式')" v-model.trim="queryParams.defaultContactPhone" @input="queryParams.defaultContactPhone=queryParams.defaultContactPhone.replace(/\s+/g, '')"></el-input>
</el-form-item>
<el-form-item :label="$t('客户类别')" prop="level">
<dict-selector multiple :type="DICT_TYPE.CUSTOMER_TYPE" v-model="queryParams.type" clearable @change="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('部门')">
<el-select v-model="queryParams.deptIds" :placeholder="$t('请选择部门')">
<el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select multiple v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" clearable size="small" @change="handleQuery">
<el-option v-for="dict in customerServiceList"
......@@ -45,10 +69,22 @@
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')">
<el-form-item :label="$t('创建人')" v-show="showSearch">
<el-select v-model="queryParams.founder">
<el-option
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-date-picker clearable v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<!--
<el-form-item :label="$t('信用等级')" prop="department">
<el-select multiple clearable v-model="queryParams.creditLevel" @change="handleQuery">
<el-option v-for="(item,index) in creditList" :label=" isChinese ? item.nameZh : item.nameEn" :key="index" :value="item.id" ></el-option>
......@@ -87,6 +123,246 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
-->
<el-form-item :label="$t('角色')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.CUSTOMER_ROLE"
v-model="queryParams.role"
formatter="number"
@change="handleQuery"
:placeholder="$t('请选择')"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('出货渠道')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE"
v-model="queryParams.transportType"
formatter="number"
@change="handleQuery"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('业务国家')" v-show="showSearch">
<el-select
multiple
clearable
v-model="queryParams.busiCountryIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('常用提货网点')" v-show="showSearch">
<el-select multiple v-model="queryParams.pickupPoints">
<el-option
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('入公海时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="enterOpenSeaTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('业绩类型')" v-show="showSearch">
<el-select clearable v-model="queryParams.isNew">
<el-option :label="$t('新客户')" :value="true" />
<el-option :label="$t('老客户')" :value="false" />
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货量')" v-show="showSearch">
<el-input
v-model.trim="weightYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="weightYearly.key"
class="w-50"
/>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('商品类别')" v-show="showSearch">
<el-select
@change="handleSelectProductType"
multiple
v-model="queryParams.productTypes"
:placeholder="$t('请选择产品类别')"
>
<el-option
:label="item.titleZh"
:value="item.id"
v-for="item in productTypeList"
:key="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('商品名称')" v-show="showSearch">
<el-select
multiple
filterable
clearable
v-model="queryParams.productIds"
:placeholder="$t('请选择商品名称')"
>
<el-option
:label="item.titleZh"
:value="parseInt(item.id)"
v-for="item in productList"
:key="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('主要竞争对手')" v-show="showSearch">
<el-select
clearable
multiple
v-model="queryParams.competitorIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="item in competitorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货次数')" v-show="showSearch">
<el-input
v-model.trim="numYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="numYearly.key"
class="w-50"
/>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('推介人')" v-show="showSearch">
<el-select
clearable
remote
:remote-method="remoteMethod"
v-model="queryParams.promoter"
:placeholder="$t('请输入推介人')"
filterable
>
<el-option
v-for="item in customerSelectFn"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('控货无收货人')" v-show="showSearch">
<el-switch v-model="queryParams.noConsignee" />
</el-form-item>
<el-form-item :label="$t('默认付款')" v-show="showSearch">
<el-switch v-model="queryParams.defaultPay" />
</el-form-item>
<el-form-item :label="$t('是否显示提单价格')" v-show="showSearch">
<el-switch v-model="queryParams.isShowTidanPrice" />
</el-form-item>
<el-form-item :label="$t('归属时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="customerServiceConfirmedTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('首次成交时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="firstDealTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('获取方式')" v-show="showSearch">
<el-select
v-model="queryParams.getMethods"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建入口')" v-show="showSearch">
<el-select
v-model="queryParams.createFroms"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('结算方式')" v-show="showSearch">
<el-select
v-model="queryParams.balances"
multiple
:placeholder="$t('请选择结算方式')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
......@@ -393,9 +669,10 @@ import {
exportCustomerExcel,
getWaitForConfirmList,
confirm,
waiteConfirmExportExcel, waiteConfirEexportExcel, recycleUnconfirmedCustomer
waiteConfirmExportExcel, waiteConfirEexportExcel, recycleUnconfirmedCustomer,
competitorListAll
} from "@/api/ecw/customer";
import { listServiceUser } from "@/api/system/user"
import { listServiceUser, listAllSimpl } from "@/api/system/user"
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import {CommonStatusEnum} from '@/utils/constants'
import {handOverCustomer} from "../../../api/ecw/customer";
......@@ -404,7 +681,10 @@ import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import { getNodeList } from "@/api/ecw/node";
import { getCustomerSelect } from "@/api/ecw/customer";
import { getProductTypeList } from "@/api/ecw/productType";
import { getProductList } from "@/api/ecw/product";
export default {
name: "EcwCustomerconfirmIndex",
......@@ -418,6 +698,58 @@ export default {
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
customerSelectFn() {
if (this.recommended.length > 0) {
let i = this.customerSelect.find(
(item) => item.id === this.recommended[0].id
);
if (!i) {
this.customerSelect.push(this.recommended[0]);
}
return this.customerSelect;
} else {
return this.customerSelect;
}
},
combinedQueryParams() {
let queryParams = {}
if (this.enterOpenSeaTime && this.enterOpenSeaTime.length == 2) {
queryParams.beginEnterOpenSeaTime = this.enterOpenSeaTime[0]
queryParams.endEnterOpenSeaTime = this.enterOpenSeaTime[1]
}
if (this.customerServiceConfirmedTime && this.customerServiceConfirmedTime.length == 2) {
queryParams.beginCustomerServiceConfirmedTime = this.enterOpenSeaTime[0]
queryParams.endCustomerServiceConfirmedTime = this.enterOpenSeaTime[1]
}
if (this.dateRangeCreateTime && this.dateRangeCreateTime.length == 2) {
queryParams.beginCreateTime = this.dateRangeCreateTime[0]
queryParams.endCreateTime = this.dateRangeCreateTime[1]
}
if (this.firstDealTime && this.firstDealTime.length == 2) {
queryParams.beginFirstDealTime = this.firstDealTime[0]
queryParams.endFirstDealTime = this.firstDealTime[1]
}
if (this.weightYearly.value) {
let key = 'eqWeightYearly'
if (this.weightYearly.key == 'leNumberKey') {
key = 'leWeightYearly'
} else if (this.weightYearly.key == 'geNumberKey') {
key = 'geWeightYearly'
}
queryParams[key] = this.weightYearly.value;
}
if (this.numYearly.value) {
let key = 'eqNumYearly'
if (this.numYearly.key == 'leNumberKey') {
key = 'leNumYearly'
} else if (this.numYearly.key == 'geNumberKey') {
key = 'geNumYearly'
}
queryParams[key] = this.numYearly.value;
}
return queryParams;
},
},
components: {
Contacts,
......@@ -446,7 +778,7 @@ export default {
queryParams: {
pageNo: 1,
pageSize: 10,
number: null,
/*number: null,
name: null,
level: null,
source: null,
......@@ -459,7 +791,7 @@ export default {
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
memberAreaCode: null*/
},
// 表单参数
form: {},
......@@ -473,7 +805,26 @@ export default {
serviceStaffOptions: [],
customerServiceList:[],
countryList:[],
creditList:[]
creditList:[],
enterOpenSeaTime: [],
customerServiceConfirmedTime: [],
firstDealTime: [],
customerSelect: [],
recommended: [],
getNodeLists: [],
allSimplList: [],
weightYearly: {
key: "eqNumberKey",
value: "",
},
numYearly: {
key: "eqNumberKey",
value: "",
},
productTypeList: [],
productList: [],
competitorList: [],
deptList: [],
};
},
created() {
......@@ -491,6 +842,22 @@ export default {
getCountryListAll().then(r => {
this.countryList = r.data
})
this.getCustomerSelect();
getNodeList().then((r) => {
this.getNodeLists = r.data;
});
listAllSimpl().then((r) => {
this.allSimplList = r.data;
});
getProductTypeList().then((r) => {
this.productTypeList = r.data;
});
competitorListAll().then((r) => {
this.competitorList = r.data;
})
listSimpleDepts().then(response => {
this.deptList = response.data
})
},
methods: {
// recovery(row){
......@@ -525,6 +892,22 @@ export default {
this.loading = false;
});
},
remoteMethod(val) {
this.getCustomerSelect(val);
},
getCustomerSelect(val = "") {
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then(
(res) => {
this.customerSelect = res.data.list;
}
);
},
handleSelectProductType(val) {
this.queryParams.productIds = [];
getProductList({ typeIds: val }).then((r) => {
this.productList = r.data;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
......@@ -585,24 +968,16 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.enterOpenSeaTime = []
this.customerServiceConfirmedTime = []
this.firstDealTime = []
this.resetForm("queryForm");
this.queryParams = {
pageNo: 1,
pageSize: 10,
number: null,
name: null,
level: null,
source: null,
customerService: null,
status: null,
department: null,
creditLevel:null,
country:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}
};
this.weightYearly.value = "";
this.numYearly.value = "";
this.handleQuery();
},
/** 新增按钮操作 */
......
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="130px">
<el-form-item :label="$t('客户编号')" prop="number">
<el-input v-model="queryParams.number" :placeholder="$t('请输入客户编号')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item :label="$t('客户名称')" prop="name">
<el-input v-model="queryParams.name" :placeholder="$t('请输入客户名称')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<!--
<el-form-item :label="$t('客户等级')" prop="level">
<el-select clearable v-model="queryParams.level" :placeholder="$t('请选择客户等级')" clearable size="small">
<el-select clearable v-model="queryParams.level" :placeholder="$t('请选择客户等级')" size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
</el-select>
</el-form-item>
-->
<el-form-item :label="$t('区号')">
<el-select
v-model="queryParams.areaCode"
:placeholder="$t('请选择区号')"
>
<el-option
v-for="(item, index) in countryList"
:key="index"
:label="
item.nameShort +
(isChinese ? item.nameZh : item.nameEn) +
' +' +
item.tel
"
:value="item.tel"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('联系方式')">
<el-input :placeholder="$t('请输入联系方式')" v-model="queryParams.defaultContactPhone"></el-input>
</el-form-item>
<el-form-item :label="$t('客户类别')" prop="level">
<dict-selector :type="DICT_TYPE.CUSTOMER_TYPE" v-model="queryParams.type"></dict-selector>
</el-form-item>
<el-form-item :label="$t('部门')">
<el-select v-model="queryParams.deptIds" :placeholder="$t('请选择部门')">
<el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" clearable size="small">
<el-select clearable v-model="queryParams.customerService" :placeholder="$t('请选择客户经理')" size="small">
<el-option v-for="dict in customerServiceList"
:key="dict.id" :label="dict.nickname" :value="dict.id"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('客户来源')" prop="source">
<el-select clearable v-model="queryParams.source" :placeholder="$t('请选择客户来源')" clearable size="small">
<el-select clearable v-model="queryParams.source" :placeholder="$t('请选择客户来源')" size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('国')" prop="source">
<el-select clearable v-model="queryParams.country" :placeholder="$t('请选择国家')">
<el-form-item :label="$t('国')" prop="source">
<el-select clearable v-model="queryParams.country" :placeholder="$t('请选择')">
<el-option v-for="dict in countryList"
:key="dict.id" :label="isChinese ? dict.nameZh : dict.nameEn" :value="parseInt(dict.id)" />
</el-select>
......@@ -46,10 +70,22 @@
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')">
<el-form-item :label="$t('创建人')" v-show="showSearch">
<el-select v-model="queryParams.founder">
<el-option
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-date-picker clearable v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<!--
<el-form-item :label="$t('信用等级')" prop="department">
<el-select clearable v-model="queryParams.creditLevel" >
<el-option v-for="(item,index) in creditList" :label="isChinese ? item.nameZh : item.nameEn" :key="index" :value="item.id" ></el-option>
......@@ -88,6 +124,246 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
-->
<el-form-item :label="$t('角色')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.CUSTOMER_ROLE"
v-model="queryParams.role"
formatter="number"
@change="handleQuery"
:placeholder="$t('请选择')"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('出货渠道')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE"
v-model="queryParams.transportType"
formatter="number"
@change="handleQuery"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('业务国家')" v-show="showSearch">
<el-select
multiple
clearable
v-model="queryParams.busiCountryIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('常用提货网点')" v-show="showSearch">
<el-select multiple v-model="queryParams.pickupPoints">
<el-option
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('入公海时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="enterOpenSeaTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('业绩类型')" v-show="showSearch">
<el-select clearable v-model="queryParams.isNew">
<el-option :label="$t('新客户')" :value="true" />
<el-option :label="$t('老客户')" :value="false" />
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货量')" v-show="showSearch">
<el-input
v-model.trim="weightYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="weightYearly.key"
class="w-50"
/>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('商品类别')" v-show="showSearch">
<el-select
@change="handleSelectProductType"
multiple
v-model="queryParams.productTypes"
:placeholder="$t('请选择产品类别')"
>
<el-option
:label="item.titleZh"
:value="item.id"
v-for="item in productTypeList"
:key="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('商品名称')" v-show="showSearch">
<el-select
multiple
filterable
clearable
v-model="queryParams.productIds"
:placeholder="$t('请选择商品名称')"
>
<el-option
:label="item.titleZh"
:value="parseInt(item.id)"
v-for="item in productList"
:key="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('主要竞争对手')" v-show="showSearch">
<el-select
clearable
multiple
v-model="queryParams.competitorIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="item in competitorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货次数')" v-show="showSearch">
<el-input
v-model.trim="numYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="numYearly.key"
class="w-50"
/>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('推介人')" v-show="showSearch">
<el-select
clearable
remote
:remote-method="remoteMethod"
v-model="queryParams.promoter"
:placeholder="$t('请输入推介人')"
filterable
>
<el-option
v-for="item in customerSelectFn"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('控货无收货人')" v-show="showSearch">
<el-switch v-model="queryParams.noConsignee" />
</el-form-item>
<el-form-item :label="$t('默认付款')" v-show="showSearch">
<el-switch v-model="queryParams.defaultPay" />
</el-form-item>
<el-form-item :label="$t('是否显示提单价格')" v-show="showSearch">
<el-switch v-model="queryParams.isShowTidanPrice" />
</el-form-item>
<el-form-item :label="$t('归属时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="customerServiceConfirmedTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('首次成交时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="firstDealTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('获取方式')" v-show="showSearch">
<el-select
v-model="queryParams.getMethods"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建入口')" v-show="showSearch">
<el-select
v-model="queryParams.createFroms"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('结算方式')" v-show="showSearch">
<el-select
v-model="queryParams.balances"
multiple
:placeholder="$t('请选择结算方式')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
......@@ -200,17 +476,24 @@
<script>
import {
createCustomer, updateCustomer, deleteCustomer, getCustomer, handOverCustomer,
exportCustomerExcel, getCustomerToBeAssigned, waitDistributionExportExcel
exportCustomerExcel, getCustomerToBeAssigned, waitDistributionExportExcel,
competitorListAll
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload'
import {listServiceUser} from "@/api/system/user";
import {listServiceUser, listAllSimpl} from "@/api/system/user";
import {getCountryListAll} from "@/api/ecw/country";
import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import { getNodeList } from "@/api/ecw/node";
import { getCustomerSelect } from "@/api/ecw/customer";
import { getProductTypeList } from "@/api/ecw/productType";
import { getProductList } from "@/api/ecw/product";
import {listSimpleDepts} from "@/api/system/dept";
export default {
name: "EcwCustomertobeassignedIndex",
activated() {
......@@ -248,7 +531,7 @@ export default {
queryParams: {
pageNo: 1,
pageSize: 10,
number: null,
/*number: null,
name: null,
level: null,
source: null,
......@@ -261,7 +544,7 @@ export default {
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
memberAreaCode: null*/
},
// 表单参数
form: {},
......@@ -285,7 +568,26 @@ export default {
transferShow:false,
creditList:[],
selectCustomerList:[],
countryList:[]
countryList:[],
enterOpenSeaTime: [],
customerServiceConfirmedTime: [],
firstDealTime: [],
customerSelect: [],
recommended: [],
getNodeLists: [],
allSimplList: [],
weightYearly: {
key: "eqNumberKey",
value: "",
},
numYearly: {
key: "eqNumberKey",
value: "",
},
productTypeList: [],
productList: [],
competitorList: [],
deptList: [],
};
},
created() {
......@@ -304,6 +606,22 @@ export default {
// getNodeList().then(r => {
// this.nodeList = r.data
// })
this.getCustomerSelect();
getNodeList().then((r) => {
this.getNodeLists = r.data;
});
listAllSimpl().then((r) => {
this.allSimplList = r.data;
});
getProductTypeList().then((r) => {
this.productTypeList = r.data;
});
competitorListAll().then((r) => {
this.competitorList = r.data;
})
listSimpleDepts().then(response => {
this.deptList = response.data
})
},
methods: {
countryFormatter(row, column, cellValue) {
......@@ -326,6 +644,22 @@ export default {
this.loading = false;
});
},
remoteMethod(val) {
this.getCustomerSelect(val);
},
getCustomerSelect(val = "") {
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then(
(res) => {
this.customerSelect = res.data.list;
}
);
},
handleSelectProductType(val) {
this.queryParams.productIds = [];
getProductList({ typeIds: val }).then((r) => {
this.productList = r.data;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
......@@ -380,24 +714,16 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.enterOpenSeaTime = []
this.customerServiceConfirmedTime = []
this.firstDealTime = []
this.resetForm("queryForm");
this.queryParams = {
pageNo: 1,
pageSize: 10,
number: null,
name: null,
level: null,
source: null,
customerService: null,
status: null,
department: null,
creditLevel:null,
country:null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
}
};
this.weightYearly.value = "";
this.numYearly.value = "";
this.handleQuery();
},
/** 新增按钮操作 */
......@@ -499,6 +825,58 @@ export default {
isChinese(){
return this.$i18n.locale === 'zh_CN'
},
customerSelectFn() {
if (this.recommended.length > 0) {
let i = this.customerSelect.find(
(item) => item.id === this.recommended[0].id
);
if (!i) {
this.customerSelect.push(this.recommended[0]);
}
return this.customerSelect;
} else {
return this.customerSelect;
}
},
combinedQueryParams() {
let queryParams = {}
if (this.enterOpenSeaTime && this.enterOpenSeaTime.length == 2) {
queryParams.beginEnterOpenSeaTime = this.enterOpenSeaTime[0]
queryParams.endEnterOpenSeaTime = this.enterOpenSeaTime[1]
}
if (this.customerServiceConfirmedTime && this.customerServiceConfirmedTime.length == 2) {
queryParams.beginCustomerServiceConfirmedTime = this.enterOpenSeaTime[0]
queryParams.endCustomerServiceConfirmedTime = this.enterOpenSeaTime[1]
}
if (this.dateRangeCreateTime && this.dateRangeCreateTime.length == 2) {
queryParams.beginCreateTime = this.dateRangeCreateTime[0]
queryParams.endCreateTime = this.dateRangeCreateTime[1]
}
if (this.firstDealTime && this.firstDealTime.length == 2) {
queryParams.beginFirstDealTime = this.firstDealTime[0]
queryParams.endFirstDealTime = this.firstDealTime[1]
}
if (this.weightYearly.value) {
let key = 'eqWeightYearly'
if (this.weightYearly.key == 'leNumberKey') {
key = 'leWeightYearly'
} else if (this.weightYearly.key == 'geNumberKey') {
key = 'geWeightYearly'
}
queryParams[key] = this.weightYearly.value;
}
if (this.numYearly.value) {
let key = 'eqNumYearly'
if (this.numYearly.key == 'leNumberKey') {
key = 'leNumYearly'
} else if (this.numYearly.key == 'geNumberKey') {
key = 'geNumYearly'
}
queryParams[key] = this.numYearly.value;
}
return queryParams;
},
}
};
</script>
......@@ -7,8 +7,7 @@
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
label-width="130px"
>
<el-form-item :label="$t('客户编号')" prop="number">
<el-input v-model.trim="queryParams.number" :placeholder="$t('请输入客户编号')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" clearable @keyup.enter.native="handleQuery" />
......@@ -16,26 +15,62 @@
<el-form-item :label="$t('客户名称')" prop="name">
<el-input v-model.trim="queryParams.name" :placeholder="$t('请输入客户名称')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"/>
</el-form-item>
<!--
<el-form-item :label="$t('客户等级')" prop="level">
<el-select clearable v-model="queryParams.level" multiple :placeholder="$t('请选择客户等级')" clearable size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
</el-select>
</el-form-item>
-->
<el-form-item :label="$t('区号')">
<el-select
v-model="queryParams.areaCode"
:placeholder="$t('请选择区号')"
>
<el-option
v-for="(item, index) in countryList"
:key="index"
:label="
item.nameShort +
(isChinese ? item.nameZh : item.nameEn) +
' +' +
item.tel
"
:value="item.tel"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('联系方式')">
<el-input :placeholder="$t('请输入联系方式')" v-model.trim="queryParams.defaultContactPhone" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"></el-input>
<el-input :placeholder="$t('请输入联系方式')" v-model.trim="queryParams.defaultContactPhone" @input="queryParams.defaultContactPhone=queryParams.defaultContactPhone.replace(/\s+/g, '')"></el-input>
</el-form-item>
<el-form-item :label="$t('客户类别')" prop="level">
<dict-selector :type="DICT_TYPE.CUSTOMER_TYPE" multiple v-model="queryParams.type" @change="handleQuery"></dict-selector>
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select
clearable
v-model="queryParams.customerService"
:placeholder="$t('请选择客户经理')"
size="small"
@change="handleQuery"
>
<el-option
v-for="dict in customerServiceList"
:key="dict.id"
:label="dict.nickname"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('客户来源')" prop="source">
<el-select clearable v-model="queryParams.source" multiple :placeholder="$t('请选择客户来源')" clearable size="small" @change="handleQuery">
<el-select clearable v-model="queryParams.source" multiple :placeholder="$t('请选择客户来源')" size="small" @change="handleQuery">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
multiple :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('国')" prop="source">
<el-select clearable v-model="queryParams.country" :placeholder="$t('请选择国家')" multiple @change="handleQuery">
<el-form-item :label="$t('国')" prop="source">
<el-select clearable v-model="queryParams.country" :placeholder="$t('请选择')" multiple @change="handleQuery">
<el-option v-for="dict in countryList"
:key="dict.id" :label=" isChinese ? dict.nameZh : dict.nameEn " :value="parseInt(dict.id)" />
</el-select>
......@@ -46,7 +81,18 @@
:key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')">
<el-form-item :label="$t('创建人')" v-show="showSearch">
<el-select v-model="queryParams.founder">
<el-option
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-date-picker
clearable
v-model="dateRangeCreateTime"
......@@ -58,7 +104,7 @@
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<!--
<el-form-item :label="$t('信用等级')" prop="department">
<el-select clearable v-model="queryParams.creditLevel" multiple @change="handleQuery">
<el-option v-for="(item,index) in creditList" :label="isChinese ? item.nameZh : item.nameEn" :key="index" :value="item.id" ></el-option>
......@@ -97,6 +143,246 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
-->
<el-form-item :label="$t('角色')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.CUSTOMER_ROLE"
v-model="queryParams.role"
formatter="number"
@change="handleQuery"
:placeholder="$t('请选择')"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('出货渠道')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE"
v-model="queryParams.transportType"
formatter="number"
@change="handleQuery"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('业务国家')" v-show="showSearch">
<el-select
multiple
clearable
v-model="queryParams.busiCountryIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('常用提货网点')" v-show="showSearch">
<el-select multiple v-model="queryParams.pickupPoints">
<el-option
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('入公海时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="enterOpenSeaTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('业绩类型')" v-show="showSearch">
<el-select clearable v-model="queryParams.isNew">
<el-option :label="$t('新客户')" :value="true" />
<el-option :label="$t('老客户')" :value="false" />
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货量')" v-show="showSearch">
<el-input
v-model.trim="weightYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="weightYearly.key"
class="w-50"
/>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('商品类别')" v-show="showSearch">
<el-select
@change="handleSelectProductType"
multiple
v-model="queryParams.productTypes"
:placeholder="$t('请选择产品类别')"
>
<el-option
:label="item.titleZh"
:value="item.id"
v-for="item in productTypeList"
:key="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('商品名称')" v-show="showSearch">
<el-select
multiple
filterable
clearable
v-model="queryParams.productIds"
:placeholder="$t('请选择商品名称')"
>
<el-option
:label="item.titleZh"
:value="parseInt(item.id)"
v-for="item in productList"
:key="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('主要竞争对手')" v-show="showSearch">
<el-select
clearable
multiple
v-model="queryParams.competitorIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="item in competitorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货次数')" v-show="showSearch">
<el-input
v-model.trim="numYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="numYearly.key"
class="w-50"
/>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('推介人')" v-show="showSearch">
<el-select
clearable
remote
:remote-method="remoteMethod"
v-model="queryParams.promoter"
:placeholder="$t('请输入推介人')"
filterable
>
<el-option
v-for="item in customerSelectFn"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('控货无收货人')" v-show="showSearch">
<el-switch v-model="queryParams.noConsignee" />
</el-form-item>
<el-form-item :label="$t('默认付款')" v-show="showSearch">
<el-switch v-model="queryParams.defaultPay" />
</el-form-item>
<el-form-item :label="$t('是否显示提单价格')" v-show="showSearch">
<el-switch v-model="queryParams.isShowTidanPrice" />
</el-form-item>
<el-form-item :label="$t('归属时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="customerServiceConfirmedTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('首次成交时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="firstDealTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('获取方式')" v-show="showSearch">
<el-select
v-model="queryParams.getMethods"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建入口')" v-show="showSearch">
<el-select
v-model="queryParams.createFroms"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('结算方式')" v-show="showSearch">
<el-select
v-model="queryParams.balances"
multiple
:placeholder="$t('请选择结算方式')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索")
......@@ -324,21 +610,24 @@ import {
getMyCustomerService,
mineExporteExcel,
mineExportExcel,
competitorListAll
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import upload from "@/components/ImageUpload";
import customerFollowList from "../customer/components/customerFollow";
import customerComplaints from "@/components/customerComplaints";
import { listServiceUser } from "@/api/system/user";
import { listServiceUser, getUserProfile, listAllSimpl} from "@/api/system/user";
import { getCountryListAll } from "@/api/ecw/country";
import { getCreditPage } from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer";
import Template from "@/views/cms/template/index.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
//lanbm 2024-05-26 add
import { getUserProfile } from "@/api/system/user";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import { getNodeList } from "@/api/ecw/node";
import { getCustomerSelect } from "@/api/ecw/customer";
import { getProductTypeList } from "@/api/ecw/productType";
import { getProductList } from "@/api/ecw/product";
export default {
name: "EcwMycustomerserviceIndex",
components: {
......@@ -354,6 +643,58 @@ export default {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
customerSelectFn() {
if (this.recommended.length > 0) {
let i = this.customerSelect.find(
(item) => item.id === this.recommended[0].id
);
if (!i) {
this.customerSelect.push(this.recommended[0]);
}
return this.customerSelect;
} else {
return this.customerSelect;
}
},
combinedQueryParams() {
let queryParams = {}
if (this.enterOpenSeaTime && this.enterOpenSeaTime.length == 2) {
queryParams.beginEnterOpenSeaTime = this.enterOpenSeaTime[0]
queryParams.endEnterOpenSeaTime = this.enterOpenSeaTime[1]
}
if (this.customerServiceConfirmedTime && this.customerServiceConfirmedTime.length == 2) {
queryParams.beginCustomerServiceConfirmedTime = this.enterOpenSeaTime[0]
queryParams.endCustomerServiceConfirmedTime = this.enterOpenSeaTime[1]
}
if (this.dateRangeCreateTime && this.dateRangeCreateTime.length == 2) {
queryParams.beginCreateTime = this.dateRangeCreateTime[0]
queryParams.endCreateTime = this.dateRangeCreateTime[1]
}
if (this.firstDealTime && this.firstDealTime.length == 2) {
queryParams.beginFirstDealTime = this.firstDealTime[0]
queryParams.endFirstDealTime = this.firstDealTime[1]
}
if (this.weightYearly.value) {
let key = 'eqWeightYearly'
if (this.weightYearly.key == 'leNumberKey') {
key = 'leWeightYearly'
} else if (this.weightYearly.key == 'geNumberKey') {
key = 'geWeightYearly'
}
queryParams[key] = this.weightYearly.value;
}
if (this.numYearly.value) {
let key = 'eqNumYearly'
if (this.numYearly.key == 'leNumberKey') {
key = 'leNumYearly'
} else if (this.numYearly.key == 'geNumberKey') {
key = 'geNumYearly'
}
queryParams[key] = this.numYearly.value;
}
return queryParams;
},
},
data() {
return {
......@@ -382,7 +723,7 @@ export default {
queryParams: {
pageNo: 1,
pageSize: 10,
number: null,
/*number: null,
name: null,
level: null,
source: null,
......@@ -395,7 +736,7 @@ export default {
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
memberAreaCode: null*/
},
// 表单参数
form: {},
......@@ -455,7 +796,26 @@ export default {
selectCustomerList: [],
//lanbm 2024-05-26 添加参数
userId:undefined,
customerFollowVisible: false
customerFollowVisible: false,
enterOpenSeaTime: [],
customerServiceConfirmedTime: [],
firstDealTime: [],
customerSelect: [],
recommended: [],
getNodeLists: [],
allSimplList: [],
weightYearly: {
key: "eqNumberKey",
value: "",
},
numYearly: {
key: "eqNumberKey",
value: "",
},
productTypeList: [],
productList: [],
competitorList: [],
deptList: [],
};
},
activated() {
......@@ -480,6 +840,19 @@ export default {
getUserProfile().then((res) => {
this.userId = res.data.id;
});
this.getCustomerSelect();
getNodeList().then((r) => {
this.getNodeLists = r.data;
});
listAllSimpl().then((r) => {
this.allSimplList = r.data;
});
getProductTypeList().then((r) => {
this.productTypeList = r.data;
});
competitorListAll().then((r) => {
this.competitorList = r.data;
})
},
methods: {
handleSelectionChange(val) {
......@@ -510,6 +883,22 @@ export default {
this.loading = false;
});
},
remoteMethod(val) {
this.getCustomerSelect(val);
},
getCustomerSelect(val = "") {
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then(
(res) => {
this.customerSelect = res.data.list;
}
);
},
handleSelectProductType(val) {
this.queryParams.productIds = [];
getProductList({ typeIds: val }).then((r) => {
this.productList = r.data;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
......@@ -564,24 +953,16 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.enterOpenSeaTime = []
this.customerServiceConfirmedTime = []
this.firstDealTime = []
this.resetForm("queryForm");
this.queryParams = {
pageNo: 1,
pageSize: 10,
number: null,
name: null,
level: null,
source: null,
customerService: null,
status: null,
department: null,
creditLevel: null,
country: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
};
this.weightYearly.value = "";
this.numYearly.value = "";
this.handleQuery();
},
/** 新增按钮操作 */
......
......@@ -7,8 +7,7 @@
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
label-width="130px"
>
<el-form-item :label="$t('客户编号')" prop="number">
<el-input
......@@ -34,7 +33,6 @@
clearable
v-model="queryParams.level"
:placeholder="$t('请选择客户等级')"
clearable
size="small"
>
<el-option
......@@ -45,12 +43,30 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('区号')">
<el-select
v-model="queryParams.areaCode"
:placeholder="$t('请选择区号')"
>
<el-option
v-for="(item, index) in countryList"
:key="index"
:label="
item.nameShort +
(isChinese ? item.nameZh : item.nameEn) +
' +' +
item.tel
"
:value="item.tel"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('联系方式')">
<el-input
:placeholder="$t('请输入联系方式')"
v-model.trim="queryParams.defaultContactPhone"
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@input="queryParams.defaultContactPhone=queryParams.defaultContactPhone.replace(/\s+/g, '')"
></el-input>
</el-form-item>
<el-form-item :label="$t('客户类别')" prop="level">
......@@ -61,13 +77,17 @@
@change="handleQuery"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('部门')">
<el-select v-model="queryParams.deptIds" :placeholder="$t('请选择部门')">
<el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('客户经理')" prop="customerService">
<el-select
multiple
clearable
multiple
clearable
v-model="queryParams.customerService"
:placeholder="$t('请选择客户经理')"
clearable
size="small"
@change="handleQuery"
>
......@@ -81,11 +101,10 @@
</el-form-item>
<el-form-item :label="$t('客户来源')" prop="source">
<el-select
multiple
clearable
multiple
clearable
v-model="queryParams.source"
:placeholder="$t('请选择客户来源')"
clearable
size="small"
@change="handleQuery"
>
......@@ -97,12 +116,12 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('国家')" prop="source">
<el-form-item :label="$t('国籍')">
<el-select
multiple
clearable
v-model="queryParams.country"
:placeholder="$t('请选择国家')"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
......@@ -115,11 +134,10 @@
</el-form-item>
<el-form-item :label="$t('客户状态')" prop="status">
<el-select
multiple
clearable
multiple
clearable
v-model="queryParams.status"
:placeholder="$t('请选择客户状态')"
clearable
size="small"
@change="handleQuery"
>
......@@ -131,7 +149,18 @@
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')">
<el-form-item :label="$t('创建人')" v-show="showSearch">
<el-select v-model="queryParams.founder">
<el-option
v-for="item in allSimplList"
:key="item.id"
:label="item.nickname"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-date-picker
clearable
v-model="dateRangeCreateTime"
......@@ -143,6 +172,7 @@
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<!--
<el-form-item :label="$t('信用等级')" prop="department">
<el-select multiple clearable v-model="queryParams.creditLevel" @change="handleQuery">
<el-option
......@@ -193,6 +223,246 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
-->
<el-form-item :label="$t('角色')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.CUSTOMER_ROLE"
v-model="queryParams.role"
formatter="number"
@change="handleQuery"
:placeholder="$t('请选择')"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('出货渠道')">
<dict-selector
multiple
clearable
:type="DICT_TYPE.ECW_CUSTOMER_TRANSPORT_TYPE"
v-model="queryParams.transportType"
formatter="number"
@change="handleQuery"
></dict-selector>
</el-form-item>
<el-form-item :label="$t('业务国家')" v-show="showSearch">
<el-select
multiple
clearable
v-model="queryParams.busiCountryIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="dict in countryList"
:key="dict.id"
:label="isChinese ? dict.nameZh : dict.nameEn"
:value="parseInt(dict.id)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('常用提货网点')" v-show="showSearch">
<el-select multiple v-model="queryParams.pickupPoints">
<el-option
v-for="item in getNodeLists"
:key="item.id"
:value="item.id"
:label="isChinese ? item.titleZh : item.titleEn"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('入公海时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="enterOpenSeaTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('业绩类型')" v-show="showSearch">
<el-select clearable v-model="queryParams.isNew">
<el-option :label="$t('新客户')" :value="true" />
<el-option :label="$t('老客户')" :value="false" />
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货量')" v-show="showSearch">
<el-input
v-model.trim="weightYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="weightYearly.key"
class="w-50"
/>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('商品类别')" v-show="showSearch">
<el-select
@change="handleSelectProductType"
multiple
v-model="queryParams.productTypes"
:placeholder="$t('请选择产品类别')"
>
<el-option
:label="item.titleZh"
:value="item.id"
v-for="item in productTypeList"
:key="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('商品名称')" v-show="showSearch">
<el-select
multiple
filterable
clearable
v-model="queryParams.productIds"
:placeholder="$t('请选择商品名称')"
>
<el-option
:label="item.titleZh"
:value="parseInt(item.id)"
v-for="item in productList"
:key="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('主要竞争对手')" v-show="showSearch">
<el-select
clearable
multiple
v-model="queryParams.competitorIds"
:placeholder="$t('请选择')"
@change="handleQuery"
>
<el-option
v-for="item in competitorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('年度发货次数')" v-show="showSearch">
<el-input
v-model.trim="numYearly.value"
:placeholder="$t('请输入数字')"
clearable
@keyup.enter.native="handleQuery"
>
<template slot="prepend">
<dict-selector
:type="DICT_TYPE.CUSTOMER_QUERY_NUMBER_FIELD"
defaultable
v-model="numYearly.key"
class="w-50"
/>
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('推介人')" v-show="showSearch">
<el-select
clearable
remote
:remote-method="remoteMethod"
v-model="queryParams.promoter"
:placeholder="$t('请输入推介人')"
filterable
>
<el-option
v-for="item in customerSelectFn"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('控货无收货人')" v-show="showSearch">
<el-switch v-model="queryParams.noConsignee" />
</el-form-item>
<el-form-item :label="$t('默认付款')" v-show="showSearch">
<el-switch v-model="queryParams.defaultPay" />
</el-form-item>
<el-form-item :label="$t('是否显示提单价格')" v-show="showSearch">
<el-switch v-model="queryParams.isShowTidanPrice" />
</el-form-item>
<el-form-item :label="$t('归属时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="customerServiceConfirmedTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('首次成交时间')" v-show="showSearch">
<el-date-picker
type="datetimerange"
clearable
v-model="firstDealTime"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('结束日期')"
/>
</el-form-item>
<el-form-item :label="$t('获取方式')" v-show="showSearch">
<el-select
v-model="queryParams.getMethods"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_GET_METHOD)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('创建入口')" v-show="showSearch">
<el-select
v-model="queryParams.createFroms"
multiple
:placeholder="$t('请选择')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FROM)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('结算方式')" v-show="showSearch">
<el-select
v-model="queryParams.balances"
multiple
:placeholder="$t('请选择结算方式')"
>
<el-option
v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_BALANCE)"
:key="dict.value"
:label="isChinese ? dict.label : dict.labelEn"
:value="parseInt(dict.value)"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{
$t("搜索")
......@@ -400,15 +670,21 @@ import {
getPublicList,
setFishing,
publicExportExcel,
competitorListAll
} from "@/api/ecw/customer";
import { getDictDatas, DICT_TYPE } from "@/utils/dict";
import upload from "@/components/ImageUpload";
import { listServiceUser } from "@/api/system/user";
import { listServiceUser, listAllSimpl } from "@/api/system/user";
import { getCountryListAll } from "@/api/ecw/country";
import { getCreditPage } from "@/api/customer/credit";
import Template from "@/views/cms/template/index.vue";
import Contacts from "@/views/ecw/customer/components/contacts.vue";
import AreaCodeSelector from "@/components/AreaCodeSelector/index.vue";
import { getNodeList } from "@/api/ecw/node";
import { getCustomerSelect } from "@/api/ecw/customer";
import { getProductTypeList } from "@/api/ecw/productType";
import { getProductList } from "@/api/ecw/product";
import {listSimpleDepts} from "@/api/system/dept";
export default {
name: "EcwOceancustomerIndex",
activated() {
......@@ -525,6 +801,26 @@ export default {
isBatch: false,
countryList: [],
creditList: [],
customerFollowVisible: false,
enterOpenSeaTime: [],
customerServiceConfirmedTime: [],
firstDealTime: [],
customerSelect: [],
recommended: [],
getNodeLists: [],
allSimplList: [],
weightYearly: {
key: "eqNumberKey",
value: "",
},
numYearly: {
key: "eqNumberKey",
value: "",
},
productTypeList: [],
productList: [],
competitorList: [],
deptList: [],
};
},
created() {
......@@ -542,11 +838,79 @@ export default {
// getNodeList().then(r => {
// this.nodeList = r.data
// })
this.getCustomerSelect();
getNodeList().then((r) => {
this.getNodeLists = r.data;
});
listAllSimpl().then((r) => {
this.allSimplList = r.data;
});
getProductTypeList().then((r) => {
this.productTypeList = r.data;
});
competitorListAll().then((r) => {
this.competitorList = r.data;
})
listSimpleDepts().then(response => {
this.deptList = response.data
})
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN";
},
customerSelectFn() {
if (this.recommended.length > 0) {
let i = this.customerSelect.find(
(item) => item.id === this.recommended[0].id
);
if (!i) {
this.customerSelect.push(this.recommended[0]);
}
return this.customerSelect;
} else {
return this.customerSelect;
}
},
combinedQueryParams() {
let queryParams = {}
if (this.enterOpenSeaTime && this.enterOpenSeaTime.length == 2) {
queryParams.beginEnterOpenSeaTime = this.enterOpenSeaTime[0]
queryParams.endEnterOpenSeaTime = this.enterOpenSeaTime[1]
}
if (this.customerServiceConfirmedTime && this.customerServiceConfirmedTime.length == 2) {
queryParams.beginCustomerServiceConfirmedTime = this.enterOpenSeaTime[0]
queryParams.endCustomerServiceConfirmedTime = this.enterOpenSeaTime[1]
}
if (this.dateRangeCreateTime && this.dateRangeCreateTime.length == 2) {
queryParams.beginCreateTime = this.dateRangeCreateTime[0]
queryParams.endCreateTime = this.dateRangeCreateTime[1]
}
if (this.firstDealTime && this.firstDealTime.length == 2) {
queryParams.beginFirstDealTime = this.firstDealTime[0]
queryParams.endFirstDealTime = this.firstDealTime[1]
}
if (this.weightYearly.value) {
let key = 'eqWeightYearly'
if (this.weightYearly.key == 'leNumberKey') {
key = 'leWeightYearly'
} else if (this.weightYearly.key == 'geNumberKey') {
key = 'geWeightYearly'
}
queryParams[key] = this.weightYearly.value;
}
if (this.numYearly.value) {
let key = 'eqNumYearly'
if (this.numYearly.key == 'leNumberKey') {
key = 'leNumYearly'
} else if (this.numYearly.key == 'geNumberKey') {
key = 'geNumYearly'
}
queryParams[key] = this.numYearly.value;
}
return queryParams;
},
},
methods: {
countryFormatter(row, column, cellValue) {
......@@ -566,6 +930,22 @@ export default {
this.loading = false;
});
},
remoteMethod(val) {
this.getCustomerSelect(val);
},
getCustomerSelect(val = "") {
getCustomerSelect({ pageNo: 1, pageSize: 30, searchKey: val }).then(
(res) => {
this.customerSelect = res.data.list;
}
);
},
handleSelectProductType(val) {
this.queryParams.productIds = [];
getProductList({ typeIds: val }).then((r) => {
this.productList = r.data;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
......@@ -620,24 +1000,16 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.enterOpenSeaTime = []
this.customerServiceConfirmedTime = []
this.firstDealTime = []
this.resetForm("queryForm");
this.queryParams = {
pageNo: 1,
pageSize: 10,
number: null,
name: null,
level: null,
source: null,
customerService: null,
status: null,
department: null,
creditLevel: null,
country: null,
memberCode: null,
memberName: null,
memberMobile: null,
memberAreaCode: null
};
this.weightYearly.value = "";
this.numYearly.value = "";
this.handleQuery();
},
/** 新增按钮操作 */
......
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