Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Muse
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
Muse
Commits
4b2014a1
Commit
4b2014a1
authored
Nov 28, 2019
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
71d966a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
51 deletions
+47
-51
salesGuestList.vue
src/components/viitto/salesGuestList.vue
+47
-51
No files found.
src/components/viitto/salesGuestList.vue
View file @
4b2014a1
...
...
@@ -172,10 +172,10 @@
</el-row>
</div>
<div
class=
"content"
>
<div
class=
"MapIcon"
>
<
!--
<
div
class=
"MapIcon"
>
<span
@
click=
"LineMap()"
>
折线图
</span>
<span
@
click=
"BarMap()"
>
柱状图
</span>
</div>
</div>
-->
<div
class=
"myecharts"
ref=
"myecharts"
>
</div>
...
...
@@ -196,7 +196,9 @@ export default {
dataList
:
[],
//年份列表
yearList
:
[],
Mydatalist
:
[]
Mydatalist
:
[],
//所有月份
monthList
:
[]
};
},
watch
:
{},
...
...
@@ -212,7 +214,6 @@ export default {
"http://47.96.23.199:5001/api/order/get_sale_numandpreferprice_statistics"
;
this
.
loading
=
true
;
this
.
apiRequest
(
url
,
{
msg
:
this
.
msg
},
r
=>
{
console
.
log
(
JSON
.
stringify
(
r
),
"rrrrr"
);
this
.
loading
=
false
;
if
(
r
.
data
.
resultCode
==
1
)
{
this
.
dataList
=
r
.
data
.
data
;
...
...
@@ -229,7 +230,7 @@ export default {
//去重获取公司
getCompany
(
dataList
)
{
this
.
companyList
=
[];
let
monthList
=
[];
this
.
monthList
=
[];
var
obj
=
{};
if
(
dataList
&&
dataList
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
dataList
.
length
;
i
++
)
{
...
...
@@ -238,23 +239,36 @@ export default {
obj
[
dataList
[
i
].
OutBranchName
]
=
true
;
}
if
(
!
obj
[
dataList
[
i
].
MonthStr
])
{
monthList
.
push
(
dataList
[
i
].
MonthStr
);
this
.
monthList
.
push
(
dataList
[
i
].
MonthStr
);
obj
[
dataList
[
i
].
MonthStr
]
=
true
;
}
}
}
console
.
log
(
monthList
,
"monthListttt"
);
let
companyArr
=
[];
let
companyArr1
=
[];
console
.
log
(
this
.
companyList
,
"this.companyList"
);
this
.
companyList
.
forEach
((
item
,
index
)
=>
{
let
obj
=
{
OutBranchName
:
item
.
OutBranchName
,
List
:
[]
let
Arr
=
[];
this
.
companyList
.
forEach
((
cItem
,
cIndex
)
=>
{
var
preferPricearray
=
[];
var
guestNumArray
=
[];
this
.
monthList
.
forEach
((
mItem
,
mIndex
)
=>
{
var
bMonth
=
this
.
getOtherMonth
(
cItem
.
RB_Branch_Id
,
mItem
);
if
(
bMonth
)
{
preferPricearray
.
push
(
bMonth
.
PreferPrice
);
guestNumArray
.
push
(
bMonth
.
GuestNum
);
}
else
{
preferPricearray
.
push
(
0
);
guestNumArray
.
push
(
0
);
}
});
var
obj
=
{
name
:
cItem
.
OutBranchName
,
preferPriceList
:
preferPricearray
,
GuestNumList
:
guestNumArray
};
companyArr
.
push
(
obj
);
Arr
.
push
(
obj
);
});
var
companyArr1
=
[];
Arr
.
forEach
((
item
,
index
)
=>
{
let
obj2
=
{
data
:
[
item
.
OutBranchN
ame
],
data
:
[
item
.
n
ame
],
icon
:
"circle"
,
x
:
index
*
5
+
3.5
+
"%"
,
orient
:
"horizontal"
,
...
...
@@ -265,34 +279,11 @@ export default {
}
};
companyArr1
.
push
(
obj2
);
});
// this.companyList.forEach(citem => {
// var monthArray=[];
// monthList.forEach(mitem => {
// monthArray = dataList.find(item => {
// return item.MonthStr === mitem; //筛选出匹配数据
// });
// });
// console.log(monthArray,"monthArray");
// });
dataList
.
forEach
((
x
,
index
)
=>
{
companyArr
.
forEach
(
y
=>
{
if
(
y
.
OutBranchName
==
x
.
OutBranchName
)
{
y
.
List
.
push
(
x
);
}
});
});
let
arr
=
[];
let
arr1
=
[];
companyArr
.
forEach
(
item
=>
{
var
tempArray
=
[];
let
obj
=
{
name
:
item
.
OutBranchName
,
type
:
"bar"
,
data
:
[]
data
:
item
.
preferPriceList
};
let
objline
=
{
type
:
"line"
,
...
...
@@ -302,19 +293,24 @@ export default {
hoverAnimation
:
true
,
smooth
:
true
,
showSymbol
:
false
,
data
:
[]
data
:
item
.
GuestNumList
};
item
.
List
.
forEach
(
list
=>
{
obj
.
data
.
push
(
list
.
PreferPrice
);
objline
.
data
.
push
(
list
.
GuestNum
);
});
arr
.
push
(
obj
);
arr1
.
push
(
objline
);
this
.
Mydatalist
.
push
(
obj
);
this
.
Mydatalist
.
push
(
objline
);
});
this
.
Mydatalist
=
arr
.
concat
(
arr1
);
console
.
log
(
this
.
Mydatalist
,
"this.Mydatalist"
);
this
.
init
(
companyArr1
);
},
getOtherMonth
(
branchId
,
monthStr
)
{
var
obj
=
""
;
this
.
dataList
.
forEach
(
dItem
=>
{
if
(
dItem
.
RB_Branch_Id
==
branchId
&&
monthStr
==
dItem
.
MonthStr
)
{
obj
=
dItem
;
}
});
return
obj
;
},
//点击切换为折现图
LineMap
()
{
// let newArr=this.Mydatalist;
...
...
@@ -398,7 +394,7 @@ export default {
});
},
init
(
companyArr1
)
{
console
.
log
(
this
.
Mydatalist
,
"this.Mydatalist"
);
console
.
log
(
"companyArr1"
,
companyArr1
);
var
that
=
this
;
var
myChart
=
this
.
$echarts
.
init
(
this
.
$refs
.
myecharts
);
var
option
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment