Commit ebaef158 authored by 陈俊俊's avatar 陈俊俊

采购单细节

parent 0702ff8d
......@@ -75,7 +75,6 @@
35C3C0BC1AE959B80035AC8A /* ICRNavigationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 35C3C0BB1AE959B80035AC8A /* ICRNavigationViewController.xib */; };
35C3C0BF1AE95F1D0035AC8A /* UIImage+Rotate.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C3C0BE1AE95F1D0035AC8A /* UIImage+Rotate.m */; };
35CF33781B953F07001211EF /* GXFProcessBill.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF33771B953F07001211EF /* GXFProcessBill.m */; };
35CF337B1B953F9A001211EF /* GXFProcessMaterial.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF337A1B953F9A001211EF /* GXFProcessMaterial.m */; };
35CF337E1B953FFF001211EF /* GXFProcessProduct.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF337D1B953FFF001211EF /* GXFProcessProduct.m */; };
35CF33811B9542BE001211EF /* GXFNewProcessViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF33801B9542BE001211EF /* GXFNewProcessViewController.m */; };
35CF33841B954F35001211EF /* GXFTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF33831B954F35001211EF /* GXFTableViewCell.m */; };
......@@ -544,8 +543,6 @@
35C3C0BE1AE95F1D0035AC8A /* UIImage+Rotate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Rotate.m"; sourceTree = "<group>"; };
35CF33761B953F07001211EF /* GXFProcessBill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GXFProcessBill.h; path = ../Views/GXFProcessBill.h; sourceTree = "<group>"; };
35CF33771B953F07001211EF /* GXFProcessBill.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GXFProcessBill.m; path = ../Views/GXFProcessBill.m; sourceTree = "<group>"; };
35CF33791B953F9A001211EF /* GXFProcessMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GXFProcessMaterial.h; path = ../Views/GXFProcessMaterial.h; sourceTree = "<group>"; };
35CF337A1B953F9A001211EF /* GXFProcessMaterial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GXFProcessMaterial.m; path = ../Views/GXFProcessMaterial.m; sourceTree = "<group>"; };
35CF337C1B953FFF001211EF /* GXFProcessProduct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GXFProcessProduct.h; path = ../Views/GXFProcessProduct.h; sourceTree = "<group>"; };
35CF337D1B953FFF001211EF /* GXFProcessProduct.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GXFProcessProduct.m; path = ../Views/GXFProcessProduct.m; sourceTree = "<group>"; };
35CF337F1B9542BE001211EF /* GXFNewProcessViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFNewProcessViewController.h; sourceTree = "<group>"; };
......@@ -1146,8 +1143,6 @@
children = (
35CF33761B953F07001211EF /* GXFProcessBill.h */,
35CF33771B953F07001211EF /* GXFProcessBill.m */,
35CF33791B953F9A001211EF /* GXFProcessMaterial.h */,
35CF337A1B953F9A001211EF /* GXFProcessMaterial.m */,
35CF337C1B953FFF001211EF /* GXFProcessProduct.h */,
35CF337D1B953FFF001211EF /* GXFProcessProduct.m */,
);
......@@ -2518,7 +2513,6 @@
7217E9E91B72364300FE5C1D /* SurveyResult.m in Sources */,
C10214DB1AD90A3F0024637E /* ICRFunctionBaseView.m in Sources */,
35B448DF1B9B0A73001209E2 /* ProductBillCell.m in Sources */,
35CF337B1B953F9A001211EF /* GXFProcessMaterial.m in Sources */,
30D7495F1ACE8F4400C63BA1 /* ICRConfigurationViewController.m in Sources */,
724171721B9D30660094DF55 /* ChooseWarehouseViewController.m in Sources */,
FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */,
......@@ -3042,7 +3036,6 @@
"$(PROJECT_DIR)",
);
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
......@@ -3064,7 +3057,6 @@
"$(PROJECT_DIR)",
);
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
......
......@@ -149,28 +149,39 @@ typedef enum : NSUInteger {
_purchaseView.total = [NSNumber numberWithFloat:totalPrice+otherPrice];
}
- (void)addPurchaseProduct:(NSNotification *)fication{
PurchaseBillProduct *billProduct = [[fication userInfo] objectForKey:@"purchaseBillProduct"];
NSInteger indexTag = [[[fication userInfo] objectForKey:@"indexTag"] integerValue];
ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init];
if (billProduct) {
ShopDetail *shopDetail=[self coverShopDetail:billProduct];
shopDetail.IsXiuGai=YES;
svc.choseShopDetail = ^(ShopDetail *Detail){
if (Detail.IsDeleted) {
[_pvc.productArr removeObjectAtIndex:indexTag];
}else{
PurchaseBillProduct *billProduct = [self coverPurchaseProduct:Detail];
[_pvc.productArr replaceObjectAtIndex:indexTag withObject:billProduct];
}
[_pvc.tableView reloadData];
[[NSNotificationCenter defaultCenter] postNotificationName:SetProductTotalPrice object:nil];
};
svc.shopDetail=shopDetail;
}else{
// 回调
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";
PurchaseBillProduct *billProduct = [self coverPurchaseProduct:shopDetail];
[_pvc.productArr addObject:billProduct];
[_pvc.tableView reloadData];
[[NSNotificationCenter defaultCenter] postNotificationName:SetProductTotalPrice object:nil];
};
}
svc.title = [IBTCommon localizableString:@"AddShopDetail"];
[self PushViewController:svc animated:YES];
}
- (void)btnClick:(UIButton *)btn{
switch (btn.tag) {
case SaveTag:
......@@ -289,6 +300,40 @@ typedef enum : NSUInteger {
- (void)pushNextViewController:(id)vc{
[self PushViewController:vc animated:YES];
}
//两个类之间的转换
- (PurchaseBillProduct *)coverPurchaseProduct:(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";
return billProduct;
}
- (ShopDetail *)coverShopDetail:(PurchaseBillProduct *)billProduct{
ShopDetail *shopDetail = [[ShopDetail alloc]init];
shopDetail.uuid = billProduct.uuid;
shopDetail.product_uuid = billProduct.product_uuid;
shopDetail.product_code = billProduct.product_code;
shopDetail.merchandise = billProduct.product_name;
shopDetail.packageSpecification = [billProduct.qpc stringValue];
shopDetail.packageUnit = billProduct.unit;
shopDetail.packageQuantity = [billProduct.qty stringValue];
shopDetail.packageUnitPrice = [billProduct.price stringValue];
shopDetail.foundationQuantity= [billProduct.baseQty stringValue];
shopDetail.foundationUnitPrice= [billProduct.basePrice stringValue];
shopDetail.totalMoney= [billProduct.total stringValue];
shopDetail.remark = billProduct.remark;
return shopDetail;
}
#pragma mark - 协议方法
......
......@@ -35,21 +35,21 @@
if (!self.productArr) {
self.productArr = [NSMutableArray array];
}
PurchaseBillProduct *billProduct = [PurchaseBillProduct new];
billProduct.product_name = @"dd";
billProduct.product_uuid = @"402880e64e287fe2014e28895b8a0032";
billProduct.product_code = @"农夫山泉";
billProduct.qpc = [NSNumber numberWithFloat:22];
billProduct.unit = @"筐";
billProduct.qty = [NSNumber numberWithFloat:23];
billProduct.price = [NSNumber numberWithFloat:333];
billProduct.baseQty = [NSNumber numberWithFloat:333];
billProduct.basePrice = [NSNumber numberWithFloat:33];
billProduct.total = [NSNumber numberWithFloat:80];
billProduct.remark = @"hshshshsh";
billProduct.qpcStr = @"fdsfdsfdsa";
[self.productArr addObject:billProduct];
// PurchaseBillProduct *billProduct = [PurchaseBillProduct new];
//
// billProduct.product_name = @"dd";
// billProduct.product_uuid = @"402880e64e287fe2014e28895b8a0032";
// billProduct.product_code = @"农夫山泉";
// billProduct.qpc = [NSNumber numberWithFloat:22];
// billProduct.unit = @"筐";
// billProduct.qty = [NSNumber numberWithFloat:23];
// billProduct.price = [NSNumber numberWithFloat:333];
// billProduct.baseQty = [NSNumber numberWithFloat:333];
// billProduct.basePrice = [NSNumber numberWithFloat:33];
// billProduct.total = [NSNumber numberWithFloat:80];
// billProduct.remark = @"hshshshsh";
// billProduct.qpcStr = @"fdsfdsfdsa";
// [self.productArr addObject:billProduct];
if (self.productArr.count > 0) {
[[NSNotificationCenter defaultCenter] postNotificationName:SetProductTotalPrice object:nil];
}
......@@ -85,7 +85,10 @@
- (void)choosePurchase{
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_ChoseTransportPurchase object:nil];
}
- (void)editClick:(UIButton *)btn{
PurchaseBillProduct *billProduct = self.productArr[btn.tag];
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_AddPurchaseProduct object:nil userInfo:@{@"purchaseBillProduct":billProduct,@"indexTag":@(btn.tag)}];
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
......@@ -171,10 +174,7 @@
return TableHeight;
}
- (void)editClick:(UIButton *)btn{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"" message:@"哈哈" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
......
......@@ -446,6 +446,7 @@ typedef enum : NSUInteger {
if ([bill.state isEqualToString:PURCHASE_STATE_INITIAL] || [bill.state isEqualToString:PURCHASE_STATE_REJECTED]) {
NewPurchaseViewController *nvc = [NewPurchaseViewController new];
nvc.purchaseBill = bill;
nvc.title = @"修改采购单";
[self PushViewController:nvc animated:YES];
}else{
PurchaseDetailViewController *pvc = [PurchaseDetailViewController new];
......
......@@ -9,6 +9,7 @@
#import "IBTModel.h"
@interface ShopDetail : IBTModel
@property (nonatomic,strong)NSString *uuid;//商品
@property (nonatomic,strong)NSString *merchandise;//商品
@property (nonatomic,strong)NSString *product_uuid;//商品
@property (nonatomic,strong)NSString *product_code;//商品
......
......@@ -131,6 +131,8 @@ typedef enum : NSUInteger {
packageUnitPrice.text=self.shopDetail.packageUnitPrice; //包装单价
totalMoney.text=self.shopDetail.totalMoney; //总金额
remark.text=self.shopDetail.remark;
self.productCodeStr = self.shopDetail.product_code;
self.productUuidStr = self.shopDetail.product_uuid;
_productLabel.textColor=GXF_CONTENT_COLOR;
_PackagingLable.textColor=GXF_CONTENT_COLOR;
}
......@@ -200,7 +202,9 @@ typedef enum : NSUInteger {
_PackagingLable.textColor=GXF_PLACEHOLDER_COLOR;
}
- (BOOL)informationComplete{
if (!self.shopDetail) {
self.shopDetail=[[ShopDetail alloc]init];
}
self.shopDetail.merchandise=merchandise.text;
self.shopDetail.packageSpecification=packageSpecification.text;
self.shopDetail.packageQuantity=packageQuantity.text;
......@@ -427,7 +431,7 @@ typedef enum : NSUInteger {
cvc.choseBaseInfo = ^(NSArray *products){
Product *product=products [0];
_productLabel.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code];
merchandise.text=[NSString stringWithFormat:@"%@[%@]",product.name,product.code];
merchandise.text=product.name;
_productLabel.textColor = GXF_CONTENT_COLOR;
self.productNameStr = product.name;
self.productUuidStr = product.uuid;
......
......@@ -55,7 +55,6 @@
- (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{}
......
......@@ -292,10 +292,38 @@ typedef enum : NSUInteger {
}
- (void)addPurchaseProduct:(NSNotification *)fication{
TransportPdtDetail *billProduct = [[fication userInfo] objectForKey:@"transportPdtDetail"];
NSInteger indexTag = [[[fication userInfo] objectForKey:@"indexTag"] integerValue];
ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init];
if (billProduct) {
ShopDetail *shopDetail=[self coverShopDetail:billProduct];
shopDetail.IsXiuGai=YES;
svc.choseShopDetail = ^(ShopDetail *Detail){
TransportPdtDetail *tdetail = [self coverTransportPdtDetail:Detail];
if (Detail.IsDeleted) {
[_bottomView refreshDelProduct:tdetail tag:indexTag];
}else{
[_bottomView refreshEditProduct:tdetail tag:indexTag];
}
};
svc.shopDetail=shopDetail;
}else{
// 回调
svc.choseShopDetail = ^(ShopDetail *shopDetail){
TransportPdtDetail *tdetail = [self coverTransportPdtDetail:shopDetail];
[_bottomView refreshProduct:tdetail];
};
}
svc.title = [IBTCommon localizableString:@"AddShopDetail"];
[self PushViewController:svc animated:YES];
}
- (TransportPdtDetail *)coverTransportPdtDetail:(ShopDetail *)shopDetail{
TransportPdtDetail *billProduct = [[TransportPdtDetail alloc]init];
billProduct.uuid = shopDetail.uuid;
billProduct.productUuid = shopDetail.product_uuid;
billProduct.productCode = shopDetail.product_code;
billProduct.productName = shopDetail.merchandise;
......@@ -307,12 +335,28 @@ typedef enum : NSUInteger {
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];
return billProduct;
}
- (ShopDetail *)coverShopDetail:(TransportPdtDetail *)billProduct{
ShopDetail *shopDetail = [[ShopDetail alloc]init];
shopDetail.uuid = billProduct.uuid;
shopDetail.product_uuid = billProduct.productUuid;
shopDetail.product_code = billProduct.productCode;
shopDetail.merchandise = billProduct.productName;
shopDetail.packageSpecification = [billProduct.qpc stringValue];
shopDetail.packageUnit = billProduct.unit;
shopDetail.packageQuantity = [billProduct.qty stringValue];
shopDetail.packageUnitPrice = [billProduct.price stringValue];
#warning 少一个包装单价
shopDetail.foundationQuantity= [billProduct.price stringValue];
shopDetail.foundationUnitPrice= [billProduct.baseQty stringValue];
shopDetail.totalMoney= [billProduct.total stringValue];
shopDetail.remark = billProduct.note;
return shopDetail;
}
#pragma mark - TopPurchaseViewDelegate
- (void)pushNextViewController:(id)vc{
......
......@@ -79,6 +79,11 @@
- (void)addClick{
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_AddPurchaseProduct object:nil];
}
- (void)editClick:(UIButton *)btn{
TransportPdtDetail *pdDetail = self.transportProductArr[btn.tag];
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_AddPurchaseProduct object:nil userInfo:@{@"transportPdtDetail":pdDetail,@"indexTag":@(btn.tag)}];
}
- (void)choosePurchase{
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_ChoseTransportPurchase object:nil];
}
......@@ -166,10 +171,6 @@
return TableHeight;
}
- (void)editClick:(UIButton *)btn{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"" message:@"哈哈" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
......
......@@ -25,11 +25,16 @@
//刷新费用
- (void)refreshCost:(NSArray *)costArr;
//刷新商品
- (void)refreshTranProduct:(NSArray *)tranProductArr;
#warning - 临时
- (void)reProduct:(NSArray *)tranProductArr;
//添加或者编辑
//删除商品
- (void)refreshDelProduct:(TransportPdtDetail *)fee tag:(NSInteger)indexTag;
//添加
- (void)refreshProduct:(TransportPdtDetail *)transportPdtDetail;
- (void)refreshEditProduct:(TransportPdtDetail *)transportPdtDetail tag:(NSInteger)indexTag;
@end
......@@ -173,5 +173,15 @@
[self.productVC.transportProductArr addObjectsFromArray:tranProductArr];
[self.productVC.tableView reloadData];
}
- (void)refreshDelProduct:(TransportPdtDetail *)fee tag:(NSInteger)indexTag{
if (fee) {
[self.productVC.transportProductArr removeObjectAtIndex:indexTag];
[self.productVC.tableView reloadData];
}
}
- (void)refreshEditProduct:(TransportPdtDetail *)transportPdtDetail tag:(NSInteger)indexTag{
[self.productVC.transportProductArr replaceObjectAtIndex:indexTag withObject:transportPdtDetail];
[self.productVC.tableView reloadData];
}
@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