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
9 years ago
by
陈俊俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
9ae2d7d9
Expand all
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
...
...
This diff is collapsed.
Click to expand it.
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
This diff is collapsed.
Click to expand it.
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
;
...
...
This diff is collapsed.
Click to expand it.
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
];
...
...
This diff is collapsed.
Click to expand it.
XFFruit/Utilities/IBTUIKit/IBTConstants.h
View file @
9e53ce25
This diff is collapsed.
Click to expand it.
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
];
...
...
This diff is collapsed.
Click to expand it.
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
)
{
...
...
This diff is collapsed.
Click to expand it.
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
This diff is collapsed.
Click to expand it.
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
];
}
}
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m
View file @
9e53ce25
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