diff --git a/XFFruit.xcodeproj/project.pbxproj b/XFFruit.xcodeproj/project.pbxproj index 03399f053791ecc662e0d2e10d75ba53d81708bc..55dfd6a9ba66f2d9e7b5a6d1928fe25386358c80 100644 --- a/XFFruit.xcodeproj/project.pbxproj +++ b/XFFruit.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 0414FF1B1B94959700C7B00E /* ShopDetaileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF161B94959700C7B00E /* ShopDetaileViewController.m */; }; 04B4A3871B9CAAD700D88D68 /* ShopDetail.m in Sources */ = {isa = PBXBuildFile; fileRef = 04B4A3861B9CAAD700D88D68 /* ShopDetail.m */; }; 04E721E01BA73CE2008F9158 /* ChooseProductUnitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E721DF1BA73CE2008F9158 /* ChooseProductUnitViewController.m */; }; + 04E721E31BA755FD008F9158 /* ProductUnit.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E721E21BA755FD008F9158 /* ProductUnit.m */; }; 04F6E70A1B9B08A500550849 /* PurchaseNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F6E7091B9B08A500550849 /* PurchaseNoticeViewController.m */; }; 300DD94A1B184B450080EE12 /* ICRPatrolPlan.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD9491B184B450080EE12 /* ICRPatrolPlan.m */; }; 300DD94B1B184B450080EE12 /* ICRPatrolPlan.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD9491B184B450080EE12 /* ICRPatrolPlan.m */; }; @@ -467,6 +468,8 @@ 04B4A3861B9CAAD700D88D68 /* ShopDetail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopDetail.m; sourceTree = "<group>"; }; 04E721DE1BA73CE2008F9158 /* ChooseProductUnitViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChooseProductUnitViewController.h; sourceTree = "<group>"; }; 04E721DF1BA73CE2008F9158 /* ChooseProductUnitViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChooseProductUnitViewController.m; sourceTree = "<group>"; }; + 04E721E11BA755FD008F9158 /* ProductUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProductUnit.h; sourceTree = "<group>"; }; + 04E721E21BA755FD008F9158 /* ProductUnit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductUnit.m; sourceTree = "<group>"; }; 04F6E7081B9B08A500550849 /* PurchaseNoticeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurchaseNoticeViewController.h; sourceTree = "<group>"; }; 04F6E7091B9B08A500550849 /* PurchaseNoticeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurchaseNoticeViewController.m; sourceTree = "<group>"; }; 1B0B22845F5CD40B5CF655F2 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; }; @@ -1057,6 +1060,8 @@ children = ( 04B4A3851B9CAAD700D88D68 /* ShopDetail.h */, 04B4A3861B9CAAD700D88D68 /* ShopDetail.m */, + 04E721E11BA755FD008F9158 /* ProductUnit.h */, + 04E721E21BA755FD008F9158 /* ProductUnit.m */, ); path = Models; sourceTree = "<group>"; @@ -2534,6 +2539,7 @@ FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */, 0414FF171B94959700C7B00E /* NewPurchaseNoticeViewController.m in Sources */, 35CF33901B95AF1B001211EF /* GXFBaseSearchViewController.m in Sources */, + 04E721E31BA755FD008F9158 /* ProductUnit.m in Sources */, FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */, C182E40E1AD4CE0B009BB9DB /* IBTModel.m in Sources */, C1FE50411AE0240300C18080 /* IBTAVAudioPlayWrapper.m in Sources */, diff --git a/XFFruit/Controllers/HTTPController/ICRHTTPController.m b/XFFruit/Controllers/HTTPController/ICRHTTPController.m index 2bf3eb07b2c8d953d599ff78fb1a5483c75d5de4..1994061b9904acb407c7cdf728af8c0af0ddfac4 100644 --- a/XFFruit/Controllers/HTTPController/ICRHTTPController.m +++ b/XFFruit/Controllers/HTTPController/ICRHTTPController.m @@ -2280,7 +2280,37 @@ acceptTypeJson:YES success:(void (^)(id))succ failure:(void (^)(id))fail { + if (!data) { + if (fail) { + fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] ); + } + return; + } + void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) { + CLog(@"%@", responseObject); + if (succ) { + succ( responseObject ); + } + }; + void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) { + CLog(@"%@", error); + if (fail) { + fail( error ); + } + }; + NSDictionary *dict = data; + NSString *currentTime = [[NSDate date] httpParameterString]; + ICRUserUtil *userUtil = [ICRUserUtil sharedInstance]; + NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_savePurchaseNotice] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userCode,userUtil.displayName]; + NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + [self POST:encodeUrlStr + parameters:dict + needToken:NO +acceptTypeJson:YES + success:success + failure:failure]; + } //2·获å–采è´é€šçŸ¥å•列表 - (void)getPurchaseNoticeListWithData:(id)data diff --git a/XFFruit/Utilities/IBTUIKit/IBTConstants.h b/XFFruit/Utilities/IBTUIKit/IBTConstants.h index c475c167e6a1f2b2b028fd468ed332c8f0d18ebb..48b02bc5e7b23d0bb51b875344434733b28f1857 100644 --- a/XFFruit/Utilities/IBTUIKit/IBTConstants.h +++ b/XFFruit/Utilities/IBTUIKit/IBTConstants.h @@ -114,6 +114,7 @@ //refreshUpdateDate #define SurveyUpdateDate @"surveyUpdateDate" #define ChooseProductUpdateDate @"chooseProductUpdateDate" +#define ChooseProductUnitUpdateDate @"chooseProductUnitUpdateDate" #define ChoosePersonUpdateDate @"choosePersonUpdateDate" #define ChooseVendorUpdateDate @"chooseVendorUpdateDate" #define ChooseWarehouseUpdateDate @"chooseWarehouseUpdateDate" @@ -168,7 +169,7 @@ #define GXF_BASECLASS_WAREHOUSE @"Warehouse" #define GXF_BASECLASS_VENDOR @"Vendor" #define GXF_BASECLASS_PRODUCT @"Product" -#define GXF_BASECLASS_PRODUCTUNIT @"ProductUnit" +#define GXF_BASECLASS_PRODUCTUNIT @"GXFProductUnit" #define GXF_BASECLASS_USER @"User" diff --git a/XFFruit/ViewControllers/PurchaseNotice/Controllers/NewPurchaseNoticeViewController.m b/XFFruit/ViewControllers/PurchaseNotice/Controllers/NewPurchaseNoticeViewController.m index 2fe9185143c51cfa5616c35f401b7e14bdb59abd..bd97d29df2fd6b775d97cc5606bf305706701828 100644 --- a/XFFruit/ViewControllers/PurchaseNotice/Controllers/NewPurchaseNoticeViewController.m +++ b/XFFruit/ViewControllers/PurchaseNotice/Controllers/NewPurchaseNoticeViewController.m @@ -7,16 +7,17 @@ // #import "NewPurchaseNoticeViewController.h" - +#import "PurchaseNoticeViewController.h" #import "SurveyCell.h" #import "HPGrowingTextView.h" - +#import "SeePurchaseNoticeViewController.h" #import "ChosePersonViewController.h" #import "SurveyUser.h" #import "Survey.h" #import "PurchaseNoticeCell.h" #import "ShopDetaileViewController.h" #import "ShopDetail.h" +#import "PurchaseBillProduct.h" #define LeftMargin 15 #define LeftWidth 40 #define RightWidth 30 @@ -52,6 +53,10 @@ typedef enum : NSUInteger { NSMutableArray *selectCellAry; BOOL _isClickStart; UITableView *mingXiTableView; + id uuidObject; + id billNumberObject; + NSNumber *versionObject; + NSString *title; } @@ -64,6 +69,8 @@ typedef enum : NSUInteger { @property (nonatomic,strong)NSString *remarkStr; @property (nonatomic,strong)NSMutableArray *users; @property (nonatomic,strong)Survey *survey; +@property (nonatomic,strong)SurveyUser *surveyUser; + @property (nonatomic,strong)UILabel *HeardLabel; @property (nonatomic,strong)UILabel *FootLabel; @property (nonatomic,strong)UIButton *addDetailedButton; @@ -76,6 +83,10 @@ typedef enum : NSUInteger { - (void)viewDidLoad { [super viewDidLoad]; + //æ•°æ®é»˜è®¤å€¼ + uuidObject = [NSNull null]; + billNumberObject = [NSNull null]; + versionObject = [NSNumber numberWithInteger:0]; [self setupSubviews]; // Do any additional setup after loading the view. } @@ -280,6 +291,7 @@ typedef enum : NSUInteger { }else { textStr = [textStr stringByAppendingFormat:@"ã€%@",user.userName]; } + self.surveyUser=user; [self.users addObject:[user dictForCommit]]; } _personLabel.text = textStr; @@ -317,6 +329,7 @@ typedef enum : NSUInteger { _titleField.font = FontSize(15); _titleField.returnKeyType = UIReturnKeyDone; _titleField.delegate = self; + title=_titleField.text; [cell.contentView addSubview:_titleField]; }else if (indexPath.row == _dataArr.count -1){ @@ -462,22 +475,122 @@ typedef enum : NSUInteger { switch (btn.tag) { case SaveTag: { - // if ([self checkSurvey]) { - // [self saveSurvey:@"initial" message:@"æ£åœ¨ä¿å˜..."]; - // } + if ([self checkSurvey]) { + [self saveSurvey:@"initial" message:@"æ£åœ¨ä¿å˜..."]; + } } break; case CommitTag: { - // if ([self checkSurvey]) { - // [self saveSurvey:@"submitted" message:@"æ£åœ¨æäº¤..."]; - // } + if ([self checkSurvey]) { + [self saveSurvey:@"submitted" message:@"æ£åœ¨æäº¤..."]; + } } break; default: break; } } +- (BOOL)checkSurvey{ + self.titleStr = _titleField.text; + self.remarkStr = _noteTextView.text; + if ( self.titleStr.length==0) { + ShowMessage(@"采è´é€šçŸ¥å•æ ‡é¢˜ä¸èƒ½ä¸ºç©º"); + return NO; + } + if (_personLabel.text.length == 0 ) { + ShowMessage(@"采è´å‘˜ä¸èƒ½ä¸ºç©º"); + return NO; + } + if (_shopeArr.count==0) { + ShowMessage(@"商哿˜Žç»†ä¸èƒ½ä¸ºç©º"); + return NO; + + } +// if (self.productUuidStr.length == 0 || self.productNameStr.length == 0|| self.productCodeStr.length == 0 ) { +// ShowMessage(@"è°ƒç ”å•†å“ä¸èƒ½ä¸ºç©º"); +// return NO; +// } +// if (self.beginDateStr.length == 0) { +// ShowMessage(@"è°ƒç ”å¼€å§‹æ—¥æœŸä¸èƒ½ä¸ºç©º"); +// return NO; +// } +// if (self.endDateStr.length == 0) { +// ShowMessage(@"è°ƒç ”ç»“æŸæ—¥æœŸä¸èƒ½ä¸ºç©º"); +// return NO; +// } +// if (self.users.count <=0) { +// ShowMessage(@"è°ƒç ”äººå‘˜ä¸èƒ½ä¸ºç©º"); +// return NO; +// } +// if ([IBTCommon compareDate:self.beginDateStr withDate:self.endDateStr] < 0) { +// ShowMessage(@"开始日期ä¸èƒ½å°äºŽç»“æŸæ—¥æœŸ"); +// return NO; +// } +// + return YES; +} +- (void)saveSurvey:(NSString *)state message:(NSString *)msg +{ + //ä¿å˜ + void(^succ)(id) = ^(id data) { + [IBTLoadingView hideHUDWithText:nil]; + if (data) { + NSInteger success = [data[@"success"] integerValue]; + NSString *message = data[@"message"]; + if (success == 1) { + //æˆåŠŸ + if ([state isEqualToString:@"initial"]) {//ä¿å˜æˆåŠŸ +// NSString *uuidS = data[@"data"][@"uuid"]; +// NSString *billNumberS = data[@"data"][@"billNumber"]; +// NSNumber *versionN = data[@"data"][@"version"]; +//// uuidObject = uuidS; +//// billNumberObject = billNumberS; +//// versionObject = versionN; +// [IBTLoadingView showTips:[NSString stringWithFormat:@"当å‰å•æ®%@å·²ä¿å˜æˆåŠŸ",billNumberS]]; + }else{//æäº¤æˆåŠŸ + PurchaseNoticeViewController *svc = [PurchaseNoticeViewController new]; + [self PushViewController:svc animated:YES]; + } + }else{ + [IBTLoadingView showTips:message]; + } + } + }; + void(^fail)(id) = ^(id data) { + [IBTLoadingView hideHUDWithText:nil]; + [IBTLoadingView showTips:data]; + }; + +// if(self.survey.uuid.length > 0 && uuidObject == [NSNull null]){ +// uuidObject = self.survey.uuid; +// } +// if (self.survey.billNumber > 0 && billNumberObject == [NSNull null]) { +// billNumberObject = self.survey.billNumber; +// } +// if (self.survey && [versionObject integerValue] == 0) { +// versionObject = self.survey.version; +// } + NSMutableArray *billProducts = [NSMutableArray array]; + for (ShopDetail *billProduct in _shopeArr) { + [billProducts addObject:[billProduct dictForCommit]]; + } + + NSDictionary *dict = @{@"uuid":uuidObject,//å”¯ä¸€æ ‡è¯† + @"billnumber":billNumberObject, + @"version":versionObject, + @"title":title, + + @"state":state, + + @"purchaserUuid":self.surveyUser.userUuid, + @"purchaserCode":self.surveyUser.userCode, + @"purchaserName":self.surveyUser.userName, + + @"remark":_noteTextView.text, + @"products":billProducts}; [IBTLoadingView showProgressLabel:msg]; + [[ICRHTTPController sharedController] savePurchaseNoticeWithData:dict success:succ failure:fail]; +} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; diff --git a/XFFruit/ViewControllers/PurchaseNotice/Controllers/PurchaseNoticeViewController.m b/XFFruit/ViewControllers/PurchaseNotice/Controllers/PurchaseNoticeViewController.m index 10e972547bd7ca190ee7c7de5736b13891bd1a6f..51d0751eae5b3d9171a8dff89449730884152296 100644 --- a/XFFruit/ViewControllers/PurchaseNotice/Controllers/PurchaseNoticeViewController.m +++ b/XFFruit/ViewControllers/PurchaseNotice/Controllers/PurchaseNoticeViewController.m @@ -302,7 +302,8 @@ typedef enum : NSUInteger { }else{ [btn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal]; if (_boltView == nil) { - _boltView = [[PurchaseBoltView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 274) state:self.state billNumber:self.billLike noticeNumber:self.noticeLike]; + _boltView = [[PurchaseBoltView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 274) state:self.state billNumber:self.billLike titleStr:@"采è´é€šçŸ¥" vendorNumber:self.noticeLike]; +// _boltView = [[PurchaseBoltView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 274) state:self.state billNumber:self.billLike noticeNumber:self.noticeLike]; _boltView.backgroundColor = XXFBgColor; _boltView.delegate = self; @@ -380,7 +381,8 @@ typedef enum : NSUInteger { - (void)sureClick{ if (self.state.length > 0 || self.billLike.length > 0 || self.noticeLike.length > 0 ||self.orderDirection.length > 0) { - [_boltView.noticeFiled resignFirstResponder]; + [_boltView.titleFiled resignFirstResponder]; + [_boltView.vendorFiled resignFirstResponder]; [_boltView.billFiled resignFirstResponder]; _currentPage = 0; diff --git a/XFFruit/ViewControllers/PurchaseNotice/Controllers/SeePurchaseNoticeViewController.m b/XFFruit/ViewControllers/PurchaseNotice/Controllers/SeePurchaseNoticeViewController.m index 07f565670b3f48d92739632b8e10acdb56277a49..e50b4beed9a7d6baaa8b21937a0ca90534f1dd06 100644 --- a/XFFruit/ViewControllers/PurchaseNotice/Controllers/SeePurchaseNoticeViewController.m +++ b/XFFruit/ViewControllers/PurchaseNotice/Controllers/SeePurchaseNoticeViewController.m @@ -272,7 +272,7 @@ typedef enum : NSUInteger { }else if ([self.bill.state isEqualToString:PURCHASE_STATE_REJECTED]) { self.stateLabel.textColor = [UIColor grayColor]; self.stateLabel.text = @"已拒ç»"; - }else if ([self.bill.state isEqualToString:PURCHASE_STATE_APPROVED]) { + }else if ([self.bill.state isEqualToString:PURCHASE_STATE_SHIPPING]) { self.stateLabel.textColor = [UIColor grayColor]; self.stateLabel.text = @"已审批"; }else if ([self.bill.state isEqualToString:PURCHASE_STATE_SHIPPING]) { diff --git a/XFFruit/ViewControllers/PurchaseNotice/Models/ProductUnit.h b/XFFruit/ViewControllers/PurchaseNotice/Models/ProductUnit.h new file mode 100644 index 0000000000000000000000000000000000000000..40e219cff91c6c6f9370cde0a4d08cf5e8b156c2 --- /dev/null +++ b/XFFruit/ViewControllers/PurchaseNotice/Models/ProductUnit.h @@ -0,0 +1,37 @@ +// +// ProductUnit.h +// XFFruit +// +// Created by mac on 15/9/15. +// Copyright (c) 2015å¹´ Xummer. All rights reserved. +// + +#import "IBTModel.h" + +@interface ProductUnit : IBTModel +@property (nonatomic,strong)NSString *uuid;//商å“uuid +@property (nonatomic,strong)NSString *code;//代ç +@property (nonatomic,strong)NSString *secondCode;//第二代ç +@property (nonatomic,strong)NSString *name;//åç§° +@property (nonatomic,strong)NSString *qpc;//é»˜è®¤è§„æ ¼ +@property (nonatomic,strong)NSString *qpcStr;//é»˜è®¤è§„æ ¼è¯´æ˜Ž +@property (nonatomic,strong)NSString *measureUnit;//é»˜è®¤è§„æ ¼å•ä½ +@property (nonatomic,strong)NSString *brandName;//å“牌åç§° +@property (nonatomic,strong)NSString *manufactory;//生产厂商 +@property (nonatomic,strong)NSString *isNew;//æ˜¯å¦æ–°å“ +@property (nonatomic,strong)NSString *categoryUuid;//所属商å“类别 +@property (nonatomic,strong)NSString *image;//图片相对路径 +@property (nonatomic,strong)NSDate *create_time;//创建时间 +@property (nonatomic,strong)NSString *create_id;//创建人代ç +@property (nonatomic,strong)NSString *create_operName;//创建人åç§° +@property (nonatomic,strong)NSDate *lastModify_time;//最åŽä¿®æ”¹æ—¶é—´ +@property (nonatomic,strong)NSString *lastModify_id;//最åŽä¿®æ”¹äººä»£ç +@property (nonatomic,strong)NSString *lastModify_operName;//最åŽä¿®æ”¹äººåç§° +@property (nonatomic,assign)NSInteger enabled;//是å¦å¯ç”¨ +@property (nonatomic,strong)NSString *barcode; +@property (nonatomic,strong)NSString *enterprise; +@property (nonatomic,strong)NSString *remark; +@property (nonatomic,strong)NSString *specification; +@property (nonatomic,strong)NSString *version; + +@end diff --git a/XFFruit/ViewControllers/PurchaseNotice/Models/ProductUnit.m b/XFFruit/ViewControllers/PurchaseNotice/Models/ProductUnit.m new file mode 100644 index 0000000000000000000000000000000000000000..aa600d9b8e1bb78661395fb3c9d1a1a482bed27e --- /dev/null +++ b/XFFruit/ViewControllers/PurchaseNotice/Models/ProductUnit.m @@ -0,0 +1,20 @@ +// +// ProductUnit.m +// XFFruit +// +// Created by mac on 15/9/15. +// Copyright (c) 2015å¹´ Xummer. All rights reserved. +// + +#import "ProductUnit.h" + +@implementation ProductUnit ++ (NSDictionary *)specialKeysAndReplaceKeys { + return @{ @"pID" : [[self class] PrimaryKey], }; +} + ++ (NSString *)PrimaryKey { + return @"uuid"; +} + +@end diff --git a/XFFruit/ViewControllers/PurchaseNotice/Views/ChooseProductUnitViewController.m b/XFFruit/ViewControllers/PurchaseNotice/Views/ChooseProductUnitViewController.m index 98bb207bbad617310ad2dca4914ef7f356149ff6..f8985e686a3c3f92622c1821b7c9715863d9aa8f 100644 --- a/XFFruit/ViewControllers/PurchaseNotice/Views/ChooseProductUnitViewController.m +++ b/XFFruit/ViewControllers/PurchaseNotice/Views/ChooseProductUnitViewController.m @@ -14,11 +14,10 @@ @end @implementation ChooseProductUnitViewController - - (void)viewDidLoad { [super viewDidLoad]; //记录更新时间 - self.tableView.header.lastUpdatedTimeKey = ChooseProductUpdateDate; + self.tableView.header.lastUpdatedTimeKey = ChooseProductUnitUpdateDate; self.title = @"选择包装å•ä½"; [self fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCTUNIT]; } @@ -35,8 +34,7 @@ [IBTLoadingView showTips:data]; }; [IBTLoadingView showProgressLabel:@"æ£åœ¨åŠ è½½..."]; - [[ICRHTTPController sharedController]getProductunitWithPage_number:0 page_size:100 success:succ failure:fail]; -// [[ICRHTTPController sharedController] getProductWithPage_number:0 page_size:100 success:succ failure:fail]; + [[ICRHTTPController sharedController] getProductWithPage_number:0 page_size:100 success:succ failure:fail]; } #pragma mark -æˆåŠŸ - (void)fetchProductList:(NSString *)titleStr{ @@ -53,8 +51,8 @@ __weak typeof(self)weakSelf = self; ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) { __strong __typeof(weakSelf)strongSelf = weakSelf; - if (![GXF_NSUSERFEFTAULTS objectForKey:ChooseProductUpdateDate]) { - [GXF_NSUSERFEFTAULTS setObject:[NSDate date] forKey:ChooseProductUpdateDate]; + if (![GXF_NSUSERFEFTAULTS objectForKey:ChooseProductUnitUpdateDate]) { + [GXF_NSUSERFEFTAULTS setObject:[NSDate date] forKey:ChooseProductUnitUpdateDate]; [GXF_NSUSERFEFTAULTS synchronize]; [self getBaseDataFromServer]; }else{ diff --git a/XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m b/XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m index 42492b9e6fa5d54b687d01c92f89fbd03aed97ff..18258f04b5894608bb9d7330508b5c2e14093e03 100644 --- a/XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m +++ b/XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m @@ -14,6 +14,8 @@ #import "ChooseProductViewController.h" #import "SelectCompanyViewController.h" #import "ChooseProductUnitViewController.h" +#import "GXFSearchVendorViewController.h" +#import "GXFProductUnit.h" #import "SurveyUser.h" #import "Survey.h" #import "Product.h" @@ -197,7 +199,7 @@ typedef enum : NSUInteger { foundationQuantity.text=@""; //åŸºç¡€æ•°é‡ foundationUnitPrice.text=@""; //基础å•ä»· packageUnitPrice.text=@""; //包装å•ä»· - totalMoney.text=@""; //æ€»é‡‘é¢ + totalMoney.text=@"0"; //æ€»é‡‘é¢ remark.text=@""; _productLabel.textColor=GXF_PLACEHOLDER_COLOR; _PackagingLable.textColor=GXF_PLACEHOLDER_COLOR; @@ -383,6 +385,7 @@ typedef enum : NSUInteger { }else { + _titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)]; _titleField.textAlignment = NSTextAlignmentRight; _titleField.textColor = GXF_CONTENT_COLOR; @@ -406,14 +409,36 @@ typedef enum : NSUInteger { { foundationUnitPrice=_titleField; //基础å•ä»· _titleField.placeholder = @"输入基础å•ä»·"; + _titleField.frame = CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-30, TableHeight); + UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_titleField.frame) + 5, 0, 20, TableHeight)]; + label.text = @"å…ƒ"; + label.textColor = GXF_CONTENT_COLOR; + label.font = GXF_FIFTEENTEN_SIZE; + [cell.contentView addSubview:label]; }else if (indexPath.row==6) { packageUnitPrice=_titleField; //包装å•ä»· _titleField.placeholder = @"输入包装å•ä»·"; + _titleField.frame = CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-30, TableHeight); + UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_titleField.frame) + 5, 0, 20, TableHeight)]; + label.text = @"å…ƒ"; + label.textColor = GXF_CONTENT_COLOR; + label.font = GXF_FIFTEENTEN_SIZE; + [cell.contentView addSubview:label]; }else if (indexPath.row==7) { totalMoney=_titleField; //æ€»é‡‘é¢ _titleField.placeholder = @"输入总金é¢"; + _titleField.text = @"0"; + _titleField.frame = CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-30, TableHeight); + _titleField.textColor = [UIColor redColor]; + + UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_titleField.frame)+ 5, 0, 20, TableHeight)]; + label.text = @"å…ƒ"; + label.textColor = GXF_CONTENT_COLOR; + label.font = GXF_FIFTEENTEN_SIZE; + [cell.contentView addSubview:label]; + }else if (indexPath.row==8) { remark=_titleField; //备注 @@ -442,19 +467,36 @@ typedef enum : NSUInteger { [self PushViewController:cvc animated:YES]; }else if (indexPath.row ==3) { - +// æ— æ•°æ® +// GXFSearchVendorViewController *vc = [[GXFSearchVendorViewController alloc]initWithTitle:[IBTCommon localizableString:@"ProductUnitTitle"]]; +// vc.choseVendor = ^(NSArray *vendors){ +// if (vendors.count > 0) { +// GXFProductUnit *productUnit = vendors[0]; +// _PackagingLable.text = [NSString stringWithFormat:@"%@[%@]",productUnit.name,productUnit.uuid]; +// packageUnit.text = [NSString stringWithFormat:@"%@[%@]",productUnit.name,productUnit.uuid]; +// _PackagingLable.textColor = GXF_CONTENT_COLOR; +// self.productUuidStr = productUnit.uuid; +// +// self.productNameStr = productUnit.name; +// } +// }; +// [self PushViewController:vc animated:YES]; +// 陈俊 ChooseProductUnitViewController *cvc = [ChooseProductUnitViewController new]; cvc.choseBaseInfo = ^(NSArray *products){ Product *product=products [0]; - _productLabel.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code]; - merchandise.text=product.name; - _productLabel.textColor = GXF_CONTENT_COLOR; + _PackagingLable.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code]; + packageUnit.text= [NSString stringWithFormat:@"%@[%@]",product.name,product.code]; + _PackagingLable.textColor = GXF_CONTENT_COLOR; +// merchandise.text=product.name; + self.productNameStr = product.name; self.productUuidStr = product.uuid; self.productCodeStr = product.code; }; - cvc.isMoreChose = NO;//是å¦å¤šé€‰ + cvc.isMoreChose = NO; [self PushViewController:cvc animated:YES]; +// 自己 // SelectCompanyViewController *vc=[SelectCompanyViewController new]; // vc.chosePackaging = ^(NSString *Packaging){ // @@ -463,8 +505,8 @@ typedef enum : NSUInteger { // _PackagingLable.textColor = GXF_CONTENT_COLOR; // // }; - - +// +// // [self PushViewController:vc animated:YES]; } diff --git a/XFFruit/en.lproj/Localizable.strings b/XFFruit/en.lproj/Localizable.strings index 99e89d35b8fce939780666af7e598fee667407d6..42330a66367d29e9a296f2749bf171214598f294 100644 --- a/XFFruit/en.lproj/Localizable.strings +++ b/XFFruit/en.lproj/Localizable.strings @@ -212,4 +212,5 @@ "EditorShopDetail" ="ç¼–è¾‘å•†å“æ˜Žç»†"; "AddShopDetail" ="æ·»åŠ å•†å“æ˜Žç»†"; - +"ProductUnitTitle" = "商å“å•ä½"; +"ProductUnitTitle" = "商å“å•ä½"; \ No newline at end of file