Commit 39fe1244 authored by 曹云霄's avatar 曹云霄

临时VI检查增加历史检查入口,优化附件水印显示内容

parent f97a7c29
...@@ -128,6 +128,8 @@ ...@@ -128,6 +128,8 @@
29B501E61D1A95CC003D4E74 /* SourceOrderSectionView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29B501E51D1A95CC003D4E74 /* SourceOrderSectionView.xib */; }; 29B501E61D1A95CC003D4E74 /* SourceOrderSectionView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29B501E51D1A95CC003D4E74 /* SourceOrderSectionView.xib */; };
29B501E91D1A986B003D4E74 /* OilHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B501E81D1A986B003D4E74 /* OilHeaderView.m */; }; 29B501E91D1A986B003D4E74 /* OilHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B501E81D1A986B003D4E74 /* OilHeaderView.m */; };
29B501EB1D1A9875003D4E74 /* OilHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29B501EA1D1A9875003D4E74 /* OilHeaderView.xib */; }; 29B501EB1D1A9875003D4E74 /* OilHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29B501EA1D1A9875003D4E74 /* OilHeaderView.xib */; };
29B510A01FD8E1230040198F /* PatrolTaskRemarkFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B5109F1FD8E1230040198F /* PatrolTaskRemarkFooterView.m */; };
29B510A21FD8E3D30040198F /* PatrolTaskRemarkFooterView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29B510A11FD8E3D30040198F /* PatrolTaskRemarkFooterView.xib */; };
29BE722E1D40773F001D60EE /* OilNumberTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BE722D1D40773F001D60EE /* OilNumberTableViewCell.m */; }; 29BE722E1D40773F001D60EE /* OilNumberTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BE722D1D40773F001D60EE /* OilNumberTableViewCell.m */; };
29BE72311D407755001D60EE /* LossNumberTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BE72301D407755001D60EE /* LossNumberTableViewCell.m */; }; 29BE72311D407755001D60EE /* LossNumberTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BE72301D407755001D60EE /* LossNumberTableViewCell.m */; };
29BE72341D4077BE001D60EE /* NoteTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BE72331D4077BE001D60EE /* NoteTableViewCell.m */; }; 29BE72341D4077BE001D60EE /* NoteTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BE72331D4077BE001D60EE /* NoteTableViewCell.m */; };
...@@ -695,6 +697,9 @@ ...@@ -695,6 +697,9 @@
29B501E71D1A986B003D4E74 /* OilHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OilHeaderView.h; sourceTree = "<group>"; }; 29B501E71D1A986B003D4E74 /* OilHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OilHeaderView.h; sourceTree = "<group>"; };
29B501E81D1A986B003D4E74 /* OilHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OilHeaderView.m; sourceTree = "<group>"; }; 29B501E81D1A986B003D4E74 /* OilHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OilHeaderView.m; sourceTree = "<group>"; };
29B501EA1D1A9875003D4E74 /* OilHeaderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OilHeaderView.xib; sourceTree = "<group>"; }; 29B501EA1D1A9875003D4E74 /* OilHeaderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OilHeaderView.xib; sourceTree = "<group>"; };
29B5109E1FD8E1230040198F /* PatrolTaskRemarkFooterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PatrolTaskRemarkFooterView.h; sourceTree = "<group>"; };
29B5109F1FD8E1230040198F /* PatrolTaskRemarkFooterView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PatrolTaskRemarkFooterView.m; sourceTree = "<group>"; };
29B510A11FD8E3D30040198F /* PatrolTaskRemarkFooterView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PatrolTaskRemarkFooterView.xib; sourceTree = "<group>"; };
29BE722C1D40773F001D60EE /* OilNumberTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OilNumberTableViewCell.h; sourceTree = "<group>"; }; 29BE722C1D40773F001D60EE /* OilNumberTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OilNumberTableViewCell.h; sourceTree = "<group>"; };
29BE722D1D40773F001D60EE /* OilNumberTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OilNumberTableViewCell.m; sourceTree = "<group>"; }; 29BE722D1D40773F001D60EE /* OilNumberTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OilNumberTableViewCell.m; sourceTree = "<group>"; };
29BE722F1D407755001D60EE /* LossNumberTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LossNumberTableViewCell.h; sourceTree = "<group>"; }; 29BE722F1D407755001D60EE /* LossNumberTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LossNumberTableViewCell.h; sourceTree = "<group>"; };
...@@ -2074,6 +2079,9 @@ ...@@ -2074,6 +2079,9 @@
29F5C39C1FCBAA4F0052CBF1 /* PatrolTaskCollectionReusableView.m */, 29F5C39C1FCBAA4F0052CBF1 /* PatrolTaskCollectionReusableView.m */,
29F5C39D1FCBAA4F0052CBF1 /* PatrolTaskCollectionViewCell.h */, 29F5C39D1FCBAA4F0052CBF1 /* PatrolTaskCollectionViewCell.h */,
29F5C39E1FCBAA4F0052CBF1 /* PatrolTaskCollectionViewCell.m */, 29F5C39E1FCBAA4F0052CBF1 /* PatrolTaskCollectionViewCell.m */,
29B5109E1FD8E1230040198F /* PatrolTaskRemarkFooterView.h */,
29B5109F1FD8E1230040198F /* PatrolTaskRemarkFooterView.m */,
29B510A11FD8E3D30040198F /* PatrolTaskRemarkFooterView.xib */,
29F5C39F1FCBAA4F0052CBF1 /* QuestionCells */, 29F5C39F1FCBAA4F0052CBF1 /* QuestionCells */,
29F5C3B01FCBAA4F0052CBF1 /* ZJStandardPictureTableViewCell.h */, 29F5C3B01FCBAA4F0052CBF1 /* ZJStandardPictureTableViewCell.h */,
29F5C3B11FCBAA4F0052CBF1 /* ZJStandardPictureTableViewCell.m */, 29F5C3B11FCBAA4F0052CBF1 /* ZJStandardPictureTableViewCell.m */,
...@@ -3625,6 +3633,7 @@ ...@@ -3625,6 +3633,7 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
29B510A21FD8E3D30040198F /* PatrolTaskRemarkFooterView.xib in Resources */,
3506ECCD1BA00E3400897EBE /* Main.storyboard in Resources */, 3506ECCD1BA00E3400897EBE /* Main.storyboard in Resources */,
2978ED531D1BC74D00159B4A /* TimeSelectViewController.xib in Resources */, 2978ED531D1BC74D00159B4A /* TimeSelectViewController.xib in Resources */,
2941543E1D1D099100B3B761 /* OrderDetailsView.xib in Resources */, 2941543E1D1D099100B3B761 /* OrderDetailsView.xib in Resources */,
...@@ -4014,6 +4023,7 @@ ...@@ -4014,6 +4023,7 @@
35B2E56C1BAC064600AB8582 /* ICRQStarViewController.m in Sources */, 35B2E56C1BAC064600AB8582 /* ICRQStarViewController.m in Sources */,
3506ECEA1BA012BB00897EBE /* AppDelegate.m in Sources */, 3506ECEA1BA012BB00897EBE /* AppDelegate.m in Sources */,
35B2E56A1BAC064600AB8582 /* ICRQScoreViewController.m in Sources */, 35B2E56A1BAC064600AB8582 /* ICRQScoreViewController.m in Sources */,
29B510A01FD8E1230040198F /* PatrolTaskRemarkFooterView.m in Sources */,
2944FC231D2F48040093628B /* BaseViewController.m in Sources */, 2944FC231D2F48040093628B /* BaseViewController.m in Sources */,
29F5C4521FCBAB410052CBF1 /* SupervisionTableViewCell.m in Sources */, 29F5C4521FCBAB410052CBF1 /* SupervisionTableViewCell.m in Sources */,
3506EDD91BA0194300897EBE /* UIFont+Custom.m in Sources */, 3506EDD91BA0194300897EBE /* UIFont+Custom.m in Sources */,
......
...@@ -126,8 +126,8 @@ ...@@ -126,8 +126,8 @@
,@"function_vicheck" ,@"function_vicheck"
,@"function_vicheckresult",nil]; ,@"function_vicheckresult",nil];
NSArray *titleArray = [NSArray arrayWithObjects: NSArray *titleArray = [NSArray arrayWithObjects:
@"VI临时检查" @"临时VI检查"
,@"VI检查" ,@"VI检查任务"
,@"VI检查结果",nil]; ,@"VI检查结果",nil];
NSDictionary *dict = @{@"image":[imageArray objectAtIndex:i],@"title":[titleArray objectAtIndex:i]}; NSDictionary *dict = @{@"image":[imageArray objectAtIndex:i],@"title":[titleArray objectAtIndex:i]};
[_datasArray[3] addObject:dict]; [_datasArray[3] addObject:dict];
...@@ -254,9 +254,9 @@ ...@@ -254,9 +254,9 @@
//VI检查 //VI检查
NSArray *viExamine = [NSArray arrayWithObjects: NSArray *viExamine = [NSArray arrayWithObjects:
@"500201,500202,500203" @"501601,501602"
,@"500201,500202,500203" ,@"501401,501402"
,@"500201,500202,500203",nil]; ,@"501501",nil];
//开发、HSE //开发、HSE
NSArray *development = [NSArray arrayWithObjects: NSArray *development = [NSArray arrayWithObjects:
@"500501,500502,500503" @"500501,500502,500503"
...@@ -292,7 +292,9 @@ ...@@ -292,7 +292,9 @@
#pragma mark -获取登录人的所有的油站 #pragma mark -获取登录人的所有的油站
- (void)getStoreArray - (void)getStoreArray
{ {
[IBTLoadingView showProgressLabel:@"获取门店中"];
[HttpRequestManager requestNetworkwithURL:[NSString stringWithFormat:@"%@/mdata/store/getsByUser/%@",HTTP_REST_API_BASE_URL,[ICRUserUtil sharedInstance].f_user_uuid] withRequestType:ONE withParameter:nil withSuccess:^(id returnValue) { [HttpRequestManager requestNetworkwithURL:[NSString stringWithFormat:@"%@/mdata/store/getsByUser/%@",HTTP_REST_API_BASE_URL,[ICRUserUtil sharedInstance].f_user_uuid] withRequestType:ONE withParameter:nil withSuccess:^(id returnValue) {
[IBTLoadingView hideHUDWithText:nil];
if ([returnValue[@"success"] isEqualToNumber:@1]) { if ([returnValue[@"success"] isEqualToNumber:@1]) {
[ICRUserUtil sharedInstance].storeArray = returnValue[@"data"]; [ICRUserUtil sharedInstance].storeArray = returnValue[@"data"];
} }
...@@ -448,6 +450,7 @@ ...@@ -448,6 +450,7 @@
[self PushViewController:patrolResultVc animated:YES]; [self PushViewController:patrolResultVc animated:YES];
}else if (indexPath.item == 1) { }else if (indexPath.item == 1) {
PatrolTaskViewController *patrolTask = [PatrolTaskViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_PATROLINSPECT]; PatrolTaskViewController *patrolTask = [PatrolTaskViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_PATROLINSPECT];
patrolTask.isTempTask = NO;
[self PushViewController:patrolTask animated:YES]; [self PushViewController:patrolTask animated:YES];
}else { }else {
PatrolTempCheckViewController *tempChecKVc = [PatrolTempCheckViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_PATROLINSPECT]; PatrolTempCheckViewController *tempChecKVc = [PatrolTempCheckViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_PATROLINSPECT];
......
...@@ -11,15 +11,6 @@ ...@@ -11,15 +11,6 @@
@interface CustomInspectionTableViewCell : UITableViewCell @interface CustomInspectionTableViewCell : UITableViewCell
/**
VI检查问题、答案 数据源
*/
@property (nonatomic,strong) NSArray *datasArray;
/**
* 父视图传入的section闭合控制数组
*/
@property (nonatomic,strong) NSArray *closedControlArray;
/** /**
显示内容 显示内容
...@@ -27,14 +18,16 @@ ...@@ -27,14 +18,16 @@
@property (nonatomic,strong) InspectionAnswerViewController *inspectionVc; @property (nonatomic,strong) InspectionAnswerViewController *inspectionVc;
/** /**
cell 高度 刷新cell
@param datasArray VI检查问题、答案 数据源
@param rowHeightArray cell 高度
@param sectionHeightArray section 高度
@param closedControlArray 父视图传入的section闭合控制数组
*/ */
@property (nonatomic,strong) NSArray *rowHeightArray; - (void)updateCell:(NSArray *)datasArray rowHeightArray:(NSArray *)rowHeightArray sectionHeightArray:(NSArray *)sectionHeightArray closedControlArray:(NSMutableArray *)closedControlArray;
/**
section 高度
*/
@property (nonatomic,strong) NSArray *sectionHeightArray;
@end @end
...@@ -27,34 +27,14 @@ ...@@ -27,34 +27,14 @@
[self.contentView addSubview:self.inspectionVc.view]; [self.contentView addSubview:self.inspectionVc.view];
} }
#pragma mark - 数据源 - (void)updateCell:(NSArray *)datasArray rowHeightArray:(NSArray *)rowHeightArray sectionHeightArray:(NSArray *)sectionHeightArray closedControlArray:(NSMutableArray *)closedControlArray
- (void)setDatasArray:(NSArray *)datasArray
{ {
_datasArray = datasArray;
self.inspectionVc.datasArray = datasArray; self.inspectionVc.datasArray = datasArray;
}
#pragma mark - Section 闭合
- (void)setClosedControlArray:(NSMutableArray *)closedControlArray
{
_closedControlArray = closedControlArray;
self.inspectionVc.closedControlArray = closedControlArray;
}
#pragma mark - SubTableView Row Height
- (void)setRowHeightArray:(NSArray *)rowHeightArray
{
_rowHeightArray = rowHeightArray;
self.inspectionVc.rowHeightArray = rowHeightArray;
}
- (void)setSectionHeightArray:(NSArray *)sectionHeightArray
{
_sectionHeightArray = sectionHeightArray;
self.inspectionVc.sectionHeightArray = sectionHeightArray; self.inspectionVc.sectionHeightArray = sectionHeightArray;
self.inspectionVc.rowHeightArray = rowHeightArray;
self.inspectionVc.closedControlArray = closedControlArray;
} }
@end @end
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
@end @end
@interface InspectionAnswerViewController : UITableViewController @interface InspectionAnswerViewController : UITableViewController
@property (nonatomic,weak) id<RefreshDelegate>RefreshDelegate; @property (nonatomic,weak) id<RefreshDelegate>delegate;
/** /**
VI检查问题、答案 数据源 VI检查问题、答案 数据源
...@@ -48,4 +48,5 @@ ...@@ -48,4 +48,5 @@
*/ */
@property (nonatomic,strong) NSMutableArray *browserArray; @property (nonatomic,strong) NSMutableArray *browserArray;
@end @end
...@@ -34,9 +34,7 @@ ...@@ -34,9 +34,7 @@
- (void)setClosedControlArray:(NSMutableArray *)closedControlArray - (void)setClosedControlArray:(NSMutableArray *)closedControlArray
{ {
_closedControlArray = closedControlArray; _closedControlArray = closedControlArray;
dispatch_async(dispatch_get_main_queue(), ^{ [self.tableView reloadData];
[self.tableView reloadData];
});
} }
#pragma mark - Table view data source #pragma mark - Table view data source
...@@ -90,15 +88,11 @@ ...@@ -90,15 +88,11 @@
BOOL boolValue = [self.closedControlArray[senderIndex] boolValue]; BOOL boolValue = [self.closedControlArray[senderIndex] boolValue];
boolValue = !boolValue; boolValue = !boolValue;
self.closedControlArray[senderIndex] = [NSNumber numberWithBool:boolValue]; self.closedControlArray[senderIndex] = [NSNumber numberWithBool:boolValue];
if ([self.RefreshDelegate respondsToSelector:@selector(refreshSuperTableView)]) { if ([self.delegate respondsToSelector:@selector(refreshSuperTableView)]) {
[self.RefreshDelegate refreshSuperTableView]; [self.delegate refreshSuperTableView];
} }
[self.tableView reloadData];
} }
@end @end
...@@ -84,6 +84,10 @@ NSString *const CELL = @"CustomInspectionTableViewCell"; ...@@ -84,6 +84,10 @@ NSString *const CELL = @"CustomInspectionTableViewCell";
*/ */
@property (weak, nonatomic) IBOutlet UILabel *checkItemsLabel; @property (weak, nonatomic) IBOutlet UILabel *checkItemsLabel;
/**
cell高度
*/
@property (nonatomic,assign) CGFloat cellHeight;
@end @end
...@@ -254,11 +258,8 @@ NSString *const CELL = @"CustomInspectionTableViewCell"; ...@@ -254,11 +258,8 @@ NSString *const CELL = @"CustomInspectionTableViewCell";
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
CustomInspectionTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CELL forIndexPath:indexPath]; CustomInspectionTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CELL forIndexPath:indexPath];
cell.datasArray = self.datasArray[indexPath.section]; cell.inspectionVc.delegate = self;
cell.inspectionVc.RefreshDelegate = self; [cell updateCell:self.datasArray[indexPath.section] rowHeightArray:self.subTableViewHeightArray[indexPath.section] sectionHeightArray:self.subTableViewSectionHeightArray[indexPath.section] closedControlArray:self.sectionOpenControl[indexPath.section]];
cell.rowHeightArray = self.subTableViewHeightArray[indexPath.section];
cell.sectionHeightArray = self.subTableViewSectionHeightArray[indexPath.section];
cell.closedControlArray = self.sectionOpenControl[indexPath.section];
return cell; return cell;
} }
...@@ -288,12 +289,6 @@ NSString *const CELL = @"CustomInspectionTableViewCell"; ...@@ -288,12 +289,6 @@ NSString *const CELL = @"CustomInspectionTableViewCell";
return SECTION_HEIGHT; return SECTION_HEIGHT;
} }
#pragma mark -<sectionHeaderDelegate>
- (void)refreshingTableViewHeight:(NSNumber *)sectionState withIndexPath:(NSIndexPath *)indexPath
{
self.sectionOpenControl[indexPath.section][indexPath.row] = sectionState;
[self.tableView reloadData];
}
#pragma mark - <RefreshDelegate> #pragma mark - <RefreshDelegate>
- (void)refreshSuperTableView - (void)refreshSuperTableView
......
...@@ -80,10 +80,8 @@ ...@@ -80,10 +80,8 @@
*/ */
@property (weak, nonatomic) IBOutlet UILabel *storeNumberTitleLabel; @property (weak, nonatomic) IBOutlet UILabel *storeNumberTitleLabel;
@end @end
@implementation InspectionTableViewController @implementation InspectionTableViewController
...@@ -285,14 +283,14 @@ ...@@ -285,14 +283,14 @@
_queryResultModel = [[ParametersModel alloc]init]; _queryResultModel = [[ParametersModel alloc]init];
_queryResultModel.pageSize = PAGESIZE; _queryResultModel.pageSize = PAGESIZE;
_queryResultModel.pageNumber = ZERO; _queryResultModel.pageNumber = ZERO;
_queryResultModel.userUuid = kUser.f_user_uuid; // _queryResultModel.userUuid = kUser.f_user_uuid;
NSString *dateString = [[NSDate date] yearMonthDayString]; NSString *dateString = [[NSDate date] yearMonthDayString];
NSString *beginDateString = [NSString stringWithFormat:@"%@ 00:00:00",[ToolsManager getTimeby:-7]]; NSString *beginDateString = [NSString stringWithFormat:@"%@ 00:00:00",[ToolsManager getTimeby:-7]];
NSString *endDateString = [NSString stringWithFormat:@"%@ 23:59:59", dateString]; NSString *endDateString = [NSString stringWithFormat:@"%@ 23:59:59", dateString];
_queryResultModel.beginDate = beginDateString; _queryResultModel.beginDate = beginDateString;
_queryResultModel.endDate = endDateString; _queryResultModel.endDate = endDateString;
InspectQuickLookQuery *conditions = [[InspectQuickLookQuery alloc]init]; InspectQuickLookQuery *conditions = [[InspectQuickLookQuery alloc]init];
conditions.field = @"beginTime"; conditions.field = @"beginDate";
conditions.direction = @"desc"; conditions.direction = @"desc";
_queryResultModel.queryOrders = (NSArray<InspectQuickLookQuery> *)@[conditions]; _queryResultModel.queryOrders = (NSArray<InspectQuickLookQuery> *)@[conditions];
} }
......
...@@ -77,6 +77,11 @@ ...@@ -77,6 +77,11 @@
@property (nonatomic, copy) NSString *beginDate; @property (nonatomic, copy) NSString *beginDate;
/**
是否是临时巡检
*/
@property (nonatomic, assign) BOOL temp;
@property (nonatomic, strong) NSArray<Inspectors> *inspectors; @property (nonatomic, strong) NSArray<Inspectors> *inspectors;
@property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *name;
......
...@@ -51,6 +51,11 @@ ...@@ -51,6 +51,11 @@
*/ */
@property (nonatomic,assign) NSInteger pageNumber; @property (nonatomic,assign) NSInteger pageNumber;
/**
区分是否是临时任务
*/
@property (nonatomic, copy) NSString *isTemp;
/** /**
* 页个数 * 页个数
*/ */
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
CGFloat storesCount = model.personStoreCount; CGFloat storesCount = model.personStoreCount;
self.taskProgressLabel.text = [NSString stringWithFormat:@"%.0f%@(%ld/%.0f%@)",(model.finishCount/storesCount)*100.0,@"%",model.finishCount,storesCount,@"店"]; self.taskProgressLabel.text = [NSString stringWithFormat:@"%.0f%@(%ld/%.0f%@)",(model.finishCount/storesCount)*100.0,@"%",model.finishCount,storesCount,@"店"];
[self.progressView setProgress:model.finishCount / storesCount animated:YES]; [self.progressView setProgress:model.finishCount / storesCount animated:YES];
self.supervisionNameLabel.textColor = [model.user_uuid isEqualToString:kUser.f_user_uuid] ? ICR_TINTCOLOR : [UIColor blackColor];
} }
#pragma mark -设置进度条风格 #pragma mark -设置进度条风格
......
...@@ -28,6 +28,21 @@ ...@@ -28,6 +28,21 @@
self.taskStateImageView.image = storesModel.resultState?TCImage(@"complete"):TCImage(@"unfinished"); self.taskStateImageView.image = storesModel.resultState?TCImage(@"complete"):TCImage(@"unfinished");
self.finishProgressLabel.text = storesModel.resultState?nil:@"未提交"; self.finishProgressLabel.text = storesModel.resultState?nil:@"未提交";
self.finishProgressLabel.hidden = storesModel.resultState; self.finishProgressLabel.hidden = storesModel.resultState;
} }
@end @end
//
// PatrolTaskRemarkFooterView.h
// total
//
// Created by 曹云霄 on 2017/12/7.
// Copyright © 2017年 Delevin. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "IQTextView.h"
@interface PatrolTaskRemarkFooterView : UITableViewHeaderFooterView
@property (weak, nonatomic) IBOutlet IQTextView *remarkTextView;
@end
//
// PatrolTaskRemarkFooterView.m
// total
//
// Created by 曹云霄 on 2017/12/7.
// Copyright © 2017年 Delevin. All rights reserved.
//
#import "PatrolTaskRemarkFooterView.h"
@implementation PatrolTaskRemarkFooterView
- (void)awakeFromNib
{
[super awakeFromNib];
self.remarkTextView.placeholder = @"请输入备注内容...";
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="PatrolTaskRemarkFooterView">
<rect key="frame" x="0.0" y="0.0" width="375" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="备注" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aAQ-fX-SrJ">
<rect key="frame" x="20" y="10" width="31" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Eph-Dj-H5K" customClass="IQTextView">
<rect key="frame" x="20" y="38" width="335" height="52"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" red="0.92941176469999998" green="0.93333333330000001" blue="0.93725490199999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</textView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="aAQ-fX-SrJ" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="5wu-Zq-WW8"/>
<constraint firstAttribute="trailing" secondItem="Eph-Dj-H5K" secondAttribute="trailing" constant="20" id="6MV-CF-1Cw"/>
<constraint firstItem="aAQ-fX-SrJ" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" id="6YX-Xy-wO7"/>
<constraint firstItem="Eph-Dj-H5K" firstAttribute="top" secondItem="aAQ-fX-SrJ" secondAttribute="bottom" constant="10" id="OxA-2r-dNl"/>
<constraint firstItem="Eph-Dj-H5K" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" id="TD7-0V-4ZH"/>
<constraint firstAttribute="bottom" secondItem="Eph-Dj-H5K" secondAttribute="bottom" constant="10" id="jFu-If-EqR"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="remarkTextView" destination="Eph-Dj-H5K" id="PjL-lR-yYq"/>
</connections>
<point key="canvasLocation" x="37.5" y="36"/>
</view>
</objects>
</document>
...@@ -34,11 +34,9 @@ ...@@ -34,11 +34,9 @@
- (void)setCellModel:(PatrolExamCellViewModel *)cellModel { - (void)setCellModel:(PatrolExamCellViewModel *)cellModel {
[super setCellModel:cellModel]; [super setCellModel:cellModel];
if (cellModel.question.reference.length > 0) { if (cellModel.question.reference.length > 0) {
self.btnReference.hidden = NO; self.btnReference.hidden = NO;
}else{ }else{
if ([UploadManager getUploadType] == UPLOAD_COMMON) { if ([UploadManager getUploadType] == UPLOAD_COMMON) {
self.btnReference.hidden = cellModel.question.attachmentId.length == 0; self.btnReference.hidden = cellModel.question.attachmentId.length == 0;
}else{ }else{
...@@ -46,21 +44,50 @@ ...@@ -46,21 +44,50 @@
} }
} }
if (self.cellModel.answer.resultAttachments.count > 0) { if (cellModel.viewModel.detail.temp) {
NSString *title = [NSString stringWithFormat:@"附件(%lu)",self.cellModel.answer.resultAttachments.count]; [self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg_red") forState:UIControlStateNormal];
[self.btnAtt setTitle:title forState:UIControlStateNormal]; [self.btnAtt setImage:TCImage(@"patrol_exam_camera_red") forState:UIControlStateNormal];
[self.btnAtt setImage:TCImage(@"patrol_exam_camera") forState:UIControlStateNormal]; if (self.cellModel.answer.resultAttachments.count > 0) {
[self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg") forState:UIControlStateNormal]; NSString *title = [NSString stringWithFormat:@"附件(%lu)",self.cellModel.answer.resultAttachments.count];
[self.btnAtt setTitleColor:ICR_TINTCOLOR forState:UIControlStateNormal]; [self.btnAtt setTitle:title forState:UIControlStateNormal];
}else{ [self.btnAtt setTitleColor:ICR_TINTCOLOR forState:UIControlStateNormal];
[self.btnAtt setTitle:@"附件" forState:UIControlStateNormal]; [self.btnAtt setImage:TCImage(@"patrol_exam_camera") forState:UIControlStateNormal];
[self.btnAtt setImage:TCImage(@"patrol_exam_camera_gray") forState:UIControlStateNormal]; [self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg") forState:UIControlStateNormal];
[self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_gray_btn_bg") forState:UIControlStateNormal]; }else {
[self.btnAtt setTitleColor:RGBA(128, 128, 128, 1) forState:UIControlStateNormal]; [self.btnAtt setTitle:@"附件" forState:UIControlStateNormal];
[self.btnAtt setTitleColor:RGBA(227, 12, 53, 1) forState:UIControlStateNormal];
}
}else {
if (cellModel.question.needPhoto) {
[self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg_red") forState:UIControlStateNormal];
[self.btnAtt setImage:TCImage(@"patrol_exam_camera_red") forState:UIControlStateNormal];
if (self.cellModel.answer.resultAttachments.count > 0) {
NSString *title = [NSString stringWithFormat:@"附件(%lu)",self.cellModel.answer.resultAttachments.count];
[self.btnAtt setTitle:title forState:UIControlStateNormal];
[self.btnAtt setTitleColor:ICR_TINTCOLOR forState:UIControlStateNormal];
[self.btnAtt setImage:TCImage(@"patrol_exam_camera") forState:UIControlStateNormal];
[self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg") forState:UIControlStateNormal];
}else {
[self.btnAtt setTitle:@"附件" forState:UIControlStateNormal];
[self.btnAtt setTitleColor:RGBA(227, 12, 53, 1) forState:UIControlStateNormal];
}
}else {
if (self.cellModel.answer.resultAttachments.count > 0) {
NSString *title = [NSString stringWithFormat:@"附件(%lu)",self.cellModel.answer.resultAttachments.count];
[self.btnAtt setTitle:title forState:UIControlStateNormal];
[self.btnAtt setImage:TCImage(@"patrol_exam_camera") forState:UIControlStateNormal];
[self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_btn_bg") forState:UIControlStateNormal];
[self.btnAtt setTitleColor:ICR_TINTCOLOR forState:UIControlStateNormal];
}else{
[self.btnAtt setTitle:@"附件" forState:UIControlStateNormal];
[self.btnAtt setImage:TCImage(@"patrol_exam_camera_gray") forState:UIControlStateNormal];
[self.btnAtt setBackgroundImage:TCImage(@"patrol_exam_gray_btn_bg") forState:UIControlStateNormal];
[self.btnAtt setTitleColor:RGBA(128, 128, 128, 1) forState:UIControlStateNormal];
}
}
} }
} }
- (IBAction)actionStandard:(UIButton *)sender { - (IBAction)actionStandard:(UIButton *)sender {
sender.selected = !sender.isSelected; sender.selected = !sender.isSelected;
if (sender.isSelected) { if (sender.isSelected) {
......
...@@ -22,7 +22,10 @@ ...@@ -22,7 +22,10 @@
if ([question.category isEqualToString:cellModel.category]) { if ([question.category isEqualToString:cellModel.category]) {
for (NSString *key in cellModel.viewModel.dicAnswers.allKeys) { for (NSString *key in cellModel.viewModel.dicAnswers.allKeys) {
if ([key isEqualToString:question.uuid]) { if ([key isEqualToString:question.uuid]) {
[answers addObject:@1]; ZJPatrolDetail_results_answers *answer = (ZJPatrolDetail_results_answers *)[cellModel.viewModel.dicAnswers objectForKey:key];
if (answer.details.count) {
[answers addObject:@1];
}
} }
} }
[questions addObject:question]; [questions addObject:question];
......
...@@ -175,6 +175,11 @@ ...@@ -175,6 +175,11 @@
@property (nonatomic, strong) NSNumber <Optional> * scoreTo; @property (nonatomic, strong) NSNumber <Optional> * scoreTo;
/**
是否必须拍照
*/
@property (nonatomic, assign) BOOL needPhoto;
@property (nonatomic, strong) NSNumber <Optional> * scoreFrom; @property (nonatomic, strong) NSNumber <Optional> * scoreFrom;
@property (nonatomic, strong) NSString <Optional> * reference; @property (nonatomic, strong) NSString <Optional> * reference;
...@@ -204,6 +209,8 @@ ...@@ -204,6 +209,8 @@
@property (nonatomic, strong) NSString <Optional> * uuid; @property (nonatomic, strong) NSString <Optional> * uuid;
@property (nonatomic, assign) BOOL temp;
@property (nonatomic, strong) NSNumber <Optional> * state; @property (nonatomic, strong) NSNumber <Optional> * state;
@property (nonatomic, strong) NSNumber <Optional> * version; @property (nonatomic, strong) NSNumber <Optional> * version;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="---" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AmB-Sw-RmT"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="---" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AmB-Sw-RmT">
<rect key="frame" x="129.5" y="15.5" width="22.5" height="19.5"/> <rect key="frame" x="129.5" y="15.5" width="22.5" height="19.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.0" green="0.36078431370000003" blue="0.64705882349999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.0" green="0.36078431370000003" blue="0.64705882349999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<constraint firstAttribute="height" constant="50" id="AST-Wr-reU"/> <constraint firstAttribute="height" constant="50" id="AST-Wr-reU"/>
<constraint firstItem="XQD-st-wDe" firstAttribute="centerY" secondItem="3Fm-DF-njJ" secondAttribute="centerY" id="Cna-K4-AgL"/> <constraint firstItem="XQD-st-wDe" firstAttribute="centerY" secondItem="3Fm-DF-njJ" secondAttribute="centerY" id="Cna-K4-AgL"/>
<constraint firstItem="EJ7-Oe-Vsf" firstAttribute="leading" secondItem="3Fm-DF-njJ" secondAttribute="leading" id="FlZ-QT-pIT"/> <constraint firstItem="EJ7-Oe-Vsf" firstAttribute="leading" secondItem="3Fm-DF-njJ" secondAttribute="leading" id="FlZ-QT-pIT"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="AmB-Sw-RmT" secondAttribute="trailing" constant="10" id="LFx-Be-91D"/>
<constraint firstItem="XQD-st-wDe" firstAttribute="leading" secondItem="3Fm-DF-njJ" secondAttribute="leading" constant="10" id="P7c-HC-XjG"/> <constraint firstItem="XQD-st-wDe" firstAttribute="leading" secondItem="3Fm-DF-njJ" secondAttribute="leading" constant="10" id="P7c-HC-XjG"/>
<constraint firstItem="AmB-Sw-RmT" firstAttribute="leading" secondItem="XQD-st-wDe" secondAttribute="trailing" constant="5" id="T0P-KO-Hbn"/> <constraint firstItem="AmB-Sw-RmT" firstAttribute="leading" secondItem="XQD-st-wDe" secondAttribute="trailing" constant="5" id="T0P-KO-Hbn"/>
<constraint firstAttribute="bottom" secondItem="EJ7-Oe-Vsf" secondAttribute="bottom" id="mDb-HG-qFZ"/> <constraint firstAttribute="bottom" secondItem="EJ7-Oe-Vsf" secondAttribute="bottom" id="mDb-HG-qFZ"/>
...@@ -243,7 +244,7 @@ ...@@ -243,7 +244,7 @@
<constraints> <constraints>
<constraint firstAttribute="width" constant="85" id="QCJ-l1-s8b"/> <constraint firstAttribute="width" constant="85" id="QCJ-l1-s8b"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="15"/>
<inset key="titleEdgeInsets" minX="-16" minY="0.0" maxX="20" maxY="0.0"/> <inset key="titleEdgeInsets" minX="-16" minY="0.0" maxX="20" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="65" minY="0.0" maxX="0.0" maxY="0.0"/> <inset key="imageEdgeInsets" minX="65" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="全部展开" image="arrowturnoff"> <state key="normal" title="全部展开" image="arrowturnoff">
...@@ -1067,7 +1068,7 @@ ...@@ -1067,7 +1068,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="1YA-Q1-Xuk"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="none" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="1YA-Q1-Xuk">
<rect key="frame" x="0.0" y="20" width="375" height="563"/> <rect key="frame" x="0.0" y="20" width="375" height="563"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<view key="tableHeaderView" contentMode="scaleToFill" id="ETU-e0-ASH"> <view key="tableHeaderView" contentMode="scaleToFill" id="ETU-e0-ASH">
...@@ -1119,7 +1120,7 @@ ...@@ -1119,7 +1120,7 @@
</view> </view>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ZJPictureTableViewCell" rowHeight="114" id="BOo-Tf-lON" customClass="ZJPictureTableViewCell"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ZJPictureTableViewCell" rowHeight="114" id="BOo-Tf-lON" customClass="ZJPictureTableViewCell">
<rect key="frame" x="0.0" y="98" width="375" height="114"/> <rect key="frame" x="0.0" y="125.5" width="375" height="114"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="BOo-Tf-lON" id="IcP-xt-v61"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="BOo-Tf-lON" id="IcP-xt-v61">
<rect key="frame" x="0.0" y="0.0" width="375" height="114"/> <rect key="frame" x="0.0" y="0.0" width="375" height="114"/>
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#import "ZJPictureTableViewCell.h" #import "ZJPictureTableViewCell.h"
#import "UploadManager.h" #import "UploadManager.h"
#import "PatrolExamViewModel.h" #import "PatrolExamViewModel.h"
#import "PatrolTaskRemarkFooterView.h"
@interface PatrolAttachmentViewController () <UITableViewDelegate, UITableViewDataSource> @interface PatrolAttachmentViewController () <UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView; @property (weak, nonatomic) IBOutlet UITableView *tableView;
...@@ -28,10 +30,10 @@ ...@@ -28,10 +30,10 @@
[super viewDidLoad]; [super viewDidLoad];
self.labelQuestionTitle.text = self.cellModel.question.title; self.labelQuestionTitle.text = self.cellModel.question.title;
[self.btnBottom setTitle:@"提交" forState:UIControlStateNormal]; [self.btnBottom setTitle:@"提交" forState:UIControlStateNormal];
[self.tableView registerNib:[UINib nibWithNibName:PatrolTaskRemarkFooterView.className bundle:nil] forHeaderFooterViewReuseIdentifier:PatrolTaskRemarkFooterView.className];
[self configWithType]; [self configWithType];
} }
- (void)configWithType { - (void)configWithType {
switch (self.viewModel.type) { switch (self.viewModel.type) {
case kPicCellTypeAdd: case kPicCellTypeAdd:
...@@ -89,7 +91,8 @@ ...@@ -89,7 +91,8 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ZJPictureTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ZJPictureTableViewCell" forIndexPath:indexPath]; ZJPictureTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ZJPictureTableViewCell" forIndexPath:indexPath];
[cell configCellWithViewModel:self.viewModel indexPath:indexPath target:self]; NSString *memarkString = [NSString stringWithFormat:@"%@ %@\n%@ %@",kUser.f_user_name,self.cellModel.question.title,[[NSDate date] httpParameterString],self.cellModel.viewModel.inspector.store_name];
[cell configCellWithViewModel:self.viewModel indexPath:indexPath target:self remarkString:memarkString];
@weakify(self); @weakify(self);
cell.blockReloadData = ^{ cell.blockReloadData = ^{
@strongify(self); @strongify(self);
...@@ -98,6 +101,23 @@ ...@@ -98,6 +101,23 @@
return cell; return cell;
} }
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
PatrolTaskRemarkFooterView *footerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:PatrolTaskRemarkFooterView.className];
footerView.remarkTextView.text = self.cellModel.getAnswer.remark;
WS(weakSelf);
[footerView.remarkTextView.rac_textSignal subscribeNext:^(NSString * _Nullable x) {
weakSelf.cellModel.getAnswer.remark = x;
}];
footerView.userInteractionEnabled = self.cellModel.viewModel.state.type == PatrolExamStateProcessing;
return footerView;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 150;
}
- (IBAction)actionSubmit:(id)sender { - (IBAction)actionSubmit:(id)sender {
@weakify(self); @weakify(self);
ShowAlertView(@"提示", @"确认提交附件?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) { ShowAlertView(@"提示", @"确认提交附件?", @[@"确认",@"取消"], UIAlertControllerStyleAlert, ^(NSInteger index) {
...@@ -124,6 +144,8 @@ ...@@ -124,6 +144,8 @@
[UploadManager uploadObjectArray:arrAttachment completed:^(UploadResponse *success) { [UploadManager uploadObjectArray:arrAttachment completed:^(UploadResponse *success) {
@strongify(self); @strongify(self);
ZJPatrolDetail_results_answers *answer = self.cellModel.getAnswer; ZJPatrolDetail_results_answers *answer = self.cellModel.getAnswer;
PatrolTaskRemarkFooterView *footerView = (PatrolTaskRemarkFooterView *)[self.tableView footerViewForSection:0];
answer.remark = footerView.remarkTextView.text;
answer.resultAttachmentId = [ToolsManager getTheTimestamp]; answer.resultAttachmentId = [ToolsManager getTheTimestamp];
answer.attachmenturls = (NSMutableArray<ZJPatrolDetail_questions_attachmentUrls,Optional> *)[NSMutableArray array]; answer.attachmenturls = (NSMutableArray<ZJPatrolDetail_questions_attachmentUrls,Optional> *)[NSMutableArray array];
if (success.type == UPLOAD_COMMON) { if (success.type == UPLOAD_COMMON) {
......
...@@ -71,29 +71,8 @@ ...@@ -71,29 +71,8 @@
[[NSRunLoop mainRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes]; [[NSRunLoop mainRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes];
[self.tableView registerClass:[PatrolExamStarCell class] forCellReuseIdentifier:@"PatrolExamStarCell"]; [self.tableView registerClass:[PatrolExamStarCell class] forCellReuseIdentifier:@"PatrolExamStarCell"];
self.title = self.viewModel.storeResult.store_name;
[self.btnSubmit setTitle:@"确认提交" forState:UIControlStateNormal]; [self.btnSubmit setTitle:@"确认提交" forState:UIControlStateNormal];
@weakify(self); @weakify(self);
//加载详情
[IBTLoadingView showProgressLabel:@"加载中"];
[self.viewModel httpDetailComplete:^{
@strongify(self);
[IBTLoadingView hideHUDWithText:nil];
self.topView.viewModel = self.viewModel;
//根据当前单据状态显示底部按钮
[self.tableView reloadData];
dispatch_async(dispatch_get_main_queue(), ^{
NSMutableArray *arrIndexs = [self.viewModel closeAll];
[self.tableView deleteRowsAtIndexPaths:arrIndexs withRowAnimation:UITableViewRowAnimationFade];
});
//进行中的单据才显示保存按钮
if (self.viewModel.state.type == PatrolExamStateProcessing) {
UIBarButtonItem *save = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStyleDone target:self action:@selector(actionSave)];
self.navigationItem.rightBarButtonItem = save;
self.btnSubmit.hidden = NO;
}
}];
self.viewModel.blockReHttp = ^{ self.viewModel.blockReHttp = ^{
@strongify(self); @strongify(self);
//加载详情 //加载详情
...@@ -119,6 +98,31 @@ ...@@ -119,6 +98,31 @@
} failure:^(id errorValue) { } failure:^(id errorValue) {
[IBTLoadingView showTextOnly:errorValue]; [IBTLoadingView showTextOnly:errorValue];
}]; }];
}else {
//加载详情
[IBTLoadingView showProgressLabel:@"加载中"];
[self.viewModel httpDetailComplete:^{
@strongify(self);
[IBTLoadingView hideHUDWithText:nil];
self.title = self.viewModel.inspector.store_name;
self.topView.viewModel = self.viewModel;
//根据当前单据状态显示底部按钮
[self.tableView reloadData];
if (self.viewModel.state.type != PatrolExamStateUnStart) {
dispatch_async(dispatch_get_main_queue(), ^{
NSMutableArray *arrIndexs = [self.viewModel closeAll];
[self.tableView deleteRowsAtIndexPaths:arrIndexs withRowAnimation:UITableViewRowAnimationFade];
});
}
//进行中的单据才显示保存按钮
if (self.viewModel.state.type == PatrolExamStateProcessing) {
UIBarButtonItem *save = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStyleDone target:self action:@selector(actionSave)];
self.navigationItem.rightBarButtonItem = save;
self.btnSubmit.hidden = NO;
}
}];
}; };
//统一刷新 //统一刷新
self.viewModel.blockReloadData = ^{ self.viewModel.blockReloadData = ^{
...@@ -134,7 +138,6 @@ ...@@ -134,7 +138,6 @@
//开始答题 //开始答题
self.confirmVC.blockStart = ^{ self.confirmVC.blockStart = ^{
@strongify(self); @strongify(self);
[kNotification postNotificationName:UPDATEPATROLONLINELIST object:nil];
UIBarButtonItem *save = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStyleDone target:self action:@selector(actionSave)]; UIBarButtonItem *save = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStyleDone target:self action:@selector(actionSave)];
self.navigationItem.rightBarButtonItem = save; self.navigationItem.rightBarButtonItem = save;
self.btnSubmit.hidden = NO; self.btnSubmit.hidden = NO;
...@@ -143,14 +146,17 @@ ...@@ -143,14 +146,17 @@
@strongify(self); @strongify(self);
[IBTLoadingView hideHUDWithText:nil]; [IBTLoadingView hideHUDWithText:nil];
self.viewModel.state = [PatrolExamState stateWithCode:self.viewModel.storeResult.state]; self.viewModel.state = [PatrolExamState stateWithCode:self.viewModel.storeResult.state];
self.title = self.viewModel.inspector.store_name;
self.topView.viewModel = self.viewModel; self.topView.viewModel = self.viewModel;
self.btnSubmit.hidden = self.viewModel.state.type != PatrolExamStateProcessing; self.btnSubmit.hidden = self.viewModel.state.type != PatrolExamStateProcessing;
[self.tableView reloadData]; [self.tableView reloadData];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
NSMutableArray *arrIndexs = [self.viewModel closeAll]; NSMutableArray *arrIndexs = [self.viewModel closeAll];
[self.tableView deleteRowsAtIndexPaths:arrIndexs withRowAnimation:UITableViewRowAnimationFade]; [self.tableView deleteRowsAtIndexPaths:arrIndexs withRowAnimation:UITableViewRowAnimationFade];
}); });
if (!self.isBackRootVc) {
[kNotification postNotificationName:UPDATEPATROLONLINELIST object:nil];
}
}]; }];
}; };
...@@ -285,27 +291,89 @@ ...@@ -285,27 +291,89 @@
#pragma mark -提交VI检查任务 #pragma mark -提交VI检查任务
- (IBAction)actionSubmit:(id)sender { - (IBAction)actionSubmit:(id)sender {
//找到最上面一个没有回答的问题
if (self.viewModel.detail.questions.count != self.viewModel.dicAnswers.count) { if (!self.viewModel.detail.temp) {
NSMutableArray *arrQuestionId = [NSMutableArray array]; //找到最上面一个没有回答的问题
for (ZJPatrolDetail_questions *qustion in self.viewModel.detail.questions) { if (self.viewModel.detail.questions.count != self.viewModel.dicAnswers.count) {
[arrQuestionId addObject:qustion.uuid]; NSMutableArray *arrQuestionId = [NSMutableArray array];
for (ZJPatrolDetail_questions *qustion in self.viewModel.detail.questions) {
[arrQuestionId addObject:qustion.uuid];
}
NSMutableSet *setQuestionId = [NSMutableSet setWithArray:arrQuestionId];
NSSet *setAnswerQuestionId = [NSSet setWithArray:self.viewModel.dicAnswers.allKeys];
[setQuestionId minusSet:setAnswerQuestionId];
for (NSInteger i = 0; i < self.viewModel.arrCellData.count; i++) {
PatrolExamCellViewModel *vm = self.viewModel.arrCellData[i];
if ([setQuestionId containsObject:vm.question.uuid]) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:(UITableViewScrollPositionMiddle) animated:YES];
break;
}
}
[IBTLoadingView showTextOnly:@"您有未检查的项目"];
return;
}else {
NSMutableArray *questionArray = [NSMutableArray array];
for (id object in self.viewModel.dicAnswers.allValues) {
if ([object isKindOfClass:[ZJPatrolDetail_results_answers class]]) {
ZJPatrolDetail_results_answers *answer = (ZJPatrolDetail_results_answers *)object;
if (answer.details.count && !answer.resultAttachments.count) {
[questionArray addObject:answer.questionUuid];
}
}
}
for (NSInteger i = 0; i < self.viewModel.arrCellData.count; i++) {
PatrolExamCellViewModel *vm = self.viewModel.arrCellData[i];
if (vm.question.needPhoto) {
if ([questionArray containsObject:vm.question.uuid]) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:(UITableViewScrollPositionMiddle) animated:YES];
break;
}
}else {
[questionArray removeObject:vm.question.uuid];
}
}
if (questionArray.count) {
[IBTLoadingView showTextOnly:@"您有检查的项目未拍照"];
return;
}
}
}else {
NSMutableArray *questionArray = [NSMutableArray array];
for (id object in self.viewModel.dicAnswers.allValues) {
if ([object isKindOfClass:[ZJPatrolDetail_results_answers class]]) {
ZJPatrolDetail_results_answers *answer = (ZJPatrolDetail_results_answers *)object;
if (answer.details.count && !answer.resultAttachments.count) {
[questionArray addObject:answer.questionUuid];
}
}
} }
NSMutableSet *setQuestionId = [NSMutableSet setWithArray:arrQuestionId];
NSSet *setAnswerQuestionId = [NSSet setWithArray:self.viewModel.dicAnswers.allKeys];
[setQuestionId minusSet:setAnswerQuestionId];
for (NSInteger i = 0; i < self.viewModel.arrCellData.count; i++) { for (NSInteger i = 0; i < self.viewModel.arrCellData.count; i++) {
PatrolExamCellViewModel *vm = self.viewModel.arrCellData[i]; PatrolExamCellViewModel *vm = self.viewModel.arrCellData[i];
if ([setQuestionId containsObject:vm.question.uuid]) { if ([questionArray containsObject:vm.question.uuid]) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0]; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:(UITableViewScrollPositionMiddle) animated:YES]; [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:(UITableViewScrollPositionMiddle) animated:YES];
break;
} }
} }
[IBTLoadingView showTextOnly:@"您有未检查的项目"]; if (questionArray.count) {
return; [IBTLoadingView showTextOnly:@"您有检查的项目未拍照"];
return;
}
} }
@weakify(self); @weakify(self);
ShowAlertView(@"提示",@"您确认要提交VI检查任务吗?", @[@"取消",@"确认"], UIAlertControllerStyleAlert, ^(NSInteger index) { NSMutableArray *answerArray = [NSMutableArray array];
for (id object in self.viewModel.dicAnswers.allValues) {
if ([object isKindOfClass:[ZJPatrolDetail_results_answers class]]) {
ZJPatrolDetail_results_answers *answer = (ZJPatrolDetail_results_answers *)object;
if (answer.details.count) {
[answerArray addObject:@1];
}
}
}
NSString *message = [NSString stringWithFormat:@"当前已填写(%lu/%lu)项检查项目,请确认是否提交!",answerArray.count, self.viewModel.detail.questions.count];
ShowAlertView(@"提示",message, @[@"取消",@"确认"], UIAlertControllerStyleAlert, ^(NSInteger index) {
@strongify(self); @strongify(self);
if (index == ONE) { if (index == ONE) {
[IBTLoadingView showProgressLabel:@"加载中"]; [IBTLoadingView showProgressLabel:@"加载中"];
......
...@@ -26,24 +26,24 @@ ...@@ -26,24 +26,24 @@
self.tableView.rowHeight = UITableViewAutomaticDimension; self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 88; self.tableView.estimatedRowHeight = 88;
[self.backButton setTitle:@"返回" forState:UIControlStateNormal]; [self.backButton setTitle:@"返回" forState:UIControlStateNormal];
if ([UploadManager getUploadType] == UPLOAD_COMMON) { // if ([UploadManager getUploadType] == UPLOAD_COMMON) {
[RequestManager request_PatrolInspectAttachment:self.question.attachmentId success:^(id returnValue) { // [RequestManager request_PatrolInspectAttachment:self.question.attachmentId success:^(id returnValue) {
if ([returnValue[@"success"] boolValue] == YES) { // if ([returnValue[@"success"] boolValue] == YES) {
NSMutableArray *pictures = [NSMutableArray array]; // NSMutableArray *pictures = [NSMutableArray array];
for (NSInteger i = 0; i < [returnValue[@"data"] count]; i++) { // for (NSInteger i = 0; i < [returnValue[@"data"] count]; i++) {
NSDictionary *dict = returnValue[@"data"][i]; // NSDictionary *dict = returnValue[@"data"][i];
PostAttachmentModel *model = [[PostAttachmentModel alloc] initWithDictionary:dict error:nil]; // PostAttachmentModel *model = [[PostAttachmentModel alloc] initWithDictionary:dict error:nil];
[pictures addObject:model]; // [pictures addObject:model];
} // }
self.arrPictures = pictures; // self.arrPictures = pictures;
[self.tableView reloadData]; // [self.tableView reloadData];
[self configHeightWithAttachment]; // [self configHeightWithAttachment];
} // }
//
} failure:^(id errorValue) { // } failure:^(id errorValue) {
[IBTLoadingView showTextOnly:errorValue]; // [IBTLoadingView showTextOnly:errorValue];
}]; // }];
}else{ // }else{
self.arrPictures = [NSMutableArray array]; self.arrPictures = [NSMutableArray array];
for (ZJPatrolDetail_questions_attachmentUrls *att in self.question.attachmentUrls) { for (ZJPatrolDetail_questions_attachmentUrls *att in self.question.attachmentUrls) {
PostAttachmentModel *model = [[PostAttachmentModel alloc] initWithDictionary:att.toDictionary error:nil]; PostAttachmentModel *model = [[PostAttachmentModel alloc] initWithDictionary:att.toDictionary error:nil];
...@@ -51,8 +51,7 @@ ...@@ -51,8 +51,7 @@
} }
[self configHeightWithAttachment]; [self configHeightWithAttachment];
[self.tableView reloadData]; [self.tableView reloadData];
} // }
} }
- (void)configHeightWithAttachment { - (void)configHeightWithAttachment {
...@@ -84,7 +83,7 @@ ...@@ -84,7 +83,7 @@
}else{ }else{
PostAttachmentModel *model = self.arrPictures[indexPath.row - 1]; PostAttachmentModel *model = self.arrPictures[indexPath.row - 1];
ZJStandardPictureTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ZJStandardPictureTableViewCell" forIndexPath:indexPath]; ZJStandardPictureTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ZJStandardPictureTableViewCell" forIndexPath:indexPath];
[cell.img sd_setImageWithURL:[NSURL URLWithString:model.fileUrl] placeholderImage:TCImage(@"AttachPhoto")]; [cell.img sd_setImageWithURL:[NSURL URLWithString:[ToolsManager jointUrl:model.fileUrl]] placeholderImage:KNODATAIMAGE];
return cell; return cell;
} }
...@@ -95,7 +94,6 @@ ...@@ -95,7 +94,6 @@
if (indexPath.row > 0) { if (indexPath.row > 0) {
NSMutableArray *imageArray = [NSMutableArray array]; NSMutableArray *imageArray = [NSMutableArray array];
PYPhotoBrowseView *photoBroseView = [[PYPhotoBrowseView alloc] init]; PYPhotoBrowseView *photoBroseView = [[PYPhotoBrowseView alloc] init];
photoBroseView.currentIndex = ZERO;
for (UITableViewCell *cell in tableView.visibleCells) { for (UITableViewCell *cell in tableView.visibleCells) {
if ([cell isKindOfClass:[ZJStandardPictureTableViewCell class]]) { if ([cell isKindOfClass:[ZJStandardPictureTableViewCell class]]) {
ZJStandardPictureTableViewCell *pictureCell = (ZJStandardPictureTableViewCell *)cell; ZJStandardPictureTableViewCell *pictureCell = (ZJStandardPictureTableViewCell *)cell;
...@@ -103,6 +101,7 @@ ...@@ -103,6 +101,7 @@
} }
} }
photoBroseView.sourceImgageViews = imageArray; photoBroseView.sourceImgageViews = imageArray;
photoBroseView.currentIndex = indexPath.row - 1;
[photoBroseView show]; [photoBroseView show];
} }
} }
......
...@@ -18,4 +18,9 @@ ...@@ -18,4 +18,9 @@
*/ */
@property (nonatomic, assign) BOOL isBackRootVc; @property (nonatomic, assign) BOOL isBackRootVc;
/**
是否是临时任务
*/
@property (nonatomic, assign) BOOL isTempTask;
@end @end
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
#pragma mark -UI #pragma mark -UI
- (void)uiConfigAction - (void)uiConfigAction
{ {
self.title = @"VI检查"; self.title = @"VI检查任务";
self.collectionFlowLayout.itemSize = CGSizeMake((ScreenSize.width-30)/2.0, 130); self.collectionFlowLayout.itemSize = CGSizeMake((ScreenSize.width-30)/2.0, 130);
self.collectionFlowLayout.sectionInset = UIEdgeInsetsMake(5, 10, 5, 10); self.collectionFlowLayout.sectionInset = UIEdgeInsetsMake(5, 10, 5, 10);
self.collectionFlowLayout.minimumLineSpacing = 10; self.collectionFlowLayout.minimumLineSpacing = 10;
...@@ -217,6 +217,7 @@ ...@@ -217,6 +217,7 @@
if (!_queryPlanModel) { if (!_queryPlanModel) {
_queryPlanModel = [[ParametersModel alloc]init]; _queryPlanModel = [[ParametersModel alloc]init];
_queryPlanModel.pageSize = PAGESIZE; _queryPlanModel.pageSize = PAGESIZE;
_queryPlanModel.isTemp = self.isTempTask ? @"true" : @"false";
_queryPlanModel.pageNumber = self.pullPageIndex; _queryPlanModel.pageNumber = self.pullPageIndex;
InspectQuickLookQuery *conditions = [[InspectQuickLookQuery alloc]init]; InspectQuickLookQuery *conditions = [[InspectQuickLookQuery alloc]init];
conditions.field = @"beginDate"; conditions.field = @"beginDate";
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
[super viewDidLoad]; [super viewDidLoad];
[self addStoreChildVc]; [self addStoreChildVc];
self.title = @"临时检查"; [self addHistoryButtonItem];
kUser.f_user_uuid = @"8a2eb8135ce33bdd015d07a2cb10018d"; self.title = @"临时VI检查";
} }
#pragma mark -布局完成 #pragma mark -布局完成
...@@ -52,6 +52,19 @@ ...@@ -52,6 +52,19 @@
self.storeDetailVc.view.frame = self.contentBgView.bounds; self.storeDetailVc.view.frame = self.contentBgView.bounds;
} }
#pragma mark -添加历史按钮
- (void)addHistoryButtonItem
{
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"历史" style:UIBarButtonItemStyleDone target:self action:@selector(historyButtonItemAction)];
}
#pragma mark -临时检查历史
- (void)historyButtonItemAction {
PatrolTaskViewController *patrolTask = [PatrolTaskViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_PATROLINSPECT];
patrolTask.isTempTask = YES;
[self PushViewController:patrolTask animated:YES];
}
#pragma mark -添加油站列表控制器 #pragma mark -添加油站列表控制器
- (void)addStoreChildVc - (void)addStoreChildVc
{ {
...@@ -81,7 +94,7 @@ ...@@ -81,7 +94,7 @@
ShowAlertView(@"提示", @"您确定对此门店发起VI临时检查任务吗?", @[@"取消",@"确认"], UIAlertControllerStyleAlert, ^(NSInteger index) { ShowAlertView(@"提示", @"您确定对此门店发起VI临时检查任务吗?", @[@"取消",@"确认"], UIAlertControllerStyleAlert, ^(NSInteger index) {
if (index == ONE) { if (index == ONE) {
[IBTLoadingView showProgressLabel:@"加载中"]; [IBTLoadingView showProgressLabel:@"加载中"];
[RequestManager request_CreatePatrolTempCheck:self.selectedStoreModel.uuid success:^(id returnValue) { [RequestManager request_CreatePatrolTempCheck:weakSelf.selectedStoreModel.uuid success:^(id returnValue) {
[IBTLoadingView hideHUDWithText:nil]; [IBTLoadingView hideHUDWithText:nil];
if ([ BaseViewModel verifyData:returnValue]) { if ([ BaseViewModel verifyData:returnValue]) {
[IBTLoadingView showTextOnly:@"生成VI临时VI检查任务成功"]; [IBTLoadingView showTextOnly:@"生成VI临时VI检查任务成功"];
...@@ -90,14 +103,14 @@ ...@@ -90,14 +103,14 @@
PatrolTaskCustomModel *customModel = [PatrolTaskCustomModel new]; PatrolTaskCustomModel *customModel = [PatrolTaskCustomModel new];
customModel.uuid = detail.uuid; customModel.uuid = detail.uuid;
Results *result = [Results new]; Results *result = [Results new];
result.store_uuid = self.selectedStoreModel.uuid; result.store_uuid = weakSelf.selectedStoreModel.uuid;
PatrolExamViewController *examVC = [PatrolExamViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_PATROLINSPECT]; PatrolExamViewController *examVC = [PatrolExamViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_PATROLINSPECT];
PatrolExamViewModel *viewVM = [PatrolExamViewModel new]; PatrolExamViewModel *viewVM = [PatrolExamViewModel new];
viewVM.storeResult = result; viewVM.storeResult = result;
viewVM.plan = customModel; viewVM.plan = customModel;
examVC.viewModel = viewVM; examVC.viewModel = viewVM;
examVC.isBackRootVc = YES; examVC.isBackRootVc = YES;
[self pushViewController:examVC animated:YES]; [weakSelf pushViewController:examVC animated:YES];
}); });
}else { }else {
[IBTLoadingView showTextOnly:[BaseViewModel messageData:returnValue]]; [IBTLoadingView showTextOnly:[BaseViewModel messageData:returnValue]];
......
...@@ -23,12 +23,34 @@ ...@@ -23,12 +23,34 @@
self.labelPosision.text = viewModel.inspector.store_name; self.labelPosision.text = viewModel.inspector.store_name;
self.labelTime.text = [self configTimeBegin:viewModel.detail.beginDate end:viewModel.detail.endDate]; self.labelTime.text = [self configTimeBegin:viewModel.detail.beginDate end:viewModel.detail.endDate];
self.labelTitle.text = viewModel.plan.name; self.labelTitle.text = viewModel.plan.name;
self.labelProgress.text = [NSString stringWithFormat:@"%lu/%lu",viewModel.dicAnswers.count, viewModel.detail.questions.count];
self.labelState.text = viewModel.state.text; self.labelState.text = viewModel.state.text;
NSMutableArray *answerArray = [NSMutableArray array];
for (id object in viewModel.dicAnswers.allValues) {
if ([object isKindOfClass:[ZJPatrolDetail_results_answers class]]) {
ZJPatrolDetail_results_answers *answer = (ZJPatrolDetail_results_answers *)object;
if (answer.details.count) {
[answerArray addObject:@1];
}
}
}
self.labelProgress.text = [NSString stringWithFormat:@"%lu/%lu",answerArray.count, viewModel.detail.questions.count];
} }
- (NSString *)configTimeBegin:(NSString *)begin end:(NSString *)end { - (NSString *)configTimeBegin:(NSString *)begin end:(NSString *)end {
return [NSString stringWithFormat:@"%@%@ ~ %@%@",@"起:",begin, @"止:",end]; return [NSString stringWithFormat:@"%@%@ ~ %@%@",@"起:",begin, @"止:",end];
} }
@end @end
...@@ -645,13 +645,7 @@ typedef enum : NSUInteger { ...@@ -645,13 +645,7 @@ typedef enum : NSUInteger {
#pragma mark -友好界面 #pragma mark -友好界面
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
{ {
return KNODATAIMAGE; return [UIImage imageNamed:@"no_data"];
}
- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
{
NSDictionary *attributes = @{NSFontAttributeName: [UIFont boldSystemFontOfSize:15.0f], NSForegroundColorAttributeName: [UIColor darkGrayColor]};
return [[NSAttributedString alloc]initWithString:@"暂无数据" attributes:attributes];
} }
- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView - (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView
......
...@@ -453,17 +453,20 @@ ...@@ -453,17 +453,20 @@
#pragma mark -不同的类调用筛选,排序字段不同(在此区分) #pragma mark -不同的类调用筛选,排序字段不同(在此区分)
- (NSArray *)distinguishClassSorts { - (NSArray *)distinguishClassSorts {
NSArray *sorts = nil; NSArray *sorts = nil;
if ([self.classVc isKindOfClass:[PatrolTaskViewController class]]) { if ([self.classVc isKindOfClass:[PatrolTaskViewController class]] || [self.classVc isKindOfClass:[InspectionTableViewController class]]) {
sorts = @[@{@"name":@"任务创建时间降序",@"uuid":@"beginDate,desc"}, sorts = @[@{@"name":@"任务创建时间降序",@"uuid":@"beginDate,desc"},
@{@"name":@"任务创建时间升序",@"uuid":@"beginDate,asc"}, @{@"name":@"任务创建时间升序",@"uuid":@"beginDate,asc"},
@{@"name":@"任务最后修改时间降序",@"uuid":@"lastModifyInfo,desc"}, @{@"name":@"任务最后修改时间降序",@"uuid":@"lastModifyInfo,desc"},
@{@"name":@"任务最后修改时间升序",@"uuid":@"lastModifyInfo,asc"}]; @{@"name":@"任务最后修改时间升序",@"uuid":@"lastModifyInfo,asc"}];
}else if ([self.classVc isKindOfClass:[InspectionTableViewController class]]) {
sorts = @[@{@"name":@"任务创建时间降序",@"uuid":@"beginTime,desc"},
@{@"name":@"任务创建时间升序",@"uuid":@"beginTime,asc"},
@{@"name":@"按截止日期降序",@"uuid":@"endTime,desc"},
@{@"name":@"按截止日期升序",@"uuid":@"endTime,asc"}];
} }
/*
else if ([self.classVc isKindOfClass:[InspectionTableViewController class]]) {
sorts = @[@{@"name":@"任务创建时间降序",@"uuid":@"beginTime,desc"},
@{@"name":@"任务创建时间升序",@"uuid":@"beginTime,asc"},
@{@"name":@"按截止日期降序",@"uuid":@"endTime,desc"},
@{@"name":@"按截止日期升序",@"uuid":@"endTime,asc"}];
}
*/
return sorts; return sorts;
} }
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
if (boolValue) { if (boolValue) {
return string; return string;
} }
NSArray *baseUrl = [HTTP_LOCAL_BASE_URL componentsSeparatedByString:@"total-server/rest/"]; NSString *urlString = [NSString stringWithFormat:@"%@%@",HTTP_LOCAL_BASE_URL,string];
NSString *urlString = [NSString stringWithFormat:@"%@%@",baseUrl.firstObject,string];
return urlString; return urlString;
} }
......
...@@ -18,8 +18,14 @@ UICollectionViewDataSource,DBCameraViewControllerDelegate> ...@@ -18,8 +18,14 @@ UICollectionViewDataSource,DBCameraViewControllerDelegate>
@property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *layOut; @property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *layOut;
@property (weak, nonatomic) UIViewController *vc; @property (weak, nonatomic) UIViewController *vc;
@property (strong, nonatomic) PicViewModel *viewModel; @property (strong, nonatomic) PicViewModel *viewModel;
/**
水印文字
*/
@property (nonatomic, copy) NSString *remarkString;
/** 是否显示添加按钮 */ /** 是否显示添加按钮 */
@property (nonatomic, copy) repairBlock blockReloadData; @property (nonatomic, copy) repairBlock blockReloadData;
- (void)configCellWithViewModel:(PicViewModel *)viewModel indexPath:(NSIndexPath *)indexPath target:(UIViewController *)target; - (void)configCellWithViewModel:(PicViewModel *)viewModel indexPath:(NSIndexPath *)indexPath target:(UIViewController *)target remarkString:(NSString *)remarkString;
- (void)pushImagePickerController; - (void)pushImagePickerController;
@end @end
...@@ -25,15 +25,15 @@ ...@@ -25,15 +25,15 @@
// Initialization code // Initialization code
} }
- (void)configCellWithViewModel:(PicViewModel *)viewModel indexPath:(NSIndexPath *)indexPath target:(UIViewController *)target { - (void)configCellWithViewModel:(PicViewModel *)viewModel indexPath:(NSIndexPath *)indexPath target:(UIViewController *)target remarkString:(NSString *)remarkString {
self.vc = target; self.vc = target;
self.viewModel = viewModel; self.viewModel = viewModel;
self.remarkString = remarkString;
//如果是只读的,则直接刷新。 //如果是只读的,则直接刷新。
if (self.viewModel.type == kPicCellTypeRead) { if (self.viewModel.type == kPicCellTypeRead) {
[self.collectionView reloadData]; [self.collectionView reloadData];
return; return;
} }
//非只读情况,则是添加或者编辑 //非只读情况,则是添加或者编辑
if (self.viewModel.arrPics.count == self.viewModel.maxPictureNumber) { if (self.viewModel.arrPics.count == self.viewModel.maxPictureNumber) {
self.viewModel.type = kPicCellTypeEdit; self.viewModel.type = kPicCellTypeEdit;
...@@ -121,9 +121,9 @@ ...@@ -121,9 +121,9 @@
return; return;
} }
UIImage *newImage = [image rescaleImageToSize:CGSizeMake(ScreenSize.width, ScreenSize.width * 4 / 3)]; UIImage *newImage = [image rescaleImageToSize:CGSizeMake(ScreenSize.width, ScreenSize.width * 4 / 3)];
NSString *string = [NSString stringWithFormat:@"%@-%@",kUser.f_user_name,[[NSDate date] httpParameterString]]; // NSString *string = [NSString stringWithFormat:@"%@ %@",kUser.f_user_name,[[NSDate date] httpParameterString]];
NSDictionary *fontDict = @{NSForegroundColorAttributeName:[UIColor yellowColor],NSFontAttributeName:[UIFont systemFontOfSize:17]}; NSDictionary *fontDict = @{NSForegroundColorAttributeName:[UIColor yellowColor],NSFontAttributeName:[UIFont systemFontOfSize:17]};
UIImage *waterImage = [newImage imageWaterMarkWithString:string point:CGPointMake(20, newImage.size.height - 20) attribute:fontDict]; UIImage *waterImage = [newImage imageWaterMarkWithString:self.remarkString point:CGPointMake(20, newImage.size.height - 20) attribute:fontDict];
NSString *imageName = [self saveImageToLocal:waterImage]; NSString *imageName = [self saveImageToLocal:waterImage];
[self.viewModel.arrPics addObject:imageName]; [self.viewModel.arrPics addObject:imageName];
self.blockReloadData(); self.blockReloadData();
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"resizing" : {
"mode" : "9-part",
"center" : {
"mode" : "tile",
"width" : 1,
"height" : 1
},
"cap-insets" : {
"bottom" : 35,
"top" : 34,
"right" : 8,
"left" : 8
}
},
"idiom" : "universal",
"filename" : "patrol_exam_btn_bg_red@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "patrol_exam_camera.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "patrol_exam_camera_gray.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "patrol_exam_camera_red@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "patrol_exam_camera_red@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.2.12</string> <string>1.3.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.2.12</string> <string>1.3.0</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
......
...@@ -519,6 +519,7 @@ acceptTypeJson:(BOOL)bAcceptJson ...@@ -519,6 +519,7 @@ acceptTypeJson:(BOOL)bAcceptJson
}; };
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kGTOHTTP_UserLogin] stringByAppendingFormat:@"/%@", nsUserName]; NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kGTOHTTP_UserLogin] stringByAppendingFormat:@"/%@", nsUserName];
NSLog(@"%@",urlStr);
[self POST:urlStr [self POST:urlStr
parameters:dictParametes parameters:dictParametes
needToken:NO needToken:NO
......
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