Commit 78864b56 by 张立顺

Merge branch 'SAAS+V5.3.0-1117' of 192.168.3.233:saas_plus/sales-assistant into SAAS+V5.3.0-1117

2 parents e4db5539 811220f4
Showing 26 changed files with 179 additions and 72 deletions
......@@ -68,10 +68,10 @@ Component({
rightCurrent: false,
defaultIndex: 1,
opts: {
keys: ['stattime', 'output'],
color: '#69C9FF',
lineColr: '#6ED0BE',
tickCount: 8
keys: ['stattime', 'output', 'predictOutput'],
color: '#D1D7F5',
lineColr: '#347BFF',
tickCount: 10
},
},
......@@ -119,13 +119,16 @@ Component({
async getAnalysisData() {
try {
let params = this.getParams()
params.merchantid = 44215138
const [outputData, buyAndToStoreData, chartData, supervisionSale] = await Promise.all([
CustomerApi.queryMerchantOutputAndAtv(params),
CustomerApi.queryMerchantBuyAndTostore(params),
CustomerApi.queryMerchantOutputTrend(params),
CustomerApi.queryServiceSupervisionSale(params)
])
console.log(chartData)
chartData?.data?.list?.forEach((val, index) => {
val.predictOutput = chartData.data?.listpredict?.[index] ? chartData.data?.listpredict?.[index].output: ''
})
this.setData({
outputData: outputData?.data?.list || [],
buyAndToStoreData: buyAndToStoreData?.data?.list || [],
......
......@@ -92,7 +92,8 @@ Component({
})
},
onMoreTap(e) {
const index = e.currentTarget.dataset.index
let { index, type } = e.currentTarget.dataset
if (!type) return
const item = this.data.displayItems[index] || {}
this.setData({
showPopup: true,
......
......@@ -3,9 +3,9 @@
<block wx:for="{{displayItems}}" wx:key="index">
<view class="cell {{item.full ? 'cell-full' : (item.span === 2 ? 'cell-span2' : '')}}">
<view class="cell-label">{{item.label}}</view>
<view class="cell-value {{item.highlight ? 'highlight' : ''}}">
<view class="cell-value {{item.highlight ? 'highlight' : ''}}" bindtap="onMoreTap" data-type="{{item.isLong}}" data-index="{{index}}">
<text class="value-text">{{item.value || '-'}}</text>
<image wx:if="{{item.isLong}}" class="more-icon" src="{{IMG_URL}}/customer/more-icon.png" mode="aspectFit" data-index="{{index}}" bindtap="onMoreTap" />
<image wx:if="{{item.isLong}}" class="more-icon" src="{{IMG_URL}}/customer/more-icon.png" mode="aspectFit" />
</view>
</view>
</block>
......
......@@ -159,11 +159,11 @@ Component({
businessType: businessTypeObj[current]
}
CustomerApi.getKPIData(params).then(res => {
res?.map(m => {
const completed = this.formatCurrency(m.completed, )
const target = this.formatCurrency(m.target)
const completionRate = this.formatCurrency(m.completionRate, true)
return { ...m, completed, target, completionRate }
console.log(res)
res?.forEach(val => {
val.completed = this.formatCurrency(val.completed)
val.target = this.formatCurrency(val.target)
val.completionRate = this.formatCurrency(val.completionRate, true)
})
res?.sort((a, b) => {
return a.month - b.month
......
......@@ -68,6 +68,10 @@ Component({
val.cycleIndicator = this.formatPercent(val.cycleIndicator)
val.fallbackIndicator = this.formatPercent(val.fallbackIndicator)
})
res?.displaySituationWarningList?.forEach(val => {
val.cycleIndicator = this.formatPercent(val.cycleIndicator)
val.fallbackIndicator = this.formatPercent(val.fallbackIndicator)
})
// 初始化展开状态:仅在有数据时允许展开
const hasBusiness = (res.displaySituationWarningList || []).length > 0
const hasBottom = (res?.safetyIndexWarningList || []).length > 0
......
......@@ -79,7 +79,7 @@
opacity: 0;
.summary-card {
background: #fffcf7;
padding: 24rpx 32rpx;
padding: 24rpx 32rpx 1rpx;
.summary-title {
color: #292D33;
font-size: 28rpx;
......@@ -88,6 +88,7 @@
.summary-row {
color: #757B85;
font-size: 26rpx;
margin-bottom: 28rpx;
.red {
color: #F24724;
}
......
.bar-wrap {
padding: 34rpx 30rpx 30rpx 40rpx;
padding: 34rpx 10rpx 30rpx 40rpx;
box-sizing: border-box;
.searchList {
......
......@@ -18,7 +18,7 @@ Component({
},
color: {
type: String,
value: '#3975C6'
value: '#347BFF'
}
},
observers: {
......@@ -40,24 +40,24 @@ Component({
* 组件的方法列表
*/
methods: {
onInitChart(xData, yData) {
onInitChart(xData, yData, yData2) {
this.ecComponent && this.ecComponent.init((canvas, width, height, dpr) => {
const chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // new
});
this.setOption(chart, xData, yData);
this.setOption(chart, xData, yData, yData2);
return chart;
})
},
setOption(chart, xData, yData) {
setOption(chart, xData, yData, yData2) {
let maxSpan = xData.length < 10 ? 80 : 20
// let start= xData.length < 10 ? 50 : 80
var option = {
grid: {
left: 8,
right: 30,
right: 18,
top: 30,
bottom: 0,
containLabel: true
......@@ -66,32 +66,27 @@ Component({
trigger: 'axis',
triggerOn: "mousemove",
axisPointer: {
type: "shadow",
type: "line",
shadowStyle: {
shadowColor: 'rgba(53, 195, 118, .1)',
color: 'rgba(53, 195, 118, .1)',
shadowColor: '#E5EAFC',
color: '#E5EAFC',
},
lineStyle: {
color: '#35C376',
type: 'shadow'
color: '#2A2B32',
type: 'dashed'
}
},
position: 'top',
padding: [0, 12],
borderWidth: 2,
borderColor: '#6ED0BE',
borderRadius: 10,
borderRadius: 8,
backgroundColor: '#292D33',
textStyle: {
color: '#6ED0BE',
fontSize: 10
},
position: function (point, params, dom, rect, size) {
// 固定在顶部
return [point[0]-20, '10%'];
color: '#FFFFFF',
fontSize: 11
},
formatter: function (item) {
return `${item[0].value}`
}
return `${item[0].value}`
}
},
xAxis: {
type: 'category',
......@@ -100,11 +95,15 @@ Component({
// max: 5,
axisLabel: {
interval: 0,
fontSize: 11,
color: '#A6A6A6'
color: '#999EA8'
},
axisLine: {
show: false //坐标轴线线
show: true,
lineStyle: {
color: "rgba(153, 158, 168, 0.5)",
},
},
axisTick: {
show: false //坐标轴刻度
......@@ -114,51 +113,110 @@ Component({
yAxis: {
x: 'center',
type: 'value',
labelLine: {
show: true,
},
axisLabel: {
fontSize: 11,
color: '#A6A6A6'
fontSize: 11,
color: '#999EA8',
formatter(value) {
if (value >= 10000) {
return value / 10000 + "w";
} else {
return value;
}
},
},
axisLine: {
show: false //坐标轴线线
show: true,
lineStyle: {
color: "rgba(153, 158, 168, 0.5)",
},
},
axisTick: {
show: false //坐标轴刻度
},
splitLine: {
show: true,
lineStyle: {
type: 'dashed'
}
}
},
dataZoom: {
type: "inside",
maxSpan: maxSpan,
// end: 100,
// // start: start,
},
series: [{
series: [
{
showSymbol: false,
data: yData,
type: 'line',
// smooth: true,
color: this.data.color
}]
color: this.data.color,
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(147, 170, 253, 1)' // 顶部颜色
}, {
offset: 1,
color: 'rgba(229, 234, 252, 0.31)' // 底部颜色
}]
}
}
},
{
showSymbol: false,
data: yData2,
type: 'line',
lineStyle: {
type: 'dashed'
},
itemStyle: {
color: "rgba(52, 123, 255, 1)",
},
// smooth: true,
color: this.data.color,
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(147, 170, 253, 1)' // 顶部颜色
}, {
offset: 1,
color: 'rgba(229, 234, 252, 0.31)' // 底部颜色
}]
}
}
}
]
}
chart.setOption(option)
},
//初始化数据
initData(data) {
const xData = [],
yData = [];
const [x, y] = this.data.keys
yData = [],
yData2 = []
const [x, y, y2] = this.data.keys
data.forEach(item => {
xData.push(item[x])
yData.push(item[y])
yData2.push(item[y2])
})
this.setData({
xData,
yData
yData,
yData2
})
this.onInitChart(xData, yData)
this.onInitChart(xData, yData, yData2)
},
},
ready() {
......
......@@ -7,5 +7,14 @@ Component({
}
},
data: {},
methods: {}
methods: {
// 图片预览
previewImage(e) {
let { url, index } = e.currentTarget.dataset
wx.previewImage({
urls: url,
current: url[index]
})
}
}
})
\ No newline at end of file
......@@ -51,6 +51,7 @@
height: 72rpx;
border-radius: 8rpx;
background: #D5D8DB;
margin-right: 16rpx;
}
}
......
......@@ -46,10 +46,12 @@
<view class="section-title">附加信息</view>
<view class="card">
<view class="row image-row">
<view class="label">门店门头照片</view>
<view class="label">店面门头照片</view>
<view class="value">
<view class="photo-wrap" wx:if="{{detail.storePhoto}}">
<image class="photo" webp src="{{detail.storePhoto}}" />
<block wx:for="{{detail.storePhotoList}}" wx:key="index">
<image class="photo" data-url="{{detail.storePhotoList}}" bindtap="previewImage" webp data-index="{{index}}" src="{{item}}" />
</block>
</view>
<view wx:else>-</view>
</view>
......
......@@ -62,6 +62,7 @@
border-bottom: none;
}
.uploader-wrap {
margin-top: -16rpx;
padding: 0 0 32rpx 40rpx;
border-bottom: 1rpx solid #EFF0F280;
.image_content {
......
......@@ -43,6 +43,7 @@
</view>
</view>
</block>
<view class="section-title">附加信息</view>
<view class="row no-border">
<view class="label">店面门头照片</view>
</view>
......
......@@ -32,7 +32,6 @@ Page({
if (pageQuery.currentTab == 2) {
this.setData({tabIndex: 2})
}
this.setData({tabIndex: 2})
}
},
......@@ -89,7 +88,10 @@ Page({
},
getMerchantDetail(pageQuery) {
wx.$api.showLoading()
CustomerApi.getMaterialData({id: pageQuery.merchantId}).then(res => {
wx.$api.hideLoading()
this.setData({showPage: true})
// 处理数据回显
this.progressData(res)
})
......@@ -117,6 +119,8 @@ Page({
data.salePotentialCustomerPersonnelInfoDTOList?.forEach(val => {
val.roleName = ROLELIST?.find(v => v.value == val.personnelType)?.label
})
// 店面门头照片
data.storePhotoList = data.storePhoto?.split(',')
this.setData({
infoDetail: data
}, () => {
......
<!--packageCustomer/pages/merchantDetail/merchantDetail.wxml-->
<navigation-bar showBack="{{true}}" navStyle="{{navStyle}}" bindnavbarReady="navbarReady">门店详情</navigation-bar>
<scroll-view class="layout" scroll-y style="padding-top: {{navBarHeight}}px;" bindscroll="onScroll" scroll-top="{{setScrollTop}}">
<view class="container">
<view class="container" wx:if="{{showPage}}">
<view class="card header-card">
<view class="title-row">
<text class="status" style="color: {{statusText[infoDetail.storeType].color}};background: {{statusText[infoDetail.storeType].background}}">{{statusText[infoDetail.storeType].label}}</text>
......
......@@ -77,6 +77,14 @@ Page({
})
},
// 图片预览
previewImage(e) {
let { url } = e.currentTarget.dataset
wx.previewImage({
urls: [url]
})
},
progressData(data) {
// 主营品牌
data.mainCategory = data?.salePotentialCustomerBrandDTOList?.map(val => {return `${val.mainBrandName}${val.subBrandName}`})?.join('/')
......@@ -90,6 +98,8 @@ Page({
data.salePotentialCustomerPersonnelInfoDTOList?.forEach(val => {
val.roleName = ROLELIST?.find(v => v.value == val.personnelType)?.label
})
// 店面门头照片
data.storePhotoList = data.storePhoto?.split(',')
this.setData({
infoDetail: data
}, () => {
......@@ -148,7 +158,7 @@ Page({
this.setData({
tabIndex: index
})
this.resetAndLoad()
if (index == 0) this.resetAndLoad()
wx.nextTick(() => { this.measureLayout() })
},
......
......@@ -92,6 +92,7 @@
padding: 16rpx;
text-align: center;
font-size: 24rpx;
border-radius: 16rpx;
.title {
color: #757B85;
margin-bottom: 12rpx;
......@@ -120,6 +121,7 @@
padding: 32rpx;
margin-bottom: 24rpx;
.visit-title {
font-weight: 500;
color: #292D33;
font-size: 32rpx;
margin-bottom: 16rpx;
......
......@@ -14,7 +14,7 @@
<info-board items="{{infoBoardItems}}" threshold="{{24}}" clampLines="{{1}}" />
<view class="fail-row" wx:if="{{infoDetail.potentialCustomersStatus == 2}}">
<view class="title">战败原因</view>
<view class="content">{{infoDetail.reason}}</view>
<view class="content">{{infoDetail.failureReason}}</view>
</view>
</view>
<view class="tabbar-anchor" id="tabbarAnchor">
......@@ -29,12 +29,12 @@
<block wx:else>
<block wx:for="{{visitRecords}}" wx:key="index">
<view class="card visit-card">
<view class="visit-title">{{item.contactName}}</view>
<view class="visit-title">{{item.createdBy}}</view>
<block wx:for="{{cardItemObj}}" wx:for-item='i' wx:for-index='ind' wx:key='ind'>
<view class="item">
<view class="label">{{i.label}}</view>
<block wx:if="{{i.type == 'image'}}">
<image wx:if="{{item[i.key]}}" src="{{item[i.key]}}"></image>
<image wx:if="{{item[i.key]}}" data-url="{{item[i.key]}}" bindtap="previewImage" src="{{item[i.key]}}"></image>
<view wx:else class="value">-</view>
</block>
......@@ -60,7 +60,7 @@
</scroll-view>
<!-- 底部固定操作条:新增拜访 -->
<!-- potentialCustomersStatus 4是根据isBind绑定状态方便处理造出来的值 -->
<view class="bottom-bar" wx:if="{{tabIndex != 0 && userInfo.loginRole != 1 && infoDetail.potentialCustomersStatus != 3 && infoDetail.potentialCustomersStatus != 4}}">
<view class="bottom-bar" wx:if="{{tabIndex != 1 && userInfo.loginRole != 1 && infoDetail.potentialCustomersStatus != 3 && infoDetail.potentialCustomersStatus != 4}}">
<view class="inner safe-area-bottom">
<view class="btn" bind:tap="onCreateVisit">新增拜访</view>
</view>
......
......@@ -23,7 +23,7 @@
.box {
margin: 0 32rpx;
border-bottom: 1rpx solid #EFF0F2;
border-bottom: 1rpx solid #EFF0F280;
&:last-child{
border-bottom: none;
}
......@@ -65,6 +65,7 @@
padding: 16rpx;
font-size: 24rpx;
margin-bottom: 20rpx;
color: #292D33;
image {
width: 32rpx;
height: 32rpx;
......
......@@ -8,7 +8,7 @@
</view>
</view>
<view class="choose-btn" bindtap="chooseCarBrand">
<text>请选择</text>
<text>去选择</text>
<image src="{{IMG_URL}}customer/arrow.png" mode=""/>
</view>
<view class="list-box">
......
......@@ -73,13 +73,13 @@ Component({
mainBrandId: searchObj?.selectedMainBrand?.[0]?.id,
subBrandId: searchObj?.selectedMainBrand?.[0]?.children[0]?.id,
cooperationMode: searchObj?.cooperationModelList?.value,
businessTypeList: searchObj?.businessTypeList?.map(val => { if (val.value) return val.value })?.join(','),
businessTypeList: searchObj?.businessTypeList?.map(val => { if (val.value) return val.value }),
flowSituation: searchObj?.trafficStatusList?.value,
provinceId: searchObj?.provinces?.value,
salesPersonId: searchObj?.salesStaffList?.value,
potentialCustomersStatus: statusIndex == 0 ? undefined : statusMap[statusIndex], // 状态
isBind: statusIndex == 3 ? 1 : undefined, // 是否绑定
isSuperior: userInfo.loginRole != 3 ? 1 : 0,
isSuperior: userInfo.loginRole == 1 ? 1 : 0,
queryScoure: 3
}
return obj
......
......@@ -53,6 +53,7 @@
color: #757B85;
}
.value {
font-family: "numberBold";
margin-top: 8rpx;
font-size: 40rpx;
font-weight: 700;
......
......@@ -82,7 +82,8 @@
<view class="label">战败原因</view>
<view class="value">{{item.failureReason || '-'}} </view>
</view>
<view class="card-actions" wx:if="{{userInfo.loginRole != 1}}">
<!-- loginRole 1 总监 2 大区经理 3 销售 -->
<view class="card-actions" wx:if="{{(userInfo.loginRole == 2 && item.isSelf == 1) || userInfo.loginRole == 3}}">
<view wx:if="{{item.potentialCustomersStatus == 1 || item.potentialCustomersStatus == 3}}" class="btn {{item.potentialCustomersStatus == 1 ? 'ghost' : ''}}" catchtap="jump" data-item="{{item}}">信息完善</view>
<view wx:if="{{item.potentialCustomersStatus == 1}}" class="btn" catchtap="jump" data-item="{{item}}" data-name="resultFeedback">结果反馈</view>
</view>
......
import { IMG_URL } from '~/utils/constantData'
import CustomerApi from '~/api/customerApi/index'
import dayjs from 'dayjs'
// 预计算安全的月份时间戳,避免初始 0 值
const __NOW__ = new Date()
......@@ -59,12 +60,13 @@ Component({
mainBrandId: searchObj?.selectedMainBrand?.[0]?.id,
subBrandId: searchObj?.selectedMainBrand?.[0]?.children[0]?.id,
cooperationMode: searchObj?.cooperationModelList?.value,
businessTypeList: searchObj?.businessTypeList?.map(val => { if (val.value) return val.value })?.join(','),
businessTypeList: searchObj?.businessTypeList?.map(val => { if (val.value) return val.value }),
flowSituation: searchObj?.trafficStatusList?.value,
provinceId: searchObj?.provinces?.value,
salesPersonId: searchObj?.salesStaffList?.value,
storeType: statusIndex ? statusIndex : undefined,
isSuperior: userInfo.loginRole != 3 ? 1 : 0
isSuperior: userInfo.loginRole == 1 ? 1 : 0,
queryScoure: 3
}
return obj
},
......@@ -159,6 +161,7 @@ Component({
},
getMore() {
this.loadMore()
},
async loadMore(cb) {
......@@ -169,6 +172,8 @@ Component({
const res = await CustomerApi.getStorePageList({ currentPage, pageSize, ...params })
const nextList = (res.list || []).map(val => {
val.salesUser = val.salePersonnelInfoDTOList?.map(v => { return v.personnelName })?.join('/')
val.signedTime = val.signedTime ? dayjs(val.signedTime).format('YYYY-MM-DD HH:mm') : ''
val.expectedOperationDate = val.expectedOperationDate ? dayjs(val.expectedOperationDate).format('YYYY-MM-DD') : ''
return val
})
const total = res?.total || res?.count || 0
......
......@@ -64,6 +64,7 @@
color: #757B85;
}
.value {
font-family: "numberBold";
margin-top: 8rpx;
font-size: 40rpx;
font-weight: 700;
......
......@@ -31,7 +31,8 @@
<view class="bg_iamge">
<glsx-image src="{{'customer/top-bg.png'}}" class="image_class" />
</view>
<scroll-view class="layout" style="padding-top: calc({{navBarHeight}}px + 172rpx);" scroll-top="{{setScrollTop}}" lower-threshold="104" scroll-y bindscrolltolower="getMore" bindscroll="onPageScroll">
<!-- scroll-top="{{setScrollTop}}" -->
<scroll-view class="layout" style="padding-top: calc({{navBarHeight}}px + 172rpx);" scroll-into-view="{{statusIndex % 2 ? 'mask-view' : 'mask-view-2'}}" lower-threshold="104" scroll-y bindscrolltolower="getMore" bindscroll="onPageScroll">
<view class="container">
<block wx:if="{{myTabIdx==0}}">
<potential-section id="potentialSection"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!