Commit 8773a2ae authored by 陈俊俊's avatar 陈俊俊

IOS 查看发运单来源单号有2张以上就无法显示全

parent 3a2fd52e
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
} }
+ (NSString *)stringFromDate:(NSDate*)aDate{ + (NSString *)stringFromDate:(NSDate*)aDate{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd"]; [formatter setDateFormat:@"yyyy-MM-dd "];
NSString *dateString = [formatter stringFromDate:aDate]; NSString *dateString = [formatter stringFromDate:aDate];
return dateString; return dateString;
} }
......
...@@ -38,6 +38,17 @@ typedef enum : NSUInteger { ...@@ -38,6 +38,17 @@ typedef enum : NSUInteger {
@property (nonatomic,strong)UILabel *createOperLabel; @property (nonatomic,strong)UILabel *createOperLabel;
@property (nonatomic,strong)UILabel *arriveDateLabel; @property (nonatomic,strong)UILabel *arriveDateLabel;
@property (nonatomic,strong)UILabel *noteLabel; @property (nonatomic,strong)UILabel *noteLabel;
@property (nonatomic,strong)UILabel *leftBillNumberLabel;
@property (nonatomic,strong)UILabel *leftPurchaseLabel;
@property (nonatomic,strong)UILabel *leftStateLabel;
@property (nonatomic,strong)UILabel *leftWarehouseLabel;
@property (nonatomic,strong)UILabel *leftRwarehouseLabel;
@property (nonatomic,strong)UILabel *leftCarnumberLabel;
@property (nonatomic,strong)UILabel *leftCarhoneLabel;
@property (nonatomic,strong)UILabel *leftCreateOperLabel;
@property (nonatomic,strong)UILabel *leftArriveDateLabel;
@property (nonatomic,strong)UILabel *leftNoteLabel;
@end @end
@implementation TransferDetailViewController @implementation TransferDetailViewController
...@@ -108,13 +119,45 @@ typedef enum : NSUInteger { ...@@ -108,13 +119,45 @@ typedef enum : NSUInteger {
} }
- (void)setNoteHeight - (void)setNoteHeight
{ {
CGFloat purchaseHeight = [self.purchaseLabel calculateHeight];
if (purchaseHeight < LeftHeight) {
purchaseHeight = LeftHeight;
}
self.purchaseLabel.height = purchaseHeight;
self.leftStateLabel.top = self.purchaseLabel.bottom;
self.stateLabel.top = self.purchaseLabel.bottom;
self.leftWarehouseLabel.top = self.leftStateLabel.bottom;
self.warehouseLabel.top = self.leftStateLabel.bottom;
self.leftRwarehouseLabel.top = self.leftWarehouseLabel.bottom;
self.rwarehouseLabel.top = self.leftWarehouseLabel.bottom;
self.leftCarnumberLabel.top = self.leftRwarehouseLabel.bottom;
self.carnumberLabel.top = self.leftRwarehouseLabel.bottom;
self.leftCarhoneLabel.top = self.leftCarnumberLabel.bottom;
self.carhoneLabel.top = self.leftCarnumberLabel.bottom;
self.leftCreateOperLabel.top = self.leftCarhoneLabel.bottom;
self.createOperLabel.top = self.leftCarhoneLabel.bottom;
self.leftArriveDateLabel.top = self.leftCreateOperLabel.bottom;
self.arriveDateLabel.top = self.leftCreateOperLabel.bottom;
self.leftNoteLabel.top = self.leftArriveDateLabel.bottom;
self.noteLabel.top = self.leftArriveDateLabel.bottom;
CGFloat height = [self.noteLabel calculateHeight]; CGFloat height = [self.noteLabel calculateHeight];
if (height < LeftHeight) {
height = LeftHeight;
}
CGRect noteFrame = self.noteLabel.frame; self.noteLabel.height = height;
noteFrame.size.height = height;
self.noteLabel.frame = noteFrame;
CGFloat totalHeight = height + LeftHeight*9; CGFloat totalHeight = height + LeftHeight*8 + purchaseHeight;
CGRect purchaseFrame = _transportView.frame; CGRect purchaseFrame = _transportView.frame;
purchaseFrame.size.height = totalHeight + LeftMargin; purchaseFrame.size.height = totalHeight + LeftMargin;
...@@ -217,28 +260,39 @@ typedef enum : NSUInteger { ...@@ -217,28 +260,39 @@ typedef enum : NSUInteger {
if (i == 0) { if (i == 0) {
self.billNumberLabel = rightLabel; self.billNumberLabel = rightLabel;
self.leftBillNumberLabel = leftLabel;
}else if (i == 1) { }else if (i == 1) {
self.purchaseLabel = rightLabel; self.purchaseLabel = rightLabel;
self.purchaseLabel.numberOfLines = 0;
self.leftPurchaseLabel = leftLabel;
}else if(i == 2){ }else if(i == 2){
self.stateLabel = rightLabel; self.stateLabel = rightLabel;
self.leftStateLabel = leftLabel;
}else if(i == 3){ }else if(i == 3){
self.warehouseLabel = rightLabel; self.warehouseLabel = rightLabel;
self.leftWarehouseLabel = leftLabel;
}else if(i == 4){ }else if(i == 4){
self.rwarehouseLabel = rightLabel; self.rwarehouseLabel = rightLabel;
self.leftRwarehouseLabel = leftLabel;
}else if(i == 5){ }else if(i == 5){
self.carnumberLabel = rightLabel; self.carnumberLabel = rightLabel;
self.leftCarnumberLabel = leftLabel;
}else if(i == 6){ }else if(i == 6){
self.carhoneLabel = rightLabel; self.carhoneLabel = rightLabel;
self.leftCarhoneLabel = leftLabel;
}else if(i == 7){ }else if(i == 7){
self.createOperLabel = rightLabel; self.createOperLabel = rightLabel;
self.leftCreateOperLabel = leftLabel;
}else if(i == 8){ }else if(i == 8){
leftLabel.width = LeftWidth + 10; leftLabel.width = LeftWidth + 10;
rightLabel.left = leftLabel.right; rightLabel.left = leftLabel.right;
rightLabel.width = ScreenSize.width - leftLabel.width - LeftMargin; rightLabel.width = ScreenSize.width - leftLabel.width - LeftMargin;
self.arriveDateLabel = rightLabel; self.arriveDateLabel = rightLabel;
self.leftArriveDateLabel = leftLabel;
}else if(i == leftArr.count - 1){ }else if(i == leftArr.count - 1){
rightLabel.numberOfLines = 0; rightLabel.numberOfLines = 0;
self.noteLabel = rightLabel; self.noteLabel = rightLabel;
self.leftNoteLabel = leftLabel;
} }
[_transportView addSubview:rightLabel]; [_transportView addSubview:rightLabel];
} }
......
...@@ -43,6 +43,17 @@ typedef enum : NSUInteger { ...@@ -43,6 +43,17 @@ typedef enum : NSUInteger {
@property (nonatomic,strong)UILabel *createOperLabel; @property (nonatomic,strong)UILabel *createOperLabel;
@property (nonatomic,strong)UILabel *arriveDateLabel; @property (nonatomic,strong)UILabel *arriveDateLabel;
@property (nonatomic,strong)UILabel *noteLabel; @property (nonatomic,strong)UILabel *noteLabel;
@property (nonatomic,strong)UILabel *leftBillNumberLabel;
@property (nonatomic,strong)UILabel *leftPurchaseLabel;
@property (nonatomic,strong)UILabel *leftStateLabel;
@property (nonatomic,strong)UILabel *leftWarehouseLabel;
@property (nonatomic,strong)UILabel *leftRwarehouseLabel;
@property (nonatomic,strong)UILabel *leftCarnumberLabel;
@property (nonatomic,strong)UILabel *leftCarhoneLabel;
@property (nonatomic,strong)UILabel *leftCreateOperLabel;
@property (nonatomic,strong)UILabel *leftArriveDateLabel;
@property (nonatomic,strong)UILabel *leftNoteLabel;
@end @end
@implementation TransportDetailViewController @implementation TransportDetailViewController
...@@ -120,6 +131,7 @@ typedef enum : NSUInteger { ...@@ -120,6 +131,7 @@ typedef enum : NSUInteger {
NSString *purchseNumber = @""; NSString *purchseNumber = @"";
NSInteger count = 0; NSInteger count = 0;
for (NSDictionary *billDict in purchases) { for (NSDictionary *billDict in purchases) {
if (![billDict[@"purchasebillnumber"] isEqual:[NSNull null]]) { if (![billDict[@"purchasebillnumber"] isEqual:[NSNull null]]) {
count ++; count ++;
...@@ -137,13 +149,45 @@ typedef enum : NSUInteger { ...@@ -137,13 +149,45 @@ typedef enum : NSUInteger {
} }
- (void)setNoteHeight - (void)setNoteHeight
{ {
CGFloat purchaseHeight = [self.purchaseLabel calculateHeight];
if (purchaseHeight < LeftHeight) {
purchaseHeight = LeftHeight;
}
self.purchaseLabel.height = purchaseHeight;
self.leftStateLabel.top = self.purchaseLabel.bottom;
self.stateLabel.top = self.purchaseLabel.bottom;
self.leftWarehouseLabel.top = self.leftStateLabel.bottom;
self.warehouseLabel.top = self.leftStateLabel.bottom;
self.leftRwarehouseLabel.top = self.leftWarehouseLabel.bottom;
self.rwarehouseLabel.top = self.leftWarehouseLabel.bottom;
self.leftCarnumberLabel.top = self.leftRwarehouseLabel.bottom;
self.carnumberLabel.top = self.leftRwarehouseLabel.bottom;
self.leftCarhoneLabel.top = self.leftCarnumberLabel.bottom;
self.carhoneLabel.top = self.leftCarnumberLabel.bottom;
self.leftCreateOperLabel.top = self.leftCarhoneLabel.bottom;
self.createOperLabel.top = self.leftCarhoneLabel.bottom;
self.leftArriveDateLabel.top = self.leftCreateOperLabel.bottom;
self.arriveDateLabel.top = self.leftCreateOperLabel.bottom;
self.leftNoteLabel.top = self.leftArriveDateLabel.bottom;
self.noteLabel.top = self.leftArriveDateLabel.bottom;
CGFloat height = [self.noteLabel calculateHeight]; CGFloat height = [self.noteLabel calculateHeight];
if (height < LeftHeight) {
height = LeftHeight;
}
CGRect noteFrame = self.noteLabel.frame; self.noteLabel.height = height;
noteFrame.size.height = height;
self.noteLabel.frame = noteFrame;
CGFloat totalHeight = height + LeftHeight*9; CGFloat totalHeight = height + LeftHeight*8 + purchaseHeight;
CGRect purchaseFrame = _transportView.frame; CGRect purchaseFrame = _transportView.frame;
purchaseFrame.size.height = totalHeight + LeftMargin; purchaseFrame.size.height = totalHeight + LeftMargin;
...@@ -309,28 +353,39 @@ typedef enum : NSUInteger { ...@@ -309,28 +353,39 @@ typedef enum : NSUInteger {
if (i == 0) { if (i == 0) {
self.billNumberLabel = rightLabel; self.billNumberLabel = rightLabel;
self.leftBillNumberLabel = leftLabel;
}else if (i == 1) { }else if (i == 1) {
self.purchaseLabel = rightLabel; self.purchaseLabel = rightLabel;
self.purchaseLabel.numberOfLines = 0;
self.leftPurchaseLabel = leftLabel;
}else if(i == 2){ }else if(i == 2){
self.stateLabel = rightLabel; self.stateLabel = rightLabel;
self.leftStateLabel = leftLabel;
}else if(i == 3){ }else if(i == 3){
self.warehouseLabel = rightLabel; self.warehouseLabel = rightLabel;
self.leftWarehouseLabel = leftLabel;
}else if(i == 4){ }else if(i == 4){
self.rwarehouseLabel = rightLabel; self.rwarehouseLabel = rightLabel;
self.leftRwarehouseLabel = leftLabel;
}else if(i == 5){ }else if(i == 5){
self.carnumberLabel = rightLabel; self.carnumberLabel = rightLabel;
self.leftCarnumberLabel = leftLabel;
}else if(i == 6){ }else if(i == 6){
self.carhoneLabel = rightLabel; self.carhoneLabel = rightLabel;
self.leftCarhoneLabel = leftLabel;
}else if(i == 7){ }else if(i == 7){
self.createOperLabel = rightLabel; self.createOperLabel = rightLabel;
self.leftCreateOperLabel = leftLabel;
}else if(i == 8){ }else if(i == 8){
leftLabel.width = LeftWidth + 10; leftLabel.width = LeftWidth + 10;
rightLabel.left = leftLabel.right; rightLabel.left = leftLabel.right;
rightLabel.width = ScreenSize.width - leftLabel.width - LeftMargin; rightLabel.width = ScreenSize.width - leftLabel.width - LeftMargin;
self.arriveDateLabel = rightLabel; self.arriveDateLabel = rightLabel;
self.leftArriveDateLabel = leftLabel;
}else if(i == leftArr.count - 1){ }else if(i == leftArr.count - 1){
rightLabel.numberOfLines = 0; rightLabel.numberOfLines = 0;
self.noteLabel = rightLabel; self.noteLabel = rightLabel;
self.leftNoteLabel = leftLabel;
} }
[_transportView addSubview:rightLabel]; [_transportView addSubview:rightLabel];
} }
......
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