Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b6aa6829
authored
Mar 22, 2023
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
部分联调
1 parent
19d169bd
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
246 additions
and
212 deletions
api/mineApi/mine.js
components/NavigationBar/NavigationBar.wxml
packageMine/components/selectServiceConfirm/selectServiceConfirm.js
packageMine/components/selectServiceConfirm/selectServiceConfirm.wxml
packageMine/components/selectServicePopup/selectServicePopup.js
packageMine/components/selectServicePopup/selectServicePopup.wxml
packageMine/pages/staffManage/createStaff/constant/data.js
packageMine/pages/staffManage/createStaff/createStaff.js
packageMine/pages/staffManage/createStaff/createStaff.wxml
packageMine/pages/staffManage/selectConnectionPage/selectConnectionPage.js
packageMine/pages/staffManage/staffList/staffList.js
packageMine/pages/staffManage/staffList/staffList.wxml
pages/tab/mine/mine.js
utils/request/environment.js
utils/request/request.js
api/mineApi/mine.js
View file @
b6aa682
...
...
@@ -46,5 +46,42 @@ class mineApi {
// true
)
}
// 获取服务中心下拉筛选 所有服务商数据
getServiceCenterListAPI
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.busassistant.serviceCenter.listByServiceMerchantId'
,
...
data
}
)
}
// 获取员工列表
getStaffListAPI
(
data
)
{
return
api
.
post
(
{
method
:
'merchants.api.open.serviceCenter.searchStaffPage'
,
...
data
}
)
}
// 创建员工
createStaffAPI
(
data
)
{
return
api
.
post
(
{
method
:
'merchants.api.open.serviceCenter.createStaff'
,
...
data
}
)
}
// 更新员工
updateStaffAPI
(
data
)
{
return
api
.
post
(
{
method
:
'merchants.api.open.serviceCenter.updateStaff'
,
...
data
}
)
}
}
export
default
mineApi
components/NavigationBar/NavigationBar.wxml
View file @
b6aa682
<view class="navigation-bar" id="navigation-bar" style="padding-top:{{statusBarHeight}}px;height:{{navigationBarHeight}}px;{{navStyle}}">
<block wx:if="{{!custom}}">
<view class="navigation-bar-box" wx:if="{{showNavBar}}" style="{{navigationBarStyle}}">
<block wx:if="{{SHOWBACK
|| customBack
}}">
<block wx:if="{{SHOWBACK}}">
<view class="back " bindtap="back">
<image class="img" src="./images/icon-back.png" />
</view>
...
...
packageMine/components/selectServiceConfirm/selectServiceConfirm.js
View file @
b6aa682
...
...
@@ -7,7 +7,30 @@ Component({
* 组件的属性列表
*/
properties
:
{
show
:
Boolean
,
show
:
{
type
:
Boolean
,
observer
:
function
(
n
)
{
if
(
n
)
{
let
{
serviceList
,
selectInfo
}
=
this
.
data
console
.
log
(
serviceList
)
let
activeIndex
=
serviceList
.
findIndex
(
v
=>
v
.
yqMerchantId
==
selectInfo
?.
yqMerchantId
)
serviceList
.
forEach
((
item
,
ind
)
=>
{
item
.
show
=
true
if
(
activeIndex
==
ind
)
{
item
.
act
=
true
}
else
{
item
.
act
=
false
}
this
.
setData
({
serviceList
})
})
this
.
setData
({
searchKeyword
:
''
})
}
}
},
serviceList
:
Array
,
selectInfo
:
Object
,
tabBarStyle
:
String
...
...
@@ -17,6 +40,7 @@ Component({
* 组件的初始数据
*/
data
:
{
searchKeyword
:
''
},
/**
* 组件的方法列表
...
...
@@ -26,7 +50,7 @@ Component({
let
{
item
}
=
e
.
currentTarget
.
dataset
let
{
serviceList
}
=
this
.
data
serviceList
.
forEach
((
val
,
ind
)
=>
{
if
(
item
.
serviceCode
==
val
.
serviceCode
)
{
if
(
item
.
yqMerchantId
==
val
.
yqMerchantId
)
{
val
.
act
=
true
}
else
{
val
.
act
=
false
...
...
@@ -38,16 +62,22 @@ Component({
})
this
.
triggerEvent
(
'hiddenSelectConfirm'
,
item
)
},
input
(
e
)
{
search
(
e
)
{
let
{
serviceList
}
=
this
.
data
let
{
value
}
=
e
.
detail
let
{
value
}
=
e
.
currentTarget
.
dataset
&&
Object
.
keys
(
e
.
currentTarget
.
dataset
).
length
?
e
.
currentTarget
.
dataset
:
e
.
detail
serviceList
.
forEach
(
item
=>
{
item
.
act
=
false
item
.
show
=
item
.
serviceCod
e
?.
includes
(
value
)
item
.
show
=
item
.
yqMerchantNam
e
?.
includes
(
value
)
})
this
.
setData
({
serviceList
})
},
input
(
e
)
{
let
{
value
}
=
e
.
detail
this
.
setData
({
searchKeyword
:
value
})
}
}
})
\ No newline at end of file
packageMine/components/selectServiceConfirm/selectServiceConfirm.wxml
View file @
b6aa682
...
...
@@ -16,7 +16,7 @@
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<view class="search" bindtap="s
howConfirm
">
<view class="search" bindtap="s
earch" data-value="{{searchKeyword}}
">
<view class="text-center">搜索</view>
</view>
</view>
...
...
@@ -36,8 +36,9 @@
<view
class="service-items text-hide {{item.act?'active':''}}"
data-item="{{item}}"
hidden="{{!item.show}}"
bindtap="select">
{{item.
service
Name}}
{{item.
yqMerchant
Name}}
</view>
</block>
</scroll-view>
...
...
packageMine/components/selectServicePopup/selectServicePopup.js
View file @
b6aa682
// pages/tab/output/components/accountSwitchingPop/accountSwitchingPop.js
import
{
IMG_URL
}
from
'~/utils/constantData.js'
import
USERAPI
from
'~/api/usersApi/index'
import
{
setUserInfo
}
from
'~/utils/cache/storageApi'
Component
({
options
:
{
addGlobalClass
:
true
...
...
@@ -15,22 +13,26 @@ Component({
value
:
false
,
observer
:
function
(
n
)
{
if
(
n
)
{
let
{
merchantRange
,
selectInfo
}
=
this
.
data
let
activeIndex
=
merchantRange
.
findIndex
(
v
=>
v
.
serviceCode
==
selectInfo
.
serviceCode
)
merchantRange
.
forEach
((
item
,
ind
)
=>
{
let
{
serviceRange
,
selectInfo
}
=
this
.
data
let
activeIndex
=
serviceRange
.
findIndex
(
v
=>
v
.
yqMerchantId
==
selectInfo
.
yqMerchantId
)
serviceRange
.
forEach
((
item
,
ind
)
=>
{
item
.
show
=
true
if
(
activeIndex
==
ind
)
{
item
.
act
=
true
}
else
{
item
.
act
=
false
}
this
.
setData
({
merchant
Range
service
Range
})
})
this
.
setData
({
searchKeyword
:
''
})
}
}
},
merchant
Range
:
Object
,
service
Range
:
Object
,
selectInfo
:
Object
},
...
...
@@ -39,12 +41,13 @@ Component({
*/
data
:
{
IMG_URL
,
merchantList
:
[]
serviceList
:
[],
searchKeyword
:
''
},
observers
:
{
merchant
Range
:
function
(
e
)
{
service
Range
:
function
(
e
)
{
this
.
setData
({
merchant
List
:
e
service
List
:
e
})
}
},
...
...
@@ -56,8 +59,8 @@ Component({
this
.
triggerEvent
(
'hidePopup'
)
},
confirm
()
{
let
{
merchant
Range
,
subIndex
}
=
this
.
data
let
actObj
=
merchant
Range
.
find
((
item
,
index
)
=>
{
let
{
service
Range
,
subIndex
}
=
this
.
data
let
actObj
=
service
Range
.
find
((
item
,
index
)
=>
{
if
(
item
.
act
)
{
subIndex
=
index
}
...
...
@@ -81,28 +84,33 @@ Component({
},
select
(
e
)
{
let
{
index
}
=
e
.
currentTarget
.
dataset
let
{
merchant
Range
}
=
this
.
data
merchant
Range
.
forEach
((
item
,
ind
)
=>
{
let
{
service
Range
}
=
this
.
data
service
Range
.
forEach
((
item
,
ind
)
=>
{
if
(
index
==
ind
)
{
item
.
act
=
true
}
else
{
item
.
act
=
false
}
this
.
setData
({
merchant
Range
service
Range
})
})
},
input
(
e
)
{
let
{
merchant
Range
}
=
this
.
data
let
{
value
}
=
e
.
detail
merchant
Range
.
forEach
(
item
=>
{
search
(
e
)
{
let
{
service
Range
}
=
this
.
data
let
{
value
}
=
e
.
currentTarget
.
dataset
&&
Object
.
keys
(
e
.
currentTarget
.
dataset
).
length
?
e
.
currentTarget
.
dataset
:
e
.
detail
service
Range
.
forEach
(
item
=>
{
item
.
act
=
false
item
.
show
=
item
.
serviceCode
?.
includes
(
value
)
// = show
item
.
show
=
item
.
yqMerchantName
?.
includes
(
value
)
})
this
.
setData
({
serviceRange
})
},
input
(
e
)
{
let
{
value
}
=
e
.
detail
this
.
setData
({
merchantRang
e
searchKeyword
:
valu
e
})
}
}
...
...
packageMine/components/selectServicePopup/selectServicePopup.wxml
View file @
b6aa682
...
...
@@ -19,7 +19,7 @@
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<view class="search text-center" bindtap="s
howConfirm
">
<view class="search text-center" bindtap="s
earch" data-value="{{searchKeyword}}
">
<view class="text-center">搜索</view>
</view>
</view>
...
...
@@ -34,12 +34,13 @@
style="height:100%;"
data-type="message"
refresher-triggered="{{triggered}}">
<block wx:for="{{
merchant
List}}" wx:key="index">
<block wx:for="{{
service
List}}" wx:key="index">
<view
class="itemCon text-hide {{item.act?'active':''}}"
data-index="{{index}}"
hidden="{{!item.show}}"
bindtap="select">
{{item.
service
Name}}
{{item.
yqMerchant
Name}}
</view>
</block>
</scroll-view>
...
...
packageMine/pages/staffManage/createStaff/constant/data.js
View file @
b6aa682
const
phoneRex
=
/^
[
1
]([
3-9
])[
0-9
]{9}
$/
const
formRule
=
{
select
Service
Info
:
[{
required
:
true
,
message
:
'所属服务中心不能为空'
}],
selectInfo
:
[{
required
:
true
,
message
:
'所属服务中心不能为空'
}],
staffName
:
[{
required
:
true
,
message
:
'员工姓名不能为空'
}],
staff
Mobil
e
:
[
staff
Phon
e
:
[
{
required
:
true
,
message
:
'手机号码不能为空'
},
{
validator
:
(
rule
,
value
)
=>
{
...
...
@@ -14,7 +14,7 @@ const formRule = {
const
formItems
=
[{
label
:
'所属服务中心'
,
props
:
'select
Service
Info'
,
props
:
'selectInfo'
,
valueFn
:
'serviceValue'
,
type
:
'select'
,
placeholder
:
'请选择服务中心'
,
...
...
@@ -28,7 +28,7 @@ const formItems = [{
},
{
label
:
'手机号码'
,
tips
:
'(登录凭证)'
,
props
:
'staff
Mobil
e'
,
props
:
'staff
Phon
e'
,
type
:
'input'
,
placeholder
:
'请输入手机号码'
,
maxLength
:
11
...
...
packageMine/pages/staffManage/createStaff/createStaff.js
View file @
b6aa682
// packagesList/mineDetail/pages/staffManage/createStaff/createStaff.js
import
constantData
from
'./constant/data'
import
{
behavior
as
computedBehavior
}
from
"~/utils/lib/miniprogram-computed"
import
mineApi
from
'~/api/mineApi/index'
Page
({
behaviors
:
[
computedBehavior
],
...
...
@@ -9,73 +10,7 @@ Page({
*/
data
:
{
addOrEdit
:
'add'
,
serviceList
:
[{
serviceCode
:
1
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
2
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
3
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
4
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
5
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
6
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
7
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
8
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
9
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
10
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
11
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
}],
serviceList
:
[],
formItems
:
constantData
.
formItems
,
formData
:
{
selectedConnectionList
:
[],
...
...
@@ -85,7 +20,7 @@ Page({
},
watch
:
{
'formData.select
ServiceInfo.serviceCode
'
:
function
(
e
)
{
'formData.select
Info.yqMerchantId
'
:
function
(
e
)
{
// 将可见客户置为全部
this
.
setData
({
'formData.connectionValue'
:
'全部'
,
...
...
@@ -98,11 +33,12 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
// 获取服务中心/客户数据
this
.
getSelectList
()
},
onRoute
(
options
)
{
// 选择可见客户回退
console
.
log
(
constantData
)
if
(
!
options
.
info
)
return
this
.
setData
({
addOrEdit
:
options
?.
info
?
'edit'
:
'add'
,
...
...
@@ -131,6 +67,18 @@ Page({
})
},
getSelectList
()
{
// 获取服务中心
mineApi
.
getServiceCenterListAPI
({}).
then
(
res
=>
{
let
data
=
res
||
[]
this
.
setData
({
serviceList
:
data
})
})
// 获取全部客户
},
back
()
{
let
{
showServiceConfirm
}
=
this
.
data
if
(
showServiceConfirm
){
...
...
@@ -150,18 +98,19 @@ Page({
this
.
hiddenSelectConfirm
()
break
case
2
:
if
(
!
formData
.
select
Service
Info
)
return
wx
.
$api
.
showToast
(
'请先选择所属服务中心'
)
if
(
!
formData
.
selectInfo
)
return
wx
.
$api
.
showToast
(
'请先选择所属服务中心'
)
wx
.
$router
.
go
(
'packageMine.selectConnectionPage'
,
this
.
data
.
formData
)
break
}
},
hiddenSelectConfirm
(
e
)
{
let
select
Service
Info
=
e
?.
detail
let
selectInfo
=
e
?.
detail
this
.
setData
({
showServiceConfirm
:
!
this
.
data
.
showServiceConfirm
})
if
(
!
select
Service
Info
)
return
if
(
!
selectInfo
)
return
this
.
setData
({
'formData.select
ServiceInfo'
:
selectService
Info
,
'formData.serviceValue'
:
select
ServiceInfo
?.
service
Name
'formData.select
Info'
:
select
Info
,
'formData.serviceValue'
:
select
Info
?.
yqMerchant
Name
})
},
...
...
@@ -177,10 +126,18 @@ Page({
handleConfirm
()
{
let
{
addOrEdit
,
formData
}
=
this
.
data
let
validObj
=
wx
.
$util
.
checkRule
(
formData
,
constantData
.
formRule
)
// if (validObj) {
// wx.$api.showToast(validObj.message)
// return
// }
if
(
validObj
)
{
wx
.
$api
.
showToast
(
validObj
.
message
)
return
}
let
params
=
{
merchantNo
:
formData
?.
selectInfo
?.
yqMerchantId
,
staffUuid
:
''
,
staffName
:
formData
?.
staffName
,
staffPhone
:
formData
?.
staffPhone
,
createdSource
:
3
,
// 创建来源 固定3 生意助手
visibleMerchantNoList
:
[]
}
let
message
=
addOrEdit
==
'add'
?
'是否确定创建员工?'
:
'是否确定修改员工信息?'
wx
.
showModal
({
title
:
'提示'
,
...
...
@@ -191,11 +148,14 @@ Page({
success
(
res
)
{
if
(
res
.
confirm
)
{
// 创建/编辑接口
if
(
addOrEdit
==
'add'
)
{
wx
.
$router
.
redirectTo
(
'packageMine.successPage'
)
}
else
{
wx
.
$router
.
back
()
}
let
requestEvent
=
addOrEdit
==
'add'
?
'createStaffAPI'
:
'updateStaffAPI'
mineApi
[
requestEvent
](
params
).
then
(
res
=>
{
if
(
addOrEdit
==
'add'
)
{
wx
.
$router
.
redirectTo
(
'packageMine.successPage'
)
}
else
{
wx
.
$router
.
back
()
}
})
}
}
})
...
...
packageMine/pages/staffManage/createStaff/createStaff.wxml
View file @
b6aa682
...
...
@@ -29,4 +29,4 @@
<view class="btn-blue" bindtap="handleConfirm">{{addOrEdit == 'add' ? '提交' : '保存'}}</view>
</view>
</view>
<select-service-confirm show="{{showServiceConfirm}}" tabBarStyle="{{tabBarStyle}}" serviceList="{{serviceList}}" bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm>
<select-service-confirm show="{{showServiceConfirm}}" tabBarStyle="{{tabBarStyle}}" serviceList="{{serviceList}}"
selectInfo="{{formData.selectInfo}}"
bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm>
packageMine/pages/staffManage/selectConnectionPage/selectConnectionPage.js
View file @
b6aa682
...
...
@@ -224,7 +224,7 @@ Page({
let
prevPage
=
currentPages
[
currentPages
.
length
-
2
]
prevPage
.
setData
({
'formData.connectionValue'
:
arr
.
find
(
v
=>
v
.
active
&&
v
.
type
==
0
)
?
'全部'
:
`已选择
${
selectedConnectionList
?.
length
}
位客户
`,
'formData.selectedConnectionList': selectedConnectionList
'formData.selectedConnectionList':
arr.find(v => v.active && v.type == 0) ? [] :
selectedConnectionList
})
this.back()
},
...
...
packageMine/pages/staffManage/staffList/staffList.js
View file @
b6aa682
// packagesList/mineDetail/pages/staffManage/staffManage.js
import
{
IMG_URL
}
from
'~/utils/constantData'
import
mineApi
from
'~/api/mineApi/index'
Page
({
/**
...
...
@@ -9,82 +10,27 @@ Page({
IMG_URL
,
bgUrl
:
`
${
IMG_URL
}
/personal/empty_tran.png`
,
popupShow
:
false
,
staffList
:
[{
serviceCode
:
1
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
2
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
3
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
4
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
5
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
6
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
7
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
8
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
9
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
10
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
},
{
serviceCode
:
11
,
staffName
:
'马保国'
,
staffMobile
:
'13645674567'
,
serviceName
:
'广东嘀加八号快乐酷爱咖哩鸡服务中心咖哩鸡服务中心咖哩鸡服务中心'
,
time
:
'2022.10.03'
}],
selectInfo
:
{
serviceName
:
'全部服务中心'
},
total
:
15
staffList
:
[],
selectInfo
:
{
yqMerchantName
:
'全部服务中心'
},
total
:
15
,
serviceList
:
[],
currentPage
:
1
,
allServiceIds
:
[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
// 获取服务中心数据
mineApi
.
getServiceCenterListAPI
({}).
then
(
res
=>
{
let
data
=
res
||
[]
let
serviceIds
=
data
.
map
(
val
=>
{
return
val
.
yqMerchantId
})
this
.
setData
({
serviceList
:
res
||
[],
allServiceIds
:
serviceIds
})
})
},
/**
...
...
@@ -98,7 +44,42 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow
()
{
// 获取员工列表
this
.
getList
(
true
)
},
getList
(
isReset
=
false
)
{
let
{
currentPage
,
selectInfo
,
allServiceIds
}
=
this
.
data
let
params
=
{
pageSize
:
10
,
pageNum
:
currentPage
,
merchantNoList
:
selectInfo
?.
yqMerchantId
?
[
selectInfo
?.
yqMerchantId
]
:
allServiceIds
}
mineApi
.
getStaffListAPI
(
params
).
then
(
res
=>
{
let
tempList
=
isReset
?
res
||
[]
:
this
.
data
.
staffList
.
concat
(
res
||
[])
this
.
setData
({
staffList
:
tempList
,
currentPage
:
currentPage
+
1
,
total
,
triggered
:
false
})
if
(
isReset
)
{
this
.
setData
({
scrollTop
:
0
})
}
})
},
onBottomRefresh
()
{
this
.
getList
()
},
search
()
{
this
.
setData
({
currentPage
:
1
})
this
.
getList
(
true
)
},
// 筛选服务中心
...
...
@@ -119,20 +100,21 @@ Page({
// 创建/编辑员工
jump
(
e
)
{
// 校验是否有配置服务中心
// return wx.showModal({
// title: '提示',
// content: '您尚无服务中心,请先创建服务中心',
// confirmText: '去创建',
// cancelText: '取消',
// confirmColor: '#3666FE',
// success(res) {
// if (res.confirm) {
// wx.$router.reLaunch('packageMine.creatService')
// }
// }
// })
if
(
!
this
.
data
.
serviceList
.
length
)
{
return
wx
.
showModal
({
title
:
'提示'
,
content
:
'您尚无服务中心,请先创建服务中心'
,
confirmText
:
'去创建'
,
cancelText
:
'取消'
,
confirmColor
:
'#3666FE'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
wx
.
$router
.
redirectTo
(
'packageMine.editService'
)
}
}
})
}
let
dataset
=
e
.
currentTarget
.
dataset
console
.
log
(
dataset
)
wx
.
$router
.
go
(
'packageMine.createStaff'
,
dataset
)
},
...
...
packageMine/pages/staffManage/staffList/staffList.wxml
View file @
b6aa682
...
...
@@ -10,7 +10,7 @@
<view class="title">员工数量:<text class="number">{{total}}</text></view>
<view class="select-btn">
<view class="type" bindtap="filterTypeFn">
<text>{{selectInfo.
service
Name}}</text>
<text>{{selectInfo.
yqMerchant
Name}}</text>
<glsx-image class="point" src="index/point.png" />
</view>
</view>
...
...
@@ -18,7 +18,7 @@
<scroll-view scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="
search
"
bindrefresherrefresh="
getList
"
bindscrolltolower="onBottomRefresh"
class="list"
style="height:calc(100vh - 148rpx - 110rpx);"
...
...
@@ -51,4 +51,4 @@
<nothing-tips tips="暂无员工~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" />
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="getStaffList" selectInfo="{{selectInfo}}" popShow="{{popupShow}}"
merchantRange="{{staff
List}}" />
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="getStaffList" selectInfo="{{selectInfo}}" popShow="{{popupShow}}"
serviceRange="{{service
List}}" />
pages/tab/mine/mine.js
View file @
b6aa682
...
...
@@ -151,7 +151,7 @@ Page({
onLoad
:
async
function
(
options
)
{
let
{
userInfo
}
=
wx
.
$storage
.
get
()
let
serviceMerchantId
=
userInfo
.
subLoginUser
.
merchantId
let
serviceMerchantId
=
userInfo
.
subLoginUser
?
.
merchantId
//解决因为使用await 异步导致数据没同步已经开始调用onshow方法
this
.
setData
({
serviceMerchantId
,
...
...
utils/request/environment.js
View file @
b6aa682
...
...
@@ -93,6 +93,17 @@ const domain = {
prod
:
'https://scrm.glsx.com.cn'
}[
target
[
index
]]
// 员工管理接口域名
const
domain2
=
{
ip
:
'http://192.168.1.170:8315'
,
/**登录: 192.168.2.3:8315
商城: 192.168.2.3:8558 */
dev
:
'http://rop-merchant.dev.glsx.com.cn'
,
uat
:
'https://scrm.test.glsx.com.cn'
,
preRelease
:
'https://scrm.beta.glsx.com.cn'
,
prod
:
'https://scrm.glsx.com.cn'
}[
target
[
index
]]
const
pathEnum
=
{
sso
:
'/rop-scrm-sso/'
,
shopmall
:
'/rop-scrm-shopmall/'
,
...
...
@@ -107,7 +118,8 @@ const pathEnum = {
sop
:
'/rop-scrm-sop/'
,
customercollect
:
'/rop-scrm-bigdatautil/'
,
drac
:
'/rop-scrm-entmicro/'
,
busassistant
:
'/rop-scrm-busassistant/'
busassistant
:
'/rop-scrm-busassistant/'
,
open
:
'/rop-merchants/'
}
const
defaultMerchantId
=
{
ip
:
'44184606'
,
...
...
@@ -127,6 +139,7 @@ let mockUrl = {
module
.
exports
=
{
index
,
domain
,
domain2
,
pathEnum
,
secretKey
,
defaultMerchantId
,
...
...
utils/request/request.js
View file @
b6aa682
import
{
secretKey
,
pathEnum
,
domain
,
sign
}
from
'./http.js'
import
{
secretKey
,
pathEnum
,
domain
,
sign
,
domain2
}
from
'./http.js'
import
{
getSessionId
}
from
'~/utils/cache/storageApi'
import
network
from
'~/utils/network'
/**接口 */
...
...
@@ -25,8 +25,10 @@ class Request {
let
path
=
pathEnum
[
projectName
]
if
(
!
path
)
path
=
`/rop-scrm-
${
projectName
}
/`
params
=
this
.
getData
(
params
)
// open 员工管理模块域名
let
baseUrl
=
projectName
==
'open'
?
domain2
:
domain
wx
.
request
({
url
:
`
${
domain
}${
path
}
router?method=
${
params
.
method
}
`
,
url
:
`
${
baseUrl
}${
path
}
router?method=
${
params
.
method
}
`
,
data
:
params
,
method
:
RequestMethods
,
header
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment