Commit 2f49dc76 authored by Achilles's avatar Achilles

确认 拒绝调试

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