Commit 8f8df89a authored by zhu's avatar zhu

Merge branch 'DEV_20150805_001' of http://121.42.32.57/root/xffruit into DEV_20150805_001

Conflicts:
	XFFruit/ViewControllers/Business/BusinessViewController.m
parents d5a96360 5bfa7b5f
...@@ -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,functionItemTag INTEGER )"; NSString *createTableSql = @"CREATE TABLE IF NOT EXISTS displayFunction (Id INTEGER PRIMARY KEY AUTOINCREMENT,functionId INTEGER,functionName VARCHAR ,functionImgName VARCHAR,functionSmallImgName VARCHAR, isSelected INTEGER,hasPermission INTEGER,functionItemTag INTEGER )";
BOOL work = [_dataBase executeUpdate:createTableSql]; BOOL work = [_dataBase executeUpdate:createTableSql];
return work; return work;
...@@ -196,24 +196,31 @@ ...@@ -196,24 +196,31 @@
#pragma displayFunction #pragma displayFunction
- (BOOL)insertDisplayFunction: (GXFDisplayFunction *)displayFunction { - (BOOL)insertDisplayFunction: (GXFDisplayFunction *)displayFunction {
NSString *inserSql = @"INSERT INTO displayFunction(functionId,functionName,functionImgName,functionSmallImgName,functionItemTag) VALUES(?,?,?,?,?)"; NSString *inserSql = @"INSERT INTO displayFunction(functionId,functionName,functionImgName,functionSmallImgName,hasPermission,functionItemTag) VALUES(?,?,?,?,?,?)";
BOOL work = [_dataBase executeUpdate:inserSql,@(displayFunction.functionId),displayFunction.functionName,displayFunction.functionImgName,displayFunction.functionSmallImgName,@(displayFunction.functionItemTag)]; BOOL work = [_dataBase executeUpdate:inserSql,@(displayFunction.functionId),displayFunction.functionName,displayFunction.functionImgName,displayFunction.functionSmallImgName,@(0),@(displayFunction.functionItemTag)];
return work; return work;
} }
- (GXFDisplayFunction *)selectDisplayFunctionByFunctionId: (NSInteger)functionId{ //- (GXFDisplayFunction *)upDatePermissionDisplayFunctionByFunctionId: (NSInteger)functionId {
GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init]; // GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init];
FMResultSet *rs = [_dataBase executeQuery:@"SELET * FROM displayFunction WHERE functionId = ? ",@(functionId)]; // FMResultSet *rs = [_dataBase executeQuery:@"SELET * FROM displayFunction WHERE functionId = ? ",@(functionId)];
while ([rs next]) { // while ([rs next]) {
displayFunction.functionId = [rs intForColumn:@"functionId"]; // displayFunction.functionId = [rs intForColumn:@"functionId"];
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"]; // displayFunction.functionItemTag = [rs intForColumn:@"functionItemTag"];
break; // break;
} // }
return displayFunction; // return displayFunction;
//}
//更新权限
- (BOOL)updateDisplayFunctionPermissionWithId: (GXFDisplayFunction *)displayFunction{
BOOL work = [_dataBase executeUpdate:@"UPDATE displayFunction SET hasPermission = ? where functionId = ?",@(displayFunction.hasPermission),@(displayFunction.functionId)];
return work;
} }
//更新是否选中 //更新是否选中
- (BOOL)updateDisplayFunctionIsSelectedWithId: (GXFDisplayFunction *)displayFunction{ - (BOOL)updateDisplayFunctionIsSelectedWithId: (GXFDisplayFunction *)displayFunction{
BOOL work = [_dataBase executeUpdate:@"UPDATE displayFunction SET isSelected = ? where functionId = ?",@(displayFunction.isSelected),@(displayFunction.functionId)]; BOOL work = [_dataBase executeUpdate:@"UPDATE displayFunction SET isSelected = ? where functionId = ?",@(displayFunction.isSelected),@(displayFunction.functionId)];
...@@ -221,31 +228,195 @@ ...@@ -221,31 +228,195 @@
} }
#pragma 有权限的displayfunctions #pragma 有权限的displayfunctions
//待改正,最好的办法是两张表关联起来查找但是我还没做到 //待改正,最好的办法是两张表关联起来查找但是我还没做到
//返回有权限的,并更新了权限
-(NSArray *)displayFunctionsHasPermission{ -(NSArray *)displayFunctionsHasPermission{
NSMutableArray *muArr = [NSMutableArray array]; NSMutableArray *muArr = [NSMutableArray array];
NSArray *hasPermission = [self p_functionsIdPermission]; NSArray *hasPermission = [self p_functionsIdPermission];
BOOL hasSeeOption1 = NO;
BOOL hasSeeOption3 = NO;
BOOL hasSeeOption4 = NO;
BOOL hasSeeOption5 = NO;
BOOL hasSeeOption6 = NO;
BOOL hasSeeOption7 = NO;
for (int count = 0; count < hasPermission.count; count ++) { for (int count = 0; count < hasPermission.count; count ++) {
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction WHERE functionId = ?",hasPermission[count] ]; FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction WHERE functionId = ?",hasPermission[count] ];
while ([rs next]) { while ([rs next]) {
GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs]; GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs];
displayFunction.hasPermission = YES;
[self updateDisplayFunctionPermissionWithId:displayFunction];
[muArr addObject:displayFunction]; [muArr addObject:displayFunction];
if (displayFunction.functionId == 500102 && hasSeeOption1 == NO) {
hasSeeOption1 = YES;
}
if (displayFunction.functionId == 500103 && hasSeeOption1 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption1 = NO;
}
//"采购通知"
if (displayFunction.functionId == 500302 && hasSeeOption3 == NO) {
hasSeeOption3 = YES;
}
if (displayFunction.functionId == 500303 && hasSeeOption3 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption3 = NO;
}
//采购单???? 有三个:"全部查看权"、"本人查看权"、 "供应商查看权"
if (displayFunction.functionId == 500402 && hasSeeOption4 == NO) {
hasSeeOption4 = YES;
}
if (displayFunction.functionId == 500403 && hasSeeOption4 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption4 = YES;
}
//"发运单"
if (displayFunction.functionId == 500502 && hasSeeOption5 == NO) {
hasSeeOption5 = YES;
}
if (displayFunction.functionId == 500503 && hasSeeOption5 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption5 = NO;
}
//"转运单"
if (displayFunction.functionId == 500602 && hasSeeOption6 == NO) {
hasSeeOption6 = YES;
}
if (displayFunction.functionId == 500603 && hasSeeOption6 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption6 = NO;
}
//"加工单"
if (displayFunction.functionId == 500702 && hasSeeOption7 == NO) {
hasSeeOption7 = YES;
}
if (displayFunction.functionId == 500703 && hasSeeOption7 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption7 = NO;
}
continue;
} }
} }
return muArr; return muArr;
} }
////把显示重复功能的去掉
//- (NSArray *)siftDuplicationDisplayFunctionsButton {
// NSMutableArray *allDisplayFunctionsArr = [NSMutableArray arrayWithArray:[self displayFunctionsHasPermission]];
// NSMutableArray *muArr = [NSMutableArray array];
//
// NSArray *hasPermission = [self p_functionsIdPermission];
// BOOL hasSeeOption1 = NO;
//
// BOOL hasSeeOption3 = NO;
// BOOL hasSeeOption4 = NO;
// BOOL hasSeeOption5 = NO;
// BOOL hasSeeOption6 = NO;
// BOOL hasSeeOption7 = NO;
//
// for (int count = 0; count < hasPermission.count; count ++) {
// FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction WHERE functionId = ?",hasPermission[count] ];
// while ([rs next]) {
// GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs];
//
// [muArr addObject:displayFunction];
// //"行情反馈",
// if (displayFunction.functionId == 500102 && hasSeeOption1 == NO) {
// hasSeeOption1 = YES;
// }
// if (displayFunction.functionId == 500103 && hasSeeOption1 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption1 = NO;
// }
//
// //"采购通知"
// if (displayFunction.functionId == 500302 && hasSeeOption3 == NO) {
// hasSeeOption3 = YES;
// }
// if (displayFunction.functionId == 500303 && hasSeeOption3 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption3 = NO;
// }
//
// //采购单???? 有三个:"全部查看权"、"本人查看权"、 "供应商查看权"
// if (displayFunction.functionId == 500402 && hasSeeOption4 == NO) {
// hasSeeOption4 = YES;
// }
// if (displayFunction.functionId == 500403 && hasSeeOption4 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption4 = YES;
// }
//// if (displayFunction.functionId == 500403 && hasSeeOption4 == NO) {
//// //[muArr removeObject:displayFunction];
//// hasSeeOption4 = YES;
//// }
//// if (displayFunction.functionId == 500403 && hasSeeOption4 == YES) {
//// [muArr removeObject:displayFunction];
//// hasSeeOption4 = YES;
//// }
//// if (displayFunction.functionId == 500404 && hasSeeOption4 == YES) {
//// [muArr removeObject:displayFunction];
//// hasSeeOption4 = YES;
//// }
//
// //"发运单"
// if (displayFunction.functionId == 500502 && hasSeeOption5 == NO) {
// hasSeeOption5 = YES;
// }
// if (displayFunction.functionId == 500503 && hasSeeOption5 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption5 = NO;
// }
//
// //"转运单"
// if (displayFunction.functionId == 500602 && hasSeeOption6 == NO) {
// hasSeeOption6 = YES;
// }
// if (displayFunction.functionId == 500603 && hasSeeOption6 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption6 = NO;
// }
// //"加工单"
// if (displayFunction.functionId == 500702 && hasSeeOption7 == NO) {
// hasSeeOption7 = YES;
// }
// if (displayFunction.functionId == 500703 && hasSeeOption7 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption7 = NO;
// }
//
// }
// }
//
// return muArr;
//
//}
//默认配置显示功能 初始配置为 //默认配置显示功能 初始配置为
- (NSArray *)defaultdisplayFunctions { - (NSArray *)defaultdisplayFunctions {
NSMutableArray *arr = [NSMutableArray arrayWithArray:[self displayFunctionsHasPermission]]; NSMutableArray *arr = [NSMutableArray arrayWithArray:[self displayFunctionsHasPermission]];
for (int count = 0; count < arr.count; count ++) { for (int count = 0; count < arr.count; count ++) {
if ((count % 2) || (count == 0)) { if ((count % 2) || (count == 0)) {
GXFDisplayFunction *displayFunction = (GXFDisplayFunction *)arr[count]; GXFDisplayFunction *displayFunction = (GXFDisplayFunction *)arr[count];
displayFunction.isSelected = YES; displayFunction.isSelected = YES;
[self updateDisplayFunctionIsSelectedWithId:displayFunction]; [self updateDisplayFunctionIsSelectedWithId:displayFunction];
[arr replaceObjectAtIndex:count withObject:displayFunction]; [arr replaceObjectAtIndex:count withObject:displayFunction];
} }
} }
...@@ -256,9 +427,72 @@ ...@@ -256,9 +427,72 @@
- (NSArray *)originDisplayFunctions { - (NSArray *)originDisplayFunctions {
NSMutableArray *muArr = [NSMutableArray array]; NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction"]; FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction"];
BOOL hasSeeOption1 = NO;
BOOL hasSeeOption3 = NO;
BOOL hasSeeOption4 = NO;
BOOL hasSeeOption5 = NO;
BOOL hasSeeOption6 = NO;
BOOL hasSeeOption7 = NO;
while ([rs next]) { while ([rs next]) {
GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs]; GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs];
[muArr addObject:displayFunction]; [muArr addObject:displayFunction];
//"行情反馈",
if (displayFunction.functionId == 500102 && hasSeeOption1 == NO) {
hasSeeOption1 = YES;
}
if (displayFunction.functionId == 500103 && hasSeeOption1 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption1 = NO;
}
//"采购通知"
if (displayFunction.functionId == 500302 && hasSeeOption3 == NO) {
hasSeeOption3 = YES;
}
if (displayFunction.functionId == 500303 && hasSeeOption3 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption3 = NO;
}
//采购单???? 有三个:"全部查看权"、"本人查看权"、 "供应商查看权"
if (displayFunction.functionId == 500402 && hasSeeOption4 == NO) {
hasSeeOption4 = YES;
}
if (displayFunction.functionId == 500403 && hasSeeOption4 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption4 = YES;
}
//"发运单"
if (displayFunction.functionId == 500502 && hasSeeOption5 == NO) {
hasSeeOption5 = YES;
}
if (displayFunction.functionId == 500503 && hasSeeOption5 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption5 = NO;
}
//"转运单"
if (displayFunction.functionId == 500602 && hasSeeOption6 == NO) {
hasSeeOption6 = YES;
}
if (displayFunction.functionId == 500603 && hasSeeOption6 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption6 = NO;
}
//"加工单"
if (displayFunction.functionId == 500702 && hasSeeOption7 == NO) {
hasSeeOption7 = YES;
}
if (displayFunction.functionId == 500703 && hasSeeOption7 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption7 = NO;
}
} }
return muArr; return muArr;
...@@ -271,6 +505,7 @@ ...@@ -271,6 +505,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.hasPermission = [rs intForColumn:@"hasPermission"];
displayFunction.functionItemTag = [rs intForColumn:@"functionItemTag"]; displayFunction.functionItemTag = [rs intForColumn:@"functionItemTag"];
return displayFunction; return displayFunction;
} }
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
@(500101),@(500102),@(500103), @(500101),@(500102),@(500103),
@(500201), @(500201),
@(500301),@(500302),@(500303),//"采购通知", @(500301),@(500302),@(500303),//"采购通知",
@(500401),@(500402),@(500403),@(500406),//"采购单" @(500401),@(500402),@(500403),@(500404),//"采购单"
@(500501),@(500502),@(500503),//"发运单" @(500501),@(500502),@(500503),//"发运单"
@(500601),@(500602),@(500603),//"转运单" @(500601),@(500602),@(500603),//"转运单"
@(500701),@(500702),@(500703),];//加工单 @(500701),@(500702),@(500703),];//加工单
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
@"新建行情调研",@"查看行情调研", @"查看行情调研", @"新建行情调研",@"查看行情调研", @"查看行情调研",
@"填写行情反馈", @"填写行情反馈",
@"新建采购通知",@"查看采购通知", @"查看采购通知", @"新建采购通知",@"查看采购通知", @"查看采购通知",
@"新建采购单",@"查看采购单", @"查看采购单", @"审核采购单【供应商】", @"新建采购单",@"查看采购单", @"查看采购单", @"审核采购单",//【供应商】",
@"新建发运单",@"查看发运单", @"查看发运单", @"新建发运单",@"查看发运单", @"查看发运单",
@"新增加工单",@"查看加工单", @"查看加工单", @"新增加工单",@"查看加工单", @"查看加工单",
@"新建转运单", @"查看转运单", @"查看转运单"]; @"新建转运单", @"查看转运单", @"查看转运单"];
......
...@@ -1741,7 +1741,9 @@ acceptTypeJson:YES ...@@ -1741,7 +1741,9 @@ acceptTypeJson:YES
fail( error ); fail( error );
} }
}; };
NSString *dateStr = [[NSDate date] httpParameterString];
#pragma 请求参数的下载时间应该有要求????
NSString *dateStr = @"2015-05-04";//[[NSDate date] httpParameterString];//urlAction
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:urlAction] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)]; NSString *urlStr = [[[self class] UrlForPluginHTTPAction:urlAction] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
......
...@@ -290,6 +290,7 @@ ...@@ -290,6 +290,7 @@
} }
- (NSString *)httpParameterString { - (NSString *)httpParameterString {
NSString *str = [self stringWithFormatter:@"%Y-%m-%d %H:%M:%S"];
return [self stringWithFormatter:@"%Y-%m-%d %H:%M:%S"]; return [self stringWithFormatter:@"%Y-%m-%d %H:%M:%S"];
} }
- (NSString *)coverStringFromString { - (NSString *)coverStringFromString {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
// Fuctions // Fuctions
- (NSDictionary *)dictForCommit; - (NSDictionary *)dictForCommit;
- (NSMutableDictionary *)mutableDictDateToStringForCommit;//把属性为日期类型的转化为string
- (NSDictionary *)dictForLocalSave; - (NSDictionary *)dictForLocalSave;
- (void)praseFromJsonDict:(NSDictionary *)dict; - (void)praseFromJsonDict:(NSDictionary *)dict;
- (void)praseFromLocalDict:(NSDictionary *)dict; - (void)praseFromLocalDict:(NSDictionary *)dict;
......
...@@ -418,6 +418,48 @@ ...@@ -418,6 +418,48 @@
return mDict; return mDict;
} }
- (NSMutableDictionary *)mutableDictDateToStringForCommit {
unsigned int count;
objc_property_t *properties = class_copyPropertyList([self class], &count);
if (count == 0) {
free(properties);
return nil;
}
NSMutableDictionary *mDict = [NSMutableDictionary dictionary];
NSDictionary *dictSpKeyDict = [[self class] specialKeysAndReplaceKeys];
NSArray *arrSpecialKeys = [dictSpKeyDict allKeys];
NSArray *arrCustomKeys = [[self class] customAcitonKeys];
NSArray *arrLocalKeys = [[self class] localKeys];
for (unsigned int i = 0; i < count; i++) {
objc_property_t property = properties[i];
NSString *key = [NSString stringWithUTF8String:property_getName(property)];
id value = [self valueForKey:key];
if ([value isKindOfClass:[NSDate class]]) {
value = [value httpParameterString];
}
if (value) {
if ([arrCustomKeys containsObject:key] ||
[arrLocalKeys containsObject:key]) {
continue;
} else if ([arrSpecialKeys containsObject:key]) {
[mDict addEntriesFromDictionary:@{dictSpKeyDict[key]: value}];
} else {
[mDict addEntriesFromDictionary:@{key: value}];
}
}
}
free(properties);
return mDict;
}
- (NSDictionary *)dictForLocalSave { - (NSDictionary *)dictForLocalSave {
unsigned int count; unsigned int count;
objc_property_t *properties = class_copyPropertyList([self class], &count); objc_property_t *properties = class_copyPropertyList([self class], &count);
......
...@@ -8,11 +8,6 @@ ...@@ -8,11 +8,6 @@
#import "BusinessViewController.h" #import "BusinessViewController.h"
#import "ICRTaskListViewController.h"
#import "ICRPatrolPlanViewController.h"
#import "ICRStoreListViewController.h"
#import "ICRStoreDetailViewController.h"
#import "ICRAnnouncementViewController.h"
#import "NewSurveyViewController.h" #import "NewSurveyViewController.h"
#import "SurveyViewController.h" #import "SurveyViewController.h"
...@@ -31,7 +26,13 @@ ...@@ -31,7 +26,13 @@
#import"PurchaseNoticeViewController.h" #import"PurchaseNoticeViewController.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 @end
...@@ -39,79 +40,74 @@ ...@@ -39,79 +40,74 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// [self initView];
[self setupSubviews]; [self setupSubviews];
// Do any additional setup after loading the view.
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // 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)];
//新建加工单
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 ++;
}
ICRFunctionBaseView *baseView = [ICRFunctionBaseView initWithFunctionData:arrFunctionEntities]; - (void)setupFunctionBaseView {
NSMutableArray *funtionEntitlesArr = [NSMutableArray array];
baseView.frame = (CGRect){ 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];
}
self.c_functionBaseView = [ICRFunctionBaseView initWithFunctionData:funtionEntitlesArr];
_c_functionBaseView.frame = (CGRect){
.origin.x = 0, .origin.x = 0,
.origin.y =0, .origin.y =0,
.size.width = CGRectGetWidth(self.view.frame), .size.width = CGRectGetWidth(self.view.frame),
.size.height = CGRectGetHeight(self.view.frame),}; .size.height = _c_functionBaseView.height};//CGRectGetHeight(self.view.frame),};
baseView.backgroundColor = [UIColor clearColor]; _c_functionBaseView.backgroundColor = [UIColor clearColor];
baseView.m_delegate = self; _c_functionBaseView.m_delegate = self;
[self.view addSubview:baseView];
} }
-(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 #pragma mark - ICRFunctionBaseViewDelegate
- (void)ICRFunctionBaseView:(ICRFunctionItemControl *)imageView { - (void)ICRFunctionBaseView:(ICRFunctionItemControl *)imageView {
/* /*
...@@ -123,21 +119,22 @@ ...@@ -123,21 +119,22 @@
switch (imageView.tag) { switch (imageView.tag) {
case kFunctionNotice://公告 case kFunctionNotice://公告
{ {
ICRAnnouncementViewController *aVC = [[ICRAnnouncementViewController alloc] init]; // ICRAnnouncementViewController *aVC = [[ICRAnnouncementViewController alloc] init];
[self PushViewController:aVC animated:YES]; // [self PushViewController:aVC animated:YES];
} }
break; break;
case kFunctionNewSurvey://新建行情 case kFunctionNewSurvey://新建行情
{ {
NewSurveyViewController *svc = [[NewSurveyViewController alloc] init]; NewSurveyViewController *svc = [[NewSurveyViewController alloc] init];
svc.navTitle = [IBTCommon localizableString:@"AddSurvey"]; svc.title = [IBTCommon localizableString:@"AddSurvey"];
[self PushViewController:svc animated:YES]; [self PushViewController:svc animated:YES];
} }
break; break;
case kFunctionSeeSurvey://查看行情调研 case kFunctionSeeSurvey://查看行情
{ {
SurveyViewController *svc = [[SurveyViewController alloc] init]; SurveyViewController *svc = [[SurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey"]; svc.title = [IBTCommon localizableString:@"Survey"];
svc.navigationItem.hidesBackButton = YES;
[self PushViewController:svc animated:YES]; [self PushViewController:svc animated:YES];
} }
break; break;
...@@ -171,60 +168,38 @@ ...@@ -171,60 +168,38 @@
[self PushViewController:pvc animated:YES]; [self PushViewController:pvc animated:YES];
} }
break; break;
case kFunctionNewProcessing:{
GXFNewProcessViewController *pvc = [[GXFNewProcessViewController alloc]init];
// case kFunctionTaskManagement://任务管理 //pvc.title = @"采购单";
// { [self PushViewController:pvc animated:YES];
// ICRTaskListViewController *tVC = [[ICRTaskListViewController alloc] init]; }
// [self PushViewController:tVC animated:YES]; break;
// } case kFunctionSeeProcessing:{
// break; GXFSeeProcessViewController *seeProcessVC= [[GXFSeeProcessViewController alloc]init];
// case kFunctionPatrolPlan://巡店计划 [self PushViewController:seeProcessVC animated:YES];
// { }
// ICRPatrolPlanViewController *pVC = [[ICRPatrolPlanViewController alloc] initWithStore:nil isHomeShow:YES]; break;
// [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: default:
return; return;
break; 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 @end
...@@ -54,7 +54,7 @@ static NSString *cellID = @"cell"; ...@@ -54,7 +54,7 @@ static NSString *cellID = @"cell";
self.navigationItem.rightBarButtonItem = rightBarBtn; self.navigationItem.rightBarButtonItem = rightBarBtn;
} }
- (void)setupTableView { - (void)setupTableView {
self.f_tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped]; self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height - 64) style:UITableViewStyleGrouped];
self.f_tableView.dataSource = self; self.f_tableView.dataSource = self;
self.f_tableView.delegate = self; self.f_tableView.delegate = self;
//[self.f_tableView dequeueReusableCellWithIdentifier ] //[self.f_tableView dequeueReusableCellWithIdentifier ]
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
@end @end
@implementation ICRHomeViewController @implementation ICRHomeViewController
static NSString *cellID = @"cell"; static NSString *firestCellID = @"firestCell";
static NSString *secondCellID = @"secondCell"; static NSString *secondCellID = @"secondCell";
static NSString *collectionCellID = @"collectionCell"; static NSString *collectionCellID = @"collectionCell";
//static CGFloat colletionCellHeight [UIScreen mainScreen].bounds.size.width / 3.0 //static CGFloat colletionCellHeight [UIScreen mainScreen].bounds.size.width / 3.0
...@@ -187,24 +187,30 @@ static NSString *collectionCellID = @"collectionCell"; ...@@ -187,24 +187,30 @@ static NSString *collectionCellID = @"collectionCell";
} }
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; UITableViewCell *cell; //= [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
if (indexPath.section == 0) { if (indexPath.section == 0) {
cell = [[GXFNoticeFunctionTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; cell = [tableView dequeueReusableCellWithIdentifier:firestCellID];
if (!cell) {
cell = [[GXFNoticeFunctionTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:firestCellID];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.text = @"查看行情反馈-进行中"; cell.textLabel.text = @"查看行情反馈-进行中";
} else {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"secondCell"];
[cell.contentView addSubview:_f_functionBaseView];
NSLog(@"%@",NSStringFromCGRect(cell.frame));
} }
} else { } else {
cell = [tableView dequeueReusableCellWithIdentifier:secondCellID];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:secondCellID];
} else {
while ([cell.contentView.subviews lastObject] != nil) { while ([cell.contentView.subviews lastObject] != nil) {
[(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview]; [(UIView *)[cell.contentView.subviews lastObject]removeFromSuperview];
} }
} }
[cell.contentView addSubview:_f_functionBaseView];
NSLog(@"%@",NSStringFromCGRect(cell.frame));
}
return cell; return cell;
} }
......
...@@ -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) BOOL hasPermission;
@property (nonatomic, assign) NSInteger functionItemTag; @property (nonatomic, assign) NSInteger functionItemTag;
+ (instancetype)initClassWithDictionary: (NSDictionary *)dict; + (instancetype)initClassWithDictionary: (NSDictionary *)dict;
......
...@@ -163,12 +163,14 @@ ...@@ -163,12 +163,14 @@
} }
} }
if (![[GXFFunctionDB sharedInstance]defaultdisplayFunctions]) { //配置功能 不是默认配置
NSUserDefaults *f_default = [NSUserDefaults standardUserDefaults];
BOOL noDefault = [[f_default objectForKey:@"noDefault"] integerValue] > 0 ? YES : NO;
if (!noDefault) {
[[GXFFunctionDB sharedInstance]defaultdisplayFunctions]; [[GXFFunctionDB sharedInstance]defaultdisplayFunctions];
} }
}; };
void(^fail)(id) = ^(id data) { void(^fail)(id) = ^(id data) {
......
...@@ -58,8 +58,8 @@ typedef NS_ENUM(NSInteger, cellRow) { ...@@ -58,8 +58,8 @@ typedef NS_ENUM(NSInteger, cellRow) {
@property (nonatomic, assign) BOOL d_isProduct; @property (nonatomic, assign) BOOL d_isProduct;
@property (nonatomic, strong) NSArray *d_meteilHeaderArr; @property (nonatomic, strong) NSArray *d_meteilHeaderArr;
@property (nonatomic, strong) NSArray *d_productHeaderArr; @property (nonatomic, strong) NSArray *d_productHeaderArr;
@property (nonatomic, strong) NSMutableArray *d_meteilArr; //@property (nonatomic, strong) NSMutableArray *d_meteilArr;
@property (nonatomic, strong) NSMutableArray *d_productArr; //@property (nonatomic, strong) NSMutableArray *d_productArr;
@property (nonatomic, assign) NSInteger d_editOrDelete; @property (nonatomic, assign) NSInteger d_editOrDelete;
...@@ -86,29 +86,29 @@ typedef NS_ENUM(NSInteger, cellRow) { ...@@ -86,29 +86,29 @@ typedef NS_ENUM(NSInteger, cellRow) {
} }
- (void)addNewMaterail: (NSNotification *)aNotification { - (void)addNewMaterail: (NSNotification *)aNotification {
GXFProcessMaterial *material = aNotification.object; GXFProcessMaterial *material = aNotification.object;
if (_d_meteilArr) { if (_d_materialMuArr) {
[_d_meteilArr addObject:material]; [_d_materialMuArr addObject:material];
[self p_refreshData]; [self p_refreshData];
} }
} }
- (void)addNewProduct: (NSNotification *)aNotification { - (void)addNewProduct: (NSNotification *)aNotification {
GXFProcessProduct *product = aNotification.object; GXFProcessProduct *product = aNotification.object;
if (_d_productArr) { if (_d_productMuArr) {
[_d_productArr addObject:product]; [_d_productMuArr addObject:product];
[self p_refreshData]; [self p_refreshData];
} }
} }
- (void)editProduct: (NSNotification *)aNotification { - (void)editProduct: (NSNotification *)aNotification {
GXFProcessProduct *product = aNotification.object; GXFProcessProduct *product = aNotification.object;
if (_d_productArr) { if (_d_productMuArr) {
[_d_productArr replaceObjectAtIndex:_d_editOrDelete withObject:product];//待做:优化为刷新这一条 [_d_productMuArr replaceObjectAtIndex:_d_editOrDelete withObject:product];//待做:优化为刷新这一条
[self p_refreshData]; [self p_refreshData];
} }
} }
- (void)deleteProduct: (NSNotification *)aNotification { - (void)deleteProduct: (NSNotification *)aNotification {
GXFProcessProduct *product = aNotification.object; GXFProcessProduct *product = aNotification.object;
if (_d_productArr) { if (_d_productMuArr) {
[_d_productArr removeObject:product];////待做:优化为刷新这一条 [_d_productMuArr removeObject:product];////待做:优化为刷新这一条
[self p_refreshData]; [self p_refreshData];
} }
} }
...@@ -184,31 +184,31 @@ typedef NS_ENUM(NSInteger, cellRow) { ...@@ -184,31 +184,31 @@ typedef NS_ENUM(NSInteger, cellRow) {
_selectRowArr = [[NSMutableArray alloc]init]; _selectRowArr = [[NSMutableArray alloc]init];
self.d_processBill = [[GXFProcessBill alloc]init]; self.d_processBill = [[GXFProcessBill alloc]init];
if (!self.d_meteilArr) { if (!self.d_materialMuArr) {
self.d_meteilArr = [NSMutableArray array]; self.d_materialMuArr = [NSMutableArray array];
} }
GXFProcessMaterial *processM = [[GXFProcessMaterial alloc]init]; // GXFProcessMaterial *processM = [[GXFProcessMaterial alloc]init];
processM.uuid = @"00"; // processM.uuid = @"00";
processM.productName = @"Material"; // processM.productName = @"Material";
processM.productUuid = @"01"; // processM.productUuid = @"01";
processM.baseQty = @(10); // processM.baseQty = @(10);
processM.instockDate = [NSDate date]; // processM.instockDate = [NSDate date];
[self.d_meteilArr addObject:processM]; // [self.d_materialMuArr addObject:processM];
[self.d_meteilArr addObject:processM]; // [self.d_materialMuArr addObject:processM];
if (!self.d_productArr) { if (!self.d_productMuArr) {
self.d_productArr = [NSMutableArray array]; self.d_productMuArr = [NSMutableArray array];
} }
GXFProcessProduct *processP = [[GXFProcessProduct alloc]init]; // GXFProcessProduct *processP = [[GXFProcessProduct alloc]init];
processP.uuid = @"11"; // processP.uuid = @"11";
processP.productName = @"product"; // processP.productName = @"product";
processP.productUuid = @"12"; // processP.productUuid = @"12";
processP.baseQty = @(10); // processP.baseQty = @(10);
processP.outstockDate = [NSDate date]; // processP.outstockDate = [NSDate date];
[self.d_productArr addObject:processP]; // [self.d_productMuArr addObject:processP];
NSDictionary *dict = [processP dictForCommit];
} }
- (void)initSubViews { - (void)initSubViews {
self.view.backgroundColor = XXFBgColor; self.view.backgroundColor = XXFBgColor;
...@@ -231,9 +231,9 @@ typedef NS_ENUM(NSInteger, cellRow) { ...@@ -231,9 +231,9 @@ typedef NS_ENUM(NSInteger, cellRow) {
return _d_arrLeftTableV.count; return _d_arrLeftTableV.count;
} else { } else {
if (_d_isProduct) { if (_d_isProduct) {
return 2 + _d_productArr.count; return 2 + _d_productMuArr.count;
} }
return 2 + _d_meteilArr.count; return 2 + _d_materialMuArr.count;
} }
} }
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
...@@ -394,10 +394,10 @@ typedef NS_ENUM(NSInteger, cellRow) { ...@@ -394,10 +394,10 @@ typedef NS_ENUM(NSInteger, cellRow) {
if (cell == nil) { if (cell == nil) {
if (_d_isProduct) { if (_d_isProduct) {
GXFProcessProduct *processP = (GXFProcessProduct *)_d_productArr[indexPath.row - 2]; GXFProcessProduct *processP = (GXFProcessProduct *)_d_productMuArr[indexPath.row - 2];
cell = [[GXFProcessProductTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID processProduct:processP]; cell = [[GXFProcessProductTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID processProduct:processP];
} else { } else {
GXFProcessMaterial *pm = (GXFProcessMaterial *)_d_meteilArr[indexPath.row - 2]; GXFProcessMaterial *pm = (GXFProcessMaterial *)_d_materialMuArr[indexPath.row - 2];
cell = [[GXFProcessMaterialTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID processMaterial:pm]; cell = [[GXFProcessMaterialTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID processMaterial:pm];
} }
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
...@@ -527,7 +527,7 @@ typedef NS_ENUM(NSInteger, cellRow) { ...@@ -527,7 +527,7 @@ typedef NS_ENUM(NSInteger, cellRow) {
- (void)editClick: (UIButton *)btn{ - (void)editClick: (UIButton *)btn{
if (_d_isProduct) { if (_d_isProduct) {
self.d_editOrDelete = btn.tag - 2; self.d_editOrDelete = btn.tag - 2;
GXFProcessProduct *product = _d_productArr[btn.tag - 2]; GXFProcessProduct *product = _d_productMuArr[btn.tag - 2];
GXFPopNewProductViewController *productVC = [[GXFPopNewProductViewController alloc]initWithProcessProduct:product isEdit: YES]; GXFPopNewProductViewController *productVC = [[GXFPopNewProductViewController alloc]initWithProcessProduct:product isEdit: YES];
[self PushViewController:productVC animated:NO]; [self PushViewController:productVC animated:NO];
} else { } else {
...@@ -558,18 +558,22 @@ typedef NS_ENUM(NSInteger, cellRow) { ...@@ -558,18 +558,22 @@ typedef NS_ENUM(NSInteger, cellRow) {
#pragma GXFBottomViewDelegate #pragma GXFBottomViewDelegate
- (void)bottomViewleftButtonClicked:(UIButton *)leftBtn { - (void)bottomViewleftButtonClicked:(UIButton *)leftBtn {
}
- (void)bottomViewRightButtonClicked:(UIButton *)rightBtn {
CLog(@"ffff"); CLog(@"ffff");
//[IBTCommon checkString:_d_processBill.title] //[IBTCommon checkString:_d_processBill.title]
if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.title]) { // if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.title]) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"标题不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; // UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"标题不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show]; // [alert show];
return; // return;
} // }
if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.vendor_name]) { // if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.vendor_name]) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"请选择供应商" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; // UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"请选择供应商" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show]; // [alert show];
return; // return;
} // }
if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.warehouse_name]) { if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.warehouse_name]) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"请选择加工工厂" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"请选择加工工厂" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
...@@ -614,18 +618,22 @@ typedef NS_ENUM(NSInteger, cellRow) { ...@@ -614,18 +618,22 @@ typedef NS_ENUM(NSInteger, cellRow) {
// version = self.survey.version; // version = self.survey.version;
// } // }
// NSDictionary *material = @{@"uuid":@"",@"productUuid":@"",@"productCode":@"",@"productName":@"",@"instockDate":@"",@"place":@"",@"quality":@"",@"baseQty":@"",@"basePrice":@"",@"total":@"",@"remark":@"",};
// NSDictionary *product = @{@"uuid":@"",@"productUuid":@"",@"productCode":@"",@"productName":@"",@"instockDate":@"",@"place":@"",@"quality":@"",@"baseQty":@"",@"basePrice":@"",@"total":@"",@"remark":@"",};
NSMutableArray *productMuArr = [NSMutableArray array]; NSMutableArray *productMuArr = [NSMutableArray array];
for (int count = 0; count < _d_productArr.count; count ++) { for (int count = 0; count < _d_productMuArr.count; count ++) {
GXFProcessProduct *product = (GXFProcessProduct *)_d_productArr[count]; GXFProcessProduct *product = (GXFProcessProduct *)_d_productMuArr[count];
[productMuArr addObject:[product dictForCommit]]; NSMutableDictionary *dic = [product mutableDictDateToStringForCommit];
// NSDictionary *materialdict = @{@"uuid":@"11",@"productUuid":@"402880e64e287fe2014e28895b8a0032",@"productCode":@"农夫山泉",@"productName":@"dd",@"outstockDate":@"2015-09-05 13:36:16 +0000",@"unit":@"",@"qpc":@"kk",@"qpcStr":@"ll",@"quality":@"9",@"baseQty":@"8",@"remark":@""};
[productMuArr addObject:dic];//productdict];
} }
NSMutableArray *materialMuArr = [NSMutableArray array]; NSMutableArray *materialMuArr = [NSMutableArray array];
for (int count = 0; count < _d_productArr.count; count ++) { for (int count = 0; count < _d_materialMuArr.count; count ++) {
GXFProcessMaterial *material = (GXFProcessMaterial *)_d_materialMuArr[count]; GXFProcessMaterial *material = (GXFProcessMaterial *)_d_materialMuArr[count];
[materialMuArr addObject:[material dictForCommit]]; NSMutableDictionary *dic = [material mutableDictDateToStringForCommit];
// NSDictionary *productdict = @{@"uuid":@"",@"productUuid":@"402880e64e287fe2014e28895b8a0032",@"productCode":@"农夫山泉",@"productName":@"dd",@"outstockDate":@"2015-09-05 13:36:16 +0000",@"place":@"",@"quality":@"",@"baseQty":@"1",@"basePrice":@"2",@"total":@"2",@"remark":@""};
[materialMuArr addObject:dic];//materialdict];
} }
...@@ -633,14 +641,14 @@ typedef NS_ENUM(NSInteger, cellRow) { ...@@ -633,14 +641,14 @@ typedef NS_ENUM(NSInteger, cellRow) {
@"version":@(0), @"version":@(0),
@"billnumber":@"", @"billnumber":@"",
@"title":@"title",//[IBTCommon checkString:self.titleStr], @"title":@"title",//[IBTCommon checkString:self.titleStr],
@"vendor_uuid":_d_processBill.vendor_uuid, @"vendor_uuid": @"000",//_d_processBill.vendor_uuid,
@"vendor_code":_d_processBill.vendor_code, @"vendor_code": @"111",//_d_processBill.vendor_code,
@"vendor_name":_d_processBill.vendor_name, @"vendor_name": @"ff",//_d_processBill.vendor_name,
@"warehouse_uuid":_d_processBill.warehouse_uuid, @"warehouse_uuid":_d_processBill.warehouse_uuid,
@"warehouse_code":_d_processBill.warehouse_code, @"warehouse_code":_d_processBill.warehouse_code,
@"warehouse_name":_d_processBill.warehouse_name, @"warehouse_name":_d_processBill.warehouse_name,
@"contact":[IBTCommon checkString: _d_processBill.contact], @"contact":[IBTCommon checkString: _d_processBill.contact],
@"contactPhone":[IBTCommon checkString:_d_processBill.contact], @"contactPhone":[IBTCommon checkString:_d_processBill.contactPhone],
@"total":_d_processBill.total, @"total":_d_processBill.total,
@"remark":[IBTCommon checkString:_d_processBill.remark], @"remark":[IBTCommon checkString:_d_processBill.remark],
@"materials":materialMuArr, @"materials":materialMuArr,
...@@ -648,9 +656,6 @@ typedef NS_ENUM(NSInteger, cellRow) { ...@@ -648,9 +656,6 @@ typedef NS_ENUM(NSInteger, cellRow) {
//[IBTLoadingView showProgressLabel:msg]; //[IBTLoadingView showProgressLabel:msg];
[[ICRHTTPController sharedController] saveSurveyWithAuthenticode:dict success:succ failure:fail]; [[ICRHTTPController sharedController] saveSurveyWithAuthenticode:dict success:succ failure:fail];
}
- (void)bottomViewRightButtonClicked:(UIButton *)rightBtn {
} }
/* /*
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
[IBTLoadingView showProgressLabel:@"正在加载..."]; [IBTLoadingView showProgressLabel:@"正在加载..."];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance]; ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSDictionary *queryOrderDict = @{@"direction":@"desc",@"field":@"billNumber"}; NSDictionary *queryOrderDict = @{@"direction":@"",@"field":@"billNumber"};
NSDictionary *dict = @{ NSDictionary *dict = @{
@"billNumberLike":@"", @"billNumberLike":@"",
@"state":@"", @"state":@"",
......
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