Commit a855f6b2 by 张立顺

Merge branch 'v4.27.0_0831' of http://192.168.3.233:8090/saas_plus/business-assi…

…stant into v4.27.0_0831
2 parents 39b95ac8 fc26aa84
Showing 34 changed files with 266 additions and 110 deletions
...@@ -15,5 +15,26 @@ class outputValueApi { ...@@ -15,5 +15,26 @@ class outputValueApi {
...data ...data
}) })
} }
/** 获取服务商(生意助手看产值)全场景我的门店数据 */
getAllSceneList(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchantTotal.allSceneShopList',
...data
})
}
/** 获取服务商(生意助手看产值)我的门店页总累计产值 */
getMerchantTotal(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchantTotal.getMerchantTotal',
...data
})
}
/** 获取服务商(生意助手看产值)指定场景我的门店数据 */
getQuerySceneList(data) {
return api.post({
method: 'scrm.api.boutiquecoupon.partnermerchantTotal.querySceneShopList',
...data
})
}
} }
export default outputValueApi export default outputValueApi
...@@ -19,11 +19,11 @@ Component({ ...@@ -19,11 +19,11 @@ Component({
}) })
}, 0.2 * 1000) }, 0.2 * 1000)
} else { } else {
// let hideTab = wx.$hideTab let hideTab = wx.$hideTab
this.setData({ this.setData({
showPopup: true, showPopup: true,
close: false, close: false,
// hideTab hideTab
}) })
} }
} }
...@@ -37,8 +37,9 @@ Component({ ...@@ -37,8 +37,9 @@ Component({
type: Boolean, type: Boolean,
value: true value: true
}, },
hideTab: Boolean, customHideTab: Boolean,
isTab: Boolean customIsTab: Boolean,
customPopupSlotStyle: String
}, },
/** /**
...@@ -64,9 +65,10 @@ Component({ ...@@ -64,9 +65,10 @@ Component({
} }
}, },
attached() { attached() {
// const { isTab } = wx.$router.getRouterList().find(item => item.url === `/${wx.$router.getPageInstance().route}`) const { isTab } = wx.$router.getRouterList().find(item => item.url === `/${wx.$router.getPageInstance().route}`)
// this.setData({ this.setData({
// isTab isTab
// }) })
console.log(isTab)
} }
}) })
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
<block wx:if="{{title}}"> <block wx:if="{{title}}">
<view class="popup-title text-center">{{title}}</view> <view class="popup-title text-center">{{title}}</view>
</block> </block>
<view class="popup-slot {{isTab && !hideTab? '': title?'isFullSucreen':'isFullSucreen-notitle'}}"> <view class="popup-slot {{(isTab || customIsTab) && (!hideTab || !customHideTab) ? '': title?'isFullSucreen':'isFullSucreen-notitle'}}" style="{{customPopupSlotStyle}}">
<slot></slot> <slot></slot>
</view> </view>
<view class="popup-footer {{isTab && !hideTab?'':'isFullSucreen'}}" wx:if="{{only}}"> <view class="popup-footer {{(isTab || customIsTab) && (!hideTab || !customHideTab) ?'':'isFullSucreen'}}" wx:if="{{only}}">
<view class="cancel btn text-center" bindtap="hidePopup">取消</view> <view class="cancel btn text-center" bindtap="hidePopup">取消</view>
<view class="confirm btn text-center" bindtap="confirm">确认</view> <view class="confirm btn text-center" bindtap="confirm">确认</view>
</view> </view>
<view class="popup-footer {{isTab && !hideTabb?'':'isFullSucreen'}}" wx:else> <view class="popup-footer {{(isTab || customIsTab) && (!hideTab || !customHideTab) ?'':'isFullSucreen'}}" wx:else>
<view class="confirm doubtn text-center" bindtap="confirm">确认</view> <view class="confirm doubtn text-center" bindtap="confirm">确认</view>
</view> </view>
</view> </view>
......
...@@ -7,6 +7,7 @@ Component({ ...@@ -7,6 +7,7 @@ Component({
selectInfo: { selectInfo: {
type: Object, type: Object,
observer: function(n) { observer: function(n) {
console.log(n)
this.setData({ this.setData({
copySelectInfo: n copySelectInfo: n
}) })
...@@ -18,7 +19,7 @@ Component({ ...@@ -18,7 +19,7 @@ Component({
if (n) { if (n) {
let { staffTypeList, notAll } = this.data let { staffTypeList, notAll } = this.data
if (notAll) { if (notAll) {
let index = staffTypeList.findIndex(v => v.type == '') let index = staffTypeList.findIndex(v => v.staffBusinessType == '')
if (index > -1) staffTypeList.splice(index, 1) if (index > -1) staffTypeList.splice(index, 1)
this.setData({ this.setData({
staffTypeList staffTypeList
...@@ -36,16 +37,16 @@ Component({ ...@@ -36,16 +37,16 @@ Component({
data: { data: {
staffTypeList: [ staffTypeList: [
{ {
type: '', staffBusinessType: '',
typeStr: '全部' staffBusinessTypeStr: '全部'
}, },
{ {
type: '1', staffBusinessType: '0',
typeStr: '驻店' staffBusinessTypeStr: '驻店'
}, },
{ {
type: '2', staffBusinessType: '1',
typeStr: '技师' staffBusinessTypeStr: '技师'
} }
], ],
copySelectInfo: {} copySelectInfo: {}
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
height="500rpx"> height="500rpx">
<block wx:for="{{staffTypeList}}" wx:key="index"> <block wx:for="{{staffTypeList}}" wx:key="index">
<view <view
class="itemCon text-hide {{item.type == copySelectInfo.type?'active':''}}" class="itemCon text-hide {{item.staffBusinessType == copySelectInfo.staffBusinessType?'active':''}}"
data-target="{{item}}" data-target="{{item}}"
bindtap="select"> bindtap="select">
{{item.typeStr}} {{item.staffBusinessTypeStr}}
</view> </view>
</block> </block>
</popup> </popup>
const phoneRex = /^[1]([3-9])[0-9]{9}$/ const phoneRex = /^[1]([3-9])[0-9]{9}$/
const formRule = { const formRule = {
selectInfo: [{ required: true, message: '所属服务中心不能为空' }], selectInfo: [{ required: true, message: '所属服务中心不能为空' }],
type: [{ required: true, message: '员工类型不能为空' }], staffBusinessType: [{ required: true, message: '员工类型不能为空' }],
staffName: [{ required: true, message: '员工姓名不能为空' }], staffName: [{ required: true, message: '员工姓名不能为空' }],
staffPhone: [ staffPhone: [
{ required: true, message: '手机号码不能为空' }, { required: true, message: '手机号码不能为空' },
...@@ -22,8 +22,8 @@ const formItems = [{ ...@@ -22,8 +22,8 @@ const formItems = [{
pageType: 1 pageType: 1
}, { }, {
label: '员工类型', label: '员工类型',
props: 'type', props: 'staffBusinessType',
valueFn: 'typeStr', valueFn: 'staffBusinessTypeStr',
type: 'select', type: 'select',
placeholder: '请选择员工类型', placeholder: '请选择员工类型',
pageType: 3 pageType: 3
......
...@@ -52,11 +52,12 @@ Page({ ...@@ -52,11 +52,12 @@ Page({
let optionsInfo = options?.info || {} let optionsInfo = options?.info || {}
let data = options?.info ? { let data = options?.info ? {
...options?.info, ...options?.info,
selectInfo: {yqMerchantId: optionsInfo.merchantNo, yqMerchantName: optionsInfo.merchantName}, selectInfo: {yqMerchantId: optionsInfo.merchantNo, yqMerchantName: optionsInfo.merchantName, staffBusinessType: optionsInfo?.staffBusinessType},
serviceValue: optionsInfo.merchantName, serviceValue: optionsInfo.merchantName,
visualType: optionsInfo.visualType || 0, visualType: optionsInfo.visualType || 0,
connectionValue: optionsInfo.visualType == 1 ? `已选${optionsInfo.visibleMerchantNo?.split(',')?.length}位客户`: '全部', connectionValue: optionsInfo.visualType == 1 ? `已选${optionsInfo.visibleMerchantNo?.split(',')?.length}位客户`: '全部',
selectedConnectionIds: optionsInfo.visualType == 1 ? optionsInfo.visibleMerchantNo?.split(',').map((v) => {return v && Number(v)}) : [] selectedConnectionIds: optionsInfo.visualType == 1 ? optionsInfo.visibleMerchantNo?.split(',').map((v) => {return v && Number(v)}) : [],
staffBusinessTypeStr: optionsInfo.staffBusinessType == 0 ? '驻店' : optionsInfo.staffBusinessType == 1 ? '技师' : ''
} : {} } : {}
this.setData({ this.setData({
addOrEdit: options?.info ? 'edit' : 'add', addOrEdit: options?.info ? 'edit' : 'add',
...@@ -132,7 +133,7 @@ Page({ ...@@ -132,7 +133,7 @@ Page({
this.hiddenSelectConfirm() this.hiddenSelectConfirm()
break break
case 2: case 2:
if (!formData.selectInfo) return wx.$api.showToast('请先选择所属服务中心') if (!formData?.selectInfo?.yqMerchantId) return wx.$api.showToast('请先选择所属服务中心')
wx.$router.go('packageMine.selectConnectionPage', this.data.formData) wx.$router.go('packageMine.selectConnectionPage', this.data.formData)
break break
case 3: case 3:
...@@ -163,7 +164,11 @@ Page({ ...@@ -163,7 +164,11 @@ Page({
}, },
hiddenSelectConfirm(e) { hiddenSelectConfirm(e) {
let selectInfo = e?.detail let { formData } = this.data
let selectInfo = {
...formData.selectInfo,
...e?.detail
}
this.setData({ showServiceConfirm: !this.data.showServiceConfirm }) this.setData({ showServiceConfirm: !this.data.showServiceConfirm })
if (!selectInfo) return if (!selectInfo) return
this.setData({ this.setData({
...@@ -202,7 +207,8 @@ Page({ ...@@ -202,7 +207,8 @@ Page({
staffPhone: formData?.staffPhone, staffPhone: formData?.staffPhone,
createdSource: 3, // 创建来源 固定3 生意助手 createdSource: 3, // 创建来源 固定3 生意助手
visualType: formData?.visualType, visualType: formData?.visualType,
visibleMerchantNoList: formData?.visualType == 0 ? undefined : formData?.selectedConnectionIds // 全部 无需传可见客户数据 visibleMerchantNoList: formData?.visualType == 0 ? undefined : formData?.selectedConnectionIds, // 全部 无需传可见客户数据
staffType: Number(formData?.staffBusinessType)
} }
let message = addOrEdit == 'add' ? '是否确定创建员工?' : '是否确定修改员工信息?' let message = addOrEdit == 'add' ? '是否确定创建员工?' : '是否确定修改员工信息?'
wx.showModal({ wx.showModal({
......
...@@ -3,7 +3,8 @@ var formatMobile = function (item) { ...@@ -3,7 +3,8 @@ var formatMobile = function (item) {
} }
var filterType = function (item) { var filterType = function (item) {
return ['驻店', '员工'][item.type] || '' console.log(item, '123123')
return ['驻店', '技师'][item] || ''
} }
module.exports = { module.exports = {
......
...@@ -72,7 +72,7 @@ Page({ ...@@ -72,7 +72,7 @@ Page({
}).then(res => { }).then(res => {
this.setData({ this.setData({
connectionList: res || [], connectionList: res || [],
selectedConnectionList: res?.filter(val => { return options?.selectedConnectionIds.length && options.selectedConnectionIds.includes(val.merchantId) }) || [] selectedConnectionList: res?.filter(val => { return options?.selectedConnectionIds?.length && options.selectedConnectionIds.includes(val.merchantId) }) || []
}) })
}) })
}, },
......
...@@ -11,7 +11,7 @@ Page({ ...@@ -11,7 +11,7 @@ Page({
bgUrl: `${IMG_URL}/personal/empty_tran.png`, bgUrl: `${IMG_URL}/personal/empty_tran.png`,
popupShow: false, popupShow: false,
staffList: [], staffList: [],
selectInfo: { yqMerchantName: '全部服务中心', typeStr: '全部员工类型', type: '' }, selectInfo: { yqMerchantName: '全部服务中心', staffBusinessTypeStr: '全部员工类型', staffBusinessType: '' },
total: 0, total: 0,
serviceList: [], serviceList: [],
currentPage: 1, currentPage: 1,
...@@ -62,7 +62,7 @@ Page({ ...@@ -62,7 +62,7 @@ Page({
pageSize: 10, pageSize: 10,
pageNum: currentPage, pageNum: currentPage,
merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds, merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds,
type: selectInfo.type staffBusinessType: selectInfo.staffBusinessType
} }
if (nothing || isAsk) { if (nothing || isAsk) {
return return
...@@ -122,8 +122,8 @@ Page({ ...@@ -122,8 +122,8 @@ Page({
getStaffList(e) { getStaffList(e) {
wx.$api.hideLoading() wx.$api.hideLoading()
let { selectInfo } = this.data let { selectInfo } = this.data
let { type, typeStr } = e.detail let { staffBusinessType, staffBusinessTypeStr } = e.detail
if (type == '' && typeStr == '全部') e.detail.typeStr = '全部员工类型' if (staffBusinessType == '' && staffBusinessTypeStr == '全部') e.detail.staffBusinessTypeStr = '全部员工类型'
let obj = { let obj = {
...selectInfo, ...selectInfo,
...e.detail ...e.detail
......
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
background: #F1F3F9; background: #F1F3F9;
border: 2rpx solid #FFFFFF; border: 2rpx solid #FFFFFF;
border-radius: 8rpx; border-radius: 8rpx;
padding: 0 8rpx;
font-size: 22rpx; font-size: 22rpx;
margin-left: 16rpx; margin-left: 16rpx;
color: #6B7384; color: #6B7384;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="select-box"> <view class="select-box">
<view class="select-btn"> <view class="select-btn">
<view class="type" bindtap="handleStaffTypeChange"> <view class="type" bindtap="handleStaffTypeChange">
<text>{{selectInfo.typeStr}}</text> <text>{{selectInfo.staffBusinessTypeStr}}</text>
<glsx-image class="point" src="index/point.png" /> <glsx-image class="point" src="index/point.png" />
</view> </view>
</view> </view>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<glsx-image wx:if="{{!item.weChatAvatarUrl}}" src="personal/staff_defalut_avatar.png" class="avatar"/> <glsx-image wx:if="{{!item.weChatAvatarUrl}}" src="personal/staff_defalut_avatar.png" class="avatar"/>
<image wx:else src="{{item.weChatAvatarUrl}}" class="avatar"></image> <image wx:else src="{{item.weChatAvatarUrl}}" class="avatar"></image>
<view class="message-text"> <view class="message-text">
<view class="name"><text>{{item.staffName}}</text><text wx:if="{{item.type}}" class="type_tips">{{filter.filterType(item.type)}}</text></view> <view class="name"><text>{{item.staffName}}</text><text class="type_tips" wx:if="{{format.filterType(item.staffBusinessType)}}">{{format.filterType(item.staffBusinessType)}}</text></view>
<view class="mobile">{{format.formatMobile(item.staffPhone)}}</view> <view class="mobile">{{format.formatMobile(item.staffPhone)}}</view>
</view> </view>
</view> </view>
......
...@@ -234,12 +234,13 @@ Page({ ...@@ -234,12 +234,13 @@ Page({
pIdx: -1, pIdx: -1,
idx: -1 idx: -1
} }
let { userInfo } = wx.$storage.get()
if (this.data.mockObj?.crowdObj) { if (this.data.mockObj?.crowdObj) {
let pList = this.data.mockObj.crowdObj.map(item => item.pMerchantId) let pList = this.data.mockObj.crowdObj.map(item => item.pMerchantId)
for (let i = 0; i < this.data.mockObj.crowdObj.length; i++) { for (let i = 0; i < this.data.mockObj.crowdObj.length; i++) {
let item = this.data.mockObj.crowdObj[i] let item = this.data.mockObj.crowdObj[i]
let cList = item.merchantList.map(k => k.merhantId) let cList = item.merchantList.map(k => k.merhantId)
if (cList.includes((id || this.data.merchantInfo.merchantId) + '') && pList.includes((pId || this.data.merchantInfo.pMerchantId) + '')) { if (cList.includes((id || this.data.merchantInfo.merchantId) + '') && pList.includes((pId || userInfo.subLoginUser.merchantId) + '')) {
res = { res = {
flag: true, flag: true,
pIdx: i, pIdx: i,
...@@ -254,7 +255,8 @@ Page({ ...@@ -254,7 +255,8 @@ Page({
// 处理SC004的mock数据 // 处理SC004的mock数据
mockDealCrowd(data) { mockDealCrowd(data) {
var obj = this.judgeCrowd(this.data.merchantInfo.pMerchantId, data.merchantId) let { userInfo } = wx.$storage.get()
var obj = this.judgeCrowd(userInfo.subLoginUser.merchantId, data.merchantId)
if (!obj.flag) { if (!obj.flag) {
return data return data
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
background: #F7F7F7; background: #F7F7F7;
border-radius: 8rpx; border-radius: 8rpx;
display: flex; display: flex;
margin-top: -2rpx;
.merchant_text{ .merchant_text{
display: flex; display: flex;
view{ view{
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
bind:hidePopup="hidePopup" bind:hidePopup="hidePopup"
bindconfirm="confirm" bindconfirm="confirm"
height="60%" height="60%"
title="员工提成"> title="员工提成"
customIsTab="{{true}}"
customPopupSlotStyle="height: calc(100% - 200rpx)">
<!-- 服务多家门店不显示门店名称 --> <!-- 服务多家门店不显示门店名称 -->
<view class="title_tips"> <view class="title_tips">
<view decode="{{true}}" class="merchant_text" wx:if="{{(handleCommissionObj.constructionStats && handleCommissionObj.constructionStats.length == 1) || (handleCommissionObj.outputValueStats && handleCommissionObj.outputValueStats.length == 1)}}"> <view decode="{{true}}" class="merchant_text" wx:if="{{(handleCommissionObj.constructionStats && handleCommissionObj.constructionStats.length == 1) || (handleCommissionObj.outputValueStats && handleCommissionObj.outputValueStats.length == 1)}}">
......
...@@ -37,6 +37,10 @@ Component({ ...@@ -37,6 +37,10 @@ Component({
screenFlag: true screenFlag: true
}) })
}, },
// 超管切换服务商
hanbleChangeService() {
this.getMerchantList()
},
// 选择门店 // 选择门店
handleSlectMerchant() { handleSlectMerchant() {
this.setData({ this.setData({
......
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
</view> </view>
</view> </view>
<!-- 选择门店 --> <!-- 选择门店 -->
<select-merchant-popup wx:if="{{popupShow}}" bind:hidePopup="handleSlectMerchant" bindmerchantConfirm="handleMerchantChange" selectInfo="{{formData}}" popShow="{{popupShow}}" merchantRange="{{merchantList}}" isTab="{{true}}"/> <select-merchant-popup wx:if="{{popupShow}}" bind:hidePopup="handleSlectMerchant" bindmerchantConfirm="handleMerchantChange" selectInfo="{{formData}}" popShow="{{popupShow}}" merchantRange="{{merchantList}}"/>
<!-- 筛选 --> <!-- 筛选 -->
<screen-confirm-box wx:if="{{pageLoaded}}" bindscreenFlag="handleScreenFlag" tabBarStyle="{{tabBarStyle}}" show="{{confirmShow}}" userInfo="{{userInfo}}" formData="{{formData}}" tabType="{{tabType}}"></screen-confirm-box>
\ No newline at end of file \ No newline at end of file
<screen-confirm-box wx:if="{{pageLoaded}}" bindscreenFlag="handleScreenFlag" tabBarStyle="{{tabBarStyle}}" show="{{confirmShow}}" userInfo="{{userInfo}}" formData="{{formData}}" tabType="{{tabType}}" bindchangeService="hanbleChangeService"></screen-confirm-box>
\ No newline at end of file \ No newline at end of file
...@@ -17,7 +17,7 @@ Component({ ...@@ -17,7 +17,7 @@ Component({
thisPage.setData({ thisPage.setData({
isShowFilterScreen: true isShowFilterScreen: true
}) })
this.setDate() // 默认展示当前月份 if (!this.data.formData.startTime || !this.data.formData.endTime) this.setDate() // 未选择时间默认展示当前月份
this.setViewData() this.setViewData()
} }
} }
...@@ -44,7 +44,7 @@ Component({ ...@@ -44,7 +44,7 @@ Component({
}, },
{ {
id: '3', id: '3',
label: '众筹活动' label: '售后众筹'
}, },
{ {
id: '0', id: '0',
...@@ -87,7 +87,7 @@ Component({ ...@@ -87,7 +87,7 @@ Component({
}) })
.catch(err => { }) .catch(err => { })
} else { } else {
let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }] let merchantRange = [{ merchantId: userInfo?.subLoginUser?.merchantId, merchantName: userInfo?.subLoginUser?.merchantName }]
this.setData({ this.setData({
merchantRange merchantRange
}) })
...@@ -96,6 +96,7 @@ Component({ ...@@ -96,6 +96,7 @@ Component({
changeMerchantRange(e) { changeMerchantRange(e) {
let { merchantRange, subIndex, formData } = this.data let { merchantRange, subIndex, formData } = this.data
let { merchantId } = e.detail let { merchantId } = e.detail
this.reset()
merchantRange.forEach((item, index) => { merchantRange.forEach((item, index) => {
item.show = true item.show = true
if (item.merchantId == merchantId) { if (item.merchantId == merchantId) {
...@@ -104,12 +105,13 @@ Component({ ...@@ -104,12 +105,13 @@ Component({
} }
}) })
formData.partnerMerchantIds = [merchantId] formData.partnerMerchantIds = [merchantId]
if (!this.data.formData.startTime || !this.data.formData.endTime) this.setDate() // 未选择时间默认展示当前月份
this.setData({ this.setData({
merchantRange, merchantRange,
subIndex, subIndex,
formData formData
}) })
if (this.data.tabType == 1 && merchantId !== userInfo?.subLoginUser?.merchantId) this.getStaffList() this.getStaffList()
this.servicePicker() this.servicePicker()
}, },
// 服务商切换 // 服务商切换
...@@ -154,7 +156,11 @@ Component({ ...@@ -154,7 +156,11 @@ Component({
// 员工数据 // 员工数据
getStaffList() { getStaffList() {
let { partnerMerchantIds } = this.data.formData let { partnerMerchantIds } = this.data.formData
outputValueApi.GETALLSTAFFDATAAPI({partnerMerchantId: partnerMerchantIds[0]}).then(res => { let { userInfo } = this.data
let params = {
partnerMerchantIds: partnerMerchantIds.length ? partnerMerchantIds : userInfo?.subLoginUser?.merchantId
}
outputValueApi.GETALLSTAFFDATAAPI(params).then(res => {
let arr = res || [] let arr = res || []
if (!arr?.length || arr[0]?.staffName !== '全部') { if (!arr?.length || arr[0]?.staffName !== '全部') {
arr.unshift({ arr.unshift({
...@@ -182,9 +188,11 @@ Component({ ...@@ -182,9 +188,11 @@ Component({
target.map(i => (i.active = false)) target.map(i => (i.active = false))
target[index].active = true target[index].active = true
} else { } else {
target[index].active = true target[index].active = !target[index].active
target[0].active = false target[0].active = false
} }
let activeFlag = target.findIndex(val => val.active)
if (activeFlag < 0) target[0].active = true
break break
case 'sceneList': case 'sceneList':
target.map(i => (i.active = false)) target.map(i => (i.active = false))
...@@ -214,6 +222,8 @@ Component({ ...@@ -214,6 +222,8 @@ Component({
// 切换服务商 清空已选的门店 // 切换服务商 清空已选的门店
formData.shopMerchantIds = [] formData.shopMerchantIds = []
formData.shopMerchantNames = '全部门店' formData.shopMerchantNames = '全部门店'
// 获取服务商下门店
this.triggerEvent('changeService')
thisPage.setData({ thisPage.setData({
screenFormData: formData, screenFormData: formData,
}) })
...@@ -243,7 +253,7 @@ Component({ ...@@ -243,7 +253,7 @@ Component({
} }
merchantRange.forEach((item, index) => { merchantRange.forEach((item, index) => {
item.show = true item.show = true
if (item.merchantId == userInfo.subLoginUser.merchantId) { if (item.merchantId == userInfo?.subLoginUser?.merchantId) {
subIndex = index subIndex = index
} }
}) })
...@@ -254,7 +264,6 @@ Component({ ...@@ -254,7 +264,6 @@ Component({
merchantRange, merchantRange,
subIndex subIndex
}) })
this.init()
} }
}, },
attached() { attached() {
......
...@@ -94,10 +94,14 @@ ...@@ -94,10 +94,14 @@
width: 316rpx; width: 316rpx;
height: 68rpx; height: 68rpx;
line-height: 68rpx; line-height: 68rpx;
font-size: 26rpx;
text-align: center; text-align: center;
background: #F7F7F7; background: #F7F7F7;
border-radius: 8rpx; border-radius: 8rpx;
} }
.box .date_box .date_item.placeholder{
color: #9E9EA8;
}
.box .list_box { .box .list_box {
display: flex; display: flex;
......
...@@ -48,9 +48,11 @@ ...@@ -48,9 +48,11 @@
</view> </view>
</view> </view>
<view class="date_box"> <view class="date_box">
<view class="date_item">{{filter.filterDate(formData.startTime)}}</view> <view class="date_item" wx:if="{{formData.startTime}}">{{filter.filterDate(formData.startTime) || '开始时间'}}</view>
<view class="date_item placeholder" wx:else>YYYY/MM</view>
<view>-</view> <view>-</view>
<view class="date_item">{{filter.filterDate(formData.endTime)}}</view> <view class="date_item" wx:if="{{formData.endTime}}">{{filter.filterDate(formData.endTime) || '结束时间'}}</view>
<view class="date_item placeholder" wx:else>YYYY/MM</view>
</view> </view>
</view> </view>
<view class="box" wx:if="{{tabType == 0}}"> <view class="box" wx:if="{{tabType == 0}}">
...@@ -82,4 +84,4 @@ ...@@ -82,4 +84,4 @@
</view> </view>
</scroll-view> </scroll-view>
<switchAccountPopup wx:if="{{servicePopupShow}}" bind:hidePopup="servicePicker" bindchangeAccount="changeMerchantRange" popShow="{{servicePopupShow}}" merchantRange="{{merchantRange}}" selectInfo="{{formData}}" hideTab="{{true}}"/> <switchAccountPopup wx:if="{{servicePopupShow}}" bind:hidePopup="servicePicker" bindchangeAccount="changeMerchantRange" popShow="{{servicePopupShow}}" merchantRange="{{merchantRange}}" selectInfo="{{formData}}" customHideTab="{{true}}"/>
...@@ -35,7 +35,7 @@ Component({ ...@@ -35,7 +35,7 @@ Component({
}, },
merchantRange: Object, merchantRange: Object,
selectInfo: Object, selectInfo: Object,
hideTab: Boolean customHideTab: Boolean
}, },
/** /**
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
bind:hidePopup="hidePopup" bind:hidePopup="hidePopup"
bindconfirm="confirm" bindconfirm="confirm"
height="60%" height="60%"
hideTab="{{hideTab}}"> customHideTab="{{customHideTab}}">
<!-- <search-input placeholder="请搜索服务商账号名" ></search-input> --> <!-- <search-input placeholder="请搜索服务商账号名" ></search-input> -->
<view class="search-box"> <view class="search-box">
<view class="search-input"> <view class="search-input">
......
...@@ -69,7 +69,8 @@ Component({ ...@@ -69,7 +69,8 @@ Component({
actionOperationResult(val1, val2, rate = false){ actionOperationResult(val1, val2, rate = false){
const p = this.actionOperation(val1, val2) const p = this.actionOperation(val1, val2)
return rate ? ((val1 * p) / (val2 * p)) * 100 : ((val1 * p) / (val2 * p)).toFixed(2) let flag = Number.isInteger(((val1 * p) / (val2 * p)) * 100) // 是否是整数
return rate ? (flag ? ((val1 * p) / (val2 * p)) * 100 : (((val1 * p) / (val2 * p)) * 100).toFixed(2)) : ((val1 * p) / (val2 * p)).toFixed(2)
}, },
actionOperation(val1, val2){ actionOperation(val1, val2){
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
<view class="flex_spa-be"> <view class="flex_spa-be">
<view class="merchant_num">服务门店·{{item.outputValueType == 1 ? item.outputValueStats.length : item.constructionStats.length}}家</view> <view class="merchant_num">服务门店·{{item.outputValueType == 1 ? item.outputValueStats.length : item.constructionStats.length}}家</view>
<view class="commission"> <view class="commission">
<view class="flex" data-target="{{item}}" bindtap="handleCommissionPopup"><text>提成</text><text class="arrow"></text></view> <view class="flex" wx:if="{{item.commissionFlag}}" data-target="{{item}}" bindtap="handleCommissionPopup"><text>提成</text><text class="arrow"></text></view>
<!-- <view class="disabled" wx:else="">提成未设置</view> --> <view class="disabled" wx:else>提成未设置</view>
</view> </view>
</view> </view>
</view> </view>
......
// pages/tab/outputValue/components/merchant/merchant.js // pages/tab/outputValue/components/merchant/merchant.js
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import outputApi from '~/api/outputApi/index' import outputValueApi from '~/api/outputValueApi/index'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -35,6 +35,12 @@ Component({ ...@@ -35,6 +35,12 @@ Component({
formData: {}, formData: {},
serviceName: '', serviceName: '',
totalObj: {}, totalObj: {},
pageCof: {
startYearMonth: '',
endYearMonth: ''
},
isEnd: false,
loading: true,
// totalObj: { // totalObj: {
// scene1Total: '72536', // scene1Total: '72536',
// scene0Total: '76400', // scene0Total: '76400',
...@@ -186,59 +192,98 @@ Component({ ...@@ -186,59 +192,98 @@ Component({
// }] // }]
// }] // }]
}, },
// lifetimes: {
// attached() {
// this.getMerchantList()
// }
// },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
// search() {
// console.log(this.data.searchForm, 'searchForm---')
// let { sceneType } = this.data.searchForm
// let { allMerchantList, otherMerchantList } = this.data
// this.setData({
// merchantList: !sceneType ? allMerchantList : otherMerchantList
// })
// },
merchantRefresh(isReset = false) { merchantRefresh(isReset = false) {
if (isReset) {
this.setData({
['pageCof.startYearMonth']: '',
['pageCof.endYearMonth']: ''
})
}
this.getTotal() this.getTotal()
this.getMerchantList(isReset) this.getMerchantList(isReset)
}, },
getTotal() { getTotal() {
let { searchForm } = this.data
let params = {
merchantId: searchForm.shopMerchantIds.length ? searchForm.shopMerchantIds[0] : ''
}
outputValueApi.getMerchantTotal(params).then(res => {
this.setData({
totalObj: res || {}
})
})
},
getMore() {
this.getMerchantList()
},
// month作为分页参数
dealMonth(isReset = false, monthInterval = 1) {
let { startTime, endTime } = this.data.searchForm
let { startYearMonth, endYearMonth } = this.data.pageCof
// 获取当前日期
let _currentDate = new Date()
// 获取前n个月的日期
let _endMonthDate = new Date()
let searchStart = ''
// 翻页
if (startYearMonth && endYearMonth) {
_currentDate = new Date(startYearMonth)
_endMonthDate = new Date(startYearMonth)
} else if (startTime && endTime) {
_currentDate = new Date(endTime)
_endMonthDate = new Date(endTime)
searchStart = new Date(startTime)
}
_endMonthDate.setMonth(_currentDate.getMonth() - monthInterval)
let _startMonthDate = new Date(isReset ? _currentDate : _endMonthDate)
_startMonthDate.setMonth(_startMonthDate.getMonth() - monthInterval)
endYearMonth = isReset ? _currentDate.format('yyyy-MM') : _endMonthDate.format('yyyy-MM')
startYearMonth = searchStart > _startMonthDate ? new Date(searchStart).format('yyyy-MM') : _startMonthDate.format('yyyy-MM')
this.setData({
['pageCof.startYearMonth']: startYearMonth,
['pageCof.endYearMonth']: endYearMonth,
isEnd: new Date(new Date(startTime)).format('yyyy-MM') == startYearMonth
})
}, },
getMerchantList(isReset = false) { getMerchantList(isReset = false) {
let { userInfo } = wx.$storage.get() let { userInfo } = wx.$storage.get()
console.log(this.data.searchForm, 'searchForm---') let { searchForm, merchantList } = this.data
let { searchForm } = this.data
this.setData({ this.setData({
serviceName: userInfo.subLoginUser.merchantName serviceName: userInfo.subLoginUser.merchantName,
loading: true
}) })
this.dealMonth(isReset)
let params = { let params = {
partnerMerchantId: userInfo.subLoginUser.merchantId, partnerMerchantId: userInfo.subLoginUser.merchantId,
merchantId: searchForm.shopMerchantIds.length ? searchForm.shopMerchantIds[0] : '' merchantId: searchForm.shopMerchantIds.length ? searchForm.shopMerchantIds[0] : '',
sceneType: searchForm.sceneType,
...this.data.pageCof
}
wx.$api.showLoading('加载中...')
const paiName = searchForm.sceneType ? 'getQuerySceneList' : 'getAllSceneList'
outputValueApi[paiName](params).then(res => {
console.log(res, 'res---')
this.setData({
merchantList: isReset ? (res || []) : merchantList.concat(res || [])
})
if (isReset) {
this.setData({
busiScrollTop: 0
})
}
}).finally(() => {
wx.hideLoading()
this.setData({
triggered: false,
loading: false
})
})
} }
// outputApi.getStaffList(params).then(res => {
// if (isReset) {
// this.setData({
// busiScrollTop: 0
// })
// }
// this.setData({
// triggered: false
// })
// // let _list = []
// // _list = res || []
// // this.setData({
// // merchantList: _list
// // })
// })
},
} }
}) })
...@@ -15,6 +15,19 @@ ...@@ -15,6 +15,19 @@
.merchant-content { .merchant-content {
// margin: 0 16rpx; // margin: 0 16rpx;
margin-bottom: 44rpx;
}
.btn {
width: 256rpx;
height: 80rpx;
line-height: 80rpx;
border: 1.6rpx solid #DDDDDD;
border-radius: 12rpx;
font-size: 24rpx;
color: #5A6066;
text-align: center;
margin: 0 auto 44rpx;
} }
.end-txt { .end-txt {
......
<!--pages/tab/outputValue/components/merchant/merchant.wxml--> <!--pages/tab/outputValue/components/merchant/merchant.wxml-->
<view class="merchantCon"> <view class="merchantCon">
<scroll-view class="merchant" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="handleSearch" lower-threshold='50' scroll-top="{{busiScrollTop}}"> <scroll-view class="merchant" id="scroller" scroll-y="{{true}}" refresher-enabled="{{true}}" refresher-triggered="{{triggered}}" bindrefresherrefresh="merchantRefresh" lower-threshold='50' scroll-top="{{busiScrollTop}}">
<!-- 全部 - 服务商总产值 --> <!-- 全部 - 服务商总产值 -->
<service-total wx:if="{{!searchForm.sceneType}}" serviceName="{{serviceName}}" totalObj="{{totalObj}}"></service-total> <service-total wx:if="{{!searchForm.sceneType && merchantList.length}}" serviceName="{{serviceName}}" totalObj="{{totalObj}}"></service-total>
<view wx:for="{{merchantList}}" wx:key="index" class="merchant-content"> <view wx:for="{{merchantList}}" wx:key="index" class="merchant-content">
<!-- 全部 --> <!-- 全部 -->
<merchant-all wx:if="{{!searchForm.sceneType}}" curInfo="{{item}}"></merchant-all> <merchant-all wx:if="{{!searchForm.sceneType}}" curInfo="{{item}}"></merchant-all>
<!-- 指定场景:太阳膜,售后众筹,会员权益/升级 --> <!-- 指定场景:太阳膜,售后众筹,会员权益/升级 -->
<merchant-scene wx:else searchForm="{{searchForm}}" curInfo="{{item}}"></merchant-scene> <merchant-scene wx:else searchForm="{{searchForm}}" curInfo="{{item}}"></merchant-scene>
</view> </view>
<view wx:if="{{!loading}}">
<view wx:if="{{!merchantList.length}}" class="end-txt"> <view wx:if="{{!merchantList.length}}" class="end-txt">
<nothing-tips tips="暂无数据~" bgColor="{{'#FFFFFF'}}" bg="{{bgUrl}}" /> <nothing-tips tips="暂无数据~" bgColor="{{'#FFFFFF'}}" bg="{{bgUrl}}" />
</view> </view>
<view class="btn" wx:elif="{{!isEnd}}" bindtap="getMore">加载更多</view>
<view wx:else class="end-txt"> <view wx:else class="end-txt">
<view>到底啦~</view> <view>到底啦~</view>
</view> </view>
</view>
</scroll-view> </scroll-view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -8,7 +8,11 @@ Component({ ...@@ -8,7 +8,11 @@ Component({
curInfo: { curInfo: {
type: Object, type: Object,
value: () => { }, value: () => { },
observer(n) { } observer(n) {
if(n) {
this.dealYearMonth()
}
}
}, },
searchForm: { searchForm: {
type: Object, type: Object,
...@@ -38,14 +42,23 @@ Component({ ...@@ -38,14 +42,23 @@ Component({
sceneTopList: constant.membranesTopList, sceneTopList: constant.membranesTopList,
sceneFormList: constant.membranesFormList, sceneFormList: constant.membranesFormList,
sceneObj: {}, sceneObj: {},
compareList: [], date: {
switchChecked: false year: '',
month: ''
}
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
dealYearMonth() {
let { yearMonth } = this.data.curInfo
this.setData({
['date.year']: new Date(yearMonth || '').getFullYear(),
['date.month']: new Date(yearMonth || '').getMonth() + 1,
})
},
dealData() { dealData() {
let { searchForm, sceneToInfo } = this.data let { searchForm, sceneToInfo } = this.data
let sceneObj = sceneToInfo.find(item => item.type == (searchForm.sceneType || 1)) let sceneObj = sceneToInfo.find(item => item.type == (searchForm.sceneType || 1))
...@@ -54,6 +67,11 @@ Component({ ...@@ -54,6 +67,11 @@ Component({
sceneTopList: constant[(sceneObj.name || 'membranes') + 'TopList'], sceneTopList: constant[(sceneObj.name || 'membranes') + 'TopList'],
sceneFormList: constant[(sceneObj.name || 'membranes') + 'FormList'] sceneFormList: constant[(sceneObj.name || 'membranes') + 'FormList']
}) })
} },
jump(e) {
let { info } = e.currentTarget.dataset
console.log(info)
wx.$router.go('packagesList.newSummary', info)
},
} }
}) })
...@@ -130,6 +130,14 @@ ...@@ -130,6 +130,14 @@
background-image: linear-gradient(179deg, #FAFAFA 0%, #FFFFFF 50%); background-image: linear-gradient(179deg, #FAFAFA 0%, #FFFFFF 50%);
} }
.list:hover {
background: #00000005;
}
.title-box-first:hover {
background-image: none;
}
.title-box { .title-box {
position: relative; position: relative;
padding: 26rpx 24rpx; padding: 26rpx 24rpx;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<text class="num-red">¥{{filter.money_three_for_two_thousands(curInfo.curMonthTotalData.bizTotal || 0)}}</text> <text class="num-red">¥{{filter.money_three_for_two_thousands(curInfo.curMonthTotalData.bizTotal || 0)}}</text>
</view> </view>
<view> <view>
<text class="num-month">8</text><text class="month">月</text><text class="year">2023年</text> <text class="num-month">{{date.month}}</text><text class="month">月</text><text class="year">{{date.year}}年</text>
</view> </view>
<view class="top-num-box"> <view class="top-num-box">
<view> <view>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</view> </view>
<!-- 门店列表 --> <!-- 门店列表 -->
<view class="contanier"> <view class="contanier">
<view wx:for="{{curInfo.merchantDataList}}" wx:key="index" class="list"> <view wx:for="{{curInfo.merchantDataList}}" wx:key="index" class="list" bindtap="jump" data-info="{{item}}">
<view class="title-box flex-between {{index == 0 ? 'title-box-first' : ''}}"> <view class="title-box flex-between {{index == 0 ? 'title-box-first' : ''}}">
<view class="title-block"> <view class="title-block">
<view class="title-name text-hide">{{item.merchantName}}</view> <view class="title-name text-hide">{{item.merchantName}}</view>
......
...@@ -9,7 +9,10 @@ Component({ ...@@ -9,7 +9,10 @@ Component({
type: Object, type: Object,
value: () => { }, value: () => { },
observer(n) { observer(n) {
n && this.dealCompare() if(n) {
this.dealYearMonth()
this.dealCompare()
}
} }
} }
}, },
...@@ -20,13 +23,24 @@ Component({ ...@@ -20,13 +23,24 @@ Component({
data: { data: {
sceneFormList: constant.sceneFormList, sceneFormList: constant.sceneFormList,
compareList: [], compareList: [],
switchChecked: false switchChecked: false,
date: {
year: '',
month: ''
}
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
dealYearMonth() {
let { yearMonth } = this.data.curInfo
this.setData({
['date.year']: new Date(yearMonth || '').getFullYear(),
['date.month']: new Date(yearMonth || '').getMonth() + 1,
})
},
dealCompare() { dealCompare() {
let { merchantDataList } = this.data.curInfo let { merchantDataList } = this.data.curInfo
let list = [] let list = []
...@@ -43,9 +57,8 @@ Component({ ...@@ -43,9 +57,8 @@ Component({
this.setData({ this.setData({
compareList: list compareList: list
}) })
console.log(this.data.compareList, 'compareList---')
}, },
handleClick(e) { jump(e) {
let { info } = e.currentTarget.dataset let { info } = e.currentTarget.dataset
console.log(info) console.log(info)
wx.$router.go('packagesList.newSummary', info) wx.$router.go('packagesList.newSummary', info)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<switch style="zoom:.6; margin-left: 8rpx;" color="#3666FE" checked="{{switchChecked}}" bindchange="switchChange" /> <switch style="zoom:.6; margin-left: 8rpx;" color="#3666FE" checked="{{switchChecked}}" bindchange="switchChange" />
</view> </view>
<view> <view>
<text class="num-month">8</text><text class="month">月</text><text class="year">2023年</text> <text class="num-month">{{date.month}}</text><text class="month">月</text><text class="year">{{date.year}}年</text>
</view> </view>
<view class="top-num-box"> <view class="top-num-box">
<view> <view>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</view> </view>
<!-- 门店列表 --> <!-- 门店列表 -->
<view class="contanier"> <view class="contanier">
<view wx:for="{{curInfo.merchantDataList}}" wx:key="index" class="list" bindtap="handleClick" data-info="{{item}}"> <view wx:for="{{curInfo.merchantDataList}}" wx:key="index" class="list" bindtap="jump" data-info="{{item}}">
<view class="title-box flex-between {{index == 0 ? 'title-box-first' : ''}}"> <view class="title-box flex-between {{index == 0 ? 'title-box-first' : ''}}">
<view class="title-block"> <view class="title-block">
<view class="title-name text-hide">{{item.merchantName}}</view> <view class="title-name text-hide">{{item.merchantName}}</view>
......
...@@ -37,8 +37,7 @@ Component({ ...@@ -37,8 +37,7 @@ Component({
}, },
merchantRange: Object, merchantRange: Object,
selectInfo: Object, selectInfo: Object,
isMerchant: Boolean, isMerchant: Boolean
isTab: Boolean
}, },
/** /**
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
bind:hidePopup="hidePopup" bind:hidePopup="hidePopup"
bindconfirm="confirm" bindconfirm="confirm"
height="60%" height="60%"
isTab="{{isTab}}"> customIsTab="{{true}}">
<view class="search-box"> <view class="search-box">
<view class="search-input"> <view class="search-input">
<glsx-image src="output/searchIcon.png" class="search-icon" /> <glsx-image src="output/searchIcon.png" class="search-icon" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!