Commit 4c6a7a9d by 张立顺

Merge branch 'V4.38.1-0422' into 'develop'

上线合并

See merge request !60
2 parents 8c9d2429 da9d39fe
...@@ -51,11 +51,22 @@ const getInviteCode = data => { ...@@ -51,11 +51,22 @@ const getInviteCode = data => {
} }
) )
} }
// 根据4s店或者园区店查询员工信息
const getSetStaffList = data => {
data.routerMethod = 'dj.api.smartcarlife.merchant.staff.list'
return api.post(
{
method: 'scrm.api.boutiquecoupon.rop.router',
...data
}
)
}
export default { export default {
getCustomerList, getCustomerList,
saveCustomer, saveCustomer,
updateCustomer, updateCustomer,
getEmployeeList, getEmployeeList,
getInviteCode getInviteCode,
getSetStaffList
} }
\ No newline at end of file \ No newline at end of file
...@@ -55,7 +55,7 @@ const setLoginInfo = (userInfo, sessionId) => { ...@@ -55,7 +55,7 @@ const setLoginInfo = (userInfo, sessionId) => {
console.log(params); console.log(params);
return wx.navigateToMiniProgram({ return wx.navigateToMiniProgram({
appId: 'wx570d9331f9ace0bd', appId: 'wx570d9331f9ace0bd',
path: `tabWorkOrder/pages/staffDaily/staffDaily` + '?' + params, path: options.page == 'upgradeStaffDaily' ? `tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily?${params}` : `tabWorkOrder/pages/staffDaily/staffDaily?${params}`,
envVersion: 'trial', envVersion: 'trial',
success(res) { success(res) {
// 打开成功 // 打开成功
......
// packagesList/mineDetail/pages/staffManage/selectServicePage.js
import { IMG_URL } from '~/utils/constantData'
Component({
options: {
addGlobalClass: true
},
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function(n) {
if (n) {
let { residentManagerList, selectInfo } = this.data
let activeIndex = residentManagerList.findIndex(v => v.staffUuid == (selectInfo?.staffUuid || selectInfo?.userId))
residentManagerList.forEach((item, ind) => {
item.show = true
if (activeIndex == ind) {
item.act = true
} else {
item.act = false
}
this.setData({
residentManagerList
})
})
this.setData({
searchKeyword: ''
})
}
}
},
residentManagerList: Array,
selectInfo: Object,
tabBarStyle: String
},
/**
* 组件的初始数据
*/
data: {
searchKeyword: '',
bgUrl: `${IMG_URL}/personal/empty_tran.png`,
emptyDataStyle: 'width: 100%; height: 100%;'
},
/**
* 组件的方法列表
*/
methods: {
select(e) {
let { item } = e.currentTarget.dataset
let { residentManagerList } = this.data
residentManagerList.forEach((val, ind) => {
if (item.staffUuid == val.staffUuid) {
val.act = true
} else {
val.act = false
}
})
this.setData({
residentManagerList,
selectInfo: item || {}
})
this.triggerEvent('hiddenResidentManagerConfirm', item)
},
search(e) {
let { residentManagerList } = this.data
let { value } = e.currentTarget.dataset && Object.keys(e.currentTarget.dataset).length ? e.currentTarget.dataset : e.detail
residentManagerList.forEach(item => {
item.act = false
item.show = item.staffName?.includes(value)
})
this.setData({
residentManagerList
})
},
input(e) {
let { value } = e.detail
this.setData({
searchKeyword: value
})
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packagesList/mineDetail/pages/staffManage/selectServicePage.wxss */
.select-service-page{
position: fixed;
top: 0;
z-index: 10;
height: 100vh;
width: 100%;
box-sizing: border-box;
background-color: #ffffff;
animation: show-confirm-box .5s forwards;
.search-content{
height: 108rpx;
background: #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 #b4bacc26;
position: relative;
z-index: inherit;
.search-box {
width: 100%;
height: 104rpx;
padding-left: 32rpx;
display: flex;
align-items: center;
background-color: #fff;
position: sticky;
top: 0;
left: 0;
z-index: 9;
box-sizing: border-box;
.search {
width: 144rpx;
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
display: flex;
align-items: center;
justify-content: center;
.text-center {
font-size: 24rpx;
border-radius: 12rpx;
width: 100%;
font-size: 32rpx;
color: #858A94;
.search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
}
}
.search-input {
background: #F7F8FA;
border-radius: 38rpx;
width: 606rpx;
height: 72rpx;
display: flex;
align-items: center;
padding-left: 26rpx;
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
.search-icon {
width: 28rpx;
height: 28rpx;
}
.search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
}
.input {
font-size: 28rpx;
width: calc(100% - 136rpx);
margin-left: 10rpx;
}
}
}
}
.list{
height: calc(100% - 108rpx);
box-sizing: border-box;
}
.service-items{
width: 100%;
height: 88rpx;
line-height: 88rpx;
background-color: #FFFFFF;
padding: 0 32rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #323233;
}
.service-items.active {
background: #F0F7FF;
color: #3666FE;
}
}
@keyframes show-confirm-box {
0%{
right: -100%;
}
100%{
right: 0;
}
}
\ No newline at end of file \ No newline at end of file
<!--packagesList/mineDetail/pages/staffManage/selectServicePage.wxml-->
<view class="select-service-page" hidden="{{!show}}" style="padding-top: {{tabBarStyle}}px;" catchtouchmove="{{true}}">
<view class="search-content">
<view class="search-box">
<view class="search-input">
<glsx-image src="output/searchIcon.png" class="search-icon" />
<input
type="text"
placeholder="请搜索驻店负责人"
class="input"
value="{{keyword}}"
placeholder-class="input-placeholder"
bindinput="input"
bindconfirm="search" />
<block wx:if="{{keyword}}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<view class="search" bindtap="search" data-value="{{searchKeyword}}">
<view class="text-center">搜索</view>
</view>
</view>
</view>
<scroll-view
scroll-y
scroll-top="{{scrollTop}}"
class="list isFullSucreen"
data-type="message"
wx:if="{{residentManagerList.length}}"
refresher-triggered="{{triggered}}">
<block wx:for="{{residentManagerList}}" wx:key="index">
<view
class="service-items text-hide {{item.act?'active':''}}"
data-item="{{item}}"
hidden="{{!item.show}}"
bindtap="select">
{{item.staffName}}
</view>
</block>
</scroll-view>
<block wx:else>
<nothing-tips tips="暂无数据" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" emptyDataStyle="{{emptyDataStyle}}" />
</block>
</view>
...@@ -31,7 +31,8 @@ Component({ ...@@ -31,7 +31,8 @@ Component({
} }
}, },
serviceList: Array, serviceList: Array,
selectInfo: Object selectInfo: Object,
tabBarStyle: String
}, },
/** /**
......
<!--packagesList/mineDetail/pages/staffManage/selectServicePage.wxml--> <!--packagesList/mineDetail/pages/staffManage/selectServicePage.wxml-->
<view class="select-service-page" hidden="{{!show}}" catchtouchmove="{{true}}"> <view class="select-service-page" hidden="{{!show}}" style="padding-top:{{tabBarStyle}}px;" catchtouchmove="{{true}}">
<view class="search-content"> <view class="search-content">
<view class="search-box"> <view class="search-box">
<view class="search-input"> <view class="search-input">
......
...@@ -35,6 +35,13 @@ const formItems = [{ ...@@ -35,6 +35,13 @@ const formItems = [{
placeholder: '请输入联系人姓名', placeholder: '请输入联系人姓名',
maxlength: 10 maxlength: 10
}, { }, {
label: '驻店负责人',
props: 'residentManagerId',
valueFn: 'residentManagerName',
type: 'select',
placeholder: '请选择驻店负责人',
pageType: 2
}, {
label: '联系电话', label: '联系电话',
props: 'phone', props: 'phone',
type: 'input', type: 'input',
......
...@@ -34,7 +34,16 @@ Page({ ...@@ -34,7 +34,16 @@ Page({
}, },
// 车品牌popup // 车品牌popup
popupShow: false, popupShow: false,
selectedBrandList: [] selectedBrandList: [],
showResidentManagerConfirm: false, // 驻店负责人
residentManagerList: [] // 园区店(所属服务中心)下所有员工数据
},
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
})
}, },
// 地址解析(地址转坐标)https://apis.map.qq.com/ws/geocoder/v1/?address= // 地址解析(地址转坐标)https://apis.map.qq.com/ws/geocoder/v1/?address=
...@@ -214,31 +223,85 @@ Page({ ...@@ -214,31 +223,85 @@ Page({
// 选择服务中心/客户 // 选择服务中心/客户
jump(e) { jump(e) {
let { addOrEdit } = this.data let { addOrEdit, formData } = this.data
if (addOrEdit == 'edit') { let { type } = e.currentTarget.dataset
if (addOrEdit == 'edit' && type == 1) {
return true return true
} }
let { type } = e.currentTarget.dataset // 选择服务中心
switch (type) { if (type == 1) {
// 选择服务中心 this.hiddenSelectConfirm()
case 1: }
this.hiddenSelectConfirm() if (type == 2) {
break if (!formData.serviceCenterMerchantId) return wx.showToast({
title: '请选择服务中心',
icon: 'none',
duration: 2000
})
this.hiddenResidentManagerConfirm()
} }
}, },
// 服务中心 // 服务中心
hiddenSelectConfirm(e) { hiddenSelectConfirm(e) {
let { formData } = this.data
let selectInfo = e?.detail let 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({
selectInfo: selectInfo, 'formData.serviceSelectInfo': selectInfo,
'formData.serviceCenterMerchantId': selectInfo?.yqMerchantId, 'formData.serviceCenterMerchantId': selectInfo?.yqMerchantId,
'formData.serviceCenterMerchantName': selectInfo?.yqMerchantName 'formData.serviceCenterMerchantName': selectInfo?.yqMerchantName
}) })
// 切换所属服务中心 清空驻店负责人
formData.residentManagerId = ''
formData.residentManagerName = ''
formData.residentManagerNum = ''
this.setData({
formData
})
// 获取驻店员工列表
this.getResidentManagerList(selectInfo?.yqMerchantId)
}, },
// 驻店负责人
hiddenResidentManagerConfirm(e) {
let selectInfo = e?.detail
this.setData({ showResidentManagerConfirm: !this.data.showResidentManagerConfirm })
if (!selectInfo) return
this.setData({
'formData.residentSelectInfo': selectInfo,
'formData.residentManagerId': selectInfo?.staffUuid,
'formData.residentManagerName': selectInfo?.staffName,
'formData.residentManagerNum': selectInfo?.staffPhone
})
},
// 返回
back() {
let { showResidentManagerConfirm, showServiceConfirm } = this.data
if (showResidentManagerConfirm || showServiceConfirm) {
this.setData({
showResidentManagerConfirm: false,
showServiceConfirm: false
})
} else {
wx.$router.back()
}
},
// 获取园区店下所有员工
getResidentManagerList(id) {
let { formData } = this.data
let params = {
merchantId: formData.merchantId,
yqMerchantId: id
}
mineCustomerApi.getSetStaffList(params).then(res => {
console.log(res)
this.setData({
residentManagerList: res || []
})
})
},
handleInput(e) { handleInput(e) {
let { attr } = e.currentTarget.dataset let { attr } = e.currentTarget.dataset
let { value } = e.detail let { value } = e.detail
...@@ -296,7 +359,7 @@ Page({ ...@@ -296,7 +359,7 @@ Page({
wx.$api.showToast(validObj.message) wx.$api.showToast(validObj.message)
return return
} }
if(!selectedBrandList.length) { if (!selectedBrandList.length) {
wx.$api.showToast('至少选择一个主营品牌') wx.$api.showToast('至少选择一个主营品牌')
return return
} }
...@@ -339,6 +402,12 @@ Page({ ...@@ -339,6 +402,12 @@ Page({
cityCode: formData.cityCode, cityCode: formData.cityCode,
cityName: formData.cityName, cityName: formData.cityName,
merchantAddress: formData.merchantAddress, merchantAddress: formData.merchantAddress,
residentManager: {
userId: formData.residentManagerId,
userType: 2, // 员工类型默认2
userName: formData.residentManagerName,
userNum: formData.residentManagerNum
}
} }
if (addOrEdit == 'edit') { if (addOrEdit == 'edit') {
params.merchantId = formData.merchantId params.merchantId = formData.merchantId
...@@ -395,11 +464,18 @@ Page({ ...@@ -395,11 +464,18 @@ Page({
let params = { let params = {
merchantId: formData.merchantId merchantId: formData.merchantId
} }
const attrList = [{ name: 'provinceCode' }, { name: 'provinceName' }, { name: 'cityCode' }, { name: 'cityName' }, { name: 'merchantAddress' }, { name: 'latitude', attrName: 'lat' }, { name: 'longitude', attrName: 'lng' }] const attrList = [{ name: 'provinceCode' }, { name: 'provinceName' }, { name: 'cityCode' }, { name: 'cityName' }, { name: 'merchantAddress' }, { name: 'latitude', attrName: 'lat' }, { name: 'longitude', attrName: 'lng' }, { name: 'residentManagerId', attrName: 'userId', obj: 'residentManager' }, { name: 'residentManagerName', attrName: 'userName', obj: 'residentManager' }, { name: 'residentManagerNum', attrName: 'userNum', obj: 'residentManager' }]
mineServiceApi.getMerchantInfo(params).then(res => { mineServiceApi.getMerchantInfo(params).then(res => {
attrList.forEach(item => { attrList.forEach(item => {
formData[item.name] = res[item.attrName || item.name] formData[item.name] = item?.obj ? res[item.obj]?.[item.attrName] : res[item.attrName || item.name]
}) })
// 有所属服务中心 获取所有员工(园区店下)
if (formData?.serviceCenterMerchantId) this.getResidentManagerList(formData.serviceCenterMerchantId)
if (res.residentManager?.userId) {
this.setData({
'formData.residentSelectInfo': res.residentManager,
})
}
this.setData({ this.setData({
formData, formData,
selectedBrandList: this.infoToBrandList(res.brandTreeList || []), selectedBrandList: this.infoToBrandList(res.brandTreeList || []),
...@@ -424,7 +500,7 @@ Page({ ...@@ -424,7 +500,7 @@ Page({
} }
}) })
if (addOrEdit == 'edit') { if (addOrEdit == 'edit') {
wx.setNavigationBarTitle({ title: '编辑客户' }) // wx.setNavigationBarTitle({ title: '编辑客户' })
scenceList.forEach(item => { scenceList.forEach(item => {
item.isCheck = target.sceneList?.findIndex(k => k == item.sceneCode) != -1 item.isCheck = target.sceneList?.findIndex(k => k == item.sceneCode) != -1
}) })
......
{ {
"navigationBarTitleText": "创建客户", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"select-service-confirm": "../../../components/selectServiceConfirm/selectServiceConfirm", "select-service-confirm": "../../../components/selectServiceConfirm/selectServiceConfirm",
"car-brand": "../../../components/CarBrand/CarBrand" "car-brand": "../../../components/CarBrand/CarBrand",
"select-resident-manager-confirm": "../../../components/selectResidentManagerConfirm/selectResidentManagerConfirm"
} }
} }
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/customerManagement/editCustomer/editCustomer.wxml--> <!--packageMine/pages/customerManagement/editCustomer/editCustomer.wxml-->
<navigation-bar bindnavbarReady="navbarReady" showBack="{{true}}" bindback="back" customBack="{{true}}">
{{showResidentManagerConfirm ? '选择驻店负责人' : showServiceConfirm ? '选择服务中心' : addOrEdit == 'edit' ? '编辑客户' : '创建客户'}}
</navigation-bar>
<view class="create-service-page" style="padding-top:{{tabBarStyle}}px;"> <view class="create-service-page" style="padding-top:{{tabBarStyle}}px;">
<view class="tips" wx:if="{{addOrEdit == 'add'}}">请完善客户资料完成创建:</view> <view class="tips" wx:if="{{addOrEdit == 'add'}}">请完善客户资料完成创建:</view>
<view class="form-content"> <view class="form-content">
...@@ -7,7 +10,7 @@ ...@@ -7,7 +10,7 @@
<view class="input-box" wx:if="{{item.type == 'input'}}"> <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" /> <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>
<view class="select-box {{addOrEdit == 'edit' ? 'disabled' : ''}}" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}"> <view class="select-box {{addOrEdit == 'edit' && item.pageType == 1 ? '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="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view>
<view class="placeholder-text" wx:else>{{item.placeholder}}</view> <view class="placeholder-text" wx:else>{{item.placeholder}}</view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" /> <glsx-image src="personal/arrow_right.png" class="arrow_right" />
...@@ -85,7 +88,10 @@ ...@@ -85,7 +88,10 @@
<view class="btn-blue" bindtap="handleConfirm">{{addOrEdit == 'add' ? '提交' : '保存'}}</view> <view class="btn-blue" bindtap="handleConfirm">{{addOrEdit == 'add' ? '提交' : '保存'}}</view>
</view> </view>
</view> </view>
<select-service-confirm show="{{showServiceConfirm}}" tabBarStyle="{{tabBarStyle}}" serviceList="{{serviceList}}" selectInfo="{{formData.selectInfo}}" bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm> <!-- 服务中心 -->
<select-service-confirm wx:if="{{showServiceConfirm}}" show="{{showServiceConfirm}}" tabBarStyle="{{tabBarStyle}}" serviceList="{{serviceList}}" selectInfo="{{formData.serviceSelectInfo}}" bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm>
<!-- 驻店负责人 -->
<select-resident-manager-confirm wx:if="{{showResidentManagerConfirm}}" show="{{showResidentManagerConfirm}}" tabBarStyle="{{tabBarStyle}}" residentManagerList="{{residentManagerList}}" selectInfo="{{formData.residentSelectInfo}}" bind:hiddenResidentManagerConfirm="hiddenResidentManagerConfirm"/>
<!-- 车品牌 --> <!-- 车品牌 -->
<popup show="{{popupShow}}" bind:hidePopup="hideBrandPopup" bindconfirm="brandConfirm" height="95%"> <popup show="{{popupShow}}" bind:hidePopup="hideBrandPopup" bindconfirm="brandConfirm" height="95%">
<car-brand id="car-brand" popupShow="{{popupShow}}" selectedList="{{selectedBrandList}}"></car-brand> <car-brand id="car-brand" popupShow="{{popupShow}}" selectedList="{{selectedBrandList}}"></car-brand>
......
...@@ -29,7 +29,7 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -29,7 +29,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false const manual = false
const release = false const release = false
let index = 2 let index = 3
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!