Commit 6aa357bd by chenwq

bug修复,客户管理

1 parent 3e99966e
...@@ -22,7 +22,8 @@ Page({ ...@@ -22,7 +22,8 @@ Page({
pageCof: { pageCof: {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
} },
isAsk: false
}, },
// 筛选服务中心 // 筛选服务中心
...@@ -76,14 +77,18 @@ Page({ ...@@ -76,14 +77,18 @@ Page({
}, },
getList(isReset = false) { getList(isReset = false) {
let { customerList, pageCof, total, selectInfo } = this.data let { customerList, pageCof, total, selectInfo, isAsk } = this.data
if (total == customerList.length) { let _this = this
if (total == customerList.length || isAsk) {
return true return true
} }
let params = { let params = {
...pageCof, ...pageCof,
serviceCenterMerchantId: selectInfo?.yqMerchantId || '' serviceCenterMerchantId: selectInfo?.yqMerchantId || ''
} }
this.setData({
isAsk: true
})
mineCustomerApi.getCustomerList(params).then(res => { mineCustomerApi.getCustomerList(params).then(res => {
let { list, total } = res let { list, total } = res
this.setData({ this.setData({
...@@ -97,6 +102,10 @@ Page({ ...@@ -97,6 +102,10 @@ Page({
scrollTop: 0 scrollTop: 0
}) })
} }
}).finally(function () {
_this.setData({
isAsk: false
})
}) })
}, },
......
...@@ -31,21 +31,21 @@ ...@@ -31,21 +31,21 @@
<view class="employee-box"> <view class="employee-box">
<view class="employee-list"> <view class="employee-list">
<!-- 技师 --> <!-- 技师 -->
<view class="employee-list"> <view class="employee-list" catchtap="handleTechnician" data-target="{{item}}">
<view class="avatar-box"> <view class="avatar-box">
<glsx-image class="avatar-img" src="personal/tech_defalut_avatar.png" /> <glsx-image class="avatar-img" src="personal/tech_defalut_avatar.png" />
<view wx:if="{{item.technicianCount != '0'}}" class="num">{{item.technicianCount > maxNum ? (maxNum + '+') : item.technicianCount}}</view> <view wx:if="{{item.technicianCount != '0'}}" class="num">{{item.technicianCount > maxNum ? (maxNum + '+') : item.technicianCount}}</view>
</view> </view>
<view class="look-btn" data-target="{{item}}" catchtap="handleTechnician">技师</view> <view class="look-btn">技师</view>
</view> </view>
<view class="line">|</view> <view class="line">|</view>
<!-- 销售顾问 --> <!-- 销售顾问 -->
<view class="employee-list" wx:if="{{item.employeeNum != '0'}}"> <view class="employee-list" wx:if="{{item.employeeNum != '0'}}" catchtap="handleSale" data-target="{{item}}">
<view class="avatar-box"> <view class="avatar-box">
<glsx-image class="avatar-img" src="personal/staff_defalut_avatar.png" /> <glsx-image class="avatar-img" src="personal/staff_defalut_avatar.png" />
<view class="num">{{item.employeeNum > maxNum ? (maxNum + '+') : item.employeeNum}}</view> <view class="num">{{item.employeeNum > maxNum ? (maxNum + '+') : item.employeeNum}}</view>
</view> </view>
<view class="look-btn" data-target="{{item}}" catchtap="handleSale">销售顾问</view> <view class="look-btn">销售顾问</view>
</view> </view>
<view class="no-employee" wx:else>暂无销售顾问,去邀请</view> <view class="no-employee" wx:else>暂无销售顾问,去邀请</view>
</view> </view>
......
...@@ -4,6 +4,8 @@ import { scenceList } from '~/pages/tab/index/constant/data' ...@@ -4,6 +4,8 @@ import { scenceList } from '~/pages/tab/index/constant/data'
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import mineServiceApi from '~/api/mineApi/mineService' import mineServiceApi from '~/api/mineApi/mineService'
import mineCustomerApi from '~/api/mineApi/mineCustomer' import mineCustomerApi from '~/api/mineApi/mineCustomer'
import outputApi from '~/api/outputApi/index'
const sceneCodeList = ['SC002', 'SC003', 'SC004', 'SC001']
Page({ Page({
/** /**
...@@ -24,12 +26,33 @@ Page({ ...@@ -24,12 +26,33 @@ Page({
serviceList: [], serviceList: [],
// 场景业务 // 场景业务
scenceList, scenceList,
isConfirm: false isConfirm: false,
baseData: {
proList: []
}
},
getProList(sceneCode) {
let { scenceList } = this.data
var params = {
sceneCode: sceneCode || ''
}
let list = []
outputApi.findProByScene(params).then(res => {
console.log(res)
console.log(this.data.scenceList)
sceneCodeList.forEach(item => {
let target = res.find(k => k.sceneCode == item)
list.push(target)
})
this.setData({
scenceList: list
})
})
}, },
getAllServiceList() { getAllServiceList() {
mineServiceApi.getAllServiceList({}).then(res => { mineServiceApi.getAllServiceList({}).then(res => {
console.log(res)
this.setData({ this.setData({
serviceList: res || [] serviceList: res || []
}) })
...@@ -159,6 +182,7 @@ Page({ ...@@ -159,6 +182,7 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
let { scenceList } = this.data let { scenceList } = this.data
this.getProList()
wx.$router.getData(res => { wx.$router.getData(res => {
let { addOrEdit, target } = res let { addOrEdit, target } = res
this.setData({ this.setData({
......
...@@ -82,25 +82,20 @@ ...@@ -82,25 +82,20 @@
} }
.scene { .scene {
text-align: center;
width: 100%; width: 100%;
font-size: 28rpx;
color: #323436;
} }
.scene-item { .scene-item {
display: flex;
box-sizing: border-box; box-sizing: border-box;
position: relative;
width: 25%;
/* flex: 1; */
background: #F7F8FC; background: #F7F8FC;
margin-right: 4rpx; font-size: 24rpx;
font-size: 18rpx; padding: 8rpx 28rpx;
color: #8A8C90;
/* padding: 32rpx 0 28rpx; */
padding: 24rpx 0 18rpx;
border-radius: 12rpx;
font-weight: 500; font-weight: 500;
border: 2rpx solid #F7F8FC; border: 2rpx solid #F2F3F7;
/* margin-bottom: 20rpx; */ border-radius: 12rpx;
} }
.scene-item:last-child { .scene-item:last-child {
...@@ -115,18 +110,6 @@ ...@@ -115,18 +110,6 @@
height: 22rpx; height: 22rpx;
} }
.scene-title {
width: 100rpx;
font-size: 24rpx;
font-weight: 600;
text-align: center;
color: #323436;
}
.scene-item:nth-child(2) .scene-title {
width: 120rpx;
}
/* 选中 - start */ /* 选中 - start */
.active.scene-item { .active.scene-item {
background-image: linear-gradient(144deg, #F0F7FF 0%, #FFFFFF 73%); background-image: linear-gradient(144deg, #F0F7FF 0%, #FFFFFF 73%);
...@@ -135,32 +118,11 @@ ...@@ -135,32 +118,11 @@
} }
/* 选中 - end */ /* 选中 - end */
.title-box {
height: 68rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 10rpx 0 4rpx;
}
.scene-title.on-open {
color: #8A8C90;
}
.no-open-img {
position: relative;
}
.scene-img { .scene-img {
width: 92rpx; width: 92rpx;
height: 64rpx; height: 64rpx;
} }
.lock-img {
width: 92rpx;
height: 64rpx;
}
/* .notOpened { /* .notOpened {
color: #8A8C90; color: #8A8C90;
} */ } */
\ No newline at end of file \ No newline at end of file
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
<glsx-image src="personal/arrow_right.png" class="arrow_right" /> <glsx-image src="personal/arrow_right.png" class="arrow_right" />
</view> </view>
<view wx:if="{{item.type == 'business'}}"> <view wx:if="{{item.type == 'business'}}">
<view class="flex scene"> <!-- <view class="scene"> -->
<view class="scene-item {{item.isCheck ? 'active' : ''}}" wx:for="{{scenceList}}" wx:key="index" bindtap="handleSceneClick" data-idx="{{index}}" data-scenecode="{{item.sceneCode}}"> <!-- <view class="scene-item {{item.isCheck ? 'active' : ''}}" wx:for="{{scenceList}}" wx:key="index" bindtap="handleSceneClick" data-idx="{{index}}" data-scenecode="{{item.sceneCode}}"> -->
<glsx-image wx:if="{{item.isCheck}}" src="personal/scene-check.png" class="check-icon" /> <view wx:for="{{scenceList}}" wx:key="index" class="scene">
<!-- <glsx-image wx:if="{{item.isCheck}}" src="personal/scene-check.png" class="check-icon" /> -->
<view class="scene-item">
<image webp class="scene-img" src="{{IMGURL}}output/caracticon0{{item.sceneid + 1}}.png?v={{img_version}}"></image> <image webp class="scene-img" src="{{IMGURL}}output/caracticon0{{item.sceneid + 1}}.png?v={{img_version}}"></image>
<view class="title-box"> <view>{{item.name}}</view>
<view class="scene-title">{{item.name}}</view>
</view> </view>
<view wx:for="{{item.productList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
{{subItem.productName}}
</view> </view>
</view> </view>
<!-- </view> -->
</view> </view>
</block> </block>
</view> </view>
......
...@@ -165,9 +165,6 @@ Page({ ...@@ -165,9 +165,6 @@ Page({
getList(isReset = false) { getList(isReset = false) {
let { technicianList, pageCof, total, customerInfo } = this.data let { technicianList, pageCof, total, customerInfo } = this.data
if (total == technicianList.length) {
return true
}
let params = { let params = {
...pageCof, ...pageCof,
merchantId: customerInfo.merchantId merchantId: customerInfo.merchantId
......
...@@ -14,7 +14,8 @@ Page({ ...@@ -14,7 +14,8 @@ Page({
pageCof: { pageCof: {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
} },
isAsk: false
}, },
handleEdit(e) { handleEdit(e) {
...@@ -40,13 +41,17 @@ Page({ ...@@ -40,13 +41,17 @@ Page({
}, },
getList(isReset = false) { getList(isReset = false) {
let { serviceList, pageCof, total } = this.data let { serviceList, pageCof, total, isAsk } = this.data
if (total == serviceList.length) { let _this = this
if (total == serviceList.length || isAsk) {
return true return true
} }
let params = { let params = {
...pageCof ...pageCof
} }
this.setData({
isAsk: true
})
mineServiceApi.getServiceList(params).then(res => { mineServiceApi.getServiceList(params).then(res => {
let { list, total } = res let { list, total } = res
this.setData({ this.setData({
...@@ -60,6 +65,10 @@ Page({ ...@@ -60,6 +65,10 @@ Page({
scrollTop: 0 scrollTop: 0
}) })
} }
}).finally(function () {
_this.setData({
isAsk: false
})
}) })
}, },
......
...@@ -11,13 +11,14 @@ Page({ ...@@ -11,13 +11,14 @@ Page({
bgUrl: `${IMG_URL}/personal/empty_tran.png`, bgUrl: `${IMG_URL}/personal/empty_tran.png`,
popupShow: false, popupShow: false,
staffList: [], staffList: [],
selectInfo: {yqMerchantName: '全部服务中心'}, selectInfo: { yqMerchantName: '全部服务中心' },
total: 0, total: 0,
serviceList: [], serviceList: [],
currentPage: 1, currentPage: 1,
allServiceIds: [], allServiceIds: [],
nothing: false, nothing: false,
scrollTop: 0 scrollTop: 0,
isAsk: false
}, },
/** /**
...@@ -40,7 +41,7 @@ Page({ ...@@ -40,7 +41,7 @@ Page({
// 获取服务中心数据 // 获取服务中心数据
mineApi.getServiceCenterListAPI({}).then(res => { mineApi.getServiceCenterListAPI({}).then(res => {
let data = res || [] let data = res || []
let serviceIds = data.map(val => {return val.yqMerchantId}) let serviceIds = data.map(val => { return val.yqMerchantId })
this.setData({ this.setData({
serviceList: res || [], serviceList: res || [],
allServiceIds: serviceIds, allServiceIds: serviceIds,
...@@ -54,15 +55,19 @@ Page({ ...@@ -54,15 +55,19 @@ Page({
}, },
getList(isReset = false) { getList(isReset = false) {
let { currentPage, selectInfo, allServiceIds, nothing } = this.data let { currentPage, selectInfo, allServiceIds, nothing, isAsk } = this.data
let _this = this
let params = { let params = {
pageSize: 10, pageSize: 10,
pageNum: currentPage, pageNum: currentPage,
merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds merchantNoList: selectInfo?.yqMerchantId ? [selectInfo?.yqMerchantId] : allServiceIds
} }
if (nothing) { if (nothing || isAsk) {
return return
} }
this.setData({
isAsk: true
})
mineApi.getStaffListAPI(params).then(res => { mineApi.getStaffListAPI(params).then(res => {
let tempList = isReset ? res?.list || [] : this.data.staffList.concat(res?.list || []) let tempList = isReset ? res?.list || [] : this.data.staffList.concat(res?.list || [])
this.setData({ this.setData({
...@@ -77,6 +82,10 @@ Page({ ...@@ -77,6 +82,10 @@ Page({
scrollTop: 0 scrollTop: 0
}) })
} }
}).finally(function () {
_this.setData({
isAsk: false
})
}) })
}, },
......
...@@ -704,7 +704,7 @@ const scenceList = [ ...@@ -704,7 +704,7 @@ const scenceList = [
sale: 10000, //销量 sale: 10000, //销量
varType: 1, varType: 1,
flow: 10000, flow: 10000,
"productCode": "PC009", "productCode": "PC011",
"productName": "智能香氛系统", "productName": "智能香氛系统",
"category": "轻改类", "category": "轻改类",
prodImg: `${IMG_URL}index/prod2/prod3-5.png`, prodImg: `${IMG_URL}index/prod2/prod3-5.png`,
......
...@@ -631,7 +631,7 @@ const scenario_3 = [ ...@@ -631,7 +631,7 @@ const scenario_3 = [
sale: 10000, //销量 sale: 10000, //销量
varType: 1, varType: 1,
flow: 10000, flow: 10000,
productCode: 'PC009', productCode: 'PC011',
productName: '智能香氛系统', productName: '智能香氛系统',
category: '轻改类', category: '轻改类',
prodImg: `${IMG_URL}index/prod2/prod3-5.png`, prodImg: `${IMG_URL}index/prod2/prod3-5.png`,
......
...@@ -76,13 +76,13 @@ Component({ ...@@ -76,13 +76,13 @@ Component({
return params return params
}, },
handleInputeClear(e) { // handleInputeClear(e) {
this.setData({ // this.setData({
isInputClear: true, // isInputClear: true,
['formData.userName']: '' // ['formData.userName']: ''
}) // })
console.log(this.data.isInputClear, 'isInputClear---') // console.log(this.data.isInputClear, 'isInputClear---')
}, // },
handleInput(e) { handleInput(e) {
let { attr } = e.currentTarget.dataset let { attr } = e.currentTarget.dataset
...@@ -93,13 +93,13 @@ Component({ ...@@ -93,13 +93,13 @@ Component({
}, },
changeFold() { changeFold() {
let { isInputClear } = this.data // let { isInputClear } = this.data
if (isInputClear) { // if (isInputClear) {
this.setData({ // this.setData({
isInputClear: false // isInputClear: false
}) // })
return true // return true
} // }
this.setData({ this.setData({
isFold: !this.data.isFold isFold: !this.data.isFold
}) })
......
<!--pages/tab/output/components/StaffSort/StaffSort.wxml--> <!--pages/tab/output/components/StaffSort/StaffSort.wxml-->
<view class="total-tab"> <view class="total-tab">
<view wx:if="{{isFold}}" class="tab {{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'active' : ''}}">筛选 <view wx:if="{{isFold}}" class="tab {{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'active' : ''}}">
<glsx-image src="{{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'output/icon-arrow-act.png' : 'output/icon-arrow.png'}}" class="icon" /> {{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? '已选' : '筛选'}}
<glsx-image src="{{(formData.busiIdx != '0' || formData.yqMerchantId || formData.timeIdx != '0') ? 'output/sort.png' : 'output/sort-default.png'}}" class="icon" />
</view> </view>
<scroll-view wx:else scroll-x="{{true}}"> <scroll-view wx:else scroll-x="{{true}}">
<view class="tabs-box"> <view class="tabs-box">
...@@ -25,9 +26,9 @@ ...@@ -25,9 +26,9 @@
<glsx-image src="output/searchIcon.png" class="icon" /> <glsx-image src="output/searchIcon.png" class="icon" />
<input type="text" placeholder="{{isFold ? '请输入员工姓名搜索' : '搜索'}}" maxlength="30" value="{{formData.userName}}" placeholder-class="input-placeholder" data-attr="userName" confirm-type="search" bindinput="handleInput" bindfocus="handleInputFocus" bindblur="handleInputBlur" /> <input type="text" placeholder="{{isFold ? '请输入员工姓名搜索' : '搜索'}}" maxlength="30" value="{{formData.userName}}" placeholder-class="input-placeholder" data-attr="userName" confirm-type="search" bindinput="handleInput" bindfocus="handleInputFocus" bindblur="handleInputBlur" />
</view> </view>
<view wx:if="{{isFold}}" class="icon-delete" bindtap="handleInputeClear" data-attr="userName"> <!-- <view wx:if="{{isFold}}" class="icon-delete" bindtap="handleInputeClear" data-attr="userName">
<glsx-image src="output/icon-delete.png" class="icon" /> <glsx-image src="output/icon-delete.png" class="icon" />
</view> </view> -->
</view> </view>
</view> </view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleServiceChange" selectInfo="{{formData}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" /> <select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleServiceChange" selectInfo="{{formData}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
\ No newline at end of file \ 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!