Commit 182b65ff authored by freecui's avatar freecui

首页功能跳转

parent b9a36cf9
......@@ -66,7 +66,7 @@
if (![_dataBase open]) {
[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];
return work;
......@@ -196,8 +196,8 @@
#pragma displayFunction
- (BOOL)insertDisplayFunction: (GXFDisplayFunction *)displayFunction {
NSString *inserSql = @"INSERT INTO displayFunction(functionId,functionName,functionImgName,functionSmallImgName) VALUES(?,?,?,?)";
BOOL work = [_dataBase executeUpdate:inserSql,@(displayFunction.functionId),displayFunction.functionName,displayFunction.functionImgName,displayFunction.functionSmallImgName];
NSString *inserSql = @"INSERT INTO displayFunction(functionId,functionName,functionImgName,functionSmallImgName,functionItemTag) VALUES(?,?,?,?,?)";
BOOL work = [_dataBase executeUpdate:inserSql,@(displayFunction.functionId),displayFunction.functionName,displayFunction.functionImgName,displayFunction.functionSmallImgName,@(displayFunction.functionItemTag)];
return work;
}
......@@ -209,6 +209,7 @@
displayFunction.functionName = [rs stringForColumn:@"functionName"];
displayFunction.functionImgName = [rs stringForColumn:@"functionImgName"];
displayFunction.functionSmallImgName = [rs stringForColumn:@"functionSmallImgName"];
displayFunction.functionItemTag = [rs intForColumn:@"functionItemTag"];
break;
}
return displayFunction;
......@@ -270,6 +271,7 @@
displayFunction.functionImgName = [rs stringForColumn:@"functionImgName"];
displayFunction.functionSmallImgName = [rs stringForColumn:@"functionSmallImgName"];
displayFunction.isSelected = [rs intForColumn:@"isSelected"];
displayFunction.functionItemTag = [rs intForColumn:@"functionItemTag"];
return displayFunction;
}
//返回被选中的
......
......@@ -111,6 +111,14 @@
@"新建转运单", @"查看转运单", @"查看转运单"];
//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)) {
NSLog(@"展现功能界面:插入的数据不是一一对应的");
return nil;
......@@ -123,6 +131,7 @@
displayFunction.functionName = functionsName[count];
displayFunction.functionImgName = functionsImageName[count];
//displayFunction.functionSmallImgName = fu
displayFunction.functionItemTag = [functionItemTag[count] integerValue];
[muarr addObject:displayFunction];
}
......
......@@ -11,28 +11,32 @@
//@protocol ICRFuctionItemControlDelegate;
typedef NS_ENUM (NSUInteger, ICRFunctionID) {
kFunctionAnnouncement = 0,
kFunctionTaskManagement,
kFunctionPatrolPlan,
kFunctionMyShop,
kFunctionNavigation,
kFunctionComeShopReg,
kFunctionLeaveShopReg,
kFunctionCreatTask,
kFunctionHandleTask,
kFunctionNotice = 0, //公告
kFunctionNewSurvey, //新建行情调研
kFunctionSeeSurvey, //查看行情调研
kFunctionFeeBackSurvey, //填写行情反馈
kFunctionNewPurchaseNotice, //新建采购通知
kFunctionSeePurchaseNotice, //查看采购通知
kFunctionNewPurchase, // 新建采购单
kFunctionSeePurchase, // 查看采购单
kFunctionExaminePurchase, // 审核采购单【供应商】
kFunctionNewShipment, // 新建发运单
kFunctionSeeShipment, // 查看发运单
kFunctionNewProcessing, // 新增加工单
kFunctionSeeProcessing, // 查看加工单
kFunctionNotice,
kFunctionNewSurvey,
kFunctionSeeSurvey,
kFunctionFeeBackSurvey,
kFunctionNewPurchaseNotice,
kFunctionSeePurchaseNotice,
kFunctionNewPurchase,
kFunctionSeePurchase,
kFunctionExaminePurchas,
kFunctionNewShipment,
kFunctionSeeShipment,
kFunctionNewProcessing,
kFunctionAnnouncement ,
kFunctionTaskManagement,
kFunctionPatrolPlan,
kFunctionMyShop,
kFunctionNavigation,
kFunctionComeShopReg,
kFunctionLeaveShopReg,
kFunctionCreatTask,
kFunctionHandleTask
};
@interface ICRFunctionItemControl : UIControl
......
......@@ -78,7 +78,7 @@
//新建采购单
@(kFunctionSeePurchase),
//查看采购单
@(kFunctionExaminePurchas),
@(kFunctionExaminePurchase),
//审核采购单
@(kFunctionNewShipment),
//新建发运单
......@@ -172,28 +172,28 @@
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 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;
default:
return;
......
......@@ -12,12 +12,6 @@
#import "ICRHomeViewController.h"
#import "ICRTaskListViewController.h"
#import "ICRPatrolPlanViewController.h"
#import "ICRStoreListViewController.h"
#import "ICRStoreDetailViewController.h"
#import "ICRAnnouncementViewController.h"
#import "ICRFunctionBaseView.h"
#import "ICRFunctionEntity.h"
......@@ -26,7 +20,10 @@
#import "SurveyViewController.h"
#import "AddWorkSheetViewController.h"
#import "NewPurchaseViewController.h"
#import "NewPurchaseNoticeViewController.h"
#import "SeePurchaseNoticeViewController.h"
#import "NewPurchaseViewController.h"
#import "PurchaseViewController.h"
#import "GXFFunctionsViewController.h"
......@@ -36,6 +33,7 @@
#import "GXFFunctionCollectionViewCell.h"
#import "GXFFunctionDB.h"
#define ICRFUNCTION_IMG_TOP_PADDING (25)
......@@ -132,6 +130,7 @@ static NSString *collectionCellID = @"collectionCell";
ICRFunctionEntity *functionEntity = [[ICRFunctionEntity alloc]init];
functionEntity.functionName = displayFunction.functionName;
functionEntity.iconName = displayFunction.functionImgName;
functionEntity.functionItemTag = displayFunction.functionItemTag;
[funtionEntitlesArr addObject:functionEntity];
}
......@@ -207,16 +206,88 @@ static NSString *collectionCellID = @"collectionCell";
}
#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 ICRFunctionBaseViewDelegate
- (void)ICRFunctionBaseView:(ICRFunctionItemControl *)imageView {
switch (imageView.tag) {
case kFunctionNotice://公告
{
// 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
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
......
......@@ -15,6 +15,7 @@
@property (nonatomic, copy) NSString *functionImgName; //
@property (nonatomic, copy) NSString *functionSmallImgName;
@property (nonatomic, assign) BOOL isSelected; //选中
@property (nonatomic, assign) NSInteger functionItemTag;
+ (instancetype)initClassWithDictionary: (NSDictionary *)dict;
- (instancetype)initWithDictionary: (NSDictionary *)dict;
......
......@@ -152,6 +152,7 @@
[[GXFFunctionDBHelper sharedInstance] insertAllOriginDisplayFunctions];
}
//更改功能权限
for (int count = 0; count < userUtil.permissions.count; count ++) {
......@@ -162,6 +163,9 @@
}
}
if (![[GXFFunctionDB sharedInstance]defaultdisplayFunctions]) {
[[GXFFunctionDB sharedInstance]defaultdisplayFunctions];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment