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
55128f11
Commit
55128f11
authored
Nov 29, 2019
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
5d735343
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
31 deletions
+91
-31
saleGuestTable.vue
src/components/viitto/saleGuestTable.vue
+91
-31
No files found.
src/components/viitto/saleGuestTable.vue
View file @
55128f11
...
...
@@ -183,6 +183,7 @@ export default {
monthstr
:
0
,
outbranchid
:
-
1
},
monthList
:[],
companyList
:[],
}
},
...
...
@@ -206,46 +207,50 @@ export default {
let
url
=
'http://47.96.23.199:5001/api/order/get_sale_numandpreferprice_statistics'
this
.
apiRequest
(
url
,{
msg
:
this
.
msg
},
r
=>
{
if
(
r
.
data
.
resultCode
==
1
){
console
.
log
(
r
,
'errrrrr'
);
let
data
=
r
.
data
.
data
;
this
.
dataList
=
data
;
this
.
getCompany
(
data
);
let
tempArr
=
[];
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
tempArr
.
indexOf
(
data
[
i
].
MonthStr
)
===
-
1
)
{
this
.
dataList
.
push
({
month
:
data
[
i
].
MonthStr
,
List
:
[
data
[
i
]]
});
tempArr
.
push
(
data
[
i
].
MonthStr
);
}
else
{
for
(
let
j
=
0
;
j
<
this
.
dataList
.
length
;
j
++
)
{
if
(
this
.
dataList
[
j
].
month
==
data
[
i
].
MonthStr
)
{
this
.
dataList
[
j
].
List
.
push
(
data
[
i
]);
break
;
}
}
}
}
//数量不够push空
this
.
dataList
.
forEach
(
x
=>
{
if
(
x
.
List
.
length
<
this
.
companyList
.
length
){
for
(
var
i
=
0
;
i
<
this
.
companyList
.
length
-
x
.
List
.
length
;
i
++
){
x
.
List
.
push
({
GuestNum
:
''
,
MonthStr
:
''
,
OutBranchName
:
''
,
PreferPrice
:
''
,
RB_Branch_Id
:
''
,
YearStr
:
''
})
}
}
})
// for (let i = 0; i
<
data
.
length
;
i
++
)
{
// if (tempArr.indexOf(data[i].MonthStr) === -1) {
// this.dataList.push({
// month: data[i].MonthStr,
// List: [data[i]]
// });
// tempArr.push(data[i].MonthStr);
// } else {
// for (let j = 0; j
<
this
.
dataList
.
length
;
j
++
)
{
// if (this.dataList[j].month == data[i].MonthStr) {
// this.dataList[j].List.push(data[i]);
// break;
// }
// }
// }
// }
// console.log(this.dataList,'datalist');
// //数量不够push空
// this.dataList.forEach(x=>{
// if(x.List.length
<
this
.
companyList
.
length
){
// for(var i=0;i
<
this
.
companyList
.
length
-
x
.
List
.
length
;
i
++
){
// x.List.push({
// GuestNum:'',
// MonthStr:'',
// OutBranchName:'',
// PreferPrice:'',
// RB_Branch_Id:'',
// YearStr:''
// })
// }
// }
// })
}
})
},
//去重获取公司
getCompany
(
dataList
){
this
.
companyList
=
[];
this
.
monthList
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
];
var
obj
=
{};
for
(
var
i
=
0
;
i
<
dataList
.
length
;
i
++
){
if
(
!
obj
[
dataList
[
i
].
OutBranchName
]){
...
...
@@ -253,7 +258,62 @@ export default {
obj
[
dataList
[
i
].
OutBranchName
]
=
true
;
}
}
let
Arr
=
[];
this
.
companyList
.
forEach
((
cItem
,
cIndex
)
=>
{
let
Arr2
=
[];
this
.
monthList
.
forEach
((
mItem
,
mIndex
)
=>
{
var
bMonth
=
this
.
getOtherMonth
(
cItem
.
RB_Branch_Id
,
mItem
);
let
Obj
=
{
GuestNum
:
0
,
MonthStr
:
''
,
OutBranchName
:
''
,
PreferPrice
:
0
,
RB_Branch_Id
:
0
,
YearStr
:
''
}
if
(
bMonth
)
{
console
.
log
(
bMonth
,
'bMonth'
);
Obj
.
GuestNum
=
bMonth
.
GuestNum
Obj
.
MonthStr
=
bMonth
.
MonthStr
Obj
.
OutBranchName
=
bMonth
.
OutBranchName
Obj
.
PreferPrice
=
bMonth
.
PreferPrice
Obj
.
RB_Branch_Id
=
bMonth
.
RB_Branch_Id
Obj
.
YearStr
=
bMonth
.
YearStr
console
.
log
(
Arr2
,
'Arrrrrrrr'
);
}
else
{
Obj
.
GuestNum
=
0
Obj
.
MonthStr
=
bMonth
.
MonthStr
Obj
.
OutBranchName
=
bMonth
.
OutBranchName
Obj
.
PreferPrice
=
0
Obj
.
RB_Branch_Id
=
bMonth
.
RB_Branch_Id
Obj
.
YearStr
=
bMonth
.
YearStr
}
Arr2
.
push
(
obj
)
});
var
obj
=
{
month
:
cItem
.
MonthStr
,
List
:
Arr2
,
};
Arr
.
push
(
obj
);
});
// console.log(Arr,'Arrrrrrrr');
},
getOtherMonth
(
branchId
,
monthStr
)
{
var
obj
=
""
;
this
.
dataList
.
forEach
(
dItem
=>
{
if
(
dItem
.
RB_Branch_Id
==
branchId
&&
monthStr
==
dItem
.
MonthStr
)
{
obj
=
dItem
;
}
});
return
obj
;
},
//点击跳转
goSalesMap
(){
this
.
$router
.
push
({
...
...
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