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
5f3dac71
Commit
5f3dac71
authored
Aug 20, 2015
by
n22
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DEV_20150805_001' of
http://121.42.32.57/root/xffruit
into DEV_20150805_001
Conflicts: XFFruit.xcodeproj/project.pbxproj
parents
f4a79001
8f9cd6ed
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1286 additions
and
23 deletions
+1286
-23
ICRFunctionItemControl.h
XFFruit/General/Views/FunctionView/ICRFunctionItemControl.h
+14
-1
BusinessViewController.m
XFFruit/ViewControllers/Business/BusinessViewController.m
+122
-22
NewPurchaseNoticeViewController.h
...trollers/PurchaseNotice/NewPurchaseNoticeViewController.h
+13
-0
NewPurchaseNoticeViewController.m
...trollers/PurchaseNotice/NewPurchaseNoticeViewController.m
+392
-0
PurchaseNoticeCell.h
XFFruit/ViewControllers/PurchaseNotice/PurchaseNoticeCell.h
+24
-0
PurchaseNoticeCell.m
XFFruit/ViewControllers/PurchaseNotice/PurchaseNoticeCell.m
+116
-0
SeePurchaseNoticeViewController.h
...trollers/PurchaseNotice/SeePurchaseNoticeViewController.h
+13
-0
SeePurchaseNoticeViewController.m
...trollers/PurchaseNotice/SeePurchaseNoticeViewController.m
+38
-0
ShopDetaileViewController.h
...iewControllers/PurchaseNotice/ShopDetaileViewController.h
+14
-0
ShopDetaileViewController.m
...iewControllers/PurchaseNotice/ShopDetaileViewController.m
+538
-0
Localizable.strings
XFFruit/en.lproj/Localizable.strings
+2
-0
No files found.
XFFruit/General/Views/FunctionView/ICRFunctionItemControl.h
View file @
5f3dac71
...
...
@@ -19,7 +19,20 @@ typedef NS_ENUM (NSUInteger, ICRFunctionID) {
kFunctionComeShopReg
,
kFunctionLeaveShopReg
,
kFunctionCreatTask
,
kFunctionHandleTask
kFunctionHandleTask
,
kFunctionNotice
,
kFunctionNewSurvey
,
kFunctionSeeSurvey
,
kFunctionFeeBackSurvey
,
kFunctionNewPurchaseNotice
,
kFunctionSeePurchaseNotice
,
kFunctionNewPurchase
,
kFunctionSeePurchase
,
kFunctionExaminePurchas
,
kFunctionNewShipment
,
kFunctionSeeShipment
,
kFunctionNewProcessing
,
};
@interface
ICRFunctionItemControl
:
UIControl
...
...
XFFruit/ViewControllers/Business/BusinessViewController.m
View file @
5f3dac71
...
...
@@ -8,10 +8,23 @@
#import "BusinessViewController.h"
#import "ICRTaskListViewController.h"
#import "ICRPatrolPlanViewController.h"
#import "ICRStoreListViewController.h"
#import "ICRStoreDetailViewController.h"
#import "ICRAnnouncementViewController.h"
#import "NewSurveyViewController.h"
#import "SurveyViewController.h"
#import "AddWorkSheetViewController.h"
#import "ICRFunctionBaseView.h"
#import "ICRFunctionEntity.h"
#import "ICRFunctionBaseView.h"
#import "NewPurchaseNoticeViewController.h"
#import "SeePurchaseNoticeViewController.h"
@interface
BusinessViewController
()
<
ICRFunctionBaseViewDelegate
>
@end
...
...
@@ -45,18 +58,30 @@
[
IBTCommon
localizableString
:
@"Survey7"
],
[
IBTCommon
localizableString
:
@"Survey8"
],[
IBTCommon
localizableString
:
@"Survey9"
],
];
NSArray
*
functionTags
=
@[
@
(
kFunctionAnnouncement
),
@
(
kFunctionTaskManagement
),
@
(
kFunctionPatrolPlan
),
@
(
kFunctionMyShop
),
@
(
kFunctionNavigation
),
@
(
kFunctionComeShopReg
),
@
(
kFunctionAnnouncement
),
@
(
kFunctionTaskManagement
),
@
(
kFunctionPatrolPlan
),
@
(
kFunctionMyShop
),
@
(
kFunctionNavigation
),
@
(
kFunctionComeShopReg
)];
NSArray
*
functionTags
=
@[
@
(
kFunctionNotice
),
//公告
@
(
kFunctionNewSurvey
),
//新建行情调研
@
(
kFunctionSeeSurvey
),
//查看行情调研
@
(
kFunctionFeeBackSurvey
),
//填写行情反馈
@
(
kFunctionNewPurchaseNotice
),
//新建采购通知
@
(
kFunctionSeePurchaseNotice
),
//查看采购通知
@
(
kFunctionNewPurchase
),
//新建采购单
@
(
kFunctionSeePurchase
),
//查看采购单
@
(
kFunctionExaminePurchas
),
//审核采购单
@
(
kFunctionNewShipment
),
//新建发运单
@
(
kFunctionSeeShipment
),
//查看发运单
@
(
kFunctionNewProcessing
)];
//新建加工单
int
i
=
0
;
for
(
NSString
*
functionName
in
fuctionNames
)
{
...
...
@@ -80,13 +105,97 @@
[
self
.
view
addSubview
:
baseView
];
}
#pragma mark - ICRFunctionBaseViewDelegate
-
(
void
)
ICRFunctionBaseView
:
(
ICRFunctionItemControl
*
)
imageView
{
/*
kFunctionAnnouncement = 0,
kFunctionTaskManagement,
kFunctionPatrolPlan,
kFunctionMyShop,
*/
switch
(
imageView
.
tag
)
{
case
kFunctionNotice
:
//公告
{
ICRAnnouncementViewController
*
aVC
=
[[
ICRAnnouncementViewController
alloc
]
init
];
[
self
PushViewController
:
aVC
animated
:
YES
];
}
break
;
case
kFunctionNewSurvey
:
//新建行情
{
NewSurveyViewController
*
svc
=
[[
NewSurveyViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"AddSurvey"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionSeeSurvey
:
//查看行情
{
SurveyViewController
*
svc
=
[[
SurveyViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"Survey"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionNewPurchaseNotice
:
//新建采购通知单
{
NewPurchaseNoticeViewController
*
svc
=
[[
NewPurchaseNoticeViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"Survey2"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionSeePurchaseNotice
:
//查看采购通知单
{
SeePurchaseNoticeViewController
*
svc
=
[[
SeePurchaseNoticeViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"Survey3"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionTaskManagement
:
//任务管理
{
ICRTaskListViewController
*
tVC
=
[[
ICRTaskListViewController
alloc
]
init
];
[
self
PushViewController
:
tVC
animated
:
YES
];
}
break
;
case
kFunctionPatrolPlan
:
//巡店计划
{
ICRPatrolPlanViewController
*
pVC
=
[[
ICRPatrolPlanViewController
alloc
]
initWithStore
:
nil
isHomeShow
:
YES
];
[
self
PushViewController
:
pVC
animated
:
YES
];
}
break
;
case
kFunctionMyShop
:
//我的店铺
{
// ICRStoreListViewController *sVC = [[ICRStoreListViewController alloc] initWithBHaveToChooseOne:NO];
// sVC.title = [IBTCommon localizableString:@"MyStore"];
// sVC.m_delegate = self;
// [self PushViewController:sVC animated:YES];
AddWorkSheetViewController
*
sVC
=
[[
AddWorkSheetViewController
alloc
]
init
];
[
self
PushViewController
:
sVC
animated
:
YES
];
}
break
;
default
:
return
;
break
;
}
}
/*
#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.
}
*/
-
(
void
)
initView
{
NSArray
*
butArray
=
[[
NSArray
alloc
]
initWithObjects
:
@"公告"
,
@"新建行情调研"
,
@"查看行情调研"
,
@"填写行情反馈"
,
@"新建采购通知"
,
@"查看采购通知"
,
@"新建采购单"
,
@"查看采购单"
,
@"审核采购单"
,
@"新建发运单"
,
@"查看发运单"
,
@"新建加工单"
,
nil
];
for
(
int
i
=
0
;
i
<
butArray
.
count
;
i
++
)
{
UIButton
*
but
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
but
.
frame
=
CGRectMake
(
15
+
i
%
3
*
(
90
+
10
),
10
+
(
i
/
3
)
*
(
100
+
10
)
,
90
,
90
)
;
// but.titleLabel.text=[NSString stringWithFormat:@"%@",[butArray objectAtIndex:i]];
// but.titleLabel.text=[NSString stringWithFormat:@"%@",[butArray objectAtIndex:i]];
NSString
*
str
=
[
butArray
objectAtIndex
:
i
];
[
but
setTitle
:
str
forState
:
UIControlStateNormal
];
but
.
backgroundColor
=
[
UIColor
redColor
];
...
...
@@ -95,14 +204,5 @@
}
}
/*
#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/NewPurchaseNoticeViewController.h
0 → 100644
View file @
5f3dac71
//
// NewPurchaseNoticeViewController.h
// XFFruit
//
// Created by mac on 15/8/16.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface
NewPurchaseNoticeViewController
:
ICRBaseViewController
@end
XFFruit/ViewControllers/PurchaseNotice/NewPurchaseNoticeViewController.m
0 → 100644
View file @
5f3dac71
//
// NewPurchaseNoticeViewController.m
// XFFruit
//
// Created by mac on 15/8/16.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "NewPurchaseNoticeViewController.h"
#import "SurveyCell.h"
#import "HPGrowingTextView.h"
#import "ChosePersonViewController.h"
#import "SurveyUser.h"
#import "Survey.h"
#import "PurchaseNoticeCell.h"
#import "ShopDetaileViewController.h"
#define LeftMargin 15
#define BtnHeight 44
#define TableHeight 46
#define CornerRadius 5
#define TitleSize 15
#define BtnSize 19
#define TotalHeight 432
#define KeyboardHeight 258
#define DateViewHeight 300
#define FootOfsetHeight 140
@interface
NewPurchaseNoticeViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
UITextFieldDelegate
,
HPGrowingTextViewDelegate
>
{
UITableView
*
_tableView
;
NSMutableArray
*
_dataArr
;
UITextField
*
_titleField
;
UILabel
*
_productLabel
;
UILabel
*
_startDateLabel
;
UILabel
*
_endDateLabel
;
UILabel
*
_personLabel
;
HPGrowingTextView
*
_noteTextView
;
NSIndexPath
*
selectedCellIndexPath
;
BOOL
_isClickStart
;
UITableView
*
mingXiTableView
;
}
@property
(
nonatomic
,
strong
)
NSString
*
titleStr
;
@property
(
nonatomic
,
strong
)
NSString
*
productCodeStr
;
@property
(
nonatomic
,
strong
)
NSString
*
productNameStr
;
@property
(
nonatomic
,
strong
)
NSString
*
productUuidStr
;
@property
(
nonatomic
,
strong
)
NSString
*
beginDateStr
;
@property
(
nonatomic
,
strong
)
NSString
*
endDateStr
;
@property
(
nonatomic
,
strong
)
NSString
*
remarkStr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
users
;
@property
(
nonatomic
,
strong
)
Survey
*
survey
;
@property
(
nonatomic
,
strong
)
UILabel
*
HeardLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
FootLabel
;
@property
(
nonatomic
,
strong
)
UIButton
*
addDetailedButton
;
@end
@implementation
NewPurchaseNoticeViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
self
setupSubviews
];
// Do any additional setup after loading the view.
}
-
(
void
)
setupSubviews
{
_dataArr
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"标题:"
,
@"采购员:"
,
@"备注:"
,
nil
];
self
.
view
.
backgroundColor
=
XXFBgColor
;
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
LeftMargin
,
ScreenSize
.
width
,
ScreenSize
.
height
/
2
-
FootOfsetHeight
-
LeftMargin
))
style
:(
UITableViewStylePlain
)];
_tableView
.
backgroundColor
=
[
UIColor
whiteColor
];
_tableView
.
tag
=
1001
;
_tableView
.
bounces
=
NO
;
_tableView
.
delegate
=
self
;
_tableView
.
dataSource
=
self
;
mingXiTableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
2
*
LeftMargin
+
_tableView
.
frame
.
size
.
height
,
ScreenSize
.
width
,
ScreenSize
.
height
-
_tableView
.
height
-
TableHeight
-
LeftMargin
)];
mingXiTableView
.
backgroundColor
=
[
UIColor
whiteColor
];
mingXiTableView
.
tag
=
1002
;
mingXiTableView
.
bounces
=
NO
;
mingXiTableView
.
delegate
=
self
;
mingXiTableView
.
dataSource
=
self
;
UIView
*
footView2
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
TableHeight
)];
footView2
.
backgroundColor
=
[
UIColor
clearColor
];
UILabel
*
lable
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
TableHeight
)];
lable
.
text
=
@" 商品 价格 包装规格 包装数量"
;
lable
.
textColor
=
HexColor
(
@"444444"
);
[
footView2
addSubview
:
lable
];
UIView
*
footView3
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
TableHeight
)];
footView3
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
addDetailedButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
self
.
addDetailedButton
setFrame
:
CGRectMake
(
90
,
0
,
200
,
TableHeight
)];
[
self
.
addDetailedButton
setTitle
:
@"+ 点击添加商品明细"
forState
:
UIControlStateNormal
];
[
self
.
addDetailedButton
addTarget
:
self
action
:
@selector
(
addShopeDetailed
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
addDetailedButton
setTitleColor
:
HexColor
(
@"444444"
)
forState
:
UIControlStateNormal
];
self
.
FootLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
footView3
.
size
.
height
-
1
,
footView3
.
size
.
width
-
2
*
LeftMargin
,
1
))];
self
.
FootLabel
.
backgroundColor
=
HexColor
(
@"e5e5e5"
);
self
.
FootLabel
.
font
=
FontSize
(
TitleSize
);
self
.
HeardLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
0
,
footView3
.
size
.
width
-
2
*
LeftMargin
,
1
))];
self
.
HeardLabel
.
backgroundColor
=
HexColor
(
@"e5e5e5"
);
self
.
HeardLabel
.
font
=
FontSize
(
TitleSize
);
//HexColor(@"e5e5e5")
[
footView3
addSubview
:
self
.
addDetailedButton
];
[
footView3
addSubview
:
self
.
HeardLabel
];
[
footView3
addSubview
:
self
.
FootLabel
];
mingXiTableView
.
tableFooterView
=
footView3
;
mingXiTableView
.
tableHeaderView
=
footView2
;
[
self
.
view
addSubview
:
_tableView
];
[
self
.
view
addSubview
:
mingXiTableView
];
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
if
([
tableView
isEqual
:
_tableView
])
{
return
1
;
}
else
if
([
tableView
isEqual
:
mingXiTableView
])
{
return
1
;
}
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
if
([
tableView
isEqual
:
_tableView
])
{
return
_dataArr
.
count
;
}
else
if
([
tableView
isEqual
:
mingXiTableView
])
{
return
_dataArr
.
count
;
}
return
1
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
([
tableView
isEqual
:
_tableView
])
{
static
NSString
*
cellID
=
@"cellID"
;
SurveyCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
SurveyCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
if
(
indexPath
.
row
>
0
&&
indexPath
.
row
<
_dataArr
.
count
-
1
)
{
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
}
[
self
createViewInCell
:
cell
indexPath
:
indexPath
];
}
[
cell
setTitleStr
:
_dataArr
[
indexPath
.
row
]];
return
cell
;
}
else
if
([
tableView
isEqual
:
mingXiTableView
])
{
static
NSString
*
CellID
=
@"CellID"
;
PurchaseNoticeCell
*
Cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
CellID
];
if
(
Cell
==
nil
)
{
Cell
=
[[
PurchaseNoticeCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
CellID
];
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
Cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
// Cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;向左箭头
}
if
(
selectedCellIndexPath
!=
nil
&
[
selectedCellIndexPath
compare
:
indexPath
]
==
NSOrderedSame
){
Cell
.
backgroundColor
=
XXFBgColor
;
Cell
.
subSview
.
hidden
=
NO
;
}
else
{
Cell
.
subSview
.
hidden
=
YES
;
Cell
.
backgroundColor
=
[
UIColor
whiteColor
];
}
[
Cell
.
button
addTarget
:
self
action
:
@selector
(
didtoucher
)
forControlEvents
:
UIControlEventTouchUpInside
];
// [cell setTitleStr:_dataArr[indexPath.row]];
return
Cell
;
}
return
nil
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
([
tableView
isEqual
:
_tableView
])
{
if
(
indexPath
.
row
==
2
){
return
TableHeight
*
2
;
}
else
{
return
TableHeight
;
}
}
else
if
([
tableView
isEqual
:
mingXiTableView
])
{
if
(
selectedCellIndexPath
!=
nil
&
[
selectedCellIndexPath
compare
:
indexPath
]
==
NSOrderedSame
){
return
TableHeight
*
3
;
}
return
TableHeight
;
}
return
TableHeight
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
([
tableView
isEqual
:
_tableView
])
{
if
(
indexPath
.
row
==
2
||
indexPath
.
row
==
3
)
{
[
self
keyboardHidden
];
if
(
indexPath
.
row
==
2
)
{
_isClickStart
=
YES
;
}
else
{
_isClickStart
=
NO
;
}
}
else
if
(
indexPath
.
row
==
1
){
ChosePersonViewController
*
cvc
=
[
ChosePersonViewController
new
];
cvc
.
chosePerson
=
^
(
NSArray
*
users
){
NSString
*
textStr
=
@""
;
if
(
self
.
users
.
count
<=
0
)
{
[
self
.
users
removeAllObjects
];
}
for
(
SurveyUser
*
user
in
users
)
{
if
(
textStr
.
length
==
0
)
{
textStr
=
[
textStr
stringByAppendingFormat
:
@"%@"
,
user
.
userName
];
}
else
{
textStr
=
[
textStr
stringByAppendingFormat
:
@"、%@"
,
user
.
userName
];
}
[
self
.
users
addObject
:[
user
dictForCommit
]];
}
_personLabel
.
text
=
textStr
;
_personLabel
.
textColor
=
HexColor
(
@"444444"
);
};
cvc
.
isMoreChose
=
NO
;
[
self
PushViewController
:
cvc
animated
:
YES
];
}
}
else
if
([
tableView
isEqual
:
mingXiTableView
])
{
PurchaseNoticeCell
*
Cell
=
(
PurchaseNoticeCell
*
)[
mingXiTableView
cellForRowAtIndexPath
:
indexPath
];
Cell
.
isSelected
=
YES
;
selectedCellIndexPath
=
indexPath
;
// [Cell setTitleStr:@"selected"];
// [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
[
mingXiTableView
reloadData
];
}
}
-
(
void
)
createViewInCell
:
(
SurveyCell
*
)
cell
indexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
0
)
{
_titleField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
)];
_titleField
.
textAlignment
=
NSTextAlignmentRight
;
_titleField
.
textColor
=
HexColor
(
@"444444"
);
_titleField
.
placeholder
=
@"输入采购通知标题"
;
_titleField
.
font
=
FontSize
(
15
);
_titleField
.
returnKeyType
=
UIReturnKeyDone
;
_titleField
.
delegate
=
self
;
[
cell
.
contentView
addSubview
:
_titleField
];
// if (self.survey) {
// _titleField.text = [IBTCommon checkString:self.survey.title];
// self.titleStr = [IBTCommon checkString:self.survey.title];
// }
// }else
}
else
if
(
indexPath
.
row
==
_dataArr
.
count
-
1
){
_noteTextView
=
[[
HPGrowingTextView
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
)];
_noteTextView
.
contentInset
=
UIEdgeInsetsMake
(
5
,
5
,
5
,
0
);
_noteTextView
.
minNumberOfLines
=
1
;
_noteTextView
.
maxNumberOfLines
=
4
;
_noteTextView
.
font
=
FontSize
(
15
);
_noteTextView
.
textAlignment
=
NSTextAlignmentRight
;
_noteTextView
.
delegate
=
self
;
_noteTextView
.
returnKeyType
=
UIReturnKeyDone
;
_noteTextView
.
placeholder
=
@"输入备注内容"
;
[
cell
.
contentView
addSubview
:
_noteTextView
];
// if (self.survey) {
// _noteTextView.text = [IBTCommon checkString:self.survey.remark];
// self.remarkStr = [IBTCommon checkString:self.survey.remark];
// }
CGRect
lineFrame
=
cell
.
lineLabel
.
frame
;
lineFrame
.
origin
.
y
=
TableHeight
*
2
-
1
;
cell
.
lineLabel
.
frame
=
lineFrame
;
}
else
{
UILabel
*
contentLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
))];
contentLabel
.
textAlignment
=
NSTextAlignmentRight
;
contentLabel
.
textColor
=
HexColor
(
@"bbbbbb"
);
contentLabel
.
font
=
FontSize
(
TitleSize
);
[
cell
.
contentView
addSubview
:
contentLabel
];
if
(
indexPath
.
row
==
1
)
{
contentLabel
.
text
=
@"选择采购员"
;
_personLabel
=
contentLabel
;
[
self
preferDataInPersonLabel
];
}
}
}
-
(
void
)
preferDataInPersonLabel
{
if
(
self
.
survey
)
{
if
(
self
.
survey
.
users
.
count
>
0
)
{
NSString
*
personStr
=
@""
;
for
(
SurveyUser
*
surveyUser
in
self
.
survey
.
users
)
{
if
(
personStr
.
length
==
0
)
{
personStr
=
[
personStr
stringByAppendingFormat
:
@"%@"
,
surveyUser
.
userName
];
}
else
{
personStr
=
[
personStr
stringByAppendingFormat
:
@"、%@"
,
surveyUser
.
userName
];
}
}
_personLabel
.
text
=
personStr
;
_personLabel
.
textColor
=
HexColor
(
@"444444"
);
}
if
(
self
.
users
>
0
)
{
[
self
.
users
addObjectsFromArray
:
self
.
survey
.
users
];
}
}
}
//添加商品明细
-
(
void
)
addShopeDetailed
{
ShopDetaileViewController
*
svc
=
[[
ShopDetaileViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"AddShopDetail"
];
[
self
PushViewController
:
svc
animated
:
YES
];
NSLog
(
@"1111111111"
);
}
//编辑
-
(
void
)
didtoucher
{
// EditorShopDetail
ShopDetaileViewController
*
svc
=
[[
ShopDetaileViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"EditorShopDetail"
];
[
self
PushViewController
:
svc
animated
:
YES
];
//
NSLog
(
@"123213232332323223"
);
}
#pragma mark delegate
-
(
BOOL
)
growingTextViewShouldReturn
:
(
HPGrowingTextView
*
)
growingTextView
{
[
_noteTextView
resignFirstResponder
];
[
self
setTableFrame
:
LeftMargin
];
return
YES
;
}
-
(
void
)
growingTextViewDidBeginEditing
:
(
HPGrowingTextView
*
)
growingTextView
{
CGFloat
offset
=
ScreenSize
.
height
-
TotalHeight
-
KeyboardHeight
;
if
(
offset
<
0
)
{
//上移
[
self
setTableFrame
:
LeftMargin
+
offset
];
}
}
-
(
void
)
setTableFrame
:
(
CGFloat
)
tabelH
{
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
tableFrame
=
_tableView
.
frame
;
tableFrame
.
origin
.
y
=
tabelH
;
_tableView
.
frame
=
tableFrame
;
}];
}
-
(
void
)
keyboardHidden
{
[
_titleField
resignFirstResponder
];
[
_noteTextView
resignFirstResponder
];
[
self
setTableFrame
:
LeftMargin
];
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
/*
#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/PurchaseNoticeCell.h
0 → 100644
View file @
5f3dac71
//
// PurchaseNoticeCell.h
// XFFruit
//
// Created by mac on 15/8/18.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
PurchaseNoticeCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UILabel
*
HeardLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
FootLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
SpLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
DjLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
BzggLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
BzslLabel
;
@property
(
nonatomic
,
strong
)
UIView
*
subSview
;
@property
(
nonatomic
,
assign
)
BOOL
isSelected
;
@property
(
nonatomic
,
strong
)
UIButton
*
button
;
-
(
void
)
setTitleStr
:(
NSString
*
)
str
;
@end
XFFruit/ViewControllers/PurchaseNotice/PurchaseNoticeCell.m
0 → 100644
View file @
5f3dac71
//
// PurchaseNoticeCell.m
// XFFruit
//
// Created by mac on 15/8/18.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "PurchaseNoticeCell.h"
#define TitleSize 17
#define LeftMargin 15
#define TableHeight 46
#define TableWidth 60
@implementation
PurchaseNoticeCell
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
];
if
(
self
)
{
self
.
isSelected
=
NO
;
[
self
bulidLayout
];
}
return
self
;
}
-
(
void
)
bulidLayout
{
self
.
HeardLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
0
,
ScreenSize
.
width
-
LeftMargin
*
2
,
1
))];
self
.
HeardLabel
.
backgroundColor
=
HexColor
(
@"e5e5e5"
);
self
.
HeardLabel
.
font
=
FontSize
(
TitleSize
);
self
.
FootLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
self
.
size
.
height
-
1
,
ScreenSize
.
width
-
LeftMargin
*
2
,
1
))];
self
.
HeardLabel
.
backgroundColor
=
HexColor
(
@"e5e5e5"
);
self
.
HeardLabel
.
font
=
FontSize
(
TitleSize
);
self
.
SpLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
+
20
,
0
,
TableWidth
,
TableHeight
))];
self
.
SpLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
SpLabel
.
textColor
=
HexColor
(
@"666666"
);
self
.
SpLabel
.
font
=
FontSize
(
TitleSize
);
self
.
DjLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
+
80
,
0
,
TableWidth
,
TableHeight
))];
self
.
DjLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
DjLabel
.
textColor
=
HexColor
(
@"666666"
);
self
.
DjLabel
.
font
=
FontSize
(
TitleSize
);
self
.
BzggLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
LeftMargin
+
150
,
0
,
TableWidth
,
TableHeight
)];
self
.
BzggLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
BzggLabel
.
textColor
=
HexColor
(
@"666666"
);
self
.
BzggLabel
.
font
=
FontSize
(
TitleSize
);
self
.
BzslLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
LeftMargin
+
240
,
0
,
TableWidth
,
TableHeight
)];
self
.
BzslLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
BzslLabel
.
textColor
=
HexColor
(
@"666666"
);
self
.
BzslLabel
.
font
=
FontSize
(
TitleSize
);
self
.
SpLabel
.
text
=
@"1 西瓜"
;
self
.
DjLabel
.
text
=
@"0.8"
;
self
.
BzggLabel
.
text
=
@"1*12"
;
self
.
BzslLabel
.
text
=
@"100框"
;
self
.
subSview
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
50
,
ScreenSize
.
width
,
TableHeight
*
3
)];
NSArray
*
array
=
[
NSArray
arrayWithObjects
:
@"包装规格"
,
@"基础数量"
,
@"包装单价"
,
@"备注"
,
nil
];
NSArray
*
array1
=
[
NSArray
arrayWithObjects
:
@"包装数量"
,
@"基础单价"
,
@"总金额"
,
nil
];
for
(
int
i
=
0
;
i
<
array
.
count
;
i
++
)
{
UILabel
*
lable
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
TableWidth
-
10
,
i
*
(
10
+
10
),
100
,
10
)];
lable
.
text
=
[
array
objectAtIndex
:
i
];
lable
.
font
=
FontSize
(
TitleSize
-
2
);
[
lable
setTextColor
:
HexColor
(
@"444444"
)];
[
self
.
subSview
addSubview
:
lable
];
}
for
(
int
i
=
0
;
i
<
array1
.
count
;
i
++
)
{
UILabel
*
lable
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
TableWidth
+
150
,
i
*
(
10
+
10
),
100
,
10
)];
lable
.
text
=
[
array
objectAtIndex
:
i
];
lable
.
font
=
FontSize
(
TitleSize
-
2
);
[
lable
setTextColor
:
HexColor
(
@"444444"
)];
[
self
.
subSview
addSubview
:
lable
];
}
self
.
subSview
.
hidden
=
YES
;
self
.
button
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
self
.
button
setFrame
:
CGRectMake
(
310
,
0
,
50
,
50
)];
[
self
.
button
setImage
:[
UIImage
imageNamed
:
@"AttachHide"
]
forState
:
UIControlStateNormal
];
// [self.button setTitle:@"编辑" forState:UIControlStateNormal];
// [self.button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[
self
.
contentView
addSubview
:
self
.
button
];
[
self
.
contentView
addSubview
:
self
.
subSview
];
[
self
.
contentView
addSubview
:
self
.
SpLabel
];
[
self
.
contentView
addSubview
:
self
.
DjLabel
];
[
self
.
contentView
addSubview
:
self
.
BzslLabel
];
[
self
.
contentView
addSubview
:
self
.
BzggLabel
];
[
self
.
contentView
addSubview
:
self
.
HeardLabel
];
// [self.contentView addSubview:self.FootLabel];
}
-
(
void
)
setTitleStr
:
(
NSString
*
)
str
{
}
-
(
void
)
awakeFromNib
{
// Initialization code
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
XFFruit/ViewControllers/PurchaseNotice/SeePurchaseNoticeViewController.h
0 → 100644
View file @
5f3dac71
//
// SeePurchaseNoticeViewController.h
// XFFruit
//
// Created by mac on 15/8/16.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface
SeePurchaseNoticeViewController
:
ICRBaseViewController
@end
XFFruit/ViewControllers/PurchaseNotice/SeePurchaseNoticeViewController.m
0 → 100644
View file @
5f3dac71
//
// SeePurchaseNoticeViewController.m
// XFFruit
//
// Created by mac on 15/8/16.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "SeePurchaseNoticeViewController.h"
@interface
SeePurchaseNoticeViewController
()
@end
@implementation
SeePurchaseNoticeViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
/*
#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/ShopDetaileViewController.h
0 → 100644
View file @
5f3dac71
//
// ShopDetaileViewController.h
// XFFruit
//
// Created by mac on 15/8/19.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "Survey.h"
@interface
ShopDetaileViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
Survey
*
survey
;
@property
(
nonatomic
,
strong
)
NSString
*
navTitle
;
@end
XFFruit/ViewControllers/PurchaseNotice/ShopDetaileViewController.m
0 → 100644
View file @
5f3dac71
//
// ShopDetaileViewController.m
// XFFruit
//
// Created by mac on 15/8/19.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ShopDetaileViewController.h"
#import "SurveyCell.h"
#import "HPGrowingTextView.h"
#import "StartTimeView.h"
#import "ChosePersonViewController.h"
#import "ChooseProductViewController.h"
#import "SurveyUser.h"
#import "Survey.h"
#import "Product.h"
#define LeftMargin 15
#define BtnHeight 44
#define TableHeight 46
#define CornerRadius 5
#define TitleSize 15
#define BtnSize 19
#define TotalHeight 432
#define KeyboardHeight 258
#define DateViewHeight 300
typedef
enum
:
NSUInteger
{
SaveTag
=
2000
,
CommitTag
,
}
BtnTag
;
@interface
ShopDetaileViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
HPGrowingTextViewDelegate
,
UITextFieldDelegate
,
StartTimeViewDelegate
>
{
UITableView
*
_tableView
;
NSMutableArray
*
_dataArr
;
UITextField
*
_titleField
;
UILabel
*
_productLabel
;
UILabel
*
_startDateLabel
;
UILabel
*
_endDateLabel
;
UILabel
*
_personLabel
;
HPGrowingTextView
*
_noteTextView
;
UIDatePicker
*
_timePicker
;
BOOL
_isClickStart
;
StartTimeView
*
_startTimeView
;
}
@property
(
nonatomic
,
strong
)
NSString
*
titleStr
;
@property
(
nonatomic
,
strong
)
NSString
*
productCodeStr
;
@property
(
nonatomic
,
strong
)
NSString
*
productNameStr
;
@property
(
nonatomic
,
strong
)
NSString
*
productUuidStr
;
@property
(
nonatomic
,
strong
)
NSString
*
beginDateStr
;
@property
(
nonatomic
,
strong
)
NSString
*
endDateStr
;
@property
(
nonatomic
,
strong
)
NSString
*
remarkStr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
users
;
@end
@implementation
ShopDetaileViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
title
=
self
.
navTitle
;
[
self
initData
];
// [self createTableView];
[
self
setupSubviews
];
// Do any additional setup after loading the view.
}
-
(
void
)
initData
{
_dataArr
=
[
NSMutableArray
array
];
self
.
users
=
[
NSMutableArray
array
];
[
_dataArr
addObject
:
@"商品"
];
[
_dataArr
addObject
:
@"包装规格"
];
[
_dataArr
addObject
:
@"包装数量"
];
[
_dataArr
addObject
:
@"包装单位"
];
[
_dataArr
addObject
:
@"基础数量"
];
[
_dataArr
addObject
:
@"基础单价"
];
[
_dataArr
addObject
:
@"包装单位"
];
[
_dataArr
addObject
:
@"总金额"
];
[
_dataArr
addObject
:
@"备注"
];
}
-
(
void
)
setupSubviews
{
// self.view.backgroundColor = XXFBgColor;
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
LeftMargin
))
style
:(
UITableViewStylePlain
)];
_tableView
.
backgroundColor
=
[
UIColor
whiteColor
];
_tableView
.
bounces
=
NO
;
_tableView
.
delegate
=
self
;
_tableView
.
dataSource
=
self
;
UIView
*
footView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
50
)];
UIButton
*
saveBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
LeftMargin
,
10
,
(
ScreenSize
.
width
-
LeftMargin
*
3
)
/
2
,
BtnHeight
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
SaveTag
image
:
nil
title
:
@"保存"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
CornerRadius
bgColor
:
HexColor
(
@"50bd62"
)];
[
footView
addSubview
:
saveBtn
];
UIButton
*
commitBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
saveBtn
.
frame
.
origin
.
x
+
saveBtn
.
frame
.
size
.
width
+
LeftMargin
,
10
,
(
ScreenSize
.
width
-
LeftMargin
*
3
)
/
2
,
BtnHeight
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
CommitTag
image
:
nil
title
:
@"提交"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
CornerRadius
bgColor
:
HexColor
(
@"f69100"
)];
[
footView
addSubview
:
commitBtn
];
// [self.view addSubview:footView];
_tableView
.
tableFooterView
=
footView
;
[
self
.
view
addSubview
:
_tableView
];
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
#pragma mark - 按钮点击事件
-
(
void
)
btnClick
:
(
UIButton
*
)
btn
{
switch
(
btn
.
tag
)
{
case
SaveTag
:
{
// if ([self checkSurvey]) {
// [self saveSurvey:@"initial" message:@"正在保存..."];
// }
}
break
;
case
CommitTag
:
{
// if ([self checkSurvey]) {
// [self saveSurvey:@"submitted" message:@"正在提交..."];
// }
}
break
;
default
:
break
;
}
}
-
(
BOOL
)
checkSurvey
{
self
.
titleStr
=
_titleField
.
text
;
self
.
remarkStr
=
_noteTextView
.
text
;
if
(
self
.
titleStr
.
length
==
0
||
self
.
productUuidStr
.
length
==
0
||
self
.
productNameStr
.
length
==
0
||
self
.
productCodeStr
.
length
==
0
||
self
.
users
.
count
<=
0
||
self
.
beginDateStr
.
length
==
0
||
self
.
endDateStr
.
length
==
0
)
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示信息"
message
:
@"信息不完整"
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
[
alert
show
];
return
NO
;
}
return
YES
;
}
#pragma mark - 保存
-
(
void
)
saveSurvey
:
(
NSString
*
)
state
message
:
(
NSString
*
)
msg
{
//保存
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
];
if
(
success
==
1
)
{
//成功
[
IBTLoadingView
showTips
:
@"操作成功"
];
[
self
clearAllInformation
];
if
(
self
.
survey
)
{
[
ICRUserUtil
sharedInstance
].
needFresh
=
YES
;
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
id
uuidObject
=
[
NSNull
null
];
if
(
self
.
survey
.
uuid
.
length
>
0
){
uuidObject
=
self
.
survey
.
uuid
;
}
id
billNumberObject
=
[
NSNull
null
];
if
(
self
.
survey
.
billNumber
>
0
)
{
billNumberObject
=
self
.
survey
.
billNumber
;
}
NSNumber
*
version
=
[
NSNumber
numberWithLong
:
0
];
if
(
self
.
survey
)
{
version
=
self
.
survey
.
version
;
}
NSDictionary
*
dict
=
@{
@"uuid"
:
uuidObject
,
@"version"
:
version
,
@"billnumber"
:
billNumberObject
,
@"title"
:
[
IBTCommon
checkString
:
self
.
titleStr
],
@"state"
:
state
,
@"productUuid"
:
[
IBTCommon
checkString
:
self
.
productUuidStr
],
@"productCode"
:
[
IBTCommon
checkString
:
self
.
productCodeStr
],
@"productName"
:
[
IBTCommon
checkString
:
self
.
productNameStr
],
@"beginDate"
:
[
IBTCommon
checkString
:
self
.
beginDateStr
],
@"endDate"
:
[
IBTCommon
checkString
:
self
.
endDateStr
],
@"remark"
:
[
IBTCommon
checkString
:
self
.
remarkStr
],
@"users"
:
self
.
users
};
[
IBTLoadingView
showProgressLabel
:
msg
];
[[
ICRHTTPController
sharedController
]
saveSurveyWithAuthenticode
:
dict
success
:
succ
failure
:
fail
];
}
-
(
void
)
clearAllInformation
{
_titleField
.
text
=
@""
;
_productLabel
.
text
=
@"请输入商品"
;
_productLabel
.
textColor
=
HexColor
(
@"bbbbbb"
);
_startDateLabel
.
text
=
@"选择日期"
;
_startDateLabel
.
textColor
=
HexColor
(
@"bbbbbb"
);
_endDateLabel
.
text
=
@"选择日期"
;
_endDateLabel
.
textColor
=
HexColor
(
@"bbbbbb"
);
_personLabel
.
text
=
@"选择调研人员"
;
_personLabel
.
textColor
=
HexColor
(
@"bbbbbb"
);
_noteTextView
.
text
=
@""
;
//清空数据
self
.
titleStr
=
@""
;
self
.
productCodeStr
=
@""
;
self
.
productNameStr
=
@""
;
self
.
productUuidStr
=
@""
;
self
.
beginDateStr
=
@""
;
self
.
endDateStr
=
@""
;
[
self
.
users
removeAllObjects
];
self
.
remarkStr
=
@""
;
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
_dataArr
.
count
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
// if (indexPath.row == 0){
// return TableHeight*2;
// }else{
return
TableHeight
;
// }
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"cellID"
;
SurveyCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
SurveyCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
if
(
indexPath
.
row
==
0
||
indexPath
.
row
==
3
)
{
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
}
[
self
createViewInCell
:
cell
indexPath
:
indexPath
];
}
[
cell
setTitleStr
:
_dataArr
[
indexPath
.
row
]];
return
cell
;
}
-
(
void
)
createViewInCell
:
(
SurveyCell
*
)
cell
indexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
0
||
indexPath
.
row
==
3
)
{
UILabel
*
contentLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
))];
contentLabel
.
textAlignment
=
NSTextAlignmentRight
;
contentLabel
.
textColor
=
HexColor
(
@"bbbbbb"
);
contentLabel
.
font
=
FontSize
(
TitleSize
);
[
cell
.
contentView
addSubview
:
contentLabel
];
if
(
indexPath
.
row
==
0
)
{
contentLabel
.
text
=
@"选择商品"
;
_productLabel
=
contentLabel
;
[
self
preferDataInProductLabel
];
}
else
if
(
indexPath
.
row
==
3
)
{
contentLabel
.
text
=
@"选择包装单位"
;
_productLabel
=
contentLabel
;
[
self
preferDataInProductLabel
];
}
}
else
{
_titleField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
)];
_titleField
.
textAlignment
=
NSTextAlignmentRight
;
_titleField
.
textColor
=
HexColor
(
@"444444"
);
_titleField
.
placeholder
=
@"输入调研标题"
;
_titleField
.
font
=
FontSize
(
15
);
_titleField
.
returnKeyType
=
UIReturnKeyDone
;
_titleField
.
delegate
=
self
;
[
cell
.
contentView
addSubview
:
_titleField
];
if
(
indexPath
.
row
==
1
)
{
_titleField
.
placeholder
=
@"输入包装规格"
;
}
else
if
(
indexPath
.
row
==
2
)
{
_titleField
.
placeholder
=
@"输入包装数量"
;
}
else
if
(
indexPath
.
row
==
4
)
{
_titleField
.
placeholder
=
@"输入基础数量"
;
}
else
if
(
indexPath
.
row
==
5
)
{
_titleField
.
placeholder
=
@"输入基础单价"
;
}
else
if
(
indexPath
.
row
==
6
)
{
_titleField
.
placeholder
=
@"输入包装单价"
;
}
else
if
(
indexPath
.
row
==
7
)
{
_titleField
.
placeholder
=
@"输入总金额"
;
}
else
if
(
indexPath
.
row
==
8
)
{
_titleField
.
placeholder
=
@"输入备注内容"
;
}
// if (self.survey) {
// _titleField.text = [IBTCommon checkString:self.survey.title];
// self.titleStr = [IBTCommon checkString:self.survey.title];
// }
}
// _titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
// _titleField.textAlignment = NSTextAlignmentRight;
// _titleField.textColor = HexColor(@"444444");
// _titleField.placeholder = @"输入调研标题";
// _titleField.font = FontSize(15);
// _titleField.returnKeyType = UIReturnKeyDone;
// _titleField.delegate = self;
// [cell.contentView addSubview:_titleField];
// if (self.survey) {
// _titleField.text = [IBTCommon checkString:self.survey.title];
// self.titleStr = [IBTCommon checkString:self.survey.title];
// }
// }else if (indexPath.row == _dataArr.count -1){
// _noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
// _noteTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
// _noteTextView.minNumberOfLines = 1;
// _noteTextView.maxNumberOfLines = 4;
// _noteTextView.font = FontSize(15);
// _noteTextView.textAlignment = NSTextAlignmentRight;
// _noteTextView.delegate = self;
// _noteTextView.returnKeyType = UIReturnKeyDone;
// _noteTextView.placeholder = @"输入备注内容";
// [cell.contentView addSubview:_noteTextView];
// if (self.survey) {
// _noteTextView.text = [IBTCommon checkString:self.survey.remark];
// self.remarkStr = [IBTCommon checkString:self.survey.remark];
// }
// CGRect lineFrame = cell.lineLabel.frame;
// lineFrame.origin.y = TableHeight*2-1;
// cell.lineLabel.frame = lineFrame;
// }else{
// UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight))];
// contentLabel.textAlignment= NSTextAlignmentRight;
// contentLabel.textColor = HexColor(@"bbbbbb");
// contentLabel.font = FontSize(TitleSize);
// [cell.contentView addSubview:contentLabel];
// if (indexPath.row == 1) {
// contentLabel.text = @"选择商品";
// _productLabel = contentLabel;
// [self preferDataInProductLabel];
// }else if(indexPath.row == 2){
// contentLabel.text = @"选择日期";
// _startDateLabel = contentLabel;
// if (self.survey) {
// if (self.survey.beginDate.length > 9) {
// _startDateLabel.text = [[IBTCommon checkString:self.survey.beginDate]substringToIndex:10];
// }
// _startDateLabel.textColor = HexColor(@"444444");
// self.beginDateStr =[IBTCommon checkString:self.survey.beginDate];
//
// }
// }else if(indexPath.row == 3){
// contentLabel.text = @"选择日期";
// _endDateLabel = contentLabel;
// if (self.survey) {
// if (self.survey.endDate.length > 9) {
// _endDateLabel.text = [[IBTCommon checkString:self.survey.endDate]substringToIndex:10];
// }
// _endDateLabel.textColor = HexColor(@"444444");
// self.endDateStr = [IBTCommon checkString:self.survey.endDate];
// }
// }else if(indexPath.row == 4){
// contentLabel.text = @"选择调研人员";
// _personLabel = contentLabel;
// [self preferDataInPersonLabel];
// }
// }
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
2
||
indexPath
.
row
==
3
)
{
[
self
keyboardHidden
];
if
(
indexPath
.
row
==
2
)
{
_isClickStart
=
YES
;
}
else
{
_isClickStart
=
NO
;
}
[
self
startDatePickView
];
}
else
if
(
indexPath
.
row
==
4
){
ChosePersonViewController
*
cvc
=
[
ChosePersonViewController
new
];
cvc
.
chosePerson
=
^
(
NSArray
*
users
){
NSString
*
textStr
=
@""
;
if
(
self
.
users
.
count
<=
0
)
{
[
self
.
users
removeAllObjects
];
}
for
(
SurveyUser
*
user
in
users
)
{
if
(
textStr
.
length
==
0
)
{
textStr
=
[
textStr
stringByAppendingFormat
:
@"%@"
,
user
.
userName
];
}
else
{
textStr
=
[
textStr
stringByAppendingFormat
:
@"、%@"
,
user
.
userName
];
}
[
self
.
users
addObject
:[
user
dictForCommit
]];
}
_personLabel
.
text
=
textStr
;
_personLabel
.
textColor
=
HexColor
(
@"444444"
);
};
cvc
.
isMoreChose
=
YES
;
[
self
PushViewController
:
cvc
animated
:
YES
];
}
else
if
(
indexPath
.
row
==
1
){
ChooseProductViewController
*
cvc
=
[
ChooseProductViewController
new
];
cvc
.
choseProduct
=
^
(
Product
*
product
){
_productLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
product
.
name
,
product
.
code
];
_productLabel
.
textColor
=
HexColor
(
@"444444"
);
self
.
productNameStr
=
product
.
name
;
self
.
productUuidStr
=
product
.
uuid
;
self
.
productCodeStr
=
product
.
code
;
};
cvc
.
isMoreChose
=
NO
;
[
self
PushViewController
:
cvc
animated
:
YES
];
}
}
-
(
void
)
preferDataInPersonLabel
{
if
(
self
.
survey
)
{
if
(
self
.
survey
.
users
.
count
>
0
)
{
NSString
*
personStr
=
@""
;
for
(
SurveyUser
*
surveyUser
in
self
.
survey
.
users
)
{
if
(
personStr
.
length
==
0
)
{
personStr
=
[
personStr
stringByAppendingFormat
:
@"%@"
,
surveyUser
.
userName
];
}
else
{
personStr
=
[
personStr
stringByAppendingFormat
:
@"、%@"
,
surveyUser
.
userName
];
}
}
_personLabel
.
text
=
personStr
;
_personLabel
.
textColor
=
HexColor
(
@"444444"
);
}
if
(
self
.
users
>
0
)
{
[
self
.
users
addObjectsFromArray
:
self
.
survey
.
users
];
}
}
}
-
(
void
)
preferDataInProductLabel
{
if
(
self
.
survey
)
{
_productLabel
.
text
=
[
IBTCommon
checkString
:
self
.
survey
.
productName
];
_productLabel
.
textColor
=
HexColor
(
@"444444"
);
self
.
productCodeStr
=
[
IBTCommon
checkString
:
self
.
survey
.
productCode
];
self
.
productNameStr
=
[
IBTCommon
checkString
:
self
.
survey
.
productName
];
self
.
productUuidStr
=
[
IBTCommon
checkString
:
self
.
survey
.
productUuid
];
}
}
-
(
void
)
startDatePickView
{
if
(
!
_startTimeView
)
{
_startTimeView
=
[[
StartTimeView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
ScreenSize
.
height
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
)];
_startTimeView
.
delegate
=
self
;
_startTimeView
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
.
5
);
[
self
.
view
addSubview
:
_startTimeView
];
[
UIView
animateWithDuration
:
0
.
15
animations
:
^
{
CGRect
startFrame
=
_startTimeView
.
frame
;
startFrame
.
origin
.
y
=
0
;
_startTimeView
.
frame
=
startFrame
;
}
completion
:^
(
BOOL
finished
)
{
}];
}
}
-
(
void
)
cancelTimeView
{
[
self
clearDatePickView
];
}
-
(
void
)
okTimeView
:
(
NSDate
*
)
time
{
if
(
_isClickStart
)
{
_startDateLabel
.
textColor
=
HexColor
(
@"444444"
);
_startDateLabel
.
text
=
[
IBTCommon
stringFromDate
:
time
];
self
.
beginDateStr
=
[
time
httpParameterString
];
}
else
{
_endDateLabel
.
textColor
=
HexColor
(
@"444444"
);
_endDateLabel
.
text
=
[
IBTCommon
stringFromDate
:
time
];
self
.
endDateStr
=
[
time
httpParameterString
];
}
// 关闭选择器
[
self
clearDatePickView
];
}
#pragma mark - 取消
-
(
void
)
clearDatePickView
{
[
UIView
animateWithDuration
:
0
.
15
animations
:
^
{
CGRect
startFrame
=
_startTimeView
.
frame
;
startFrame
.
origin
.
y
=
ScreenSize
.
height
;
_startTimeView
.
frame
=
startFrame
;
}
completion
:^
(
BOOL
finished
)
{
[
_startTimeView
removeFromSuperview
];
_startTimeView
=
nil
;
}];
}
#pragma mark delegate
-
(
BOOL
)
growingTextViewShouldReturn
:
(
HPGrowingTextView
*
)
growingTextView
{
[
_noteTextView
resignFirstResponder
];
[
self
setTableFrame
:
LeftMargin
];
return
YES
;
}
-
(
void
)
growingTextViewDidBeginEditing
:
(
HPGrowingTextView
*
)
growingTextView
{
CGFloat
offset
=
ScreenSize
.
height
-
TotalHeight
-
KeyboardHeight
;
if
(
offset
<
0
)
{
//上移
[
self
setTableFrame
:
LeftMargin
+
offset
];
}
}
-
(
void
)
setTableFrame
:
(
CGFloat
)
tabelH
{
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
tableFrame
=
_tableView
.
frame
;
tableFrame
.
origin
.
y
=
tabelH
;
_tableView
.
frame
=
tableFrame
;
}];
}
-
(
void
)
keyboardHidden
{
[
_titleField
resignFirstResponder
];
[
_noteTextView
resignFirstResponder
];
[
self
setTableFrame
:
LeftMargin
];
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
}
/*
#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/en.lproj/Localizable.strings
View file @
5f3dac71
...
...
@@ -50,6 +50,8 @@
"Survey7" = "新建发运单";
"Survey8" = "查看发运单";
"Survey9" = "新建加工单";
"EditorShopDetail" ="编辑商品明细";
"AddShopDetail" ="添加商品明细";
// Store
"Store" = "门店";
...
...
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