Commit 7a6398a3 authored by 陈俊俊's avatar 陈俊俊

报表修改

parent 39619a0c
......@@ -50,5 +50,5 @@
+ (NSString *)getWeekFromDate;
+ (NSInteger)getWeeks:(NSInteger)year;
+ (NSString*)weekdayStringFromDate:(NSDate*)inputDate;
+(NSString *)countNumAndChangeformat:(NSString *)num;
@end
......@@ -360,4 +360,27 @@
return [weekdays objectAtIndex:theComponents.weekday];
}
+(NSString *)countNumAndChangeformat:(NSString *)num{
int count = 0;
long long int a = num.longLongValue;
while (a != 0)
{
count++;
a /= 10;
}
NSMutableString *string = [NSMutableString stringWithString:num];
NSMutableString *newstring = [NSMutableString string];
while (count > 3) {
count -= 3;
NSRange rang = NSMakeRange(string.length - 3, 3);
NSString *str = [string substringWithRange:rang];
[newstring insertString:str atIndex:0];
[newstring insertString:@"," atIndex:0];
[string deleteCharactersInRange:rang];
}
[newstring insertString:string atIndex:0];
return newstring;
}
@end
......@@ -123,8 +123,7 @@
[IBTLoadingView showProgressLabel:@"正在加载..."];
NSDictionary *dict = @{
@"path":userUtil.belongOrgPath,
@"code":self.nameAndCode,
@"name":self.nameAndCode,
@"codeOrName":self.nameAndCode,
@"pageNumber":@(_currentPage),
@"pageSize":@20
};
......
......@@ -125,7 +125,7 @@
self.dqLabel.text = sale.orgCode;
self.nameLabel.text = sale.orgName;
//客流量
self.saleLabel.text = [sale.passenger stringValue];
self.saleLabel.text = [IBTCommon countNumAndChangeformat:[sale.passenger stringValue]];
//客流量比变化率
if ([sale.passengerChainSign isEqualToString:ReportChainSignPlus]) {
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateDisabled];
......
......@@ -111,7 +111,7 @@
- (void)setPassengerWithCompass:(Compass *)compass{
//客流数
self.centerLabel.text = compass.passenger?[compass.passenger stringValue]:@"---" ;
self.centerLabel.text = compass.passenger?[IBTCommon countNumAndChangeformat:[compass.passenger stringValue]]:@"---" ;
//客流统计时间
NSString *weekday = @"";
......@@ -151,7 +151,7 @@
if ([IBTCommon convertToDateFrom:compass.persalesdate]) {
weekday = [IBTCommon weekdayStringFromDate:[IBTCommon convertToDateFrom:compass.persalesdate]];
}
self.dateLabel.text = compass.persalesdate?[NSString stringWithFormat:@"%@%@累计客单价",compass.persalesdate,weekday]:@"无";
self.dateLabel.text = compass.persalesdate?[NSString stringWithFormat:@"%@%@客单价",compass.persalesdate,weekday]:@"无";
//客单价环比变化率
if ([compass.persalesChainSign isEqualToString:ReportChainSignPlus]) {
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateDisabled];
......@@ -184,7 +184,7 @@
if ([IBTCommon convertToDateFrom:compass.grossprofitdate]) {
weekday = [IBTCommon weekdayStringFromDate:[IBTCommon convertToDateFrom:compass.grossprofitdate]];
}
self.dateLabel.text = compass.grossprofitdate?[NSString stringWithFormat:@"%@%@累计毛利率",compass.grossprofitdate,weekday]:@"无";
self.dateLabel.text = compass.grossprofitdate?[NSString stringWithFormat:@"%@%@毛利率",compass.grossprofitdate,weekday]:@"无";
//毛利率环比变化率
if ([compass.grossprofitChainSign isEqualToString:ReportChainSignPlus]) {
[self.lastWeekLabel setImage:[UIImage imageNamed:ReportChainPlusImage] forState:UIControlStateDisabled];
......
......@@ -154,7 +154,7 @@
self.dateLabel.text = compass.dataScope?[NSString stringWithFormat:@"%@%@累计销售额",compass.dataScope,weekday]:@"无";
//销售额
self.centerLabel.text = compass.sales?[compass.sales stringValue]:@"---" ;
self.centerLabel.text = compass.sales?[IBTCommon countNumAndChangeformat:[compass.sales stringValue]]:@"---" ;
//销售环比变化率
if ([compass.salesChainSign isEqualToString:ReportChainSignPlus]) {
......@@ -180,7 +180,7 @@
NSString *salesTargetStr = compass.salesTargetRate?[NSString stringWithFormat:@"%@%%",compass.salesTargetRate]:@"---";
self.rateLabel.text = salesTargetStr;
//单店日均销售
NSString *dailysalesPerStr = compass.dailysalesPerStore?[NSString stringWithFormat:@"%@%%",compass.dailysalesPerStore]:@"---";
NSString *dailysalesPerStr = compass.dailysalesPerStore?[NSString stringWithFormat:@"%@",compass.dailysalesPerStore]:@"---";
self.averageLabel.text = dailysalesPerStr;
}
......
......@@ -53,9 +53,9 @@
[self.contentView addSubview:searLabel];
self.totalLabel = searLabel;
CGFloat width = (ScreenSize.width - searLabel.right - 35)/3;
CGFloat width = (ScreenSize.width - searLabel.right - 25)/3;
rect = CGRectMake(searLabel.right, 0, width + 10, Sale_Header_Height);
rect = CGRectMake(searLabel.right, 0, width + 20, Sale_Header_Height);
UILabel * xsBtn = [IBTCommon labelWithTitle:@"销售额" frame:rect textFont:self.textFont];
xsBtn.textColor = ReportTitleColor;
[self.contentView addSubview:xsBtn];
......@@ -65,7 +65,7 @@
bszLabel.textColor = ReportTitleColor;
[self.contentView addSubview:bszLabel];
rect = CGRectMake(bszLabel.right , 0, width-10, Sale_Header_Height);
rect = CGRectMake(bszLabel.right , 0, width-20, Sale_Header_Height);
UILabel * sclLabel = [IBTCommon labelWithTitle:@"达成率" frame:rect textFont:self.textFont];
sclLabel.textColor = ReportTitleColor;
[self.contentView addSubview:sclLabel];
......
......@@ -68,9 +68,9 @@
self.dqLabel = [IBTCommon labelWithTitle:@"0101" frame:rect textFont:self.textFont];
[self.contentView addSubview:self.dqLabel];
CGFloat width = (ScreenSize.width - self.dqLabel.right - 35)/3;
CGFloat width = (ScreenSize.width - self.dqLabel.right - 25)/3;
rect = CGRectMake(self.dqLabel.right , 0, width+10, Sale_Cell_Height);
rect = CGRectMake(self.dqLabel.right , 0, width+20, Sale_Cell_Height);
self.saleLabel = [IBTCommon labelWithTitle:@"56,080" frame:rect textFont:self.textFont];
[self.contentView addSubview:self.saleLabel];
......@@ -81,12 +81,12 @@
[self.contentView addSubview:self.lastWeekLabel];
rect = CGRectMake(self.lastWeekLabel.right, 0, width-10, Sale_Cell_Height);
rect = CGRectMake(self.lastWeekLabel.right, 0, width-20, Sale_Cell_Height);
self.rateLabel = [IBTCommon labelWithTitle:@"60%" frame:rect textFont:self.textFont];
self.rateLabel.textColor = GXF_COMMIT_COLOR;
[self.contentView addSubview:self.rateLabel];
rect = CGRectMake(self.rateLabel.right, 0, 35, Sale_Cell_Height);
rect = CGRectMake(self.rateLabel.right, 0, 25, Sale_Cell_Height);
self.detailBtn = [IBTCommon buttonWithTitle:@"" Image:[UIImage imageNamed:@"more_detail"] frame:rect fontSize:20 fontColor:ReportBgColor];
self.detailBtn.titleLabel.font = [UIFont boldSystemFontOfSize:15];
[self.contentView addSubview:self.detailBtn];
......@@ -122,7 +122,7 @@
self.saleLabel.textColor = GXF_NAVIGAYION_COLOR;
}
//销售额
self.saleLabel.text = sale.sales?[sale.sales stringValue] : @"0";
self.saleLabel.text = sale.sales?[IBTCommon countNumAndChangeformat:[sale.sales stringValue]] : @"0";
NSString *salesYoStr = [NSString stringWithFormat:@"%@%%",sale.salesChainRate];
[self.lastWeekLabel setTitle:salesYoStr forState:UIControlStateNormal];
......
......@@ -234,7 +234,12 @@
self.currentYear = [[self.dateStr substringWithRange:NSMakeRange(0,4)] intValue];
self.selectedYear = self.currentYear;
self.currentMonth = [[self.dateStr substringWithRange:NSMakeRange(5,2)] intValue];
if (self.dateStr.length <= 6) {
self.currentMonth = [[self.dateStr substringWithRange:NSMakeRange(5,1)] intValue];
}else{
self.currentMonth = [[self.dateStr substringWithRange:NSMakeRange(5,2)] intValue];
}
[pickerView selectRow:(self.currentYear - kStartYear) inComponent:0 animated:YES];
......
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