Commit e113e90b authored by zhu's avatar zhu

no message

parent dfef3048
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
0414FF1B1B94959700C7B00E /* ShopDetaileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF161B94959700C7B00E /* ShopDetaileViewController.m */; }; 0414FF1B1B94959700C7B00E /* ShopDetaileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF161B94959700C7B00E /* ShopDetaileViewController.m */; };
04B4A3871B9CAAD700D88D68 /* ShopDetail.m in Sources */ = {isa = PBXBuildFile; fileRef = 04B4A3861B9CAAD700D88D68 /* ShopDetail.m */; }; 04B4A3871B9CAAD700D88D68 /* ShopDetail.m in Sources */ = {isa = PBXBuildFile; fileRef = 04B4A3861B9CAAD700D88D68 /* ShopDetail.m */; };
04E721E01BA73CE2008F9158 /* ChooseProductUnitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04E721DF1BA73CE2008F9158 /* ChooseProductUnitViewController.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 */; }; 04F6E70A1B9B08A500550849 /* PurchaseNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F6E7091B9B08A500550849 /* PurchaseNoticeViewController.m */; };
300DD94A1B184B450080EE12 /* ICRPatrolPlan.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD9491B184B450080EE12 /* ICRPatrolPlan.m */; }; 300DD94A1B184B450080EE12 /* ICRPatrolPlan.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD9491B184B450080EE12 /* ICRPatrolPlan.m */; };
300DD94B1B184B450080EE12 /* 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 @@ ...@@ -467,6 +468,8 @@
04B4A3861B9CAAD700D88D68 /* ShopDetail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopDetail.m; sourceTree = "<group>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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>"; }; 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 @@ ...@@ -1057,6 +1060,8 @@
children = ( children = (
04B4A3851B9CAAD700D88D68 /* ShopDetail.h */, 04B4A3851B9CAAD700D88D68 /* ShopDetail.h */,
04B4A3861B9CAAD700D88D68 /* ShopDetail.m */, 04B4A3861B9CAAD700D88D68 /* ShopDetail.m */,
04E721E11BA755FD008F9158 /* ProductUnit.h */,
04E721E21BA755FD008F9158 /* ProductUnit.m */,
); );
path = Models; path = Models;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2534,6 +2539,7 @@ ...@@ -2534,6 +2539,7 @@
FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */, FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */,
0414FF171B94959700C7B00E /* NewPurchaseNoticeViewController.m in Sources */, 0414FF171B94959700C7B00E /* NewPurchaseNoticeViewController.m in Sources */,
35CF33901B95AF1B001211EF /* GXFBaseSearchViewController.m in Sources */, 35CF33901B95AF1B001211EF /* GXFBaseSearchViewController.m in Sources */,
04E721E31BA755FD008F9158 /* ProductUnit.m in Sources */,
FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */, FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */,
C182E40E1AD4CE0B009BB9DB /* IBTModel.m in Sources */, C182E40E1AD4CE0B009BB9DB /* IBTModel.m in Sources */,
C1FE50411AE0240300C18080 /* IBTAVAudioPlayWrapper.m in Sources */, C1FE50411AE0240300C18080 /* IBTAVAudioPlayWrapper.m in Sources */,
......
...@@ -2280,6 +2280,36 @@ acceptTypeJson:YES ...@@ -2280,6 +2280,36 @@ acceptTypeJson:YES
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail 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·获取采购通知单列表 //2·获取采购通知单列表
......
...@@ -114,6 +114,7 @@ ...@@ -114,6 +114,7 @@
//refreshUpdateDate //refreshUpdateDate
#define SurveyUpdateDate @"surveyUpdateDate" #define SurveyUpdateDate @"surveyUpdateDate"
#define ChooseProductUpdateDate @"chooseProductUpdateDate" #define ChooseProductUpdateDate @"chooseProductUpdateDate"
#define ChooseProductUnitUpdateDate @"chooseProductUnitUpdateDate"
#define ChoosePersonUpdateDate @"choosePersonUpdateDate" #define ChoosePersonUpdateDate @"choosePersonUpdateDate"
#define ChooseVendorUpdateDate @"chooseVendorUpdateDate" #define ChooseVendorUpdateDate @"chooseVendorUpdateDate"
#define ChooseWarehouseUpdateDate @"chooseWarehouseUpdateDate" #define ChooseWarehouseUpdateDate @"chooseWarehouseUpdateDate"
...@@ -168,7 +169,7 @@ ...@@ -168,7 +169,7 @@
#define GXF_BASECLASS_WAREHOUSE @"Warehouse" #define GXF_BASECLASS_WAREHOUSE @"Warehouse"
#define GXF_BASECLASS_VENDOR @"Vendor" #define GXF_BASECLASS_VENDOR @"Vendor"
#define GXF_BASECLASS_PRODUCT @"Product" #define GXF_BASECLASS_PRODUCT @"Product"
#define GXF_BASECLASS_PRODUCTUNIT @"ProductUnit" #define GXF_BASECLASS_PRODUCTUNIT @"GXFProductUnit"
#define GXF_BASECLASS_USER @"User" #define GXF_BASECLASS_USER @"User"
......
...@@ -7,16 +7,17 @@ ...@@ -7,16 +7,17 @@
// //
#import "NewPurchaseNoticeViewController.h" #import "NewPurchaseNoticeViewController.h"
#import "PurchaseNoticeViewController.h"
#import "SurveyCell.h" #import "SurveyCell.h"
#import "HPGrowingTextView.h" #import "HPGrowingTextView.h"
#import "SeePurchaseNoticeViewController.h"
#import "ChosePersonViewController.h" #import "ChosePersonViewController.h"
#import "SurveyUser.h" #import "SurveyUser.h"
#import "Survey.h" #import "Survey.h"
#import "PurchaseNoticeCell.h" #import "PurchaseNoticeCell.h"
#import "ShopDetaileViewController.h" #import "ShopDetaileViewController.h"
#import "ShopDetail.h" #import "ShopDetail.h"
#import "PurchaseBillProduct.h"
#define LeftMargin 15 #define LeftMargin 15
#define LeftWidth 40 #define LeftWidth 40
#define RightWidth 30 #define RightWidth 30
...@@ -52,6 +53,10 @@ typedef enum : NSUInteger { ...@@ -52,6 +53,10 @@ typedef enum : NSUInteger {
NSMutableArray *selectCellAry; NSMutableArray *selectCellAry;
BOOL _isClickStart; BOOL _isClickStart;
UITableView *mingXiTableView; UITableView *mingXiTableView;
id uuidObject;
id billNumberObject;
NSNumber *versionObject;
NSString *title;
} }
...@@ -64,6 +69,8 @@ typedef enum : NSUInteger { ...@@ -64,6 +69,8 @@ typedef enum : NSUInteger {
@property (nonatomic,strong)NSString *remarkStr; @property (nonatomic,strong)NSString *remarkStr;
@property (nonatomic,strong)NSMutableArray *users; @property (nonatomic,strong)NSMutableArray *users;
@property (nonatomic,strong)Survey *survey; @property (nonatomic,strong)Survey *survey;
@property (nonatomic,strong)SurveyUser *surveyUser;
@property (nonatomic,strong)UILabel *HeardLabel; @property (nonatomic,strong)UILabel *HeardLabel;
@property (nonatomic,strong)UILabel *FootLabel; @property (nonatomic,strong)UILabel *FootLabel;
@property (nonatomic,strong)UIButton *addDetailedButton; @property (nonatomic,strong)UIButton *addDetailedButton;
...@@ -76,6 +83,10 @@ typedef enum : NSUInteger { ...@@ -76,6 +83,10 @@ typedef enum : NSUInteger {
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
//数据默认值
uuidObject = [NSNull null];
billNumberObject = [NSNull null];
versionObject = [NSNumber numberWithInteger:0];
[self setupSubviews]; [self setupSubviews];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
...@@ -280,6 +291,7 @@ typedef enum : NSUInteger { ...@@ -280,6 +291,7 @@ typedef enum : NSUInteger {
}else { }else {
textStr = [textStr stringByAppendingFormat:@"、%@",user.userName]; textStr = [textStr stringByAppendingFormat:@"、%@",user.userName];
} }
self.surveyUser=user;
[self.users addObject:[user dictForCommit]]; [self.users addObject:[user dictForCommit]];
} }
_personLabel.text = textStr; _personLabel.text = textStr;
...@@ -317,6 +329,7 @@ typedef enum : NSUInteger { ...@@ -317,6 +329,7 @@ typedef enum : NSUInteger {
_titleField.font = FontSize(15); _titleField.font = FontSize(15);
_titleField.returnKeyType = UIReturnKeyDone; _titleField.returnKeyType = UIReturnKeyDone;
_titleField.delegate = self; _titleField.delegate = self;
title=_titleField.text;
[cell.contentView addSubview:_titleField]; [cell.contentView addSubview:_titleField];
}else if (indexPath.row == _dataArr.count -1){ }else if (indexPath.row == _dataArr.count -1){
...@@ -462,22 +475,122 @@ typedef enum : NSUInteger { ...@@ -462,22 +475,122 @@ typedef enum : NSUInteger {
switch (btn.tag) { switch (btn.tag) {
case SaveTag: case SaveTag:
{ {
// if ([self checkSurvey]) { if ([self checkSurvey]) {
// [self saveSurvey:@"initial" message:@"正在保存..."]; [self saveSurvey:@"initial" message:@"正在保存..."];
// } }
} }
break; break;
case CommitTag: case CommitTag:
{ {
// if ([self checkSurvey]) { if ([self checkSurvey]) {
// [self saveSurvey:@"submitted" message:@"正在提交..."]; [self saveSurvey:@"submitted" message:@"正在提交..."];
// } }
} }
break; break;
default: default:
break; 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 { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
......
...@@ -302,7 +302,8 @@ typedef enum : NSUInteger { ...@@ -302,7 +302,8 @@ typedef enum : NSUInteger {
}else{ }else{
[btn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal]; [btn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal];
if (_boltView == nil) { 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.backgroundColor = XXFBgColor;
_boltView.delegate = self; _boltView.delegate = self;
...@@ -380,7 +381,8 @@ typedef enum : NSUInteger { ...@@ -380,7 +381,8 @@ typedef enum : NSUInteger {
- (void)sureClick{ - (void)sureClick{
if (self.state.length > 0 || self.billLike.length > 0 || self.noticeLike.length > 0 ||self.orderDirection.length > 0) { 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]; [_boltView.billFiled resignFirstResponder];
_currentPage = 0; _currentPage = 0;
......
...@@ -272,7 +272,7 @@ typedef enum : NSUInteger { ...@@ -272,7 +272,7 @@ typedef enum : NSUInteger {
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_REJECTED]) { }else if ([self.bill.state isEqualToString:PURCHASE_STATE_REJECTED]) {
self.stateLabel.textColor = [UIColor grayColor]; self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"已拒绝"; 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.textColor = [UIColor grayColor];
self.stateLabel.text = @"已审批"; self.stateLabel.text = @"已审批";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_SHIPPING]) { }else if ([self.bill.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
......
//
// 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
//
// 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
...@@ -14,11 +14,10 @@ ...@@ -14,11 +14,10 @@
@end @end
@implementation ChooseProductUnitViewController @implementation ChooseProductUnitViewController
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
//记录更新时间 //记录更新时间
self.tableView.header.lastUpdatedTimeKey = ChooseProductUpdateDate; self.tableView.header.lastUpdatedTimeKey = ChooseProductUnitUpdateDate;
self.title = @"选择包装单位"; self.title = @"选择包装单位";
[self fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCTUNIT]; [self fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCTUNIT];
} }
...@@ -35,8 +34,7 @@ ...@@ -35,8 +34,7 @@
[IBTLoadingView showTips:data]; [IBTLoadingView showTips:data];
}; };
[IBTLoadingView showProgressLabel:@"正在加载..."]; [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 -成功 #pragma mark -成功
- (void)fetchProductList:(NSString *)titleStr{ - (void)fetchProductList:(NSString *)titleStr{
...@@ -53,8 +51,8 @@ ...@@ -53,8 +51,8 @@
__weak typeof(self)weakSelf = self; __weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) { ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf; __strong __typeof(weakSelf)strongSelf = weakSelf;
if (![GXF_NSUSERFEFTAULTS objectForKey:ChooseProductUpdateDate]) { if (![GXF_NSUSERFEFTAULTS objectForKey:ChooseProductUnitUpdateDate]) {
[GXF_NSUSERFEFTAULTS setObject:[NSDate date] forKey:ChooseProductUpdateDate]; [GXF_NSUSERFEFTAULTS setObject:[NSDate date] forKey:ChooseProductUnitUpdateDate];
[GXF_NSUSERFEFTAULTS synchronize]; [GXF_NSUSERFEFTAULTS synchronize];
[self getBaseDataFromServer]; [self getBaseDataFromServer];
}else{ }else{
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#import "ChooseProductViewController.h" #import "ChooseProductViewController.h"
#import "SelectCompanyViewController.h" #import "SelectCompanyViewController.h"
#import "ChooseProductUnitViewController.h" #import "ChooseProductUnitViewController.h"
#import "GXFSearchVendorViewController.h"
#import "GXFProductUnit.h"
#import "SurveyUser.h" #import "SurveyUser.h"
#import "Survey.h" #import "Survey.h"
#import "Product.h" #import "Product.h"
...@@ -197,7 +199,7 @@ typedef enum : NSUInteger { ...@@ -197,7 +199,7 @@ typedef enum : NSUInteger {
foundationQuantity.text=@""; //基础数量 foundationQuantity.text=@""; //基础数量
foundationUnitPrice.text=@""; //基础单价 foundationUnitPrice.text=@""; //基础单价
packageUnitPrice.text=@""; //包装单价 packageUnitPrice.text=@""; //包装单价
totalMoney.text=@""; //总金额 totalMoney.text=@"0"; //总金额
remark.text=@""; remark.text=@"";
_productLabel.textColor=GXF_PLACEHOLDER_COLOR; _productLabel.textColor=GXF_PLACEHOLDER_COLOR;
_PackagingLable.textColor=GXF_PLACEHOLDER_COLOR; _PackagingLable.textColor=GXF_PLACEHOLDER_COLOR;
...@@ -383,6 +385,7 @@ typedef enum : NSUInteger { ...@@ -383,6 +385,7 @@ typedef enum : NSUInteger {
}else }else
{ {
_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 = GXF_CONTENT_COLOR; _titleField.textColor = GXF_CONTENT_COLOR;
...@@ -406,14 +409,36 @@ typedef enum : NSUInteger { ...@@ -406,14 +409,36 @@ typedef enum : NSUInteger {
{ {
foundationUnitPrice=_titleField; //基础单价 foundationUnitPrice=_titleField; //基础单价
_titleField.placeholder = @"输入基础单价"; _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) }else if (indexPath.row==6)
{ {
packageUnitPrice=_titleField; //包装单价 packageUnitPrice=_titleField; //包装单价
_titleField.placeholder = @"输入包装单价"; _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) }else if (indexPath.row==7)
{ {
totalMoney=_titleField; //总金额 totalMoney=_titleField; //总金额
_titleField.placeholder = @"输入总金额"; _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) }else if (indexPath.row==8)
{ {
remark=_titleField; //备注 remark=_titleField; //备注
...@@ -442,19 +467,36 @@ typedef enum : NSUInteger { ...@@ -442,19 +467,36 @@ typedef enum : NSUInteger {
[self PushViewController:cvc animated:YES]; [self PushViewController:cvc animated:YES];
}else if (indexPath.row ==3) }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]; ChooseProductUnitViewController *cvc = [ChooseProductUnitViewController new];
cvc.choseBaseInfo = ^(NSArray *products){ cvc.choseBaseInfo = ^(NSArray *products){
Product *product=products [0]; Product *product=products [0];
_productLabel.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code]; _PackagingLable.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code];
merchandise.text=product.name; packageUnit.text= [NSString stringWithFormat:@"%@[%@]",product.name,product.code];
_productLabel.textColor = GXF_CONTENT_COLOR; _PackagingLable.textColor = GXF_CONTENT_COLOR;
// merchandise.text=product.name;
self.productNameStr = product.name; self.productNameStr = product.name;
self.productUuidStr = product.uuid; self.productUuidStr = product.uuid;
self.productCodeStr = product.code; self.productCodeStr = product.code;
}; };
cvc.isMoreChose = NO;//是否多选 cvc.isMoreChose = NO;
[self PushViewController:cvc animated:YES]; [self PushViewController:cvc animated:YES];
// 自己
// SelectCompanyViewController *vc=[SelectCompanyViewController new]; // SelectCompanyViewController *vc=[SelectCompanyViewController new];
// vc.chosePackaging = ^(NSString *Packaging){ // vc.chosePackaging = ^(NSString *Packaging){
// //
...@@ -463,8 +505,8 @@ typedef enum : NSUInteger { ...@@ -463,8 +505,8 @@ typedef enum : NSUInteger {
// _PackagingLable.textColor = GXF_CONTENT_COLOR; // _PackagingLable.textColor = GXF_CONTENT_COLOR;
// //
// }; // };
//
//
// [self PushViewController:vc animated:YES]; // [self PushViewController:vc animated:YES];
} }
......
...@@ -212,4 +212,5 @@ ...@@ -212,4 +212,5 @@
"EditorShopDetail" ="编辑商品明细"; "EditorShopDetail" ="编辑商品明细";
"AddShopDetail" ="添加商品明细"; "AddShopDetail" ="添加商品明细";
"ProductUnitTitle" = "商品单位";
"ProductUnitTitle" = "商品单位";
\ No newline at end of file
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