Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-assistant-assemble
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 b0fccb57
authored
Apr 26, 2023
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
4c2eba07
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
172 additions
and
114 deletions
login/index/components/Box/Box.scss
packageOutput/components/staff/staff.js
packageOutput/components/staff/staff.wxml
packagesList/outDetail/components/OutputWork/components/OutputLine/OutputLine.scss
packagesList/outDetail/components/OutputWork/index.js
login/index/components/Box/Box.scss
View file @
b0fccb5
...
...
@@ -24,7 +24,7 @@
}
.opacity-view
{
//
animation: opacity-view .5s forwards;
//
animation: opacity-view .5s forwards;
}
.box
{
...
...
packageOutput/components/staff/staff.js
View file @
b0fccb5
// packageOutput/components/staff/staff.js
import
Util
from
'~/utils/util'
import
{
accMul
}
from
'~/utils/format'
Component
({
/**
* 组件的属性列表
*/
properties
:
{
sfaffList
:
{
type
:
Object
,
observer
(
val
)
{
this
.
getDetail
(
val
)
this
.
filterStaff
=
val
this
.
setData
({
selectValue
:
1
})
}
type
:
Object
,
observer
(
val
)
{
console
.
log
(
val
,
'sfaffList'
)
this
.
getDetail
(
val
)
this
.
filterStaff
=
val
this
.
setData
({
selectValue
:
1
})
}
},
tabelTh
:
{
type
:
Object
,
value
:
[]
type
:
Object
,
value
:
[]
},
downType
:
{
type
:
String
,
value
:
'boutique'
type
:
String
,
value
:
'boutique'
}
},
...
...
@@ -28,51 +34,51 @@ Component({
*/
data
:
{
dataType
:
{
crowType
:
[{
label
:
'产值'
,
value
:
1
},
{
label
:
'转发次数'
,
value
:
2
},
{
label
:
'访客总数'
,
value
:
3
},
{
label
:
'浏览总数'
,
value
:
4
},
{
label
:
'成交单量'
,
value
:
5
},
{
label
:
'转化率'
,
value
:
6
}],
boutique
:
[{
label
:
'产值'
,
value
:
1
},
{
label
:
'单量'
,
value
:
2
},
{
label
:
'客单量'
,
value
:
3
},
{
label
:
'转化率'
,
value
:
4
}],
equity
:
[{
label
:
'产值'
,
value
:
1
},
{
label
:
'成交量'
,
value
:
2
},
{
label
:
'报价量'
,
value
:
3
},
{
label
:
'转化率'
,
value
:
4
}]
crowType
:
[{
label
:
'产值'
,
value
:
1
},
{
label
:
'转发次数'
,
value
:
2
},
{
label
:
'访客总数'
,
value
:
3
},
{
label
:
'浏览总数'
,
value
:
4
},
{
label
:
'成交单量'
,
value
:
5
},
{
label
:
'转化率'
,
value
:
6
}],
boutique
:
[{
label
:
'产值'
,
value
:
1
},
{
label
:
'单量'
,
value
:
2
},
{
label
:
'客单量'
,
value
:
3
},
{
label
:
'转化率'
,
value
:
4
}],
equity
:
[{
label
:
'产值'
,
value
:
1
},
{
label
:
'成交量'
,
value
:
2
},
{
label
:
'报价量'
,
value
:
3
},
{
label
:
'转化率'
,
value
:
4
}]
},
empName
:
''
,
show
:
true
,
...
...
@@ -85,66 +91,114 @@ Component({
*/
methods
:
{
showUp
()
{
this
.
setData
({
show
:
false
})
this
.
setData
({
show
:
false
})
},
//选择排序
selectType
(
e
)
{
const
{
value
,
label
}
=
e
.
target
.
dataset
this
.
setData
({
selectValue
:
value
,
show
:
true
,
selectTxt
:
label
})
this
.
getDetail
(
this
.
filterStaff
)
const
{
value
,
label
}
=
e
.
target
.
dataset
this
.
setData
({
selectValue
:
value
,
show
:
true
,
selectTxt
:
label
})
this
.
getDetail
(
this
.
filterStaff
)
},
hanldBlur
(
e
)
{
const
empName
=
e
.
detail
.
value
;
const
sfaffList
=
this
.
data
.
sfaffList
.
filter
(
item
=>
{
const
employeeName
=
item
.
transferName
||
item
.
employeeName
return
employeeName
?
employeeName
.
includes
(
empName
):
item
})
this
.
filterStaff
=
sfaffList
this
.
getDetail
(
sfaffList
)
const
empName
=
e
.
detail
.
value
;
const
sfaffList
=
this
.
data
.
sfaffList
.
filter
(
item
=>
{
const
employeeName
=
item
.
transferName
||
item
.
employeeName
return
employeeName
?
employeeName
.
includes
(
empName
)
:
item
})
this
.
filterStaff
=
sfaffList
this
.
getDetail
(
sfaffList
)
},
//格式化数组
formatArr
(
arr
,
fn
)
{
let
res
=
{}
for
(
let
v
of
arr
)
{
const
val
=
Object
.
keys
(
v
)
for
(
let
i
of
val
)
{
if
(
res
[
i
])
{
res
[
i
].
push
(
v
[
i
])
continue
}
res
[
i
]
=
[
v
[
i
]]
}
let
res
=
{}
for
(
let
v
of
arr
)
{
const
val
=
Object
.
keys
(
v
)
for
(
let
i
of
val
)
{
if
(
res
[
i
])
{
res
[
i
].
push
(
v
[
i
])
continue
}
res
[
i
]
=
[
v
[
i
]]
}
return
fn
(
res
)
}
return
fn
(
res
)
},
// 生成对应的表格数据
getDetail
(
val
)
{
let
{
tabelTh
,
dataType
,
selectValue
,
downType
}
=
this
.
data
,
sortKey
for
(
let
i
in
tabelTh
)
{
if
(
tabelTh
[
i
]
==
dataType
[
downType
][
selectValue
-
1
].
label
)
{
sortKey
=
i
}
let
{
tabelTh
,
dataType
,
selectValue
,
downType
}
=
this
.
data
,
sortKey
for
(
let
i
in
tabelTh
)
{
if
(
tabelTh
[
i
]
==
dataType
[
downType
][
selectValue
-
1
].
label
)
{
sortKey
=
i
}
const
tableData
=
Util
.
deepClone
(
val
).
sort
((
a
,
b
)
=>
{
return
(
b
[
sortKey
]
||
0
)
-
(
a
[
sortKey
]
||
0
)
})
const
sfaffList
=
this
.
formatArr
(
tableData
,
(
item
)
=>
{
const
result
=
[]
const
obj_keys
=
Object
.
keys
(
tabelTh
)
for
(
let
k
of
obj_keys
)
{
result
.
push
({
name
:
tabelTh
[
k
],
val
:
k
,
list
:
item
}
const
tableData
=
Util
.
deepClone
(
val
).
sort
((
a
,
b
)
=>
{
return
(
b
[
sortKey
]
||
0
)
-
(
a
[
sortKey
]
||
0
)
})
const
sfaffList
=
this
.
formatArr
(
tableData
,
(
item
)
=>
{
const
result
=
[]
const
obj_keys
=
Object
.
keys
(
tabelTh
);
const
handleParams
=
(
k
)
=>
{
let
obj
=
{
[
k
]:
(
item
,
k
)
=>
{
return
item
[
k
]
},
transferName
:
(
item
)
=>
{
let
arr
=
[]
item
.
avatar
.
forEach
((
val
,
index
)
=>
{
arr
.
push
({
avatarUrl
:
val
,
transferName
:
item
.
transferName
[
index
]
})
}
return
result
})
this
.
setData
({
sfaff
:
sfaffList
})
})
return
arr
},
employeeName
:
(
item
)
=>
{
let
arr
=
[]
item
.
avatarUrl
.
forEach
((
val
,
index
)
=>
{
arr
.
push
({
avatarUrl
:
val
,
transferName
:
item
.
employeeName
[
index
]
})
})
return
arr
},
conversionRate
:
(
item
,
k
)
=>
{
const
arr
=
this
.
data
.
downType
==
'equity'
?
item
[
k
].
map
(
item
=>
accMul
(
item
,
100
))
:
item
[
k
]
return
arr
},
}
return
obj
}
for
(
let
k
of
obj_keys
)
{
result
.
push
({
name
:
tabelTh
[
k
],
val
:
k
,
list
:
handleParams
(
k
)[
k
](
item
,
k
)
})
}
return
result
})
this
.
setData
({
sfaff
:
sfaffList
})
}
}
})
})
\ No newline at end of file
packageOutput/components/staff/staff.wxml
View file @
b0fccb5
...
...
@@ -22,15 +22,16 @@
<!-- 左侧固定 -->
<view class='table_left_column'>
<view class='left_col_item'>排名</view>
<view class='left_col_item' wx:for="{{sfaff[0].list
[sfaff[0].val]
}}" wx:for-index="index" wx:key="index">{{index+1}}</view>
<view class='left_col_item' wx:for="{{sfaff[0].list}}" wx:for-index="index" wx:key="index">{{index+1}}</view>
</view>
<!-- 右侧表格滚动 -->
<view class="table_right_scroll_box">
<view class="flex_direction_column_item" wx:for="{{sfaff}}" wx:for-index="index" wx:key="index">
<view class='item_name'>{{item.name}}</view>
<view wx:for="{{item.list[item.val]}}" wx:for-item="litem" wx:for-index="lindex" wx:key="lindex" class='item_name item_desc'>
<image wx:if="{{item.name == '员工'}}" src="{{item.list['avatarUrl'][lindex] || item.list['shareImageUrl'][lindex]}}"></image>
<block wx:if="{{item.name == '转化率'}}">{{litem?(downType == 'equity'?litem*100:litem)+'%': '--'}}</block>
<view wx:for="{{item.list}}" wx:for-item="litem" wx:for-index="lindex" wx:key="lindex" class='item_name item_desc'>
<image wx:if="{{item.name == '员工'&& litem.avatarUrl}}" src="{{ litem.avatarUrl? litem.avatarUrl:''}}"></image>
<block wx:if="{{item.name == '转化率'}}">{{litem?litem+'%': '--'}}</block>
<block wx:elif="{{item.name == '员工'}}">{{litem.transferName?litem.transferName:'--'}}</block>
<block wx:else>{{litem||'--'}}</block>
</view>
</view>
...
...
packagesList/outDetail/components/OutputWork/components/OutputLine/OutputLine.scss
View file @
b0fccb5
...
...
@@ -28,13 +28,15 @@
margin-top
:
24rpx
;
display
:
flex
;
align-items
:
center
;
z-index
:
9999
;
position
:
static
;
.time
{
padding
:
6rpx
30rpx
;
border
:
2rpx
solid
#EBEBEB
;
border-radius
:
32rpx
;
font-weight
:
400
;
font-size
:
2
4
rpx
;
font-size
:
2
0
rpx
;
color
:
#A6A6A6
;
}
...
...
@@ -52,14 +54,15 @@
display
:
flex
;
align-items
:
center
;
position
:
absolute
;
right
:
30rpx
;
right
:
30rpx
;
.time-icon
{
width
:
2
8
rpx
;
height
:
26rpx
;
width
:
2
5
.6
rpx
;
height
:
2
4
.
6rpx
;
}
.temporal
{
font-size
:
2
6
rpx
;
font-size
:
2
4
rpx
;
color
:
#A6A6A6
;
margin
:
0
8rpx
;
}
...
...
packagesList/outDetail/components/OutputWork/index.js
View file @
b0fccb5
...
...
@@ -331,7 +331,7 @@ Component({
dataType
,
//数据类型:1报价量/ 2成交量 /3产值
}
this
.
data
.
type
==
1
?
params
.
dateDimension
=
timePeriod
:
params
.
timePeriod
=
timePeriod
if
(
startTime
)
this
.
data
.
type
==
1
?
params
.
startDate
=
startTime
:
params
.
startTime
=
startTime
+
' 00:00:00
'
if
(
startTime
)
this
.
data
.
type
==
1
?
params
.
startDate
=
startTime
:
params
.
startTime
=
startTime
+
' 00:00:00'
if
(
endTime
)
this
.
data
.
type
==
1
?
params
.
endDate
=
endTime
:
params
.
endTime
=
endTime
+
' 23:59:59'
ActivityApi
[
methods
[
this
.
data
.
type
]](
params
).
then
(
res
=>
{
this
.
setData
({
...
...
@@ -368,7 +368,7 @@ Component({
merchantIds
:
[
thisPage
.
data
.
merchantId
]
}
tabelTh
=
{
transferName
:
"员工
姓名
"
,
transferName
:
"员工"
,
outputValue
:
"产值"
,
successCount
:
"成交量"
,
quotationCount
:
"报价量"
,
...
...
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