Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
01b576d0
Commit
01b576d0
authored
Jun 09, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收支统计
parent
a7b4133a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
14 deletions
+108
-14
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/ViewController/地址管理/XinZengDiZhiViewController.swift
...form/ViewController/地址管理/XinZengDiZhiViewController.swift
+16
-0
GeliBusinessPlatform/ViewController/收支统计/ShouZhiTongJiViewController.swift
...orm/ViewController/收支统计/ShouZhiTongJiViewController.swift
+92
-14
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
01b576d0
No preview for this file type
GeliBusinessPlatform/ViewController/地址管理/XinZengDiZhiViewController.swift
View file @
01b576d0
...
...
@@ -116,6 +116,22 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
@IBOutlet
weak
var
listView
:
UITableView
!
@IBAction
func
saveAction
(
_
sender
:
Any
)
{
print
(
"save "
)
if
holderArr
.
first
==
"请填写收货人姓名"
{
HUD
.
flash
(
.
label
(
"请填写收货人姓名"
),
delay
:
1.2
)
return
}
if
holderArr
[
1
]
==
"请选择城市"
{
HUD
.
flash
(
.
label
(
"请选择城市"
),
delay
:
1.2
)
return
}
if
holderArr
[
2
]
==
"请输入详细地址"
{
HUD
.
flash
(
.
label
(
"请输入详细地址"
),
delay
:
1.2
)
return
}
if
holderArr
[
3
]
==
"请请输入手机号"
{
HUD
.
flash
(
.
label
(
"请输入手机号"
),
delay
:
1.2
)
return
}
let
alertView
=
GeliAlertView
(
frame
:
self
.
view
.
window
!.
bounds
)
alertView
.
delegate
=
self
alertView
.
tishiLbl
.
text
=
""
...
...
GeliBusinessPlatform/ViewController/收支统计/ShouZhiTongJiViewController.swift
View file @
01b576d0
...
...
@@ -18,8 +18,8 @@ class ShouZhiTongJiViewController: BaseViewController,UITableViewDelegate,UITabl
@IBOutlet
weak
var
zhiChuBigLbl
:
UILabel
!
@IBOutlet
weak
var
shouRuSmallLbl
:
UILabel
!
@IBOutlet
weak
var
shouRuBigLbl
:
UILabel
!
@IBOutlet
weak
var
viewH
:
NSLayoutConstraint
!
@IBOutlet
weak
var
viewW
:
NSLayoutConstraint
!
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
navbar
.
title
=
"收支统计"
...
...
@@ -27,6 +27,8 @@ class ShouZhiTongJiViewController: BaseViewController,UITableViewDelegate,UITabl
self
.
view
.
addSubview
(
navbar
)
SetTopFrame
(
view
:
scrollView
,
height
:
fullScreenHeight
-
NavCGRect
.
height
)
loadData
()
// Do any additional setup after loading the view.
topListView
.
separatorStyle
=
.
none
bottomListView
.
separatorStyle
=
.
none
...
...
@@ -36,6 +38,83 @@ class ShouZhiTongJiViewController: BaseViewController,UITableViewDelegate,UITabl
topListView
.
register
(
UINib
(
nibName
:
"TitleAndTFCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndTFCell"
)
bottomListView
.
register
(
UINib
(
nibName
:
"TitleAndTFCell"
,
bundle
:
nil
),
forCellReuseIdentifier
:
"TitleAndTFCell"
)
}
var
topArr
=
[
"主营收入"
,
"其它收入"
]
var
bottomArr
=
[
"固定采购"
,
"临时采购"
,
"员工工资"
,
"运输费"
,
"租金费"
,
"冷藏费"
,
"其它费"
,
"样品"
]
var
topHolder
=
[
"-"
,
"-"
]
var
bottomHolder
=
[
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
,
"-"
]
func
loadData
(){
let
UserToken
=
UserDefaults
.
standard
.
value
(
forKey
:
"user_token"
)
let
star_time
=
Int
(
starTime
.
timeIntervalSince1970
)
let
end_time
=
Int
(
endTime
.
timeIntervalSince1970
)
Statistics
([
"user_token"
:
UserToken
as
Any
,
"start_time"
:
star_time
as
Any
,
"end_time"
:
end_time
as
Any
],
success
:
{
(
data
)
in
let
model
=
(
data
as!
StatisticsModel
)
if
model
.
data
?
.
order_amount_sum
!=
nil
{
self
.
topHolder
.
insert
(
"
\(
String
(
describing
:
model
.
data
!.
order_amount_sum
!
)
)
"
,
at
:
0
)
self
.
topHolder
.
remove
(
at
:
1
)
}
if
model
.
data
?
.
finance_income
!=
nil
{
self
.
topHolder
.
insert
(
"
\(
String
(
describing
:
model
.
data
!.
finance_income
!
)
)
"
,
at
:
1
)
self
.
topHolder
.
remove
(
at
:
2
)
}
if
model
.
data
?
.
expend
?
.
fixed_purchase
!=
nil
{
self
.
bottomHolder
.
insert
(
"
\(
model
.
data
!.
expend
!.
fixed_purchase
!
)
"
,
at
:
0
)
self
.
bottomHolder
.
remove
(
at
:
1
)
}
if
model
.
data
?
.
expend
?
.
temp_purchase
!=
nil
{
self
.
bottomArr
.
insert
(
"
\(
model
.
data
!.
expend
!.
temp_purchase
!
)
"
,
at
:
1
)
self
.
bottomArr
.
remove
(
at
:
2
)
}
if
model
.
data
?
.
expend
?
.
salary
!=
nil
{
self
.
bottomHolder
.
insert
(
"
\(
model
.
data
!.
expend
!.
salary
!
)
"
,
at
:
2
)
self
.
bottomHolder
.
remove
(
at
:
3
)
}
if
model
.
data
?
.
expend
?
.
logistics
!=
nil
{
self
.
bottomHolder
.
insert
(
"
\(
model
.
data
!.
expend
!.
logistics
!
)
"
,
at
:
3
)
self
.
bottomHolder
.
remove
(
at
:
4
)
}
if
model
.
data
?
.
expend
?
.
rental
!=
nil
{
self
.
bottomHolder
.
insert
(
"
\(
model
.
data
!.
expend
!.
rental
!
)
"
,
at
:
4
)
self
.
bottomHolder
.
remove
(
at
:
5
)
}
if
model
.
data
?
.
expend
?
.
refrigeration
!=
nil
{
self
.
bottomHolder
.
insert
(
"
\(
model
.
data
!.
expend
!.
refrigeration
!
)
"
,
at
:
5
)
self
.
bottomHolder
.
remove
(
at
:
6
)
}
if
model
.
data
?
.
expend
?
.
other
!=
nil
{
self
.
bottomHolder
.
insert
(
"
\(
model
.
data
!.
expend
!.
other
!
)
"
,
at
:
6
)
self
.
bottomHolder
.
remove
(
at
:
7
)
}
if
model
.
data
!.
expend
!.
boon
!=
nil
{
self
.
bottomHolder
.
insert
(
"
\(
model
.
data
!.
expend
!.
boon
!
)
"
,
at
:
7
)
self
.
bottomHolder
.
remove
(
at
:
8
)
}
let
income_sum
=
"
\(
String
(
describing
:
model
.
data
!.
income_sum
!
)
)
"
if
income_sum
.
contains
(
"."
){
let
incomeArr
=
income_sum
.
components
(
separatedBy
:
"."
)
self
.
shouRuBigLbl
.
text
=
incomeArr
.
first
!
self
.
shouRuSmallLbl
.
text
=
"."
+
incomeArr
.
last
!
}
else
{
self
.
shouRuBigLbl
.
text
=
income_sum
}
let
expend_sum
=
"
\(
String
(
describing
:
model
.
data
!.
expend_sum
!
)
)
"
if
expend_sum
.
contains
(
"."
){
let
expendArr
=
expend_sum
.
components
(
separatedBy
:
"."
)
self
.
zhiChuBigLbl
.
text
=
expendArr
.
first
!
self
.
zhiChuSmallLbl
.
text
=
"."
+
expendArr
.
last
!
}
else
{
self
.
zhiChuBigLbl
.
text
=
expend_sum
}
self
.
topListView
.
reloadData
()
self
.
bottomListView
.
reloadData
()
})
{
(
error
)
in
}
}
//MARK:--日期筛选按钮(右上角按钮)
let
selectV
=
WorkSelectTimeView
()
var
selelctIndex
=
1001
...
...
@@ -64,33 +143,33 @@ class ShouZhiTongJiViewController: BaseViewController,UITableViewDelegate,UITabl
isShowSelectTimeV
=
false
switch
sender
{
case
1001
:
// topNavBtn.setTitle("今日", for: .normal)
// topNavBtn.setTitle("今日", for: .normal)
endTime
=
DateInRegion
()
.
dateAt
(
.
endOfDay
)
.
date
-
8
.
hours
starTime
=
DateInRegion
()
.
dateAt
(
.
startOfDay
)
.
date
-
8
.
hours
//今天开始时间
//
loadData()
loadData
()
break
case
1002
:
// topNavBtn.setTitle("本周", for: .normal)
// topNavBtn.setTitle("本周", for: .normal)
endTime
=
DateInRegion
()
.
dateAt
(
.
endOfDay
)
.
date
-
8
.
hours
starTime
=
DateInRegion
()
.
dateAt
(
.
startOfWeek
)
.
date
+
1
.
days
-
8
.
hours
//当周周一开始时间
//
loadData()
loadData
()
break
case
1003
:
// topNavBtn.setTitle("本月", for: .normal)
// topNavBtn.setTitle("本月", for: .normal)
endTime
=
DateInRegion
()
.
dateAt
(
.
endOfDay
)
.
date
-
8
.
hours
starTime
=
DateInRegion
()
.
dateAt
(
.
startOfMonth
)
.
date
-
8
.
hours
//本月开始时间
//
loadData()
loadData
()
break
case
1004
:
if
beginDate
!=
nil
&&
endginDate
!=
nil
{
let
timeInterval
:
TimeInterval
=
beginDate
!.
timeIntervalSince1970
let
timeIntervalEnd
:
TimeInterval
=
endginDate
!.
timeIntervalSince1970
let
timestr
=
dayByDouble
(
sender
:
timeInterval
)
+
"-"
+
dayByDouble
(
sender
:
timeIntervalEnd
)
// topNavBtn.setTitle(timestr, for: .normal)
// topNavBtn.setTitle(timestr, for: .normal)
endTime
=
endginDate
!
starTime
=
beginDate
!
print
(
timestr
)
//
loadData()
loadData
()
}
break
...
...
@@ -119,8 +198,7 @@ class ShouZhiTongJiViewController: BaseViewController,UITableViewDelegate,UITabl
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
49
}
var
topArr
=
[
"主营收入"
,
"其它收入"
]
var
bottomArr
=
[
"固定采购"
,
"临时采购"
,
"员工工资"
,
"运输费"
,
"租金费"
,
"冷藏费"
,
"其它费"
,
"样品"
]
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
tableView
==
topListView
{
return
topArr
.
count
...
...
@@ -133,10 +211,10 @@ class ShouZhiTongJiViewController: BaseViewController,UITableViewDelegate,UITabl
cell
.
textTF
.
isUserInteractionEnabled
=
false
if
tableView
==
topListView
{
cell
.
nameLbl
.
text
=
topArr
[
indexPath
.
row
]
cell
.
textTF
.
text
=
top
Ar
r
[
indexPath
.
row
]
cell
.
textTF
.
text
=
top
Holde
r
[
indexPath
.
row
]
}
else
{
cell
.
nameLbl
.
text
=
bottomArr
[
indexPath
.
row
]
cell
.
textTF
.
text
=
bottom
Ar
r
[
indexPath
.
row
]
cell
.
textTF
.
text
=
bottom
Holde
r
[
indexPath
.
row
]
}
return
cell
}
...
...
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