Commit 3918f561 authored by Sandy's avatar Sandy

修改选择shop可见范围

parent 69fb55dc
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.4.2</string> <string>1.4.3</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
#define VANKE_BAIDU_WEATHER_SERVER_URL @"http://api.map.baidu.com/telematics/v3/weather" #define VANKE_BAIDU_WEATHER_SERVER_URL @"http://api.map.baidu.com/telematics/v3/weather"
//正式环境 //正式环境
//#define VANKE_SERVER_BASE_URL @"http://140.206.62.178:8080/wanke-server/rest" //正式 #define VANKE_SERVER_BASE_URL @"http://140.206.62.178:8080/wanke-server/rest" //正式
// //后台多媒体文件基准地址 //后台多媒体文件基准地址
//#define VANKE_SERVER_MEDIA_BASE_URL @"http://140.206.62.178:8080" //正式 #define VANKE_SERVER_MEDIA_BASE_URL @"http://140.206.62.178:8080" //正式
// 测试环境 // 测试环境
#define VANKE_SERVER_BASE_URL @"http://139.196.39.77:8080/wanke-server/rest" //#define VANKE_SERVER_BASE_URL @"http://139.196.39.77:8080/wanke-server/rest"
#define VANKE_SERVER_MEDIA_BASE_URL @"http://139.196.39.77:8080" //#define VANKE_SERVER_MEDIA_BASE_URL @"http://139.196.39.77:8080"
// 后台服务企业认证码 // 后台服务企业认证码
......
...@@ -112,6 +112,16 @@ ...@@ -112,6 +112,16 @@
if ( page <= 1 ) if ( page <= 1 )
{ {
[self.projects removeAllObjects]; [self.projects removeAllObjects];
LoginResponseData *model = [[VankeCommonModel sharedInstance] getLoginInfo];
// NSString *code;
// if ([self.classificationEquals isEqualToString:@"万科中心"]) {
// code = @"HQVC";
// }else if (){
// code = @"HSCQ";
// }else{
// code = @"";
// }
[self.projects addObjectsFromArray:resp.data]; [self.projects addObjectsFromArray:resp.data];
} }
else else
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
@property (nonatomic,assign)NSInteger storeCount; @property (nonatomic,assign)NSInteger storeCount;
@property (nonatomic,strong)NSIndexPath *currentIndex; @property (nonatomic,strong)NSIndexPath *currentIndex;
@property (nonatomic,strong)NSMutableArray *selectArr; @property (nonatomic,strong)NSMutableArray *selectArr;
@property (nonatomic, assign) BOOL isAuto;
...@@ -296,6 +297,7 @@ ON_CREATE_VIEWS( signal ) ...@@ -296,6 +297,7 @@ ON_CREATE_VIEWS( signal )
} }
if (indexPath == nil && self.dataArr.count > 0) { if (indexPath == nil && self.dataArr.count > 0) {
self.isAuto = YES;
NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0]; NSIndexPath *index = [NSIndexPath indexPathForRow:0 inSection:0];
[[NSNotificationCenter defaultCenter]postNotificationName:KNOTIFICATION_GetNextDetailData object:nil userInfo:@{@"indexPath":index}]; [[NSNotificationCenter defaultCenter]postNotificationName:KNOTIFICATION_GetNextDetailData object:nil userInfo:@{@"indexPath":index}];
} }
...@@ -411,7 +413,7 @@ ON_CREATE_VIEWS( signal ) ...@@ -411,7 +413,7 @@ ON_CREATE_VIEWS( signal )
} }
- (void)customSegTwoClick:(NSString *)title{ - (void)customSegTwoClick:(NSString *)title{
self.isAuto = NO;
//选择历史查看 //选择历史查看
if ([self.segView.currentTitle isEqualToString:SaleDay]) { if ([self.segView.currentTitle isEqualToString:SaleDay]) {
[self startDatePickView:SaleEnDay]; [self startDatePickView:SaleEnDay];
...@@ -493,6 +495,11 @@ ON_CREATE_VIEWS( signal ) ...@@ -493,6 +495,11 @@ ON_CREATE_VIEWS( signal )
- (void)getNextDetailData:(NSNotification *)fication{ - (void)getNextDetailData:(NSNotification *)fication{
NSDictionary *dict = fication.userInfo; NSDictionary *dict = fication.userInfo;
NSIndexPath *indexPath = dict[@"indexPath"]; NSIndexPath *indexPath = dict[@"indexPath"];
if (indexPath.row > self.dataArr.count - 1) {
self.isAuto = NO;
return;
}
Compass *parentCompass = [self.dataArr objectAtIndex:indexPath.row]; Compass *parentCompass = [self.dataArr objectAtIndex:indexPath.row];
//如果当前点击的不是删除,则要先获取数据在进行插入 //如果当前点击的不是删除,则要先获取数据在进行插入
if (![self isHaveIndexPath:parentCompass.orgCode]) { if (![self isHaveIndexPath:parentCompass.orgCode]) {
...@@ -551,6 +558,11 @@ ON_CREATE_VIEWS( signal ) ...@@ -551,6 +558,11 @@ ON_CREATE_VIEWS( signal )
} }
[self refreshAllTable]; [self refreshAllTable];
if (self.isAuto) {
[[NSNotificationCenter defaultCenter]postNotificationName:KNOTIFICATION_GetNextDetailData object:nil userInfo:@{@"indexPath":[NSIndexPath indexPathForRow:endPosition inSection:0]}];
}
} }
- (void)insertDataWithTable:(UITableView *)tableView arr:(NSMutableArray *)arr{ - (void)insertDataWithTable:(UITableView *)tableView arr:(NSMutableArray *)arr{
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#import "SaleViewCell.h" #import "SaleViewCell.h"
#import "CalculateHelper.h" #import "CalculateHelper.h"
#define Sale_Cell_Height 50 #define Sale_Cell_Height 50
#define Left_Width 120 #define Left_Width 115
#define Left_margin 5 #define Left_margin 5
@interface SaleViewCell () @interface SaleViewCell ()
{ {
...@@ -67,11 +67,10 @@ ...@@ -67,11 +67,10 @@
self.dqLabel = [IBTCommon labelWithTitle:@"0101" frame:rect textFont:self.textFont]; self.dqLabel = [IBTCommon labelWithTitle:@"0101" frame:rect textFont:self.textFont];
[self.contentView addSubview:self.dqLabel]; [self.contentView addSubview:self.dqLabel];
CGFloat width = (SCREEN_WIDTH - self.nameLabel.right - 4)/4;
CGFloat width = (SCREEN_WIDTH - self.dqLabel.right - 4)/4;
//销售额 //销售额
rect = CGRectMake(self.dqLabel.right , 0, width + 15, Sale_Cell_Height); rect = CGRectMake(self.nameLabel.right + 5 , 0, width + 10, Sale_Cell_Height);
self.saleLabel = [IBTCommon labelWithTitle:@"56,080" frame:rect textFont:self.textFont]; self.saleLabel = [IBTCommon labelWithTitle:@"56,080" frame:rect textFont:self.textFont];
[self.contentView addSubview:self.saleLabel]; [self.contentView addSubview:self.saleLabel];
...@@ -191,12 +190,12 @@ ...@@ -191,12 +190,12 @@
self.lineLabel.width = SCREEN_WIDTH - width; self.lineLabel.width = SCREEN_WIDTH - width;
if (width > 0) { if (width > 0) {
self.nameLabel.left = width + 5; self.nameLabel.left = width + 5;
self.nameLabel.width = SCREEN_WIDTH - width - 5; self.nameLabel.width = Left_Width;
self.dqLabel.left = width + 5; self.dqLabel.left = width + 5;
self.dqLabel.width = SCREEN_WIDTH - width - 5; self.dqLabel.width = SCREEN_WIDTH - width - 5;
}else{ }else{
self.nameLabel.left = 5; self.nameLabel.left = 5;
self.nameLabel.width = SCREEN_WIDTH - 5; self.nameLabel.width = Left_Width;
self.dqLabel.left = 5; self.dqLabel.left = 5;
self.dqLabel.width = SCREEN_WIDTH - 5; self.dqLabel.width = SCREEN_WIDTH - 5;
} }
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#import "VankeShopModel.h" #import "VankeShopModel.h"
typedef void (^block)(VankeShopModel *); typedef void (^block)(VankeShopModel *);
@interface ChooseShopViewController : UIViewController @interface ChooseShopViewController : UIViewController
@property (nonatomic, copy) NSString *projectId;
@property (nonatomic, copy) block chooseBlock; @property (nonatomic, copy) block chooseBlock;
@end @end
...@@ -29,14 +29,40 @@ ...@@ -29,14 +29,40 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.arrData = [LoginShopsInstance shareInstance].arrShops; [self httpRequestGetShops];
self.results = [NSArray arrayWithArray:self.arrData];
self.title = @"选择商铺"; self.title = @"选择商铺";
[self setUPSearchBar]; [self setUPSearchBar];
[self setUpTableView]; [self setUpTableView];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (void)httpRequestGetShops {
self.arrData = [LoginShopsInstance shareInstance].arrShops;
NSMutableArray *arr = [NSMutableArray array];
for (VankeShopModel *shop in self.arrData) {
[arr addObject:shop.code];
}
NSString *codes = [arr componentsJoinedByString:@","];
NSString *url = [NSString stringWithFormat:@"shopCodesIn%@/projectIdEquals%@",codes, self.projectId];
NSString *encodeUrlStr = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
ICRHTTPController *httpCtrl = [ICRHTTPController sharedController];
WS(weakSelf);
[httpCtrl getUrl:encodeUrlStr params:nil success:^(id data) {
for (NSDictionary *dic in data[@"data"]) {
VankeShopModel *shop = [VankeShopModel modelObjectWithDictionary:dic];
[weakSelf.arrData addObject:shop];
}
weakSelf.results = [NSArray arrayWithArray:weakSelf.arrData];
} failure:^(id data) {
}];
}
- (void)setUPSearchBar { - (void)setUPSearchBar {
self.searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 50)]; self.searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 50)];
self.searchBar.backgroundImage = [UIImage imageWithColor:[UIColor colorWithRed:0.953 green:0.439 blue:0.063 alpha:1.000]]; self.searchBar.backgroundImage = [UIImage imageWithColor:[UIColor colorWithRed:0.953 green:0.439 blue:0.063 alpha:1.000]];
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "VankeShopModel.h" #import "VankeShopModel.h"
@interface HistoryViewController : UIViewController @interface HistoryViewController : UIViewController
@property (nonatomic, copy) NSString *projectid;
@property (nonatomic, strong) VankeShopModel *shop; @property (nonatomic, strong) VankeShopModel *shop;
@property (nonatomic, copy) void (^historyBlock)(void); @property (nonatomic, copy) void (^historyBlock)(void);
@end @end
...@@ -68,10 +68,10 @@ ...@@ -68,10 +68,10 @@
- (void)chooseShopAction { - (void)chooseShopAction {
ChooseShopViewController *chooseVC = [[ChooseShopViewController alloc] init]; ChooseShopViewController *chooseVC = [[ChooseShopViewController alloc] init];
chooseVC.projectId = self.projectid;
WS(weakSelf); WS(weakSelf);
chooseVC.chooseBlock = ^(VankeShopModel *shop){ chooseVC.chooseBlock = ^(VankeShopModel *shop){
weakSelf.shop = shop; weakSelf.shop = shop;
[weakSelf setUpData]; [weakSelf setUpData];
}; };
......
...@@ -258,7 +258,7 @@ ON_WILL_APPEAR( signal ) ...@@ -258,7 +258,7 @@ ON_WILL_APPEAR( signal )
- (void)chooseShopAction { - (void)chooseShopAction {
ChooseShopViewController *chooseVC = [[ChooseShopViewController alloc] init]; ChooseShopViewController *chooseVC = [[ChooseShopViewController alloc] init];
chooseVC.projectId = self.authorizedOrg.uuid;
chooseVC.chooseBlock = ^(VankeShopModel *shop){ chooseVC.chooseBlock = ^(VankeShopModel *shop){
self.shop = shop; self.shop = shop;
[self.topView setShopName:shop.name]; [self.topView setShopName:shop.name];
...@@ -364,6 +364,7 @@ ON_WILL_APPEAR( signal ) ...@@ -364,6 +364,7 @@ ON_WILL_APPEAR( signal )
- (void)goToHistory { - (void)goToHistory {
HistoryViewController *history = [[HistoryViewController alloc] init]; HistoryViewController *history = [[HistoryViewController alloc] init];
history.projectid = self.authorizedOrg.uuid;
history.shop = self.shop; history.shop = self.shop;
history.historyBlock = ^(){ history.historyBlock = ^(){
[self.arrPics removeAllObjects]; [self.arrPics removeAllObjects];
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#import "CalculateHelper.h" #import "CalculateHelper.h"
#import "StatementDetailViewController.h" #import "StatementDetailViewController.h"
#import "UIScrollView+EmptyDataSet.h" #import "UIScrollView+EmptyDataSet.h"
#import "VankeCommonModel.h"
@interface StatementViewController ()<UITableViewDelegate, UITableViewDataSource, SRMonthPickerDelegate, UISearchBarDelegate, UITextFieldDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate> @interface StatementViewController ()<UITableViewDelegate, UITableViewDataSource, SRMonthPickerDelegate, UISearchBarDelegate, UITextFieldDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
@property (weak, nonatomic) IBOutlet UITableView *tableView; @property (weak, nonatomic) IBOutlet UITableView *tableView;
/** 已缴百分比 */ /** 已缴百分比 */
...@@ -192,8 +193,13 @@ ...@@ -192,8 +193,13 @@
/** 网络请求 */ /** 网络请求 */
- (void)setUpData { - (void)setUpData {
LoginResponseData *model = [[VankeCommonModel sharedInstance] getLoginInfo];
User *user = [[VankeCommonModel sharedInstance] currentUser];
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
NSString *url = [NSString stringWithFormat:@"statement/query/%@~%@?authorizedOrgIn=%@&pageNumber=%@&pageSize=%@", self.startDate, self.endDate, self.org.code, @0, @9999]; NSString *url = [NSString stringWithFormat:@"statement/query/%@~%@?authorizedOrgIn=%@&pageNumber=%@&pageSize=%@", self.startDate, self.endDate, self.org.code,@0, @9999];
if ([[VankeCommonModel sharedInstance] curUserIsTenant]) {
url = [url stringByAppendingString:[NSString stringWithFormat:@"&tenantEquals=%@",model.tenant.uuid]];
}
WS(weakSelf); WS(weakSelf);
[[ICRHTTPController sharedController] getUrl:url params:nil success:^(id data) { [[ICRHTTPController sharedController] getUrl:url params:nil success:^(id data) {
NSDictionary *dict = data; NSDictionary *dict = data;
......
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