Commit 343b0282 by 前端

Merge branch 'develop' into 'master'

上线合并,v4.39.0-0603

See merge request !65
2 parents 33cd3f4b 26daa278
import api from '~/utils/request/request' import api from "~/utils/request/request";
// const { appId } = wx.getAccountInfoSync().miniProgram // const { appId } = wx.getAccountInfoSync().miniProgram
const CODE = { const CODE = {
platformEntrance: 'BUSINESS_ASSISTANT', platformEntrance: "BUSINESS_ASSISTANT",
productCode: 'PC00c3' productCode: "PC00c3",
} };
class mineApi { class mineApi {
/**分页查询客户列表 */ /**分页查询客户列表 */
merchantCustomInfo(data) { merchantCustomInfo(data) {
return api.post( return api.post(
{ {
method: 'scrm.api.boutiquecoupon.merchantCustomInfo.page', method: "scrm.api.boutiquecoupon.merchantCustomInfo.page",
...data ...data,
} }
// true // true
) );
} }
/** 保存客户信息 */ /** 保存客户信息 */
saveMerchantCustomInfo(data) { saveMerchantCustomInfo(data) {
return api.post( return api.post(
{ {
method: 'scrm.api.boutiquecoupon.merchantCustomInfo.save', method: "scrm.api.boutiquecoupon.merchantCustomInfo.save",
...data ...data,
} }
// true // true
) );
} }
/** 消息盒子列表 */ /** 消息盒子列表 */
messageBoxPage(data) { messageBoxPage(data) {
return api.post( return api.post(
{ {
method: 'scrm.api.busassistant.messageBox.page', method: "scrm.api.busassistant.messageBox.page",
...data ...data,
} }
// true // true
) );
} }
/** 是否有未读消息 */ /** 是否有未读消息 */
messageBoxPageIsRead(data) { messageBoxPageIsRead(data) {
return api.post( return api.post(
{ {
method: 'scrm.api.busassistant.messageBox.isread', method: "scrm.api.busassistant.messageBox.isread",
...data ...data,
} }
// true // true
) );
} }
// 获取服务中心下拉筛选 所有服务商数据 // 获取服务中心下拉筛选 所有服务商数据
getServiceCenterListAPI(data) { getServiceCenterListAPI(data) {
// data.querySubPartner = true // data.querySubPartner = true
return api.post( return api.post({
{ method: "scrm.api.busassistant.serviceCenter.listByServiceMerchantId",
method: 'scrm.api.busassistant.serviceCenter.listByServiceMerchantId', ...data,
...data });
}
)
} }
// 获取员工列表 // 获取员工列表
getStaffListAPI(data) { getStaffListAPI(data) {
return api.post( return api.post({
{ method: "scrm.api.busassistant.staff.searchStaffPage",
method: 'scrm.api.busassistant.staff.searchStaffPage', ...data,
...data });
}
)
} }
// 创建员工 // 创建员工
createStaffAPI(data) { createStaffAPI(data) {
return api.post( return api.post({
{ method: "scrm.api.busassistant.staff.createStaff",
method: 'scrm.api.busassistant.staff.createStaff', ...data,
...data });
}
)
} }
// 更新员工 // 更新员工
updateStaffAPI(data) { updateStaffAPI(data) {
return api.post( return api.post({
{ method: "scrm.api.busassistant.staff.updateStaff",
method: 'scrm.api.busassistant.staff.updateStaff', ...data,
...data });
}
)
} }
// 获取当前服务中心下的客户列表 // 获取当前服务中心下的客户列表
getConnectionListByServiceAPI(data) { getConnectionListByServiceAPI(data) {
return api.post( return api.post({
{ method:
method: 'scrm.api.busassistant.merchantCustomer.listByServiceCenterMerchantId', "scrm.api.busassistant.merchantCustomer.listByServiceCenterMerchantId",
...data ...data,
} });
)
} }
/** 获取车品牌列表 */ /** 获取车品牌列表 */
getCarBrandList() { getCarBrandList() {
return api.post({ 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) { // getCarTypeList(carSeriesId) {
// return api.post({ // return api.post({
...@@ -115,4 +116,4 @@ class mineApi { ...@@ -115,4 +116,4 @@ class mineApi {
// }) // })
// } // }
} }
export default mineApi export default mineApi;
...@@ -58,15 +58,22 @@ Page({ ...@@ -58,15 +58,22 @@ Page({
let optionsInfo = options?.info || {} let optionsInfo = options?.info || {}
let data = options?.info ? { let data = options?.info ? {
...options?.info, ...options?.info,
selectInfo: {yqMerchantId: optionsInfo.merchantNo, yqMerchantName: optionsInfo.merchantName}, selectInfo: { yqMerchantId: optionsInfo.merchantNo, yqMerchantName: optionsInfo.merchantName },
serviceValue: optionsInfo.merchantName, serviceValue: optionsInfo.merchantName,
visualType: optionsInfo.visualType || 0, visualType: optionsInfo.visualType || 0,
connectionValue: optionsInfo.visualType == 1 ? `已选${optionsInfo.visibleMerchantNo?.split(',')?.length}位客户`: '全部', connectionValue: optionsInfo.visualType == 1 ? `已选${optionsInfo.visibleMerchantNo?.split(',')?.length}位客户` : '全部',
selectedConnectionIds: optionsInfo.visualType == 1 ? optionsInfo.visibleMerchantNo?.split(',').map((v) => {return v && Number(v)}) : [], selectedConnectionIds: optionsInfo.visualType == 1 ? optionsInfo.visibleMerchantNo?.split(',').map((v) => { return v && Number(v) }) : [],
staffBusinessTypeStr: optionsInfo.staffBusinessType == 0 ? '驻店' : optionsInfo.staffBusinessType == 1 ? '技师' : '', 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({ this.setData({
addOrEdit: options?.info ? 'edit' : 'add', addOrEdit: options?.info ? 'edit' : 'add',
'formItems[0].disabled': options?.info ? true : false, 'formItems[0].disabled': options?.info ? true : false,
...@@ -96,7 +103,7 @@ Page({ ...@@ -96,7 +103,7 @@ Page({
}).then(res => { }).then(res => {
// 全部客户 // 全部客户
let { allConnectionIds, copyFormData } = this.data let { allConnectionIds, copyFormData } = this.data
allConnectionIds = res?.map(val => {return val.merchantId}) allConnectionIds = res?.map(val => { return val.merchantId })
this.setData({ this.setData({
allConnectionIds allConnectionIds
...@@ -116,7 +123,7 @@ Page({ ...@@ -116,7 +123,7 @@ Page({
back() { back() {
let { showServiceConfirm } = this.data let { showServiceConfirm } = this.data
if (showServiceConfirm){ if (showServiceConfirm) {
this.setData({ this.setData({
showServiceConfirm: false showServiceConfirm: false
}) })
...@@ -128,7 +135,7 @@ Page({ ...@@ -128,7 +135,7 @@ Page({
let { formData } = this.data let { formData } = this.data
let { type, disabled } = e.currentTarget.dataset let { type, disabled } = e.currentTarget.dataset
if (disabled) return if (disabled) return
switch(type) { switch (type) {
// 选择服务中心 // 选择服务中心
case 1: case 1:
this.hiddenSelectConfirm() this.hiddenSelectConfirm()
...@@ -183,11 +190,13 @@ Page({ ...@@ -183,11 +190,13 @@ Page({
[`formData.${name}`]: value [`formData.${name}`]: value
}) })
}, },
handleDelete() {
this.handleConfirm('delete')
},
// 提交 // 提交
handleConfirm() { handleConfirm(btnName) {
let _this = this let _this = this
let { addOrEdit, formData, allConnectionIds, isConfirm } = _this.data let { addOrEdit, formData, allConnectionIds, isConfirm, staffName, staffPhone } = _this.data
if (isConfirm) { if (isConfirm) {
return true return true
} }
...@@ -209,9 +218,33 @@ Page({ ...@@ -209,9 +218,33 @@ Page({
visibleMerchantNoList: formData?.visualType == 0 ? undefined : formData?.selectedConnectionIds, // 全部 无需传可见客户数据 visibleMerchantNoList: formData?.visualType == 0 ? undefined : formData?.selectedConnectionIds, // 全部 无需传可见客户数据
staffType: Number(formData?.staffBusinessType) 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({ wx.showModal({
title: '提示', title,
content: message, content: message,
confirmText: '确定', confirmText: '确定',
cancelText: '取消', cancelText: '取消',
...@@ -222,18 +255,34 @@ Page({ ...@@ -222,18 +255,34 @@ Page({
isConfirm: true 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 => { mineApi[requestEvent](params).then(res => {
if (addOrEdit == 'add') { if (addOrEdit == 'add') {
wx.$router.redirectTo('packageMine.successPage?page=staff') wx.$router.redirectTo('packageMine.successPage?page=staff')
} else { } else {
wx.$router.back() wx.$router.back()
} }
}).catch(err => { })
setTimeout(() => {
// console.log(111111222);
_this.setData({ _this.setData({
isConfirm: false isConfirm: false
}) })
}) }, 500)
} }
} }
}) })
......
/* packagesList/mineDetail/pages/staffManage/createStaff/createStaff.wxss */ /* packagesList/mineDetail/pages/staffManage/createStaff/createStaff.wxss */
.create-staff-page{ .create-staff-page {
margin: 20rpx; margin: 20rpx;
.tips{
.tips {
padding: 12rpx; padding: 12rpx;
color: #323436; color: #323436;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
} }
.form-content{
.form-content {
background: #FFFFFF; background: #FFFFFF;
border-radius: 16rpx; border-radius: 16rpx;
padding: 44rpx 40rpx; padding: 44rpx 40rpx;
.label{
.label {
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
color: #323436; color: #323436;
margin-bottom: 12rpx; margin-bottom: 12rpx;
.tips{
.tips {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #F35251; color: #F35251;
} }
} }
.input-box,.select-box{
.input-box,
.select-box {
height: 40rpx; height: 40rpx;
background: #F8F9FC; background: #F8F9FC;
border-radius: 12rpx; border-radius: 12rpx;
...@@ -30,20 +36,24 @@ ...@@ -30,20 +36,24 @@
margin-bottom: 16rpx; margin-bottom: 16rpx;
color: #323436; color: #323436;
} }
.select-box{
.select-box {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.arrow_right{
.arrow_right {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;
} }
.name{
.name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
} }
} }
.btn { .btn {
position: fixed; position: fixed;
bottom: 16rpx; bottom: 16rpx;
...@@ -56,8 +66,17 @@ ...@@ -56,8 +66,17 @@
color: #FFFFFF; color: #FFFFFF;
margin: 0 32rpx; margin: 0 32rpx;
} }
.btn-blue { .btn-blue {
background: var(--btnColor); background: var(--btnColor);
border-radius: 8rpx; border-radius: 8rpx;
} }
.delete {
bottom: 106rpx
}
.deleteBtn {
margin-top: 10rpx;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -8,15 +8,7 @@ ...@@ -8,15 +8,7 @@
<block wx:for="{{formItems}}" wx:key="index"> <block wx:for="{{formItems}}" wx:key="index">
<view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view> <view class="label">{{item.label}}<text class="tips">{{item.tips}}</text></view>
<view class="input-box" wx:if="{{item.type == 'input'}}"> <view class="input-box" wx:if="{{item.type == 'input'}}">
<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" />
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>
<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="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> <view class="name" wx:if="{{formData[item.valueFn]}}">{{formData[item.valueFn]}}</view>
...@@ -25,9 +17,11 @@ ...@@ -25,9 +17,11 @@
</view> </view>
</block> </block>
</view> </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" 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>
</view> </view>
<select-service-confirm show="{{showServiceConfirm}}" serviceList="{{serviceList}}" selectInfo="{{formData.selectInfo}}" bind:hiddenSelectConfirm="hiddenSelectConfirm"></select-service-confirm> <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 \ No newline at end of file
// packagesList/mineDetail/pages/staffManage/staffManage.js // packagesList/mineDetail/pages/staffManage/staffManage.js
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from "~/utils/constantData";
import mineApi from '~/api/mineApi/index' import mineApi from "~/api/mineApi/index";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_URL, IMG_URL,
bgUrl: `${IMG_URL}/personal/empty_tran.png`, bgUrl: `${IMG_URL}/personal/empty_tran.png`,
tabList: ["员工", "我的申请"],
tabIndx: 0,
popupShow: false, popupShow: false,
staffList: [], 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, total: 0,
serviceList: [], serviceList: [],
currentPage: 1, currentPage: 1,
allServiceIds: [], allServiceIds: [],
nothing: false, nothing: false,
scrollTop: 0, scrollTop: 0,
scrollTopApplication: 0,
isAsk: false, isAsk: false,
staffPopupShow: false, staffPopupShow: false,
staffTypeSelectInfo: { staffTypeSelectInfo: {
staffBusinessType: '' staffBusinessType: "",
} },
totalApplication: 0,
currentPageApplication: 1,
listApplication: [],
isAskApplication: false,
nothingApplication: false,
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {},
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
// 获取服务中心数据 // 获取服务中心数据
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,
currentPage: 1, currentPage: 1,
nothing: false, 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) { getList(isReset = false) {
let { currentPage, selectInfo, allServiceIds, nothing, isAsk, staffTypeSelectInfo } = this.data let {
let _this = this currentPage,
selectInfo,
allServiceIds,
nothing,
isAsk,
staffTypeSelectInfo,
} = 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
staffBusinessType: staffTypeSelectInfo.staffBusinessType ? [selectInfo?.yqMerchantId]
} : allServiceIds,
staffBusinessType: staffTypeSelectInfo.staffBusinessType,
};
if (nothing || isAsk) { if (nothing || isAsk) {
return return;
} }
this.setData({ this.setData({
isAsk: true isAsk: true,
}) triggered: true,
mineApi.getStaffListAPI(params).then(res => { });
let tempList = isReset ? res?.data || [] : this.data.staffList.concat(res?.data || []) mineApi
this.setData({ .getStaffListAPI(params)
staffList: tempList, .then((res) => {
currentPage: currentPage + 1, let tempList = isReset
total: res.count, ? res?.data || []
nothing: res.count == tempList.length, : this.data.staffList.concat(res?.data || []);
triggered: false
})
if (isReset) {
this.setData({ this.setData({
scrollTop: 0 staffList: tempList,
}) currentPage: currentPage + 1,
} total: res.count,
}).finally(function () { nothing: res.count == tempList.length,
_this.setData({ triggered: false,
isAsk: false });
if (isReset) {
this.setData({
scrollTop: 0,
});
}
}) })
}) .finally(function () {
_this.setData({
isAsk: false,
});
});
}, },
onBottomRefresh() { onBottomRefresh() {
this.getList() this.getList();
}, },
search() { search() {
this.setData({ this.setData({
currentPage: 1, currentPage: 1,
nothing: false, nothing: false,
total: 0 total: 0,
}) });
this.getList(true) this.getList(true);
},
onBottomRefreshApplication() {
console.log("onBottomRefreshApplication");
this.getStaffAuditPage();
},
searchApplication() {
this.setData({
nothingApplication: false,
totalApplication: 0,
currentPageApplication: 1,
});
this.getStaffAuditPage(true);
}, },
// 筛选员工类型 // 筛选员工类型
handleStaffTypeChange() { handleStaffTypeChange() {
this.setData({ this.setData({
staffPopupShow: !this.data.staffPopupShow staffPopupShow: !this.data.staffPopupShow,
}) });
}, },
// 筛选服务中心 // 筛选服务中心
filterTypeFn() { filterTypeFn() {
this.setData({ this.setData({
popupShow: !this.data.popupShow popupShow: !this.data.popupShow,
}) });
}, },
// 获取员工列表 // 获取员工列表
getStaffList(e) { getStaffList(e) {
wx.$api.hideLoading() wx.$api.hideLoading();
let { selectInfo } = this.data let { selectInfo } = this.data;
let { staffBusinessType, staffBusinessTypeStr } = e.detail let { staffBusinessType, staffBusinessTypeStr } = e.detail;
if (staffBusinessType == '' && staffBusinessTypeStr == '全部') e.detail.staffBusinessTypeStr = '全部员工类型' if (staffBusinessType == "" && staffBusinessTypeStr == "全部")
e.detail.staffBusinessTypeStr = "全部员工类型";
let obj = { let obj = {
...selectInfo, ...selectInfo,
...e.detail ...e.detail,
} };
this.setData({ this.setData({
selectInfo: obj, selectInfo: obj,
staffTypeSelectInfo: obj, staffTypeSelectInfo: obj,
nothing: false, nothing: false,
currentPage: 1 currentPage: 1,
}) });
this.getList(true) this.getList(true);
}, },
// 创建/编辑员工 // 创建/编辑员工
jump(e) { 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) { if (!this.data.serviceList.length) {
return wx.showModal({ return wx.showModal({
title: '提示', title: "提示",
content: '您尚无服务中心,请先创建服务中心', content: "您尚无服务中心,请先创建服务中心",
confirmText: '去创建', confirmText: "去创建",
cancelText: '取消', cancelText: "取消",
confirmColor: '#3666FE', confirmColor: "#3666FE",
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
wx.$router.redirectTo('packageMine.editService') wx.$router.redirectTo("packageMine.editService");
} }
} },
}) });
} }
let dataset = e.currentTarget.dataset let dataset = e.currentTarget.dataset;
wx.$router.go('packageMine.createStaff', dataset) wx.$router.go("packageMine.createStaff", dataset);
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {},
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
onShareAppMessage() {},
});
/* packagesList/mineDetail/pages/staffManage/staffManage.wxss */ /* packagesList/mineDetail/pages/staffManage/staffManage.wxss */
.staff-list-page{ .staff-list-page {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx; padding: 20rpx;
background-color: #F2F3F7; background-color: #F2F3F7;
.btn_box{
.btn_box {
width: 100%; width: 100%;
height: 96rpx; height: 96rpx;
display: flex; display: flex;
...@@ -16,27 +17,33 @@ ...@@ -16,27 +17,33 @@
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
margin-bottom: 32rpx; margin-bottom: 32rpx;
.icon{
.icon {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin-right: 16rpx; margin-right: 16rpx;
vertical-align: -12rpx vertical-align: -12rpx
} }
} }
.title-box{
.title-box {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.title{
.title {
color: #323436; color: #323436;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
.number{
.number {
color: var(--btnColor) color: var(--btnColor)
} }
} }
.select-box{
.select-box {
display: flex; display: flex;
.select-btn { .select-btn {
box-sizing: border-box; box-sizing: border-box;
padding: 16rpx 0; padding: 16rpx 0;
...@@ -44,6 +51,7 @@ ...@@ -44,6 +51,7 @@
align-items: center; align-items: center;
z-index: 2; z-index: 2;
background-color: #f2f3f7; background-color: #f2f3f7;
.type { .type {
margin-left: 8px; margin-left: 8px;
display: flex; display: flex;
...@@ -56,12 +64,14 @@ ...@@ -56,12 +64,14 @@
border-radius: 14px; border-radius: 14px;
font-size: 12px; font-size: 12px;
color: #8a8c90; color: #8a8c90;
text{
text {
max-width: 360rpx; max-width: 360rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.point { .point {
margin-left: 2px; margin-left: 2px;
width: 12px; width: 12px;
...@@ -71,33 +81,42 @@ ...@@ -71,33 +81,42 @@
} }
} }
} }
.item-box{
.item-box {
width: 100%; width: 100%;
background: #FFFFFF; background: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.top{
.top {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 24rpx 32rpx; padding: 24rpx 32rpx;
.message{
.message {
display: flex; display: flex;
.avatar{
.avatar {
flex-shrink: 0; flex-shrink: 0;
width: 72rpx; width: 72rpx;
height: 72rpx; height: 72rpx;
margin-right: 12rpx; margin-right: 12rpx;
border-radius: 50%; border-radius: 50%;
} }
.message-text{
.message-text {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
justify-content: center; justify-content: center;
.name{
.name {
color: #323436; color: #323436;
font-size: 28rpx; font-size: 28rpx;
.type_tips{
.type_tips {
background: #F1F3F9; background: #F1F3F9;
border: 2rpx solid #FFFFFF; border: 2rpx solid #FFFFFF;
border-radius: 8rpx; border-radius: 8rpx;
...@@ -107,18 +126,28 @@ ...@@ -107,18 +126,28 @@
color: #6B7384; color: #6B7384;
} }
} }
.mobile{
.mobile {
color: #858A94; color: #858A94;
font-size: 26rpx; font-size: 26rpx;
} }
} }
} }
.arrow_right{
.arrow_right {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;
} }
.auditstatus {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 24rpx;
color: #3666FE;
}
} }
.bottom{
.bottom {
padding: 0 32rpx; padding: 0 32rpx;
height: 72rpx; height: 72rpx;
background-color: #FFF9F2; background-color: #FFF9F2;
...@@ -127,13 +156,15 @@ ...@@ -127,13 +156,15 @@
justify-content: space-between; justify-content: space-between;
font-size: 24rpx; font-size: 24rpx;
color: #8A8C90; color: #8A8C90;
.service_name{
.service_name {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
} }
.bottomTips { .bottomTips {
text-align: center; text-align: center;
color: #393b3e; color: #393b3e;
...@@ -141,4 +172,207 @@ ...@@ -141,4 +172,207 @@
height: 60rpx; height: 60rpx;
line-height: 40rpx; 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 #0000001a;
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 \ No newline at end of file
<!--packagesList/mineDetail/pages/staffManage/staffManage.wxml--> <!--packagesList/mineDetail/pages/staffManage/staffManage.wxml-->
<wxs src="../index.wxs" module="format" /> <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"> <view class="btn_box" bindtap="jump">
<glsx-image src="index/apply.png" class="icon" /> <glsx-image src="index/apply.png" class="icon" />
<text>创建新员工</text> <text>创建新员工</text>
</view> </view>
<view class="content-box"> <view class="content-box">
<view class="title-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-box">
<view class="select-btn"> <view class="select-btn">
<view class="type" bindtap="handleStaffTypeChange"> <view class="type" bindtap="handleStaffTypeChange">
...@@ -23,43 +27,70 @@ ...@@ -23,43 +27,70 @@
</view> </view>
</view> </view>
</view> </view>
<block wx:if="{{staffList.length}}"> <block wx:if="{{ staffList.length }}">
<scroll-view scroll-y <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 }}">
enable-back-to-top <view class="item-box" wx:for="{{ staffList }}" wx:key="index" bindtap="jump" data-info="{{ item }}">
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="top">
<view class="message"> <view class="message">
<glsx-image wx:if="{{!item.weChatAvatarUrl}}" src="personal/staff_defalut_avatar.png" class="avatar"/> <glsx-image wx:if="{{ !item.weChatAvatarUrl }}" src="personal/staff_defalut_avatar.png" class="avatar" />
<image wx:else src="{{item.weChatAvatarUrl}}" class="avatar"></image> <image wx:else src="{{ item.weChatAvatarUrl }}" class="avatar"></image>
<view class="message-text"> <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 class="mobile">{{format.formatMobile(item.staffPhone)}}</view>
</view> </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>
<view class="bottom"> <view class="bottom">
<view class="service_name"> <view class="service_name">所属:{{item.merchantName}}</view>
所属:{{item.merchantName}}
</view>
<view class="time">{{item.createdDate}}</view> <view class="time">{{item.createdDate}}</view>
</view> </view>
</view> </view>
<view class="bottomTips" wx:if="{{nothing}}">到底啦!</view> <view class="bottomTips" wx:if="{{ nothing }}">到底啦!</view>
</scroll-view> </scroll-view>
</block> </block>
<block wx:else> <block wx:else>
<nothing-tips tips="暂无员工~" bgColor="{{'#F2F3F7'}}" bg="{{bgUrl}}" /> <nothing-tips tips="暂无员工~" bgColor="{{ '#F2F3F7' }}" bg="{{ bgUrl }}" />
</block> </block>
</view> </view>
</view> </view>
<select-service-popup wx:if="{{popupShow}}" bind:hidePopup="filterTypeFn" bind:getStaffList="getStaffList" selectInfo="{{selectInfo}}" popShow="{{popupShow}}" serviceRange="{{serviceList}}" /> <view hidden="{{ tabIndx==0 }}" class="scrollCon">
<staff-type-popup wx:if="{{staffPopupShow}}" bind:hidePopup="handleStaffTypeChange" selectInfo="{{selectInfo}}" staffTypeSelectInfo="{{staffTypeSelectInfo}}" bindconfirm="getStaffList" popShow="{{staffPopupShow}}"/> <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 \ No newline at end of file
...@@ -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 = 3 let index = 2
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!