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
182b65ff
Commit
182b65ff
authored
Aug 29, 2015
by
freecui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页功能跳转
parent
b9a36cf9
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
151 additions
and
60 deletions
+151
-60
GXFFunctionDB.m
XFFruit/Controllers/DataBaseController/GXFFunctionDB.m
+5
-3
GXFFunctionDBHelper.m
XFFruit/Controllers/DataBaseController/GXFFunctionDBHelper.m
+9
-0
ICRFunctionItemControl.h
XFFruit/General/Views/FunctionView/ICRFunctionItemControl.h
+25
-21
BusinessViewController.m
XFFruit/ViewControllers/Business/BusinessViewController.m
+23
-23
ICRHomeViewController.m
.../ViewControllers/Home/Controllers/ICRHomeViewController.m
+84
-13
GXFDisplayFunction.h
XFFruit/ViewControllers/Home/Models/GXFDisplayFunction.h
+1
-0
ICRLoginViewController.m
XFFruit/ViewControllers/Login/ICRLoginViewController.m
+4
-0
No files found.
XFFruit/Controllers/DataBaseController/GXFFunctionDB.m
View file @
182b65ff
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
if
(
!
[
_dataBase
open
])
{
if
(
!
[
_dataBase
open
])
{
[
self
openDb
];
[
self
openDb
];
}
}
NSString
*
createTableSql
=
@"CREATE TABLE IF NOT EXISTS displayFunction (Id INTEGER PRIMARY KEY AUTOINCREMENT,functionId INTEGER,functionName VARCHAR ,functionImgName VARCHAR,functionSmallImgName VARCHAR, isSelected INTEGER)"
;
NSString
*
createTableSql
=
@"CREATE TABLE IF NOT EXISTS displayFunction (Id INTEGER PRIMARY KEY AUTOINCREMENT,functionId INTEGER,functionName VARCHAR ,functionImgName VARCHAR,functionSmallImgName VARCHAR, isSelected INTEGER
,functionItemTag INTEGER
)"
;
BOOL
work
=
[
_dataBase
executeUpdate
:
createTableSql
];
BOOL
work
=
[
_dataBase
executeUpdate
:
createTableSql
];
return
work
;
return
work
;
...
@@ -196,8 +196,8 @@
...
@@ -196,8 +196,8 @@
#pragma displayFunction
#pragma displayFunction
-
(
BOOL
)
insertDisplayFunction
:
(
GXFDisplayFunction
*
)
displayFunction
{
-
(
BOOL
)
insertDisplayFunction
:
(
GXFDisplayFunction
*
)
displayFunction
{
NSString
*
inserSql
=
@"INSERT INTO displayFunction(functionId,functionName,functionImgName,functionSmallImgName
) VALUES(
?,?,?,?)"
;
NSString
*
inserSql
=
@"INSERT INTO displayFunction(functionId,functionName,functionImgName,functionSmallImgName
,functionItemTag) VALUES(?,
?,?,?,?)"
;
BOOL
work
=
[
_dataBase
executeUpdate
:
inserSql
,
@
(
displayFunction
.
functionId
),
displayFunction
.
functionName
,
displayFunction
.
functionImgName
,
displayFunction
.
functionSmallImgName
];
BOOL
work
=
[
_dataBase
executeUpdate
:
inserSql
,
@
(
displayFunction
.
functionId
),
displayFunction
.
functionName
,
displayFunction
.
functionImgName
,
displayFunction
.
functionSmallImgName
,
@
(
displayFunction
.
functionItemTag
)
];
return
work
;
return
work
;
}
}
...
@@ -209,6 +209,7 @@
...
@@ -209,6 +209,7 @@
displayFunction
.
functionName
=
[
rs
stringForColumn
:
@"functionName"
];
displayFunction
.
functionName
=
[
rs
stringForColumn
:
@"functionName"
];
displayFunction
.
functionImgName
=
[
rs
stringForColumn
:
@"functionImgName"
];
displayFunction
.
functionImgName
=
[
rs
stringForColumn
:
@"functionImgName"
];
displayFunction
.
functionSmallImgName
=
[
rs
stringForColumn
:
@"functionSmallImgName"
];
displayFunction
.
functionSmallImgName
=
[
rs
stringForColumn
:
@"functionSmallImgName"
];
displayFunction
.
functionItemTag
=
[
rs
intForColumn
:
@"functionItemTag"
];
break
;
break
;
}
}
return
displayFunction
;
return
displayFunction
;
...
@@ -270,6 +271,7 @@
...
@@ -270,6 +271,7 @@
displayFunction
.
functionImgName
=
[
rs
stringForColumn
:
@"functionImgName"
];
displayFunction
.
functionImgName
=
[
rs
stringForColumn
:
@"functionImgName"
];
displayFunction
.
functionSmallImgName
=
[
rs
stringForColumn
:
@"functionSmallImgName"
];
displayFunction
.
functionSmallImgName
=
[
rs
stringForColumn
:
@"functionSmallImgName"
];
displayFunction
.
isSelected
=
[
rs
intForColumn
:
@"isSelected"
];
displayFunction
.
isSelected
=
[
rs
intForColumn
:
@"isSelected"
];
displayFunction
.
functionItemTag
=
[
rs
intForColumn
:
@"functionItemTag"
];
return
displayFunction
;
return
displayFunction
;
}
}
//返回被选中的
//返回被选中的
...
...
XFFruit/Controllers/DataBaseController/GXFFunctionDBHelper.m
View file @
182b65ff
...
@@ -111,6 +111,14 @@
...
@@ -111,6 +111,14 @@
@"新建转运单"
,
@"查看转运单"
,
@"查看转运单"
];
@"新建转运单"
,
@"查看转运单"
,
@"查看转运单"
];
//NSArray *functionsSmallImgName = @[];
//NSArray *functionsSmallImgName = @[];
NSArray
*
functionItemTag
=
@[
@
(
0
),
@
(
1
),
@
(
2
),
@
(
2
),
@
(
3
),
@
(
4
),
@
(
5
),
@
(
5
),
//"采购通知",
@
(
6
),
@
(
7
),
@
(
7
),
@
(
8
),
//"采购单"
@
(
9
),
@
(
10
),
@
(
10
),
//"发运单"
@
(
11
),
@
(
12
),
@
(
12
),
//"转运单"
@
(
13
),
@
(
14
),
@
(
14
),];
//加工单
if
((
functionsId
.
count
!=
functionsName
.
count
)
||
(
functionsId
.
count
!=
functionsImageName
.
count
)
||
(
functionsName
.
count
!=
functionsImageName
.
count
))
{
if
((
functionsId
.
count
!=
functionsName
.
count
)
||
(
functionsId
.
count
!=
functionsImageName
.
count
)
||
(
functionsName
.
count
!=
functionsImageName
.
count
))
{
NSLog
(
@"展现功能界面:插入的数据不是一一对应的"
);
NSLog
(
@"展现功能界面:插入的数据不是一一对应的"
);
return
nil
;
return
nil
;
...
@@ -123,6 +131,7 @@
...
@@ -123,6 +131,7 @@
displayFunction
.
functionName
=
functionsName
[
count
];
displayFunction
.
functionName
=
functionsName
[
count
];
displayFunction
.
functionImgName
=
functionsImageName
[
count
];
displayFunction
.
functionImgName
=
functionsImageName
[
count
];
//displayFunction.functionSmallImgName = fu
//displayFunction.functionSmallImgName = fu
displayFunction
.
functionItemTag
=
[
functionItemTag
[
count
]
integerValue
];
[
muarr
addObject
:
displayFunction
];
[
muarr
addObject
:
displayFunction
];
}
}
...
...
XFFruit/General/Views/FunctionView/ICRFunctionItemControl.h
View file @
182b65ff
...
@@ -11,7 +11,24 @@
...
@@ -11,7 +11,24 @@
//@protocol ICRFuctionItemControlDelegate;
//@protocol ICRFuctionItemControlDelegate;
typedef
NS_ENUM
(
NSUInteger
,
ICRFunctionID
)
{
typedef
NS_ENUM
(
NSUInteger
,
ICRFunctionID
)
{
kFunctionAnnouncement
=
0
,
kFunctionNotice
=
0
,
//公告
kFunctionNewSurvey
,
//新建行情调研
kFunctionSeeSurvey
,
//查看行情调研
kFunctionFeeBackSurvey
,
//填写行情反馈
kFunctionNewPurchaseNotice
,
//新建采购通知
kFunctionSeePurchaseNotice
,
//查看采购通知
kFunctionNewPurchase
,
// 新建采购单
kFunctionSeePurchase
,
// 查看采购单
kFunctionExaminePurchase
,
// 审核采购单【供应商】
kFunctionNewShipment
,
// 新建发运单
kFunctionSeeShipment
,
// 查看发运单
kFunctionNewProcessing
,
// 新增加工单
kFunctionSeeProcessing
,
// 查看加工单
kFunctionAnnouncement
,
kFunctionTaskManagement
,
kFunctionTaskManagement
,
kFunctionPatrolPlan
,
kFunctionPatrolPlan
,
kFunctionMyShop
,
kFunctionMyShop
,
...
@@ -19,20 +36,7 @@ typedef NS_ENUM (NSUInteger, ICRFunctionID) {
...
@@ -19,20 +36,7 @@ typedef NS_ENUM (NSUInteger, ICRFunctionID) {
kFunctionComeShopReg
,
kFunctionComeShopReg
,
kFunctionLeaveShopReg
,
kFunctionLeaveShopReg
,
kFunctionCreatTask
,
kFunctionCreatTask
,
kFunctionHandleTask
,
kFunctionHandleTask
kFunctionNotice
,
kFunctionNewSurvey
,
kFunctionSeeSurvey
,
kFunctionFeeBackSurvey
,
kFunctionNewPurchaseNotice
,
kFunctionSeePurchaseNotice
,
kFunctionNewPurchase
,
kFunctionSeePurchase
,
kFunctionExaminePurchas
,
kFunctionNewShipment
,
kFunctionSeeShipment
,
kFunctionNewProcessing
,
};
};
@interface
ICRFunctionItemControl
:
UIControl
@interface
ICRFunctionItemControl
:
UIControl
...
...
XFFruit/ViewControllers/Business/BusinessViewController.m
View file @
182b65ff
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
//新建采购单
//新建采购单
@
(
kFunctionSeePurchase
),
@
(
kFunctionSeePurchase
),
//查看采购单
//查看采购单
@
(
kFunctionExaminePurchas
),
@
(
kFunctionExaminePurchas
e
),
//审核采购单
//审核采购单
@
(
kFunctionNewShipment
),
@
(
kFunctionNewShipment
),
//新建发运单
//新建发运单
...
@@ -172,28 +172,28 @@
...
@@ -172,28 +172,28 @@
break
;
break
;
case
kFunctionTaskManagement
:
//任务管理
//
case kFunctionTaskManagement://任务管理
{
//
{
ICRTaskListViewController
*
tVC
=
[[
ICRTaskListViewController
alloc
]
init
];
//
ICRTaskListViewController *tVC = [[ICRTaskListViewController alloc] init];
[
self
PushViewController
:
tVC
animated
:
YES
];
//
[self PushViewController:tVC animated:YES];
}
//
}
break
;
//
break;
case
kFunctionPatrolPlan
:
//巡店计划
//
case kFunctionPatrolPlan://巡店计划
{
//
{
ICRPatrolPlanViewController
*
pVC
=
[[
ICRPatrolPlanViewController
alloc
]
initWithStore
:
nil
isHomeShow
:
YES
];
//
ICRPatrolPlanViewController *pVC = [[ICRPatrolPlanViewController alloc] initWithStore:nil isHomeShow:YES];
[
self
PushViewController
:
pVC
animated
:
YES
];
//
[self PushViewController:pVC animated:YES];
}
//
}
break
;
//
break;
case
kFunctionMyShop
:
//我的店铺
//
case kFunctionMyShop://我的店铺
{
//
{
// ICRStoreListViewController *sVC = [[ICRStoreListViewController alloc] initWithBHaveToChooseOne:NO];
//
// ICRStoreListViewController *sVC = [[ICRStoreListViewController alloc] initWithBHaveToChooseOne:NO];
// sVC.title = [IBTCommon localizableString:@"MyStore"];
//
// sVC.title = [IBTCommon localizableString:@"MyStore"];
// sVC.m_delegate = self;
//
// sVC.m_delegate = self;
// [self PushViewController:sVC animated:YES];
//
// [self PushViewController:sVC animated:YES];
AddWorkSheetViewController
*
sVC
=
[[
AddWorkSheetViewController
alloc
]
init
];
//
AddWorkSheetViewController *sVC = [[AddWorkSheetViewController alloc] init];
[
self
PushViewController
:
sVC
animated
:
YES
];
//
[self PushViewController:sVC animated:YES];
}
//
}
break
;
//
break;
default
:
default
:
return
;
return
;
...
...
XFFruit/ViewControllers/Home/Controllers/ICRHomeViewController.m
View file @
182b65ff
...
@@ -12,12 +12,6 @@
...
@@ -12,12 +12,6 @@
#import "ICRHomeViewController.h"
#import "ICRHomeViewController.h"
#import "ICRTaskListViewController.h"
#import "ICRPatrolPlanViewController.h"
#import "ICRStoreListViewController.h"
#import "ICRStoreDetailViewController.h"
#import "ICRAnnouncementViewController.h"
#import "ICRFunctionBaseView.h"
#import "ICRFunctionBaseView.h"
#import "ICRFunctionEntity.h"
#import "ICRFunctionEntity.h"
...
@@ -26,7 +20,10 @@
...
@@ -26,7 +20,10 @@
#import "SurveyViewController.h"
#import "SurveyViewController.h"
#import "AddWorkSheetViewController.h"
#import "AddWorkSheetViewController.h"
#import "NewPurchaseViewController.h"
#import "NewPurchaseViewController.h"
#import "NewPurchaseNoticeViewController.h"
#import "SeePurchaseNoticeViewController.h"
#import "NewPurchaseViewController.h"
#import "PurchaseViewController.h"
#import "GXFFunctionsViewController.h"
#import "GXFFunctionsViewController.h"
...
@@ -36,6 +33,7 @@
...
@@ -36,6 +33,7 @@
#import "GXFFunctionCollectionViewCell.h"
#import "GXFFunctionCollectionViewCell.h"
#import "GXFFunctionDB.h"
#import "GXFFunctionDB.h"
#define ICRFUNCTION_IMG_TOP_PADDING (25)
#define ICRFUNCTION_IMG_TOP_PADDING (25)
...
@@ -132,6 +130,7 @@ static NSString *collectionCellID = @"collectionCell";
...
@@ -132,6 +130,7 @@ static NSString *collectionCellID = @"collectionCell";
ICRFunctionEntity
*
functionEntity
=
[[
ICRFunctionEntity
alloc
]
init
];
ICRFunctionEntity
*
functionEntity
=
[[
ICRFunctionEntity
alloc
]
init
];
functionEntity
.
functionName
=
displayFunction
.
functionName
;
functionEntity
.
functionName
=
displayFunction
.
functionName
;
functionEntity
.
iconName
=
displayFunction
.
functionImgName
;
functionEntity
.
iconName
=
displayFunction
.
functionImgName
;
functionEntity
.
functionItemTag
=
displayFunction
.
functionItemTag
;
[
funtionEntitlesArr
addObject
:
functionEntity
];
[
funtionEntitlesArr
addObject
:
functionEntity
];
}
}
...
@@ -207,16 +206,88 @@ static NSString *collectionCellID = @"collectionCell";
...
@@ -207,16 +206,88 @@ static NSString *collectionCellID = @"collectionCell";
}
}
#pragma 给cell的内容赋值
#pragma ICRFunctionBaseViewDelegate
-
(
void
)
p_contentToTableViewCell
:
(
UITableViewCell
*
)
cell
andArray
:
(
NSArray
*
)
array
{
for
(
int
count
=
0
;
count
<
array
.
count
;
count
++
)
{
-
(
void
)
ICRFunctionBaseView
:
(
ICRFunctionItemControl
*
)
imageView
{
GXFDisplayFunction
*
dFunction
=
(
GXFDisplayFunction
*
)
array
[
count
];
switch
(
imageView
.
tag
)
{
cell
.
imageView
.
image
=
[
UIImage
imageNamed
:
dFunction
.
functionSmallImgName
];
case
kFunctionNotice
:
//公告
cell
.
textLabel
.
text
=
dFunction
.
functionName
;
{
// ICRAnnouncementViewController *aVC = [[ICRAnnouncementViewController alloc] init];
// [self PushViewController:aVC animated:YES];
}
break
;
case
kFunctionNewSurvey
:
//新建行情
{
NewSurveyViewController
*
svc
=
[[
NewSurveyViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"AddSurvey"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionSeeSurvey
:
//查看行情
{
SurveyViewController
*
svc
=
[[
SurveyViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"Survey"
];
svc
.
navigationItem
.
hidesBackButton
=
YES
;
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionNewPurchaseNotice
:
//新建采购通知单
{
NewPurchaseNoticeViewController
*
svc
=
[[
NewPurchaseNoticeViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"Survey2"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionSeePurchaseNotice
:
//查看采购通知单
{
SeePurchaseNoticeViewController
*
svc
=
[[
SeePurchaseNoticeViewController
alloc
]
init
];
svc
.
title
=
[
IBTCommon
localizableString
:
@"Survey3"
];
[
self
PushViewController
:
svc
animated
:
YES
];
}
break
;
case
kFunctionNewPurchase
:
//新建采购单
{
NewPurchaseViewController
*
nvc
=
[[
NewPurchaseViewController
alloc
]
init
];
nvc
.
title
=
@"新建采购单"
;
[
self
PushViewController
:
nvc
animated
:
YES
];
}
break
;
case
kFunctionSeePurchase
:{
PurchaseViewController
*
pvc
=
[[
PurchaseViewController
alloc
]
init
];
pvc
.
title
=
@"采购单"
;
[
self
PushViewController
:
pvc
animated
:
YES
];
}
break
;
default
:
return
;
break
;
}
}
}
}
//UICollectionView
//#pragma 给cell的内容赋值
//- (void)p_contentToTableViewCell: (UITableViewCell *)cell andArray: (NSArray *)array {
// for (int count = 0; count < array.count; count ++) {
// GXFDisplayFunction *dFunction = (GXFDisplayFunction *)array[count];
// cell.imageView.image = [UIImage imageNamed:dFunction.functionSmallImgName];
// cell.textLabel.text = dFunction.functionName;
// }
//}
#pragma UICollectionViewDataSource,UICollectionViewDelegate
#pragma UICollectionViewDataSource,UICollectionViewDelegate
-
(
NSInteger
)
numberOfSectionsInCollectionView
:
(
UICollectionView
*
)
collectionView
{
-
(
NSInteger
)
numberOfSectionsInCollectionView
:
(
UICollectionView
*
)
collectionView
{
...
...
XFFruit/ViewControllers/Home/Models/GXFDisplayFunction.h
View file @
182b65ff
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
@property
(
nonatomic
,
copy
)
NSString
*
functionImgName
;
//
@property
(
nonatomic
,
copy
)
NSString
*
functionImgName
;
//
@property
(
nonatomic
,
copy
)
NSString
*
functionSmallImgName
;
@property
(
nonatomic
,
copy
)
NSString
*
functionSmallImgName
;
@property
(
nonatomic
,
assign
)
BOOL
isSelected
;
//选中
@property
(
nonatomic
,
assign
)
BOOL
isSelected
;
//选中
@property
(
nonatomic
,
assign
)
NSInteger
functionItemTag
;
+
(
instancetype
)
initClassWithDictionary
:
(
NSDictionary
*
)
dict
;
+
(
instancetype
)
initClassWithDictionary
:
(
NSDictionary
*
)
dict
;
-
(
instancetype
)
initWithDictionary
:
(
NSDictionary
*
)
dict
;
-
(
instancetype
)
initWithDictionary
:
(
NSDictionary
*
)
dict
;
...
...
XFFruit/ViewControllers/Login/ICRLoginViewController.m
View file @
182b65ff
...
@@ -153,6 +153,7 @@
...
@@ -153,6 +153,7 @@
}
}
//更改功能权限
//更改功能权限
for
(
int
count
=
0
;
count
<
userUtil
.
permissions
.
count
;
count
++
)
{
for
(
int
count
=
0
;
count
<
userUtil
.
permissions
.
count
;
count
++
)
{
GXFFunction
*
function
=
[[
GXFFunctionDB
sharedInstance
]
functionSelectWithId
:[
userUtil
.
permissions
[
count
]
integerValue
]];
GXFFunction
*
function
=
[[
GXFFunctionDB
sharedInstance
]
functionSelectWithId
:[
userUtil
.
permissions
[
count
]
integerValue
]];
...
@@ -162,6 +163,9 @@
...
@@ -162,6 +163,9 @@
}
}
}
}
if
(
!
[[
GXFFunctionDB
sharedInstance
]
defaultdisplayFunctions
])
{
[[
GXFFunctionDB
sharedInstance
]
defaultdisplayFunctions
];
}
...
...
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