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 343b0282
authored
Jun 04, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'develop' into 'master'
上线合并,v4.39.0-0603 See merge request
!65
2 parents
33cd3f4b
26daa278
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
698 additions
and
223 deletions
api/mineApi/mine.js
packageMine/pages/staffManage/createStaff/createStaff.js
packageMine/pages/staffManage/createStaff/createStaff.scss
packageMine/pages/staffManage/createStaff/createStaff.wxml
packageMine/pages/staffManage/staffList/staffList.js
packageMine/pages/staffManage/staffList/staffList.scss
packageMine/pages/staffManage/staffList/staffList.wxml
utils/request/environment.js
api/mineApi/mine.js
View file @
343b028
import
api
from
'~/utils/request/request'
import
api
from
"~/utils/request/request"
;
// const { appId } = wx.getAccountInfoSync().miniProgram
const
CODE
=
{
platformEntrance
:
'BUSINESS_ASSISTANT'
,
productCode
:
'PC00c3'
}
platformEntrance
:
"BUSINESS_ASSISTANT"
,
productCode
:
"PC00c3"
,
}
;
class
mineApi
{
/**分页查询客户列表 */
merchantCustomInfo
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.boutiquecoupon.merchantCustomInfo.page'
,
...
data
method
:
"scrm.api.boutiquecoupon.merchantCustomInfo.page"
,
...
data
,
}
// true
)
)
;
}
/** 保存客户信息 */
saveMerchantCustomInfo
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.boutiquecoupon.merchantCustomInfo.save'
,
...
data
method
:
"scrm.api.boutiquecoupon.merchantCustomInfo.save"
,
...
data
,
}
// true
)
)
;
}
/** 消息盒子列表 */
messageBoxPage
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.busassistant.messageBox.page'
,
...
data
method
:
"scrm.api.busassistant.messageBox.page"
,
...
data
,
}
// true
)
)
;
}
/** 是否有未读消息 */
messageBoxPageIsRead
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.busassistant.messageBox.isread'
,
...
data
method
:
"scrm.api.busassistant.messageBox.isread"
,
...
data
,
}
// true
)
)
;
}
// 获取服务中心下拉筛选 所有服务商数据
getServiceCenterListAPI
(
data
)
{
// data.querySubPartner = true
return
api
.
post
(
{
method
:
'scrm.api.busassistant.serviceCenter.listByServiceMerchantId'
,
...
data
}
)
return
api
.
post
({
method
:
"scrm.api.busassistant.serviceCenter.listByServiceMerchantId"
,
...
data
,
});
}
// 获取员工列表
getStaffListAPI
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.busassistant.staff.searchStaffPage'
,
...
data
}
)
return
api
.
post
({
method
:
"scrm.api.busassistant.staff.searchStaffPage"
,
...
data
,
});
}
// 创建员工
createStaffAPI
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.busassistant.staff.createStaff'
,
...
data
}
)
return
api
.
post
({
method
:
"scrm.api.busassistant.staff.createStaff"
,
...
data
,
});
}
// 更新员工
updateStaffAPI
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.busassistant.staff.updateStaff'
,
...
data
}
)
return
api
.
post
({
method
:
"scrm.api.busassistant.staff.updateStaff"
,
...
data
,
});
}
// 获取当前服务中心下的客户列表
getConnectionListByServiceAPI
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.busassistant.merchantCustomer.listByServiceCenterMerchantId'
,
...
data
}
)
return
api
.
post
({
method
:
"scrm.api.busassistant.merchantCustomer.listByServiceCenterMerchantId"
,
...
data
,
});
}
/** 获取车品牌列表 */
getCarBrandList
()
{
return
api
.
post
({
method
:
'scrm.api.busassistant.serviceCenter.getCarbrandTree'
method
:
"scrm.api.busassistant.serviceCenter.getCarbrandTree"
,
});
}
/** 员工审核列表 */
staffAuditPage
(
data
)
{
return
api
.
post
({
method
:
"scrm.api.busassistant.staff.audit.page"
,
...
data
,
});
}
/** 新增/更新/删除员工-提交审核 */
staffAuditAdd
(
data
)
{
return
api
.
post
({
method
:
'scrm.api.busassistant.staff.audit.add'
,
...
data
})
}
/** 获取车系列表 */
// getCarSeriesList(data) {
// return api.post({
// method: 'scrm.api.carlife.common.getCarSeriesList',
// ...data
// })
// }
/** 获取车型 */
// getCarTypeList(carSeriesId) {
// return api.post({
...
...
@@ -115,4 +116,4 @@ class mineApi {
// })
// }
}
export
default
mineApi
export
default
mineApi
;
packageMine/pages/staffManage/createStaff/createStaff.js
View file @
343b028
...
...
@@ -58,15 +58,22 @@ Page({
let
optionsInfo
=
options
?.
info
||
{}
let
data
=
options
?.
info
?
{
...
options
?.
info
,
selectInfo
:
{
yqMerchantId
:
optionsInfo
.
merchantNo
,
yqMerchantName
:
optionsInfo
.
merchantName
},
selectInfo
:
{
yqMerchantId
:
optionsInfo
.
merchantNo
,
yqMerchantName
:
optionsInfo
.
merchantName
},
serviceValue
:
optionsInfo
.
merchantName
,
visualType
:
optionsInfo
.
visualType
||
0
,
connectionValue
:
optionsInfo
.
visualType
==
1
?
`已选
${
optionsInfo
.
visibleMerchantNo
?.
split
(
','
)?.
length
}
位客户
`: '全部',
selectedConnectionIds: optionsInfo.visualType == 1 ? optionsInfo.visibleMerchantNo?.split(',').map((v) => {
return v && Number(v)
}) : [],
connectionValue
:
optionsInfo
.
visualType
==
1
?
`已选
${
optionsInfo
.
visibleMerchantNo
?.
split
(
','
)?.
length
}
位客户
`
: '全部',
selectedConnectionIds: optionsInfo.visualType == 1 ? optionsInfo.visibleMerchantNo?.split(',').map((v) => {
return v && Number(v)
}) : [],
staffBusinessTypeStr: optionsInfo.staffBusinessType == 0 ? '驻店' : optionsInfo.staffBusinessType == 1 ? '技师' : '',
staffTypeSelectInfo: {
staffBusinessType: optionsInfo?.staffBusinessType
}
staffTypeSelectInfo: {
staffBusinessType: optionsInfo?.staffBusinessType
}
} : {}
if (options?.info) wx.setNavigationBarTitle({ title: '编辑员工' })
// if
if (options?.info) {
wx.setNavigationBarTitle({ title: '编辑员工' })
this.setData({
staffName: data.staffName,
staffPhone: data.staffPhone
})
}
this.setData({
addOrEdit: options?.info ? 'edit' : 'add',
'formItems[0].disabled': options?.info ? true : false,
...
...
@@ -96,7 +103,7 @@ Page({
}).then(res => {
// 全部客户
let { allConnectionIds, copyFormData } = this.data
allConnectionIds = res?.map(val => {
return val.merchantId
})
allConnectionIds = res?.map(val => {
return val.merchantId
})
this.setData({
allConnectionIds
...
...
@@ -116,7 +123,7 @@ Page({
back() {
let { showServiceConfirm } = this.data
if (showServiceConfirm){
if (showServiceConfirm)
{
this.setData({
showServiceConfirm: false
})
...
...
@@ -128,7 +135,7 @@ Page({
let { formData } = this.data
let { type, disabled } = e.currentTarget.dataset
if (disabled) return
switch(type) {
switch
(type) {
// 选择服务中心
case 1:
this.hiddenSelectConfirm()
...
...
@@ -183,11 +190,13 @@ Page({
[`
formData
.
$
{
name
}
`]: value
})
},
handleDelete() {
this.handleConfirm('delete')
},
// 提交
handleConfirm() {
handleConfirm(
btnName
) {
let _this = this
let { addOrEdit, formData, allConnectionIds, isConfirm } = _this.data
let { addOrEdit, formData, allConnectionIds, isConfirm
, staffName, staffPhone
} = _this.data
if (isConfirm) {
return true
}
...
...
@@ -209,9 +218,33 @@ Page({
visibleMerchantNoList: formData?.visualType == 0 ? undefined : formData?.selectedConnectionIds, // 全部 无需传可见客户数据
staffType: Number(formData?.staffBusinessType)
}
let message = addOrEdit == 'add' ? '是否确定创建员工?' : '是否确定修改员工信息?'
let title = ''
let message = ''
console.log(btnName, 'btnName');
if (addOrEdit == 'add') {
title = '确定要新增员工吗?'
message = '新增员工将自动提交审核,审核通过后完成新增。'
params.auditType = 1
} else {
title = '确定要保存变更吗?',
message = '变更员工姓名或手机号将自动提交审核,审核通过后完成变更。'
params.auditType = 0
}
if (btnName == 'delete') {
title = '确定删除员工吗?'
message = '删除员工将提交审核,审核通过后完成删除,删除后不可恢复。'
params.auditType = 2
}
// let message = addOrEdit == 'add' ? '是否确定创建员工?' : '是否确定修改员工信息?'
// handleDelete
wx.showModal({
title
: '提示'
,
title,
content: message,
confirmText: '确定',
cancelText: '取消',
...
...
@@ -222,18 +255,34 @@ Page({
isConfirm: true
})
// 创建/编辑接口
let requestEvent = addOrEdit == 'add' ? 'createStaffAPI' : 'updateStaffAPI'
// staffAuditAdd
let requestEvent = 'staffAuditAdd'
// 是编辑并且手机号和姓名没变
if (params.auditType == 0) {
if (params.staffName == staffName && params.staffPhone == staffPhone) {
requestEvent = 'updateStaffAPI'
} else {
params.staffNameNew = params.staffName
params.staffName = staffName
params.staffPhoneNew = params.staffPhone
params.staffPhone = staffPhone
}
}
// 'createStaffAPI' : 'updateStaffAPI'
console.log(requestEvent, 'requestEvent');
mineApi[requestEvent](params).then(res => {
if (addOrEdit == 'add') {
wx.$router.redirectTo('packageMine.successPage?page=staff')
} else {
wx.$router.back()
}
}).catch(err => {
})
setTimeout(() => {
// console.log(111111222);
_this.setData({
isConfirm: false
})
})
}
, 500
)
}
}
})
...
...
packageMine/pages/staffManage/createStaff/createStaff.scss
View file @
343b028
/* packagesList/mineDetail/pages/staffManage/createStaff/createStaff.wxss */
.create-staff-page
{
.create-staff-page
{
margin
:
20rpx
;
.tips
{
.tips
{
padding
:
12rpx
;
color
:
#323436
;
font-size
:
28rpx
;
font-weight
:
600
;
}
.form-content
{
.form-content
{
background
:
#FFFFFF
;
border-radius
:
16rpx
;
padding
:
44rpx
40rpx
;
.label
{
.label
{
font-size
:
28rpx
;
font-weight
:
600
;
color
:
#323436
;
margin-bottom
:
12rpx
;
.tips
{
.tips
{
font-size
:
24rpx
;
font-weight
:
400
;
color
:
#F35251
;
}
}
.input-box
,
.select-box
{
.input-box
,
.select-box
{
height
:
40rpx
;
background
:
#F8F9FC
;
border-radius
:
12rpx
;
...
...
@@ -30,20 +36,24 @@
margin-bottom
:
16rpx
;
color
:
#323436
;
}
.select-box
{
.select-box
{
display
:
flex
;
justify-content
:
space-between
;
.arrow_right
{
.arrow_right
{
width
:
36rpx
;
height
:
36rpx
;
}
.name
{
.name
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
}
}
.btn
{
position
:
fixed
;
bottom
:
16rpx
;
...
...
@@ -56,8 +66,17 @@
color
:
#FFFFFF
;
margin
:
0
32rpx
;
}
.btn-blue
{
background
:
var
(
--
btnColor
);
border-radius
:
8rpx
;
}
.delete
{
bottom
:
106rpx
}
.deleteBtn
{
margin-top
:
10rpx
;
}
}
\ No newline at end of file
packageMine/pages/staffManage/createStaff/createStaff.wxml
View file @
343b028
...
...
@@ -8,15 +8,7 @@
<block wx:for="{{formItems}}" wx:key="index">
<view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view>
<view class="input-box" wx:if="{{item.type == 'input'}}">
<input
type="{{item.inputType || 'text'}}"
placeholder="{{item.placeholder}}"
class="input"
bindinput="input"
data-name="{{item.props}}"
maxlength="{{item.maxLength}}"
value="{{formData[item.props]}}"
placeholder-class="input-placeholder" />
<input type="{{item.inputType || 'text'}}" placeholder="{{item.placeholder}}" class="input" bindinput="input" data-name="{{item.props}}" maxlength="{{item.maxLength}}" value="{{formData[item.props]}}" placeholder-class="input-placeholder" />
</view>
<view class="select-box" style="background-color: {{item.disabled ? '#E1E2E6' : ''}}" wx:if="{{item.type == 'select'}}" bindtap="jump" data-type="{{item.pageType}}" data-disabled="{{item.disabled}}">
<view class="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view>
...
...
@@ -25,9 +17,11 @@
</view>
</block>
</view>
<view class="isFullSucreen btn">
<view class="isFullSucreen btn
{{addOrEdit != 'add'?'delete':''}}
">
<view class="btn-blue" bindtap="handleConfirm">{{addOrEdit == 'add' ? '提交' : '保存'}}</view>
<view class="btn-blue deleteBtn" bindtap="handleDelete" wx:if="{{addOrEdit != 'add'}}">删除</view>
<!-- <view class="btn-blue" bindtap="handleConfirm">{{addOrEdit == 'add' ? '提交' : '保存'}}</view> -->
</view>
</view>
<select-service-confirm show="{{showServiceConfirm}}" serviceList="{{serviceList}}" selectInfo="{{formData.selectInfo}}" bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm>
<staff-type-popup wx:if="{{staffPopupShow}}" bind:hidePopup="handleStaffTypeChange" selectInfo="{{formData.selectInfo}}" staffTypeSelectInfo="{{formData.staffTypeSelectInfo}}" bindconfirm="staffTypeConfiem" popShow="{{staffPopupShow}}" notAll="{{true}}"/>
<staff-type-popup wx:if="{{staffPopupShow}}" bind:hidePopup="handleStaffTypeChange" selectInfo="{{formData.selectInfo}}" staffTypeSelectInfo="{{formData.staffTypeSelectInfo}}" bindconfirm="staffTypeConfiem" popShow="{{staffPopupShow}}" notAll="{{true}}"
/>
\ No newline at end of file
packageMine/pages/staffManage/staffList/staffList.js
View file @
343b028
// packagesList/mineDetail/pages/staffManage/staffManage.js
import
{
IMG_URL
}
from
'~/utils/constantData'
import
mineApi
from
'~/api/mineApi/index'
import
{
IMG_URL
}
from
"~/utils/constantData"
;
import
mineApi
from
"~/api/mineApi/index"
;
Page
({
/**
* 页面的初始数据
*/
data
:
{
IMG_URL
,
bgUrl
:
`
${
IMG_URL
}
/personal/empty_tran.png`
,
tabList
:
[
"员工"
,
"我的申请"
],
tabIndx
:
0
,
popupShow
:
false
,
staffList
:
[],
selectInfo
:
{
yqMerchantName
:
'全部服务中心'
,
staffBusinessTypeStr
:
'全部员工类型'
},
selectInfo
:
{
yqMerchantName
:
"全部服务中心"
,
staffBusinessTypeStr
:
"全部员工类型"
,
},
auditStatus
:
{
0
:
"审核中"
,
1
:
"已通过"
,
2
:
"已驳回"
,
},
auditStatusColor
:
{
0
:
"#3666FE"
,
1
:
"#21AB60"
,
2
:
"#F36261"
,
},
orderObj
:
[
{
label
:
"手机号码:"
,
key
:
"staffPhone"
,
},
{
label
:
"新员工姓名:"
,
key
:
"staffNameNew"
,
},
{
label
:
"新手机号码:"
,
key
:
"staffPhoneNew"
,
},
{
label
:
"所属服务中心:"
,
key
:
"serviceMerchantName"
,
},
{
label
:
"申请类型:"
,
key
:
"auditType"
,
labelKey
:
{
0
:
"变更"
,
1
:
"新增"
,
2
:
"删除"
,
},
},
{
label
:
"申请时间:"
,
key
:
"applyTime"
,
},
// {
// label: "驳回原因:",
// key: "auditRemark",
// },
],
total
:
0
,
serviceList
:
[],
currentPage
:
1
,
allServiceIds
:
[],
nothing
:
false
,
scrollTop
:
0
,
scrollTopApplication
:
0
,
isAsk
:
false
,
staffPopupShow
:
false
,
staffTypeSelectInfo
:
{
staffBusinessType
:
''
}
staffBusinessType
:
""
,
},
totalApplication
:
0
,
currentPageApplication
:
1
,
listApplication
:
[],
isAskApplication
:
false
,
nothingApplication
:
false
,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
},
onLoad
(
options
)
{},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
()
{
},
onReady
()
{},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{
// 获取服务中心数据
mineApi
.
getServiceCenterListAPI
({}).
then
(
res
=>
{
let
data
=
res
||
[]
let
serviceIds
=
data
.
map
(
val
=>
{
return
val
.
yqMerchantId
})
mineApi
.
getServiceCenterListAPI
({}).
then
((
res
)
=>
{
let
data
=
res
||
[];
let
serviceIds
=
data
.
map
((
val
)
=>
{
return
val
.
yqMerchantId
;
});
this
.
setData
({
serviceList
:
res
||
[],
allServiceIds
:
serviceIds
,
currentPage
:
1
,
nothing
:
false
,
total
:
0
})
total
:
0
,
})
;
// 获取员工列表
this
.
getList
(
true
)
})
this
.
getList
(
true
);
// 获取我的申请列表
this
.
getStaffAuditPage
(
true
);
});
},
// 切换tab 重新请求
changeTabIndx
(
e
)
{
// console.log(e);
let
{
detail
}
=
e
;
this
.
setData
({
tabIndx
:
detail
,
});
this
.
setData
({
currentPageApplication
:
1
,
currentPage
:
1
,
});
detail
==
0
?
this
.
getList
(
true
)
:
this
.
getStaffAuditPage
(
true
);
},
getStaffAuditPage
(
isReset
=
false
)
{
let
{
currentPageApplication
,
selectInfo
,
allServiceIds
,
nothingApplication
,
isAskApplication
,
staffTypeSelectInfo
,
}
=
this
.
data
;
let
_this
=
this
;
let
params
=
{
pageSize
:
10
,
pageNum
:
currentPageApplication
,
merchantNoList
:
selectInfo
?.
yqMerchantId
?
[
selectInfo
?.
yqMerchantId
]
:
allServiceIds
,
staffBusinessType
:
staffTypeSelectInfo
.
staffBusinessType
,
};
if
(
nothingApplication
||
isAskApplication
)
{
return
;
}
this
.
setData
({
isAskApplication
:
true
,
triggeredApplication
:
true
,
});
mineApi
.
staffAuditPage
(
params
)
.
then
((
res
)
=>
{
console
.
log
(
res
,
"listApplication"
);
let
tempList
=
isReset
?
res
?.
list
||
[]
:
this
.
data
.
listApplication
.
concat
(
res
?.
list
||
[]);
this
.
setData
({
listApplication
:
tempList
,
currentPageApplication
:
currentPageApplication
+
1
,
totalApplication
:
res
.
total
,
nothingApplication
:
res
.
total
==
tempList
.
length
,
triggeredApplication
:
false
,
});
if
(
isReset
)
{
this
.
setData
({
scrollTopApplication
:
0
,
});
}
})
.
finally
(
function
()
{
_this
.
setData
({
isAskApplication
:
false
,
});
});
},
getList
(
isReset
=
false
)
{
let
{
currentPage
,
selectInfo
,
allServiceIds
,
nothing
,
isAsk
,
staffTypeSelectInfo
}
=
this
.
data
let
_this
=
this
let
{
currentPage
,
selectInfo
,
allServiceIds
,
nothing
,
isAsk
,
staffTypeSelectInfo
,
}
=
this
.
data
;
let
_this
=
this
;
let
params
=
{
pageSize
:
10
,
pageNum
:
currentPage
,
merchantNoList
:
selectInfo
?.
yqMerchantId
?
[
selectInfo
?.
yqMerchantId
]
:
allServiceIds
,
staffBusinessType
:
staffTypeSelectInfo
.
staffBusinessType
}
merchantNoList
:
selectInfo
?.
yqMerchantId
?
[
selectInfo
?.
yqMerchantId
]
:
allServiceIds
,
staffBusinessType
:
staffTypeSelectInfo
.
staffBusinessType
,
};
if
(
nothing
||
isAsk
)
{
return
return
;
}
this
.
setData
({
isAsk
:
true
})
mineApi
.
getStaffListAPI
(
params
).
then
(
res
=>
{
let
tempList
=
isReset
?
res
?.
data
||
[]
:
this
.
data
.
staffList
.
concat
(
res
?.
data
||
[])
this
.
setData
({
staffList
:
tempList
,
currentPage
:
currentPage
+
1
,
total
:
res
.
count
,
nothing
:
res
.
count
==
tempList
.
length
,
triggered
:
false
})
if
(
isReset
)
{
isAsk
:
true
,
triggered
:
true
,
});
mineApi
.
getStaffListAPI
(
params
)
.
then
((
res
)
=>
{
let
tempList
=
isReset
?
res
?.
data
||
[]
:
this
.
data
.
staffList
.
concat
(
res
?.
data
||
[]);
this
.
setData
({
scrollTop
:
0
})
}
}).
finally
(
function
()
{
_this
.
setData
({
isAsk
:
false
staffList
:
tempList
,
currentPage
:
currentPage
+
1
,
total
:
res
.
count
,
nothing
:
res
.
count
==
tempList
.
length
,
triggered
:
false
,
});
if
(
isReset
)
{
this
.
setData
({
scrollTop
:
0
,
});
}
})
})
.
finally
(
function
()
{
_this
.
setData
({
isAsk
:
false
,
});
});
},
onBottomRefresh
()
{
this
.
getList
()
this
.
getList
()
;
},
search
()
{
this
.
setData
({
currentPage
:
1
,
nothing
:
false
,
total
:
0
})
this
.
getList
(
true
)
total
:
0
,
});
this
.
getList
(
true
);
},
onBottomRefreshApplication
()
{
console
.
log
(
"onBottomRefreshApplication"
);
this
.
getStaffAuditPage
();
},
searchApplication
()
{
this
.
setData
({
nothingApplication
:
false
,
totalApplication
:
0
,
currentPageApplication
:
1
,
});
this
.
getStaffAuditPage
(
true
);
},
// 筛选员工类型
handleStaffTypeChange
()
{
this
.
setData
({
staffPopupShow
:
!
this
.
data
.
staffPopupShow
})
staffPopupShow
:
!
this
.
data
.
staffPopupShow
,
})
;
},
// 筛选服务中心
filterTypeFn
()
{
this
.
setData
({
popupShow
:
!
this
.
data
.
popupShow
})
popupShow
:
!
this
.
data
.
popupShow
,
})
;
},
// 获取员工列表
getStaffList
(
e
)
{
wx
.
$api
.
hideLoading
()
let
{
selectInfo
}
=
this
.
data
let
{
staffBusinessType
,
staffBusinessTypeStr
}
=
e
.
detail
if
(
staffBusinessType
==
''
&&
staffBusinessTypeStr
==
'全部'
)
e
.
detail
.
staffBusinessTypeStr
=
'全部员工类型'
wx
.
$api
.
hideLoading
();
let
{
selectInfo
}
=
this
.
data
;
let
{
staffBusinessType
,
staffBusinessTypeStr
}
=
e
.
detail
;
if
(
staffBusinessType
==
""
&&
staffBusinessTypeStr
==
"全部"
)
e
.
detail
.
staffBusinessTypeStr
=
"全部员工类型"
;
let
obj
=
{
...
selectInfo
,
...
e
.
detail
}
...
e
.
detail
,
}
;
this
.
setData
({
selectInfo
:
obj
,
staffTypeSelectInfo
:
obj
,
nothing
:
false
,
currentPage
:
1
})
this
.
getList
(
true
)
currentPage
:
1
,
})
;
this
.
getList
(
true
)
;
},
// 创建/编辑员工
jump
(
e
)
{
console
.
log
(
e
,
"e"
);
let
info
=
e
.
currentTarget
.
dataset
.
info
;
if
(
info
?.
auditStatus
==
0
)
{
return
wx
.
$api
.
showToast
({
title
:
"审核中不可操作"
,
icon
:
"error"
,
});
}
// 校验是否有配置服务中心
if
(
!
this
.
data
.
serviceList
.
length
)
{
return
wx
.
showModal
({
title
:
'提示'
,
content
:
'您尚无服务中心,请先创建服务中心'
,
confirmText
:
'去创建'
,
cancelText
:
'取消'
,
confirmColor
:
'#3666FE'
,
title
:
"提示"
,
content
:
"您尚无服务中心,请先创建服务中心"
,
confirmText
:
"去创建"
,
cancelText
:
"取消"
,
confirmColor
:
"#3666FE"
,
success
(
res
)
{
if
(
res
.
confirm
)
{
wx
.
$router
.
redirectTo
(
'packageMine.editService'
)
wx
.
$router
.
redirectTo
(
"packageMine.editService"
);
}
}
})
}
,
})
;
}
let
dataset
=
e
.
currentTarget
.
dataset
wx
.
$router
.
go
(
'packageMine.createStaff'
,
dataset
)
let
dataset
=
e
.
currentTarget
.
dataset
;
wx
.
$router
.
go
(
"packageMine.createStaff"
,
dataset
);
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
()
{
},
onHide
()
{},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
()
{
},
onUnload
()
{},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
()
{
},
onPullDownRefresh
()
{},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
()
{
},
onReachBottom
()
{},
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{
}
})
\ No newline at end of file
onShareAppMessage
()
{},
});
packageMine/pages/staffManage/staffList/staffList.scss
View file @
343b028
/* packagesList/mineDetail/pages/staffManage/staffManage.wxss */
.staff-list-page
{
.staff-list-page
{
width
:
100%
;
box-sizing
:
border-box
;
padding
:
20rpx
;
background-color
:
#F2F3F7
;
.btn_box
{
.btn_box
{
width
:
100%
;
height
:
96rpx
;
display
:
flex
;
...
...
@@ -16,27 +17,33 @@
font-size
:
28rpx
;
font-weight
:
600
;
margin-bottom
:
32rpx
;
.icon
{
.icon
{
width
:
40rpx
;
height
:
40rpx
;
margin-right
:
16rpx
;
vertical-align
:
-12rpx
}
}
.title-box
{
.title-box
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.title
{
.title
{
color
:
#323436
;
font-size
:
28rpx
;
font-weight
:
600
;
.number
{
.number
{
color
:
var
(
--
btnColor
)
}
}
.select-box
{
.select-box
{
display
:
flex
;
.select-btn
{
box-sizing
:
border-box
;
padding
:
16rpx
0
;
...
...
@@ -44,6 +51,7 @@
align-items
:
center
;
z-index
:
2
;
background-color
:
#f2f3f7
;
.type
{
margin-left
:
8px
;
display
:
flex
;
...
...
@@ -56,12 +64,14 @@
border-radius
:
14px
;
font-size
:
12px
;
color
:
#8a8c90
;
text
{
text
{
max-width
:
360rpx
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
.point
{
margin-left
:
2px
;
width
:
12px
;
...
...
@@ -71,33 +81,42 @@
}
}
}
.item-box
{
.item-box
{
width
:
100%
;
background
:
#FFFFFF
;
border-radius
:
12rpx
;
margin-bottom
:
20rpx
;
.top
{
.top
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
24rpx
32rpx
;
.message
{
.message
{
display
:
flex
;
.avatar
{
.avatar
{
flex-shrink
:
0
;
width
:
72rpx
;
height
:
72rpx
;
margin-right
:
12rpx
;
border-radius
:
50%
;
}
.message-text
{
.message-text
{
display
:
flex
;
flex-flow
:
column
;
justify-content
:
center
;
.name
{
.name
{
color
:
#323436
;
font-size
:
28rpx
;
.type_tips
{
.type_tips
{
background
:
#F1F3F9
;
border
:
2rpx
solid
#FFFFFF
;
border-radius
:
8rpx
;
...
...
@@ -107,18 +126,28 @@
color
:
#6B7384
;
}
}
.mobile
{
.mobile
{
color
:
#858A94
;
font-size
:
26rpx
;
}
}
}
.arrow_right
{
.arrow_right
{
width
:
36rpx
;
height
:
36rpx
;
}
.auditstatus
{
font-family
:
PingFangSC-Medium
;
font-weight
:
500
;
font-size
:
24rpx
;
color
:
#3666FE
;
}
}
.bottom
{
.bottom
{
padding
:
0
32rpx
;
height
:
72rpx
;
background-color
:
#FFF9F2
;
...
...
@@ -127,13 +156,15 @@
justify-content
:
space-between
;
font-size
:
24rpx
;
color
:
#8A8C90
;
.service_name
{
.service_name
{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
}
}
.bottomTips
{
text-align
:
center
;
color
:
#393b3e
;
...
...
@@ -141,4 +172,207 @@
height
:
60rpx
;
line-height
:
40rpx
;
}
}
.tabContainer
{
height
:
100rpx
;
background-color
:
#fff
;
}
.tab-box
{
background
:
#FFFFFF
;
.tab
{
margin-left
:
0
!
important
;
}
.tab.active
.text
{
font-family
:
PingFangSC-Medium
;
font-weight
:
500
;
font-size
:
32rpx
;
color
:
#3666FE
;
}
}
.list
{
box-sizing
:
border-box
;
width
:
100%
;
}
.touch-item
{
box-sizing
:
border-box
;
position
:
relative
;
display
:
flex
;
justify-content
:
space-between
;
overflow
:
hidden
;
margin
:
20rpx
;
box-shadow
:
0
4rpx
20rpx
0
#000000
1a
;
border-radius
:
16rpx
;
}
.list
.item
{
box-sizing
:
border-box
;
background
:
#FFFFFF
;
padding
:
32rpx
;
position
:
relative
;
}
.list
.content
{
width
:
100%
;
margin-right
:
0
;
-webkit-transition
:
all
0
.4s
;
transition
:
all
0
.4s
;
-webkit-transform
:
translateX
(
72px
);
transform
:
translateX
(
72px
);
margin-left
:
-72px
;
/* .item {
display: flex;
} */
}
.list
.item
.name
{
box-sizing
:
border-box
;
display
:
flex
;
align-items
:
center
;
font-size
:
32rpx
;
margin-bottom
:
15rpx
;
padding-bottom
:
18rpx
;
color
:
#292D33
;
font-weight
:
500
;
border-bottom
:
1rpx
dashed
#E4E8EE
;
}
.list
.item.gray
.name
{
color
:
#999999
;
}
/* .list .item .name.disabled{
} */
.list
.item
.name
image
{
width
:
46rpx
;
height
:
46rpx
;
}
.list
.item.gray
.name
image
{
filter
:
grayscale
(
100%
);
}
.staffBusinessType
{
width
:
60rpx
;
height
:
32rpx
;
background
:
#F1F3F9
;
border
:
2rpx
solid
#FFFFFF
;
border-radius
:
8rpx
;
font-family
:
PingFangSC-Regular
;
font-weight
:
400
;
font-size
:
22rpx
;
color
:
#6B7384
;
text-align
:
center
;
line-height
:
32rpx
;
margin-left
:
10rpx
;
}
.list
.item
.name
.name-text
{
/* margin-left: var(--fontSize26); */
max-width
:
404rpx
;
}
.list
.item
.name
.name-sex-icon
{
width
:
32rpx
;
height
:
32rpx
;
margin-left
:
8rpx
;
}
.list
.item
.status
{
position
:
absolute
;
font-size
:
24rpx
;
font-weight
:
500
;
top
:
32rpx
;
right
:
32rpx
;
height
:
44rpx
;
// max-width: 50rpx;
overflow
:
hidden
;
/* 确保文字超出容器部分会被隐藏 */
white-space
:
nowrap
;
/* 防止文字换行 */
// background: #F0F0F0;
// border-radius: 4rpx;
// padding: 0 8rpx;
}
.list
.item
.status
.arc
{
position
:
absolute
;
width
:
32rpx
;
height
:
32rpx
;
left
:
calc
(
-1
*
44rpx
);
}
.list
.item
.status
.arc
.outside
{
position
:
absolute
;
animation
:
arc-animation
5s
infinite
;
border-radius
:
100%
;
}
.list
.item
.order-list
{
padding
:
20rpx
0
;
// padding-top: 15rpx;
}
.list
.item
.order
{
font-size
:
24rpx
;
color
:
#333333
;
margin-bottom
:
16rpx
;
display
:
flex
;
align-items
:
center
;
}
.list
.item
.order
:last-of-type
{
margin-bottom
:
0
;
}
.list
.item
.order
.order-label
{
width
:
185rpx
;
color
:
#999EA8
;
}
.list
.item
.order
.order-value
{
width
:
calc
(
100%
-
186rpx
);
display
:
flex
;
align-items
:
center
;
color
:
#323436
;
font-size
:
24rpx
;
}
.list
.item
.order
.order-value
.order-value-item
:first-of-type
{
max-width
:
70%
;
}
.list
.item
.order
.order-value
.order-value-item
.split
{
margin
:
0
6rpx
;
}
.list
.item
.order
.order-value.auditType
{
color
:
#EF971E
;
}
.list-nothing
{
padding
:
30rpx
0
;
text-align
:
center
;
font-size
:
28rpx
;
color
:
#666666
;
}
.bottomTips
{
height
:
92rpx
;
line-height
:
92rpx
;
text-align
:
center
;
font-size
:
20rpx
;
color
:
#666666
;
background
:
#F8F9F9
;
}
\ No newline at end of file
packageMine/pages/staffManage/staffList/staffList.wxml
View file @
343b028
<!--packagesList/mineDetail/pages/staffManage/staffManage.wxml-->
<wxs src="../index.wxs" module="format" />
<view class="staff-list-page">
<tab tab="{{ tabList }}" itemWidth="{{ '50%' }}" index="{{ tabIndx }}" bindclick="changeTabIndx" class="tabContainer" />
<view class="staff-list-page" hidden="{{ tabIndx==1 }}">
<view class="btn_box" bindtap="jump">
<glsx-image src="index/apply.png" class="icon" />
<text>创建新员工</text>
</view>
<view class="content-box">
<view class="title-box">
<view class="title">员工数量:<text class="number">{{total}}</text></view>
<view class="title">
员工数量:
<text class="number">{{total}}</text>
</view>
<view class="select-box">
<view class="select-btn">
<view class="type" bindtap="handleStaffTypeChange">
...
...
@@ -23,43 +27,70 @@
</view>
</view>
</view>
<block wx:if="{{staffList.length}}">
<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"
scroll-top="{{scrollTop}}"
refresher-triggered="{{triggered}}">
<view class="item-box" wx:for="{{staffList}}" wx:key="index" bindtap="jump" data-info="{{item}}">
<block wx:if="{{ staffList.length }}">
<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" scroll-top="{{ scrollTop }}" refresher-triggered="{{ triggered }}">
<view class="item-box" wx:for="{{ staffList }}" wx:key="index" bindtap="jump" data-info="{{ item }}">
<view class="top">
<view class="message">
<glsx-image wx:if="{{
!item.weChatAvatarUrl}}" src="personal/staff_defalut_avatar.png" class="avatar"
/>
<image wx:else src="{{
item.weChatAvatarUrl
}}" class="avatar"></image>
<glsx-image wx:if="{{
!item.weChatAvatarUrl }}" src="personal/staff_defalut_avatar.png" class="avatar"
/>
<image wx:else src="{{
item.weChatAvatarUrl
}}" class="avatar"></image>
<view class="message-text">
<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="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>
</view>
<glsx-image src="personal/arrow_right.png" class="arrow_right" />
<view class=" auditstatus" wx:if="{{item.auditStatus == 0}}">审核中</view>
<glsx-image wx:if="{{item.auditStatus != 0}}" src="personal/arrow_right.png" class="arrow_right" />
</view>
<view class="bottom">
<view class="service_name">
所属:{{item.merchantName}}
</view>
<view class="service_name">所属:{{item.merchantName}}</view>
<view class="time">{{item.createdDate}}</view>
</view>
</view>
<view class="bottomTips" wx:if="{{
nothing
}}">到底啦!</view>
<view class="bottomTips" wx:if="{{
nothing
}}">到底啦!</view>
</scroll-view>
</block>
<block wx:else>
<nothing-tips tips="暂无员工~" bgColor="{{
'#F2F3F7'}}" bg="{{bgUrl
}}" />
<nothing-tips tips="暂无员工~" bgColor="{{
'#F2F3F7' }}" bg="{{ bgUrl
}}" />
</block>
</view>
</view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="getStaffList" selectInfo="{{selectInfo}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" />
<staff-type-popup wx:if="{{staffPopupShow}}" bind:hidePopup="handleStaffTypeChange" selectInfo="{{selectInfo}}" staffTypeSelectInfo="{{staffTypeSelectInfo}}" bindconfirm="getStaffList" popShow="{{staffPopupShow}}"/>
<view hidden="{{ tabIndx==0 }}" class="scrollCon">
<block wx:if="{{ listApplication.length }}">
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{ true }}" bindrefresherrefresh="searchApplication" bindscrolltolower="onBottomRefreshApplication" class="list" style="height:calc(100vh - 148rpx );" refresher-threshold="104" scroll-top="{{ scrollTopApplication }}" refresher-triggered="{{ triggeredApplication }}">
<block wx:for="{{ listApplication }}" wx:for-item="li" wx:for-index="ind" wx:key="ind">
<view style="{{ li.txtStyle }}" class="touch-item" data-ind="{{ ind }}" data-index="{{ index }}">
<view class="item content">
<view class="status text-center" style="color:{{ auditStatusColor[li.auditStatus] }};">{{auditStatus[li.auditStatus] }}</view>
<view class="name">
<view class="name-text text-hide">{{ li.staffName}}</view>
<view class="staffBusinessType" wx:if="{{ li.staffBusinessType != null }}">{{li.staffBusinessType == 0 ? '驻店':'技师'}}</view>
</view>
<view class="order-list">
<block wx:for="{{ orderObj }}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
<view class="order" wx:if="{{li[i.key]||i.key =='auditType' }}">
<view class="order-label">{{i.label}}</view>
<view wx:if="{{ i.key =='auditType' }}" class="order-value auditType">{{ i.labelKey[li.auditType] || ''}}</view>
<view wx:else class="order-value">{{li[i.key] || ''}}</view>
</view>
</block>
<view class="order" wx:if="{{ li.auditStatus == 2 }}">
<view class="order-label">驳回原因:</view>
<view class="order-value">{{li.auditRemark || ''}}</view>
</view>
</view>
</view>
</view>
</block>
<view class="bottomTips" wx:if="{{ nothingApplication }}">到底啦!</view>
</scroll-view>
</block>
<block wx:else>
<nothing-tips tips="暂无申请~" bgColor="{{ '#F2F3F7' }}" bg="{{ bgUrl }}" />
</block>
</view>
<select-service-popup wx:if="{{ popupShow }}" bind:hidePopup="filterTypeFn" bind:getStaffList="getStaffList" selectInfo="{{ selectInfo }}" popShow="{{ popupShow }}" serviceRange="{{ serviceList }}" />
<staff-type-popup wx:if="{{ staffPopupShow }}" bind:hidePopup="handleStaffTypeChange" selectInfo="{{ selectInfo }}" staffTypeSelectInfo="{{ staffTypeSelectInfo }}" bindconfirm="getStaffList" popShow="{{ staffPopupShow }}" />
\ No newline at end of file
utils/request/environment.js
View file @
343b028
...
...
@@ -29,7 +29,7 @@ const systemInfo = wx.getSystemInfoSync()
const
manual
=
false
const
release
=
false
let
index
=
3
let
index
=
2
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
...
...
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