Commit d1e107d3 authored by 朱朝吉's avatar 朱朝吉

Merge branch 'DEV_20150805_001' of http://121.42.32.57/root/xffruit into DEV_20150805_001

parents ff97980e a38b0bed
......@@ -211,6 +211,7 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
//结束行情反馈(写)
- (void)surveyFinishWithUuid:(NSString *)uuid
version:(NSNumber *)version
success:(void (^)(id))succ
failure:(void (^)(id))fail;
......
......@@ -1534,6 +1534,7 @@ acceptTypeJson:YES
//结束行情反馈(写)
- (void)surveyFinishWithUuid:(NSString *)uuid
version:(NSNumber *)version
success:(void (^)(id))succ
failure:(void (^)(id))fail{
......@@ -1558,9 +1559,9 @@ acceptTypeJson:YES
};
NSString *currentTime = [[NSDate date] httpParameterString];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveyFinish] stringByAppendingFormat:@"/%@?time=%@&operId=%@&operName=%@",uuid,currentTime,userUtil.userCode,userUtil.displayName];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveyFinish] stringByAppendingFormat:@"/%@?version=%@&time=%@&operId=%@&operName=%@",uuid,version,currentTime,userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self GET:encodeUrlStr
[self POST:encodeUrlStr
parameters:nil
needToken:NO
acceptTypeJson:YES
......
......@@ -17,6 +17,7 @@
@property (assign, nonatomic) BOOL bNotAutoAddCancelButton;
@property (strong, nonatomic) NSString *cancelButtonName; // 为当前设置 ModuleView Left Close button
- (void)safeSetEdgesForExtendedLayout:(UIRectEdge)extendedLayout;
- (BOOL)isPresentedIn;
......
......@@ -17,6 +17,7 @@
@property (copy, nonatomic) NSString *token;
@property (copy, nonatomic) NSNumber *bAutoLogin;
@property (copy, nonatomic) NSString *authenticode;
@property (assign,nonatomic)BOOL needFresh;
// User Data
@property (copy, nonatomic) NSString *displayName;
......
......@@ -20,6 +20,9 @@
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,weak)id <BoltMaskViewDelegate>delegate;
@property (nonatomic,strong)UITextField *titleFiled;
@property (nonatomic,strong)UITextField *billFiled;
- (instancetype)initWithFrame:(CGRect)frame state:(NSString *)state title:(NSString *)title bill:(NSString *)bill;
@end
......@@ -19,8 +19,6 @@
NSIndexPath *_currentIndexPath;
UIView *_titleView;
UIView *_billNumberView;
UITextField * _titleFiled;
UITextField *_billFiled;
NSString *_state;
NSString *_billNumber;
NSString *_title;
......@@ -58,11 +56,11 @@
}
_titleView.hidden = YES;
if(self.title.length > 0){
_titleFiled.text = self.title;
self.titleFiled.text = self.title;
}
_billNumberView.hidden = YES;
if (self.billNumber.length > 0) {
_billFiled.text = self.billNumber;
self.billFiled.text = self.billNumber;
}
}
......@@ -97,15 +95,15 @@
titleLabel.font = FontSize(15);
titleLabel.text = @"标题类似于:";
[_titleView addSubview:titleLabel];
_titleFiled = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(titleLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
_titleFiled.textAlignment = NSTextAlignmentLeft;
_titleFiled.textColor = HexColor(@"444444");
_titleFiled.placeholder = @"输入标题";
_titleFiled.borderStyle = UITextBorderStyleRoundedRect;
_titleFiled.font = FontSize(15);
_titleFiled.returnKeyType = UIReturnKeyDone;
_titleFiled.delegate = self;
[_titleView addSubview:_titleFiled];
self.titleFiled = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(titleLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
self.titleFiled.textAlignment = NSTextAlignmentLeft;
self.titleFiled.textColor = HexColor(@"444444");
self.titleFiled.placeholder = @"输入标题";
self.titleFiled.borderStyle = UITextBorderStyleRoundedRect;
self.titleFiled.font = FontSize(15);
self.titleFiled.returnKeyType = UIReturnKeyDone;
self.titleFiled.delegate = self;
[_titleView addSubview:self.titleFiled];
_billNumberView = [[UIView alloc]initWithFrame:CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin, self.frame.size.height)];
......@@ -116,15 +114,15 @@
billLabel.text = @"单号:";
[_billNumberView addSubview:billLabel];
_billFiled = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(billLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
_billFiled.textAlignment = NSTextAlignmentLeft;
_billFiled.textColor = HexColor(@"444444");
_billFiled.placeholder = @"输入单号";
_billFiled.borderStyle = UITextBorderStyleRoundedRect;
_billFiled.font = FontSize(15);
_billFiled.returnKeyType = UIReturnKeyDone;
_billFiled.delegate = self;
[_billNumberView addSubview:_billFiled];
self.billFiled = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(billLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
self.billFiled.textAlignment = NSTextAlignmentLeft;
self.billFiled.textColor = HexColor(@"444444");
self.billFiled.placeholder = @"输入单号";
self.billFiled.borderStyle = UITextBorderStyleRoundedRect;
self.billFiled.font = FontSize(15);
self.billFiled.returnKeyType = UIReturnKeyDone;
self.billFiled.delegate = self;
[_billNumberView addSubview:self.billFiled];
self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin, self.frame.size.height) style:(UITableViewStylePlain)];
self.tableView.backgroundColor = [UIColor whiteColor];
......@@ -231,16 +229,25 @@
[self keyBoardHidden];
}
- (void)keyBoardHidden{
[_titleFiled resignFirstResponder];
[_billFiled resignFirstResponder];
[self.titleFiled resignFirstResponder];
[self.billFiled resignFirstResponder];
}
- (void)textFieldDidEndEditing:(UITextField *)textField{
if (textField == _titleFiled) {
[self.delegate getTitleLike:_titleFiled.text];
}else if(textField == _billFiled){
[self.delegate getBillNumber:_billFiled.text];
if (textField == self.titleFiled) {
if (self.titleFiled.text.length > 0) {
[self.delegate getTitleLike:self.titleFiled.text];
}
}else if(textField == self.billFiled){
if (self.billFiled.text.length > 0) {
[self.delegate getBillNumber:self.billFiled.text];
}
}
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
NSLog(@"%@",self.titleFiled.text);
return YES;
}
@end
......@@ -68,6 +68,7 @@
}
- (void)setSurveyResult:(SurveyResult *)surveyResult{
//
[self.imageBtn setBackgroundImage:[UIImage imageNamed:@"no_image_default"] forState:UIControlStateNormal];
self.userNameLabel.text = [NSString stringWithFormat:@"反馈人:%@[%@]",surveyResult.userName,surveyResult.feedbackTime];
self.placeLabel.text = [NSString stringWithFormat:@"产地:%@",surveyResult.place];
......
......@@ -15,6 +15,8 @@
@interface ChosePersonViewController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate>
{
UITextField *_selectTextFiled;
NSIndexPath *_currentIndexPath;
}
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)UITableView *tableView;
......@@ -109,6 +111,7 @@
}
- (void)sureClick{
if (self.isMoreChose) {
NSMutableArray *arr = [[NSMutableArray alloc]init];
for (NSIndexPath *index in self.indexArr) {
User *user = self.dataArr[index.row];
......@@ -128,14 +131,31 @@
}else{
self.chosePerson(arr);
}
}else{
NSMutableArray *arr = [[NSMutableArray alloc]init];
if (self.dataArr.count > 0) {
User *user = self.dataArr[_currentIndexPath.row];
SurveyUser * survey = [[SurveyUser alloc]init];
survey.userUuid = user.uuid;
survey.userCode = user.login;
survey.userName = user.name;
[arr addObject:survey];
self.chosePerson(arr);
}
}
[self PopViewControllerAnimated:YES];
}
- (void)deletePerson {
_selectTextFiled.text = @"";
if (self.isMoreChose) {
[self.indexArr removeAllObjects];
}else{
_currentIndexPath = nil;
}
_selectTextFiled.text = @"";
[self.tableView reloadData];
}
#pragma mark - 协议方法
......@@ -154,11 +174,23 @@
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (self.isMoreChose) {
if ([self isHaveIndexPath:indexPath]) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
cell.Commitbtn.hidden = YES;
}
}
if (self.dataArr.count > 0) {
User *user = self.dataArr[indexPath.row];
[cell setTitleStr:user.name];
......@@ -186,6 +218,18 @@
}
}
_selectTextFiled.text = personStr;
}else{
MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:_currentIndexPath];
currentCell.Commitbtn.hidden = YES;
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
_currentIndexPath = indexPath;
User *user = self.dataArr[indexPath.row];
_selectTextFiled.text = user.name;
}
}
......
......@@ -12,5 +12,5 @@
@interface NewSurveyViewController : ICRBaseViewController
@property (nonatomic,strong)Survey *survey;
@property (nonatomic,strong)NSString *navTitle;
@end
......@@ -60,7 +60,7 @@ typedef enum : NSUInteger {
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"新建行情调研";
self.title = self.navTitle;
[self initData];
[self createTableView];
}
......@@ -144,7 +144,10 @@ typedef enum : NSUInteger {
//成功
[IBTLoadingView showTips:@"操作成功"];
[self clearAllInformation];
if (self.survey) {
[ICRUserUtil sharedInstance].needFresh = YES;
[self.navigationController popViewControllerAnimated:YES];
}
}else{
[IBTLoadingView showTips:message];
}
......@@ -162,7 +165,12 @@ typedef enum : NSUInteger {
if (self.survey.billNumber > 0) {
billNumberObject = self.survey.billNumber;
}
NSNumber *version = [NSNumber numberWithLong:0];
if (self.survey) {
version = self.survey.version;
}
NSDictionary *dict = @{@"uuid":uuidObject,
@"version":version,
@"billnumber":billNumberObject,
@"title":[IBTCommon checkString:self.titleStr],
@"state":state,
......@@ -187,8 +195,7 @@ typedef enum : NSUInteger {
_endDateLabel.textColor = HexColor(@"bbbbbb");
_personLabel.text = @"选择调研人员";
_personLabel.textColor = HexColor(@"bbbbbb");
_noteTextView.text = @"输入备注";
_noteTextView.textColor = HexColor(@"bbbbbb");
_noteTextView.text = @"";
//清空数据
self.titleStr = @"";
self.productCodeStr = @"";
......@@ -453,6 +460,11 @@ typedef enum : NSUInteger {
[self setTableFrame:LeftMargin];
}
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -233,7 +233,7 @@ typedef enum : NSUInteger {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"] ;
if (success == 1) {
[self backSurvey];
}else{
[IBTLoadingView showTips:message];
}
......@@ -246,7 +246,12 @@ typedef enum : NSUInteger {
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] surveyFinishWithUuid:self.surveyUuid success:succ failure:fail];
[[ICRHTTPController sharedController] surveyFinishWithUuid:self.surveyUuid version:self.survey.version success:succ failure:fail];
}
//返回列表
- (void)backSurvey{
[ICRUserUtil sharedInstance].needFresh = YES;
[self PopViewControllerAnimated:YES];
}
- (void)setNoteHeight
......
......@@ -60,7 +60,16 @@ typedef enum : NSUInteger {
- (void)initData{
self.dataArr = [NSMutableArray array];
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
if ([ICRUserUtil sharedInstance].needFresh) {
[self getData];
}
}
- (void)getData{
[ICRUserUtil sharedInstance].needFresh = NO;
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
......@@ -84,7 +93,7 @@ typedef enum : NSUInteger {
}
id titleObject = [NSNull null];
if (self.titleLike.length > 0) {
billObject = self.titleLike;
titleObject = self.titleLike;
}
id orderObject = [NSNull null];
if (self.orderDirection.length > 0) {
......@@ -97,7 +106,7 @@ typedef enum : NSUInteger {
@"titleLike":titleObject,
@"orderField":[NSNull null],
@"orderDirection":orderObject,
@"userUuid":userUtil.userId,
// @"userUuid":userUtil.userId,
@"pageNumber":@(0),
@"pageSize":@(20)};
[[ICRHTTPController sharedController] querySurveyWithBillData:dict success:succ failure:fail];
......@@ -151,6 +160,10 @@ typedef enum : NSUInteger {
#pragma mark - 确定
- (void)sureClick{
[_boltView.titleFiled resignFirstResponder];
[_boltView.billFiled resignFirstResponder];
//请求
[self getData];
//还原数据
......@@ -323,6 +336,7 @@ typedef enum : NSUInteger {
if ([survey.state isEqualToString:@"initial"]) {
NewSurveyViewController *nvc = [[NewSurveyViewController alloc]init];
nvc.survey = survey;
nvc.navTitle = @"修改行情调研单";
[self PushViewController:nvc animated:YES];
}else if([survey.state isEqualToString:@"submitted"] || [survey.state isEqualToString:@"insurvey"]|| [survey.state isEqualToString:@"finished"]){
......@@ -342,11 +356,6 @@ typedef enum : NSUInteger {
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
......
......@@ -29,5 +29,5 @@
@property (nonatomic,strong)NSString *lastModify_id;//最后修改人代码
@property (nonatomic,strong)NSString *lastModify_operName;//最后修改人名称
@property (nonatomic,strong)NSArray *users;
@property (nonatomic,assign)NSInteger version;
@property (nonatomic,strong)NSNumber *version;
@end
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