Commit 3141ab0e authored by Sandy's avatar Sandy

发运单只能整单添加商品、添加后不允许修改

parent bc0c36fd
......@@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.23</string>
<string>1.2.24</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.2.23</string>
<string>1.2.24</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
......
......@@ -9,12 +9,22 @@
#import "ICRBaseViewController.h"
#import "Survey.h"
#import "ShopDetail.h"
/**
* 从哪个模块进入
*/
typedef NS_ENUM(NSInteger, ShopDetailInterType) {
/**
* 发运单
*/
ShopDetailInterTypeTransport = 1,
/**
* 采购单
*/
ShopDetailInterTypePurchase,
/**
* 转运单
*/
ShopDetailInterTypeTranfer
};
typedef void(^ChoseShopDetail)(ShopDetail *shopDetail);
@interface ShopDetaileViewController : ICRBaseViewController
......
......@@ -103,11 +103,18 @@ typedef enum : NSUInteger {
UIView *footView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 50)];
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];
[footView addSubview:saveBtn];
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{
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];
[footView addSubview:saveBtn];
UIButton *commitBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(saveBtn.frame.origin.x + saveBtn.frame.size.width + LeftMargin, 10, (ScreenSize.width - LeftMargin*3)/2, BtnHeight) target:self sel:@selector(btnClick:) tag:CommitTag image:nil title:@"保存" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_COMMIT_COLOR];
[footView addSubview:commitBtn];
}
UIButton *commitBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(saveBtn.frame.origin.x + saveBtn.frame.size.width + LeftMargin, 10, (ScreenSize.width - LeftMargin*3)/2, BtnHeight) target:self sel:@selector(btnClick:) tag:CommitTag image:nil title:@"保存" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_COMMIT_COLOR];
[footView addSubview:commitBtn];
_tableView.tableFooterView = footView;
[self.view addSubview:_tableView];
......@@ -186,7 +193,6 @@ typedef enum : NSUInteger {
//只有发运单才需要差库存
if (self.intertype == ShopDetailInterTypeTransport) {
__weak ShopDetaileViewController *weakSelf = self;
[self stockValidWithBillNumber:self.shopDetail.sourceBillNumber complete:^{
......@@ -365,6 +371,10 @@ typedef enum : NSUInteger {
[self createViewInCell:cell indexPath:indexPath];
}
[cell setTitleStr:_dataArr[indexPath.row]];
if (self.intertype == ShopDetailInterTypeTransport){
cell.userInteractionEnabled = NO;
}
return cell;
}
......
......@@ -349,6 +349,10 @@ typedef enum : NSUInteger {
ShowMessage(@"司机电话不能为空");
return NO;
}
if (_sheetView.arriveDate.length == 0) {
ShowMessage(@"预计到货时间不能为空");
return NO;
}
if (_bottomView.productVC.transportProductArr.count == 0) {
ShowMessage(@"商品不能为空");
......@@ -456,6 +460,17 @@ typedef enum : NSUInteger {
TransportPdtDetail *tdetail = [self coverTransportPdtDetail:Detail];
if (Detail.IsDeleted) {
[_bottomView refreshDelProduct:tdetail tag:indexTag];
//清空缓存,重新
[self.dicProduct removeAllObjects];
for (TransportPdtDetail *pdtDetail in _bottomView.productVC.transportProductArr) {
NSMutableArray *arrProduct = [self.dicProduct objectForKey:pdtDetail.purchasebillnumber];
if (!arrProduct) {
arrProduct = [NSMutableArray array];
[self.dicProduct setObject:arrProduct forKey:pdtDetail.purchasebillnumber];
}
[arrProduct addObject:pdtDetail];
}
}else{
[_bottomView refreshEditProduct:tdetail tag:indexTag];
}
......
......@@ -160,28 +160,18 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
TransportPurductCell *cell = (TransportPurductCell *)[tableView cellForRowAtIndexPath:indexPath];
TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
if (![self isHaveIndexPath:billProduct]) {
cell.editBtn.hidden = NO;
// cell.smallImageView.image = [UIImage imageNamed:@"arrowdown"];
// cell.lineLabel.y = ShowHeight + TableHeight -1;
// cell.showView.height = ShowHeight;
// cell.backgroundColor = [UIColor whiteColor];
[self.selectArr addObject:billProduct];
// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_getSelectPurchaseProduct object:nil userInfo:@{@"selectArr":billProduct,@"state":@"add"}];
}else{
[self.selectArr removeObject:billProduct];
cell.editBtn.hidden = YES;
// cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
// cell.lineLabel.y = TableHeight -1;
// cell.showView.height = 0;
// cell.backgroundColor = [UIColor whiteColor];
// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_getSelectPurchaseProduct object:nil userInfo:@{@"selectArr":billProduct,@"state":@"remove"}];
}
self.headCell.checkBox.isSelected = self.selectArr.count == self.secondArr.count;
[self.secondTable reloadData];
// TransportPurductCell *cell = (TransportPurductCell *)[tableView cellForRowAtIndexPath:indexPath];
// TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
// if (![self isHaveIndexPath:billProduct]) {
// cell.editBtn.hidden = NO;
// [self.selectArr addObject:billProduct];
//
// }else{
// [self.selectArr removeObject:billProduct];
// cell.editBtn.hidden = YES;
// }
// self.headCell.checkBox.isSelected = self.selectArr.count == self.secondArr.count;
// [self.secondTable reloadData];
}
- (BOOL)isHaveIndexPath:(TransportPdtDetail *)billProduct{
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