Commit 5851ab4e authored by AvatarC's avatar AvatarC

Merge branch 'develop' of https://git.oschina.net/gomoretech/RedstarIOS into develop_avatar

parents 24060026 22ef2cab
......@@ -61,6 +61,7 @@
8490C4D31BF9DEF0006B6569 /* PictureTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4CE1BF9DEF0006B6569 /* PictureTableCell.m */; };
8490C4D41BF9DEF0006B6569 /* PictureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4D21BF9DEF0006B6569 /* PictureViewController.m */; };
8490C4D71BF9DF1D006B6569 /* PictureStoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490C4D61BF9DF1D006B6569 /* PictureStoryViewController.m */; };
8491F6C61C2BCD8D00A00395 /* SpotCheckTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8491F6C51C2BCD8D00A00395 /* SpotCheckTableViewCell.m */; };
84945F1B1C2A6A6300C1793C /* AboutMeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84945F1A1C2A6A6300C1793C /* AboutMeViewController.m */; };
84970DEF1BD8DD8A00C1728A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970DEE1BD8DD8A00C1728A /* main.m */; };
84970DFA1BD8DD8A00C1728A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84970DF91BD8DD8A00C1728A /* Assets.xcassets */; };
......@@ -285,6 +286,8 @@
8490C4D21BF9DEF0006B6569 /* PictureViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureViewController.m; sourceTree = "<group>"; };
8490C4D51BF9DF1D006B6569 /* PictureStoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureStoryViewController.h; sourceTree = "<group>"; };
8490C4D61BF9DF1D006B6569 /* PictureStoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PictureStoryViewController.m; sourceTree = "<group>"; };
8491F6C41C2BCD8D00A00395 /* SpotCheckTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpotCheckTableViewCell.h; sourceTree = "<group>"; };
8491F6C51C2BCD8D00A00395 /* SpotCheckTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpotCheckTableViewCell.m; sourceTree = "<group>"; };
84945F191C2A6A6300C1793C /* AboutMeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AboutMeViewController.h; sourceTree = "<group>"; };
84945F1A1C2A6A6300C1793C /* AboutMeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AboutMeViewController.m; sourceTree = "<group>"; };
84970DEA1BD8DD8A00C1728A /* redstar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = redstar.app; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -755,6 +758,7 @@
843D1B991C0B3F6200E30002 /* SpotCheckOnLine */ = {
isa = PBXGroup;
children = (
8491F6C31C2BCD7300A00395 /* Cell */,
84CEB1641C28E7E40072ED0A /* Model */,
843D1B9A1C0B3F6200E30002 /* View */,
843D1B9B1C0B3F6200E30002 /* ViewController */,
......@@ -1174,6 +1178,15 @@
path = ViewController;
sourceTree = "<group>";
};
8491F6C31C2BCD7300A00395 /* Cell */ = {
isa = PBXGroup;
children = (
8491F6C41C2BCD8D00A00395 /* SpotCheckTableViewCell.h */,
8491F6C51C2BCD8D00A00395 /* SpotCheckTableViewCell.m */,
);
path = Cell;
sourceTree = "<group>";
};
84945F181C2A6A4A00C1793C /* About */ = {
isa = PBXGroup;
children = (
......@@ -2279,6 +2292,7 @@
84CF0F1E1BE9B40400C855CE /* InspectDetailFooterView.m in Sources */,
84F30DA41BFC19F200CBAD13 /* RankListModel.m in Sources */,
8409BDFC1C281ACD00354460 /* SelectStoreHeadView.m in Sources */,
8491F6C61C2BCD8D00A00395 /* SpotCheckTableViewCell.m in Sources */,
84CC34EF1C09AEC0002F10E2 /* LookOnLineDetailViewController.m in Sources */,
8487D8091BF20FAD00E63E90 /* TaxisView.m in Sources */,
84A673C71C0C7E0C000F828E /* AnnounceDetailHeadView.m in Sources */,
......
......@@ -9,12 +9,11 @@
#ifndef Url_h
#define Url_h
// url
//#define kRedStarURL @"http://218.244.151.129:7580/"
// url 测试环境
// #define kRedStarURL @"http://218.244.151.129:7580/"
#define kRedStarURL @"http://219.235.234.225:7580/"
// 正式环境
#define kRedStarURL @"http://219.235.234.225:7580/"
// 检查更新
......
......@@ -20,7 +20,23 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.takeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
self.view.backgroundColor = [UIColor whiteColor];
CGFloat imageW = self.checkImage.size.width;
CGFloat imageH = self.checkImage.size.height;
CGFloat imageViewW,imageViewH;
if ((imageH / imageW) > (kScreenHeight / kScreenWidth)) {
imageViewH = kScreenHeight;
imageViewW = imageW * (kScreenHeight / imageH);
} else {
imageViewH = imageH * (kScreenWidth / imageW);
imageViewW = kScreenWidth;
}
self.takeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, imageViewW, imageViewH)];
_takeImageView.center = CGPointMake(kScreenWidth / 2, (kScreenHeight - 64) / 2);
_takeImageView.image = _checkImage;
[self.view addSubview:_takeImageView];
......
......@@ -71,6 +71,8 @@
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:inspectListVC];
} else if ([item.titleLabel.text isEqualToString:@"口碑标准"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
return;
} else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) {
PictureViewController *pictureVC = [[PictureViewController alloc] init];
......
......@@ -89,7 +89,8 @@
_uuidArray = [NSMutableArray array];
for (TreeNodeModel *model in array) {
nameStr = [nameStr stringByAppendingString:[NSString stringWithFormat:@"%@,", model.name]];
[_uuidArray addObject:model.uuid];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:model.uuid , @"store_uuid", model.code , @"store_code", model.name , @"store_name", nil];
[_uuidArray addObject:dict];
}
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
_storeName = nameStr;
......@@ -104,7 +105,7 @@
NSDate *date = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
[dateFormatter setDateFormat:@"YYYY-MM-dd hh:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:date];
NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
......@@ -121,7 +122,7 @@
@"content":self.footView.contentTextView.text,
@"endDate":dateString,
@"state":@"initial",
// @"stores":_uuidArray
@"stores":_uuidArray
};
NSLog(@"发起抽查par = %@", parameters);
[httpClient saveSportCheckWithParameters:parameters completion:^(id response, NSError *error) {
......
......@@ -33,7 +33,7 @@
[strAttr addAttributes:@{NSForegroundColorAttributeName:kProgressDealWithColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(5,str.length - 5)];
[self.progressLabel setAttributedText:strAttr];
} else if ([lookOnLine.state isEqualToString:@"finished"]) {
NSString *str = [NSString stringWithFormat:@"临检进度:已评分"];
NSString *str = [NSString stringWithFormat:@"临检进度:已完成"];
NSMutableAttributedString *strAttr = [[NSMutableAttributedString alloc] initWithString:str];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kCellDetailColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(0,5)];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kProgressDealWithColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(5,str.length - 5)];
......
......@@ -430,7 +430,15 @@
[http getStoreSportCheckListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"获取 商场 抽查列表 response= %@", response);
NSLog(@"获取 商场 抽查列表 error= %@", error);
NSDictionary *dataDict = response[@"data"];
NSArray *recordsArray = dataDict[@"records"];
NSMutableArray *tempArray = [NSMutableArray array];
for (NSDictionary *dict in recordsArray) {
LookOnLineModel *lookOnline = [[LookOnLineModel alloc] init];
[lookOnline setValuesForKeysWithDictionary:dict];
[tempArray addObject:lookOnline];
}
_allLookOnLineList = tempArray;
if (_allLookOnLineList.count == 0) {
if (_tableView) {
[_tableView removeFromSuperview];
......@@ -451,7 +459,7 @@
}];
[self.tableView reloadData];
}
[self closeGreenView];
[MBProgressHUD hideHUDForView:self.view animated:YES];
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
}];
......@@ -491,7 +499,7 @@
{
LookOnLineModel *lookOnLine = _allLookOnLineList[indexPath.row];
LookOnLineDetailViewController *lookDetailVC = [[LookOnLineDetailViewController alloc] init];
lookDetailVC.uuid = lookOnLine.uuid;
lookDetailVC.lookOnLine = lookOnLine;
[self.navigationController pushViewController:lookDetailVC animated:YES];
}
......@@ -531,7 +539,6 @@
@"direction":@"asc"}];
}
// 相关参数
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
NSDictionary *parameters = @{@"userUuid":user_uuid,
......@@ -543,7 +550,15 @@
[http getStoreSportCheckListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"获取 商场 抽查列表 response= %@", response);
NSLog(@"获取 商场 抽查列表 error= %@", error);
NSDictionary *dataDict = response[@"data"];
NSArray *recordsArray = dataDict[@"records"];
NSMutableArray *tempArray = [NSMutableArray array];
for (NSDictionary *dict in recordsArray) {
LookOnLineModel *lookOnline = [[LookOnLineModel alloc] init];
[lookOnline setValuesForKeysWithDictionary:dict];
[tempArray addObject:lookOnline];
}
_allLookOnLineList = tempArray;
if (_allLookOnLineList.count == 0) {
if (_tableView) {
[_tableView removeFromSuperview];
......
......@@ -7,7 +7,7 @@
//
#import <UIKit/UIKit.h>
@class OnLineDetailModel;
@class LookOnLineModel;
@interface LookOnLineDetailView : UIView
@property (nonatomic, strong) UILabel *titleLabel;
......@@ -21,5 +21,5 @@
@property (nonatomic, strong) UILabel *dayLabel; // 剩余天数
@property (nonatomic, strong) OnLineDetailModel *onLineDetail;
@property (nonatomic, strong) LookOnLineModel *lookOnLine;
@end
......@@ -7,6 +7,7 @@
//
#import "LookOnLineDetailView.h"
#import "LookOnLineModel.h"
@interface LookOnLineDetailView ()
@property (nonatomic, strong) UILabel *shopname; // 商店名称
......@@ -41,9 +42,11 @@
}
- (void)setOnLineDetail:(OnLineDetailModel *)onLineDetail
- (void)setLookOnLine:(LookOnLineModel *)lookOnLine
{
_onLineDetail = onLineDetail;
_lookOnLine = lookOnLine;
self.titleLabel.text = [NSString stringWithFormat:@"%@", lookOnLine.title];
self.bgView.backgroundColor = [UIColor whiteColor];
self.shopname.text = @"商场名称";
......@@ -52,12 +55,12 @@
self.startDate.text = @"发起时间";
self.taskContent.text = @"任务内容";
self.shopnameLabel.text = @"上海真北店";
self.overDateLabel.text = @"2015-10-03";
self.shopnameLabel.text = [NSString stringWithFormat:@"%@", lookOnLine.store_name];
self.overDateLabel.text = [NSString stringWithFormat:@"%@", lookOnLine.endDate];
self.peopleLabel.text = @"王XX 集团X领导";
self.startDateLabel.text = @"2015-09-30 12:20:12";
self.startDateLabel.text = [NSString stringWithFormat:@"%@", lookOnLine.reportTime];
NSString *intro = @"1.大厅促销标语、彩旗拍照不少于3张; 2.促销人员着装拍照不少于4张; 3.大厅促销站台拍照不少于3张。";
NSString *intro = [NSString stringWithFormat:@"%@", lookOnLine.content];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:intro];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle setLineSpacing:5];
......@@ -71,9 +74,9 @@
self.dayLabel.text = @"2";
self.pictureLabel.text = @"现场照片";
}
- (UILabel *)titleLabel
{
if (!_titleLabel) {
......
......@@ -7,7 +7,9 @@
//
#import <UIKit/UIKit.h>
#import "LookOnLineModel.h"
@interface LookOnLineDetailViewController : UIViewController
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, strong) LookOnLineModel *lookOnLine;
@end
......@@ -29,7 +29,6 @@
@property (nonatomic, strong) LookOnLineFootView *footView;
@property (nonatomic, strong) NSMutableArray *imageNameArray;
@property (nonatomic, strong) OnLineDetailModel *onLineDetail;
@property (nonatomic, assign) int rowNumber;
@end
......@@ -47,9 +46,13 @@
self.imageNameArray = [NSMutableArray array];
[self requestOnLineDetail];
_rowNumber = 1;
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}
#pragma mark - Private Mothods
- (void)setNav
......@@ -77,25 +80,6 @@
self.navigationItem.titleView = customLab;
}
- (void)requestOnLineDetail
{
NSString *url = [NSString stringWithFormat:@"%@%@%@?fetch_parts=stores", kRedStarURL, kSportcheckDetailURL,self.uuid];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
[httpClient getSportCheckDetailWithCompletion:^(id response, NSError *error) {
NSLog(@"5.4 抽查明细 response = %@, error = %@", response, error);
NSDictionary *dataDict = response[@"data"];
OnLineDetailModel *onlineDetail = [[OnLineDetailModel alloc] init];
[onlineDetail setValuesForKeysWithDictionary:dataDict];
_onLineDetail = onlineDetail;
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.tableView reloadData];
}];
}
- (void)reportRestult:(UIButton *)sender
{
......@@ -161,7 +145,7 @@
NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kReportCheckResultURL,@"checkId", dateString, operId, operName];
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kReportCheckResultURL,_lookOnLine.uuid, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSLog(@"上报抽检结果 url = %@", url);
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
......@@ -182,7 +166,7 @@
}
NSDictionary *parameters = @{
@"storeUuid":@"",
@"storeUuid":_lookOnLine.store_uuid,
@"processNote":self.footView.contentTextView.text,
@"attachments":imageArray,
};
......@@ -190,9 +174,23 @@
[httpClient reportCheckResultWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"上报抽检结果 response = %@", response);
NSLog(@"上报抽检结果 error = %@", error);
if ([response[@"message"] isEqualToString:@"ok"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"上报成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
alert.tag = 314332;
alert.delegate = self;
[alert show];
}
}];
}
}
if (alertView.tag == 314332) {
if (buttonIndex == 0) {
[self.navigationController popViewControllerAnimated:YES];
}
}
}
#pragma mark - UIImagePickerController 代理方法
......@@ -255,7 +253,6 @@
[cell.photoButton1 setImage:image0 forState:UIControlStateNormal];
NSString *imageName1 = _imageNameArray[(indexPath.row) * 2 + 1];
NSLog(@"imageName = %@", imageName1);
NSString *fullPath1 = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName1];
UIImage *image1 = [UIImage imageWithContentsOfFile:fullPath1];
[cell.photoButton2 setImage:image1 forState:UIControlStateNormal];
......@@ -307,7 +304,7 @@
if (!_headerView) {
_headerView = [[LookOnLineDetailView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 295)];
_headerView.titleLabel.text = @"2015年十一促销临时抽查";
_headerView.onLineDetail = _onLineDetail;
_headerView.lookOnLine = _lookOnLine;
}
return _headerView;
}
......
......@@ -176,10 +176,14 @@
if (indexPath.section == 0) {
return;
} else {
OnLineResultViewController *onLineResult = [[OnLineResultViewController alloc] init];
onLineResult.storeDetail = _allStoreArray[indexPath.row];
onLineResult.checkUuid = self.uuid;
[self.navigationController pushViewController:onLineResult animated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// OnLineResultViewController *onLineResult = [[OnLineResultViewController alloc] init];
// onLineResult.storeDetail = _allStoreArray[indexPath.row];
// onLineResult.checkUuid = self.uuid;
// [self.navigationController pushViewController:onLineResult animated:YES];
}
}
......
//
// SpotCheckTableViewCell.h
// redstar
//
// Created by admin on 15/12/24.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@class SpotCheckModel;
@interface SpotCheckTableViewCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel; // 标题
@property (nonatomic, strong) UILabel *startDate; // 起始日期
@property (nonatomic, strong) UILabel *overDate; // 截止日期
@property (nonatomic, strong) UILabel *progressLabel;
@property (nonatomic, strong) UILabel *alreadyLabel;
@property (nonatomic, strong) UILabel *allLabel;
@property (nonatomic, assign) CGFloat multiplier; // 乘数
@property (nonatomic, strong) UIImageView *alreadyView;
@property (nonatomic, strong) UIView *allView;
@property (nonatomic, strong) SpotCheckModel *spotCheck;
@end
......@@ -18,7 +18,7 @@
#import <MJRefresh.h>
#import "NoDataView.h"
#import "InspectListCell.h"
#import "SpotCheckTableViewCell.h"
#import "SpotCheckModel.h"
#define kInspectListTableViewcellIndeterfor @"inspectListTableViewcellIndeterfor"
@interface SpotCheckOnLineViewController ()<UITableViewDelegate, UITableViewDataSource,ScreenTableDelegate, TaxisViewDelegate, InspectTableViewDelegate>
......@@ -61,7 +61,6 @@
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self requestSpotCheckList];
_page = 0;
}
......@@ -69,6 +68,8 @@
{
[super viewWillAppear:animated];
self.tabBarController.tabBar.hidden = YES;
[self requestSpotCheckList];
}
......@@ -176,12 +177,15 @@
[spot setValuesForKeysWithDictionary:dict];
[tempArray addObject:spot];
}
[_allSpotCheckList addObjectsFromArray:tempArray];
if (tempArray.count < 10) {
[self.tableView.footer noticeNoMoreData];
} else {
[self.tableView.footer endRefreshing];
}
[MBProgressHUD hideHUDForView:self.view animated:YES];
[self.tableView reloadData];
}];
}
......@@ -189,8 +193,10 @@
- (void)addSpotCheckTaskClick:(UIButton *)sender
{
OnLineViewController *onlineVC = [[OnLineViewController alloc] init];
[self.navigationController pushViewController:onlineVC animated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// OnLineViewController *onlineVC = [[OnLineViewController alloc] init];
// [self.navigationController pushViewController:onlineVC animated:YES];
}
- (void)dropCilck:(MenuButton *)sender
......@@ -376,7 +382,6 @@
[parameters setObject:@"reported" forKey:@"state"];
} else {
[parameters setObject:@"finished" forKey:@"state"];
}
NSArray *array = @[@{@"field":@"state"}];
[parameters setObject:array forKey:@"queryOrders"];
......@@ -437,7 +442,16 @@
[httpCilent getManageSportCheckListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"管理层的抽查列表 response= %@", response);
NSLog(@"管理层的抽查列表 error= %@", error);
NSDictionary *dataDict = response[@"data"];
NSArray *recordsArray = dataDict[@"records"];
NSMutableArray *tempArray = [NSMutableArray array];
for (NSDictionary *dict in recordsArray) {
SpotCheckModel *spot = [[SpotCheckModel alloc] init];
[spot setValuesForKeysWithDictionary:dict];
[tempArray addObject:spot];
}
_allSpotCheckList = tempArray;
if (_allSpotCheckList.count == 0) {
......@@ -463,6 +477,7 @@
[MBProgressHUD hideHUDForView:self.view animated:YES];
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
[self closeGreenView];
}];
}
......@@ -486,7 +501,7 @@
#pragma mark - TaxisDelegate
- (void)timeChange:(UIButton *)sender
{
_page = 0;
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kManageSportcheckURL];
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSArray *queryOrders;
......@@ -508,7 +523,7 @@
// 相关参数
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
NSDictionary *parameters = @{@"userUuid":user_uuid,
@"pageNumber":@(0),
@"pageNumber":@(_page),
@"pageSize":@(10),
@"queryOrders":queryOrders
};
......@@ -516,7 +531,16 @@
[httpCilent getManageSportCheckListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"管理层的抽查列表 response= %@", response);
NSLog(@"管理层的抽查列表 error= %@", error);
NSDictionary *dataDict = response[@"data"];
NSArray *recordsArray = dataDict[@"records"];
NSMutableArray *tempArray = [NSMutableArray array];
for (NSDictionary *dict in recordsArray) {
SpotCheckModel *spot = [[SpotCheckModel alloc] init];
[spot setValuesForKeysWithDictionary:dict];
[tempArray addObject:spot];
}
_allSpotCheckList = tempArray;
if (_allSpotCheckList.count == 0) {
if (_tableView) {
......@@ -563,9 +587,9 @@
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
InspectListCell *cell=[tableView dequeueReusableCellWithIdentifier:kInspectListTableViewcellIndeterfor];
SpotCheckTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kInspectListTableViewcellIndeterfor];
if (!cell) {
cell = [[InspectListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectListTableViewcellIndeterfor];
cell = [[SpotCheckTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectListTableViewcellIndeterfor];
}
cell.spotCheck = _allSpotCheckList[indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
......@@ -603,7 +627,7 @@
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableFooterView = [[UIView alloc] init];
[_tableView registerClass:[InspectListCell class] forCellReuseIdentifier:kInspectListTableViewcellIndeterfor];
[_tableView registerClass:[SpotCheckTableViewCell class] forCellReuseIdentifier:kInspectListTableViewcellIndeterfor];
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 200.0;
[self.view addSubview:_tableView];
......
......@@ -115,8 +115,12 @@
- (void)addClick:(UIButton *)sender
{
AddPictureViewController *addPic = [[AddPictureViewController alloc] init];
[self.navigationController pushViewController:addPic animated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// AddPictureViewController *addPic = [[AddPictureViewController alloc] init];
// [self.navigationController pushViewController:addPic animated:YES];
}
- (void)requestPicturePraise
......@@ -531,6 +535,7 @@
#pragma mark - TaxisDelegate
- (void)timeChange:(UIButton *)sender
{
_page = 0;
// 请求地址
NSString *urlStr = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQueryPicturePraiseURL];
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
......@@ -550,7 +555,7 @@
}
NSDictionary *parameters = @{@"user":user_uuid,
@"pageNumber":@(0),
@"pageNumber":@(_page),
@"pageSize":@(10),
@"queryOrders":queryOrders
};
......
......@@ -8,7 +8,6 @@
#import <UIKit/UIKit.h>
@class TaskListModel;
@class SpotCheckModel;
@interface InspectListCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel; // 标题
......@@ -26,6 +25,5 @@
@property (nonatomic, strong) UIView *allView;
@property (nonatomic, strong) TaskListModel *taskList;
@property (nonatomic, strong) SpotCheckModel *spotCheck;
@end
......@@ -39,59 +39,6 @@
}
- (void)setSpotCheck:(SpotCheckModel *)spotCheck
{
_spotCheck = spotCheck;
self.titleLabel.text = [NSString stringWithFormat:@"%@", spotCheck.title];
self.startDate.text = [NSString stringWithFormat:@"起始时间:%@", spotCheck.endDate];
self.overDate.text = [NSString stringWithFormat:@"截止时间:%@", spotCheck.endDate];
self.address.text = [NSString stringWithFormat:@"巡检商场:%@", spotCheck.content];
self.alreadyLabel.text = [NSString stringWithFormat:@"%d", spotCheck.reportCount];
self.allLabel.text = [NSString stringWithFormat:@"/%d", spotCheck.storeCount];
self.allView.backgroundColor = kProgressViewAllBackColor;
if (spotCheck.reportCount == 0) {
self.multiplier = 0;
} else {
self.multiplier = (CGFloat)spotCheck.reportCount / spotCheck.storeCount;
}
if (self.multiplier > 1) {
self.multiplier = 1.0;
}
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
self.alreadyView.image = image;
if ([_spotCheck.state isEqualToString:@"initial"]) {
NSString *str = [NSString stringWithFormat:@"巡检进度:未处理"];
NSMutableAttributedString *strAttr = [[NSMutableAttributedString alloc] initWithString:str];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kCellDetailColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(0,5)];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kProgressUnSettledColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(5,str.length - 5)];
[self.progressLabel setAttributedText:strAttr];
self.alreadyLabel.textColor = kProgressUnSettledColor;
self.allLabel.textColor = kProgressUnSettledColor;
} else if ([_spotCheck.state isEqualToString:@"reported"]) {
NSString *str = [NSString stringWithFormat:@"巡检进度:已上报"];
NSMutableAttributedString *strAttr = [[NSMutableAttributedString alloc] initWithString:str];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kCellDetailColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(0,5)];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kProgressDealWithColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(5,str.length - 5)];
[self.progressLabel setAttributedText:strAttr];
self.alreadyLabel.textColor = kProgressDealWithColor;
self.allLabel.textColor = kProgressDealWithColor;
} else if ([_spotCheck.state isEqualToString:@"finished"]) {
NSString *str = [NSString stringWithFormat:@"巡检进度:已评分"];
NSMutableAttributedString *strAttr = [[NSMutableAttributedString alloc] initWithString:str];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kCellDetailColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(0,5)];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kProgressDealWithColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(5,str.length - 5)];
[self.progressLabel setAttributedText:strAttr];
self.alreadyLabel.textColor = kProgressDealWithColor;
self.allLabel.textColor = kProgressDealWithColor;
} else {
}
}
- (void)setTaskList:(TaskListModel *)taskList
{
......
......@@ -121,7 +121,7 @@
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"queryOrders":@[@{@"field":@"lastModifyInfo", @"direction":@"desc"}],
@"pageNumber":@(_page),
@"pageSize":@(10)
};
......@@ -157,7 +157,7 @@
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"queryOrders":@[@{@"field":@"lastModifyInfo", @"direction":@"desc"}],
@"pageNumber":@(0),
@"pageSize":@(10)
};
......@@ -213,7 +213,7 @@
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"queryOrders":@[@{@"field":@"lastModifyInfo", @"direction":@"desc"}],
@"pageNumber":@(0),
@"pageSize":@(10)
};
......
......@@ -15,7 +15,7 @@
@property (nonatomic, assign) int attachmentNumber;
@property (nonatomic, copy) NSString *category;
@property (nonatomic, copy) NSString *lineNo;
@property (nonatomic, copy) NSString *readonly;
@property (nonatomic) BOOL readonly;
@property (nonatomic, copy) NSString *reference;
@property (nonatomic, strong) NSArray *referenceAttachments;
@property (nonatomic, copy) NSString *remark;
......
......@@ -229,7 +229,6 @@
TaskGroup *taskGroup = _taskData[indexPath.section - 1];
TaskModel *task = taskGroup.answers[indexPath.row];
cell.task = task;
cell.titleLabel.text = [NSString stringWithFormat:@"%d、%@", (int)indexPath.row + 1 ,task.title];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
......@@ -254,14 +253,20 @@
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
if ([permissions containsObject:@"500103"]) {
//InspectNoUpLoadViewController *inspectNotVC = [[InspectNoUpLoadViewController alloc] init];
InspectNotUploadViewController *inspectNotVC = [[InspectNotUploadViewController alloc] init];
inspectNotVC.questionCount = taskGroup.questionCount;
inspectNotVC.taskModel = task;
inspectNotVC.store_uuid = _taskDetail.store_uuid;
inspectNotVC.praiseUuid = _taskDetail.uuid;
inspectNotVC.questionUuid = task.uuid;
[self.navigationController pushViewController:inspectNotVC animated:YES];
if (task.readonly) {
InspectUploadedViewController *inspectVC = [[InspectUploadedViewController alloc] init];
inspectVC.questionCount = taskGroup.questionCount;
inspectVC.taskModel = task;
[self.navigationController pushViewController:inspectVC animated:YES];
} else {
InspectNotUploadViewController *inspectNotVC = [[InspectNotUploadViewController alloc] init];
inspectNotVC.questionCount = taskGroup.questionCount;
inspectNotVC.taskModel = task;
inspectNotVC.store_uuid = _taskDetail.store_uuid;
inspectNotVC.praiseUuid = _taskDetail.uuid;
inspectNotVC.questionUuid = task.uuid;
[self.navigationController pushViewController:inspectNotVC animated:YES];
}
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有编辑检查点的权限!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
......
......@@ -59,6 +59,7 @@
bgButton.titleLabel.font = [UIFont systemFontOfSize:17.0];
[bgButton addTarget:self action:@selector(headBtnClick) forControlEvents:UIControlEventTouchUpInside];
bgButton.backgroundColor = [UIColor whiteColor];
bgButton.titleLabel.numberOfLines = 0;
[self addSubview:bgButton];
_bgButton = bgButton;
......@@ -129,13 +130,6 @@
} else {
_scoreLabel.text = [NSString stringWithFormat:@"%.1f",rankListModel.score];
}
// if (rankListModel.score == nil || rankListModel.score == NULL || [rankListModel.score isEqual:[NSNull null]]) {
// _scoreLabel.text = [NSString stringWithFormat:@"0"];
// } else {
// _scoreLabel.text = [NSString stringWithFormat:@"%@",rankListModel.score];
// }
}
......
......@@ -412,6 +412,7 @@
_pickerView.backgroundColor = [UIColor whiteColor];
_pickerView.pickerView.delegate = self;
_pickerView.pickerView.dataSource = self;
_pickerView.pickerView.showsSelectionIndicator = YES;
}
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
......@@ -512,7 +513,8 @@
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
NSDictionary *dict = _titleArray[row];
return [NSString stringWithFormat:@"%@", dict[@"name"]];
NSString *title = [NSString stringWithFormat:@"%@", dict[@"name"]];
return title;
}
......
......@@ -114,7 +114,6 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
if ([permissions containsObject:@"500501"] || [permissions containsObject:@"500502"]) {
[self.titleArray addObject:@"问题知识"];
[self requestQuestionList];
}
......@@ -130,17 +129,6 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
}
[[NSUserDefaults standardUserDefaults] setObject:_titleArray forKey:@"function"];
NSLog(@"-title = =%@", _titleArray);
// 初始化容器
// self.btnTitleArray = [NSArray arrayWithObjects:@"在线抽查", @"口碑巡检",@"口碑标准",@"图说口碑",@"问题知识",@"口碑排名",@"查看抽查", nil];
// self.announeArray = [NSArray arrayWithObjects:@"关于展开10月口碑巡检的说明", @"迎2015十一大促活动启动", @"9月口碑巡检结果排名已公布", nil];
//
// // 初始化
// self.test1Array = [NSArray arrayWithObjects:@"【服务口碑现场】第二期",@"讲述红星人自己的故事",@"【服务口碑现场】第一期", nil];
// self.test2Array = [NSArray arrayWithObjects:@"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。",@"变成商场服务提升的契机,变成商场服务提升的契机。",@"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。", nil];
// self.test3Array = [NSArray arrayWithObjects:@"2015-08-26",@"2015-08-09",@"2015-07-31", nil];
[self setupNav];
......@@ -193,7 +181,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSString *url3 = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL];
HttpClient *httpCilent3 = [[HttpClient alloc] initWithUrl:url3];
NSDictionary *parameters3 = @{@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"queryOrders":@[@{@"field":@"lastModifyInfo", @"direction":@"desc"}],
@"pageNumber":@(0),
@"pageSize":@(2)
};
......@@ -353,7 +341,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSDictionary *parameters = @{
@"userUuid":[[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"],
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"queryOrders":@[@{@"field":@"lastModifyInfo", @"direction":@"desc"}],
@"pageNumber":@(0),
@"pageSize":@(2)
};
......@@ -504,8 +492,15 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:inspectListVC];
} else if ([item.titleLabel.text isEqualToString:@"口碑标准"]) {
LookOnLineViewController *lookOnLine = [[LookOnLineViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:lookOnLine];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
return;
// LookOnLineViewController *lookOnLine = [[LookOnLineViewController alloc] init];
// nav = [[UINavigationController alloc] initWithRootViewController:lookOnLine];
// StandardViewController *standardVC = [[StandardViewController alloc] init];
// nav = [[UINavigationController alloc] initWithRootViewController:standardVC];
} else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) {
......
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