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
a44683ad
Commit
a44683ad
authored
9 years ago
by
n22
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购
parent
534bb720
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
397 additions
and
30 deletions
+397
-30
project.pbxproj
XFFruit.xcodeproj/project.pbxproj
+6
-0
AddProductViewController.h
...ntrollers/Purchase/Controllers/AddProductViewController.h
+32
-0
AddProductViewController.m
...ntrollers/Purchase/Controllers/AddProductViewController.m
+284
-0
ChooseTypeViewController.h
...ntrollers/Purchase/Controllers/ChooseTypeViewController.h
+2
-2
ChooseTypeViewController.m
...ntrollers/Purchase/Controllers/ChooseTypeViewController.m
+1
-9
ChooseWarehouseViewController.h
...lers/Purchase/Controllers/ChooseWarehouseViewController.h
+1
-1
ChooseWarehouseViewController.m
...lers/Purchase/Controllers/ChooseWarehouseViewController.m
+1
-1
NewPurchaseViewController.m
...trollers/Purchase/Controllers/NewPurchaseViewController.m
+18
-2
ProductViewController.h
...wControllers/Purchase/Controllers/ProductViewController.h
+6
-1
ProductViewController.m
...wControllers/Purchase/Controllers/ProductViewController.m
+40
-8
ProductCell.m
XFFruit/ViewControllers/Purchase/Views/ProductCell.m
+2
-2
TopPurchaseView.m
XFFruit/ViewControllers/Purchase/Views/TopPurchaseView.m
+3
-2
NewSurveyViewController.m
...wControllers/Survey/controllers/NewSurveyViewController.m
+0
-1
HeaderCell.m
XFFruit/ViewControllers/WorkSheet/Views/HeaderCell.m
+1
-1
No files found.
XFFruit.xcodeproj/project.pbxproj
View file @
a44683ad
...
...
@@ -355,6 +355,7 @@
C1FE50531AE024FA00C18080
/* UIAlertView+Blocks.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C1FE504D1AE024FA00C18080
/* UIAlertView+Blocks.m */
;
};
C1FE50561AE3587F00C18080
/* ICRAttachmentUnit.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C1FE50551AE3587F00C18080
/* ICRAttachmentUnit.m */
;
};
C1FE50571AE3587F00C18080
/* ICRAttachmentUnit.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
C1FE50551AE3587F00C18080
/* ICRAttachmentUnit.m */
;
};
FE0C652C1B8EAB3400580183
/* AddProductViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FE0C652B1B8EAB3400580183
/* AddProductViewController.m */
;
};
FE0C9B091B7C543D00335B39
/* User.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FE0C9B081B7C543D00335B39
/* User.m */
;
};
FE17F6791B85847D0078CE96
/* QueryOrder.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FE17F6781B85847D0078CE96
/* QueryOrder.m */
;
};
FE17F6831B85CA5B0078CE96
/* NewPurchaseNoticeViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
FE17F67C1B85CA5B0078CE96
/* NewPurchaseNoticeViewController.m */
;
};
...
...
@@ -785,6 +786,8 @@
C1FE504D1AE024FA00C18080
/* UIAlertView+Blocks.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"UIAlertView+Blocks.m"
;
sourceTree
=
"<group>"
;
};
C1FE50541AE3587F00C18080
/* ICRAttachmentUnit.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ICRAttachmentUnit.h
;
sourceTree
=
"<group>"
;
};
C1FE50551AE3587F00C18080
/* ICRAttachmentUnit.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ICRAttachmentUnit.m
;
sourceTree
=
"<group>"
;
};
FE0C652A1B8EAB3400580183
/* AddProductViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
AddProductViewController.h
;
sourceTree
=
"<group>"
;
};
FE0C652B1B8EAB3400580183
/* AddProductViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
AddProductViewController.m
;
sourceTree
=
"<group>"
;
};
FE0C9B071B7C543D00335B39
/* User.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
User.h
;
path
=
../Views/User.h
;
sourceTree
=
"<group>"
;
};
FE0C9B081B7C543D00335B39
/* User.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
User.m
;
path
=
../Views/User.m
;
sourceTree
=
"<group>"
;
};
FE17F6771B85847D0078CE96
/* QueryOrder.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
QueryOrder.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1005,6 +1008,8 @@
FE4678A91B8D60F900B5EDA3
/* ChooseTypeViewController.m */
,
FE4678AB1B8D636300B5EDA3
/* ChooseWarehouseViewController.h */
,
FE4678AC1B8D636300B5EDA3
/* ChooseWarehouseViewController.m */
,
FE0C652A1B8EAB3400580183
/* AddProductViewController.h */
,
FE0C652B1B8EAB3400580183
/* AddProductViewController.m */
,
);
path
=
Controllers
;
sourceTree
=
"<group>"
;
...
...
@@ -2131,6 +2136,7 @@
C15295CE1B24741400DF60D1
/* ASValuePopUpView.m in Sources */
,
C159184D1AC062460013B391
/* IBTTableView.m in Sources */
,
30D1859C1ADBB91000327997
/* ICRAnnouncement.m in Sources */
,
FE0C652C1B8EAB3400580183
/* AddProductViewController.m in Sources */
,
C142D2AE1AC3A155000109A7
/* NSString+TrimmingAdditions.m in Sources */
,
C15918471AC062460013B391
/* IBTCommon.m in Sources */
,
C1FE502D1ADD887400C18080
/* LBorderView.m in Sources */
,
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/AddProductViewController.h
0 → 100644
View file @
a44683ad
//
// AddProductViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "HPGrowingTextView.h"
@protocol
AddProductViewDelegate
<
NSObject
>
-
(
void
)
dissmiss
;
-
(
void
)
pushViewController
:(
id
)
cvc
;
@end
@interface
AddProductViewController
:
ICRBaseViewController
@property
(
nonatomic
,
assign
)
CGRect
viewFrame
;
@property
(
nonatomic
,
strong
)
UILabel
*
productNameLabel
;
//商品
@property
(
nonatomic
,
strong
)
UILabel
*
productTypeLabel
;
//单位
@property
(
nonatomic
,
strong
)
UITextField
*
productStandFiled
;
//规格
@property
(
nonatomic
,
strong
)
UITextField
*
productCountFiled
;
//包装数量
@property
(
nonatomic
,
strong
)
UITextField
*
baseCountFiled
;
//基础数量
@property
(
nonatomic
,
strong
)
UITextField
*
basePriceFiled
;
//基础单价
@property
(
nonatomic
,
strong
)
UITextField
*
productPriceFiled
;
//包装单价
@property
(
nonatomic
,
strong
)
UITextField
*
totalPriceFiled
;
//总价格
@property
(
nonatomic
,
strong
)
HPGrowingTextView
*
remarkTextView
;
//备注
@property
(
nonatomic
,
weak
)
id
<
AddProductViewDelegate
>
delegate
;
@end
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/AddProductViewController.m
0 → 100644
View file @
a44683ad
//
// AddProductViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "AddProductViewController.h"
#import "SurveyCell.h"
#import "ChooseProductViewController.h"
#import "ChooseTypeViewController.h"
#define LeftMargin 15
#define BtnHeight 44
#define TableHeight 46
#define TopHeight 50
#define TotalHeight 508
#define KeyboardHeight 258
typedef
enum
:
NSUInteger
{
DelTag
=
9000
,
CommitTag
,
DissTag
}
BtnTag
;
@interface
AddProductViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
UITextFieldDelegate
,
HPGrowingTextViewDelegate
>
{
UIView
*
_bgView
;
UITableView
*
_tableView
;
NSMutableArray
*
_dataArr
;
CGRect
_tableFrame
;
}
@end
@implementation
AddProductViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
self
initData
];
[
self
bulidLayout
];
}
-
(
void
)
initData
{
_dataArr
=
[
NSMutableArray
array
];
[
_dataArr
addObject
:
@"商品"
];
[
_dataArr
addObject
:
@"包装单位"
];
[
_dataArr
addObject
:
@"包装规格"
];
[
_dataArr
addObject
:
@"包装数量"
];
[
_dataArr
addObject
:
@"基础数量"
];
[
_dataArr
addObject
:
@"基础单价"
];
[
_dataArr
addObject
:
@"包装单价"
];
[
_dataArr
addObject
:
@"总金额"
];
[
_dataArr
addObject
:
@"备注"
];
}
-
(
void
)
setViewFrame
:
(
CGRect
)
viewFrame
{
_tableFrame
=
viewFrame
;
}
-
(
void
)
bulidLayout
{
_bgView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
LeftMargin
,
(
self
.
view
.
frame
.
size
.
height
-
TotalHeight
)
/
2
,
self
.
view
.
frame
.
size
.
width
-
LeftMargin
*
2
,
TotalHeight
)];
_bgView
.
layer
.
cornerRadius
=
5
;
_bgView
.
layer
.
masksToBounds
=
YES
;
[
self
.
view
addSubview
:
_bgView
];
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
CGRectGetWidth
(
_bgView
.
frame
),
TopHeight
)];
label
.
text
=
@"新增商品明细"
;
label
.
textAlignment
=
NSTextAlignmentCenter
;
label
.
backgroundColor
=
XXFBgColor
;
label
.
textColor
=
HexColor
(
@"444444"
);
label
.
font
=
FontSize
(
15
);
[
_bgView
addSubview
:
label
];
UIButton
*
dissBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
CGRectGetWidth
(
_bgView
.
frame
)
-
TopHeight
,
0
,
TopHeight
,
TopHeight
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
DissTag
image
:
nil
title
:
@"关闭"
titleColor
:
HexColor
(
@"444444"
)
isCorner
:
NO
corner
:
0
bgColor
:
nil
];
dissBtn
.
titleLabel
.
font
=
FontSize
(
15
);
[
_bgView
addSubview
:
dissBtn
];
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
TopHeight
,
CGRectGetWidth
(
_bgView
.
frame
),
CGRectGetHeight
(
_bgView
.
frame
)
-
TopHeight
))
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
*
delBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
LeftMargin
,
10
,
(
CGRectGetWidth
(
_bgView
.
frame
)
-
LeftMargin
*
3
)
/
2
,
BtnHeight
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
6001
image
:
nil
title
:
@"删除"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
HexColor
(
@"50bd62"
)];
[
footView
addSubview
:
delBtn
];
UIButton
*
commitBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
delBtn
.
frame
.
origin
.
x
+
delBtn
.
frame
.
size
.
width
+
LeftMargin
,
10
,
(
CGRectGetWidth
(
_bgView
.
frame
)
-
LeftMargin
*
3
)
/
2
,
BtnHeight
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
1001
image
:
nil
title
:
@"提交"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
HexColor
(
@"f69100"
)];
[
footView
addSubview
:
commitBtn
];
// [self.view addSubview:footView];
_tableView
.
tableFooterView
=
footView
;
[
_bgView
addSubview
:
_tableView
];
}
-
(
void
)
btnClick
:
(
UIButton
*
)
btn
{
switch
(
btn
.
tag
)
{
case
DissTag
:
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
dissmiss
)])
{
[
self
.
delegate
dissmiss
];
}
}
break
;
default
:
break
;
}
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
_dataArr
.
count
;
}
-
(
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
==
1
)
{
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
==
1
)
{
UILabel
*
contentLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
100
+
LeftMargin
,
0
,
CGRectGetWidth
(
_bgView
.
frame
)
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
))];
contentLabel
.
textAlignment
=
NSTextAlignmentRight
;
contentLabel
.
textColor
=
HexColor
(
@"bbbbbb"
);
contentLabel
.
font
=
FontSize
(
15
);
[
cell
.
contentView
addSubview
:
contentLabel
];
if
(
indexPath
.
row
==
0
)
{
contentLabel
.
text
=
@"选择商品"
;
self
.
productNameLabel
=
contentLabel
;
}
else
if
(
indexPath
.
row
==
1
){
contentLabel
.
text
=
@"选择包装单位"
;
self
.
productTypeLabel
=
contentLabel
;
}
}
else
if
(
indexPath
.
row
==
_dataArr
.
count
-
1
){
self
.
remarkTextView
=
[[
HPGrowingTextView
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
CGRectGetWidth
(
_bgView
.
frame
)
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
)];
self
.
remarkTextView
.
contentInset
=
UIEdgeInsetsMake
(
5
,
5
,
5
,
0
);
self
.
remarkTextView
.
minNumberOfLines
=
1
;
self
.
remarkTextView
.
maxNumberOfLines
=
2
;
self
.
remarkTextView
.
font
=
FontSize
(
15
);
self
.
remarkTextView
.
textAlignment
=
NSTextAlignmentRight
;
self
.
remarkTextView
.
delegate
=
self
;
self
.
remarkTextView
.
returnKeyType
=
UIReturnKeyDone
;
self
.
remarkTextView
.
placeholder
=
@"输入备注内容"
;
[
cell
.
contentView
addSubview
:
self
.
remarkTextView
];
}
else
{
UITextField
*
textField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
CGRectGetWidth
(
_bgView
.
frame
)
-
100
-
LeftMargin
*
2
-
30
,
TableHeight
)];
textField
.
textAlignment
=
NSTextAlignmentRight
;
textField
.
textColor
=
HexColor
(
@"444444"
);
textField
.
font
=
FontSize
(
15
);
textField
.
keyboardType
=
UIKeyboardTypeNumbersAndPunctuation
;
textField
.
returnKeyType
=
UIReturnKeyDone
;
textField
.
delegate
=
self
;
[
cell
.
contentView
addSubview
:
textField
];
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
textField
.
frame
)
+
5
,
0
,
20
,
TableHeight
)];
label
.
textColor
=
HexColor
(
@"444444"
);
label
.
font
=
FontSize
(
15
);
[
cell
.
contentView
addSubview
:
label
];
if
(
indexPath
.
row
==
2
)
{
label
.
text
=
@"斤"
;
textField
.
placeholder
=
@"包装规格"
;
self
.
productStandFiled
=
textField
;
}
else
if
(
indexPath
.
row
==
3
)
{
label
.
text
=
@"框"
;
textField
.
placeholder
=
@"包装数量"
;
self
.
productCountFiled
=
textField
;
}
else
if
(
indexPath
.
row
==
4
)
{
label
.
text
=
@"斤"
;
textField
.
placeholder
=
@"基础数量"
;
self
.
baseCountFiled
=
textField
;
}
else
if
(
indexPath
.
row
==
5
)
{
label
.
text
=
@"元"
;
textField
.
placeholder
=
@"基础单价"
;
self
.
basePriceFiled
=
textField
;
}
else
if
(
indexPath
.
row
==
6
)
{
label
.
text
=
@"元"
;
textField
.
placeholder
=
@"包装单价"
;
self
.
productPriceFiled
=
textField
;
}
else
if
(
indexPath
.
row
==
7
)
{
label
.
text
=
@"元"
;
textField
.
placeholder
=
@"总金额"
;
self
.
totalPriceFiled
=
textField
;
}
}
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
0
){
ChooseProductViewController
*
cvc
=
[
ChooseProductViewController
new
];
cvc
.
choseProduct
=
^
(
Product
*
product
){
self
.
productNameLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
product
.
name
,
product
.
code
];
self
.
productNameLabel
.
textColor
=
HexColor
(
@"444444"
);
};
cvc
.
isMoreChose
=
NO
;
[
self
.
delegate
pushViewController
:
cvc
];
}
else
if
(
indexPath
.
row
==
1
){
ChooseTypeViewController
*
tvc
=
[[
ChooseTypeViewController
alloc
]
init
];
tvc
.
title
=
@"类型"
;
tvc
.
dataArr
=
@[
@"筐"
,
@"斤"
];
tvc
.
choseType
=
^
(
NSString
*
type
){
self
.
productTypeLabel
.
text
=
type
;
self
.
productTypeLabel
.
textColor
=
HexColor
(
@"444444"
);
};
[
self
.
delegate
pushViewController
:
tvc
];
}
}
#pragma mark delegate
-
(
BOOL
)
growingTextViewShouldReturn
:
(
HPGrowingTextView
*
)
growingTextView
{
[
self
.
remarkTextView
resignFirstResponder
];
[
self
setTableFrame
:
TopHeight
];
return
YES
;
}
-
(
void
)
growingTextViewDidBeginEditing
:
(
HPGrowingTextView
*
)
growingTextView
{
CGFloat
offset
=
ScreenSize
.
height
-
TotalHeight
-
KeyboardHeight
;
if
(
offset
<
0
)
{
//上移
[
self
setTableFrame
:
TopHeight
+
offset
];
}
}
-
(
void
)
setTableFrame
:
(
CGFloat
)
tabelH
{
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
CGRect
tableFrame
=
_tableView
.
frame
;
tableFrame
.
origin
.
y
=
tabelH
;
_tableView
.
frame
=
tableFrame
;
}];
}
-
(
void
)
textFieldDidBeginEditing
:
(
UITextField
*
)
textField
{
if
(
textField
==
self
.
basePriceFiled
||
textField
==
self
.
productPriceFiled
||
textField
==
self
.
totalPriceFiled
)
{
CGFloat
offset
=
ScreenSize
.
height
-
TotalHeight
-
KeyboardHeight
;
if
(
offset
<
0
)
{
//上移
[
self
setTableFrame
:
TopHeight
+
offset
];
}
}
}
-
(
void
)
keyboardHidden
{
[
self
.
productStandFiled
resignFirstResponder
];
[
self
.
productPriceFiled
resignFirstResponder
];
[
self
.
productCountFiled
resignFirstResponder
];
[
self
.
basePriceFiled
resignFirstResponder
];
[
self
.
baseCountFiled
resignFirstResponder
];
[
self
.
totalPriceFiled
resignFirstResponder
];
[
self
setTableFrame
:
TopHeight
];
}
-
(
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
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/ChooseTypeViewController.h
View file @
a44683ad
...
...
@@ -2,7 +2,7 @@
// ChooseTypeViewController.h
// XFFruit
//
// Created by
n22
on 15/8/26.
// Created by
陈俊俊
on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
...
...
@@ -11,5 +11,5 @@ typedef void(^ChoseType)(NSString *type);
@interface
ChooseTypeViewController
:
ICRBaseViewController
@property
(
nonatomic
,
copy
)
ChoseType
choseType
;
@property
(
nonatomic
,
copy
)
NSArray
*
dataArr
;
@end
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/ChooseTypeViewController.m
View file @
a44683ad
...
...
@@ -2,7 +2,7 @@
// ChooseTypeViewController.m
// XFFruit
//
// Created by
n22
on 15/8/26.
// Created by
陈俊俊
on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
...
...
@@ -16,7 +16,6 @@
NSIndexPath
*
_currentIndexPath
;
}
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@end
...
...
@@ -24,15 +23,8 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
self
initData
];
[
self
bulidLayout
];
}
-
(
void
)
initData
{
self
.
dataArr
=
[
NSMutableArray
array
];
[
self
.
dataArr
addObject
:
@"普通"
];
[
self
.
dataArr
addObject
:
@"紧急"
];
}
-
(
void
)
bulidLayout
{
self
.
view
.
backgroundColor
=
HexColor
(
@"f8f8f8"
);
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/ChooseWarehouseViewController.h
View file @
a44683ad
...
...
@@ -2,7 +2,7 @@
// ChooseStoreViewController.h
// XFFruit
//
// Created by
n22
on 15/8/26.
// Created by
陈俊俊
on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/ChooseWarehouseViewController.m
View file @
a44683ad
...
...
@@ -2,7 +2,7 @@
// ChooseStoreViewController.m
// XFFruit
//
// Created by
n22
on 15/8/26.
// Created by
陈俊俊
on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/NewPurchaseViewController.m
View file @
a44683ad
...
...
@@ -9,7 +9,7 @@
#import "NewPurchaseViewController.h"
#import "TopPurchaseView.h"
#import "ProductViewController.h"
#import "AddProductViewController.h"
#define TopHeight 328
#define BottomHeight 300
#define SpaceHeight 20
...
...
@@ -20,12 +20,13 @@ typedef enum : NSUInteger {
CommitTag
,
}
BtnTag
;
@interface
NewPurchaseViewController
()
<
TopPurchaseViewDelegate
>
@interface
NewPurchaseViewController
()
<
TopPurchaseViewDelegate
,
ProductViewDelegate
>
{
UIScrollView
*
_scrollView
;
TopPurchaseView
*
_purchaseView
;
UIView
*
_bottomView
;
ProductViewController
*
_pvc
;
AddProductViewController
*
_avc
;
}
@end
...
...
@@ -67,6 +68,7 @@ typedef enum : NSUInteger {
[
_scrollView
addSubview
:
_bottomView
];
_pvc
=
[[
ProductViewController
alloc
]
init
];
_pvc
.
delegate
=
self
;
_pvc
.
viewFrame
=
_bottomView
.
bounds
;
[
_bottomView
addSubview
:
_pvc
.
view
];
...
...
@@ -76,10 +78,24 @@ typedef enum : NSUInteger {
}
#pragma mark - TopPurchaseViewDelegate
-
(
void
)
pushNextViewController
:
(
id
)
vc
{
[
self
PushViewController
:
vc
animated
:
YES
];
}
#pragma mark - ProductViewDelegate
-
(
void
)
pushViewController
:
(
id
)
cvc
selfController
:
(
id
)
avc
{
_avc
=
avc
;
[
self
PushViewController
:
cvc
animated
:
YES
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
if
(
_avc
)
{
[
AppWindow
addSubview
:
_avc
.
view
];
}
}
#pragma mark - 协议方法
-
(
void
)
hiddenKeyBoard
{
[
self
keyboardHidden
];
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/ProductViewController.h
View file @
a44683ad
...
...
@@ -7,10 +7,15 @@
//
#import "ICRBaseViewController.h"
@protocol
ProductViewDelegate
<
NSObject
>
-
(
void
)
pushViewController
:
(
id
)
cvc
selfController
:
(
id
)
avc
;
@end
@interface
ProductViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
NSMutableArray
*
productArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
assign
)
CGRect
viewFrame
;
@property
(
nonatomic
,
assign
)
BOOL
isHiddenEdit
;
@property
(
nonatomic
,
weak
)
id
<
ProductViewDelegate
>
delegate
;
@end
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/ProductViewController.m
View file @
a44683ad
...
...
@@ -10,12 +10,14 @@
#import "FooterCell.h"
#import "HeaderCell.h"
#import "ProductCell.h"
#import "AddProductViewController.h"
#define TableHeight 44
@interface
ProductViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
FooterCellDelegate
>
@interface
ProductViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
FooterCellDelegate
,
AddProductViewDelegate
>
{
CGRect
_tableFrame
;
NSMutableArray
*
_selectRowArr
;
//记录当前选中的cell
AddProductViewController
*
_avc
;
}
@end
...
...
@@ -60,10 +62,34 @@
self
.
tableView
.
tableFooterView
=
footCell
;
}
}
#pragma mark - footerDelegate
-
(
void
)
addClick
{
[
self
.
productArr
addObject
:
@"dddd"
];
[
self
.
tableView
reloadData
];
// [self.productArr addObject:@"dddd"];
// [self.tableView reloadData];
if
(
_avc
==
nil
)
{
_avc
=
[[
AddProductViewController
alloc
]
init
];
_avc
.
delegate
=
self
;
_avc
.
view
.
backgroundColor
=
RGBA
(
0
,
0
,
0
,
0
.
5
);
[
AppWindow
addSubview
:
_avc
.
view
];
}
}
#pragma mark - addProductViewDelegate
-
(
void
)
dissmiss
{
if
(
_avc
)
{
[
_avc
.
view
removeFromSuperview
];
_avc
=
nil
;
}
}
-
(
void
)
pushViewController
:
(
id
)
cvc
{
if
(
_avc
)
{
[
_avc
.
view
removeFromSuperview
];
}
if
([
self
.
delegate
respondsToSelector
:
@selector
(
pushViewController
:
selfController
:
)])
{
[
self
.
delegate
pushViewController
:
cvc
selfController
:
_avc
];
}
}
#pragma mark - 协议方法
...
...
@@ -102,6 +128,8 @@
cell
.
showView
.
frame
=
showfrmame
;
cell
.
backgroundColor
=
[
UIColor
whiteColor
];
}
cell
.
editBtn
.
tag
=
indexPath
.
row
;
[
cell
.
editBtn
addTarget
:
self
action
:
@selector
(
editClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
return
cell
;
}
-
(
BOOL
)
isHaveIndexPath
:
(
NSIndexPath
*
)
indexPath
{
...
...
@@ -122,14 +150,12 @@
Linefrmame
.
origin
.
y
=
200
-
1
;
showfrmame
.
size
.
height
=
150
;
// cell.showView.hidden = NO;
cell
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_selectRowArr
addObject
:
indexPath
];
}
else
{
cell
.
smallImageView
.
image
=
[
UIImage
imageNamed
:
@"arrowright"
];
Linefrmame
.
origin
.
y
=
TableHeight
-
1
;
showfrmame
.
size
.
height
=
0
;
// cell.showView.hidden = YES;
cell
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_selectRowArr
removeObject
:
indexPath
];
}
...
...
@@ -137,14 +163,20 @@
cell
.
showView
.
frame
=
showfrmame
;
[
self
.
tableView
reloadData
];
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
([
self
isHaveIndexPath
:
indexPath
])
{
return
200
;
}
return
TableHeight
;
}
-
(
void
)
editClick
:
(
UIButton
*
)
btn
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@""
message
:
@"哈哈"
delegate
:
self
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
[
alert
show
];
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Views/ProductCell.m
View file @
a44683ad
...
...
@@ -36,7 +36,7 @@
-
(
void
)
bulidLayout
{
CGFloat
headWidth
=
(
ScreenSize
.
width
-
LeftWidth
-
RightWidth
-
SpaceMargin
*
(
3
-
1
))
/
3
;
CGFloat
headWidth
=
(
ScreenSize
.
width
-
LeftWidth
*
2
-
SpaceMargin
*
(
3
-
1
))
/
3
;
self
.
smallImageView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
LeftMargin
,
(
TableHeight
-
SmallSize
)
/
2
,
SmallSize
,
SmallSize
)];
self
.
smallImageView
.
image
=
[
UIImage
imageNamed
:
@"arrowright"
];
...
...
@@ -130,7 +130,7 @@
self
.
editBtn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
self
.
editBtn
setImage
:[
UIImage
imageNamed
:
@"edit"
]
forState
:
UIControlStateNormal
];
self
.
editBtn
.
frame
=
CGRectMake
(
ScreenSize
.
width
-
RightWidth
,
0
,
RightWidth
-
LeftMargin
,
TableHeight
);
self
.
editBtn
.
frame
=
CGRectMake
(
ScreenSize
.
width
-
LeftWidth
,
0
,
LeftWidth
,
TableHeight
);
self
.
editBtn
.
contentMode
=
UIViewContentModeScaleAspectFit
;
self
.
lineLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
TableHeight
-
1
,
ScreenSize
.
width
-
LeftMargin
*
2
,
1
))];;
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Views/TopPurchaseView.m
View file @
a44683ad
...
...
@@ -89,7 +89,7 @@
self
.
otherPriceFiled
.
placeholder
=
@"请输入其他费用"
;
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
textField
.
frame
)
+
5
,
0
,
20
,
TableHeight
)];
label
.
text
=
@"元"
;
label
.
textColor
=
HexColor
(
@"
bbbbbb
"
);
label
.
textColor
=
HexColor
(
@"
444444
"
);
label
.
font
=
FontSize
(
TitleSize
);
[
cell
.
contentView
addSubview
:
label
];
...
...
@@ -132,7 +132,7 @@
self
.
purchasePriceLabel
=
contentLabel
;
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
contentLabel
.
frame
)
+
5
,
0
,
20
,
TableHeight
)];
label
.
text
=
@"元"
;
label
.
textColor
=
HexColor
(
@"
bbbbbb
"
);
label
.
textColor
=
HexColor
(
@"
444444
"
);
label
.
font
=
FontSize
(
TitleSize
);
[
cell
.
contentView
addSubview
:
label
];
...
...
@@ -156,6 +156,7 @@
}
else
if
(
indexPath
.
row
==
1
){
ChooseTypeViewController
*
tvc
=
[[
ChooseTypeViewController
alloc
]
init
];
tvc
.
title
=
@"类型"
;
tvc
.
dataArr
=
@[
@"普通"
,
@"紧急"
];
tvc
.
choseType
=
^
(
NSString
*
type
){
self
.
purchaseTypeLabel
.
text
=
type
;
self
.
purchaseTypeLabel
.
textColor
=
HexColor
(
@"444444"
);
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Survey/controllers/NewSurveyViewController.m
View file @
a44683ad
...
...
@@ -100,7 +100,6 @@ typedef enum : NSUInteger {
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
];
}
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/WorkSheet/Views/HeaderCell.m
View file @
a44683ad
...
...
@@ -31,7 +31,7 @@
}
-
(
void
)
bulidLayout
{
CGFloat
headWidth
=
(
ScreenSize
.
width
-
LeftWidth
-
Righ
tWidth
-
SpaceMargin
*
(
self
.
arr
.
count
-
1
))
/
self
.
arr
.
count
;
CGFloat
headWidth
=
(
ScreenSize
.
width
-
LeftWidth
-
Lef
tWidth
-
SpaceMargin
*
(
self
.
arr
.
count
-
1
))
/
self
.
arr
.
count
;
for
(
NSInteger
i
=
0
;
i
<
self
.
arr
.
count
;
i
++
)
{
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
LeftWidth
+
(
SpaceMargin
+
headWidth
)
*
i
,
0
,
headWidth
,
self
.
frame
.
size
.
height
)];
label
.
font
=
FontSize
(
TitleSize
);
...
...
This diff is collapsed.
Click to expand it.
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