Commit 2f49dc76 authored by Achilles's avatar Achilles

确认 拒绝调试

parent 879faa5f
......@@ -28,13 +28,20 @@
User *curUser = [[VankeCommonModel sharedInstance] currentUser];
NSString *url = [NSString stringWithFormat:@"/statement/confirm"];
NSDictionary *operator = [NSDictionary dictionaryWithObjectsAndKeys:
curUser.uuid, @"operId",
curUser.name, @"operName",
nil];
NSDictionary *operInfo = [NSDictionary dictionaryWithObjectsAndKeys:
operTime, @"time",
operator, @"operator",
nil];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
self.contract, @"contract",
self.settle, @"settle",
@"confirmed", @"state",
operTime, @"time",
curUser.uuid, @"operId",
curUser.name, @"operName",
operInfo, @"operInfo",
nil];
NSString *postData = [VankeUtil dictToJsonString: dict];
[self http_post: url].BODY(postData).TIMEOUT(10);
......
......@@ -28,14 +28,21 @@
User *curUser = [[VankeCommonModel sharedInstance] currentUser];
NSString *url = [NSString stringWithFormat:@"/statement/confirm"];
NSDictionary *operator = [NSDictionary dictionaryWithObjectsAndKeys:
curUser.uuid, @"operId",
curUser.name, @"operName",
nil];
NSDictionary *operInfo = [NSDictionary dictionaryWithObjectsAndKeys:
operTime, @"time",
operator, @"operator",
nil];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
self.contract, @"contract",
self.settle, @"settle",
@"rejected", @"state",
_message, @"message",
operTime, @"time",
curUser.uuid, @"operId",
curUser.name, @"operName",
operInfo, @"operInfo",
nil];
NSString *postData = [VankeUtil dictToJsonString: dict];
......
......@@ -29,6 +29,11 @@
// 最后一次响应结果
@property (nonatomic, strong) StatementListResponse *lastResp;
/**
* reload current page
*/
-(void) reload;
@end
......@@ -38,6 +38,15 @@
#pragma mark - paging query
-(void) reload {
if ( self.shops.count )
{
[self gotoPage:(self.shops.count / PAGE_SIZE )];
} else {
[self firstPage];
}
}
- (void)firstPage
{
[self gotoPage:1];
......
......@@ -120,7 +120,7 @@ ON_NOTIFICATION3( VankeLoginBoard_iPhone, SUCC_LOGIN, notification )
[UIView beginAnimations:HideLoginViewAnimationName context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve: UIViewAnimationCurveEaseOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
[UIView setAnimationDelegate:self];
[UIView commitAnimations];
......
......@@ -25,6 +25,9 @@
@interface VankeStatementDetailListBoard_iPhone : VankeBaseBoard
// 单据状态发生变化的通知
AS_NOTIFICATION( STATE_CHANGED )
AS_MODEL( VankeStatementSubjectListModel, model )
AS_OUTLET( BeeUIScrollView, list )
AS_OUTLET( VankeStatementDetailMonthCell_iPhone, settlementBar)
......
......@@ -47,6 +47,8 @@ SUPPORT_RESOURCE_LOADING( YES )
@synthesize settleEquals = _settleEquals;
@synthesize contractEquals = _contractEquals;
DEF_NOTIFICATION( STATE_CHANGED )
DEF_MODEL( VankeStatementListModel, model )
DEF_OUTLET( BeeUIScrollView, list )
DEF_OUTLET( VankeStatementDetailMonthCell_iPhone, settlementBar)
......@@ -139,8 +141,8 @@ ON_SIGNAL3( VankeStatementSubjectListModel, RELOADED, signal )
if (nil != respData) {
self.title = [respData codeName];
$(self.settlementBar).DATA(respData);
$(self.imgState).DATA([NSString stringWithFormat:@"%@_big.png", _data.state]);
[self showOperButtons: [_data unconfirmed]];
$(self.imgState).DATA([NSString stringWithFormat:@"%@_big.png", respData.state]);
[self showOperButtons: [respData unconfirmed]];
}
}
......@@ -153,10 +155,11 @@ ON_SIGNAL3( VankeStatementConfirmModel, RELOADED, signal ) {
if (![confirmModel isOk]) {
NSString *msg = [NSString stringWithFormat:@"确认失败: %@", confirmModel.serverResp.message];
[GEToast showWithText:msg bottomOffset:50.0f duration:2.0f];
[GEToast showWithText:msg bottomOffset:60.0f duration:2.0f];
} else {
[GEToast showWithText:@"确认成功!" bottomOffset:50.0f duration:2.0f];
[GEToast showWithText:@"确认成功!" bottomOffset:60.0f duration:2.0f];
[self.model firstPage];
[self postNotification:self.STATE_CHANGED];
}
}
......@@ -166,12 +169,13 @@ ON_SIGNAL3( VankeStatementRejectModel, RELOADING, signal ) {
ON_SIGNAL3( VankeStatementRejectModel, RELOADED, signal ) {
[GEToast hideProgress];
if (![confirmModel isOk]) {
NSString *msg = [NSString stringWithFormat:@"拒绝失败: %@", confirmModel.serverResp.message];
[GEToast showWithText:msg bottomOffset:50.0f duration:2.0f];
if (![rejectModel isOk]) {
NSString *msg = [NSString stringWithFormat:@"拒绝失败: %@", rejectModel.serverResp.message];
[GEToast showWithText:msg bottomOffset:60.0f duration:2.0f];
} else {
[GEToast showWithText:@"拒绝成功!" bottomOffset:50.0f duration:2.0f];
[GEToast showWithText:@"拒绝成功!" bottomOffset:60.0f duration:2.0f];
[self.model firstPage];
[self postNotification:self.STATE_CHANGED];
}
}
......@@ -219,6 +223,9 @@ ON_SIGNAL3(VankeStatementDetailMonthCell_iPhone, pickerMask, signal) {
ON_SIGNAL3(VankeStatementDetailListBoard_iPhone, btnReject, signal) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"拒绝原因" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
UITextField *textField = [alert textFieldAtIndex:0];
textField.placeholder = @"请输入拒绝原因...";
// textField.borderStyle=UITextBorderStyleRoundedRect;
alert.tag = ALERT_REJECT_TAG;
[alert show];
}
......
......@@ -66,6 +66,7 @@ ON_CREATE_VIEWS( signal )
self.title = @"对账单";
[self initListAndModel];
// [self.searchBar setBarTintColor :[VankeUtil rgbStringToColor: @"246,246,246"]];
[self observeNotification:VankeStatementDetailListBoard_iPhone.STATE_CHANGED];
}
ON_DELETE_VIEWS( signal )
......@@ -183,6 +184,14 @@ ON_SIGNAL3(VankeStatementListItemCell_iPhone, mask, signal) {
[self.stack pushBoard:board animated:YES];
}
#pragma VankeStatementDetailListBoard_iPhone event
ON_NOTIFICATION3( VankeStatementDetailListBoard_iPhone, STATE_CHANGED, notification )
{
INFO(@"state changed");
[self.model reload];
}
#pragma private methods
-(void) initListAndModel {
......@@ -253,4 +262,5 @@ ON_SIGNAL3(VankeStatementListItemCell_iPhone, mask, signal) {
// _model.settleEquals = [df dateFromString:@"2015-10-11"];
}
@end
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