Commit 59ace950 authored by 陈俊俊's avatar 陈俊俊

bug修复

parent a374661b
......@@ -8,6 +8,6 @@ pod 'SSKeychain', '~> 1.2.3'
pod 'FMDB', '~> 2.5'
pod 'Base64nl', '~> 1.2'
pod 'Reveal-iOS-SDK', '~> 1.5.1'
pod 'BaiduMapAPI', '~> 2.8.1'
pod 'BaiduMapAPI', '~> 2.8.1
pod 'MJRefresh', '~> 2.2.0'
pod 'IQKeyboardManager', '~> 3.2.3'
......@@ -33,11 +33,11 @@ PODS:
- FMDB/common
- IQKeyboardManager (3.2.4)
- MBProgressHUD (0.9.1)
- MJRefresh (2.2.1)
- MJRefresh (2.2.0)
- Reveal-iOS-SDK (1.5.1)
- SDWebImage (3.7.3):
- SDWebImage/Core (= 3.7.3)
- SDWebImage/Core (3.7.3)
- SDWebImage (3.7.2):
- SDWebImage/Core (= 3.7.2)
- SDWebImage/Core (3.7.2)
- SSKeychain (1.2.3)
DEPENDENCIES:
......@@ -59,9 +59,9 @@ SPEC CHECKSUMS:
FMDB: 96e8f1bcc1329e269330f99770ad4285d9003e52
IQKeyboardManager: 555b1231fefafb21b19278d7cca72986a27b748b
MBProgressHUD: c47f2c166c126cf2ce36498d80f33e754d4e93ad
MJRefresh: c3fa0387e8e97a11a9666639d2f815607edd1c2f
MJRefresh: 65a2bf14abb6feeaed8696aa1551f70e15ab0a08
Reveal-iOS-SDK: c9c55cad2729c85f6ced415f1b21857c9a2d8ef9
SDWebImage: 1d2b1a1efda1ade1b00b6f8498865f8ddedc8a84
SDWebImage: 71b7cdc1d1721d6a82ed62889030225f2c249e29
SSKeychain: 3f42991739c6c60a9cf1bbd4dff6c0d3694bcf3d
COCOAPODS: 0.39.0
COCOAPODS: 0.38.2
......@@ -2558,7 +2558,6 @@
C1F696001AB870B400F9F5DD /* Frameworks */,
C1F696011AB870B400F9F5DD /* Resources */,
1454647E6246AB3D8AAE6FF2 /* Copy Pods Resources */,
D17DB74B89F4D8DFDFC2E29A /* Embed Pods Frameworks */,
);
buildRules = (
);
......@@ -2698,21 +2697,6 @@
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
D17DB74B89F4D8DFDFC2E29A /* Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
......@@ -3217,7 +3201,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
......@@ -3255,7 +3239,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MTL_ENABLE_DEBUG_INFO = NO;
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
......@@ -3268,8 +3252,8 @@
baseConfigurationReference = 1B0B22845F5CD40B5CF655F2 /* Pods.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_IDENTITY = "iPhone Developer: Minglong Hu (TR9LJDJBFT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Minglong Hu (TR9LJDJBFT)";
ENABLE_BITCODE = NO;
GCC_PREFIX_HEADER = "XFFruit/XFFruit-Prefix.pch";
INFOPLIST_FILE = XFFruit/Info.plist;
......@@ -3281,7 +3265,7 @@
"$(PROJECT_DIR)/XFFruit/Vendors/JiGuang/lib",
);
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Debug;
......@@ -3291,8 +3275,8 @@
baseConfigurationReference = 7DDFB1D460448C3B45118195 /* Pods.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_IDENTITY = "iPhone Developer: Minglong Hu (TR9LJDJBFT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Minglong Hu (TR9LJDJBFT)";
ENABLE_BITCODE = NO;
GCC_PREFIX_HEADER = "XFFruit/XFFruit-Prefix.pch";
INFOPLIST_FILE = XFFruit/Info.plist;
......@@ -3304,7 +3288,7 @@
"$(PROJECT_DIR)/XFFruit/Vendors/JiGuang/lib",
);
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Release;
......@@ -3327,7 +3311,7 @@
INFOPLIST_FILE = XFFruitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = XFFruitTests;
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/XFFruit.app/XFFruit";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
......@@ -3347,7 +3331,7 @@
INFOPLIST_FILE = XFFruitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = XFFruitTests;
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/XFFruit.app/XFFruit";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
......
......@@ -129,9 +129,9 @@
// NSOrderedSame self.version==self.severVersion
if (self.severForceUpdate) {
//强制更新
UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:nil otherButtonTitles: @"去下载", nil];
alertV.tag = 1001;
[alertV show];
// UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:nil otherButtonTitles: @"去下载", nil];
// alertV.tag = 1001;
// [alertV show];
}else
{
UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:@"下次再说"otherButtonTitles: @"去下载", nil];//
......
......@@ -243,7 +243,7 @@ static NSString * const ICRHTTPInterface[] = {
//收货
[XFFHttp_SaveRctinfo] =@"transfer/save_rctinfo",
[XFFHttp_SaveReceipt] =@"transfer/receipt",
[XFFHttp_getVersionId] = @"ipapk",
[XFFHttp_getVersionId] = @"rest/ipapk",
};
......@@ -2944,7 +2944,7 @@ acceptTypeJson:YES
}
};
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_getVersionId] stringByAppendingFormat:@"?type=%@",type];
NSString *urlStr = [NSString stringWithFormat:@"%@/%@?type=%@",Server_Url,ICRHTTPInterface[XFFHttp_getVersionId],type];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self GET:encodeUrlStr
......
......@@ -22,18 +22,23 @@
#define ICR_TABBAR_TINT_COLOR [UIColor colorWithR:36 g:38 b:53 a:1]
#define ICR_IMAGE_BG_COLOR [UIColor colorWithW:242 a:1]
// HTTP
//#define HTTP_REST_API_BASE_URL @"http://115.28.191.44:8080/IPatrol/rest"
//new HTTP
//阿里云内部测试环境
//#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:7580/cruiser-server/rest"
#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7280/cruiser-server/rest"
#define Server_Url @"http://218.244.151.129:7580/cruiser-server"
//现场测试环境
#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7280/cruiser-server/rest"
//#define Server_Url @"http://122.224.171.126:7280/cruiser-server"
// HTTP
//#define HTTP_REST_API_BASE_URL @"http://115.28.191.44:8080/IPatrol/rest"
//10月23 122.224.171.126:7280
//#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:8281/XFFruit-server/rest"
// Import Headers
#import "ICRUtilsMacro.h"
#import "ICRVendorMacro.h"
#import "ICRHTTPController.h"
......
......@@ -18,5 +18,5 @@
@property (nonatomic, strong) NSDate *lastModified_time;//最后修改时间
@property (nonatomic, copy) NSString *lastModified_id;//最后修改人代码
@property (nonatomic, copy) NSString *lastModified_operName;//最后修改人名称
@property (nonatomic, assign) NSInteger priority;//新增字段优先级
@end
......@@ -269,6 +269,12 @@ typedef enum : NSUInteger {
if (self.purchaseBill && [versionObject integerValue] == 0) {
versionObject = self.purchaseBill.version;
}
if (_purchaseView.noticeUuid.length ==0 || _purchaseView.noticeNumber.length == 0) {
if (self.purchaseBill && self.purchaseBill.noticeNumber && self.purchaseBill.noticeUuid) {
_purchaseView.noticeUuid = self.purchaseBill.noticeUuid;
_purchaseView.noticeNumber = self.purchaseBill.noticeNumber;
}
}
NSMutableArray *billProducts = [NSMutableArray array];
for (PurchaseBillProduct *billProduct in _pvc.productArr) { [billProducts addObject:[billProduct dictForCommit]];
}
......
......@@ -16,6 +16,7 @@
#import "PurchaseNoticeCell.h"
#import "NoticeProductViewController.h"
#import "NoticeProduct.h"
#import "StartTimeView.h"
#import "PurchaseBillProduct.h"
#define LeftMargin 15
#define LeftWidth 40
......@@ -37,15 +38,15 @@ typedef enum : NSUInteger {
SaveTag = 8000,
CommitTag,
} BtnTag;
@interface NewPurchaseNoticeViewController()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,HPGrowingTextViewDelegate,UIAlertViewDelegate>
@interface NewPurchaseNoticeViewController()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,HPGrowingTextViewDelegate,UIAlertViewDelegate,StartTimeViewDelegate>
{
NSString *_clickState;
UITableView *_tableView;
NSMutableArray *_dataArr;
NSMutableArray *_shopeArr;
UITextField *_titleField;
UILabel *_productLabel;
UILabel *_personLabel;
UILabel *_finishDateLabel;
HPGrowingTextView *_noteTextView;
NSIndexPath *selectedCellIndexPath;
NSMutableArray *selectCellAry;
......@@ -54,7 +55,7 @@ typedef enum : NSUInteger {
id billNumberObject;
NSNumber *versionObject;
NSString *title;
StartTimeView *_startTimeView;
}
@property (nonatomic,strong)NSString *titleStr;
......@@ -62,6 +63,7 @@ typedef enum : NSUInteger {
@property (nonatomic,strong)NSString *purchaseNameStr;
@property (nonatomic,strong)NSString *purchaseUuidStr;
@property (nonatomic,strong)NSString *remarkStr;
@property (nonatomic,strong)NSString *finishDateStr;
@property (nonatomic,strong)UILabel *HeardLabel;
@property (nonatomic,strong)UILabel *FootLabel;
......@@ -129,6 +131,13 @@ typedef enum : NSUInteger {
self.purchaseNameStr = self.purchaseNotice.purchaserName;
[self.selectUsers addObject:self.purchaseNotice.purchaserUuid];
}
if (self.purchaseNotice.finishDate) {
if (self.purchaseNotice.finishDate.length > 9) {
_finishDateLabel.text = [[IBTCommon checkString:self.purchaseNotice.finishDate]substringToIndex:10];
}
_finishDateLabel.textColor = GXF_CONTENT_COLOR;
self.finishDateStr = [IBTCommon checkString:self.purchaseNotice.finishDate];
}
if (self.purchaseNotice.remark) {
_noteTextView.text = self.purchaseNotice.remark;
self.remarkStr = self.purchaseNotice.remark;
......@@ -151,17 +160,17 @@ typedef enum : NSUInteger {
selectCellAry=[[NSMutableArray alloc]initWithCapacity:1000];
self.selectUsers = [NSMutableArray array];
_dataArr=[[NSMutableArray alloc]initWithObjects:@"标题:",@"采购员:",@"备注:", nil];
_shopeArr=[[NSMutableArray alloc]initWithObjects: nil];
_dataArr=[[NSMutableArray alloc]initWithObjects:@"标题:",@"采购员:",@"要求采购完成时间:",@"备注:", nil];
_shopeArr=[[NSMutableArray alloc]init];
self.view.backgroundColor = XXFBgColor;
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, LeftMargin,ScreenSize.width, ScreenSize.height/3-LeftMargin)) style:(UITableViewStylePlain)];
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, LeftMargin,ScreenSize.width, ScreenSize.height/3)) style:(UITableViewStylePlain)];
_tableView.backgroundColor = [UIColor whiteColor];
_tableView.tag=1001;
_tableView.delegate = self;
_tableView.dataSource = self;
mingXiTableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 2*LeftMargin+_tableView.frame.size.height, ScreenSize.width, ScreenSize.height-_tableView.height-ScreenSize.height/5 - 50)];
mingXiTableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 2*LeftMargin+_tableView.frame.size.height, ScreenSize.width, ScreenSize.height-_tableView.height-ScreenSize.height/6 - 50)];
mingXiTableView.backgroundColor = [UIColor whiteColor];
mingXiTableView.tag=1002;
mingXiTableView.delegate=self;
......@@ -270,6 +279,7 @@ typedef enum : NSUInteger {
if (indexPath.row >0 && indexPath.row < _dataArr.count - 1) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
cell.titleLabel.width = 130;
[self createViewInCell:cell indexPath:indexPath];
}
[cell setTitleStr:_dataArr[indexPath.row]];
......@@ -305,12 +315,7 @@ typedef enum : NSUInteger {
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if ([tableView isEqual:_tableView]) {
if (indexPath.row == 2){
return TableHeight*2;
}else{
return TableHeight;
}
}else if ([tableView isEqual:mingXiTableView])
{
if ([self comperIndexpath:indexPath]) {
......@@ -347,6 +352,8 @@ typedef enum : NSUInteger {
};
cvc.isMoreChose = NO;
[self PushViewController:cvc animated:YES];
}else if(indexPath.row == 2){
[self startDatePickView];
}
}else if ([tableView isEqual:mingXiTableView])
{
......@@ -368,7 +375,7 @@ typedef enum : NSUInteger {
- (void)createViewInCell:(SurveyCell *)cell indexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 0) {
_titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight)];
_titleField = [[UITextField alloc] initWithFrame:CGRectMake(cell.titleLabel.right, 0, ScreenSize.width - cell.titleLabel.width - LeftMargin*2-15, TableHeight)];
_titleField.textAlignment = NSTextAlignmentRight;
_titleField.textColor = GXF_CONTENT_COLOR;
_titleField.placeholder = @"输入采购通知单标题";
......@@ -379,21 +386,22 @@ typedef enum : NSUInteger {
[cell.contentView addSubview:_titleField];
}else if (indexPath.row == _dataArr.count -1){
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight)];
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(cell.titleLabel.right, 0, ScreenSize.width - cell.titleLabel.width - LeftMargin*2-15, TableHeight)];
_noteTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
_noteTextView.minNumberOfLines = 1;
_noteTextView.maxNumberOfLines = 4;
_noteTextView.maxNumberOfLines = 1;
_noteTextView.isScrollable = YES;
_noteTextView.font = FontSize(15);
_noteTextView.textAlignment = NSTextAlignmentRight;
_noteTextView.delegate = self;
_noteTextView.returnKeyType = UIReturnKeyDone;
_noteTextView.placeholder = @"输入备注内容";
[cell.contentView addSubview:_noteTextView];
CGRect lineFrame = cell.lineLabel.frame;
lineFrame.origin.y = TableHeight*2-1;
cell.lineLabel.frame = lineFrame;
// CGRect lineFrame = cell.lineLabel.frame;
// lineFrame.origin.y = TableHeight*2-1;
// cell.lineLabel.frame = lineFrame;
}else{
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight))];
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(cell.titleLabel.right, 0, ScreenSize.width - cell.titleLabel.width - LeftMargin*2-15, TableHeight))];
contentLabel.textAlignment= NSTextAlignmentRight;
contentLabel.textColor = GXF_PLACEHOLDER_COLOR;
contentLabel.font = FontSize(TitleSize);
......@@ -401,6 +409,9 @@ typedef enum : NSUInteger {
if (indexPath.row == 1) {
contentLabel.text = @"选择采购员";
_personLabel = contentLabel;
}else if(indexPath.row == 2){
contentLabel.text = @"选择要求完成日期";
_finishDateLabel = contentLabel;
}
}
}
......@@ -524,11 +535,48 @@ typedef enum : NSUInteger {
return NO;
}
}
return YES;
}
- (void)startDatePickView{
if (!_startTimeView) {
_startTimeView = [[StartTimeView alloc] initWithFrame:CGRectMake(0, ScreenSize.height, ScreenSize.width, ScreenSize.height - 64)];
_startTimeView.delegate = self;
_startTimeView.backgroundColor = RGBA(0, 0, 0 ,0.5);
[self.view addSubview:_startTimeView];
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = _startTimeView.frame;
startFrame.origin.y = 0;
_startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
}];
}
}
- (void)cancelTimeView{
[self clearDatePickView];
}
- (void)okTimeView:(NSDate *)time{
return YES;
_finishDateLabel.textColor = GXF_CONTENT_COLOR;
_finishDateLabel.text = [IBTCommon stringFromDate:time];
self.finishDateStr = [time httpParameterString];
// 关闭选择器
[self clearDatePickView];
}
#pragma mark - 取消
- (void)clearDatePickView{
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = _startTimeView.frame;
startFrame.origin.y = ScreenSize.height;
_startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
[_startTimeView removeFromSuperview];
_startTimeView = nil;
}];
}
- (void)saveSurvey:(NSString *)state message:(NSString *)msg
{
//保存
......@@ -587,6 +635,7 @@ typedef enum : NSUInteger {
@"purchaserUuid":self.purchaseUuidStr,
@"purchaserCode":self.purchaseCodeStr,
@"purchaserName":self.purchaseNameStr,
@"finishDate":[IBTCommon checkString:self.finishDateStr],
@"remark":self.remarkStr,
@"products":billProducts};
[IBTLoadingView showProgressLabel:msg];
......
......@@ -57,6 +57,8 @@ typedef enum : NSUInteger {
@property (nonatomic,strong)UILabel *userLabel;
@property (nonatomic,strong)UILabel *stateLabel;
@property (nonatomic,strong)UILabel *countLabel;
@property (nonatomic,strong)UILabel *finishLabel;
@property (nonatomic,strong)UILabel *noteLabel;
@property (nonatomic,strong)UILabel *HeardLabel;
@property (nonatomic,strong)UILabel *FootLabel;
......@@ -122,14 +124,27 @@ typedef enum : NSUInteger {
self.titleLabel.text = [IBTCommon checkString:self.purchaseNotice.title];
self.userLabel.text = [IBTCommon checkString:self.purchaseNotice.purchaserName];
self.countLabel.text = [NSString stringWithFormat:@"%@",@"222"];
self.countLabel.text = [NSString stringWithFormat:@"%@",[self calutionTotalCount]];
self.finishLabel.text = [NSString stringWithFormat:@"%@",self.purchaseNotice.finishDate?[[IBTCommon checkString:self.purchaseNotice.finishDate] substringToIndex:10]:@"无"];
self.noteLabel.text = [IBTCommon checkString:self.purchaseNotice.remark];
[_shopeArr addObjectsFromArray:self.purchaseNotice.products];
[mingXiTableView reloadData];
[self setNoteHeight];
}
- (NSString *)calutionTotalCount{
NSString *str = @"";
NSInteger baseCount = 0;
NSInteger purshaseCount = 0;
for (NoticeProduct *noticeProduct in self.purchaseNotice.products) {
baseCount += [noticeProduct.quantity integerValue];
purshaseCount += [noticeProduct.purchasedQuantity integerValue];
}
str = [NSString stringWithFormat:@"%@ 已采(%@)",[NSNumber numberWithInteger:baseCount],[NSNumber numberWithInteger:purshaseCount]];
return str;
}
#pragma mark - 视图初始化
- (void)bulidLayout{
......@@ -157,21 +172,26 @@ typedef enum : NSUInteger {
[self.view addSubview:_endBtn];
if ([self.purchaseNotice.state isEqualToString:PURCHASENOTICE_STATE_NOTACCEPTED]) {
if ([self checkIsPermission:NOTICE_PERMISSIONS_ACCEPTTASK]&& [self checkIsPermission:NOTICE_PERMISSIONS_FINISH]) {
_rejectBtn.tag = EndTag;
[_rejectBtn setTitle:@"结束" forState:UIControlStateNormal];
_endBtn.tag = AcceptTag;
[_endBtn setTitle:@"接受任务" forState:UIControlStateNormal];
}else{
if ([self checkIsPermission:NOTICE_PERMISSIONS_ACCEPTTASK]) {
_rejectBtn.hidden = YES;
_endBtn.frame = CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, ScreenSize.width - LeftMargin * 2, 40);
_endBtn.tag = AcceptTag;
[_endBtn setTitle:@"接受任务" forState:UIControlStateNormal];
}
// else if ([self checkIsPermission:NOTICE_PERMISSIONS_CREATEBILL]) {
// _rejectBtn.hidden = YES;
// _endBtn.frame = CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, ScreenSize.width - LeftMargin * 2, 40);
// _endBtn.tag = NewTag;
// [_endBtn setTitle:@"新建采购单" forState:UIControlStateNormal];
// }
else{
}else if([self checkIsPermission:NOTICE_PERMISSIONS_FINISH]){
_rejectBtn.hidden = YES;
_endBtn.frame = CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, ScreenSize.width - LeftMargin * 2, 40);
_endBtn.tag = EndTag;
[_endBtn setTitle:@"结束" forState:UIControlStateNormal];
}else{
[self hiddenBottomBtn];
}
}
}else if([self.purchaseNotice.state isEqualToString:PURCHASENOTICE_STATE_PURCHASEING]){
if ([self checkIsPermission:NOTICE_PERMISSIONS_FINISH] && [self checkIsPermission:NOTICE_PERMISSIONS_CREATEBILL]) {
_rejectBtn.tag = EndTag;
......@@ -242,13 +262,19 @@ typedef enum : NSUInteger {
NSString *message = data[@"message"];
if (success == 1) {
if ([action isEqualToString:@"accept"]) {
#warning 有点问
[ICRUserUtil sharedInstance].needFresh = YES;
if ([IBTCommon checkIsPermission:NOTICE_PERMISSIONS_CREATEBILL]) {
_stateLabel.text = @"发运中";
_endBtn.hidden = YES;
_rejectBtn.hidden = NO;
[_rejectBtn setTitle:@"新建采购单" forState:UIControlStateNormal];
_rejectBtn.frame = CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, ScreenSize.width - LeftMargin * 2, 40);
_rejectBtn.tag = NewTag;
[ICRUserUtil sharedInstance].needFresh = YES;
}else{
[self PopViewControllerAnimated:YES];
}
}else{
[ICRUserUtil sharedInstance].needFresh = YES;
[self PopViewControllerAnimated:YES];
......@@ -277,7 +303,7 @@ typedef enum : NSUInteger {
_bottomView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_bottomView];
_shopeArr=[[NSMutableArray alloc]initWithObjects: nil];
_shopeArr=[[NSMutableArray alloc]init];
selectCellAry=[[NSMutableArray alloc]initWithCapacity:1000];
mingXiTableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, _bottomView.height)];
mingXiTableView.backgroundColor = [UIColor whiteColor];
......@@ -333,7 +359,7 @@ typedef enum : NSUInteger {
}
- (void)createPurchaseView{
_leftArr = @[@"单号:",@"创建人:",@"标题:",@"状态:",@"采购员:",@"合计基础数量:",@"备注:"];
_leftArr = @[@"单号:",@"创建人:",@"标题:",@"状态:",@"采购员:",@"合计基础数量:",@"要求采购完成时间:",@"备注:"];
_purchaseView= [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, LeftHeight*_leftArr.count +LeftMargin)];
_purchaseView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_purchaseView];
......@@ -363,7 +389,12 @@ typedef enum : NSUInteger {
leftLabel.width = 110;
rightLabel.x = leftLabel.right;
self.countLabel = rightLabel;
}else if(i == _leftArr.count - 1){
}else if(i == 6){
leftLabel.width = 145;
rightLabel.left = leftLabel.right;
self.finishLabel = rightLabel;
}
else if(i == _leftArr.count - 1){
rightLabel.numberOfLines = 0;
self.noteLabel = rightLabel;
}
......
......@@ -23,6 +23,7 @@
@property (nonatomic,strong)NSString *purchaserUuid;//采购员ID
@property (nonatomic,strong)NSString *purchaserCode;//采购员代码
@property (nonatomic,strong)NSString *purchaserName;//采购员名称
@property (nonatomic,strong)NSString *finishDate;//新增要求采购完成时间
@property (nonatomic,strong)NSString *remark;//备注
@property (nonatomic,strong)NSArray *products;//商品
......
......@@ -7,7 +7,7 @@
//
#import "NoticeDetailCell.h"
#define TitleSize 17
#define TitleSize 16
#define LeftMargin 15
#define TableHeight 46
#define TableWidth 60
......@@ -62,7 +62,7 @@
self.SpLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20, 0, gipWidth, TableHeight))];
self.SpLabel.textAlignment= NSTextAlignmentLeft;
self.SpLabel.textColor = HexColor(@"666666");
self.SpLabel.textColor = GXF_CONTENT_COLOR;
self.SpLabel.font = FontSize(TitleSize);
// self.DjLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20+self.SpLabel.size.width+gipWidth , 0, TableWidth,TableHeight ))];
......@@ -72,12 +72,12 @@
self.BzggLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+20+gipWidth+1, 0, gipWidth, TableHeight)];
self.BzggLabel.textAlignment= NSTextAlignmentLeft;
self.BzggLabel.textColor = HexColor(@"666666");
self.BzggLabel.textColor = GXF_CONTENT_COLOR;
self.BzggLabel.font = FontSize(TitleSize);
self.BzslLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+20+2*gipWidth+2, 0, gipWidth, TableHeight)];
self.BzslLabel.textAlignment= NSTextAlignmentLeft;
self.BzslLabel.textColor = HexColor(@"666666");
self.BzslLabel.textColor = GXF_CONTENT_COLOR;
self.BzslLabel.font = FontSize(TitleSize);
......@@ -85,7 +85,7 @@
self.YcgslLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+20+3*gipWidth+3, 0, gipWidth, TableHeight)];
self.YcgslLabel.textAlignment= NSTextAlignmentLeft;
self.YcgslLabel.textColor = HexColor(@"666666");
self.YcgslLabel.textColor = GXF_CONTENT_COLOR;
self.YcgslLabel.font = FontSize(TitleSize);
......
......@@ -26,21 +26,21 @@
{
self.contentView.backgroundColor = XXFBgColor;
UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(20, 5, ScreenSize.width - 40, 130 -10)];
UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 5, ScreenSize.width, 130 -10)];
bgView.backgroundColor = [UIColor whiteColor];
bgView.layer.cornerRadius = 5;
bgView.layer.masksToBounds = YES;
// bgView.layer.cornerRadius = 5;
// bgView.layer.masksToBounds = YES;
[self.contentView addSubview:bgView];
self.createdLable = [[UILabel alloc]initWithFrame:CGRectMake(LeftMargin, 0, bgView.width - 100, 30)];//业务时间
self.createdLable.font = GXF_FIFTEENTEN_SIZE;
self.createdLable.textColor = GXF_CELL_COLOR;
self.createdLable.textColor = GXF_NAVIGAYION_COLOR;
self.createdLable.text = @"2015-04-05 09:05:05";
self.creatorLable = [[UILabel alloc]initWithFrame:CGRectMake(self.createdLable.right, 0, bgView.width - self.createdLable.width - LeftMargin * 2, 30)];//业务人
self.creatorLable.font = GXF_FIFTEENTEN_SIZE;
self.creatorLable.textAlignment = NSTextAlignmentRight;
self.creatorLable.textColor = GXF_CELL_COLOR;
self.creatorLable.textColor = GXF_NAVIGAYION_COLOR;
self.traceIdLable = [[UILabel alloc]initWithFrame:CGRectMake(self.createdLable.x, self.createdLable.bottom, bgView.width - LeftMargin*2, 20)];//采购通知单uuid
self.traceIdLable.font = GXF_FIFTEENTEN_SIZE;
......
......@@ -7,7 +7,7 @@
//
#import "PurchaseNoticeCell.h"
#define TitleSize 17
#define TitleSize 16
#define LeftMargin 15
#define TableHeight 46
#define TableWidth 60
......
......@@ -134,6 +134,7 @@
cell = [[SurveyCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.titleLabel.width = 110;
[self createViewInCell:cell indexPath:indexPath];
}
[cell setTitleStr:_dataArr[indexPath.row]];
......@@ -142,7 +143,7 @@
- (void)createViewInCell:(SurveyCell *)cell indexPath:(NSIndexPath *)indexPath{
if (indexPath.row == _dataArr.count -1){
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableRowHeight)];
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(cell.titleLabel.right, 0, ScreenSize.width - cell.titleLabel.width - LeftMargin*2-15, TableRowHeight)];
_noteTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
_noteTextView.minNumberOfLines = 1;
_noteTextView.maxNumberOfLines = 2;
......@@ -158,7 +159,7 @@
lineFrame.origin.y = TableRowHeight*2-1;
cell.lineLabel.frame = lineFrame;
}else if(indexPath.row == 4 || indexPath.row == 6){
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-30, TableRowHeight)];
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(cell.titleLabel.right, 0, ScreenSize.width - cell.titleLabel.width - LeftMargin*2-30, TableRowHeight)];
textField.textAlignment = NSTextAlignmentRight;
textField.textColor = GXF_CONTENT_COLOR;
textField.font = GXF_FIFTEENTEN_SIZE;
......@@ -184,7 +185,7 @@
_shBaseQuantityField = textField;
}
}else{
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableRowHeight))];
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(cell.titleLabel.right, 0, ScreenSize.width - cell.titleLabel.width - LeftMargin*2-15, TableRowHeight))];
contentLabel.textAlignment= NSTextAlignmentRight;
contentLabel.textColor = GXF_CONTENT_COLOR;
contentLabel.font = GXF_FIFTEENTEN_SIZE;
......
......@@ -104,7 +104,7 @@ typedef enum : NSUInteger {
NSDictionary *dict = @{
@"state":stateObject,
@"queryOrders":orderArr,
@"userCode":userUtil.userCode,
@"userUuid":userUtil.userId,
@"pageNumber":@(_currentPage),
@"pageSize":@(20)};
[[ICRHTTPController sharedController] queryTransferWithData:dict success:succ failure:fail];
......
......@@ -151,6 +151,8 @@ typedef enum : NSUInteger {
UIButton *endBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, ScreenSize.width - LeftMargin*2, 40) target:self sel:@selector(btnClick:) tag:EndTag image:nil title:@"结束" titleColor:[UIColor whiteColor] isCorner:YES corner:8 bgColor:GXF_COMMIT_COLOR];
[self.view addSubview:endBtn];
_surveyView= [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, LeftHeight * 9+ ContentMargin * 10)];
_surveyView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_surveyView];
......
......@@ -22,7 +22,7 @@ typedef enum : NSUInteger {
CommitTag,
} BtnTag;
#define TopHeight 284
#define TopHeight 382
#define BottomHeight 300
#define SpaceHeight 20
#define BottomViewHeight 60
......@@ -214,6 +214,7 @@ typedef enum : NSUInteger {
@"carnumber":[IBTCommon checkString:_sheetView.carnumber],
@"type":[IBTCommon checkString:_sheetView.type],
@"carphone":[IBTCommon checkString:_sheetView.carphone],
@"arriveDate":[IBTCommon checkString:_sheetView.arriveDate],
@"note":_sheetView.note,
@"pdtDetails":billProducts,
@"accountDetails":costs
......
......@@ -35,6 +35,7 @@ typedef enum : NSUInteger {
@property (nonatomic,strong)UILabel *carnumberLabel;
@property (nonatomic,strong)UILabel *carhoneLabel;
@property (nonatomic,strong)UILabel *createOperLabel;
@property (nonatomic,strong)UILabel *arriveDateLabel;
@property (nonatomic,strong)UILabel *noteLabel;
@end
......@@ -93,6 +94,7 @@ typedef enum : NSUInteger {
self.carhoneLabel.text = [IBTCommon checkString:self.transfer.carphone];
self.noteLabel.text = [NSString stringWithFormat:@"%@",self.transfer.note?self.transfer.note:@"无"];
self.createOperLabel.text = [NSString stringWithFormat:@"%@%@",[IBTCommon checkString:self.transfer.create_operName],self.transfer.create_time.length > 10 ? [self.transfer.create_time substringToIndex:10] : self.transfer.create_time];
self.arriveDateLabel.text = [NSString stringWithFormat:@"%@",self.transfer.arriveDate?[[IBTCommon checkString:self.transfer.arriveDate]substringToIndex:10]:@"无"];
[_transView refreshTranProduct:self.transfer.pdtDetails];
[_transView refreshCost:self.transfer.accountDetails];
[self setNoteHeight];
......@@ -149,17 +151,16 @@ typedef enum : NSUInteger {
[self.view addSubview:_firstBtn];
// _secondBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(CGRectGetMaxX(_firstBtn.frame)+ LeftMargin, ScreenSize.height - 64 - BottomHeight +5, (ScreenSize.width - LeftMargin*3)/2, 40) target:self sel:@selector(btnClick:) tag:EndTag image:nil title:@"结束" titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_COMMIT_COLOR];
// [self.view addSubview:_secondBtn];
if ([self.transfer.state isEqualToString:TRANSFER_STATE_RECEIVED] || [self.transfer.state isEqualToString:TRANSFER_STATE_ABORTED] || ![self checkIsPermission:TRANSFER_ACTION_ABORT]) {
_firstBtn.hidden = YES;
_secondBtn.hidden = YES;
CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame;
if ([self.transfer.state isEqualToString:TRANSFER_STATE_RECEIVED] || [self.transfer.state isEqualToString:TRANSFER_STATE_UNRECEIVED]) {
if ([IBTCommon checkIsPermission:TRANSFER_ACTION_ABORT]) {
_firstBtn.hidden = NO;
}else{
[self hiddenBottomView];
}
NSArray *leftArr = @[@"单号:",@"来源单据:",@"状态:",@"发货仓库:",@"收货仓库:",@"车辆:",@"司机电话:",@"创建:",@"备注"];
}else{
[self hiddenBottomView];
}
NSArray *leftArr = @[@"单号:",@"来源单据:",@"状态:",@"发货仓库:",@"收货仓库:",@"车辆:",@"司机电话:",@"创建:",@"预计到货时间:",@"备注:"];
_transportView= [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, LeftHeight*leftArr.count +LeftMargin)];
_transportView.backgroundColor = [UIColor whiteColor];
......@@ -193,6 +194,11 @@ typedef enum : NSUInteger {
self.carhoneLabel = rightLabel;
}else if(i == 7){
self.createOperLabel = rightLabel;
}else if(i == 8){
leftLabel.width = LeftWidth + 10;
rightLabel.left = leftLabel.right;
rightLabel.width = ScreenSize.width - leftLabel.width - LeftMargin;
self.arriveDateLabel = rightLabel;
}else if(i == leftArr.count - 1){
rightLabel.numberOfLines = 0;
self.noteLabel = rightLabel;
......@@ -201,6 +207,12 @@ typedef enum : NSUInteger {
}
[self createBottomView];
}
- (void)hiddenBottomView{
_firstBtn.hidden = YES;
CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame;
}
- (void)createBottomView{
_bottomView= [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_transportView.frame) + TopMargin, ScreenSize.width, 300)];
_bottomView.backgroundColor = [UIColor whiteColor];
......@@ -278,14 +290,7 @@ typedef enum : NSUInteger {
[[ICRHTTPController sharedController] endTransferWithTransferUuid:self.transfer.uuid version:self.transfer.version success:succ failure:fail];
}
}
- (BOOL)checkIsPermission:(NSString *)permission{
for (NSString *per in [ICRUserUtil sharedInstance].permissions) {
if ([per isEqualToString:permission]) {
return YES;
}
}
return NO;
}
- (void)didReceiveMemoryWarning {
......
......@@ -122,7 +122,7 @@ typedef enum : NSUInteger {
@"billNumberLike":billObject,
@"creator":userObject,
@"queryOrders":orderArr,
@"userCode":userUtil.userCode,
@"userUuid":userUtil.userId,
@"pageNumber":@(_currentPage),
@"pageSize":@(20)};
[[ICRHTTPController sharedController] queryTransferWithData:dict success:succ failure:fail];
......
......@@ -29,7 +29,7 @@
@property (nonatomic,strong)NSString *lastModified_id; //最后修改人代码
@property (nonatomic,strong)NSString *lastModified_operName;//最后修改人名称
@property (nonatomic,strong)NSNumber *version; //版本
@property (nonatomic,strong)NSString *arriveDate;//新增预计到达时
@property (nonatomic,strong)NSArray *pdtDetails;//商品
@property (nonatomic,strong)NSArray *accountDetails;//费用
......
......@@ -21,6 +21,8 @@
@property (nonatomic,strong)UITextField *carTextFiled; //车辆
@property (nonatomic,strong)UILabel *typeLabel; //运输类型
@property (nonatomic,strong)UITextField *phoneTextFiled; //电话
@property (nonatomic,strong)UILabel *arriveDateLabel; //预计到货时间
@property (nonatomic,strong)HPGrowingTextView *remarkTextView;//备注
......@@ -35,6 +37,7 @@
@property (nonatomic,strong)NSString *carnumber;
@property (nonatomic,strong)NSString *type;
@property (nonatomic,strong)NSString *carphone;
@property (nonatomic,strong)NSString *arriveDate;
@property (nonatomic,strong)NSString *note;
@property (nonatomic,strong)Transfer *transfer;
@end
......@@ -13,17 +13,19 @@
#import "Warehouse.h"
#import "ChooseWarehouseViewController.h"
#import "ChooseTypeViewController.h"
#import "StartTimeView.h"
#define LeftMargin 15
#define TopMargin 20
#define LeftWidth 80
#define TableHeight 44
#define SpaceHeight 10
@interface TopTransferView ()<UITableViewDataSource,UITableViewDelegate,HPGrowingTextViewDelegate,UITextFieldDelegate>
@interface TopTransferView ()<UITableViewDataSource,UITableViewDelegate,HPGrowingTextViewDelegate,UITextFieldDelegate,StartTimeViewDelegate>
{
UITableView *_tableView;
NSMutableArray *_dataArr;
StartTimeView *_startTimeView;
}
@property (nonatomic,strong)NSString *selectType;
@property (nonatomic,strong)NSString *selectRwarehouse;
......@@ -46,7 +48,7 @@
{
self.backgroundColor = XXFBgColor;
_dataArr = [NSMutableArray array];
NSArray *arr = @[@"发货仓库:",@"收货仓库:",@"运输类型:",@"车辆:",@"司机电话:",@"备注:"];
NSArray *arr = @[@"发货仓库:",@"收货仓库:",@"运输类型:",@"车辆:",@"司机电话:",@"预计到货时间:",@"备注:"];
[_dataArr addObjectsFromArray:arr];
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, TopMargin,self.frame.size.width, self.frame.size.height - TopMargin)) style:(UITableViewStylePlain)];
......@@ -70,7 +72,7 @@
cell = [[SurveyCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (indexPath.row ==0 || indexPath.row == 1 || indexPath.row == 2) {
if (indexPath.row ==0 || indexPath.row == 1 || indexPath.row == 2 || indexPath.row == 5) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
[self createViewInCell:cell indexPath:indexPath];
......@@ -127,6 +129,9 @@
contentLabel.text = @"选择类型";
self.typeLabel = contentLabel;
}else if(indexPath.row == 5){
contentLabel.text = @"选择预计到货时间";
self.arriveDateLabel = contentLabel;
}
}
}
......@@ -163,6 +168,13 @@
self.phoneTextFiled.text = transfer.carphone;
self.carphone = transfer.carphone;
}
if (transfer.arriveDate) {
if (transfer.arriveDate.length > 9) {
_arriveDateLabel.text = [[IBTCommon checkString:transfer.arriveDate]substringToIndex:10];
}
_arriveDateLabel.textColor = GXF_CONTENT_COLOR;
self.arriveDate = [IBTCommon checkString:transfer.arriveDate];
}
if (transfer.note) {
self.remarkTextView.text = transfer.note;
self.note = transfer.note;
......@@ -229,8 +241,48 @@
};
[self.delegate pushNextViewController:tvc];
}else if(indexPath.row == 5){
[self startDatePickView];
}
}
- (void)startDatePickView{
if (!_startTimeView) {
_startTimeView = [[StartTimeView alloc] initWithFrame:CGRectMake(0, ScreenSize.height, ScreenSize.width, ScreenSize.height - 64)];
_startTimeView.delegate = self;
_startTimeView.backgroundColor = RGBA(0, 0, 0 ,0.5);
[AppWindow addSubview:_startTimeView];
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = _startTimeView.frame;
startFrame.origin.y = 64;
_startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
}];
}
}
- (void)cancelTimeView{
[self clearDatePickView];
}
- (void)okTimeView:(NSDate *)time{
_arriveDateLabel.textColor = GXF_CONTENT_COLOR;
_arriveDateLabel.text = [IBTCommon stringFromDate:time];
self.arriveDate = [time httpParameterString];
// 关闭选择器
[self clearDatePickView];
}
#pragma mark - 取消
- (void)clearDatePickView{
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = _startTimeView.frame;
startFrame.origin.y = ScreenSize.height;
_startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
[_startTimeView removeFromSuperview];
_startTimeView = nil;
}];
}
- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{
......
......@@ -20,7 +20,7 @@ typedef enum : NSUInteger {
CommitTag,
} BtnTag;
#define TopHeight 284
#define TopHeight 328
#define BottomHeight 300
#define SpaceHeight 20
#define BottomViewHeight 60
......@@ -219,6 +219,7 @@ typedef enum : NSUInteger {
@"carnumber":[IBTCommon checkString:_sheetView.carnumber],
@"type":[IBTCommon checkString:_sheetView.type],
@"carphone":[IBTCommon checkString:_sheetView.carphone],
@"arriveDate":[IBTCommon checkString:_sheetView.arriveDate],
@"note":_sheetView.note,
@"pdtDetails":billProducts,
@"accountDetails":costs};
......@@ -259,6 +260,7 @@ typedef enum : NSUInteger {
ShowMessage(@"司机电话不能为空");
return NO;
}
if (_bottomView.productVC.transportProductArr.count == 0) {
ShowMessage(@"商品不能为空");
return NO;
......
......@@ -40,6 +40,7 @@ typedef enum : NSUInteger {
@property (nonatomic,strong)UILabel *carnumberLabel;
@property (nonatomic,strong)UILabel *carhoneLabel;
@property (nonatomic,strong)UILabel *createOperLabel;
@property (nonatomic,strong)UILabel *arriveDateLabel;
@property (nonatomic,strong)UILabel *noteLabel;
@end
......@@ -103,6 +104,7 @@ typedef enum : NSUInteger {
self.carhoneLabel.text = [IBTCommon checkString:self.transport.carphone];
self.noteLabel.text = [NSString stringWithFormat:@"%@",self.transport.note?self.transport.note:@"无"];
self.createOperLabel.text = [NSString stringWithFormat:@"%@%@",[IBTCommon checkString:self.transport.create_operName],self.transport.create_time.length > 10 ? [self.transport.create_time substringToIndex:10] : self.transport.create_time];
self.arriveDateLabel.text = [NSString stringWithFormat:@"%@",self.transport.arriveDate?[[IBTCommon checkString:self.transport.arriveDate]substringToIndex:10]:@"无"];
[_transView refreshTranProduct:self.transport.pdtDetails];
[_transView refreshCost:self.transport.accountDetails];
[self setNoteHeight];
......@@ -252,7 +254,7 @@ typedef enum : NSUInteger {
}
}
}
NSArray *leftArr = @[@"单号:",@"采购单:",@"状态:",@"发货仓库:",@"收货仓库:",@"车辆:",@"司机电话:",@"创建:",@"备注"];
NSArray *leftArr = @[@"单号:",@"采购单:",@"状态:",@"发货仓库:",@"收货仓库:",@"车辆:",@"司机电话:",@"创建:",@"预计到货时间:",@"备注:"];
_transportView= [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, LeftHeight*leftArr.count +LeftMargin)];
_transportView.backgroundColor = [UIColor whiteColor];
......@@ -286,6 +288,11 @@ typedef enum : NSUInteger {
self.carhoneLabel = rightLabel;
}else if(i == 7){
self.createOperLabel = rightLabel;
}else if(i == 8){
leftLabel.width = LeftWidth + 10;
rightLabel.left = leftLabel.right;
rightLabel.width = ScreenSize.width - leftLabel.width - LeftMargin;
self.arriveDateLabel = rightLabel;
}else if(i == leftArr.count - 1){
rightLabel.numberOfLines = 0;
self.noteLabel = rightLabel;
......
......@@ -123,7 +123,7 @@ typedef enum : NSUInteger {
@"billNumberLike":billObject,
@"creator":userObject,
@"queryOrders":orderArr,
@"userCode":userUtil.userCode,
@"userUuid":userUtil.userId,
@"pageNumber":@(_currentPage),
@"pageSize":@(20)};
[[ICRHTTPController sharedController] queryTransPortWithData:dict success:succ failure:fail];
......
......@@ -31,6 +31,7 @@
@property (nonatomic,strong)NSString *lastModified_time;//最后修改时间
@property (nonatomic,strong)NSString *lastModified_id;//最后修改人代码
@property (nonatomic,strong)NSString *lastModified_operName;//最后修改人名称
@property (nonatomic,strong)NSString *arriveDate;//新增预计到达时
@property (nonatomic,strong)NSArray *pdtDetails;//商品
@property (nonatomic,strong)NSArray *accountDetails;//费用
......
......@@ -21,6 +21,7 @@
@property (nonatomic,strong)UITextField *carTextFiled; //车辆
@property (nonatomic,strong)UILabel *typeLabel; //运输类型
@property (nonatomic,strong)UITextField *phoneTextFiled; //电话
@property (nonatomic,strong)UILabel *arriveDateLabel; //预计收货时间
@property (nonatomic,strong)HPGrowingTextView *remarkTextView;//备注
......@@ -35,6 +36,7 @@
@property (nonatomic,strong)NSString *carnumber;
@property (nonatomic,strong)NSString *type;
@property (nonatomic,strong)NSString *carphone;
@property (nonatomic,strong)NSString *arriveDate;
@property (nonatomic,strong)NSString *note;
@property (nonatomic,strong)Transport *transport;
......
......@@ -11,17 +11,18 @@
#import "Warehouse.h"
#import "ChooseWarehouseViewController.h"
#import "ChooseTypeViewController.h"
#import "StartTimeView.h"
#define LeftMargin 15
#define TopMargin 20
#define LeftWidth 80
#define TableHeight 44
#define SpaceHeight 10
@interface TopTransportView ()<UITableViewDataSource,UITableViewDelegate,HPGrowingTextViewDelegate,UITextFieldDelegate>
@interface TopTransportView ()<UITableViewDataSource,UITableViewDelegate,HPGrowingTextViewDelegate,UITextFieldDelegate,StartTimeViewDelegate>
{
UITableView *_tableView;
NSMutableArray *_dataArr;
StartTimeView *_startTimeView;
}
@property (nonatomic,strong)NSString *selectType;
@property (nonatomic,strong)NSString *selectRwarehouse;
......@@ -44,7 +45,7 @@
{
self.backgroundColor = XXFBgColor;
_dataArr = [NSMutableArray array];
NSArray *arr = @[@"发货仓库:",@"收货仓库:",@"运输类型:",@"车辆:",@"司机电话:",@"备注:"];
NSArray *arr = @[@"发货仓库:",@"收货仓库:",@"运输类型:",@"车辆:",@"司机电话:",@"预计到货时间:",@"备注:"];
[_dataArr addObjectsFromArray:arr];
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, TopMargin,self.frame.size.width, self.frame.size.height - TopMargin)) style:(UITableViewStylePlain)];
......@@ -68,9 +69,10 @@
cell = [[SurveyCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (indexPath.row ==0 || indexPath.row == 1 || indexPath.row == 2) {
if (indexPath.row ==0 || indexPath.row == 1 || indexPath.row == 2 || indexPath.row == 5) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
[self createViewInCell:cell indexPath:indexPath];
}
[cell setTitleStr:_dataArr[indexPath.row]];
......@@ -125,6 +127,9 @@
contentLabel.text = @"选择类型";
self.typeLabel = contentLabel;
}else if(indexPath.row == 5){
contentLabel.text = @"选择预计到货时间";
self.arriveDateLabel = contentLabel;
}
}
}
......@@ -161,6 +166,14 @@
self.phoneTextFiled.text = transport.carphone;
self.carphone = transport.carphone;
}
if (transport.arriveDate) {
if (transport.arriveDate.length > 9) {
_arriveDateLabel.text = [[IBTCommon checkString:transport.arriveDate]substringToIndex:10];
}
_arriveDateLabel.textColor = GXF_CONTENT_COLOR;
self.arriveDate = [IBTCommon checkString:transport.arriveDate];
}
if (transport.note) {
self.remarkTextView.text = transport.note;
self.note = transport.note;
......@@ -227,9 +240,49 @@
};
[self.delegate pushNextViewController:tvc];
}else if(indexPath.row == 5){
[self startDatePickView];
}
}
- (void)startDatePickView{
if (!_startTimeView) {
_startTimeView = [[StartTimeView alloc] initWithFrame:CGRectMake(0, ScreenSize.height, ScreenSize.width, ScreenSize.height - 64)];
_startTimeView.delegate = self;
_startTimeView.backgroundColor = RGBA(0, 0, 0 ,0.5);
[AppWindow addSubview:_startTimeView];
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = _startTimeView.frame;
startFrame.origin.y = 64;
_startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
}];
}
}
- (void)cancelTimeView{
[self clearDatePickView];
}
- (void)okTimeView:(NSDate *)time{
_arriveDateLabel.textColor = GXF_CONTENT_COLOR;
_arriveDateLabel.text = [IBTCommon stringFromDate:time];
self.arriveDate = [time httpParameterString];
// 关闭选择器
[self clearDatePickView];
}
#pragma mark - 取消
- (void)clearDatePickView{
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = _startTimeView.frame;
startFrame.origin.y = ScreenSize.height;
_startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
[_startTimeView removeFromSuperview];
_startTimeView = nil;
}];
}
- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{
[self.remarkTextView resignFirstResponder];
......
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