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

发运单

parent f7abd79d
...@@ -6,6 +6,6 @@ pod 'SSKeychain', '~> 1.2.3' ...@@ -6,6 +6,6 @@ pod 'SSKeychain', '~> 1.2.3'
pod 'FMDB', '~> 2.5' pod 'FMDB', '~> 2.5'
pod 'Base64nl', '~> 1.2' pod 'Base64nl', '~> 1.2'
pod 'Reveal-iOS-SDK', '~> 1.5.1' pod 'Reveal-iOS-SDK', '~> 1.5.1'
pod 'BaiduMapAPI', '~> 2.7.0' pod 'BaiduMapAPI', '~> 2.7.0
pod 'MJRefresh', '~> 2.2.0' pod 'MJRefresh', '~> 2.2.0'
pod 'IQKeyboardManager', '~> 3.2.3' pod 'IQKeyboardManager', '~> 3.2.3'
\ No newline at end of file
This diff is collapsed.
...@@ -178,54 +178,56 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) { ...@@ -178,54 +178,56 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//添加行情调研单 //1.添加行情调研单
- (void)saveSurveyWithAuthenticode:(id)data - (void)saveSurveyWithAuthenticode:(id)data
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//获取行情调研单列表 //2.获取行情调研单列表
- (void)querySurveyWithBillData:(id)data - (void)querySurveyWithBillData:(id)data
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//获取行情调研单详情 //3.获取行情调研单详情
- (void)getResultWithSurveyUuid:(NSString *)surveyUuid - (void)getResultWithSurveyUuid:(NSString *)surveyUuid
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//下载商品信息 //4.生成行情反馈图片
- (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;
//生成行情反馈图片
- (void)resultChartWithResultUuid:(NSString *)uuid - (void)resultChartWithResultUuid:(NSString *)uuid
width:(NSNumber *)width width:(NSNumber *)width
height:(NSNumber *)height height:(NSNumber *)height
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//结束行情反馈(写) //5.结束行情反馈(写)
- (void)surveyFinishWithUuid:(NSString *)uuid - (void)surveyFinishWithUuid:(NSString *)uuid
version:(NSNumber *)version version:(NSNumber *)version
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//获取行情调研单反馈列表 //6.获取行情调研单反馈列表
- (void)getResultsWithUuid:(NSString *)uuid - (void)getResultsWithUuid:(NSString *)uuid
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; 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 - (void)getVendorWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size page_size:(NSUInteger)page_size
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//仓库 //4.仓库
- (void)getWarehouseWithPage_number:(NSUInteger)page_number - (void)getWarehouseWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size page_size:(NSUInteger)page_size
success:(void (^)(id))succ success:(void (^)(id))succ
...@@ -288,19 +290,19 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) { ...@@ -288,19 +290,19 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//添加采购单 //1.添加采购单
- (void)savePurchaseWithData:(id)data - (void)savePurchaseWithData:(id)data
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//获取采购单列表 //2.获取采购单列表
- (void)queryPurchaseWithData:(id)data - (void)queryPurchaseWithData:(id)data
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//获取采购单详情 //3.获取采购单详情
- (void)getPurchaseResultWithPurchaseUuid:(NSString *)purchaseUuid - (void)getPurchaseResultWithPurchaseUuid:(NSString *)purchaseUuid
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//审核/拒绝/供应商确认/结束/作废采购单 //4.审核/拒绝/供应商确认/结束/作废采购单
- (void)dealByActionWithPurchaseUuid:(NSString *)purchaseUuid - (void)dealByActionWithPurchaseUuid:(NSString *)purchaseUuid
action:(NSString *)action action:(NSString *)action
remark:(NSString *)remark remark:(NSString *)remark
...@@ -308,6 +310,30 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) { ...@@ -308,6 +310,30 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; 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 @end
...@@ -101,8 +101,14 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) { ...@@ -101,8 +101,14 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
XFFHttp_PurchaseSave, XFFHttp_PurchaseSave,
XFFHttp_QueryPurchase, XFFHttp_QueryPurchase,
XFFHttp_GetPurchaseDetail, XFFHttp_GetPurchaseDetail,
XFFHttp_DealByActionPurchase XFFHttp_DealByActionPurchase,
//发运单
XFFHttp_TransportSave,
XFFHttp_QueryTransport,
XFFHttp_GetTransportDetail,
XFFHttp_EndTransport,
XFFHttp_AbortTransport
}; };
static NSString * const ICRHTTPInterface[] = { static NSString * const ICRHTTPInterface[] = {
...@@ -185,8 +191,15 @@ static NSString * const ICRHTTPInterface[] = { ...@@ -185,8 +191,15 @@ static NSString * const ICRHTTPInterface[] = {
[XFFHttp_PurchaseSave] = @"purchase/bill/save", [XFFHttp_PurchaseSave] = @"purchase/bill/save",
[XFFHttp_QueryPurchase] = @"purchase/bill/query", [XFFHttp_QueryPurchase] = @"purchase/bill/query",
[XFFHttp_GetPurchaseDetail] = @"purchase/bill/get", [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[] = { static NSString * const ICRAttachmentTypeValue[] = {
...@@ -1497,7 +1510,7 @@ acceptTypeJson:YES ...@@ -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]; NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr [self POST:encodeUrlStr
parameters:NULL parameters:NULL
...@@ -1903,7 +1916,7 @@ acceptTypeJson:YES ...@@ -1903,7 +1916,7 @@ acceptTypeJson:YES
success:success success:success
failure:failure]; failure:failure];
} }
//获取行情调研单列表 //获取采购单列表
- (void)queryPurchaseWithData:(id)data - (void)queryPurchaseWithData:(id)data
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail{ failure:(void (^)(id))fail{
...@@ -1963,6 +1976,7 @@ acceptTypeJson:YES ...@@ -1963,6 +1976,7 @@ acceptTypeJson:YES
success:success success:success
failure:failure]; failure:failure];
} }
//采购单处理
- (void)dealByActionWithPurchaseUuid:(NSString *)purchaseUuid - (void)dealByActionWithPurchaseUuid:(NSString *)purchaseUuid
action:(NSString *)action action:(NSString *)action
remark:(NSString *)remark remark:(NSString *)remark
...@@ -1989,17 +2003,190 @@ acceptTypeJson:YES ...@@ -1989,17 +2003,190 @@ acceptTypeJson:YES
} }
}; };
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance]; 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]; 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 [self GET:encodeUrlStr
parameters:nil parameters:nil
needToken:NO needToken:NO
acceptTypeJson:YES acceptTypeJson:YES
success:success success:success
failure:failure]; 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·保存采购通知单 //1·保存采购通知单
- (void)savePurchaseNoticeWithData:(id)data - (void)savePurchaseNoticeWithData:(id)data
success:(void (^)(id))succ success:(void (^)(id))succ
......
...@@ -14,12 +14,9 @@ ...@@ -14,12 +14,9 @@
@end @end
@implementation ChooseParentViewController @implementation ChooseParentViewController
- (void)dealloc{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(boxValueChanged:) name:UITextFieldTextDidChangeNotification object:nil];
[self initData]; [self initData];
[self bulidLayout]; [self bulidLayout];
[self createRefresh]; [self createRefresh];
...@@ -37,6 +34,7 @@ ...@@ -37,6 +34,7 @@
self.selectTextFiled.textAlignment = NSTextAlignmentLeft; self.selectTextFiled.textAlignment = NSTextAlignmentLeft;
self.selectTextFiled.background = [UIImage imageNamed:@"textFiled"]; self.selectTextFiled.background = [UIImage imageNamed:@"textFiled"];
self.selectTextFiled.delegate = self; self.selectTextFiled.delegate = self;
[self.selectTextFiled addTarget:self action:@selector(boxValueChanged:) forControlEvents:UIControlEventEditingChanged];
self.selectTextFiled.font = GXF_FIFTEENTEN_SIZE; self.selectTextFiled.font = GXF_FIFTEENTEN_SIZE;
[self.view addSubview:self.selectTextFiled]; [self.view addSubview:self.selectTextFiled];
...@@ -159,7 +157,7 @@ ...@@ -159,7 +157,7 @@
__weak typeof(self)weakSelf = self; __weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) { ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf; __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 setObject:[NSDate date] forKey:self.tableView.header.lastUpdatedTimeKey];
[GXF_NSUSERFEFTAULTS synchronize]; [GXF_NSUSERFEFTAULTS synchronize];
[self getBaseDataFromServer]; [self getBaseDataFromServer];
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
self.view.backgroundColor = ICR_VIEW_BG_COLOR; // self.view.backgroundColor = ICR_VIEW_BG_COLOR;
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
......
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
#define SetProductTotalPrice @"setProductTotalPrice" #define SetProductTotalPrice @"setProductTotalPrice"
#define KNOTIFICATION_getSelectPurchaseProduct @"KNOTIFICATION_getSelectPurchaseProduct" #define KNOTIFICATION_getSelectPurchaseProduct @"KNOTIFICATION_getSelectPurchaseProduct"
#define KNOTIFICATION_ChoseTransportPurchase @"KNOTIFICATION_ChoseTransportPurchase"
#define KNOTIFICATION_AddPurchaseProduct @"KNOTIFICATION_AddPurchaseProduct"
#define KNOTIFICATION_AddTransportCost @"KNOTIFICATION_AddTransportCost"
......
...@@ -118,6 +118,8 @@ ...@@ -118,6 +118,8 @@
#define ChooseVendorUpdateDate @"chooseVendorUpdateDate" #define ChooseVendorUpdateDate @"chooseVendorUpdateDate"
#define ChooseWarehouseUpdateDate @"chooseWarehouseUpdateDate" #define ChooseWarehouseUpdateDate @"chooseWarehouseUpdateDate"
#define PurchaseUpdateDate @"purchaseUpdateDate" #define PurchaseUpdateDate @"purchaseUpdateDate"
#define TransportUpdateDate @"TransportUpdateDate"
//行情调研状态 //行情调研状态
//initial(未提交),submitted(已提交),insurvey(调研中),finished(已完成) //initial(未提交),submitted(已提交),insurvey(调研中),finished(已完成)
...@@ -129,9 +131,9 @@ ...@@ -129,9 +131,9 @@
//采购单状态 //采购单状态
#define PURCHASE_STATE_INITIAL @"initial" //未提交 #define PURCHASE_STATE_INITIAL @"initial" //未提交
#define PURCHASE_STATE_SUBMITTED @"submitted"//已提交 #define PURCHASE_STATE_SUBMITTED @"submitted"//已提交 未审批
#define PURCHASE_STATE_REJECTED @"rejected" //已拒绝 #define PURCHASE_STATE_REJECTED @"rejected" //已拒绝
#define PURCHASE_STATE_APPROVED @"approved" //已审批 #define PURCHASE_STATE_APPROVED @"approved" //已审批 发运中
#define PURCHASE_STATE_SHIPPING @"shipping" //发运中 #define PURCHASE_STATE_SHIPPING @"shipping" //发运中
#define PURCHASE_STATE_FINISHED @"finished" //已完成 #define PURCHASE_STATE_FINISHED @"finished" //已完成
#define PURCHASE_STATE_ABORTED @"aborted" //已作废 #define PURCHASE_STATE_ABORTED @"aborted" //已作废
...@@ -163,5 +165,12 @@ ...@@ -163,5 +165,12 @@
#define GXF_BASECLASS_USER @"User" #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 #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 @@ ...@@ -24,7 +24,7 @@
#import "NewPurchaseViewController.h" #import "NewPurchaseViewController.h"
#import "PurchaseViewController.h" #import "PurchaseViewController.h"
#import "NewTransportViewController.h" #import "NewTransportViewController.h"
#import "TransportViewController.h"
#import"PurchaseNoticeViewController.h" #import"PurchaseNoticeViewController.h"
...@@ -173,9 +173,18 @@ ...@@ -173,9 +173,18 @@
case kFunctionNewShipment://任务管理 case kFunctionNewShipment://任务管理
{ {
NewTransportViewController *tVC = [[NewTransportViewController alloc] init]; 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]; [self PushViewController:tVC animated:YES];
} }
break; break;
// case kFunctionPatrolPlan://巡店计划 // case kFunctionPatrolPlan://巡店计划
// { // {
// ICRPatrolPlanViewController *pVC = [[ICRPatrolPlanViewController alloc] initWithStore:nil isHomeShow:YES]; // 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 @@ ...@@ -11,6 +11,8 @@
#import "ProductBillViewController.h" #import "ProductBillViewController.h"
#import "PurchaseBillProduct.h" #import "PurchaseBillProduct.h"
#import "PurchaseViewController.h" #import "PurchaseViewController.h"
#import "ShopDetaileViewController.h"
#import "PurchaseBillProduct.h"
#define TopHeight 328 #define TopHeight 328
#define BottomHeight 300 #define BottomHeight 300
#define SpaceHeight 20 #define SpaceHeight 20
...@@ -41,6 +43,7 @@ typedef enum : NSUInteger { ...@@ -41,6 +43,7 @@ typedef enum : NSUInteger {
if (self) { if (self) {
//监听值的改变 //监听值的改变
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setProductTotalPrice:) name:SetProductTotalPrice object:nil]; [[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; return self;
} }
...@@ -145,7 +148,29 @@ typedef enum : NSUInteger { ...@@ -145,7 +148,29 @@ typedef enum : NSUInteger {
_purchaseView.chargePurchase = [NSNumber numberWithFloat:otherPrice]; _purchaseView.chargePurchase = [NSNumber numberWithFloat:otherPrice];
_purchaseView.total = [NSNumber numberWithFloat:totalPrice+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{ - (void)btnClick:(UIButton *)btn{
switch (btn.tag) { switch (btn.tag) {
case SaveTag: case SaveTag:
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
billProduct.remark = @"hshshshsh"; billProduct.remark = @"hshshshsh";
billProduct.qpcStr = @"fdsfdsfdsa"; billProduct.qpcStr = @"fdsfdsfdsa";
[self.productArr addObject:billProduct]; [self.productArr addObject:billProduct];
[self.productArr addObject:billProduct];
if (self.productArr.count > 0) { if (self.productArr.count > 0) {
[[NSNotificationCenter defaultCenter] postNotificationName:SetProductTotalPrice object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:SetProductTotalPrice object:nil];
} }
...@@ -81,10 +80,10 @@ ...@@ -81,10 +80,10 @@
} }
#pragma mark - footerDelegate #pragma mark - footerDelegate
- (void)addClick{ - (void)addClick{
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_AddPurchaseProduct object:nil];
} }
- (void)choosePurchase{ - (void)choosePurchase{
[[NSNotificationCenter defaultCenter] postNotificationName:@"ChoseTransportPurchase" object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_ChoseTransportPurchase object:nil];
} }
#pragma mark - 协议方法 #pragma mark - 协议方法
......
...@@ -108,7 +108,7 @@ typedef enum : NSUInteger { ...@@ -108,7 +108,7 @@ typedef enum : NSUInteger {
} }
- (void)createBtn{ - (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]; [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]; _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 { ...@@ -118,22 +118,18 @@ typedef enum : NSUInteger {
//根据权限判断按钮显示 //根据权限判断按钮显示
- (void)showBtnByPermissions{ - (void)showBtnByPermissions{
//逻辑判断按钮显示不显示 //逻辑判断按钮显示不显示
if ([self.bill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {//状态已提交 if ([self.bill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {//状态已提交 未审批
if ([self checkIsPermission:PURCHASE_PERMISSIONS_VENDORAPPROVE]) {//供应商审批权 if([self checkIsPermission:PURCHASE_PERMISSIONS_MANAGEAPPROVE]){
//显示确认按钮
_firstBtn.hidden = YES;
[self changeBtnFrame:_secondBtn title:@"确认" originX:LeftMargin width:OneWidth];
_secondBtn.tag = SureTag;
self.indexStyle = 2;
}else if([self checkIsPermission:PURCHASE_PERMISSIONS_MANAGEAPPROVE]){
//显示拒绝和审批 //显示拒绝和审批
[self changeBtnFrame:_firstBtn title:@"拒绝" originX:LeftMargin width:TwoWidth]; [self changeBtnFrame:_firstBtn title:@"拒绝" originX:LeftMargin width:TwoWidth];
[self changeBtnFrame:_secondBtn title:@"审核通过" originX:CGRectGetMaxX(_firstBtn.frame) + LeftMargin width:TwoWidth]; [self changeBtnFrame:_secondBtn title:@"审核通过" originX:CGRectGetMaxX(_firstBtn.frame) + LeftMargin width:TwoWidth];
_firstBtn.tag = RejectTag; _firstBtn.tag = RejectTag;
_secondBtn.tag = PassTag; _secondBtn.tag = PassTag;
self.indexStyle = 1; 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]){//供应商审批权 if([self checkIsPermission:PURCHASE_PERMISSIONS_VENDORAPPROVE]){//供应商审批权
//显示确认按钮 //显示确认按钮
_firstBtn.hidden = YES; _firstBtn.hidden = YES;
...@@ -159,6 +155,8 @@ typedef enum : NSUInteger { ...@@ -159,6 +155,8 @@ typedef enum : NSUInteger {
_firstBtn.hidden = YES; _firstBtn.hidden = YES;
[self changeBtnFrame:_secondBtn title:@"作废" originX:LeftMargin width:OneWidth]; [self changeBtnFrame:_secondBtn title:@"作废" originX:LeftMargin width:OneWidth];
_secondBtn.tag = CancleTag; _secondBtn.tag = CancleTag;
}else{
[self hiddenTwoBtn];
} }
} }
} }
...@@ -170,16 +168,21 @@ typedef enum : NSUInteger { ...@@ -170,16 +168,21 @@ typedef enum : NSUInteger {
_secondBtn.tag = CancleTag; _secondBtn.tag = CancleTag;
self.indexStyle = 0; self.indexStyle = 0;
}else{
[self hiddenTwoBtn];
} }
}else if([self.bill.state isEqualToString:PURCHASE_STATE_ABORTED]){//已作废 }else if([self.bill.state isEqualToString:PURCHASE_STATE_ABORTED]){//已作废
[self hiddenTwoBtn];
}
}
- (void)hiddenTwoBtn{
_firstBtn.hidden = YES; _firstBtn.hidden = YES;
_secondBtn.hidden = YES; _secondBtn.hidden = YES;
self.indexStyle = 1; self.indexStyle = 1;
CGRect scrollViewFrame = _scrollView.frame; CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64; scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame; _scrollView.frame = scrollViewFrame;
}
} }
//改变按钮的位置 //改变按钮的位置
- (void)changeBtnFrame:(UIButton *)btn title:(NSString *)title originX:(CGFloat)originX width:(CGFloat)width{ - (void)changeBtnFrame:(UIButton *)btn title:(NSString *)title originX:(CGFloat)originX width:(CGFloat)width{
......
...@@ -78,21 +78,23 @@ ...@@ -78,21 +78,23 @@
stateStr = @"未提交"; stateStr = @"未提交";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) { }else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {
stateStr = @"已提交"; stateStr = @"未审批";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_REJECTED]) { }else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_REJECTED]) {
stateStr = @"已拒绝"; 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]) { }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 = @"发运中"; stateStr = @"发运中";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled]; [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 = @"已完成"; stateStr = @"已完成";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_ABORTED]) { }else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_ABORTED]) {
...@@ -103,11 +105,6 @@ ...@@ -103,11 +105,6 @@
} }
- (void)awakeFromNib { - (void)awakeFromNib {
// Initialization code // Initialization code
} }
......
...@@ -309,7 +309,7 @@ typedef enum : NSUInteger { ...@@ -309,7 +309,7 @@ typedef enum : NSUInteger {
- (void)createViewInCell:(SurveyCell *)cell indexPath:(NSIndexPath *)indexPath{ - (void)createViewInCell:(SurveyCell *)cell indexPath:(NSIndexPath *)indexPath{
if (indexPath.row == 0) { 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.textAlignment = NSTextAlignmentRight;
_titleField.textColor = HexColor(@"444444"); _titleField.textColor = HexColor(@"444444");
_titleField.placeholder = @"输入采购通知标题"; _titleField.placeholder = @"输入采购通知标题";
...@@ -319,7 +319,7 @@ typedef enum : NSUInteger { ...@@ -319,7 +319,7 @@ typedef enum : NSUInteger {
[cell.contentView addSubview:_titleField]; [cell.contentView addSubview:_titleField];
}else if (indexPath.row == _dataArr.count -1){ }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.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
_noteTextView.minNumberOfLines = 1; _noteTextView.minNumberOfLines = 1;
_noteTextView.maxNumberOfLines = 4; _noteTextView.maxNumberOfLines = 4;
...@@ -333,7 +333,7 @@ typedef enum : NSUInteger { ...@@ -333,7 +333,7 @@ typedef enum : NSUInteger {
lineFrame.origin.y = TableHeight*2-1; lineFrame.origin.y = TableHeight*2-1;
cell.lineLabel.frame = lineFrame; cell.lineLabel.frame = lineFrame;
}else{ }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.textAlignment= NSTextAlignmentRight;
contentLabel.textColor = HexColor(@"bbbbbb"); contentLabel.textColor = HexColor(@"bbbbbb");
contentLabel.font = FontSize(TitleSize); contentLabel.font = FontSize(TitleSize);
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
@interface ShopDetail : IBTModel @interface ShopDetail : IBTModel
@property (nonatomic,strong)NSString *merchandise;//商品 @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 *packageSpecification;//包装规格
@property (nonatomic,strong)NSString *packageQuantity;//包装数量 @property (nonatomic,strong)NSString *packageQuantity;//包装数量
@property (nonatomic,strong)NSString *packageUnit;//包装单位 @property (nonatomic,strong)NSString *packageUnit;//包装单位
......
...@@ -152,7 +152,8 @@ typedef enum : NSUInteger { ...@@ -152,7 +152,8 @@ typedef enum : NSUInteger {
self.shopDetail.packageUnitPrice=packageUnitPrice.text; self.shopDetail.packageUnitPrice=packageUnitPrice.text;
self.shopDetail.totalMoney=totalMoney.text; self.shopDetail.totalMoney=totalMoney.text;
self.shopDetail.remark=remark.text; self.shopDetail.remark=remark.text;
self.shopDetail.product_code = self.productCodeStr;
self.shopDetail.product_uuid = self.productUuidStr;
if (merchandise.text.length == 0 ) { if (merchandise.text.length == 0 ) {
ShowMessage(@"商品不能为空"); ShowMessage(@"商品不能为空");
return NO; return NO;
......
...@@ -12,4 +12,6 @@ ...@@ -12,4 +12,6 @@
@property (nonatomic,strong)NSMutableArray *costArr; @property (nonatomic,strong)NSMutableArray *costArr;
@property (nonatomic,strong)UITableView *tableView; @property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,assign)CGRect viewFrame; @property (nonatomic,assign)CGRect viewFrame;
@property (nonatomic,assign)BOOL isHiddenEdit;
@end @end
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "CostViewController.h" #import "CostViewController.h"
#import "HeaderCell.h" #import "HeaderCell.h"
#import "FooterCell.h" #import "FooterCell.h"
#import "CostCell.h"
@interface CostViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate> @interface CostViewController ()<UITableViewDataSource,UITableViewDelegate,FooterCellDelegate>
{ {
CGRect _tableFrame; CGRect _tableFrame;
...@@ -32,24 +33,32 @@ ...@@ -32,24 +33,32 @@
self.tableView.backgroundColor = [UIColor whiteColor]; self.tableView.backgroundColor = [UIColor whiteColor];
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.view addSubview:self.tableView]; [self.view addSubview:self.tableView];
NSArray *arr = @[@"费用",@"应付金额",@"已付金额"]; NSArray *arr = @[@"费用",@"应付金额",@"已付金额",@"尾款"];
HeaderCell *headCell = [[HeaderCell alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 38) withArr:arr]; HeaderCell *headCell = [[HeaderCell alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, 38) withArr:arr];
[self.view addSubview:headCell]; [self.view addSubview:headCell];
self.tableView.tableHeaderView = headCell; self.tableView.tableHeaderView = headCell;
if (!self.isHiddenEdit) {
FooterCell *footCell = [[FooterCell alloc]initWithFrame:CGRectMake(0, 0, _tableFrame.size.width, 50) withTitle:@"+点击添加原料明细" isTwo:@""]; FooterCell *footCell = [[FooterCell alloc]initWithFrame:CGRectMake(0, 0, _tableFrame.size.width, 50) withTitle:@"+点击添加费用明细" isTwo:@""];
[self.view addSubview:footCell]; [self.view addSubview:footCell];
footCell.delegate = self; footCell.delegate = self;
self.tableView.tableFooterView = footCell; self.tableView.tableFooterView = footCell;
}
} }
- (void)addClick{ - (void)addClick{
[self.costArr addObject:@"dddd"]; [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_AddTransportCost object:nil];
[self.tableView reloadData]; }
- (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 - 协议方法 #pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1; return 1;
...@@ -58,12 +67,21 @@ ...@@ -58,12 +67,21 @@
return self.costArr.count; return self.costArr.count;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"cellID"; static NSString *cellID = @"CostCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; CostCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) { 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; 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 @@ ...@@ -10,8 +10,11 @@
#import "TopTransportView.h" #import "TopTransportView.h"
#import "BottomTransportView.h" #import "BottomTransportView.h"
#import "TransportPurchaseViewController.h" #import "TransportPurchaseViewController.h"
#import "PurchaseBillProduct.h" #import "NewCostViewController.h"
#import "TransportPdtDetail.h"
#import "FeeAcountDetail.h" #import "FeeAcountDetail.h"
#import "TransportViewController.h"
#import "ShopDetaileViewController.h"
typedef enum : NSUInteger { typedef enum : NSUInteger {
SaveTag = 7000, SaveTag = 7000,
CommitTag, CommitTag,
...@@ -34,27 +37,67 @@ typedef enum : NSUInteger { ...@@ -34,27 +37,67 @@ typedef enum : NSUInteger {
@end @end
@implementation NewTransportViewController @implementation NewTransportViewController
- (void)dealloc{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (instancetype)init{ - (instancetype)init{
self = [super init]; self = [super init];
if (self) { 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; return self;
} }
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.title = @"新建发运单";
//布局 //布局
[self bulidLayout]; [self bulidLayout];
uuidObject = [NSNull null]; uuidObject = [NSNull null];
billNumberObject = [NSNull null]; billNumberObject = [NSNull null];
versionObject = [NSNumber numberWithInteger:0]; versionObject = [NSNumber numberWithInteger:0];
// if (self.purchaseBill) { if (self.transport) {
// [self getDataFromServer]; [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{ - (void)bulidLayout{
self.view.backgroundColor = XXFBgColor; self.view.backgroundColor = XXFBgColor;
_scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0,0, ScreenSize.width, ScreenSize.height- 64 - BottomViewHeight )]; _scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0,0, ScreenSize.width, ScreenSize.height- 64 - BottomViewHeight )];
...@@ -77,7 +120,7 @@ typedef enum : NSUInteger { ...@@ -77,7 +120,7 @@ typedef enum : NSUInteger {
_sheetView.delegate = self; _sheetView.delegate = self;
[_scrollView addSubview:_sheetView]; [_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]; _bottomView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_bottomView]; [_scrollView addSubview:_bottomView];
} }
...@@ -86,13 +129,13 @@ typedef enum : NSUInteger { ...@@ -86,13 +129,13 @@ typedef enum : NSUInteger {
case SaveTag: case SaveTag:
{ {
if ([self checkTransport]) { if ([self checkTransport]) {
[self getDataFromServer:PURCHASE_STATE_INITIAL msg:@"正在保存..."]; [self getDataFromServer:TRANSPORT_STATE_INITIAL msg:@"正在保存..."];
} }
} }
break; break;
case CommitTag:{ case CommitTag:{
if ([self checkTransport]) { if ([self checkTransport]) {
[self getDataFromServer:PURCHASE_STATE_SUBMITTED msg:@"正在提交..."]; [self getDataFromServer:TRANSPORT_STATE_UNRECEIVED msg:@"正在提交..."];
} }
} }
...@@ -119,8 +162,8 @@ typedef enum : NSUInteger { ...@@ -119,8 +162,8 @@ typedef enum : NSUInteger {
versionObject = versionN; versionObject = versionN;
[IBTLoadingView showTips:[NSString stringWithFormat:@"当前单据%@已保存成功",billNumberS]]; [IBTLoadingView showTips:[NSString stringWithFormat:@"当前单据%@已保存成功",billNumberS]];
}else{//提交成功 }else{//提交成功
// PurchaseViewController *svc = [PurchaseViewController new]; TransportViewController *svc = [TransportViewController new];
// [self PushViewController:svc animated:YES]; [self PushViewController:svc animated:YES];
} }
}else{ }else{
[IBTLoadingView showTips:message]; [IBTLoadingView showTips:message];
...@@ -138,21 +181,23 @@ typedef enum : NSUInteger { ...@@ -138,21 +181,23 @@ typedef enum : NSUInteger {
if (self.transport.billnumber > 0 && billNumberObject == [NSNull null]) { if (self.transport.billnumber > 0 && billNumberObject == [NSNull null]) {
billNumberObject = self.transport.billnumber; billNumberObject = self.transport.billnumber;
} }
// if (self.purchaseBill && [versionObject integerValue] == 0) { if (self.transport && [versionObject integerValue] == 0) {
// versionObject = self.transport.version; versionObject = self.transport.version;
// } }
NSMutableArray *billProducts = [NSMutableArray array]; NSMutableArray *billProducts = [NSMutableArray array];
for (PurchaseBillProduct *billProduct in _bottomView.productVC.productArr) { for (TransportPdtDetail *pdtDetail in _bottomView.productVC.transportProductArr) {
[billProducts addObject:[billProduct dictForCommit]]; [billProducts addObject:[pdtDetail dictForCommit]];
} }
NSMutableArray *costs = [NSMutableArray array]; NSMutableArray *costs = [NSMutableArray array];
for (FeeAcountDetail *fee in _bottomView.costVC.costArr) { for (FeeAcountDetail *fee in _bottomView.costVC.costArr) {
[costs addObject:[fee dictForCommit]]; [costs addObject:[fee dictForCommit]];
} }
// self.state = state; // self.state = state;
NSDictionary *dict = @{@"uuid":uuidObject, NSDictionary *dict = @{@"uuid":uuidObject,
// @"version":versionObject, @"version":versionObject,
@"billnumber":billNumberObject, @"billnumber":billNumberObject,
@"enterprise":[ICRUserUtil sharedInstance].orgId,
@"state":state, @"state":state,
@"warehouseUuid":[IBTCommon checkString:_sheetView.warehouseUuid], @"warehouseUuid":[IBTCommon checkString:_sheetView.warehouseUuid],
@"warehouseCode":[IBTCommon checkString:_sheetView.warehouseCode], @"warehouseCode":[IBTCommon checkString:_sheetView.warehouseCode],
...@@ -167,7 +212,7 @@ typedef enum : NSUInteger { ...@@ -167,7 +212,7 @@ typedef enum : NSUInteger {
@"pdtDetails":billProducts, @"pdtDetails":billProducts,
@"accountDetails":costs}; @"accountDetails":costs};
[IBTLoadingView showProgressLabel:msg]; [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 { ...@@ -198,7 +243,7 @@ typedef enum : NSUInteger {
ShowMessage(@"司机电话不能为空"); ShowMessage(@"司机电话不能为空");
return NO; return NO;
} }
if (_bottomView.productVC.productArr.count == 0) { if (_bottomView.productVC.transportProductArr.count == 0) {
ShowMessage(@"商品不能为空"); ShowMessage(@"商品不能为空");
return NO; return NO;
} }
...@@ -214,10 +259,59 @@ typedef enum : NSUInteger { ...@@ -214,10 +259,59 @@ typedef enum : NSUInteger {
- (void)choseTransportPurchase{ - (void)choseTransportPurchase{
TransportPurchaseViewController *tpv = [TransportPurchaseViewController new]; TransportPurchaseViewController *tpv = [TransportPurchaseViewController new];
tpv.getProchaseProduct = ^(NSArray *products){ tpv.getProchaseProduct = ^(NSArray *products){
[_bottomView refreshProduct:products]; if (products.count > 0) {
[_bottomView reProduct:products];
}
}; };
[self PushViewController:tpv animated:YES]; [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 #pragma mark - TopPurchaseViewDelegate
...@@ -237,6 +331,7 @@ typedef enum : NSUInteger { ...@@ -237,6 +331,7 @@ typedef enum : NSUInteger {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
} }
/* /*
#pragma mark - Navigation #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 @@ ...@@ -9,6 +9,7 @@
#import "TransportPurchaseViewController.h" #import "TransportPurchaseViewController.h"
#import "TransportPurchaseCell.h" #import "TransportPurchaseCell.h"
#import "QueryOrder.h" #import "QueryOrder.h"
#import "TransportPdtDetail.h"
#define TopMargin 50 #define TopMargin 50
#define TableHeight 50 #define TableHeight 50
@interface TransportPurchaseViewController ()<UITextFieldDelegate,UITableViewDataSource,UITableViewDelegate> @interface TransportPurchaseViewController ()<UITextFieldDelegate,UITableViewDataSource,UITableViewDelegate>
...@@ -149,20 +150,20 @@ ...@@ -149,20 +150,20 @@
if(self.dataArr.count > 0){ if(self.dataArr.count > 0){
PurchaseBill *bill = _dataArr[indexPath.row]; PurchaseBill *bill = _dataArr[indexPath.row];
NSMutableArray *arr = [NSMutableArray array]; NSMutableArray *arr = [NSMutableArray array];
PurchaseBillProduct *billProduct = [PurchaseBillProduct new]; TransportPdtDetail *billProduct = [TransportPdtDetail new];
billProduct.product_name = @"dd"; billProduct.productName = @"dd";
billProduct.product_uuid = @"402880e64e287fe2014e28895b8a0032"; billProduct.productUuid = @"402880e64e287fe2014e28895b8a0032";
billProduct.product_code = @"农夫山泉"; billProduct.productCode = @"农夫山泉";
billProduct.qpc = [NSNumber numberWithFloat:22]; billProduct.qpc = [NSNumber numberWithFloat:22];
billProduct.unit = @"筐"; billProduct.unit = @"筐";
billProduct.qty = [NSNumber numberWithFloat:23]; billProduct.qty = [NSNumber numberWithFloat:23];
billProduct.price = [NSNumber numberWithFloat:333]; billProduct.price = [NSNumber numberWithFloat:333];
billProduct.baseQty = [NSNumber numberWithFloat:333]; billProduct.baseQty = [NSNumber numberWithFloat:333];
billProduct.basePrice = [NSNumber numberWithFloat:33];
billProduct.total = [NSNumber numberWithFloat:80]; billProduct.total = [NSNumber numberWithFloat:80];
billProduct.remark = @"hshshshsh"; billProduct.note = @"hshshshsh";
billProduct.qpcStr = @"fdsfdsfdsa"; billProduct.qpcStr = @"fdsfdsfdsa";
billProduct.purchasebillnumber = bill.billNumber;
[arr addObject:billProduct]; [arr addObject:billProduct];
[arr addObject:billProduct]; [arr addObject:billProduct];
bill.products = arr; bill.products = arr;
...@@ -171,7 +172,7 @@ ...@@ -171,7 +172,7 @@
return cell; return cell;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 200; return 210;
} }
#pragma mark - 按钮确定 #pragma mark - 按钮确定
- (void)sureClick{ - (void)sureClick{
...@@ -183,7 +184,7 @@ ...@@ -183,7 +184,7 @@
#pragma mark - 得到通知的方法 #pragma mark - 得到通知的方法
- (void)getSelectPurchaseProduct:(NSNotification *)fination{ - (void)getSelectPurchaseProduct:(NSNotification *)fination{
NSDictionary *dict = fination.userInfo; NSDictionary *dict = fination.userInfo;
PurchaseBillProduct *billProduct = dict[@"selectArr"]; TransportPdtDetail *billProduct = dict[@"selectArr"];
NSString *state = dict[@"state"]; NSString *state = dict[@"state"];
if ([state isEqualToString:@"add"]) { if ([state isEqualToString:@"add"]) {
[self.indexArr addObject:billProduct]; [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 @@ ...@@ -23,6 +23,7 @@
@property (nonatomic,strong)NSString *type;//类型 @property (nonatomic,strong)NSString *type;//类型
@property (nonatomic,strong)NSString *carphone;//司机电话 @property (nonatomic,strong)NSString *carphone;//司机电话
@property (nonatomic,strong)NSString *note;//备注 @property (nonatomic,strong)NSString *note;//备注
@property (nonatomic,strong)NSNumber *version;//版本
@property (nonatomic,strong)NSString *create_time;//创建时间 @property (nonatomic,strong)NSString *create_time;//创建时间
@property (nonatomic,strong)NSString *create_id;//创建人代码 @property (nonatomic,strong)NSString *create_id;//创建人代码
...@@ -31,6 +32,8 @@ ...@@ -31,6 +32,8 @@
@property (nonatomic,strong)NSString *lastModified_id;//最后修改人代码 @property (nonatomic,strong)NSString *lastModified_id;//最后修改人代码
@property (nonatomic,strong)NSString *lastModified_operName;//最后修改人名称 @property (nonatomic,strong)NSString *lastModified_operName;//最后修改人名称
@property (nonatomic,strong)NSArray *pdtDetails;//商品
@property (nonatomic,strong)NSArray *accountDetails;//费用
@end @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 @@ ...@@ -7,13 +7,29 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ProductBillViewController.h" #import "TransportProductViewController.h"
#import "CostViewController.h" #import "CostViewController.h"
#import "FeeAcountDetail.h"
#import "TransportPdtDetail.h"
@interface BottomTransportView : UIView @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,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)refreshCost:(NSArray *)costArr;
//刷新商品
- (void)refreshTranProduct:(NSArray *)tranProductArr;
#warning - 临时
- (void)reProduct:(NSArray *)tranProductArr;
//添加或者编辑
- (void)refreshProduct:(TransportPdtDetail *)transportPdtDetail;
@end @end
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
// //
#import "BottomTransportView.h" #import "BottomTransportView.h"
#import "TransportPdtDetail.h"
#import "FeeAcountDetail.h"
#define ContentHeight 44 #define ContentHeight 44
#define BtnWidth 100 #define BtnWidth 100
#define BeginTag 8000 #define BeginTag 8000
...@@ -24,9 +25,10 @@ ...@@ -24,9 +25,10 @@
@implementation BottomTransportView @implementation BottomTransportView
- (instancetype)initWithFrame:(CGRect)frame{ - (instancetype)initWithFrame:(CGRect)frame withHidden:(BOOL)isHidden{
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if (self) { if (self) {
self.isHiddenEdit = isHidden;
//界面 //界面
[self bulidLayout]; [self bulidLayout];
} }
...@@ -67,9 +69,11 @@ ...@@ -67,9 +69,11 @@
if (i == 0) { if (i == 0) {
view.backgroundColor = [UIColor redColor]; view.backgroundColor = [UIColor redColor];
self.productVC.viewFrame = view.bounds; self.productVC.viewFrame = view.bounds;
self.productVC.isHiddenEdit = self.isHiddenEdit;
[view addSubview:self.productVC.view]; [view addSubview:self.productVC.view];
}else if(i == 1){ }else if(i == 1){
self.costVC.viewFrame = view.bounds; self.costVC.viewFrame = view.bounds;
self.costVC.isHiddenEdit = self.isHiddenEdit;
[view addSubview:self.costVC.view]; [view addSubview:self.costVC.view];
view.backgroundColor = [UIColor blueColor]; view.backgroundColor = [UIColor blueColor];
} }
...@@ -86,7 +90,7 @@ ...@@ -86,7 +90,7 @@
} }
- (void)addChildView{ - (void)addChildView{
self.productVC = [[ProductBillViewController alloc]init]; self.productVC = [[TransportProductViewController alloc]init];
self.productVC.twoTitle = @"+选择采购单"; self.productVC.twoTitle = @"+选择采购单";
self.costVC = [[CostViewController alloc]init]; self.costVC = [[CostViewController alloc]init];
} }
...@@ -115,15 +119,59 @@ ...@@ -115,15 +119,59 @@
btn.enabled = NO; btn.enabled = NO;
_currentBtn = btn; _currentBtn = btn;
} }
//添加商品
- (void)refreshProduct:(NSArray *)productArr{ - (void)refreshProduct:(TransportPdtDetail *)transportPdtDetail
if (self.productVC.productArr) { {
[self.productVC.productArr addObjectsFromArray:productArr]; if (self.productVC.transportProductArr) {
[self.productVC.transportProductArr addObject:transportPdtDetail];
[self.productVC.tableView reloadData]; [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{ - (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 @end
// //
// TransportPurductCell.h // CostCell.h
// XFFruit // XFFruit
// //
// Created by 陈俊俊 on 15/9/6. // Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved. // Copyright (c) 2015年 Xummer. All rights reserved.
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "FeeAcountDetail.h"
@interface TransportPurductCell : UITableViewCell @interface CostCell : UITableViewCell
@property (nonatomic,strong)UIImageView *smallImageView; @property (nonatomic,strong)UIImageView *smallImageView;
@property (nonatomic,strong)UIButton *editBtn; @property (nonatomic,strong)UIButton *editBtn;
@property (nonatomic,strong)UILabel *seqLabel; @property (nonatomic,strong)UILabel *seqLabel;
@property (nonatomic,strong)UILabel *titleLabel; @property (nonatomic,strong)UILabel *typeLabel;
@property (nonatomic,strong)UILabel *standLabel; @property (nonatomic,strong)UILabel *actualLabel;
@property (nonatomic,strong)UILabel *countLabel; @property (nonatomic,strong)UILabel *paidLabel;
@property (nonatomic,strong)UILabel *baseCountLabel; @property (nonatomic,strong)UILabel *leftLabel;
@property (nonatomic,strong)UILabel *lineLabel; @property (nonatomic,strong)UILabel *lineLabel;
- (void)setFeeCost:(FeeAcountDetail *)fee row:(NSInteger)row;
@end @end
// //
// TransportPurductCell.m // CostCell.m
// XFFruit // XFFruit
// //
// Created by 陈俊俊 on 15/9/6. // Created by 陈俊俊 on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved. // Copyright (c) 2015年 Xummer. All rights reserved.
// //
#import "TransportPurductCell.h" #import "CostCell.h"
#define LeftMargin 13 #define LeftMargin 13
#define TableHeight 44 #define TableHeight 44
#define SmallSize 10 #define SmallSize 10
#define SmallWidth 20 #define SmallWidth 20
#define SpaceMargin 1 #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{ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
...@@ -29,55 +27,67 @@ ...@@ -29,55 +27,67 @@
- (void)bulidLayout - (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.textColor = GXF_CONTENT_COLOR;
self.seqLabel.text = @"13"; self.seqLabel.text = @"13";
self.seqLabel.font = GXF_SIXTEENTEH_SIZE; self.seqLabel.font = GXF_SIXTEENTEH_SIZE;
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftWidth, 0, headWidth, TableHeight))]; self.typeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftWidth, 0, headWidth, TableHeight))];
self.titleLabel.textAlignment = NSTextAlignmentLeft; self.typeLabel.textAlignment = NSTextAlignmentLeft;
self.titleLabel.textColor = GXF_CONTENT_COLOR; self.typeLabel.textColor = GXF_CONTENT_COLOR;
self.titleLabel.text = @"苹果桃子"; self.typeLabel.text = @"苹果桃子";
self.titleLabel.font = GXF_SIXTEENTEH_SIZE; self.typeLabel.font = GXF_SIXTEENTEH_SIZE;
self.standLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))]; self.actualLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.typeLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.standLabel.textAlignment = NSTextAlignmentLeft; self.actualLabel.textAlignment = NSTextAlignmentLeft;
self.standLabel.textColor = GXF_CONTENT_COLOR; self.actualLabel.textColor = GXF_CONTENT_COLOR;
self.standLabel.text = @"80"; self.actualLabel.text = @"30000";
self.standLabel.font = GXF_SIXTEENTEH_SIZE; self.actualLabel.font = GXF_SIXTEENTEH_SIZE;
self.countLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.standLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))]; self.paidLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.actualLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.countLabel.textAlignment = NSTextAlignmentLeft; self.paidLabel.textAlignment = NSTextAlignmentLeft;
self.countLabel.text = @"200"; self.paidLabel.text = @"2015-04-05";
self.countLabel.textColor = GXF_CONTENT_COLOR; self.paidLabel.textColor = GXF_CONTENT_COLOR;
self.countLabel.font = GXF_SIXTEENTEH_SIZE; self.paidLabel.font = GXF_SIXTEENTEH_SIZE;
self.baseCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.countLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))]; self.leftLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.paidLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.baseCountLabel.textAlignment = NSTextAlignmentLeft; self.leftLabel.textAlignment = NSTextAlignmentLeft;
self.baseCountLabel.text = @"200"; self.leftLabel.text = @"2015-04-05";
self.baseCountLabel.textColor = GXF_CONTENT_COLOR; self.leftLabel.textColor = GXF_CONTENT_COLOR;
self.baseCountLabel.font = GXF_SIXTEENTEH_SIZE; self.leftLabel.font = GXF_SIXTEENTEH_SIZE;
self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom]; self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.editBtn setImage:[UIImage imageNamed:@"selected"] forState:UIControlStateNormal]; [self.editBtn setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateNormal];
self.editBtn.frame = CGRectMake(ScreenSize.width - LeftWidth, 0, LeftWidth , TableHeight); 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 = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin,TableHeight-1, ScreenSize.width - LeftMargin * 2, 1))];;
self.lineLabel.backgroundColor = GXF_LINE_COLOR; self.lineLabel.backgroundColor = GXF_LINE_COLOR;
[self.contentView addSubview:self.smallImageView]; [self.contentView addSubview:self.smallImageView];
[self.contentView addSubview:self.seqLabel]; [self.contentView addSubview:self.seqLabel];
[self.contentView addSubview:self.titleLabel]; [self.contentView addSubview:self.smallImageView];
[self.contentView addSubview:self.standLabel]; [self.contentView addSubview:self.typeLabel];
[self.contentView addSubview:self.countLabel];
[self.contentView addSubview:self.baseCountLabel];
[self.contentView addSubview:self.editBtn]; [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 { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; [super setSelected:selected animated:animated];
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "HPGrowingTextView.h" #import "HPGrowingTextView.h"
#import "Transport.h"
@protocol TopTransportViewDelegate <NSObject> @protocol TopTransportViewDelegate <NSObject>
- (void)hiddenKeyBoard; - (void)hiddenKeyBoard;
...@@ -36,5 +36,6 @@ ...@@ -36,5 +36,6 @@
@property (nonatomic,strong)NSString *type; @property (nonatomic,strong)NSString *type;
@property (nonatomic,strong)NSString *carphone; @property (nonatomic,strong)NSString *carphone;
@property (nonatomic,strong)NSString *note; @property (nonatomic,strong)NSString *note;
@property (nonatomic,strong)Transport *transport;
@end @end
...@@ -125,6 +125,43 @@ ...@@ -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{ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if(indexPath.row == 0){ if(indexPath.row == 0){
ChooseWarehouseViewController *cvc = [ChooseWarehouseViewController new]; ChooseWarehouseViewController *cvc = [ChooseWarehouseViewController new];
...@@ -160,9 +197,13 @@ ...@@ -160,9 +197,13 @@
tvc.choseBaseInfo = ^(NSArray *types){ tvc.choseBaseInfo = ^(NSArray *types){
if (types.count > 0) { if (types.count > 0) {
NSString *type = types[0]; NSString *type = types[0];
self.typeLabel.text = [type isEqualToString:GXF_Critical] ? @"紧急":@"普通"; self.typeLabel.text = type;
self.typeLabel.textColor = GXF_CONTENT_COLOR; 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 @@ ...@@ -7,12 +7,12 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ProductBillCell.h"
#import "PurchaseBill.h" #import "PurchaseBill.h"
@interface TransportPurchaseCell : UITableViewCell<UITableViewDataSource,UITableViewDelegate> @interface TransportPurchaseCell : UITableViewCell<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong)UILabel *titleLabel; @property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *lineLabel; @property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UILabel *secondLabel; @property (nonatomic,strong)UILabel *secondLabel;
@property (nonatomic,strong)UILabel *threeLabel;
@property (nonatomic,strong)UITableView *secondTable; @property (nonatomic,strong)UITableView *secondTable;
@property (nonatomic,strong)NSMutableArray *secondArr; @property (nonatomic,strong)NSMutableArray *secondArr;
...@@ -21,4 +21,5 @@ ...@@ -21,4 +21,5 @@
@property (nonatomic,strong)NSMutableArray *indexArr; @property (nonatomic,strong)NSMutableArray *indexArr;
@property (nonatomic,strong)NSMutableArray *selectArr; @property (nonatomic,strong)NSMutableArray *selectArr;
@end @end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "TransportPurchaseCell.h" #import "TransportPurchaseCell.h"
#import "PurchaseBillProduct.h" #import "TransportPurductCell.h"
#import "HeaderCell.h" #import "HeaderCell.h"
@implementation TransportPurchaseCell @implementation TransportPurchaseCell
...@@ -23,22 +23,31 @@ ...@@ -23,22 +23,31 @@
- (void)bulidLayout - (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 = [[UILabel alloc]initWithFrame:(CGRectMake(0,0, ScreenSize.width, 1))];;
self.lineLabel.backgroundColor = GXF_LINE_COLOR; self.lineLabel.backgroundColor = GXF_LINE_COLOR;
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0, 0, ScreenSize.width, 44))]; self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0, 0, ScreenSize.width, 44))];
self.titleLabel.textAlignment = NSTextAlignmentCenter; self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.titleLabel.textColor = GXF_NAVIGAYION_COLOR;
self.titleLabel.text = @"苹果桃子"; 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 = [[UILabel alloc]initWithFrame:(CGRectMake(0,44-1, ScreenSize.width, 1))];;
self.secondLabel.backgroundColor = GXF_LINE_COLOR; self.secondLabel.backgroundColor = GXF_LINE_COLOR;
[self.contentView addSubview:self.titleLabel]; self.threeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0,200-1, ScreenSize.width, 1))];;
[self.contentView addSubview:self.lineLabel]; self.threeLabel.backgroundColor = GXF_LINE_COLOR;
[self.contentView addSubview:self.secondLabel];
[bgView addSubview:self.titleLabel];
[bgView addSubview:self.lineLabel];
[bgView addSubview:self.secondLabel];
[bgView addSubview:self.threeLabel];
} }
- (void)setBill:(PurchaseBill *)bill{ - (void)setBill:(PurchaseBill *)bill{
...@@ -52,7 +61,7 @@ ...@@ -52,7 +61,7 @@
// [self.secondArr addObject:billProcuct]; // [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.delegate = self;
self.secondTable.dataSource = self; self.secondTable.dataSource = self;
...@@ -79,21 +88,22 @@ ...@@ -79,21 +88,22 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
static NSString *cellID = @"ProductBillCell"; static NSString *cellID = @"TransportPurductCell";
ProductBillCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; TransportPurductCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) { if (cell == nil) {
cell = [[ProductBillCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; cell = [[TransportPurductCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID withImageName:@"selected"];
cell.editBtn.hidden = YES; cell.editBtn.hidden = YES;
cell.rightImageName = @"edit";
} }
PurchaseBillProduct * billProduct = self.secondArr[indexPath.row]; TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
[cell setBillProduct:billProduct row:indexPath.row]; [cell setPdtDetail:billProduct row:indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell; return cell;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
ProductBillCell *cell = (ProductBillCell *)[tableView cellForRowAtIndexPath:indexPath]; TransportPurductCell *cell = (TransportPurductCell *)[tableView cellForRowAtIndexPath:indexPath];
PurchaseBillProduct * billProduct = self.secondArr[indexPath.row]; TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
if (![self isHaveIndexPath:indexPath]) { if (![self isHaveIndexPath:indexPath]) {
cell.editBtn.hidden = NO; cell.editBtn.hidden = NO;
[self.selectArr addObject:indexPath]; [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 @@ ...@@ -15,5 +15,5 @@
#import "IBTConstants.h" #import "IBTConstants.h"
#import "ICRAppMacro.h" #import "ICRAppMacro.h"
#import "ICRNotificationMacro.h" #import "ICRNotificationMacro.h"
#import "RegexUtil.h"
#endif #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