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
8938ec94
Commit
8938ec94
authored
Sep 07, 2015
by
陈俊俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发运单
parent
e12f0d4c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
1624 additions
and
491 deletions
+1624
-491
project.pbxproj
XFFruit.xcodeproj/project.pbxproj
+81
-0
ICRHTTPController.m
XFFruit/Controllers/HTTPController/ICRHTTPController.m
+2
-2
ChooseParentViewController.h
...l/Classes/BaseViewController/ChooseParentViewController.h
+6
-0
ChooseParentViewController.m
...l/Classes/BaseViewController/ChooseParentViewController.m
+88
-9
ICRNotificationMacro.h
XFFruit/Macro/ICRNotificationMacro.h
+4
-0
IBTConstants.h
XFFruit/Utilities/IBTUIKit/IBTConstants.h
+15
-6
BusinessViewController.m
XFFruit/ViewControllers/Business/BusinessViewController.m
+7
-6
ChooseTypeViewController.h
...ntrollers/Purchase/Controllers/ChooseTypeViewController.h
+0
-2
ChooseTypeViewController.m
...ntrollers/Purchase/Controllers/ChooseTypeViewController.m
+9
-23
ChooseVendorViewController.h
...rollers/Purchase/Controllers/ChooseVendorViewController.h
+0
-2
ChooseVendorViewController.m
...rollers/Purchase/Controllers/ChooseVendorViewController.m
+6
-111
ChooseWarehouseViewController.h
...lers/Purchase/Controllers/ChooseWarehouseViewController.h
+0
-2
ChooseWarehouseViewController.m
...lers/Purchase/Controllers/ChooseWarehouseViewController.m
+7
-77
NewPurchaseViewController.m
...trollers/Purchase/Controllers/NewPurchaseViewController.m
+9
-2
ProductBillViewController.h
...trollers/Purchase/Controllers/ProductBillViewController.h
+2
-1
ProductBillViewController.m
...trollers/Purchase/Controllers/ProductBillViewController.m
+6
-4
PurchaseDetailViewController.m
...llers/Purchase/Controllers/PurchaseDetailViewController.m
+10
-12
PurchaseViewController.m
...Controllers/Purchase/Controllers/PurchaseViewController.m
+32
-32
PurchaseBillProduct.h
...uit/ViewControllers/Purchase/Models/PurchaseBillProduct.h
+4
-0
ProductBillCell.h
XFFruit/ViewControllers/Purchase/Views/ProductBillCell.h
+5
-0
ProductBillCell.m
XFFruit/ViewControllers/Purchase/Views/ProductBillCell.m
+37
-0
PurchaseCell.h
XFFruit/ViewControllers/Purchase/Views/PurchaseCell.h
+2
-0
PurchaseCell.m
XFFruit/ViewControllers/Purchase/Views/PurchaseCell.m
+17
-9
TopPurchaseView.m
XFFruit/ViewControllers/Purchase/Views/TopPurchaseView.m
+9
-9
NewPurchaseNoticeViewController.m
...trollers/PurchaseNotice/NewPurchaseNoticeViewController.m
+1
-1
ShopDetaileViewController.m
...iewControllers/PurchaseNotice/ShopDetaileViewController.m
+3
-2
NewTransportViewController.h
...Survey/Transport/Controllers/NewTransportViewController.h
+14
-0
NewTransportViewController.m
...Survey/Transport/Controllers/NewTransportViewController.m
+250
-0
TransportPurchaseViewController.h
...y/Transport/Controllers/TransportPurchaseViewController.h
+16
-0
TransportPurchaseViewController.m
...y/Transport/Controllers/TransportPurchaseViewController.m
+211
-0
FeeAcountDetail.h
...ViewControllers/Survey/Transport/Models/FeeAcountDetail.h
+21
-0
FeeAcountDetail.m
...ViewControllers/Survey/Transport/Models/FeeAcountDetail.m
+13
-0
Transport.h
XFFruit/ViewControllers/Survey/Transport/Models/Transport.h
+36
-0
Transport.m
XFFruit/ViewControllers/Survey/Transport/Models/Transport.m
+13
-0
BottomTransportView.h
...wControllers/Survey/Transport/Views/BottomTransportView.h
+19
-0
BottomTransportView.m
...wControllers/Survey/Transport/Views/BottomTransportView.m
+129
-0
TopTransportView.h
...ViewControllers/Survey/Transport/Views/TopTransportView.h
+40
-0
TopTransportView.m
...ViewControllers/Survey/Transport/Views/TopTransportView.m
+191
-0
TransportPurchaseCell.h
...ontrollers/Survey/Transport/Views/TransportPurchaseCell.h
+24
-0
TransportPurchaseCell.m
...ontrollers/Survey/Transport/Views/TransportPurchaseCell.m
+127
-0
TransportPurductCell.h
...Controllers/Survey/Transport/Views/TransportPurductCell.h
+20
-0
TransportPurductCell.m
...Controllers/Survey/Transport/Views/TransportPurductCell.m
+87
-0
ChooseProductViewController.h
...trollers/Survey/controllers/ChooseProductViewController.h
+0
-2
ChooseProductViewController.m
...trollers/Survey/controllers/ChooseProductViewController.m
+5
-84
ChosePersonViewController.h
...ontrollers/Survey/controllers/ChosePersonViewController.h
+0
-3
ChosePersonViewController.m
...ontrollers/Survey/controllers/ChosePersonViewController.m
+11
-76
NewSurveyViewController.m
...wControllers/Survey/controllers/NewSurveyViewController.m
+3
-2
CostViewController.m
...iewControllers/WorkSheet/Controllers/CostViewController.m
+1
-1
GoodsViewController.m
...ewControllers/WorkSheet/Controllers/GoodsViewController.m
+1
-1
MaterialVIewController.m
...ontrollers/WorkSheet/Controllers/MaterialVIewController.m
+5
-5
FooterCell.h
XFFruit/ViewControllers/WorkSheet/Views/FooterCell.h
+2
-2
FooterCell.m
XFFruit/ViewControllers/WorkSheet/Views/FooterCell.m
+23
-2
TopSheetView.m
XFFruit/ViewControllers/WorkSheet/Views/TopSheetView.m
+0
-1
No files found.
XFFruit.xcodeproj/project.pbxproj
View file @
8938ec94
This diff is collapsed.
Click to expand it.
XFFruit/Controllers/HTTPController/ICRHTTPController.m
View file @
8938ec94
...
...
@@ -1721,8 +1721,8 @@ acceptTypeJson:YES
fail
(
error
);
}
};
NSString
*
dateStr
=
[[
NSDate
date
]
httpParameterString
];
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
urlAction
]
stringByAppendingFormat
:
@"?startDate=%@&pageNumber=%@&pageSize=%@"
,
dateStr
,
@
(
page_number
),
@
(
page_size
)];
//
NSString *dateStr = [[NSDate date] httpParameterString];
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
urlAction
]
stringByAppendingFormat
:
@"?startDate=%@&pageNumber=%@&pageSize=%@"
,
@"2015-05-06"
,
@
(
page_number
),
@
(
page_size
)];
NSString
*
encodeUrlStr
=
[
urlStr
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
if
(
isPost
)
{
...
...
XFFruit/General/Classes/BaseViewController/ChooseParentViewController.h
View file @
8938ec94
...
...
@@ -10,6 +10,7 @@
#import "MaskCell.h"
#import "MJRefresh.h"
typedef
void
(
^
ChoseBaseInfo
)(
NSArray
*
baseInfos
);
@interface
ChooseParentViewController
:
ICRBaseViewController
...
...
@@ -19,10 +20,15 @@
@property
(
nonatomic
,
strong
)
NSMutableArray
*
indexArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
UITextField
*
selectTextFiled
;
@property
(
nonatomic
,
strong
)
NSIndexPath
*
currentIndexPath
;
@property
(
nonatomic
,
strong
)
NSString
*
tableStr
;
@property
(
nonatomic
,
assign
)
BOOL
isRefresh
;
@property
(
nonatomic
,
copy
)
ChoseBaseInfo
choseBaseInfo
;
-
(
void
)
endRefreshing
;
-
(
void
)
getBaseDataFromServer
;
-
(
BOOL
)
isHaveIndexPath
:(
NSIndexPath
*
)
indexPath
;
-
(
void
)
deleteTextFieldStr
;
-
(
void
)
fetchDataList
:(
NSString
*
)
titleStr
tableStr
:(
NSString
*
)
tableStr
;
-
(
void
)
tableViewRefresh
;
@end
XFFruit/General/Classes/BaseViewController/ChooseParentViewController.m
View file @
8938ec94
...
...
@@ -86,6 +86,27 @@
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
0
)
{
return
;
}
if
(
self
.
isMoreChose
==
YES
)
{
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
if
(
!
[
self
isHaveIndexPath
:
indexPath
])
{
cell
.
Commitbtn
.
hidden
=
NO
;
[
self
.
indexArr
addObject
:
indexPath
];
}
else
{
cell
.
Commitbtn
.
hidden
=
YES
;
[
self
.
indexArr
removeObject
:
indexPath
];
}
}
else
{
MaskCell
*
currentCell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
self
.
currentIndexPath
];
currentCell
.
Commitbtn
.
hidden
=
YES
;
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
self
.
currentIndexPath
=
indexPath
;
}
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
TableHeight
;
...
...
@@ -93,9 +114,7 @@
-
(
void
)
keyboardHidden
{
[
self
.
selectTextFiled
resignFirstResponder
];
}
-
(
void
)
deleteTextFieldStr
{
self
.
selectTextFiled
.
text
=
@""
;
}
#pragma mark - 结束刷新
-
(
void
)
endRefreshing
{
self
.
isRefresh
=
NO
;
...
...
@@ -110,17 +129,77 @@
}
return
NO
;
}
-
(
void
)
deleteTextFieldStr
{
self
.
selectTextFiled
.
text
=
@""
;
[
self
boxValueChanged
:
nil
];
}
#pragma mark - 按钮事件
-
(
void
)
boxValueChanged
:
(
NSNotification
*
)
fication
{
// NSString *tilkeStr = [IBTCommon trimmingCharacters:self.selectTextFiled.text];
// [self fetchDataList:tilkeStr];
}
-
(
void
)
tableViewRefresh
{
self
.
currentIndexPath
=
nil
;
if
(
self
.
indexArr
.
count
>
0
)
{
[
self
.
indexArr
removeAllObjects
];
}
[
self
.
tableView
reloadData
];
}
-
(
void
)
fetchDataList
:
(
NSString
*
)
titleStr
tableStr
:
(
NSString
*
)
tableStr
{
ICRDatabaseFetchBlock
fetchBlk
=
^
FMResultSet
*
(
FMDatabase
*
db
)
{
NSString
*
sql
=
@""
;
if
(
titleStr
.
length
>
0
)
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' ORDER BY %@"
,
tableStr
,
titleStr
,
@"uuid"
];
}
else
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ ORDER BY %@"
,
tableStr
,
@"uuid"
];
}
return
[
db
executeQuery
:
sql
];
};
__weak
typeof
(
self
)
weakSelf
=
self
;
ICRDatabaseFetchResultsBlock
fetchResultsBlk
=
^
(
NSArray
*
fetchedObjects
)
{
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
if
(
!
[
GXF_NSUSERFEFTAULTS
objectForKey
:
self
.
tableView
.
header
.
lastUpdatedTimeKey
])
{
[
GXF_NSUSERFEFTAULTS
setObject
:[
NSDate
date
]
forKey
:
self
.
tableView
.
header
.
lastUpdatedTimeKey
];
[
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
:
NSClassFromString
(
tableStr
)
fetchBlock
:
fetchBlk
fetchResultsBlock
:
fetchResultsBlk
];
}
#pragma mark -成功
-
(
void
)
sureClick
{
if
(
self
.
isMoreChose
)
{
NSMutableArray
*
arr
=
[[
NSMutableArray
alloc
]
init
];
for
(
NSIndexPath
*
index
in
self
.
indexArr
)
{
[
arr
addObject
:
self
.
dataArr
[
index
.
row
]];
}
self
.
choseBaseInfo
(
arr
);
}
else
{
NSMutableArray
*
arr
=
[[
NSMutableArray
alloc
]
init
];
if
(
self
.
dataArr
.
count
>
0
)
{
if
(
self
.
currentIndexPath
)
{
[
arr
addObject
:
self
.
dataArr
[
self
.
currentIndexPath
.
row
]];
self
.
choseBaseInfo
(
arr
);
}
}
}
[
self
PopViewControllerAnimated
:
YES
];
}
#pragma mark -childFunction
-
(
void
)
getBaseDataFromServer
{
}
-
(
void
)
sureClick
{
}
-
(
void
)
boxValueChanged
:
(
NSNotification
*
)
fication
{
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
XFFruit/Macro/ICRNotificationMacro.h
View file @
8938ec94
...
...
@@ -10,6 +10,10 @@
#define XFFruit_ICRNotificationMacro_h
#define SetProductTotalPrice @"setProductTotalPrice"
#define KNOTIFICATION_getSelectPurchaseProduct @"KNOTIFICATION_getSelectPurchaseProduct"
#define KNOTIFICATION_changeIsSelectedFunctions @"KNOTIFICATION_changeIsSelectedFunctions"
...
...
XFFruit/Utilities/IBTUIKit/IBTConstants.h
View file @
8938ec94
...
...
@@ -128,12 +128,14 @@
//采购单状态
#define PURCHASE_STATE_INITIAL @"initial"
#define PURCHASE_STATE_SUBMITTED @"submitted"
#define PURCHASE_STATE_REJECTED @"rejected"
#define PURCHASE_STATE_APPROVED @"approved"
#define PURCHASE_STATE_SHIPPING @"shipping"
#define PURCHASE_STATE_FINISHED @"finished"
#define PURCHASE_STATE_INITIAL @"initial" //未提交
#define PURCHASE_STATE_SUBMITTED @"submitted"//已提交
#define PURCHASE_STATE_REJECTED @"rejected" //已拒绝
#define PURCHASE_STATE_APPROVED @"approved" //已审批
#define PURCHASE_STATE_SHIPPING @"shipping" //发运中
#define PURCHASE_STATE_FINISHED @"finished" //已完成
#define PURCHASE_STATE_ABORTED @"aborted" //已作废
//采购单操作
#define PURCHASE_ACTION_REJECT @"reject"
...
...
@@ -155,4 +157,11 @@
#define GXF_Critical @"critical"//紧急
#define GXF_Normal @"normal"//普通
#define GXF_BASECLASS_WAREHOUSE @"Warehouse"
#define GXF_BASECLASS_VENDOR @"Vendor"
#define GXF_BASECLASS_PRODUCT @"Product"
#define GXF_BASECLASS_USER @"User"
#endif
XFFruit/ViewControllers/Business/BusinessViewController.m
View file @
8938ec94
...
...
@@ -28,6 +28,7 @@
#import "NewPurchaseViewController.h"
#import "PurchaseViewController.h"
#import "NewTransportViewController.h"
@interface
BusinessViewController
()
<
ICRFunctionBaseViewDelegate
>
...
...
@@ -171,12 +172,12 @@
break
;
// case kFunctionTaskManage
ment://任务管理
//
{
// ICRTaskListViewController *tVC = [[ICRTaskLis
tViewController alloc] init];
//
[self PushViewController:tVC animated:YES];
//
}
//
break;
case
kFunctionNewShip
ment
:
//任务管理
{
NewTransportViewController
*
tVC
=
[[
NewTranspor
tViewController
alloc
]
init
];
[
self
PushViewController
:
tVC
animated
:
YES
];
}
break
;
// case kFunctionPatrolPlan://巡店计划
// {
// ICRPatrolPlanViewController *pVC = [[ICRPatrolPlanViewController alloc] initWithStore:nil isHomeShow:YES];
...
...
XFFruit/ViewControllers/Purchase/Controllers/ChooseTypeViewController.h
View file @
8938ec94
...
...
@@ -7,8 +7,6 @@
//
#import "ChooseParentViewController.h"
typedef
void
(
^
ChoseType
)(
NSString
*
type
);
@interface
ChooseTypeViewController
:
ChooseParentViewController
@property
(
nonatomic
,
copy
)
ChoseType
choseType
;
@end
XFFruit/ViewControllers/Purchase/Controllers/ChooseTypeViewController.m
View file @
8938ec94
...
...
@@ -11,7 +11,6 @@
#define TableHeight 50
@interface
ChooseTypeViewController
()
{
NSIndexPath
*
_currentIndexPath
;
}
@end
...
...
@@ -23,19 +22,10 @@
self
.
title
=
@"类型"
;
[
self
.
dataArr
addObject
:
@"紧急"
];
[
self
.
dataArr
addObject
:
@"普通"
];
self
.
selectTextFiled
=
nil
;
self
.
tableView
.
frame
=
CGRectMake
(
0
,
5
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
5
);
}
-
(
void
)
createRefresh
{}
-
(
void
)
sureClick
{
if
(
self
.
dataArr
.
count
>
0
)
{
if
(
_currentIndexPath
)
{
NSString
*
type
=
self
.
dataArr
[
_currentIndexPath
.
row
];
self
.
choseType
(
type
);
}
}
[
self
PopViewControllerAnimated
:
YES
];
}
#pragma mark - 协议方法
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
...
...
@@ -48,8 +38,8 @@
cell
.
Commitbtn
.
hidden
=
YES
;
}
if
(
_
currentIndexPath
)
{
if
(
indexPath
.
row
==
_
currentIndexPath
.
row
)
{
if
(
self
.
currentIndexPath
)
{
if
(
indexPath
.
row
==
self
.
currentIndexPath
.
row
)
{
cell
.
Commitbtn
.
hidden
=
NO
;
}
else
{
cell
.
Commitbtn
.
hidden
=
YES
;
...
...
@@ -63,17 +53,13 @@
}
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
MaskCell
*
currentCell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
_currentIndexPath
];
currentCell
.
Commitbtn
.
hidden
=
YES
;
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
_currentIndexPath
=
indexPath
;
MaskCell
*
currentCell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
self
.
currentIndexPath
];
currentCell
.
Commitbtn
.
hidden
=
YES
;
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
self
.
currentIndexPath
=
indexPath
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
XFFruit/ViewControllers/Purchase/Controllers/ChooseVendorViewController.h
View file @
8938ec94
...
...
@@ -7,8 +7,6 @@
//
#import "ChooseParentViewController.h"
typedef
void
(
^
ChoseVendor
)(
NSArray
*
vendor
);
@interface
ChooseVendorViewController
:
ChooseParentViewController
@property
(
nonatomic
,
copy
)
ChoseVendor
choseVendor
;
@end
XFFruit/ViewControllers/Purchase/Controllers/ChooseVendorViewController.m
View file @
8938ec94
...
...
@@ -12,7 +12,6 @@
#define TableHeight 50
@interface
ChooseVendorViewController
()
{
NSIndexPath
*
_currentIndexPath
;
}
@end
...
...
@@ -24,11 +23,9 @@
//记录更新时间
self
.
tableView
.
header
.
lastUpdatedTimeKey
=
ChooseVendorUpdateDate
;
self
.
title
=
@"选择供应商"
;
[
self
fetchVendorList
:
@""
];
[
self
fetchDataList
:
@""
tableStr
:
GXF_BASECLASS_VENDOR
];
}
-
(
void
)
getBaseDataFromServer
{
__weak
typeof
(
self
)
weakSelf
=
self
;
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
...
...
@@ -36,7 +33,7 @@
if
(
data
)
{
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
[
strongSelf
endRefreshing
];
[
strongSelf
fetch
VendorList
:
@""
];
[
strongSelf
fetch
DataList
:
@""
tableStr
:
GXF_BASECLASS_VENDOR
];
}
else
{
[
IBTLoadingView
showTips
:
data
];
}
...
...
@@ -48,66 +45,6 @@
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
[[
ICRHTTPController
sharedController
]
getVendorWithPage_number
:
0
page_size
:
100
success
:
succ
failure
:
fail
];
}
#pragma mark -成功
-
(
void
)
fetchVendorList
:
(
NSString
*
)
titleStr
{
ICRDatabaseFetchBlock
fetchBlk
=
^
FMResultSet
*
(
FMDatabase
*
db
)
{
NSString
*
sql
=
@""
;
if
(
titleStr
.
length
>
0
)
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' ORDER BY %@"
,
[
Vendor
TableName
],
titleStr
,
@"uuid"
];
}
else
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ ORDER BY %@"
,
[
Vendor
TableName
],
@"uuid"
];
}
return
[
db
executeQuery
:
sql
];
};
__weak
typeof
(
self
)
weakSelf
=
self
;
ICRDatabaseFetchResultsBlock
fetchResultsBlk
=
^
(
NSArray
*
fetchedObjects
)
{
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
if
(
!
[
GXF_NSUSERFEFTAULTS
objectForKey
:
ChooseVendorUpdateDate
])
{
[
GXF_NSUSERFEFTAULTS
setObject
:[
NSDate
date
]
forKey
:
ChooseVendorUpdateDate
];
[
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
:[
Vendor
class
]
fetchBlock
:
fetchBlk
fetchResultsBlock
:
fetchResultsBlk
];
}
-
(
void
)
sureClick
{
if
(
self
.
isMoreChose
)
{
NSMutableArray
*
arr
=
[[
NSMutableArray
alloc
]
init
];
for
(
NSIndexPath
*
index
in
self
.
indexArr
)
{
Vendor
*
vendor
=
self
.
dataArr
[
index
.
row
];
[
arr
addObject
:
vendor
];
}
self
.
choseVendor
(
arr
);
}
else
{
NSMutableArray
*
arr
=
[[
NSMutableArray
alloc
]
init
];
if
(
self
.
dataArr
.
count
>
0
)
{
Vendor
*
vendor
=
self
.
dataArr
[
_currentIndexPath
.
row
];
[
arr
addObject
:
vendor
];
self
.
choseVendor
(
arr
);
}
}
[
self
PopViewControllerAnimated
:
YES
];
}
-
(
void
)
deleteTextFieldStr
{
[
super
deleteTextFieldStr
];
[
self
boxValueChanged
:
nil
];
}
#pragma mark - 协议方法
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"MaskCell"
;
...
...
@@ -119,14 +56,14 @@
cell
.
Commitbtn
.
hidden
=
YES
;
}
if
(
self
.
isMoreChose
)
{
if
([
self
has
IndexPath
:
indexPath
])
{
if
([
self
isHave
IndexPath
:
indexPath
])
{
cell
.
Commitbtn
.
hidden
=
NO
;
}
else
{
cell
.
Commitbtn
.
hidden
=
YES
;
}
}
else
{
if
(
_
currentIndexPath
)
{
if
(
indexPath
.
row
==
_
currentIndexPath
.
row
)
{
if
(
self
.
currentIndexPath
)
{
if
(
indexPath
.
row
==
self
.
currentIndexPath
.
row
)
{
cell
.
Commitbtn
.
hidden
=
NO
;
}
else
{
cell
.
Commitbtn
.
hidden
=
YES
;
...
...
@@ -148,52 +85,10 @@
}
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
0
)
{
return
;
}
if
(
self
.
isMoreChose
==
YES
)
{
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
if
(
!
[
self
hasIndexPath
:
indexPath
])
{
[
self
.
indexArr
addObject
:
indexPath
];
}
}
else
{
MaskCell
*
currentCell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
_currentIndexPath
];
currentCell
.
Commitbtn
.
hidden
=
YES
;
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
_currentIndexPath
=
indexPath
;
}
}
-
(
BOOL
)
hasIndexPath
:
(
NSIndexPath
*
)
indexPath
{
for
(
NSIndexPath
*
path
in
self
.
indexArr
)
{
if
(
path
.
row
==
indexPath
.
row
)
{
return
YES
;
}
}
return
NO
;
}
#pragma mark - 按钮事件
-
(
void
)
boxValueChanged
:
(
NSNotification
*
)
fication
{
NSString
*
tilkeStr
=
[
IBTCommon
trimmingCharacters
:
self
.
selectTextFiled
.
text
];
[
self
fetchVendorList
:
tilkeStr
];
}
-
(
void
)
tableViewRefresh
{
_currentIndexPath
=
nil
;
if
(
self
.
indexArr
.
count
>
0
)
{
[
self
.
indexArr
removeAllObjects
];
}
[
self
.
tableView
reloadData
];
[
self
fetchDataList
:
tilkeStr
tableStr
:
GXF_BASECLASS_VENDOR
];
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
XFFruit/ViewControllers/Purchase/Controllers/ChooseWarehouseViewController.h
View file @
8938ec94
...
...
@@ -8,8 +8,6 @@
#import "ChooseParentViewController.h"
#import "Warehouse.h"
typedef
void
(
^
ChoseWarehouse
)(
Warehouse
*
warehouse
);
@interface
ChooseWarehouseViewController
:
ChooseParentViewController
@property
(
nonatomic
,
copy
)
ChoseWarehouse
choseWarehouse
;
@end
XFFruit/ViewControllers/Purchase/Controllers/ChooseWarehouseViewController.m
View file @
8938ec94
...
...
@@ -10,10 +10,7 @@
#define TopMargin 50
#define TableHeight 50
@interface
ChooseWarehouseViewController
()
{
NSIndexPath
*
_currentIndexPath
;
}
@end
@implementation
ChooseWarehouseViewController
...
...
@@ -23,7 +20,7 @@
//记录更新时间
self
.
tableView
.
header
.
lastUpdatedTimeKey
=
ChooseWarehouseUpdateDate
;
self
.
title
=
@"选择仓库"
;
[
self
fetch
WarehouseList
:
@""
];
[
self
fetch
DataList
:
@""
tableStr
:
GXF_BASECLASS_WAREHOUSE
];
}
-
(
void
)
getBaseDataFromServer
{
...
...
@@ -33,7 +30,7 @@
if
(
data
)
{
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
[
self
endRefreshing
];
[
strongSelf
fetch
WarehouseList
:
@""
];
[
strongSelf
fetch
DataList
:
@""
tableStr
:
GXF_BASECLASS_WAREHOUSE
];
}
else
{
[
IBTLoadingView
showTips
:
data
];
}
...
...
@@ -47,56 +44,6 @@
[[
ICRHTTPController
sharedController
]
getWarehouseWithPage_number
:
0
page_size
:
100
success
:
succ
failure
:
fail
];
}
#pragma mark -成功
-
(
void
)
fetchWarehouseList
:
(
NSString
*
)
titleStr
{
ICRDatabaseFetchBlock
fetchBlk
=
^
FMResultSet
*
(
FMDatabase
*
db
)
{
NSString
*
sql
=
@""
;
if
(
titleStr
.
length
>
0
)
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' ORDER BY %@"
,
[
Warehouse
TableName
],
titleStr
,
@"uuid"
];
}
else
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ ORDER BY %@"
,
[
Warehouse
TableName
],
@"uuid"
];
}
return
[
db
executeQuery
:
sql
];
};
__weak
typeof
(
self
)
weakSelf
=
self
;
ICRDatabaseFetchResultsBlock
fetchResultsBlk
=
^
(
NSArray
*
fetchedObjects
)
{
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
if
(
!
[
GXF_NSUSERFEFTAULTS
objectForKey
:
ChooseWarehouseUpdateDate
])
{
[
GXF_NSUSERFEFTAULTS
setObject
:[
NSDate
date
]
forKey
:
ChooseWarehouseUpdateDate
];
[
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
:[
Warehouse
class
]
fetchBlock
:
fetchBlk
fetchResultsBlock
:
fetchResultsBlk
];
}
-
(
void
)
sureClick
{
if
(
self
.
dataArr
.
count
>
0
)
{
if
(
_currentIndexPath
)
{
Warehouse
*
warehouse
=
self
.
dataArr
[
_currentIndexPath
.
row
];
self
.
choseWarehouse
(
warehouse
);
}
}
[
self
PopViewControllerAnimated
:
YES
];
}
-
(
void
)
deleteTextFieldStr
{
[
super
deleteTextFieldStr
];
}
#pragma mark - 协议方法
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"MaskCell"
;
...
...
@@ -108,8 +55,8 @@
cell
.
Commitbtn
.
hidden
=
YES
;
}
if
(
_
currentIndexPath
)
{
if
(
indexPath
.
row
==
_
currentIndexPath
.
row
)
{
if
(
self
.
currentIndexPath
)
{
if
(
indexPath
.
row
==
self
.
currentIndexPath
.
row
)
{
cell
.
Commitbtn
.
hidden
=
NO
;
}
else
{
cell
.
Commitbtn
.
hidden
=
YES
;
...
...
@@ -132,29 +79,12 @@
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
MaskCell
*
currentCell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
_currentIndexPath
];
currentCell
.
Commitbtn
.
hidden
=
YES
;
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
_currentIndexPath
=
indexPath
;
}
#pragma mark - 按钮事件
-
(
void
)
boxValueChanged
:
(
NSNotification
*
)
fication
{
NSString
*
tilkeStr
=
[
IBTCommon
trimmingCharacters
:
self
.
selectTextFiled
.
text
];
[
self
fetchWarehouseList
:
tilkeStr
];
}
-
(
void
)
tableViewRefresh
{
_currentIndexPath
=
nil
;
if
(
self
.
indexArr
.
count
>
0
)
{
[
self
.
indexArr
removeAllObjects
];
}
[
self
.
tableView
reloadData
];
[
self
fetchDataList
:
tilkeStr
tableStr
:
GXF_BASECLASS_WAREHOUSE
];
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
XFFruit/ViewControllers/Purchase/Controllers/NewPurchaseViewController.m
View file @
8938ec94
...
...
@@ -83,7 +83,7 @@ typedef enum : NSUInteger {
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
[[
ICRHTTPController
sharedController
]
getPurchaseResultWithPurchaseUuid
:
@"5a7417014f926eb5014f9ce2988a004d"
success
:
succ
failure
:
fail
];
[[
ICRHTTPController
sharedController
]
getPurchaseResultWithPurchaseUuid
:
self
.
purchaseBill
.
uuid
success
:
succ
failure
:
fail
];
}
//赋值
-
(
void
)
prepareDataInCell
{
...
...
@@ -211,7 +211,7 @@ typedef enum : NSUInteger {
for
(
PurchaseBillProduct
*
billProduct
in
_pvc
.
productArr
)
{
[
billProducts
addObject
:[
billProduct
dictForCommit
]];
}
self
.
state
=
state
;
NSDictionary
*
dict
=
@{
@"uuid"
:
uuidObject
,
@"version"
:
versionObject
,
@"billnumber"
:
billNumberObject
,
...
...
@@ -274,6 +274,13 @@ typedef enum : NSUInteger {
[
_purchaseView
.
otherPriceFiled
resignFirstResponder
];
[
_purchaseView
.
remarkTextView
resignFirstResponder
];
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
if
(
self
.
purchaseBill
&&
[
self
.
state
isEqualToString
:
PURCHASE_STATE_INITIAL
]){
[
ICRUserUtil
sharedInstance
].
needFresh
=
YES
;
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
XFFruit/ViewControllers/Purchase/Controllers/ProductBillViewController.h
View file @
8938ec94
...
...
@@ -8,11 +8,12 @@
#import "ICRBaseViewController.h"
@interface
ProductBillViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
NSMutableArray
*
productArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
assign
)
CGRect
viewFrame
;
@property
(
nonatomic
,
assign
)
BOOL
isHiddenEdit
;
@property
(
nonatomic
,
strong
)
NSString
*
twoTitle
;
@end
XFFruit/ViewControllers/Purchase/Controllers/ProductBillViewController.m
View file @
8938ec94
...
...
@@ -12,7 +12,7 @@
#import "ProductBillCell.h"
#import "PurchaseBillProduct.h"
#define TableHeight 44
#define ShowHeight 1
0
0
#define ShowHeight 1
1
0
@interface
ProductBillViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
FooterCellDelegate
>
{
...
...
@@ -46,7 +46,7 @@
billProduct
.
price
=
[
NSNumber
numberWithFloat
:
333
];
billProduct
.
baseQty
=
[
NSNumber
numberWithFloat
:
333
];
billProduct
.
basePrice
=
[
NSNumber
numberWithFloat
:
33
];
billProduct
.
total
=
[
NSNumber
numberWithFloat
:
4
0
];
billProduct
.
total
=
[
NSNumber
numberWithFloat
:
8
0
];
billProduct
.
remark
=
@"hshshshsh"
;
billProduct
.
qpcStr
=
@"fdsfdsfdsa"
;
[
self
.
productArr
addObject
:
billProduct
];
...
...
@@ -73,7 +73,7 @@
self
.
tableView
.
tableHeaderView
=
headCell
;
if
(
!
self
.
isHiddenEdit
)
{
FooterCell
*
footCell
=
[[
FooterCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
_tableFrame
.
size
.
width
,
50
)
withTitle
:
@"+点击添加商品明细"
];
FooterCell
*
footCell
=
[[
FooterCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
_tableFrame
.
size
.
width
,
50
)
withTitle
:
@"+点击添加商品明细"
isTwo
:
self
.
twoTitle
];
[
self
.
view
addSubview
:
footCell
];
footCell
.
delegate
=
self
;
self
.
tableView
.
tableFooterView
=
footCell
;
...
...
@@ -83,7 +83,9 @@
-
(
void
)
addClick
{
}
-
(
void
)
choosePurchase
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"ChoseTransportPurchase"
object
:
nil
];
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
...
...
XFFruit/ViewControllers/Purchase/Controllers/PurchaseDetailViewController.m
View file @
8938ec94
...
...
@@ -89,7 +89,7 @@ typedef enum : NSUInteger {
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
[[
ICRHTTPController
sharedController
]
getPurchaseResultWithPurchaseUuid
:
@"5a7417014f926eb5014f93b18fbc000f"
success
:
succ
failure
:
fail
];
[[
ICRHTTPController
sharedController
]
getPurchaseResultWithPurchaseUuid
:
self
.
bill
.
uuid
success
:
succ
failure
:
fail
];
}
...
...
@@ -104,13 +104,7 @@ typedef enum : NSUInteger {
[
self
createBottomView
];
[
self
createPurchaseView
];
if
([
self
.
bill
.
state
isEqualToString
:
@"finished"
])
{
_secondBtn
.
hidden
=
YES
;
_firstBtn
.
hidden
=
YES
;
CGRect
scrollViewFrame
=
_scrollView
.
frame
;
scrollViewFrame
.
size
.
height
=
ScreenSize
.
height
-
64
;
_scrollView
.
frame
=
scrollViewFrame
;
}
}
-
(
void
)
createBtn
{
...
...
@@ -176,11 +170,15 @@ typedef enum : NSUInteger {
_secondBtn
.
tag
=
CancleTag
;
self
.
indexStyle
=
0
;
}
else
{
//不显示任何按钮
_firstBtn
.
hidden
=
YES
;
_secondBtn
.
hidden
=
YES
;
self
.
indexStyle
=
1
;
}
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_ABORTED
]){
//已作废
_firstBtn
.
hidden
=
YES
;
_secondBtn
.
hidden
=
YES
;
self
.
indexStyle
=
1
;
CGRect
scrollViewFrame
=
_scrollView
.
frame
;
scrollViewFrame
.
size
.
height
=
ScreenSize
.
height
-
64
;
_scrollView
.
frame
=
scrollViewFrame
;
}
}
//改变按钮的位置
...
...
XFFruit/ViewControllers/Purchase/Controllers/PurchaseViewController.m
View file @
8938ec94
...
...
@@ -63,34 +63,34 @@ typedef enum : NSUInteger {
}
-
(
void
)
initData
{
self
.
dataArr
=
[
NSMutableArray
array
];
for
(
NSInteger
i
=
0
;
i
<
6
;
i
++
)
{
PurchaseBill
*
bill
=
[
PurchaseBill
new
];
bill
.
billNumber
=
@"150903000013"
;
bill
.
noticeNumber
=
@"134594059654"
;
bill
.
create_operName
=
@"创建人"
;
bill
.
create_time
=
@"2013-03-04"
;
bill
.
vendor_name
=
@"供应商"
;
bill
.
total
=
[
NSNumber
numberWithFloat
:
22
];
bill
.
charge
=
[
NSNumber
numberWithFloat
:
333
];
bill
.
remark
=
@"备注"
;
bill
.
lastModify_operName
=
@"最后修改人"
;
bill
.
vendorConfirmTime
=
@"否"
;
if
(
i
==
0
)
{
bill
.
state
=
@"initial"
;
}
else
if
(
i
==
1
){
bill
.
state
=
@"submitted"
;
}
else
if
(
i
==
2
){
bill
.
state
=
@"rejected"
;
}
else
if
(
i
==
3
){
bill
.
state
=
@"approved"
;
}
else
if
(
i
==
4
){
bill
.
state
=
@"shipping"
;
}
else
if
(
i
==
5
){
bill
.
state
=
@"finished"
;
}
[
self
.
dataArr
addObject
:
bill
];
}
//
for (NSInteger i = 0; i < 6; i++) {
//
PurchaseBill *bill = [PurchaseBill new];
//
bill.billNumber = @"150903000013";
//
bill.noticeNumber = @"134594059654";
//
bill.create_operName = @"创建人";
//
bill.create_time = @"2013-03-04";
//
bill.vendor_name = @"供应商";
//
bill.total = [NSNumber numberWithFloat:22];
//
bill.charge = [NSNumber numberWithFloat:333];
//
bill.remark = @"备注";
//
bill.lastModify_operName = @"最后修改人";
//
bill.vendorConfirmTime = @"否";
//
//
if (i == 0) {
//
bill.state = @"initial";
//
}else if(i == 1){
//
bill.state = @"submitted";
//
}else if(i == 2){
//
bill.state = @"rejected";
//
}else if(i == 3){
//
bill.state = @"approved";
//
}else if(i == 4){
//
bill.state = @"shipping";
//
}else if(i == 5){
//
bill.state = @"finished";
//
}
//
[self.dataArr addObject:bill];
//
}
}
-
(
void
)
getData
{
[
ICRUserUtil
sharedInstance
].
needFresh
=
NO
;
...
...
@@ -154,7 +154,7 @@ typedef enum : NSUInteger {
NSDictionary
*
dict
=
@{
@"billNumberLike"
:
billObject
,
@"state"
:
stateObject
,
@"noticeNumberLike"
:
noticeObject
,
//
@"noticeNumberLike":noticeObject,
@"titleLike"
:
[
NSNull
null
],
@"vendorUuid"
:
[
NSNull
null
],
@"queryOrders"
:
orderArr
,
...
...
@@ -169,9 +169,9 @@ typedef enum : NSUInteger {
NSString
*
message
=
data
[
@"message"
]
;
if
(
success
==
1
)
{
if
(
_currentPage
==
0
)
{
//
if (self.dataArr.count > 0) {
//
[self.dataArr removeAllObjects];
//
}
if
(
self
.
dataArr
.
count
>
0
)
{
[
self
.
dataArr
removeAllObjects
];
}
}
NSArray
*
recodesArr
=
data
[
@"data"
][
@"records"
];
for
(
NSDictionary
*
purchaseBillDict
in
recodesArr
)
{
...
...
XFFruit/ViewControllers/Purchase/Models/PurchaseBillProduct.h
View file @
8938ec94
...
...
@@ -22,6 +22,10 @@
@property
(
nonatomic
,
strong
)
NSNumber
*
basePrice
;
//基础单价
@property
(
nonatomic
,
strong
)
NSNumber
*
total
;
// 金额
@property
(
nonatomic
,
strong
)
NSString
*
remark
;
//备注
@property
(
nonatomic
,
strong
)
NSNumber
*
shippedFlag
;
//发运标志,0 未发运,1已发运
@property
(
nonatomic
,
strong
)
NSNumber
*
shippedQty
;
//发运包装数量
@property
(
nonatomic
,
strong
)
NSNumber
*
shippedBaseQty
;
//发运基础数量
@end
XFFruit/ViewControllers/Purchase/Views/ProductBillCell.h
View file @
8938ec94
...
...
@@ -25,6 +25,11 @@
@property
(
nonatomic
,
strong
)
UILabel
*
showBasePriceLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
showTotalLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
showNoteLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
showShippedFlag
;
//发运标志
@property
(
nonatomic
,
strong
)
UILabel
*
showShippedQty
;
//发运包装数量
@property
(
nonatomic
,
strong
)
UILabel
*
showShippedBaseQty
;
//发运基础数量
@property
(
nonatomic
,
assign
)
BOOL
isShowShipping
;
//是否发运
-
(
void
)
setBillProduct
:(
PurchaseBillProduct
*
)
billProduct
row
:(
NSInteger
)
row
;
...
...
XFFruit/ViewControllers/Purchase/Views/ProductBillCell.m
View file @
8938ec94
...
...
@@ -17,6 +17,7 @@
#define ShowWidth 150
#define ShowHeight 20
@implementation
ProductBillCell
...
...
@@ -131,6 +132,7 @@
[
self
.
showView
addSubview
:
self
.
showPriceLabel
];
[
self
.
showView
addSubview
:
self
.
showBasePriceLabel
];
[
self
.
showView
addSubview
:
self
.
showTotalLabel
];
[
self
.
showView
addSubview
:
self
.
showNoteLabel
];
[
self
.
contentView
addSubview
:
self
.
lineLabel
];
...
...
@@ -148,6 +150,41 @@
self
.
showBasePriceLabel
.
text
=
[
NSString
stringWithFormat
:
@"基础单价:%@"
,
billProduct
.
basePrice
];
self
.
showTotalLabel
.
text
=
[
NSString
stringWithFormat
:
@"总金额:%@"
,
billProduct
.
total
];
self
.
showNoteLabel
.
text
=
[
NSString
stringWithFormat
:
@"备注:%@"
,
billProduct
.
remark
];
[
self
isShowShippingQty
:
billProduct
];
}
-
(
void
)
isShowShippingQty
:
(
PurchaseBillProduct
*
)
billProduct
{
if
(
billProduct
.
shippedQty
){
self
.
showShippedFlag
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMinX
(
self
.
showStandLabel
.
frame
),
CGRectGetMaxY
(
self
.
showBasePriceLabel
.
frame
),
ShowWidth
,
ShowHeight
))];
self
.
showShippedFlag
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showShippedFlag
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showShippedFlag
.
text
=
@"是否发运:未"
;
self
.
showShippedFlag
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
showShippedQty
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMinX
(
self
.
showCountLabel
.
frame
),
CGRectGetMaxY
(
self
.
showBasePriceLabel
.
frame
),
ShowWidth
,
ShowHeight
))];
self
.
showShippedQty
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showShippedQty
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showShippedQty
.
text
=
@"发运包装数量:"
;
self
.
showShippedQty
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
showShippedBaseQty
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMinX
(
self
.
showStandLabel
.
frame
),
CGRectGetMaxY
(
self
.
showShippedFlag
.
frame
),
ShowWidth
,
ShowHeight
))];
self
.
showShippedBaseQty
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
showShippedBaseQty
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
self
.
showShippedBaseQty
.
text
=
@"发运基础数量:"
;
self
.
showShippedBaseQty
.
font
=
GXF_THREETEENTH_SIZE
;
self
.
showNoteLabel
.
frame
=
CGRectMake
(
CGRectGetMinX
(
self
.
showCountLabel
.
frame
),
CGRectGetMaxY
(
self
.
showShippedFlag
.
frame
),
ShowWidth
,
ShowHeight
);
}
NSMutableAttributedString
*
attributeStr1
=
[
IBTCommon
setTextViewFontOfString
:
@"发运状态:"
paragraphStyle
:
0
fontSize
:
13
color
:
GXF_CELL_COLOR
];
NSString
*
str
=
[
NSString
stringWithFormat
:
@"%@"
,[
billProduct
.
shippedFlag
integerValue
]
==
0
?
@"未完成"
:
@"已完成"
];
[
attributeStr1
appendAttributedString
:[
IBTCommon
setTextViewFontOfString
:
str
paragraphStyle
:
0
fontSize
:
13
color
:
[
UIColor
redColor
]]];
self
.
showShippedFlag
.
attributedText
=
attributeStr1
;
self
.
showShippedBaseQty
.
text
=
[
NSString
stringWithFormat
:
@"发运包装数量:%@"
,[
billProduct
.
shippedBaseQty
stringValue
]];
self
.
showShippedQty
.
text
=
[
NSString
stringWithFormat
:
@"发运基础数量:%@"
,[
billProduct
.
shippedQty
stringValue
]];
[
self
.
showView
addSubview
:
self
.
showShippedFlag
];
[
self
.
showView
addSubview
:
self
.
showShippedQty
];
[
self
.
showView
addSubview
:
self
.
showShippedBaseQty
];
}
-
(
void
)
awakeFromNib
{
...
...
XFFruit/ViewControllers/Purchase/Views/PurchaseCell.h
View file @
8938ec94
...
...
@@ -11,6 +11,8 @@
@interface
PurchaseCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UILabel
*
billNumberLabel
;
//采购单号
@property
(
nonatomic
,
strong
)
UILabel
*
noticeNumberLabel
;
//采购通知单号
@property
(
nonatomic
,
strong
)
UILabel
*
vendorLabel
;
//供应商
@property
(
nonatomic
,
strong
)
UILabel
*
createOperNameLabel
;
//创建人
@property
(
nonatomic
,
strong
)
UILabel
*
createTimeLabel
;
//创建时间
@property
(
nonatomic
,
strong
)
UILabel
*
lineLabel
;
...
...
XFFruit/ViewControllers/Purchase/Views/PurchaseCell.m
View file @
8938ec94
...
...
@@ -8,7 +8,6 @@
#import "PurchaseCell.h"
#define TitleSize 16
#define ContentSize 14
#define LeftMargin 90
#define TopMargin 10
#define TitleHeight 20
...
...
@@ -29,27 +28,31 @@
{
self
.
stateBtn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
self
.
stateBtn
.
frame
=
CGRectMake
(
TopMargin
*
2
,
TopMargin
,
LeftMargin
-
TopMargin
*
3
,
20
);
self
.
stateBtn
.
titleLabel
.
font
=
FontSize
(
ContentSize
)
;
self
.
stateBtn
.
titleLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
[
self
.
stateBtn
setTitleColor
:[
UIColor
whiteColor
]
forState
:
UIControlStateNormal
];
self
.
stateBtn
.
enabled
=
NO
;
self
.
billNumberLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
TopMargin
,
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
billNumberLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
billNumberLabel
.
font
=
FontSize
(
TitleSize
)
;
self
.
billNumberLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
noticeNumberLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
billNumberLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
*
2
))];
self
.
noticeNumberLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
billNumberLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
noticeNumberLabel
.
numberOfLines
=
0
;
self
.
noticeNumberLabel
.
textColor
=
GXF_CELL_COLOR
;
self
.
noticeNumberLabel
.
font
=
FontSize
(
ContentSize
)
;
self
.
noticeNumberLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
self
.
createOperNameLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
noticeNumberLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
vendorLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
noticeNumberLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
vendorLabel
.
textColor
=
GXF_CELL_COLOR
;
self
.
vendorLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
self
.
createOperNameLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
vendorLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
createOperNameLabel
.
textColor
=
GXF_CELL_COLOR
;
self
.
createOperNameLabel
.
font
=
FontSize
(
ContentSize
)
;
self
.
createOperNameLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
self
.
createTimeLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
CGRectGetMaxY
(
self
.
createOperNameLabel
.
frame
),
ScreenSize
.
width
-
LeftMargin
,
TitleHeight
))];
self
.
createTimeLabel
.
textColor
=
GXF_CELL_COLOR
;
self
.
createTimeLabel
.
font
=
FontSize
(
ContentSize
)
;
self
.
createTimeLabel
.
font
=
GXF_FOURTEENTH_SIZE
;
self
.
lineLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
TableHeight
-
1
,
ScreenSize
.
width
-
LeftMargin
-
TopMargin
*
2
,
1
))];;
self
.
lineLabel
.
backgroundColor
=
GXF_LINE_COLOR
;
...
...
@@ -57,6 +60,7 @@
[
self
.
contentView
addSubview
:
self
.
stateBtn
];
[
self
.
contentView
addSubview
:
self
.
billNumberLabel
];
[
self
.
contentView
addSubview
:
self
.
noticeNumberLabel
];
[
self
.
contentView
addSubview
:
self
.
vendorLabel
];
[
self
.
contentView
addSubview
:
self
.
createOperNameLabel
];
[
self
.
contentView
addSubview
:
self
.
createTimeLabel
];
[
self
.
contentView
addSubview
:
self
.
lineLabel
];
...
...
@@ -65,7 +69,8 @@
-
(
void
)
setPurchaseBill
:
(
PurchaseBill
*
)
purchaseBill
{
self
.
billNumberLabel
.
text
=
[
NSString
stringWithFormat
:
@"单号:%@"
,
purchaseBill
.
billNumber
];
self
.
noticeNumberLabel
.
text
=
[
NSString
stringWithFormat
:
@"采购通知单:%@"
,
purchaseBill
.
noticeNumber
];
self
.
noticeNumberLabel
.
text
=
[
NSString
stringWithFormat
:
@"采购通知单号:%@"
,
purchaseBill
.
noticeNumber
.
length
>
0
?
purchaseBill
.
noticeNumber
:
@"无"
];
self
.
vendorLabel
.
text
=
[
NSString
stringWithFormat
:
@"供应商:%@[%@]"
,
purchaseBill
.
vendor_name
,
purchaseBill
.
vendor_code
]
;
self
.
createOperNameLabel
.
text
=
[
NSString
stringWithFormat
:
@"创建人:%@"
,
purchaseBill
.
create_operName
]
;
self
.
createTimeLabel
.
text
=
[
NSString
stringWithFormat
:
@"创建时间:%@"
,
purchaseBill
.
create_time
];
NSString
*
stateStr
=
@""
;
...
...
@@ -90,6 +95,9 @@
}
else
if
([
purchaseBill
.
state
isEqualToString
:
PURCHASE_STATE_FINISHED
])
{
stateStr
=
@"已完成"
;
[
self
.
stateBtn
setBackgroundImage
:[
UIImage
imageNamed
:
@"finish"
]
forState
:
UIControlStateDisabled
];
}
else
if
([
purchaseBill
.
state
isEqualToString
:
PURCHASE_STATE_ABORTED
])
{
stateStr
=
@"已作废"
;
[
self
.
stateBtn
setBackgroundImage
:[
UIImage
imageNamed
:
@"finish"
]
forState
:
UIControlStateDisabled
];
}
[
self
.
stateBtn
setTitle
:
stateStr
forState
:
UIControlStateNormal
];
}
...
...
XFFruit/ViewControllers/Purchase/Views/TopPurchaseView.m
View file @
8938ec94
...
...
@@ -93,16 +93,17 @@
[
cell
.
contentView
addSubview
:
label
];
}
else
if
(
indexPath
.
row
==
_dataArr
.
count
-
1
){
self
.
remarkTextView
=
[[
HPGrowingTextView
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
15
,
TableHeight
/
2
)];
self
.
remarkTextView
.
backgroundColor
=
[
UIColor
redColor
];
self
.
remarkTextView
=
[[
HPGrowingTextView
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
15
,
TableHeight
)];
self
.
remarkTextView
.
contentInset
=
UIEdgeInsetsMake
(
5
,
5
,
5
,
0
);
self
.
remarkTextView
.
minNumberOfLines
=
1
;
self
.
remarkTextView
.
maxNumberOfLines
=
1
;
self
.
remarkTextView
.
isScrollable
=
YES
;
self
.
remarkTextView
.
font
=
GXF_FIFTEENTEN_SIZE
;
self
.
remarkTextView
.
textAlignment
=
NSTextAlignmentRight
;
self
.
remarkTextView
.
delegate
=
self
;
self
.
remarkTextView
.
returnKeyType
=
UIReturnKeyDone
;
self
.
remarkTextView
.
placeholder
=
@"输入备注内容"
;
[
cell
.
contentView
addSubview
:
self
.
remarkTextView
];
}
else
{
UILabel
*
contentLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
15
,
TableHeight
))];
...
...
@@ -181,9 +182,8 @@
self
.
remark
=
bill
.
remark
;
}
}
}
#warning 有点问题
-
(
void
)
prepareDataInCell
{
if
(
self
.
total
)
{
self
.
purchasePriceLabel
.
text
=
[
self
.
total
stringValue
];
...
...
@@ -192,7 +192,7 @@
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
2
){
ChooseVendorViewController
*
cvc
=
[
ChooseVendorViewController
new
];
cvc
.
chose
Vendor
=
^
(
NSArray
*
vendors
){
cvc
.
chose
BaseInfo
=
^
(
NSArray
*
vendors
){
if
(
vendors
.
count
>
0
)
{
Vendor
*
vendor
=
vendors
[
0
];
self
.
purchaseSupplierLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
vendor
.
name
,
vendor
.
code
];
...
...
@@ -207,7 +207,8 @@
[
self
.
delegate
pushNextViewController
:
cvc
];
}
else
if
(
indexPath
.
row
==
1
){
ChooseTypeViewController
*
tvc
=
[[
ChooseTypeViewController
alloc
]
init
];
tvc
.
choseType
=
^
(
NSString
*
type
){
tvc
.
choseBaseInfo
=
^
(
NSArray
*
types
){
NSString
*
type
=
types
[
0
];
self
.
purchaseTypeLabel
.
text
=
type
;
self
.
purchaseTypeLabel
.
textColor
=
GXF_CONTENT_COLOR
;
if
([
type
isEqualToString
:
@"紧急"
])
{
...
...
@@ -219,7 +220,8 @@
[
self
.
delegate
pushNextViewController
:
tvc
];
}
else
if
(
indexPath
.
row
==
3
){
ChooseWarehouseViewController
*
wvc
=
[[
ChooseWarehouseViewController
alloc
]
init
];
wvc
.
choseWarehouse
=
^
(
Warehouse
*
warehouse
){
wvc
.
choseBaseInfo
=
^
(
NSArray
*
warehouses
){
Warehouse
*
warehouse
=
warehouses
[
0
];
self
.
purchaseStoreLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
warehouse
.
name
,
warehouse
.
code
];
self
.
purchaseStoreLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
receiveWrh_uuid
=
warehouse
.
uuid
;
...
...
@@ -242,9 +244,7 @@
}
-
(
void
)
boxValueChanged
:
(
UITextField
*
)
textFiled
{
if
(
self
.
otherPriceFiled
.
text
.
length
>
0
)
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
SetProductTotalPrice
object
:
nil
];
}
}
...
...
XFFruit/ViewControllers/PurchaseNotice/NewPurchaseNoticeViewController.m
View file @
8938ec94
...
...
@@ -229,7 +229,7 @@
}
else
if
(
indexPath
.
row
==
1
){
ChosePersonViewController
*
cvc
=
[
ChosePersonViewController
new
];
cvc
.
chose
Person
=
^
(
NSArray
*
users
){
cvc
.
chose
BaseInfo
=
^
(
NSArray
*
users
){
NSString
*
textStr
=
@""
;
if
(
self
.
users
.
count
<=
0
)
{
[
self
.
users
removeAllObjects
];
...
...
XFFruit/ViewControllers/PurchaseNotice/ShopDetaileViewController.m
View file @
8938ec94
...
...
@@ -381,7 +381,7 @@ typedef enum : NSUInteger {
[
self
startDatePickView
];
}
else
if
(
indexPath
.
row
==
4
){
ChosePersonViewController
*
cvc
=
[
ChosePersonViewController
new
];
cvc
.
chose
Person
=
^
(
NSArray
*
users
){
cvc
.
chose
BaseInfo
=
^
(
NSArray
*
users
){
NSString
*
textStr
=
@""
;
if
(
self
.
users
.
count
<=
0
)
{
[
self
.
users
removeAllObjects
];
...
...
@@ -401,7 +401,8 @@ typedef enum : NSUInteger {
[
self
PushViewController
:
cvc
animated
:
YES
];
}
else
if
(
indexPath
.
row
==
1
){
ChooseProductViewController
*
cvc
=
[
ChooseProductViewController
new
];
cvc
.
choseProduct
=
^
(
Product
*
product
){
cvc
.
choseBaseInfo
=
^
(
NSArray
*
products
){
Product
*
product
=
products
[
0
];
_productLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
product
.
name
,
product
.
code
];
_productLabel
.
textColor
=
HexColor
(
@"444444"
);
self
.
productNameStr
=
product
.
name
;
...
...
XFFruit/ViewControllers/Survey/Transport/Controllers/NewTransportViewController.h
0 → 100644
View file @
8938ec94
//
// NewTransportViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "Transport.h"
@interface
NewTransportViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
Transport
*
transport
;
@end
XFFruit/ViewControllers/Survey/Transport/Controllers/NewTransportViewController.m
0 → 100644
View file @
8938ec94
//
// NewTransportViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "NewTransportViewController.h"
#import "TopTransportView.h"
#import "BottomTransportView.h"
#import "TransportPurchaseViewController.h"
#import "PurchaseBillProduct.h"
#import "FeeAcountDetail.h"
typedef
enum
:
NSUInteger
{
SaveTag
=
7000
,
CommitTag
,
}
BtnTag
;
#define TopHeight 284
#define BottomHeight 300
#define SpaceHeight 20
#define BottomViewHeight 60
@interface
NewTransportViewController
()
<
TopTransportViewDelegate
,
UIScrollViewDelegate
>
{
UIScrollView
*
_scrollView
;
TopTransportView
*
_sheetView
;
BottomTransportView
*
_bottomView
;
id
uuidObject
;
id
billNumberObject
;
NSNumber
*
versionObject
;
}
@end
@implementation
NewTransportViewController
-
(
instancetype
)
init
{
self
=
[
super
init
];
if
(
self
)
{
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
choseTransportPurchase
)
name
:
@"ChoseTransportPurchase"
object
:
nil
];
}
return
self
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
title
=
@"新建发运单"
;
//布局
[
self
bulidLayout
];
uuidObject
=
[
NSNull
null
];
billNumberObject
=
[
NSNull
null
];
versionObject
=
[
NSNumber
numberWithInteger
:
0
];
// if (self.purchaseBill) {
// [self getDataFromServer];
// }
}
-
(
void
)
bulidLayout
{
self
.
view
.
backgroundColor
=
XXFBgColor
;
_scrollView
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
BottomViewHeight
)];
_scrollView
.
showsHorizontalScrollIndicator
=
NO
;
_scrollView
.
showsVerticalScrollIndicator
=
NO
;
_scrollView
.
contentSize
=
CGSizeMake
(
ScreenSize
.
width
,
TopHeight
+
BottomHeight
+
SpaceHeight
*
2
);
[
self
.
view
addSubview
:
_scrollView
];
UIView
*
footView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
ScreenSize
.
height
-
BottomViewHeight
-
64
,
ScreenSize
.
width
,
BottomViewHeight
)];
UIButton
*
saveBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
15
,
8
,
(
ScreenSize
.
width
-
15
*
3
)
/
2
,
44
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
SaveTag
image
:
nil
title
:
@"保存"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
GXF_SAVE_COLOR
];
[
footView
addSubview
:
saveBtn
];
UIButton
*
commitBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
saveBtn
.
frame
)
+
15
,
8
,
(
ScreenSize
.
width
-
15
*
3
)
/
2
,
44
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
CommitTag
image
:
nil
title
:
@"提交"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
5
bgColor
:
GXF_COMMIT_COLOR
];
[
footView
addSubview
:
commitBtn
];
[
self
.
view
addSubview
:
footView
];
_sheetView
=
[[
TopTransportView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
TopHeight
)];
_sheetView
.
delegate
=
self
;
[
_scrollView
addSubview
:
_sheetView
];
_bottomView
=
[[
BottomTransportView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_sheetView
.
frame
)
+
20
,
ScreenSize
.
width
,
BottomHeight
)];
_bottomView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_scrollView
addSubview
:
_bottomView
];
}
-
(
void
)
btnClick
:
(
UIButton
*
)
btn
{
switch
(
btn
.
tag
)
{
case
SaveTag
:
{
if
([
self
checkTransport
])
{
[
self
getDataFromServer
:
PURCHASE_STATE_INITIAL
msg
:
@"正在保存..."
];
}
}
break
;
case
CommitTag
:{
if
([
self
checkTransport
])
{
[
self
getDataFromServer
:
PURCHASE_STATE_SUBMITTED
msg
:
@"正在提交..."
];
}
}
break
;
default
:
break
;
}
}
-
(
void
)
getDataFromServer
:
(
NSString
*
)
state
msg
:
(
NSString
*
)
msg
{
//保存
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
];
if
(
success
==
1
)
{
//成功
if
([
state
isEqualToString
:
PURCHASE_STATE_INITIAL
])
{
//保存成功
NSString
*
uuidS
=
data
[
@"data"
][
@"uuid"
];
NSString
*
billNumberS
=
data
[
@"data"
][
@"billNumber"
];
NSNumber
*
versionN
=
data
[
@"data"
][
@"version"
];
uuidObject
=
uuidS
;
billNumberObject
=
billNumberS
;
versionObject
=
versionN
;
[
IBTLoadingView
showTips
:[
NSString
stringWithFormat
:
@"当前单据%@已保存成功"
,
billNumberS
]];
}
else
{
//提交成功
// PurchaseViewController *svc = [PurchaseViewController new];
// [self PushViewController:svc animated:YES];
}
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
if
(
self
.
transport
.
uuid
.
length
>
0
&&
uuidObject
==
[
NSNull
null
]){
uuidObject
=
self
.
transport
.
uuid
;
}
if
(
self
.
transport
.
billnumber
>
0
&&
billNumberObject
==
[
NSNull
null
])
{
billNumberObject
=
self
.
transport
.
billnumber
;
}
// if (self.purchaseBill && [versionObject integerValue] == 0) {
// versionObject = self.transport.version;
// }
NSMutableArray
*
billProducts
=
[
NSMutableArray
array
];
for
(
PurchaseBillProduct
*
billProduct
in
_bottomView
.
productVC
.
productArr
)
{
[
billProducts
addObject
:[
billProduct
dictForCommit
]];
}
NSMutableArray
*
costs
=
[
NSMutableArray
array
];
for
(
FeeAcountDetail
*
fee
in
_bottomView
.
costVC
.
costArr
)
{
[
costs
addObject
:[
fee
dictForCommit
]];
}
// self.state = state;
NSDictionary
*
dict
=
@{
@"uuid"
:
uuidObject
,
// @"version":versionObject,
@"billnumber"
:
billNumberObject
,
@"state"
:
state
,
@"warehouseUuid"
:
[
IBTCommon
checkString
:
_sheetView
.
warehouseUuid
],
@"warehouseCode"
:
[
IBTCommon
checkString
:
_sheetView
.
warehouseCode
],
@"warehouseName"
:
[
IBTCommon
checkString
:
_sheetView
.
warehouseName
],
@"rwarehouseUuid"
:
[
IBTCommon
checkString
:
_sheetView
.
rwarehouseUuid
],
@"rwarehouseCode"
:
[
IBTCommon
checkString
:
_sheetView
.
rwarehouseCode
],
@"rwarehouseName"
:
[
IBTCommon
checkString
:
_sheetView
.
rwarehouseName
],
@"carnumber"
:
[
IBTCommon
checkString
:
_sheetView
.
carnumber
],
@"type"
:
[
IBTCommon
checkString
:
_sheetView
.
type
],
@"carphone"
:
[
IBTCommon
checkString
:
_sheetView
.
carphone
],
@"note"
:
_sheetView
.
note
,
@"pdtDetails"
:
billProducts
,
@"accountDetails"
:
costs
};
[
IBTLoadingView
showProgressLabel
:
msg
];
[[
ICRHTTPController
sharedController
]
savePurchaseWithData
:
dict
success
:
succ
failure
:
fail
];
}
-
(
BOOL
)
checkTransport
{
_sheetView
.
note
=
_sheetView
.
remarkTextView
.
text
;
_sheetView
.
carnumber
=
_sheetView
.
carTextFiled
.
text
;
_sheetView
.
carphone
=
_sheetView
.
phoneTextFiled
.
text
;
if
(
_sheetView
.
warehouseName
.
length
==
0
)
{
ShowMessage
(
@"发货仓库不能为空"
);
return
NO
;
}
if
(
_sheetView
.
rwarehouseUuid
.
length
==
0
)
{
ShowMessage
(
@"收货仓库不能为空"
);
return
NO
;
}
if
(
_sheetView
.
type
.
length
==
0
)
{
ShowMessage
(
@"运输类型不能为空"
);
return
NO
;
}
if
(
_sheetView
.
carnumber
.
length
==
0
)
{
ShowMessage
(
@"车牌号不能为空"
);
return
NO
;
}
if
(
_sheetView
.
carphone
.
length
==
0
)
{
ShowMessage
(
@"司机电话不能为空"
);
return
NO
;
}
if
(
_bottomView
.
productVC
.
productArr
.
count
==
0
)
{
ShowMessage
(
@"商品不能为空"
);
return
NO
;
}
if
(
_bottomView
.
costVC
.
costArr
.
count
==
0
)
{
ShowMessage
(
@"费用不能为空"
);
return
NO
;
}
return
YES
;
}
-
(
void
)
choseTransportPurchase
{
TransportPurchaseViewController
*
tpv
=
[
TransportPurchaseViewController
new
];
tpv
.
getProchaseProduct
=
^
(
NSArray
*
products
){
[
_bottomView
refreshProduct
:
products
];
};
[
self
PushViewController
:
tpv
animated
:
YES
];
}
#pragma mark - TopPurchaseViewDelegate
-
(
void
)
pushNextViewController
:
(
id
)
vc
{
[
self
PushViewController
:
vc
animated
:
YES
];
}
#pragma mark - 协议方法
-
(
void
)
hiddenKeyBoard
{
[
self
keyboardHidden
];
}
-
(
void
)
keyboardHidden
{
[
_sheetView
.
phoneTextFiled
resignFirstResponder
];
[
_sheetView
.
carTextFiled
resignFirstResponder
];
[
_sheetView
.
remarkTextView
resignFirstResponder
];
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
XFFruit/ViewControllers/Survey/Transport/Controllers/TransportPurchaseViewController.h
0 → 100644
View file @
8938ec94
//
// TransportPurchaseViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
typedef
void
(
^
GetPurchaseProduct
)(
NSArray
*
products
);
@interface
TransportPurchaseViewController
:
ICRBaseViewController
@property
(
nonatomic
,
copy
)
GetPurchaseProduct
getProchaseProduct
;
@end
XFFruit/ViewControllers/Survey/Transport/Controllers/TransportPurchaseViewController.m
0 → 100644
View file @
8938ec94
//
// TransportPurchaseViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransportPurchaseViewController.h"
#import "TransportPurchaseCell.h"
#import "QueryOrder.h"
#define TopMargin 50
#define TableHeight 50
@interface
TransportPurchaseViewController
()
<
UITextFieldDelegate
,
UITableViewDataSource
,
UITableViewDelegate
>
@property
(
nonatomic
,
strong
)
NSMutableArray
*
indexArr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
UITextField
*
selectTextFiled
;
@end
@implementation
TransportPurchaseViewController
-
(
instancetype
)
init
{
self
=
[
super
init
];
if
(
self
)
{
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
getSelectPurchaseProduct
:
)
name
:
KNOTIFICATION_getSelectPurchaseProduct
object
:
nil
];
}
return
self
;
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
title
=
@"选择采购单"
;
[
self
initData
];
[
self
bulidLayout
];
[
self
getData
];
}
-
(
void
)
initData
{
self
.
dataArr
=
[
NSMutableArray
array
];
self
.
indexArr
=
[
NSMutableArray
array
];
}
-
(
void
)
getData
{
[
ICRUserUtil
sharedInstance
].
needFresh
=
NO
;
__weak
typeof
(
self
)
weakSelf
=
self
;
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
[
strongSelf
fetchtPuchaseList
:
data
];
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
ICRUserUtil
*
userUtil
=
[
ICRUserUtil
sharedInstance
];
NSMutableArray
*
orderArr
=
[
NSMutableArray
array
];
if
(
orderArr
.
count
==
0
)
{
QueryOrder
*
order
=
[
QueryOrder
new
];
order
.
field
=
@"billNumber"
;
order
.
direction
=
@"desc"
;
[
orderArr
addObject
:[
order
dictForCommit
]];
}
NSDictionary
*
dict
=
@{
@"state"
:
@"submitted"
,
@"queryOrders"
:
orderArr
,
@"userUuid"
:
userUtil
.
userId
,
@"pageNumber"
:
@
(
0
),
@"pageSize"
:
@
(
20
)};
[[
ICRHTTPController
sharedController
]
queryPurchaseWithData
:
dict
success
:
succ
failure
:
fail
];
}
-
(
void
)
fetchtPuchaseList
:
(
id
)
data
{
if
(
data
)
{
NSInteger
success
=
[
data
[
@"success"
]
integerValue
];
NSString
*
message
=
data
[
@"message"
]
;
if
(
success
==
1
)
{
NSArray
*
recodesArr
=
data
[
@"data"
][
@"records"
];
for
(
NSDictionary
*
purchaseBillDict
in
recodesArr
)
{
PurchaseBill
*
purchaseBill
=
[[
PurchaseBill
alloc
]
init
];
[
purchaseBill
setValuesForKeysWithDictionary
:
purchaseBillDict
];
[
self
.
dataArr
addObject
:
purchaseBill
];
}
[
self
.
tableView
reloadData
];
}
else
{
[
IBTLoadingView
showTips
:
message
];
}
}
else
{
[
IBTLoadingView
showTips
:
@" 无记录 "
];
}
}
#pragma mark - 布局
-
(
void
)
bulidLayout
{
self
.
selectTextFiled
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
20
,
5
,
ScreenSize
.
width
-
40
,
TopMargin
-
10
)];
self
.
selectTextFiled
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
selectTextFiled
.
background
=
[
UIImage
imageNamed
:
@"textFiled"
];
self
.
selectTextFiled
.
delegate
=
self
;
self
.
selectTextFiled
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
self
.
view
addSubview
:
self
.
selectTextFiled
];
UIImageView
*
leftView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
35
,
40
)];
leftView
.
image
=
[
UIImage
imageNamed
:
@"search"
];
self
.
selectTextFiled
.
leftView
=
leftView
;
self
.
selectTextFiled
.
leftViewMode
=
UITextFieldViewModeAlways
;
UIButton
*
rightView
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
rightView
setImage
:[
UIImage
imageNamed
:
@"delete"
]
forState
:
UIControlStateNormal
];
rightView
.
frame
=
CGRectMake
(
0
,
0
,
35
,
40
);
[
rightView
addTarget
:
self
action
:
@selector
(
deleteTextFieldStr
)
forControlEvents
:
UIControlEventTouchUpInside
];
self
.
selectTextFiled
.
rightView
=
rightView
;
self
.
selectTextFiled
.
rightViewMode
=
UITextFieldViewModeAlways
;
self
.
tableView
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
ScreenSize
.
height
-
64
-
TopMargin
))
style
:(
UITableViewStylePlain
)];
self
.
tableView
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
self
.
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
[
self
.
view
addSubview
:
self
.
tableView
];
UIBarButtonItem
*
rightItem
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:
@"确定"
style
:
UIBarButtonItemStylePlain
target
:
self
action
:
@selector
(
sureClick
)];
self
.
navigationItem
.
rightBarButtonItem
=
rightItem
;
}
-
(
void
)
deleteTextFieldStr
{
self
.
selectTextFiled
.
text
=
@""
;
}
#pragma mark - 协议方法
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
dataArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"TransPortPurchase"
;
TransportPurchaseCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
TransportPurchaseCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
}
if
(
self
.
dataArr
.
count
>
0
){
PurchaseBill
*
bill
=
_dataArr
[
indexPath
.
row
];
NSMutableArray
*
arr
=
[
NSMutableArray
array
];
PurchaseBillProduct
*
billProduct
=
[
PurchaseBillProduct
new
];
billProduct
.
product_name
=
@"dd"
;
billProduct
.
product_uuid
=
@"402880e64e287fe2014e28895b8a0032"
;
billProduct
.
product_code
=
@"农夫山泉"
;
billProduct
.
qpc
=
[
NSNumber
numberWithFloat
:
22
];
billProduct
.
unit
=
@"筐"
;
billProduct
.
qty
=
[
NSNumber
numberWithFloat
:
23
];
billProduct
.
price
=
[
NSNumber
numberWithFloat
:
333
];
billProduct
.
baseQty
=
[
NSNumber
numberWithFloat
:
333
];
billProduct
.
basePrice
=
[
NSNumber
numberWithFloat
:
33
];
billProduct
.
total
=
[
NSNumber
numberWithFloat
:
80
];
billProduct
.
remark
=
@"hshshshsh"
;
billProduct
.
qpcStr
=
@"fdsfdsfdsa"
;
[
arr
addObject
:
billProduct
];
[
arr
addObject
:
billProduct
];
bill
.
products
=
arr
;
cell
.
bill
=
bill
;
}
return
cell
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
200
;
}
#pragma mark - 按钮确定
-
(
void
)
sureClick
{
[
self
PopViewControllerAnimated
:
YES
];
if
(
self
.
indexArr
.
count
>
0
)
{
self
.
getProchaseProduct
(
self
.
indexArr
);
}
}
#pragma mark - 得到通知的方法
-
(
void
)
getSelectPurchaseProduct
:
(
NSNotification
*
)
fination
{
NSDictionary
*
dict
=
fination
.
userInfo
;
PurchaseBillProduct
*
billProduct
=
dict
[
@"selectArr"
];
NSString
*
state
=
dict
[
@"state"
];
if
([
state
isEqualToString
:
@"add"
])
{
[
self
.
indexArr
addObject
:
billProduct
];
}
else
{
[
self
.
indexArr
removeObject
:
billProduct
];
}
}
-
(
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/Survey/Transport/Models/FeeAcountDetail.h
0 → 100644
View file @
8938ec94
//
// FeeAcountDetail.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface
FeeAcountDetail
:
IBTModel
@property
(
nonatomic
,
strong
)
NSString
*
uuid
;
//唯一标识
@property
(
nonatomic
,
strong
)
NSString
*
accounttitle
;
//费用类型
@property
(
nonatomic
,
strong
)
NSString
*
accounttitlename
;
//费用类型名称
@property
(
nonatomic
,
strong
)
NSNumber
*
actualmoney
;
//应付总金额
@property
(
nonatomic
,
strong
)
NSNumber
*
paidmoney
;
//已付总金额
@property
(
nonatomic
,
strong
)
NSNumber
*
leftmoney
;
//尾款总金额
@property
(
nonatomic
,
strong
)
NSString
*
note
;
//备注
@end
XFFruit/ViewControllers/Survey/Transport/Models/FeeAcountDetail.m
0 → 100644
View file @
8938ec94
//
// FeeAcountDetail.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "FeeAcountDetail.h"
@implementation
FeeAcountDetail
@end
XFFruit/ViewControllers/Survey/Transport/Models/Transport.h
0 → 100644
View file @
8938ec94
//
// Transport.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface
Transport
:
IBTModel
@property
(
nonatomic
,
strong
)
NSString
*
uuid
;
//唯一标识
@property
(
nonatomic
,
strong
)
NSString
*
billnumber
;
//调研单号
@property
(
nonatomic
,
strong
)
NSString
*
warehouseUuid
;
//仓库id
@property
(
nonatomic
,
strong
)
NSString
*
warehouseCode
;
//仓库代码
@property
(
nonatomic
,
strong
)
NSString
*
warehouseName
;
//仓库名称
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseUuid
;
//收货仓库id
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseCode
;
//收货仓库代码
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseName
;
//收货仓库名称
@property
(
nonatomic
,
strong
)
NSString
*
carnumber
;
//车牌号
@property
(
nonatomic
,
strong
)
NSString
*
state
;
//状态
@property
(
nonatomic
,
strong
)
NSString
*
type
;
//类型
@property
(
nonatomic
,
strong
)
NSString
*
carphone
;
//司机电话
@property
(
nonatomic
,
strong
)
NSString
*
note
;
//备注
@property
(
nonatomic
,
strong
)
NSString
*
create_time
;
//创建时间
@property
(
nonatomic
,
strong
)
NSString
*
create_id
;
//创建人代码
@property
(
nonatomic
,
strong
)
NSString
*
create_operName
;
//create_operName
@property
(
nonatomic
,
strong
)
NSString
*
lastModified_time
;
//最后修改时间
@property
(
nonatomic
,
strong
)
NSString
*
lastModified_id
;
//最后修改人代码
@property
(
nonatomic
,
strong
)
NSString
*
lastModified_operName
;
//最后修改人名称
@end
XFFruit/ViewControllers/Survey/Transport/Models/Transport.m
0 → 100644
View file @
8938ec94
//
// Transport.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "Transport.h"
@implementation
Transport
@end
XFFruit/ViewControllers/Survey/Transport/Views/BottomTransportView.h
0 → 100644
View file @
8938ec94
//
// BottomTransportView.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ProductBillViewController.h"
#import "CostViewController.h"
@interface
BottomTransportView
:
UIView
@property
(
nonatomic
,
strong
)
ProductBillViewController
*
productVC
;
@property
(
nonatomic
,
strong
)
CostViewController
*
costVC
;
//刷新tableView
-
(
void
)
refreshProduct
:(
NSArray
*
)
productArr
;
-
(
void
)
refreshCost
:(
NSArray
*
)
costArr
;
@end
XFFruit/ViewControllers/Survey/Transport/Views/BottomTransportView.m
0 → 100644
View file @
8938ec94
//
// BottomTransportView.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "BottomTransportView.h"
#define ContentHeight 44
#define BtnWidth 100
#define BeginTag 8000
#define SpaceWidth (ScreenSize.width - 100*2)/3
@interface
BottomTransportView
()
<
UIScrollViewDelegate
>
{
UIScrollView
*
_bottomSV
;
UIImageView
*
_moveImageView
;
UIButton
*
_currentBtn
;
UIButton
*
_addBtn
;
}
@end
@implementation
BottomTransportView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
//界面
[
self
bulidLayout
];
}
return
self
;
}
#pragma mark - 布局
-
(
void
)
bulidLayout
{
[
self
addChildView
];
[
self
createBottomView
];
}
-
(
void
)
createBottomView
{
NSArray
*
arr
=
@[
@"商品明细"
,
@"费用明细"
];
_bottomSV
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
ContentHeight
+
4
,
ScreenSize
.
width
,
CGRectGetHeight
(
self
.
frame
)
-
ContentHeight
-
2
)];
_bottomSV
.
showsHorizontalScrollIndicator
=
NO
;
_bottomSV
.
showsVerticalScrollIndicator
=
NO
;
_bottomSV
.
pagingEnabled
=
YES
;
_bottomSV
.
delegate
=
self
;
_bottomSV
.
backgroundColor
=
[
UIColor
yellowColor
];
_bottomSV
.
contentSize
=
CGSizeMake
(
ScreenSize
.
width
*
arr
.
count
,
CGRectGetHeight
(
_bottomSV
.
frame
));
[
self
addSubview
:
_bottomSV
];
for
(
NSInteger
i
=
0
;
i
<
arr
.
count
;
i
++
)
{
UIButton
*
btn
=
[
UIButton
buttonWithType
:
UIButtonTypeSystem
];
[
btn
setTitle
:
arr
[
i
]
forState
:
UIControlStateNormal
];
btn
.
frame
=
CGRectMake
(
SpaceWidth
+
(
BtnWidth
+
SpaceWidth
)
*
i
,
0
,
BtnWidth
,
ContentHeight
);
[
btn
setTitleColor
:
GXF_CONTENT_COLOR
forState
:
UIControlStateNormal
];
[
btn
setTitleColor
:
GXF_SAVE_COLOR
forState
:
UIControlStateDisabled
];
btn
.
titleLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
btn
.
tag
=
i
+
BeginTag
;
[
btn
addTarget
:
self
action
:
@selector
(
btnClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
addSubview
:
btn
];
UIView
*
view
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetWidth
(
_bottomSV
.
frame
)
*
i
,
0
,
CGRectGetWidth
(
_bottomSV
.
frame
),
CGRectGetHeight
(
_bottomSV
.
frame
))];
if
(
i
==
0
)
{
view
.
backgroundColor
=
[
UIColor
redColor
];
self
.
productVC
.
viewFrame
=
view
.
bounds
;
[
view
addSubview
:
self
.
productVC
.
view
];
}
else
if
(
i
==
1
){
self
.
costVC
.
viewFrame
=
view
.
bounds
;
[
view
addSubview
:
self
.
costVC
.
view
];
view
.
backgroundColor
=
[
UIColor
blueColor
];
}
[
_bottomSV
addSubview
:
view
];
}
_moveImageView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
SpaceWidth
,
ContentHeight
,
BtnWidth
,
4
)];
_moveImageView
.
image
=
[
UIImage
imageNamed
:
@"tab_line"
];
UILabel
*
lineLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
ContentHeight
+
1
,
ScreenSize
.
width
,
1
))];
lineLabel
.
backgroundColor
=
GXF_LINE_COLOR
;
lineLabel
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
self
addSubview
:
lineLabel
];
[
self
addSubview
:
_moveImageView
];
}
-
(
void
)
addChildView
{
self
.
productVC
=
[[
ProductBillViewController
alloc
]
init
];
self
.
productVC
.
twoTitle
=
@"+选择采购单"
;
self
.
costVC
=
[[
CostViewController
alloc
]
init
];
}
-
(
void
)
btnClick
:
(
UIButton
*
)
btn
{
NSInteger
index
=
btn
.
tag
-
BeginTag
;
_currentBtn
.
enabled
=
YES
;
btn
.
enabled
=
NO
;
_currentBtn
=
btn
;
[
UIView
animateWithDuration
:
0
.
5
animations
:
^
{
CGRect
moveFrame
=
_moveImageView
.
frame
;
moveFrame
.
origin
.
x
=
SpaceWidth
+
(
BtnWidth
+
SpaceWidth
)
*
index
;
_moveImageView
.
frame
=
moveFrame
;
_bottomSV
.
contentOffset
=
CGPointMake
(
index
*
self
.
frame
.
size
.
width
,
0
);
}];
}
-
(
void
)
scrollViewDidEndDecelerating
:
(
UIScrollView
*
)
scrollView
{
CGFloat
offsetX
=
scrollView
.
contentOffset
.
x
/
self
.
frame
.
size
.
width
;
[
UIView
animateWithDuration
:
0
.
5
animations
:
^
{
CGRect
moveFrame
=
_moveImageView
.
frame
;
moveFrame
.
origin
.
x
=
SpaceWidth
+
(
BtnWidth
+
SpaceWidth
)
*
offsetX
;
_moveImageView
.
frame
=
moveFrame
;
}];
_currentBtn
.
enabled
=
YES
;
UIButton
*
btn
=
(
UIButton
*
)
[
self
viewWithTag
:
offsetX
+
BeginTag
];
btn
.
enabled
=
NO
;
_currentBtn
=
btn
;
}
-
(
void
)
refreshProduct
:
(
NSArray
*
)
productArr
{
if
(
self
.
productVC
.
productArr
)
{
[
self
.
productVC
.
productArr
addObjectsFromArray
:
productArr
];
[
self
.
productVC
.
tableView
reloadData
];
}
}
-
(
void
)
refreshCost
:
(
NSArray
*
)
costArr
{
}
@end
XFFruit/ViewControllers/Survey/Transport/Views/TopTransportView.h
0 → 100644
View file @
8938ec94
//
// TopTransportView.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "HPGrowingTextView.h"
@protocol
TopTransportViewDelegate
<
NSObject
>
-
(
void
)
hiddenKeyBoard
;
-
(
void
)
pushNextViewController
:(
id
)
vc
;
@end
@interface
TopTransportView
:
UIView
@property
(
nonatomic
,
strong
)
UILabel
*
rwarehouseLabel
;
//收货仓库
@property
(
nonatomic
,
strong
)
UILabel
*
warehouseLabel
;
//发货仓库
@property
(
nonatomic
,
strong
)
UITextField
*
carTextFiled
;
//车辆
@property
(
nonatomic
,
strong
)
UILabel
*
typeLabel
;
//运输类型
@property
(
nonatomic
,
strong
)
UITextField
*
phoneTextFiled
;
//电话
@property
(
nonatomic
,
strong
)
HPGrowingTextView
*
remarkTextView
;
//备注
@property
(
nonatomic
,
weak
)
id
<
TopTransportViewDelegate
>
delegate
;
@property
(
nonatomic
,
strong
)
NSString
*
warehouseUuid
;
@property
(
nonatomic
,
strong
)
NSString
*
warehouseCode
;
@property
(
nonatomic
,
strong
)
NSString
*
warehouseName
;
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseUuid
;
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseCode
;
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseName
;
@property
(
nonatomic
,
strong
)
NSString
*
carnumber
;
@property
(
nonatomic
,
strong
)
NSString
*
type
;
@property
(
nonatomic
,
strong
)
NSString
*
carphone
;
@property
(
nonatomic
,
strong
)
NSString
*
note
;
@end
XFFruit/ViewControllers/Survey/Transport/Views/TopTransportView.m
0 → 100644
View file @
8938ec94
//
// TopTransportView.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TopTransportView.h"
#import "SurveyCell.h"
#import "Warehouse.h"
#import "ChooseWarehouseViewController.h"
#import "ChooseTypeViewController.h"
#define LeftMargin 15
#define TopMargin 20
#define LeftWidth 80
#define TableHeight 44
#define SpaceHeight 10
@interface
TopTransportView
()
<
UITableViewDataSource
,
UITableViewDelegate
,
HPGrowingTextViewDelegate
,
UITextFieldDelegate
>
{
UITableView
*
_tableView
;
NSMutableArray
*
_dataArr
;
}
@end
@implementation
TopTransportView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
//界面
[
self
bulidLayout
];
}
return
self
;
}
#pragma mark - 布局
-
(
void
)
bulidLayout
{
self
.
backgroundColor
=
XXFBgColor
;
_dataArr
=
[
NSMutableArray
array
];
NSArray
*
arr
=
@[
@"发货仓库:"
,
@"收货仓库:"
,
@"运输类型:"
,
@"车辆:"
,
@"司机电话:"
,
@"备注:"
];
[
_dataArr
addObjectsFromArray
:
arr
];
_tableView
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
TopMargin
,
self
.
frame
.
size
.
width
,
self
.
frame
.
size
.
height
-
TopMargin
))
style
:(
UITableViewStylePlain
)];
_tableView
.
backgroundColor
=
[
UIColor
whiteColor
];
_tableView
.
bounces
=
NO
;
_tableView
.
delegate
=
self
;
_tableView
.
dataSource
=
self
;
[
self
addSubview
:
_tableView
];
}
#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
||
indexPath
.
row
==
2
)
{
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
==
3
||
indexPath
.
row
==
4
)
{
UITextField
*
textField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
)];
textField
.
textAlignment
=
NSTextAlignmentRight
;
textField
.
textColor
=
GXF_CONTENT_COLOR
;
textField
.
font
=
GXF_FIFTEENTEN_SIZE
;
textField
.
returnKeyType
=
UIReturnKeyDone
;
textField
.
delegate
=
self
;
[
cell
.
contentView
addSubview
:
textField
];
if
(
indexPath
.
row
==
3
)
{
self
.
carTextFiled
=
textField
;
self
.
carTextFiled
.
placeholder
=
@"请输入车辆"
;
}
else
if
(
indexPath
.
row
==
4
){
textField
.
keyboardType
=
UIKeyboardTypeNumbersAndPunctuation
;
textField
.
returnKeyType
=
UIReturnKeyDone
;
self
.
phoneTextFiled
=
textField
;
self
.
phoneTextFiled
.
placeholder
=
@"请输入司机电话"
;
}
}
else
if
(
indexPath
.
row
==
_dataArr
.
count
-
1
){
self
.
remarkTextView
=
[[
HPGrowingTextView
alloc
]
initWithFrame
:
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
)];
self
.
remarkTextView
.
contentInset
=
UIEdgeInsetsMake
(
5
,
5
,
5
,
0
);
self
.
remarkTextView
.
minNumberOfLines
=
1
;
self
.
remarkTextView
.
maxNumberOfLines
=
1
;
self
.
remarkTextView
.
isScrollable
=
YES
;
self
.
remarkTextView
.
font
=
GXF_FIFTEENTEN_SIZE
;
self
.
remarkTextView
.
textAlignment
=
NSTextAlignmentRight
;
self
.
remarkTextView
.
delegate
=
self
;
self
.
remarkTextView
.
returnKeyType
=
UIReturnKeyDone
;
self
.
remarkTextView
.
placeholder
=
@"输入备注内容"
;
[
cell
.
contentView
addSubview
:
self
.
remarkTextView
];
}
else
{
UILabel
*
contentLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
100
+
LeftMargin
,
0
,
ScreenSize
.
width
-
100
-
LeftMargin
*
2
-
10
,
TableHeight
))];
contentLabel
.
textAlignment
=
NSTextAlignmentRight
;
contentLabel
.
textColor
=
GXF_PLACEHOLDER_COLOR
;
contentLabel
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
cell
.
contentView
addSubview
:
contentLabel
];
if
(
indexPath
.
row
==
0
)
{
contentLabel
.
text
=
@"选择发货仓库"
;
self
.
warehouseLabel
=
contentLabel
;
}
else
if
(
indexPath
.
row
==
1
){
contentLabel
.
text
=
@"选择收货仓库"
;
self
.
rwarehouseLabel
=
contentLabel
;
}
else
if
(
indexPath
.
row
==
2
){
contentLabel
.
text
=
@"选择类型"
;
self
.
typeLabel
=
contentLabel
;
}
}
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
0
){
ChooseWarehouseViewController
*
cvc
=
[
ChooseWarehouseViewController
new
];
cvc
.
choseBaseInfo
=
^
(
NSArray
*
warehouses
){
if
(
warehouses
.
count
>
0
)
{
Warehouse
*
warehouse
=
warehouses
[
0
];
self
.
warehouseLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
warehouse
.
name
,
warehouse
.
code
];
self
.
warehouseLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
warehouseUuid
=
warehouse
.
uuid
;
self
.
warehouseCode
=
warehouse
.
code
;
self
.
warehouseName
=
warehouse
.
name
;
}
};
cvc
.
isMoreChose
=
NO
;
[
self
.
delegate
pushNextViewController
:
cvc
];
}
else
if
(
indexPath
.
row
==
1
){
ChooseWarehouseViewController
*
tvc
=
[[
ChooseWarehouseViewController
alloc
]
init
];
tvc
.
choseBaseInfo
=
^
(
NSArray
*
warehouses
){
if
(
warehouses
.
count
>
0
)
{
Warehouse
*
warehouse
=
warehouses
[
0
];
self
.
rwarehouseLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
warehouse
.
name
,
warehouse
.
code
];
self
.
rwarehouseLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
rwarehouseUuid
=
warehouse
.
uuid
;
self
.
rwarehouseCode
=
warehouse
.
code
;
self
.
rwarehouseName
=
warehouse
.
name
;
}
};
[
self
.
delegate
pushNextViewController
:
tvc
];
}
else
if
(
indexPath
.
row
==
2
){
ChooseTypeViewController
*
tvc
=
[[
ChooseTypeViewController
alloc
]
init
];
tvc
.
choseBaseInfo
=
^
(
NSArray
*
types
){
if
(
types
.
count
>
0
)
{
NSString
*
type
=
types
[
0
];
self
.
typeLabel
.
text
=
[
type
isEqualToString
:
GXF_Critical
]
?
@"紧急"
:
@"普通"
;
self
.
typeLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
type
=
type
;
}
};
[
self
.
delegate
pushNextViewController
:
tvc
];
}
}
-
(
BOOL
)
growingTextViewShouldReturn
:
(
HPGrowingTextView
*
)
growingTextView
{
[
self
.
remarkTextView
resignFirstResponder
];
return
YES
;
}
-
(
BOOL
)
textFieldShouldReturn
:
(
UITextField
*
)
textField
{
[
self
.
delegate
hiddenKeyBoard
];
return
YES
;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
XFFruit/ViewControllers/Survey/Transport/Views/TransportPurchaseCell.h
0 → 100644
View file @
8938ec94
//
// TransportPurchaseCell.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ProductBillCell.h"
#import "PurchaseBill.h"
@interface
TransportPurchaseCell
:
UITableViewCell
<
UITableViewDataSource
,
UITableViewDelegate
>
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
lineLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
secondLabel
;
@property
(
nonatomic
,
strong
)
UITableView
*
secondTable
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
secondArr
;
@property
(
nonatomic
,
strong
)
PurchaseBill
*
bill
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
indexArr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
selectArr
;
@end
XFFruit/ViewControllers/Survey/Transport/Views/TransportPurchaseCell.m
0 → 100644
View file @
8938ec94
//
// TransportPurchaseCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransportPurchaseCell.h"
#import "PurchaseBillProduct.h"
#import "HeaderCell.h"
@implementation
TransportPurchaseCell
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
];
if
(
self
)
{
[
self
bulidLayout
];
}
return
self
;
}
-
(
void
)
bulidLayout
{
self
.
lineLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
1
))];;
self
.
lineLabel
.
backgroundColor
=
GXF_LINE_COLOR
;
self
.
titleLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
44
))];
self
.
titleLabel
.
textAlignment
=
NSTextAlignmentCenter
;
self
.
titleLabel
.
textColor
=
GXF_NAVIGAYION_COLOR
;
self
.
titleLabel
.
text
=
@"苹果桃子"
;
self
.
titleLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
secondLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
44
-
1
,
ScreenSize
.
width
,
1
))];;
self
.
secondLabel
.
backgroundColor
=
GXF_LINE_COLOR
;
[
self
.
contentView
addSubview
:
self
.
titleLabel
];
[
self
.
contentView
addSubview
:
self
.
lineLabel
];
[
self
.
contentView
addSubview
:
self
.
secondLabel
];
}
-
(
void
)
setBill
:
(
PurchaseBill
*
)
bill
{
self
.
titleLabel
.
text
=
[
NSString
stringWithFormat
:
@"[采购单:%@]"
,
bill
.
billNumber
];
self
.
secondArr
=
[
NSMutableArray
array
];
self
.
selectArr
=
[
NSMutableArray
array
];
[
self
.
secondArr
addObjectsFromArray
:
bill
.
products
];
// for (NSDictionary *billDict in bill.products) {
// PurchaseBillProduct *billProcuct = [PurchaseBillProduct new];
// [billProcuct setValuesForKeysWithDictionary:billDict];
// [self.secondArr addObject:billProcuct];
// }
self
.
secondTable
=
[[
UITableView
alloc
]
initWithFrame
:(
CGRectMake
(
0
,
44
,
ScreenSize
.
width
,
200
-
44
))
style
:(
UITableViewStylePlain
)];
self
.
secondTable
.
delegate
=
self
;
self
.
secondTable
.
dataSource
=
self
;
self
.
secondTable
.
bounces
=
NO
;
self
.
secondTable
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
[
self
.
contentView
addSubview
:
self
.
secondTable
];
NSArray
*
arr
=
@[
@"商品"
,
@"单价"
,
@"包装数量"
];
HeaderCell
*
headCell
=
[[
HeaderCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
38
)
withArr
:
arr
];
self
.
secondTable
.
tableHeaderView
=
headCell
;
//重要
[
self
.
secondTable
reloadData
];
}
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
secondArr
.
count
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"ProductBillCell"
;
ProductBillCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
if
(
cell
==
nil
)
{
cell
=
[[
ProductBillCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
];
cell
.
editBtn
.
hidden
=
YES
;
}
PurchaseBillProduct
*
billProduct
=
self
.
secondArr
[
indexPath
.
row
];
[
cell
setBillProduct
:
billProduct
row
:
indexPath
.
row
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
ProductBillCell
*
cell
=
(
ProductBillCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
PurchaseBillProduct
*
billProduct
=
self
.
secondArr
[
indexPath
.
row
];
if
(
!
[
self
isHaveIndexPath
:
indexPath
])
{
cell
.
editBtn
.
hidden
=
NO
;
[
self
.
selectArr
addObject
:
indexPath
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_getSelectPurchaseProduct
object
:
nil
userInfo
:
@{
@"selectArr"
:
billProduct
,
@"state"
:
@"add"
}];
}
else
{
[
self
.
selectArr
removeObject
:
indexPath
];
cell
.
editBtn
.
hidden
=
YES
;
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
KNOTIFICATION_getSelectPurchaseProduct
object
:
nil
userInfo
:
@{
@"selectArr"
:
billProduct
,
@"state"
:
@"remove"
}];
}
;
}
-
(
BOOL
)
isHaveIndexPath
:
(
NSIndexPath
*
)
indexPath
{
for
(
NSIndexPath
*
path
in
self
.
selectArr
)
{
if
(
path
.
row
==
indexPath
.
row
)
{
return
YES
;
}
}
return
NO
;
}
-
(
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/Survey/Transport/Views/TransportPurductCell.h
0 → 100644
View file @
8938ec94
//
// TransportPurductCell.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
TransportPurductCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UIImageView
*
smallImageView
;
@property
(
nonatomic
,
strong
)
UIButton
*
editBtn
;
@property
(
nonatomic
,
strong
)
UILabel
*
seqLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
standLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
countLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
baseCountLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
lineLabel
;
@end
XFFruit/ViewControllers/Survey/Transport/Views/TransportPurductCell.m
0 → 100644
View file @
8938ec94
//
// TransportPurductCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransportPurductCell.h"
#define LeftMargin 13
#define TableHeight 44
#define SmallSize 10
#define SmallWidth 20
#define SpaceMargin 1
#define LeftWidth 40
#define ShowWidth 150
#define ShowHeight 20
@implementation
TransportPurductCell
-
(
instancetype
)
initWithStyle
:(
UITableViewCellStyle
)
style
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
self
=
[
super
initWithStyle
:
style
reuseIdentifier
:
reuseIdentifier
];
if
(
self
)
{
[
self
bulidLayout
];
}
return
self
;
}
-
(
void
)
bulidLayout
{
CGFloat
headWidth
=
(
ScreenSize
.
width
-
LeftWidth
*
2
-
SpaceMargin
*
(
4
-
1
))
/
4
;
self
.
seqLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
0
,
SmallWidth
,
TableHeight
))];
self
.
seqLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
seqLabel
.
text
=
@"13"
;
self
.
seqLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
titleLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftWidth
,
0
,
headWidth
,
TableHeight
))];
self
.
titleLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
titleLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
titleLabel
.
text
=
@"苹果桃子"
;
self
.
titleLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
standLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMaxX
(
self
.
titleLabel
.
frame
)
+
SpaceMargin
,
0
,
headWidth
,
TableHeight
))];
self
.
standLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
standLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
standLabel
.
text
=
@"80"
;
self
.
standLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
countLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMaxX
(
self
.
standLabel
.
frame
)
+
SpaceMargin
,
0
,
headWidth
,
TableHeight
))];
self
.
countLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
countLabel
.
text
=
@"200"
;
self
.
countLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
countLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
baseCountLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
CGRectGetMaxX
(
self
.
countLabel
.
frame
)
+
SpaceMargin
,
0
,
headWidth
,
TableHeight
))];
self
.
baseCountLabel
.
textAlignment
=
NSTextAlignmentLeft
;
self
.
baseCountLabel
.
text
=
@"200"
;
self
.
baseCountLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
baseCountLabel
.
font
=
GXF_SIXTEENTEH_SIZE
;
self
.
editBtn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
self
.
editBtn
setImage
:[
UIImage
imageNamed
:
@"selected"
]
forState
:
UIControlStateNormal
];
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
))];;
self
.
lineLabel
.
backgroundColor
=
GXF_LINE_COLOR
;
[
self
.
contentView
addSubview
:
self
.
smallImageView
];
[
self
.
contentView
addSubview
:
self
.
seqLabel
];
[
self
.
contentView
addSubview
:
self
.
titleLabel
];
[
self
.
contentView
addSubview
:
self
.
standLabel
];
[
self
.
contentView
addSubview
:
self
.
countLabel
];
[
self
.
contentView
addSubview
:
self
.
baseCountLabel
];
[
self
.
contentView
addSubview
:
self
.
editBtn
];
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
XFFruit/ViewControllers/Survey/controllers/ChooseProductViewController.h
View file @
8938ec94
...
...
@@ -8,9 +8,7 @@
#import "ChooseParentViewController.h"
#import "Product.h"
typedef
void
(
^
ChoseProduct
)(
Product
*
product
);
@interface
ChooseProductViewController
:
ChooseParentViewController
@property
(
nonatomic
,
copy
)
ChoseProduct
choseProduct
;
@end
XFFruit/ViewControllers/Survey/controllers/ChooseProductViewController.m
View file @
8938ec94
...
...
@@ -11,7 +11,6 @@
#define TableHeight 50
@interface
ChooseProductViewController
()
{
NSIndexPath
*
_currentIndexPath
;
}
@end
...
...
@@ -21,7 +20,7 @@
//记录更新时间
self
.
tableView
.
header
.
lastUpdatedTimeKey
=
ChooseProductUpdateDate
;
self
.
title
=
@"选择商品"
;
[
self
fetch
ProductList
:
@""
];
[
self
fetch
DataList
:
@""
tableStr
:
GXF_BASECLASS_PRODUCT
];
}
-
(
void
)
getBaseDataFromServer
{
__weak
typeof
(
self
)
weakSelf
=
self
;
...
...
@@ -29,7 +28,7 @@
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
[
strongSelf
endRefreshing
];
[
strongSelf
fetch
ProductList
:
@""
];
[
strongSelf
fetch
DataList
:
@""
tableStr
:
GXF_BASECLASS_PRODUCT
];
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
...
...
@@ -38,53 +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
];
}
-
(
void
)
sureClick
{
if
(
self
.
isMoreChose
){
}
else
{
if
(
self
.
dataArr
.
count
>
0
)
{
if
(
_currentIndexPath
)
{
Product
*
product
=
self
.
dataArr
[
_currentIndexPath
.
row
];
self
.
choseProduct
(
product
);
}
}
}
[
self
PopViewControllerAnimated
:
YES
];
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellID
=
@"MaskCell"
;
MaskCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
...
...
@@ -101,8 +53,8 @@
cell
.
Commitbtn
.
hidden
=
YES
;
}
}
else
{
if
(
_
currentIndexPath
)
{
if
(
indexPath
.
row
==
_
currentIndexPath
.
row
)
{
if
(
self
.
currentIndexPath
)
{
if
(
indexPath
.
row
==
self
.
currentIndexPath
.
row
)
{
cell
.
Commitbtn
.
hidden
=
NO
;
}
else
{
cell
.
Commitbtn
.
hidden
=
YES
;
...
...
@@ -125,40 +77,9 @@
}
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
0
)
{
return
;
}
if
(
self
.
isMoreChose
==
YES
)
{
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
if
(
!
[
self
isHaveIndexPath
:
indexPath
])
{
[
self
.
indexArr
addObject
:
indexPath
];
}
}
else
{
MaskCell
*
currentCell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
_currentIndexPath
];
currentCell
.
Commitbtn
.
hidden
=
YES
;
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
_currentIndexPath
=
indexPath
;
}
}
#pragma mark - 父类方法
-
(
void
)
deleteTextFieldStr
{
[
super
deleteTextFieldStr
];
[
self
boxValueChanged
:
nil
];
}
#pragma mark - 按钮事件
-
(
void
)
boxValueChanged
:
(
NSNotification
*
)
fication
{
NSString
*
tilkeStr
=
[
IBTCommon
trimmingCharacters
:
self
.
selectTextFiled
.
text
];
[
self
fetchProductList
:
tilkeStr
];
}
-
(
void
)
tableViewRefresh
{
_currentIndexPath
=
nil
;
[
self
.
tableView
reloadData
];
[
self
fetchDataList
:
tilkeStr
tableStr
:
GXF_BASECLASS_PRODUCT
];
}
...
...
XFFruit/ViewControllers/Survey/controllers/ChosePersonViewController.h
View file @
8938ec94
...
...
@@ -8,10 +8,7 @@
#import "ChooseParentViewController.h"
typedef
void
(
^
ChosePerson
)(
NSArray
*
user
);
@interface
ChosePersonViewController
:
ChooseParentViewController
@property
(
nonatomic
,
copy
)
ChosePerson
chosePerson
;
@end
XFFruit/ViewControllers/Survey/controllers/ChosePersonViewController.m
View file @
8938ec94
...
...
@@ -11,10 +11,9 @@
#import "User.h"
#define TopMargin 50
#define TableHeight 50
@interface
ChosePersonViewController
()
{
NSIndexPath
*
_currentIndexPath
;
@interface
ChosePersonViewController
()
{
}
@end
@implementation
ChosePersonViewController
...
...
@@ -23,7 +22,7 @@
[
super
viewDidLoad
];
self
.
tableView
.
header
.
lastUpdatedTimeKey
=
ChoosePersonUpdateDate
;
self
.
title
=
@"选择人员"
;
[
self
fetch
UserList
:
@""
];
[
self
fetch
DataList
:
@""
tableStr
:
GXF_BASECLASS_USER
];
}
-
(
void
)
getBaseDataFromServer
{
...
...
@@ -32,7 +31,7 @@
[
IBTLoadingView
hideHUDWithText
:
nil
];
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
[
strongSelf
endRefreshing
];
[
strongSelf
fetch
UserList
:
@""
];
[
strongSelf
fetch
DataList
:
@""
tableStr
:
GXF_BASECLASS_USER
];
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
...
...
@@ -43,36 +42,6 @@
[[
ICRHTTPController
sharedController
]
getUserWithPage_number
:
0
page_size
:
100
success
:
succ
failure
:
fail
];
}
#pragma mark -成功
-
(
void
)
fetchUserList
:
(
NSString
*
)
titleStr
{
ICRDatabaseFetchBlock
fetchBlk
=
^
FMResultSet
*
(
FMDatabase
*
db
)
{
NSString
*
sql
=
@""
;
if
(
titleStr
.
length
>
0
)
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' ORDER BY %@"
,
[
User
TableName
],
titleStr
,
@"uuid"
];
}
else
{
sql
=
[
NSString
stringWithFormat
:
@"SELECT * FROM %@ ORDER BY %@"
,
[
User
TableName
],
@"uuid"
];
}
return
[
db
executeQuery
:
sql
];
};
__weak
typeof
(
self
)
weakSelf
=
self
;
ICRDatabaseFetchResultsBlock
fetchResultsBlk
=
^
(
NSArray
*
fetchedObjects
)
{
__strong
__typeof
(
weakSelf
)
strongSelf
=
weakSelf
;
if
(
!
[
GXF_NSUSERFEFTAULTS
objectForKey
:
ChoosePersonUpdateDate
])
{
[
GXF_NSUSERFEFTAULTS
setObject
:[
NSDate
date
]
forKey
:
ChoosePersonUpdateDate
];
[
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
:[
User
class
]
fetchBlock
:
fetchBlk
fetchResultsBlock
:
fetchResultsBlk
];
}
-
(
void
)
sureClick
{
if
(
self
.
isMoreChose
)
{
NSMutableArray
*
arr
=
[[
NSMutableArray
alloc
]
init
];
...
...
@@ -84,18 +53,18 @@
survey
.
userName
=
user
.
name
;
[
arr
addObject
:
survey
];
}
self
.
chose
Person
(
arr
);
self
.
chose
BaseInfo
(
arr
);
}
else
{
NSMutableArray
*
arr
=
[[
NSMutableArray
alloc
]
init
];
if
(
self
.
dataArr
.
count
>
0
)
{
if
(
_
currentIndexPath
)
{
User
*
user
=
self
.
dataArr
[
_
currentIndexPath
.
row
];
if
(
self
.
currentIndexPath
)
{
User
*
user
=
self
.
dataArr
[
self
.
currentIndexPath
.
row
];
SurveyUser
*
survey
=
[[
SurveyUser
alloc
]
init
];
survey
.
userUuid
=
user
.
uuid
;
survey
.
userCode
=
user
.
login
;
survey
.
userName
=
user
.
name
;
[
arr
addObject
:
survey
];
self
.
chose
Person
(
arr
);
self
.
chose
BaseInfo
(
arr
);
}
}
}
...
...
@@ -119,8 +88,8 @@
cell
.
Commitbtn
.
hidden
=
YES
;
}
}
else
{
if
(
_
currentIndexPath
)
{
if
(
indexPath
.
row
==
_
currentIndexPath
.
row
)
{
if
(
self
.
currentIndexPath
)
{
if
(
indexPath
.
row
==
self
.
currentIndexPath
.
row
)
{
cell
.
Commitbtn
.
hidden
=
NO
;
}
else
{
cell
.
Commitbtn
.
hidden
=
YES
;
...
...
@@ -138,46 +107,12 @@
User
*
user
=
self
.
dataArr
[
indexPath
.
row
];
[
cell
setTitleStr
:
user
.
name
];
}
}
return
cell
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
indexPath
.
row
==
0
)
{
return
;
}
if
(
self
.
isMoreChose
==
YES
)
{
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
if
(
!
[
self
isHaveIndexPath
:
indexPath
])
{
cell
.
Commitbtn
.
hidden
=
NO
;
[
self
.
indexArr
addObject
:
indexPath
];
}
else
{
cell
.
Commitbtn
.
hidden
=
YES
;
[
self
.
indexArr
removeObject
:
indexPath
];
}
}
else
{
MaskCell
*
currentCell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
_currentIndexPath
];
currentCell
.
Commitbtn
.
hidden
=
YES
;
MaskCell
*
cell
=
(
MaskCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
cell
.
Commitbtn
.
hidden
=
NO
;
_currentIndexPath
=
indexPath
;
}
}
-
(
void
)
deleteTextFieldStr
{
[
super
deleteTextFieldStr
];
[
self
boxValueChanged
:
nil
];
}
#pragma mark - 按钮事件
-
(
void
)
boxValueChanged
:
(
NSNotification
*
)
fication
{
NSString
*
tilkeStr
=
[
IBTCommon
trimmingCharacters
:
self
.
selectTextFiled
.
text
];
[
self
fetchUserList
:
tilkeStr
];
}
-
(
void
)
tableViewRefresh
{
_currentIndexPath
=
nil
;
if
(
self
.
indexArr
.
count
>
0
)
{
[
self
.
indexArr
removeAllObjects
];
}
[
self
.
tableView
reloadData
];
[
self
fetchDataList
:
tilkeStr
tableStr
:
GXF_BASECLASS_USER
];
}
...
...
XFFruit/ViewControllers/Survey/controllers/NewSurveyViewController.m
View file @
8938ec94
...
...
@@ -394,7 +394,7 @@ typedef enum : NSUInteger {
[
self
startDatePickView
];
}
else
if
(
indexPath
.
row
==
4
){
ChosePersonViewController
*
cvc
=
[
ChosePersonViewController
new
];
cvc
.
chose
Person
=
^
(
NSArray
*
users
){
cvc
.
chose
BaseInfo
=
^
(
NSArray
*
users
){
if
(
users
.
count
>
0
){
NSString
*
textStr
=
@""
;
if
(
self
.
users
.
count
>
0
)
{
...
...
@@ -417,7 +417,8 @@ typedef enum : NSUInteger {
}
else
if
(
indexPath
.
row
==
1
){
ChooseProductViewController
*
cvc
=
[
ChooseProductViewController
new
];
cvc
.
choseProduct
=
^
(
Product
*
product
){
cvc
.
choseBaseInfo
=
^
(
NSArray
*
products
){
Product
*
product
=
products
[
0
];
_productLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@[%@]"
,
product
.
name
,
product
.
code
];
_productLabel
.
textColor
=
GXF_CONTENT_COLOR
;
self
.
productNameStr
=
product
.
name
;
...
...
XFFruit/ViewControllers/WorkSheet/Controllers/CostViewController.m
View file @
8938ec94
...
...
@@ -40,7 +40,7 @@
[
self
.
view
addSubview
:
headCell
];
self
.
tableView
.
tableHeaderView
=
headCell
;
FooterCell
*
footCell
=
[[
FooterCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
_tableFrame
.
size
.
width
,
50
)
withTitle
:
@"+点击添加原料明细"
];
FooterCell
*
footCell
=
[[
FooterCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
_tableFrame
.
size
.
width
,
50
)
withTitle
:
@"+点击添加原料明细"
isTwo
:
@""
];
[
self
.
view
addSubview
:
footCell
];
footCell
.
delegate
=
self
;
self
.
tableView
.
tableFooterView
=
footCell
;
...
...
XFFruit/ViewControllers/WorkSheet/Controllers/GoodsViewController.m
View file @
8938ec94
...
...
@@ -40,7 +40,7 @@
[
self
.
view
addSubview
:
headCell
];
self
.
tableView
.
tableHeaderView
=
headCell
;
FooterCell
*
footCell
=
[[
FooterCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
_tableFrame
.
size
.
width
,
50
)
withTitle
:
@"+点击添加原料明细"
];
FooterCell
*
footCell
=
[[
FooterCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
_tableFrame
.
size
.
width
,
50
)
withTitle
:
@"+点击添加原料明细"
isTwo
:
@""
];
[
self
.
view
addSubview
:
footCell
];
footCell
.
delegate
=
self
;
self
.
tableView
.
tableFooterView
=
footCell
;
...
...
XFFruit/ViewControllers/WorkSheet/Controllers/MaterialVIewController.m
View file @
8938ec94
...
...
@@ -45,11 +45,11 @@
HeaderCell
*
headCell
=
[[
HeaderCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
38
)
withArr
:
arr
];
[
self
.
view
addSubview
:
headCell
];
self
.
tableView
.
tableHeaderView
=
headCell
;
FooterCell
*
footCell
=
[[
FooterCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
_tableFrame
.
size
.
width
,
50
)
withTitle
:
@"+点击添加原料明细"
];
[
self
.
view
addSubview
:
footCell
];
footCell
.
delegate
=
self
;
self
.
tableView
.
tableFooterView
=
footCell
;
//
// FooterCell *footCell = [[FooterCell alloc]initWithFrame:CGRectMake(0, 0, _tableFrame.size.width, 50) withTitle:@"+点击添加原料明细"
];
//
[self.view addSubview:footCell];
//
footCell.delegate = self;
//
self.tableView.tableFooterView = footCell;
}
-
(
void
)
addClick
{
...
...
XFFruit/ViewControllers/WorkSheet/Views/FooterCell.h
View file @
8938ec94
...
...
@@ -11,11 +11,11 @@
@protocol
FooterCellDelegate
<
NSObject
>
-
(
void
)
addClick
;
-
(
void
)
choosePurchase
;
@end
@interface
FooterCell
:
UIView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
withTitle
:(
NSString
*
)
title
;
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
withTitle
:(
NSString
*
)
title
isTwo
:(
NSString
*
)
twoTitle
;
@property
(
nonatomic
,
strong
)
id
<
FooterCellDelegate
>
delegate
;
@end
XFFruit/ViewControllers/WorkSheet/Views/FooterCell.m
View file @
8938ec94
...
...
@@ -11,14 +11,19 @@
#define LeftMargin 13
@interface
FooterCell
()
@property
(
nonatomic
,
strong
)
NSString
*
title
;
@property
(
nonatomic
,
strong
)
NSString
*
twoTitle
;
@property
(
nonatomic
,
strong
)
UILabel
*
lineLabel
;
@end
@implementation
FooterCell
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
withTitle
:(
NSString
*
)
title
{
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
withTitle
:(
NSString
*
)
title
isTwo
:(
NSString
*
)
twoTitle
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
title
=
title
;
if
(
twoTitle
.
length
>
0
)
{
self
.
twoTitle
=
twoTitle
;
}
[
self
bulidLayout
];
}
return
self
;
...
...
@@ -33,6 +38,18 @@
[
addBtn
addTarget
:
self
action
:
@selector
(
addBtn
)
forControlEvents
:
UIControlEventTouchUpInside
];
addBtn
.
titleLabel
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
self
addSubview
:
addBtn
];
if
(
self
.
twoTitle
.
length
>
0
)
{
addBtn
.
frame
=
CGRectMake
(
0
,
0
,
self
.
frame
.
size
.
width
/
2
,
50
);
UIButton
*
otherBtn
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
otherBtn
.
frame
=
CGRectMake
(
self
.
frame
.
size
.
width
/
2
,
0
,
self
.
frame
.
size
.
width
/
2
,
50
);
[
otherBtn
setTitle
:
self
.
twoTitle
forState
:
UIControlStateNormal
];
otherBtn
.
backgroundColor
=
[
UIColor
whiteColor
];
[
otherBtn
setTitleColor
:
GXF_PLACEHOLDER_COLOR
forState
:
UIControlStateNormal
];
[
otherBtn
addTarget
:
self
action
:
@selector
(
otherClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
otherBtn
.
titleLabel
.
font
=
GXF_FIFTEENTEN_SIZE
;
[
self
addSubview
:
otherBtn
];
}
self
.
lineLabel
=
[[
UILabel
alloc
]
initWithFrame
:(
CGRectMake
(
LeftMargin
,
self
.
frame
.
size
.
height
-
1
,
ScreenSize
.
width
-
LeftMargin
*
2
,
1
))];
self
.
lineLabel
.
backgroundColor
=
GXF_LINE_COLOR
;
self
.
lineLabel
.
font
=
GXF_FIFTEENTEN_SIZE
;
...
...
@@ -44,6 +61,10 @@
[
self
.
delegate
addClick
];
}
}
-
(
void
)
otherClick
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
choosePurchase
)])
{
[
self
.
delegate
choosePurchase
];
}
}
@end
XFFruit/ViewControllers/WorkSheet/Views/TopSheetView.m
View file @
8938ec94
...
...
@@ -113,7 +113,6 @@
}
else
if
(
indexPath
.
row
==
4
){
contentLabel
.
text
=
@"选择加工工厂"
;
self
.
factoryLabel
=
contentLabel
;
}
}
}
...
...
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