Commit e3151944 authored by Sandy's avatar Sandy

报表界面、楼层销售

parent 4e344413
This diff is collapsed.
//
// BaseViewController.h
// RealEstateManagement
//
// Created by Z on 16/6/24.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BaseViewController : UIViewController
/** 从storyBoard获取控制器 */
- (id)controllerWithIdentifier:(NSString *)identifier;
/**
* 根据storyboarId push到指定的vc
*/
- (void)PushToStoryBoardVCWithIdentifier:(NSString *)identifier isHideTabbar:(BOOL)hide animate:(BOOL)animate;
@end
//
// BaseViewController.m
// RealEstateManagement
//
// Created by Z on 16/6/24.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import "BaseViewController.h"
@interface BaseViewController ()
@end
@implementation BaseViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.view.backgroundColor = [UIColor colorWithWhite:0.965 alpha:1.000];
// Do any additional setup after loading the view.
}
/** 从storyBoard获取控制器 */
- (id)controllerWithIdentifier:(NSString *)identifier {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Statement" bundle:nil];
return [storyboard instantiateViewControllerWithIdentifier:identifier];
}
- (void)PushToStoryBoardVCWithIdentifier:(NSString *)identifier isHideTabbar:(BOOL)hide animate:(BOOL)animate {
UIViewController *vc = [self controllerWithIdentifier:identifier];
vc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc animated:YES];
}
- (void)dealloc{
CLog(@"%@页面释放", NSStringFromClass([self class]));
}
- (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
......@@ -122,6 +122,15 @@
- (NSString *)timeStampStr;
+ (NSString *)curTimeStamp;
/** yyyy-MM-dd HH:mm:ss */
- (NSString *)httpParameterString;
/** yyyy-MM-dd */
- (NSString *)yearMonthDayString;
/** yyyy-MM */
- (NSString *)yearMonthString;
- (NSString *)yearString;
- (NSString *)monthString;
- (NSString *)dayString;
@end
@interface NSNumber (DateFormatterAdditions)
......
......@@ -380,6 +380,36 @@
return [[NSDate date] timeStampStr];
}
- (NSString *)httpParameterString {
return [self stringWithFormatter:@"%Y-%m-%d %H:%M:%S"];
}
- (NSString *)yearMonthDayString {
return [self stringWithFormatter:@"%Y-%m-%d"];
}
- (NSString *)yearMonthString {
return [self stringWithFormatter:@"%Y-%m"];
}
- (NSString *)mobileIDDateString {
return [self stringWithFormatter:@"%y%m%d%H%M%S000"];
}
- (NSString *)yearString {
NSString *strDate = [self yearMonthDayString];
NSArray *arrDate = [strDate componentsSeparatedByString:@"-"];
return arrDate[0];
}
- (NSString *)monthString {
NSString *strDate = [self yearMonthDayString];
NSArray *arrDate = [strDate componentsSeparatedByString:@"-"];
return arrDate[1];
}
- (NSString *)dayString{
NSString *strDate = [self yearMonthDayString];
NSArray *arrDate = [strDate componentsSeparatedByString:@"-"];
return arrDate[2];
}
@end
@implementation NSNumber (DateFormatterAdditions)
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "back_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "back_icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "downSale@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "downSale@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "goSale@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "goSale@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "more_detail@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "more_detail@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sale_2@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "sale_2@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sale_3@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "sale_3@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sale_4@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "sale_4@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sale_amount_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "sale_amount_icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "salebg_2@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "salebg_2@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "salebg_3@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "salebg_3@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "salebg_4@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "salebg_4@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "search-icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "search-icon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "white_point@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "white_point@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "yellow_point@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "yellow_point@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "业态销售.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "业态销售@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "楼层销售.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "楼层销售@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -76,4 +76,8 @@
#define CLog(format, ...)
#endif
//收起键盘
#define HIDE_KEYBOARD [[UIApplication sharedApplication].keyWindow endEditing:YES]
#endif /* OtherHeaders_h */
......@@ -18,6 +18,7 @@
#import "VankeTenantTabBoard_iPhone.h"
#import "ICRModifyPwdViewController.h"
#import "ReportViewController.h"
#import "ReportBoardsViewController.h"
#pragma mark -
@interface VankeAppBoard_iPhone ()
......@@ -56,7 +57,7 @@ ON_CREATE_VIEWS( signal )
[_router map:@"home" toClass:[VankeMainBoard_iPhone class]];
[_router map:@"affairs" toClass:[VankeAffairsBoard_iPhone class]];
[_router map:@"me" toClass:[ICRSystemViewController class]];
[_router map:@"report" toClass:[ReportViewController class]];
[_router map:@"report" toClass:[ReportBoardsViewController class]];
[self.view addSubview:_router.view];
[self createAndShowLoginWindow];
......
......@@ -24,6 +24,7 @@
#import "VankeStatementListBoard_iPhone.h"
#import "ICRAnnouncementViewController.h"
#import "SalesInputViewController.h"
#import "StatementViewController.h"
#import "ChooseProjectTableViewController.h"
#import "ICRAppMacro.h"
#pragma mark -
......@@ -108,7 +109,11 @@ ON_SIGNAL3(VankeAffairsBoard_iPhone, btnBill, signal) {
return;
} else if (authorizedOrgs.count == 1) {
AuthorizedOrg *org = [authorizedOrgs objectAtIndex:0];
[self showStatementList:org];
//跳转对账单
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Statement" bundle:nil];
StatementViewController *statementVC = [storyboard instantiateViewControllerWithIdentifier:@"StatementViewController"];
statementVC.org = org;
[self.navigationController pushViewController:statementVC animated:YES];
} else {
CGFloat xWidth = self.view.bounds.size.width - 20.0f;
CGFloat yHeight = authorizedOrgs.count * 60 + 50;
......@@ -175,8 +180,12 @@ ON_SIGNAL3(VankeAffairsBoard_iPhone, btnServiceApply, signal) {
- (void)popoverListView:(UIPopoverListView *)popoverListView
didSelectIndexPath:(NSIndexPath *)indexPath
{
//跳转对账单
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Statement" bundle:nil];
StatementViewController *statementVC = [storyboard instantiateViewControllerWithIdentifier:@"StatementViewController"];
AuthorizedOrg *org = [authorizedOrgs objectAtIndex:indexPath.row];
[self showStatementList:org];
statementVC.org = org;
[self.navigationController pushViewController:statementVC animated:YES];
}
- (CGFloat)popoverListView:(UIPopoverListView *)popoverListView
......
......@@ -13,7 +13,7 @@
// 统计时间类型 否 String 100 day(日),week(周),month(月)
@property (nonatomic,strong)NSString *dataScope;
// 统计时间 否 String 100 日:2015-10-10周:37,表示今年第几周月:2015-10
@property (nonatomic,strong)NSString *orgUuid;
//@property (nonatomic,strong)NSString *orgUuid;
//组织标识 否 String
@property (nonatomic,strong)NSString *orgCode;
//组织代码 否 String
......@@ -21,7 +21,7 @@
//组织名称 否 Integer
@property (nonatomic,assign)NSInteger level;
//等级 否 String
@property (nonatomic,strong)NSString *upperUuid;
@property (nonatomic,strong)NSString *upperOrgCode;
//上级组织uuid 否 String
@property (nonatomic,strong)NSNumber *sales;
// 销售额 是 String 100
......
......@@ -10,4 +10,8 @@
@implementation Compass
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
}
@end
//
// ReportBoardsViewController.h
// vanke
//
// Created by Z on 16/7/15.
// Copyright © 2016年 gomore. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ICRBaseViewController.h"
@interface ReportBoardsViewController : ICRBaseViewController
@end
//
// ReportBoardsViewController.m
// vanke
//
// Created by Z on 16/7/15.
// Copyright © 2016年 gomore. All rights reserved.
//
#import "ReportBoardsViewController.h"
#import "ReportBoardTableViewCell.h"
#import "ReportViewController.h"
static NSString *const cellId = @"cellId";
@interface ReportBoardsViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *arrTitles;
@property (nonatomic, strong) NSArray *arrPicName;
@end
@implementation ReportBoardsViewController
ON_CREATE_VIEWS( signal )
{
self.navigationBarShown = YES;
self.navigationBarTitle = @"报表";
self.navigationBarLeft = nil;
UIColor *color = [UIColor colorWithR:63 g:134 b:244 a:1];
if ( IOS7_OR_LATER ) {
self.navigationController.navigationBar.barTintColor = color;
} else {
self.navigationController.navigationBar.tintColor = color;
}
}
ON_DID_APPEAR( signal )
{
self.arrTitles = @[@"楼层销售报表",@"业态销售报表"];
self.arrPicName = @[@"楼层销售",@"业态销售"];
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 64 - 49) style:UITableViewStylePlain];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.tableView registerNib:[UINib nibWithNibName:@"ReportBoardTableViewCell" bundle:nil] forCellReuseIdentifier:cellId];
[self.view addSubview:self.tableView];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
}
#pragma mark - tableView delegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 90;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
switch (indexPath.row) {
case 0:
{
ReportViewController *reportVC = [[ReportViewController alloc] init];
reportVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:reportVC animated:YES];
}
break;
default:
break;
}
}
#pragma mark - tableView dataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.arrTitles.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ReportBoardTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId forIndexPath:indexPath];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.img.image = [UIImage imageNamed:self.arrPicName[indexPath.row]];
cell.labelTItle.text = self.arrTitles[indexPath.row];
return cell;
}
- (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
......@@ -57,15 +57,18 @@ ON_CREATE_VIEWS( signal )
self.navigationBarTitle = @"我";
self.navigationBarLeft = nil;
//添加通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getNextDetailData:) name:KNOTIFICATION_GetNextDetailData object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(goReoprtDetail:) name:KNOTIFICATION_GoReportDetail object:nil];
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getNextDetailData:) name:KNOTIFICATION_GetNextDetailData object:nil];
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(goReoprtDetail:) name:KNOTIFICATION_GoReportDetail object:nil];
UIColor *color = [UIColor colorWithR:63 g:134 b:244 a:1];
if ( IOS7_OR_LATER ) {
self.navigationController.navigationBar.barTintColor = color;
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
} else {
self.navigationController.navigationBar.tintColor = color;
}
}
- (instancetype)init{
......@@ -154,7 +157,7 @@ ON_CREATE_VIEWS( signal )
#pragma mark - 获取上部数据
- (void)getDataFromServer{
__weak typeof(self)weakSelf = self;
[IBTLoadingView showProgressLabel:@"正在加载..."];
// [IBTLoadingView showProgressLabel:@"正在加载..."];
NSMutableArray *orderArr =[NSMutableArray array];
if (orderArr.count == 0) {
QueryOrder *order = [QueryOrder new];
......@@ -172,16 +175,26 @@ ON_CREATE_VIEWS( signal )
NSString *authorCodes = [arrAuthordCode componentsJoinedByString:@","];
NSDictionary *dict = @{
@"dataScopeType":self.dayType,
@"dataType":@"floor",
@"dataType":@"biz",
@"orgCodes":authorCodes,
@"dataScope":self.scopeType,
@"orgUuid":loginInfo.org_uuid,
@"queryOrders":orderArr,
@"pageNumber":@0,
@"pageSize":@100
};
NSString *json = [dict JSONString];
[[ICRHTTPController sharedController] postUrl:@"salesdata/query" params:dict success:^(id data) {
NSDictionary *testParams = @{@"dataType" : @"biz",
@"dataScopeType" : @"day",
@"dataScope" : @"2016-7-15",
@"orgCodes" : @"22,33",
@"upperOrgCode" : [NSNull null],
@"queryOrders" : @[@{@"field" : @"salesInfo.orgCode",
@"direction" : @"asc"}],
@"pageNumber" : @0,
@"pageSize" : @20};
[[ICRHTTPController sharedController] postUrl:@"salesdata/query" params:testParams success:^(id data) {
CLog(@"%@", data);
__strong __typeof(weakSelf)strongSelf = weakSelf;
//赋值
NSInteger success = [data[@"success"] integerValue];
......@@ -231,40 +244,68 @@ ON_CREATE_VIEWS( signal )
//获取底部详情数据
- (void)getBottomData:(NSIndexPath *)indexPath{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
// void(^succ)(id) = ^(id data) {
// __strong __typeof(weakSelf)strongSelf = weakSelf;
// //赋值
// [IBTLoadingView hideHUDWithText:nil];
// [strongSelf downLoadData:data indexPath:indexPath];
// };
// void(^fail)(id) = ^(id data) {
// [IBTLoadingView hideHUDWithText:nil];
// [IBTLoadingView showTips:data];
// };
// LoginResponseData *loginInfo = [[VankeCommonModel sharedInstance] getLoginInfo];
// if (!self.orgScope) {
// self.orgScope = loginInfo.org_uuid;
// }
// NSMutableArray *orderArr =[NSMutableArray array];
// if (orderArr.count == 0) {
// QueryOrder *order = [QueryOrder new];
// order.field = @"orgCode";
// order.direction = @"desc";
// [orderArr addObject:[order dictForCommit]];
// }
// if (indexPath) {
//// [IBTLoadingView showProgressLabel:@"正在加载..."];
// }
// NSDictionary *dict = @{
// @"dataScopeType":self.dayType,
// @"dataScope":self.scopeType,
// @"orgUuid":self.orgScope,
// @"fetchScope":@"childs",
// @"queryOrders":orderArr,
// @"pageNumber":@0,
// @"pageSize":@100
// };
// CLog(@"%@", dict);
NSArray *arr = [[VankeCommonModel sharedInstance] getAuthOrgs];
NSMutableArray *arrAuthordCode = [NSMutableArray array];
for (AuthorizedOrg *org in arr) {
[arrAuthordCode addObject:org.code];
}
NSString *authorCodes = [arrAuthordCode componentsJoinedByString:@","];
NSDictionary *testParams = @{@"dataType" : @"biz",
@"dataScopeType" : @"day",
@"dataScope" : @"2016-7-15",
@"orgCodes" : self.orgScope ? [NSNull null] : @"HSCQ",
@"upperOrgCode" : self.orgScope ? self.orgScope : [NSNull null],
@"queryOrders" : @[@{@"field" : @"salesInfo.orgCode",
@"direction" : @"asc"}],
@"pageNumber" : @0,
@"pageSize" : @20};
[[ICRHTTPController sharedController] postUrl:@"salesdata/query" params:testParams success:^(id data) {
CLog(@"%@", data);
__strong __typeof(weakSelf)strongSelf = weakSelf;
//赋值
[IBTLoadingView hideHUDWithText:nil];
[strongSelf downLoadData:data indexPath:indexPath];
};
void(^fail)(id) = ^(id data) {
} failure:^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
LoginResponseData *loginInfo = [[VankeCommonModel sharedInstance] getLoginInfo];
if (!self.orgScope) {
self.orgScope = loginInfo.org_uuid;
}
NSMutableArray *orderArr =[NSMutableArray array];
if (orderArr.count == 0) {
QueryOrder *order = [QueryOrder new];
order.field = @"orgCode";
order.direction = @"desc";
[orderArr addObject:[order dictForCommit]];
}
if (indexPath) {
// [IBTLoadingView showProgressLabel:@"正在加载..."];
}
NSDictionary *dict = @{
@"dataScopeType":self.dayType,
@"dataScope":self.scopeType,
@"orgUuid":self.orgScope,
@"fetchScope":@"childs",
@"queryOrders":orderArr,
@"pageNumber":@0,
@"pageSize":@100
};
CLog(@"%@", dict);
}];
// [[ICRHTTPController sharedController] queryHomepageWith:dict success:succ failure:fail];
}
......@@ -499,12 +540,12 @@ ON_CREATE_VIEWS( signal )
NSIndexPath *indexPath = dict[@"indexPath"];
Compass *parentCompass = [self.dataArr objectAtIndex:indexPath.row];
//如果当前点击的不是删除,则要先获取数据在进行插入
if (![self isHaveIndexPath:parentCompass.orgUuid]) {
if (![self isHaveIndexPath:parentCompass.orgCode]) {
if (parentCompass.isLeaf) {
//如果是子节点就不用进行网络请求
return;
}//不是子节点进行网络请求
self.orgScope = parentCompass.orgUuid;
self.orgScope = parentCompass.orgCode;
[self getBottomData:indexPath];
return;
}
......@@ -517,7 +558,7 @@ ON_CREATE_VIEWS( signal )
BOOL expand = NO;
for (int i=0; i<self.totalArr.count; i++) {
Compass *node = [self.totalArr objectAtIndex:i];
if ([node.upperUuid isEqualToString:parentCompass.orgUuid]) {
if ([node.upperOrgCode isEqualToString:parentCompass.orgCode]) {
//修改二级节点的属性为为原属性相反属性
node.expand = !node.expand;
if (node.expand) {
......@@ -541,13 +582,13 @@ ON_CREATE_VIEWS( signal )
//插入或者删除相关节点
if (expand) {
[self.selectArr addObject:parentCompass.orgUuid];
[self.selectArr addObject:parentCompass.orgCode];
[self insertDataWithTable:svc.tableView arr:indexPathArray];
// [self insertDataWithTable:ppvc.tableView arr:indexPathArray];
// [self insertDataWithTable:pvc.tableView arr:indexPathArray];
// [self insertDataWithTable:gvc.tableView arr:indexPathArray];
}else{
[self.selectArr removeObject:parentCompass.orgUuid];
[self.selectArr removeObject:parentCompass.orgCode];
[self deleteDataWithTable:svc.tableView arr:indexPathArray];
// [self deleteDataWithTable:pvc.tableView arr:indexPathArray];
// [self deleteDataWithTable:ppvc.tableView arr:indexPathArray];
......@@ -590,7 +631,7 @@ ON_CREATE_VIEWS( signal )
for (NSInteger i = startPosition+1; i < endPosition; i++) {
Compass *parentCompass = self.dataArr[i];
for (Compass *orgCompass in self.totalArr) {
if (parentCompass.orgUuid == orgCompass.orgUuid) {
if (parentCompass.orgCode == orgCompass.orgCode) {
[self.totalArr removeObject:orgCompass];
break;
}
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ReportViewController">
<connections>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</objects>
</document>
......@@ -113,6 +113,7 @@ static NSString *saleHeaderIdentify = @"saleHeaderIdentify";
headerView = [[SaleHeaderView alloc] initWithReuseIdentifier:saleHeaderIdentify];
}
[headerView buildLayout];
//jv
headerView.totalLabel.text = [NSString stringWithFormat:@"共%ld家",(long)self.count];
[headerView changeTypeName:self.typeStr];
......
......@@ -51,39 +51,34 @@
- (void)bulidLayout{
CGRect rect = CGRectMake(0, 0, self.width, self.height);
self.bgImage = [[UIImageView alloc]initWithFrame:rect];
self.bgImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.width, self.height)];
[self addSubview:self.bgImage];
rect = CGRectMake(self.width/4, 20, CenImageSize, CenImageSize);
self.cenImage = [[UIImageView alloc]initWithFrame:rect];
self.cenImage = [[UIImageView alloc]initWithFrame:CGRectMake(self.width/4, 20, CenImageSize, CenImageSize)];
self.cenImage.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:self.cenImage];
rect = CGRectMake(self.cenImage.right+5, 20, SCREEN_WIDTH - self.cenImage.right, ContentHeight);
self.centerLabel = [[UILabel alloc]initWithFrame:rect];
self.centerLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.cenImage.right+5, 20, SCREEN_WIDTH - self.cenImage.right, ContentHeight)];
self.centerLabel.textColor = ReportContentColor;
self.centerLabel.font = FontSize(28);
[self addSubview:self.centerLabel];
rect = CGRectMake(self.centerLabel.left, self.centerLabel.bottom,self.width-self.centerLabel.left, ContentHeight);
self.dateLabel = [[UILabel alloc]initWithFrame:rect];
self.dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.centerLabel.left, self.centerLabel.bottom,self.width-self.centerLabel.left, ContentHeight)];
self.dateLabel.textColor = [UIColor lightGrayColor];
self.dateLabel.font = GXF_THREETEENTH_SIZE;
self.dateLabel.textAlignment = NSTextAlignmentLeft;
[self addSubview:self.dateLabel];
CGFloat bottomWidth = (SCREEN_WIDTH - 20)/4;
CGFloat bottomWidth = (SCREEN_WIDTH - 20)/3;
rect = CGRectMake(10, self.dateLabel.bottom + 5,bottomWidth, ContentHeight);
self.lastWeekLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:rect fontSize:15 fontColor:[UIColor lightGrayColor]];
self.lastWeekLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:CGRectMake(10, self.dateLabel.bottom + 5,bottomWidth, ContentHeight) fontSize:15 fontColor:[UIColor lightGrayColor]];
[self addSubview:self.lastWeekLabel];
rect = CGRectMake(self.lastWeekLabel.left, self.lastWeekLabel.bottom,bottomWidth,20);
UILabel *weekLabel = [[UILabel alloc]initWithFrame:rect];
UILabel *weekLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.lastWeekLabel.left, self.lastWeekLabel.bottom,bottomWidth,20)];
weekLabel.textColor = [UIColor lightGrayColor];
weekLabel.text = @"比上周同期";
weekLabel.font = GXF_THREETEENTH_SIZE;
......@@ -91,51 +86,51 @@
[self addSubview:weekLabel];
self.weekLabel = weekLabel;
rect = CGRectMake(self.lastWeekLabel.right, self.lastWeekLabel.top,bottomWidth, ContentHeight);
self.lastYearLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:rect fontSize:15 fontColor:[UIColor lightGrayColor]];
self.lastYearLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:CGRectMake(self.lastWeekLabel.right, self.lastWeekLabel.top,bottomWidth, ContentHeight) fontSize:15 fontColor:[UIColor lightGrayColor]];
[self addSubview:self.lastYearLabel];
rect = CGRectMake(self.lastYearLabel.left, self.lastWeekLabel.bottom,bottomWidth,20);
UILabel *yearLabel = [[UILabel alloc]initWithFrame:rect];
UILabel *yearLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.lastYearLabel.left, self.lastWeekLabel.bottom,bottomWidth,20)];
yearLabel.textColor = [UIColor lightGrayColor];
yearLabel.text = @"比去年同期";
yearLabel.font = GXF_THREETEENTH_SIZE;
yearLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:yearLabel];
rect = CGRectMake(self.lastYearLabel.right,self.lastWeekLabel.top,bottomWidth, ContentHeight);
self.rateLabel = [[UILabel alloc]initWithFrame:rect];
self.rateLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.lastYearLabel.right,self.lastWeekLabel.top,bottomWidth, ContentHeight)];
self.rateLabel.textColor = GXF_COMMIT_COLOR;
self.rateLabel.font = GXF_FIFTEENTEN_SIZE;
self.rateLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.rateLabel];
rect = CGRectMake(self.rateLabel.left, self.lastWeekLabel.bottom,bottomWidth,20);
UILabel *raLabel = [[UILabel alloc]initWithFrame:rect];
UILabel *raLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.rateLabel.left, self.lastWeekLabel.bottom,bottomWidth,20)];
raLabel.textColor = [UIColor lightGrayColor];
raLabel.text = @"销售达成率";
raLabel.text = @"坪效";
raLabel.font = GXF_THREETEENTH_SIZE;
raLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:raLabel];
rect = CGRectMake(self.rateLabel.right, self.lastWeekLabel.top,bottomWidth, ContentHeight);
self.averageLabel = [[UILabel alloc]initWithFrame:rect];
self.averageLabel.textColor = GXF_COMMIT_COLOR;
self.averageLabel.font = GXF_FIFTEENTEN_SIZE;
self.averageLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.averageLabel];
rect = CGRectMake(self.averageLabel.left, self.lastWeekLabel.bottom,bottomWidth,20);
UILabel *avLabel = [[UILabel alloc]initWithFrame:rect];
avLabel.textColor = [UIColor lightGrayColor];
avLabel.text = @"单店日均";
avLabel.font = GXF_THREETEENTH_SIZE;
avLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:avLabel];
self.avgLabel = avLabel;
// self.averageLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.rateLabel.right, self.lastWeekLabel.top,bottomWidth, ContentHeight)];
// self.averageLabel.textColor = GXF_COMMIT_COLOR;
// self.averageLabel.font = GXF_FIFTEENTEN_SIZE;
//
// self.averageLabel.textAlignment = NSTextAlignmentCenter;
// [self addSubview:self.averageLabel];
//
//
// UILabel *avLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.averageLabel.left, self.lastWeekLabel.bottom,bottomWidth,20)];
// avLabel.textColor = [UIColor lightGrayColor];
// avLabel.text = @"单店日均";
// avLabel.font = GXF_THREETEENTH_SIZE;
// avLabel.textAlignment = NSTextAlignmentCenter;
// [self addSubview:avLabel];
// self.avgLabel = avLabel;
// self.pageControl = [[SMPageControl alloc]initWithFrame:CGRectMake(0, avLabel.bottom+5, SCREEN_WIDTH, 10)];
// self.pageControl.numberOfPages = 4;
// self.pageControl.currentPage = self.currentPage;
......
//
// ReportBoardTableViewCell.h
// vanke
//
// Created by Z on 16/7/15.
// Copyright © 2016年 gomore. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ReportBoardTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *labelTItle;
@property (weak, nonatomic) IBOutlet UIImageView *img;
@end
//
// ReportBoardTableViewCell.m
// vanke
//
// Created by Z on 16/7/15.
// Copyright © 2016年 gomore. All rights reserved.
//
#import "ReportBoardTableViewCell.h"
@implementation ReportBoardTableViewCell
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="85" id="KGk-i7-Jjw" customClass="ReportBoardTableViewCell">
<rect key="frame" x="0.0" y="0.0" width="316" height="85"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="316" height="84"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="楼层销售" translatesAutoresizingMaskIntoConstraints="NO" id="6lO-Np-GH7">
<rect key="frame" x="18" y="12" width="60" height="60"/>
<constraints>
<constraint firstAttribute="width" secondItem="6lO-Np-GH7" secondAttribute="height" multiplier="1:1" id="Ury-rU-7jm"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="楼层销售报表" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zal-Y6-M8w">
<rect key="frame" x="96" y="31" width="108" height="22"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="6lO-Np-GH7" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="12" id="49Y-R0-syZ"/>
<constraint firstItem="Zal-Y6-M8w" firstAttribute="leading" secondItem="6lO-Np-GH7" secondAttribute="trailing" constant="18" id="7wc-cN-0c6"/>
<constraint firstAttribute="bottom" secondItem="6lO-Np-GH7" secondAttribute="bottom" constant="12" id="CEl-S1-AKk"/>
<constraint firstItem="Zal-Y6-M8w" firstAttribute="centerY" secondItem="6lO-Np-GH7" secondAttribute="centerY" id="CgF-7B-u0D"/>
<constraint firstItem="6lO-Np-GH7" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="18" id="TpU-jM-NOL"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="img" destination="6lO-Np-GH7" id="gwM-jD-id3"/>
<outlet property="labelTItle" destination="Zal-Y6-M8w" id="cHY-xv-T5d"/>
</connections>
<point key="canvasLocation" x="401" y="380.5"/>
</tableViewCell>
</objects>
<resources>
<image name="楼层销售" width="75" height="75"/>
</resources>
</document>
......@@ -48,30 +48,40 @@
[self.contentView addSubview:lineLabel];
rect = CGRectMake(10, 0, 105, Sale_Header_Height);
//右侧共几家 jv
rect = CGRectMake(10, 0, 90, Sale_Header_Height);
UILabel *searLabel = [IBTCommon labelWithTitle:@"共280家" frame:rect textFont:self.textFont];
searLabel.textColor = ReportTitleColor;
[self.contentView addSubview:searLabel];
searLabel.alpha = 0;
self.totalLabel = searLabel;
CGFloat width = (SCREEN_WIDTH - searLabel.right - 25)/3;
CGFloat width = (SCREEN_WIDTH - searLabel.right - 15)/4;
rect = CGRectMake(searLabel.right, 0, width + 20, Sale_Header_Height);
rect = CGRectMake(searLabel.right, 0, width, Sale_Header_Height);
UILabel * xsBtn = [IBTCommon labelWithTitle:@"销售额" frame:rect textFont:self.textFont];
xsBtn.textColor = ReportTitleColor;
[self.contentView addSubview:xsBtn];
rect = CGRectMake(xsBtn.right , 0, width, Sale_Header_Height);
UILabel * bszLabel = [IBTCommon labelWithTitle:@"比上周" frame:rect textFont:self.textFont];
bszLabel.textAlignment = NSTextAlignmentCenter;
bszLabel.textColor = ReportTitleColor;
[self.contentView addSubview:bszLabel];
self.bszLabel = bszLabel;
rect = CGRectMake(bszLabel.right , 0, width-20, Sale_Header_Height);
UILabel * sclLabel = [IBTCommon labelWithTitle:@"达成率" frame:rect textFont:self.textFont];
rect = CGRectMake(bszLabel.right , 0, width, Sale_Header_Height);
UILabel * sclLabel = [IBTCommon labelWithTitle:@"坪效" frame:rect textFont:self.textFont];
sclLabel.textColor = ReportTitleColor;
sclLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:sclLabel];
//日均销售
UILabel *dailySale = [IBTCommon labelWithTitle:@"日均销售" frame:CGRectMake(sclLabel.right, 0, width + 10, Sale_Header_Height) textFont:self.textFont];
dailySale.textColor = ReportTitleColor;
// dailySale.backgroundColor = [UIColor redColor];
[self.contentView addSubview:dailySale];
rect = CGRectMake(0, Sale_Header_Height-1, SCREEN_WIDTH, 1);
UILabel *lineTLabel = [[UILabel alloc]initWithFrame:rect];
lineTLabel.backgroundColor = GXF_LINE_COLOR;
......
......@@ -16,7 +16,9 @@
@property (nonatomic, strong) UILabel *saleLabel;
@property (nonatomic, strong) UIButton *lastWeekLabel;
/** 坪效 */
@property (nonatomic, strong) UILabel *rateLabel;
@property (nonatomic, strong) UILabel *dailySaleLabel;
@property (nonatomic, strong) UILabel *lineLabel;
......
......@@ -9,7 +9,7 @@
#import "SaleViewCell.h"
#define Sale_Cell_Height 50
#define Left_Width 110
#define Left_Width 95
#define Left_margin 5
@interface SaleViewCell ()
{
......@@ -68,28 +68,39 @@
self.dqLabel = [IBTCommon labelWithTitle:@"0101" frame:rect textFont:self.textFont];
[self.contentView addSubview:self.dqLabel];
CGFloat width = (SCREEN_WIDTH - self.dqLabel.right - 25)/3;
CGFloat width = (SCREEN_WIDTH - self.dqLabel.right - 15)/4;
rect = CGRectMake(self.dqLabel.right , 0, width+20, Sale_Cell_Height);
rect = CGRectMake(self.dqLabel.right , 0, width, Sale_Cell_Height);
self.saleLabel = [IBTCommon labelWithTitle:@"56,080" frame:rect textFont:self.textFont];
[self.contentView addSubview:self.saleLabel];
//比上周
rect = CGRectMake(self.saleLabel.right, 0, width, Sale_Cell_Height);
self.lastWeekLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:rect fontSize:15 fontColor:ReportContentColor];
self.lastWeekLabel = [IBTCommon buttonWithTitle:@"" Image:nil frame:rect fontSize:15 fontColor:ReportContentColor];
self.lastWeekLabel.enabled = NO;
self.lastWeekLabel.titleLabel.textAlignment = NSTextAlignmentCenter;
self.lastWeekLabel.contentHorizontalAlignment=UIControlContentHorizontalAlignmentLeft ;
[self.contentView addSubview:self.lastWeekLabel];
rect = CGRectMake(self.lastWeekLabel.right, 0, width-20, Sale_Cell_Height);
//坪效
rect = CGRectMake(self.lastWeekLabel.right, 0, width, Sale_Cell_Height);
self.rateLabel = [IBTCommon labelWithTitle:@"60%" frame:rect textFont:self.textFont];
self.rateLabel.textAlignment = NSTextAlignmentCenter;
self.rateLabel.textColor = GXF_COMMIT_COLOR;
[self.contentView addSubview:self.rateLabel];
rect = CGRectMake(self.rateLabel.right, 0, 25, Sale_Cell_Height);
self.detailBtn = [IBTCommon buttonWithTitle:@"" Image:[UIImage imageNamed:@"more_detail"] frame:rect fontSize:20 fontColor:ReportBgColor];
self.detailBtn.titleLabel.font = [UIFont boldSystemFontOfSize:15];
[self.contentView addSubview:self.detailBtn];
//日均销售
self.dailySaleLabel = [IBTCommon labelWithTitle:@"23" frame:CGRectMake(self.rateLabel.right+10, 0, width, Sale_Cell_Height) textFont:self.textFont];
self.dailySaleLabel.textColor = GXF_COMMIT_COLOR;
[self.contentView addSubview:self.dailySaleLabel];
//三个小点
// rect = CGRectMake(self.rateLabel.right, 0, 25, Sale_Cell_Height);
// self.detailBtn = [IBTCommon buttonWithTitle:@"" Image:[UIImage imageNamed:@"more_detail"] frame:rect fontSize:20 fontColor:ReportBgColor];
// self.detailBtn.titleLabel.font = [UIFont boldSystemFontOfSize:15];
// [self.contentView addSubview:self.detailBtn];
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0, Sale_Cell_Height - 1, SCREEN_WIDTH, 1))];
......@@ -126,27 +137,27 @@
NSString *salesYoStr = [NSString stringWithFormat:@"%@%%",[IBTCommon stringDisposeWithFloat:[sale.salesChainRate floatValue]]];
[self.lastWeekLabel setTitle:salesYoStr forState:UIControlStateNormal];
//销售目标达成率
NSString *salesTargetRateStr = [NSString stringWithFormat:@"%@%%",[IBTCommon stringDisposeWithFloat:[sale.salesTargetRate floatValue]]];
//坪效
NSString *salesTargetRateStr = [NSString stringWithFormat:@"%@",[IBTCommon stringDisposeWithFloat:[sale.salesTargetRate floatValue]]];
self.rateLabel.text = salesTargetRateStr;
[self setColorAndFont:sale.level];
}
- (void)setColorAndFont:(NSInteger)level{
if (level == 0) {
if (level == 99) {
self.dqLabel.textColor = GXF_CONTENT_COLOR;
self.nameLabel.textColor = GXF_CONTENT_COLOR;
self.lineLabel.hidden = NO;
[self setFontLabel:17];
[self setWidthDQ:0];
self.contentView.backgroundColor = [UIColor whiteColor];
}else if (level == 1) {
}else if (level == 0) {
self.dqLabel.textColor = [UIColor blackColor];
self.nameLabel.textColor = [UIColor blackColor];
self.lineLabel.hidden = NO;
[self setFontLabel:15];
[self setWidthDQ:0];
self.contentView.backgroundColor = [UIColor whiteColor];
}else if(level == 2){
}else if(level == 1){
self.lineLabel.hidden = NO;
self.dqLabel.textColor = GXF_LEFTSIX_COLOR;
self.nameLabel.textColor = GXF_LEFTSIX_COLOR;
......@@ -158,9 +169,8 @@
self.dqLabel.textColor = ReportTwoColor;
self.nameLabel.textColor = ReportTwoColor;
[self setFontLabel:12];
[self setWidthDQ:10];
[self setWidthDQ:10];
self.contentView.backgroundColor = [UIColor colorWithWhite:0.965 alpha:1.000];
}
}
- (void)setFontLabel:(NSInteger)fontSize{
......
//
// StatementListParamModel.h
//
// Created by 杰 张 on 16/6/29
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface StatementListParamModel : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) double pageSize;
@property (nonatomic, strong) NSString *shopLike;
@property (nonatomic, assign) double pageNumber;
@property (nonatomic, strong) NSString *tenantEquals;
@property (nonatomic, strong) NSString *authorizedOrgIn;
@property (nonatomic, strong) NSString *settleEquals;
@property (nonatomic, strong) NSString *state;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// StatementListParamModel.m
//
// Created by 杰 张 on 16/6/29
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "StatementListParamModel.h"
NSString *const kStatementListParamModelPageSize = @"pageSize";
NSString *const kStatementListParamModelShopLike = @"shopLike";
NSString *const kStatementListParamModelPageNumber = @"pageNumber";
NSString *const kStatementListParamModelTenantEquals = @"tenantEquals";
NSString *const kStatementListParamModelAuthorizedOrgIn = @"authorizedOrgIn";
NSString *const kStatementListParamModelSettleEquals = @"settleEquals";
NSString *const kStatementListParamModelState = @"state";
@interface StatementListParamModel ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation StatementListParamModel
@synthesize pageSize = _pageSize;
@synthesize shopLike = _shopLike;
@synthesize pageNumber = _pageNumber;
@synthesize tenantEquals = _tenantEquals;
@synthesize authorizedOrgIn = _authorizedOrgIn;
@synthesize settleEquals = _settleEquals;
@synthesize state = _state;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.pageSize = [[self objectOrNilForKey:kStatementListParamModelPageSize fromDictionary:dict] doubleValue];
self.shopLike = [self objectOrNilForKey:kStatementListParamModelShopLike fromDictionary:dict];
self.pageNumber = [[self objectOrNilForKey:kStatementListParamModelPageNumber fromDictionary:dict] doubleValue];
self.tenantEquals = [self objectOrNilForKey:kStatementListParamModelTenantEquals fromDictionary:dict];
self.authorizedOrgIn = [self objectOrNilForKey:kStatementListParamModelAuthorizedOrgIn fromDictionary:dict];
self.settleEquals = [self objectOrNilForKey:kStatementListParamModelSettleEquals fromDictionary:dict];
self.state = [self objectOrNilForKey:kStatementListParamModelState fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
NSNumber *num = [NSNumber numberWithInt:self.pageSize];
[mutableDict setValue:num forKey:kStatementListParamModelPageSize];
[mutableDict setValue:self.shopLike forKey:kStatementListParamModelShopLike];
[mutableDict setValue:[NSNumber numberWithInt:self.pageNumber] forKey:kStatementListParamModelPageNumber];
[mutableDict setValue:self.tenantEquals forKey:kStatementListParamModelTenantEquals];
NSMutableArray *tempArrayForAuthorizedOrgIn = [NSMutableArray array];
for (NSObject *subArrayObject in self.authorizedOrgIn) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForAuthorizedOrgIn addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForAuthorizedOrgIn addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForAuthorizedOrgIn] forKey:kStatementListParamModelAuthorizedOrgIn];
[mutableDict setValue:self.settleEquals forKey:kStatementListParamModelSettleEquals];
[mutableDict setValue:self.state forKey:kStatementListParamModelState];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.pageSize = [aDecoder decodeDoubleForKey:kStatementListParamModelPageSize];
self.shopLike = [aDecoder decodeObjectForKey:kStatementListParamModelShopLike];
self.pageNumber = [aDecoder decodeDoubleForKey:kStatementListParamModelPageNumber];
self.tenantEquals = [aDecoder decodeObjectForKey:kStatementListParamModelTenantEquals];
self.authorizedOrgIn = [aDecoder decodeObjectForKey:kStatementListParamModelAuthorizedOrgIn];
self.settleEquals = [aDecoder decodeObjectForKey:kStatementListParamModelSettleEquals];
self.state = [aDecoder decodeObjectForKey:kStatementListParamModelState];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeDouble:_pageSize forKey:kStatementListParamModelPageSize];
[aCoder encodeObject:_shopLike forKey:kStatementListParamModelShopLike];
[aCoder encodeDouble:_pageNumber forKey:kStatementListParamModelPageNumber];
[aCoder encodeObject:_tenantEquals forKey:kStatementListParamModelTenantEquals];
[aCoder encodeObject:_authorizedOrgIn forKey:kStatementListParamModelAuthorizedOrgIn];
[aCoder encodeObject:_settleEquals forKey:kStatementListParamModelSettleEquals];
[aCoder encodeObject:_state forKey:kStatementListParamModelState];
}
- (id)copyWithZone:(NSZone *)zone
{
StatementListParamModel *copy = [[StatementListParamModel alloc] init];
if (copy) {
copy.pageSize = self.pageSize;
copy.shopLike = [self.shopLike copyWithZone:zone];
copy.pageNumber = self.pageNumber;
copy.tenantEquals = [self.tenantEquals copyWithZone:zone];
copy.authorizedOrgIn = [self.authorizedOrgIn copyWithZone:zone];
copy.settleEquals = [self.settleEquals copyWithZone:zone];
copy.state = [self.state copyWithZone:zone];
}
return copy;
}
@end
This source diff could not be displayed because it is too large. You can view the blob instead.
//
// StatementDetailViewController.h
// RealEstateManagement
//
// Created by Z on 16/6/29.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import "BaseViewController.h"
@interface StatementDetailViewController : BaseViewController
@end
//
// StatementDetailViewController.m
// RealEstateManagement
//
// Created by Z on 16/6/29.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import "StatementDetailViewController.h"
#import "StatementDetailCell.h"
@interface StatementDetailViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@end
@implementation StatementDetailViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
#pragma mark - tableView DataSource
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 60;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
StatementDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:@"StatementDetailCell" forIndexPath:indexPath];
return cell;
}
- (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
//
// StatementViewController.h
// RealEstateManagement
//
// Created by Z on 16/6/29.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import "BaseViewController.h"
@interface StatementViewController : BaseViewController
/** 项目 */
@property (nonatomic, strong) AuthorizedOrg *org;
@end
//
// StatementViewController.m
// RealEstateManagement
//
// Created by Z on 16/6/29.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import "StatementViewController.h"
#import "StatementTableViewCell.h"
#import "NSDate+FormatterAdditions.h"
#import "SRMonthPicker.h"
#import "StatementListParamModel.h"
@interface StatementViewController ()<UITableViewDelegate, UITableViewDataSource, SRMonthPickerDelegate, UISearchBarDelegate>
/** 共?家商铺 */
@property (weak, nonatomic) IBOutlet UILabel *labelTotalShop;
/** 应缴合计 */
@property (weak, nonatomic) IBOutlet UILabel *labelTotalShouldPay;
/** 已缴合计 */
@property (weak, nonatomic) IBOutlet UILabel *labelTotalPaidIn;
/** 未缴合计 */
@property (weak, nonatomic) IBOutlet UILabel *labelTotalUnPaid;
/** 输入框,用于呼出datePicker */
@property (weak, nonatomic) IBOutlet UITextField *textFieldSelectDate;
/** 年 */
@property (weak, nonatomic) IBOutlet UILabel *labelYear;
/** 月 */
@property (weak, nonatomic) IBOutlet UILabel *labelMonth;
/** 输入框 用于呼出datePicker */
@property (weak, nonatomic) IBOutlet UITextField *finishTextField;
/** 截止 年 */
@property (weak, nonatomic) IBOutlet UILabel *labelFinishYear;
/** 截止 月 */
@property (weak, nonatomic) IBOutlet UILabel *labelFinishMonth;
@property (weak, nonatomic) IBOutlet UISearchBar *searchBar;
/** 当前选中的日期 */
@property (nonatomic, copy) NSString *startDate;
@property (nonatomic, copy) NSString *endDate;
/** 网络请求参数 */
@property (nonatomic, strong) StatementListParamModel *paramModel;
@end
@implementation StatementViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setDefaults];
[self setUpDatePicker];
self.paramModel = [[StatementListParamModel alloc] init];
self.title = @"商铺对账单";
// self.paramModel.authorizedOrgIn = [[UserInfo shareInstance].authorizedOrgs[0] uuid];
self.paramModel.pageSize = 999;
self.paramModel.pageNumber = 0;
[self setUpData];
// Do any additional setup after loading the view.
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// self.navigationController.navigationBar.barTintColor = kMainPurpleColor;
}
- (void)setDefaults {
NSDate *currentDate = [NSDate date];
self.startDate = currentDate.yearMonthString;
self.endDate = currentDate.yearMonthString;
self.labelYear.text = currentDate.yearString;
self.labelMonth.text = currentDate.monthString;
self.labelFinishYear.text = currentDate.yearString;
self.labelFinishMonth.text = currentDate.monthString;
}
- (void)setUpDatePicker {
SRMonthPicker *datePicker = [[SRMonthPicker alloc] initWithDate:[NSDate date]];
datePicker.monthPickerDelegate = self;
datePicker.yearFirst = YES;
self.textFieldSelectDate.inputView = datePicker;
self.finishTextField.inputView = datePicker;
}
/** 显示结清账户 */
- (IBAction)showSettleShop:(UIButton *)sender {
sender.selected = !sender.isSelected;
}
#pragma mark - SRMonthPickerDelegate
- (void)monthPickerDidChangeDate:(SRMonthPicker *)monthPicker {
NSString *strDate = monthPicker.date.yearMonthString;
NSString *year = monthPicker.date.yearString;
NSString *month = monthPicker.date.monthString;
//判断是开始时间还是结束时间
if ([self.textFieldSelectDate isFirstResponder]) {
self.startDate = strDate;
self.labelYear.text = year;
self.labelMonth.text = month;
}else{
self.endDate = strDate;
self.labelFinishYear.text = year;
self.labelFinishMonth.text = month;
}
}
#pragma mark - UISearchBarDelegate
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar {
searchBar.showsCancelButton = YES;
return YES;
}
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
searchBar.showsCancelButton = NO;
searchBar.text = nil;
HIDE_KEYBOARD;
}
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
searchBar.showsCancelButton = NO;
HIDE_KEYBOARD;
}
/** 网络请求 */
- (void)setUpData {
// NSString *url = [NSString stringWithFormat:@"statement/query/%@~%@?authorizedOrgIn=%@&pageNumber=%@&pageSize=%@", @"2016-06", self.endDate, self.org.uuid, @0, @999];
// [[HTTPCilent shareCilent] GET:url parameters:nil complete:^(id responseObject, NSError *error) {
// error;
// }];
}
#pragma mark - tableView DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
StatementTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"StatementCell" forIndexPath:indexPath];
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 90;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self PushToStoryBoardVCWithIdentifier:@"StatementDetailViewController" isHideTabbar:YES animate:YES];
}
- (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
//
// ChooseShopTableViewCell.h
// RealEstateManagement
//
// Created by Z on 16/7/13.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ChooseShopTableViewCell : UITableViewCell
@end
//
// ChooseShopTableViewCell.m
// RealEstateManagement
//
// Created by Z on 16/7/13.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import "ChooseShopTableViewCell.h"
@implementation ChooseShopTableViewCell
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// StatementDetailCell.h
// RealEstateManagement
//
// Created by Z on 16/6/29.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface StatementDetailCell : UITableViewCell
@end
//
// StatementDetailCell.m
// RealEstateManagement
//
// Created by Z on 16/6/29.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import "StatementDetailCell.h"
@interface StatementDetailCell ()
/** 标题 */
@property (weak, nonatomic) IBOutlet UILabel *labelTitle;
/** 时间 */
@property (weak, nonatomic) IBOutlet UILabel *labelDate;
/** 应缴 */
@property (weak, nonatomic) IBOutlet UILabel *labelShouldPay;
/** 已缴 */
@property (weak, nonatomic) IBOutlet UILabel *labelPaidIn;
/** 未缴 */
@property (weak, nonatomic) IBOutlet UILabel *labelUnPaid;
@end
@implementation StatementDetailCell
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// StatementTableViewCell.h
// RealEstateManagement
//
// Created by Z on 16/6/29.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface StatementTableViewCell : UITableViewCell
@end
//
// StatementTableViewCell.m
// RealEstateManagement
//
// Created by Z on 16/6/29.
// Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//
#import "StatementTableViewCell.h"
@interface StatementTableViewCell ()
@property (weak, nonatomic) IBOutlet UIView *imgShop;
@property (weak, nonatomic) IBOutlet UILabel *labelTitle;
/** 应缴 */
@property (weak, nonatomic) IBOutlet UILabel *labelShouldPay;
/** 已缴 */
@property (weak, nonatomic) IBOutlet UILabel *labelPaidIn;
/** 未缴 */
@property (weak, nonatomic) IBOutlet UILabel *labelUnPaid;
@end
@implementation StatementTableViewCell
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
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