Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
xffruit
Project
Project
Details
Activity
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
张杰
xffruit
Commits
9ac64d07
Commit
9ac64d07
authored
Sep 05, 2015
by
zhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
9d420d62
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
874 additions
and
25 deletions
+874
-25
project.pbxproj
XFFruit.xcodeproj/project.pbxproj
+6
-4
BusinessViewController.m
XFFruit/ViewControllers/Business/BusinessViewController.m
+4
-2
PurchaseNoticeViewController.h
...PurchaseNotice/Controllers/PurchaseNoticeViewController.h
+13
-0
PurchaseNoticeViewController.m
...PurchaseNotice/Controllers/PurchaseNoticeViewController.m
+473
-0
SeePurchaseNoticeViewController.h
...chaseNotice/Controllers/SeePurchaseNoticeViewController.h
+4
-1
SeePurchaseNoticeViewController.m
...chaseNotice/Controllers/SeePurchaseNoticeViewController.m
+307
-0
SelectCompanyViewController.h
...ollers/PurchaseNotice/Views/SelectCompanyViewController.h
+5
-1
SelectCompanyViewController.m
...ollers/PurchaseNotice/Views/SelectCompanyViewController.m
+15
-13
ShopDetaileViewController.m
...trollers/PurchaseNotice/Views/ShopDetaileViewController.m
+13
-2
Localizable.strings
XFFruit/en.lproj/Localizable.strings
+17
-1
Localizable.strings
XFFruit/zh-Hans.lproj/Localizable.strings
+17
-1
No files found.
XFFruit.xcodeproj/project.pbxproj
View file @
9ac64d07
...
...
@@ -14,6 +14,7 @@
0414FF191B94959700C7B00E
/* PurchaseNoticeCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0414FF121B94959700C7B00E
/* PurchaseNoticeCell.m */
;
};
0414FF1A1B94959700C7B00E
/* SelectCompanyViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0414FF141B94959700C7B00E
/* SelectCompanyViewController.m */
;
};
0414FF1B1B94959700C7B00E
/* ShopDetaileViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0414FF161B94959700C7B00E
/* ShopDetaileViewController.m */
;
};
04F6E70A1B9B08A500550849
/* PurchaseNoticeViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04F6E7091B9B08A500550849
/* PurchaseNoticeViewController.m */
;
};
300DD94A1B184B450080EE12
/* ICRPatrolPlan.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
300DD9491B184B450080EE12
/* ICRPatrolPlan.m */
;
};
300DD94B1B184B450080EE12
/* ICRPatrolPlan.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
300DD9491B184B450080EE12
/* ICRPatrolPlan.m */
;
};
300DD94E1B184EA70080EE12
/* ICRQuestion.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
300DD94D1B184EA70080EE12
/* ICRQuestion.m */
;
};
...
...
@@ -419,6 +420,8 @@
0414FF141B94959700C7B00E
/* SelectCompanyViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
SelectCompanyViewController.m
;
sourceTree
=
"<group>"
;
};
0414FF151B94959700C7B00E
/* ShopDetaileViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ShopDetaileViewController.h
;
sourceTree
=
"<group>"
;
};
0414FF161B94959700C7B00E
/* ShopDetaileViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ShopDetaileViewController.m
;
sourceTree
=
"<group>"
;
};
04F6E7081B9B08A500550849
/* PurchaseNoticeViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
PurchaseNoticeViewController.h
;
sourceTree
=
"<group>"
;
};
04F6E7091B9B08A500550849
/* PurchaseNoticeViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
PurchaseNoticeViewController.m
;
sourceTree
=
"<group>"
;
};
1B0B22845F5CD40B5CF655F2
/* Pods.debug.xcconfig */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
text.xcconfig
;
name
=
Pods.debug.xcconfig
;
path
=
"Pods/Target Support Files/Pods/Pods.debug.xcconfig"
;
sourceTree
=
"<group>"
;
};
300DD9481B184B450080EE12
/* ICRPatrolPlan.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ICRPatrolPlan.h
;
sourceTree
=
"<group>"
;
};
300DD9491B184B450080EE12
/* ICRPatrolPlan.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ICRPatrolPlan.m
;
sourceTree
=
"<group>"
;
};
...
...
@@ -912,6 +915,8 @@
children
=
(
0414FF0B1B94959700C7B00E
/* NewPurchaseNoticeViewController.h */
,
0414FF0C1B94959700C7B00E
/* NewPurchaseNoticeViewController.m */
,
04F6E7081B9B08A500550849
/* PurchaseNoticeViewController.h */
,
04F6E7091B9B08A500550849
/* PurchaseNoticeViewController.m */
,
0414FF0D1B94959700C7B00E
/* SeePurchaseNoticeViewController.h */
,
0414FF0E1B94959700C7B00E
/* SeePurchaseNoticeViewController.m */
,
);
...
...
@@ -2228,6 +2233,7 @@
C142D2BE1AC3A155000109A7
/* UIView+FindUIViewController.m in Sources */
,
35C3C0BF1AE95F1D0035AC8A
/* UIImage+Rotate.m in Sources */
,
7281A0C51B89BF1C0052B1AC
/* ChooseVendorViewController.m in Sources */
,
04F6E70A1B9B08A500550849
/* PurchaseNoticeViewController.m in Sources */
,
C11A344D1B1BE27200079129
/* ICRPatrolAllStoreViewController.m in Sources */
,
C10214DD1AD90A3F0024637E
/* ICRFunctionEntity.m in Sources */
,
FE4678AA1B8D60F900B5EDA3
/* ChooseTypeViewController.m in Sources */
,
...
...
@@ -2639,7 +2645,6 @@
MTL_ENABLE_DEBUG_INFO
=
YES
;
ONLY_ACTIVE_ARCH
=
YES
;
PROVISIONING_PROFILE
=
"cfc700e3-f78e-4893-a7fd-62daba6a0c6c"
;
SDKROOT
=
iphoneos
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
...
...
@@ -2678,7 +2683,6 @@
IPHONEOS_DEPLOYMENT_TARGET
=
7.0
;
MTL_ENABLE_DEBUG_INFO
=
NO
;
PROVISIONING_PROFILE
=
"cfc700e3-f78e-4893-a7fd-62daba6a0c6c"
;
SDKROOT
=
iphoneos
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
...
...
@@ -2703,7 +2707,6 @@
);
PRODUCT_NAME
=
XFFruit
;
PROVISIONING_PROFILE
=
"cfc700e3-f78e-4893-a7fd-62daba6a0c6c"
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
};
name
=
Debug
;
...
...
@@ -2725,7 +2728,6 @@
);
PRODUCT_NAME
=
XFFruit
;
PROVISIONING_PROFILE
=
"cfc700e3-f78e-4893-a7fd-62daba6a0c6c"
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
};
name
=
Release
;
...
...
XFFruit/ViewControllers/Business/BusinessViewController.m
View file @
9ac64d07
...
...
@@ -29,6 +29,8 @@
#import "NewPurchaseViewController.h"
#import "PurchaseViewController.h"
#import"PurchaseNoticeViewController.h"
@interface
BusinessViewController
()
<
ICRFunctionBaseViewDelegate
>
@end
...
...
@@ -148,8 +150,8 @@
break
;
case
kFunctionSeePurchaseNotice
:
//查看采购通知单
{
See
PurchaseNoticeViewController
*
svc
=
[[
See
PurchaseNoticeViewController
alloc
]
init
];
PurchaseNoticeViewController
*
svc
=
[[
PurchaseNoticeViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"Survey3"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
...
...
XFFruit/ViewControllers/PurchaseNotice/Controllers/PurchaseNoticeViewController.h
0 → 100644
View file @
9ac64d07
//
// PurchaseNoticeViewController.h
// XFFruit
//
// Created by mac on 15/9/5.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface
PurchaseNoticeViewController
:
ICRBaseViewController
@end
XFFruit/ViewControllers/PurchaseNotice/Controllers/PurchaseNoticeViewController.m
0 → 100644
View file @
9ac64d07
//
// PurchaseNoticeViewController.m
// XFFruit
//
// Created by mac on 15/9/5.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "PurchaseNoticeViewController.h"
#import "PurchaseCell.h"
#import "PurchaseBill.h"
#import "SeePurchaseNoticeViewController.h"
#import "QueryOrder.h"
#import "SortMaskView.h"
#import "PurchaseBoltView.h"
#import "MJRefresh.h"
#define TopMargin 44
#define TableHeight 120
#define LeftMargin 20
#define BtnWidth 60
#define BtnHeight 24
#define BtnSize 16
typedef
enum
:
NSUInteger
{
SortTag
=
3000
,
BoltTag
}
BtnTag
;
@interface
PurchaseNoticeViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
PurchaseViewDelegate
,
SortMaskViewDelegate
>
{
UIView
*
_maskView
;
UIButton
*
currentBtn
;
SortMaskView
*
_sortView
;
PurchaseBoltView
*
_boltView
;
UIBarButtonItem
*
_sureBtn
;
UIButton
*
_sortBtn
;
UIButton
*
_boltBtn
;
BOOL
_isRefresh
;
BOOL
_isLoadMore
;
NSInteger
_currentPage
;
}
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
NSString
*
noticeLike
;
@property
(
nonatomic
,
strong
)
NSString
*
state
;
@property
(
nonatomic
,
strong
)
NSString
*
billLike
;
@property
(
nonatomic
,
strong
)
NSString
*
orderDirection
;
//asc(升序),desc(降序)
@end
@implementation
PurchaseNoticeViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
XXFBgColor
;
[
self
initData
];
[
self
createTableView
];
[
self
createRefresh
];
[
self
getData
];
// Do any additional setup after loading the view.
}
-
(
void
)
initData
{
self
.
dataArr
=
[
NSMutableArray
array
];
for
(
NSInteger
i
=
0
;
i
<
6
;
i
++
)
{
PurchaseBill
*
bill
=
[
PurchaseBill
new
];
bill
.
billNumber
=
@"222222222"
;
bill
.
noticeNumber
=
@"134594059654"
;
bill
.
create_operName
=
@"创建人"
;
bill
.
create_time
=
@"2013-03-04"
;
bill
.
vendor_name
=
@"供应商"
;
bill
.
total
=
[
NSNumber
numberWithFloat
:
22
];
bill
.
remark
=
@"备注"
;
bill
.
lastModify_operName
=
@"最后修改人"
;
bill
.
vendorConfirmTime
=
@"否"
;
if
(
i
==
0
)
{
bill
.
state
=
@"initial"
;
}
else
if
(
i
==
1
){
bill
.
state
=
@"submitted"
;
}
else
if
(
i
==
2
){
bill
.
state
=
@"rejected"
;
}
else
if
(
i
==
3
){
bill
.
state
=
@"approved"
;
}
else
if
(
i
==
4
){
bill
.
state
=
@"shipping"
;
}
else
if
(
i
==
5
){
bill
.
state
=
@"finished"
;
}
[
self
.
dataArr
addObject
:
bill
];
}
}
-
(
void
)
getData
{
[
ICRUserUtil
sharedInstance
].
needFresh
=
NO
;
__weak
typeof
(
self
)
weakSelf
=
self
;
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
[
strongSelf
fetchtPuchaseList
:
data
];
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
ICRUserUtil
*
userUtil
=
[
ICRUserUtil
sharedInstance
];
NSMutableArray
*
orderArr
=
[
NSMutableArray
array
];
if
(
self
.
orderDirection
.
length
>
0
&&
!
[
self
.
orderDirection
isEqualToString
:
@"none"
])
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"lastModified"
;
order
.
direction
=
self
.
orderDirection
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
id
billObject
=
[
NSNull
null
];
if
(
self
.
billLike
.
length
>
0
)
{
billObject
=
self
.
billLike
;
if
(
self
.
orderDirection
.
length
>
0
&&
!
[
self
.
orderDirection
isEqualToString
:
@"none"
])
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"billNumber"
;
order
.
direction
=
self
.
orderDirection
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
}
id
stateObject
=
[
NSNull
null
];
if
(
self
.
state
.
length
>
0
&&
!
[
self
.
state
isEqualToString
:
@"none"
])
{
stateObject
=
self
.
state
;
if
(
self
.
orderDirection
.
length
>
0
&&
!
[
self
.
orderDirection
isEqualToString
:
@"none"
])
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"state"
;
order
.
direction
=
self
.
orderDirection
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
}
id
noticeObject
=
[
NSNull
null
];
if
(
self
.
noticeLike
.
length
>
0
)
{
noticeObject
=
self
.
noticeLike
;
if
(
self
.
orderDirection
.
length
>
0
&&
!
[
self
.
orderDirection
isEqualToString
:
@"none"
])
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"noticeNumber"
;
order
.
direction
=
self
.
orderDirection
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
}
if
(
orderArr
.
count
==
0
)
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"billNumber"
;
order
.
direction
=
@"desc"
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
NSDictionary
*
dict
=
@{
@"billNumberLike"
:
billObject
,
@"state"
:
stateObject
,
@"noticeNumberLike"
:
noticeObject
,
@"titleLike"
:
[
NSNull
null
],
@"vendorUuid"
:
[
NSNull
null
],
@"queryOrders"
:
orderArr
,
@"userUuid"
:
userUtil
.
userId
,
@"pageNumber"
:
@
(
_currentPage
),
@"pageSize"
:
@
(
20
)};
[[
ICRHTTPController
sharedController
]
queryPurchaseWithData
:
dict
success
:
succ
failure
:
fail
];
}
-
(
void
)
fetchtPuchaseList
:
(
id
)
data
{
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
]
;
if
(
success
==
1
)
{
if
(
_currentPage
==
0
)
{
// if (self.dataArr.count > 0) {
// [self.dataArr removeAllObjects];
// }
}
NSArray
*
recodesArr
=
data
[
@"data"
][
@"records"
];
for
(
NSDictionary
*
purchaseBillDict
in
recodesArr
)
{
PurchaseBill
*
purchaseBill
=
[[
PurchaseBill
alloc
]
init
];
[
purchaseBill
setValuesForKeysWithDictionary
:
purchaseBillDict
];
[
self
.
dataArr
addObject
:
purchaseBill
];
}
NSDictionary
*
pageDict
=
data
[
@"data"
][
@"paging"
];
NSInteger
pageCount
=
[
pageDict
[
@"pageCount"
]
integerValue
];
[
self
.
tableView
reloadData
];
[
self
endRefreshing
];
if
(
pageCount
<=
_currentPage
)
{
[
self
.
tableView
.
footer
noticeNoMoreData
];
}
if
(
_currentPage
==
0
&&
self
.
dataArr
.
count
>
0
)
{
[
self
.
tableView
scrollToRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
0
inSection
:
0
]
atScrollPosition
:
UITableViewScrollPositionTop
animated
:
YES
];
}
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
else
{
[
IBTLoadingView
showTips
:
@" 无记录 "
];
}
}
-
(
void
)
createRefresh
{
self
.
tableView
.
header
=
[
MJRefreshNormalHeader
headerWithRefreshingBlock
:
^
{
if
(
_isRefresh
)
{
return
;
}
_isRefresh
=
YES
;
_currentPage
=
0
;
[
self
getData
];
}];
self
.
tableView
.
header
.
lastUpdatedTimeKey
=
PurchaseUpdateDate
;
self
.
tableView
.
footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
if
(
_isLoadMore
)
{
return
;
}
_isLoadMore
=
YES
;
_currentPage
++
;
[
self
getData
];
}
];
}
#pragma mark - 结束刷新
-
(
void
)
endRefreshing
{
_isLoadMore
=
NO
;
_isRefresh
=
NO
;
[
self
.
tableView
.
header
endRefreshing
];
[
self
.
tableView
.
footer
endRefreshing
];
}
-
(
void
)
createTableView
{
_sureBtn
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:
@"确定"
style
:
UIBarButtonItemStylePlain
target
:
self
action
:
@selector
(
sureClick
)];
self
.
navigationItem
.
rightBarButtonItem
=
_sureBtn
;
_sortBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
LeftMargin
,
10
,
BtnWidth
,
BtnHeight
)
target
:
self
sel
:
@selector
(
sortClick
:
)
tag
:
SortTag
image
:
@"black_arrow_down_with_text"
title
:
nil
titleColor
:
GXF_DETAIL_COLOR
isCorner
:
NO
corner
:
0
bgColor
:
nil
];
_sortBtn
.
titleLabel
.
font
=
FontSize
(
BtnSize
);
[
self
.
view
addSubview
:
_sortBtn
];
_boltBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
ScreenSize
.
width
-
BtnWidth
-
LeftMargin
,
10
,
BtnWidth
,
BtnHeight
)
target
:
self
sel
:
@selector
(
sortClick
:
)
tag
:
BoltTag
image
:
@"black_filter_with_text"
title
:
nil
titleColor
:
GXF_DETAIL_COLOR
isCorner
:
NO
corner
:
0
bgColor
:
nil
];
_boltBtn
.
titleLabel
.
font
=
FontSize
(
BtnSize
);
[
self
.
view
addSubview
:
_boltBtn
];
self
.
tableView
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
TopMargin
))
style
:(
UITableViewStylePlain
)];
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
[
self
.
view
addSubview
:
self
.
tableView
];
_maskView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
TopMargin
)];
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
.
5
);
_maskView
.
hidden
=
YES
;
[
self
.
view
addSubview
:
_maskView
];
}
#pragma mark -按钮事件
-
(
void
)
sortClick
:
(
UIButton
*
)
btn
{
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
.
5
);
_maskView
.
hidden
=
NO
;
if
(
btn
.
tag
==
SortTag
)
{
if
(
_boltView
){
[
self
hiddenBoltMaskView
:
NO
];
}
if
(
currentBtn
==
btn
)
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"black_arrow_down_with_text"
]
forState
:
UIControlStateNormal
];
[
self
hiddenSortMaskView
:
YES
];
currentBtn
=
nil
;
}
else
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"select_arrow_up_text"
]
forState
:
UIControlStateNormal
];
if
(
_sortView
==
nil
)
{
_sortView
=
[[
SortMaskView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
-
105
,
ScreenSize
.
width
,
150
)
withOrderDirection
:
self
.
orderDirection
];
_sortView
.
dataArr
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"按时间顺序"
,
@"按时间逆序"
,
@"默认排序"
,
nil
];
_sortView
.
delegate
=
self
;
[
_maskView
addSubview
:
_sortView
];
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_sortView
.
frame
;
sortFrame
.
origin
.
y
=
0
;
_sortView
.
frame
=
sortFrame
;
}];
}
currentBtn
=
btn
;
}
}
else
if
(
btn
.
tag
==
BoltTag
){
if
(
_sortView
)
{
[
self
hiddenSortMaskView
:
NO
];
}
if
(
currentBtn
==
btn
)
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"black_filter_with_text"
]
forState
:
UIControlStateNormal
];
[
self
hiddenBoltMaskView
:
YES
];
currentBtn
=
nil
;
}
else
{
[
btn
setImage
:[
UIImage
imageNamed
:
@"selected-filter_with_text"
]
forState
:
UIControlStateNormal
];
if
(
_boltView
==
nil
)
{
_boltView
=
[[
PurchaseBoltView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
-
105
,
ScreenSize
.
width
,
274
)
state
:
self
.
state
billNumber
:
self
.
billLike
noticeNumber
:
self
.
noticeLike
];
_boltView
.
backgroundColor
=
XXFBgColor
;
_boltView
.
delegate
=
self
;
//initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成)
_boltView
.
dataArr
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"未提交"
,
@"已提交"
,
@"已拒绝"
,
@"已审批"
,
@"发运中"
,
@"已完成"
,
nil
];
[
_maskView
addSubview
:
_boltView
];
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_boltView
.
frame
;
sortFrame
.
origin
.
y
=
0
;
_boltView
.
frame
=
sortFrame
;
}];
currentBtn
=
btn
;
}
}
}
}
-
(
void
)
hiddenSortMaskView
:
(
BOOL
)
isHide
{
currentBtn
=
nil
;
[
self
checkSortBtnColor
];
if
(
isHide
==
NO
)
{
[
_sortView
removeFromSuperview
];
_sortView
=
nil
;
}
else
{
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_sortView
.
frame
;
sortFrame
.
origin
.
y
=
-
105
;
_sortView
.
frame
=
sortFrame
;
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
);
}
completion
:^
(
BOOL
finished
)
{
[
_sortView
removeFromSuperview
];
_sortView
=
nil
;
_maskView
.
hidden
=
YES
;
}];
}
}
-
(
void
)
hiddenBoltMaskView
:
(
BOOL
)
isHide
{
currentBtn
=
nil
;
[
self
checkBoltBtnColor
];
if
(
isHide
==
NO
)
{
[
_boltView
removeFromSuperview
];
_boltView
=
nil
;
}
else
{
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
sortFrame
=
_boltView
.
frame
;
sortFrame
.
origin
.
y
=
-
105
;
_boltView
.
frame
=
sortFrame
;
_maskView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
);
}
completion
:^
(
BOOL
finished
)
{
[
_boltView
removeFromSuperview
];
_boltView
=
nil
;
_maskView
.
hidden
=
YES
;
}];
}
}
//检测排序的颜色
-
(
void
)
checkSortBtnColor
{
if
(
self
.
orderDirection
.
length
>
0
)
{
[
_sortBtn
setImage
:[
UIImage
imageNamed
:
@"select_arrow_up_text"
]
forState
:
UIControlStateNormal
];
}
else
{
[
_sortBtn
setImage
:[
UIImage
imageNamed
:
@"black_arrow_down_with_text"
]
forState
:
UIControlStateNormal
];
}
}
-
(
void
)
checkBoltBtnColor
{
if
(
self
.
state
.
length
>
0
||
self
.
noticeLike
.
length
>
0
||
self
.
billLike
.
length
>
0
)
{
[
_boltBtn
setImage
:[
UIImage
imageNamed
:
@"selected-filter_with_text"
]
forState
:
UIControlStateNormal
];
}
else
{
[
_boltBtn
setImage
:[
UIImage
imageNamed
:
@"black_filter_with_text"
]
forState
:
UIControlStateNormal
];
}
}
#pragma mark - 确定
-
(
void
)
sureClick
{
if
(
self
.
state
.
length
>
0
||
self
.
billLike
.
length
>
0
||
self
.
noticeLike
.
length
>
0
||
self
.
orderDirection
.
length
>
0
)
{
[
_boltView
.
noticeFiled
resignFirstResponder
];
[
_boltView
.
billFiled
resignFirstResponder
];
_currentPage
=
0
;
//请求
[
self
getData
];
//还原数据
if
(
_sortView
)
{
[
self
hiddenSortMaskView
:
YES
];
}
if
(
_boltView
)
{
[
self
hiddenBoltMaskView
:
YES
];
}
}
}
#pragma mark - sortDelegate
-
(
void
)
getSortValueSelectRow
:
(
NSString
*
)
state
{
if
(
state
.
length
>
0
)
{
self
.
orderDirection
=
state
;
CLog
(
@"%@"
,
state
);
}
}
#pragma mark - boltDelegate
-
(
void
)
getBoltValueSelectRow
:
(
NSString
*
)
state
{
self
.
state
=
state
;
CLog
(
@"%@"
,
state
);
}
-
(
void
)
getbillLike
:
(
NSString
*
)
billLike
{
self
.
billLike
=
billLike
;
CLog
(
@"%@"
,
billLike
);
}
-
(
void
)
getnoticeLike
:
(
NSString
*
)
noticeLike
{
self
.
noticeLike
=
noticeLike
;
CLog
(
@"%@"
,
noticeLike
);
}
-
(
void
)
clearBoltInformation
{
//清空所有条件
if
(
self
.
billLike
.
length
>
0
)
{
self
.
billLike
=
@""
;
}
if
(
self
.
noticeLike
.
length
>
0
)
{
self
.
noticeLike
=
@""
;
}
if
(
self
.
state
.
length
>
0
)
{
self
.
state
=
@""
;
}
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
dataArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"SurveyID"
;
PurchaseCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
PurchaseCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
}
if
(
self
.
dataArr
.
count
>
0
)
{
PurchaseBill
*
bill
=
self
.
dataArr
[
indexPath
.
row
];
[
cell
setPurchaseBill
:
bill
];
}
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
SeePurchaseNoticeViewController
*
pvc
=
[
SeePurchaseNoticeViewController
new
];
pvc
.
title
=
@"查看采购单"
;
pvc
.
bill
=
_dataArr
[
indexPath
.
row
];
if
(
indexPath
.
row
==
0
){
pvc
.
indexPerson
=
0
;
}
else
if
(
indexPath
.
row
==
1
){
pvc
.
indexPerson
=
1
;
}
else
if
(
indexPath
.
row
==
2
){
pvc
.
indexPerson
=
2
;
}
[
self
PushViewController
:
pvc
animated
:
YES
];
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
TableHeight
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
XFFruit/ViewControllers/PurchaseNotice/Controllers/SeePurchaseNoticeViewController.h
View file @
9ac64d07
...
...
@@ -7,7 +7,10 @@
//
#import "ICRBaseViewController.h"
#import "PurchaseBill.h"
@interface
SeePurchaseNoticeViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
PurchaseBill
*
bill
;
//模拟三个人员
@property
(
nonatomic
,
assign
)
NSInteger
indexPerson
;
//0.1.2
@end
XFFruit/ViewControllers/PurchaseNotice/Controllers/SeePurchaseNoticeViewController.m
View file @
9ac64d07
...
...
@@ -7,9 +7,52 @@
//
#import "SeePurchaseNoticeViewController.h"
#import "ProductBillViewController.h"
#import "PurchaseBillProduct.h"
#define BottomHeight 50
#define LeftMargin 15
#define LeftWidth 100
#define LeftHeight 30
#define TopMargin 15
typedef
enum
:
NSUInteger
{
CancleTag
=
3500
,
EndTag
,
RejectTag
,
PassTag
,
SureTag
}
BtnTag
;
@interface
SeePurchaseNoticeViewController
()
{
UIScrollView
*
_scrollView
;
UIView
*
_purchaseView
;
UIView
*
_bottomView
;
ProductBillViewController
*
_pvc
;
NSArray
*
_leftArr
;
UIButton
*
_endBtn
;
UIButton
*
_rejectBtn
;
}
@property
(
nonatomic
,
strong
)
UILabel
*
billNumberLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
noticeNumberLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
createOperNameLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
checkNameLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
stateLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
lastModifyNameLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
typeLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
vendorNameLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
vendorIsSureLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
warehouseLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
otherPriceLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
totalPriceLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
noteLabel
;
@end
@implementation
SeePurchaseNoticeViewController
...
...
@@ -17,8 +60,272 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
self
bulidLayout
];
[
self
getDataFromServer
];
// Do any additional setup after loading the view.
}
-
(
void
)
getDataFromServer
{
__weak
typeof
(
self
)
weakSelf
=
self
;
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
]
;
if
(
success
==
1
)
{
NSDictionary
*
dictData
=
data
[
@"data"
];
PurchaseBill
*
bill
=
[[
PurchaseBill
alloc
]
init
];
[
bill
setValuesForKeysWithDictionary
:
dictData
];
self
.
bill
=
bill
;
[
strongSelf
fetchtPurchaseDetail
];
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
else
{
[
IBTLoadingView
showTips
:
@" 无记录 "
];
}
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
[[
ICRHTTPController
sharedController
]
getPurchaseResultWithPurchaseUuid
:
@"5a7417014f926eb5014f93b18fbc000f"
success
:
succ
failure
:
fail
];
}
#pragma mark - 视图初始化
-
(
void
)
bulidLayout
{
_scrollView
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
BottomHeight
)];
_scrollView
.
showsHorizontalScrollIndicator
=
NO
;
_scrollView
.
showsVerticalScrollIndicator
=
NO
;
_scrollView
.
backgroundColor
=
XXFBgColor
;
[
self
.
view
addSubview
:
_scrollView
];
[
self
createBtn
];
[
self
createPurchaseView
];
[
self
createBottomView
];
if
([
self
.
bill
.
state
isEqualToString
:
@"finished"
])
{
_endBtn
.
hidden
=
YES
;
_rejectBtn
.
hidden
=
YES
;
CGRect
scrollViewFrame
=
_scrollView
.
frame
;
scrollViewFrame
.
size
.
height
=
ScreenSize
.
height
-
64
;
_scrollView
.
frame
=
scrollViewFrame
;
}
}
-
(
void
)
createBtn
{
_rejectBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
LeftMargin
,
ScreenSize
.
height
-
64
-
BottomHeight
+
5
,
(
ScreenSize
.
width
-
LeftMargin
*
3
)
/
2
,
40
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
RejectTag
image
:
nil
title
:
@""
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
GXF_SAVE_COLOR
];
[
self
.
view
addSubview
:
_rejectBtn
];
_endBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
_rejectBtn
.
frame
)
+
LeftMargin
,
ScreenSize
.
height
-
64
-
BottomHeight
+
5
,
(
ScreenSize
.
width
-
LeftMargin
*
3
)
/
2
,
40
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
0
image
:
nil
title
:
@""
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
GXF_COMMIT_COLOR
];
[
self
.
view
addSubview
:
_endBtn
];
if
(
self
.
indexPerson
==
0
)
{
_rejectBtn
.
hidden
=
NO
;
_rejectBtn
.
tag
=
CancleTag
;
[
_rejectBtn
setTitle
:
@"作废"
forState
:
UIControlStateNormal
];
_endBtn
.
tag
=
EndTag
;
[
_endBtn
setTitle
:
@"结束"
forState
:
UIControlStateNormal
];
}
else
if
(
self
.
indexPerson
==
1
){
_rejectBtn
.
hidden
=
NO
;
_rejectBtn
.
tag
=
RejectTag
;
[
_rejectBtn
setTitle
:
@"拒绝"
forState
:
UIControlStateNormal
];
[
_endBtn
setTitle
:
@"审核通过"
forState
:
UIControlStateNormal
];
_endBtn
.
tag
=
PassTag
;
}
else
{
_rejectBtn
.
hidden
=
YES
;
_endBtn
.
frame
=
CGRectMake
(
LeftMargin
,
ScreenSize
.
height
-
64
-
BottomHeight
+
5
,
ScreenSize
.
width
-
LeftMargin
*
2
,
40
);
_endBtn
.
tag
=
SureTag
;
[
_endBtn
setTitle
:
@"确认"
forState
:
UIControlStateNormal
];
}
}
-
(
void
)
btnClick
:
(
UIButton
*
)
btn
{
NSLog
(
@"%ld"
,(
long
)
btn
.
tag
);
switch
(
btn
.
tag
)
{
case
CancleTag
:
{
NSLog
(
@"作废"
);
}
break
;
case
EndTag
:
{
NSLog
(
@"结束"
);
}
break
;
case
RejectTag
:
{
NSLog
(
@"拒绝"
);
}
break
;
case
PassTag
:
{
NSLog
(
@"审核通过"
);
}
break
;
case
SureTag
:
{
NSLog
(
@"确定"
);
}
break
;
default
:
break
;
}
}
-
(
void
)
createBottomView
{
_bottomView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_purchaseView
.
frame
)
+
TopMargin
,
ScreenSize
.
width
,
200
)];
_bottomView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_scrollView
addSubview
:
_bottomView
];
_pvc
=
[[
ProductBillViewController
alloc
]
init
];
[
self
addChildViewController
:
_pvc
];
_pvc
.
viewFrame
=
_bottomView
.
bounds
;
_pvc
.
isHiddenEdit
=
YES
;
[
_bottomView
addSubview
:
_pvc
.
view
];
}
-
(
void
)
createPurchaseView
{
if
(
self
.
indexPerson
==
0
)
{
_leftArr
=
@[
@"单号:"
,
@"采购通知单:"
,
@"创建人:"
,
@"最后修改人:"
,
@"状态:"
,
@"类型:"
,
@"供应商:"
,
@"供应商确认:"
,
@"收货仓库:"
,
@"其他费用:"
,
@"总金额:"
,
@"备注:"
];
}
else
if
(
self
.
indexPerson
==
1
)
{
_leftArr
=
@[
@"单号:"
,
@"采购通知单:"
,
@"创建人:"
,
@"审核人:"
,
@"状态:"
,
@"类型:"
,
@"供应商:"
,
@"供应商确认:"
,
@"收货仓库:"
,
@"其他费用:"
,
@"总金额:"
,
@"备注:"
];
}
else
{
_leftArr
=
@[
@"单号:"
,
@"采购通知单:"
,
@"创建人:"
,
@"审核人:"
,
@"状态:"
,
@"供应商:"
,
@"其他费用:"
,
@"总金额:"
,
@"备注:"
];
}
_purchaseView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
LeftHeight
*
_leftArr
.
count
+
LeftMargin
)];
_purchaseView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_scrollView
addSubview
:
_purchaseView
];
for
(
NSInteger
i
=
0
;
i
<
_leftArr
.
count
;
i
++
)
{
UILabel
*
leftLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
LeftMargin
,
10
+
LeftHeight
*
i
,
LeftWidth
,
LeftHeight
)];
leftLabel
.
font
=
GXF_SEVENTEENTH_SIZE
;
leftLabel
.
text
=
_leftArr
[
i
];
leftLabel
.
textColor
=
GXF_DETAIL_COLOR
;
[
_purchaseView
addSubview
:
leftLabel
];
UILabel
*
rightLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
leftLabel
.
frame
),
10
+
LeftHeight
*
i
,
_purchaseView
.
frame
.
size
.
width
-
LeftMargin
-
LeftWidth
,
LeftHeight
)];
rightLabel
.
font
=
GXF_SEVENTEENTH_SIZE
;
rightLabel
.
textColor
=
GXF_DETAIL_COLOR
;
if
(
i
==
0
)
{
self
.
billNumberLabel
=
rightLabel
;
}
else
if
(
i
==
1
)
{
self
.
noticeNumberLabel
=
rightLabel
;
}
else
if
(
i
==
2
){
self
.
createOperNameLabel
=
rightLabel
;
}
else
if
(
i
==
_leftArr
.
count
-
3
){
self
.
otherPriceLabel
=
rightLabel
;
}
else
if
(
i
==
_leftArr
.
count
-
2
){
self
.
totalPriceLabel
=
rightLabel
;
}
else
if
(
i
==
_leftArr
.
count
-
1
){
rightLabel
.
numberOfLines
=
0
;
self
.
noteLabel
=
rightLabel
;
}
if
(
self
.
indexPerson
==
0
||
self
.
indexPerson
==
1
)
{
if
(
self
.
indexPerson
==
0
)
{
if
(
i
==
3
)
{
self
.
lastModifyNameLabel
=
rightLabel
;
}
}
else
{
if
(
i
==
3
)
{
self
.
checkNameLabel
=
rightLabel
;
}
}
if
(
i
==
4
){
self
.
stateLabel
=
rightLabel
;
}
else
if
(
i
==
5
){
self
.
typeLabel
=
rightLabel
;
}
else
if
(
i
==
6
){
self
.
vendorNameLabel
=
rightLabel
;
}
else
if
(
i
==
7
){
self
.
vendorIsSureLabel
=
rightLabel
;
}
else
if
(
i
==
8
){
self
.
warehouseLabel
=
rightLabel
;
}
}
else
{
if
(
i
==
3
){
self
.
checkNameLabel
=
rightLabel
;
}
else
if
(
i
==
4
){
self
.
stateLabel
=
rightLabel
;
}
else
if
(
i
==
5
){
self
.
vendorNameLabel
=
rightLabel
;
}
}
[
_purchaseView
addSubview
:
rightLabel
];
}
}
-
(
void
)
fetchtPurchaseDetail
{
self
.
billNumberLabel
.
text
=
[
IBTCommon
checkString
:
self
.
bill
.
billNumber
];
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_INITIAL
])
{
self
.
stateLabel
.
textColor
=
[
UIColor
redColor
];
self
.
stateLabel
.
text
=
@"未提交"
;
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_SUBMITTED
])
{
self
.
stateLabel
.
textColor
=
[
UIColor
greenColor
];
self
.
stateLabel
.
text
=
@"已提交"
;
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_REJECTED
])
{
self
.
stateLabel
.
textColor
=
[
UIColor
grayColor
];
self
.
stateLabel
.
text
=
@"已拒绝"
;
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_APPROVED
])
{
self
.
stateLabel
.
textColor
=
[
UIColor
grayColor
];
self
.
stateLabel
.
text
=
@"已审批"
;
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_SHIPPING
])
{
self
.
stateLabel
.
textColor
=
[
UIColor
grayColor
];
self
.
stateLabel
.
text
=
@"发运中"
;
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_FINISHED
])
{
self
.
stateLabel
.
textColor
=
[
UIColor
blackColor
];
self
.
stateLabel
.
text
=
@"已完成"
;
}
self
.
noticeNumberLabel
.
text
=
(
self
.
bill
.
noticeNumber
.
length
==
0
)
?
@"无"
:(
self
.
bill
.
noticeNumber
);
self
.
createOperNameLabel
.
text
=
[
IBTCommon
checkString
:
self
.
bill
.
create_operName
];
self
.
checkNameLabel
.
text
=
[
IBTCommon
checkString
:
self
.
bill
.
vendor_name
];
self
.
vendorNameLabel
.
text
=
[
IBTCommon
checkString
:
self
.
bill
.
vendor_name
];
self
.
totalPriceLabel
.
text
=
[
IBTCommon
checkString
:[
self
.
bill
.
total
stringValue
]];
self
.
noteLabel
.
text
=
[
IBTCommon
checkString
:
self
.
bill
.
remark
];
self
.
lastModifyNameLabel
.
text
=
[
IBTCommon
checkString
:
self
.
bill
.
lastModify_operName
];
NSString
*
type
=
[
self
.
bill
.
type
isEqualToString
:
GXF_Critical
]
?
@"紧急"
:
@"普通"
;
self
.
typeLabel
.
text
=
type
;
self
.
vendorIsSureLabel
.
text
=
self
.
bill
.
vendorConfirmTime
.
length
>
0
?
@"是"
:
@"否"
;
self
.
warehouseLabel
.
text
=
[
IBTCommon
checkString
:
self
.
bill
.
receiveWrh_name
];
self
.
otherPriceLabel
.
text
=
[
self
.
bill
.
charge
stringValue
];
NSMutableArray
*
productArr
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
billDict
in
self
.
bill
.
products
)
{
PurchaseBillProduct
*
billProbuct
=
[
PurchaseBillProduct
new
];
[
billProbuct
setValuesForKeysWithDictionary
:
billDict
];
[
productArr
addObject
:
billProbuct
];
}
_pvc
.
productArr
=
productArr
;
[
_pvc
.
tableView
reloadData
];
[
self
setNoteHeight
];
}
-
(
void
)
setNoteHeight
{
CGFloat
height
=
[
self
.
noteLabel
calculateHeight
];
CGRect
noteFrame
=
self
.
noteLabel
.
frame
;
noteFrame
.
size
.
height
=
height
;
self
.
noteLabel
.
frame
=
noteFrame
;
CGFloat
totalHeight
=
height
+
LeftHeight
*
_leftArr
.
count
;
CGRect
purchaseFrame
=
_purchaseView
.
frame
;
purchaseFrame
.
size
.
height
=
totalHeight
;
_purchaseView
.
frame
=
purchaseFrame
;
CGRect
bottomFrame
=
_bottomView
.
frame
;
bottomFrame
.
origin
.
y
=
CGRectGetMaxY
(
_purchaseView
.
frame
)
+
TopMargin
;
_bottomView
.
frame
=
bottomFrame
;
_scrollView
.
contentSize
=
CGSizeMake
(
ScreenSize
.
width
,
totalHeight
+
CGRectGetHeight
(
_bottomView
.
frame
)
+
TopMargin
*
2
);
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
...
...
XFFruit/ViewControllers/PurchaseNotice/Views/SelectCompanyViewController.h
View file @
9ac64d07
...
...
@@ -7,7 +7,11 @@
//
#import "ICRBaseViewController.h"
#import "MaskCell.h"
typedef
void
(
^
ChosePackaging
)(
NSString
*
Packaging
);
@interface
SelectCompanyViewController
:
ICRBaseViewController
@interface
SelectCompanyViewController
:
ICRBaseViewController
@property
(
nonatomic
,
copy
)
ChosePackaging
chosePackaging
;
@end
XFFruit/ViewControllers/PurchaseNotice/Views/SelectCompanyViewController.m
View file @
9ac64d07
...
...
@@ -7,7 +7,7 @@
//
#import "SelectCompanyViewController.h"
#define TableHeight 45
@interface
SelectCompanyViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
>
{
...
...
@@ -27,6 +27,7 @@
-
(
void
)
initData
{
self
.
dataArr
=
[
NSMutableArray
arrayWithObjects
:
@"筐"
,
@"斤"
,
nil
];
self
.
title
=
@"选择包装单位"
;
}
-
(
void
)
initView
...
...
@@ -45,19 +46,16 @@
return
self
.
dataArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"cellID"
;
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
static
NSString
*
cellID
=
@"MaskCell"
;
MaskCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
//
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell
=
[[
MaskCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
totalWidth
:
ScreenSize
.
width
totalHeight
:
TableHeight
];
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
if
(
indexPath
.
row
>=
0
&&
indexPath
.
row
<
_dataArr
.
count
)
{
// cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell
.
textAlignment
=
UITextAlignmentCenter
;
cell
.
textLabel
.
text
=
self
.
dataArr
[
indexPath
.
row
];
}
cell
.
Commitbtn
.
hidden
=
YES
;
}
return
cell
;
...
...
@@ -68,6 +66,10 @@
return
40
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
NSString
*
ChosePackaging
=
self
.
dataArr
[
indexPath
.
row
];
//block 回调
self
.
chosePackaging
(
ChosePackaging
);
[
self
PopViewControllerAnimated
:
YES
];
}
-
(
void
)
didReceiveMemoryWarning
{
...
...
XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m
View file @
9ac64d07
...
...
@@ -35,6 +35,7 @@ typedef enum : NSUInteger {
NSMutableArray
*
_dataArr
;
UITextField
*
_titleField
;
UILabel
*
_productLabel
;
UILabel
*
_PackagingLable
;
UILabel
*
_startDateLabel
;
UILabel
*
_endDateLabel
;
UILabel
*
_personLabel
;
...
...
@@ -260,7 +261,7 @@ typedef enum : NSUInteger {
}
else
if
(
indexPath
.
row
==
3
)
{
contentLabel
.
text
=
@"选择包装单位"
;
_
productLabel
=
contentLabel
;
_
PackagingLable
=
contentLabel
;
[
self
preferDataInProductLabel
];
}
...
...
@@ -301,9 +302,11 @@ typedef enum : NSUInteger {
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
0
){
ChooseProductViewController
*
cvc
=
[
ChooseProductViewController
new
];
cvc
.
choseProduct
=
^
(
Product
*
product
){
_productLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
product
.
name
,
product
.
code
];
_productLabel
.
textColor
=
HexColor
(
@"444444"
);
self
.
productNameStr
=
product
.
name
;
...
...
@@ -315,6 +318,14 @@ typedef enum : NSUInteger {
}
else
if
(
indexPath
.
row
==
3
)
{
SelectCompanyViewController
*
vc
=
[
SelectCompanyViewController
new
];
vc
.
chosePackaging
=
^
(
NSString
*
Packaging
){
_PackagingLable
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
Packaging
];
_PackagingLable
.
textColor
=
HexColor
(
@"444444"
);
};
[
self
PushViewController
:
vc
animated
:
YES
];
}
}
...
...
XFFruit/en.lproj/Localizable.strings
View file @
9ac64d07
...
...
@@ -195,5 +195,21 @@
"AddSurvey" = "新建行情调研";
"AddPurchase" = "新建采购单";
"Purchase" = "采购单";
//Business
"Business" = "业务";
"Announcement" = "公告";
"AddSurvey" = "新建行情调研";
"Survey" = "查看行情调研";
"Survey1" = "填写行情反馈";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey4" = "新建采购单";
"Survey5" = "查看采购单";
"Survey6" = "审核采购单";
"Survey7" = "新建发运单";
"Survey8" = "查看发运单";
"Survey9" = "新建加工单";
"EditorShopDetail" ="编辑商品明细";
"AddShopDetail" ="添加商品明细";
XFFruit/zh-Hans.lproj/Localizable.strings
View file @
9ac64d07
...
...
@@ -181,3 +181,19 @@
"AddSurvey" = "新建行情调研";
"AddPurchase" = "新建采购单";
"Purchase" = "采购单";
//Business
"Business" = "业务";
"Announcement" = "公告";
"AddSurvey" = "新建行情调研";
"Survey" = "查看行情调研";
"Survey1" = "填写行情反馈";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey4" = "新建采购单";
"Survey5" = "查看采购单";
"Survey6" = "审核采购单";
"Survey7" = "新建发运单";
"Survey8" = "查看发运单";
"Survey9" = "新建加工单";
"EditorShopDetail" ="编辑商品明细";
"AddShopDetail" ="添加商品明细";
\ No newline at end of file
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