|
@@ -2,14 +2,30 @@
|
|
|
<div class="overseas-custom-list-wrap">
|
|
|
<div class="top-box" v-show="isDataSelectBtnShow">
|
|
|
<div class="switch-box">
|
|
|
- <el-radio-group v-model="pageSelect">
|
|
|
- <el-radio-button label="海外客户"></el-radio-button>
|
|
|
- <el-radio-button label="已隐藏客户"></el-radio-button>
|
|
|
+ <el-radio-group v-model="pageSelect" >
|
|
|
+ <el-radio-button :label="1">海外客户</el-radio-button>
|
|
|
+ <el-radio-button :label="2">已隐藏客户</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
<div class="select-box">
|
|
|
- <el-select placeholder="请选择销售"></el-select>
|
|
|
- <el-input prefix-icon="el-icon-search" placeholder="客户名称/社会信用码/手机号码/邮箱" style="width:317px;"></el-input>
|
|
|
+ <el-select placeholder="请选择销售" v-if="pageSelect===1"
|
|
|
+ v-model="tableParams.SellerId"
|
|
|
+ @change="handlePageChange(1)"
|
|
|
+ multiple collapse-tags clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="item in salesArr"
|
|
|
+ :key="item.SellerId"
|
|
|
+ :label="item.RealName"
|
|
|
+ :value="item.SellerId"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <el-input
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
+ placeholder="客户名称/社会信用码/手机号码/邮箱"
|
|
|
+ style="width:317px;" clearable
|
|
|
+ v-model="tableParams.Keywords"
|
|
|
+ @input="handlePageChange(1)"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="data-box">
|
|
@@ -17,19 +33,19 @@
|
|
|
<div class="table-select-box">
|
|
|
<ul class="status-box">
|
|
|
<li v-for="item in tableTabs" :key="item.Status"
|
|
|
- :class="['tab',{'act':statusSelect === item.Status}]"
|
|
|
+ :class="['tab',{'act':tableParams.CompanyStatus === item.CompanyStatus}]"
|
|
|
@click="changeStatus(item)"
|
|
|
>
|
|
|
- {{`${item.Status}(${item.Count})`}}
|
|
|
+ {{`${item.CompanyStatus}(${item.Total})`}}
|
|
|
</li>
|
|
|
</ul>
|
|
|
<!-- 试用小分类 -->
|
|
|
- <ul class="try-status-box" v-if="statusSelect==='试用'">
|
|
|
- <li v-for="item in tryTabs" :key="item.TryStage"
|
|
|
- :class="['trial-item',{'act':act_trialTag === item.TryStage}]"
|
|
|
+ <ul class="try-status-box" v-if="tableParams.CompanyStatus==='试用'">
|
|
|
+ <li v-for="item in tryTabs" :key="item.TryStatus"
|
|
|
+ :class="['trial-item',{'act':tableParams.tagStatusSelect === item.TryStatus}]"
|
|
|
@click="changeTagStatus(item)"
|
|
|
>
|
|
|
- {{item.TryStageStr+'('+item.Count+')'}}
|
|
|
+ {{item.TryStatus+'('+item.Total+')'}}
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
@@ -59,13 +75,13 @@
|
|
|
>
|
|
|
<template slot-scope="{row}">
|
|
|
<!-- 客户名称 -->
|
|
|
- <div v-if="item.key==='CompanyName'" class="name-box" @click="toCustomDetail">{{row[item.key]}}</div>
|
|
|
+ <div v-if="item.key==='CompanyName'" class="editor" @click="toCustomDetail(row)">{{row[item.key]}}</div>
|
|
|
<!-- 状态 -->
|
|
|
- <div v-else-if="item.key==='Status'" class="status-box">
|
|
|
+ <div v-else-if="item.key==='CompanyStatus'" class="status-box">
|
|
|
<span>{{row[item.key]}}</span>
|
|
|
<div class="select" v-if="row[item.key]==='试用'">
|
|
|
<el-select
|
|
|
- v-model="row.TryStageSlice[0].TryStage"
|
|
|
+ v-model="row.OverseasLabel"
|
|
|
size="mini"
|
|
|
style="width: 50px"
|
|
|
placeholder=""
|
|
@@ -80,16 +96,16 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <span v-else-if="item.key==='FiccView'" class="editor" @click="handleDialogShow('click',row)">{{row[item.key]}}</span>
|
|
|
- <span v-else-if="item.key==='RoadShowTotal'" class="editor" @click="handleDialogShow('road',row)">{{row[item.key]}}</span>
|
|
|
+ <span v-else-if="item.key==='ViewTotal'" :class="{'editor':row[item.key]>0}" @click="handleDialogShow('click',row)">{{row[item.key]}}</span>
|
|
|
+ <span v-else-if="item.key==='RoadShowTotal'" :class="{'editor':row[item.key]>0}" @click="handleDialogShow('road',row)">{{row[item.key]}}</span>
|
|
|
<span v-else>{{row[item.key]}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- 管理员展示操作列 -->
|
|
|
<el-table-column label="操作" align="center" v-if="isDataSelectBtnShow">
|
|
|
<template slot-scope="{row}">
|
|
|
- <el-button type="text">{{pageSelect==='海外客户'?'隐藏':'取消隐藏'}}</el-button>
|
|
|
- <el-button type="text">转正式</el-button>
|
|
|
+ <el-button type="text">{{pageSelect===1?'隐藏':'取消隐藏'}}</el-button>
|
|
|
+ <el-button type="text" v-if="pageSelect===1">转正式</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<template slot="empty">
|
|
@@ -115,8 +131,9 @@
|
|
|
<!-- 选择销售弹窗 -->
|
|
|
<SelectSaleDialog
|
|
|
:isSelectSaleShow="isSelectSaleShow"
|
|
|
- :AllSalesArr="AllSalesArr"
|
|
|
+ :selectedSalesArr="salesArr"
|
|
|
@close="isSelectSaleShow=false"
|
|
|
+ @saveSales="saveSales"
|
|
|
/>
|
|
|
<!-- 累计点击量弹窗 -->
|
|
|
<TotalClicksDialog
|
|
@@ -134,21 +151,20 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { customInterence,dataAuthInterface } from '@/api/api.js'
|
|
|
+import { overseasCustomInterence} from '@/api/modules/overseasCustom.js'
|
|
|
+import {customInterence } from '@/api/api.js'
|
|
|
import SelectSaleDialog from './components/selectSaleDialog';
|
|
|
import TotalClicksDialog from './components/totalClicksDialog';
|
|
|
import RoadShowsDialog from './components/roadShowsDialog';
|
|
|
+const tryArr = ['','未分类','推进','跟踪','预备']
|
|
|
export default {
|
|
|
components: { SelectSaleDialog, TotalClicksDialog, RoadShowsDialog },
|
|
|
data() {
|
|
|
return {
|
|
|
- pageSelect: '海外客户',
|
|
|
+ pageSelect: 1,
|
|
|
salesArr: [],
|
|
|
tableTabs: [],
|
|
|
tryTabs: [],
|
|
|
- statusSelect: '全部',
|
|
|
- tagStatusSelect: '全部',
|
|
|
- AllSalesArr: [],
|
|
|
trialTags: [{ label: '推进', value: 2 },
|
|
|
{ label: '跟踪', value: 3 },
|
|
|
{ label: '预备', value: 4 },
|
|
@@ -165,10 +181,10 @@ export default {
|
|
|
key: 'SellerName'
|
|
|
}, {
|
|
|
label: "状态",
|
|
|
- key: 'Status'
|
|
|
+ key: 'CompanyStatus'
|
|
|
}, {
|
|
|
label: "累计点击量",
|
|
|
- key: 'FiccView',
|
|
|
+ key: 'ViewTotal',
|
|
|
sortable: true
|
|
|
}, {
|
|
|
label: "路演数量",
|
|
@@ -176,13 +192,22 @@ export default {
|
|
|
sortable: true
|
|
|
}, {
|
|
|
label: "最近阅读时间",
|
|
|
- key: 'FiccLastViewTime',
|
|
|
+ key: 'LastViewTime',
|
|
|
sortable: true
|
|
|
}, {
|
|
|
label: "创建时间",
|
|
|
- key: 'CreatedTime',
|
|
|
+ key: 'CreateTime',
|
|
|
sortable: true
|
|
|
}],
|
|
|
+ tableParams:{
|
|
|
+ Keywords:'',
|
|
|
+ SortField:'ViewTotal',//排序字段
|
|
|
+ SortDesc:1,//排序方式
|
|
|
+ SellerId:'',//选择的销售
|
|
|
+ CompanyStatus:'全部',//客户状态
|
|
|
+ tagStatusSelect:'全部',//客户的试用状态
|
|
|
+ tryStatusSelect:0,//客户试用状态对应的OverseasLabel
|
|
|
+ },
|
|
|
tableData: [],
|
|
|
currentPage: 1,
|
|
|
pageSize: 10,
|
|
@@ -198,53 +223,89 @@ export default {
|
|
|
return localStorage.Role || '';
|
|
|
},
|
|
|
isDataSelectBtnShow() {
|
|
|
- return (this.RoleType === 'admin' || this.RoleType === 'ficc_admin');
|
|
|
+ return (this.Role === 'admin' || this.Role === 'ficc_admin');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ pageSelect(newval){
|
|
|
+ this.handlePageChange(1)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- //获取销售列表
|
|
|
- //由于中英文客户的销售列表不一致,获取系统全部人员列表作为销售列表
|
|
|
- getSalesList(){
|
|
|
- dataAuthInterface.userSearch().then(res=>{
|
|
|
+ //获取已保存选择的销售
|
|
|
+ getSavedSales(){
|
|
|
+ overseasCustomInterence.getSavedSalesList().then(res=>{
|
|
|
if(res.Ret!==200) return
|
|
|
- this.AllSalesArr = res.Data||[]
|
|
|
+ this.salesArr = res.Data||[]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //保存选择的销售
|
|
|
+ saveSales({AddSellerIdArr,DelSellerIdArr,sales}){
|
|
|
+ overseasCustomInterence.saveSelectedSales({
|
|
|
+ AddSellerIdArr,DelSellerIdArr
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ this.$message.success("选择销售成功")
|
|
|
+ this.tableParams = {
|
|
|
+ Keywords:'',
|
|
|
+ SortField:'ViewTotal',
|
|
|
+ SortDesc:1,
|
|
|
+ SellerId:'',
|
|
|
+ CompanyStatus:'全部',
|
|
|
+ tagStatusSelect:'全部',
|
|
|
+ tryStatusSelect:0,
|
|
|
+ }
|
|
|
+ this.salesArr = sales.map(i=>({SellerId:i.value,RealName:i.label}))
|
|
|
+ this.handlePageChange(1)
|
|
|
+ this.isSelectSaleShow = false
|
|
|
})
|
|
|
},
|
|
|
getTableData() {
|
|
|
- //先用中文客户列表
|
|
|
- customInterence.customList({
|
|
|
+ const {Keywords,SortField,SortDesc,SellerId,CompanyStatus,tryStatusSelect} = this.tableParams
|
|
|
+ overseasCustomInterence.getCustomList({
|
|
|
PageSize: this.pageSize,
|
|
|
CurrentIndex: this.currentPage,
|
|
|
- Status: this.statusSelect
|
|
|
- }).then(res => {
|
|
|
- if (res.Ret !== 200)
|
|
|
- return;
|
|
|
- //获取各个状态列表
|
|
|
- this.tableTabs = res.Data.StatusCount;
|
|
|
- //获取试用状态列表,并重新排序:全部 ... 未分类
|
|
|
- this.tryTabs = res.Data.TryStageCount ? res.Data.TryStageCount.sort((x, y) => x.TryStage - y.TryStage) : [];
|
|
|
- if (this.tryTabs.length) {
|
|
|
- const [x, y, ...res] = this.tryTabs;
|
|
|
- this.tryTabs = [x, ...res, y];
|
|
|
- }
|
|
|
- //获取表格数据
|
|
|
- this.tableData = res.Data.List.map(i => {
|
|
|
- const { TryStageSlice = [] } = i;
|
|
|
- return {
|
|
|
- ...i,
|
|
|
- TryStageSlice
|
|
|
- };
|
|
|
- });
|
|
|
- });
|
|
|
+ Keywords,CompanyStatus,
|
|
|
+ SellerId:(Array.isArray(SellerId)?SellerId.join(','):'')+'',
|
|
|
+ OverseasLabel:tryStatusSelect,
|
|
|
+ CustomType:this.pageSelect,
|
|
|
+ SortField:'ViewTotal',
|
|
|
+ SortDesc:1,
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ if(!res.Data) return
|
|
|
+ //客户状态
|
|
|
+ this.tableTabs = res.Data.StatisticsData||[]
|
|
|
+ //手动添加一个全部
|
|
|
+ let total = this.tableTabs.map(i=>(i.Total)).reduce((acc,curr)=>acc+curr,0)
|
|
|
+ this.tableTabs.unshift({CompanyStatus:'全部',Total:total})
|
|
|
+ //客户试用状态
|
|
|
+ this.tryTabs = res.Data.OverseasLabelData||[]
|
|
|
+ this.tryTabs = this.tryTabs.map(tab=>({
|
|
|
+ TryStatus:tryArr[tab.OverseasLabel],
|
|
|
+ Total:tab.Total,
|
|
|
+ OverseasLabel:tab.OverseasLabel}))
|
|
|
+ //手动添加一个全部
|
|
|
+ let tryTotal = this.tryTabs.map(i=>(i.Total)).reduce((acc,curr)=>acc+curr,0)
|
|
|
+ this.tryTabs.unshift({TryStatus:'全部',Total:tryTotal,OverseasLabel:0})
|
|
|
+ //客户列表
|
|
|
+ this.tableData = res.Data.List||[]
|
|
|
+ this.total = res.Data.Paging.Totals||0
|
|
|
+ })
|
|
|
},
|
|
|
//切换客户状态
|
|
|
changeStatus(item) {
|
|
|
- this.statusSelect = item.Status;
|
|
|
+ this.tableParams.CompanyStatus = item.CompanyStatus;
|
|
|
+ if(item.CompanyStatus!=='试用'){
|
|
|
+ this.tableParams.tagStatusSelect = '全部';
|
|
|
+ this.tableParams.tryStatusSelect = 0
|
|
|
+ }
|
|
|
this.handlePageChange(1);
|
|
|
},
|
|
|
//切换客户试用状态
|
|
|
changeTagStatus(item) {
|
|
|
- this.tagStatusSelect = item.TryStage;
|
|
|
+ this.tableParams.tagStatusSelect = item.TryStatus;
|
|
|
+ this.tableParams.tryStatusSelect = item.OverseasLabel
|
|
|
this.handlePageChange(1);
|
|
|
},
|
|
|
handleSortChange() { },
|
|
@@ -252,12 +313,29 @@ export default {
|
|
|
this.currentPage = page;
|
|
|
this.getTableData();
|
|
|
},
|
|
|
- toCustomDetail() { },
|
|
|
+ //跳转至客户详情
|
|
|
+ toCustomDetail(data) {
|
|
|
+ const path = data.Source===1?'/detailCustomEn':'/customDetail'
|
|
|
+ const query = {
|
|
|
+ ...data.Source===1?{
|
|
|
+ companyId:data.CompanyId - 10000000
|
|
|
+ }:{
|
|
|
+ id:data.CompanyId
|
|
|
+ },
|
|
|
+ from:'overseas'
|
|
|
+ }
|
|
|
+ const href = this.$router.resolve({path,query}).href
|
|
|
+ window.open(href,"_blank")
|
|
|
+ },
|
|
|
handleChangeTryStatus(data) {
|
|
|
- const { ProductId, TryStage, CompanyId } = data;
|
|
|
- //接口巴拉巴拉
|
|
|
- //保留筛选参数
|
|
|
- //this.getTableData()
|
|
|
+ const { OverseasLabel, CompanyId } = data;
|
|
|
+ overseasCustomInterence.setCustomTryStatus({
|
|
|
+ CompanyId,OverseasLabel
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ this.$message.success("设置成功")
|
|
|
+ this.getTableData()
|
|
|
+ })
|
|
|
},
|
|
|
handleDialogShow(type,data){
|
|
|
this.customData = data
|
|
@@ -269,7 +347,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getSalesList();
|
|
|
+ this.getSavedSales()
|
|
|
this.getTableData();
|
|
|
},
|
|
|
};
|
|
@@ -380,6 +458,13 @@ export default {
|
|
|
margin-left: 10px;
|
|
|
}
|
|
|
}
|
|
|
+ .editor{
|
|
|
+ color:#409EFF;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover{
|
|
|
+ text-decoration: underline;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|