Commit de1eb6ba by 张立顺

feat 接口联调

1 parent d1f8b4f9
......@@ -58,9 +58,17 @@ Component({
key: 'penetrationRate',
width: 'var(--fontSize120)',
unit: '%'
},
{
name: '完成率',
key: 'completionRate',
width: 'var(--fontSize120)',
unit: '%'
}
// { name: '完成率', key: 'followUpCount', width: 'var(--fontSize120)' }
],
selectedMainBrand: [],
selectedMainBrandOverview: [],
selectedMainBrandList: [],
tableObjStoreExpansion: [
{
name: '已完成',
......@@ -118,8 +126,13 @@ Component({
key: 'penetrationRate',
width: 'var(--fontSize120)',
unit: '%'
},
{
name: '完成率',
key: 'completionRate',
width: 'var(--fontSize120)',
unit: '%'
}
// { name: '完成率', key: 'followUpCount', width: 'var(--fontSize120)' }
],
headerConfigStoreExpansion: {
name: '销售名称',
......@@ -205,7 +218,8 @@ Component({
cooperationModelabel: '全部',
cooperationMode: '',
regionCooperationModelabel: '全部',
regionCooperationMode: ''
regionCooperationMode: '',
carBrandPopupShow: false
},
lifetimes: {
attached() {
......@@ -226,6 +240,58 @@ Component({
this.getRankingSelectIndex()
this.regionOverviewShow()
},
hideBrandPopupFormSelf() {
let { carSelectModules } = this.data
// 清空对应的品牌列表
this.setData({
[carSelectModules]: []
})
this.hideBrandPopup()
// 判断是哪个模块的对应调用接口
if (carSelectModules == 'selectedMainBrand') {
this.outputCount()
this.getRankingSelectIndex()
} else {
this.regionOverviewShow()
}
},
hideBrandPopup() {
this.setData({
carBrandPopupShow: !this.data.carBrandPopupShow
})
},
// 选择主营品牌
chooseCarBrand(e) {
console.log(e)
let { carname } = e.currentTarget.dataset
console.log(carname)
this.setData({
carBrandPopupShow: true,
carSelectModules: carname,
selectedMainBrandList: this.data[carname] || []
})
},
brandConfirm() {
let { carSelectModules } = this.data
let brandMoudle = this.selectComponent('#car-brand')
this.setData({
[carSelectModules]: (brandMoudle && brandMoudle.handleConfirm()) || []
})
// console.log(
// (brandMoudle && brandMoudle.handleConfirm()) || [],
// '(brandMoudle && brandMoudle.handleConfirm()) || []'
// )
this.hideBrandPopup()
// 判断是哪个模块的对应调用接口
if (carSelectModules == 'selectedMainBrand') {
this.outputCount()
this.getRankingSelectIndex()
} else {
this.regionOverviewShow()
}
},
// 总览合作模式
changeCooperationModeByList() {
let { cooperationModeByList, cooperationMode } = this.data
......@@ -355,7 +421,8 @@ Component({
overviewSwitchValue,
tabIndx,
rankingSelectIndex,
cooperationMode
cooperationMode,
selectedMainBrand
} = this.data
// tabIndx
// 1-【1.1 精品升级】、2-【2.1权益升级】、4-【2.3延保升级】
......@@ -370,7 +437,9 @@ Component({
IndexApi[apiName]({
businessType: scene[tabIndx],
isAll: overviewSwitchValue,
cooperationMode: cooperationMode
cooperationMode: cooperationMode,
mainBrandId: selectedMainBrand?.[0]?.id,
subBrandId: selectedMainBrand?.[0]?.children?.[0]?.id
}).then(res => {
// dataOverview
console.log(res, 'outputRanking')
......@@ -396,7 +465,8 @@ Component({
rankingSelectIndex,
rankingSelectIndexOverview,
sortDimension,
cooperationMode
cooperationMode,
selectedMainBrand
} = this.data
let tableApiName =
overviewTabIndex == 1
......@@ -411,6 +481,8 @@ Component({
cooperationMode: cooperationMode,
// sortType: rankingSelectIndex,
...params,
mainBrandId: selectedMainBrand?.[0]?.id,
subBrandId: selectedMainBrand?.[0]?.children?.[0]?.id,
sortDimension,
dataOverviewSortDimension: sortDimension
}).then(res => {
......@@ -419,7 +491,7 @@ Component({
this.setData({
dataOverviewTable: res.data,
itemTableHeightOverview: res.data.length * 72,
tableWidthOverview: overviewTabIndex == 1 ? '900' : '640'
tableWidthOverview: overviewTabIndex == 1 ? '1020' : '640'
})
})
},
......@@ -433,7 +505,8 @@ Component({
overviewTabIndexRegion,
tabIndx,
sortDimensionOverview,
regionCooperationMode
regionCooperationMode,
selectedMainBrandOverview
} = this.data
let scene = {
0: 1,
......@@ -449,12 +522,14 @@ Component({
sortDimension: sortDimensionOverview,
sortType: 1,
saleRegionSortDimension: sortDimensionOverview,
cooperationMode: regionCooperationMode
cooperationMode: regionCooperationMode,
mainBrandId: selectedMainBrandOverview?.[0]?.id,
subBrandId: selectedMainBrandOverview?.[0]?.children?.[0]?.id
}).then(res => {
this.setData({
tableData: res.data,
itemTableHeight: res.data.length * 72,
tableWidth: overviewTabIndexRegion == 1 ? '900' : '640'
tableWidth: overviewTabIndexRegion == 1 ? '1020' : '640'
})
console.log('tableWidth', overviewTabIndexRegion == 1 ? '1025' : '400')
})
......
......@@ -5,6 +5,7 @@
"switch-block": "/components/switchBlock/switchBlock",
"store-waring": "/pages/components/storeWarning/storeWarning",
"tableScrollX": "/pages/components/tableScrollX/table",
"select-popup": "/components/SelectPopup/SelectPopup"
"select-popup": "/components/SelectPopup/SelectPopup",
"car-brand": "/components/CarBrand/CarBrand"
}
}
......@@ -32,8 +32,13 @@
}
.bold {
// margin-top: 8rpx;
max-width: 240rpx;
display: inline-block;
line-height: 28rpx;
color: #292d33;
margin-right: 4rpx;
}
.mode {
......@@ -595,4 +600,15 @@
width: 24rpx;
height: 24rpx;
}
}
.text {
display: flex;
align-items: center;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
\ No newline at end of file
......@@ -23,10 +23,11 @@
</view>
<block wx:if="{{ overviewTabIndex == 1 }}">
<view class="selectList">
<view class="carband box">
<view class="carband box" bindtap="chooseCarBrand" data-carname="selectedMainBrand">
<view class="text">
主营品牌 /
<text class="bold">鸿蒙智行问界</text>
<text>主营品牌 /</text>
<text class="bold text-hide" wx:if="{{ selectedMainBrand.length > 0 }}">{{selectedMainBrand[0].children[0].name}}</text>
<text class="bold text-hide" wx:else>全部</text>
</view>
<glsx-image class="icon" src="{{ '/index/arrow.png' }}" webp></glsx-image>
</view>
......@@ -139,10 +140,11 @@
</view>
</view>
<view class="selectList" wx:if="{{ overviewTabIndexRegion == 1 }}">
<view class="carband box">
<view class="carband box" bindtap="chooseCarBrand" data-carname="selectedMainBrandOverview">
<view class="text">
主营品牌 /
<text class="bold">鸿蒙智行问界</text>
<text>主营品牌 /</text>
<text class="bold text-hide" wx:if="{{ selectedMainBrandOverview.length > 0 }}">{{selectedMainBrandOverview[0].children[0].name}}</text>
<text class="bold text-hide" wx:else>全部</text>
</view>
<glsx-image class="icon" src="{{ '/index/arrow.png' }}" webp></glsx-image>
</view>
......@@ -194,4 +196,14 @@
bindconfirm="handlePopupConfirm"
title="{{ selectTitle }}"
customIsTab="{{ true }}"
></select-popup>
\ No newline at end of file
></select-popup>
<popup
show="{{ carBrandPopupShow }}"
title="选择品牌"
bind:hidePopup="hideBrandPopupFormSelf"
customPopupSlotStyle="{{ 'height: calc(100% - 282rpx)' }}"
bindconfirm="brandConfirm"
height="90%"
>
<car-brand id="car-brand" popupShow="{{ carBrandPopupShow }}" multiple="{{ false }}" selectedList="{{ selectedMainBrandList }}"></car-brand>
</popup>
\ No newline at end of file
<!--pages/tabWorkOrder/components/OrderScreen/OrderScreen.wxml-->
<scroll-view scroll-y class="confirm-box" style="height:calc(100vh - {{navBarHeight}}px);margin-top:{{navBarHeight}}px;" hidden="{{!show}}">
<view class="main" style="padding-bottom: {{btnHeight}}px;min-height: calc(100% - {{btnHeight}}px);">
<view class="box">
<view class="title">
<view class="title-left">
主营品牌
</view>
</view>
<view class="choose-btn" bindtap="chooseCarBrand">
<text>去选择</text>
<image src="{{IMG_URL}}customer/arrow.png" mode=""/>
</view>
<view class="list-box">
<block wx:for="{{form.selectedMainBrand}}" wx:key="index">
<view class="item flex-1 text-center active" data-index="{{index}}">{{item.name}}{{ (item.children && item.children[0] && item.children[0].name) || (item.name || '') }}</view>
</block>
</view>
</view>
<view class="box">
<view class="title">
业务类型
</view>
<view class="list-box">
<block wx:for="{{form.businessTypeList}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-list-name="businessTypeList" data-index="{{index}}">{{item.name}}</view>
</block>
</view>
</view>
<view class="box">
<view class="title">
合作模式
</view>
<view class="list-box">
<block wx:for="{{form.cooperationModelList}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-list-name="cooperationModelList" data-index="{{index}}">{{item.name}}</view>
</block>
</view>
</view>
<view class="box">
<view class="title">
流量情况
</view>
<view class="list-box">
<block wx:for="{{form.trafficStatusList}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-list-name="trafficStatusList" data-index="{{index}}">{{item.name}}</view>
</block>
</view>
</view>
<view class="box" wx:if="{{userInfo.loginRole == 1}}">
<view class="title">
<view class="title-left">
所属省份
</view>
<view wx:if="{{form.provinces.length > 12}}" bindtap="showMore" data-type="provincesShowMore" class="collapse-btn {{!provincesShowMore ? 'rotate-180' : ''}}">
<image src="{{IMG_URL}}customer/collapse_icon.png" mode="" />
</view>
</view>
<view class="list-box">
<block wx:for="{{form.provinces}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}}" hidden="{{index >= 12 && !provincesShowMore}}" bindtap="choose" data-list-name="provinces" data-index="{{index}}">{{item.name}}</view>
</block>
</view>
</view>
<view class="box" wx:if="{{userInfo.loginRole == 1}}">
<view class="title">
<view class="title-left">
销售人员
</view>
<view wx:if="{{form.salesStaffList.length > 12}}" bindtap="showMore" data-type="salesStaffShowMore" class="collapse-btn {{!salesStaffShowMore ? 'rotate-180' : ''}}">
<image src="{{IMG_URL}}customer/collapse_icon.png" mode="" />
</view>
</view>
<view class="list-box">
<block wx:for="{{form.salesStaffList}}" wx:key="index">
<view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-list-name="salesStaffList" data-index="{{index}}" hidden="{{index >= 12 && !salesStaffShowMore}}">
<view class="text-item">{{item.staffName}}</view>
</view>
</block>
</view>
</view>
</view>
<view class="btn-box isFullSucreen-btn">
<view class="btn clear text-center" bindtap="reset">清除</view>
<view class="btn done text-center" bindtap="confirm">确定</view>
</view>
<scroll-view
scroll-y
class="confirm-box"
style="height:calc(100vh - {{ navBarHeight}}px);margin-top:{{navBarHeight }}px;"
hidden="{{ !show }}"
>
<view class="main" style="padding-bottom: {{ btnHeight}}px;min-height: calc(100% - {{btnHeight }}px);">
<view class="box">
<view class="title">
<view class="title-left">主营品牌</view>
</view>
<view class="choose-btn" bindtap="chooseCarBrand">
<text>去选择</text>
<image src="{{ IMG_URL }}customer/arrow.png" mode="" />
</view>
<view class="list-box">
<block wx:for="{{ form.selectedMainBrand }}" wx:key="index">
<view class="item flex-1 text-center active" data-index="{{ index }}">{{item.name}}{{ (item.children && item.children[0] && item.children[0].name) || (item.name || '') }}</view>
</block>
</view>
</view>
<view class="box">
<view class="title">业务类型</view>
<view class="list-box">
<block wx:for="{{ form.businessTypeList }}" wx:key="index">
<view
class="item text-center {{ item.active?'active':'' }}"
bindtap="choose"
data-list-name="businessTypeList"
data-index="{{ index }}"
>{{item.name}}</view>
</block>
</view>
</view>
<view class="box">
<view class="title">合作模式</view>
<view class="list-box">
<block wx:for="{{ form.cooperationModelList }}" wx:key="index">
<view
class="item text-center {{ item.active?'active':'' }}"
bindtap="choose"
data-list-name="cooperationModelList"
data-index="{{ index }}"
>{{item.name}}</view>
</block>
</view>
</view>
<view class="box">
<view class="title">流量情况</view>
<view class="list-box">
<block wx:for="{{ form.trafficStatusList }}" wx:key="index">
<view
class="item text-center {{ item.active?'active':'' }}"
bindtap="choose"
data-list-name="trafficStatusList"
data-index="{{ index }}"
>{{item.name}}</view>
</block>
</view>
</view>
<view class="box" wx:if="{{ userInfo.loginRole == 1 }}">
<view class="title">
<view class="title-left">所属省份</view>
<view
wx:if="{{ form.provinces.length > 12 }}"
bindtap="showMore"
data-type="provincesShowMore"
class="collapse-btn {{ !provincesShowMore ? 'rotate-180' : '' }}"
>
<image src="{{ IMG_URL }}customer/collapse_icon.png" mode="" />
</view>
</view>
<view class="list-box">
<block wx:for="{{ form.provinces }}" wx:key="index">
<view
class="item text-center {{ item.active?'active':'' }}"
hidden="{{ index >= 12 && !provincesShowMore }}"
bindtap="choose"
data-list-name="provinces"
data-index="{{ index }}"
>{{item.name}}</view>
</block>
</view>
</view>
<view class="box" wx:if="{{ userInfo.loginRole == 1 }}">
<view class="title">
<view class="title-left">销售人员</view>
<view
wx:if="{{ form.salesStaffList.length > 12 }}"
bindtap="showMore"
data-type="salesStaffShowMore"
class="collapse-btn {{ !salesStaffShowMore ? 'rotate-180' : '' }}"
>
<image src="{{ IMG_URL }}customer/collapse_icon.png" mode="" />
</view>
</view>
<view class="list-box">
<block wx:for="{{ form.salesStaffList }}" wx:key="index">
<view
class="item text-center {{ item.active?'active':'' }}"
bindtap="choose"
data-list-name="salesStaffList"
data-index="{{ index }}"
hidden="{{ index >= 12 && !salesStaffShowMore }}"
>
<view class="text-item">{{item.staffName}}</view>
</view>
</block>
</view>
</view>
</view>
<view class="btn-box isFullSucreen-btn">
<view class="btn clear text-center" bindtap="reset">清除</view>
<view class="btn done text-center" bindtap="confirm">确定</view>
</view>
</scroll-view>
<popup show="{{carBrandPopupShow}}" title="选择品牌" bind:hidePopup="hideBrandPopup" customPopupSlotStyle="{{'height: calc(100% - 282rpx)'}}" bindconfirm="brandConfirm" height="90%">
<car-brand id="car-brand" popupShow="{{carBrandPopupShow}}" multiple="{{false}}" selectedList="{{form.selectedMainBrand}}"></car-brand>
<popup
show="{{ carBrandPopupShow }}"
title="选择品牌"
bind:hidePopup="hideBrandPopup"
customPopupSlotStyle="{{ 'height: calc(100% - 282rpx)' }}"
bindconfirm="brandConfirm"
height="90%"
>
<car-brand id="car-brand" popupShow="{{ carBrandPopupShow }}" multiple="{{ false }}" selectedList="{{ form.selectedMainBrand }}"></car-brand>
</popup>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!