Commit 12e2543b by 杨北旺

内容管理:解决冲突

2 parents 7c52b6fe 3c05ae04
...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd' ...@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 2 let index = 1
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync()
......
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
let params = data || {} let params = data || {}
return api.post('dj.api.smartcarlife.goodsInfo.getDetailById', params) return api.post('dj.api.smartcarlife.goodsInfo.getDetailById', params)
}, },
/**获取客户线索列表 */ /**获取客户线索列表 */
getCustomerClueList(params = {}) { getCustomerClueList(params = {}) {
params.pageSize = 10 params.pageSize = 10
...@@ -89,5 +89,22 @@ export default { ...@@ -89,5 +89,22 @@ export default {
getCustomerClueStatistics(data) { getCustomerClueStatistics(data) {
return api.post('dj.api.smartcarlife.customer.clue.statistics.status', data) return api.post('dj.api.smartcarlife.customer.clue.statistics.status', data)
}, },
/** 根据手机号查询工牌设备号 */
getInspectionBadgeCode(data) {
return api.post('dj.api.smartcarlife.app.inspection.findBadgeByPhone', data)
},
/** 质检管理信息 */
getEmployeeBadge(data = {}) {
return api.post('dj.api.mindworkplate.app.badge.employeeBadgeReclistWithPage', data)
},
/**分页查询接待批次列表 */
getInspectionList(data) {
return api.post('dj.api.smartcarlife.app.inspection.conversation.batch.page', data)
},
/**
* 质检详情-质检分析
*/
getInspectionDetail(data) {
return api.post('dj.api.smartcarlife.app.inspection.conversation.check.detail', data)
},
} }
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/aiInspection/aiInspection.js // packageEquity/pages/aiInspection/aiInspection.js
import carLifeApi from '../../carEquityApi'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {},
flag: true,
list: [new Array(10)]
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.$router.getData(({
params
}) => {
this.loadData(params)
})
if (options.badgeId) this.loadData(options)
},
loadData(params) {
this.setData({ this.setData({
num: 88 badgeId: params.badgeId
}) })
setTimeout(() => { this.searchDate = new Date().format('yyyy-MM-dd')
this.selectComponent('#arc').drawData() this.onLoadData()
setTimeout(() => { },
onLoadData() {
wx.$util.showLoading()
this.getInspectionList()
this.getEmployeeBadge()
},
changeDate({
detail
}) {
this.searchDate = detail
this.onLoadData()
},
async getEmployeeBadge() {
try {
const {
searchDate,
data: {
badgeId
}
} = this, {
code,
data,
message
} = await carLifeApi.getEmployeeBadge({
searchdate: searchDate,
badgeId
})
if (code == 0) {
console.log(data)
let [inspectionInfo] = data.list
inspectionInfo = inspectionInfo || {}
this.setData({ this.setData({
num: 10 inspectionInfo
}) })
this.selectComponent('#arc').drawData() const arcComponent = this.selectComponent('#arc')
setTimeout(() => { arcComponent.init()
this.setData({ if (inspectionInfo.score) arcComponent.drawData()
num: 50 } else throw message
}) } catch (error) {
this.selectComponent('#arc').drawData() wx.hideLoading()
setTimeout(() => { wx.$util.showToast(error)
this.setData({ }
num: 44
})
this.selectComponent('#arc').drawData()
}, 2e3)
}, 2e3)
}, 2e3)
}, 2e3)
}, },
changeDate(e) { async getInspectionList() {
console.log(e) try {
const {
searchDate
} = this, {
code,
data,
message
} = await carLifeApi.getInspectionList({
startTime: `${searchDate} 00:00:00`,
endTime: `${searchDate} 23:59:59`,
})
if (code == 0) {
wx.hideLoading()
const rex = /\b\d{2}:\d{2}:\d{2}\b/
data.list?.map(e => {
if (e.startTime && e.endTime) e.time = `${e.startTime.match(rex)[0]}-${e.endTime.match(rex)[0]}`
if (e.duration) e.duration = this.formatTime(e.duration)
if (!e.estimatedResult) {
e.estimatedResult = '未知'
e.estimatedStatus = -1
} else e.estimatedStatus == '战败' ? 0 : 1
})
this.setData({
list: data.list || [],
flag: true
})
} else throw message
} catch (error) {
wx.hideLoading()
this.setData({
flag: true
})
console.log(error)
wx.$util.showToast(error)
}
},
formatTime(seconds) {
seconds = seconds / 1000
let formattedTime = ''
if (seconds < 60) return seconds + 's'
else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + 'h'
if (minutes > 0 || hours > 0) formattedTime += minutes + 'min'
if (remainingSeconds > 0) formattedTime += remainingSeconds + 's'
return formattedTime
}
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
...@@ -4,26 +4,24 @@ ...@@ -4,26 +4,24 @@
<gl-image webp src="/equity/aiInspection-bg.png" /> <gl-image webp src="/equity/aiInspection-bg.png" />
</view> </view>
<view class="info"> <view class="info">
<view class="name">你好,<text>恒河猴</text></view> <view class="name">你好,<text>{{userInfo.name}}</text></view>
<view class="merchant">服务门店:<text>安徽合肥凯越4S店</text></view> <view class="merchant">服务门店:<text>{{userInfo.default4SStoreInfo.merchantName}}</text></view>
<view class="no">工牌编号:806599260358</view> <view class="no">工牌编号:{{badgeId}}</view>
</view> </view>
<view class="arc-box"> <view class="arc-box">
<view class="arc"> <view class="arc">
<circular num="{{num}}" id="arc"></circular> <circular num="{{inspectionInfo.score || 0}}" id="arc"></circular>
</view> </view>
<view class="arc-tips">今日综合质检评分</view> <view class="arc-tips">今日综合质检评分</view>
</view> </view>
</view> </view>
<date-box bindchange="changeDate"></date-box> <date-box bindchange="changeDate" ></date-box>
<data-box></data-box> <data-box data="{{inspectionInfo}}"></data-box>
<view class="content-box"> <view class="content-box">
<block wx:if="{{flag}}"> <block wx:if="{{flag}}">
<block wx:if="{{list.length}}"> <block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<block wx:for="{{item}}" wx:key="ind" wx:for-item="i" wx:for-index="ind"> <content-item item="{{item}}"></content-item>
<content-item item="{{i}}"></content-item>
</block>
</block> </block>
<block wx:if="{{nothing}}"> <block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view> <view class="list-nothing">到底了~</view>
......
...@@ -57,6 +57,8 @@ Component({ ...@@ -57,6 +57,8 @@ Component({
y: width / 2, y: width / 2,
innerRadius: this.toRpx(58), innerRadius: this.toRpx(58),
outerRadius: this.toRpx(34), outerRadius: this.toRpx(34),
lineWidth: this.toRpx(22),
arcRadius: this.toRpx(46)
} }
this.canvas = canvas this.canvas = canvas
this.drawBackground() this.drawBackground()
...@@ -89,11 +91,12 @@ Component({ ...@@ -89,11 +91,12 @@ Component({
ctx.save() ctx.save()
this.drawTips() this.drawTips()
}, },
drawData(){ drawData() {
const {num} = this.data const {
this.drawBackground() num
} = this.data
this.part = Math.ceil(num / 20) this.part = Math.ceil(num / 20)
this.fillArc(Start_Angle, 0, Start_Angle + Angle) if (num) this.fillArc(Start_Angle, 0, Start_Angle + Angle)
}, },
drawTips(data) { drawTips(data) {
let { let {
...@@ -101,8 +104,8 @@ Component({ ...@@ -101,8 +104,8 @@ Component({
y, y,
} = this.arcInfo } = this.arcInfo
x = x / 2 x = x / 2
// if (data) this.ctx.clearRect(x + 10, y / 2 + 20, this.toRpx(52), this.toRpx(30))
this.ctx.clearRect(x + 15, y / 2 + 15, this.toRpx(45), this.toRpx(60)) this.ctx.clearRect(x + 10, y / 2 + 60, this.toRpx(50), this.toRpx(30))
this.drawText({ this.drawText({
text: data || '···', text: data || '···',
x, x,
...@@ -124,7 +127,7 @@ Component({ ...@@ -124,7 +127,7 @@ Component({
textBaseline: 'middle' textBaseline: 'middle'
}) })
}, },
fillArc(startAngle, index, endAngle) { fillArc(startAngle, index, endAngle) {
const { const {
ctx, ctx,
...@@ -132,8 +135,8 @@ Component({ ...@@ -132,8 +135,8 @@ Component({
arcInfo: { arcInfo: {
x, x,
y, y,
innerRadius, lineWidth,
outerRadius arcRadius
}, },
data: { data: {
num num
...@@ -142,10 +145,10 @@ Component({ ...@@ -142,10 +145,10 @@ Component({
a = startAngle a = startAngle
let b = startAngle + Math.PI / 70 let b = startAngle + Math.PI / 70
ctx.beginPath() ctx.beginPath()
ctx.fillStyle = Arc_Data_Background[index] ctx.strokeStyle = Arc_Data_Background[index]
ctx.arc(x, y, innerRadius, a, b) ctx.lineWidth = lineWidth
ctx.arc(x, y, outerRadius, b, a, true) ctx.arc(x, y, arcRadius, a, b)
ctx.fill() ctx.stroke()
ctx.save() ctx.save()
this.drawImg() this.drawImg()
setTimeout(() => { setTimeout(() => {
...@@ -173,23 +176,22 @@ Component({ ...@@ -173,23 +176,22 @@ Component({
arcInfo: { arcInfo: {
x, x,
y, y,
innerRadius, lineWidth,
outerRadius arcRadius
} }
} = this } = this
let startAngle = Start_Angle let startAngle = Start_Angle
for (let i = 0; i < part; i++) { for (let i = 0; i < part; i++) {
ctx.beginPath() ctx.beginPath()
ctx.strokeStyle = Arc_Data_Background[i]
ctx.lineWidth = lineWidth
if (i == part - 1) { if (i == part - 1) {
ctx.arc(x, y, innerRadius, startAngle, remainder) ctx.arc(x, y, arcRadius, startAngle, remainder)
ctx.arc(x, y, outerRadius, remainder, startAngle, true)
} else { } else {
ctx.arc(x, y, innerRadius, startAngle, startAngle + Angle) ctx.arc(x, y, arcRadius, startAngle, startAngle + Angle)
ctx.arc(x, y, outerRadius, startAngle + Angle, startAngle, true)
} }
ctx.fillStyle = Arc_Data_Background[i] // ctx.fillStyle = Arc_Data_Background[i]
ctx.stroke() ctx.stroke()
ctx.fill()
startAngle += Angle startAngle += Angle
} }
ctx.save() ctx.save()
......
...@@ -14,15 +14,15 @@ Component({ ...@@ -14,15 +14,15 @@ Component({
data: { data: {
contentObject: [{ contentObject: [{
label: '接待时间', label: '接待时间',
key: '' key: 'time'
}, },
{ {
label: '录音时长', label: '录音时长',
key: '' key: 'duration'
}, },
{ {
label: '预计营销结果', label: '预计营销结果',
key: '', key: 'estimatedResult',
colorEnum: { colorEnum: {
0: '#F24724', 0: '#F24724',
1: '#35C376' 1: '#35C376'
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<view class="title"> <view class="title">
<view class="sub"> <view class="sub">
接待批次 接待批次
<view class="num">1</view> <view class="num">{{item.num}}</view>
</view> </view>
<view class="sub"> <view class="sub">
得分 得分
<view class="num">1</view> <view class="num">{{item.score || 0}}</view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<block wx:for="{{contentObject}}" wx:for-item="i" wx:for-index="ind"> <block wx:for="{{contentObject}}" wx:for-item="i" wx:for-index="ind">
<view class="sub-item"> <view class="sub-item">
<view class="label">{{i.label}}</view> <view class="label">{{i.label}}</view>
<view class="value" style="color:{{colorEnum?colorEnum[item.status]:''}};">{{item[i.key]||'恒河猴'}}</view> <view class="value" style="color:{{colorEnum?colorEnum[item.status]:''}};">{{item[i.key]||'-'}}</view>
</view> </view>
</block> </block>
<view class="btn" bindtap="jumpDetail">质检详情</view> <view class="btn" bindtap="jumpDetail">质检详情</view>
......
...@@ -5,7 +5,7 @@ Component({ ...@@ -5,7 +5,7 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
data: Object
}, },
/** /**
...@@ -15,17 +15,17 @@ Component({ ...@@ -15,17 +15,17 @@ Component({
dataObject: [{ dataObject: [{
title: '预计接待批次', title: '预计接待批次',
tips: 'AI根据当日提交的营销录音做出的预估接待批次数', tips: 'AI根据当日提交的营销录音做出的预估接待批次数',
key: '' key: 'batchNum'
}, },
{ {
title: '当日到店量', title: '当日到店量',
tips: '驻店员工在当日驻店日报中填写的到店流量(会员权益/延保),即本人在当天接待的权益延保业务客户数', tips: '驻店员工在当日驻店日报中填写的到店流量(会员权益/延保),即本人在当天接待的权益延保业务客户数',
key: '' key: 'toStoreCount'
}, },
{ {
title: '异常占比', title: '异常占比',
tips: '异常占比=【预计接待批次 - 当日到店量(会员权益/延保)】/ 预计接待批次数', tips: '异常占比=【预计接待批次 - 当日到店量(会员权益/延保)】/ 预计接待批次数',
key: '', key: 'abnormalProportion',
unit: '%' unit: '%'
} }
] ]
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</block> </block>
</view> </view>
<view class="data-value"> <view class="data-value">
12 {{data[item.key] || '-'}}
<block wx:if="{{item.unit}}"> <block wx:if="{{item.unit}}">
<view class="unit">{{item.unit}}</view> <view class="unit">{{item.unit}}</view>
</block> </block>
......
// packageEquity/pages/aiInspectionDetail/aiInspectionDetail.js // packageEquity/pages/aiInspectionDetail/aiInspectionDetail.js
import carLifeApi from '../../carEquityApi'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
overviewList:[ overviewList: [{
{ title: '话术评分',
title:'话术评分', key: 'score'
key:''
}, },
{ {
title:'预计营销结果', title: '预计营销结果',
key:'', key: 'estimatedResult',
fontSize: 'var(--fontSize28)' fontSize: 'var(--fontSize28)'
}, },
{ {
title:'开始录音时间', title: '开始录音时间',
key:'' key: 'startTime'
}, },
{ {
title:'对话时长', title: '对话时长',
key:'' key: 'duration'
} }
], ]
list:new Array(10)
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.$router.getData(res => {
if (!res.estimatedResult) res.estimatedResult = '未知'
if (res.startTime) res.startTime = res.startTime.match(/\b\d{2}:\d{2}:\d{2}\b/)[0]
if (res.duration) res.duration = this.formatTime(res.duration)
this.setData({
detailInfo: res
})
this.getInspectionDetail(res.id)
})
this.getInspectionDetail(19)
},
async getInspectionDetail(batchId) {
try {
wx.$util.showLoading()
const {
code,
data: {
list
},
message
} = await carLifeApi.getInspectionDetail({
batchId
})
if (code == 0 && list) {
let titleList = Array.from(new Set([...list.map(e => e.firstClassify)]))
const classifyList = titleList.map(i => {
let arr = [],
rawScore = 0,
score = 0
list.map(e => {
if (i == e.firstClassify) {
arr.push(e)
rawScore += e.rawScore
score += e.score
}
})
return {
list: arr,
title: i,
rawScore,
score,
}
})
console.log(classifyList)
this.setData({
list: classifyList
})
wx.hideLoading()
} else throw message
} catch (error) {
wx.hideLoading()
wx.$util.showToast(error)
}
},
formatTime(seconds) {
seconds = seconds / 1000
let formattedTime = ''
if (seconds < 60) return seconds + '秒'
else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒'
return formattedTime
}
},
jump(e) {
const {
item
} = e.currentTarget.dataset
wx.$router.go('aiInspectionReception', item)
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
......
...@@ -33,7 +33,23 @@ page { ...@@ -33,7 +33,23 @@ page {
height: 100%; height: 100%;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
position: relative;
&::after {
content: '';
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: var(--fontSize1);
height: var(--fontSize56);
background-color: #E4E8EE;
}
&:last-of-type{
&::after{
display: none;
}
}
.title { .title {
font-weight: 500; font-weight: 500;
font-size: var(--fontSize22); font-size: var(--fontSize22);
...@@ -85,6 +101,7 @@ page { ...@@ -85,6 +101,7 @@ page {
color: #347BFF; color: #347BFF;
line-height: var(--fontSize44); line-height: var(--fontSize44);
} }
} }
} }
} }
...@@ -110,4 +127,8 @@ page { ...@@ -110,4 +127,8 @@ page {
} }
} }
} }
}
.red{
color: #F24724 !important;
} }
\ No newline at end of file \ No newline at end of file
...@@ -5,26 +5,30 @@ ...@@ -5,26 +5,30 @@
<block wx:for="{{overviewList}}" wx:key="index"> <block wx:for="{{overviewList}}" wx:key="index">
<view class="overview-item flex"> <view class="overview-item flex">
<view class="title">{{item.title}}</view> <view class="title">{{item.title}}</view>
<view class="value">50</view> <view class="value">{{detailInfo[item.key] || '-'}}</view>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
<view class="content-box"> <view class="content-box">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<view class="item"> <view class="item" bindtap="jump" data-item="{{item}}">
<view class="title flex"> <view class="title flex">
接待环节 {{item.title}}
<view class="score flex"> <view class="score flex">
得分: 得分:
<view class="num flex"><view class="highlight">15</view>/20</view> <view class="num flex">
<view class="highlight {{item.score == 0 ?'red':''}}">{{item.score}}</view>/{{item.rawScore}}
</view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view class="sub-item flex"> <block wx:for="{{item.list}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="label">介绍延保</view> <view class="sub-item flex">
<view class="value">5/5</view> <view class="label">{{i.secondClassify}}</view>
</view> <view class="value">{{i.score}}/{{i.rawScore}}</view>
</view>
</block>
</view> </view>
</view> </view>
</block> </block>
......
...@@ -5,16 +5,26 @@ Page({ ...@@ -5,16 +5,26 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
list:new Array(10) hitEnum: {
1: '命中',
0: '未命中'
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
wx.setNavigationBarTitle({ wx.$router.getData(res => {
title: '接待环节', console.log(res)
wx.setNavigationBarTitle({
title: res.title
})
this.setData({
detailInfo: res
})
}) })
}, },
/** /**
......
...@@ -94,4 +94,8 @@ page { ...@@ -94,4 +94,8 @@ page {
} }
} }
} }
}
.red{
color: #F24724 !important;
} }
\ No newline at end of file \ No newline at end of file
<view class="layout isFullSucreen"> <view class="layout isFullSucreen">
<view class="title flex"> <view class="title flex">
接待环节 {{detailInfo.title}}
<view class="score flex"> <view class="score flex">
得分: 得分:
<view class="num flex"> <view class="num flex">
<view class="highlight">15</view>/20 <view class="highlight {{detailInfo.score == 0 ?'red':''}}">{{detailInfo.score}}</view>/{{detailInfo.rawScore}}
</view> </view>
</view> </view>
</view> </view>
<view class="content-box"> <view class="content-box">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{detailInfo.list}}" wx:key="index">
<view class="item"> <view class="item">
<view class="title flex"> <view class="title flex">
接待环节 {{item.secondClassify}}
<view class="score flex"> <view class="score flex">
得分: 得分:
<view class="num flex"> <view class="num flex">
<view class="highlight">15</view>/20 <view class="highlight {{item.score == 0 ?'red':''}}">{{item.score}}</view>/{{item.rawScore}}
</view> </view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view class="sub-item flex"> <view class="sub-item flex">
<view class="label">是否命中</view> <view class="label">是否命中</view>
<view class="value">命中</view> <view class="value">{{hitEnum[item.hitResult]}}</view>
</view> </view>
<view class="sub-item flex"> <view class="sub-item flex">
<view class="label">命中文本</view> <view class="label">命中文本</view>
<view class="value">您好,XX先生/小姐/女士。</view> <view class="value">{{item.hitText || '-'}}</view>
</view> </view>
<view class="example"> <view class="example">
<view class="label">话术建议</view> <view class="label">话术建议</view>
<view class="value">稍后将向您介绍车辆使用注意事项以及保养车辆质保相关事项。</view> <view class="value">{{item.suggestions||'-'}}</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -2,10 +2,20 @@ ...@@ -2,10 +2,20 @@
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
// import api from '~/packageCrowdFunding/api' // import api from '~/packageCrowdFunding/api'
import NP from 'number-precision' import NP from 'number-precision'
import { getBusinessSchoolScene } from '~/store/index' import {
import { getQuotationStatistics, outputValueStatistics, quotationPage, updateOrderStatus, merchantMode } from '../../api' getBusinessSchoolScene
} from '~/store/index'
import {
getQuotationStatistics,
outputValueStatistics,
quotationPage,
updateOrderStatus,
merchantMode
} from '../../api'
import commonApi from '~/api/api' import commonApi from '~/api/api'
const app = getApp() const app = getApp()
import carLifeApi from '../../carEquityApi'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -26,8 +36,7 @@ Component({ ...@@ -26,8 +36,7 @@ Component({
IMG_URL, IMG_URL,
statisticsObj: {}, statisticsObj: {},
dataActive: 'total', dataActive: 'total',
staticDataList: [ staticDataList: [{
{
label: '今日营业额', label: '今日营业额',
value: 'todayTurnover', value: 'todayTurnover',
tipsLabel: '今日成交量', tipsLabel: '今日成交量',
...@@ -46,8 +55,7 @@ Component({ ...@@ -46,8 +55,7 @@ Component({
tipsValue: 'totalOrderNumber' tipsValue: 'totalOrderNumber'
} }
], ],
itemDataList: [ itemDataList: [{
{
label: '营业额', label: '营业额',
value: 'totalOutputValue', value: 'totalOutputValue',
icon: 'icon_15', icon: 'icon_15',
...@@ -86,8 +94,7 @@ Component({ ...@@ -86,8 +94,7 @@ Component({
icon: 'icon_7' icon: 'icon_7'
} }
], ],
menuList: [ menuList: [{
{
menuText: '驻店日报', menuText: '驻店日报',
path: 'tabWorkOrder.staffDaily', path: 'tabWorkOrder.staffDaily',
recordId: 13, recordId: 13,
...@@ -134,7 +141,9 @@ Component({ ...@@ -134,7 +141,9 @@ Component({
userInfo userInfo
}) })
// let issta // let issta
let { menuList } = this.data let {
menuList
} = this.data
getBusinessSchoolScene({}).then(res => { getBusinessSchoolScene({}).then(res => {
console.log(res, 'res') console.log(res, 'res')
if ((res || userInfo?.isSuper) && menuList.every(item => item.menuText != '工资绩效')) { if ((res || userInfo?.isSuper) && menuList.every(item => item.menuText != '工资绩效')) {
...@@ -152,17 +161,25 @@ Component({ ...@@ -152,17 +161,25 @@ Component({
this.getData() this.getData()
this.getTotal(this.data.dataActive) this.getTotal(this.data.dataActive)
this.getYqStoreConfig() this.getYqStoreConfig()
// 根据手机号查询工牌设备号
this.getInspectionBadgeCode()
// 获取驻店员工目标 // 获取驻店员工目标
if (isStaff) this.getStaffTargetTask() if (isStaff) this.getStaffTargetTask()
}, },
getStaffTargetTask() { getStaffTargetTask() {
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo()
let { menuList } = this.data let {
menuList
} = this.data
commonApi.getStaffTargetTaskApi({ commonApi.getStaffTargetTaskApi({
sceneType: 0, sceneType: 0,
merchantId: userInfo?.default4SStoreInfo?.merchantId merchantId: userInfo?.default4SStoreInfo?.merchantId
}).then(res => { }).then(res => {
let { code, data, message } = res let {
code,
data,
message
} = res
if (code == 0) { if (code == 0) {
// 切换门店 需删除入口 重新请求判断显示入口 // 切换门店 需删除入口 重新请求判断显示入口
let index = menuList.findIndex(v => v.menuText == '驻店目标') let index = menuList.findIndex(v => v.menuText == '驻店目标')
...@@ -186,8 +203,9 @@ Component({ ...@@ -186,8 +203,9 @@ Component({
taskInfo: data[0] taskInfo: data[0]
}) })
// 将当前周期的员工目标任务弹窗标记为已弹起 // 将当前周期的员工目标任务弹窗标记为已弹起
commonApi.setTaskDialog({id: data[0]?.id}).then(() => { commonApi.setTaskDialog({
}) id: data[0]?.id
}).then(() => {})
} }
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
...@@ -195,25 +213,30 @@ Component({ ...@@ -195,25 +213,30 @@ Component({
}) })
}, },
getTotal() { getTotal() {
let { storeInfo } = this.data let {
storeInfo
} = this.data
getQuotationStatistics({ getQuotationStatistics({
merchantId: storeInfo?.merchantId merchantId: storeInfo?.merchantId
}).then(res => { }).then(res => {
// console.log(res, '统计---') // console.log(res, '统计---')
let { code, message } = res let {
let data = res.data code,
? { message
...res.data, } = res
todayTurnover: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[0] : '0', let data = res.data ?
todayTurDecimal: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[1] : '00', {
// totalTurnover: res.data.totalTurnover ? (Math.round()(res.data.totalTurnover / 100).toFixed(2) + '').split('.')[0] : '0', ...res.data,
totalTurnover: res.data.totalTurnover ? Math.round(res.data.totalTurnover / 100) : '0', todayTurnover: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[0] : '0',
totalTurDecimal: res.data.totalTurnover ? ((res.data.totalTurnover / 100).toFixed(2) + '').split('.')[1] : '00', todayTurDecimal: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[1] : '00',
monthTurnover: res.data.monthTurnover ? ((res.data.monthTurnover / 100).toFixed(2) + '').split('.')[0] : '0' // totalTurnover: res.data.totalTurnover ? (Math.round()(res.data.totalTurnover / 100).toFixed(2) + '').split('.')[0] : '0',
// monthTurnover: 12233, totalTurnover: res.data.totalTurnover ? Math.round(res.data.totalTurnover / 100) : '0',
// monthTurDecimal: res.data.monthTurnover ? ((res.data.monthTurnover / 100).toFixed(2) + '').split('.')[1] : '00' totalTurDecimal: res.data.totalTurnover ? ((res.data.totalTurnover / 100).toFixed(2) + '').split('.')[1] : '00',
} monthTurnover: res.data.monthTurnover ? ((res.data.monthTurnover / 100).toFixed(2) + '').split('.')[0] : '0'
: {} // monthTurnover: 12233,
// monthTurDecimal: res.data.monthTurnover ? ((res.data.monthTurnover / 100).toFixed(2) + '').split('.')[1] : '00'
} :
{}
if (code == '0') { if (code == '0') {
this.setData({ this.setData({
statisticsObj: data statisticsObj: data
...@@ -227,7 +250,10 @@ Component({ ...@@ -227,7 +250,10 @@ Component({
getData() { getData() {
// const userInfo = wx.$util.getUserInfo() // const userInfo = wx.$util.getUserInfo()
const { dataActive, merchantId } = this.data const {
dataActive,
merchantId
} = this.data
let today = new Date() let today = new Date()
let thisMonth = new Date(new Date().setDate(1)).format('yyyy-MM-dd') let thisMonth = new Date(new Date().setDate(1)).format('yyyy-MM-dd')
const dataobj = { const dataobj = {
...@@ -247,7 +273,11 @@ Component({ ...@@ -247,7 +273,11 @@ Component({
outputValueStatistics({ outputValueStatistics({
...dataobj[dataActive] ...dataobj[dataActive]
}).then(res => { }).then(res => {
let { code, data, message } = res let {
code,
data,
message
} = res
if (code == 0) { if (code == 0) {
data.conversionRate = NP.times(data.conversionRate, 100) data.conversionRate = NP.times(data.conversionRate, 100)
data.avgPrice = NP.divide(data.avgPrice, 100) data.avgPrice = NP.divide(data.avgPrice, 100)
...@@ -262,7 +292,9 @@ Component({ ...@@ -262,7 +292,9 @@ Component({
}) })
}, },
changeDataSelect(e) { changeDataSelect(e) {
let { name } = e.currentTarget.dataset let {
name
} = e.currentTarget.dataset
this.setData({ this.setData({
dataActive: name dataActive: name
}) })
...@@ -286,13 +318,23 @@ Component({ ...@@ -286,13 +318,23 @@ Component({
// } // }
// }, // },
navGo(e) { navGo(e) {
let { mode, taskId } = this.data let {
let { item } = e.currentTarget.dataset mode,
taskId
} = this.data
let {
item
} = e.currentTarget.dataset
if (item.path) { if (item.path) {
if (item.menuText == '驻店目标') { if (item.menuText == '驻店目标') {
return wx.$router.go(item.path, { id: taskId }) return wx.$router.go(item.path, {
id: taskId
})
} else { } else {
return wx.$router.go(item.path, { scene: 1 }) return wx.$router.go(item.path, {
scene: 1,
params:item.params || {}
})
} }
} else { } else {
// 工资绩效特殊处理 // 工资绩效特殊处理
...@@ -313,11 +355,15 @@ Component({ ...@@ -313,11 +355,15 @@ Component({
}, },
/**获取园区配置 */ /**获取园区配置 */
async getYqStoreConfig() { async getYqStoreConfig() {
const { merchantId: yqMerchantId } = wx.$util.getUserInfo(), const {
{ menuList } = this.data, merchantId: yqMerchantId
{ data } = await commonApi.getYqStoreConfig({ } = wx.$util.getUserInfo(), {
yqMerchantId menuList
}) } = this.data, {
data
} = await commonApi.getYqStoreConfig({
yqMerchantId
})
//是否配置园区店面档案互通 Y / N //是否配置园区店面档案互通 Y / N
if (data) { if (data) {
const culeIndex = menuList.findIndex(e => e.menuText == '客户线索') const culeIndex = menuList.findIndex(e => e.menuText == '客户线索')
...@@ -329,35 +375,61 @@ Component({ ...@@ -329,35 +375,61 @@ Component({
path: 'packageEquity.clueList', path: 'packageEquity.clueList',
default: true default: true
}) })
// menuList.push({
// menuText: '话术质检',
// icon: 'ai_inspection',
// path: 'packageEquity.aiInspection',
// default: true
// })
this.getCustomerClueRemind() this.getCustomerClueRemind()
} }
if (data.customerExchangeFlag == 'N' && culeIndex != -1) menuList.splice(culeIndex, 1) if (data.customerExchangeFlag == 'N' && culeIndex != -1) menuList.splice(culeIndex, 1)
} }
this.setData({ this.setData({
menuList menuList
}) })
}, },
/**客户线索新增客户提醒 */ /**客户线索新增客户提醒 */
async getCustomerClueRemind() { async getCustomerClueRemind() {
const { sceneType, shopMerchantId: merchantId } = wx.$util.getUserInfo(), const {
{ menuList } = this.data, sceneType,
{ data, code } = await commonApi.getCustomerClueRemind({ shopMerchantId: merchantId
sceneType, } = wx.$util.getUserInfo(), {
merchantId: [merchantId] menuList
}) } = this.data, {
data,
code
} = await commonApi.getCustomerClueRemind({
sceneType,
merchantId: [merchantId]
})
if (code == 0) { if (code == 0) {
const index = menuList.findIndex(e => e.menuText == '客户线索') const index = menuList.findIndex(e => e.menuText == '客户线索')
this.setData({ this.setData({
[`menuList[${index}].tipsNum`]: data [`menuList[${index}].tipsNum`]: data
}) })
} }
},
/**根据手机号查询工牌设备号 */
async getInspectionBadgeCode() {
const {
phone
} = wx.$util.getUserInfo(), {
menuList
} = this.data, {
data
} = await carLifeApi.getInspectionBadgeCode({
phone
}),
index = menuList.findIndex(e => e.menuText == '话术质检')
if (data && index == -1) menuList.push({
menuText: '话术质检',
icon: 'ai_inspection',
path: 'packageEquity.aiInspection',
default: true,
params: {
badgeId: data
}
})
if (!data && index != -1) menuList.splice(culeIndex, 1)
this.setData({
menuList
})
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "培训资料", "name": "19",
"pathName": "packageEquity/pages/trainingMaterials/trainingMaterials", "pathName": "packageEquity/pages/aiInspectionDetail/aiInspectionDetail",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "packageEquity/pages/cleD", "name": "质检",
"pathName": "packageEquity/pages/clueDetail/clueDetail", "pathName": "packageEquity/pages/aiInspection/aiInspection",
"query": "id=27", "query": "badgeId=806599C630911",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!