Commit d19fc37a by 岑成威

Merge branch 'sass+v5.8.2' of http://192.168.3.233:8090/saas_plus/regional-assis…

…tant into sass+v5.8.2
2 parents 3c59ac5f 4597d250
Showing 27 changed files with 648 additions and 335 deletions
...@@ -100,8 +100,7 @@ ...@@ -100,8 +100,7 @@
"pages/performanceRating/batchOperation/batchOperation", "pages/performanceRating/batchOperation/batchOperation",
"pages/validReferralCount/referraCountEdit/referraCountEdit", "pages/validReferralCount/referraCountEdit/referraCountEdit",
"pages/attendanceStatis/attendanceDetail/attendanceDetail", "pages/attendanceStatis/attendanceDetail/attendanceDetail",
"pages/appealFormManage/appealFormDetail/appealFormDetail", "pages/appealFormManage/appealFormDetail/appealFormDetail"
"pages/residentManage/createStaff"
] ]
}, },
{ {
......
...@@ -126,8 +126,10 @@ Component({ ...@@ -126,8 +126,10 @@ Component({
// 单选:取消其他,选中当前 // 单选:取消其他,选中当前
const currentVal = item[valueKey] const currentVal = item[valueKey]
const display = this.data.displayOptions.map((it, idx) => ({ ...it, checked: idx === index ? !it.checked : false })) const display = this.data.displayOptions.map((it, idx) => ({ ...it, checked: idx === index ? !it.checked : false }))
const selected = display[index].checked ? [currentVal] : [] const selected = display[index].checked ? [currentVal] : []
this.setData({ displayOptions: display, selectedValues: selected }) this.setData({ displayOptions: display, selectedValues: selected })
const copyDisplay = this.data.copyDisplayOptions.map((it, idx) => ({ ...it, checked: idx === index ? !it.checked : false }))
this.setData({ copyDisplayOptions: copyDisplay })
this.triggerEvent('change', { values: selected, items: this.getSelectedItems() }) this.triggerEvent('change', { values: selected, items: this.getSelectedItems() })
if (this.properties.confirmOnSelect) { if (this.properties.confirmOnSelect) {
this.onConfirm() this.onConfirm()
...@@ -164,8 +166,8 @@ Component({ ...@@ -164,8 +166,8 @@ Component({
this.triggerEvent('cancel') this.triggerEvent('cancel')
}, },
onConfirm() { onConfirm() {
const values = this.data.selectedValues const values = this.data.selectedValues
const items = this.getSelectedItems() const items = this.getSelectedItems()
this.triggerEvent('confirm', { values, items }) this.triggerEvent('confirm', { values, items })
}, },
getSelectedItems() { getSelectedItems() {
......
...@@ -38,5 +38,10 @@ module.exports = { ...@@ -38,5 +38,10 @@ module.exports = {
/** 根据人员获取业务场景数据 */ /** 根据人员获取业务场景数据 */
getBaseSceneCodeList(data) { getBaseSceneCodeList(data) {
return api.post("dj.api.scenemerchantref.findAllSceneByMerchantId", data) return api.post("dj.api.scenemerchantref.findAllSceneByMerchantId", data)
},
/** 新增员工-获取北森待激活的员工数据 */
getEmployeeOnTheJobList(data) {
return api.post("dj.api.smartcarlife.staffBaseInfo.pageList", data)
} }
};
\ No newline at end of file \ No newline at end of file
};
...@@ -309,20 +309,31 @@ Component({ ...@@ -309,20 +309,31 @@ Component({
}) })
}, },
goToStaff(e) { goToStaff(e) {
let { let {
index index
} = e.currentTarget.dataset, { } = e.currentTarget.dataset, {
accountList accountList
} = this.data; } = this.data;
let { let {
staffPhone, staffPhone,
staffName, staffName,
staffId staffId
} = accountList[index] } = accountList[index]
wx.navigateTo({ let pageInstance = wx.$router.getPageInstance()
url: `/packageWorkspace/pages/residentManage/createStaff?staffPhone=${staffPhone}&staffName=${staffName}&staffId=${staffId}`
}) pageInstance.setData({
}, activeIndex: 0
}, () => {
let thisPage = pageInstance.selectComponent(`#componet-0`)
thisPage.setData({
'staffObj.staffName': staffName,
'staffObj.staffPhone': staffPhone,
'staffObj.staffId': staffId,
namePhoneDisabled: true
})
})
},
// 触底刷新 // 触底刷新
mineReachBottom() { mineReachBottom() {
console.log('触底') console.log('触底')
...@@ -354,11 +365,9 @@ Component({ ...@@ -354,11 +365,9 @@ Component({
}) })
}, },
}, },
// lifetimes: { lifetimes: {
// attached: function () { attached: function () {
// this.getData() this.getData()
// } }
},
// },
}) })
\ No newline at end of file \ No newline at end of file
/* tabWorkOrder/pages/residentManage/components/accountAllocation/index.wxss */ /* tabWorkOrder/pages/residentManage/components/accountAllocation/index.wxss */
.container {
height: calc(100% - 104rpx);
}
.search-input { .search-input {
// border: 1rpx solid #979797; // border: 1rpx solid #979797;
background: #ffffff; background: #ffffff;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<block wx:if="{{ isFlag }}"> <block wx:if="{{ isFlag }}">
<scroll-view <scroll-view
class="account-box" class="account-box"
style="height: calc(100vh - var(--fontSize540));" style="height: calc(100% - var(--fontSize340));"
enhanced="{{ true }}" enhanced="{{ true }}"
show-scrollbar="{{ false }}" show-scrollbar="{{ false }}"
scroll-y scroll-y
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
"usingComponents": { "usingComponents": {
"business-type":"../businessType/index", "business-type":"../businessType/index",
"shop-merchant":"../shopMerchant/index", "shop-merchant":"../shopMerchant/index",
"yq-merchant":"../yqMerchant/index" "yq-merchant":"../yqMerchant/index",
"select-popup":"../../../../components/selectPopup/selectPopup",
"staff-select-popup": "../staffSelectPopup/index"
} }
}
\ No newline at end of file \ No newline at end of file
}
/* tabWorkOrder/pages/residentManage/components/addStaff/index.wxss */ /* tabWorkOrder/pages/residentManage/components/addStaff/index.wxss */
.container { .container {
margin: var(--fontSize16) var(--fontSize24); margin: 0 var(--fontSize24);
border-radius: 16rpx; border-radius: 16rpx;
opacity: 1; opacity: 1;
box-sizing: border-box; box-sizing: border-box;
...@@ -39,7 +39,10 @@ ...@@ -39,7 +39,10 @@
height: 100%; height: 100%;
} }
.between{ .between{
text-align:right; text-align:right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.placeholder-class { .placeholder-class {
color: #BBBBBB; color: #BBBBBB;
......
<!--tabWorkOrder/pages/residentManage/components/addStaff/index.wxml--> <!--tabWorkOrder/pages/residentManage/components/addStaff/index.wxml-->
<view class="container">
<view class="top-box">
<view>
<view class="title">增设新员工门店账号</view>
<view class="info">增设的员工账号支持该手机号所绑定的员工登录「嘀加区域助手」小程序开展业务录单。
仅支持新增深圳嘀加服务商下的员工账号</view>
</view>
<image class="staff-icon" src="{{IMG_URL}}add-staff.png" mode=""/>
</view>
<view class="box">
<gl-cell border valueAlign="right" label="员工姓名" cellHeight="{{cellHeight}}" cellStyle="{{cellStyle}}" requiredAfter labelWidth="var(--fontSize290)" required>
<input placeholder="请输入" disabled style="color: #BBBBBB;" value="{{staffObj.staffName}}" class="input" placeholder-class="placeholder-class" bindinput="input" data-name="staffObj.staffName" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="手机号" cellHeight="{{cellHeight}}" cellStyle="{{cellStyle}}" requiredAfter labelWidth="var(--fontSize140)" required>
<input placeholder="请输入" disabled class="input" style="color: #BBBBBB;" value="{{staffObj.staffPhone}}" type="number" maxlength="11" placeholder-class="placeholder-class" bindinput="input" bindblur="phoneBlur" data-name="staffObj.staffPhone" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" required label="归属门店" cellHeight="{{cellHeight}}" cellStyle="{{cellStyle}}" requiredAfter labelWidth="var(--fontSize180)" haveArrow bindclick="showPopup" data-show-name="shopMerchantBox" placeholder="点击选择">
<block wx:if="{{ staffObj.merchantId }}">
<view class="between">{{staffObj.merchantName}}{{staffObj.merchantId}}</view>
</block>
</gl-cell>
<gl-cell border valueAlign="right" label="所属业务" cellHeight="{{cellHeight}}" cellStyle="{{cellStyle}}" requiredAfter labelWidth="var(--fontSize180)" required haveArrow bindclick="showPopup"data-show-name="isBusiness" placeholder="点击选择">
<block wx:if="{{ staffObj.staffSceneLabelText }}">
<view class="between">{{staffObj.staffSceneLabelText}}</view>
</block>
</gl-cell>
<gl-cell valueAlign="right" label="关联账号" required cellHeight="{{cellHeight}}" cellBoxStyle="{{cellBoxStyle}}" cellStyle="{{cellStyle}}" requiredAfter labelWidth="var(--fontSize290)" haveArrow="{{yqMerchartList.length>1}}" bindclick="showPopup" data-show-name="yqMerchartBox" placeholder="点击选择" >
<block wx:if="{{ staffObj.yqMerchantName }}">
<view class="between">{{staffObj.yqMerchantName}}{{staffObj.yqMerchantId}}</view>
</block>
</gl-cell>
</view>
</view>
<view class="btn" bind:tap="submit">确认开通</view>
<text class="hint">请核对员工姓名、手机号,开通账号后即可</text>
<text class="hint">投入使用。登录密码默认为Aa+手机号</text>
<business-type show="{{isBusiness}}" scene-label="{{staffObj.staffSceneLabel}}" baseSceneList="{{baseSceneList}}" bindconfirm="selectChoose"></business-type>
<shop-merchant show="{{shopMerchantBox}}" scene-label="{{staffObj.staffSceneLabel}}" bindconfirm="selectChooseShop" merchantId="{{staffObj.merchantId}}"></shop-merchant>
<yq-merchant show="{{yqMerchartBox}}" merchantId="{{staffObj.yqMerchantId}}" yqMerchartList="{{yqMerchartList}}"></yq-merchant>
\ No newline at end of file \ No newline at end of file
<scroll-view class="content-box"
style="height: calc(100% - 104rpx);"
scroll-y>
<view style="width: 100%; height: 16rpx;background: transparent;"></view>
<view class="container">
<view class="top-box">
<view>
<view class="title">
增设新员工门店账号
</view>
<view class="info">
增设的员工账号支持该手机号所绑定的员工登录「嘀加区域助手」小程序开展业务录单。仅支持新增深圳嘀加服务商下的员工账号
</view>
</view>
<image class="staff-icon"
src="{{ IMG_URL }}add-staff.png"
mode="" />
</view>
<view class="box">
<gl-cell border
valueAlign="right"
label="员工姓名"
cellHeight="{{ cellHeight }}"
cellStyle="{{ cellStyle }}"
requiredAfter
labelWidth="var(--fontSize160)"
required
haveArrow="{{ !namePhoneDisabled }}"
bindclick="openStaffSelect"
placeholder="点击选择">
<block wx:if="{{ namePhoneDisabled }}">
<input placeholder="请输入"
disabled="{{ namePhoneDisabled }}"
style="color: {{ namePhoneDisabled ? '#BBBBBB' : '' }}"
value="{{ staffObj.staffName }}"
class="input"
placeholder-class="placeholder-class"
bindinput="input"
data-name="staffObj.staffName"
always-embed></input>
</block>
<block wx:else>
<view class="between {{ staffObj.staffName ? '' : 'placeholder-class' }}">
{{ staffObj.staffName || '点击选择' }}
</view>
</block>
</gl-cell>
<gl-cell border
valueAlign="right"
label="手机号"
cellHeight="{{ cellHeight }}"
cellStyle="{{ cellStyle }}"
requiredAfter
labelWidth="var(--fontSize160)"
required>
<input placeholder="请输入"
disabled="{{ true }}"
class="input"
style="color: #BBBBBB"
value="{{ staffObj.staffPhone }}"
type="number"
maxlength="11"
placeholder-class="placeholder-class"
always-embed></input>
</gl-cell>
<gl-cell border
valueAlign="right"
required
label="归属门店"
cellHeight="{{ cellHeight }}"
cellStyle="{{ cellStyle }}"
requiredAfter
labelWidth="var(--fontSize160)"
haveArrow
bindclick="showPopup"
data-show-name="shopMerchantBox"
placeholder="点击选择">
<block wx:if="{{ staffObj.merchantId }}">
<view class="between">
{{ staffObj.merchantName }}{{ staffObj.merchantId }}
</view>
</block>
</gl-cell>
<gl-cell border
valueAlign="right"
label="所属业务"
cellHeight="{{ cellHeight }}"
cellStyle="{{ cellStyle }}"
requiredAfter
labelWidth="var(--fontSize160)"
required
haveArrow
bindclick="showPopup"
data-show-name="isBusiness"
placeholder="点击选择">
<block wx:if="{{ staffObj.staffSceneLabelText }}">
<view class="between">
{{ staffObj.staffSceneLabelText }}
</view>
</block>
</gl-cell>
<gl-cell valueAlign="right"
border
label="关联账号"
required
cellHeight="{{ cellHeight }}"
cellBoxStyle="{{ cellBoxStyle }}"
cellStyle="{{ cellStyle }}"
requiredAfter
labelWidth="var(--fontSize160)"
placeholder="自动关联">
<block wx:if="{{ staffObj.yqMerchantListText }}">
<view class="between" bindtap="showAllYqMerchantListText">
{{ staffObj.yqMerchantListText }}
</view>
</block>
</gl-cell>
<gl-cell valueAlign="right"
label="驻店类型"
required
requiredAfter
cellHeight="{{ cellHeight }}"
cellBoxStyle="{{ cellBoxStyle }}"
cellStyle="{{ cellStyle }}"
labelWidth="var(--fontSize160)"
haveArrow
bindclick="openResidentType"
placeholder="点击选择">
<block wx:if="{{ staffObj.stationTypeText }}">
<view class="between">
{{ staffObj.stationTypeText }}
</view>
</block>
</gl-cell>
</view>
</view>
<view class="btn" bind:tap="submit">
确认开通
</view>
<text class="hint">请核对员工姓名、手机号,开通账号后即可</text><text class="hint">投入使用。登录密码默认为Aa+手机号</text>
</scroll-view>
<business-type show="{{ isBusiness }}"
scene-label="{{ staffObj.staffSceneLabel }}"
baseSceneList="{{ baseSceneList }}"
bindconfirm="selectChoose"></business-type>
<shop-merchant show="{{ shopMerchantBox }}"
scene-label="{{ staffObj.staffSceneLabel }}"
bindconfirm="selectChooseShop"
selectedObj="{{ selectedShopObj }}"></shop-merchant>
<staff-select-popup show="{{staffSelectBox}}" bindconfirm="selectChooseStaff" selectedObj="{{selectedStaffObj}}"></staff-select-popup>
<select-popup show="{{ stationTypeBox }}"
title="选择驻店类型"
options="{{ stationTypeOptions }}"
labelKey="label"
valueKey="value"
value="{{ [staffObj.stationType] }}"
height="40%"
bindconfirm="onResidentTypeConfirm"
bindcancel="onResidentTypeCancel" />
...@@ -48,10 +48,10 @@ Component({ ...@@ -48,10 +48,10 @@ Component({
} = this.data, { } = this.data, {
index index
} = e.currentTarget.dataset; } = e.currentTarget.dataset;
list.forEach(item=>{ if (index === undefined || index === null) return
item.active=false const item = list[index]
}) if (!item) return
list[index].active =true item.active = !item.active
this.setData({ this.setData({
list, list,
}); });
...@@ -84,4 +84,4 @@ Component({ ...@@ -84,4 +84,4 @@ Component({
}); });
}, },
} }
})
\ No newline at end of file \ No newline at end of file
})
...@@ -2,47 +2,46 @@ ...@@ -2,47 +2,46 @@
.box { .box {
// height:200rpx; // height:200rpx;
height: 100%; height: 100%;
// width: calc(100% + var(--fontSize64));
// margin-left: calc(-1 * var(--fontSize32));
} }
.item {
padding: 24rpx 4rpx; .item{
box-sizing: border-box; display: flex;
height: var(--fontSize88);
align-items: center;
color: #292D33;
border-bottom: var(--fontSize1) solid #EFF0F2; border-bottom: var(--fontSize1) solid #EFF0F2;
}
.item-hd { .item:last-child{
display: flex; border-bottom: none;
align-items: center; }
.item.active{
color: #2C66F7;
}
.name { .merchant_item{
max-width: 400rpx; height: var(--fontSize88);
font-weight: 400; font-size: var(--fontSize28);
font-size: 28rpx; display: flex;
color: #292D33; align-items: center;
margin-left: 20rpx; width:94%;
overflow: hidden; }
text-overflow: ellipsis;
}
.total-price { .merchant_item .text-hide{
font-weight: 500; max-width: calc(100% - var(--fontSize192));
font-size: 28rpx; overflow: hidden;
color: #2C66F7; text-overflow: ellipsis;
margin-left: auto; white-space: nowrap;
} }
.icon { .mark{
display: block; width:var(--fontSize32);
width: var(--fontSize32); height: var(--fontSize32);
height: var(--fontSize32); }
}
.icon .arc {
width: 100%;
height: 100%;
border: var(--fontSize2) solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
}
}
\ No newline at end of file \ No newline at end of file
.icon {
width: var(--fontSize32);
height: var(--fontSize32);
display: block;
margin-right: var(--fontSize20);
flex-shrink: 0;
}
<popup show="{{ show }}" title="选择所属业务" bindconfirm="confirm" bindcancel="cancel" height="40%"> <popup show="{{ show }}" title="选择所属业务" bindconfirm="confirm" bindcancel="cancel" height="40%">
<scroll-view scroll-y show-scrollbar="{{false}}" enhanced="true" class="box"> <scroll-view scroll-y show-scrollbar="{{false}}" enhanced="true" class="box">
<block wx:if="{{list.length}}"> <block wx:if="{{list.length}}">
<view class="item" wx:for="{{ list }}"> <block wx:for="{{ list }}" wx:key="index">
<view class="item-hd" catchtap="choose" data-index="{{ index }}"> <view class="item {{ item.active ? 'active' : '' }}" bindtap="choose" data-index="{{ index }}">
<view class="icon" > <view class="merchant_item">
<block wx:if="{{ item.active }}"> <view class="text-hide">{{item.baseSceneCodeName}}</view>
<image src="../../image/radio.png" /> </view>
</block> <view class="mark" wx:if="{{ item.active }}">
<block wx:else> <gl-image class="icon" src="/equity/mark.png" />
<view class="arc" />
</block>
</view> </view>
<view class="name">{{item.baseSceneCodeName}}</view>
</view> </view>
</view> </block>
</block> </block>
<view class="safeAreaInset"></view>
</scroll-view> </scroll-view>
</popup>
\ No newline at end of file \ No newline at end of file
</popup>
...@@ -11,22 +11,24 @@ Component({ ...@@ -11,22 +11,24 @@ Component({
if (n) { if (n) {
this.setData({ this.setData({
pageNum: 1, pageNum: 1,
storeIndex: null,
nothing: false, nothing: false,
keyword:'', keyword:'',
merchantIdName:'', merchantIdName:'',
tempMerchantId: this.data.merchantId, scrollTop: 0,
scrollTop: 0 isFlag: false,
shopMerchantList: []
}, () => { }, () => {
this.getData() this.getData()
this.setData({
selectItem: wx.$util.deepClone(this.data.selectedObj)
})
}) })
} }
} }
}, },
sceneLabel: String, sceneLabel: String,
merchantId: String selectedObj: Object
}, },
/** /**
...@@ -41,8 +43,7 @@ Component({ ...@@ -41,8 +43,7 @@ Component({
total: 0, total: 0,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
storeIndex: null, selectItem: {},
tempMerchantId: '',
shopMerchantList: [] shopMerchantList: []
}, },
/** /**
...@@ -88,21 +89,28 @@ Component({ ...@@ -88,21 +89,28 @@ Component({
merchantIdName, merchantIdName,
pageNum, pageNum,
pageSize pageSize
} }
this.setData({
requestLoading: true
})
if (pageNum == 1) wx.$util.showLoading()
api.getshopMerchantList(params).then(res => { api.getshopMerchantList(params).then(res => {
wx.$util.hideLoading()
this.setData({
requestLoading: false
})
if (res.code == 0) { if (res.code == 0) {
let { let {
list, list,
total total,
pages
} = res.data; } = res.data;
let tempList = pageNum == 1 ? list : [...shopMerchantList, ...res.data.list]; let tempList = pageNum == 1 ? list : [...shopMerchantList, ...res.data.list];
this.setData({ this.setData({
shopMerchantList: tempList, shopMerchantList: tempList,
isFlag: true, isFlag: true,
total: total, total: total,
nothing: pageNum == 1 ? false : total == tempList.length, nothing: pages == pageNum,
}, () => {
if (this.data.tempMerchantId ) this.initData()
}) })
} }
...@@ -117,59 +125,40 @@ Component({ ...@@ -117,59 +125,40 @@ Component({
} = this.data } = this.data
if (pageNum * pageSize >= total) { if (pageNum * pageSize >= total) {
return return
} }
if (this.data.requestLoading) return
this.setData({ this.setData({
pageNum: pageNum + 1 pageNum: pageNum + 1
}, () => { }, () => {
this.getData() this.getData()
}) })
}, },
initData(n) {
let {
shopMerchantList,
storeIndex,
tempMerchantId,
} = this.data;
storeIndex = null
shopMerchantList.forEach((item, index) => {
if (item.shopMerchantId == tempMerchantId) {
storeIndex = index
}
})
this.setData({
storeIndex
})
},
choose(e) { choose(e) {
let { let {
index item
} = e.currentTarget.dataset, } = e.currentTarget.dataset,
{ {
shopMerchantList shopMerchantList
} = this.data, } = this.data
{ console.log(item)
shopMerchantId
} = shopMerchantList[index];
this.setData({ this.setData({
storeIndex: index, selectItem: item,
tempMerchantId:shopMerchantId shopMerchantList
}) })
}, },
confirm() { confirm() {
if (this.data.shopMerchantList.length == 0) return if (this.data.shopMerchantList.length == 0) return
let { let {
shopMerchantList, selectItem
storeIndex
} = this.data; } = this.data;
if(storeIndex===null) { if(!Object.keys(selectItem).length) {
wx.$util.showToast('请选择门店'); wx.$util.showToast('请选择门店');
return return
} }
let { let {
shopMerchantId, shopMerchantId,
shopMerchantName shopMerchantName
} = shopMerchantList[storeIndex]; } = selectItem;
this.setData({ this.setData({
show: false show: false
}, () => { }, () => {
...@@ -193,9 +182,6 @@ Component({ ...@@ -193,9 +182,6 @@ Component({
thisPage.setData({ thisPage.setData({
shopMerchantBox: false, shopMerchantBox: false,
}) })
this.setData({
storeIndex: 0
})
}, },
} }
......
...@@ -10,16 +10,19 @@ ...@@ -10,16 +10,19 @@
<scroll-view class="store-select-box" scroll-top="{{scrollTop}}" style="height: calc(100% - var(--fontSize82));" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-y bindscrolltolower="mineReachBottom"> <scroll-view class="store-select-box" scroll-top="{{scrollTop}}" style="height: calc(100% - var(--fontSize82));" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-y bindscrolltolower="mineReachBottom">
<view class="merchant-box" wx:if="{{shopMerchantList.length>0}}"> <view class="merchant-box" wx:if="{{shopMerchantList.length>0}}">
<block wx:for="{{shopMerchantList}}" wx:key="index"> <block wx:for="{{shopMerchantList}}" wx:key="index">
<view class="item {{storeIndex===index?'active':''}}" bindtap="choose" data-index="{{index}}"> <view class="item {{selectItem.shopMerchantId == item.shopMerchantId ? 'active' : ''}}" bindtap="choose" data-item="{{item}}" data-index="{{index}}">
<view class="merchant_item"> <view class="merchant_item">
<view class="text-hide">{{item.shopMerchantName}}</view> <view class="text-hide">{{item.shopMerchantName}}</view>
<view>{{item.shopMerchantId}}</view> <view>{{item.shopMerchantId}}</view>
</view> </view>
<view class="mark" wx:if="{{storeIndex===index}}"> <view class="mark" wx:if="{{selectItem.shopMerchantId == item.shopMerchantId}}">
<gl-image class="icon" src="/equity/mark.png" /> <gl-image class="icon" src="/equity/mark.png" />
</view> </view>
</view> </view>
</block> </block>
<block wx:if="{{requestLoading}}">
<view class="list-nothing">加载中</view>
</block>
<block wx:if="{{nothing}}"> <block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view> <view class="list-nothing">到底了~</view>
</block> </block>
......
// packageWorkspace/pages/residentManage/components/staffSelectPopup/index.js
import api from '../../api'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
observer: function (n) {
if (n) {
this.setData({
pageNum: 1,
nothing: false,
keyword:'',
staffName:'',
scrollTop: 0,
selectedObj: wx.$util.deepClone(this.data.selectedObj),
staffList: [],
isFlag: false
}, () => {
this.getData()
})
}
}
},
sceneLabel: String,
selectedObj: Object
},
/**
* 组件的初始数据
*/
data: {
keyword: '',
staffName: '',
scrollTop: 0,
nothing: false,
isFlag: false,
total: 0,
pageNum: 1,
pageSize: 20,
selectItem: {},
staffList: []
},
/**
* 组件的方法列表
*/
methods: {
clear() {
this.setData({
keyword: "",
staffName:''
});
this.search();
},
input(e) {
let {
value
} = e.detail;
this.setData({
keyword: value
});
},
search() {
this.setData({
staffName:this.data.keyword,
pageNum:1,
accountList: [],
isFlag: false,
nothing: false,
}, () => {
this.getData()
});
},
getData() {
let {
staffList,
staffName,
pageNum,
pageSize
} = this.data
let params = {
staffName,
pageNum,
pageSize
}
if (pageNum == 1) wx.$util.showLoading()
if (this.data.requestLoading) return
this.setData({
requestLoading: true
})
api.getEmployeeOnTheJobList(params).then(res => {
wx.$util.hideLoading()
this.setData({requestLoading: false})
if (res.code == 0) {
let {
list,
total,
pages
} = res.data;
res.data?.list?.forEach(val => {
val.staffId = val.id
})
let tempList = pageNum == 1 ? list : [...staffList, ...res.data.list];
this.setData({
staffList: tempList,
isFlag: true,
total: total,
nothing: pageNum == pages
})
}
})
},
// 触底刷新
mineReachBottom() {
let {
pageNum,
total,
pageSize
} = this.data
if (this.data.requestLoading) return
if (pageNum * pageSize >= total) {
return
}
this.setData({
pageNum: pageNum + 1
}, () => {
this.getData()
})
},
choose(e) {
let {item} = e.currentTarget.dataset,
{
staffList
} = this.data
this.setData({
selectItem: item,
staffList
})
},
confirm() {
if (this.data.staffList.length == 0) return
let {
selectItem
} = this.data;
if(!Object.keys(selectItem).length) {
wx.$util.showToast('请选择员工');
return
}
let {
staffPhone,
staffName,
staffId
} = selectItem;
this.setData({
show: false
}, () => {
this.triggerEvent("confirm",{ staffPhone, staffName, staffId})
})
},
hidePopup() {
let pageInstance = wx.$router.getPageInstance()
let thisPage = pageInstance.selectComponent(`#componet-0`)
thisPage.setData({
staffSelectBox: false,
})
},
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageWorkspace/pages/residentManage/components/staffSelectPopup/index.wxss */
.title{
margin-bottom: var(--fontSize20);
color: #292D33;
font-weight: 400;
font-size: var(--fontSize32);
}
.staff-select-box{
height: calc(100% - var(--fontSize168));
}
.staff-box{
height:100%;
}
.staff-box .item{
display: flex;
height: var(--fontSize88);
align-items: center;
color: #292D33;
border-bottom: var(--fontSize1) solid #EFF0F2;
}
.staff-box .item:last-child{
border-bottom: none;
}
.staff-box .item.active{
color: #2C66F7;
}
.item .staff_item{
height: var(--fontSize88);
font-size: var(--fontSize28);
display: flex;
align-items: center;
width:94%;
}
.item .staff_item .text-hide{
max-width: calc(100% - var(--fontSize192));
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.item .icon {
width: var(--fontSize32);
height: var(--fontSize32);
display: block;
margin-right: var(--fontSize20);
flex-shrink: 0;
}
.item .icon .arc {
width: 100%;
height: 100%;
border: var(--fontSize2) solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
.mark{
width:var(--fontSize32);
height: var(--fontSize32);
}
.list-nothing,
.list-not {
text-align: center;
font-size: 28rpx;
color: #979797;
}
.search-input {
// border: 1rpx solid #979797;
background: #F7F8FA;
border-radius: var(--fontSize38);
//width: calc(100% - var(--fontSize64));
height: var(--fontSize72);
display: flex;
align-items: center;
margin: 16rpx 0;
}
.search-input .search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin: 0 var(--fontSize10) 0 var(--fontSize26);
}
.search-input .search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.search-input .input {
font-size: var(--fontSize28);
height: var(--fontSize38);
line-height: var(--fontSize38);
width: calc(100% - var(--fontSize136));
}
.input-placeholder {
color: rgba(200, 201, 204, .89);
}
\ No newline at end of file \ No newline at end of file
<!--packageWorkspace/pages/residentManage/components/staffSelectPopup/index.wxml-->
<popup title="选择员工" show="{{ show }}" bindconfirm="confirm" height="85%" bindcancel="hidePopup" class="staff-wrap">
<view class="search-input">
<image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="员工查询" class="input" value="{{ keyword }}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="search" />
<block wx:if="{{ keyword }}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
<block wx:if="{{isFlag}}">
<scroll-view class="staff-select-box" scroll-top="{{scrollTop}}" style="height: calc(100% - var(--fontSize82));" enhanced="{{true}}" show-scrollbar="{{false}}" scroll-y bindscrolltolower="mineReachBottom">
<view class="staff-box" wx:if="{{staffList.length>0}}">
<block wx:for="{{staffList}}" wx:key="index">
<view class="item {{selectItem.staffId == item.id ? 'active' : ''}}" bindtap="choose" data-item="{{item}}">
<view class="staff_item">
<view class="text-hide">{{item.staffName}}</view>
</view>
<view class="mark" wx:if="{{selectItem.staffId == item.id}}">
<gl-image class="icon" src="/equity/mark.png" />
</view>
</view>
</block>
<view class="list-nothing" wx:if="{{requestLoading}}">加载中</view>
<block wx:if="{{nothing}}">
<view class="list-nothing">到底了~</view>
</block>
</view>
<view class="no-data" wx:if="{{!staffList.length}}">
<empty-data />
</view>
</scroll-view>
</block>
</popup>
\ No newline at end of file \ No newline at end of file
// packageWorkspace/pages/residentManage/createStaff.js
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
Page({
/**
* 页面的初始数据
*/
data: {
navStyle: 'background-color: transparent',
navBarHeight: 88,
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let comp = this.selectComponent('#componet-0')
if (comp) {
comp.setData({
'staffObj.staffName': options?.staffName,
'staffObj.staffPhone': options?.staffPhone,
'staffObj.staffId': options?.staffId
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
back() {
wx.$router.back()
},
getBaseSceneList() {
getBaseSceneCodeList
},
checkRequired(obj) {
let target = [
"staffName",
"staffPhone",
"staffSceneLabel",
"merchantId",
"yqMerchantId"
];
obj = {
...obj
};
if (!phoneRex.test(obj.staffPhone)) {
this.showToast("请输入正确的手机号");
return true;
}
try {
target.map((key) => {
if (!obj[key]) {
throw key;
}
});
} catch (error) {
return error;
}
return false;
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"add-staff":"./components/addStaff/index"
},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
/* packageWorkspace/pages/residentManage/createStaff.wxss */
page {
background: #F7F8FA;
}
.bg {
width: 100%;
height: var(--fontSize400);
background: linear-gradient(0deg, #e8f0fb00 0%, #dde8fb 100%);
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
\ No newline at end of file \ No newline at end of file
<!--packageWorkspace/pages/residentManage/createStaff.wxml-->
<navigation-bar bindnavbarReady="navbarReady" class="navigation-bar-wrap" bindback="back" showBack="true" navStyle="{{navStyle}}">新增员工</navigation-bar>
<view class="bg"></view>
<view class="content" style="margin-top: {{navBarHeight}}px;">
<add-staff id="componet-0"></add-staff>
</view>
...@@ -10,7 +10,15 @@ Page({ ...@@ -10,7 +10,15 @@ Page({
data: { data: {
navStyle: 'background-color: transparent', navStyle: 'background-color: transparent',
list: ['新增员工', '调店账号分配'], list: ['新增员工', '调店账号分配'],
activeIndex:0 activeIndex: 0,
navBarHeight: 113.5
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
}, },
/** /**
...@@ -22,28 +30,35 @@ Page({ ...@@ -22,28 +30,35 @@ Page({
checkRequired(obj) { checkRequired(obj) {
let target = [ let target = [
"staffName", "staffName",
"staffPhone", "staffPhone",
"merchantId",
"staffSceneLabel", "staffSceneLabel",
"merchantId", "yqMerchantList",
"yqMerchantId" "stationType"
]; ];
obj = { obj = {
...obj ...obj
}; };
if (!phoneRex.test(obj.staffPhone)) {
this.showToast("请输入正确的手机号");
return true;
}
try { try {
target.map((key) => { target.map((key) => {
if (key === "yqMerchantList") {
const hasList = Array.isArray(obj.yqMerchantList) && obj.yqMerchantList.length > 0
if (!hasList) throw key
return
}
if (!obj[key]) { if (!obj[key]) {
throw key; throw key;
} }
}); });
} catch (error) { } catch (error) {
return error; return error;
} }
if (!phoneRex.test(obj.staffPhone)) {
this.showToast("请输入正确的手机号");
return true;
}
return false; return false;
}, },
/** /**
...@@ -57,8 +72,6 @@ Page({ ...@@ -57,8 +72,6 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
const comp = this.selectComponent("#componet-1");
comp.getData && comp.getData()
}, },
back() { back() {
wx.$router.back() wx.$router.back()
...@@ -106,4 +119,4 @@ Page({ ...@@ -106,4 +119,4 @@ Page({
onShareAppMessage() { onShareAppMessage() {
} }
})
\ No newline at end of file \ No newline at end of file
})
{ {
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"add-staff": "./components/addStaff/index",
"account-allocation":"./components/accountAllocation/index" "account-allocation":"./components/accountAllocation/index"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -14,8 +14,8 @@ page { ...@@ -14,8 +14,8 @@ page {
} }
.content { .content {
margin-top: 176rpx; box-sizing: border-box;
height: 100vh;
.tabs { .tabs {
margin: 0 40rpx; margin: 0 40rpx;
display: flex; display: flex;
......
<navigation-bar bindnavbarReady="navbarReady" class="navigation-bar-wrap" bindback="back" showBack="true" navStyle="{{navStyle}}">驻店管理</navigation-bar> <navigation-bar bindnavbarReady="navbarReady" class="navigation-bar-wrap" bindback="back" showBack="true" navStyle="{{navStyle}}">驻店管理</navigation-bar>
<view class="bg"></view> <view class="bg"></view>
<view class="content"> <view class="content" style="padding-top: {{navBarHeight}}px;">
<account-allocation id="componet-1"></account-allocation> <view class="tabs" >
<view wx:for="{{list}}" wx:key="index" class="tab {{activeIndex==index?'active':''}}" data-index="{{index}}" bind:tap="changeHandle">{{item}}</view>
</view>
<add-staff id="componet-0" wx:if="{{activeIndex===0}}"></add-staff>
<account-allocation id="componet-1" wx:if="{{activeIndex===1}}"></account-allocation>
</view> </view>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!