维护客户基本完善

This commit is contained in:
wanyongkang
2020-11-22 11:08:44 +08:00
parent 3d334596c4
commit 6f166e6d88
2 changed files with 319 additions and 159 deletions

View File

@@ -1,73 +1,63 @@
<template>
<div v-loading="loading">
<div class="heior_box">
<span>
总营业额 <el-tag type="danger" effect="plain">{{retData.OrderAmount }} </el-tag>
总客户数<el-tag type="danger" effect="plain">{{retData.UserTotal }} </el-tag>
</span>
<div class="search-box">
<div class="search-box">
<el-date-picker
v-model="sell_detail_month"
size="small"
v-model="dateRange"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
type="month"
style="margin-right:5px;width:110px;float:left;"
@change="sell_detail_info"
placeholder="选择月">
</el-date-picker>
<el-button slot="append" icon="el-icon-search" @click="search" size="small">搜索</el-button>
</div>
</div>
<el-table :data="retData.List" border size="medium" :height="$getHeight(100)">
<el-table-column prop="Name" label="客户经理" width="180"></el-table-column>
<el-table-column prop="Amount" label="营业额" width="180"></el-table-column>
<el-table-column prop="UserCount" label="客户总数" ></el-table-column>
<el-table-column prop="NewUserCount" label="新增客户"></el-table-column>
<el-table-column prop="name" label="客户经理" width="180"></el-table-column>
<el-table-column prop="sell_percent" label="营业额/总营业额" width="180"></el-table-column>
<el-table-column prop="cost_percent" label="消费客户数/所有客户" ></el-table-column>
<el-table-column prop="cost_register" label="注册且购买过的客户/当月新注册客户总数"></el-table-column>
<el-table-column prop="cost_old_user" label="老客户在本月再次购买/所有老客户"></el-table-column>
<el-table-column prop="com_cost" label="同比增加金额"></el-table-column>
<el-table-column prop="com_percent" label="同比增加百分比"></el-table-column>
<el-table-column prop="today_new_user" label="今日新赠客户"></el-table-column>
<el-table-column prop="refund" label="总退款金额"></el-table-column>
</el-table>
</div>
</template>
<script>
export default {
name: "treeTable",
components: {
name: 'treeTable',
components: {
},
data() {
data () {
return {
loading: false,
options: [],
retData: { OrderAmount: 0,UserTotal:0, List: [] },
retData: { OrderAmount: 0, UserTotal: 0, List: [] },
dateRange: [],
searchModel: {
Btime: "",
Etime: "",
}
};
sell_detail_month: null
}
},
created() {
this.$store.commit("setCurrentNav", "订单管理>>销售统计");
this.get();
created () {
this.$store.commit('setCurrentNav', '订单管理>>销售统计')
this.get()
},
methods: {
search() {
this.get();
search () {
this.get()
},
get() {
if (this.dateRange && this.dateRange.length == 2) {
this.searchModel.Btime = this.dateRange[0];
this.searchModel.Etime = this.dateRange[1];
}else{
this.searchModel.Btime =null;
this.searchModel.Etime =null;
}
this.$api.get("course/v1/order/UserCountStatistics", this.searchModel).then(res => {
this.retData = res.Data;
});
get () {
this.$api.get(this.$api.phpURL + 'manager/SellInfo/getAll', {sell_month: this.sell_detail_month}).then(res => {
this.retData.List = res.data
})
},
dataExport() {
this.$api.getDownloadFile("/baseinfo/v1/chargeorder/ExportOrder", this.searchModel);
dataExport () {
this.$api.getDownloadFile('/baseinfo/v1/chargeorder/ExportOrder', this.searchModel)
}
}
};
}
</script>
<style scoped>
</style>

View File

@@ -1,91 +1,139 @@
<template>
<div v-loading="loading">
<div class="heior_box">
<el-button
<el-card class="box-card">
<el-date-picker
v-model="sell_detail_month"
size="small"
type="primary"
icon="el-icon-sold-out"
v-if="$local.isRoot()"
@click="dataExport"
>导出</el-button>
type="month"
style="margin-right:5px;width:110px;float:left;"
@change="sell_detail_info"
placeholder="选择月">
</el-date-picker>
<p>
{{sell_detail.sell_percent}}&nbsp;&nbsp;<span style="color:red">||</span>
{{sell_detail.cost_percent}}&nbsp;&nbsp;<span style="color:red">||</span>
{{sell_detail.cost_register}}&nbsp;&nbsp;<span style="color:red">||</span>
{{sell_detail.cost_old_user}}&nbsp;&nbsp;<br>
{{sell_detail.com_cost}}&nbsp;&nbsp;<span style="color:red">||</span>
{{sell_detail.com_percent}}&nbsp;&nbsp;<span style="color:red">||</span>
{{sell_detail.today_new_user}}&nbsp;&nbsp;<span style="color:red">||</span>
{{sell_detail.refund}}
</p>
</el-card>
<el-card class="box-card">
<div class="heior_box">
<!-- <el-button size="small" type="primary" icon="el-icon-sold-out" @click="dataExport" v-if="$local.isRoot()">导出</el-button> -->
<div class="search-box">
<el-date-picker
v-model="last_month"
type="datetimerange"
align="right"
size="small"
v-model="dateRange1"
type="daterange"
range-separator=""
start-placeholder="A开始日期"
end-placeholder="A结束日期"
></el-date-picker>
style="margin-right:5px;"
start-placeholder="上月开始日期"
end-placeholder="上月结束日期"
:default-time="['00:00:00', '00:00:00']">
</el-date-picker>
<el-date-picker
v-model="new_month"
type="datetimerange"
align="right"
size="small"
v-model="dateRange2"
type="daterange"
range-separator=""
start-placeholder="B开始日期"
end-placeholder="B结束日期"
></el-date-picker>
style="margin-right:5px;"
start-placeholder="本月开始日期"
end-placeholder="本月结束日期"
:default-time="['00:00:00', '00:00:00']">
</el-date-picker>
<!-- <el-date-picker
v-model="searchModel.month"
size="small"
type="month"
style="margin-right:5px;width:110px"
placeholder="选择月">
</el-date-picker> -->
<el-select size="small" style="margin-right:5px;" v-model="searchModel.cost_type" placeholder="请选择">
<el-option
v-for="item in cost_types"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input
size="small"
placeholder="起始金额"
type="number"
style="margin-right:5px;width:100px"
v-model="searchModel.money1">
</el-input>
<el-input
size="small"
placeholder="截至金额"
type="number"
style="margin-right:5px;width:100px"
v-model="searchModel.money2">
</el-input>
<el-select
v-model="searchModel.profile"
clearable
style="margin-right:5px;width:160px"
size="small"
placeholder="状态"
>
<el-option v-for="item in types" :key="item.label" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input v-model="searchModel.keyWord" placeholder="请输入会员号" clearable size="small">
<el-input style="width:190px" v-model="searchModel.keyWord" placeholder="请输入会员号" clearable size="small">
<el-button slot="append" icon="el-icon-search" @click="search"></el-button>
</el-input>
</div>
</div>
<el-table :data="retData.Data" size="medium" :height="$getHeight(300)"
<el-table :data="retData.Data" :height="$getHeight(200)"
@sort-change="sort"
row-key="Id" border>
<el-table-column prop="Profile" label="状态" width="240">
<template slot-scope="scope">
<el-dropdown size="small" split-button type="primary">
{{scope.row.UserInfo.Profile}}
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="changeProfile(scope.row,'已完成')">已完成</el-dropdown-item>
<el-dropdown-item @click.native="changeProfile(scope.row,'高意向客户')">高意向客户</el-dropdown-item>
<el-dropdown-item @click.native="changeProfile(scope.row,'待跟进-消费减少')">待跟进-消费减少</el-dropdown-item>
<el-dropdown-item @click.native="changeProfile(scope.row,'待跟进-未购买')">待跟进-未购买</el-dropdown-item>
<el-dropdown-item @click.native="changeProfile(scope.row,'跟进超时-消费减少')">跟进超时-消费减少</el-dropdown-item>
<el-dropdown-item @click.native="changeProfile(scope.row,'跟进超时-未购买')">跟进超时-未购买</el-dropdown-item>
<el-dropdown-item @click.native="changeProfile(scope.row,'流失-需求减少')">流失-需求减少</el-dropdown-item>
<el-dropdown-item @click.native="changeProfile(scope.row,'流失-暂时不用')">流失-暂时不用</el-dropdown-item>
<el-dropdown-item @click.native="changeProfile(scope.row,'流失-价格问题')">流失-价格问题</el-dropdown-item>
<el-dropdown-item @click.native="changeProfile(scope.row,'流失-产品问题')">流失-产品问题</el-dropdown-item>
<el-dropdown-item @click.native="changeProfile(scope.row,'跟进超时')">跟进超时</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-table-column prop="follow_status" label="状态">
<template slot-scope="scope">
<el-link @click="click_follow_status(scope.row)">{{scope.row.follow_status}}</el-link>
</template>
</el-table-column>
<el-table-column prop="UserName" label="用户">
<el-table-column label="会员号">
<template slot-scope="scope">
<phoneHide :text="scope.row.UserName"></phoneHide>
</template>
</el-table-column>
<el-table-column prop="UserName" label="联系信息">
<template slot-scope="scope">
<p v-if="scope.row.UserInfo.Wx">微信:{{scope.row.UserInfo.Wx}}</p>
<p v-if="scope.row.UserInfo.QQ">QQ:{{scope.row.UserInfo.QQ}}</p>
<p v-if="scope.row.UserInfo.TaoBao">淘宝:{{scope.row.UserInfo.TaoBao}}</p>
<p v-if="scope.row.UserInfo.WangWang">旺旺:{{scope.row.UserInfo.WangWang}}</p>
<el-link @click="click_username(scope.row)">{{scope.row.UserName}}</el-link>
</template>
</el-table-column>
<el-table-column prop="CreateTime" label="注册时间"></el-table-column>
<el-table-column prop="PrevMonthAmount" label="消费金额A" sortable="custom"></el-table-column>
<el-table-column prop="MonthAmount" label="消费金额B" sortable="custom"></el-table-column>
<el-table-column prop="AddAmount" label="对比增长金额" sortable="custom">
<!-- <template slot-scope="scope">
{{scope.row.MonthAmount-scope.row.PrevMonthAmount}}
</template> -->
</el-table-column>
<el-table-column prop="TotalAccountCount" label="账户总数" sortable="custom"></el-table-column>
<el-table-column prop="UsingAccountCount" label="使用中个数" sortable="custom"></el-table-column>
<el-table-column prop="ExpirdAccountCount" label="过期个数" sortable="custom"></el-table-column>
<el-table-column prop="last_pay_time" label="最后消费时间"></el-table-column>
<el-table-column label="消费" sortable="all_amount">
<template slot-scope="scope">
<el-link @click="click_all_amount(scope.row,1)">{{scope.row.all_amount}}</el-link>
</template>value
</el-table-column>
<el-table-column label="上月消费" sortable="PrevMonthAmount">
<template slot-scope="scope">
<el-link @click="click_all_amount(scope.row,2)">{{scope.row.PrevMonthAmount}}</el-link>
</template>
</el-table-column>
<el-table-column label="本月消费" sortable="MonthAmount">
<template slot-scope="scope">
<el-link @click="click_all_amount(scope.row,3)">{{scope.row.MonthAmount}}</el-link>
</template>
</el-table-column>
<el-table-column prop="AddAmount" label="对比增长金额"></el-table-column>
<el-table-column prop="persent" label="对比增长百分比"></el-table-column>
<el-table-column label="账户总数" sortable="account_count">
<template slot-scope="scope">
<el-link @click="click_account(scope.row,1)">{{scope.row.account_count}}</el-link>
</template>
</el-table-column>
<el-table-column label="使用中个数" sortable="account_used">
<template slot-scope="scope">
<el-link @click="click_account(scope.row,3)">{{scope.row.account_used}}</el-link>
</template>
</el-table-column>value
<el-table-column label="过期个数" sortable="account_expire">
<template slot-scope="scope">
<el-link @click="click_account(scope.row,2)">{{scope.row.account_expire}}</el-link>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
@@ -97,6 +145,68 @@
:total="retData.TotalCount"
></el-pagination>
</div>
<el-dialog
title="修改跟进状态"
:visible.sync="follow_status_change_fall"
width="30%">
<el-select size="small" v-model="set_follow_status.status" placeholder="请选择">
<el-option
v-for="item in types"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input style="margin:5px 0" v-model="set_follow_status.remark" size="small" placeholder="请输入备注"></el-input>
<el-table :data="follow_status_list" border>
<el-table-column prop="record" width="230" label="跟进记录"></el-table-column>
<el-table-column prop="remark" label="备注"></el-table-column>
<el-table-column prop="create_time" label="时间"></el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="follow_status_change_fall = false"> </el-button>
<el-button :disabled="clickOk" type="primary" @click="changeFolowStatus()"> </el-button>
</span>
</el-dialog>
<el-dialog
title="用户信息"
:visible.sync="userinfo_fall"
width="30%">
<el-card class="box-card">
<p oncopy="return false;">电话{{user_info.UserName}}</p>
<p>微信{{user_info.Wx}}</p>
<p>QQ{{user_info.QQ}}</p>
</el-card>
</el-dialog>
<el-dialog
title="消费记录"
:visible.sync="cost_fall"
width="50%">
<el-table height="500px" :data="cost_list" border>
<el-table-column prop="ScoreTypeName" label="资金项目"></el-table-column>
<el-table-column prop="ScoreValue" label="操作金额"></el-table-column>
<el-table-column prop="RestAmount1" label="操作前金额"></el-table-column>
<el-table-column prop="RestAmount2" label="操作后金额"></el-table-column>
<el-table-column prop="UpdateTime" label="时间"></el-table-column>
</el-table>
</el-dialog>
<el-dialog
title="帐号记录"
:visible.sync="account_fall"
width="50%">
<el-table height="500px" :data="account_list" border>
<el-table-column prop="ProductName" label="产品"></el-table-column>
<el-table-column prop="PackageName" label="套餐"></el-table-column>
<el-table-column prop="Account" label="帐号"></el-table-column>
<el-table-column prop="StartTime" label="开始时间"></el-table-column>
<el-table-column prop="EndTime" label="结束时间"></el-table-column>
</el-table>
</el-dialog>
</el-card>
</div>
</template>
<script>
@@ -117,81 +227,141 @@ export default {
keyWord: '',
sortLable: '',
sortOrder: 0,
profile: ''
profile: '',
last_month: {
s_time: '',
e_time: ''
},
new_month: {
s_time: '',
e_time: ''
},
cost_type: '0',
money1: null,
money2: null
},
types: [
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '已完成', label: '已完成'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '高意向客户', label: '高意向客户'},
// eslint-disable-next-line indent
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '待跟进-消费减少', label: '待跟进-消费减少'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '待跟进-未购买', label: '待跟进-未购买'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '跟进超时-消费减少', label: '跟进超时-消费减少'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '跟进超时-未购买', label: '跟进超时-未购买'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '流失-需求减少', label: '流失-需求减少'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '流失-暂时不用', label: '流失-暂时不用'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '流失-价格问题', label: '流失-价格问题'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '流失-产品问题', label: '流失-产品问题'},
// eslint-disable-next-line standard/object-curly-even-spacing
{ value: '跟进超时', label: '跟进超时'}
]
types: [],
user_info: {},
follow_status_change_fall: false,
follow_status_list: [],
set_follow_status: {
user_id: null,
old_status: null,
status: null,
remark: null
},
userinfo_fall: false,
clickOk: false,
cost_fall: false,
cost_list: [],
account_list: [],
account_fall: false,
last_month: null,
new_month: null,
cost_types: [{
value: '0',
label: '总消费'
}, {
value: '1',
label: '上月消费'
}, {
value: '2',
label: '本月消费'
}],
sell_detail: {},
sell_detail_month: null
}
},
created () {
this.$store.commit('setCurrentNav', '用户管理>>消费统计')
this.dateRange1[0] = dateUtil.getLastMonthStartDate()
this.dateRange1[1] = dateUtil.getLastMonthCurrentDate()
this.dateRange2[0] = dateUtil.getMonthStartDate()
this.dateRange2[1] = dateUtil.getMonthCurrentDate()
this.get()
this.sell_detail_info()
},
methods: {
sell_detail_info () {
this.$api.get(this.$api.phpURL + 'manager/SellInfo/getOne', {sell_month: this.sell_detail_month}).then(res => {
this.sell_detail = res.data
})
},
// eslint-disable-next-line standard/object-curly-even-spacing
sort ({column, prop, order }) {
console.log(column)
console.log(prop)
console.log(order)
this.searchModel.sortLable = prop
this.searchModel.PageIndex = 1
this.searchModel.sortLable = column.sortable
// eslint-disable-next-line eqeqeq
this.searchModel.sortOrder = order == 'ascending' ? 0 : 1
this.search()
},
changeProfile (row, command) {
row.UserInfo.Profile = command
this.$api
.post('baseinfo/v1/user/UpdateProfile', {UserId: row.UserInfo.Id, Profile: command})
.then(res => {})
this.searchModel.sortOrder = order == 'ascending' ? 1 : 0
this.get()
},
search () {
if (this.last_month && this.last_month.length === 2) {
this.searchModel.last_month.s_time = this.last_month[0]
this.searchModel.last_month.e_time = this.last_month[1]
}
if (this.new_month && this.new_month.length === 2) {
this.searchModel.new_month.s_time = this.new_month[0]
this.searchModel.new_month.e_time = this.new_month[1]
}
this.searchModel.PageIndex = 1
this.searchModel.sortLable = null
if (this.searchModel.money1 || this.searchModel.money2) {
if (!(this.searchModel.money1 && this.searchModel.money2)) {
this.$message({
message: '请正确填写消费范围',
type: 'warning'
})
return
}
}
this.get()
},
get () {
this.loading = true
if (this.dateRange1 && this.dateRange1.length === 2) {
this.searchModel.bTime1 = this.dateRange1[0]
this.searchModel.eTime1 = this.dateRange1[1]
}
if (this.dateRange2 && this.dateRange2.length === 2) {
this.searchModel.bTime2 = this.dateRange2[0]
this.searchModel.eTime2 = this.dateRange2[1]
}
this.$api
.get('course/v1/order/UserConsumeStatistics', this.searchModel)
.then(res => {
this.retData = res
this.loading = false
this.$api.get(this.$api.phpURL + 'manager/UserFollow/getList', {PageIndex: this.searchModel.PageIndex, search: this.searchModel}).then(res => {
this.retData.Data = res.data.list
this.retData.TotalCount = parseInt(res.data.count)
this.types = res.data.types
this.loading = false
})
},
click_follow_status (row) {
this.clickOk = false
this.follow_status_change_fall = true
this.set_follow_status.status = row.follow_status
this.set_follow_status.user_id = row.Id
this.set_follow_status.old_status = row.follow_status
this.$api.get(this.$api.phpURL + 'manager/UserFollow/getFollowRecord', {id: row.Id}).then(res => {
this.follow_status_list = res.data
})
},
changeFolowStatus () {
// eslint-disable-next-line valid-typeof
if (typeof this.set_follow_status.status !== 'number') {
this.$alert('请选择跟进状态', '警告', {
confirmButtonText: '确定'
})
return
}
this.clickOk = true
this.$api.post(this.$api.phpURL + 'manager/UserFollow/changeFolowStatus', {data: this.set_follow_status}).then(res => {
this.follow_status_change_fall = false
})
},
click_username (row) {
this.userinfo_fall = true
this.$api.get(this.$api.phpURL + 'manager/UserFollow/getUserInfo', {id: row.Id}).then(res => {
this.user_info = res.data
})
},
click_all_amount (row, index) {
this.cost_fall = true
this.$api.get(this.$api.phpURL + 'manager/UserFollow/getCostList', {id: row.Id, index: index}).then(res => {
this.cost_list = res.data
})
},
click_account (row, index) {
this.account_fall = true
this.$api.get(this.$api.phpURL + 'manager/UserFollow/getAccountList', {id: row.Id, index: index}).then(res => {
this.account_list = res.data
})
},
dataExport () {
this.$api.getDownloadFile('/course/v1/order/ExportUserConsumeStatistics', this.searchModel)