Commit 22ef2cab authored by admin's avatar admin

修复bug

parent c8c656fe
......@@ -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 = (
......@@ -2263,6 +2276,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,10 +9,11 @@
#ifndef Url_h
#define Url_h
// url
// 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/"
// 检查更新
......
......@@ -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;
}];
......@@ -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];
......
//
// 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>
......@@ -442,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) {
......@@ -468,6 +477,7 @@
[MBProgressHUD hideHUDForView:self.view animated:YES];
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
[self closeGreenView];
}];
}
......@@ -577,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;
......@@ -617,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];
......
......@@ -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.create_time];
self.overDate.text = [NSString stringWithFormat:@"截止时间:%@", spotCheck.endDate];
self.address.text = [NSString stringWithFormat:@"巡检商场:%@", @"上海真北店"];
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
{
......
......@@ -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;
......
......@@ -253,7 +253,7 @@
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
if ([permissions containsObject:@"500103"]) {
if ([task.readonly isEqualToString:@"1"]) {
if (task.readonly) {
InspectUploadedViewController *inspectVC = [[InspectUploadedViewController alloc] init];
inspectVC.questionCount = taskGroup.questionCount;
inspectVC.taskModel = task;
......
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