Commit bc476c75 authored by zhu's avatar zhu

保存删除逻辑

parent f7abd79d
...@@ -18,5 +18,7 @@ ...@@ -18,5 +18,7 @@
@property (nonatomic,strong)NSString *packageUnitPrice;//包装单价 @property (nonatomic,strong)NSString *packageUnitPrice;//包装单价
@property (nonatomic,strong)NSString *totalMoney;//总金额 @property (nonatomic,strong)NSString *totalMoney;//总金额
@property (nonatomic,strong)NSString *remark;//备注 @property (nonatomic,strong)NSString *remark;//备注
@property (nonatomic,assign)BOOL IsDeleted;//是否删除
@property (nonatomic,assign)BOOL IsXiuGai;//是否删除
@end @end
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
// } // }
lable.text=[array objectAtIndex:i]; lable.text=[array objectAtIndex:i];
lable.font=FontSize(TitleSize-2); lable.font=FontSize(TitleSize-2);
[lable setTextColor:HexColor(@"444444")]; [lable setTextColor:GXF_CONTENT_COLOR];
[self.subSview addSubview:lable]; [self.subSview addSubview:lable];
UILabel*shopeLable= [self.shopDetailAry1 objectAtIndex:i]; UILabel*shopeLable= [self.shopDetailAry1 objectAtIndex:i];
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
} }
shopeLable.font=FontSize(TitleSize-2); shopeLable.font=FontSize(TitleSize-2);
[shopeLable setTextColor:HexColor(@"444444")]; [shopeLable setTextColor:GXF_CONTENT_COLOR];
// shopeLable.backgroundColor=[UIColor redColor]; // shopeLable.backgroundColor=[UIColor redColor];
[self.subSview addSubview:shopeLable]; [self.subSview addSubview:shopeLable];
} }
...@@ -113,13 +113,13 @@ ...@@ -113,13 +113,13 @@
lable.text=[array1 objectAtIndex:i]; lable.text=[array1 objectAtIndex:i];
lable.font=FontSize(TitleSize-2); lable.font=FontSize(TitleSize-2);
[lable setTextColor:HexColor(@"444444")]; [lable setTextColor:GXF_CONTENT_COLOR];
[self.subSview addSubview:lable]; [self.subSview addSubview:lable];
UILabel*shopeLable= [self.shopDetailAry2 objectAtIndex:i]; UILabel*shopeLable= [self.shopDetailAry2 objectAtIndex:i];
shopeLable.frame=CGRectMake(lable.frame.origin.x-LeftMargin+lable.frame.size.width, lable.frame.origin.y,(ScreenSize.width-2*LeftMargin)/4, 10); shopeLable.frame=CGRectMake(lable.frame.origin.x-LeftMargin+lable.frame.size.width, lable.frame.origin.y,(ScreenSize.width-2*LeftMargin)/4, 10);
shopeLable.font=FontSize(TitleSize-2); shopeLable.font=FontSize(TitleSize-2);
[shopeLable setTextColor:HexColor(@"444444")]; [shopeLable setTextColor:GXF_CONTENT_COLOR];
// shopeLable.backgroundColor=[UIColor redColor]; // shopeLable.backgroundColor=[UIColor redColor];
[self.subSview addSubview:shopeLable]; [self.subSview addSubview:shopeLable];
} }
......
...@@ -71,7 +71,7 @@ typedef enum : NSUInteger { ...@@ -71,7 +71,7 @@ typedef enum : NSUInteger {
self.title = self.navTitle; self.title = self.navTitle;
[self initData]; [self initData];
[self setupSubviews]; [self setupSubviews];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (void)initData{ - (void)initData{
merchandise=[[UITextField alloc]init]; merchandise=[[UITextField alloc]init];
...@@ -88,6 +88,7 @@ typedef enum : NSUInteger { ...@@ -88,6 +88,7 @@ typedef enum : NSUInteger {
[_dataArr addObject:@"包装单价"]; [_dataArr addObject:@"包装单价"];
[_dataArr addObject:@"总金额"]; [_dataArr addObject:@"总金额"];
[_dataArr addObject:@"备注"]; [_dataArr addObject:@"备注"];
} }
-(void)setupSubviews -(void)setupSubviews
...@@ -113,6 +114,27 @@ typedef enum : NSUInteger { ...@@ -113,6 +114,27 @@ typedef enum : NSUInteger {
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
} }
- (void)setviewsData
{
if (self.shopDetail!=nil) {
_productLabel.text=self.shopDetail.merchandise;//商品
merchandise.text=self.shopDetail.merchandise;
packageUnit.text=self.shopDetail.packageUnit;
_PackagingLable.text=self.shopDetail.packageUnit;//包装单位
packageSpecification.text=self.shopDetail.packageSpecification;//包装规格
packageQuantity.text=self.shopDetail.packageQuantity; //包装数量
foundationQuantity.text=self.shopDetail.foundationQuantity; //基础数量
foundationUnitPrice.text=self.shopDetail.foundationUnitPrice; //基础单价
packageUnitPrice.text=self.shopDetail.packageUnitPrice; //包装单价
totalMoney.text=self.shopDetail.totalMoney; //总金额
remark.text=self.shopDetail.remark;
_productLabel.textColor=GXF_CONTENT_COLOR;
_PackagingLable.textColor=GXF_CONTENT_COLOR;
}
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
...@@ -120,8 +142,25 @@ typedef enum : NSUInteger { ...@@ -120,8 +142,25 @@ typedef enum : NSUInteger {
#pragma mark - 按钮点击事件 #pragma mark - 按钮点击事件
- (void)btnClick:(UIButton *)btn{ - (void)btnClick:(UIButton *)btn{
switch (btn.tag) { switch (btn.tag) {
case SaveTag: case SaveTag://删除
{ {
if (self.shopDetail!=nil) {
ShopDetail *shopDetail=self.shopDetail;
if (shopDetail.IsXiuGai==YES) {
shopDetail.IsDeleted=YES;
self.choseShopDetail(shopDetail);//回调
[self PopViewControllerAnimated:YES];
}else
{
[self clearShopDetail];
}
}else
{
[self clearShopDetail];
}
// if ([self checkSurvey]) { // if ([self checkSurvey]) {
// [self saveSurvey:@"initial" message:@"正在保存..."]; // [self saveSurvey:@"initial" message:@"正在保存..."];
// } // }
...@@ -131,6 +170,7 @@ typedef enum : NSUInteger { ...@@ -131,6 +170,7 @@ typedef enum : NSUInteger {
{ {
if ([self informationComplete]) { if ([self informationComplete]) {
ShopDetail *shopDetail=self.shopDetail; ShopDetail *shopDetail=self.shopDetail;
shopDetail.IsDeleted=NO;
self.choseShopDetail(shopDetail);//回调 self.choseShopDetail(shopDetail);//回调
[self PopViewControllerAnimated:YES]; [self PopViewControllerAnimated:YES];
// [self saveSurvey:@"submitted" message:@"正在提交..."]; // [self saveSurvey:@"submitted" message:@"正在提交..."];
...@@ -141,6 +181,24 @@ typedef enum : NSUInteger { ...@@ -141,6 +181,24 @@ typedef enum : NSUInteger {
break; break;
} }
} }
- (void)clearShopDetail
{
_productLabel.text=@"选择商品";//商品
merchandise.text=@"";
packageUnit.text=@"";
_PackagingLable.text=@"选择包装单位";//包装单位
packageSpecification.text=@"";//包装规格
packageQuantity.text=@""; //包装数量
foundationQuantity.text=@""; //基础数量
foundationUnitPrice.text=@""; //基础单价
packageUnitPrice.text=@""; //包装单价
totalMoney.text=@""; //总金额
remark.text=@"";
_productLabel.textColor=GXF_PLACEHOLDER_COLOR;
_PackagingLable.textColor=GXF_PLACEHOLDER_COLOR;
}
- (BOOL)informationComplete{ - (BOOL)informationComplete{
self.shopDetail=[[ShopDetail alloc]init]; self.shopDetail=[[ShopDetail alloc]init];
self.shopDetail.merchandise=merchandise.text; self.shopDetail.merchandise=merchandise.text;
...@@ -246,13 +304,13 @@ typedef enum : NSUInteger { ...@@ -246,13 +304,13 @@ typedef enum : NSUInteger {
- (void)clearAllInformation{ - (void)clearAllInformation{
_titleField.text = @""; _titleField.text = @"";
_productLabel.text = @"请输入商品"; _productLabel.text = @"请输入商品";
_productLabel.textColor = HexColor(@"bbbbbb"); _productLabel.textColor = GXF_PLACEHOLDER_COLOR;
_startDateLabel.text = @"选择日期"; _startDateLabel.text = @"选择日期";
_startDateLabel.textColor = HexColor(@"bbbbbb"); _startDateLabel.textColor = GXF_PLACEHOLDER_COLOR;
_endDateLabel.text = @"选择日期"; _endDateLabel.text = @"选择日期";
_endDateLabel.textColor = HexColor(@"bbbbbb"); _endDateLabel.textColor = GXF_PLACEHOLDER_COLOR;
_personLabel.text = @"选择调研人员"; _personLabel.text = @"选择调研人员";
_personLabel.textColor = HexColor(@"bbbbbb"); _personLabel.textColor = GXF_PLACEHOLDER_COLOR;
_noteTextView.text = @""; _noteTextView.text = @"";
//清空数据 //清空数据
self.titleStr = @""; self.titleStr = @"";
...@@ -303,7 +361,7 @@ typedef enum : NSUInteger { ...@@ -303,7 +361,7 @@ typedef enum : NSUInteger {
if (indexPath.row == 0||indexPath.row==3) { if (indexPath.row == 0||indexPath.row==3) {
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight))]; UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight))];
contentLabel.textAlignment= NSTextAlignmentRight; contentLabel.textAlignment= NSTextAlignmentRight;
contentLabel.textColor = HexColor(@"bbbbbb"); contentLabel.textColor = GXF_PLACEHOLDER_COLOR;
contentLabel.font = FontSize(TitleSize); contentLabel.font = FontSize(TitleSize);
[cell.contentView addSubview:contentLabel]; [cell.contentView addSubview:contentLabel];
if (indexPath.row==0) { if (indexPath.row==0) {
...@@ -321,7 +379,7 @@ typedef enum : NSUInteger { ...@@ -321,7 +379,7 @@ typedef enum : NSUInteger {
{ {
_titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)]; _titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
_titleField.textAlignment = NSTextAlignmentRight; _titleField.textAlignment = NSTextAlignmentRight;
_titleField.textColor = HexColor(@"444444"); _titleField.textColor = GXF_CONTENT_COLOR;
_titleField.placeholder = @"输入调研标题"; _titleField.placeholder = @"输入调研标题";
_titleField.font = FontSize(15); _titleField.font = FontSize(15);
_titleField.returnKeyType = UIReturnKeyDone; _titleField.returnKeyType = UIReturnKeyDone;
...@@ -358,6 +416,7 @@ typedef enum : NSUInteger { ...@@ -358,6 +416,7 @@ typedef enum : NSUInteger {
} }
[self setviewsData];
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
...@@ -368,7 +427,7 @@ typedef enum : NSUInteger { ...@@ -368,7 +427,7 @@ typedef enum : NSUInteger {
Product *product=products [0]; Product *product=products [0];
_productLabel.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code]; _productLabel.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code];
merchandise.text=[NSString stringWithFormat:@"%@[%@]",product.name,product.code]; merchandise.text=[NSString stringWithFormat:@"%@[%@]",product.name,product.code];
_productLabel.textColor = HexColor(@"444444"); _productLabel.textColor = GXF_CONTENT_COLOR;
self.productNameStr = product.name; self.productNameStr = product.name;
self.productUuidStr = product.uuid; self.productUuidStr = product.uuid;
self.productCodeStr = product.code; self.productCodeStr = product.code;
...@@ -382,7 +441,7 @@ typedef enum : NSUInteger { ...@@ -382,7 +441,7 @@ typedef enum : NSUInteger {
_PackagingLable.text = [NSString stringWithFormat:@"%@",Packaging]; _PackagingLable.text = [NSString stringWithFormat:@"%@",Packaging];
packageUnit.text=[NSString stringWithFormat:@"%@",Packaging]; packageUnit.text=[NSString stringWithFormat:@"%@",Packaging];
_PackagingLable.textColor = HexColor(@"444444"); _PackagingLable.textColor = GXF_CONTENT_COLOR;
}; };
...@@ -404,7 +463,7 @@ typedef enum : NSUInteger { ...@@ -404,7 +463,7 @@ typedef enum : NSUInteger {
} }
} }
_personLabel.text = personStr; _personLabel.text = personStr;
_personLabel.textColor = HexColor(@"444444"); _personLabel.textColor = GXF_CONTENT_COLOR;
} }
if (self.users > 0) { if (self.users > 0) {
...@@ -415,7 +474,7 @@ typedef enum : NSUInteger { ...@@ -415,7 +474,7 @@ typedef enum : NSUInteger {
- (void)preferDataInProductLabel{ - (void)preferDataInProductLabel{
if (self.survey) { if (self.survey) {
_productLabel.text = [IBTCommon checkString:self.survey.productName]; _productLabel.text = [IBTCommon checkString:self.survey.productName];
_productLabel.textColor = HexColor(@"444444"); _productLabel.textColor = GXF_CONTENT_COLOR;
self.productCodeStr = [IBTCommon checkString:self.survey.productCode]; self.productCodeStr = [IBTCommon checkString:self.survey.productCode];
self.productNameStr = [IBTCommon checkString:self.survey.productName]; self.productNameStr = [IBTCommon checkString:self.survey.productName];
self.productUuidStr = [IBTCommon checkString:self.survey.productUuid]; self.productUuidStr = [IBTCommon checkString:self.survey.productUuid];
...@@ -445,11 +504,11 @@ typedef enum : NSUInteger { ...@@ -445,11 +504,11 @@ typedef enum : NSUInteger {
} }
- (void)okTimeView:(NSDate *)time{ - (void)okTimeView:(NSDate *)time{
if (_isClickStart) { if (_isClickStart) {
_startDateLabel.textColor = HexColor(@"444444"); _startDateLabel.textColor = GXF_CONTENT_COLOR;
_startDateLabel.text = [IBTCommon stringFromDate:time]; _startDateLabel.text = [IBTCommon stringFromDate:time];
self.beginDateStr = [time httpParameterString]; self.beginDateStr = [time httpParameterString];
}else{ }else{
_endDateLabel.textColor = HexColor(@"444444"); _endDateLabel.textColor = GXF_CONTENT_COLOR;
_endDateLabel.text = [IBTCommon stringFromDate:time]; _endDateLabel.text = [IBTCommon stringFromDate:time];
self.endDateStr = [time httpParameterString]; self.endDateStr = [time httpParameterString];
} }
......
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