Commit 07f54d5d by zhangxw

Merge branch 'saas+v4.18.0_0330' of http://192.168.3.233:8090/saas_plus/business…

…-assistant into zhangxw_dev_v4.18.0_0330
2 parents b4fd6526 51036d15
......@@ -16,7 +16,8 @@ const saveCustomer = data => {
{
method: 'scrm.api.busassistant.merchantCustomer.save',
...data
}
},
true
)
}
......@@ -26,7 +27,8 @@ const updateCustomer = data => {
{
method: 'scrm.api.busassistant.merchantCustomer.update',
...data
}
},
true
)
}
......
......@@ -26,7 +26,8 @@ const saveService = data => {
{
method: 'scrm.api.busassistant.serviceCenter.save',
...data
}
},
true
)
}
......@@ -36,7 +37,8 @@ const updateService = data => {
{
method: 'scrm.api.busassistant.serviceCenter.update',
...data
}
},
true
)
}
......
// packageMine/pages/customerManagement/customerList/customerList.js
import { IMG_URL } from '~/utils/constantData'
import mineCustomerApi from '~/api/mineApi/mineCustomer'
import mineApi from '~/api/mineApi/index'
Page({
/**
......@@ -10,9 +11,11 @@ Page({
IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
selectInfo: {
serviceName: '全部服务中心'
yqMerchantName: '全部服务中心'
},
popupShow: false,
serviceList: [],
allServiceIds: [],
customerList: [],
total: -1,
pageCof: {
......@@ -43,21 +46,24 @@ Page({
wx.$router.go('packageMine.editCustomer', params)
},
handleSearch() {
handleSearch(e) {
wx.$api.hideLoading()
this.setData({
selectInfo: e.detail,
total: -1,
['pageCof.pageNum']: 1,
total: -1
})
this.getList()
this.getList(true)
},
getList() {
let { customerList, pageCof, total } = this.data
getList(isReset = false) {
let { customerList, pageCof, total, selectInfo } = this.data
if (total == customerList.length) {
return true
}
let params = {
...pageCof
...pageCof,
serviceCenterMerchantId: selectInfo?.yqMerchantId || ''
}
mineCustomerApi.getCustomerList(params).then(res => {
let { list, total } = res
......@@ -67,6 +73,26 @@ Page({
triggered: false,
total
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
})
},
// 获取服务中心数据
getServiceList() {
mineApi.getServiceCenterListAPI({}).then(res => {
let data = res || []
let serviceIds = data.map(val => { return val.yqMerchantId })
this.setData({
serviceList: res || [],
allServiceIds: serviceIds,
['pageCof.pageNum']: 1,
total: -1
})
this.getList(true)
})
},
......@@ -88,7 +114,11 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.getList()
this.setData({
total: -1,
['pageCof.pageNum']: 1,
})
this.getServiceList(true)
},
/**
......
......@@ -5,17 +5,18 @@
<glsx-image src="index/apply.png" class="icon" />
<text>创建新客户</text>
</view>
<view class="content-box" wx:if="{{customerList.length}}">
<view class="content-box">
<view class="title-box">
<view class="title">客户数量:<text class="number">{{total < 0 ? 0 : total}}</text></view>
<view class="title">客户数量:<text class="number">{{total < 0 ? 0 : total}}</text>
</view>
<view class="select-btn">
<view class="type" bindtap="filterTypeFn">
<text>{{selectInfo.serviceName}}</text>
<text>{{selectInfo.yqMerchantName}}</text>
<glsx-image class="point" src="index/point.png" />
</view>
</view>
</view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="getList" class="list" style="height:calc(100vh - 148rpx - 110rpx);" refresher-threshold="104" refresher-triggered="{{triggered}}">
<scroll-view wx:if="{{customerList.length}}" scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="getList" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{customerList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}">
<view class="top">
<view class="message">
......@@ -52,8 +53,8 @@
</scroll-view>
</view>
<view wx:else>
<view wx:if="{{!customerList.length}}">
<nothing-tips tips="暂无客户~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="getCustomerList" selectInfo="{{selectInfo}}" popShow="{{popupShow}}" merchantRange="{{staffList}}" />
\ No newline at end of file
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="handleSearch" selectInfo="{{selectInfo}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
\ No newline at end of file
......@@ -45,7 +45,7 @@ Page({
// 选择服务中心/客户
jump(e) {
let { addOrEdit } = this.data
if(addOrEdit == 'edit') {
if (addOrEdit == 'edit') {
return true
}
let { type } = e.currentTarget.dataset
......@@ -112,13 +112,18 @@ Page({
if (res.confirm) {
// 创建/编辑接口
mineCustomerApi[apiNameObj[addOrEdit]](formData).then(res => {
if (addOrEdit == 'add') {
wx.$router.redirectTo('packageMine.successPage?page=customer')
let { code, message } = res
if (code == '0') {
if (addOrEdit == 'add') {
wx.$router.redirectTo('packageMine.successPage?page=customer')
} else {
wx.$api.showToast('修改成功')
setTimeout(() => {
wx.$router.reLaunch('packageMine.customerList')
}, 1000)
}
} else {
wx.$api.showToast('修改成功')
setTimeout(() => {
wx.$router.reLaunch('packageMine.customerList')
}, 1000)
wx.$api.showToast(message)
}
})
}
......
......@@ -52,6 +52,10 @@
white-space: nowrap;
}
}
.disabled {
background: #E1E2E6;
}
}
.btn {
......
......@@ -7,7 +7,7 @@
<view class="input-box" wx:if="{{item.type == 'input'}}">
<input type="text" placeholder="{{item.placeholder || '请输入' + item.label}}" maxlength="{{item.maxlength}}" class="input" value="{{formData[item.props]}}" type="{{item.inputType || 'text'}}" password="{{item.password}}" placeholder-class="input-placeholder" data-attr="{{item.props}}" bindinput="handleInput" />
</view>
<view class="select-box" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}">
<view class="select-box {{addOrEdit == 'edit' ? 'disabled' : ''}}" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}">
<view class="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view>
<view class="placeholder-text" wx:else>{{item.placeholder}}</view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
......
......@@ -44,13 +44,23 @@ Page({
this.getInviteCode()
},
getList() {
handleSeach() {
this.getList(true)
},
getList(isReset = false) {
let { customerInfo } = this.data
mineCustomerApi.getEmployeeList({ merchantId: customerInfo.merchantId }).then(res => {
console.log(res)
this.setData({
saleList: res
saleList: res,
triggered: false
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
})
},
......@@ -74,7 +84,7 @@ Page({
})
let params = {
merchantId: customerInfo.serviceCenterMerchantId,
staffLabels: sceneStr
staffLabel: sceneStr
}
mineCustomerApi.getInviteCode(params).then(res => {
this.setData({
......
......@@ -8,11 +8,12 @@
<view class="title-box">
<view class="title">销售顾问:<text class="number">{{saleList.length}}</text></view>
</view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="search" bindscrolltolower="onBottomRefresh" class="list" style="height:calc(100vh - 148rpx - 110rpx);" refresher-threshold="104" refresher-triggered="{{triggered}}">
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSeach" class="list" style="height:calc(100vh - 148rpx - 110rpx);" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{saleList}}" wx:key="index">
<view class="top">
<view class="message">
<glsx-image src="personal/staff_defalut_avatar.png" class="avatar" />
<image wx:if="{{item.weChatAvatarUrl}}" src="{{item.weChatAvatarUrl}}" class="avatar" />
<glsx-image wx:else src="personal/staff_defalut_avatar.png" class="avatar" />
<view class="message-text">
<view class="merchant">{{item.merchantName}}</view>
<view class="contact">{{item.contactName}} {{item.phone}}</view>
......
......@@ -43,14 +43,18 @@ Page({
if (res.confirm) {
// 创建/编辑接口
mineServiceApi[apiNameObj[addOrEdit]](formData).then(res => {
console.log(res, 'res---')
if (addOrEdit == 'add') {
wx.$router.redirectTo('packageMine.successPage?page=service')
let { code, message } = res
if (code == '0') {
if (addOrEdit == 'add') {
wx.$router.redirectTo('packageMine.successPage?page=service')
} else {
wx.$api.showToast('修改成功')
setTimeout(() => {
wx.$router.reLaunch('packageMine.serviceList')
}, 1000)
}
} else {
wx.$api.showToast('修改成功')
setTimeout(() => {
wx.$router.reLaunch('packageMine.serviceList')
}, 1000)
wx.$api.showToast(message)
}
})
}
......
......@@ -37,7 +37,7 @@
color: #323436;
}
.input-disabled {
.disabled {
background: #E1E2E6;
}
......
......@@ -7,7 +7,7 @@
<view class="form-content">
<block wx:for="{{formItems}}" wx:key="index">
<view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view>
<view class="input-box {{item.disabled ? 'input-disabled' : ''}}" wx:if="{{item.type == 'input'}}">
<view class="input-box {{item.disabled ? 'disabled' : ''}}" wx:if="{{item.type == 'input'}}">
<input placeholder="{{item.placeholder || '请输入' + item.label}}" maxlength="{{item.maxlength}}" class="input" value="{{formData[item.props]}}" type="{{item.inputType || 'text'}}" password="{{item.password}}" disabled="{{item.disabled}}" placeholder-class="input-placeholder" data-attr="{{item.props}}" bindinput="handleInput" />
</view>
<view class="select-box" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}">
......
......@@ -32,10 +32,10 @@ Page({
['pageCof.pageNum']: 1,
total: -1
})
this.getList()
this.getList(true)
},
getList() {
getList(isReset = false) {
let { serviceList, pageCof, total } = this.data
if (total == serviceList.length) {
return true
......@@ -51,6 +51,11 @@ Page({
triggered: false,
total
})
if (isReset) {
this.setData({
scrollTop: 0
})
}
})
},
......@@ -72,7 +77,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.getList()
this.handleSearch()
},
/**
......
......@@ -8,7 +8,7 @@
<view class="title-box">
<view class="title">服务中心数量:<text class="number">{{total < 0 ? 0 : total}}</text></view>
</view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="getList" class="list" style="height:calc(100vh - 148rpx - 110rpx);" refresher-threshold="104" refresher-triggered="{{triggered}}">
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="handleSearch" bindscrolltolower="getList" class="list" style="height:calc(100vh - 148rpx - 110rpx);" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{serviceList}}" wx:key="index" bindtap="handleEdit" data-type="edit" data-target="{{item}}">
<view class="top">
<view class="message">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!