Commit bc476c75 authored by zhu's avatar zhu

保存删除逻辑

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