Commit 39284cb2 authored by freecui's avatar freecui

加工单详情:已完成和已废弃

parent 1364a19c
......@@ -88,6 +88,7 @@
35CF339E1B96E606001211EF /* GXFWarehouseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF339D1B96E606001211EF /* GXFWarehouseViewController.m */; };
35D56A7D1B9D4E8300996C28 /* GXFProcessCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 35D56A7C1B9D4E8300996C28 /* GXFProcessCell.m */; };
35D56A801B9D533900996C28 /* GXFProcessBoltView.m in Sources */ = {isa = PBXBuildFile; fileRef = 35D56A7F1B9D533900996C28 /* GXFProcessBoltView.m */; };
35D56A831B9D5E7500996C28 /* GXFSeeProcessViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35D56A821B9D5E7500996C28 /* GXFSeeProcessViewController.m */; };
7217E9E51B72364300FE5C1D /* NewSurveyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7217E9C51B72364300FE5C1D /* NewSurveyViewController.m */; };
7217E9E61B72364300FE5C1D /* SurveyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7217E9C71B72364300FE5C1D /* SurveyViewController.m */; };
7217E9E71B72364300FE5C1D /* Attachment.m in Sources */ = {isa = PBXBuildFile; fileRef = 7217E9CA1B72364300FE5C1D /* Attachment.m */; };
......@@ -551,6 +552,8 @@
35D56A7C1B9D4E8300996C28 /* GXFProcessCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFProcessCell.m; sourceTree = "<group>"; };
35D56A7E1B9D533900996C28 /* GXFProcessBoltView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFProcessBoltView.h; sourceTree = "<group>"; };
35D56A7F1B9D533900996C28 /* GXFProcessBoltView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFProcessBoltView.m; sourceTree = "<group>"; };
35D56A811B9D5E7500996C28 /* GXFSeeProcessViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFSeeProcessViewController.h; sourceTree = "<group>"; };
35D56A821B9D5E7500996C28 /* GXFSeeProcessViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFSeeProcessViewController.m; sourceTree = "<group>"; };
7217E9C41B72364300FE5C1D /* NewSurveyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewSurveyViewController.h; sourceTree = "<group>"; };
7217E9C51B72364300FE5C1D /* NewSurveyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewSurveyViewController.m; sourceTree = "<group>"; };
7217E9C61B72364300FE5C1D /* SurveyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurveyViewController.h; sourceTree = "<group>"; };
......@@ -1078,6 +1081,8 @@
35CF33801B9542BE001211EF /* GXFNewProcessViewController.m */,
358432F21B994EDD007E73ED /* GXFListProcessViewController.h */,
358432F31B994EDD007E73ED /* GXFListProcessViewController.m */,
35D56A811B9D5E7500996C28 /* GXFSeeProcessViewController.h */,
35D56A821B9D5E7500996C28 /* GXFSeeProcessViewController.m */,
);
path = Controllers;
sourceTree = "<group>";
......@@ -2405,6 +2410,7 @@
FE4678AA1B8D60F900B5EDA3 /* ChooseTypeViewController.m in Sources */,
30DB92A61ADD039F00271835 /* ICRAnnocementContentView.m in Sources */,
C142D2B21AC3A155000109A7 /* UIFont+Custom.m in Sources */,
35D56A831B9D5E7500996C28 /* GXFSeeProcessViewController.m in Sources */,
C15295CE1B24741400DF60D1 /* ASValuePopUpView.m in Sources */,
C159184D1AC062460013B391 /* IBTTableView.m in Sources */,
30D1859C1ADBB91000327997 /* ICRAnnouncement.m in Sources */,
......
......@@ -10,7 +10,8 @@
#import "GXFProcessCell.h"
#import "GXFProcessBill.h"
//#import "SeePurchaseNoticeViewController.h"
#import "GXFSeeProcessViewController.h"
#import "GXFNewProcessViewController.h"
#import "QueryOrder.h"
#import "SortMaskView.h"
#import "GXFProcessBoltView.h"
......@@ -417,17 +418,21 @@ typedef enum : NSUInteger {
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
// SeePurchaseNoticeViewController *pvc = [SeePurchaseNoticeViewController new];
// pvc.title = @"查看采购单";
// pvc.bill = _dataArr[indexPath.row];
// if(indexPath.row == 0){
// pvc.indexPerson = 0;
// }else if(indexPath.row == 1){
// pvc.indexPerson = 1;
// }else if(indexPath.row == 2){
// pvc.indexPerson = 2;
// }
// [self PushViewController:pvc animated:YES];
// GXFProcessCell *cell = (GXFProcessCell *)[tableView cellForRowAtIndexPath:indexPath];
GXFProcessBill *bill = (GXFProcessBill *)self.dataArr[indexPath.row];
if([bill.state isEqualToString:PROCESS_STATE_PROCESSINF]){
} else {
GXFSeeProcessViewController *seeProcessVC = [[GXFSeeProcessViewController alloc]initWithProcessUuid:bill.uuid];
[self PushViewController:seeProcessVC animated:YES];
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
......
//
// GXFSeeProcessViewController.h
// XFFruit
//
// Created by freecui on 15/9/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFSeeProcessViewController : UIViewController
- (instancetype)initWithProcessUuid: (NSString *)processUuid;
@end
//
// GXFProcessViewController.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFSeeProcessViewController.h"
#import "GXFBottomView.h"
#import "GXFTableViewCell.h"
#import "GXFButtonAndLineView.h"
#import "GXFSearchVendorViewController.h"
#import "Vendor.h"
#import "Warehouse.h"
#import "GXFProcessBill.h"
#import "GXFProcessMaterial.h"
#import "GXFProcessProduct.h"
#import "GXFPopNewMaterialViewController.h"
#import "GXFPopNewProductViewController.h"
#import "GXFProcessMaterialTableViewCell.h"
#import "GXFProcessProductTableViewCell.h"
#import "ProductBillCell.h"
typedef NS_ENUM(NSUInteger, processType){
kMaterial = 0,
kProduct
};
typedef NS_ENUM(NSInteger, cellRow) {
kTitle = 0,
kVendor,
kContact,
kContactPhone,
kWarehouse,
kTotal,
kRemark,
};
@interface GXFSeeProcessViewController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,GXFBottomViewDelegate>
{
NSMutableArray *_selectRowArr;//记录当前选中的cell
}
@property (nonatomic, strong) UIScrollView *c_scrollView;
@property (nonatomic, strong) UITableView *c_tableView;
@property (nonatomic, strong) IBTSegmentContainer *c_segContainer;
@property (nonatomic, strong) IBTSegmentedControl *c_segmentControl;
@property (nonatomic, strong) GXFPopNewMaterialViewController *c_materialVC;
@property (nonatomic, strong) GXFButtonAndLineView *c_materialView;
@property (nonatomic, strong) GXFButtonAndLineView *c_productView;
@property (nonatomic, strong) NSArray *d_arrRightTableV;
@property (nonatomic, strong) NSArray *d_arrLeftTableV;
@property (nonatomic, strong) NSMutableArray *d_materialMuArr;
@property (nonatomic, strong) NSMutableArray *d_productMuArr;
@property (nonatomic, strong) GXFProcessBill *d_processBill;
@property (nonatomic, assign) BOOL d_isProduct;
@property (nonatomic, strong) NSArray *d_meteilHeaderArr;
@property (nonatomic, strong) NSArray *d_productHeaderArr;
@property (nonatomic, assign) NSInteger d_editOrDelete;
@property (nonatomic,assign)BOOL isHiddenEdit;
@property (nonatomic, copy) NSString *d_processUuid;
@end
@implementation GXFSeeProcessViewController
- (instancetype)initWithProcessUuid:(NSString *)processUuid {
self = [super init];
if (!self) {
return nil;
}
self.d_processUuid = processUuid;
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.title = @"查看加工单";
[self initData];
[self initSubViews];
}
- (void)viewWillAppear:(BOOL)animated {
}
//刷新数据
- (void)p_refreshData {
NSIndexSet *indexSet = [[NSIndexSet alloc]initWithIndex:1];
[self.c_tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];
}
- (void)initData {
self.d_arrLeftTableV =@[@"标题:",@"供应商:",@"联系人:",@"联系电话:",@"加工工厂:",@"总费用:",@"备注:"];
self.d_arrRightTableV = @[@"请输入标题",@"选择供应商",@"请输入联系人姓名",@"请输入联系电话",@"选择加工工厂",@"",@"请输入备注"];
self.d_meteilHeaderArr = @[@"原料",@"基础数量",@"入库时间"];
self.d_productHeaderArr = @[@"原料",@"基础数量",@"出库时间"];
if (!self.d_materialMuArr) {
self.d_materialMuArr = [NSMutableArray array];
}
if (!self.d_productMuArr) {
self.d_productMuArr = [NSMutableArray array];
}
_selectRowArr = [[NSMutableArray alloc]init];
// self.d_processBill = [[GXFProcessBill alloc]init];
__weak typeof(self)weakSelf = self;
void (^success)(id) = ^(id data){
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchDataWithData:data];
};
void (^fail)(id) = ^(id data){
[IBTLoadingView hideHUDWithText:nil];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getResultWithProcessUuid:_d_processUuid success:success failure:fail];
}
- (void)fetchDataWithData: (id)data {
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"];
if (success == 1) {
NSDictionary *dict = (NSDictionary *)data[@"data"];
self.d_processBill = [[GXFProcessBill alloc]initWithDict:dict];
NSArray *arrMaterials = dict[@"materials"];
if (arrMaterials.count > 0) {
for (int i = 0; i < arrMaterials.count; i++) {
GXFProcessMaterial *material = [[GXFProcessMaterial alloc]initWithDict:arrMaterials[i]];
[self.d_materialMuArr addObject:material];
}
}
NSArray *arrProducts = dict[@"products"];
if (arrProducts.count > 0) {
for (int i = 0; i < arrMaterials.count; i++) {
GXFProcessProduct *product = [[GXFProcessProduct alloc]initWithDict:arrProducts[i]];
[self.d_productMuArr addObject:product];
}
}
}
}
[self.c_tableView reloadData];
}
- (void)initSubViews {
self.view.backgroundColor = XXFBgColor;
self.c_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height - BottomViewHeight - NavigationBarHeight) style:UITableViewStyleGrouped];
self.c_tableView.dataSource = self;
self.c_tableView.delegate = self;
[self.view addSubview:_c_tableView];
[_c_tableView reloadData];
GXFBottomView *bottomV = [[GXFBottomView alloc]initOneButtonWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, BottomViewHeight) buttonColor:GXF_GREEN_COLOR buttonTitle:@"返回"];
bottomV.delegate = self;
[self.view addSubview:bottomV];
}
#pragma UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return _d_arrLeftTableV.count;
} else {
if (_d_isProduct) {
return 1 + _d_productMuArr.count;
}
return 1 + _d_materialMuArr.count;
}
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 1) {
if (indexPath.row >= 1) {
if ([self isHaveIndexPath:indexPath]) {
return 200;
} else {
return GXF_TABLEVIEW_NOMALCELL_HEIGHT;
}
} else {
return GXF_TABLEVIEW_NOMALCELL_HEIGHT;
}
} else {
return GXF_TABLEVIEW_NOMALCELL_HEIGHT;
}
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (section == 0) {
return nil;
} else {
UIView * headV = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, 44)];
headV.backgroundColor = [UIColor whiteColor];
GXFButtonAndLineView *materialView = [[GXFButtonAndLineView alloc]initViewLineAndButtonWithFrame:CGRectMake(0, 0, self.view.width * 0.5, headV.height ) isSeleted:!_d_isProduct buttonTitle: @"原料明细" selectColor:GXF_GREEN_COLOR]; [materialView.f_btn addTarget:self action:@selector(selecNewMaterial) forControlEvents:UIControlEventTouchUpInside];
self.c_materialView = materialView;
GXFButtonAndLineView *productView = [[GXFButtonAndLineView alloc]initViewLineAndButtonWithFrame:CGRectMake(self.view.width * 0.5, 0, materialView.width, materialView.height) isSeleted:_d_isProduct buttonTitle: @"成品明细" selectColor:GXF_GREEN_COLOR];
[productView.f_btn addTarget:self action:@selector(selecNewMaterial) forControlEvents:UIControlEventTouchUpInside];
self.c_productView= productView;
[headV addSubview:_c_materialView];
[headV addSubview:_c_productView];
[headV addSubview:productView];
return headV;
}
}
- (UIView *)viewLineAndButtonWithFrame: (CGRect)frame
isSeleted: (BOOL)isSelected
buttonTitle: (NSString *)title
selectColor: (UIColor *)color
// target: (id)target
action:(SEL)action
forControlEvents:(UIControlEvents)controlEvents
{
UIView *view = [[UIView alloc]initWithFrame:frame];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, 0, view.width, view.height - 1);
[btn setTitle:title forState:UIControlStateNormal];
[btn addTarget:self action:action forControlEvents:controlEvents];
CGSize labelSize = [btn.titleLabel.text sizeWithAttributes:@{NSFontAttributeName: btn.titleLabel.font}];
UIView *line = [[UIView alloc]initWithFrame:CGRectMake((view.width - labelSize.width ) * 0.5, btn.bottom, labelSize.width, 1)];
if (isSelected) {
[btn setTitleColor:GXF_GREEN_COLOR forState:UIControlStateNormal];
line.backgroundColor = GXF_GREEN_COLOR;
} else {
[btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
line.backgroundColor = [UIColor whiteColor];
}
[view addSubview:line];
[view addSubview:btn];
return view;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if (section == 0) {
return 0.1;
} else {
return 44;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
GXFTableViewCell *xfCell ;
if (indexPath.section == 0) {
if (indexPath.row <= kWarehouse ||indexPath.row == kRemark) {
xfCell = [tableView dequeueReusableCellWithIdentifier:noLblCell];
if (!xfCell ) {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:noLblCell textFieldPlaceholder:_d_arrRightTableV[indexPath.row] isEdit:YES];
}
switch (indexPath.row) {
case kTitle:
xfCell.f_textField.text = _d_processBill.title;
break;
case kContact:
xfCell.f_textField.text = _d_processBill.contact;
break;
case kContactPhone:
xfCell.f_textField.text = _d_processBill.contactPhone;
break;
case kVendor:
xfCell.f_textField.text = _d_processBill.vendor_name;
break;
case kWarehouse:
xfCell.f_textField.text = [NSString stringWithFormat:@"%@[%@]",_d_processBill.warehouse_name,_d_processBill.warehouse_uuid];// _d_processBill.warehouse_name;
break;
case kRemark:
xfCell.f_textField.text = _d_processBill.remark;
break;
default:
break;
}
} else if (indexPath.row == kTotal ){
xfCell = [tableView dequeueReusableCellWithIdentifier:lblCell];
if (!xfCell ) {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:lblCell textFieldPlaceholder:_d_arrRightTableV[indexPath.row] hasLable:YES backLableText:@"元"];
}
xfCell.f_textField.text = [NSString stringWithFormat:@"%@",_d_processBill.total] ;
} else {
xfCell = [tableView dequeueReusableCellWithIdentifier:noLblCell];
if (!xfCell ) {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:noLblCell textFieldPlaceholder:_d_arrRightTableV[indexPath.row] isEdit:YES];
}
}
xfCell.f_textField.tag = indexPath.row;
xfCell.textLabel.text = _d_arrLeftTableV[indexPath.row];
xfCell.textLabel.textColor = [UIColor blackColor];
xfCell.selectionStyle = UITableViewCellAccessoryNone;
return xfCell;
} else {
if ( indexPath.row == 0){
xfCell = [tableView dequeueReusableCellWithIdentifier:addHeaderCell];
if (!xfCell) {
NSArray *arr = [NSArray arrayWithArray: _d_isProduct ? _d_productHeaderArr :_d_meteilHeaderArr] ;
if (arr) {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:addHeaderCell contentArray:arr];
} else {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:addHeaderCell];
}
}
xfCell.f_textField.enabled = NO;
xfCell.selectionStyle = UITableViewCellAccessoryNone;
return xfCell;
}else {
static NSString *cellIDProduct = @"ProductCell";
static NSString *cellIDMaterial = @"materialCell";
if(_d_isProduct){
//GXFProcessProductTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIDProduct];
//if (cell == nil) {
GXFProcessProduct *processP = (GXFProcessProduct *)_d_productMuArr[indexPath.row - 1];
GXFProcessProductTableViewCell *cell = [[GXFProcessProductTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIDProduct processProduct:processP];
// } else {
// while (cell.contentView.subviews.lastObject != nil) {
// [(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
// }
// }
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 = 200-1;
cell.lineLabel.frame = Linefrmame;
CGRect showfrmame = cell.showView.frame;
showfrmame.size.height = 150;
cell.showView.frame = showfrmame;
cell.backgroundColor = XXFBgColor;
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
CGRect Linefrmame = cell.lineLabel.frame;
Linefrmame.origin.y = GXF_TABLEVIEW_NOMALCELL_HEIGHT-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];
return cell;
} else {
// GXFProcessMaterialTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIDProduct];
//if (cell == nil) {
GXFProcessMaterial *processM = (GXFProcessMaterial *)_d_materialMuArr[indexPath.row - 1];
GXFProcessMaterialTableViewCell * cell = [[ GXFProcessMaterialTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIDMaterial processMaterial:processM];
// }
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 = 200-1;
cell.lineLabel.frame = Linefrmame;
CGRect showfrmame = cell.showView.frame;
showfrmame.size.height = 150;
cell.showView.frame = showfrmame;
cell.backgroundColor = XXFBgColor;
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
CGRect Linefrmame = cell.lineLabel.frame;
Linefrmame.origin.y = GXF_TABLEVIEW_NOMALCELL_HEIGHT-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];
return cell;
}
}
}
}
#pragma UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// if (indexPath.section == 0) {
// GXFTableViewCell *xfCell = (GXFTableViewCell *)[_c_tableView cellForRowAtIndexPath:indexPath];
// switch (indexPath.row) {
// case kVendor:
// {
// GXFSearchVendorViewController *vc = [[GXFSearchVendorViewController alloc]initWithTitle:[IBTCommon localizableString:@"VendorTitle"]];
// vc.choseVendor = ^(NSArray *vendors){
// if (vendors.count > 0) {
// Vendor *vendor = vendors[0];
// xfCell.f_textField.text = [NSString stringWithFormat:@"%@[%@]",vendor.name,vendor.code];
// _d_processBill.vendor_uuid = vendor.uuid;
// _d_processBill.vendor_code = vendor.code;
// _d_processBill.vendor_name = vendor.name;
// }
// };
// [self PushViewController:vc animated:YES];
// }
// break;
// case kWarehouse:
// {
// GXFSearchVendorViewController *vc = [[GXFSearchVendorViewController alloc]initWithTitle:[IBTCommon localizableString:@"WarehouseTitle"]];
// vc.choseVendor = ^(NSArray *vendors){
// if (vendors.count > 0) {
// Warehouse *warehouse = vendors[0];
// xfCell.f_textField.text = [NSString stringWithFormat:@"%@[%@]",warehouse.name,warehouse.code];
// _d_processBill.warehouse_uuid = warehouse.uuid;
// _d_processBill.warehouse_code = warehouse.code;
// _d_processBill.warehouse_name = warehouse.name;
// }
// };
// [self PushViewController:vc animated:YES];
// }
//
// break;
//
// default:
// break;
// }
//
// } else {
if (indexPath.section == 1) {
ProductBillCell *cell = (ProductBillCell *)[tableView cellForRowAtIndexPath:indexPath];
// ProductCell *cell = (ProductCell *)[tableView cellForRowAtIndexPath:indexPath];
CGRect Linefrmame = cell.lineLabel.frame;
CGRect showfrmame = cell.showView.frame;
if (Linefrmame.origin.y == GXF_TABLEVIEW_NOMALCELL_HEIGHT - 1) {
cell.smallImageView.image = [UIImage imageNamed:@"arrowdown"];
Linefrmame.origin.y = 200-1;
showfrmame.size.height = 150;
cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr addObject:indexPath];
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
Linefrmame.origin.y = GXF_TABLEVIEW_NOMALCELL_HEIGHT -1;
showfrmame.size.height = 0;
cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr removeObject:indexPath];
}
cell.lineLabel.frame = Linefrmame;
cell.showView.frame = showfrmame;
[self p_refreshData];
// NSIndexSet *indexSet = [[NSIndexSet alloc]initWithIndex:1];
// [self.c_tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];
}
}
- (BOOL)isHaveIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in _selectRowArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
//#pragma buttonAction
//- (void)addNewInfoDetailed {
//
// if (_d_isProduct) {
// GXFPopNewProductViewController *productVC = [[GXFPopNewProductViewController alloc]init];
// [self PushViewController:productVC animated:NO];
// } else {
// GXFPopNewMaterialViewController *materialVC = [[GXFPopNewMaterialViewController alloc]init];
// [self PushViewController:materialVC animated:YES];
// }
//
//}
//- (void)editClick: (UIButton *)btn{
// if (_d_isProduct) {
// self.d_editOrDelete = btn.tag - 2;
// GXFProcessProduct *product = _d_productMuArr[btn.tag - 2];
// GXFPopNewProductViewController *productVC = [[GXFPopNewProductViewController alloc]initWithProcessProduct:product isEdit: YES];
// [self PushViewController:productVC animated:NO];
// } else {
// self.d_editOrDelete = btn.tag - 2;
// GXFProcessMaterial *material = _d_materialMuArr[btn.tag - 2];
// GXFPopNewMaterialViewController *materialVC = [[GXFPopNewMaterialViewController alloc]initWithProcessMaterial:material isEdit:YES];
// [self PushViewController:materialVC animated:NO];
// }
//}
- (void)selecNewMaterial {
self.d_isProduct = !_d_isProduct;
if (!_d_isProduct) {
[self.c_materialView.f_btn setTitleColor:GXF_GREEN_COLOR forState:UIControlStateNormal];
self.c_materialView.f_line.backgroundColor = GXF_GREEN_COLOR;
[self.c_productView.f_btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
self.c_productView.f_line.backgroundColor = [UIColor whiteColor];
} else {
[self.c_materialView.f_btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
self.c_materialView.f_line.backgroundColor = [UIColor whiteColor];
[self.c_productView.f_btn setTitleColor:GXF_GREEN_COLOR forState:UIControlStateNormal];
self.c_productView.f_line.backgroundColor = GXF_GREEN_COLOR;
}
[self p_refreshData];
// NSIndexSet *indexSet = [[NSIndexSet alloc]initWithIndex:1];
// [self.c_tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];
}
#pragma GXFBottomViewDelegate
- (void)bottomViewOneButtonClicked:(UIButton *)oneBtn {
[self PopViewControllerAnimated:YES];
}
/*
kTitle = 0, 不为空
kVendor, 不为空
kContact,
kContactPhone,
kWarehouse, 不为空
kTotal,
kRemark,
*/
//- (BOOL)textFieldShouldReturn:(UITextField *)textField {
// switch (textField.tag) {
// case kTitle:
// self.d_processBill.title = textField.text;
// break;
// case kVendor:
// // self.d_processBill.title = textField.text;
// break;
// case kContact:
// self.d_processBill.contact = textField.text;
// break;
// case kContactPhone:
// self.d_processBill.contactPhone = textField.text;
// break;
// case kTotal:
// self.d_processBill.total = @([textField.text floatValue]);
// break;
// case kRemark:
// self.d_processBill.remark = textField.text;
// break;
// default:
// break;
// }
// [textField resignFirstResponder];
//
// return YES;
//}
//- (void)textFieldDidEndEditing:(UITextField *)textField {
// [self textFieldShouldReturn:textField];
//
//}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
......@@ -13,6 +13,7 @@
- (void)bottomViewleftButtonClicked: (UIButton *)leftBtn;
- (void)bottomViewRightButtonClicked: (UIButton *)rightBtn;
- (void)bottomViewOneButtonClicked: (UIButton *)oneBtn;
@end
@interface GXFBottomView : IBTUIView
......@@ -24,6 +25,7 @@ typedef NS_ENUM(NSInteger, buttonTag){
@property (nonatomic, weak) id<GXFBottomViewDelegate>delegate;
@property (nonatomic, strong) UIButton *f_leftBtn;
@property (nonatomic, strong) UIButton *f_rightBtn;
@property (nonatomic, strong) UIButton *f_oneBtn;
- (instancetype)initWithFrame:(CGRect)frame
LeftBtnTitle: (NSString *)leftTitle
rightBtnTitle: (NSString *)rightTitle;
......@@ -33,4 +35,8 @@ typedef NS_ENUM(NSInteger, buttonTag){
rightButtonColor: (UIColor *)rightBtnColor
LeftBtnTitle: (NSString *)leftTitle
rightBtnTitle: (NSString *)rightTitle;
- (instancetype)initOneButtonWithFrame:(CGRect)frame
buttonColor: (UIColor *)btnColor
buttonTitle: (NSString *)title;
@end
......@@ -74,4 +74,22 @@
}
}
- (instancetype)initOneButtonWithFrame:(CGRect)frame buttonColor:(UIColor *)btnColor buttonTitle:(NSString *)title {
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
CGRect rect = CGRectMake(LEFT_PADDING, TOP_PADDING, frame.size.width - 2 * LEFT_PADDING, BUTTON_HEIGHT);
UIButton *btn = [IBTCustomButtom creatButtonWithFrame:rect target:self sel:@selector(oneBtnClicked) tag:0 image:nil title:title titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:btnColor];
self.f_oneBtn = btn;
[self addSubview:_f_oneBtn];
return self;
}
- (void)oneBtnClicked {
if ([_delegate respondsToSelector:@selector(bottomViewOneButtonClicked:)]) {
[_delegate bottomViewOneButtonClicked:_f_oneBtn];
}
}
@end
......@@ -37,5 +37,5 @@
//@property (nonatomic,copy)NSString *materials;原料明细
//@property (nonatomic,copy)NSString *procucts;商品明细
- (instancetype )initWithDict: (NSDictionary *)dict;
@end
......@@ -9,5 +9,36 @@
#import "GXFProcessBill.h"
@implementation GXFProcessBill
- (instancetype)initWithDict:(NSDictionary *)dict {
self = [super init];
if (!self) {
self = nil;
}
self.uuid = dict[@"uuid"];
self.version = dict[@"version"];
self.billNumber = dict[@"billNumber"];
self.state = dict[@"state"];
self.title = dict[@"title"];
self.beginDate = dict[@"beginDate"];
self.endDate = dict[@"endDate"];
self.vendor_uuid = dict[@"vendor_uuid"];
self.vendor_code = dict[@"vendor_code"];
self.vendor_name = dict[@"vendor_name"];
self.warehouse_uuid = dict[@"warehouse_uuid"];
self.warehouse_code = dict[@"warehouse_code"];
self.warehouse_name = dict[@"warehouse_name"];
self.contact = dict[@"contact"];
self.contactPhone = dict[@"contactPhone"];
self.total = dict[@"total"];
self.remark = dict[@"remark"];
self.create_time = dict[@"create_time"];
self.create_id = dict[@"create_id"];
self.create_operName = dict[@"create_operName"];
self.lastModified_time = dict[@"lastModified_time"];
self.lastModified_id = dict[@"lastModified_id"];
self.lastModified_operName = dict[@"lastModified_operName"];
return self;
}
@end
......@@ -20,4 +20,5 @@
@property (nonatomic,strong) NSNumber *basePrice;//基础单价
@property (nonatomic,strong) NSNumber *total;//金额
@property (nonatomic,copy) NSString *remark;//备注
- (instancetype )initWithDict: (NSDictionary *)dict;
@end
......@@ -10,5 +10,24 @@
#import "GXFProcessMaterial.h"
@implementation GXFProcessMaterial
- (instancetype)initWithDict:(NSDictionary *)dict {
self = [super init];
if (!self) {
return nil;
}
self.uuid = dict[@"uuid"];
self.productUuid = dict[@"productUuid"];
self.productCode = dict[@"productCode"];
self.productName = dict[@"productName"];
self.instockDate = dict[@"instockDate"];
self.place = dict[@"place"];
self.quality = dict[@"quality"];
self.baseQty = dict[@"baseQty"];
self.basePrice = dict[@"basePrice"];
self.total = dict[@"total"];
self.remark = dict[@"remark"];
return self;
}
@end
......@@ -21,4 +21,6 @@
@property (nonatomic,strong) NSNumber *baseQty;//基础数量
@property (nonatomic,copy) NSString *remark;//备注
- (instancetype )initWithDict: (NSDictionary *)dict;
@end
......@@ -10,4 +10,23 @@
@implementation GXFProcessProduct
- (instancetype)initWithDict:(NSDictionary *)dict {
self = [super init];
if (!self) {
return nil;
}
self.uuid = dict[@"uuid"];
self.productUuid = dict[@"productUuid"];
self.productCode = dict[@"productCode"];
self.productName = dict[@"productName"];
self.outstockDate = dict[@"outstockDate"];
self.unit = dict[@"unit"];
self.qpc = dict[@"qpc"];
self.qpcStr = dict[@"qpcStr"];
self.quantity = dict[@"quantity"];
self.baseQty = dict[@"baseQty"];
self.remark = dict[@"remark"];
return self;
}
@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