Commit 4a62d8c4 authored by Sandy's avatar Sandy

非产品中心非wms仓收货

parent 1fb47ad6
...@@ -329,7 +329,11 @@ static NSString *ICRDataBasePath = @""; ...@@ -329,7 +329,11 @@ static NSString *ICRDataBasePath = @"";
[_m_dbQueue inDatabase:^(FMDatabase *db) { [_m_dbQueue inDatabase:^(FMDatabase *db) {
// [db open]; // [db open];
//2017-05-08仓库增加了iswms 和 isproductcenter两个字段 /*
2017-05-08
Warehouse 增加了iswms 和 isproductcenter两个字段
Product 增加了purMeasureUnit默认采购单位字段
*/
if (![db columnExists:@"iswms" inTableWithName:@"Warehouse"]) { if (![db columnExists:@"iswms" inTableWithName:@"Warehouse"]) {
CLog(@"没有iswms 和 isproductcenter两个字段"); CLog(@"没有iswms 和 isproductcenter两个字段");
...@@ -340,6 +344,16 @@ static NSString *ICRDataBasePath = @""; ...@@ -340,6 +344,16 @@ static NSString *ICRDataBasePath = @"";
[db executeUpdate:addTable]; [db executeUpdate:addTable];
} }
if (![db columnExists:@"purMeasureUnit" inTableWithName:@"Product"]) {
NSString *sql = @"DROP TABLE IF EXISTS 'Product'";
[db executeUpdate:sql];
NSString *addTable = [Product SQLForCreateTable];
[db executeUpdate:addTable];
}
// [db close]; // [db close];
}]; }];
} }
......
...@@ -354,6 +354,12 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) { ...@@ -354,6 +354,12 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ success:(void (^)(id))succ
failure:(void (^)(id))fail; failure:(void (^)(id))fail;
//5.采购单收货
- (void)recievePurchase:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//1.添加发运单 //1.添加发运单
- (void)saveTransportWithData:(id)data - (void)saveTransportWithData:(id)data
success:(void (^)(id))succ success:(void (^)(id))succ
......
...@@ -2359,6 +2359,34 @@ acceptTypeJson:YES ...@@ -2359,6 +2359,34 @@ acceptTypeJson:YES
} }
- (void)recievePurchase:(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 );
}
};
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *url = [NSString stringWithFormat:@"%@/purchase/bill/receive?time=%@&operId=%@&operName=%@",HTTP_REST_API_BASE_URL,[[NSDate date] httpParameterString],userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:data
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
#pragma mark - 添加发运单 #pragma mark - 添加发运单
- (void)saveTransportWithData:(id)data - (void)saveTransportWithData:(id)data
success:(void (^)(id))succ success:(void (^)(id))succ
......
...@@ -149,6 +149,8 @@ ...@@ -149,6 +149,8 @@
#define PURCHASE_STATE_ABORTED @"aborted" //已作废 #define PURCHASE_STATE_ABORTED @"aborted" //已作废
#define PURCHASE_STATE_PROCESS @"process"//提交系统处理 #define PURCHASE_STATE_PROCESS @"process"//提交系统处理
#define PURCHASE_STATE_PROCESSFAIL @"processFail"//系统处理失败 #define PURCHASE_STATE_PROCESSFAIL @"processFail"//系统处理失败
#define PURCHASE_STATE_WAITE_RECIEVE @"waitReceive"//待收货
//采购单操作 //采购单操作
#define PURCHASE_ACTION_REJECT @"reject" #define PURCHASE_ACTION_REJECT @"reject"
#define PURCHASE_ACTION_APPROVE @"approve" #define PURCHASE_ACTION_APPROVE @"approve"
......
...@@ -120,7 +120,7 @@ typedef enum : NSUInteger { ...@@ -120,7 +120,7 @@ typedef enum : NSUInteger {
[arr addObject:billProduct]; [arr addObject:billProduct];
} }
_aBottomView.productVC.productArr = arr; _aBottomView.productVC.productArr = arr;
[_aBottomView.productVC.tableView reloadData]; [_aBottomView.productVC.tableView reloadData];
NSMutableArray *arrCost = [NSMutableArray array]; NSMutableArray *arrCost = [NSMutableArray array];
...@@ -181,18 +181,18 @@ typedef enum : NSUInteger { ...@@ -181,18 +181,18 @@ typedef enum : NSUInteger {
[footView addSubview:commitBtn]; [footView addSubview:commitBtn];
[self.view addSubview:footView]; [self.view addSubview:footView];
_purchaseView = [[TopPurchaseView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, TopHeight)]; _purchaseView = [[TopPurchaseView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, TopHeight)];
_purchaseView.delegate = self; _purchaseView.delegate = self;
[_scrollView addSubview:_purchaseView]; [_scrollView addSubview:_purchaseView];
// _bottomView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_purchaseView.frame) + 20, ScreenSize.width,BottomHeight)]; // _bottomView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_purchaseView.frame) + 20, ScreenSize.width,BottomHeight)];
// _bottomView.backgroundColor = [UIColor whiteColor]; // _bottomView.backgroundColor = [UIColor whiteColor];
// [_scrollView addSubview:_bottomView]; // [_scrollView addSubview:_bottomView];
// //
// _pvc = [[ProductBillViewController alloc]init]; // _pvc = [[ProductBillViewController alloc]init];
// _pvc.viewFrame = _bottomView.bounds; // _pvc.viewFrame = _bottomView.bounds;
// [_bottomView addSubview:_pvc.view]; // [_bottomView addSubview:_pvc.view];
_aBottomView = [[BottomPurchaseView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_purchaseView.frame) + 20, ScreenSize.width,BottomHeight) withHidden:NO]; _aBottomView = [[BottomPurchaseView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_purchaseView.frame) + 20, ScreenSize.width,BottomHeight) withHidden:NO];
_aBottomView.backgroundColor = [UIColor whiteColor]; _aBottomView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_aBottomView]; [_scrollView addSubview:_aBottomView];
...@@ -203,14 +203,14 @@ typedef enum : NSUInteger { ...@@ -203,14 +203,14 @@ typedef enum : NSUInteger {
- (void)setProductTotalPrice:(NSNotification *)fication{ - (void)setProductTotalPrice:(NSNotification *)fication{
//计算总金额 //计算总金额
NSDecimalNumber *otherPrice = [NSDecimalNumber decimalNumberWithString:@"0"]; NSDecimalNumber *otherPrice = [NSDecimalNumber decimalNumberWithString:@"0"];
// if (_aBottomView.costVC.costArr.count == 0) { // if (_aBottomView.costVC.costArr.count == 0) {
// otherPrice = [_purchaseView.otherPriceFiled.text floatValue]; // otherPrice = [_purchaseView.otherPriceFiled.text floatValue];
// }else{ // }else{
for (FeeAcountDetail *cost in _aBottomView.costVC.costArr) { for (FeeAcountDetail *cost in _aBottomView.costVC.costArr) {
otherPrice = [CalculateHelper calculateNum1:otherPrice num2:cost.leftmoney type:CalculateTypeAdd roundingType:NSRoundBankers cutLenth:10]; otherPrice = [CalculateHelper calculateNum1:otherPrice num2:cost.leftmoney type:CalculateTypeAdd roundingType:NSRoundBankers cutLenth:10];
} }
_purchaseView.otherPriceFiled.text = [NSString stringWithFormat:@"%@", otherPrice]; _purchaseView.otherPriceFiled.text = [NSString stringWithFormat:@"%@", otherPrice];
// } // }
//其他费用 + 商品总金额 //其他费用 + 商品总金额
...@@ -225,7 +225,7 @@ typedef enum : NSUInteger { ...@@ -225,7 +225,7 @@ typedef enum : NSUInteger {
_purchaseView.chargePurchase = otherPrice; _purchaseView.chargePurchase = otherPrice;
...@@ -261,7 +261,7 @@ typedef enum : NSUInteger { ...@@ -261,7 +261,7 @@ typedef enum : NSUInteger {
[[NSNotificationCenter defaultCenter] postNotificationName:SetProductTotalPrice object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:SetProductTotalPrice object:nil];
}; };
} }
svc.title = [IBTCommon localizableString:@"AddShopDetail"]; svc.title = [IBTCommon localizableString:@"AddShopDetail"];
[self PushViewController:svc animated:YES]; [self PushViewController:svc animated:YES];
} }
...@@ -368,6 +368,7 @@ typedef enum : NSUInteger { ...@@ -368,6 +368,7 @@ typedef enum : NSUInteger {
@"total":_purchaseView.total, @"total":_purchaseView.total,
@"charge":_purchaseView.chargePurchase, @"charge":_purchaseView.chargePurchase,
@"remark":[IBTCommon checkString:_purchaseView.remark], @"remark":[IBTCommon checkString:_purchaseView.remark],
@"outSideBillNumber":[IBTCommon checkString:_purchaseView.purchaseExternal.text],
@"products":billProducts, @"products":billProducts,
@"accountDetails":costs}; @"accountDetails":costs};
[IBTLoadingView showProgressLabel:msg]; [IBTLoadingView showProgressLabel:msg];
...@@ -392,6 +393,10 @@ typedef enum : NSUInteger { ...@@ -392,6 +393,10 @@ typedef enum : NSUInteger {
ShowMessage(@"收货仓库不能为空"); ShowMessage(@"收货仓库不能为空");
return NO; return NO;
} }
if (_purchaseView.purchaseExternal.text == 0) {
ShowMessage(@"外部单据号不能为空");
return NO;
}
if (_aBottomView.productVC.productArr.count == 0) { if (_aBottomView.productVC.productArr.count == 0) {
ShowMessage(@"采购商品不能为空"); ShowMessage(@"采购商品不能为空");
return NO; return NO;
...@@ -405,12 +410,12 @@ typedef enum : NSUInteger { ...@@ -405,12 +410,12 @@ typedef enum : NSUInteger {
ShowMessage(@"有数量等于0的商品明细,请编辑后保存"); ShowMessage(@"有数量等于0的商品明细,请编辑后保存");
return NO; return NO;
} }
// if ([billProduct.price floatValue] <=0 || [billProduct.basePrice floatValue] <= 0) { // if ([billProduct.price floatValue] <=0 || [billProduct.basePrice floatValue] <= 0) {
// ShowMessage(@"有价格未填写的商品明细,请编辑后保存"); // ShowMessage(@"有价格未填写的商品明细,请编辑后保存");
// return NO; // return NO;
// } // }
} }
return YES; return YES;
} }
...@@ -461,7 +466,7 @@ typedef enum : NSUInteger { ...@@ -461,7 +466,7 @@ typedef enum : NSUInteger {
NSMutableArray *billArr = [NSMutableArray array]; NSMutableArray *billArr = [NSMutableArray array];
for (NoticeProduct *product in arr) { for (NoticeProduct *product in arr) {
PurchaseBillProduct *billProduct = [PurchaseBillProduct new]; PurchaseBillProduct *billProduct = [PurchaseBillProduct new];
// billProduct.uuid = product.uuid; // billProduct.uuid = product.uuid;
billProduct.product_name = product.productName; billProduct.product_name = product.productName;
billProduct.product_uuid = product.productUuid; billProduct.product_uuid = product.productUuid;
billProduct.product_code = product.productCode; billProduct.product_code = product.productCode;
...@@ -507,13 +512,13 @@ typedef enum : NSUInteger { ...@@ -507,13 +512,13 @@ typedef enum : NSUInteger {
} }
/* /*
#pragma mark - Navigation #pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation // In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController]. // Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller. // Pass the selected object to the new view controller.
} }
*/ */
@end @end
...@@ -8,6 +8,19 @@ ...@@ -8,6 +8,19 @@
#import "ICRBaseViewController.h" #import "ICRBaseViewController.h"
#import "PurchaseBill.h" #import "PurchaseBill.h"
/**
* 采购单状态
*/
typedef NS_ENUM(NSInteger, PurchaseType) {
/**
* 审核之前的状态(已保存、已提交)
*/
PurchaseTypeBeforeVerify = 1,
/**
* 审核之后的状态(待收货、发运中等。。)
*/
PurchaseTypeAfterVerify,
};
@interface PurchaseDetailViewController : ICRBaseViewController @interface PurchaseDetailViewController : ICRBaseViewController
@property (nonatomic,strong)PurchaseBill *bill; @property (nonatomic,strong)PurchaseBill *bill;
...@@ -15,4 +28,8 @@ ...@@ -15,4 +28,8 @@
//显示样式 //显示样式
@property (nonatomic,assign)NSInteger indexStyle;//0.1.2 @property (nonatomic,assign)NSInteger indexStyle;//0.1.2
@property (nonatomic, assign) PurchaseType type;
@end @end
...@@ -36,7 +36,11 @@ ...@@ -36,7 +36,11 @@
@property (nonatomic,strong)NSString *type;//类型 @property (nonatomic,strong)NSString *type;//类型
@property (nonatomic, strong) NSString *purchaserName;//采购员名字 @property (nonatomic, strong) NSString *purchaserName;//采购员名字
@property (nonatomic, strong) NSString *purchaserCode;//采购员代码 @property (nonatomic, strong) NSString *purchaserCode;//采购员代码
@property (nonatomic, strong) NSString *purchaserUuid;//采购员uuid
@property (strong, nonatomic) NSString *outSideBillNumber;//外部单据号
@property (nonatomic,strong)NSArray *products; @property (nonatomic,strong)NSArray *products;
@property (strong, nonatomic) NSArray *accountDetails; @property (strong, nonatomic) NSArray *accountDetails;
@property (nonatomic, strong) NSString *approv_time;//审核时间
@property (nonatomic, strong) NSString *approv_id;//审核人id
@property (nonatomic, strong) NSString *approv_operName;//审核人
@end @end
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
@property (nonatomic,strong)NSNumber *shippedFlag;//发运标志,0 未发运,1已发运 @property (nonatomic,strong)NSNumber *shippedFlag;//发运标志,0 未发运,1已发运
@property (nonatomic,strong)NSNumber *shippedQty;//发运包装数量 @property (nonatomic,strong)NSNumber *shippedQty;//发运包装数量
@property (nonatomic,strong)NSNumber *shippedBaseQty;//发运基础数量 @property (nonatomic,strong)NSNumber *shippedBaseQty;//发运基础数量
@property (strong, nonatomic) NSNumber *receivedQty;//收货数量
@property (strong, nonatomic) NSNumber *receivedBaseQty;//收货基础数量
......
...@@ -71,7 +71,8 @@ ...@@ -71,7 +71,8 @@
- (void)setPurchaseBill:(PurchaseBill *)purchaseBill{ - (void)setPurchaseBill:(PurchaseBill *)purchaseBill{
self.billNumberLabel.text = [NSString stringWithFormat:@"单号:%@",purchaseBill.billNumber]; self.billNumberLabel.text = [NSString stringWithFormat:@"单号:%@",purchaseBill.billNumber];
self.noticeNumberLabel.text = [NSString stringWithFormat:@"采购通知单号:%@",purchaseBill.noticeNumber.length > 0 ? purchaseBill.noticeNumber: @"无"]; self.noticeNumberLabel.text = [NSString stringWithFormat:@"收货仓库:%@[%@]",
purchaseBill.receiveWrh_name, purchaseBill.receiveWrh_code];
self.vendorLabel.text = [NSString stringWithFormat:@"供应商:%@[%@]",purchaseBill.vendor_name,purchaseBill.vendor_code] ; self.vendorLabel.text = [NSString stringWithFormat:@"供应商:%@[%@]",purchaseBill.vendor_name,purchaseBill.vendor_code] ;
self.createOperNameLabel.text = [NSString stringWithFormat:@"创建人:%@",purchaseBill.create_operName] ; self.createOperNameLabel.text = [NSString stringWithFormat:@"创建人:%@",purchaseBill.create_operName] ;
self.createTimeLabel.text =[NSString stringWithFormat:@"创建时间:%@",purchaseBill.create_time]; self.createTimeLabel.text =[NSString stringWithFormat:@"创建时间:%@",purchaseBill.create_time];
...@@ -113,6 +114,10 @@ ...@@ -113,6 +114,10 @@
// self.stateBtn.frame = CGRectMake(0 , TopMargin, LeftMargin - TopMargin, 20); // self.stateBtn.frame = CGRectMake(0 , TopMargin, LeftMargin - TopMargin, 20);
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_WAITE_RECIEVE]){
self.stateBtn.frame = CGRectMake(TopMargin *2 , TopMargin, LeftMargin - TopMargin*3, 20);
stateStr = @"待收货";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
} }
[self.stateBtn setTitle:stateStr forState:UIControlStateNormal]; [self.stateBtn setTitle:stateStr forState:UIControlStateNormal];
......
...@@ -17,13 +17,17 @@ ...@@ -17,13 +17,17 @@
@end @end
@interface TopPurchaseView : UIView @interface TopPurchaseView : UIView
@property (nonatomic,strong)UILabel *purchaseNoticeLabel;//采购通知单号 @property (nonatomic,strong)UILabel *purchaserLabel;//采购员
@property (nonatomic,strong)UILabel *purchaseTypeLabel;//类型 @property (nonatomic,strong)UILabel *purchaseTypeLabel;//类型
@property (nonatomic,strong)UILabel *purchaseSupplierLabel;//供应商 @property (nonatomic,strong)UILabel *purchaseSupplierLabel;//供应商
@property (nonatomic,strong)UILabel *purchaseStoreLabel;//收货仓库 @property (nonatomic,strong)UILabel *purchaseStoreLabel;//收货仓库
@property (nonatomic,strong)UITextField *otherPriceFiled;//其他费用 @property (nonatomic,strong)UITextField *otherPriceFiled;//其他费用
@property (nonatomic,strong)UILabel *purchasePriceLabel;//总金额 @property (nonatomic,strong)UILabel *purchasePriceLabel;//总金额
@property (nonatomic,strong)HPGrowingTextView *remarkTextView;//备注 @property (nonatomic,strong)HPGrowingTextView *remarkTextView;//备注
/**
* 外部单据号
*/
@property (strong, nonatomic) UITextField *purchaseExternal;
//数据 //数据
@property (nonatomic,strong)NSString *noticeUuid; @property (nonatomic,strong)NSString *noticeUuid;
@property (nonatomic,strong)NSString *noticeNumber; @property (nonatomic,strong)NSString *noticeNumber;
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
{ {
self.backgroundColor = XXFBgColor; self.backgroundColor = XXFBgColor;
_dataArr = [NSMutableArray array]; _dataArr = [NSMutableArray array];
NSArray *arr = @[@"采购员:",@"类型:",@"供应商:",@"收货仓库:",@"其他费用:",@"总金额:",@"备注:"]; NSArray *arr = @[@"采购员:",@"类型:",@"供应商:",@"收货仓库:",@"其他费用:",@"总金额:",@"外部单据号:",@"备注:"];
[_dataArr addObjectsFromArray:arr]; [_dataArr addObjectsFromArray:arr];
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, TopMargin,self.frame.size.width, self.frame.size.height - TopMargin)) style:(UITableViewStylePlain)]; _tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, TopMargin,self.frame.size.width, self.frame.size.height - TopMargin)) style:(UITableViewStylePlain)];
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
_tableView.bounces = NO; _tableView.bounces = NO;
_tableView.delegate = self; _tableView.delegate = self;
_tableView.dataSource = self; _tableView.dataSource = self;
[self addSubview:_tableView]; [self addSubview:_tableView];
} }
#pragma mark - 协议方法 #pragma mark - 协议方法
...@@ -108,7 +109,7 @@ ...@@ -108,7 +109,7 @@
[cell.contentView addSubview:label]; [cell.contentView addSubview:label];
cell.alpha = 0; cell.alpha = 0;
}else if (indexPath.row == _dataArr.count -1){ }else if ([_dataArr[indexPath.row] isEqualToString:@"备注:"]){
self.remarkTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight)]; self.remarkTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight)];
self.remarkTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0); self.remarkTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
self.remarkTextView.minNumberOfLines = 1; self.remarkTextView.minNumberOfLines = 1;
...@@ -121,6 +122,15 @@ ...@@ -121,6 +122,15 @@
self.remarkTextView.placeholder = @"输入备注内容"; self.remarkTextView.placeholder = @"输入备注内容";
[cell.contentView addSubview:self.remarkTextView]; [cell.contentView addSubview:self.remarkTextView];
}else if ([_dataArr[indexPath.row] isEqualToString:@"外部单据号:"]){
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight)];
textField.textAlignment = NSTextAlignmentRight;
textField.textColor = GXF_CONTENT_COLOR;
textField.font = GXF_FIFTEENTEN_SIZE;
textField.delegate = self;
[cell.contentView addSubview:textField];
self.purchaseExternal = textField;
self.purchaseExternal.placeholder = @"输入外部单据号";
}else{ }else{
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight))]; UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight))];
contentLabel.textAlignment= NSTextAlignmentRight; contentLabel.textAlignment= NSTextAlignmentRight;
...@@ -129,7 +139,7 @@ ...@@ -129,7 +139,7 @@
[cell.contentView addSubview:contentLabel]; [cell.contentView addSubview:contentLabel];
if (indexPath.row == 0) { if (indexPath.row == 0) {
contentLabel.text = @"选择采购员"; contentLabel.text = @"选择采购员";
self.purchaseNoticeLabel = contentLabel; self.purchaserLabel = contentLabel;
}else if(indexPath.row == 1){ }else if(indexPath.row == 1){
contentLabel.text = @"选择类型"; contentLabel.text = @"选择类型";
...@@ -138,6 +148,8 @@ ...@@ -138,6 +148,8 @@
}else if(indexPath.row == 2){ }else if(indexPath.row == 2){
contentLabel.text = @"选择供应商"; contentLabel.text = @"选择供应商";
self.purchaseSupplierLabel = contentLabel; self.purchaseSupplierLabel = contentLabel;
self.purchaseTypeLabel.textColor = GXF_CONTENT_COLOR;
self.purchaseTypeLabel.text = @"普通";
}else if(indexPath.row == 3){ }else if(indexPath.row == 3){
contentLabel.text = @"选择收货仓库"; contentLabel.text = @"选择收货仓库";
...@@ -152,7 +164,6 @@ ...@@ -152,7 +164,6 @@
label.textColor = GXF_CONTENT_COLOR; label.textColor = GXF_CONTENT_COLOR;
label.font = GXF_FIFTEENTEN_SIZE; label.font = GXF_FIFTEENTEN_SIZE;
[cell.contentView addSubview:label]; [cell.contentView addSubview:label];
} }
} }
[self prepareDataInCell]; [self prepareDataInCell];
...@@ -160,9 +171,14 @@ ...@@ -160,9 +171,14 @@
//赋值 //赋值
- (void)setBill:(PurchaseBill *)bill{ - (void)setBill:(PurchaseBill *)bill{
if (bill) { if (bill) {
if (bill.noticeUuid.length > 0) {
self.purchaseNoticeLabel.text = bill.noticeNumber; if (bill.purchaserName.length > 0) {
self.purchaseNoticeLabel.textColor = GXF_CONTENT_COLOR; self.selectPerson = [SurveyUser new];
self.selectPerson.userCode = bill.purchaserCode;
self.selectPerson.userName = bill.purchaserName;
self.selectPerson.userUuid = bill.purchaserUuid;
self.purchaserLabel.text = bill.purchaserName;
self.purchaserLabel.textColor = GXF_CONTENT_COLOR;
} }
if (bill.type.length > 0) { if (bill.type.length > 0) {
NSString *type = [bill.type isEqualToString:GXF_Critical] ? @"紧急" : @"普通"; NSString *type = [bill.type isEqualToString:GXF_Critical] ? @"紧急" : @"普通";
...@@ -198,6 +214,8 @@ ...@@ -198,6 +214,8 @@
self.purchasePriceLabel.text = [bill.total stringValue]; self.purchasePriceLabel.text = [bill.total stringValue];
self.total = bill.total; self.total = bill.total;
} }
self.purchaseExternal.text = bill.outSideBillNumber;
if (bill.remark.length > 0) { if (bill.remark.length > 0) {
self.remarkTextView.text = bill.remark; self.remarkTextView.text = bill.remark;
self.remark = bill.remark; self.remark = bill.remark;
...@@ -209,8 +227,8 @@ ...@@ -209,8 +227,8 @@
self.purchasePriceLabel.text = [self.total stringValue]; self.purchasePriceLabel.text = [self.total stringValue];
} }
if (self.noticeNumber.length > 0) { if (self.noticeNumber.length > 0) {
self.purchaseNoticeLabel.text = self.noticeNumber; self.purchaserLabel.text = self.noticeNumber;
self.purchaseNoticeLabel.textColor = GXF_CONTENT_COLOR; self.purchaserLabel.textColor = GXF_CONTENT_COLOR;
} }
} }
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
...@@ -271,8 +289,8 @@ ...@@ -271,8 +289,8 @@
cvc.choseBaseInfo = ^(NSArray *users){ cvc.choseBaseInfo = ^(NSArray *users){
if(users.count == 1){ if(users.count == 1){
self.selectPerson = users[0]; self.selectPerson = users[0];
self.purchaseNoticeLabel.text = _selectPerson.userName; self.purchaserLabel.text = _selectPerson.userName;
self.purchaseNoticeLabel.textColor = GXF_CONTENT_COLOR; self.purchaserLabel.textColor = GXF_CONTENT_COLOR;
} }
}; };
cvc.isMoreChose = NO; cvc.isMoreChose = NO;
...@@ -280,6 +298,15 @@ ...@@ -280,6 +298,15 @@
} }
} }
- (NSString *)type {
if ([self.purchaseTypeLabel.text isEqualToString:@"紧急"]) {
_type = GXF_Critical;
}else{
_type = GXF_Normal;
}
return _type;
}
- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{ - (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{
[self.remarkTextView resignFirstResponder]; [self.remarkTextView resignFirstResponder];
return YES; return YES;
......
...@@ -406,7 +406,7 @@ typedef enum : NSUInteger { ...@@ -406,7 +406,7 @@ typedef enum : NSUInteger {
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//选择商品
if(indexPath.row == 0){ if(indexPath.row == 0){
ChooseProductViewController *cvc = [ChooseProductViewController new]; ChooseProductViewController *cvc = [ChooseProductViewController new];
if (self.selectProducts.count > 0) { if (self.selectProducts.count > 0) {
...@@ -432,6 +432,7 @@ typedef enum : NSUInteger { ...@@ -432,6 +432,7 @@ typedef enum : NSUInteger {
_measureUnitLabel.text = self.productMeasureUnit; _measureUnitLabel.text = self.productMeasureUnit;
_baseCountLabel.text = self.productMeasureUnit; _baseCountLabel.text = self.productMeasureUnit;
} }
[self setPackageUnit:product.purMeasureUnit];
}; };
cvc.isMoreChose = NO; cvc.isMoreChose = NO;
[self PushViewController:cvc animated:YES]; [self PushViewController:cvc animated:YES];
...@@ -444,11 +445,7 @@ typedef enum : NSUInteger { ...@@ -444,11 +445,7 @@ typedef enum : NSUInteger {
cvc.choseBaseInfo = ^(NSArray *products){ cvc.choseBaseInfo = ^(NSArray *products){
if (products.count > 0) { if (products.count > 0) {
GXFProductUnit *productUnit=products [0]; GXFProductUnit *productUnit=products [0];
_PackagingLable.text = [NSString stringWithFormat:@"%@",productUnit.name]; [self setPackageUnit:productUnit.name];
_PackagingLable.textColor = GXF_CONTENT_COLOR;
_packageCountLabel.text = productUnit.name;
self.packageUintStr = productUnit.name;
self.selectUnit = productUnit.name;
} }
}; };
cvc.isMoreChose = NO; cvc.isMoreChose = NO;
...@@ -456,6 +453,19 @@ typedef enum : NSUInteger { ...@@ -456,6 +453,19 @@ typedef enum : NSUInteger {
} }
} }
/**
* 设置包装单位
*
* @param packageUnit 包装单位
*/
- (void)setPackageUnit:(NSString *)packageUnit {
_PackagingLable.text = packageUnit;
_PackagingLable.textColor = GXF_CONTENT_COLOR;
_packageCountLabel.text = packageUnit;
self.packageUintStr = packageUnit;
self.selectUnit = packageUnit;
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
if (textField.tag != 111) { if (textField.tag != 111) {
return YES; return YES;
......
...@@ -301,8 +301,6 @@ typedef enum : NSUInteger { ...@@ -301,8 +301,6 @@ typedef enum : NSUInteger {
_pvc.isHiddenAdd = YES; _pvc.isHiddenAdd = YES;
_pvc.isHiddenEdit = self.isNotShowEdit; _pvc.isHiddenEdit = self.isNotShowEdit;
[_bottomView addSubview:_pvc.view]; [_bottomView addSubview:_pvc.view];
NSLog(@">>>>>>>>>>>>>>>>>>>>>>>>>>%f", _transportView.bottom);
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
@property (nonatomic,strong)NSString *remark; @property (nonatomic,strong)NSString *remark;
@property (nonatomic,strong)NSString *specification; @property (nonatomic,strong)NSString *specification;
@property (nonatomic,strong)NSString *version; @property (nonatomic,strong)NSString *version;
@property (nonatomic,strong)NSString *purMeasureUnit;//默认采购单位
@end @end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "IBTModel.h" #import "IBTModel.h"
#import "PurchaseBillProduct.h"
@interface TransferPdtDetail : IBTModel @interface TransferPdtDetail : IBTModel
@property (nonatomic,strong)NSString *uuid; //唯一标识 @property (nonatomic,strong)NSString *uuid; //唯一标识
@property (nonatomic,strong)NSString *productUuid; //商品id @property (nonatomic,strong)NSString *productUuid; //商品id
...@@ -37,4 +37,25 @@ ...@@ -37,4 +37,25 @@
@property (nonatomic,strong)NSString *carnumber; //车牌号 @property (nonatomic,strong)NSString *carnumber; //车牌号
//采购单商品对象
//@property (nonatomic,strong)NSString *uuid;//唯一标识
//@property (nonatomic,strong)NSString *product_uuid;//商品uuid
//@property (nonatomic,strong)NSString *product_code;//商品代码
//@property (nonatomic,strong)NSString *product_name;//商品名称
//@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 *basePrice;//基础单价
//@property (nonatomic,strong)NSString *baseUnit;//规格单位
//@property (nonatomic,strong)NSNumber *total;// 金额
@property (nonatomic,strong)NSString *remark;//备注
@property (nonatomic,strong)NSNumber *shippedFlag;//发运标志,0 未发运,1已发运
@property (nonatomic,strong)NSNumber *shippedQty;//发运包装数量
@property (nonatomic,strong)NSNumber *shippedBaseQty;//发运基础数量
@property (strong, nonatomic) PurchaseBillProduct *purchasePdt;
- (PurchaseBillProduct *)changeToPurchasePdt;
@end @end
...@@ -10,4 +10,23 @@ ...@@ -10,4 +10,23 @@
@implementation TransferPdtDetail @implementation TransferPdtDetail
- (void)setPurchasePdt:(PurchaseBillProduct *)purchasePdt {
_purchasePdt = purchasePdt;
self.productUuid = purchasePdt.product_uuid;
self.productCode = purchasePdt.product_code;
self.productName = purchasePdt.product_name;
self.price = purchasePdt.basePrice;
self.packprice = purchasePdt.price;
}
- (PurchaseBillProduct *)changeToPurchasePdt {
if (!self.purchasePdt) {
self.purchasePdt = [PurchaseBillProduct new];
NSDictionary *dict = [self dictForCommit];
[self.purchasePdt setValuesForKeysWithDictionary:dict];
}
self.purchasePdt.receivedQty = self.rctQty;
self.purchasePdt.receivedBaseQty = self.rctBaseQty;
return self.purchasePdt;
}
@end @end
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