导粉统计,更新客户手机号时更新下微信用户对应的客户ID

This commit is contained in:
xiezhijun
2021-05-19 19:18:18 +08:00
parent 7cac34799c
commit 574c8b424e
18 changed files with 299 additions and 20 deletions

View File

@ -71,4 +71,14 @@ export function copyLastTimeLiveSchedul() {
})
}
// 根据日期查询直播记录
export function getAllLiveSchedulByDate(data) {
return request({
url: '/custom/liveSchedul/getAllLiveSchedulByDate',
method: 'get',
params: data
})
}

View File

@ -1,16 +1,16 @@
<template>
<!-- 添加或修改导粉管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="1100px" :close-on-click-modal="false" append-to-body>
<div style="height: 500px; overflow: auto">
<el-table v-loading="loading" :data="wxAccountList">
<!--<el-table-column label="微信昵称" align="center" prop="wxNickName" />-->
<el-table-column label="微信号" align="center" prop="wxAccount" width="120"/>
<el-table-column label="销售" align="center" prop="saleName" width="120"/>
<el-table-column label="已导粉数量" align="center" prop="importFanNum" width="120"/>
<el-table-column label="进粉渠道" align="center" prop="fanChannel" >
<el-table-column label="进粉渠道" align="center" prop="importFanChannel" >
<template slot-scope="scope">
<el-select
v-model="scope.row.fanChannel"
v-model="scope.row.importFanChannel"
placeholder="请选择账号渠道"
clearable
filterable
@ -25,6 +25,24 @@
</el-select>
</template>
</el-table-column>
<el-table-column label="直播间" align="center" prop="importFanLive" >
<template slot-scope="scope">
<el-select
v-model="scope.row.importFanLive"
placeholder="请选择直播间"
clearable
filterable
size="small"
>
<el-option
v-for="dict in liveSchedukList"
:key="dict.id"
:label="dict.liveRoomName"
:value="parseInt(dict.id)"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="导粉数量" align="center" prop="fanNum" width="200">
<template slot-scope="scope">
<el-input-number v-model="scope.row.fanNum" :min="1" :max="10000" label="导粉数量" style="width:160px"></el-input-number>
@ -33,10 +51,9 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
size="normal"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
@click="addImportFanRecord(scope.row)"
v-hasPermi="['custom:importFanRecord:add']"
>导粉</el-button>
</template>
@ -48,6 +65,7 @@
</template>
<script>
import { addImportFanRecord,getWxAccountAndSale } from "@/api/custom/importFanRecord";
import { getAllLiveSchedulByDate } from "@/api/custom/liveSchedul";
export default {
name: "ImportFan",
components: {
@ -71,10 +89,13 @@ export default {
callback: null,
//可接粉的微信号
wxAccountList:[],
fanChanneloptions:[]
fanChanneloptions:[],
//当日直播间
liveSchedukList:[]
};
},
created(){
},
methods: {
@ -82,11 +103,13 @@ export default {
if(!data || data == undefined || data == null){
return;
}
this.data = data;
this.fanChanneloptions = fanChanneloptions;
this.title = "「"+data.importFanDate+"」微信导粉(只显示可接粉微信号)";
this.reset();
this.callback = callback;
this.getListWxAccount();
this.getAllLiveSchedulByDate();
this.open = true;
},
reset(){
@ -107,10 +130,57 @@ export default {
getListWxAccount() {
this.loading = true;
getWxAccountAndSale().then((response) => {
response.rows.forEach((item,index) => {
item.fanNum = 1;
})
this.wxAccountList = response.rows;
this.loading = false;
});
},
getAllLiveSchedulByDate(){
console.log("--");
getAllLiveSchedulByDate({'liveSchedulDate':this.data.importFanDate}).then((response) => {
response.data.forEach((item,index) => {
item.liveRoomName = item.liveNutritionistName + " " + item.liveRoomName;
});
this.liveSchedukList = response.data;
});
},
addImportFanRecord(row){
//账号渠道、进粉数量不能为空
if(row.importFanChannel == undefined || row.importFanChannel == null){
this.$message({
type: 'warning',
message: '进粉渠道不能为空',
center: true
});
return;
}
if(row.fanNum == undefined || row.fanNum == null){
this.$message({
type: 'warning',
message: '进粉数量不能为空',
center: true
});
return;
}
let param = {
'importFanDate': this.data.importFanDate,
'importFanChannel': row.importFanChannel,
'importFanLive': row.importFanLive,
'wxAccountId': row.id,
'fanNum': row.fanNum
}
addImportFanRecord(param).then((response) => {
if(response.code == 200){
this.msgSuccess("导粉成功");
row.importFanChannel = null;
row.fanNum = 1;
row.importFanLive = null;
}
});
}
},
};
</script>

View File

@ -89,8 +89,12 @@
<span>{{ parseTime(scope.row.importFanDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="导粉渠道" align="center" prop="importFanChannel" />
<!--<el-table-column label="进粉直播间" align="center" prop="importFanLive" />-->
<el-table-column label="进粉账号渠道" align="center" prop="importFanChannelName" />
<el-table-column label="所属直播间" align="center" prop="liveRoomName" >
<template slot-scope="scope">
{{scope.row.liveRoomName + "—" + scope.row.liveNutritionistName}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button