Commit 0d97755f authored by 陈俊俊's avatar 陈俊俊

发运单

parent f7abd79d
......@@ -6,6 +6,6 @@ pod 'SSKeychain', '~> 1.2.3'
pod 'FMDB', '~> 2.5'
pod 'Base64nl', '~> 1.2'
pod 'Reveal-iOS-SDK', '~> 1.5.1'
pod 'BaiduMapAPI', '~> 2.7.0'
pod 'BaiduMapAPI', '~> 2.7.0
pod 'MJRefresh', '~> 2.2.0'
pod 'IQKeyboardManager', '~> 3.2.3'
\ No newline at end of file
This diff is collapsed.
......@@ -178,54 +178,56 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//添加行情调研单
//1.添加行情调研单
- (void)saveSurveyWithAuthenticode:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//获取行情调研单列表
//2.获取行情调研单列表
- (void)querySurveyWithBillData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//获取行情调研单详情
//3.获取行情调研单详情
- (void)getResultWithSurveyUuid:(NSString *)surveyUuid
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//下载商品信息
- (void)getProductWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//下载用户信息
- (void)getUserWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//生成行情反馈图片
//4.生成行情反馈图片
- (void)resultChartWithResultUuid:(NSString *)uuid
width:(NSNumber *)width
height:(NSNumber *)height
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//结束行情反馈(写)
//5.结束行情反馈(写)
- (void)surveyFinishWithUuid:(NSString *)uuid
version:(NSNumber *)version
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//获取行情调研单反馈列表
//6.获取行情调研单反馈列表
- (void)getResultsWithUuid:(NSString *)uuid
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//供应商
//1.下载商品信息
- (void)getProductWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//2.下载用户信息
- (void)getUserWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//3.供应商
- (void)getVendorWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//仓库
//4.仓库
- (void)getWarehouseWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
......@@ -288,19 +290,19 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
failure:(void (^)(id))fail;
//添加采购单
//1.添加采购单
- (void)savePurchaseWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//获取采购单列表
//2.获取采购单列表
- (void)queryPurchaseWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//获取采购单详情
//3.获取采购单详情
- (void)getPurchaseResultWithPurchaseUuid:(NSString *)purchaseUuid
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//审核/拒绝/供应商确认/结束/作废采购单
//4.审核/拒绝/供应商确认/结束/作废采购单
- (void)dealByActionWithPurchaseUuid:(NSString *)purchaseUuid
action:(NSString *)action
remark:(NSString *)remark
......@@ -308,6 +310,30 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//1.添加发运单
- (void)saveTransportWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//2.获取发运单列表
- (void)queryTransPortWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//3.获取发运单详情
- (void)getTransportResultWithTransportUuid:(NSString *)transportUuid
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//4.结束发运单
- (void)endTransportWithTransportUuid:(NSString *)transportUuid
version:(NSNumber *)version
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//5.作废发运单
- (void)abortTransportWithTransportUuid:(NSString *)transportUuid
version:(NSNumber *)version
success:(void (^)(id))succ
failure:(void (^)(id))fail;
@end
......@@ -101,8 +101,14 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
XFFHttp_PurchaseSave,
XFFHttp_QueryPurchase,
XFFHttp_GetPurchaseDetail,
XFFHttp_DealByActionPurchase
XFFHttp_DealByActionPurchase,
//发运单
XFFHttp_TransportSave,
XFFHttp_QueryTransport,
XFFHttp_GetTransportDetail,
XFFHttp_EndTransport,
XFFHttp_AbortTransport
};
static NSString * const ICRHTTPInterface[] = {
......@@ -185,8 +191,15 @@ static NSString * const ICRHTTPInterface[] = {
[XFFHttp_PurchaseSave] = @"purchase/bill/save",
[XFFHttp_QueryPurchase] = @"purchase/bill/query",
[XFFHttp_GetPurchaseDetail] = @"purchase/bill/get",
[XFFHttp_DealByActionPurchase] = @"purchase/bill/action"
[XFFHttp_DealByActionPurchase] = @"purchase/bill/action",
//发运单
[XFFHttp_TransportSave] = @"transport/save_transport",
[XFFHttp_QueryTransport] = @"transport/query_transport",
[XFFHttp_GetTransportDetail] = @"transport/get_transport",
[XFFHttp_EndTransport] = @"transport/finish",
[XFFHttp_AbortTransport] = @"transport/abort",
};
static NSString * const ICRAttachmentTypeValue[] = {
......@@ -1497,7 +1510,7 @@ acceptTypeJson:YES
}
};
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetProduct] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", [[NSDate date] httpParameterString],@(page_number),@(page_size)];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetProduct] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", @"2015-05-04",@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:NULL
......@@ -1903,7 +1916,7 @@ acceptTypeJson:YES
success:success
failure:failure];
}
//获取行情调研单列表
//获取采购单列表
- (void)queryPurchaseWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail{
......@@ -1963,6 +1976,7 @@ acceptTypeJson:YES
success:success
failure:failure];
}
//采购单处理
- (void)dealByActionWithPurchaseUuid:(NSString *)purchaseUuid
action:(NSString *)action
remark:(NSString *)remark
......@@ -1989,17 +2003,190 @@ acceptTypeJson:YES
}
};
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetPurchaseDetail] stringByAppendingFormat:@"/%@?action=%@&remark=%@&version=%@&time=%@&operId=%@&operName=%@",purchaseUuid,action,remark,version,[[NSDate date] httpParameterString],userUtil.userCode,userUtil.displayName];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_DealByActionPurchase] stringByAppendingFormat:@"/%@?action=%@&remark=%@&version=%@&time=%@&operId=%@&operName=%@",purchaseUuid,action,remark,version,[[NSDate date] httpParameterString],userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:nil
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
//添加发运单
- (void)saveTransportWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
if (!data) {
if (fail) {
fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
}
return;
}
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (succ) {
succ( responseObject );
}
};
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
CLog(@"%@", error);
if (fail) {
fail( error );
}
};
NSDictionary *dict = data;
NSString *currentTime = [[NSDate date] httpParameterString];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_TransportSave] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:dict
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
//获取发运单列表
- (void)queryTransPortWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail{
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (succ) {
succ( responseObject );
}
};
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
CLog(@"%@", error);
if (fail) {
fail( error );
}
};
NSDictionary *dict = data;
NSString *urlStr = [[self class] UrlForPluginHTTPAction:XFFHttp_QueryTransport];
[self POST:urlStr
parameters:dict
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
//获取发运单详情
- (void)getTransportResultWithTransportUuid:(NSString *)transportUuid
success:(void (^)(id))succ
failure:(void (^)(id))fail{
if (!transportUuid) {
if (fail) {
fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
}
return;
}
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (succ) {
succ( responseObject );
}
};
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
CLog(@"%@", error);
if (fail) {
fail( error );
}
};
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetTransportDetail] stringByAppendingFormat:@"/%@",transportUuid];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self GET:encodeUrlStr
parameters:nil
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
- (void)endTransportWithTransportUuid:(NSString *)transportUuid
version:(NSNumber *)version
success:(void (^)(id))succ
failure:(void (^)(id))fail{
if (!transportUuid) {
if (fail) {
fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
}
return;
}
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (succ) {
succ( responseObject );
}
};
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
CLog(@"%@", error);
if (fail) {
fail( error );
}
};
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_EndTransport] stringByAppendingFormat:@"/%@?version=%@&time=%@&operId=%@&operName=%@",transportUuid,version,[[NSDate date] httpParameterString],userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:nil
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
- (void)abortTransportWithTransportUuid:(NSString *)transportUuid
version:(NSNumber *)version
success:(void (^)(id))succ
failure:(void (^)(id))fail{
if (!transportUuid) {
if (fail) {
fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
}
return;
}
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (succ) {
succ( responseObject );
}
};
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
CLog(@"%@", error);
if (fail) {
fail( error );
}
};
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_AbortTransport] stringByAppendingFormat:@"/%@?version=%@&time=%@&operId=%@&operName=%@",transportUuid,version,[[NSDate date] httpParameterString],userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:nil
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
//1·保存采购通知单
- (void)savePurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
......
......@@ -14,12 +14,9 @@
@end
@implementation ChooseParentViewController
- (void)dealloc{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(boxValueChanged:) name:UITextFieldTextDidChangeNotification object:nil];
[self initData];
[self bulidLayout];
[self createRefresh];
......@@ -37,6 +34,7 @@
self.selectTextFiled.textAlignment = NSTextAlignmentLeft;
self.selectTextFiled.background = [UIImage imageNamed:@"textFiled"];
self.selectTextFiled.delegate = self;
[self.selectTextFiled addTarget:self action:@selector(boxValueChanged:) forControlEvents:UIControlEventEditingChanged];
self.selectTextFiled.font = GXF_FIFTEENTEN_SIZE;
[self.view addSubview:self.selectTextFiled];
......@@ -159,7 +157,7 @@
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (![GXF_NSUSERFEFTAULTS objectForKey:self.tableView.header.lastUpdatedTimeKey]) {
if (fetchedObjects.count == 0 && titleStr.length == 0) {
[GXF_NSUSERFEFTAULTS setObject:[NSDate date] forKey:self.tableView.header.lastUpdatedTimeKey];
[GXF_NSUSERFEFTAULTS synchronize];
[self getBaseDataFromServer];
......
......@@ -18,7 +18,7 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = ICR_VIEW_BG_COLOR;
// self.view.backgroundColor = ICR_VIEW_BG_COLOR;
}
- (void)didReceiveMemoryWarning {
......
......@@ -11,7 +11,9 @@
#define SetProductTotalPrice @"setProductTotalPrice"
#define KNOTIFICATION_getSelectPurchaseProduct @"KNOTIFICATION_getSelectPurchaseProduct"
#define KNOTIFICATION_ChoseTransportPurchase @"KNOTIFICATION_ChoseTransportPurchase"
#define KNOTIFICATION_AddPurchaseProduct @"KNOTIFICATION_AddPurchaseProduct"
#define KNOTIFICATION_AddTransportCost @"KNOTIFICATION_AddTransportCost"
......
......@@ -118,6 +118,8 @@
#define ChooseVendorUpdateDate @"chooseVendorUpdateDate"
#define ChooseWarehouseUpdateDate @"chooseWarehouseUpdateDate"
#define PurchaseUpdateDate @"purchaseUpdateDate"
#define TransportUpdateDate @"TransportUpdateDate"
//行情调研状态
//initial(未提交),submitted(已提交),insurvey(调研中),finished(已完成)
......@@ -129,9 +131,9 @@
//采购单状态
#define PURCHASE_STATE_INITIAL @"initial" //未提交
#define PURCHASE_STATE_SUBMITTED @"submitted"//已提交
#define PURCHASE_STATE_SUBMITTED @"submitted"//已提交 未审批
#define PURCHASE_STATE_REJECTED @"rejected" //已拒绝
#define PURCHASE_STATE_APPROVED @"approved" //已审批
#define PURCHASE_STATE_APPROVED @"approved" //已审批 发运中
#define PURCHASE_STATE_SHIPPING @"shipping" //发运中
#define PURCHASE_STATE_FINISHED @"finished" //已完成
#define PURCHASE_STATE_ABORTED @"aborted" //已作废
......@@ -163,5 +165,12 @@
#define GXF_BASECLASS_USER @"User"
//发运单状态
#define TRANSPORT_STATE_INITIAL @"initial" //未提交
#define TRANSPORT_STATE_UNRECEIVED @"unreceived"//未收货
#define TRANSPORT_STATE_RECEIVED @"received" //已收货
#define TRANSPORT_STATE_ABORTED @"aborted" //已废用
#endif
//
// RegexUtil.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/9.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RegexUtil : NSObject
//验证是否是整数,小数
+ (BOOL)isValidateNmuberAndFloat:(NSString *)candidate;
@end
//
// RegexUtil.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/9.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "RegexUtil.h"
@implementation RegexUtil
+ (BOOL)isValidateNmuberAndFloat:(NSString *)candidate{
NSString *regStr=@"(^[0-9]+(\\.[0-9]+)?$)";
NSPredicate *numberTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regStr];
return [numberTest evaluateWithObject:candidate];
}
@end
......@@ -24,7 +24,7 @@
#import "NewPurchaseViewController.h"
#import "PurchaseViewController.h"
#import "NewTransportViewController.h"
#import "TransportViewController.h"
#import"PurchaseNoticeViewController.h"
......@@ -173,9 +173,18 @@
case kFunctionNewShipment://任务管理
{
NewTransportViewController *tVC = [[NewTransportViewController alloc] init];
tVC.title = @"新建发运单";
[self PushViewController:tVC animated:YES];
}
break;
case kFunctionSeeShipment://任务管理
{
TransportViewController *tVC = [[TransportViewController alloc] init];
tVC.title = @"发运单";
[self PushViewController:tVC animated:YES];
}
break;
// case kFunctionPatrolPlan://巡店计划
// {
// ICRPatrolPlanViewController *pVC = [[ICRPatrolPlanViewController alloc] initWithStore:nil isHomeShow:YES];
......
//
// ChooseCostViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ChooseParentViewController.h"
@interface ChooseCostViewController : ChooseParentViewController
@end
//
// ChooseCostViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ChooseCostViewController.h"
#define TopMargin 50
#define TableHeight 50
@interface ChooseCostViewController ()
@end
@implementation ChooseCostViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"类型";
[self.dataArr addObject:@"运费"];
[self.dataArr addObject:@"人工费"];
[self.dataArr addObject:@"装卸费"];
[self.dataArr addObject:@"杂费"];
self.selectTextFiled = nil;
self.tableView.frame = CGRectMake(0, 5, ScreenSize.width, ScreenSize.height - 64 - 5);
}
- (void)createRefresh{}
#pragma mark - 协议方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[MaskCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID totalWidth:ScreenSize.width totalHeight:TableHeight];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (self.currentIndexPath) {
if (indexPath.row == self.currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
cell.Commitbtn.hidden = YES;
}
if (self.dataArr.count > 0) {
NSString *type = self.dataArr[indexPath.row];
[cell setTitleStr:type];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:self.currentIndexPath];
currentCell.Commitbtn.hidden = YES;
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
self.currentIndexPath = indexPath;
}
- (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
......@@ -11,6 +11,8 @@
#import "ProductBillViewController.h"
#import "PurchaseBillProduct.h"
#import "PurchaseViewController.h"
#import "ShopDetaileViewController.h"
#import "PurchaseBillProduct.h"
#define TopHeight 328
#define BottomHeight 300
#define SpaceHeight 20
......@@ -41,6 +43,7 @@ typedef enum : NSUInteger {
if (self) {
//监听值的改变
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setProductTotalPrice:) name:SetProductTotalPrice object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addPurchaseProduct:) name:KNOTIFICATION_AddPurchaseProduct object:nil];
}
return self;
}
......@@ -145,7 +148,29 @@ typedef enum : NSUInteger {
_purchaseView.chargePurchase = [NSNumber numberWithFloat:otherPrice];
_purchaseView.total = [NSNumber numberWithFloat:totalPrice+otherPrice];
}
- (void)addPurchaseProduct:(NSNotification *)fication{
ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init];
// 回调
svc.choseShopDetail = ^(ShopDetail *shopDetail){
PurchaseBillProduct *billProduct = [[PurchaseBillProduct alloc]init];
billProduct.product_uuid = shopDetail.product_uuid;
billProduct.product_code = shopDetail.product_code;
billProduct.product_name = shopDetail.merchandise;
billProduct.qpc = [NSNumber numberWithFloat:[shopDetail.packageSpecification floatValue]];
billProduct.unit = shopDetail.packageUnit;
billProduct.qty = [NSNumber numberWithFloat:[shopDetail.packageQuantity floatValue]];
billProduct.price = [NSNumber numberWithFloat:[shopDetail.packageUnitPrice floatValue]];
billProduct.baseQty = [NSNumber numberWithFloat:[shopDetail.foundationQuantity floatValue]];
billProduct.basePrice = [NSNumber numberWithFloat:[shopDetail.foundationUnitPrice floatValue]];
billProduct.total = [NSNumber numberWithFloat:[shopDetail.totalMoney floatValue]];
billProduct.remark = shopDetail.remark;
billProduct.qpcStr = @"fdsfdsfdsa";
[_pvc.productArr addObject:billProduct];
[_pvc.tableView reloadData];
};
svc.title = [IBTCommon localizableString:@"AddShopDetail"];
[self PushViewController:svc animated:YES];
}
- (void)btnClick:(UIButton *)btn{
switch (btn.tag) {
case SaveTag:
......
......@@ -50,7 +50,6 @@
billProduct.remark = @"hshshshsh";
billProduct.qpcStr = @"fdsfdsfdsa";
[self.productArr addObject:billProduct];
[self.productArr addObject:billProduct];
if (self.productArr.count > 0) {
[[NSNotificationCenter defaultCenter] postNotificationName:SetProductTotalPrice object:nil];
}
......@@ -81,10 +80,10 @@
}
#pragma mark - footerDelegate
- (void)addClick{
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_AddPurchaseProduct object:nil];
}
- (void)choosePurchase{
[[NSNotificationCenter defaultCenter] postNotificationName:@"ChoseTransportPurchase" object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_ChoseTransportPurchase object:nil];
}
#pragma mark - 协议方法
......
......@@ -108,7 +108,7 @@ typedef enum : NSUInteger {
}
- (void)createBtn{
_firstBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, (ScreenSize.width - LeftMargin*3)/2, 40) target:self sel:@selector(btnClick:) tag:RejectTag image:nil title:@"" titleColor: [UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_SAVE_COLOR];
_firstBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, (ScreenSize.width - LeftMargin*3)/2, 40) target:self sel:@selector(btnClick:) tag:0 image:nil title:@"" titleColor: [UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_SAVE_COLOR];
[self.view addSubview:_firstBtn];
_secondBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(CGRectGetMaxX(_firstBtn.frame)+ LeftMargin, ScreenSize.height - 64 - BottomHeight +5, (ScreenSize.width - LeftMargin*3)/2, 40) target:self sel:@selector(btnClick:) tag:0 image:nil title:@"" titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_COMMIT_COLOR];
......@@ -118,22 +118,18 @@ typedef enum : NSUInteger {
//根据权限判断按钮显示
- (void)showBtnByPermissions{
//逻辑判断按钮显示不显示
if ([self.bill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {//状态已提交
if ([self checkIsPermission:PURCHASE_PERMISSIONS_VENDORAPPROVE]) {//供应商审批权
//显示确认按钮
_firstBtn.hidden = YES;
[self changeBtnFrame:_secondBtn title:@"确认" originX:LeftMargin width:OneWidth];
_secondBtn.tag = SureTag;
self.indexStyle = 2;
}else if([self checkIsPermission:PURCHASE_PERMISSIONS_MANAGEAPPROVE]){
if ([self.bill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {//状态已提交 未审批
if([self checkIsPermission:PURCHASE_PERMISSIONS_MANAGEAPPROVE]){
//显示拒绝和审批
[self changeBtnFrame:_firstBtn title:@"拒绝" originX:LeftMargin width:TwoWidth];
[self changeBtnFrame:_secondBtn title:@"审核通过" originX:CGRectGetMaxX(_firstBtn.frame) + LeftMargin width:TwoWidth];
_firstBtn.tag = RejectTag;
_secondBtn.tag = PassTag;
self.indexStyle = 1;
}else{
[self hiddenTwoBtn];
}
}else if([self.bill.state isEqualToString:PURCHASE_STATE_SHIPPING]){//状态是发运中
}else if([self.bill.state isEqualToString:PURCHASE_STATE_APPROVED]){//状态是发运中即已审批
if([self checkIsPermission:PURCHASE_PERMISSIONS_VENDORAPPROVE]){//供应商审批权
//显示确认按钮
_firstBtn.hidden = YES;
......@@ -159,6 +155,8 @@ typedef enum : NSUInteger {
_firstBtn.hidden = YES;
[self changeBtnFrame:_secondBtn title:@"作废" originX:LeftMargin width:OneWidth];
_secondBtn.tag = CancleTag;
}else{
[self hiddenTwoBtn];
}
}
}
......@@ -170,17 +168,22 @@ typedef enum : NSUInteger {
_secondBtn.tag = CancleTag;
self.indexStyle = 0;
}else{
[self hiddenTwoBtn];
}
}else if([self.bill.state isEqualToString:PURCHASE_STATE_ABORTED]){//已作废
_firstBtn.hidden = YES;
_secondBtn.hidden = YES;
self.indexStyle = 1;
CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame;
[self hiddenTwoBtn];
}
}
- (void)hiddenTwoBtn{
_firstBtn.hidden = YES;
_secondBtn.hidden = YES;
self.indexStyle = 1;
CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame;
}
//改变按钮的位置
- (void)changeBtnFrame:(UIButton *)btn title:(NSString *)title originX:(CGFloat)originX width:(CGFloat)width{
CGRect btnFrame = btn.frame;
......
......@@ -78,21 +78,23 @@
stateStr = @"未提交";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {
stateStr = @"已提交";
stateStr = @"未审批";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_REJECTED]) {
stateStr = @"已拒绝";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_APPROVED]) {
stateStr = @"已审批";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
stateStr = @"发运中";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_FINISHED]) {
}
// else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
// stateStr = @"发运中";
// [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
//
// }
else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_FINISHED]) {
stateStr = @"已完成";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_ABORTED]) {
......@@ -103,11 +105,6 @@
}
- (void)awakeFromNib {
// Initialization code
}
......
......@@ -309,7 +309,7 @@ typedef enum : NSUInteger {
- (void)createViewInCell:(SurveyCell *)cell indexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 0) {
_titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
_titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight)];
_titleField.textAlignment = NSTextAlignmentRight;
_titleField.textColor = HexColor(@"444444");
_titleField.placeholder = @"输入采购通知标题";
......@@ -319,7 +319,7 @@ typedef enum : NSUInteger {
[cell.contentView addSubview:_titleField];
}else if (indexPath.row == _dataArr.count -1){
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight)];
_noteTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
_noteTextView.minNumberOfLines = 1;
_noteTextView.maxNumberOfLines = 4;
......@@ -333,7 +333,7 @@ typedef enum : NSUInteger {
lineFrame.origin.y = TableHeight*2-1;
cell.lineLabel.frame = lineFrame;
}else{
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight))];
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight))];
contentLabel.textAlignment= NSTextAlignmentRight;
contentLabel.textColor = HexColor(@"bbbbbb");
contentLabel.font = FontSize(TitleSize);
......
......@@ -10,6 +10,9 @@
@interface ShopDetail : IBTModel
@property (nonatomic,strong)NSString *merchandise;//商品
@property (nonatomic,strong)NSString *product_uuid;//商品
@property (nonatomic,strong)NSString *product_code;//商品
@property (nonatomic,strong)NSString *packageSpecification;//包装规格
@property (nonatomic,strong)NSString *packageQuantity;//包装数量
@property (nonatomic,strong)NSString *packageUnit;//包装单位
......
......@@ -152,7 +152,8 @@ typedef enum : NSUInteger {
self.shopDetail.packageUnitPrice=packageUnitPrice.text;
self.shopDetail.totalMoney=totalMoney.text;
self.shopDetail.remark=remark.text;
self.shopDetail.product_code = self.productCodeStr;
self.shopDetail.product_uuid = self.productUuidStr;
if (merchandise.text.length == 0 ) {
ShowMessage(@"商品不能为空");
return NO;
......
......@@ -12,4 +12,6 @@
@property (nonatomic,strong)NSMutableArray *costArr;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,assign)CGRect viewFrame;
@property (nonatomic,assign)BOOL isHiddenEdit;
@end
......@@ -9,6 +9,7 @@
#import "CostViewController.h"
#import "HeaderCell.h"
#import "FooterCell.h"
#import "CostCell.h"
@interface CostViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate>
{
CGRect _tableFrame;
......@@ -32,24 +33,32 @@
self.tableView.backgroundColor = [UIColor whiteColor];
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.view addSubview:self.tableView];
NSArray *arr = @[@"费用",@"应付金额",@"已付金额"];
NSArray *arr = @[@"费用",@"应付金额",@"已付金额",@"尾款"];
HeaderCell *headCell = [[HeaderCell alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 38) withArr:arr];
[self.view addSubview:headCell];
self.tableView.tableHeaderView = headCell;
FooterCell *footCell = [[FooterCell alloc]initWithFrame:CGRectMake(0, 0, _tableFrame.size.width, 50) withTitle:@"+点击添加原料明细" isTwo:@""];
[self.view addSubview:footCell];
footCell.delegate = self;
self.tableView.tableFooterView = footCell;
if (!self.isHiddenEdit) {
FooterCell *footCell = [[FooterCell alloc]initWithFrame:CGRectMake(0, 0, _tableFrame.size.width, 50) withTitle:@"+点击添加费用明细" isTwo:@""];
[self.view addSubview:footCell];
footCell.delegate = self;
self.tableView.tableFooterView = footCell;
}
}
- (void)addClick{
[self.costArr addObject:@"dddd"];
[self.tableView reloadData];
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_AddTransportCost object:nil];
}
- (void)editClick:(UIButton *)btn{
FeeAcountDetail *fee = self.costArr[btn.tag];
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_AddTransportCost object:nil userInfo:@{@"indexPath":[NSIndexPath indexPathForRow:btn.tag inSection:0],@"feeAccountDetail":fee}];
}
#pragma mark footDelegate
- (void)choosePurchase{}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
......@@ -58,12 +67,21 @@
return self.costArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"cellID";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
static NSString *cellID = @"CostCell";
CostCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
cell = [[CostCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (self.isHiddenEdit) {
cell.editBtn.hidden = YES;
}
}
cell.editBtn.tag = indexPath.row;
[cell.editBtn addTarget:self action:@selector(editClick:) forControlEvents:UIControlEventTouchUpInside];
if (self.costArr.count) {
FeeAcountDetail *fee = self.costArr[indexPath.row];
[cell setFeeCost:fee row:indexPath.row];
}
cell.textLabel.text = @"3333333";
return cell;
}
/*
......
//
// NewCostViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "FeeAcountDetail.h"
typedef void(^GetTransportCost)(FeeAcountDetail *accountDetail,NSIndexPath *indexPath);
typedef void(^DeleteTransportCost)(FeeAcountDetail *accountDetail,NSIndexPath *indexPath);
@interface NewCostViewController : ICRBaseViewController
@property (nonatomic,copy)GetTransportCost getTransportCost;
@property (nonatomic,copy)DeleteTransportCost deleteTransportCost;
@property (nonatomic,strong)NSString *navTitle;
@property (nonatomic,strong)FeeAcountDetail *accountDetail;
@property (nonatomic,strong)NSIndexPath *indexPath;
@end
......@@ -10,8 +10,11 @@
#import "TopTransportView.h"
#import "BottomTransportView.h"
#import "TransportPurchaseViewController.h"
#import "PurchaseBillProduct.h"
#import "NewCostViewController.h"
#import "TransportPdtDetail.h"
#import "FeeAcountDetail.h"
#import "TransportViewController.h"
#import "ShopDetaileViewController.h"
typedef enum : NSUInteger {
SaveTag = 7000,
CommitTag,
......@@ -34,27 +37,67 @@ typedef enum : NSUInteger {
@end
@implementation NewTransportViewController
- (void)dealloc{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (instancetype)init{
self = [super init];
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(choseTransportPurchase) name:@"ChoseTransportPurchase" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(choseTransportPurchase) name:KNOTIFICATION_ChoseTransportPurchase object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addTransportCost:) name:KNOTIFICATION_AddTransportCost object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addPurchaseProduct:) name:KNOTIFICATION_AddPurchaseProduct object:nil];
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"新建发运单";
//布局
[self bulidLayout];
uuidObject = [NSNull null];
billNumberObject = [NSNull null];
versionObject = [NSNumber numberWithInteger:0];
// if (self.purchaseBill) {
// [self getDataFromServer];
// }
if (self.transport) {
[self getDataFromServer];
}
}
- (void)getDataFromServer{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"] ;
if (success == 1) {
NSDictionary *dictData = data[@"data"];
Transport *transport = [[Transport alloc]init];
[transport setValuesForKeysWithDictionary:dictData];
self.transport = transport;
[strongSelf fetchtTransportDetail];
}else{
[IBTLoadingView showTips:message];
}
}else{
[IBTLoadingView showTips:@" 无记录 "];
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getTransportResultWithTransportUuid:self.transport.uuid success:succ failure:fail];
}
- (void)fetchtTransportDetail
{
_sheetView.transport = self.transport;
[_bottomView refreshCost:self.transport.accountDetails];
[_bottomView refreshTranProduct:self.transport.pdtDetails];
}
- (void)bulidLayout{
self.view.backgroundColor = XXFBgColor;
_scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0,0, ScreenSize.width, ScreenSize.height- 64 - BottomViewHeight )];
......@@ -77,7 +120,7 @@ typedef enum : NSUInteger {
_sheetView.delegate = self;
[_scrollView addSubview:_sheetView];
_bottomView = [[BottomTransportView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_sheetView.frame) + 20, ScreenSize.width,BottomHeight)];
_bottomView = [[BottomTransportView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_sheetView.frame) + 20, ScreenSize.width,BottomHeight) withHidden:NO];
_bottomView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_bottomView];
}
......@@ -86,13 +129,13 @@ typedef enum : NSUInteger {
case SaveTag:
{
if ([self checkTransport]) {
[self getDataFromServer:PURCHASE_STATE_INITIAL msg:@"正在保存..."];
[self getDataFromServer:TRANSPORT_STATE_INITIAL msg:@"正在保存..."];
}
}
break;
case CommitTag:{
if ([self checkTransport]) {
[self getDataFromServer:PURCHASE_STATE_SUBMITTED msg:@"正在提交..."];
[self getDataFromServer:TRANSPORT_STATE_UNRECEIVED msg:@"正在提交..."];
}
}
......@@ -119,8 +162,8 @@ typedef enum : NSUInteger {
versionObject = versionN;
[IBTLoadingView showTips:[NSString stringWithFormat:@"当前单据%@已保存成功",billNumberS]];
}else{//提交成功
// PurchaseViewController *svc = [PurchaseViewController new];
// [self PushViewController:svc animated:YES];
TransportViewController *svc = [TransportViewController new];
[self PushViewController:svc animated:YES];
}
}else{
[IBTLoadingView showTips:message];
......@@ -138,21 +181,23 @@ typedef enum : NSUInteger {
if (self.transport.billnumber > 0 && billNumberObject == [NSNull null]) {
billNumberObject = self.transport.billnumber;
}
// if (self.purchaseBill && [versionObject integerValue] == 0) {
// versionObject = self.transport.version;
// }
if (self.transport && [versionObject integerValue] == 0) {
versionObject = self.transport.version;
}
NSMutableArray *billProducts = [NSMutableArray array];
for (PurchaseBillProduct *billProduct in _bottomView.productVC.productArr) {
[billProducts addObject:[billProduct dictForCommit]];
for (TransportPdtDetail *pdtDetail in _bottomView.productVC.transportProductArr) {
[billProducts addObject:[pdtDetail dictForCommit]];
}
NSMutableArray *costs = [NSMutableArray array];
for (FeeAcountDetail *fee in _bottomView.costVC.costArr) {
[costs addObject:[fee dictForCommit]];
}
// self.state = state;
NSDictionary *dict = @{@"uuid":uuidObject,
// @"version":versionObject,
@"version":versionObject,
@"billnumber":billNumberObject,
@"enterprise":[ICRUserUtil sharedInstance].orgId,
@"state":state,
@"warehouseUuid":[IBTCommon checkString:_sheetView.warehouseUuid],
@"warehouseCode":[IBTCommon checkString:_sheetView.warehouseCode],
......@@ -167,7 +212,7 @@ typedef enum : NSUInteger {
@"pdtDetails":billProducts,
@"accountDetails":costs};
[IBTLoadingView showProgressLabel:msg];
[[ICRHTTPController sharedController] savePurchaseWithData:dict success:succ failure:fail];
[[ICRHTTPController sharedController] saveTransportWithData:dict success:succ failure:fail];
}
......@@ -198,7 +243,7 @@ typedef enum : NSUInteger {
ShowMessage(@"司机电话不能为空");
return NO;
}
if (_bottomView.productVC.productArr.count == 0) {
if (_bottomView.productVC.transportProductArr.count == 0) {
ShowMessage(@"商品不能为空");
return NO;
}
......@@ -214,10 +259,59 @@ typedef enum : NSUInteger {
- (void)choseTransportPurchase{
TransportPurchaseViewController *tpv = [TransportPurchaseViewController new];
tpv.getProchaseProduct = ^(NSArray *products){
[_bottomView refreshProduct:products];
if (products.count > 0) {
[_bottomView reProduct:products];
}
};
[self PushViewController:tpv animated:YES];
}
- (void)addTransportCost:(NSNotification *)fination{
NewCostViewController *nvc = [NewCostViewController new];
NSIndexPath *indexPath = [[fination userInfo] objectForKey:@"indexPath"];
FeeAcountDetail *fee = [[fination userInfo] objectForKey:@"feeAccountDetail"];
if (indexPath) {
nvc.navTitle = @"编辑费用";
nvc.indexPath = indexPath;
nvc.accountDetail = fee;
}else{
nvc.navTitle = @"添加费用";
}
nvc.getTransportCost = ^(FeeAcountDetail *fee,NSIndexPath *indexPath){
if (fee) {
[_bottomView refreshCost:fee indexPath:indexPath];
}
};
nvc.deleteTransportCost = ^(FeeAcountDetail *fee,NSIndexPath *indexPath){
if (fee) {
[_bottomView refreshDelCost:fee indexPath:indexPath];
}
};
[self PushViewController:nvc animated:YES];
}
- (void)addPurchaseProduct:(NSNotification *)fication{
ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init];
// 回调
svc.choseShopDetail = ^(ShopDetail *shopDetail){
TransportPdtDetail *billProduct = [[TransportPdtDetail alloc]init];
billProduct.productUuid = shopDetail.product_uuid;
billProduct.productCode = shopDetail.product_code;
billProduct.productName = shopDetail.merchandise;
billProduct.qpc = [NSNumber numberWithFloat:[shopDetail.packageSpecification floatValue]];
billProduct.unit = shopDetail.packageUnit;
billProduct.qty = [NSNumber numberWithFloat:[shopDetail.packageQuantity floatValue]];
billProduct.price = [NSNumber numberWithFloat:[shopDetail.packageUnitPrice floatValue]];
billProduct.baseQty = [NSNumber numberWithFloat:[shopDetail.foundationQuantity floatValue]];
billProduct.total = [NSNumber numberWithFloat:[shopDetail.totalMoney floatValue]];
billProduct.note = shopDetail.remark;
billProduct.qpcStr = @"fdsfdsfdsa";
[_bottomView refreshProduct:billProduct];
};
svc.title = [IBTCommon localizableString:@"AddShopDetail"];
[self PushViewController:svc animated:YES];
}
#pragma mark - TopPurchaseViewDelegate
......@@ -237,6 +331,7 @@ typedef enum : NSUInteger {
[super didReceiveMemoryWarning];
}
/*
#pragma mark - Navigation
......
//
// TransportDetailViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "Transport.h"
@interface TransportDetailViewController : ICRBaseViewController
@property (nonatomic,strong)Transport *transport;
@end
//
// TransportProductViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface TransportProductViewController : ICRBaseViewController
@property (nonatomic,strong)NSMutableArray *transportProductArr;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,assign)CGRect viewFrame;
@property (nonatomic,assign)BOOL isHiddenEdit;
@property (nonatomic,strong)NSString *twoTitle;
@end
//
// TransportProductViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransportProductViewController.h"
#import "FooterCell.h"
#import "HeaderCell.h"
#import "TransportPurductCell.h"
#import "TransportPdtDetail.h"
#define TableHeight 44
#define ShowHeight 110
@interface TransportProductViewController ()
<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate>
{
CGRect _tableFrame;
NSMutableArray *_selectRowArr;//记录当前选中的cell
}
@end
@implementation TransportProductViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = XXFBgColor;
[self initData];
[self createView];
}
- (void)initData{
_selectRowArr = [[NSMutableArray alloc]init];
if (!self.transportProductArr) {
self.transportProductArr = [NSMutableArray array];
}
// TransportPdtDetail *pdtDetail = [TransportPdtDetail new];
//
// pdtDetail.productName = @"dd";
// pdtDetail.productUuid = @"402880e64e287fe2014e28895b8a0032";
// pdtDetail.productCode = @"农夫山泉";
// pdtDetail.qpc = [NSNumber numberWithFloat:22];
// pdtDetail.unit = @"筐";
// pdtDetail.qty = [NSNumber numberWithFloat:23];
// pdtDetail.price = [NSNumber numberWithFloat:333];
// pdtDetail.baseQty = [NSNumber numberWithFloat:333];
// pdtDetail.total = [NSNumber numberWithFloat:80];
// pdtDetail.note = @"hshshshsh";
// pdtDetail.qpcStr = @"fdsfdsfdsa";
//
//
// [self.transportProductArr addObject:pdtDetail];
}
- (void)setViewFrame:(CGRect)viewFrame{
_tableFrame = viewFrame;
}
- (void)createView{
self.tableView = [[UITableView alloc]initWithFrame:_tableFrame style:(UITableViewStylePlain)];
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.view addSubview:self.tableView];
NSArray *arr = @[@"商品",@"单价",@"包装数量"];
HeaderCell *headCell = [[HeaderCell alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 38) withArr:arr];
[self.view addSubview:headCell];
self.tableView.tableHeaderView = headCell;
if (!self.isHiddenEdit) {
FooterCell *footCell = [[FooterCell alloc]initWithFrame:CGRectMake(0, 0, _tableFrame.size.width, 50) withTitle:@"+点击添加商品明细" isTwo:self.twoTitle];
[self.view addSubview:footCell];
footCell.delegate = self;
self.tableView.tableFooterView = footCell;
}
}
#pragma mark - footerDelegate
- (void)addClick{
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_AddPurchaseProduct object:nil];
}
- (void)choosePurchase{
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_ChoseTransportPurchase object:nil];
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.transportProductArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"TransportPurductCell";
TransportPurductCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[TransportPurductCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID withImageName:@"edit"];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (self.isHiddenEdit) {
cell.editBtn.hidden = YES;
}
}
if ([self isHaveIndexPath:indexPath]) {
cell.smallImageView.image = [UIImage imageNamed:@"arrowdown"];
CGRect Linefrmame = cell.lineLabel.frame;
Linefrmame.origin.y = ShowHeight + TableHeight -1;
cell.lineLabel.frame = Linefrmame;
CGRect showfrmame = cell.showView.frame;
showfrmame.size.height = ShowHeight;
cell.showView.frame = showfrmame;
cell.backgroundColor = XXFBgColor;
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
CGRect Linefrmame = cell.lineLabel.frame;
Linefrmame.origin.y = TableHeight-1;
cell.lineLabel.frame = Linefrmame;
CGRect showfrmame = cell.showView.frame;
showfrmame.size.height = 0;
cell.showView.frame = showfrmame;
cell.backgroundColor = [UIColor whiteColor];
}
cell.editBtn.tag = indexPath.row;
[cell.editBtn addTarget:self action:@selector(editClick:) forControlEvents:UIControlEventTouchUpInside];
if (self.transportProductArr.count > 0) {
TransportPdtDetail *billP = self.transportProductArr[indexPath.row];
[cell setPdtDetail:billP row:indexPath.row];
}
return cell;
}
- (BOOL)isHaveIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in _selectRowArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
TransportPurductCell *cell = (TransportPurductCell *)[tableView cellForRowAtIndexPath:indexPath];
CGRect Linefrmame = cell.lineLabel.frame;
CGRect showfrmame = cell.showView.frame;
if (Linefrmame.origin.y == TableHeight - 1) {
cell.smallImageView.image = [UIImage imageNamed:@"arrowdown"];
Linefrmame.origin.y = ShowHeight + TableHeight - 1;
showfrmame.size.height = ShowHeight;
cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr addObject:indexPath];
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
Linefrmame.origin.y = TableHeight -1;
showfrmame.size.height = 0;
cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr removeObject:indexPath];
}
cell.lineLabel.frame = Linefrmame;
cell.showView.frame = showfrmame;
[self.tableView reloadData];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if ([self isHaveIndexPath:indexPath]) {
return ShowHeight + TableHeight;
}
return TableHeight;
}
- (void)editClick:(UIButton *)btn{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"" message:@"哈哈" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
- (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
......@@ -9,6 +9,7 @@
#import "TransportPurchaseViewController.h"
#import "TransportPurchaseCell.h"
#import "QueryOrder.h"
#import "TransportPdtDetail.h"
#define TopMargin 50
#define TableHeight 50
@interface TransportPurchaseViewController ()<UITextFieldDelegate,UITableViewDataSource,UITableViewDelegate>
......@@ -149,20 +150,20 @@
if(self.dataArr.count > 0){
PurchaseBill *bill = _dataArr[indexPath.row];
NSMutableArray *arr = [NSMutableArray array];
PurchaseBillProduct *billProduct = [PurchaseBillProduct new];
TransportPdtDetail *billProduct = [TransportPdtDetail new];
billProduct.product_name = @"dd";
billProduct.product_uuid = @"402880e64e287fe2014e28895b8a0032";
billProduct.product_code = @"农夫山泉";
billProduct.productName = @"dd";
billProduct.productUuid = @"402880e64e287fe2014e28895b8a0032";
billProduct.productCode = @"农夫山泉";
billProduct.qpc = [NSNumber numberWithFloat:22];
billProduct.unit = @"筐";
billProduct.qty = [NSNumber numberWithFloat:23];
billProduct.price = [NSNumber numberWithFloat:333];
billProduct.baseQty = [NSNumber numberWithFloat:333];
billProduct.basePrice = [NSNumber numberWithFloat:33];
billProduct.total = [NSNumber numberWithFloat:80];
billProduct.remark = @"hshshshsh";
billProduct.note = @"hshshshsh";
billProduct.qpcStr = @"fdsfdsfdsa";
billProduct.purchasebillnumber = bill.billNumber;
[arr addObject:billProduct];
[arr addObject:billProduct];
bill.products = arr;
......@@ -171,7 +172,7 @@
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 200;
return 210;
}
#pragma mark - 按钮确定
- (void)sureClick{
......@@ -183,7 +184,7 @@
#pragma mark - 得到通知的方法
- (void)getSelectPurchaseProduct:(NSNotification *)fination{
NSDictionary *dict = fination.userInfo;
PurchaseBillProduct *billProduct = dict[@"selectArr"];
TransportPdtDetail *billProduct = dict[@"selectArr"];
NSString *state = dict[@"state"];
if ([state isEqualToString:@"add"]) {
[self.indexArr addObject:billProduct];
......
//
// TransportViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface TransportViewController : ICRBaseViewController
@end
......@@ -23,6 +23,7 @@
@property (nonatomic,strong)NSString *type;//类型
@property (nonatomic,strong)NSString *carphone;//司机电话
@property (nonatomic,strong)NSString *note;//备注
@property (nonatomic,strong)NSNumber *version;//版本
@property (nonatomic,strong)NSString *create_time;//创建时间
@property (nonatomic,strong)NSString *create_id;//创建人代码
......@@ -31,6 +32,8 @@
@property (nonatomic,strong)NSString *lastModified_id;//最后修改人代码
@property (nonatomic,strong)NSString *lastModified_operName;//最后修改人名称
@property (nonatomic,strong)NSArray *pdtDetails;//商品
@property (nonatomic,strong)NSArray *accountDetails;//费用
@end
//
// TransportPdtDetail.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface TransportPdtDetail : IBTModel
@property (nonatomic,strong)NSString *uuid;//唯一标识
@property (nonatomic,strong)NSString *productUuid;//商品uuid
@property (nonatomic,strong)NSString *productCode;//商品代码
@property (nonatomic,strong)NSString *productName;//商品名称
@property (nonatomic,strong)NSString *purchasebillnumber;//采购单号
@property (nonatomic,strong)NSString *purchasePdtDetail;//采购单明细id
@property (nonatomic,strong)NSNumber *qpc;//包装规格
@property (nonatomic,strong)NSString *qpcStr;//包装规格描述
@property (nonatomic,strong)NSString *unit;//包装单位
@property (nonatomic,strong)NSNumber *qty;//发运的包装数量
@property (nonatomic,strong)NSNumber *price;//基础单价
@property (nonatomic,strong)NSNumber *baseQty;//发运的基础数量
@property (nonatomic,strong)NSNumber *total;//发运合计金额
@property (nonatomic,strong)NSString *note;//备注
@end
//
// TransportPdtDetail.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransportPdtDetail.h"
@implementation TransportPdtDetail
@end
......@@ -7,13 +7,29 @@
//
#import <UIKit/UIKit.h>
#import "ProductBillViewController.h"
#import "TransportProductViewController.h"
#import "CostViewController.h"
#import "FeeAcountDetail.h"
#import "TransportPdtDetail.h"
@interface BottomTransportView : UIView
@property (nonatomic,strong)ProductBillViewController *productVC;
- (instancetype)initWithFrame:(CGRect)frame withHidden:(BOOL)isHidden;
@property (nonatomic,strong)TransportProductViewController *productVC;
@property (nonatomic,strong)CostViewController *costVC;
@property (nonatomic,assign)BOOL isHiddenEdit;
//刷新tableView
- (void)refreshProduct:(NSArray *)productArr;
//添加或者编辑费用
- (void)refreshCost:(FeeAcountDetail *)fee indexPath:(NSIndexPath *)indexPath;
//删除费用
- (void)refreshDelCost:(FeeAcountDetail *)fee indexPath:(NSIndexPath *)indexPath;
//刷新费用
- (void)refreshCost:(NSArray *)costArr;
//刷新商品
- (void)refreshTranProduct:(NSArray *)tranProductArr;
#warning - 临时
- (void)reProduct:(NSArray *)tranProductArr;
//添加或者编辑
- (void)refreshProduct:(TransportPdtDetail *)transportPdtDetail;
@end
......@@ -7,7 +7,8 @@
//
#import "BottomTransportView.h"
#import "TransportPdtDetail.h"
#import "FeeAcountDetail.h"
#define ContentHeight 44
#define BtnWidth 100
#define BeginTag 8000
......@@ -24,9 +25,10 @@
@implementation BottomTransportView
- (instancetype)initWithFrame:(CGRect)frame{
- (instancetype)initWithFrame:(CGRect)frame withHidden:(BOOL)isHidden{
self = [super initWithFrame:frame];
if (self) {
self.isHiddenEdit = isHidden;
//界面
[self bulidLayout];
}
......@@ -67,9 +69,11 @@
if (i == 0) {
view.backgroundColor = [UIColor redColor];
self.productVC.viewFrame = view.bounds;
self.productVC.isHiddenEdit = self.isHiddenEdit;
[view addSubview:self.productVC.view];
}else if(i == 1){
self.costVC.viewFrame = view.bounds;
self.costVC.isHiddenEdit = self.isHiddenEdit;
[view addSubview:self.costVC.view];
view.backgroundColor = [UIColor blueColor];
}
......@@ -86,7 +90,7 @@
}
- (void)addChildView{
self.productVC = [[ProductBillViewController alloc]init];
self.productVC = [[TransportProductViewController alloc]init];
self.productVC.twoTitle = @"+选择采购单";
self.costVC = [[CostViewController alloc]init];
}
......@@ -115,15 +119,59 @@
btn.enabled = NO;
_currentBtn = btn;
}
- (void)refreshProduct:(NSArray *)productArr{
if (self.productVC.productArr) {
[self.productVC.productArr addObjectsFromArray:productArr];
//添加商品
- (void)refreshProduct:(TransportPdtDetail *)transportPdtDetail
{
if (self.productVC.transportProductArr) {
[self.productVC.transportProductArr addObject:transportPdtDetail];
[self.productVC.tableView reloadData];
}
}
//添加编辑
- (void)refreshCost:(FeeAcountDetail *)fee indexPath:(NSIndexPath *)indexPath{
if (indexPath) {
[self.costVC.costArr replaceObjectAtIndex:indexPath.row withObject:fee];
// NSArray *indexArray=[NSArray arrayWithObject:indexPath];
// [self.costVC.tableView reloadRowsAtIndexPaths:indexArray withRowAnimation:UITableViewRowAnimationAutomatic];
[self.costVC.tableView reloadData];
}else{
if (self.costVC.costArr) {
[self.costVC.costArr addObject:fee];
[self.costVC.tableView reloadData];
}
}
}
//删除
- (void)refreshDelCost:(FeeAcountDetail *)fee indexPath:(NSIndexPath *)indexPath{
if (indexPath) {
[self.costVC.costArr removeObjectAtIndex:indexPath.row];
[self.costVC.tableView reloadData];
}
}
//刷新
- (void)refreshCost:(NSArray *)costArr{
NSMutableArray *feeArr = [NSMutableArray array];
for (NSDictionary *billDict in costArr) {
FeeAcountDetail *billProbuct = [FeeAcountDetail new];
[billProbuct setValuesForKeysWithDictionary:billDict];
[feeArr addObject:billProbuct];
}
self.costVC.costArr = feeArr;
[self.costVC.tableView reloadData];
}
- (void)refreshTranProduct:(NSArray *)tranProductArr{
NSMutableArray *productArr = [NSMutableArray array];
for (NSDictionary *billDict in tranProductArr) {
TransportPdtDetail *billProbuct = [TransportPdtDetail new];
[billProbuct setValuesForKeysWithDictionary:billDict];
[productArr addObject:billProbuct];
}
self.productVC.transportProductArr = productArr;
[self.productVC.tableView reloadData];
}
- (void)reProduct:(NSArray *)tranProductArr{
[self.productVC.transportProductArr addObjectsFromArray:tranProductArr];
[self.productVC.tableView reloadData];
}
@end
//
// TransportPurductCell.h
// CostCell.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TransportPurductCell : UITableViewCell
#import "FeeAcountDetail.h"
@interface CostCell : UITableViewCell
@property (nonatomic,strong)UIImageView *smallImageView;
@property (nonatomic,strong)UIButton *editBtn;
@property (nonatomic,strong)UILabel *seqLabel;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *standLabel;
@property (nonatomic,strong)UILabel *countLabel;
@property (nonatomic,strong)UILabel *baseCountLabel;
@property (nonatomic,strong)UILabel *typeLabel;
@property (nonatomic,strong)UILabel *actualLabel;
@property (nonatomic,strong)UILabel *paidLabel;
@property (nonatomic,strong)UILabel *leftLabel;
@property (nonatomic,strong)UILabel *lineLabel;
- (void)setFeeCost:(FeeAcountDetail *)fee row:(NSInteger)row;
@end
//
// TransportPurductCell.m
// CostCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransportPurductCell.h"
#import "CostCell.h"
#define LeftMargin 13
#define TableHeight 44
#define SmallSize 10
#define SmallWidth 20
#define SpaceMargin 1
#define LeftWidth 40
#define LeftWidth 45
#define RightWidth 30
@implementation CostCell
#define ShowWidth 150
#define ShowHeight 20
@implementation TransportPurductCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
......@@ -29,55 +27,67 @@
- (void)bulidLayout
{
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (4 -1))/4;
CGFloat headWidth = (ScreenSize.width - LeftWidth - RightWidth - SpaceMargin* (4 -1))/4;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"arrowright"];
self.seqLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, 0, SmallWidth, TableHeight))];
self.seqLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.smallImageView.frame), 0, SmallWidth, TableHeight))];
self.seqLabel.textColor = GXF_CONTENT_COLOR;
self.seqLabel.text = @"13";
self.seqLabel.font = GXF_SIXTEENTEH_SIZE;
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftWidth, 0, headWidth, TableHeight))];
self.titleLabel.textAlignment = NSTextAlignmentLeft;
self.titleLabel.textColor = GXF_CONTENT_COLOR;
self.titleLabel.text = @"苹果桃子";
self.titleLabel.font = GXF_SIXTEENTEH_SIZE;
self.typeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftWidth, 0, headWidth, TableHeight))];
self.typeLabel.textAlignment = NSTextAlignmentLeft;
self.typeLabel.textColor = GXF_CONTENT_COLOR;
self.typeLabel.text = @"苹果桃子";
self.typeLabel.font = GXF_SIXTEENTEH_SIZE;
self.standLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.standLabel.textAlignment = NSTextAlignmentLeft;
self.standLabel.textColor = GXF_CONTENT_COLOR;
self.standLabel.text = @"80";
self.standLabel.font = GXF_SIXTEENTEH_SIZE;
self.actualLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.typeLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.actualLabel.textAlignment = NSTextAlignmentLeft;
self.actualLabel.textColor = GXF_CONTENT_COLOR;
self.actualLabel.text = @"30000";
self.actualLabel.font = GXF_SIXTEENTEH_SIZE;
self.countLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.standLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.countLabel.textAlignment = NSTextAlignmentLeft;
self.countLabel.text = @"200";
self.countLabel.textColor = GXF_CONTENT_COLOR;
self.countLabel.font = GXF_SIXTEENTEH_SIZE;
self.paidLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.actualLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.paidLabel.textAlignment = NSTextAlignmentLeft;
self.paidLabel.text = @"2015-04-05";
self.paidLabel.textColor = GXF_CONTENT_COLOR;
self.paidLabel.font = GXF_SIXTEENTEH_SIZE;
self.baseCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.countLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.baseCountLabel.textAlignment = NSTextAlignmentLeft;
self.baseCountLabel.text = @"200";
self.baseCountLabel.textColor = GXF_CONTENT_COLOR;
self.baseCountLabel.font = GXF_SIXTEENTEH_SIZE;
self.leftLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.paidLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.leftLabel.textAlignment = NSTextAlignmentLeft;
self.leftLabel.text = @"2015-04-05";
self.leftLabel.textColor = GXF_CONTENT_COLOR;
self.leftLabel.font = GXF_SIXTEENTEH_SIZE;
self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.editBtn setImage:[UIImage imageNamed:@"selected"] forState:UIControlStateNormal];
self.editBtn.frame = CGRectMake(ScreenSize.width - LeftWidth, 0, LeftWidth , TableHeight);
self.editBtn.contentMode = UIViewContentModeScaleAspectFit;
[self.editBtn setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateNormal];
self.editBtn.frame = CGRectMake(ScreenSize.width - LeftWidth, 0, LeftWidth, TableHeight);
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin,TableHeight-1, ScreenSize.width - LeftMargin * 2, 1))];;
self.lineLabel.backgroundColor = GXF_LINE_COLOR;
[self.contentView addSubview:self.smallImageView];
[self.contentView addSubview:self.seqLabel];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.standLabel];
[self.contentView addSubview:self.countLabel];
[self.contentView addSubview:self.baseCountLabel];
[self.contentView addSubview:self.smallImageView];
[self.contentView addSubview:self.typeLabel];
[self.contentView addSubview:self.editBtn];
[self.contentView addSubview:self.actualLabel];
[self.contentView addSubview:self.paidLabel];
[self.contentView addSubview:self.leftLabel];
[self.contentView addSubview:self.lineLabel];
}
- (void)setFeeCost:(FeeAcountDetail *)fee row:(NSInteger)row
{
self.seqLabel.text = [NSString stringWithFormat:@"%@",@(row+1)];
self.typeLabel.text = fee.accounttitle;
self.actualLabel.text = [fee.actualmoney stringValue];
self.paidLabel.text = [fee.paidmoney stringValue];
self.leftLabel.text = [fee.leftmoney stringValue];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
......
......@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
#import "HPGrowingTextView.h"
#import "Transport.h"
@protocol TopTransportViewDelegate <NSObject>
- (void)hiddenKeyBoard;
......@@ -36,5 +36,6 @@
@property (nonatomic,strong)NSString *type;
@property (nonatomic,strong)NSString *carphone;
@property (nonatomic,strong)NSString *note;
@property (nonatomic,strong)Transport *transport;
@end
......@@ -125,6 +125,43 @@
}
}
}
- (void)setTransport:(Transport *)transport{
if (transport) {
if (transport.warehouseName.length > 0) {
self.warehouseLabel.text = transport.warehouseName;
self.warehouseLabel.textColor = GXF_CONTENT_COLOR;
self.warehouseCode = transport.warehouseCode;
self.warehouseName = transport.warehouseName;
self.warehouseUuid = transport.warehouseUuid;
}
if (transport.type.length > 0) {
NSString *type = [transport.type isEqualToString:GXF_Critical] ? @"紧急" : @"普通";
self.typeLabel.text = type;
self.typeLabel.textColor = GXF_CONTENT_COLOR;
self.type = transport.type;
}
if (transport.rwarehouseName.length > 0) {
self.rwarehouseLabel.text = transport.rwarehouseName;
self.rwarehouseLabel.textColor = GXF_CONTENT_COLOR;
self.rwarehouseCode = transport.rwarehouseCode;
self.rwarehouseName = transport.rwarehouseName;
self.rwarehouseUuid = transport.rwarehouseUuid;
}
if (transport.carnumber.length > 0) {
self.carTextFiled.text = transport.carnumber;
self.carnumber = transport.carnumber;
}
if (transport.carphone) {
self.phoneTextFiled.text = transport.carphone;
self.carphone = transport.carphone;
}
if (transport.note) {
self.remarkTextView.text = transport.note;
self.note = transport.note;
}
}
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if(indexPath.row == 0){
ChooseWarehouseViewController *cvc = [ChooseWarehouseViewController new];
......@@ -160,9 +197,13 @@
tvc.choseBaseInfo = ^(NSArray *types){
if (types.count > 0) {
NSString *type = types[0];
self.typeLabel.text = [type isEqualToString:GXF_Critical] ? @"紧急":@"普通";
self.typeLabel.text = type;
self.typeLabel.textColor = GXF_CONTENT_COLOR;
self.type = type;
if ([type isEqualToString:@"紧急"]) {
self.type = GXF_Critical;
}else{
self.type = GXF_Normal;
}
}
};
......
//
// TransportBoltView.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol TransportBoltViewDelegate <NSObject>
- (void)getBoltValueSelectRow:(NSString *)state;
- (void)getuserLike:(NSString *)userLike;
- (void)getbillLike:(NSString *)billLike;
- (void)clearBoltInformation;
@end
@interface TransportBoltView : UIView<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,weak)id <TransportBoltViewDelegate>delegate;
@property (nonatomic,strong)UITextField *userFiled;//采购单号类似于
@property (nonatomic,strong)UITextField *billFiled;//通知单号类似于
@property (nonatomic,strong)UITextField *creatorField;//供应商uuid类似于
- (instancetype)initWithFrame:(CGRect)frame state:(NSString *)state userNumber:(NSString *)userNumber billNumber:(NSString *)billNumber;
@end
This diff is collapsed.
//
// TransportCell.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "Transport.h"
@interface TransportCell : UITableViewCell
@property (nonatomic,strong)UILabel *billNumberLabel;//单号
@property (nonatomic,strong)UILabel *warehouseLabel;//仓库
@property (nonatomic,strong)UILabel *carnumberLabel;//车辆
@property (nonatomic,strong)UILabel *createOperNameLabel;//创建人
@property (nonatomic,strong)UILabel *createTimeLabel;//创建时间
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIButton *stateBtn;
@property (nonatomic,strong)Transport *transport;
@end
//
// TransportCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransportCell.h"
#define TitleSize 16
#define LeftMargin 90
#define TopMargin 10
#define TitleHeight 20
#define TableHeight 120
@implementation TransportCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayout];
}
return self;
}
- (void)bulidLayout
{
self.stateBtn = [UIButton buttonWithType:UIButtonTypeCustom];
self.stateBtn.frame = CGRectMake(TopMargin *2 , TopMargin, LeftMargin - TopMargin*3, 20);
self.stateBtn.titleLabel.font = GXF_FOURTEENTH_SIZE;
[self.stateBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
self.stateBtn.enabled = NO;
self.billNumberLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, TopMargin, ScreenSize.width - LeftMargin, TitleHeight))];
self.billNumberLabel.textColor = GXF_CONTENT_COLOR;
self.billNumberLabel.font = GXF_SIXTEENTEH_SIZE;
self.warehouseLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, CGRectGetMaxY(self.billNumberLabel.frame), ScreenSize.width - LeftMargin, TitleHeight))];
self.warehouseLabel.numberOfLines = 0;
self.warehouseLabel.textColor = GXF_CELL_COLOR;
self.warehouseLabel.font = GXF_FOURTEENTH_SIZE;
self.carnumberLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, CGRectGetMaxY(self.warehouseLabel.frame), ScreenSize.width - LeftMargin, TitleHeight))];
self.carnumberLabel.textColor = GXF_CELL_COLOR;
self.carnumberLabel.font = GXF_FOURTEENTH_SIZE;
self.createOperNameLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, CGRectGetMaxY(self.carnumberLabel.frame), ScreenSize.width - LeftMargin, TitleHeight))];
self.createOperNameLabel.textColor = GXF_CELL_COLOR;
self.createOperNameLabel.font = GXF_FOURTEENTH_SIZE;
self.createTimeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, CGRectGetMaxY(self.createOperNameLabel.frame), ScreenSize.width - LeftMargin, TitleHeight))];
self.createTimeLabel.textColor = GXF_CELL_COLOR;
self.createTimeLabel.font = GXF_FOURTEENTH_SIZE;
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin,TableHeight-1, ScreenSize.width - LeftMargin - TopMargin * 2, 1))];;
self.lineLabel.backgroundColor = GXF_LINE_COLOR;
[self.contentView addSubview:self.stateBtn];
[self.contentView addSubview:self.billNumberLabel];
[self.contentView addSubview:self.warehouseLabel];
[self.contentView addSubview:self.carnumberLabel];
[self.contentView addSubview:self.createOperNameLabel];
[self.contentView addSubview:self.createTimeLabel];
[self.contentView addSubview:self.lineLabel];
}
- (void)setTransport:(Transport *)transport{
self.billNumberLabel.text = [NSString stringWithFormat:@"单号:%@",transport.billnumber];
self.warehouseLabel.text = [NSString stringWithFormat:@"仓库:%@-%@",transport.warehouseName,transport.rwarehouseName];
self.carnumberLabel.text = [NSString stringWithFormat:@"车辆:%@",transport.carnumber] ;
self.createOperNameLabel.text = [NSString stringWithFormat:@"创建人:%@",transport.create_operName] ;
self.createTimeLabel.text =[NSString stringWithFormat:@"创建时间:%@",transport.create_time];
NSString *stateStr = @"";
if ([transport.state isEqualToString:TRANSPORT_STATE_INITIAL]) {
stateStr = @"未提交";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled];
}else if ([transport.state isEqualToString:TRANSPORT_STATE_UNRECEIVED]) {
stateStr = @"未收货";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([transport.state isEqualToString:TRANSPORT_STATE_RECEIVED]) {
stateStr = @"已收货";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled];
}else if ([transport.state isEqualToString:TRANSPORT_STATE_ABORTED]) {
stateStr = @"已作废";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled];
}
[self.stateBtn setTitle:stateStr forState:UIControlStateNormal];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -7,12 +7,12 @@
//
#import <UIKit/UIKit.h>
#import "ProductBillCell.h"
#import "PurchaseBill.h"
@interface TransportPurchaseCell : UITableViewCell<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UILabel *secondLabel;
@property (nonatomic,strong)UILabel *threeLabel;
@property (nonatomic,strong)UITableView *secondTable;
@property (nonatomic,strong)NSMutableArray *secondArr;
......@@ -21,4 +21,5 @@
@property (nonatomic,strong)NSMutableArray *indexArr;
@property (nonatomic,strong)NSMutableArray *selectArr;
@end
......@@ -7,7 +7,7 @@
//
#import "TransportPurchaseCell.h"
#import "PurchaseBillProduct.h"
#import "TransportPurductCell.h"
#import "HeaderCell.h"
@implementation TransportPurchaseCell
......@@ -23,22 +23,31 @@
- (void)bulidLayout
{
self.contentView.backgroundColor = XXFBgColor;
UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 200)];
bgView.backgroundColor = [UIColor whiteColor];
[self.contentView addSubview:bgView];
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0,0, ScreenSize.width, 1))];;
self.lineLabel.backgroundColor = GXF_LINE_COLOR;
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0, 0, ScreenSize.width, 44))];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.titleLabel.textColor = GXF_NAVIGAYION_COLOR;
self.titleLabel.text = @"苹果桃子";
self.titleLabel.font = GXF_SIXTEENTEH_SIZE;
self.titleLabel.font = GXF_SEVENTEENTH_SIZE;
self.secondLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0,44-1, ScreenSize.width, 1))];;
self.secondLabel.backgroundColor = GXF_LINE_COLOR;
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.lineLabel];
[self.contentView addSubview:self.secondLabel];
self.threeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0,200-1, ScreenSize.width, 1))];;
self.threeLabel.backgroundColor = GXF_LINE_COLOR;
[bgView addSubview:self.titleLabel];
[bgView addSubview:self.lineLabel];
[bgView addSubview:self.secondLabel];
[bgView addSubview:self.threeLabel];
}
- (void)setBill:(PurchaseBill *)bill{
......@@ -52,7 +61,7 @@
// [self.secondArr addObject:billProcuct];
// }
self.secondTable = [[UITableView alloc]initWithFrame:(CGRectMake(0, 44,ScreenSize.width, 200-44)) style:(UITableViewStylePlain)];
self.secondTable = [[UITableView alloc]initWithFrame:(CGRectMake(0, 44,ScreenSize.width, 200-45)) style:(UITableViewStylePlain)];
self.secondTable.delegate = self;
self.secondTable.dataSource = self;
......@@ -79,21 +88,22 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellID = @"ProductBillCell";
ProductBillCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
static NSString *cellID = @"TransportPurductCell";
TransportPurductCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[ProductBillCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
cell = [[TransportPurductCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID withImageName:@"selected"];
cell.editBtn.hidden = YES;
cell.rightImageName = @"edit";
}
PurchaseBillProduct * billProduct = self.secondArr[indexPath.row];
[cell setBillProduct:billProduct row:indexPath.row];
TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
[cell setPdtDetail:billProduct row:indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
ProductBillCell *cell = (ProductBillCell *)[tableView cellForRowAtIndexPath:indexPath];
PurchaseBillProduct * billProduct = self.secondArr[indexPath.row];
TransportPurductCell *cell = (TransportPurductCell *)[tableView cellForRowAtIndexPath:indexPath];
TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
if (![self isHaveIndexPath:indexPath]) {
cell.editBtn.hidden = NO;
[self.selectArr addObject:indexPath];
......
//
// TransportPurductCell.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TransportPdtDetail.h"
@interface TransportPurductCell : UITableViewCell
@property (nonatomic,strong)UIImageView *smallImageView;
@property (nonatomic,strong)UIButton *editBtn;
@property (nonatomic,strong)UILabel *seqLabel;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *priceLabel;
@property (nonatomic,strong)UILabel *countLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIView *showView;
@property (nonatomic,strong)UILabel *showStandLabel;
@property (nonatomic,strong)UILabel *showCountLabel;
@property (nonatomic,strong)UILabel *showBaseCountLabel;
@property (nonatomic,strong)UILabel *showPriceLabel;
@property (nonatomic,strong)UILabel *showTotalLabel;
@property (nonatomic,strong)UILabel *showNoteLabel;
@property (nonatomic,strong)UILabel *showPurchaseLabel;
@property (nonatomic,strong)NSString *rightImageName;
- (void)setPdtDetail:(TransportPdtDetail *)pdtDetail row:(NSInteger)row;
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier withImageName:(NSString *)imageName;
@end
//
// TransportPurductCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/6.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "TransportPurductCell.h"
#define LeftMargin 13
#define TableHeight 44
#define SmallSize 10
#define SmallWidth 20
#define SpaceMargin 1
#define LeftWidth 45
#define RightWidth 30
#define ShowWidth 150
#define ShowHeight 20
@implementation TransportPurductCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier withImageName:(NSString *)imageName{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.rightImageName = imageName;
[self bulidLayout];
}
return self;
}
- (void)bulidLayout
{
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (3 -1))/3;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"arrowright"];
self.smallImageView.contentMode = UIViewContentModeScaleAspectFit;
self.seqLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.smallImageView.frame), 0, SmallWidth, TableHeight))];
self.seqLabel.textColor = GXF_CONTENT_COLOR;
self.seqLabel.text = @"13";
self.seqLabel.font = GXF_SIXTEENTEH_SIZE;
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftWidth, 0, headWidth, TableHeight))];
self.titleLabel.textAlignment = NSTextAlignmentLeft;
self.titleLabel.textColor = GXF_CONTENT_COLOR;
self.titleLabel.text = @"苹果桃子";
self.titleLabel.font = GXF_SIXTEENTEH_SIZE;
self.priceLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.priceLabel.textAlignment = NSTextAlignmentLeft;
self.priceLabel.textColor = GXF_CONTENT_COLOR;
self.priceLabel.text = @"80";
self.priceLabel.font = GXF_SIXTEENTEH_SIZE;
self.countLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.priceLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.countLabel.textAlignment = NSTextAlignmentLeft;
self.countLabel.text = @"200";
self.countLabel.textColor = GXF_CONTENT_COLOR;
self.countLabel.font = GXF_SIXTEENTEH_SIZE;
self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)];
self.showView.clipsToBounds = YES;
self.showStandLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.seqLabel.frame), 0, ShowWidth, ShowHeight))];
self.showStandLabel.textAlignment = NSTextAlignmentLeft;
self.showStandLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showStandLabel.text = @"包装规格:1*12斤";
self.showStandLabel.font = GXF_THREETEENTH_SIZE;
self.showCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showStandLabel.frame), 0, ShowWidth, ShowHeight))];
self.showCountLabel.textAlignment = NSTextAlignmentLeft;
self.showCountLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showCountLabel.text = @"包装数量:10000";
self.showCountLabel.font = GXF_THREETEENTH_SIZE;
self.showBaseCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showStandLabel.frame), CGRectGetMaxY(self.showStandLabel.frame), ShowWidth, ShowHeight))];
self.showBaseCountLabel.textAlignment = NSTextAlignmentLeft;
self.showBaseCountLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showBaseCountLabel.text = @"基础数量:300";
self.showBaseCountLabel.font = GXF_THREETEENTH_SIZE;
self.showPriceLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showCountLabel.frame), CGRectGetMaxY(self.showStandLabel.frame), ShowWidth, ShowHeight))];
self.showPriceLabel.textAlignment = NSTextAlignmentLeft;
self.showPriceLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showPriceLabel.text = @"包装单价:11元";
self.showPriceLabel.font = GXF_THREETEENTH_SIZE;
self.showTotalLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showStandLabel.frame), CGRectGetMaxY(self.showBaseCountLabel.frame), ShowWidth, ShowHeight))];
self.showTotalLabel.textAlignment = NSTextAlignmentLeft;
self.showTotalLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showTotalLabel.text = @"总金额:100";
self.showTotalLabel.font = GXF_THREETEENTH_SIZE;
self.showNoteLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showCountLabel.frame), CGRectGetMaxY(self.showBaseCountLabel.frame), ShowWidth, ShowHeight))];
self.showNoteLabel.textAlignment = NSTextAlignmentLeft;
self.showNoteLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showNoteLabel.text = @"备注:1000";
self.showNoteLabel.font = GXF_THREETEENTH_SIZE;
self.showPurchaseLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showStandLabel.frame), CGRectGetMaxY(self.showTotalLabel.frame), ShowWidth+ 100, ShowHeight))];
self.showPurchaseLabel.textAlignment = NSTextAlignmentLeft;
self.showPurchaseLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.showPurchaseLabel.text = @"采购单号:1000";
self.showPurchaseLabel.font = GXF_THREETEENTH_SIZE;
self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.editBtn setImage:[UIImage imageNamed:self.rightImageName] forState:UIControlStateNormal];
self.editBtn.frame = CGRectMake(ScreenSize.width - LeftWidth, 0, LeftWidth , TableHeight);
self.editBtn.contentMode = UIViewContentModeScaleAspectFit;
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin,TableHeight-1, ScreenSize.width - LeftMargin * 2, 1))];;
self.lineLabel.backgroundColor = GXF_LINE_COLOR;
[self.contentView addSubview:self.smallImageView];
[self.contentView addSubview:self.seqLabel];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.priceLabel];
[self.contentView addSubview:self.countLabel];
[self.contentView addSubview:self.editBtn];
[self.contentView addSubview:self.showView];
[self.showView addSubview:self.showStandLabel];
[self.showView addSubview:self.showCountLabel];
[self.showView addSubview:self.showBaseCountLabel];
[self.showView addSubview:self.showPriceLabel];
[self.showView addSubview:self.showPurchaseLabel];
[self.showView addSubview:self.showTotalLabel];
[self.showView addSubview:self.showNoteLabel];
[self.contentView addSubview:self.lineLabel];
}
- (void)setPdtDetail:(TransportPdtDetail *)pdtDetail row:(NSInteger)row{
self.seqLabel.text = [NSString stringWithFormat:@"%@",@(row+1)];
self.titleLabel.text = pdtDetail.productName;
self.priceLabel.text = [pdtDetail.price stringValue];
self.countLabel.text = [pdtDetail.qty stringValue];
self.showStandLabel.text = [NSString stringWithFormat:@"包装规格:%@",pdtDetail.qpc];
self.showCountLabel.text = [NSString stringWithFormat:@"包装数量:%@",pdtDetail.baseQty];
self.showBaseCountLabel.text =[NSString stringWithFormat:@"基础数量:%@",pdtDetail.qty];
self.showPriceLabel.text = [NSString stringWithFormat:@"包装单价:%@",pdtDetail.price];
self.showPurchaseLabel.text = [NSString stringWithFormat:@"采购单号:%@",pdtDetail.purchasebillnumber.length > 0 ? pdtDetail.purchasebillnumber: @"无"];
self.showTotalLabel.text = [NSString stringWithFormat:@"总金额:%@",pdtDetail.total];
self.showNoteLabel.text =[NSString stringWithFormat:@"备注:%@",pdtDetail.note];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -15,5 +15,5 @@
#import "IBTConstants.h"
#import "ICRAppMacro.h"
#import "ICRNotificationMacro.h"
#import "RegexUtil.h"
#endif
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