Commit 275abef7 authored by dcy's avatar dcy

我的客户列表,按原姓修改

parent 9867ce34
...@@ -745,6 +745,7 @@ export default { ...@@ -745,6 +745,7 @@ export default {
watch:{ watch:{
selectCustomerList(val){ selectCustomerList(val){
if(val.length === 0){ if(val.length === 0){
this.getList()
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection();
} }
}, },
......
...@@ -11,30 +11,50 @@ ...@@ -11,30 +11,50 @@
<el-input v-model="queryParams.name" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.name" placeholder="请输入客户名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="客户等级" prop="level"> <el-form-item label="客户等级" prop="level">
<el-select v-model="queryParams.level" placeholder="请选择客户等级" clearable size="small"> <el-select clearable v-model="queryParams.level" placeholder="请选择客户等级" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_LEVEL)"
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="联系方式">
<el-input placeholder="请输入联系方式" v-model="queryParams.defaultContactPhone"></el-input>
</el-form-item>
<el-form-item label="客户类别" prop="level">
<dict-selector :type="DICT_TYPE.CUSTOMER_TYPE" multiple v-model="queryParams.type"></dict-selector>
</el-form-item>
<el-form-item label="客户经理" prop="customerService">
<el-select clearable v-model="queryParams.customerService" placeholder="请选择客户经理" clearable 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="客户来源" prop="source"> <el-form-item label="客户来源" prop="source">
<el-select v-model="queryParams.source" placeholder="请选择客户来源" clearable size="small"> <el-select clearable v-model="queryParams.source" placeholder="请选择客户来源" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_SOURCE)"
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="国家" prop="source">
<el-select clearable v-model="form.country" placeholder="请选择国家">
<el-option v-for="dict in countryList"
:key="dict.id" :label="dict.nameZh" :value="parseInt(dict.id)" />
</el-select>
</el-form-item>
<el-form-item label="客户状态" prop="status"> <el-form-item label="客户状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择客户状态" clearable size="small"> <el-select clearable v-model="queryParams.status" placeholder="请选择客户状态" clearable size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)" <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_STATUS)"
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="部门" prop="department">
<el-input v-model="queryParams.department" placeholder="请输入部门" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" <el-date-picker clearable v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" /> type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item> </el-form-item>
<el-form-item label="信用等级" prop="department">
<el-select clearable v-model="form.level" >
<el-option v-for="(item,index) in creditList" :label="item.nameZh" :key="index" :value="item.id" ></el-option>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
...@@ -51,34 +71,42 @@ ...@@ -51,34 +71,42 @@
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:customer:export']">导出</el-button> v-hasPermi="['ecw:customer:export']">导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button :disabled="selectCustomerList.length === 0" type="warning" plain icon="el-icon-download" size="mini" @click="show = true;" :loading="exportLoading"
v-hasPermi="['ecw:customer:export']">批量移交</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list"> <el-table ref="multipleTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column label="客户编号" align="center" prop="number" /> <el-table-column label="客户编号" align="center" prop="number" />
<el-table-column label="客户名称" align="center" prop="name" /> <el-table-column label="客户名称" align="center" prop="name" />
<el-table-column label="客户等级" align="center" prop="level"> <el-table-column label="客户等级" align="center" prop="vipLevelNameZh">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" /> <dict-tag :type="DICT_TYPE.CUSTOMER_LEVEL" :value="scope.row.level" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="国家" align="center" prop="country"> <el-table-column label="信用等级" prop="creditLevelNameZh"></el-table-column>
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.COUNTRY" :value="scope.row.country" />
</template>
</el-table-column>
<el-table-column label="客户状态" align="center" prop="status"> <el-table-column label="客户状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.CUSTOMER_STATUS" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="部门" align="center" prop="department" /> <el-table-column label="主联系人" prop="defaultContactName"></el-table-column>
<el-table-column label="主联系方式" prop="defaultContactPhone"></el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户经理" align="center" prop="customerService" :formatter="customerServiceFn">
</el-table-column>
<el-table-column label="国家" align="center" prop="country" :formatter="countryFormatter"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)" <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
...@@ -98,6 +126,7 @@ ...@@ -98,6 +126,7 @@
@pagination="getList"/> @pagination="getList"/>
<customer-follow-list ref="customerFollowList" :customer-id="customerId" :id="customerId"></customer-follow-list> <customer-follow-list ref="customerFollowList" :customer-id="customerId" :id="customerId"></customer-follow-list>
<customer-complaints ref="customerComplaint" :customer-id.sync="customerId"></customer-complaints> <customer-complaints ref="customerComplaint" :customer-id.sync="customerId"></customer-complaints>
<transfer-customer :show.sync="show" :customer-ids.sync="selectCustomerList"></transfer-customer>
</div> </div>
</template> </template>
...@@ -108,15 +137,24 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict'; ...@@ -108,15 +137,24 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import upload from '@/components/ImageUpload' import upload from '@/components/ImageUpload'
import customerFollowList from "@/components/CustomerFollowList"; import customerFollowList from "@/components/CustomerFollowList";
import customerComplaints from "@/components/customerComplaints"; import customerComplaints from "@/components/customerComplaints";
import {listServiceUser} from "@/api/system/user";
import {getCountryListAll} from "@/api/ecw/country";
import {getCreditPage} from "@/api/customer/credit";
import transferCustomer from "@/views/ecw/customer/transferCustomer";
export default { export default {
name: "myCustomerService", name: "myCustomerService",
components: { components: {
upload, upload,
customerFollowList, customerFollowList,
customerComplaints customerComplaints,
transferCustomer
}, },
data() { data() {
return { return {
show:false,
creditList:[],
countryList:[],
customerServiceList:[],
getDictDatas, getDictDatas,
DICT_TYPE, DICT_TYPE,
// 遮罩层 // 遮罩层
...@@ -163,6 +201,7 @@ export default { ...@@ -163,6 +201,7 @@ export default {
nodeList: [], nodeList: [],
showLine: false, showLine: false,
customerId:undefined, customerId:undefined,
selectCustomerList:[],
}; };
}, },
created() { created() {
...@@ -170,8 +209,32 @@ export default { ...@@ -170,8 +209,32 @@ export default {
// getNodeList().then(r => { // getNodeList().then(r => {
// this.nodeList = r.data // this.nodeList = r.data
// }) // })
getCreditPage({page:1,rows:999}).then(r => {
this.creditList = r.data.list
})
listServiceUser().then(r=>{
this.customerServiceList = r.data;
})
getCountryListAll().then(r => {
this.countryList = r.data
})
}, },
methods: { methods: {
handleSelectionChange(val){
this.selectCustomerList = val.map(i => i.id);
},
countryFormatter(row, column, cellValue) {
const country = this.countryList.find((e) => e.id === cellValue)
return country?.nameZh
},
customerServiceFn(val){
if(this.customerServiceList.length > 0){
let index =this.customerServiceList.findIndex(item => item.id === val.customerService);
return index !== -1 ? this.customerServiceList[index]?.nickname :''
}else {
return ''
}
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -323,6 +386,15 @@ export default { ...@@ -323,6 +386,15 @@ export default {
this.$refs['customerComplaint'].handleAdd() this.$refs['customerComplaint'].handleAdd()
}) })
} }
},
watch:{
selectCustomerList(val){
if(val.length === 0){
this.getList()
this.$refs.multipleTable.clearSelection();
}
},
} }
}; };
</script> </script>
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