Commit ee7d5b24 authored by Sandy's avatar Sandy

增加许可证关闭功能、已过期状态筛选

parent 417ac082
......@@ -32,25 +32,31 @@
// Do any additional setup after loading the view.
self.title = @"拓站信息";
[self initSubViews];
self.view.backgroundColor = [UIColor whiteColor];
}
- (void)initSubViews {
CGFloat latitude = [_d_pioneering.latitude floatValue];
CGFloat longitude = [_d_pioneering.longitude floatValue];
CGRect rect = CGRectMake(0, 0, self.view.width, 120);
CGRect rect = CGRectMake(0, 0, self.view.width, 100);
GTOPioneeringAddressInfoView *addressInfo = [[GTOPioneeringAddressInfoView alloc]initWithFrame:rect];
[addressInfo updateWithPioneering:_d_pioneering];
[self.view addSubview:addressInfo];
IBTUILabel *locationLbl = [[IBTUILabel alloc]initWithFrame:CGRectMake(10, addressInfo.bottom + 10, 100, 20) text:@"签到位置" font:[UIFont systemFontOfSize:19] tintColor:GTO_BLUE_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
IBTUILabel *locationLbl = [[IBTUILabel alloc]initWithFrame:CGRectMake(17, addressInfo.bottom + 10, 100, 20) text:@"签到位置" font:[UIFont systemFontOfSize:19] tintColor:GTO_BLUE_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
[locationLbl sizeToFit];
IBTUILabel *locationValueLbl = [[IBTUILabel alloc]initWithFrame:CGRectMake(self.view.width - 185, locationLbl.y,180, locationLbl.height) text:[NSString stringWithFormat:@"坐标(%.6f,%.6f)",latitude,longitude] font:[UIFont systemFontOfSize:17] tintColor:[UIColor blackColor] backgroundColor:nil textAlignment:NSTextAlignmentRight]; //_d_pioneering.longitude,_d_pioneering.latitude
IBTUILabel *locationValueLbl = [[IBTUILabel alloc]initWithFrame:CGRectMake(locationLbl.right + 20, locationLbl.y,180, locationLbl.height) text:[NSString stringWithFormat:@"坐标(%.6f,%.6f)",latitude,longitude] font:[UIFont systemFontOfSize:17] tintColor:[UIColor blackColor] backgroundColor:nil textAlignment:NSTextAlignmentLeft]; //_d_pioneering.longitude,_d_pioneering.latitude
[locationValueLbl sizeToFit];
[self.view addSubview:locationLbl];
[self.view addSubview:locationValueLbl];
[locationValueLbl mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(locationLbl);
make.left.equalTo(locationLbl.mas_right).offset(10);
}];
rect = CGRectMake(0, locationValueLbl.bottom,self.view.width, self.view.height - locationValueLbl.bottom - 64 - BottomViewHeight - 20);
rect = CGRectMake(0, locationValueLbl.bottom + 10,self.view.width, self.view.height - locationValueLbl.bottom - 64 - BottomViewHeight - 20);
self.c_mapView = [[BMKMapView alloc]initWithFrame:rect];
[self.view addSubview:_c_mapView];
BMKPointAnnotation *pointAnnotation = [[BMKPointAnnotation alloc]init];
......@@ -64,7 +70,7 @@
_c_mapView.centerCoordinate = CLLocationCoordinate2DMake(latitude, longitude);
_c_mapView.zoomLevel = 17;
GXFBottomView *bottomV = [[GXFBottomView alloc]initOneButtonWithFrame:CGRectMake(0, _c_mapView.bottom +20, self.view.width, BottomViewHeight) buttonColor:GTO_RED_COLOR buttonTitle:@"返回"];
GXFBottomView *bottomV = [[GXFBottomView alloc]initOneButtonWithFrame:CGRectMake(0, _c_mapView.bottom +10, self.view.width, BottomViewHeight) buttonColor:GTO_BLUE_DEEP_COLOR buttonTitle:@"返回"];
bottomV.delegate = self;
[self.view addSubview:bottomV];
......
......@@ -983,7 +983,7 @@ UIAlertViewDelegate>
#pragma buttton Action
- (void)seeAddressClicked {
GTOPioneeringAddressInfoViewController *aVC = [[GTOPioneeringAddressInfoViewController alloc]initWithPioneering:_d_pioneering];
[self PushViewController:aVC animated:NO];
[self PushViewController:aVC animated:YES];
}
#pragma bottomViewDelegate
- (void)bottomView:(GXFBottomView *)bottomView oneButtonClicked:(UIButton *)oneBtn {
......
......@@ -37,7 +37,7 @@
- (void)initSubViews {
self.m_titleLabel = [[IBTUILabel alloc]initWithfont:[UIFont systemFontOfSize:20] tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
self.m_titleLabel = [[IBTUILabel alloc]initWithfont:[UIFont systemFontOfSize:17] tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
UIFont *font = [UIFont systemFontOfSize:17];
self.m_templateLabel = [[IBTUILabel alloc]initWithfont:font tintColor:GTO_GRAY_TINT_COLOR backgroundColor:nil textAlignment:NSTextAlignmentLeft];
......@@ -58,7 +58,7 @@
.origin.x = GTO_LEFT_PADDING,
.origin.y = GTO_TOP_VERTICAL_PADDING,
.size.width = SCREEN_SIZE.width - GTO_LEFT_PADDING,
.size.height = lblH + 10,
.size.height = lblH,
};
_m_templateLabel.frame = (CGRect){
.origin.x = _m_titleLabel.x,
......@@ -86,8 +86,9 @@
@implementation GTOPioneeringAddressInfoView (configure)
- (void)updateWithPioneering: (GTOPioneering *)pioneering
{
self.m_titleLabel.text = [NSString stringWithFormat:@"标题:%@ ",pioneering.title];
self.m_templateLabel.text = [NSString stringWithFormat:@"拓站人员:%@ ",pioneering.templateName];
self.m_titleLabel.text = [NSString stringWithFormat:@"拓站标题:%@ ",pioneering.title];
self.m_templateLabel.text = [NSString stringWithFormat:@"拓站人员:%@ ",
pioneering.pioneer_name];
self.m_beginDateLabel.text = [NSString stringWithFormat:@"开始时间:%@",pioneering.beginDate ];
self.m_remarkLabel.text = [NSString stringWithFormat:@"备注:%@",pioneering.remark];
......
......@@ -9,7 +9,7 @@
#import "GTOLiceneResultViewController.h"
#import "ICRAttachmentView.h"
#import "ICRQuestionHelperView.h"
#import "HttpRequestManager.h"
#import "GTOLicence.h"
#import "GTOAnswer.h"
......@@ -41,6 +41,7 @@
#define GXF_CONTENT_COLOR HexColor(@"444444")
#define KEY_IS_DISPLAY @"isDisplay"
typedef NS_ENUM(NSUInteger, bottomViewTag) {
kBottomViewOneSaveTag = 0,
kBottomViewTwoSaveSubmitTag,
......@@ -52,7 +53,8 @@ typedef NS_ENUM(NSUInteger, alertViewTag) {
kAlertViewSubmiteTag = 0,
kAlertViewApprovedTag,
kAlertViewRejectedTag,
kAlertViewAskForApprove
kAlertViewAskForApprove,
kAlertViewClose
};
static NSString *cellID = @"cellID";
//只有标题
......@@ -173,7 +175,7 @@ static NSString *headerProblemItemID = @"headerItem";
}
}
CGRect rect = CGRectMake(0, _c_tableView.bottom, self.view.width, 40);
CGRect rect = CGRectMake(0, _c_tableView.bottom, self.view.width, 60);
GXFBottomView *bottomV;
//判断是否在时间区间内
......@@ -193,11 +195,11 @@ static NSString *headerProblemItemID = @"headerItem";
if (displayR.arrAnswers.count != displayR.arrQuestions.count) noFinishNumber++;
}
if (noFinishNumber > 0) {
bottomV = [[GXFBottomView alloc] initOneButtonWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, 40) buttonColor:GTO_BLUE_DEEP_COLOR buttonTitle:@"返回"];
bottomV = [[GXFBottomView alloc] initOneButtonWithFrame:rect buttonColor:GTO_BLUE_DEEP_COLOR buttonTitle:@"返回"];
bottomV.tag = kBottomViewOneBackTag;
} else {
bottomV = [[GXFBottomView alloc] initWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, 40)
bottomV = [[GXFBottomView alloc] initWithFrame:rect
leftButtonColor:GTO_BLUE_DEEP_COLOR
rightButtonColor:GTO_RED_COLOR
LeftBtnTitle:@"保存"
......@@ -209,7 +211,7 @@ static NSString *headerProblemItemID = @"headerItem";
bottomV = [[GXFBottomView alloc] initOneButtonWithFrame:rect buttonColor:GTO_RED_COLOR buttonTitle:@"申请审批"];
bottomV.tag = kBOttomViewAskForApprove;
}else if (isAskForApprove) {
bottomV = [[GXFBottomView alloc] initWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, 40)
bottomV = [[GXFBottomView alloc] initWithFrame:rect
leftButtonColor:GTO_BLUE_DEEP_COLOR
rightButtonColor:GTO_RED_COLOR
LeftBtnTitle:@"审批拒绝"
......@@ -220,6 +222,16 @@ static NSString *headerProblemItemID = @"headerItem";
bottomV = [[GXFBottomView alloc] initOneButtonWithFrame:rect buttonColor:GTO_BLUE_DEEP_COLOR buttonTitle:@"返 回"];
bottomV.tag = kBottomViewOneBackTag;
}
//这三种状态有权限的时候添加关闭按钮
if ([_d_licence.state isEqualToString:GTO_LICENCE__STATE_APPROVED] ||
[_d_licence.state isEqualToString:GTO_LICENCE__STATE_ASKFORAPPROVE] ||
[_d_licence.state isEqualToString:GTO_LICENCE__STATE_SUBMITTED]) {
if ([GTOCommonTools hasPermissionWithPermissionId:500406]) {
[bottomV addCloseButton];
}
}
bottomV.backgroundColor = XXFBgColor;
bottomV.delegate = self;
[self.view addSubview:bottomV];
......@@ -1013,6 +1025,32 @@ static NSString *headerProblemItemID = @"headerItem";
}
}
//关闭许可证
- (void)bottomView:(GXFBottomView *)bottomView closeClicked:(UIButton *)oneBtn {
UIAlertView *alertV = [[UIAlertView alloc] initWithTitle:@"确定关闭许可证?" message:@"" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alertV.tag = kAlertViewClose;
[alertV show];
}
- (void)closeLicense {
[IBTLoadingView showProgressLabel:@"关闭中…"];
void (^success)(id data) = ^(id data) {
if ([data[@"success"] integerValue] == 1) {
[IBTLoadingView hideHUDWithText:nil];
[self localDelete];
[self PopViewControllerAnimated:YES];
} else {
[IBTLoadingView showTextOnly:data[@"message"] inView:self.view];
}
};
void (^failure)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
};
ICRHTTPController *httpCtrl = [ICRHTTPController sharedController];
[httpCtrl doLicenceAskForCloseWithLicenceUuid:_d_licence.uuid version:_d_licence.version success:success failure:failure];
}
- (void)modifyClicked:(UIButton *)btn
{
}
......@@ -1062,6 +1100,9 @@ static NSString *headerProblemItemID = @"headerItem";
case kAlertViewAskForApprove: {
[self httpAskForApproveLicense];
} break;
case kAlertViewClose:{
[self closeLicense];
}break;
default: break;
}
}
......
......@@ -323,7 +323,7 @@
}else if(indexPath.row == 5){
stateStr =GTO_LICENCE__STATE_REJECTED;
}else if(indexPath.row == 6){
stateStr = GTO_LICENCE__STATE_APPROVED;
stateStr = GTO_LICENCE__STATE_EXPIRED;
}else if(indexPath.row == 7){
stateStr =GTO_LICENCE__STATE_FINISHED;
}
......
......@@ -75,6 +75,8 @@ static NSString *cellID = @"licenceListCell";
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
_currentPage = 0;
[self getData];
// if (_d_currentLicence && [_d_currentLicence.state isEqualToString:GTO_LICENCE_STATE_INITIAL]) {
// [self p_addAlerInfoLicenceView];
// }
......
......@@ -14,13 +14,16 @@
- (void)bottomView:(GXFBottomView *)bottomView leftButtonClicked: (UIButton *)leftBtn;
- (void)bottomView:(GXFBottomView *)bottomView RightButtonClicked: (UIButton *)rightBtn;
- (void)bottomView:(GXFBottomView *)bottomView oneButtonClicked: (UIButton *)oneBtn;
- (void)bottomView:(GXFBottomView *)bottomView closeClicked: (UIButton *)oneBtn;
@end
@interface GXFBottomView : IBTUIView
typedef NS_ENUM(NSInteger, buttonTag){
leftTag = 1,
rightTag
rightTag,
buttonTagCloseTag
};
@property (nonatomic, weak) id<GXFBottomViewDelegate>delegate;
......@@ -40,4 +43,8 @@ typedef NS_ENUM(NSInteger, buttonTag){
- (instancetype)initOneButtonWithFrame:(CGRect)frame
buttonColor: (UIColor *)btnColor
buttonTitle: (NSString *)title;
/**
* 增加关闭按钮(必须在已经初始化之后调用)
*/
- (void)addCloseButton;
@end
......@@ -75,6 +75,35 @@
}
- (void)addCloseButton {
//获取到所有的按钮
NSMutableArray *arrBtns = [NSMutableArray array];
for (id obj in self.subviews) {
if ([obj isKindOfClass:[UIButton class]]) {
[arrBtns addObject:obj];
}
}
//原有按钮数量 + 1(关闭按钮)
NSInteger counts = arrBtns.count + 1;
CGFloat width = (ScreenSize.width - (counts + 1) * LEFT_PADDING) / counts;
for (NSInteger i = 0; i < arrBtns.count; i++) {
UIButton *btn = arrBtns[i];
btn.frame = CGRectMake(LEFT_PADDING + i * (LEFT_PADDING + width), TOP_PADDING, width, BUTTON_HEIGHT);
}
CGRect rect = CGRectMake(LEFT_PADDING + arrBtns.count * (LEFT_PADDING + width), TOP_PADDING, width, BUTTON_HEIGHT);
UIButton *closeBtn = [IBTCustomButtom creatButtonWithFrame:rect target:self sel:@selector(actionClose:) tag:buttonTagCloseTag image:nil title:@"关闭" titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:GTO_RED_COLOR];
[self addSubview:closeBtn];
}
- (void)actionClose:(UIButton *)btn {
if ([_delegate respondsToSelector:@selector(bottomView:closeClicked:)]) {
[_delegate bottomView:self closeClicked:btn];
}
}
- (instancetype)initOneButtonWithFrame:(CGRect)frame buttonColor:(UIColor *)btnColor buttonTitle:(NSString *)title {
self = [super initWithFrame:frame];
if (!self) {
......
......@@ -138,6 +138,11 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
version: (NSInteger)version
success:(void (^)(id))succ
failure:(void (^)(id))fail;
// 关闭许可证
- (void)doLicenceAskForCloseWithLicenceUuid:(NSString *)licenceUuid
version: (NSInteger)version
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//5.8许可证操作日志列表(读)
- (void)getLicenceGet_logsWithLicenceUuid:(NSString *)licenceUuid
success:(void (^)(id))succ
......
......@@ -83,6 +83,7 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
kGTOHTTP_LicenceReject,
kGTOHTTP_LicenceApprove,
kGTOHTTP_LicenceAskForApprove,
kGTOHTTP_LicenceClose,
kGTOHTTP_LicenceGetLogs,
//6.1 保存拓站(写)
kGTOHTTP_PioneeringSaveResult,
......@@ -173,6 +174,7 @@ static NSString * const ICRHTTPInterface[] = {
[kGTOHTTP_LicenceReject] = @"licence/reject",
[kGTOHTTP_LicenceApprove] = @"licence/approve",
[kGTOHTTP_LicenceAskForApprove] = @"licence/askforapprove",
[kGTOHTTP_LicenceClose] = @"licence/finish",
[kGTOHTTP_LicenceGetLogs] = @"licence/get_logs",
//6.1 保存拓站(写)
......@@ -1039,6 +1041,18 @@ acceptTypeJson:YES
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self p_doPostActionWithEncodeURL:encodeUrlStr data:nil success:succ failure:fail];
}
- (void)doLicenceAskForCloseWithLicenceUuid:(NSString *)licenceUuid
version: (NSInteger)version
success:(void (^)(id))succ
failure:(void (^)(id))fail {
ICRUserUtil *userU = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kGTOHTTP_LicenceClose] stringByAppendingFormat:@"/%@?version=%ld&time=%@&operId=%@&operName=%@",licenceUuid,version,[[NSDate date] httpParameterString],userU.f_user_code,userU.f_user_name];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self p_doPostActionWithEncodeURL:encodeUrlStr data:nil success:succ failure:fail];
}
//5.8许可证操作日志列表(读)
- (void)getLicenceGet_logsWithLicenceUuid:(NSString *)licenceUuid
success:(void (^)(id))succ
......
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