Commit dc78c1b6 authored by Sandy's avatar Sandy

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

parent 70926883
......@@ -4432,7 +4432,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.xffruit;
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "e2cec26c-3666-4512-9b9a-cdb4cd9da56d";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Debug;
......@@ -4457,7 +4457,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.xffruit;
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "e2cec26c-3666-4512-9b9a-cdb4cd9da56d";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Release;
......
......@@ -29,7 +29,6 @@ typedef enum : NSUInteger {
SureTag, //确定
SaveTag, //收货状态:保存
ReceiveTag,//收货状态:收货
AbortTag//收货状态:作废
} BtnTag;
@interface PurchaseDetailViewController ()<UIAlertViewDelegate>
......@@ -243,7 +242,7 @@ typedef enum : NSUInteger {
}
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_WAITE_RECIEVE]){
if ([IBTCommon checkIsPermission:RECEIVE_ACTION_RECEIVE]) {
[self createBtnWithArr:@[@"作废",@"收货"]];
[self createBtnWithArr:@[@"保存",@"收货"]];
}else{
[self hiddenTwoBtn];
}
......@@ -331,10 +330,9 @@ typedef enum : NSUInteger {
break;
case SaveTag:
{
// if ([self checkReceive]) {
// self.state = RECEIVE_STATE_SAVE;
// [self getDataFromServer:RECEIVE_STATE_SAVE msg:@"正在保存..."];
// }
if ([self checkReceive]) {
[self httpSave];
}
}
break;
case ReceiveTag:{
......@@ -344,15 +342,6 @@ typedef enum : NSUInteger {
alertView.tag = ReceiveTag;
[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;
default:
......@@ -551,7 +540,8 @@ typedef enum : NSUInteger {
[p setValuesForKeysWithDictionary:billDict];
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) {
[billProbuct z_setRctQty:p.qty.floatValue];
......@@ -631,10 +621,6 @@ typedef enum : NSUInteger {
if (buttonIndex == 1) {
[self dealByAction:PURCHASE_ACTION_APPROVE];
}
}else if (alertView.tag == AbortTag) {
if (buttonIndex == 1) {
[self dealByAction:TRANSFER_STATE_ABORTED];//作废
}
}else if(alertView.tag == ReceiveTag){
if (buttonIndex == 1) {
// //提交
......@@ -701,6 +687,46 @@ typedef enum : NSUInteger {
[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 {
[super didReceiveMemoryWarning];
......
......@@ -27,6 +27,7 @@ typedef enum : NSUInteger {
EndTag,
SubmitTag,
ReceiveTag,//收货状态:收货
SaveTag
} BtnTag;
@interface TransportDetailViewController ()
......@@ -290,15 +291,10 @@ typedef enum : NSUInteger {
[alertView show];
}
break;
case ReceiveTag:
case SaveTag:
{
if ([self checkReceive]) {
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:@"收货后不能重复收货,请确认是否要收货?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil];
alertView.delegate = self;
alertView.tag = ReceiveTag;
[alertView show];
}
[self httpSave];
}
break;
default:
......@@ -351,6 +347,8 @@ typedef enum : NSUInteger {
btnTag = SubmitTag;
}else if([arr[i] isEqualToString:@"收货"]){
btnTag = ReceiveTag;
}else if ([arr[i] isEqualToString:@"保存"]){
btnTag = SaveTag;
}
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];
......@@ -405,7 +403,7 @@ typedef enum : NSUInteger {
}
}else if ([self.transport.state isEqualToString:TRANSPORT_STATE_UNRECEIVED] && !self.isWms){
[self createBtnWithArr:@[@"收货"]];
[self createBtnWithArr:@[@"保存",@"收货"]];
}else{
[self hiddenAllBtn];
......@@ -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{
for (NSString *isEdit in _pvc.defaultState) {
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