Commit d169f1ef authored by Sandy's avatar Sandy

改造转运单

parent 9f218ce9
...@@ -19,5 +19,6 @@ ...@@ -19,5 +19,6 @@
#define IsDictObject(Object) [(Object) isKindOfClass:[NSDictionary class]] #define IsDictObject(Object) [(Object) isKindOfClass:[NSDictionary class]]
#define IsErrorObject(Object) ![(Object) isKindOfClass:[NSError class]] #define IsErrorObject(Object) ![(Object) isKindOfClass:[NSError class]]
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self
#endif #endif
...@@ -104,8 +104,11 @@ typedef enum : NSUInteger { ...@@ -104,8 +104,11 @@ typedef enum : NSUInteger {
UIView *footView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 50)]; UIView *footView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 50)];
if (self.intertype == ShopDetailInterTypeTransport) { if (self.intertype == ShopDetailInterTypeTransport) {
// UIButton *saveBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, 10, (ScreenSize.width - LeftMargin*2), BtnHeight) target:self sel:@selector(btnClick:) tag:SaveTag image:nil title:@"删除" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_SAVE_COLOR];
// [footView addSubview:saveBtn]; }else if(self.intertype == ShopDetailInterTypeTranfer){
UIButton *saveBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, 10, (ScreenSize.width - LeftMargin*2), BtnHeight) target:self sel:@selector(btnClick:) tag:SaveTag image:nil title:@"删除" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_SAVE_COLOR];
[footView addSubview:saveBtn];
}else{ }else{
UIButton *saveBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, 10, (ScreenSize.width - LeftMargin*3)/2, BtnHeight) target:self sel:@selector(btnClick:) tag:SaveTag image:nil title:@"删除" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_SAVE_COLOR]; UIButton *saveBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, 10, (ScreenSize.width - LeftMargin*3)/2, BtnHeight) target:self sel:@selector(btnClick:) tag:SaveTag image:nil title:@"删除" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_SAVE_COLOR];
...@@ -144,15 +147,15 @@ typedef enum : NSUInteger { ...@@ -144,15 +147,15 @@ typedef enum : NSUInteger {
//基础数量 //基础数量
foundationQuantity.text=self.shopDetail.foundationQuantity; foundationQuantity.text=self.shopDetail.foundationQuantity;
//基础单价 //基础单价
// if ([self.shopDetail.foundationUnitPrice floatValue] > 0) { // if ([self.shopDetail.foundationUnitPrice floatValue] > 0) {
foundationUnitPrice.text= [self.shopDetail.foundationUnitPrice stringValue]; foundationUnitPrice.text= [self.shopDetail.foundationUnitPrice stringValue];
// } // }
self.basePrice = self.shopDetail.foundationUnitPrice; self.basePrice = self.shopDetail.foundationUnitPrice;
//包装单价 //包装单价
// if ([self.shopDetail.packageUnitPrice floatValue] > 0) { // if ([self.shopDetail.packageUnitPrice floatValue] > 0) {
packageUnitPrice.text=[self.shopDetail.packageUnitPrice stringValue]; packageUnitPrice.text=[self.shopDetail.packageUnitPrice stringValue];
// } // }
self.packPrice = self.shopDetail.packageUnitPrice; self.packPrice = self.shopDetail.packageUnitPrice;
//总金额 //总金额
if ([self.shopDetail.totalMoney floatValue] <= 0) { if ([self.shopDetail.totalMoney floatValue] <= 0) {
...@@ -342,10 +345,10 @@ typedef enum : NSUInteger { ...@@ -342,10 +345,10 @@ typedef enum : NSUInteger {
ShowMessage(@"商品数量不能为0"); ShowMessage(@"商品数量不能为0");
return NO; return NO;
} }
// if ([packageUnitPrice.text floatValue] <=0 || [foundationUnitPrice.text floatValue] <= 0 || [totalMoney.text floatValue]<= 0) { // if ([packageUnitPrice.text floatValue] <=0 || [foundationUnitPrice.text floatValue] <= 0 || [totalMoney.text floatValue]<= 0) {
// ShowMessage(@"商品价格不能0"); // ShowMessage(@"商品价格不能0");
// return NO; // return NO;
// } // }
return YES; return YES;
} }
#pragma mark - 协议方法 #pragma mark - 协议方法
...@@ -372,7 +375,7 @@ typedef enum : NSUInteger { ...@@ -372,7 +375,7 @@ typedef enum : NSUInteger {
} }
[cell setTitleStr:_dataArr[indexPath.row]]; [cell setTitleStr:_dataArr[indexPath.row]];
if (self.intertype == ShopDetailInterTypeTransport){ if (self.intertype == ShopDetailInterTypeTransport || self.intertype == ShopDetailInterTypeTranfer){
cell.userInteractionEnabled = NO; cell.userInteractionEnabled = NO;
} }
return cell; return cell;
...@@ -547,9 +550,9 @@ typedef enum : NSUInteger { ...@@ -547,9 +550,9 @@ typedef enum : NSUInteger {
} }
NSMutableString * futureString = [NSMutableString stringWithString:textField.text]; NSMutableString * futureString = [NSMutableString stringWithString:textField.text];
// kLOG(@"%@", futureString); // kLOG(@"%@", futureString);
[futureString insertString:string atIndex:range.location]; [futureString insertString:string atIndex:range.location];
// kLOG(@"----%@", futureString); // kLOG(@"----%@", futureString);
NSInteger flag = 0; NSInteger flag = 0;
NSInteger pointNum = 0;//用于标记小数点的数量,只能有一个小数点 NSInteger pointNum = 0;//用于标记小数点的数量,只能有一个小数点
const NSInteger limited = 2;//限制小数点后面的位数 const NSInteger limited = 2;//限制小数点后面的位数
...@@ -558,7 +561,7 @@ typedef enum : NSUInteger { ...@@ -558,7 +561,7 @@ typedef enum : NSUInteger {
if ([futureString characterAtIndex:i] == '.') { if ([futureString characterAtIndex:i] == '.') {
pointNum++; pointNum++;
// kLOG(@"----->>>%ld",pointNum); // kLOG(@"----->>>%ld",pointNum);
if (pointNum == 2) { if (pointNum == 2) {
return NO; return NO;
...@@ -625,15 +628,15 @@ typedef enum : NSUInteger { ...@@ -625,15 +628,15 @@ typedef enum : NSUInteger {
- (void)setPacktAndTotalPrice{ - (void)setPacktAndTotalPrice{
if (self.basePrice && foundationUnitPrice.text.length > 0) { if (self.basePrice && foundationUnitPrice.text.length > 0) {
if (foundationQuantity.text.length > 0) { if (foundationQuantity.text.length > 0) {
// float basePrice = [self.basePrice floatValue] * 100; // float basePrice = [self.basePrice floatValue] * 100;
// int intBasePrice = (int)basePrice; // int intBasePrice = (int)basePrice;
// int foundationQtt = [foundationQuantity.text intValue]; // int foundationQtt = [foundationQuantity.text intValue];
// double price = (intBasePrice * foundationQtt * 1.0); // double price = (intBasePrice * foundationQtt * 1.0);
// double totalPrice = price / 100; // double totalPrice = price / 100;
// NSDecimalNumber *basePrice = [NSDecimalNumber decimalNumberWithDecimal:[self.basePrice decimalValue]]; // NSDecimalNumber *basePrice = [NSDecimalNumber decimalNumberWithDecimal:[self.basePrice decimalValue]];
// NSDecimalNumber *foundationQty = [NSDecimalNumber decimalNumberWithString:foundationQuantity.text]; // NSDecimalNumber *foundationQty = [NSDecimalNumber decimalNumberWithString:foundationQuantity.text];
// NSDecimalNumber *multiplyResult = [basePrice decimalNumberByMultiplyingBy:foundationQty]; // NSDecimalNumber *multiplyResult = [basePrice decimalNumberByMultiplyingBy:foundationQty];
NSDecimalNumber *multiplyResult = [CalculateHelper calculateNum1:self.basePrice num2:foundationQuantity.text type:CalculateTypeMul roundingType:NSRoundBankers cutLenth:2]; NSDecimalNumber *multiplyResult = [CalculateHelper calculateNum1:self.basePrice num2:foundationQuantity.text type:CalculateTypeMul roundingType:NSRoundBankers cutLenth:2];
totalMoney.text = [multiplyResult stringValue]; totalMoney.text = [multiplyResult stringValue];
self.totalPrice = multiplyResult; self.totalPrice = multiplyResult;
...@@ -651,19 +654,19 @@ typedef enum : NSUInteger { ...@@ -651,19 +654,19 @@ typedef enum : NSUInteger {
- (void)setUnitAndTotalPrice{ - (void)setUnitAndTotalPrice{
if (self.packPrice&&packageUnitPrice.text.length > 0) { if (self.packPrice&&packageUnitPrice.text.length > 0) {
if (packageQuantity.text.length > 0) { if (packageQuantity.text.length > 0) {
// float pakePrice = [self.packPrice floatValue] * 100; // float pakePrice = [self.packPrice floatValue] * 100;
// int intPakePrice = (int)pakePrice; // int intPakePrice = (int)pakePrice;
// int pakageQty = [packageQuantity.text intValue]; // int pakageQty = [packageQuantity.text intValue];
// //
// double price = (intPakePrice * pakageQty * 1.0); // double price = (intPakePrice * pakageQty * 1.0);
// double totalPrice = price / 100; // double totalPrice = price / 100;
// float totalPrice = pakePrice * 100 * pakageQty / 100; // float totalPrice = pakePrice * 100 * pakageQty / 100;
NSDecimalNumber *totalPrice = [CalculateHelper calculateNum1:self.packPrice num2:packageQuantity.text type:CalculateTypeMul roundingType:NSRoundBankers cutLenth:2]; NSDecimalNumber *totalPrice = [CalculateHelper calculateNum1:self.packPrice num2:packageQuantity.text type:CalculateTypeMul roundingType:NSRoundBankers cutLenth:2];
totalMoney.text = [totalPrice stringValue]; totalMoney.text = [totalPrice stringValue];
self.totalPrice = totalPrice; self.totalPrice = totalPrice;
if (foundationQuantity.text.length > 0 && [foundationQuantity.text integerValue] > 0) { if (foundationQuantity.text.length > 0 && [foundationQuantity.text integerValue] > 0) {
NSDecimalNumber *packagePrice = [CalculateHelper calculateNum1:totalPrice num2:foundationQuantity.text type:CalculateTypeDiv roundingType:NSRoundBankers cutLenth:2]; NSDecimalNumber *packagePrice = [CalculateHelper calculateNum1:totalPrice num2:foundationQuantity.text type:CalculateTypeDiv roundingType:NSRoundBankers cutLenth:2];
// float packagePrice = totalPrice / [foundationQuantity.text floatValue]; // float packagePrice = totalPrice / [foundationQuantity.text floatValue];
foundationUnitPrice.text = packagePrice.stringValue; foundationUnitPrice.text = packagePrice.stringValue;
self.basePrice = packagePrice; } self.basePrice = packagePrice; }
} }
...@@ -674,14 +677,14 @@ typedef enum : NSUInteger { ...@@ -674,14 +677,14 @@ typedef enum : NSUInteger {
if (totalMoney.text.length > 0) { if (totalMoney.text.length > 0) {
if (packageQuantity.text.length > 0 && [packageQuantity.text floatValue] > 0) { if (packageQuantity.text.length > 0 && [packageQuantity.text floatValue] > 0) {
// float packagePrice = [self.totalPrice floatValue] / [packageQuantity.text floatValue]; // float packagePrice = [self.totalPrice floatValue] / [packageQuantity.text floatValue];
NSDecimalNumber *packagePrice = [CalculateHelper calculateNum1:self.totalPrice num2:packageQuantity.text type:CalculateTypeDiv roundingType:NSRoundBankers cutLenth:2]; NSDecimalNumber *packagePrice = [CalculateHelper calculateNum1:self.totalPrice num2:packageQuantity.text type:CalculateTypeDiv roundingType:NSRoundBankers cutLenth:2];
packageUnitPrice.text = packagePrice.stringValue; packageUnitPrice.text = packagePrice.stringValue;
self.packPrice = packagePrice; self.packPrice = packagePrice;
} }
if (foundationQuantity.text.length > 0 && [foundationQuantity.text floatValue] > 0) { if (foundationQuantity.text.length > 0 && [foundationQuantity.text floatValue] > 0) {
// float packagePrice = [self.totalPrice floatValue] / [foundationQuantity.text floatValue]; // float packagePrice = [self.totalPrice floatValue] / [foundationQuantity.text floatValue];
NSDecimalNumber *packagePrice = [CalculateHelper calculateNum1:self.totalPrice num2:foundationQuantity.text type:CalculateTypeDiv roundingType:NSRoundBankers cutLenth:2]; NSDecimalNumber *packagePrice = [CalculateHelper calculateNum1:self.totalPrice num2:foundationQuantity.text type:CalculateTypeDiv roundingType:NSRoundBankers cutLenth:2];
foundationUnitPrice.text = packagePrice.stringValue; foundationUnitPrice.text = packagePrice.stringValue;
self.basePrice = packagePrice; self.basePrice = packagePrice;
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#import "TransportPdtDetail.h" #import "TransportPdtDetail.h"
#import "ChooseTransportViewController.h" #import "ChooseTransportViewController.h"
#import "ChooseTransferViewController.h" #import "ChooseTransferViewController.h"
#import "ProductStockModel.h"
typedef enum : NSUInteger { typedef enum : NSUInteger {
SaveTag = 7000, SaveTag = 7000,
CommitTag, CommitTag,
...@@ -37,6 +38,12 @@ typedef enum : NSUInteger { ...@@ -37,6 +38,12 @@ typedef enum : NSUInteger {
NSNumber *versionObject; NSNumber *versionObject;
} }
@property (nonatomic,strong)NSString *state; @property (nonatomic,strong)NSString *state;
/**
* 缓存的选择的采购单数据
*/
@property (strong, nonatomic) NSMutableDictionary *dicProduct;
@property (assign, nonatomic) NSInteger purchaseAddStockCheckNumber;
@end @end
@implementation NewTransferViewController @implementation NewTransferViewController
...@@ -59,6 +66,7 @@ typedef enum : NSUInteger { ...@@ -59,6 +66,7 @@ typedef enum : NSUInteger {
[super viewDidLoad]; [super viewDidLoad];
//布局 //布局
[self bulidLayout]; [self bulidLayout];
self.purchaseAddStockCheckNumber = 0;
uuidObject = [NSNull null]; uuidObject = [NSNull null];
billNumberObject = [NSNull null]; billNumberObject = [NSNull null];
versionObject = [NSNumber numberWithInteger:0]; versionObject = [NSNumber numberWithInteger:0];
...@@ -101,6 +109,18 @@ typedef enum : NSUInteger { ...@@ -101,6 +109,18 @@ typedef enum : NSUInteger {
_sheetView.transfer = self.transfer; _sheetView.transfer = self.transfer;
[_bottomView refreshCost:self.transfer.accountDetails]; [_bottomView refreshCost:self.transfer.accountDetails];
[_bottomView refreshTranProduct:self.transfer.pdtDetails]; [_bottomView refreshTranProduct:self.transfer.pdtDetails];
//清空缓存,重新
[self.dicProduct removeAllObjects];
for (TransferPdtDetail *pdtDetail in _bottomView.productVC.transferProductArr) {
NSMutableArray *arrProduct = [self.dicProduct objectForKey:pdtDetail.sourcebillnumber];
if (!arrProduct) {
arrProduct = [NSMutableArray array];
[self.dicProduct setObject:arrProduct forKey:pdtDetail.sourcebillnumber];
}
[arrProduct addObject:pdtDetail];
}
} }
- (void)bulidLayout{ - (void)bulidLayout{
...@@ -141,9 +161,17 @@ typedef enum : NSUInteger { ...@@ -141,9 +161,17 @@ typedef enum : NSUInteger {
break; break;
case CommitTag:{ case CommitTag:{
if ([self checkTransfer]) { if ([self checkTransfer]) {
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:@"请确认提交" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil]; NSArray *array = self.dicProduct.allKeys;
alertView.delegate = self; WS(weakSelf);
//判断数量问题
[IBTLoadingView showProgressLabel:@""];
[self stockValidWithDic:self.dicProduct billNumbers:array complete:^{
[IBTLoadingView hideHUDWithText:@""];
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:@"请确认提交" delegate:weakSelf cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil];
alertView.delegate = weakSelf;
[alertView show]; [alertView show];
}];
} }
} }
break; break;
...@@ -229,6 +257,59 @@ typedef enum : NSUInteger { ...@@ -229,6 +257,59 @@ typedef enum : NSUInteger {
} }
} }
/**
* 查库存接口
*
* @param dic 存放已选择单据
* @param billNumbers 单号
* @param complete 回调
*/
- (void)stockValidWithDic:(NSMutableDictionary *)dic billNumbers:(NSArray *)billNumbers complete:(void (^)(void))complete {
//如果billNumbers数量为0,说明没有去选择
NSString *billNum = billNumbers[self.purchaseAddStockCheckNumber];
NSMutableArray *arrProducts = [dic objectForKey:billNum];
WS(weakSelf);
[HTTP purchaseStockWithPurchaseUuid:billNum success:^(id succ) {
if (![succ[@"data"] isKindOfClass:[NSArray class]]) {
[IBTLoadingView hideHUDWithText:@""];
NSString *msg = [NSString stringWithFormat:@"该批次<%@>在总部系统的库存不足!", billNum];
ShowMessage(msg);
return ;
}
for (NSDictionary *dict in succ[@"data"]) {
ProductStockModel *model = [ProductStockModel new];
[model setValuesForKeysWithDictionary:dict];
for (TransportPdtDetail *detail in arrProducts) {
if ([detail.productCode isEqualToString:model.productCode]) {
if (detail.baseQty.floatValue > model.qty.floatValue) {
CLog(@"库存不足");
[IBTLoadingView hideHUDWithText:@""];
self.purchaseAddStockCheckNumber = 0;
NSString *msg = [NSString stringWithFormat:@"该批次<%@>的商品%@在总部系统的库存不足!", billNum, detail.productName];
ShowMessage(msg);
return ;
}
}
}
}
self.purchaseAddStockCheckNumber += 1;
if (self.purchaseAddStockCheckNumber == billNumbers.count) {
self.purchaseAddStockCheckNumber = 0;
complete();
}else{
[weakSelf stockValidWithDic:dic billNumbers:billNumbers complete:complete];
}
} failure:^(id fail) {
[IBTLoadingView hideHUDWithText:@""];
self.purchaseAddStockCheckNumber = 0;
}];
}
- (BOOL)checkTransfer{ - (BOOL)checkTransfer{
...@@ -294,6 +375,8 @@ typedef enum : NSUInteger { ...@@ -294,6 +375,8 @@ typedef enum : NSUInteger {
[_bottomView reProduct:arr]; [_bottomView reProduct:arr];
} }
}; };
tpv.dicProduct = self.dicProduct;
[self PushViewController:tpv animated:YES]; [self PushViewController:tpv animated:YES];
} }
#pragma mark - 通知选择发运单 #pragma mark - 通知选择发运单
...@@ -370,6 +453,7 @@ typedef enum : NSUInteger { ...@@ -370,6 +453,7 @@ typedef enum : NSUInteger {
NSInteger indexTag = [[[fication userInfo] objectForKey:@"indexTag"] integerValue]; NSInteger indexTag = [[[fication userInfo] objectForKey:@"indexTag"] integerValue];
ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init]; ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init];
svc.intertype = ShopDetailInterTypeTranfer;
if (billProduct) { if (billProduct) {
svc.navTitle = @"编辑商品"; svc.navTitle = @"编辑商品";
ShopDetail *shopDetail=[self coverShopDetail:billProduct]; ShopDetail *shopDetail=[self coverShopDetail:billProduct];
...@@ -378,6 +462,17 @@ typedef enum : NSUInteger { ...@@ -378,6 +462,17 @@ typedef enum : NSUInteger {
TransferPdtDetail *tdetail = [self coverTransportPdtDetail:Detail]; TransferPdtDetail *tdetail = [self coverTransportPdtDetail:Detail];
if (Detail.IsDeleted) { if (Detail.IsDeleted) {
[_bottomView refreshDelProduct:tdetail tag:indexTag]; [_bottomView refreshDelProduct:tdetail tag:indexTag];
//清空缓存,重新
[self.dicProduct removeAllObjects];
for (TransferPdtDetail *pdtDetail in _bottomView.productVC.transferProductArr) {
NSMutableArray *arrProduct = [self.dicProduct objectForKey:pdtDetail.sourcebillnumber];
if (!arrProduct) {
arrProduct = [NSMutableArray array];
[self.dicProduct setObject:arrProduct forKey:pdtDetail.sourcebillnumber];
}
[arrProduct addObject:pdtDetail];
}
}else{ }else{
[_bottomView refreshEditProduct:tdetail tag:indexTag]; [_bottomView refreshEditProduct:tdetail tag:indexTag];
} }
...@@ -527,6 +622,13 @@ typedef enum : NSUInteger { ...@@ -527,6 +622,13 @@ typedef enum : NSUInteger {
} }
} }
- (NSMutableDictionary *)dicProduct {
if (!_dicProduct) {
_dicProduct = [NSMutableDictionary dictionary];
}
return _dicProduct;
}
/* /*
#pragma mark - Navigation #pragma mark - Navigation
......
...@@ -202,7 +202,7 @@ typedef enum : NSUInteger { ...@@ -202,7 +202,7 @@ typedef enum : NSUInteger {
NSArray *array = self.dicProduct.allKeys; NSArray *array = self.dicProduct.allKeys;
__weak NewTransportViewController *weakSelf = self; WS(weakSelf);
//判断数量问题 //判断数量问题
[IBTLoadingView showProgressLabel:@""]; [IBTLoadingView showProgressLabel:@""];
[self stockValidWithDic:self.dicProduct billNumbers:array complete:^{ [self stockValidWithDic:self.dicProduct billNumbers:array complete:^{
...@@ -220,6 +220,13 @@ typedef enum : NSUInteger { ...@@ -220,6 +220,13 @@ typedef enum : NSUInteger {
} }
} }
/**
* 查库存接口
*
* @param dic 存放已选择单据
* @param billNumbers 单号
* @param complete 回调
*/
- (void)stockValidWithDic:(NSMutableDictionary *)dic billNumbers:(NSArray *)billNumbers complete:(void (^)(void))complete { - (void)stockValidWithDic:(NSMutableDictionary *)dic billNumbers:(NSArray *)billNumbers complete:(void (^)(void))complete {
//如果billNumbers数量为0,说明没有去选择 //如果billNumbers数量为0,说明没有去选择
......
...@@ -86,7 +86,7 @@ NSInteger purchaseStockCheckNumber = 0; ...@@ -86,7 +86,7 @@ NSInteger purchaseStockCheckNumber = 0;
} }
NSDictionary *dict; NSDictionary *dict;
if (self.isTransportIn) { // if (self.isTransportIn) {
dict = @{ dict = @{
@"state":PURCHASE_STATE_RECEIVED, @"state":PURCHASE_STATE_RECEIVED,
@"queryOrders":orderArr, @"queryOrders":orderArr,
...@@ -96,17 +96,17 @@ NSInteger purchaseStockCheckNumber = 0; ...@@ -96,17 +96,17 @@ NSInteger purchaseStockCheckNumber = 0;
@"isProductCenter":@(1), @"isProductCenter":@(1),
@"pageNumber":@(_currentPage), @"pageNumber":@(_currentPage),
@"pageSize":@(20)}; @"pageSize":@(20)};
}else{ // }else{
dict = @{ // dict = @{
@"state":[NSNull null], // @"state":[NSNull null],
@"stateNotIn":@[PURCHASE_STATE_ABORTED,PURCHASE_STATE_REJECTED], // @"stateNotIn":@[PURCHASE_STATE_ABORTED,PURCHASE_STATE_REJECTED],
@"queryOrders":orderArr, // @"queryOrders":orderArr,
@"userUuid":userUtil.userId, // @"userUuid":userUtil.userId,
@"billNumberProductLike":billNumberObject, // @"billNumberProductLike":billNumberObject,
@"fetchParts":@"products", // @"fetchParts":@"products",
@"pageNumber":@(_currentPage), // @"pageNumber":@(_currentPage),
@"pageSize":@(20)}; // @"pageSize":@(20)};
} // }
[[ICRHTTPController sharedController] queryPurchaseWithData:dict success:succ failure:fail]; [[ICRHTTPController sharedController] queryPurchaseWithData:dict success:succ failure:fail];
} }
- (void)fetchtPuchaseList:(id)data{ - (void)fetchtPuchaseList:(id)data{
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
@property (nonatomic,strong)NSMutableArray *indexArr; @property (nonatomic,strong)NSMutableArray *indexArr;
@property (nonatomic,strong)NSMutableArray *selectArr; @property (nonatomic,strong)NSMutableArray *selectArr;
/** 是否发运单进入 */
@property (assign, nonatomic) BOOL isPurchaseIn;
- (void)setPurchaseBill:(PurchaseBill *)bill selectArr:(NSMutableArray *)selectArr; - (void)setPurchaseBill:(PurchaseBill *)bill selectArr:(NSMutableArray *)selectArr;
- (void)setTransPort:(Transport *)bill selectArr:(NSMutableArray *)selectArr; - (void)setTransPort:(Transport *)bill selectArr:(NSMutableArray *)selectArr;
......
...@@ -162,18 +162,21 @@ ...@@ -162,18 +162,21 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
// TransportPurductCell *cell = (TransportPurductCell *)[tableView cellForRowAtIndexPath:indexPath]; if (!self.isPurchaseIn) {
// TransportPdtDetail * billProduct = self.secondArr[indexPath.row]; TransportPurductCell *cell = (TransportPurductCell *)[tableView cellForRowAtIndexPath:indexPath];
// if (![self isHaveIndexPath:billProduct]) { TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
// cell.editBtn.hidden = NO; if (![self isHaveIndexPath:billProduct]) {
// [self.selectArr addObject:billProduct]; cell.editBtn.hidden = NO;
// [self.selectArr addObject:billProduct];
// }else{
// [self.selectArr removeObject:billProduct]; }else{
// cell.editBtn.hidden = YES; [self.selectArr removeObject:billProduct];
// } cell.editBtn.hidden = YES;
// self.headCell.checkBox.isSelected = self.selectArr.count == self.secondArr.count; }
// [self.secondTable reloadData]; self.headCell.checkBox.isSelected = self.selectArr.count == self.secondArr.count;
[self.secondTable reloadData];
}
} }
- (BOOL)isHaveIndexPath:(TransportPdtDetail *)billProduct{ - (BOOL)isHaveIndexPath:(TransportPdtDetail *)billProduct{
for (TransportPdtDetail *detail in self.selectArr) { for (TransportPdtDetail *detail in self.selectArr) {
......
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