Commit 51d78232 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.xcodeproj/project.pbxproj
parents e96650b5 7c08f920
......@@ -6,5 +6,5 @@ pod 'SSKeychain', '~> 1.2.3'
pod 'FMDB', '~> 2.5'
pod 'Base64nl', '~> 1.2'
pod 'Reveal-iOS-SDK', '~> 1.5.1'
pod 'BaiduMapAPI', '~> 2.8.0'
pod 'BaiduMapAPI', '~> 2.7.0'
pod 'MJRefresh', '~> 2.2.0'
......@@ -20,14 +20,7 @@ PODS:
- AFNetworking/UIKit (2.5.4):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- BaiduMapAPI (2.8.0):
- BaiduMapAPI/All (= 2.8.0)
- BaiduMapAPI/All (2.8.0):
- BaiduMapAPI/Core
- BaiduMapAPI/Extend
- BaiduMapAPI/Core (2.8.0)
- BaiduMapAPI/Extend (2.8.0):
- BaiduMapAPI/Core
- BaiduMapAPI (2.7.0)
- Base64nl (1.2)
- FMDB (2.5):
- FMDB/standard (= 2.5)
......@@ -44,7 +37,7 @@ PODS:
DEPENDENCIES:
- AFNetworking (~> 2.5.4)
- BaiduMapAPI (~> 2.8.0)
- BaiduMapAPI (~> 2.7.0)
- Base64nl (~> 1.2)
- FMDB (~> 2.5)
- MBProgressHUD (~> 0.9.1)
......@@ -55,7 +48,7 @@ DEPENDENCIES:
SPEC CHECKSUMS:
AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e
BaiduMapAPI: e066aa1e85f9fee77a1bc071afb67552852bb0fb
BaiduMapAPI: d6433624b0b4dd156f2d842f394a5011b02a6401
Base64nl: a497bdcd1c01ea793d36b399016195a8713c0e95
FMDB: 96e8f1bcc1329e269330f99770ad4285d9003e52
MBProgressHUD: c47f2c166c126cf2ce36498d80f33e754d4e93ad
......
This diff is collapsed.
//
// GXFFunctionDB.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
#import "GXFFunction.h"
#import "GXFDisplayFunction.h"
@interface GXFFunctionDB : IBTObject
+ (GXFFunctionDB *)sharedInstance;
- (void)createTables;
//- (BOOL)functionTableCreate;
- (BOOL)displayFunctionTableCreate;
- (BOOL)insertFunction: (GXFFunction *)function ;
- (GXFFunction *)functionSelectWithId: (NSInteger)Id;
- (BOOL)updateFunctionHasPermissionWithId: (GXFFunction *)function;
- (BOOL)updateFunctionIsSelectedWithId: (GXFFunction *)function;
- (NSArray *)originFunctions;
//返回全部有权限的function
- (NSArray *)functionsHasPermission;
//既有权限又被选择的
- (NSArray *)functionsHasPermissionAndIsSelected;
#pragma displayFunction
- (BOOL)insertDisplayFunction: (GXFDisplayFunction *)displayFunction;
- (BOOL)updateDisplayFunctionIsSelectedWithId: (GXFDisplayFunction *)displayFunction;
-(NSArray *)displayFunctionsHasPermission;
//默认配置显示功能 初始配置为
- (NSArray *)defaultdisplayFunctions;
- (NSArray *)originDisplayFunctions;
- (NSArray *)isSelectedDisplayFunctions;
@end
This diff is collapsed.
//
// GXFFunctionDBHelper.h
// XFFruit
//
// Created by freecui on 15/8/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFFunctionDBHelper : IBTObject
+ (instancetype)sharedInstance;
- (void)insertAllOriginFunctions;
- (BOOL)successInsertOriginFunctions;
- (void)insertAllOriginDisplayFunctions;
- (BOOL)sucessInsertOriginDisplayFunctions;
@end
//
// GXFFunctionDBHelper.m
// XFFruit
//
// Created by freecui on 15/8/28.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionDBHelper.h"
#import "GXFFunctionDB.h"
@interface GXFFunctionDBHelper ()
//@property (nonatomic, strong)GXFFunctionDB *functionDb;
@end
@implementation GXFFunctionDBHelper
+ (instancetype)sharedInstance{
static GXFFunctionDBHelper *dbHelper = nil;
static dispatch_once_t once;
dispatch_once(&once, ^{
dbHelper = [[GXFFunctionDBHelper alloc]init];
});
return dbHelper;
}
////开启一次就可以了
//- (void)openDb {
// self.functionDb = [GXFFunctionDB sharedInstance];
// [_functionDb functionTableCreate];
// [_functionDb displayFunctionTableCreate];
//}
- (void)insertAllOriginFunctions{
NSArray *functionsArr = [NSArray arrayWithArray:[self p_readJsonFile]];
for (int count = 0; count < functionsArr.count; count ++) {
GXFFunction *function = (GXFFunction *)functionsArr[count];
[[GXFFunctionDB sharedInstance] insertFunction:function];
}
}
//从读出的json文件返回GXFFunction数组
- (NSArray *)p_readJsonFile {
NSMutableArray *muArr = [NSMutableArray array];
//添加公告
GXFFunction *function = [[GXFFunction alloc]init];
function.Id = 000000;
function.name = @"announcement";
function.caption = @"公告";
function.hasPermission = YES;
function.isSelected = NO;
[muArr addObject:function];
NSString *path = [[NSBundle mainBundle] pathForResource:@"PermissionJson" ofType:nil];
NSData *jsonData = [NSData dataWithContentsOfFile:path options:NSDataReadingMappedIfSafe error:nil];
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:jsonData options: NSJSONReadingMutableContainers error:nil];
NSArray *childrenArr = dict[@"children"];
for (int i = 0; i < childrenArr.count; i ++) {
NSArray *permissionsArr = [childrenArr[i] objectForKey:@"permissions"];
for (int j = 0; j < permissionsArr.count; j++) {
NSMutableDictionary *muDict = [NSMutableDictionary dictionaryWithObjects:@[@(0),@(0)] forKeys:@[@"hasPermission",@"isSelected"]];
[muDict addEntriesFromDictionary:permissionsArr[j]];
GXFFunction *function = [[GXFFunction alloc]initWithDictionary:muDict];
[muArr addObject:function];
}
}
return muArr;
}
- (void)insertAllOriginDisplayFunctions{
NSArray *arr = [self p_createAllDisplayFunctions];
for (int count = 0; count < arr.count; count ++) {
GXFDisplayFunction *displayFunction = (GXFDisplayFunction *)arr[count];
[[GXFFunctionDB sharedInstance] insertDisplayFunction:displayFunction];
}
}
- (NSArray *)p_createAllDisplayFunctions{
NSArray *functionsId = @[@(000000),
@(500101),@(500102),@(500103),
@(500201),
@(500301),@(500302),@(500303),//"采购通知",
@(500401),@(500402),@(500403),@(500406),//"采购单"
@(500501),@(500502),@(500503),//"发运单"
@(500601),@(500602),@(500603),//"转运单"
@(500701),@(500702),@(500703),];//加工单
NSArray *functionsName = @[@"公告",
@"新建行情调研",@"查看行情调研", @"查看行情调研",
@"填写行情反馈",
@"新建采购通知",@"查看采购通知", @"查看采购通知",
@"新建采购单",@"查看采购单", @"查看采购单", @"审核采购单【供应商】",
@"新建发运单",@"查看发运单", @"查看发运单",
@"新增加工单",@"查看加工单", @"查看加工单",
@"新建转运单", @"查看转运单", @"查看转运单"];
NSArray *functionsImageName = @[@"notice",
@"create_surver",@"watch_surver", @"watch_surver",
@"create_surver_result",
@"create_needs",@"watch_needs", @"watch_needs",
@"create_purchase",@"watch_purchase", @"watch_purchase", @"review_purchase",
@"create_transport",@"watch_transort", @"watch_transort",
@"create_process",@"watch_process", @"watch_process",
@"新建转运单", @"查看转运单", @"查看转运单"];
//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;
}
NSMutableArray *muarr = [NSMutableArray array];
for (int count = 0; count < functionsId.count; count ++) {
GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init];
displayFunction.functionId = [functionsId[count] integerValue];
displayFunction.functionName = functionsName[count];
displayFunction.functionImgName = functionsImageName[count];
//displayFunction.functionSmallImgName = fu
displayFunction.functionItemTag = [functionItemTag[count] integerValue];
[muarr addObject:displayFunction];
}
return muarr;
}
- (BOOL)successInsertOriginFunctions{
return [[GXFFunctionDB sharedInstance] originFunctions].count > 0 ? YES : NO;
}
- (BOOL)sucessInsertOriginDisplayFunctions {
return [[GXFFunctionDB sharedInstance] originDisplayFunctions].count > 0 ? YES : NO;
}
@end
......@@ -24,6 +24,7 @@
#import "User.h"
#import "Survey.h"
#import "Vendor.h"
#import "Warehouse.h"
#define ICR_DB_ERROR_PARAMETER @"Parse Error: Bad Parameter(s)"
......@@ -95,7 +96,7 @@ static NSString *ICRDataBasePath = @"";
[_m_dbQueue inDatabase:^(FMDatabase *db) {
NSArray *tableNameArr =
@[ [Product class],[User class],[Survey class],[Vendor class]];
@[ [Product class],[User class],[Survey class],[Vendor class],[Warehouse class]];
NSMutableArray *sqlBatch = [NSMutableArray array];
NSString *sql = nil;
......
......@@ -225,6 +225,17 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//仓库
- (void)getWarehouseWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//添加采购单
- (void)savePurchaseWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
@end
......
......@@ -77,7 +77,9 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
XFFHttp_ResultChart,
XFFHttp_GetResults,
//供应商
XFFHttp_GetVendor
XFFHttp_GetVendor,
//仓库
XFFHttp_GetWarehouse
};
static NSString * const ICRHTTPInterface[] = {
......@@ -134,7 +136,11 @@ static NSString * const ICRHTTPInterface[] = {
//行情反馈生成图片
[XFFHttp_ResultChart] = @"survey/resultchart",
[XFFHttp_GetResults] = @"survey/get_results",
[XFFHttp_GetVendor] = @"mdata/vendor/download"
//供应商
[XFFHttp_GetVendor] = @"data/vendor/download",
//仓库
[XFFHttp_GetWarehouse] = @"data/warehouse/download",
};
static NSString * const ICRAttachmentTypeValue[] = {
......@@ -402,6 +408,7 @@ acceptTypeJson:(BOOL)bAcceptJson
userUtil.orgName = dictResult[ @"enterprise_name" ];
userUtil.orgId = dictResult[ @"enterprise_uuid" ];
userUtil.authenticode = dictResult[@"authenticode"];
userUtil.permissions = dictResult[@"permissions"];
[userUtil saveArchive];
if (succ) {
succ( dictResult );
......@@ -1306,7 +1313,9 @@ acceptTypeJson:YES
//添加行情调研单
- (void)saveSurveyWithAuthenticode:(id)data success:(void (^)(id))succ failure:(void (^)(id))fail
- (void)saveSurveyWithAuthenticode:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
if (!data) {
if (fail) {
......@@ -1642,11 +1651,95 @@ acceptTypeJson:YES
fail( error );
}
};
NSString *dateStr = @"2015-05-04";
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetVendor] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self GET:encodeUrlStr
parameters:NULL
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
//仓库
-(void)getWarehouseWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (IsDictObject(responseObject)) {
void (^complete)(void) = ^(void){
if (succ) {
[IBTCommon runOnMainThreadWithoutDeadlocking:^{
succ( responseObject );
}];
}
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
objectClass:NSClassFromString( @"Warehouse" )
deleteLocal:YES
handleData:NULL
complete:complete
fail:fail];
}
else {
if (fail) {
fail( nil );
}
}
};
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
CLog(@"%@", error);
if (fail) {
fail( error );
}
};
NSString *dateStr = @"2015-05-04";
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetWarehouse] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self GET:encodeUrlStr
parameters:NULL
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetVendor] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", [[NSDate date] httpParameterString],@(page_number),@(page_size)];
//添加采购单
- (void)savePurchaseWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
if (!data) {
if (fail) {
fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
}
return;
}
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (succ) {
succ( responseObject );
}
};
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
CLog(@"%@", error);
if (fail) {
fail( error );
}
};
NSDictionary *dict = data;
NSString *currentTime = [[NSDate date] httpParameterString];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveySave] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:NULL
parameters:dict
needToken:NO
acceptTypeJson:YES
success:success
......
......@@ -71,6 +71,7 @@
[baseView addSubview:fControl];
}
}
baseView.height = MODULE_VIEW_HEIGHT * baseView.m_rows;
return baseView;
}
......
......@@ -11,7 +11,24 @@
//@protocol ICRFuctionItemControlDelegate;
typedef NS_ENUM (NSUInteger, ICRFunctionID) {
kFunctionAnnouncement = 0,
kFunctionNotice = 0, //公告
kFunctionNewSurvey, //新建行情调研
kFunctionSeeSurvey, //查看行情调研
kFunctionFeeBackSurvey, //填写行情反馈
kFunctionNewPurchaseNotice, //新建采购通知
kFunctionSeePurchaseNotice, //查看采购通知
kFunctionNewPurchase, // 新建采购单
kFunctionSeePurchase, // 查看采购单
kFunctionExaminePurchase, // 审核采购单【供应商】
kFunctionNewShipment, // 新建发运单
kFunctionSeeShipment, // 查看发运单
kFunctionNewProcessing, // 新增加工单
kFunctionSeeProcessing, // 查看加工单
kFunctionAnnouncement ,
kFunctionTaskManagement,
kFunctionPatrolPlan,
kFunctionMyShop,
......@@ -19,20 +36,7 @@ typedef NS_ENUM (NSUInteger, ICRFunctionID) {
kFunctionComeShopReg,
kFunctionLeaveShopReg,
kFunctionCreatTask,
kFunctionHandleTask,
kFunctionNotice,
kFunctionNewSurvey,
kFunctionSeeSurvey,
kFunctionFeeBackSurvey,
kFunctionNewPurchaseNotice,
kFunctionSeePurchaseNotice,
kFunctionNewPurchase,
kFunctionSeePurchase,
kFunctionExaminePurchas,
kFunctionNewShipment,
kFunctionSeeShipment,
kFunctionNewProcessing,
kFunctionHandleTask
};
@interface ICRFunctionItemControl : UIControl
......
......@@ -9,5 +9,8 @@
#ifndef XFFruit_ICRNotificationMacro_h
#define XFFruit_ICRNotificationMacro_h
#define SetProductTotalPrice @"setProductTotalPrice"
#define KNOTIFICATION_changeIsSelectedFunctions @"KNOTIFICATION_changeIsSelectedFunctions"
#endif
{
"id" : "50",
"name": "前台",
"type" : "mobileModule",
"children": [
{
"id" : "5001",
"name": "行情调研",
"type" : "mobileModule",
"permissions": [
{
"id" : "500101",
"name": "create",
"caption": "新建权"
},
{
"id" : "500102",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500103",
"name": "viewself",
"caption": "本人查看权"
}
]
},
{
"id" : "5002",
"name": "行情反馈",
"type" : "mobileModule",
"permissions": [
{
"id" : "500201",
"name": "create",
"caption": "新建权"
},
{
"id" : "500202",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500203",
"name": "viewself",
"caption": "本人查看权"
}
]
},
{
"id" : "5003",
"name": "采购通知",
"type" : "mobileModule",
"permissions": [
{
"id" : "500301",
"name": "create",
"caption": "新建权"
},
{
"id" : "500302",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500303",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500304",
"name": "accepttask",
"caption": "接受任务权"
},
{
"id" : "500305",
"name": "createpurchasebill",
"caption": "新建采购单权"
},
{
"id" : "500306",
"name": "finish",
"caption": "结束权"
}
]
},
{
"id" : "5004",
"name": "采购单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500401",
"name": "create",
"caption": "新建权"
},
{
"id" : "500402",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500403",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500404",
"name": "viewvendor",
"caption": "供应商查看权"
},
{
"id" : "500405",
"name": "managerapprove",
"caption": "经理审批权"
},
{
"id" : "500406",
"name": "vendorapprove",
"caption": "供应商审批权"
},
{
"id" : "500407",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500408",
"name": "abort",
"caption": "作废权"
}
]
},
{
"id" : "5005",
"name": "发运单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500501",
"name": "create",
"caption": "新建权"
},
{
"id" : "500502",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500503",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500404",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500505",
"name": "abort",
"caption": "作废权"
}
]
},
{
"id" : "5006",
"name": "转运单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500601",
"name": "create",
"caption": "新建权"
},
{
"id" : "500602",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500603",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500604",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500605",
"name": "abort",
"caption": "作废权"
}
]
},
{
"id" : "5007",
"name": "加工单",
"type" : "mobileModule",
"permissions": [
{
"id" : "500701",
"name": "create",
"caption": "新建权"
},
{
"id" : "500702",
"name": "viewall",
"caption": "全部查看权"
},
{
"id" : "500703",
"name": "viewself",
"caption": "本人查看权"
},
{
"id" : "500704",
"name": "finish",
"caption": "结束权"
},
{
"id" : "500705",
"name": "abort",
"caption": "作废权"
}
]
}
]
}
......@@ -13,21 +13,28 @@
// Login Data
@property (copy, nonatomic) NSString *userName;
@property (copy, nonatomic) NSString *password;
@property (copy, nonatomic) NSString *registerCode;
@property (copy, nonatomic) NSString *registerCode; //企业认证码
@property (copy, nonatomic) NSString *token;
@property (copy, nonatomic) NSNumber *bAutoLogin;
@property (copy, nonatomic) NSString *authenticode;
@property (copy, nonatomic) NSString *authenticode;//企业认证码
@property (assign,nonatomic)BOOL needFresh;
// User Data
@property (copy, nonatomic) NSString *displayName;
@property (copy, nonatomic) NSString *userCode;
@property (copy, nonatomic) NSString *orgCode;
@property (copy, nonatomic) NSString *orgName;
@property (copy, nonatomic) NSString *userId;
@property (copy, nonatomic) NSString *orgId;
@property (copy, nonatomic) NSString *currentStoreID;
@property (copy, nonatomic) NSString *uniqueID;
@property (copy, nonatomic) NSString *userId; // 唯一标识
@property (copy, nonatomic) NSString *displayName; //用户名称
@property (copy, nonatomic) NSString *userCode; // 用户代码
@property (copy, nonatomic) NSString *orgCode; // 企业代码
@property (copy, nonatomic) NSString *orgName; // 企业名称
@property (copy, nonatomic) NSString *orgId; // 唯一标识
@property (strong, nonatomic) NSArray *permissions; //权限列表
@property (copy, nonatomic) NSString *currentStoreID; //
@property (copy, nonatomic) NSString *uniqueID; //
+ (instancetype)sharedInstance;
......
......@@ -56,8 +56,8 @@
[IBTCommon localizableString:@"Survey1"],
[IBTCommon localizableString:@"Survey2"],
[IBTCommon localizableString:@"Survey3"],
[IBTCommon localizableString:@"Survey4"],
[IBTCommon localizableString:@"Survey5"],
[IBTCommon localizableString:@"AddPurchase"],
[IBTCommon localizableString:@"Purchase"],
[IBTCommon localizableString:@"Survey6"],
[IBTCommon localizableString:@"Survey7"],
[IBTCommon localizableString:@"Survey8"],[IBTCommon localizableString:@"Survey9"],
......@@ -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;
......
//
// GXFFunctionsViewController.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTUIViewController.h"
@interface GXFFunctionsViewController : IBTUIViewController
@end
//
// GXFFunctionsViewController.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionsViewController.h"
#import "GXFDisplayFunction.h"
#import "GXFFunction.h"
#import "GXFFunctionDBHelper.h"
#import "GXFFunctionDB.h"
@interface GXFFunctionsViewController ()<UITableViewDataSource,UITableViewDelegate>
//@property (nonatomic, strong) NSArray *
@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) NSArray *firstSectionArr;
@property (nonatomic, strong) NSArray *secondSectionArr;
@end
@implementation GXFFunctionsViewController
static NSString *cellID = @"cell";
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initData];
[self setupSubViews];
}
- (void)initData {
NSUserDefaults *f_default = [NSUserDefaults standardUserDefaults];
BOOL noDefault = [[f_default objectForKey:@"noDefault"] integerValue] > 0 ? YES : NO;
if (!noDefault) {
self.secondSectionArr = [[GXFFunctionDB sharedInstance]defaultdisplayFunctions];
} else {
self.secondSectionArr = [[GXFFunctionDB sharedInstance]originDisplayFunctions];
}
NSDictionary *dictOne = @{@"Id":@(1),@"functionName":@"新建行情反馈",@"imgName":@"RefreshBtn",@"isSelected":@(0)};
NSDictionary *dictTwo = @{@"Id":@(2),@"functionName":@"查询行情反馈",@"imgName":@"RefreshBtn",@"isSelected":@(1)};
GXFDisplayFunction *dFuntionOne = [[GXFDisplayFunction alloc]initWithDictionary:dictOne];
GXFDisplayFunction *dFuntionTwo =[[GXFDisplayFunction alloc]initWithDictionary:dictTwo];
self.firstSectionArr = @[dFuntionOne,dFuntionTwo];
//@[dFuntionOne,dFuntionTwo];
}
- (void)setupSubViews {
[self setupRightBarBtn];
[self setupTableView];
}
- (void)setupRightBarBtn {
UIBarButtonItem *rightBarBtn = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(selectedFunctions)];
self.navigationItem.rightBarButtonItem = rightBarBtn;
}
- (void)setupTableView {
self.f_tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
self.f_tableView.dataSource = self;
self.f_tableView.delegate = self;
//[self.f_tableView dequeueReusableCellWithIdentifier ]
[self.view addSubview:_f_tableView];
[_f_tableView reloadData];
}
#pragma BarButton Action
- (void)selectedFunctions {
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_changeIsSelectedFunctions object:nil];
//配置功能 不是默认配置
NSUserDefaults *f_default = [NSUserDefaults standardUserDefaults];
BOOL noDefault = [[f_default objectForKey:@"noDefault"] integerValue] > 0 ? YES : NO;
if (!noDefault) {
[f_default setObject:@(1) forKey:@"noDefault"];
}
[self PopViewControllerAnimated:YES];
}
#pragma UITablewViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return _firstSectionArr.count;
} else {
return _secondSectionArr.count;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//TableViewCell重用机制避免重复显示问题 它的子视图全部删除
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
} else {
while ([cell.contentView.subviews lastObject] != nil) {
[(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
}
}
[self p_contentToTableViewCell:cell ForRowAtIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *sectionTitle = [NSString string];
switch (indexPath.section) {
case 0:
{
sectionTitle = @"提示选择";
}
break;
case 1:
{
sectionTitle = @"功能选择";
}
break;
}
return sectionTitle;
}
#pragma UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.section) {
case 0:
{
}
break;
case 1:
{
GXFDisplayFunction *displayFunction = (GXFDisplayFunction *)_secondSectionArr[indexPath.row];
UITableViewCell *cell = [_f_tableView cellForRowAtIndexPath:indexPath];
if (cell.accessoryType == UITableViewCellAccessoryNone) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
displayFunction.isSelected = YES;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
displayFunction.isSelected = NO;
}
[[GXFFunctionDB sharedInstance] updateDisplayFunctionIsSelectedWithId:displayFunction];
}
break;
}
}
#pragma 给cell的内容赋值
- (void)p_contentToTableViewCell: (UITableViewCell *)cell ForRowAtIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.section) {
case 0:
{
GXFDisplayFunction *dFunction = (GXFDisplayFunction *)_firstSectionArr[indexPath.row];
cell.imageView.image = [UIImage imageNamed:@"RefreshBtn"];//dFunction.functionImgName];
cell.textLabel.text = dFunction.functionName;
}
break;
case 1:
{
GXFDisplayFunction *dFunction = (GXFDisplayFunction *)_secondSectionArr[indexPath.row];
cell.imageView.image = [UIImage imageNamed:@"RefreshBtn"];//dFunction.functionImgName];
cell.textLabel.text = dFunction.functionName;
if (dFunction.isSelected) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
}
break;
default:
break;
}
}
- (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
//
// ICRHomeViewController.m
// XFFruit
//
// Created by Xummer on 3/24/15.
// Copyright (c) 2015 Xummer. All rights reserved.
//
#define M_HEAD_IMG_VIEW_HEIGHT (190)
#define M_HEAD_VIEW_TITLE_LABEL_HEIGHT (30)
#define M_HEAD_IMG_HEIGHT_WIDTH_PROPORTION 190.0f/320.0f
#import "ICRHomeViewController.h"
#import "ICRTaskListViewController.h"
#import "ICRPatrolPlanViewController.h"
#import "ICRStoreListViewController.h"
#import "ICRStoreDetailViewController.h"
#import "ICRAnnouncementViewController.h"
#import "ICRFunctionBaseView.h"
#import "ICRFunctionEntity.h"
#import "ICRFunctionBaseView.h"
#import "NewSurveyViewController.h"
#import "SurveyViewController.h"
#import "AddWorkSheetViewController.h"
#import "NewPurchaseViewController.h"
@interface ICRHomeViewController ()
<
ICRFunctionBaseViewDelegate,
ICRStoreListViewDelegate
>
@property (strong, nonatomic) UIImageView *m_headImageView;
@property (strong, nonatomic) UILabel *m_headViewTextLabel;
@end
@implementation ICRHomeViewController
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self setupSubviews];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Private Method
- (void)setupSubviews {
self.m_headImageView = [[UIImageView alloc] initWithFrame:(CGRect){
.origin.x = 0,
.origin.y = 0,
.size.width = self.view.width,
.size.height = self.view.width * M_HEAD_IMG_HEIGHT_WIDTH_PROPORTION
}];
_m_headImageView.image = [UIImage imageNamed:@"HomeDisplayImage"];
self.m_headViewTextLabel = [[UILabel alloc] initWithFrame:(CGRect){
.origin.x = 0,
.origin.y = CGRectGetHeight(self.m_headImageView.frame) - M_HEAD_VIEW_TITLE_LABEL_HEIGHT,
.size.width = CGRectGetWidth(self.m_headImageView.frame),
.size.height = M_HEAD_VIEW_TITLE_LABEL_HEIGHT
}];
_m_headViewTextLabel.backgroundColor = [UIColor colorWithRed:0.310f green:0.345f blue:0.392f alpha:0.5f];
_m_headViewTextLabel.textColor = [UIColor whiteColor];
_m_headViewTextLabel.font = [UIFont systemFontOfSize:13];
_m_headViewTextLabel.textAlignment = NSTextAlignmentCenter;
// _m_headViewTextLabel.text = @"我是文字我是文字我是文字我是文字";
[_m_headImageView addSubview:_m_headViewTextLabel];
[self.view addSubview:_m_headImageView];
NSMutableArray *arrFunctionEntities = [NSMutableArray array];
NSArray *functionImageNames = @[ @"AnnouncementIcon",@"TaskManageIcon",@"PatrolPlanIcon",@"MyStoreIcon",@"MyStoreIcon",@"MyStoreIcon"];
NSArray *fuctionNames = @[ [IBTCommon localizableString:@"Announcement"],
[IBTCommon localizableString:@"TaskManage"],
[IBTCommon localizableString:@"PatrolPlan"],
[IBTCommon localizableString:@"MyStore"],
[IBTCommon localizableString:@"Survey"],[IBTCommon localizableString:@"AddSurvey"]];
NSArray *functionTags = @[ @(kFunctionAnnouncement),
@(kFunctionTaskManagement),
@(kFunctionPatrolPlan),
@(kFunctionMyShop),
@(kFunctionNavigation),
@(kFunctionComeShopReg)];
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];
baseView.frame = (CGRect){
.origin.x = 0,
.origin.y = CGRectGetMaxY(_m_headImageView.frame),
.size.width = CGRectGetWidth(self.view.frame),
.size.height = CGRectGetHeight(self.view.frame) - CGRectGetHeight(_m_headImageView.frame)
};
baseView.backgroundColor = [UIColor clearColor];
baseView.m_delegate = self;
[self.view addSubview:baseView];
}
#pragma mark - ICRFunctionBaseViewDelegate
- (void)ICRFunctionBaseView:(ICRFunctionItemControl *)imageView {
/*
kFunctionAnnouncement = 0,
kFunctionTaskManagement,
kFunctionPatrolPlan,
kFunctionMyShop,
*/
switch (imageView.tag) {
case kFunctionAnnouncement:
{
ICRAnnouncementViewController *aVC = [[ICRAnnouncementViewController alloc] init];
[self PushViewController:aVC 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];
NewPurchaseViewController *sVC = [[NewPurchaseViewController alloc] init];
[self PushViewController:sVC animated:YES];
}
break;
case kFunctionNavigation:
{
SurveyViewController *svc = [[SurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey"];
[self PushViewController:svc animated:YES];
}
break;
case kFunctionComeShopReg:
{
NewSurveyViewController *svc = [[NewSurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"AddSurvey"];
[self PushViewController:svc animated:YES];
}
break;
default:
break;
}
}
#pragma mark - ICRStoreListViewDelegate
- (void)storeListViewCtrl:(ICRStoreListViewController *)vCtrl didSelectedStore:(ICRStore *)store {
ICRStoreDetailViewController *dVC = [[ICRStoreDetailViewController alloc] initWithStoreData:store];
[vCtrl PushViewController:dVC animated:YES];
}
@end
//
// GXFDisplayActions.h
// XFFruit
// 显示有已有权限功能的信息
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFDisplayFunction : IBTObject
@property (nonatomic, assign) NSInteger Id; //
@property (nonatomic, assign) NSInteger functionId;
@property (nonatomic, copy) NSString *functionName; //
@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;
@end
//
// GXFDisplayActions.m
// XFFruit
// 显示有已有权限功能的信息
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFDisplayFunction.h"
@implementation GXFDisplayFunction
+ (instancetype)initClassWithDictionary:(NSDictionary *)dict {
return [self initClassWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (!self) {
return nil;
} else {
self.Id = [dict[@"id"] integerValue];
self.functionName = dict[@"functionName"];
self.functionImgName = dict[@"imgName"];
self.isSelected = [dict[@"isSelected"] integerValue];
// [self setValuesForKeysWithDictionary:dict];
}
return self;
}
@end
//
// GXFActions.h
// XFFruit
// 后台返回的json权限文件的内容:选择权限和是否选择
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFFunction : IBTObject
@property (nonatomic, assign) NSInteger Id;
@property (nonatomic, copy) NSString *name; //权限
@property (nonatomic, copy) NSString *caption; //权限的名称
@property (nonatomic, assign) BOOL hasPermission;
@property (nonatomic, assign) BOOL isSelected;
//@property (nonatomic, assign) BOOL isPublic; 是否公共部分功能
+ (instancetype)initClassWithDictionary: (NSDictionary *)dict;
- (instancetype)initWithDictionary: (NSDictionary *)dict;
@end
//
// GXFActions.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunction.h"
@implementation GXFFunction
+ (instancetype)initClassWithDictionary:(NSDictionary *)dict {
return [self initClassWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (!self) {
return nil;
} else {
self.Id = [dict[@"id"] integerValue];
self.name = dict[@"name"];
self.caption = dict[@"caption"];
self.hasPermission = [dict[@"hasPermission"] integerValue];
self.isSelected = [dict[@"isSelected"] integerValue];
// [self setValuesForKeysWithDictionary:dict];
return self;
}
}
@end
//
// GXFNoticeCollectionViewCell.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#define ICRFUNCTION_IMG_TOP_PADDING (25)
#define ICRFUNCTION_IMG_WIDTH (65)
#define ICRFUNCTION_LABEL_HEIGHT (15)
#define ICRFUNCTION_INNER_GAP (7)
#define RIGHT_LINE_WIDTH (0.5)
@interface GXFFunctionCollectionViewCell : UICollectionViewCell
@property (nonatomic, strong, readonly) UIImageView *functionImage;
@property (nonatomic, strong, readonly) UILabel *functionNameLabel;
@end
//
// GXFNoticeCollectionViewCell.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionCollectionViewCell.h"
@implementation GXFFunctionCollectionViewCell
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
_functionImage = [[UIImageView alloc]initWithFrame:CGRectMake((CGRectGetWidth(self.frame) - ICRFUNCTION_IMG_WIDTH)/2, ICRFUNCTION_IMG_TOP_PADDING, ICRFUNCTION_IMG_WIDTH, ICRFUNCTION_IMG_WIDTH)];
_functionImage.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:_functionImage];
_functionNameLabel = [[UILabel alloc] init];
CGSize labelSize = CGSizeMake(CGRectGetWidth(self.frame), ICRFUNCTION_LABEL_HEIGHT);
labelSize = [_functionNameLabel sizeThatFits:labelSize];
_functionNameLabel.frame = (CGRect){
.origin.x = (CGRectGetWidth(self.frame) - labelSize.width)/2,
.origin.y = CGRectGetMaxY(_functionImage.frame) + ICRFUNCTION_INNER_GAP,
.size.width = labelSize.width,
.size.height = ICRFUNCTION_LABEL_HEIGHT
};
_functionNameLabel.textColor = [UIColor colorWithRed:0.596f green:0.596f blue:0.596f alpha:1.00f];
_functionNameLabel.textAlignment = NSTextAlignmentCenter;
_functionNameLabel.font = [UIFont systemFontOfSize:13];
[self.contentView addSubview:_functionNameLabel];
self.backgroundColor = [UIColor whiteColor];
return self;
}
@end
//
// GXFNoticeFunctionTableViewCell.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFNoticeFunctionTableViewCell : UITableViewCell
@property (nonatomic, strong, readonly) UIImageView *functionImg;
@property (nonatomic, strong, readonly) UILabel *noticeLabel;
@property (nonatomic, strong, readonly) UILabel *unReadLabel;
@end
//
// GXFNoticeFunctionTableViewCell.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFNoticeFunctionTableViewCell.h"
@implementation GXFNoticeFunctionTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
_functionImg = [[UIImageView alloc]initWithFrame:CGRectMake(20.f, 10.f, 45.f, 45.f)];
_functionImg.image = [UIImage imageNamed:@""];
[self.contentView addSubview:_functionImg];
_unReadLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.width - 60.f,(self.height - 20.0f)/2.0 , 25.0f, 20.0f)];
_unReadLabel.backgroundColor = [UIColor redColor];
_unReadLabel.textColor = [UIColor whiteColor];
_unReadLabel.font = [UIFont systemFontOfSize:13];
_unReadLabel.layer.cornerRadius =10;
_unReadLabel.layer.masksToBounds = YES;
[self.contentView addSubview:_unReadLabel];
_noticeLabel = [[UILabel alloc] initWithFrame:CGRectMake(_functionImg.right ,_functionImg.x,self.width - _functionImg.right - 40,self.height)];
_noticeLabel.font = [UIFont systemFontOfSize:13.0f];
[_noticeLabel setTextAlignment:NSTextAlignmentRight];
_noticeLabel.textColor = [UIColor blackColor];
[self.contentView addSubview:_noticeLabel];
}
return self;
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -9,6 +9,9 @@
#import "ICRLoginViewController.h"
#import "ICRLoginContentView.h"
#import "GXFFunctionDB.h"
#import "GXFFunctionDBHelper.h"
#define LOGIN_CONTAINER_LEFT_MARGIN (20)
#define LOGIN_CONTAINER_HEIGHT (450)
......@@ -134,8 +137,38 @@
ICRAppViewControllerManager *mgr =
[ICRAppViewControllerManager getAppViewControllerManager];
[mgr openMainFrame];
#pragma 可以开新线程 ,待优化
//当登陆成功时就建立功能数据表
[[GXFFunctionDB sharedInstance]createTables];
//完成对初始化数据书库的操作
if (![[GXFFunctionDBHelper sharedInstance] successInsertOriginFunctions]) {
[[GXFFunctionDBHelper sharedInstance] insertAllOriginFunctions];
}
if (![[GXFFunctionDBHelper sharedInstance] sucessInsertOriginDisplayFunctions]) {
[[GXFFunctionDBHelper sharedInstance] insertAllOriginDisplayFunctions];
}
//更改功能权限
for (int count = 0; count < userUtil.permissions.count; count ++) {
GXFFunction *function = [[GXFFunctionDB sharedInstance]functionSelectWithId:[userUtil.permissions[count] integerValue]];
if (function.Id) {
function.hasPermission = 1;
[[GXFFunctionDB sharedInstance] updateFunctionHasPermissionWithId:function];
}
}
if (![[GXFFunctionDB sharedInstance]defaultdisplayFunctions]) {
[[GXFFunctionDB sharedInstance]defaultdisplayFunctions];
}
};
void(^fail)(id) = ^(id data) {
......
//
// AddProductViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "HPGrowingTextView.h"
@protocol AddProductViewDelegate <NSObject>
- (void)dissmiss;
- (void)pushViewController:(id)cvc;
@end
@interface AddProductViewController : ICRBaseViewController
@property (nonatomic,assign)CGRect viewFrame;
@property (nonatomic,strong)UILabel *productNameLabel;//商品
@property (nonatomic,strong)UILabel *productTypeLabel;//单位
@property (nonatomic,strong)UITextField *productStandFiled;//规格
@property (nonatomic,strong)UITextField *productCountFiled;//包装数量
@property (nonatomic,strong)UITextField *baseCountFiled;//基础数量
@property (nonatomic,strong)UITextField *basePriceFiled;//基础单价
@property (nonatomic,strong)UITextField *productPriceFiled;//包装单价
@property (nonatomic,strong)UITextField *totalPriceFiled;//总价格
@property (nonatomic,strong)HPGrowingTextView *remarkTextView;//备注
@property (nonatomic,weak)id<AddProductViewDelegate>delegate;
@end
//
// ChooseTypeViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
typedef void(^ChoseType)(NSString *type);
@interface ChooseTypeViewController : ICRBaseViewController
@property (nonatomic,copy)ChoseType choseType;
@property (nonatomic,copy)NSArray *dataArr;
@end
//
// ChooseTypeViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ChooseTypeViewController.h"
#import "MaskCell.h"
#define TopMargin 50
#define TableHeight 50
@interface ChooseTypeViewController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate>
{
UITextField *_selectTextFiled;
NSIndexPath *_currentIndexPath;
}
@property (nonatomic,strong)UITableView *tableView;
@end
@implementation ChooseTypeViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self bulidLayout];
}
- (void)bulidLayout
{
self.view.backgroundColor = HexColor(@"f8f8f8");
_selectTextFiled = [[UITextField alloc] initWithFrame:CGRectMake(20,5,ScreenSize.width - 40,TopMargin -10)];
_selectTextFiled.textAlignment = NSTextAlignmentLeft;
_selectTextFiled.background = [UIImage imageNamed:@"textFiled"];
_selectTextFiled.delegate = self;
_selectTextFiled.font = FontSize(15);
[self.view addSubview:_selectTextFiled];
UIImageView *leftView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 35, 40)];
leftView.image = [UIImage imageNamed:@"search"];
_selectTextFiled.leftView = leftView;
_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(deletePerson) forControlEvents:UIControlEventTouchUpInside];
_selectTextFiled.rightView = rightView;
_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.view addSubview:self.tableView];
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClick)];
self.navigationItem.rightBarButtonItem = rightItem;
}
- (void)sureClick{
if (self.dataArr.count > 0) {
if (_currentIndexPath) {
NSString *type = self.dataArr[_currentIndexPath.row];
self.choseType(type);
}
}
[self PopViewControllerAnimated:YES];
}
- (void)deletePerson {
_selectTextFiled.text = @"";
_currentIndexPath = nil;
[self.tableView reloadData];
}
#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 = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[MaskCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID totalWidth:ScreenSize.width totalHeight:TableHeight];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
cell.Commitbtn.hidden = YES;
}
if (self.dataArr.count > 0) {
NSString *type = self.dataArr[indexPath.row];
[cell setTitleStr:type];
}
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;
NSString *type = self.dataArr[indexPath.row];
_selectTextFiled.text = type;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return TableHeight;
}
- (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
......@@ -32,31 +32,25 @@
- (void)initData{
self.dataArr = [NSMutableArray array];
self.indexArr = [NSMutableArray array];
Vendor *v = [[Vendor alloc]init];
v.name = @"dddd";
v.code = @"1111";
[self.dataArr addObject:v];
// [self fetchVendorList];
// __weak typeof(self)weakSelf = self;
// void(^succ)(id) = ^(id data) {
// [IBTLoadingView hideHUDWithText:nil];
// if (data) {
// __strong __typeof(weakSelf)strongSelf = weakSelf;
// [strongSelf fetchVendorList];
// }else{
// [IBTLoadingView showTips:data];
// }
// };
//
// void(^fail)(id) = ^(id data) {
// [IBTLoadingView hideHUDWithText:nil];
// [IBTLoadingView showTips:data];
// __strong __typeof(weakSelf)strongSelf = weakSelf;
// [strongSelf fetchVendorList];
// };
// [IBTLoadingView showProgressLabel:@"正在加载..."];
// [[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
[self fetchVendorList];
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchVendorList];
}else{
[IBTLoadingView showTips:data];
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
}
#pragma mark -成功
......
//
// ChooseStoreViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "Warehouse.h"
typedef void(^ChoseWarehouse)(Warehouse *warehouse);
@interface ChooseWarehouseViewController : ICRBaseViewController
@property (nonatomic,copy)ChoseWarehouse choseWarehouse;
@end
//
// ChooseStoreViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ChooseWarehouseViewController.h"
#import "MaskCell.h"
#define TopMargin 50
#define TableHeight 50
@interface ChooseWarehouseViewController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate>
{
UITextField *_selectTextFiled;
NSIndexPath *_currentIndexPath;
}
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)UITableView *tableView;
@end
@implementation ChooseWarehouseViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self initData];
[self bulidLayout];
}
- (void)initData{
self.dataArr = [NSMutableArray array];
[self fetchWarehouseList];
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchWarehouseList];
}else{
[IBTLoadingView showTips:data];
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getWarehouseWithPage_number:0 page_size:100 success:succ failure:fail];
}
#pragma mark -成功
- (void)fetchWarehouseList{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * 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;
[strongSelf.dataArr removeAllObjects];
[strongSelf.dataArr addObjectsFromArray:fetchedObjects];
[strongSelf.tableView reloadData];
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl runFetchForClass:[Warehouse class]
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
}
- (void)bulidLayout
{
self.view.backgroundColor = HexColor(@"f8f8f8");
_selectTextFiled = [[UITextField alloc] initWithFrame:CGRectMake(20,5,ScreenSize.width - 40,TopMargin -10)];
_selectTextFiled.textAlignment = NSTextAlignmentLeft;
_selectTextFiled.background = [UIImage imageNamed:@"textFiled"];
_selectTextFiled.delegate = self;
_selectTextFiled.font = FontSize(15);
[self.view addSubview:_selectTextFiled];
UIImageView *leftView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 35, 40)];
leftView.image = [UIImage imageNamed:@"search"];
_selectTextFiled.leftView = leftView;
_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(deletePerson) forControlEvents:UIControlEventTouchUpInside];
_selectTextFiled.rightView = rightView;
_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.view addSubview:self.tableView];
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClick)];
self.navigationItem.rightBarButtonItem = rightItem;
}
- (void)sureClick{
if (self.dataArr.count > 0) {
if (_currentIndexPath) {
Warehouse *warehouse = self.dataArr[_currentIndexPath.row];
self.choseWarehouse(warehouse);
}
}
[self PopViewControllerAnimated:YES];
}
- (void)deletePerson {
_selectTextFiled.text = @"";
_currentIndexPath = nil;
[self.tableView reloadData];
}
#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 = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[MaskCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID totalWidth:ScreenSize.width totalHeight:TableHeight];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
cell.Commitbtn.hidden = YES;
}
if (self.dataArr.count > 0) {
Warehouse *warehouse = self.dataArr[indexPath.row];
NSString *proStr = [NSString stringWithFormat:@"%@[%@]",warehouse.name,warehouse.code];
[cell setTitleStr:proStr];
}
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;
Warehouse *warehouse = self.dataArr[indexPath.row];
_selectTextFiled.text = warehouse.name;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return TableHeight;
}
- (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
......@@ -9,8 +9,9 @@
#import "NewPurchaseViewController.h"
#import "TopPurchaseView.h"
#import "ProductViewController.h"
#define TopHeight 284
#import "AddProductViewController.h"
#import "PurchaseBillProduct.h"
#define TopHeight 328
#define BottomHeight 300
#define SpaceHeight 20
#define BottomViewHeight 60
......@@ -20,17 +21,33 @@ typedef enum : NSUInteger {
CommitTag,
} BtnTag;
@interface NewPurchaseViewController ()<TopPurchaseViewDelegate>
@interface NewPurchaseViewController ()<TopPurchaseViewDelegate,ProductViewDelegate>
{
UIScrollView *_scrollView;
TopPurchaseView *_purchaseView;
UIView *_bottomView;
ProductViewController *_pvc ;
AddProductViewController *_avc;
}
@property (nonatomic,strong)NSNumber *total;
@property (nonatomic,strong)NSNumber *charge;
@property (nonatomic,strong)NSString *remark;
@property (nonatomic,strong)NSString *state;
@end
@implementation NewPurchaseViewController
- (instancetype)init{
self = [super init];
if (self) {
//监听值的改变
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setProductTotalPrice:) name:SetProductTotalPrice object:nil];
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
//布局
......@@ -67,25 +84,80 @@ typedef enum : NSUInteger {
[_scrollView addSubview:_bottomView];
_pvc = [[ProductViewController alloc]init];
_pvc.delegate = self;
_pvc.viewFrame = _bottomView.bounds;
[_bottomView addSubview:_pvc.view];
}
- (void)btnClick:(UIButton *)btn{
- (void)setProductTotalPrice:(NSNotification *)fication{
//计算总金额
//其他费用 + 商品总金额
float otherPrice = [_purchaseView.otherPriceFiled.text floatValue];
NSMutableArray *purchaseProduct = _pvc.productArr;
float totalPrice = 0;
for (PurchaseBillProduct *billProduct in purchaseProduct) {
totalPrice += [billProduct.total floatValue];
}
_purchaseView.purchasePriceLabel.text = [NSString stringWithFormat:@"%.2f",totalPrice + otherPrice];
self.charge = [NSNumber numberWithFloat:otherPrice];
self.total = [NSNumber numberWithFloat:totalPrice];
}
- (void)btnClick:(UIButton *)btn{
switch (btn.tag) {
case SaveTag:
{
if ([self checkPurchase]) {
}
}
break;
case CommitTag:{
}
break;
default:
break;
}
}
#pragma mark - checkNull
- (BOOL)checkPurchase{
self.remark = _purchaseView.remarkTextView.text;
if (_purchaseView.vendor_uuid.length == 0 || _purchaseView.receiveWrh_uuid.length == 0 || _purchaseView.type.length == 0 || [self.total floatValue] < 0 || !self.total) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"信息不完整" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
return NO;
}
return YES;
}
#pragma mark - TopPurchaseViewDelegate
- (void)pushNextViewController:(id)vc{
[self PushViewController:vc animated:YES];
}
#pragma mark - ProductViewDelegate
- (void)pushViewController:(id)cvc selfController:(id)avc{
_avc = avc;
[self PushViewController:cvc animated:YES];
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
if (_avc) {
[AppWindow addSubview:_avc.view];
}
}
#pragma mark - 协议方法
- (void)hiddenKeyBoard{
[self keyboardHidden];
}
- (void)keyboardHidden{
[_purchaseView.purchasePriceFiled resignFirstResponder];
[_purchaseView.otherPriceFiled resignFirstResponder];
[_purchaseView.remarkTextView resignFirstResponder];
}
- (void)didReceiveMemoryWarning {
......
......@@ -7,10 +7,15 @@
//
#import "ICRBaseViewController.h"
@protocol ProductViewDelegate <NSObject>
- (void)pushViewController:(id)cvc selfController:(id)avc;
@end
@interface ProductViewController : ICRBaseViewController
@property (nonatomic,strong)NSMutableArray *productArr;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,assign)CGRect viewFrame;
@property (nonatomic,assign)BOOL isHiddenEdit;
@property (nonatomic,weak)id<ProductViewDelegate>delegate;
@end
......@@ -10,12 +10,15 @@
#import "FooterCell.h"
#import "HeaderCell.h"
#import "ProductCell.h"
#import "AddProductViewController.h"
#import "PurchaseBillProduct.h"
#define TableHeight 44
@interface ProductViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate>
@interface ProductViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate,AddProductViewDelegate>
{
CGRect _tableFrame;
NSMutableArray *_selectRowArr;//记录当前选中的cell
AddProductViewController *_avc;
}
@end
......@@ -33,8 +36,12 @@
if (!self.productArr) {
self.productArr = [NSMutableArray array];
}
[self.productArr addObject:@"ffff"];
[self.productArr addObject:@"fffff"];
PurchaseBillProduct *billProduct = [PurchaseBillProduct new];
billProduct.total = [NSNumber numberWithFloat:25];
[self.productArr addObject:billProduct];
[self.productArr addObject:billProduct];
}
- (void)setViewFrame:(CGRect)viewFrame{
......@@ -60,10 +67,34 @@
self.tableView.tableFooterView = footCell;
}
}
#pragma mark - footerDelegate
- (void)addClick{
[self.productArr addObject:@"dddd"];
[self.tableView reloadData];
// [self.productArr addObject:@"dddd"];
// [self.tableView reloadData];
if (_avc == nil) {
_avc = [[AddProductViewController alloc]init];
_avc.delegate = self;
_avc.view.backgroundColor = RGBA(0, 0, 0, 0.5);
[AppWindow addSubview:_avc.view];
}
}
#pragma mark - addProductViewDelegate
- (void)dissmiss{
if (_avc) {
[_avc.view removeFromSuperview];
_avc = nil;
}
}
- (void)pushViewController:(id)cvc{
if (_avc) {
[_avc.view removeFromSuperview];
}
if ([self.delegate respondsToSelector:@selector(pushViewController:selfController:)]) {
[self.delegate pushViewController:cvc selfController:_avc];
}
}
#pragma mark - 协议方法
......@@ -102,6 +133,8 @@
cell.showView.frame = showfrmame;
cell.backgroundColor = [UIColor whiteColor];
}
cell.editBtn.tag = indexPath.row;
[cell.editBtn addTarget:self action:@selector(editClick:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
- (BOOL)isHaveIndexPath:(NSIndexPath *)indexPath{
......@@ -122,14 +155,12 @@
Linefrmame.origin.y = 200-1;
showfrmame.size.height = 150;
// cell.showView.hidden = NO;
cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr addObject:indexPath];
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
Linefrmame.origin.y = TableHeight -1;
showfrmame.size.height = 0;
// cell.showView.hidden = YES;
cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr removeObject:indexPath];
}
......@@ -137,14 +168,20 @@
cell.showView.frame = showfrmame;
[self.tableView reloadData];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if ([self isHaveIndexPath:indexPath]) {
return 200;
}
return TableHeight;
}
- (void)editClick:(UIButton *)btn{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"" message:@"哈哈" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -11,5 +11,7 @@
@interface PurchaseDetailViewController : ICRBaseViewController
@property (nonatomic,strong)PurchaseBill *bill;
//模拟三个人员
@property (nonatomic,assign)NSInteger indexPerson;//0.1.2
@end
......@@ -10,25 +10,47 @@
#import "ProductViewController.h"
#define BottomHeight 50
#define LeftMargin 20
#define LeftMargin 15
#define LeftWidth 100
#define LeftHeight 30
#define TopMargin 15
typedef enum : NSUInteger {
CancleTag = 3500,
RejectTag,
PassTag,
SureTag
} BtnTag;
@interface PurchaseDetailViewController ()
{
UIScrollView *_scrollView;
UIView *_purchaseView;
UIView *_bottomView;
ProductViewController *_pvc;
NSArray *_leftArr;
UIButton *_endBtn;
UIButton *_rejectBtn;
}
@property (nonatomic,strong)UILabel *billNumberLabel;
@property (nonatomic,strong)UILabel *noticeNumberLabel;
@property (nonatomic,strong)UILabel *createOperNameLabel;
@property (nonatomic,strong)UILabel *checkNameLabel;
@property (nonatomic,strong)UILabel *stateLabel;
@property (nonatomic,strong)UILabel *lastModifyNameLabel;
@property (nonatomic,strong)UILabel *typeLabel;
@property (nonatomic,strong)UILabel *vendorNameLabel;
@property (nonatomic,strong)UILabel *vendorIsSureLabel;
@property (nonatomic,strong)UILabel *warehouseLabel;
@property (nonatomic,strong)UILabel *otherPriceLabel;
@property (nonatomic,strong)UILabel *totalPriceLabel;
@property (nonatomic,strong)UILabel *noteLabel;
@end
@implementation PurchaseDetailViewController
......@@ -48,21 +70,72 @@
_scrollView.showsVerticalScrollIndicator = NO;
_scrollView.backgroundColor = HexColor(@"f8f8f8");
[self.view addSubview:_scrollView];
[self createBtn];
[self createPurchaseView];
[self createBottomView];
if ([self.bill.state isEqualToString:@"finished"]) {
_endBtn.hidden = YES;
_rejectBtn.hidden = YES;
CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame;
}
[self fetchtPurchaseDetail];
}
- (void)createBtn{
UIButton *endBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, ScreenSize.width - LeftMargin*2, 40) target:self sel:@selector(btnClick:) tag:3000 image:nil title:@"结束" titleColor:[UIColor whiteColor] isCorner:YES corner:8 bgColor:HexColor(@"f69100")];
[self.view addSubview:endBtn];
_purchaseView= [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, LeftHeight*8+LeftMargin)];
_endBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, ScreenSize.width - LeftMargin*2, 40) target:self sel:@selector(btnClick:) tag:0 image:nil title:@"作废" titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:HexColor(@"f69100")];
[self.view addSubview:_endBtn];
if (self.indexPerson == 0) {
_endBtn.tag = CancleTag;
[_endBtn setTitle:@"作废" forState:UIControlStateNormal];
}else if(self.indexPerson == 1){
_rejectBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, (ScreenSize.width - LeftMargin*3)/2, 40) target:self sel:@selector(btnClick:) tag:RejectTag image:nil title:@"拒绝" titleColor: [UIColor whiteColor] isCorner:YES corner:5 bgColor:HexColor(@"50bd62")];
[self.view addSubview:_rejectBtn];
_endBtn.frame = CGRectMake(CGRectGetMaxX(_rejectBtn.frame)+ LeftMargin, ScreenSize.height - 64 - BottomHeight +5, (ScreenSize.width - LeftMargin*3)/2, 40);
[_endBtn setTitle:@"审核通过" forState:UIControlStateNormal];
_endBtn.tag = PassTag;
}else{
_endBtn.tag = SureTag;
[_endBtn setTitle:@"确认" forState:UIControlStateNormal];
}
}
- (void)createBottomView{
_bottomView= [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_purchaseView.frame) + TopMargin, ScreenSize.width, 200)];
_bottomView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_bottomView];
_pvc = [[ProductViewController alloc]init];
[self addChildViewController:_pvc];
_pvc.viewFrame = _bottomView.bounds;
_pvc.isHiddenEdit = YES;
[_bottomView addSubview:_pvc.view];
}
- (void)createPurchaseView{
if (self.indexPerson == 0) {
_leftArr = @[@"单号:",@"采购通知单:",@"创建人:",@"最后修改人:",@"状态:",@"类型:",@"供应商:",@"供应商确认:",@"收货仓库:",@"其他费用:",@"总金额:",@"备注:"];
}else if (self.indexPerson == 1) {
_leftArr = @[@"单号:",@"采购通知单:",@"创建人:",@"审核人:",@"状态:",@"类型:",@"供应商:",@"供应商确认:",@"收货仓库:",@"其他费用:",@"总金额:",@"备注:"];
}else{
_leftArr = @[@"单号:",@"采购通知单:",@"创建人:",@"审核人:",@"状态:",@"供应商:",@"其他费用:",@"总金额:",@"备注:"];
}
_purchaseView= [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, LeftHeight*_leftArr.count +LeftMargin)];
_purchaseView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_purchaseView];
NSArray *leftArr = @[@"单号:",@"采购通知单:",@"创建人:",@"审核人:",@"状态:",@"供应商:",@"总金额:",@"备注:"];
for (NSInteger i = 0 ; i < leftArr.count; i++) {
for (NSInteger i = 0 ; i < _leftArr.count; i++) {
UILabel *leftLabel = [[UILabel alloc]initWithFrame:CGRectMake(LeftMargin, 10 + LeftHeight *i, LeftWidth, LeftHeight)];
leftLabel.font = FontSize(17);
leftLabel.text = leftArr[i];
leftLabel.text = _leftArr[i];
leftLabel.textColor = HexColor(@"888888");
[_purchaseView addSubview:leftLabel];
......@@ -76,41 +149,46 @@
self.noticeNumberLabel = rightLabel;
}else if(i == 2){
self.createOperNameLabel = rightLabel;
}else if(i == 3){
}else if(i == _leftArr.count - 3){
self.otherPriceLabel = rightLabel;
}else if(i == _leftArr.count - 2){
self.totalPriceLabel = rightLabel;
}else if(i == _leftArr.count - 1){
rightLabel.numberOfLines = 0;
self.noteLabel = rightLabel;
}
if (self.indexPerson == 0 || self.indexPerson == 1) {
if (self.indexPerson == 0) {
if (i == 3) {
self.lastModifyNameLabel = rightLabel;
}
}else{
if (i == 3) {
self.checkNameLabel = rightLabel;
}else if(i == 4){
}
}
if(i == 4){
self.stateLabel = rightLabel;
}else if(i == 5){
self.vendorNameLabel = rightLabel;
self.typeLabel = rightLabel;
}else if(i == 6){
self.totalPriceLabel = rightLabel;
self.vendorNameLabel = rightLabel;
}else if(i == 7){
rightLabel.numberOfLines = 0;
self.noteLabel = rightLabel;
self.vendorIsSureLabel = rightLabel;
}else if(i == 8){
self.warehouseLabel = rightLabel;
}
[_purchaseView addSubview:rightLabel];
}else{
if(i == 3){
self.checkNameLabel = rightLabel;
}else if(i == 4){
self.stateLabel = rightLabel;
}else if(i == 5){
self.vendorNameLabel = rightLabel;
}
_bottomView= [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_purchaseView.frame) + TopMargin, ScreenSize.width, 200)];
_bottomView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_bottomView];
_pvc = [[ProductViewController alloc]init];
[self addChildViewController:_pvc];
_pvc.viewFrame = _bottomView.bounds;
_pvc.isHiddenEdit = YES;
[_bottomView addSubview:_pvc.view];
if ([self.bill.state isEqualToString:@"finished"]) {
endBtn.hidden = YES;
CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame;
}
[self fetchtPurchaseDetail];
[_purchaseView addSubview:rightLabel];
}
}
- (void)fetchtPurchaseDetail{
......@@ -138,8 +216,15 @@
self.createOperNameLabel.text = [IBTCommon checkString:self.bill.create_operName];
self.checkNameLabel.text = [IBTCommon checkString:self.bill.vendor_name];
self.vendorNameLabel.text = [IBTCommon checkString:self.bill.vendor_name];
self.totalPriceLabel.text = [IBTCommon checkString:self.bill.total ];
self.totalPriceLabel.text = [IBTCommon checkString:self.bill.total];
self.noteLabel.text = [IBTCommon checkString:self.bill.remark];
self.lastModifyNameLabel.text = @"最后修改人";
self.typeLabel.text = @"类型";
self.vendorIsSureLabel.text = @"是否确认";
self.warehouseLabel.text = @"仓库";
self.otherPriceLabel.text = @"其他费用";
[self setNoteHeight];
}
......@@ -151,7 +236,7 @@
noteFrame.size.height = height;
self.noteLabel.frame = noteFrame;
CGFloat totalHeight = height + LeftHeight*8;
CGFloat totalHeight = height + LeftHeight*_leftArr.count;
CGRect purchaseFrame = _purchaseView.frame;
purchaseFrame.size.height = totalHeight;
_purchaseView.frame = purchaseFrame;
......
......@@ -11,6 +11,9 @@
#import "PurchaseBill.h"
#import "PurchaseDetailViewController.h"
#import "SortMaskView.h"
#import "PurchaseBoltView.h"
#define TopMargin 44
#define TableHeight 120
#define LeftMargin 20
......@@ -23,16 +26,22 @@ typedef enum : NSUInteger {
BoltTag
} BtnTag;
@interface PurchaseViewController ()<UITableViewDataSource,UITableViewDelegate>
@interface PurchaseViewController ()<UITableViewDataSource,UITableViewDelegate,PurchaseViewDelegate,SortMaskViewDelegate>
{
UIView *_maskView;
UIButton *currentBtn;
SortMaskView *_sortView;
PurchaseBoltView *_boltView;
UIBarButtonItem *_sureBtn;
UIButton *_sortBtn;
UIButton *_boltBtn;
}
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSString *noticeLike;
@property (nonatomic,strong)NSString *state;//未提交=initial已提交=submitted调研中=insurvey已完成=finished
@property (nonatomic,strong)NSString *billLike;
@property (nonatomic,strong)NSString *orderDirection;//asc(升序),desc(降序)
@end
@implementation PurchaseViewController
......@@ -48,12 +57,14 @@ typedef enum : NSUInteger {
for (NSInteger i = 0; i < 6; i++) {
PurchaseBill *bill = [PurchaseBill new];
bill.billNumber = @"222222222";
bill.noticeNumber = @"134594059654 0504门店补货0002";
bill.create_operName = @"张三";
bill.noticeNumber = @"134594059654";
bill.create_operName = @"创建人";
bill.create_time = @"2013-03-04";
bill.vendor_name = @"haha";
bill.total = @"200元";
bill.remark = @"hahahah";
bill.vendor_name = @"供应商";
bill.total = @"总金额";
bill.remark = @"备注";
bill.lastModified_operName = @"最后修改人";
bill.vendorConfirmTime = @"否";
if (i == 0) {
bill.state = @"initial";
}else if(i == 1){
......@@ -97,10 +108,158 @@ typedef enum : NSUInteger {
#pragma mark -按钮事件
- (void)sortClick:(UIButton *)btn{
_maskView.backgroundColor = RGBA(0, 0, 0, 0.5);
_maskView.hidden = NO;
if (btn.tag == SortTag) {
if(_boltView){
[self hiddenBoltMaskView:NO];
}
if (currentBtn == btn) {
[btn setImage:[UIImage imageNamed:@"black_arrow_down_with_text"] forState:UIControlStateNormal];
[self hiddenSortMaskView:YES];
currentBtn = nil;
self.navigationItem.rightBarButtonItem = nil;
}else{
[btn setImage:[UIImage imageNamed:@"select_arrow_up_text"] forState:UIControlStateNormal];
if (_sortView == nil) {
_sortView = [[SortMaskView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 150) withOrderDirection:self.orderDirection];
_sortView.dataArr = [[NSMutableArray alloc]initWithObjects:@"按时间顺序",@"按时间逆序",@"默认排序",nil];
_sortView.delegate = self;
[_maskView addSubview:_sortView];
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _sortView.frame;
sortFrame.origin.y = 0;
_sortView.frame = sortFrame;
}];
}
self.navigationItem.rightBarButtonItem = _sureBtn;
currentBtn = btn;
}
}else if(btn.tag == BoltTag){
if (_sortView) {
[self hiddenSortMaskView:NO];
}
if (currentBtn == btn) {
[btn setImage:[UIImage imageNamed:@"black_filter_with_text"] forState:UIControlStateNormal];
[self hiddenBoltMaskView:YES];
currentBtn = nil;
self.navigationItem.rightBarButtonItem = nil;
}else{
[btn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal];
if (_boltView == nil) {
_boltView = [[PurchaseBoltView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 274) state:self.state billNumber:self.billLike noticeNumber:self.noticeLike];
_boltView.backgroundColor = HexColor(@"f8f8f8");
_boltView.delegate = self;
//initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成)
_boltView.dataArr = [[NSMutableArray alloc]initWithObjects:@"未提交",@"已提交",@"已拒绝" ,@"已审批",@"发运中",@"已完成",nil];
[_maskView addSubview:_boltView];
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _boltView.frame;
sortFrame.origin.y = 0;
_boltView.frame = sortFrame;
}];
currentBtn = btn;
self.navigationItem.rightBarButtonItem = _sureBtn;
}
}
}
}
- (void)hiddenSortMaskView:(BOOL)isHide{
currentBtn = nil;
[self checkSortBtnColor];
if (isHide == NO) {
[_sortView removeFromSuperview];
_sortView = nil;
}else{
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _sortView.frame;
sortFrame.origin.y = -105;
_sortView.frame = sortFrame;
_maskView.backgroundColor = RGBA(0, 0, 0, 0);
}completion:^(BOOL finished) {
[_sortView removeFromSuperview];
_sortView = nil;
_maskView.hidden = YES;
}];
}
}
- (void)hiddenBoltMaskView:(BOOL)isHide{
currentBtn = nil;
[self checkBoltBtnColor];
if (isHide == NO) {
[_boltView removeFromSuperview];
_boltView = nil;
}else{
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _boltView.frame;
sortFrame.origin.y = -105;
_boltView.frame = sortFrame;
_maskView.backgroundColor = RGBA(0, 0, 0, 0);
}completion:^(BOOL finished) {
[_boltView removeFromSuperview];
_boltView = nil;
_maskView.hidden = YES;
}];
}
}
//检测排序的颜色
- (void)checkSortBtnColor{
if (self.orderDirection.length > 0) {
[_sortBtn setImage:[UIImage imageNamed:@"select_arrow_up_text"] forState:UIControlStateNormal];
}else{
[_sortBtn setImage:[UIImage imageNamed:@"black_arrow_down_with_text"] forState:UIControlStateNormal];
}
}
- (void)checkBoltBtnColor{
if (self.state.length > 0 || self.noticeLike.length > 0 || self.billLike.length > 0) {
[_boltBtn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal];
}else{
[_boltBtn setImage:[UIImage imageNamed:@"black_filter_with_text"] forState:UIControlStateNormal];
}
}
#pragma mark - 确定
- (void)sureClick{
}
#pragma mark - sortDelegate
- (void)getSortValueSelectRow:(NSString *)state{
if (state.length > 0) {
self.orderDirection = state;
CLog(@"%@",state);
}
}
#pragma mark - boltDelegate
- (void)getBoltValueSelectRow:(NSString *)state{
self.state = state;
CLog(@"%@",state);
}
- (void)getbillLike:(NSString *)billLike{
self.billLike = billLike;
CLog(@"%@",billLike);
}
- (void)getnoticeLike:(NSString *)noticeLike{
self.noticeLike = noticeLike;
CLog(@"%@",noticeLike);
}
- (void)clearBoltInformation{
//清空所有条件
if (self.billLike.length > 0) {
self.billLike = @"";
}
if (self.noticeLike.length > 0) {
self.noticeLike = @"";
}
if (self.state.length > 0) {
self.state = @"";
}
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
......@@ -127,6 +286,13 @@ typedef enum : NSUInteger {
PurchaseDetailViewController *pvc = [PurchaseDetailViewController new];
pvc.title = @"查看采购单";
pvc.bill = _dataArr[indexPath.row];
if(indexPath.row == 0){
pvc.indexPerson = 0;
}else if(indexPath.row == 1){
pvc.indexPerson = 1;
}else if(indexPath.row == 2){
pvc.indexPerson = 2;
}
[self PushViewController:pvc animated:YES];
}
......
......@@ -10,15 +10,15 @@
@interface PurchaseBill : IBTModel
@property (nonatomic,strong)NSString *uuid;//唯一标识
@property (nonatomic,strong)NSString *version;//版本
@property (nonatomic,strong)NSNumber *version;//版本
@property (nonatomic,strong)NSString *noticeUuid;//采购通知单uuid
@property (nonatomic,strong)NSString *noticeNumber;//采购通知单号
@property (nonatomic,strong)NSString *billNumber;//采购单号
@property (nonatomic,strong)NSString *vendor_uuid;//供应商uuid
@property (nonatomic,strong)NSString *vendor_code;//供应商代码
@property (nonatomic,strong)NSString *vendor_name;//供应商姓名
@property (nonatomic,strong)NSString *total;//总金额
@property (nonatomic,strong)NSNumber *total;//总金额
@property (nonatomic,strong)NSNumber *charge;//费用
@property (nonatomic,strong)NSString *endDate;//调研结束时间
@property (nonatomic,strong)NSString *remark;//备注
@property (nonatomic,strong)NSString *state;// initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成)
......@@ -28,9 +28,6 @@
@property (nonatomic,strong)NSString *create_operName;//创建人名称
@property (nonatomic,strong)NSString *lastModified_time;//最后修改时间
@property (nonatomic,strong)NSString *lastModified_id;//最后修改人代码
@property (nonatomic,strong)NSString *astModified_operName;//最后修改人名称
@property (nonatomic,strong)NSString *lastModified_operName;//最后修改人名称
@end
//
// PurchaseBillProduct.h
// XFFruit
//
// Created by n22 on 15/8/31.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface PurchaseBillProduct : IBTModel
@property (nonatomic,strong)NSString *uuid;//唯一标识
@property (nonatomic,strong)NSString *product_uuid;//商品uuid
@property (nonatomic,strong)NSString *product_code;//商品代码
@property (nonatomic,strong)NSString *product_name;//商品名称
@property (nonatomic,strong)NSNumber *qpc;//包装规格
@property (nonatomic,strong)NSString *qpcStr;//包装规格描述
@property (nonatomic,strong)NSString *unit;//包装单位
@property (nonatomic,strong)NSNumber *qty;//包装数量
@property (nonatomic,strong)NSNumber *price;//包装单价
@property (nonatomic,strong)NSNumber *baseQty;//基础数量
@property (nonatomic,strong)NSNumber *basePrice;//基础单价
@property (nonatomic,strong)NSNumber *total;// 金额
@property (nonatomic,strong)NSString *remark;//备注
@end
//
// PurchaseBillProduct.m
// XFFruit
//
// Created by n22 on 15/8/31.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "PurchaseBillProduct.h"
@implementation PurchaseBillProduct
@end
......@@ -4,7 +4,7 @@
//
// Created by 陈俊俊 on 15/8/23.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
// 供应商
#import "IBTModel.h"
......
//
// Warehouse.h
// XFFruit
//
// Created by n22 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
// 仓库
#import "IBTModel.h"
@interface Warehouse : IBTModel
@property (nonatomic,strong)NSString *uuid;//id
@property (nonatomic,strong)NSString *code;//代码
@property (nonatomic,strong)NSString *name;//名称
@property (nonatomic,assign)BOOL enabled;//状态
@end
//
// Warehouse.m
// XFFruit
//
// Created by n22 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "Warehouse.h"
@implementation Warehouse
+ (NSDictionary *)specialKeysAndReplaceKeys {
return @{ @"wID" : [[self class] PrimaryKey], };
}
+ (NSString *)PrimaryKey {
return @"uuid";
}
@end
......@@ -36,7 +36,7 @@
- (void)bulidLayout
{
CGFloat headWidth = (ScreenSize.width - LeftWidth - RightWidth - SpaceMargin* (3 -1))/3;
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (3 -1))/3;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"arrowright"];
......@@ -130,7 +130,7 @@
self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.editBtn setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateNormal];
self.editBtn.frame = CGRectMake(ScreenSize.width - RightWidth, 0, RightWidth - LeftMargin, TableHeight);
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))];;
......
//
// PurchaseBoltView.h
// XFFruit
//
// Created by n22 on 15/8/26.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol PurchaseViewDelegate <NSObject>
- (void)getBoltValueSelectRow:(NSString *)state;
- (void)getbillLike:(NSString *)billLike;
- (void)getnoticeLike:(NSString *)noticeLike;
- (void)clearBoltInformation;
@end
@interface PurchaseBoltView : UIView<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,weak)id <PurchaseViewDelegate>delegate;
@property (nonatomic,strong)UITextField *billFiled;//采购单号类似于
@property (nonatomic,strong)UITextField *noticeFiled;//通知单号类似于
@property (nonatomic,strong)UITextField *vendorFiled;//供应商uuid类似于
- (instancetype)initWithFrame:(CGRect)frame state:(NSString *)state billNumber:(NSString *)billNumber noticeNumber:(NSString *)noticeNumber;
@end
This diff is collapsed.
......@@ -20,8 +20,22 @@
@property (nonatomic,strong)UILabel *purchaseTypeLabel;//类型
@property (nonatomic,strong)UILabel *purchaseSupplierLabel;//供应商
@property (nonatomic,strong)UILabel *purchaseStoreLabel;//收货仓库
@property (nonatomic,strong)UITextField *purchasePriceFiled;//总金额
@property (nonatomic,strong)UITextField *otherPriceFiled;//其他费用
@property (nonatomic,strong)UILabel *purchasePriceLabel;//总金额
@property (nonatomic,strong)HPGrowingTextView *remarkTextView;//备注
//数据
@property (nonatomic,strong)NSString *noticeUuid;
@property (nonatomic,strong)NSString *noticeNumber;
@property (nonatomic,strong)NSString *billNumber;
@property (nonatomic,strong)NSString *type;
@property (nonatomic,strong)NSString *vendor_uuid;
@property (nonatomic,strong)NSString *vendor_code;
@property (nonatomic,strong)NSString *vendor_name;
@property (nonatomic,strong)NSString *receiveWrh_uuid;
@property (nonatomic,strong)NSString *receiveWrh_code;
@property (nonatomic,strong)NSString *receiveWrh_name;
@property (nonatomic,weak)id <TopPurchaseViewDelegate>delegate;
......
......@@ -10,6 +10,8 @@
#import "SurveyCell.h"
#import "ChooseVendorViewController.h"
#import "ChooseTypeViewController.h"
#import "ChooseWarehouseViewController.h"
#import "Vendor.h"
#define LeftMargin 15
#define TopMargin 20
......@@ -41,7 +43,7 @@
{
self.backgroundColor = XXFBgColor;
_dataArr = [NSMutableArray array];
NSArray *arr = @[@"采购通知:",@"类型:",@"供应商:",@"收货仓库:",@"总金额:",@"备注:"];
NSArray *arr = @[@"采购通知:",@"类型:",@"供应商:",@"收货仓库:",@"其他费用:",@"总金额:",@"备注:"];
[_dataArr addObjectsFromArray:arr];
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, TopMargin,self.frame.size.width, self.frame.size.height - TopMargin)) style:(UITableViewStylePlain)];
......@@ -65,7 +67,7 @@
cell = [[SurveyCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (indexPath.row !=4 && indexPath.row != 5) {
if (indexPath.row > 0 && indexPath.row < 4) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
[self createViewInCell:cell indexPath:indexPath];
......@@ -75,18 +77,24 @@
}
- (void)createViewInCell:(SurveyCell *)cell indexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 4 ) {
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-30, TableHeight)];
textField.textAlignment = NSTextAlignmentRight;
textField.textColor = HexColor(@"444444");
textField.font = FontSize(15);
textField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
textField.returnKeyType = UIReturnKeyDone;
textField.delegate = self;
[cell.contentView addSubview:textField];
self.purchasePriceFiled = textField;
self.purchasePriceFiled.placeholder = @"请输总金额";
self.otherPriceFiled = textField;
self.otherPriceFiled.placeholder = @"请输入其他费用";
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(textField.frame) + 5, 0, 20, TableHeight)];
label.text = @"元";
label.textColor = HexColor(@"444444");
label.font = FontSize(TitleSize);
[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-10, TableHeight)];
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 = 2;
......@@ -97,13 +105,13 @@
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))];
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight))];
contentLabel.textAlignment= NSTextAlignmentRight;
contentLabel.textColor = HexColor(@"bbbbbb");
contentLabel.font = FontSize(TitleSize);
[cell.contentView addSubview:contentLabel];
if (indexPath.row == 0) {
contentLabel.text = @"选择采购通知";
contentLabel.text = @"采购通知单号";
self.purchaseNoticeLabel = contentLabel;
}else if(indexPath.row == 1){
......@@ -117,6 +125,16 @@
}else if(indexPath.row == 3){
contentLabel.text = @"选择收货仓库";
self.purchaseStoreLabel = contentLabel;
}else if(indexPath.row == 5){
contentLabel.text = @"0";
contentLabel.frame = CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-30, TableHeight);
contentLabel.textColor = [UIColor redColor];
self.purchasePriceLabel = contentLabel;
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(contentLabel.frame)+ 5, 0, 20, TableHeight)];
label.text = @"元";
label.textColor = HexColor(@"444444");
label.font = FontSize(TitleSize);
[cell.contentView addSubview:label];
}
}
......@@ -124,16 +142,41 @@
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if(indexPath.row == 2){
ChooseVendorViewController *cvc = [ChooseVendorViewController new];
cvc.title = @"供应商";
cvc.choseVendor = ^(NSArray *vendors){
if (vendors.count > 0) {
Vendor *vendor = vendors[0];
self.purchaseSupplierLabel.text = [NSString stringWithFormat:@"%@[%@]",vendor.name,vendor.code];
self.purchaseSupplierLabel.textColor = HexColor(@"444444");
self.vendor_uuid = vendor.uuid;
self.vendor_code = vendor.code;
self.vendor_name = vendor.name;
}
};
cvc.isMoreChose = NO;
[self.delegate pushNextViewController:cvc];
}else if(indexPath.row == 1){
ChooseTypeViewController *tvc = [[ChooseTypeViewController alloc]init];
tvc.title = @"类型";
tvc.dataArr = @[@"普通",@"紧急"];
tvc.choseType = ^(NSString *type){
self.purchaseTypeLabel.text = type;
self.purchaseTypeLabel.textColor = HexColor(@"444444");
self.type = type;
};
[self.delegate pushNextViewController:tvc];
}else if(indexPath.row == 3){
ChooseWarehouseViewController *wvc = [[ChooseWarehouseViewController alloc]init];
wvc.title = @"仓库";
wvc.choseWarehouse = ^(Warehouse *warehouse){
self.purchaseStoreLabel.text = [NSString stringWithFormat:@"%@[%@]",warehouse.name,warehouse.code];
self.purchaseStoreLabel.textColor = HexColor(@"444444");
self.receiveWrh_uuid = warehouse.uuid;
self.receiveWrh_code = warehouse.code;
self.receiveWrh_name = warehouse.name;
};
[self.delegate pushNextViewController:wvc];
}
}
- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{
......@@ -144,5 +187,17 @@
[self.delegate hiddenKeyBoard];
return YES;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
[self.delegate hiddenKeyBoard];
}
- (void)textFieldDidEndEditing:(UITextField *)textField{
if (textField == self.otherPriceFiled) {
if (self.otherPriceFiled.text.length > 0) {
[[NSNotificationCenter defaultCenter] postNotificationName:SetProductTotalPrice object:nil];
}
}
}
@end
......@@ -108,7 +108,7 @@
self.titleFiled = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(titleLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
self.titleFiled.textAlignment = NSTextAlignmentLeft;
self.titleFiled.textColor = HexColor(@"444444");
self.titleFiled.placeholder = @"输入标题";
self.titleFiled.placeholder = @"输入类似标题";
self.titleFiled.borderStyle = UITextBorderStyleRoundedRect;
self.titleFiled.font = FontSize(15);
self.titleFiled.returnKeyType = UIReturnKeyDone;
......@@ -127,7 +127,7 @@
self.billFiled = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(billLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
self.billFiled.textAlignment = NSTextAlignmentLeft;
self.billFiled.textColor = HexColor(@"444444");
self.billFiled.placeholder = @"输入单号";
self.billFiled.placeholder = @"输入类似单号";
self.billFiled.borderStyle = UITextBorderStyleRoundedRect;
self.billFiled.font = FontSize(15);
self.billFiled.returnKeyType = UIReturnKeyDone;
......
......@@ -28,7 +28,7 @@
if (orderDirection.length >0) {
if ([orderDirection isEqualToString:@"asc"]) {
_currentIndexPath = [NSIndexPath indexPathForRow:0 inSection:0];
}else if ([orderDirection isEqualToString:@"des"]){
}else if ([orderDirection isEqualToString:@"desc"]){
_currentIndexPath = [NSIndexPath indexPathForRow:1 inSection:0];
}else{
_currentIndexPath = [NSIndexPath indexPathForRow:2 inSection:0];
......
......@@ -109,10 +109,12 @@
}else{
if (self.dataArr.count > 0) {
if (_currentIndexPath) {
Product *product = self.dataArr[_currentIndexPath.row];
self.choseProduct(product);
}
}
}
[self PopViewControllerAnimated:YES];
}
......
......@@ -121,19 +121,11 @@
survey.userName = user.name;
[arr addObject:survey];
}
if (arr.count == 0) {
SurveyUser *user = [[SurveyUser alloc]init];
user.userUuid = @"5a7417014e4c2928014e4dea21fb002f";
user.userName = @"栗阳";
user.userCode = @"admin";
[arr addObject:user];
self.chosePerson(arr);
}else{
self.chosePerson(arr);
}
}else{
NSMutableArray *arr = [[NSMutableArray alloc]init];
if (self.dataArr.count > 0) {
if (_currentIndexPath) {
User *user = self.dataArr[_currentIndexPath.row];
SurveyUser * survey = [[SurveyUser alloc]init];
survey.userUuid = user.uuid;
......@@ -143,6 +135,7 @@
self.chosePerson(arr);
}
}
}
[self PopViewControllerAnimated:YES];
}
......
......@@ -45,6 +45,10 @@ typedef enum : NSUInteger {
UIDatePicker *_timePicker;
BOOL _isClickStart;
StartTimeView *_startTimeView;
id uuidObject;
id billNumberObject;
NSNumber *versionObject;
NSString *_clickState;
}
@property (nonatomic,strong)NSString *titleStr;
@property (nonatomic,strong)NSString *productCodeStr;
......@@ -66,6 +70,7 @@ typedef enum : NSUInteger {
[self createTableView];
}
- (void)initData{
_dataArr = [NSMutableArray array];
self.users = [NSMutableArray array];
[_dataArr addObject:@"标题"];
......@@ -74,6 +79,9 @@ typedef enum : NSUInteger {
[_dataArr addObject:@"结束日期"];
[_dataArr addObject:@"调研人员"];
[_dataArr addObject:@"备注"];
uuidObject = [NSNull null];
billNumberObject = [NSNull null];
versionObject = [NSNumber numberWithInt:0];
}
- (void)createTableView
......@@ -94,7 +102,6 @@ typedef enum : NSUInteger {
UIButton *commitBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(saveBtn.frame.origin.x + saveBtn.frame.size.width + LeftMargin, 10, (ScreenSize.width - LeftMargin*3)/2, BtnHeight) target:self sel:@selector(btnClick:) tag:CommitTag image:nil title:@"提交" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:HexColor(@"f69100")];
[footView addSubview:commitBtn];
[self.view addSubview:footView];
_tableView.tableFooterView = footView;
[self.view addSubview:_tableView];
}
......@@ -105,6 +112,7 @@ typedef enum : NSUInteger {
case SaveTag:
{
if ([self checkSurvey]) {
_clickState = @"initial";
[self saveSurvey:@"initial" message:@"正在保存..."];
}
}
......@@ -112,6 +120,7 @@ typedef enum : NSUInteger {
case CommitTag:
{
if ([self checkSurvey]) {
_clickState = @"submitted";
[self saveSurvey:@"submitted" message:@"正在提交..."];
}
}
......@@ -144,17 +153,17 @@ typedef enum : NSUInteger {
if (success == 1) {
//成功
if ([state isEqualToString:@"initial"]) {//保存成功
[IBTLoadingView showTips:@"操作成功"];
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{//提交成功
SurveyViewController *svc = [SurveyViewController new];
[self PushViewController:svc animated:YES];
}
//
// [self clearAllInformation];
// if (self.survey) {
// [ICRUserUtil sharedInstance].needFresh = YES;
// [self.navigationController popViewControllerAnimated:YES];
// }
}else{
[IBTLoadingView showTips:message];
}
......@@ -164,20 +173,18 @@ typedef enum : NSUInteger {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
id uuidObject = [NSNull null];
if(self.survey.uuid.length > 0){
if(self.survey.uuid.length > 0 && uuidObject == [NSNull null]){
uuidObject = self.survey.uuid;
}
id billNumberObject = [NSNull null];
if (self.survey.billNumber > 0) {
if (self.survey.billNumber > 0 && billNumberObject == [NSNull null]) {
billNumberObject = self.survey.billNumber;
}
NSNumber *version = [NSNumber numberWithLong:0];
if (self.survey) {
version = self.survey.version;
if (self.survey && [versionObject integerValue] == 0) {
versionObject = self.survey.version;
}
NSDictionary *dict = @{@"uuid":uuidObject,
@"version":version,
@"version":versionObject,
@"billnumber":billNumberObject,
@"title":[IBTCommon checkString:self.titleStr],
@"state":state,
......@@ -192,32 +199,6 @@ typedef enum : NSUInteger {
[[ICRHTTPController sharedController] saveSurveyWithAuthenticode:dict success:succ failure:fail];
}
- (void)clearAllInformation{
_titleField.text = @"";
_productLabel.text = @"请输入商品";
_productLabel.textColor = HexColor(@"bbbbbb");
_startDateLabel.text = @"选择日期";
_startDateLabel.textColor = HexColor(@"bbbbbb");
_endDateLabel.text = @"选择日期";
_endDateLabel.textColor = HexColor(@"bbbbbb");
_personLabel.text = @"选择调研人员";
_personLabel.textColor = HexColor(@"bbbbbb");
_noteTextView.text = @"";
//清空数据
self.titleStr = @"";
self.productCodeStr = @"";
self.productNameStr = @"";
self.productUuidStr = @"";
self.beginDateStr = @"";
self.endDateStr = @"";
[self.users removeAllObjects];
self.remarkStr = @"";
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
......@@ -243,7 +224,7 @@ typedef enum : NSUInteger {
- (void)createViewInCell:(SurveyCell *)cell indexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 0) {
_titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
_titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight)];
_titleField.textAlignment = NSTextAlignmentRight;
_titleField.textColor = HexColor(@"444444");
_titleField.placeholder = @"输入调研标题";
......@@ -256,7 +237,7 @@ typedef enum : NSUInteger {
self.titleStr = [IBTCommon checkString:self.survey.title];
}
}else if (indexPath.row == _dataArr.count -1){
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight)];
_noteTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
_noteTextView.minNumberOfLines = 1;
_noteTextView.maxNumberOfLines = 4;
......@@ -274,7 +255,7 @@ typedef enum : NSUInteger {
lineFrame.origin.y = TableHeight*2-1;
cell.lineLabel.frame = lineFrame;
}else{
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight))];
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight))];
contentLabel.textAlignment= NSTextAlignmentRight;
contentLabel.textColor = HexColor(@"bbbbbb");
contentLabel.font = FontSize(TitleSize);
......@@ -333,7 +314,7 @@ typedef enum : NSUInteger {
}
- (void)preferDataInProductLabel{
if (self.survey) {
_productLabel.text = [IBTCommon checkString:self.survey.productName];
_productLabel.text = [NSString stringWithFormat:@"%@[%@]",[IBTCommon checkString:self.survey.productName],[IBTCommon checkString:self.survey.productCode]];
_productLabel.textColor = HexColor(@"444444");
self.productCodeStr = [IBTCommon checkString:self.survey.productCode];
self.productNameStr = [IBTCommon checkString:self.survey.productName];
......@@ -360,6 +341,7 @@ typedef enum : NSUInteger {
}else if(indexPath.row == 4){
ChosePersonViewController *cvc = [ChosePersonViewController new];
cvc.chosePerson = ^(NSArray *users){
if(users.count > 0){
NSString *textStr = @"";
if (self.users.count > 0) {
[self.users removeAllObjects];
......@@ -374,6 +356,7 @@ typedef enum : NSUInteger {
}
_personLabel.text = textStr;
_personLabel.textColor = HexColor(@"444444");
}
};
cvc.isMoreChose = YES;
[self PushViewController:cvc animated:YES];
......@@ -463,7 +446,9 @@ typedef enum : NSUInteger {
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
if(self.survey && [_clickState isEqualToString:@"initial"]){
[ICRUserUtil sharedInstance].needFresh = YES;
}
}
- (void)didReceiveMemoryWarning {
......
......@@ -95,8 +95,8 @@ typedef enum : NSUInteger {
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
if ([ICRUserUtil sharedInstance].needFresh) {
[self getData];
if ([ICRUserUtil sharedInstance].needFresh && self.tableView != nil) {
[self.tableView.header beginRefreshing];
}
}
......@@ -324,8 +324,6 @@ typedef enum : NSUInteger {
- (void)hiddenSortMaskView:(BOOL)isHide{
currentBtn = nil;
[self checkSortBtnColor];
// [_sortBtn setImage:[UIImage imageNamed:@"black_arrow_down_with_text"] forState:UIControlStateNormal];
if (isHide == NO) {
[_sortView removeFromSuperview];
_sortView = nil;
......@@ -345,8 +343,6 @@ typedef enum : NSUInteger {
- (void)hiddenBoltMaskView:(BOOL)isHide{
currentBtn = nil;
[self checkBoltBtnColor];
// [_boltBtn setImage:[UIImage imageNamed:@"black_filter_with_text"] forState:UIControlStateNormal];
if (isHide == NO) {
[_boltView removeFromSuperview];
_boltView = nil;
......@@ -367,21 +363,21 @@ typedef enum : NSUInteger {
- (void)getSortValueSelectRow:(NSString *)state{
if (state.length > 0) {
self.orderDirection = state;
NSLog(@"%@",state);
CLog(@"%@",state);
}
}
#pragma mark - boltDelegate
- (void)getBoltValueSelectRow:(NSString *)state{
self.state = state;
NSLog(@"%@",state);
CLog(@"%@",state);
}
- (void)getTitleLike:(NSString *)titleLike{
self.titleLike = titleLike;
NSLog(@"%@",titleLike);
CLog(@"%@",titleLike);
}
- (void)getBillNumber:(NSString *)billNumber{
self.billNumberLike = billNumber;
NSLog(@"%@",billNumber);
CLog(@"%@",billNumber);
}
- (void)clearBoltInformation{
//清空所有条件
......
......@@ -31,7 +31,7 @@
}
- (void)bulidLayout{
CGFloat headWidth = (ScreenSize.width - LeftWidth - RightWidth - SpaceMargin* (self.arr.count -1))/self.arr.count;
CGFloat headWidth = (ScreenSize.width - LeftWidth - LeftWidth - SpaceMargin* (self.arr.count -1))/self.arr.count;
for (NSInteger i = 0; i < self.arr.count; i++) {
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(LeftWidth + (SpaceMargin + headWidth)*i, 0, headWidth, self.frame.size.height)];
label.font = FontSize(TitleSize);
......
......@@ -14,5 +14,6 @@
#import "IBTConstants.h"
#import "ICRAppMacro.h"
#import "ICRNotificationMacro.h"
#endif
......@@ -193,5 +193,7 @@
//行情调研
"AddSurvey" = "新建行情调研";
"AddPurchase" = "新建采购单";
"Purchase" = "采购单";
......@@ -179,3 +179,5 @@
//行情调研
"Survey" = "行情调研";
"AddSurvey" = "新建行情调研";
"AddPurchase" = "新建采购单";
"Purchase" = "采购单";
\ No newline at end of file
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