Commit 90ed2e67 authored by 曹云霄's avatar 曹云霄

debug

parent d3893e9c
......@@ -93,6 +93,11 @@
*/
@property (nonatomic,strong) NSIndexPath *selectIndexPath;
/**
* 排序后的发货单详情
*/
@property (nonatomic,strong) NSArray *sortingArray;
@end
......@@ -472,7 +477,7 @@
item = [[RouteAnnotation alloc]init];
item.coordinate = tempNode.pt;
//判断已送达、未送达情况
BusbillDtl *model = self.selecteOrderBill.dtls[i];
BusbillDtl *model = self.sortingArray[i];
item.type = [model.state isEqualToString:@"已完成"]?3:5;
item.title = tempNode.name;
[_mapView addAnnotation:item];
......@@ -541,7 +546,8 @@
}else{
//发货单详情
OrderDetailsViewController *orderDetails = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"];
orderDetails.orderDetails = self.selecteOrderBill;
orderDetails.orderDetails = self.sortingArray;
orderDetails.billNumber = self.selecteOrderBill.billNumber;
WS(weakSelf);
[orderDetails setReturnoffButtonClickBlock:^{
[weakSelf turnoffButtonClickAction];
......@@ -632,13 +638,11 @@
[weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
NSMutableArray *sortingArray = [NSMutableArray array];
for (NSDictionary *dict in returnValue[@"data"]) {
BusbillDtl *details = [[BusbillDtl alloc]init];
details.customerLng = dict[@"lng"];
details.customerLat = dict[@"lat"];
details.customerName = dict[@"name"];
[returnValue[@"data"] enumerateObjectsUsingBlock:^(id _Nonnull dict, NSUInteger idx, BOOL * _Nonnull stop) {
BusbillDtl *details = [[BusbillDtl alloc]initWithDictionary:dict error:nil];
[sortingArray addObject:details];
}
}];
weakSelf.sortingArray = sortingArray;
[weakSelf startDrawWayPointRoutepointArray:sortingArray];
}else
{
......
......@@ -15,7 +15,6 @@
*/
@property (weak, nonatomic) IBOutlet UIButton *turnoffButton;
/**
* 回调
*/
......@@ -24,7 +23,7 @@
/**
* 发货单详情
*/
@property (nonatomic,strong) Busbill *orderDetails;
@property (nonatomic,strong) NSArray *orderDetails;
/**
* 刷新列表数据
......@@ -36,4 +35,9 @@
*/
@property (nonatomic,copy) void(^refreshPinStateBlock)(NSArray *details);
/**
* 单号
*/
@property (nonatomic,copy) NSString *billNumber;
@end
......@@ -33,14 +33,14 @@
{
//已完成
NSInteger index = 0;
for (BusbillDtl *model in self.orderDetails.dtls) {
for (BusbillDtl *model in self.orderDetails) {
if ([model.state isEqualToString:FINISH]) {
index ++;
}
}
NSString *indexString = [NSString stringWithFormat:@"%ld",index?index:1];
NSString *totalCount = [NSString stringWithFormat:@"%ld",self.orderDetails.dtls.count];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"本次应送%ld,已完成%ld",self.orderDetails.dtls.count,index]];
NSString *totalCount = [NSString stringWithFormat:@"%ld",self.orderDetails.count];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"本次应送%ld,已完成%ld",self.orderDetails.count,index]];
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(attributedString.length-([indexString length] + 4 + [totalCount length]), [totalCount length])];
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor greenColor] range:NSMakeRange(attributedString.length-[indexString length], [indexString length])];
self.titleLabel.attributedText = attributedString;
......@@ -49,7 +49,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
OrderDetailsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"OrderDetailsTableViewCell" forIndexPath:indexPath];
BusbillDtl *model = self.orderDetails.dtls[indexPath.row];
BusbillDtl *model = self.orderDetails[indexPath.row];
if (![model.customerLng length]&& ![model.customerLat length]) {
cell.storeTitleLabel.text = [NSString stringWithFormat:@"%@ (暂无GPS数据)",model.customerName];
}else
......@@ -76,7 +76,7 @@
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.orderDetails.dtls.count;
return self.orderDetails.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
......@@ -88,7 +88,7 @@
- (void)arriveButtonClickAction:(UIButton *)sender
{
WS(weakSelf);
BusbillDtl *model = self.orderDetails.dtls[sender.tag];
BusbillDtl *model = self.orderDetails[sender.tag];
[self CreateMBProgressHUDLoding:@"加载中"];
NSString *urlString = [NSString stringWithFormat:SERVERREQUESTURL(ORDERDETAILSSTATE),model.fid,FINISH];
NSString *UTF8String = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
......@@ -118,7 +118,7 @@
- (void)refreshDeliveryOrderState
{
NSString *orderState = FINISH;
for (BusbillDtl *model in self.orderDetails.dtls) {
for (BusbillDtl *model in self.orderDetails) {
if (![model.state isEqualToString:FINISH]) {
orderState = @"送货中";break;
}
......@@ -126,7 +126,7 @@
//更新状态
[self uiConfigAction];
WS(weakSelf);
NSString *urlString = [NSString stringWithFormat:SERVERREQUESTURL(REFRESHORDERSTATE),self.orderDetails.billNumber,orderState];
NSString *urlString = [NSString stringWithFormat:SERVERREQUESTURL(REFRESHORDERSTATE),self.billNumber,orderState];
NSString *UTF8String = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:UTF8String WithRequestType:NetworkRequestWithPOST WithParameter:nil WithReturnValueBlock:^(id returnValue) {
......@@ -135,7 +135,7 @@
weakSelf.refreshListDatasBlock();
}
if (weakSelf.refreshPinStateBlock) {
weakSelf.refreshPinStateBlock(self.orderDetails.dtls);
weakSelf.refreshPinStateBlock(self.orderDetails);
}
}else
{
......
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