Commit dc78c1b6 authored by Sandy's avatar Sandy

发运单收货状态可保存数据

parent 70926883
...@@ -4432,7 +4432,7 @@ ...@@ -4432,7 +4432,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.xffruit; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.xffruit;
PRODUCT_NAME = XFFruit; PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "e2cec26c-3666-4512-9b9a-cdb4cd9da56d";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**"; USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
}; };
name = Debug; name = Debug;
...@@ -4457,7 +4457,7 @@ ...@@ -4457,7 +4457,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.xffruit; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.xffruit;
PRODUCT_NAME = XFFruit; PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "e2cec26c-3666-4512-9b9a-cdb4cd9da56d";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**"; USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
}; };
name = Release; name = Release;
......
...@@ -29,7 +29,6 @@ typedef enum : NSUInteger { ...@@ -29,7 +29,6 @@ typedef enum : NSUInteger {
SureTag, //确定 SureTag, //确定
SaveTag, //收货状态:保存 SaveTag, //收货状态:保存
ReceiveTag,//收货状态:收货 ReceiveTag,//收货状态:收货
AbortTag//收货状态:作废
} BtnTag; } BtnTag;
@interface PurchaseDetailViewController ()<UIAlertViewDelegate> @interface PurchaseDetailViewController ()<UIAlertViewDelegate>
...@@ -243,7 +242,7 @@ typedef enum : NSUInteger { ...@@ -243,7 +242,7 @@ typedef enum : NSUInteger {
} }
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_WAITE_RECIEVE]){ }else if ([self.bill.state isEqualToString:PURCHASE_STATE_WAITE_RECIEVE]){
if ([IBTCommon checkIsPermission:RECEIVE_ACTION_RECEIVE]) { if ([IBTCommon checkIsPermission:RECEIVE_ACTION_RECEIVE]) {
[self createBtnWithArr:@[@"作废",@"收货"]]; [self createBtnWithArr:@[@"保存",@"收货"]];
}else{ }else{
[self hiddenTwoBtn]; [self hiddenTwoBtn];
} }
...@@ -331,10 +330,9 @@ typedef enum : NSUInteger { ...@@ -331,10 +330,9 @@ typedef enum : NSUInteger {
break; break;
case SaveTag: case SaveTag:
{ {
// if ([self checkReceive]) { if ([self checkReceive]) {
// self.state = RECEIVE_STATE_SAVE; [self httpSave];
// [self getDataFromServer:RECEIVE_STATE_SAVE msg:@"正在保存..."]; }
// }
} }
break; break;
case ReceiveTag:{ case ReceiveTag:{
...@@ -344,15 +342,6 @@ typedef enum : NSUInteger { ...@@ -344,15 +342,6 @@ typedef enum : NSUInteger {
alertView.tag = ReceiveTag; alertView.tag = ReceiveTag;
[alertView show]; [alertView show];
} }
}
break;
case AbortTag:
{
// CLog(@"作废");
// UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:@"请确认作废" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil];
// alertView.delegate = self;
// alertView.tag = AbortTag;
// [alertView show];
} }
break; break;
default: default:
...@@ -551,7 +540,8 @@ typedef enum : NSUInteger { ...@@ -551,7 +540,8 @@ typedef enum : NSUInteger {
[p setValuesForKeysWithDictionary:billDict]; [p setValuesForKeysWithDictionary:billDict];
billProbuct.purchasePdt = p; billProbuct.purchasePdt = p;
if ([self.bill.state isEqualToString:PURCHASE_STATE_WAITE_RECIEVE]) { //待收货并且已收货数小于1的时候才可以显示默认值
if ([self.bill.state isEqualToString:PURCHASE_STATE_WAITE_RECIEVE] && billProbuct.rctQty.floatValue < 1) {
if (self.isCenter) { if (self.isCenter) {
[billProbuct z_setRctQty:p.qty.floatValue]; [billProbuct z_setRctQty:p.qty.floatValue];
...@@ -631,10 +621,6 @@ typedef enum : NSUInteger { ...@@ -631,10 +621,6 @@ typedef enum : NSUInteger {
if (buttonIndex == 1) { if (buttonIndex == 1) {
[self dealByAction:PURCHASE_ACTION_APPROVE]; [self dealByAction:PURCHASE_ACTION_APPROVE];
} }
}else if (alertView.tag == AbortTag) {
if (buttonIndex == 1) {
[self dealByAction:TRANSFER_STATE_ABORTED];//作废
}
}else if(alertView.tag == ReceiveTag){ }else if(alertView.tag == ReceiveTag){
if (buttonIndex == 1) { if (buttonIndex == 1) {
// //提交 // //提交
...@@ -701,6 +687,46 @@ typedef enum : NSUInteger { ...@@ -701,6 +687,46 @@ typedef enum : NSUInteger {
[self PushViewController:nvc animated:YES]; [self PushViewController:nvc animated:YES];
} }
- (void)httpSave {
//保存
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"];
if (success == 1) {
//成功
[IBTLoadingView showTips:@" 保存成功! "];
[self PopViewControllerAnimated:YES];
}else{
[IBTLoadingView showTips:message];
}
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
NSMutableDictionary *param = [self.bill dictForCommit].mutableCopy;
NSMutableArray *arrProduct = [NSMutableArray array];
for (TransferPdtDetail *pdt in _pvc.productArr) {
PurchaseBillProduct *pPdt = [pdt changeToPurchasePdt];
NSDictionary *dict = [pPdt dictForCommit];
[arrProduct addObject:dict];
}
[param setObject:arrProduct forKey:@"products"];
[param setObject:self.bill.accountDetails forKey:@"accountDetails"];
[IBTLoadingView showProgressLabel:@"保存..."];
[[ICRHTTPController sharedController] savePurchaseWithData:param success:succ failure:fail];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
......
...@@ -27,6 +27,7 @@ typedef enum : NSUInteger { ...@@ -27,6 +27,7 @@ typedef enum : NSUInteger {
EndTag, EndTag,
SubmitTag, SubmitTag,
ReceiveTag,//收货状态:收货 ReceiveTag,//收货状态:收货
SaveTag
} BtnTag; } BtnTag;
@interface TransportDetailViewController () @interface TransportDetailViewController ()
...@@ -290,15 +291,10 @@ typedef enum : NSUInteger { ...@@ -290,15 +291,10 @@ typedef enum : NSUInteger {
[alertView show]; [alertView show];
} }
break; break;
case ReceiveTag:
{
if ([self checkReceive]) {
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:@"收货后不能重复收货,请确认是否要收货?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil];
alertView.delegate = self;
alertView.tag = ReceiveTag;
[alertView show];
}
case SaveTag:
{
[self httpSave];
} }
break; break;
default: default:
...@@ -351,6 +347,8 @@ typedef enum : NSUInteger { ...@@ -351,6 +347,8 @@ typedef enum : NSUInteger {
btnTag = SubmitTag; btnTag = SubmitTag;
}else if([arr[i] isEqualToString:@"收货"]){ }else if([arr[i] isEqualToString:@"收货"]){
btnTag = ReceiveTag; btnTag = ReceiveTag;
}else if ([arr[i] isEqualToString:@"保存"]){
btnTag = SaveTag;
} }
CGRect btnFrame = CGRectMake(LeftMargin + (LeftMargin + btnWidth)*i, ScreenSize.height - 64 - BottomHeight +5, btnWidth, 40); CGRect btnFrame = CGRectMake(LeftMargin + (LeftMargin + btnWidth)*i, ScreenSize.height - 64 - BottomHeight +5, btnWidth, 40);
UIButton *perBtn = [IBTCustomButtom creatButtonWithFrame:btnFrame target:self sel:@selector(btnClick:) tag:btnTag image:nil title:arr[i] titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_COMMIT_COLOR]; UIButton *perBtn = [IBTCustomButtom creatButtonWithFrame:btnFrame target:self sel:@selector(btnClick:) tag:btnTag image:nil title:arr[i] titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_COMMIT_COLOR];
...@@ -405,7 +403,7 @@ typedef enum : NSUInteger { ...@@ -405,7 +403,7 @@ typedef enum : NSUInteger {
} }
}else if ([self.transport.state isEqualToString:TRANSPORT_STATE_UNRECEIVED] && !self.isWms){ }else if ([self.transport.state isEqualToString:TRANSPORT_STATE_UNRECEIVED] && !self.isWms){
[self createBtnWithArr:@[@"收货"]]; [self createBtnWithArr:@[@"保存",@"收货"]];
}else{ }else{
[self hiddenAllBtn]; [self hiddenAllBtn];
...@@ -628,6 +626,46 @@ typedef enum : NSUInteger { ...@@ -628,6 +626,46 @@ typedef enum : NSUInteger {
}]; }];
} }
- (void)httpSave {
NSMutableDictionary *param = [self.transport dictForCommit].mutableCopy;
NSMutableArray *arrProduct = [NSMutableArray array];
for (TransferPdtDetail *pdt in _pvc.productArr) {
TransportPdtDetail *pPdt = [pdt changeToTransportPdt];
NSDictionary *dict = [pPdt dictForCommit];
[arrProduct addObject:dict];
}
[param setObject:arrProduct forKey:@"pdtDetails"];
[param setObject:self.transport.accountDetails forKey:@"accountDetails"];
//保存
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"];
if (success == 1) {
//成功
[IBTLoadingView showTips:@" 保存成功! "];
[self PopViewControllerAnimated:YES];
}else{
[IBTLoadingView showTips:message];
}
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[[ICRHTTPController sharedController] saveTransportWithData:param success:succ failure:fail];
}
- (BOOL)checkReceive{ - (BOOL)checkReceive{
for (NSString *isEdit in _pvc.defaultState) { for (NSString *isEdit in _pvc.defaultState) {
if ([isEdit isEqualToString:@"NO"]) { if ([isEdit isEqualToString:@"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