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
9e53ce25
Commit
9e53ce25
authored
Sep 15, 2015
by
陈俊俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
9ae2d7d9
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
113 additions
and
288 deletions
+113
-288
ICRHTTPController.h
XFFruit/Controllers/HTTPController/ICRHTTPController.h
+6
-1
ICRHTTPController.m
XFFruit/Controllers/HTTPController/ICRHTTPController.m
+49
-1
ChooseParentViewController.h
...l/Classes/BaseViewController/ChooseParentViewController.h
+1
-0
ChooseParentViewController.m
...l/Classes/BaseViewController/ChooseParentViewController.m
+3
-1
IBTConstants.h
XFFruit/Utilities/IBTUIKit/IBTConstants.h
+1
-1
ChooseProductViewController.m
...ollers/ChooseViewController/ChooseProductViewController.m
+0
-35
NewPurchaseNoticeViewController.m
...chaseNotice/Controllers/NewPurchaseNoticeViewController.m
+7
-32
ChooseProductUnitViewController.h
...rs/PurchaseNotice/Views/ChooseProductUnitViewController.h
+1
-1
ChooseProductUnitViewController.m
...rs/PurchaseNotice/Views/ChooseProductUnitViewController.m
+3
-38
ShopDetaileViewController.m
...trollers/PurchaseNotice/Views/ShopDetaileViewController.m
+42
-178
No files found.
XFFruit/Controllers/HTTPController/ICRHTTPController.h
View file @
9e53ce25
...
...
@@ -300,6 +300,11 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
-
(
void
)
getProductUnitWithPage_number
:(
NSUInteger
)
page_number
page_size
:(
NSUInteger
)
page_size
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
//1.添加采购单
-
(
void
)
savePurchaseWithData
:(
id
)
data
...
...
XFFruit/Controllers/HTTPController/ICRHTTPController.m
View file @
9e53ce25
...
...
@@ -174,7 +174,7 @@ static NSString * const ICRHTTPInterface[] = {
[
XFFHttp_GetWarehouse
]
=
@"data/warehouse/download"
,
//商品单位
[
XFFHttp_GetProductunit
]
=
@"
data/productunit
"
,
[
XFFHttp_GetProductunit
]
=
@"
mdata/productunit/download
"
,
//加工单
[
XFFHttp_QueryProcess
]
=
@"process/query"
,
[
XFFHttp_GetProcess
]
=
@"process/get"
,
...
...
@@ -2380,4 +2380,52 @@ acceptTypeJson:YES
{
}
-
(
void
)
getProductUnitWithPage_number
:
(
NSUInteger
)
page_number
page_size
:
(
NSUInteger
)
page_size
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
void
(
^
success
)(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
=
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
CLog
(
@"%@"
,
responseObject
);
if
(
IsDictObject
(
responseObject
))
{
void
(
^
complete
)(
void
)
=
^
(
void
){
if
(
succ
)
{
[
IBTCommon
runOnMainThreadWithoutDeadlocking
:
^
{
succ
(
responseObject
);
}];
}
};
ICRDataBaseController
*
dbCtrl
=
[
ICRDataBaseController
sharedController
];
[
dbCtrl
storageEntities
:
responseObject
[
@"data"
][
@"records"
]
objectClass
:
NSClassFromString
(
@"GXFProductUnit"
)
deleteLocal
:
YES
handleData
:
NULL
complete
:
complete
fail
:
fail
];
}
else
{
if
(
fail
)
{
fail
(
nil
);
}
}
};
void
(
^
failure
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
=
^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
CLog
(
@"%@"
,
error
);
if
(
fail
)
{
fail
(
error
);
}
};
NSString
*
dateStr
=
@"2015-05-01"
;
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
XFFHttp_GetProductunit
]
stringByAppendingFormat
:
@"?start_date=%@&page_number=%@&page_size=%@"
,
dateStr
,
@
(
page_number
),
@
(
page_size
)];
NSString
*
encodeUrlStr
=
[
urlStr
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
[
self
POST
:
encodeUrlStr
parameters
:
NULL
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
@end
XFFruit/General/Classes/BaseViewController/ChooseParentViewController.h
View file @
9e53ce25
...
...
@@ -24,6 +24,7 @@ typedef void(^ChoseBaseInfo)(NSArray *baseInfos);
@property
(
nonatomic
,
strong
)
NSString
*
tableStr
;
@property
(
nonatomic
,
assign
)
BOOL
isRefresh
;
@property
(
nonatomic
,
copy
)
ChoseBaseInfo
choseBaseInfo
;
@property
(
nonatomic
,
assign
)
BOOL
isFirst
;
-
(
void
)
endRefreshing
;
-
(
void
)
getBaseDataFromServer
;
...
...
XFFruit/General/Classes/BaseViewController/ChooseParentViewController.m
View file @
9e53ce25
...
...
@@ -25,6 +25,7 @@
-
(
void
)
initData
{
self
.
dataArr
=
[
NSMutableArray
array
];
self
.
indexArr
=
[
NSMutableArray
array
];
self
.
isFirst
=
YES
;
}
#pragma mark - 布局
...
...
@@ -157,7 +158,8 @@
__weak
typeof
(
self
)
weakSelf
=
self
;
ICRDatabaseFetchResultsBlock
fetchResultsBlk
=
^
(
NSArray
*
fetchedObjects
)
{
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
if
(
fetchedObjects
.
count
==
0
&&
titleStr
.
length
==
0
)
{
if
(
fetchedObjects
.
count
==
0
&&
titleStr
.
length
==
0
&&
self
.
isFirst
)
{
self
.
isFirst
=
NO
;
[
GXF_NSUSERFEFTAULTS
setObject
:[
NSDate
date
]
forKey
:
self
.
tableView
.
header
.
lastUpdatedTimeKey
];
[
GXF_NSUSERFEFTAULTS
synchronize
];
[
self
getBaseDataFromServer
];
...
...
XFFruit/Utilities/IBTUIKit/IBTConstants.h
View file @
9e53ce25
XFFruit/ViewControllers/ChooseViewController/ChooseProductViewController.m
View file @
9e53ce25
...
...
@@ -37,41 +37,6 @@
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
[[
ICRHTTPController
sharedController
]
getProductWithPage_number
:
0
page_size
:
100
success
:
succ
failure
:
fail
];
}
#pragma mark -成功
-
(
void
)
fetchProductList
:
(
NSString
*
)
titleStr
{
ICRDatabaseFetchBlock
fetchBlk
=
^
FMResultSet
*
(
FMDatabase
*
db
)
{
NSString
*
sql
=
@""
;
if
(
titleStr
.
length
>
0
)
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' ORDER BY %@"
,
[
Product
TableName
],
titleStr
,
@"uuid"
];
}
else
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ ORDER BY %@"
,
[
Product
TableName
],
@"uuid"
];
}
return
[
db
executeQuery
:
sql
];
};
__weak
typeof
(
self
)
weakSelf
=
self
;
ICRDatabaseFetchResultsBlock
fetchResultsBlk
=
^
(
NSArray
*
fetchedObjects
)
{
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
if
(
!
[
GXF_NSUSERFEFTAULTS
objectForKey
:
ChooseProductUpdateDate
])
{
[
GXF_NSUSERFEFTAULTS
setObject
:[
NSDate
date
]
forKey
:
ChooseProductUpdateDate
];
[
GXF_NSUSERFEFTAULTS
synchronize
];
[
self
getBaseDataFromServer
];
}
else
{
[
strongSelf
.
dataArr
removeAllObjects
];
[
strongSelf
.
dataArr
addObject
:
self
.
tableView
.
header
.
lastUpdatedTime
];
[
strongSelf
.
dataArr
addObjectsFromArray
:
fetchedObjects
];
[
self
tableViewRefresh
];
}
};
ICRDataBaseController
*
dbCtrl
=
[
ICRDataBaseController
sharedController
];
[
dbCtrl
runFetchForClass
:[
Product
class
]
fetchBlock
:
fetchBlk
fetchResultsBlock
:
fetchResultsBlk
];
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"MaskCell"
;
MaskCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
...
...
XFFruit/ViewControllers/PurchaseNotice/Controllers/NewPurchaseNoticeViewController.m
View file @
9e53ce25
...
...
@@ -51,7 +51,6 @@ typedef enum : NSUInteger {
HPGrowingTextView
*
_noteTextView
;
NSIndexPath
*
selectedCellIndexPath
;
NSMutableArray
*
selectCellAry
;
BOOL
_isClickStart
;
UITableView
*
mingXiTableView
;
id
uuidObject
;
id
billNumberObject
;
...
...
@@ -270,15 +269,7 @@ typedef enum : NSUInteger {
-
(
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
){
if
(
indexPath
.
row
==
1
){
ChosePersonViewController
*
cvc
=
[
ChosePersonViewController
new
];
cvc
.
choseBaseInfo
=
^
(
NSArray
*
users
){
NSString
*
textStr
=
@""
;
...
...
@@ -449,27 +440,11 @@ typedef enum : NSUInteger {
#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
)
btnClick
:
(
UIButton
*
)
btn
{
switch
(
btn
.
tag
)
{
...
...
XFFruit/ViewControllers/PurchaseNotice/Views/ChooseProductUnitViewController.h
View file @
9e53ce25
...
...
@@ -7,7 +7,7 @@
//
#import "ChooseParentViewController.h"
#import "
Produc
t.h"
#import "
GXFProductUni
t.h"
@interface
ChooseProductUnitViewController
:
ChooseParentViewController
@end
XFFruit/ViewControllers/PurchaseNotice/Views/ChooseProductUnitViewController.m
View file @
9e53ce25
...
...
@@ -34,43 +34,8 @@
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
[[
ICRHTTPController
sharedController
]
getProductWithPage_number
:
0
page_size
:
100
success
:
succ
failure
:
fail
];
[[
ICRHTTPController
sharedController
]
getProduct
Unit
WithPage_number
:
0
page_size
:
100
success
:
succ
failure
:
fail
];
}
#pragma mark -成功
-
(
void
)
fetchProductList
:
(
NSString
*
)
titleStr
{
ICRDatabaseFetchBlock
fetchBlk
=
^
FMResultSet
*
(
FMDatabase
*
db
)
{
NSString
*
sql
=
@""
;
if
(
titleStr
.
length
>
0
)
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' ORDER BY %@"
,
[
Product
TableName
],
titleStr
,
@"uuid"
];
}
else
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ ORDER BY %@"
,
[
Product
TableName
],
@"uuid"
];
}
return
[
db
executeQuery
:
sql
];
};
__weak
typeof
(
self
)
weakSelf
=
self
;
ICRDatabaseFetchResultsBlock
fetchResultsBlk
=
^
(
NSArray
*
fetchedObjects
)
{
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
if
(
!
[
GXF_NSUSERFEFTAULTS
objectForKey
:
ChooseProductUnitUpdateDate
])
{
[
GXF_NSUSERFEFTAULTS
setObject
:[
NSDate
date
]
forKey
:
ChooseProductUnitUpdateDate
];
[
GXF_NSUSERFEFTAULTS
synchronize
];
[
self
getBaseDataFromServer
];
}
else
{
[
strongSelf
.
dataArr
removeAllObjects
];
[
strongSelf
.
dataArr
addObject
:
self
.
tableView
.
header
.
lastUpdatedTime
];
[
strongSelf
.
dataArr
addObjectsFromArray
:
fetchedObjects
];
[
self
tableViewRefresh
];
}
};
ICRDataBaseController
*
dbCtrl
=
[
ICRDataBaseController
sharedController
];
[
dbCtrl
runFetchForClass
:[
Product
class
]
fetchBlock
:
fetchBlk
fetchResultsBlock
:
fetchResultsBlk
];
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"MaskCell"
;
MaskCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
...
...
@@ -103,9 +68,9 @@
cell
.
titleLabel
.
textColor
=
GXF_CONTENT_COLOR
;
[
cell
setTitleStr
:[
NSString
stringWithFormat
:
@"上次更新时间:%@"
,
dateStr
]];
}
else
{
Produc
t
*
product
=
self
.
dataArr
[
indexPath
.
row
];
GXFProductUni
t
*
product
=
self
.
dataArr
[
indexPath
.
row
];
cell
.
titleLabel
.
textColor
=
GXF_LEFTSIX_COLOR
;
NSString
*
proStr
=
[
NSString
stringWithFormat
:
@"%@
[%@]"
,
product
.
name
,
product
.
cod
e
];
NSString
*
proStr
=
[
NSString
stringWithFormat
:
@"%@
"
,
product
.
nam
e
];
[
cell
setTitleStr
:
proStr
];
}
}
...
...
XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m
View file @
9e53ce25
...
...
@@ -16,9 +16,6 @@
#import "ChooseProductUnitViewController.h"
#import "GXFSearchVendorViewController.h"
#import "GXFProductUnit.h"
#import "SurveyUser.h"
#import "Survey.h"
#import "Product.h"
#define LeftMargin 15
#define BtnHeight 44
#define TableHeight 46
...
...
@@ -36,17 +33,9 @@ typedef enum : NSUInteger {
{
UITableView
*
_tableView
;
NSMutableArray
*
_dataArr
;
UITextField
*
_titleField
;
UILabel
*
_productLabel
;
UILabel
*
_PackagingLable
;
UILabel
*
_startDateLabel
;
UILabel
*
_endDateLabel
;
UILabel
*
_personLabel
;
HPGrowingTextView
*
_noteTextView
;
UIDatePicker
*
_timePicker
;
BOOL
_isClickStart
;
StartTimeView
*
_startTimeView
;
UITextField
*
merchandise
;
//商品
UITextField
*
packageSpecification
;
//包装规格
UITextField
*
packageQuantity
;
//包装数量
...
...
@@ -310,15 +299,14 @@ typedef enum : NSUInteger {
}
-
(
void
)
clearAllInformation
{
_titleField
.
text
=
@""
;
_productLabel
.
text
=
@"请输入商品"
;
_productLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
_startDateLabel
.
text
=
@"选择日期"
;
_startDateLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
_endDateLabel
.
text
=
@"选择日期"
;
_endDateLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
_personLabel
.
text
=
@"选择调研人员"
;
_personLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
//
_startDateLabel.text = @"选择日期";
//
_startDateLabel.textColor = GXF_PLACEHOLDER_COLOR;
//
_endDateLabel.text = @"选择日期";
//
_endDateLabel.textColor = GXF_PLACEHOLDER_COLOR;
//
_personLabel.text = @"选择调研人员";
//
_personLabel.textColor = GXF_PLACEHOLDER_COLOR;
_noteTextView
.
text
=
@""
;
//清空数据
self
.
titleStr
=
@""
;
...
...
@@ -367,7 +355,7 @@ typedef enum : NSUInteger {
-
(
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
-
1
0
,
TableHeight
))];
UILabel
*
contentLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
1
5
,
TableHeight
))];
contentLabel
.
textAlignment
=
NSTextAlignmentRight
;
contentLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
contentLabel
.
font
=
FontSize
(
TitleSize
);
...
...
@@ -385,55 +373,53 @@ typedef enum : NSUInteger {
}
else
{
_titleField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
)];
_titleField
.
textAlignment
=
NSTextAlignmentRight
;
_titleField
.
textColor
=
GXF_CONTENT_COLOR
;
_titleField
.
placeholder
=
@"输入调研标题"
;
_titleField
.
font
=
FontSize
(
15
);
_titleField
.
returnKeyType
=
UIReturnKeyDone
;
_titleField
.
delegate
=
self
;
[
cell
.
contentView
addSubview
:
_titleField
];
UITextField
*
textField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
15
,
TableHeight
)];
textField
.
textAlignment
=
NSTextAlignmentRight
;
textField
.
textColor
=
GXF_CONTENT_COLOR
;
textField
.
font
=
FontSize
(
15
);
textField
.
returnKeyType
=
UIReturnKeyDone
;
textField
.
delegate
=
self
;
[
cell
.
contentView
addSubview
:
textField
];
if
(
indexPath
.
row
==
1
)
{
packageSpecification
=
_title
Field
;
//包装规格
_title
Field
.
placeholder
=
@"输入包装规格"
;
packageSpecification
=
text
Field
;
//包装规格
text
Field
.
placeholder
=
@"输入包装规格"
;
}
else
if
(
indexPath
.
row
==
2
)
{
packageQuantity
=
_title
Field
;
//包装数量
_title
Field
.
placeholder
=
@"输入包装数量"
;
packageQuantity
=
text
Field
;
//包装数量
text
Field
.
placeholder
=
@"输入包装数量"
;
}
else
if
(
indexPath
.
row
==
4
)
{
foundationQuantity
=
_title
Field
;
//基础数量
_title
Field
.
placeholder
=
@"输入基础数量"
;
foundationQuantity
=
text
Field
;
//基础数量
text
Field
.
placeholder
=
@"输入基础数量"
;
}
else
if
(
indexPath
.
row
==
5
)
{
foundationUnitPrice
=
_title
Field
;
//基础单价
_title
Field
.
placeholder
=
@"输入基础单价"
;
_title
Field
.
frame
=
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
30
,
TableHeight
);
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
_title
Field
.
frame
)
+
5
,
0
,
20
,
TableHeight
)];
foundationUnitPrice
=
text
Field
;
//基础单价
text
Field
.
placeholder
=
@"输入基础单价"
;
text
Field
.
frame
=
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
30
,
TableHeight
);
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
text
Field
.
frame
)
+
5
,
0
,
20
,
TableHeight
)];
label
.
text
=
@"元"
;
label
.
textColor
=
GXF_CONTENT_COLOR
;
label
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
cell
.
contentView
addSubview
:
label
];
}
else
if
(
indexPath
.
row
==
6
)
{
packageUnitPrice
=
_title
Field
;
//包装单价
_title
Field
.
placeholder
=
@"输入包装单价"
;
_title
Field
.
frame
=
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
30
,
TableHeight
);
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
_title
Field
.
frame
)
+
5
,
0
,
20
,
TableHeight
)];
packageUnitPrice
=
text
Field
;
//包装单价
text
Field
.
placeholder
=
@"输入包装单价"
;
text
Field
.
frame
=
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
30
,
TableHeight
);
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
text
Field
.
frame
)
+
5
,
0
,
20
,
TableHeight
)];
label
.
text
=
@"元"
;
label
.
textColor
=
GXF_CONTENT_COLOR
;
label
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
cell
.
contentView
addSubview
:
label
];
}
else
if
(
indexPath
.
row
==
7
)
{
totalMoney
=
_title
Field
;
//总金额
_title
Field
.
placeholder
=
@"输入总金额"
;
_title
Field
.
text
=
@"0"
;
_title
Field
.
frame
=
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
30
,
TableHeight
);
_title
Field
.
textColor
=
[
UIColor
redColor
];
totalMoney
=
text
Field
;
//总金额
text
Field
.
placeholder
=
@"输入总金额"
;
text
Field
.
text
=
@"0"
;
text
Field
.
frame
=
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
30
,
TableHeight
);
text
Field
.
textColor
=
[
UIColor
redColor
];
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
_title
Field
.
frame
)
+
5
,
0
,
20
,
TableHeight
)];
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
text
Field
.
frame
)
+
5
,
0
,
20
,
TableHeight
)];
label
.
text
=
@"元"
;
label
.
textColor
=
GXF_CONTENT_COLOR
;
label
.
font
=
GXF_FIFTEENTEN_SIZE
;
...
...
@@ -441,11 +427,9 @@ typedef enum : NSUInteger {
}
else
if
(
indexPath
.
row
==
8
)
{
remark
=
_title
Field
;
//备注
_title
Field
.
placeholder
=
@"输入备注内容"
;
remark
=
text
Field
;
//备注
text
Field
.
placeholder
=
@"输入备注内容"
;
}
}
[
self
setviewsData
];
}
...
...
@@ -467,71 +451,20 @@ typedef enum : NSUInteger {
[
self
PushViewController
:
cvc
animated
:
YES
];
}
else
if
(
indexPath
.
row
==
3
)
{
// 无数据
// GXFSearchVendorViewController *vc = [[GXFSearchVendorViewController alloc]initWithTitle:[IBTCommon localizableString:@"ProductUnitTitle"]];
// vc.choseVendor = ^(NSArray *vendors){
// if (vendors.count > 0) {
// GXFProductUnit *productUnit = vendors[0];
// _PackagingLable.text = [NSString stringWithFormat:@"%@[%@]",productUnit.name,productUnit.uuid];
// packageUnit.text = [NSString stringWithFormat:@"%@[%@]",productUnit.name,productUnit.uuid];
// _PackagingLable.textColor = GXF_CONTENT_COLOR;
// self.productUuidStr = productUnit.uuid;
//
// self.productNameStr = productUnit.name;
// }
// };
// [self PushViewController:vc animated:YES];
// 陈俊
ChooseProductUnitViewController
*
cvc
=
[
ChooseProductUnitViewController
new
];
cvc
.
choseBaseInfo
=
^
(
NSArray
*
products
){
Product
*
product
=
products
[
0
];
_PackagingLable
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
product
.
name
,
product
.
code
];
packageUnit
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
product
.
name
,
product
.
code
];
if
(
products
.
count
>
0
)
{
GXFProductUnit
*
productUnit
=
products
[
0
];
_PackagingLable
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
productUnit
.
name
];
packageUnit
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
productUnit
.
name
];
_PackagingLable
.
textColor
=
GXF_CONTENT_COLOR
;
// merchandise.text=product.name;
self
.
productNameStr
=
product
.
name
;
self
.
productUuidStr
=
product
.
uuid
;
self
.
productCodeStr
=
product
.
code
;
}
};
cvc
.
isMoreChose
=
NO
;
[
self
PushViewController
:
cvc
animated
:
YES
];
// 自己
// SelectCompanyViewController *vc=[SelectCompanyViewController new];
// vc.chosePackaging = ^(NSString *Packaging){
//
// _PackagingLable.text = [NSString stringWithFormat:@"%@",Packaging];
// packageUnit.text=[NSString stringWithFormat:@"%@",Packaging];
// _PackagingLable.textColor = GXF_CONTENT_COLOR;
//
// };
//
//
// [self PushViewController:vc 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
=
GXF_CONTENT_COLOR
;
}
if
(
self
.
users
>
0
)
{
[
self
.
users
addObjectsFromArray
:
self
.
survey
.
users
];
}
}
}
-
(
void
)
preferDataInProductLabel
{
if
(
self
.
survey
)
{
_productLabel
.
text
=
[
IBTCommon
checkString
:
self
.
survey
.
productName
];
...
...
@@ -541,82 +474,13 @@ typedef enum : NSUInteger {
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
=
GXF_CONTENT_COLOR
;
_startDateLabel
.
text
=
[
IBTCommon
stringFromDate
:
time
];
self
.
beginDateStr
=
[
time
httpParameterString
];
}
else
{
_endDateLabel
.
textColor
=
GXF_CONTENT_COLOR
;
_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
{
...
...
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