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
61e39156
Commit
61e39156
authored
9 years ago
by
freecui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改业务界面
parent
520c7985
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
120 deletions
+93
-120
BusinessViewController.m
XFFruit/ViewControllers/Business/BusinessViewController.m
+93
-120
No files found.
XFFruit/ViewControllers/Business/BusinessViewController.m
View file @
61e39156
...
...
@@ -8,11 +8,6 @@
#import "BusinessViewController.h"
#import "ICRTaskListViewController.h"
#import "ICRPatrolPlanViewController.h"
#import "ICRStoreListViewController.h"
#import "ICRStoreDetailViewController.h"
#import "ICRAnnouncementViewController.h"
#import "NewSurveyViewController.h"
#import "SurveyViewController.h"
...
...
@@ -29,87 +24,86 @@
#import "NewPurchaseViewController.h"
#import "PurchaseViewController.h"
@interface
BusinessViewController
()
<
ICRFunctionBaseViewDelegate
>
#import "GXFFunctionDB.h"
#import "GXFNewProcessViewController.h"
#import "GXFSeeProcessViewController.h"
@interface
BusinessViewController
()
<
ICRFunctionBaseViewDelegate
,
UITableViewDataSource
,
UITableViewDelegate
>
@property
(
nonatomic
,
strong
)
ICRFunctionBaseView
*
c_functionBaseView
;
@property
(
nonatomic
,
strong
)
UITableView
*
c_tableView
;
@end
@implementation
BusinessViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// [self initView];
[
self
setupSubviews
];
// Do any additional setup after loading the view.
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
-
(
void
)
setupSubviews
{
NSMutableArray
*
arrFunctionEntities
=
[
NSMutableArray
array
];
NSArray
*
functionImageNames
=
@[
@"AnnouncementIcon"
,
@"create_surver"
,
@"watch_surver"
,
@"create_surver_result"
,
@"create_needs"
,
@"watch_needs"
,
@"create_purchase"
,
@"watch_purchase"
,
@"review_purchase"
,
@"create_transport"
,
@"watch_transort"
,
@"create_process"
];
NSArray
*
fuctionNames
=
@[
[
IBTCommon
localizableString
:
@"Announcement"
],
[
IBTCommon
localizableString
:
@"AddSurvey"
],
[
IBTCommon
localizableString
:
@"Survey"
],
[
IBTCommon
localizableString
:
@"Survey1"
],
[
IBTCommon
localizableString
:
@"Survey2"
],
[
IBTCommon
localizableString
:
@"Survey3"
],
[
IBTCommon
localizableString
:
@"AddPurchase"
],
[
IBTCommon
localizableString
:
@"Purchase"
],
[
IBTCommon
localizableString
:
@"Survey6"
],
[
IBTCommon
localizableString
:
@"Survey7"
],
[
IBTCommon
localizableString
:
@"Survey8"
],[
IBTCommon
localizableString
:
@"Survey9"
],
];
NSArray
*
functionTags
=
@[
@
(
kFunctionNotice
),
//公告
@
(
kFunctionNewSurvey
),
//新建行情调研
@
(
kFunctionSeeSurvey
),
//查看行情调研
@
(
kFunctionFeeBackSurvey
),
//填写行情反馈
@
(
kFunctionNewPurchaseNotice
),
//新建采购通知
@
(
kFunctionSeePurchaseNotice
),
//查看采购通知
@
(
kFunctionNewPurchase
),
//新建采购单
@
(
kFunctionSeePurchase
),
//查看采购单
@
(
kFunctionExaminePurchase
),
//审核采购单
@
(
kFunctionNewShipment
),
//新建发运单
@
(
kFunctionSeeShipment
),
//查看发运单
@
(
kFunctionNewProcessing
)];
//新建加工单
-
(
void
)
setupFunctionBaseView
{
NSMutableArray
*
funtionEntitlesArr
=
[
NSMutableArray
array
];
int
i
=
0
;
for
(
NSString
*
functionName
in
fuctionNames
)
{
ICRFunctionEntity
*
funtionEntity
=
[[
ICRFunctionEntity
alloc
]
init
];
funtionEntity
.
functionName
=
functionName
;
funtionEntity
.
iconName
=
[
functionImageNames
objectAtIndex
:
i
];
funtionEntity
.
functionItemTag
=
[[
functionTags
objectAtIndex
:
i
]
integerValue
];
[
arrFunctionEntities
addObject
:
funtionEntity
];
i
++
;
NSArray
*
arrFunctions
=
[
NSArray
arrayWithArray
:[[
GXFFunctionDB
sharedInstance
]
displayFunctionsHasPermission
]];
for
(
GXFDisplayFunction
*
displayFunction
in
arrFunctions
)
{
ICRFunctionEntity
*
functionEntity
=
[[
ICRFunctionEntity
alloc
]
init
];
functionEntity
.
functionName
=
displayFunction
.
functionName
;
functionEntity
.
iconName
=
displayFunction
.
functionImgName
;
functionEntity
.
functionItemTag
=
displayFunction
.
functionItemTag
;
[
funtionEntitlesArr
addObject
:
functionEntity
];
}
ICRFunctionBaseView
*
baseView
=
[
ICRFunctionBaseView
initWithFunctionData
:
arrFunctionEntities
];
baseView
.
frame
=
(
CGRect
){
self
.
c_functionBaseView
=
[
ICRFunctionBaseView
initWithFunctionData
:
funtionEntitlesArr
];
_c_functionBaseView
.
frame
=
(
CGRect
){
.
origin
.
x
=
0
,
.
origin
.
y
=
0
,
.
size
.
width
=
CGRectGetWidth
(
self
.
view
.
frame
),
.
size
.
height
=
CGRectGetHeight
(
self
.
view
.
frame
),};
baseView
.
backgroundColor
=
[
UIColor
clearColor
];
baseView
.
m_delegate
=
self
;
[
self
.
view
addSubview
:
baseView
];
.
size
.
height
=
_c_functionBaseView
.
height
};
//CGRectGetHeight(self.view.frame),};
_c_functionBaseView
.
backgroundColor
=
[
UIColor
clearColor
];
_c_functionBaseView
.
m_delegate
=
self
;
}
-
(
void
)
setupSubviews
{
self
.
c_tableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
self
.
view
.
width
,
self
.
view
.
height
-
64
)
style
:
UITableViewStyleGrouped
];
self
.
c_tableView
.
delegate
=
self
;
self
.
c_tableView
.
dataSource
=
self
;
[
self
.
view
addSubview
:
_c_tableView
];
[
self
setupFunctionBaseView
];
}
#pragma UITableViewDataSource
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
1
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
1
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForHeaderInSection
:
(
NSInteger
)
section
{
return
1
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
_c_functionBaseView
.
height
+
44
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
static
NSString
*
cellId
=
@"cellId"
;
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellId
];
if
(
!
cell
)
{
cell
=
[[
UITableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellId
];
}
[
cell
.
contentView
addSubview
:
_c_functionBaseView
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
return
cell
;
}
#pragma mark - ICRFunctionBaseViewDelegate
-
(
void
)
ICRFunctionBaseView
:
(
ICRFunctionItemControl
*
)
imageView
{
/*
...
...
@@ -121,21 +115,22 @@
switch
(
imageView
.
tag
)
{
case
kFunctionNotice
:
//公告
{
ICRAnnouncementViewController
*
aVC
=
[[
ICRAnnouncementViewController
alloc
]
init
];
[
self
PushViewController
:
aVC
animated
:
YES
];
//
ICRAnnouncementViewController *aVC = [[ICRAnnouncementViewController alloc] init];
//
[self PushViewController:aVC animated:YES];
}
break
;
case
kFunctionNewSurvey
:
//新建行情
{
NewSurveyViewController
*
svc
=
[[
NewSurveyViewController
alloc
]
init
];
svc
.
navT
itle
=
[
IBTCommon
localizableString
:
@"AddSurvey"
];
svc
.
t
itle
=
[
IBTCommon
localizableString
:
@"AddSurvey"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionSeeSurvey
:
//查看行情
调研
case
kFunctionSeeSurvey
:
//查看行情
{
SurveyViewController
*
svc
=
[[
SurveyViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"Survey"
];
svc
.
navigationItem
.
hidesBackButton
=
YES
;
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
...
...
@@ -154,13 +149,13 @@
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionNewPurchase
:
//新建采购单
case
kFunctionNewPurchase
:
//新建采购单
{
NewPurchaseViewController
*
nvc
=
[[
NewPurchaseViewController
alloc
]
init
];
nvc
.
title
=
@"新建采购单"
;
[
self
PushViewController
:
nvc
animated
:
YES
];
}
break
;
case
kFunctionSeePurchase
:{
...
...
@@ -169,60 +164,38 @@
[
self
PushViewController
:
pvc
animated
:
YES
];
}
break
;
// case kFunctionTaskManagement://任务管理
// {
// ICRTaskListViewController *tVC = [[ICRTaskListViewController alloc] init];
// [self PushViewController:tVC animated:YES];
// }
// break;
// case kFunctionPatrolPlan://巡店计划
// {
// ICRPatrolPlanViewController *pVC = [[ICRPatrolPlanViewController alloc] initWithStore:nil isHomeShow:YES];
// [self PushViewController:pVC animated:YES];
// }
// break;
// case kFunctionMyShop://我的店铺
// {
// // ICRStoreListViewController *sVC = [[ICRStoreListViewController alloc] initWithBHaveToChooseOne:NO];
// // sVC.title = [IBTCommon localizableString:@"MyStore"];
// // sVC.m_delegate = self;
// // [self PushViewController:sVC animated:YES];
// AddWorkSheetViewController *sVC = [[AddWorkSheetViewController alloc] init];
// [self PushViewController:sVC animated:YES];
// }
// break;
case
kFunctionNewProcessing
:{
GXFNewProcessViewController
*
pvc
=
[[
GXFNewProcessViewController
alloc
]
init
];
//pvc.title = @"采购单";
[
self
PushViewController
:
pvc
animated
:
YES
];
}
break
;
case
kFunctionSeeProcessing
:{
GXFSeeProcessViewController
*
seeProcessVC
=
[[
GXFSeeProcessViewController
alloc
]
init
];
[
self
PushViewController
:
seeProcessVC
animated
:
YES
];
}
break
;
default
:
return
;
break
;
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
-
(
void
)
initView
{
NSArray
*
butArray
=
[[
NSArray
alloc
]
initWithObjects
:
@"公告"
,
@"新建行情调研"
,
@"查看行情调研"
,
@"填写行情反馈"
,
@"新建采购通知"
,
@"查看采购通知"
,
@"新建采购单"
,
@"查看采购单"
,
@"审核采购单"
,
@"新建发运单"
,
@"查看发运单"
,
@"新建加工单"
,
nil
];
for
(
int
i
=
0
;
i
<
butArray
.
count
;
i
++
)
{
UIButton
*
but
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
but
.
frame
=
CGRectMake
(
15
+
i
%
3
*
(
90
+
10
),
10
+
(
i
/
3
)
*
(
100
+
10
)
,
90
,
90
)
;
// but.titleLabel.text=[NSString stringWithFormat:@"%@",[butArray objectAtIndex:i]];
NSString
*
str
=
[
butArray
objectAtIndex
:
i
];
[
but
setTitle
:
str
forState
:
UIControlStateNormal
];
but
.
backgroundColor
=
[
UIColor
redColor
];
[
self
.
view
addSubview
:
but
];
}
}
//-(void)initView
//{
// NSArray *butArray=[[NSArray alloc]initWithObjects:@"公告", @"新建行情调研",@"查看行情调研",@"填写行情反馈",@"新建采购通知",@"查看采购通知",@"新建采购单",@"查看采购单",@"审核采购单",@"新建发运单",@"查看发运单",@"新建加工单",nil];
// for (int i=0; i<butArray.count; i++) {
// UIButton *but=[UIButton buttonWithType:UIButtonTypeCustom];
// but.frame=CGRectMake(15+i%3*(90+10),10+(i/3)*(100+10) , 90, 90) ;
// // but.titleLabel.text=[NSString stringWithFormat:@"%@",[butArray objectAtIndex:i]];
// NSString *str=[butArray objectAtIndex:i];
// [but setTitle:str forState:UIControlStateNormal];
// but.backgroundColor=[UIColor redColor];
// [self .view addSubview:but];
//
// }
//
//}
@end
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment