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

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

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