Commit 0d185f54 by 李伟康

流量有效性

1 parent 2b53f22a
...@@ -52,6 +52,13 @@ module.exports = { ...@@ -52,6 +52,13 @@ module.exports = {
/** 查询客户画像 */ /** 查询客户画像 */
portraitQuery(data) { portraitQuery(data) {
return api.post('dj.api.smartcarlife.customer.portrait.query', data) return api.post('dj.api.smartcarlife.customer.portrait.query', data)
},
/**
* 标记流量有效性
*
*/
updateTrafficEffectiveness(data) {
return api.post('dj.api.smartcarlife.inviteRecord.trafficEffectiveness.update', data)
} }
} }
import api from "../../api"; import api from "../../api";
// tabDate/pages/detail/detail.js // tabDate/pages/detail/detail.js
import CONSTANTDATA from "../userPortrait/constant/data"; import CONSTANTDATA from "../userPortrait/constant/data";
import { checkDailyReport } from "~/store/ModalToQueueControl"; import {
checkDailyReport
} from "~/store/ModalToQueueControl";
const app = getApp(); const app = getApp();
Page({ Page({
/** /**
...@@ -21,8 +23,7 @@ Page({ ...@@ -21,8 +23,7 @@ Page({
remark: "", remark: "",
selectPayType: 2, selectPayType: 2,
}, },
customerObj: [ customerObj: [{
{
label: "客户姓名", label: "客户姓名",
key: "customerName", key: "customerName",
}, },
...@@ -56,8 +57,7 @@ Page({ ...@@ -56,8 +57,7 @@ Page({
portrait: true, portrait: true,
}, },
], ],
recordObj: [ recordObj: [{
{
label: "跟进人", label: "跟进人",
key: "userName", key: "userName",
}, },
...@@ -80,42 +80,65 @@ Page({ ...@@ -80,42 +80,65 @@ Page({
remark: "", remark: "",
isOrder: true, isOrder: true,
selectType: 1, selectType: 1,
sceneObj: {} sceneObj: {},
trafficEffectivenessList: [{
name: '有效客户',
value: '1'
},
{
name: '无效客户',
value: '2'
}
]
}, },
// 确定是否要显示 // 确定是否要显示
showSelectType({ scene = "", item = {} }) { showSelectType({
scene = "",
item = {}
}) {
wx.$modal( wx.$modal(
this, this, {
{
show: true, show: true,
title: "请选择录单入口", title: "请选择录单入口",
tabTitleShow: false, tabTitleShow: false,
success: (res) => { success: (res) => {
// 跳转新增订单页面 并带特定参数 // 跳转新增订单页面 并带特定参数
let { selectType } = this.data; let {
selectType
} = this.data;
if (selectType == 1) { if (selectType == 1) {
// wx.$router.go("tabWorkOrder.createOrder", { // wx.$router.go("tabWorkOrder.createOrder", {
// scene, // scene,
// ...item, // ...item,
// }); // });
this.setData({ showPromptDialog: true, sceneObj: item }) this.setData({
showPromptDialog: true,
sceneObj: item
})
} else { } else {
console.log({ ...item }, "item"); console.log({
...item
}, "item");
wx.$router.go("tabWorkOrder.defeatOrder", { wx.$router.go("tabWorkOrder.defeatOrder", {
scene, scene,
...item, ...item,
}); });
} }
}, },
error: () => { }, error: () => {},
}, },
"#modal2" "#modal2"
); );
}, },
promptHandleConfirm(e) { promptHandleConfirm(e) {
let { payFlag, payType } = e.detail let {
let { sceneObj } = this.data payFlag,
payType
} = e.detail
let {
sceneObj
} = this.data
let paymentMethod = payFlag != 2 ? 1 : payType let paymentMethod = payFlag != 2 ? 1 : payType
if (payFlag == 1 || payType == 3 || payType == 4 || payType == 6) { if (payFlag == 1 || payType == 3 || payType == 4 || payType == 6) {
let params = { let params = {
...@@ -136,7 +159,9 @@ Page({ ...@@ -136,7 +159,9 @@ Page({
}) })
}, },
selectType(e) { selectType(e) {
let { type } = e.currentTarget.dataset; let {
type
} = e.currentTarget.dataset;
console.log(e, e.currentTarget.dataset, type); console.log(e, e.currentTarget.dataset, type);
this.setData({ this.setData({
selectType: type, selectType: type,
...@@ -144,8 +169,12 @@ Page({ ...@@ -144,8 +169,12 @@ Page({
}, },
showPopup(e) { showPopup(e) {
let _this = this; let _this = this;
let { name } = e.currentTarget.dataset; let {
let { detail } = this.data; name
} = e.currentTarget.dataset;
let {
detail
} = this.data;
// if (detail.inviteStatus == 4 && name == 'showDate') return _this.showToast('已施工不可操作!')// 已施工预约单不可修改到店时间 // if (detail.inviteStatus == 4 && name == 'showDate') return _this.showToast('已施工不可操作!')// 已施工预约单不可修改到店时间
this.setData({ this.setData({
[name]: !this.data[name], [name]: !this.data[name],
...@@ -153,7 +182,9 @@ Page({ ...@@ -153,7 +182,9 @@ Page({
}, },
setCopyData(e) { setCopyData(e) {
console.log(e); console.log(e);
let { content } = e.currentTarget.dataset; let {
content
} = e.currentTarget.dataset;
wx.$util.setCopyData(`${content}`); wx.$util.setCopyData(`${content}`);
}, },
editProtrait(e) { editProtrait(e) {
...@@ -162,7 +193,9 @@ Page({ ...@@ -162,7 +193,9 @@ Page({
}, },
makePhoneCall(e) { makePhoneCall(e) {
console.log(e); console.log(e);
let { data } = e.currentTarget.dataset; let {
data
} = e.currentTarget.dataset;
wx.makePhoneCall({ wx.makePhoneCall({
phoneNumber: data, phoneNumber: data,
}); });
...@@ -190,7 +223,7 @@ Page({ ...@@ -190,7 +223,7 @@ Page({
} }
let userInfo = wx.$util.getUserInfo(); let userInfo = wx.$util.getUserInfo();
this.setData({ this.setData({
isOrder: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6|| userInfo?.loginRole == 7), isOrder: !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6 || userInfo?.loginRole == 7),
}); });
this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig); this.checkPhoneShow(app.globalData.YQorderSetting?.yqPhoneConfig);
}, },
...@@ -198,7 +231,9 @@ Page({ ...@@ -198,7 +231,9 @@ Page({
console.log("config", config); console.log("config", config);
// 有就屏蔽手机号的显示 // 有就屏蔽手机号的显示
if (config) { if (config) {
let { customerObj } = this.data; let {
customerObj
} = this.data;
delete customerObj[1]; delete customerObj[1];
this.setData({ this.setData({
customerObj, customerObj,
...@@ -207,7 +242,10 @@ Page({ ...@@ -207,7 +242,10 @@ Page({
}, },
async dealPortrait(id) { async dealPortrait(id) {
let _userPortrait = []; let _userPortrait = [];
let { code, data: info } = await api.portraitQuery({ let {
code,
data: info
} = await api.portraitQuery({
id, id,
}); });
if (code != 0) return; if (code != 0) return;
...@@ -256,7 +294,11 @@ Page({ ...@@ -256,7 +294,11 @@ Page({
}) })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
let { code, message, data } = res; let {
code,
message,
data
} = res;
if (code == 0) { if (code == 0) {
wx.$util.hideLoading(); wx.$util.hideLoading();
let detail = {}; let detail = {};
...@@ -287,9 +329,9 @@ Page({ ...@@ -287,9 +329,9 @@ Page({
// 格式化跟进时间 // 格式化跟进时间
let time = e.inviteDate; let time = e.inviteDate;
e.inviteDate = time e.inviteDate = time ?
? `「${new Date(e.inviteDate).format("MM-dd hh:mm")}」` `「${new Date(e.inviteDate).format("MM-dd hh:mm")}」` :
: ""; "";
}); });
} }
if (detail.carSeriesName) if (detail.carSeriesName)
...@@ -303,7 +345,20 @@ Page({ ...@@ -303,7 +345,20 @@ Page({
detail.inviteDate = new Date(detail.inviteDate).format( detail.inviteDate = new Date(detail.inviteDate).format(
"yyyy-MM-dd hh:mm:ss" "yyyy-MM-dd hh:mm:ss"
); );
if (detail.trafficEffectiveness) {
detail.trafficEffectivenessName = {
1: '有效客户',
2: '无效客户'
} [detail.trafficEffectiveness]
}
let {
userInfo,
isOrder
} = this.data,
trafficEffectivenessDisabled = userInfo.isSuper && !userInfo.merchantType && userInfo.userType != 2 && !isOrder &&
detail.inviteStatus == 4 && detail.inviteStatus == 6 && detail.inviteStatus == 7
this.setData({ this.setData({
trafficEffectivenessDisabled,
detail, detail,
flag: true, flag: true,
}); });
...@@ -326,7 +381,10 @@ Page({ ...@@ -326,7 +381,10 @@ Page({
}); });
}, },
setInviteDate() { setInviteDate() {
let { detail, inviteDateStr } = this.data; let {
detail,
inviteDateStr
} = this.data;
api api
.setInviteDate({ .setInviteDate({
id: detail.id, id: detail.id,
...@@ -338,7 +396,11 @@ Page({ ...@@ -338,7 +396,11 @@ Page({
wx.$util.refreshPageData(true); wx.$util.refreshPageData(true);
wx.hideLoading(); wx.hideLoading();
console.log(res); console.log(res);
let { code, data, message } = res; let {
code,
data,
message
} = res;
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
showDate: false, showDate: false,
...@@ -351,7 +413,9 @@ Page({ ...@@ -351,7 +413,9 @@ Page({
}, },
cancelInvite() { cancelInvite() {
let _this = this; let _this = this;
let { id } = this.data.detail; let {
id
} = this.data.detail;
wx.showModal({ wx.showModal({
title: "温馨提示", title: "温馨提示",
content: "是否取消预约?", content: "是否取消预约?",
...@@ -367,7 +431,10 @@ Page({ ...@@ -367,7 +431,10 @@ Page({
}) })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
let { code, message } = res; let {
code,
message
} = res;
if (code == 0) { if (code == 0) {
wx.hideLoading(); wx.hideLoading();
_this.showToast("取消成功!"); _this.showToast("取消成功!");
...@@ -384,8 +451,12 @@ Page({ ...@@ -384,8 +451,12 @@ Page({
}, },
remarkConfirm(e) { remarkConfirm(e) {
let value = e.detail; let value = e.detail;
let { detail } = this.data; let {
let { id } = detail.remarks[0]; detail
} = this.data;
let {
id
} = detail.remarks[0];
if (value) { if (value) {
api api
.followRecord({ .followRecord({
...@@ -393,7 +464,10 @@ Page({ ...@@ -393,7 +464,10 @@ Page({
remark: value, remark: value,
}) })
.then((res) => { .then((res) => {
let { code, message } = res; let {
code,
message
} = res;
if (code == 0) { if (code == 0) {
this.showToast("提交成功"); this.showToast("提交成功");
this.getInviteDetail(detail.id); this.getInviteDetail(detail.id);
...@@ -409,23 +483,54 @@ Page({ ...@@ -409,23 +483,54 @@ Page({
let staffCheck = await checkDailyReport(); let staffCheck = await checkDailyReport();
if (staffCheck) return false; if (staffCheck) return false;
if (await wx.$globalDataFunction.inspectionOfProhibitionBill()) return if (await wx.$globalDataFunction.inspectionOfProhibitionBill()) return
let { detail } = this.data; let {
detail
} = this.data;
detail.isAppointment = true; detail.isAppointment = true;
wx.$util.pointRecord(25); wx.$util.pointRecord(25);
// wx.$router.redirectTo('tabWorkOrder.createOrder', detail) // wx.$router.redirectTo('tabWorkOrder.createOrder', detail)
console.log(detail, "detail"); console.log(detail, "detail");
this.showSelectType({ item: detail }); this.showSelectType({
item: detail
});
},
async bindPickerChange(e) {
console.log(e)
let {
value
} = e.detail, {
trafficEffectivenessList,
detail: {
id
}
} = this.data,
trafficEffectiveness = trafficEffectivenessList[value].value,
trafficEffectivenessName = trafficEffectivenessList[value].name,
data = await api.updateTrafficEffectiveness({
id,
trafficEffectiveness,
inviteDateStr: 1,
inviteType: 1
})
if (data) this.setData({
['detail.trafficEffectiveness']: trafficEffectiveness,
['detail.trafficEffectivenessName']: trafficEffectivenessName
})
console.log(data)
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { }, onReady: function () {},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
let { options } = this.data; let {
options
} = this.data;
if (options?.id) { if (options?.id) {
this.getInviteDetail(options.id); this.getInviteDetail(options.id);
} }
...@@ -434,25 +539,25 @@ Page({ ...@@ -434,25 +539,25 @@ Page({
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { }, onHide: function () {},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { }, onUnload: function () {},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { }, onPullDownRefresh: function () {},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { }, onReachBottom: function () {},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { }, onShareAppMessage: function () {},
}); });
\ No newline at end of file \ No newline at end of file
...@@ -15,17 +15,26 @@ page { ...@@ -15,17 +15,26 @@ page {
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 var(--fontSize4) var(--fontSize20) 0 rgba(0, 0, 0, 0.10); box-shadow: 0 var(--fontSize4) var(--fontSize20) 0 rgba(0, 0, 0, 0.10);
border-radius: var(--fontSize16); border-radius: var(--fontSize16);
padding: var(--fontSize32) var(--fontSize40) var(--fontSize20); padding: var(--fontSize32) var(--fontSize32) var(--fontSize20);
position: relative; position: relative;
margin-bottom: var(--fontSize20); margin-bottom: var(--fontSize20);
} }
.box .title { .box .title {
font-size: var(--fontSize36); font-size: var(--fontSize32);
color: #333333; color: #333333;
font-weight: 700; font-weight: 700;
padding-bottom: var(--fontSize30); padding-bottom: var(--fontSize30);
border-bottom: var(--fontSize2) solid rgba(195, 195, 195, .3); border-bottom: var(--fontSize2) solid rgba(195, 195, 195, .3);
display: flex;
align-items: center;
&-tips {
font-size: 20rpx;
color: #999EA8;
font-weight: 400;
margin-left: auto;
}
} }
.box .customer-list { .box .customer-list {
...@@ -384,6 +393,7 @@ page { ...@@ -384,6 +393,7 @@ page {
color: #292D33; color: #292D33;
padding-left: 24rpx; padding-left: 24rpx;
margin: 0 auto; margin: 0 auto;
&+.modalbox { &+.modalbox {
margin-top: 16rpx; margin-top: 16rpx;
} }
...@@ -400,3 +410,41 @@ page { ...@@ -400,3 +410,41 @@ page {
box-sizing: border-box; box-sizing: border-box;
padding: var(--fontSize48) 0; padding: var(--fontSize48) 0;
} }
.picker-box {
width: 100%;
margin-top: 20rpx;
}
.picker {
display: flex;
align-items: center;
width: 100%;
height: 64rpx;
&-label {
flex-shrink: 0;
}
&-value {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
}
.placeholder {
font-size: 28rpx;
color: #BEC1C7;
}
.arrow {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/arrow.png');
background-size: 100% 100%;
margin-left: 4rpx;
}
\ No newline at end of file \ No newline at end of file
...@@ -37,6 +37,24 @@ ...@@ -37,6 +37,24 @@
</view> </view>
</view> </view>
<view class="box"> <view class="box">
<view class="title">流量有效性<view class="title-tips">如客户为二网/无法接通/或无效客户标记为无效流量</view>
</view>
<picker class="picker-box" mode="selector" range="{{trafficEffectivenessList}}" range-key="name" bindchange="bindPickerChange" value="{{detail.trafficEffectiveness - 1}}" disabled="{{trafficEffectivenessDisabled}}">
<view class="picker">
<view class="picker-label">
流量有效性
</view>
<view class="picker-value">
<view class="text-hide" wx:if="{{detail.trafficEffectiveness}}">
{{detail.trafficEffectivenessName}}
</view>
<text class="placeholder" wx:else>点击选择</text>
<view class="arrow"></view>
</view>
</view>
</picker>
</view>
<view class="box">
<block wx:if="{{ !userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2&&isOrder }}"> <block wx:if="{{ !userInfo.isSuper && userInfo.merchantType && userInfo.userType == 2&&isOrder }}">
<!-- 已施工/已撤销/已支付 不显示 --> <!-- 已施工/已撤销/已支付 不显示 -->
<view wx:if="{{ detail.inviteStatus != 4&&detail.inviteStatus!=6&&detail.inviteStatus!=7 }}" class="icon date-icon" bindtap="showPopup" data-name="showDate"> <view wx:if="{{ detail.inviteStatus != 4&&detail.inviteStatus!=6&&detail.inviteStatus!=7 }}" class="icon date-icon" bindtap="showPopup" data-name="showDate">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!