Commit 6bfd325d authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/huaguohao/crm

# Conflicts:
#	src/plugins/index.js
parents 423d1863 81cf8a05
<style>
@import '../../assets/css/customerManage.css';
.el-table__fixed-body-wrapper table {
padding-bottom: 8px !important;
}
.clueTitle{
padding: 20px 20px 0 20px;
}
</style>
<template>
<div class="customerManage">
<div class="tools">
<div class="tools-item">
<h1 :class="isDrawer?'clueTitle':''">线索管理</h1>
</div>
<template v-if="!isDrawer">
<div style="width: 340px;">
<el-input placeholder="请输入线索名称/手机" v-model="CustomerTypeText" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="getList"></el-button>
</el-input>
</div>
<div class="rightmenu">
<el-dropdown @command="handleCommand">
<el-button icon="el-icon-plus" class="crm-btn org-btn">新建线索</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1"><i class="iconfont iconkehu"></i> 客户线索</el-dropdown-item>
<el-dropdown-item command="2"><i class="iconfont icontongxunlu"></i> 直客线索</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown @command="handleCommand">
<el-button class="crm-btn crm-btn-more easy-btn margin-right0">
<i class="iconfont icongengduo"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="3"><i class="iconfont icondaoru"></i> 导入客户线索</el-dropdown-item>
<el-dropdown-item command="4"><i class="iconfont icondaoru"></i> 导入直客线索</el-dropdown-item>
<!-- <el-dropdown-item><i class="iconfont icondaochu"></i> 导出</el-dropdown-item> -->
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</div>
<div v-if="!isDrawer" class="query-box" :style="{'padding-bottom': sceneList.length > 0 ? '0px' : '10px'}">
<el-row v-if="!multipleSelection.length" :gutter="30">
<el-col :span="4">
<span class="font-size-12" style="padding-right: 10px">场景</span>
<el-popover placement="bottom" width="180" popper-class="popover-class" v-model="visible"
trigger="click">
<div data-v-16d669bb="" class="scene-container">
<div class="scene-list">
<div class="scene-list-item" :class="{'scene-list-item-select': sceneID === item.ID}"
v-for="(item, index) in SceneEmployeeList" :key="index" @click="changeWhere(item)">
{{item.SceneName}}</div>
</div>
<div class="handle-interval">
<div class="vux-flexbox handle-button vux-flex-row"
@click="MsgBus.$emit('sceneBoxShow', 4, 1)">
<i class="el-icon-circle-plus-outline handle-button-icon"></i>
<div class="handle-button-name">新建场景</div>
</div>
<div class="vux-flexbox handle-button vux-flex-row"
@click="MsgBus.$emit('sceneEditBoxShow', 4, SceneEmployeeList)">
<i class="el-icon-setting handle-button-icon"></i>
<div class="handle-button-name">管理</div>
</div>
</div>
</div>
<el-select size="mini" popper-class="select-no" slot="reference" v-model="msg.ID"
placeholder="请选择">
<el-option v-for="item in SceneEmployeeList" :key="item.ID" :label="item.SceneName"
:value="item.ID">
</el-option>
</el-select>
</el-popover>
</el-col>
<el-col :span="4">
<span class="font-size-12" style="padding-right: 10px">客户类型</span>
<el-select size="mini" v-model="msg.CustomerType" placeholder="请选择" @change="getList">
<el-option key="0" label="客户" :value="0"></el-option>
<el-option key="1" label="直客" :value="1"></el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-button icon="iconfont iconshaixuan" class="crm-btn query-btn crm-btn-mini margin-right0"
@click="MsgBus.$emit('sceneBoxShow', 4)">高级筛选</el-button>
</el-col>
</el-row>
<div v-else class="flex-center">
<p class="font-size-12">已选 <span class="font-color-link">{{multipleSelection.length}}</span></p>
<div class="selection-box">
<el-button v-for="(item, index) in selectionList" :key="index" @click="item.myFun"><i
:class="item.class"></i>{{item.name}}</el-button>
</div>
</div>
<div class="scene-wrapper" v-if="sceneList.length > 0">
<ul class="list">
<li class="list-item" v-for="(item, index) in sceneList" :key="index">
<span
v-if="item.formType !== 'datetime'">{{item.str}}&nbsp;{{item.regionStr}}“{{item.nameFC ? item.nameFC : item.value}}”</span>
<span v-else>{{item.str}}&nbsp;“{{item.start}}-{{item.end}}”</span>
<i class="el-icon-close icon" @click="deleteScene(index)"></i>
</li>
</ul>
</div>
</div>
<div class="page-content">
<el-table v-if="loading" v-loading="true" :data="[]">
<el-table-column v-for="(item, index) in queryType2" :key="index" :label="item.label">
</el-table-column>
</el-table>
<el-table v-if="!loading" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
:height="sceneList.length > 0 ? '600' : '660'" border row-class-name="font-size-12"
@selection-change="handleSelectionChange">
<el-table-column v-if="!isDrawer" fixed type="selection" width="40"></el-table-column>
<el-table-column prop="ClueState" label="线索状态" show-overflow-tooltip width="80">
<template slot-scope="scope">
<template v-if="scope.row.ClueState==1">
正常
</template>
<template v-else-if="scope.row.ClueState==2">
无效
</template>
</template>
</el-table-column>
<el-table-column prop="ClueName" label="线索名称" v-if="queryType[0].show" show-overflow-tooltip>
<template slot-scope="scope">
<p @click="openDetails(scope)" class="font-color-link cp">
{{msg.CustomerType===1?scope.row.ClueName:scope.row.CustomerName}}</p>
</template>
</el-table-column>
<el-table-column prop="CustomerSourceTypeStr" label="线索来源" v-if="queryType[1].show"
show-overflow-tooltip width="80">
</el-table-column>
<!--CustomerSource其他的来源 -->
<el-table-column prop="SourceAccountName" label="来源细分"
v-if="queryType[2].show && msg.CustomerType === 1" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="ClueDemand" label="需求" v-if="queryType[3].show && msg.CustomerType === 1"
show-overflow-tooltip width="260">
</el-table-column>
<el-table-column prop="CustomerLevelStr" label="客户级别" sortable width="100"
v-if="queryType[4].show && msg.CustomerType === 0" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="Contact" label="联系人" v-if="queryType[5].show&&msg.CustomerType!=1"
show-overflow-tooltip>
</el-table-column>
<el-table-column prop="CustomerName" label="联系人" v-if="queryType[5].show&&msg.CustomerType===1"
show-overflow-tooltip width="100">
</el-table-column>
<el-table-column prop="ContactNumber" label="联系电话" sortable v-if="queryType[6].show"
show-overflow-tooltip>
</el-table-column>
<el-table-column prop="WeChatNo" label="微信号" sortable v-if="queryType[7].show && msg.CustomerType === 1"
show-overflow-tooltip>
</el-table-column>
<el-table-column prop="PersonChargeStr" label="负责人" sortable
v-if="queryType[8].show && msg.CustomerType === 1" show-overflow-tooltip width="90">
</el-table-column>
<el-table-column prop="CreateByStr" label="创建人" sortable v-if="queryType[9].show" show-overflow-tooltip width="90">
</el-table-column>
<el-table-column prop="UpdateTime" label="上次更新时间" sortable v-if="queryType[10].show"
show-overflow-tooltip>
<template slot-scope="scope">
<span>{{scope.row.UpdateTime}}</span>
</template>
</el-table-column>
<el-table-column prop="CreateTimestr" label="创建时间" sortable v-if="queryType[11].show"
show-overflow-tooltip>
</el-table-column>
<el-table-column prop="IsCarefor" fixed="right" width="50" label="关注">
<template slot-scope="scope">
<p>
<el-tooltip class="item" effect="dark" content="关注" placement="top">
<i v-if="scope.row.IsCarefor === 0" @click="CareforCustomer(scope)"
class="iconfont iconwujiaoxing cp"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="取消关注" placement="top">
<i v-if="scope.row.IsCarefor === 1" @click="CareforCustomer(scope)"
class="iconfont iconstar_full cp"></i>
</el-tooltip>
</p>
</template>
</el-table-column>
<el-table-column width="40" fixed="right">
<template slot="header" slot-scope="scope">
<el-popover placement="bottom" width="240">
<mySelect :queryType="queryType" @listenTochildEvent="showMessageFromChild" />
<i class="el-icon-s-operation cp" slot="reference"></i>
</el-popover>
</template>
</el-table-column>
</el-table>
</div>
<div>
<el-pagination class="Mypagination" background @current-change="handleCurrentChange"
:page-sizes="[30, 60, 90, 100]" :page-size="msg.pageSize" layout="total, sizes, prev, pager, next"
@size-change="handleSizeChange" :total="total">
</el-pagination>
</div>
<el-drawer :with-header="false" size='70%' :visible.sync="isShowCustomerInfo" direction="rtl"
:before-close="handleClose">
<customerInfoBox :CustomerId="CustomerId" @transferS="transfer" @deleteClue="deleteClue" @watersS="waters"
@editCustS="editCust" @getList="getList" />
</el-drawer>
<el-drawer :with-header="false" size='70%' :visible.sync="isShowGuestInfo" direction="rtl"
:before-close="handleClose">
<guestInfoBox :CustomerId="CustomerId" @transferS="transfer" @deleteClue="deleteClue" @watersS="waters"
@editCustS="editCust" @getList="getList" />
</el-drawer>
<div v-if="dialogTableVisible">
<customerDialogBox @getList="getList" :name="dialogTableVisibleName" :CustomerId="CustomerId" />
</div>
<div v-if="guestDialogBoxShow">
<guestDialogBox @getList="getList" :name="dialogTableVisibleName" :CustomerId="CustomerId" />
</div>
<!--显示导入弹窗-->
<div v-if="isShowImport">
<importDialogBox @getList="getList" :importType="importType" />
</div>
<el-dialog :visible.sync="transferVisible" :close-on-click-modal="false" width="450px"
custom-class="transfer-box add-box add-box2">
<div class="add-tit" slot="title">
<p><span></span>线索转移</p>
<span icon="el-icon-close"></span>
</div>
<el-form :model="transferMsg" ref="form" class="MyEditForm">
<div class="MyEditForm-item">
<el-form-item label="变更负责人为" class="label-pad-left">
<el-select filterable v-model="transferMsg.EmpId" placeholder="请选择">
<el-option v-for="item in EmployeeList" :label='item.EmName' :value='item.EmployeeId'
:key='item.EmployeeId'>
</el-option>
</el-select>
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" class="add-box-btn" @click="transfer(2)">确 定</el-button>
<el-button class="add-box-btn add-box-cancel" @click="transferVisible = false">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import mySelect from "../dialogModel/select";
import customerInfoBox from "./customerInfoBox";
import customerDialogBox from "./customerDialogBox";
import guestDialogBox from "./guestDialogBox";
import guestInfoBox from "./guestInfoBox";
import importDialogBox from "./importDialogBox";
export default {
props:{
isDrawer:{
type:Boolean,
default: false,
},
queryTime:{
type:Object,
default: null
}
},
watch: {
queryTime: {
handler(val, oldVal) {
this.queryTime = val;
this.getList()
},
deep: true,
}
},
components: {
mySelect,
customerInfoBox,
customerDialogBox,
guestDialogBox,
guestInfoBox,
importDialogBox,
},
data() {
return {
ruleList: [],
guestDialogBoxShow: false,
isShowGuestInfo: false, //是否显示直客弹窗
activeMenu: 1,
queryType2: [{
label: '线索名称',
show: true,
}, {
label: '线索来源',
show: true,
}, {
label: '来源细分',
show: true,
}, {
label: '需求',
show: true,
}, {
label: '客户级别',
show: true,
}, {
label: '联系人',
show: true,
}, {
label: '联系电话',
show: true,
}, {
label: '微信',
show: true,
}, {
label: '负责人',
show: true,
}, {
label: '创建人',
show: true,
}, {
label: '上次更新时间',
show: true,
}, {
label: '创建时间',
show: true,
}],
queryType: [{
label: '线索名称',
show: true,
}, {
label: '线索来源',
show: true,
}, {
label: '来源细分',
show: true,
}, {
label: '需求',
show: true,
}, {
label: '客户级别',
show: true,
}, {
label: '联系人',
show: true,
}, {
label: '联系电话',
show: true,
}, {
label: '微信',
show: true,
}, {
label: '负责人',
show: true,
}, {
label: '创建人',
show: true,
}, {
label: '上次更新时间',
show: true,
}, {
label: '创建时间',
show: true,
}],
CustomerId: 0,
CustomerIdStr: '',
transferVisible: false,
mySelectCtrl: false,
isShowCustomerInfo: false, //是否显示客户弹窗
loading: true,
dialogTableVisible: false,
dialogTableVisibleName: '新建线索',
tableData: [],
multipleSelection: [],
EmployeeList: [],
value: '',
userInfo: {},
transferMsg: {
CustomerIds: [],
EmpId: '',
},
CustomerTypeText:"",// 线索名称搜索
msg: {
KeyWord:'',
CustomerName: '',
Contact: '',
pageIndex: 1,
pageSize: 30,
ContactNumber: '',
WhereType: -1,
OrderBy: '',
CustomerType: 1,
ID: 33,
},
total: 0,
selectionList: [{
name: '转移',
class: 'iconfont iconplus-transfer',
myFun: this.transfer
}, {
name: '转化为客户',
class: 'iconfont iconplus-transfer',
myFun: this.waters
}, {
name: '删除',
class: 'iconfont icondelete',
myFun: this.deleteClue
}],
sceneList: [],
SceneEmployeeList: [],
sceneID: 33,
visible: false,
isShowImport: false, //是否显示导入弹窗
importType: 1, //导入文件类型(1-客户导入,2-直客导入)
};
},
mounted() {
this.userInfo = this.getLocalStorage();
this.getList()
this.Employee()
let $this = this
this.MsgBus.$on('closeCustomerDialogBox', function () {
$this.dialogTableVisible = false;
$this.guestDialogBoxShow = false;
$this.isShowImport = false;
})
this.GetSceneEmployeeList()
this.MsgBus.$on('sceneSave', function (msg) {
$this.sceneList = [...msg]
$this.GetSceneEmployeeList()
let obj = {}
msg.forEach(element => {
obj[element.name] = element
});
$this.msg.Data = obj
$this.getList()
})
this.MsgBus.$on('editScene', function () {
$this.GetSceneEmployeeList()
})
},
beforeDestroy() {
this.MsgBus.$off('sceneSave');
this.MsgBus.$off('editScene');
},
methods: {
handleClose(done) {
done();
},
// 查看详情
seeDetails(row){
this.drawer = true
this.queryTime = this.msg.YearStr+'-'+row.DateStr
},
changeWhere(item) {
this.msg.ID = item.ID
this.sceneID = item.ID
this.msg.Data = item.WhereData ? JSON.parse(item.WhereData) : {}
this.msg.WhereType = item.WhereType
this.visible = false
this.getList()
},
GetSceneEmployeeList() {
this.apipost('/api/Scene/GetSceneEmployeeList', {
LableType: 4
}, res => {
if (res.data.resultCode == 1) {
this.SceneEmployeeList = res.data.data
}
})
},
deleteScene(index) {
this.sceneList.splice(index, 1)
let obj = {}
this.sceneList.forEach(element => {
obj[element.name] = element
});
this.msg.Data = obj
this.getList()
},
handleCommand(command) {
this.CustomerId = 0
if (command === '1') {
this.dialogTableVisibleName = '新建线索'
this.dialogTableVisible = true
} else if (command === '2') {
this.guestDialogBoxShow = true
} else if (command === '3') {
this.importType = 1;
this.isShowImport = true;
} else if (command === '4') {
this.importType = 2;
this.isShowImport = true;
}
},
Employee() {
let msg = {
RB_Group_id: this.userInfo.RB_Group_id,
BranchId: -1,
DepartmentId: 0,
PostId: 0,
IsLeave: 0,
}
this.apipost2(
"admin_get_EmployeeGetList",
this.msg,
res => {
if (res.data.resultCode == 1) {
this.EmployeeList = res.data.data;
} else {}
},
err => {}
);
},
//删除
deleteClue(type) {
let tips = '确定将这些线索删除?'
if (type === 1) {
tips = '是否把线索“' + this.CustomerName + '”删除?'
this.multipleSelection.push(this.CustomerId)
}
this.$confirm(tips, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let str = ''
this.multipleSelection.map((x, i) => {
str = str + x + ','
})
this.apipost('/api/Customer/DelCustomerClue', {
CustomerIds: str.substring(0, str.length - 1)
}, res => {
if (res.data.resultCode == 1) {
if (type === 1) {} {
this.isShowCustomerInfo = false
this.isShowGuestInfo = false
}
this.multipleSelection = []
this.$message.success(res.data.message);
this.getList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
//导出
export () {
},
//转换为客户
waters(type) {
let tips = '确定将这些线索转换为客户吗?'
if (type === 1) {
tips = '是否把线索“' + this.CustomerName + '”转换为客户吗?'
this.multipleSelection.push(this.CustomerId)
}
this.$confirm(tips, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let str = ''
this.multipleSelection.map((x, i) => {
str = str + x + ','
})
let msg = {
CustomerIds: str.substring(0, str.length - 1),
CustomerType: this.msg.CustomerType
}
this.apipost('/api/Customer/UpdateCustomerClue', msg, res => {
if (res.data.resultCode == 1) {
if (type === 1) {} {
this.isShowCustomerInfo = false
this.isShowGuestInfo = false
}
this.multipleSelection = []
this.$message.success(res.data.message);
this.getList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
// 关注
CareforCustomer(scope) {
this.apipost('/api/Customer/CareforCustomer', {
CustomerCreateId: scope.row.CustomerCreateId
}, res => {
if (res.data.resultCode == 1) {
this.$message.success('操作成功');
this.getList()
}
})
},
// 转移
transfer(type) {
if (type !== 2) {
if (type === 3) {
this.multipleSelection.push(this.CustomerId)
}
if (this.ruleList.length == 0) {
this.transferVisible = true
} else {
let tips = '系统已开启自动分配,无法指定推送,是否继续推送?'
this.$confirm(tips, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let ids
if (this.CustomerId) {
ids = this.CustomerId
} else {
ids = this.multipleSelection.join(',')
}
this.apipost('/api/Customer/AutoTransferCustomer', {
IDs: ids
}, res => {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.getList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
} else {
if (this.transferMsg.EmpId === '') {
return this.$message.error('请选择变更负责人!')
}
let str = ''
this.multipleSelection.map((x, i) => {
str = str + x + ','
})
this.transferMsg.CustomerIds = str.substring(0, str.length - 1)
this.apipost('/api/Customer/TransferCustomerClue', this.transferMsg, res => {
if (res.data.resultCode == 1) {
this.multipleSelection = []
this.transferVisible = false
if (type === 3) {} {
this.isShowCustomerInfo = false
this.isShowGuestInfo = false
}
this.$message.success(res.data.message);
this.getList()
this.transferMsg = {
CustomerIds: [],
EmpId: '',
}
}
})
}
},
showMessageFromChild(list) {
this.mySelectCtrl = !this.mySelectCtrl
if (list) {
this.queryType = list
this.getList()
}
},
editCust(type) {
this.dialogTableVisibleName = '修改线索'
if (type === 1) {
this.dialogTableVisible = true
} else {
this.guestDialogBoxShow = true
}
},
openDetails(scope) {
this.CustomerId = scope.row.CustomerId
this.CustomerName = scope.row.CustomerName
if (this.msg.CustomerType === 0) {
this.isShowCustomerInfo = true
} else {
this.isShowGuestInfo = true
}
},
// 获取是否开启规则
GetCustomerAllotRule() {
this.apipost('/api/Customer/GetCustomerAllotRule', {}, res => {
if (res.data.resultCode == 1) {
this.ruleList = res.data.data.EmpList
}
})
},
handleSizeChange(val) {
this.msg.pageSize = val
this.getList();
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
handleClose(done) {
done();
},
getList: function (isclose) {
if(isclose&&isclose==1)
{
this.isShowGuestInfo=false;
}
if(this.msg.CustomerType!=1){
this.msg.CustomerName = this.CustomerTypeText
this.msg.KeyWord=""
}else{
this.msg.KeyWord = this.CustomerTypeText
this.msg.CustomerName=""
}
this.tableData = []
this.loading = true
let url
if(!this.isDrawer){
url = '/api/Customer/GetCustomerCluePage'
}else{
this.msg.StartTime = this.queryTime&&this.queryTime.StartTime
this.msg.EndTime = this.queryTime&&this.queryTime.EndTime
url = '/api/Customer/GetCustomerClueAllPage'
}
this.apipost(url, this.msg, res => {
if (res.data.resultCode == 1) {
this.tableData = res.data.data.pageData;
this.total = res.data.data.count;
this.loading = false;
}
})
if (this.msg.CustomerType == 1) {
// 获取是否开启规则
this.GetCustomerAllotRule()
}
},
handleSelectionChange(val) {
this.multipleSelection = val.map(x =>
x.CustomerId
)
}
}
};
</script>
\ No newline at end of file
......@@ -6,703 +6,29 @@
}
</style>
<template>
<div class="customerManage">
<div class="tools">
<div class="tools-item">
<h1>线索管理</h1>
</div>
<div style="width: 340px;">
<el-input placeholder="请输入线索名称/手机" v-model="CustomerTypeText" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="getList"></el-button>
</el-input>
</div>
<div class="rightmenu">
<el-dropdown @command="handleCommand">
<el-button icon="el-icon-plus" class="crm-btn org-btn">新建线索</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1"><i class="iconfont iconkehu"></i> 客户线索</el-dropdown-item>
<el-dropdown-item command="2"><i class="iconfont icontongxunlu"></i> 直客线索</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown @command="handleCommand">
<el-button class="crm-btn crm-btn-more easy-btn margin-right0">
<i class="iconfont icongengduo"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="3"><i class="iconfont icondaoru"></i> 导入客户线索</el-dropdown-item>
<el-dropdown-item command="4"><i class="iconfont icondaoru"></i> 导入直客线索</el-dropdown-item>
<!-- <el-dropdown-item><i class="iconfont icondaochu"></i> 导出</el-dropdown-item> -->
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<div class="query-box" :style="{'padding-bottom': sceneList.length > 0 ? '0px' : '10px'}">
<el-row v-if="!multipleSelection.length" :gutter="30">
<el-col :span="4">
<span class="font-size-12" style="padding-right: 10px">场景</span>
<el-popover placement="bottom" width="180" popper-class="popover-class" v-model="visible"
trigger="click">
<div data-v-16d669bb="" class="scene-container">
<div class="scene-list">
<div class="scene-list-item" :class="{'scene-list-item-select': sceneID === item.ID}"
v-for="(item, index) in SceneEmployeeList" :key="index" @click="changeWhere(item)">
{{item.SceneName}}</div>
</div>
<div class="handle-interval">
<div class="vux-flexbox handle-button vux-flex-row"
@click="MsgBus.$emit('sceneBoxShow', 4, 1)">
<i class="el-icon-circle-plus-outline handle-button-icon"></i>
<div class="handle-button-name">新建场景</div>
</div>
<div class="vux-flexbox handle-button vux-flex-row"
@click="MsgBus.$emit('sceneEditBoxShow', 4, SceneEmployeeList)">
<i class="el-icon-setting handle-button-icon"></i>
<div class="handle-button-name">管理</div>
</div>
</div>
</div>
<el-select size="mini" popper-class="select-no" slot="reference" v-model="msg.ID"
placeholder="请选择">
<el-option v-for="item in SceneEmployeeList" :key="item.ID" :label="item.SceneName"
:value="item.ID">
</el-option>
</el-select>
</el-popover>
</el-col>
<el-col :span="4">
<span class="font-size-12" style="padding-right: 10px">客户类型</span>
<el-select size="mini" v-model="msg.CustomerType" placeholder="请选择" @change="getList">
<el-option key="0" label="客户" :value="0"></el-option>
<el-option key="1" label="直客" :value="1"></el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-button icon="iconfont iconshaixuan" class="crm-btn query-btn crm-btn-mini margin-right0"
@click="MsgBus.$emit('sceneBoxShow', 4)">高级筛选</el-button>
</el-col>
</el-row>
<div v-else class="flex-center">
<p class="font-size-12">已选 <span class="font-color-link">{{multipleSelection.length}}</span></p>
<div class="selection-box">
<el-button v-for="(item, index) in selectionList" :key="index" @click="item.myFun"><i
:class="item.class"></i>{{item.name}}</el-button>
</div>
</div>
<div class="scene-wrapper" v-if="sceneList.length > 0">
<ul class="list">
<li class="list-item" v-for="(item, index) in sceneList" :key="index">
<span
v-if="item.formType !== 'datetime'">{{item.str}}&nbsp;{{item.regionStr}}{{item.nameFC ? item.nameFC : item.value}}</span>
<span v-else>{{item.str}}&nbsp;{{item.start}}-{{item.end}}</span>
<i class="el-icon-close icon" @click="deleteScene(index)"></i>
</li>
</ul>
</div>
</div>
<div class="page-content">
<el-table v-if="loading" v-loading="true" :data="[]">
<el-table-column v-for="(item, index) in queryType2" :key="index" :label="item.label">
</el-table-column>
</el-table>
<el-table v-if="!loading" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
:height="sceneList.length > 0 ? '600' : '660'" border row-class-name="font-size-12"
@selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="40"></el-table-column>
<el-table-column prop="ClueState" label="线索状态" show-overflow-tooltip width="80">
<template slot-scope="scope">
<template v-if="scope.row.ClueState==1">
正常
</template>
<template v-else-if="scope.row.ClueState==2">
无效
</template>
</template>
</el-table-column>
<el-table-column prop="ClueName" label="线索名称" v-if="queryType[0].show" show-overflow-tooltip>
<template slot-scope="scope">
<p @click="openDetails(scope)" class="font-color-link cp">
{{msg.CustomerType===1?scope.row.ClueName:scope.row.CustomerName}}</p>
</template>
</el-table-column>
<el-table-column prop="CustomerSourceTypeStr" label="线索来源" v-if="queryType[1].show"
show-overflow-tooltip width="80">
</el-table-column>
<!--CustomerSource其他的来源 -->
<el-table-column prop="SourceAccountName" label="来源细分"
v-if="queryType[2].show && msg.CustomerType === 1" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="ClueDemand" label="需求" v-if="queryType[3].show && msg.CustomerType === 1"
show-overflow-tooltip width="260">
</el-table-column>
<el-table-column prop="CustomerLevelStr" label="客户级别" sortable width="100"
v-if="queryType[4].show && msg.CustomerType === 0" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="Contact" label="联系人" v-if="queryType[5].show&&msg.CustomerType!=1"
show-overflow-tooltip>
</el-table-column>
<el-table-column prop="CustomerName" label="联系人" v-if="queryType[5].show&&msg.CustomerType===1"
show-overflow-tooltip width="100">
</el-table-column>
<el-table-column prop="ContactNumber" label="联系电话" sortable v-if="queryType[6].show"
show-overflow-tooltip>
</el-table-column>
<el-table-column prop="WeChatNo" label="微信号" sortable v-if="queryType[7].show && msg.CustomerType === 1"
show-overflow-tooltip>
</el-table-column>
<el-table-column prop="PersonChargeStr" label="负责人" sortable
v-if="queryType[8].show && msg.CustomerType === 1" show-overflow-tooltip width="90">
</el-table-column>
<el-table-column prop="CreateByStr" label="创建人" sortable v-if="queryType[9].show" show-overflow-tooltip width="90">
</el-table-column>
<el-table-column prop="UpdateTime" label="上次更新时间" sortable v-if="queryType[10].show"
show-overflow-tooltip>
<template slot-scope="scope">
<span>{{scope.row.UpdateTime}}</span>
</template>
</el-table-column>
<el-table-column prop="CreateTimestr" label="创建时间" sortable v-if="queryType[11].show"
show-overflow-tooltip>
</el-table-column>
<el-table-column prop="IsCarefor" fixed="right" width="50" label="关注">
<template slot-scope="scope">
<p>
<el-tooltip class="item" effect="dark" content="关注" placement="top">
<i v-if="scope.row.IsCarefor === 0" @click="CareforCustomer(scope)"
class="iconfont iconwujiaoxing cp"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="取消关注" placement="top">
<i v-if="scope.row.IsCarefor === 1" @click="CareforCustomer(scope)"
class="iconfont iconstar_full cp"></i>
</el-tooltip>
</p>
</template>
</el-table-column>
<el-table-column width="40" fixed="right">
<template slot="header" slot-scope="scope">
<el-popover placement="bottom" width="240">
<mySelect :queryType="queryType" @listenTochildEvent="showMessageFromChild" />
<i class="el-icon-s-operation cp" slot="reference"></i>
</el-popover>
</template>
</el-table-column>
</el-table>
</div>
<div>
<el-pagination class="Mypagination" background @current-change="handleCurrentChange"
:page-sizes="[30, 60, 90, 100]" :page-size="msg.pageSize" layout="total, sizes, prev, pager, next"
@size-change="handleSizeChange" :total="total">
</el-pagination>
</div>
<el-drawer :with-header="false" size='70%' :visible.sync="isShowCustomerInfo" direction="rtl"
:before-close="handleClose">
<customerInfoBox :CustomerId="CustomerId" @transferS="transfer" @deleteClue="deleteClue" @watersS="waters"
@editCustS="editCust" @getList="getList" />
</el-drawer>
<el-drawer :with-header="false" size='70%' :visible.sync="isShowGuestInfo" direction="rtl"
:before-close="handleClose">
<guestInfoBox :CustomerId="CustomerId" @transferS="transfer" @deleteClue="deleteClue" @watersS="waters"
@editCustS="editCust" @getList="getList" />
</el-drawer>
<div v-if="dialogTableVisible">
<customerDialogBox @getList="getList" :name="dialogTableVisibleName" :CustomerId="CustomerId" />
</div>
<div v-if="guestDialogBoxShow">
<guestDialogBox @getList="getList" :name="dialogTableVisibleName" :CustomerId="CustomerId" />
</div>
<!--显示导入弹窗-->
<div v-if="isShowImport">
<importDialogBox @getList="getList" :importType="importType" />
</div>
<el-dialog :visible.sync="transferVisible" :close-on-click-modal="false" width="450px"
custom-class="transfer-box add-box add-box2">
<div class="add-tit" slot="title">
<p><span></span>线索转移</p>
<span icon="el-icon-close"></span>
</div>
<el-form :model="transferMsg" ref="form" class="MyEditForm">
<div class="MyEditForm-item">
<el-form-item label="变更负责人为" class="label-pad-left">
<el-select filterable v-model="transferMsg.EmpId" placeholder="请选择">
<el-option v-for="item in EmployeeList" :label='item.EmName' :value='item.EmployeeId'
:key='item.EmployeeId'>
</el-option>
</el-select>
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" class="add-box-btn" @click="transfer(2)">确 定</el-button>
<el-button class="add-box-btn add-box-cancel" @click="transferVisible = false">取 消</el-button>
</div>
</el-dialog>
<div>
<clueComponent :isDrawer="isDrawer"></clueComponent>
</div>
</template>
<script>
import mySelect from "../dialogModel/select";
import customerInfoBox from "./customerInfoBox";
import customerDialogBox from "./customerDialogBox";
import guestDialogBox from "./guestDialogBox";
import guestInfoBox from "./guestInfoBox";
import importDialogBox from "./importDialogBox";
import clueComponent from "./clueComponent";
export default {
components: {
mySelect,
customerInfoBox,
customerDialogBox,
guestDialogBox,
guestInfoBox,
importDialogBox,
clueComponent
},
data() {
return {
ruleList: [],
guestDialogBoxShow: false,
isShowGuestInfo: false, //是否显示直客弹窗
activeMenu: 1,
queryType2: [{
label: '线索名称',
show: true,
}, {
label: '线索来源',
show: true,
}, {
label: '来源细分',
show: true,
}, {
label: '需求',
show: true,
}, {
label: '客户级别',
show: true,
}, {
label: '联系人',
show: true,
}, {
label: '联系电话',
show: true,
}, {
label: '微信',
show: true,
}, {
label: '负责人',
show: true,
}, {
label: '创建人',
show: true,
}, {
label: '上次更新时间',
show: true,
}, {
label: '创建时间',
show: true,
}],
queryType: [{
label: '线索名称',
show: true,
}, {
label: '线索来源',
show: true,
}, {
label: '来源细分',
show: true,
}, {
label: '需求',
show: true,
}, {
label: '客户级别',
show: true,
}, {
label: '联系人',
show: true,
}, {
label: '联系电话',
show: true,
}, {
label: '微信',
show: true,
}, {
label: '负责人',
show: true,
}, {
label: '创建人',
show: true,
}, {
label: '上次更新时间',
show: true,
}, {
label: '创建时间',
show: true,
}],
CustomerId: 0,
CustomerIdStr: '',
transferVisible: false,
mySelectCtrl: false,
isShowCustomerInfo: false, //是否显示客户弹窗
loading: true,
dialogTableVisible: false,
dialogTableVisibleName: '新建线索',
tableData: [],
multipleSelection: [],
EmployeeList: [],
value: '',
userInfo: {},
transferMsg: {
CustomerIds: [],
EmpId: '',
},
CustomerTypeText:"",// 线索名称搜索
msg: {
KeyWord:'',
CustomerName: '',
Contact: '',
pageIndex: 1,
pageSize: 30,
ContactNumber: '',
WhereType: -1,
OrderBy: '',
CustomerType: 1,
ID: 33,
},
total: 0,
selectionList: [{
name: '转移',
class: 'iconfont iconplus-transfer',
myFun: this.transfer
}, {
name: '转化为客户',
class: 'iconfont iconplus-transfer',
myFun: this.waters
}, {
name: '删除',
class: 'iconfont icondelete',
myFun: this.deleteClue
}],
sceneList: [],
SceneEmployeeList: [],
sceneID: 33,
visible: false,
isShowImport: false, //是否显示导入弹窗
importType: 1, //导入文件类型(1-客户导入,2-直客导入)
isDrawer: false
};
},
mounted() {
this.userInfo = this.getLocalStorage();
this.getList()
this.Employee()
let $this = this
this.MsgBus.$on('closeCustomerDialogBox', function () {
$this.dialogTableVisible = false;
$this.guestDialogBoxShow = false;
$this.isShowImport = false;
})
this.GetSceneEmployeeList()
this.MsgBus.$on('sceneSave', function (msg) {
$this.sceneList = [...msg]
$this.GetSceneEmployeeList()
let obj = {}
msg.forEach(element => {
obj[element.name] = element
});
$this.msg.Data = obj
$this.getList()
})
this.MsgBus.$on('editScene', function () {
$this.GetSceneEmployeeList()
})
},
beforeDestroy() {
this.MsgBus.$off('sceneSave');
this.MsgBus.$off('editScene');
},
methods: {
changeWhere(item) {
this.msg.ID = item.ID
this.sceneID = item.ID
this.msg.Data = item.WhereData ? JSON.parse(item.WhereData) : {}
this.msg.WhereType = item.WhereType
this.visible = false
this.getList()
},
GetSceneEmployeeList() {
this.apipost('/api/Scene/GetSceneEmployeeList', {
LableType: 4
}, res => {
if (res.data.resultCode == 1) {
this.SceneEmployeeList = res.data.data
}
})
},
deleteScene(index) {
this.sceneList.splice(index, 1)
let obj = {}
this.sceneList.forEach(element => {
obj[element.name] = element
});
this.msg.Data = obj
this.getList()
},
handleCommand(command) {
this.CustomerId = 0
if (command === '1') {
this.dialogTableVisibleName = '新建线索'
this.dialogTableVisible = true
} else if (command === '2') {
this.guestDialogBoxShow = true
} else if (command === '3') {
this.importType = 1;
this.isShowImport = true;
} else if (command === '4') {
this.importType = 2;
this.isShowImport = true;
}
},
Employee() {
let msg = {
RB_Group_id: this.userInfo.RB_Group_id,
BranchId: -1,
DepartmentId: 0,
PostId: 0,
IsLeave: 0,
}
this.apipost2(
"admin_get_EmployeeGetList",
this.msg,
res => {
if (res.data.resultCode == 1) {
this.EmployeeList = res.data.data;
} else {}
},
err => {}
);
},
//删除
deleteClue(type) {
let tips = '确定将这些线索删除?'
if (type === 1) {
tips = '是否把线索“' + this.CustomerName + '”删除?'
this.multipleSelection.push(this.CustomerId)
}
this.$confirm(tips, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let str = ''
this.multipleSelection.map((x, i) => {
str = str + x + ','
})
this.apipost('/api/Customer/DelCustomerClue', {
CustomerIds: str.substring(0, str.length - 1)
}, res => {
if (res.data.resultCode == 1) {
if (type === 1) {} {
this.isShowCustomerInfo = false
this.isShowGuestInfo = false
}
this.multipleSelection = []
this.$message.success(res.data.message);
this.getList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
//导出
export () {
},
//转换为客户
waters(type) {
let tips = '确定将这些线索转换为客户吗?'
if (type === 1) {
tips = '是否把线索“' + this.CustomerName + '”转换为客户吗?'
this.multipleSelection.push(this.CustomerId)
}
this.$confirm(tips, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let str = ''
this.multipleSelection.map((x, i) => {
str = str + x + ','
})
let msg = {
CustomerIds: str.substring(0, str.length - 1),
CustomerType: this.msg.CustomerType
}
this.apipost('/api/Customer/UpdateCustomerClue', msg, res => {
if (res.data.resultCode == 1) {
if (type === 1) {} {
this.isShowCustomerInfo = false
this.isShowGuestInfo = false
}
this.multipleSelection = []
this.$message.success(res.data.message);
this.getList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
// 关注
CareforCustomer(scope) {
this.apipost('/api/Customer/CareforCustomer', {
CustomerCreateId: scope.row.CustomerCreateId
}, res => {
if (res.data.resultCode == 1) {
this.$message.success('操作成功');
this.getList()
}
})
},
// 转移
transfer(type) {
if (type !== 2) {
if (type === 3) {
this.multipleSelection.push(this.CustomerId)
}
if (this.ruleList.length == 0) {
this.transferVisible = true
} else {
let tips = '系统已开启自动分配,无法指定推送,是否继续推送?'
this.$confirm(tips, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let ids
if (this.CustomerId) {
ids = this.CustomerId
} else {
ids = this.multipleSelection.join(',')
}
this.apipost('/api/Customer/AutoTransferCustomer', {
IDs: ids
}, res => {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message);
this.getList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
} else {
if (this.transferMsg.EmpId === '') {
return this.$message.error('请选择变更负责人!')
}
let str = ''
this.multipleSelection.map((x, i) => {
str = str + x + ','
})
this.transferMsg.CustomerIds = str.substring(0, str.length - 1)
this.apipost('/api/Customer/TransferCustomerClue', this.transferMsg, res => {
if (res.data.resultCode == 1) {
this.multipleSelection = []
this.transferVisible = false
if (type === 3) {} {
this.isShowCustomerInfo = false
this.isShowGuestInfo = false
}
this.$message.success(res.data.message);
this.getList()
this.transferMsg = {
CustomerIds: [],
EmpId: '',
}
}
})
}
},
showMessageFromChild(list) {
this.mySelectCtrl = !this.mySelectCtrl
if (list) {
this.queryType = list
this.getList()
}
},
editCust(type) {
this.dialogTableVisibleName = '修改线索'
if (type === 1) {
this.dialogTableVisible = true
} else {
this.guestDialogBoxShow = true
}
},
openDetails(scope) {
this.CustomerId = scope.row.CustomerId
this.CustomerName = scope.row.CustomerName
if (this.msg.CustomerType === 0) {
this.isShowCustomerInfo = true
} else {
this.isShowGuestInfo = true
}
},
// 获取是否开启规则
GetCustomerAllotRule() {
this.apipost('/api/Customer/GetCustomerAllotRule', {}, res => {
if (res.data.resultCode == 1) {
this.ruleList = res.data.data.EmpList
}
})
},
handleSizeChange(val) {
this.msg.pageSize = val
this.getList();
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
handleClose(done) {
done();
},
getList: function (isclose) {
if(isclose&&isclose==1)
{
this.isShowGuestInfo=false;
}
if(this.msg.CustomerType!=1){
this.msg.CustomerName = this.CustomerTypeText
this.msg.KeyWord=""
}else{
this.msg.KeyWord = this.CustomerTypeText
this.msg.CustomerName=""
}
this.tableData = []
this.loading = true
this.apipost('/api/Customer/GetCustomerCluePage', this.msg, res => {
if (res.data.resultCode == 1) {
this.tableData = res.data.data.pageData;
this.total = res.data.data.count;
this.loading = false;
}
})
if (this.msg.CustomerType == 1) {
// 获取是否开启规则
this.GetCustomerAllotRule()
}
},
handleSelectionChange(val) {
this.multipleSelection = val.map(x =>
x.CustomerId
)
}
}
};
</script>
\ No newline at end of file
<style>
@import '../../assets/css/customerManage.css';
.SelectedAccount_box{
display: flex;
flex-wrap: wrap;
}
.SelectedAccount{
margin: 5px;
cursor: pointer;
}
.sub-header div.active{
color: #409EFF;
border-bottom: 2px solid #409EFF;
}
.sub-header div{
padding: 20px 15px;
cursor: pointer;
}
.sub-header{
display: flex;
padding: 0 20px;
background-color: #fff;
}
@import '../../assets/css/customerManage.css';
.SelectedAccount_box {
display: flex;
flex-wrap: wrap;
}
.SelectedAccount {
margin: 5px;
cursor: pointer;
}
.sub-header div.active {
color: #409EFF;
border-bottom: 2px solid #409EFF;
}
.sub-header div {
padding: 20px 15px;
cursor: pointer;
}
.sub-header {
display: flex;
padding: 0 20px;
background-color: #fff;
}
</style>
<template>
<div class="customerManage">
<div class="sub-header">
<div v-for="(item,index) in headerList" :key="index"
:class="selectTitle==item.id?'active':''"
@click="clickTitle(item)">{{item.title}}</div>
<div v-for="(item,index) in headerList" :key="index" :class="selectTitle==item.id?'active':''"
@click="clickTitle(item)">{{item.title}}</div>
</div>
<!-- 客户来源 -->
<customerSource v-if="selectTitle==1"></customerSource>
<!-- 分配规则 -->
<distributionRules v-if="selectTitle==2"></distributionRules>
<!-- 排行统计配置 -->
<rankConfig v-if="selectTitle==3"></rankConfig>
</div>
</template>
<script>
import customerSource from "./customerSource";
import distributionRules from "./distributionRules";
export default {
import customerSource from "./customerSource";
import distributionRules from "./distributionRules";
import rankConfig from "./rankConfig";
export default {
components: {
customerSource,
distributionRules
distributionRules,
rankConfig,
},
data() {
return {
selectTitle:1,
headerList:[
{title:'客户来源',id:1},
{title:'分配规则',id:2},
]
};
return {
selectTitle: 1,
headerList: [{
title: '客户来源',
id: 1
},
{
title: '分配规则',
id: 2
},
{
title: '排行统计配置',
id: 3
},
]
};
},
mounted() {
},
beforeDestroy() {
},
methods: {
clickTitle(item){
methods: {
clickTitle(item) {
this.selectTitle = item.id
},
}
};
</script>
}
};
</script>
\ No newline at end of file
<style scoped>
.distributionRules {}
.distributionRules_title {
font-weight: bold;
font-size: 18px;
font-family: perfectFont;
padding: 20px 0;
}
.page-content {
background-color: #fff;
padding: 20px;
}
.distributionRules_text {
padding: 0 0 20px 0;
}
.text-negative {
color: #f5576c
}
.distributionRules_num {
display: flex;
justify-content: space-between;
}
.distributionRules_num div {
flex: 1;
}
.dataText {
display: flex;
flex-wrap: wrap;
padding: 10px 0;
}
.dataText_text {
margin-right: 10px;
margin-bottom: 10px;
}
.select-radio {
display: flex;
align-items: center;
}
</style>
<template>
<div class="customerManage">
<h1 class="distributionRules_title">分配给以下部门/成员</h1>
<div class="page-content">
<div class="distributionRules_text">
<span>引流排行配置</span>
<span class="text-negative">*</span>
</div>
<div class="distributionRules_num">
<div>
<el-button @click="clickSelectPeople(1)">选择部门/成员</el-button>
</div>
<div><span>已选择:{{msg.FlowList.length}}</span></div>
</div>
<div class="dataText">
<el-tag v-for="(item,index) in msg.FlowList" :key="index" class="dataText_text">{{item.EmName}}
</el-tag>
</div>
<div class="distributionRules_text">
<span>销售排行配置</span>
<span class="text-negative">*</span>
</div>
<div class="distributionRules_num">
<div>
<el-button @click="clickSelectPeople(2)">选择部门/成员</el-button>
</div>
<div><span>已选择:{{msg.SaleList.length}}</span></div>
</div>
<div class="dataText">
<el-tag v-for="(item,index) in msg.SaleList" :key="index" class="dataText_text">{{item.EmName}}
</el-tag>
</div>
<br /><br />
<el-button class="add-box-btn add-box-cancel" @click="saveRankRule" :disabled="disabledOff">立即保存</el-button>
</div>
<!-- 添加账号弹窗 -->
<div v-if="isShowRuleForm">
<addDistributionRules :obj="chooseObj" @addCustomerOk="addCustomerOk" />
</div>
</div>
</template>
<script>
import addDistributionRules from "../dialogModel/addDistributionRules";
export default {
components: {
addDistributionRules
},
data() {
return {
disabledOff: false,
isShowRuleForm: false,
msg: {
ID: 0,
SNO: 1,
Content: "",//引流人员编号
Mask: "",//销售人员编号
FlowList: [], //引流排行配置
SaleList: [], //销售排行配置
},
chooseObj: {
chooseType: 1, //选择类型(1-引流人员配置,2-销售人员配置)
EmpList: [], //已选择的员工
}
};
},
mounted() {
this.GetRankRule()
let $this = this
this.MsgBus.$on('closeaaddDistributionRules', function () {
$this.isShowRuleForm = false
})
},
methods: {
saveRankRule() {
let flowIds = [];
let saleIds = [];
this.msg.FlowList.forEach(item => {
flowIds.push(item.EmployeeId)
})
this.msg.SaleList.forEach(item => {
saleIds.push(item.EmployeeId)
})
this.msg.Content = flowIds.join(',');
this.msg.Mask = saleIds.join(',');
this.disabledOff = true
this.apipost('/api/Customer/SetRankRule', this.msg, res => {
this.disabledOff = false
if (res.data.resultCode == 1) {
this.$message.success(res.data.message)
} else {
this.$message.error(res.data.message)
}
})
},
addCustomerOk() {
this.isShowRuleForm = false
},
clickSelectPeople(type) {
this.chooseObj.chooseType = type;
//引流人员配置
if (this.chooseObj.chooseType == 1) {
this.chooseObj.EmpList = this.msg.FlowList;
}
//销售人员配置
if (this.chooseObj.chooseType == 2) {
this.chooseObj.EmpList = this.msg.SaleList;
}
this.isShowRuleForm = true;
},
// 获取规则详情
GetRankRule() {
this.apipost('/api/Customer/GetRankRule', {}, res => {
if (res.data.resultCode == 1) {
var tempData = res.data.data;
this.msg.ID = tempData.ID;
this.msg.SNO = tempData.SNO;
this.msg.Content = tempData.Content;
this.msg.Mask = tempData.Mask;
this.msg.FlowList = tempData.FlowList;
this.msg.SaleList = tempData.SaleList;
}
})
},
}
};
</script>
\ No newline at end of file
<style scoped>
.addDistributionRules .add-tit{
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.addDistributionRules .add-tit p{
display: flex;
align-items: center;
font-weight: bold;
color:rgba(17,17,17,1);
font-size:14px;
}
.addDistributionRules .add-tit p span{
display: inline-block;
width:6px;
height:6px;
background:rgba(13,36,129,1);
border-radius:50%;
margin-right: 10px;
}
.addDistributionRules .el-dialog__header{
padding: 15px 20px;
background:rgba(255,255,255,1);
}
.add_box{
display: flex;
flex-direction: row;
justify-content: space-between;
}
.addSearch{
display: flex;
flex-direction: column;
}
.addSearch-left{
height: 40px;
flex: 1;
display: flex;
align-items: center;
}
.addSearch-left span{
flex-shrink: 0;
}
.addSearch-s{
height: 40px;
line-height: 4px;
display: flex;
align-items: center;
}
.addCenter{
margin-left: 20px;
flex: 1;
display: flex;
flex-direction: column;
}
.addCenter-left,.addCenter-right{
flex: 1;
margin-top: 20px;
background-color: #fff;
padding: 10px;
}
.addCenter-left,.addCenter-right{
min-height: 400px;
max-height: 400px;
overflow: hidden;
}
.addCenter-right-box{
width: 50%;
float: left;
margin-bottom: 10px;
}
.addCenter-hidden{
min-height: 400px;
max-height: 400px;
overflow: scroll;
}
.addDistributionRules .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.addDistributionRules .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.addDistributionRules .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
background: rgba(13, 36, 129, 1);
border-radius: 50%;
margin-right: 10px;
}
.addDistributionRules .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.add_box {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.addSearch {
display: flex;
flex-direction: column;
}
.addSearch-left {
height: 40px;
flex: 1;
display: flex;
align-items: center;
}
.addSearch-left span {
flex-shrink: 0;
}
.addSearch-s {
height: 40px;
line-height: 4px;
display: flex;
align-items: center;
}
.addCenter {
margin-left: 20px;
flex: 1;
display: flex;
flex-direction: column;
}
.addCenter-left,
.addCenter-right {
flex: 1;
margin-top: 20px;
background-color: #fff;
padding: 10px;
}
.addCenter-left,
.addCenter-right {
min-height: 400px;
max-height: 400px;
overflow: hidden;
}
.addCenter-right-box {
width: 50%;
float: left;
margin-bottom: 10px;
}
.addCenter-hidden {
min-height: 400px;
max-height: 400px;
overflow: scroll;
}
</style>
<template>
<el-dialog @closed="closedDialog" :modal="false" :visible.sync="dialogTableVisible" width="600px" :close-on-click-modal="false" class="addCustomer">
<el-dialog @closed="closedDialog" :modal="false" :visible.sync="dialogTableVisible" width="600px"
:close-on-click-modal="false" class="addCustomer">
<div class="add-tit" slot="title">
<p><span></span>分配规则</p>
<span icon="el-icon-close"></span>
......@@ -87,26 +103,17 @@
<div class="addSearch">
<div class="addSearch-left">
<span>选择:</span>
<el-input placeholder="关键词进行过滤" v-model="filterText"/>
<el-input placeholder="关键词进行过滤" v-model="filterText" />
</div>
<div class="addCenter-left">
<div class="addCenter-hidden">
<el-tree
v-loading="loading"
class='ApprovalProcessBg'
:data="memberList"
show-checkbox
:filter-node-method="filterNode"
:default-checked-keys="memberSetCheckedUserKeys"
ref="tree"
:props="defaultProps"
:render-after-expand="false"
node-key="DepartmentId"
@check-change="handleNodeChange">
<el-tree v-loading="loading" class='ApprovalProcessBg' :data="memberList" show-checkbox
:filter-node-method="filterNode" :default-checked-keys="memberSetCheckedUserKeys" ref="tree"
:props="defaultProps" :render-after-expand="false" node-key="DepartmentId"
@check-change="handleNodeChange">
</el-tree>
</div>
</div>
</div>
<div class="addCenter">
<div class="addSearch-s">
......@@ -114,16 +121,12 @@
</div>
<div class="addCenter-right">
<div class="addCenter-hidden">
<div class="addCenter-right-box"
v-for="(item,index) in showMember"
:key="index">
<el-tag closable @close="mySetCheckedKeys(item.EmployeeId)">
{{item.EmName}}
</el-tag>
</div>
<div class="addCenter-right-box" v-for="(item,index) in showMember" :key="index">
<el-tag closable @close="mySetCheckedKeys(item.EmployeeId)">
{{item.EmName}}
</el-tag>
</div>
</div>
</div>
</div>
</div>
......@@ -134,110 +137,116 @@
</el-dialog>
</template>
<script>
export default {
props: {
obj:Object
},
data() {
return {
loading:false,
filterText:"",
memberSetCheckedUserKeys:[],
showMember:[],
defaultProps: {
children: 'ChildList',
label: 'DepartmentName',
export default {
props: {
obj: Object
},
memberList:[],
dialogTableVisible: false,
data() {
return {
loading: false,
filterText: "",
memberSetCheckedUserKeys: [],
showMember: [],
defaultProps: {
children: 'ChildList',
label: 'DepartmentName',
},
memberList: [],
dialogTableVisible: false,
};
},
watch:{
filterText(val) {
this.$refs.tree.filter(val);
}
},
mounted() {
this.getMember()
if(this.obj.EmpList){
this.showMember = this.obj.EmpList
this.showMember.forEach(item=>{
this.memberSetCheckedUserKeys.push(item.EmployeeId)
})
}
let $this = this
setTimeout(()=>{
$this.dialogTableVisible = true
},50)
},
methods: {
// 获取部门成员列表
getMember() {
this.loading = true
this.apipost2('WorkFlow_get_GetTempLateDepartMentEmployee', {}, res => {
this.memberList = res.data.data
this.loading = false
}, err => {})
},
// 删除指定人员
mySetCheckedKeys(id) {
if(this.memberSetCheckedUserKeys.length == 0) return
this.showMember.splice(this.showMember.findIndex(item => item.EmployeeId === id), 1)
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === id), 1)
this.$refs.tree.setCheckedKeys(this.memberSetCheckedUserKeys);
},
filterNode(value, data) {
if (!value) return true;
return data.DepartmentName.indexOf(value) !== -1;
},
handleNodeChange(data, checked) { //操作选中
data.IsCheck = checked;
if(data.Type == 2 && data.IsCheck) { //是员工且选中
let isExsit = false
this.showMember.forEach(x => {
if(x.EmployeeId == data.DepartmentId) {
isExsit = true
return false
}
})
if(!isExsit) {
this.showMember.push({
EmName: data.DepartmentName,
EmployeeId: data.DepartmentId,
Sort: this.showMember.length + 1
};
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
created() {
this.getMember()
},
mounted() {
if (this.obj.EmpList) {
this.showMember = this.obj.EmpList
this.showMember.forEach(item => {
this.memberSetCheckedUserKeys.push(item.EmployeeId)
})
this.memberSetCheckedUserKeys.push(data.DepartmentId)
}
}
else if(data.Type == 2 && !data.IsCheck) {
if(this.showMember.findIndex(item => item.EmployeeId === data.DepartmentId) != -1) {
this.showMember.splice(this.showMember.findIndex(item => item.EmployeeId === data.DepartmentId), 1)
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId), 1)
if(this.showMember.findIndex(item => item.EmployeeId === data.ParentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.ParentId), 1)
let $this = this
setTimeout(() => {
$this.dialogTableVisible = true
}, 50)
},
methods: {
// 获取部门成员列表
getMember() {
this.loading = true
this.apipost2('WorkFlow_get_GetTempLateDepartMentEmployee', {}, res => {
this.memberList = res.data.data
this.loading = false
}, err => {})
},
// 删除指定人员
mySetCheckedKeys(id) {
if (this.memberSetCheckedUserKeys.length == 0) return
this.showMember.splice(this.showMember.findIndex(item => item.EmployeeId === id), 1)
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === id), 1)
this.$refs.tree.setCheckedKeys(this.memberSetCheckedUserKeys);
},
filterNode(value, data) {
if (!value) return true;
return data.DepartmentName.indexOf(value) !== -1;
},
handleNodeChange(data, checked) { //操作选中
data.IsCheck = checked;
if (data.Type == 2 && data.IsCheck) { //是员工且选中
let isExsit = false
this.showMember.forEach(x => {
if (x.EmployeeId == data.DepartmentId) {
isExsit = true
return false
}
})
if (!isExsit) {
this.showMember.push({
EmName: data.DepartmentName,
EmployeeId: data.DepartmentId,
Sort: this.showMember.length + 1
})
this.memberSetCheckedUserKeys.push(data.DepartmentId)
}
} else if (data.Type == 2 && !data.IsCheck) {
if (this.showMember.findIndex(item => item.EmployeeId === data.DepartmentId) != -1) {
this.showMember.splice(this.showMember.findIndex(item => item.EmployeeId === data.DepartmentId),
1)
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item ===
data.DepartmentId), 1)
if (this.showMember.findIndex(item => item.EmployeeId === data.ParentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item =>
item === data.ParentId), 1)
}
}
}
}
}
if(data.Type != 2 && data.IsCheck) {
if(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId) == -1) {
this.memberSetCheckedUserKeys.push(data.DepartmentId)
}
} else if(data.Type == 2 && !data.IsCheck) {
if(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId), 1)
if(this.showMember.findIndex(item => item.EmployeeId === data.ParentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.ParentId), 1)
if (data.Type != 2 && data.IsCheck) {
if (this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId) == -1) {
this.memberSetCheckedUserKeys.push(data.DepartmentId)
}
} else if (data.Type == 2 && !data.IsCheck) {
if (this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item ===
data.DepartmentId), 1)
if (this.showMember.findIndex(item => item.EmployeeId === data.ParentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item =>
item === data.ParentId), 1)
}
}
}
}
},
closedDialog() {
this.MsgBus.$emit('closeaaddDistributionRules')
},
clickSure() {
this.dialogTableVisible = false
},
}
},
closedDialog(){
this.MsgBus.$emit('closeaaddDistributionRules')
},
clickSure() {
this.dialogTableVisible = false
},
}
}
}
</script>
\ No newline at end of file
......@@ -6,20 +6,21 @@ export default {
apiurl: ''
},
install(Vue, options) {
Vue.prototype.isOnline = function () {
return process.env.NODE_ENV !== 'development';
},
Vue.prototype.isOnline = function() {
return process.env.NODE_ENV !== 'development';
},
//域名管理对象
Vue.prototype.domainManager = function () {
Vue.prototype.domainManager = function() {
//CRM API
let domainUrl = "";
domainUrl = "http://192.168.10.46:8500";
// domainUrl = "http://192.168.10.36:8098";
//domainUrl = "http://localhost:5003";
let locationName = window.location.hostname;
//旅游ERPApi
let domainPostUrl = ""
//domainPostUrl = "http://192.168.10.36:8083";
domainPostUrl = "http://192.168.10.46";
domainPostUrl = "http://192.168.10.36:8083";
//domainPostUrl = "http://192.168.10.46";
if (this.isOnline()) {
if (window.location.host.indexOf('fcrmyx.oytour.com') != -1) {
domainUrl = "http://crm.oytour.com"
......@@ -48,7 +49,7 @@ export default {
},
//消息成功提示
Vue.prototype.Success = function (msg) {
Vue.prototype.Success = function(msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -56,7 +57,7 @@ export default {
});
},
//错误提示
Vue.prototype.Error = function (msg) {
Vue.prototype.Error = function(msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -65,7 +66,7 @@ export default {
},
//一般提示
Vue.prototype.Info = function (msg) {
Vue.prototype.Info = function(msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -73,7 +74,7 @@ export default {
});
},
//警告提示
Vue.prototype.Warning = function (msg) {
Vue.prototype.Warning = function(msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -81,12 +82,12 @@ export default {
});
},
//Confirm
Vue.prototype.Confirm = function (msg, callback) {
Vue.prototype.Confirm = function(msg, callback) {
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
if (typeof callback === 'function') {
callback();
......@@ -101,7 +102,7 @@ export default {
//type : m_filt 填充 m_w 宽度固定 高度不固定 m_h 高度固定 宽度不固定
// w : 宽
// h : 高
Vue.prototype.compressImg = function (path, type, w, h) {
Vue.prototype.compressImg = function(path, type, w, h) {
let url = this.domainManager().UploadUrl;
let poise = 'width=';
w = w ? w : ''
......@@ -116,7 +117,7 @@ export default {
//旅游ERP接口
Vue.prototype.apipost2 = function (cmd, msg, successCall, faildCall, isOnline) {
Vue.prototype.apipost2 = function(cmd, msg, successCall, faildCall, isOnline) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -146,11 +147,11 @@ export default {
"languageId": tempLanguage
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
......@@ -165,50 +166,50 @@ export default {
}
//CRM接口
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
var apiurl = this.domainManager().PostUrl + cmd;
var timestamp = (new Date()).valueOf();
var token = "";
var key = "";
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().token;
key = this.getLocalStorage().secretKey;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var postData = {
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str
}
if (localStorage.g && localStorage.g != 'undefined') {
postData.groupId = 2;
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
})
} else if (res.data.resultCode == 10005) {
this.$router.go(-1)
} else {
successCall(res)
}
}, faildCall)
},
var apiurl = this.domainManager().PostUrl + cmd;
var timestamp = (new Date()).valueOf();
var token = "";
var key = "";
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().token;
key = this.getLocalStorage().secretKey;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var postData = {
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str
}
if (localStorage.g && localStorage.g != 'undefined') {
postData.groupId = 2;
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
})
} else if (res.data.resultCode == 10005) {
this.$router.go(-1)
} else {
successCall(res)
}
}, faildCall)
},
// 自动登录HTTP提交数据
Vue.prototype.apipostLogin = function (cmd, msg, successCall, faildCall) {
Vue.prototype.apipostLogin = function(cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -232,11 +233,11 @@ export default {
postData.groupId = 2;
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
......@@ -251,7 +252,7 @@ export default {
},
//Java接口
Vue.prototype.apiJavaPost = function (cmd, msg, successCall, faildCall) {
Vue.prototype.apiJavaPost = function(cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -279,11 +280,11 @@ export default {
postData.groupId = 2;
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
......@@ -303,7 +304,7 @@ export default {
},
//下载文件
Vue.prototype.GetLocalFile = function (cmd, msg, fileName, callBack) {
Vue.prototype.GetLocalFile = function(cmd, msg, fileName, callBack) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -345,7 +346,7 @@ export default {
};
callBack(result);
}
}).catch(function (res) {
}).catch(function(res) {
console.log("GetLocalFile", res);
});
}
......
......@@ -20,6 +20,7 @@ import customerOrder from "./components/customerManage/customerOrder"
import myCustomerOrder from "./components/customerManage/myCustomerOrder"
import automaticLogin from './views/automaticLogin'
import planeTicketOrder from './components/planeTicketOrder/index'
import Test from './components/Test'
Vue.use(Router);
export default new Router({
......@@ -491,6 +492,14 @@ export default new Router({
meta: {
title: "订单核算统计"
}
},
{
path: "/test",
name: "test",
component: Test,
meta: {
title: "测试命令"
}
}
]
},
......
<template>
<div class="customerManage">
<div class="tools">
<div class="tools-item">
<h1>每日引流统计</h1>
</div>
<div style="width: 340px;">
<el-date-picker
v-model="msg.month"
type="month"
icon="el-icon-date"
slot="append"
class="input-with-select"
@change="changeMonthHandler"
placeholder="选择查询的月份">
</el-date-picker>
</div>
<div class="rightmenu">
<el-dropdown @command="handleCommand">
<el-button class="crm-btn crm-btn-more easy-btn margin-right0">
<i class="iconfont icongengduo"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1"><i class="iconfont icondaochu"></i> 导出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<div class="page-content" style="padding-bottom:20px;">
<el-table :data="tableData" tooltip-effect="dark" v-loading="loading" style="width: 100%;height:100%;" border :cell-class-name="tableCellClassName" :row-class-name="tableRowClassName">
<el-table-column prop="DateStr" label="">
</el-table-column>
<el-table-column prop="PushCount" label="引流总数">
</el-table-column>
<el-table-column prop="EffectiveCount" label="有效总数">
</el-table-column>
<el-table-column prop="InvalidCount" label="无效总数">
</el-table-column>
<el-table-column prop="RedBookCount" label="小红书总数">
</el-table-column>
<el-table-column prop="DouYinCount" label="抖音总数">
</el-table-column>
<el-table-column prop="FlyingPigCount" label="飞猪总数">
</el-table-column>
<el-table-column prop="GroupChatCount" label="社群聊天总数">
</el-table-column>
<el-table-column prop="OfflineVisitCount" label="线下拜访总数">
</el-table-column>
<el-table-column prop="StraightCustomerCount" label="直客介绍总数">
</el-table-column>
<el-table-column prop="PeerCount" label="同业介绍总数">
</el-table-column>
<el-table-column prop="OtherCount" label="其他介绍总数">
</el-table-column>
<el-table-column prop="OrderCount" label="订单总数">
</el-table-column>
<el-table-column prop="TicketOrderCount" label="机票订单总数">
</el-table-column>
<el-table-column prop="VisaOrderCount" label="签证订单总数">
</el-table-column>
<el-table-column prop="GroundOrderCount" label="地接订单总数">
</el-table-column>
<el-table-column prop="ComboOrderCount" label="套餐订单总数">
</el-table-column>
</el-table>
</div>
<div class="tools">
<div class="tools-item">
<h1>每日引流统计</h1>
</div>
<div style="width: 340px;">
<el-date-picker v-model="msg.month" type="month" icon="el-icon-date" slot="append" class="input-with-select"
@change="changeMonthHandler" placeholder="选择查询的月份">
</el-date-picker>
</div>
<div class="rightmenu">
<el-dropdown @command="handleCommand">
<el-button class="crm-btn crm-btn-more easy-btn margin-right0">
<i class="iconfont icongengduo"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1"><i class="iconfont icondaochu"></i> 导出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<div class="page-content" style="padding-bottom:20px;">
<el-table :data="tableData" tooltip-effect="dark" v-loading="loading" style="width: 100%;height:100%;" border
:cell-class-name="tableCellClassName" :row-class-name="tableRowClassName">
<el-table-column>
<template slot-scope="scope">
<template v-if="scope.row.YearStr>0&&scope.row.MonthStr>0">
<span class="pointer" style="color:blue;text-decoration:underline;" @click="seeDetails(scope.row)">{{scope.row.DateStr}}</span>
</template>
<template v-else>
<span>{{scope.row.DateStr}} </span>
</template>
</template>
</el-table-column>
<el-table-column prop="PushCount" label="引流总数">
</el-table-column>
<el-table-column prop="EffectiveCount" label="有效总数">
</el-table-column>
<el-table-column prop="InvalidCount" label="无效总数">
</el-table-column>
<el-table-column prop="RedBookCount" label="小红书总数">
</el-table-column>
<el-table-column prop="DouYinCount" label="抖音总数">
</el-table-column>
<el-table-column prop="FlyingPigCount" label="飞猪总数">
</el-table-column>
<el-table-column prop="GroupChatCount" label="社群聊天总数">
</el-table-column>
<el-table-column prop="OfflineVisitCount" label="线下拜访总数">
</el-table-column>
<el-table-column prop="StraightCustomerCount" label="直客介绍总数">
</el-table-column>
<el-table-column prop="PeerCount" label="同业介绍总数">
</el-table-column>
<el-table-column prop="OtherCount" label="其他介绍总数">
</el-table-column>
<el-table-column prop="OrderCount" label="订单总数">
</el-table-column>
<el-table-column prop="TicketOrderCount" label="机票订单总数">
</el-table-column>
<el-table-column prop="VisaOrderCount" label="签证订单总数">
</el-table-column>
<el-table-column prop="GroundOrderCount" label="地接订单总数">
</el-table-column>
<el-table-column prop="ComboOrderCount" label="套餐订单总数">
</el-table-column>
</el-table>
</div>
<el-drawer :with-header="false" size='70%' :visible.sync="drawer" direction="rtl" :before-close="handleClose">
<clueComponent :isDrawer="isDrawer" :queryTime="queryTime"></clueComponent>
</el-drawer>
</div>
</template>
<script>
export default {
data() {
return {
msg: {
month: "",
YearStr: "",
MonthStr: "",
},
total: 0,
tableData: [],
loading: false,
};
},
created() {
let d = new Date();
this.msg.month = d;
this.msg.YearStr = d.getFullYear();
this.msg.MonthStr = d.getMonth() + 1;
},
mounted() {
this.init();
},
methods: {
init() {
if (this.loading) return;
this.loading = true;
this.apipost(
"/api/ClueStatic/GetClueDay",
this.msg,
(res) => {
console.log(res);
this.loading = false;
this.tableData = res.data.data;
import clueComponent from "@/components/clueManagement/clueComponent";
export default {
components: {
clueComponent
},
data() {
return {
queryTime: {
StartTime: '',
EndTime: ''
},
(e) => {
this.loading = false;
}
);
drawer: false,
isDrawer: true,
msg: {
month: "",
YearStr: "",
MonthStr: "",
},
total: 0,
tableData: [],
loading: false,
};
},
created() {
let d = new Date();
this.msg.month = d;
this.msg.YearStr = d.getFullYear();
this.msg.MonthStr = d.getMonth() + 1;
},
tableRowClassName({ row }) {
let cname = "font-size-12";
if (
row.DateStr == "总数" ||
row.DateStr == "上期总数" ||
row.DateStr == "环比成长"
) {
cname += " xiaoji-row";
} else if (row.DateStr == "月总数") {
cname += " sum-row";
}
return cname;
mounted() {
this.init();
},
tableCellClassName({ row, column }) {
if (
row[column.property].toString().indexOf("-") != -1 &&
column.property != "DateStr"
) {
return "warning-col";
} else if (column.property == "InvalidCount") {
methods: {
handleClose(done) {
done();
},
// 查看详情
seeDetails(row) {
var d = new Date();
var currentY = this.msg.YearStr;
var currentM = this.msg.MonthStr;
var MonthDayNum = new Date(currentY, currentM, 0).getDate(); //计算当月的天数
this.queryTime.StartTime = this.msg.YearStr + '-' + row.DateStr
this.queryTime.EndTime = this.msg.YearStr + '-' + row.DateStr
this.drawer = true
},
init() {
if (this.loading) return;
this.loading = true;
this.apipost(
"/api/ClueStatic/GetClueDay",
this.msg,
(res) => {
console.log(res);
this.loading = false;
this.tableData = res.data.data;
},
(e) => {
this.loading = false;
}
);
},
tableRowClassName({
row
}) {
let cname = "font-size-12";
if (
row.DateStr == "总数" ||
row.DateStr == "上期总数" ||
row.DateStr == "环比成长"
) {
cname += " xiaoji-row";
} else if (row.DateStr == "月总数") {
cname += " sum-row";
}
return cname;
},
tableCellClassName({
row,
column
}) {
if (
parseFloat(row[column.property]) / parseFloat(row.PushCount) >=
0.2
row[column.property] && row[column.property].toString().indexOf("-") != -1 &&
column.property != "DateStr"
) {
return "warning-col";
} else if (column.property == "InvalidCount") {
if (
parseFloat(row[column.property]) / parseFloat(row.PushCount) >=
0.2
) {
return "warning-col";
}
}
}
},
changeMonthHandler(val) {
this.msg.YearStr = val.getFullYear();
this.msg.MonthStr = val.getMonth() + 1;
console.log(this.msg);
this.init();
},
handleCommand(command) {
console.log(command);
if (command == "1") {
this.downloadHandler();
}
},
downloadHandler() {
console.log("点击了");
this.GetLocalFile(
"/api/ClueStatic/DownLoadClueDay",
this.msg,
"每日引流数据统计.xls",
(res) => {
this.$message({
message: "导出成功",
type: "success",
});
},
changeMonthHandler(val) {
this.msg.YearStr = val.getFullYear();
this.msg.MonthStr = val.getMonth() + 1;
console.log(this.msg);
this.init();
},
handleCommand(command) {
console.log(command);
if (command == "1") {
this.downloadHandler();
}
);
},
downloadHandler() {
console.log("点击了");
this.GetLocalFile(
"/api/ClueStatic/DownLoadClueDay",
this.msg,
"每日引流数据统计.xls",
(res) => {
this.$message({
message: "导出成功",
type: "success",
});
}
);
},
},
},
};
};
</script>
<style>
@import "../../assets/css/customerManage.css";
@import "../../assets/css/customerManage.css";
.el-table__fixed-body-wrapper table {
padding-bottom: 8px !important;
}
.el-table .xiaoji-row {
background: #ffff00;
}
.el-table .sum-row {
background: #00b0f0;
}
.el-table .warning-col {
background: red;
}
.el-table__fixed-body-wrapper table {
padding-bottom: 8px !important;
}
.el-table .xiaoji-row {
background: #ffff00;
}
.pointer {
cursor: pointer;
}
.el-table .sum-row {
background: #00b0f0;
}
.el-table .warning-col {
background: red;
}
</style>
.pointer:hover {
color: #00b0f0;
}
</style>
\ No newline at end of file
<template>
<div class="customerManage" style="display:flex;height:calc(100% - 20px);flex-direction:column;">
<div class="tools" style="border:none;">
<div class="tools-item">
<h1>月度引流统计</h1>
</div>
<div style="width: 340px;">
<el-date-picker
v-model="msg.month"
type="year"
icon="el-icon-date"
slot="append"
class="input-with-select"
format="yyyy 年"
@change="changeMonthHandler"
placeholder="选择查询的月份">
</el-date-picker>
</div>
<div class="rightmenu">
<el-dropdown @command="handleCommand">
<el-button class="crm-btn crm-btn-more easy-btn margin-right0">
<i class="iconfont icongengduo"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1"><i class="iconfont icondaochu"></i> 导出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<el-tabs v-model="activeName" style="flex:1;height:100%;" class="diy-eltabs" tab-position="top">
<el-tab-pane label="月度数据" name="monthdata" style="background:#000">
<div class="data-box-item">
<el-table :data="tableData" tooltip-effect="dark" v-loading="loading" style="width: 100%;" height="100%" border :cell-class-name="tableCellClassName" :row-class-name="tableRowClassName">
<el-table-column prop="DateStr" label="">
</el-table-column>
<el-table-column prop="PushCount" label="引流总数">
</el-table-column>
<el-table-column prop="EffectiveCount" label="有效总数">
</el-table-column>
<el-table-column prop="InvalidCount" label="无效总数">
</el-table-column>
<el-table-column prop="RedBookCount" label="小红书总数">
</el-table-column>
<el-table-column prop="DouYinCount" label="抖音总数">
</el-table-column>
<el-table-column prop="FlyingPigCount" label="飞猪总数">
</el-table-column>
<el-table-column prop="GroupChatCount" label="社群聊天总数">
</el-table-column>
<el-table-column prop="OfflineVisitCount" label="线下拜访总数">
</el-table-column>
<el-table-column prop="StraightCustomerCount" label="直客介绍总数">
</el-table-column>
<el-table-column prop="PeerCount" label="同业介绍总数">
</el-table-column>
<el-table-column prop="OtherCount" label="其他介绍总数">
</el-table-column>
<el-table-column prop="OrderCount" label="订单总数">
</el-table-column>
<el-table-column prop="TicketOrderCount" label="机票订单总数">
</el-table-column>
<el-table-column prop="VisaOrderCount" label="签证订单总数">
</el-table-column>
<el-table-column prop="GroundOrderCount" label="地接订单总数">
</el-table-column>
<el-table-column prop="ComboOrderCount" label="套餐订单总数">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="月度成长率" name="monthrate">
<div class="data-box-item">
<el-table :data="rateData" :formatter="formatter" tooltip-effect="dark" v-loading="rateLoading" style="width: 100%;" height="100%" border :cell-class-name="tableCellClassName" :row-class-name="tableRowClassName">
<el-table-column prop="ItemName" label="">
</el-table-column>
<el-table-column prop="JanuaryRate" label="1月" :formatter="formatter">
</el-table-column>
<el-table-column prop="FebruaryRate" label="2月" :formatter="formatter">
</el-table-column>
<el-table-column prop="MarchRate" label="3月" :formatter="formatter">
</el-table-column>
<el-table-column prop="AprilRate" label="4月" :formatter="formatter">
</el-table-column>
<el-table-column prop="MayRate" label="5月" :formatter="formatter">
</el-table-column>
<el-table-column prop="JuneRate" label="6月" :formatter="formatter">
</el-table-column>
<el-table-column prop="JulyRate" label="7月" :formatter="formatter">
</el-table-column>
<el-table-column prop="AugustRate" label="8月" :formatter="formatter">
</el-table-column>
<el-table-column prop="SeptemberRate" label="9月" :formatter="formatter">
</el-table-column>
<el-table-column prop="OctoberRate" label="10月" :formatter="formatter">
</el-table-column>
<el-table-column prop="NovemberRate" label="11月" :formatter="formatter">
</el-table-column>
<el-table-column prop="DecemberRate" label="12月" :formatter="formatter">
</el-table-column>
<el-table-column prop="AvgRate" label="平均" :formatter="formatter">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
<div class="tools" style="border:none;">
<div class="tools-item">
<h1>月度引流统计</h1>
</div>
<div style="width: 340px;">
<el-date-picker v-model="msg.month" type="year" icon="el-icon-date" slot="append" class="input-with-select"
format="yyyy 年" @change="changeMonthHandler" placeholder="选择查询的月份">
</el-date-picker>
</div>
<div class="rightmenu">
<el-dropdown @command="handleCommand">
<el-button class="crm-btn crm-btn-more easy-btn margin-right0">
<i class="iconfont icongengduo"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1"><i class="iconfont icondaochu"></i> 导出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<el-tabs v-model="activeName" style="flex:1;height:100%;" class="diy-eltabs" tab-position="top">
<el-tab-pane label="月度数据" name="monthdata" style="background:#000">
<div class="data-box-item">
<el-table :data="tableData" tooltip-effect="dark" v-loading="loading" style="width: 100%;" height="100%"
border :cell-class-name="tableCellClassName" :row-class-name="tableRowClassName">
<el-table-column>
<template slot-scope="scope">
<template v-if="scope.row.MonthStr>0">
<span class="pointer" style="color:blue;text-decoration:underline;"
@click="seeDetails(scope.row)">{{scope.row.DateStr}}</span>
</template>
<template v-else>
<span>{{scope.row.DateStr}} </span>
</template>
</template>
</el-table-column>
<el-table-column prop="PushCount" label="引流总数">
</el-table-column>
<el-table-column prop="EffectiveCount" label="有效总数">
</el-table-column>
<el-table-column prop="InvalidCount" label="无效总数">
</el-table-column>
<el-table-column prop="RedBookCount" label="小红书总数">
</el-table-column>
<el-table-column prop="DouYinCount" label="抖音总数">
</el-table-column>
<el-table-column prop="FlyingPigCount" label="飞猪总数">
</el-table-column>
<el-table-column prop="GroupChatCount" label="社群聊天总数">
</el-table-column>
<el-table-column prop="OfflineVisitCount" label="线下拜访总数">
</el-table-column>
<el-table-column prop="StraightCustomerCount" label="直客介绍总数">
</el-table-column>
<el-table-column prop="PeerCount" label="同业介绍总数">
</el-table-column>
<el-table-column prop="OtherCount" label="其他介绍总数">
</el-table-column>
<el-table-column prop="OrderCount" label="订单总数">
</el-table-column>
<el-table-column prop="TicketOrderCount" label="机票订单总数">
</el-table-column>
<el-table-column prop="VisaOrderCount" label="签证订单总数">
</el-table-column>
<el-table-column prop="GroundOrderCount" label="地接订单总数">
</el-table-column>
<el-table-column prop="ComboOrderCount" label="套餐订单总数">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
<el-tab-pane label="月度成长率" name="monthrate">
<div class="data-box-item">
<el-table :data="rateData" :formatter="formatter" tooltip-effect="dark" v-loading="rateLoading"
style="width: 100%;" height="100%" border :cell-class-name="tableCellClassName"
:row-class-name="tableRowClassName">
<el-table-column prop="ItemName" label="">
</el-table-column>
<el-table-column prop="JanuaryRate" label="1月" :formatter="formatter">
</el-table-column>
<el-table-column prop="FebruaryRate" label="2月" :formatter="formatter">
</el-table-column>
<el-table-column prop="MarchRate" label="3月" :formatter="formatter">
</el-table-column>
<el-table-column prop="AprilRate" label="4月" :formatter="formatter">
</el-table-column>
<el-table-column prop="MayRate" label="5月" :formatter="formatter">
</el-table-column>
<el-table-column prop="JuneRate" label="6月" :formatter="formatter">
</el-table-column>
<el-table-column prop="JulyRate" label="7月" :formatter="formatter">
</el-table-column>
<el-table-column prop="AugustRate" label="8月" :formatter="formatter">
</el-table-column>
<el-table-column prop="SeptemberRate" label="9月" :formatter="formatter">
</el-table-column>
<el-table-column prop="OctoberRate" label="10月" :formatter="formatter">
</el-table-column>
<el-table-column prop="NovemberRate" label="11月" :formatter="formatter">
</el-table-column>
<el-table-column prop="DecemberRate" label="12月" :formatter="formatter">
</el-table-column>
<el-table-column prop="AvgRate" label="平均" :formatter="formatter">
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
<el-drawer :with-header="false" size='70%' :visible.sync="drawer" direction="rtl" :before-close="handleClose">
<clueComponent :isDrawer="isDrawer" :queryTime="queryTime"></clueComponent>
</el-drawer>
</div>
</template>
<script>
export default {
data() {
return {
msg: {
month: "",
YearStr: "",
},
total: 0,
tableData: [],
loading: false,
rateLoading: false,
activeName: "monthdata",
rateData: [],
};
},
created() {
let d = new Date();
this.msg.month = d;
this.msg.YearStr = d.getFullYear();
},
mounted() {
this.init();
this.initRate();
},
methods: {
init() {
if (this.loading) return;
this.loading = true;
this.apipost(
"/api/ClueStatic/GetClueMonth",
this.msg,
(res) => {
this.loading = false;
this.tableData = res.data.data;
},
(e) => {
this.loading = false;
}
);
import clueComponent from "@/components/clueManagement/clueComponent";
export default {
components: {
clueComponent
},
initRate() {
if (this.rateLoading) return;
this.rateLoading = true;
this.apipost(
"/api/ClueStatic/GetClueMonthRate",
this.msg,
(res) => {
this.rateLoading = false;
this.rateData = res.data.data;
data() {
return {
queryTime: {
StartTime: '',
EndTime: ''
},
(e) => {
this.rateLoading = false;
}
);
drawer: false,
isDrawer: true,
msg: {
month: "",
YearStr: "",
},
total: 0,
tableData: [],
loading: false,
rateLoading: false,
activeName: "monthdata",
rateData: [],
};
},
tableRowClassName({ row }) {
let cname = "font-size-12";
if (row.DateStr == "平均") {
cname += " xiaoji-row";
} else if (row.DateStr == "总数") {
cname += " sum-row";
}
return cname;
created() {
let d = new Date();
this.msg.month = d;
this.msg.YearStr = d.getFullYear();
},
tableCellClassName({ row, column }) {
if (
row[column.property].toString().indexOf("-") != -1 &&
column.property != "DateStr"
) {
return "warning-col";
} else if (column.property == "InvalidCount") {
if (
parseFloat(row[column.property]) / parseFloat(row.PushCount) >=
0.2
) {
return "warning-col";
}
}
},
changeMonthHandler(val) {
this.msg.YearStr = val.getFullYear();
mounted() {
this.init();
this.initRate();
},
formatter(row, column) {
return row[column.property] + "%";
},
handleCommand(command) {
console.log(command);
if (command == "1") {
if (this.activeName == "monthdata") {
this.downloadHandler(
"/api/ClueStatic/DownLoadClueMonth",
"月度引流数据"
);
methods: {
handleClose(done) {
done();
},
// 查看详情
seeDetails(row) {
var d = new Date();
var currentY = this.msg.YearStr;
var currentM = this.msg.month;
if (row.DateStr.length == 2) {
currentM = '0' + row.DateStr.slice(0, 1)
} else {
this.downloadHandler(
"/api/ClueStatic/DownLoadClueMonthRate",
"月度引流成长率"
);
currentM = row.DateStr.slice(0, 2)
}
}
},
downloadHandler(url, name) {
console.log("点击了");
this.GetLocalFile(url, this.msg, `${name}.xls`, (res) => {
this.$message({
message: "导出成功",
type: "success",
var MonthDayNum = new Date(currentY, currentM, 0).getDate(); //计算当月的天数
this.queryTime.StartTime = this.msg.YearStr + '-' + currentM + '-01'
this.queryTime.EndTime = currentY + '-' + currentM + '-' + MonthDayNum
this.drawer = true
},
init() {
if (this.loading) return;
this.loading = true;
this.apipost(
"/api/ClueStatic/GetClueMonth",
this.msg,
(res) => {
this.loading = false;
this.tableData = res.data.data;
},
(e) => {
this.loading = false;
}
);
},
initRate() {
if (this.rateLoading) return;
this.rateLoading = true;
this.apipost(
"/api/ClueStatic/GetClueMonthRate",
this.msg,
(res) => {
this.rateLoading = false;
this.rateData = res.data.data;
},
(e) => {
this.rateLoading = false;
}
);
},
tableRowClassName({
row
}) {
let cname = "font-size-12";
if (row.DateStr == "平均") {
cname += " xiaoji-row";
} else if (row.DateStr == "总数") {
cname += " sum-row";
}
return cname;
},
tableCellClassName({
row,
column
}) {
if (
row[column.property] && row[column.property].toString().indexOf("-") != -1 &&
column.property != "DateStr"
) {
return "warning-col";
} else if (column.property == "InvalidCount") {
if (
parseFloat(row[column.property]) / parseFloat(row.PushCount) >=
0.2
) {
return "warning-col";
}
}
},
changeMonthHandler(val) {
this.msg.YearStr = val.getFullYear();
this.init();
this.initRate();
},
formatter(row, column) {
return row[column.property] + "%";
},
handleCommand(command) {
console.log(command);
if (command == "1") {
if (this.activeName == "monthdata") {
this.downloadHandler(
"/api/ClueStatic/DownLoadClueMonth",
"月度引流数据"
);
} else {
this.downloadHandler(
"/api/ClueStatic/DownLoadClueMonthRate",
"月度引流成长率"
);
}
}
},
downloadHandler(url, name) {
console.log("点击了");
this.GetLocalFile(url, this.msg, `${name}.xls`, (res) => {
this.$message({
message: "导出成功",
type: "success",
});
});
});
},
},
},
};
};
</script>
<style>
@import "../../assets/css/customerManage.css";
@import "../../assets/css/customerManage.css";
.el-table__fixed-body-wrapper table {
padding-bottom: 8px !important;
}
.el-table .xiaoji-row {
background: #ffff00;
}
.el-table .sum-row {
background: #00b0f0;
}
.el-table .warning-col {
background: red;
}
.diy-eltabs .el-tabs__content {
height: calc(100% - 40px);
}
.diy-eltabs .data-box-item {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.el-table__fixed-body-wrapper table {
padding-bottom: 8px !important;
}
.el-table .xiaoji-row {
background: #ffff00;
}
.pointer {
cursor: pointer;
}
.el-table .sum-row {
background: #00b0f0;
}
.el-table .warning-col {
background: red;
}
.diy-eltabs .el-tabs__content {
height: calc(100% - 40px);
}
.diy-eltabs .data-box-item {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
</style>
.pointer:hover {
color: #00b0f0;
}
</style>
\ No newline at end of file
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