//
//  SaleInputDetailViewController.m
//  HDMall
//
//  Created by Javen on 2017/8/4.
//  Copyright © 2017年 上海勾芒信息科技. All rights reserved.
//

#import "SaleInputDetailViewController.h"

@interface SaleInputDetailViewController ()

@end

@implementation SaleInputDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"销售录入详情";
    self.viewModel.type = SaleInputTypeReadOnly;
    self.viewModel.picVM.type = kPicCellTypeRead;
    self.topView.right1.hidden = YES;
    self.topView.right2.hidden = YES;
    self.topView.userInteractionEnabled = NO;
    self.totalView.textFieldBillCount.userInteractionEnabled = NO;
    [self.btnBottom setTitle:@"返回" forState:UIControlStateNormal];
    self.title = @"销售录入详情";
    WS(weakSelf);
    [self.viewModel httpDetailWithUuid:self.listModel.billNumber callBack:^(BOOL isSuccess) {
        [weakSelf configUIWithDetail];
    }];
}

- (void)configUIWithDetail {
    self.topView.contract = self.viewModel.detail.contract;
    
    self.totalView.textFieldBillCount.text = self.viewModel.detail.saleCount.stringValue;
    [self.topView.btnStore setTitle:self.viewModel.detail.contract.name forState:UIControlStateNormal];
    self.topView.textFieldDate.text = self.viewModel.detail.saleDate;
    [self allInputMoney];
    [self.topView httpToDayData];
    [self.tableView reloadData];
}

- (void)httpPayments {
    CLog(@"空实现父类httpPayments方法");
}

- (IBAction)actionSubmit:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
