Skip to content

Commit

Permalink
添加删除
Browse files Browse the repository at this point in the history
  • Loading branch information
锦超 committed Sep 12, 2015
1 parent 0882c25 commit 54bcf34
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
38 changes: 28 additions & 10 deletions YHB_Prj/YHB_Prj/Woyaodinghuo/WYJHDetailVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,12 @@ - (void)shouhuoBTItem
#pragma mark 修改
- (void)modifyBTItem
{
UIView *tempTopView = [[UIView alloc] initWithFrame:CGRectMake(0, 10, kMainScreenWidth-20, 34)];
UIView *tempTopView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, kMainScreenWidth-20, 34)];
tempTopView.backgroundColor = [UIColor whiteColor];
UIButton *searchBt = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, tempTopView.width-50, tempTopView.height)];
[searchBt setTitle:@"请输入商品名称/简拼/条码" forState:UIControlStateNormal];
[searchBt setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
searchBt.titleLabel.font = [UIFont systemFontOfSize:13];
[tempTopView addSubview:searchBt];

UIButton *tiaomaBt = [[UIButton alloc] initWithFrame:CGRectMake(tempTopView.width-50, 0, 50, tempTopView.height)];
Expand All @@ -150,15 +153,11 @@ - (void)modifyBTItem

[self.view addSubview:tempTopView];

CGRect tvRect = self.tvHeadView.frame;
self.tvHeadView.frame = CGRectMake(0, tvRect.origin.y+44, tvRect.size.width, tvRect.size.height);

CGRect tbvRect = self.tableview.frame;
self.tableview.frame = CGRectMake(0, tbvRect.origin.y+44, tbvRect.size.width, tbvRect.size.height);
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//
//
// });
self.tableview.editing = YES;
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
return UITableViewCellEditingStyleDelete;
}

#pragma mark - UITableViewDataSource
Expand Down Expand Up @@ -199,6 +198,25 @@ - (void)configureCell:(WYJHDetailCell *)cell
}
}

// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
MLOG(@"1213");
if(indexPath.row < self.modeArry.count)
{
WYJHMode *mode = [self.modeArry objectAtIndex:indexPath.row];
[self.manager appDeleteSupplierStorageSrl:mode.strId finishBlock:^(BOOL ret) {

}];
}
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.row < self.modeArry.count)
{
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
Expand Down
3 changes: 3 additions & 0 deletions YHB_Prj/YHB_Prj/Woyaodinghuo/WYJHManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@
finishBlock:(void(^)(BOOL ret))aFinishBlock;
- (void)appStorageStockSrl:(NSString *)aId
finishBlock:(void(^)(BOOL ret))aFinishBlock;

- (void)appDeleteSupplierStorageSrl:(NSString *)aId //删除
finishBlock:(void(^)(BOOL ret))aFinishBlock;
@end
13 changes: 13 additions & 0 deletions YHB_Prj/YHB_Prj/Woyaodinghuo/WYJHManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@ - (void)appStorageStockSrl:(NSString *)aId

}];
}

- (void)appDeleteSupplierStorageSrl:(NSString *)aId
finishBlock:(void(^)(BOOL ret))aFinishBlock

{
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:0];
[dict setValue:aId forKey:@"id"];
[NetManager requestWith:dict apiName:@"appDeleteSupplierStorageSrl" method:@"post" succ:^(NSDictionary *successDict) {
MLOG(@"%@",successDict);
} failure:^(NSDictionary *failDict, NSError *error) {

}];
}
#pragma mark 设置筛选数据
- (void)setAccountType:(int)aType //是否已结 1-未结 2-已结
{
Expand Down

0 comments on commit 54bcf34

Please sign in to comment.