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 672b7747
authored
Aug 17, 2023
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
d54bcf2b
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
79 additions
and
56 deletions
pages/tab/outputValue/components/ScreenBox/ScreenBox.js
pages/tab/outputValue/components/ScreenBox/ScreenBox.wxml
pages/tab/outputValue/components/ScreenConfirmBox/ScreenConfirmBox.js
pages/tab/outputValue/components/ScreenConfirmBox/ScreenConfirmBox.wxml
pages/tab/outputValue/components/SwitchAccountPopup/SwitchAccountPopup.js
pages/tab/outputValue/components/SwitchAccountPopup/SwitchAccountPopup.wxml
pages/tab/outputValue/components/selectMerchantPopup/selectMerchantPopup.js
pages/tab/outputValue/components/selectMerchantPopup/selectMerchantPopup.wxml
pages/tab/outputValue/outputValue.js
pages/tab/outputValue/outputValue.wxml
pages/tab/outputValue/components/ScreenBox/ScreenBox.js
View file @
672b774
...
...
@@ -24,7 +24,6 @@ Component({
attached
()
{
// 获取服务商下4s店
this
.
getMerchantList
()
console
.
log
(
this
.
data
.
tabType
,
'123123'
)
},
},
/**
...
...
pages/tab/outputValue/components/ScreenBox/ScreenBox.wxml
View file @
672b774
...
...
@@ -10,6 +10,6 @@
</view>
</view>
<!-- 选择门店 -->
<select-merchant-popup wx:if="{{popupShow}}" bind:hidePopup="handleSlectMerchant" bindmerchantConfirm="handleMerchantChange" selectInfo="{{formData}}" popShow="{{popupShow}}"
service
Range="{{merchantList}}" isTab="{{true}}"/>
<select-merchant-popup wx:if="{{popupShow}}" bind:hidePopup="handleSlectMerchant" bindmerchantConfirm="handleMerchantChange" selectInfo="{{formData}}" popShow="{{popupShow}}"
merchant
Range="{{merchantList}}" isTab="{{true}}"/>
<!-- 筛选 -->
<screen-confirm-box wx:if="{{confirmShow}}" tabBarStyle="{{tabBarStyle}}" show="{{confirmShow}}" formData="{{formData}}" tabType="{{tabType}}"></screen-confirm-box>
\ No newline at end of file
<screen-confirm-box wx:if="{{confirmShow}}" tabBarStyle="{{tabBarStyle}}" show="{{confirmShow}}" formData="{{formData}}" tabType="{{tabType}}" bindreloadMerchantList="getMerchantList"></screen-confirm-box>
\ No newline at end of file
pages/tab/outputValue/components/ScreenConfirmBox/ScreenConfirmBox.js
View file @
672b774
...
...
@@ -33,7 +33,6 @@ Component({
isSuper
:
false
,
servicePopupShow
:
false
,
merchantRange
:
[],
subIndex
:
0
,
sceneList
:
[
{
id
:
''
,
...
...
@@ -87,25 +86,18 @@ Component({
USERAPI
.
adminSelectLogin
()
.
then
(
result
=>
{
let
{
merchantList
:
merchantRange
}
=
result
let
subIndex
=
-
1
merchantRange
.
forEach
((
item
,
index
)
=>
{
item
.
show
=
true
if
(
item
.
merchantId
==
userInfo
.
subLoginUser
.
merchantId
)
{
subIndex
=
index
item
.
act
=
true
}
})
this
.
setData
({
merchantRange
,
subIndex
merchantRange
})
})
.
catch
(
err
=>
{
})
}
else
{
let
merchantRange
=
[{
merchantId
:
userInfo
.
subLoginUser
.
merchantId
,
merchantName
:
userInfo
.
subLoginUser
.
merchantName
}]
this
.
setData
({
merchantRange
,
subIndex
:
0
merchantRange
})
}
},
...
...
@@ -125,6 +117,7 @@ Component({
subIndex
,
formData
})
if
(
this
.
data
.
tabType
==
1
&&
merchantId
!==
userInfo
?.
subLoginUser
?.
merchantId
)
this
.
getStaffList
()
this
.
servicePicker
()
},
// 服务商切换
...
...
@@ -132,8 +125,6 @@ Component({
this
.
setData
({
servicePopupShow
:
!
this
.
data
.
servicePopupShow
})
// 根据服务商请求员工数据
this
.
getStaffList
()
},
// 月份确定
dateRangeSelect
(
e
)
{
...
...
@@ -190,8 +181,7 @@ Component({
},
init
()
{
this
.
getMerchantRange
()
this
.
getStaffList
()
console
.
log
(
this
.
data
.
tabType
,
'tabType'
)
if
(
this
.
data
.
tabType
==
1
)
this
.
getStaffList
()
// 我的员工有员工筛选条件
},
choose
(
e
)
{
let
{
index
,
listName
}
=
e
.
currentTarget
.
dataset
...
...
@@ -214,8 +204,6 @@ Component({
this
.
setData
({
formData
})
// 请求员工数据
this
.
getStaffList
()
break
}
this
.
setData
({
...
...
@@ -229,13 +217,14 @@ Component({
formData
.
sceneType
=
sceneList
.
filter
(
val
=>
val
.
active
)[
0
]?.
id
||
''
formData
.
staffUUIDs
=
staffList
.
filter
(
val
=>
val
.
active
).
map
(
subVal
=>
{
return
subVal
.
userId
})
const
thisPage
=
wx
.
$router
.
getPageInstance
()
// 切换登录账号
console
.
log
(
formData
?.
partnerMerchantIds
[
0
])
if
(
formData
?.
partnerMerchantIds
[
0
]
!==
userInfo
.
subLoginUser
.
merchantId
)
{
USERAPI
.
switchSubLoginInfo
({
merchantId
:
formData
?.
partnerMerchantIds
[
0
]
}).
then
(
res
=>
{
console
.
log
(
res
)
setUserInfo
(
res
)
wx
.
$api
.
hideLoading
()
this
.
triggerEvent
(
'reloadMerchantList'
)
// 切换服务商 清空已选的门店
formData
.
shopMerchantIds
=
[]
formData
.
shopMerchantNames
=
'全部门店'
thisPage
.
setData
({
screenFormData
:
formData
})
...
...
@@ -243,28 +232,38 @@ Component({
})
}
else
{
wx
.
$api
.
hideLoading
()
thisPage
.
searchEvent
()
thisPage
.
setData
({
screenFormData
:
formData
})
thisPage
.
searchEvent
()
}
},
reset
()
{
let
{
formData
,
userInfo
,
sceneList
,
staffList
}
=
this
.
data
let
{
formData
,
userInfo
,
sceneList
,
staffList
,
tabType
,
merchantRange
,
subIndex
}
=
this
.
data
formData
.
partnerMerchantIds
=
[
userInfo
.
subLoginUser
.
merchantId
]
formData
.
startTime
=
''
formData
.
endTime
=
''
formData
.
sceneType
=
''
formData
.
staffUUIDs
=
[]
sceneList
.
map
(
val
=>
val
.
active
=
false
)
sceneList
[
0
].
active
=
true
staffList
.
map
(
val
=>
val
.
active
=
false
)
staffList
[
0
].
active
=
true
if
(
tabType
==
0
)
{
sceneList
.
map
(
val
=>
val
.
active
=
false
)
sceneList
[
0
].
active
=
true
}
else
if
(
tabType
==
1
)
{
staffList
.
map
(
val
=>
val
.
active
=
false
)
staffList
[
0
].
active
=
true
}
merchantRange
.
forEach
((
item
,
index
)
=>
{
item
.
show
=
true
if
(
item
.
merchantId
==
userInfo
.
subLoginUser
.
merchantId
)
{
subIndex
=
index
}
})
this
.
setData
({
formData
,
sceneList
,
staffList
staffList
,
merchantRange
,
subIndex
})
this
.
init
()
}
...
...
pages/tab/outputValue/components/ScreenConfirmBox/ScreenConfirmBox.wxml
View file @
672b774
...
...
@@ -80,4 +80,4 @@
</view>
</scroll-view>
<switchAccountPopup wx:if="{{servicePopupShow}}" bind:hidePopup="
tapPicker" bindchangeAccount="changeMerchantRange" popShow="{{servicePopupShow}}" merchantRange="{{merchantRange
}}" hideTab="{{true}}"/>
<switchAccountPopup wx:if="{{servicePopupShow}}" bind:hidePopup="
servicePicker" bindchangeAccount="changeMerchantRange" popShow="{{servicePopupShow}}" merchantRange="{{merchantRange}}" selectInfo="{{formData
}}" hideTab="{{true}}"/>
pages/tab/outputValue/components/SwitchAccountPopup/SwitchAccountPopup.js
View file @
672b774
...
...
@@ -10,9 +10,31 @@ Component({
properties
:
{
popShow
:
{
type
:
Boolean
,
value
:
false
value
:
false
,
observer
:
function
(
n
)
{
if
(
n
)
{
let
{
merchantRange
,
selectInfo
}
=
this
.
data
let
activeIndex
=
merchantRange
.
findIndex
(
v
=>
v
.
merchantId
==
selectInfo
.
partnerMerchantIds
[
0
])
merchantRange
.
forEach
((
item
,
ind
)
=>
{
item
.
show
=
true
if
(
activeIndex
==
ind
)
{
item
.
act
=
true
}
else
{
item
.
act
=
false
}
this
.
setData
({
merchantRange
,
selectedMerchantId
:
selectInfo
.
partnerMerchantIds
[
0
]
})
})
this
.
setData
({
searchKeyword
:
''
})
}
}
},
merchantRange
:
Object
,
selectInfo
:
Object
,
hideTab
:
Boolean
},
...
...
@@ -25,7 +47,6 @@ Component({
},
observers
:
{
merchantRange
:
function
(
e
)
{
// console.log(e)
this
.
setData
({
merchantList
:
e
})
...
...
@@ -60,7 +81,7 @@ Component({
this
.
triggerEvent
(
'changeAccount'
,
actObj
)
},
select
(
e
)
{
let
{
index
}
=
e
.
currentTarget
.
dataset
let
{
index
,
target
}
=
e
.
currentTarget
.
dataset
let
{
merchantRange
}
=
this
.
data
merchantRange
.
forEach
((
item
,
ind
)
=>
{
if
(
index
==
ind
)
{
...
...
@@ -69,16 +90,18 @@ Component({
item
.
act
=
false
}
this
.
setData
({
merchantRange
merchantRange
,
selectedMerchantId
:
target
.
merchantId
})
})
},
input
(
e
)
{
let
{
merchantRange
}
=
this
.
data
let
{
merchantRange
,
selectedMerchantId
}
=
this
.
data
let
{
value
}
=
e
.
detail
merchantRange
.
forEach
(
item
=>
{
item
.
act
=
false
item
.
show
=
item
.
merchantName
.
includes
(
value
)
if
(
item
.
merchantId
==
selectedMerchantId
)
item
.
act
=
true
})
this
.
setData
({
merchantRange
...
...
pages/tab/outputValue/components/SwitchAccountPopup/SwitchAccountPopup.wxml
View file @
672b774
...
...
@@ -41,6 +41,7 @@
class="itemCon text-hide {{item.act?'active':''}}"
hidden="{{!item.show}}"
data-index="{{index}}"
data-target="{{item}}"
bindtap="select">
{{item.merchantName}}
</view>
...
...
pages/tab/outputValue/components/selectMerchantPopup/selectMerchantPopup.js
View file @
672b774
...
...
@@ -13,10 +13,10 @@ Component({
value
:
false
,
observer
:
function
(
n
)
{
if
(
n
)
{
let
{
service
Range
,
selectInfo
}
=
this
.
data
let
activeIndex
=
service
Range
.
findIndex
(
v
=>
v
.
merchantId
==
selectInfo
.
shopMerchantIds
[
0
])
if
(
serviceRange
.
length
)
service
Range
.
unshift
({
merchantId
:
''
,
merchantName
:
'全部'
})
service
Range
.
forEach
((
item
,
ind
)
=>
{
let
{
merchant
Range
,
selectInfo
}
=
this
.
data
let
activeIndex
=
merchant
Range
.
findIndex
(
v
=>
v
.
merchantId
==
selectInfo
.
shopMerchantIds
[
0
])
if
(
merchantRange
.
length
)
merchant
Range
.
unshift
({
merchantId
:
''
,
merchantName
:
'全部'
})
merchant
Range
.
forEach
((
item
,
ind
)
=>
{
item
.
show
=
true
if
(
activeIndex
==
(
ind
-
1
))
{
item
.
act
=
true
...
...
@@ -24,7 +24,8 @@ Component({
item
.
act
=
false
}
this
.
setData
({
serviceRange
merchantRange
,
selectedMerchantId
:
selectInfo
.
shopMerchantIds
[
0
]
})
})
this
.
setData
({
...
...
@@ -33,7 +34,7 @@ Component({
}
}
},
service
Range
:
Object
,
merchant
Range
:
Object
,
selectInfo
:
Object
,
isMerchant
:
Boolean
,
isTab
:
Boolean
...
...
@@ -48,7 +49,7 @@ Component({
searchKeyword
:
''
},
observers
:
{
service
Range
:
function
(
e
)
{
merchant
Range
:
function
(
e
)
{
this
.
setData
({
serviceList
:
e
||
[]
})
...
...
@@ -62,8 +63,8 @@ Component({
this
.
triggerEvent
(
'hidePopup'
)
},
confirm
()
{
let
{
service
Range
,
subIndex
}
=
this
.
data
let
actObj
=
service
Range
.
find
((
item
,
index
)
=>
{
let
{
merchant
Range
,
subIndex
}
=
this
.
data
let
actObj
=
merchant
Range
.
find
((
item
,
index
)
=>
{
if
(
item
.
act
)
{
subIndex
=
index
}
...
...
@@ -84,29 +85,30 @@ Component({
this
.
hidePopup
()
},
select
(
e
)
{
let
{
index
}
=
e
.
currentTarget
.
dataset
let
{
service
Range
}
=
this
.
data
service
Range
.
forEach
((
item
,
ind
)
=>
{
let
{
index
,
target
}
=
e
.
currentTarget
.
dataset
let
{
merchant
Range
}
=
this
.
data
merchant
Range
.
forEach
((
item
,
ind
)
=>
{
if
(
index
==
ind
)
{
item
.
act
=
true
}
else
{
item
.
act
=
false
}
this
.
setData
({
serviceRange
merchantRange
,
selectedMerchantId
:
target
.
merchantId
})
})
},
search
(
e
)
{
let
{
serviceRange
,
selectInfo
}
=
this
.
data
let
{
merchantRange
,
selectedMerchantId
}
=
this
.
data
let
{
value
}
=
e
.
currentTarget
.
dataset
&&
Object
.
keys
(
e
.
currentTarget
.
dataset
).
length
?
e
.
currentTarget
.
dataset
:
e
.
detail
service
Range
.
forEach
(
item
=>
{
merchant
Range
.
forEach
(
item
=>
{
item
.
act
=
false
item
.
show
=
item
.
merchantName
?.
includes
(
value
)
if
(
item
.
merchantId
==
select
Info
.
shopMerchantIds
[
0
]
)
item
.
act
=
true
if
(
item
.
merchantId
==
select
edMerchantId
)
item
.
act
=
true
})
this
.
setData
({
service
Range
merchant
Range
})
},
input
(
e
)
{
...
...
pages/tab/outputValue/components/selectMerchantPopup/selectMerchantPopup.wxml
View file @
672b774
...
...
@@ -39,6 +39,7 @@
<view
class="itemCon text-hide {{item.act?'active':''}}"
data-index="{{index}}"
data-target="{{item}}"
hidden="{{!item.show}}"
bindtap="select">
{{item.merchantName}}
...
...
pages/tab/outputValue/outputValue.js
View file @
672b774
...
...
@@ -56,7 +56,6 @@ Page({
})
},
changeTabIndx
(
e
)
{
console
.
log
(
e
)
this
.
setData
({
tabIndx
:
e
.
detail
})
...
...
@@ -98,7 +97,6 @@ Page({
// merchantModule.init && merchantModule.init()
}
let
{
isSuper
,
userInfo
}
=
this
.
data
console
.
log
(
isSuper
)
// 判断是超管才需要切换账号
if
(
isSuper
)
{
USERAPI
.
adminSelectLogin
()
...
...
pages/tab/outputValue/outputValue.wxml
View file @
672b774
...
...
@@ -3,7 +3,7 @@
<block>
<tab wx:if="{{!isShowFilterScreen}}" noLine="{{true}}" tab="{{tabList}}" itemWidth="{{'136rpx'}}" index="{{tabIndx}}" tabHeight unreadClueCount="{{unreadClueCount}}" bindclick="changeTabIndx" class="tabContainer" />
<view class="screen_box">
<screen-box id="screenBox" formData="{{screenFormData}}" tabType="{{tabInd
e
x}}" tabBarStyle="{{tabBarStyle}}" isShowFilterScreen="{{isShowFilterScreen}}" bindconfirm="screenConfirm" merchantRange="{{merchantRange}}"></screen-box>
<screen-box id="screenBox" formData="{{screenFormData}}" tabType="{{tabIndx}}" tabBarStyle="{{tabBarStyle}}" isShowFilterScreen="{{isShowFilterScreen}}" bindconfirm="screenConfirm" merchantRange="{{merchantRange}}"></screen-box>
</view>
</block>
<block wx:if="{{isShowFilterScreen}}">
...
...
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