Commit d2673e07 authored by zhu's avatar zhu

Merge branch 'DEV_20150805_001' of http://121.42.32.57/root/xffruit into DEV_20150805_001

parents d0a4b325 3cc25fac
......@@ -120,6 +120,8 @@
7281A0BF1B8980E60052B1AC /* PurchaseBill.m in Sources */ = {isa = PBXBuildFile; fileRef = 7281A0BE1B8980E60052B1AC /* PurchaseBill.m */; };
7281A0C21B898A040052B1AC /* PurchaseDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7281A0C11B898A040052B1AC /* PurchaseDetailViewController.m */; };
7281A0C81B89BFE60052B1AC /* Vendor.m in Sources */ = {isa = PBXBuildFile; fileRef = 7281A0C71B89BFE60052B1AC /* Vendor.m */; };
72873CEB1BA27BA6007B3387 /* GXFPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 72873CEA1BA27BA6007B3387 /* GXFPopView.m */; };
72873CEE1BA280DD007B3387 /* GXFPopCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 72873CED1BA280DD007B3387 /* GXFPopCell.m */; };
72B3C0C11B9D3C7300025D81 /* CostViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B3C0AC1B9D3C7300025D81 /* CostViewController.m */; };
72B3C0C21B9D3C7300025D81 /* NewCostViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B3C0AE1B9D3C7300025D81 /* NewCostViewController.m */; };
72B3C0C31B9D3C7300025D81 /* NewTransportViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72B3C0B01B9D3C7300025D81 /* NewTransportViewController.m */; };
......@@ -632,6 +634,10 @@
7281A0C11B898A040052B1AC /* PurchaseDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurchaseDetailViewController.m; sourceTree = "<group>"; };
7281A0C61B89BFE60052B1AC /* Vendor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vendor.h; sourceTree = "<group>"; };
7281A0C71B89BFE60052B1AC /* Vendor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Vendor.m; sourceTree = "<group>"; };
72873CE91BA27BA6007B3387 /* GXFPopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFPopView.h; sourceTree = "<group>"; };
72873CEA1BA27BA6007B3387 /* GXFPopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFPopView.m; sourceTree = "<group>"; };
72873CEC1BA280DD007B3387 /* GXFPopCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFPopCell.h; sourceTree = "<group>"; };
72873CED1BA280DD007B3387 /* GXFPopCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFPopCell.m; sourceTree = "<group>"; };
72B3C0AB1B9D3C7300025D81 /* CostViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CostViewController.h; sourceTree = "<group>"; };
72B3C0AC1B9D3C7300025D81 /* CostViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CostViewController.m; sourceTree = "<group>"; };
72B3C0AD1B9D3C7300025D81 /* NewCostViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewCostViewController.h; sourceTree = "<group>"; };
......@@ -1311,6 +1317,10 @@
7241716E1B9D30660094DF55 /* ChosePersonViewController.m */,
724171741B9D30DE0094DF55 /* ChooseCostViewController.h */,
724171751B9D30DE0094DF55 /* ChooseCostViewController.m */,
72873CE91BA27BA6007B3387 /* GXFPopView.h */,
72873CEA1BA27BA6007B3387 /* GXFPopView.m */,
72873CEC1BA280DD007B3387 /* GXFPopCell.h */,
72873CED1BA280DD007B3387 /* GXFPopCell.m */,
);
path = ChooseViewController;
sourceTree = "<group>";
......@@ -2517,6 +2527,7 @@
04B4A3871B9CAAD700D88D68 /* ShopDetail.m in Sources */,
7217E9E91B72364300FE5C1D /* SurveyResult.m in Sources */,
C10214DB1AD90A3F0024637E /* ICRFunctionBaseView.m in Sources */,
72873CEE1BA280DD007B3387 /* GXFPopCell.m in Sources */,
35B448DF1B9B0A73001209E2 /* ProductBillCell.m in Sources */,
30D7495F1ACE8F4400C63BA1 /* ICRConfigurationViewController.m in Sources */,
724171721B9D30660094DF55 /* ChooseWarehouseViewController.m in Sources */,
......@@ -2595,6 +2606,7 @@
C1C564431AD66C6E006A1050 /* ICRTaskEditViewController.m in Sources */,
C142D2AA1AC3A155000109A7 /* NSDate+FormatterAdditions.m in Sources */,
C1B307A31ADD199600657F11 /* ICRTaskResultContentView.m in Sources */,
72873CEB1BA27BA6007B3387 /* GXFPopView.m in Sources */,
30DB9F971AD7DEC00085FA5C /* IBTUISearchBar.m in Sources */,
7217E9E61B72364300FE5C1D /* SurveyViewController.m in Sources */,
C10214E41AD9141E0024637E /* ICRAnnouncementViewController.m in Sources */,
......@@ -3042,7 +3054,7 @@
"$(PROJECT_DIR)",
);
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Debug;
......@@ -3063,7 +3075,7 @@
"$(PROJECT_DIR)",
);
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Release;
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "add.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "add@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -103,7 +103,7 @@
#define GXF_LINE_COLOR HexColor(@"e5e5e5")
#define GXF_DETAIL_COLOR HexColor(@"888888")
#define GXF_LEFTSIX_COLOR HexColor(@"666666")
#define GXF_PopView_COLOR RGBA(24,164,219,1)
#define GXF_THREETEENTH_SIZE FontSize(13)
#define GXF_FOURTEENTH_SIZE FontSize(14)
......@@ -133,8 +133,8 @@
#define PURCHASE_STATE_INITIAL @"initial" //未提交
#define PURCHASE_STATE_SUBMITTED @"submitted"//已提交 未审批
#define PURCHASE_STATE_REJECTED @"rejected" //已拒绝
#define PURCHASE_STATE_APPROVED @"approved" //已审批 发运中
#define PURCHASE_STATE_SHIPPING @"shipping" //发运中
//#define PURCHASE_STATE_APPROVED @"approved" //已审批 发运中
#define PURCHASE_STATE_SHIPPING @"shipping" //已审批 发运中
#define PURCHASE_STATE_FINISHED @"finished" //已完成
#define PURCHASE_STATE_ABORTED @"aborted" //已作废
......
......@@ -27,7 +27,6 @@
#import "TransportViewController.h"
#import"PurchaseNoticeViewController.h"
#import "GXFFunctionDB.h"
#import "GXFNewProcessViewController.h"
#import "GXFListProcessViewController.h"
......
//
// GXFPopCell.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/11.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFPopCell : UITableViewCell
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIImageView *addImageView;
@property (nonatomic,strong)UILabel *lineLabel;
- (void)setTitleStr:(NSString *)title;
@end
//
// GXFPopCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/11.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFPopCell.h"
#define GXFPopCell_Width ScreenSize.width - 20*2
@implementation GXFPopCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayout];
}
return self;
}
- (void)bulidLayout
{
self.addImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 15, 15, 15)];
self.addImageView.image = [UIImage imageNamed:@"add"];
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.addImageView.frame)+ 10, 0, 100, 44))];
self.titleLabel.textAlignment= NSTextAlignmentLeft;
self.titleLabel.textColor = GXF_PLACEHOLDER_COLOR;
self.titleLabel.font = GXF_FIFTEENTEN_SIZE;
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(0, 44-1, GXFPopCell_Width, 1))];
self.lineLabel.backgroundColor = GXF_LINE_COLOR;
[self.contentView addSubview:self.addImageView];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.lineLabel];
}
- (void)setTitleStr:(NSString *)title{
self.titleLabel.text = title;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// GXFPopView.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/11.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFPopView : UIView
- (instancetype)initWithFrame:(CGRect)frame withArr:(NSArray *)titleArr;
@end
//
// GXFPopView.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/11.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFPopView.h"
#import "GXFPopCell.h"
#define GXFPOpView_LeftMargin 20
#define GXFPOpView_ContentHeight 200
#define GXFPOpView_TopHeight 44
@interface GXFPopView ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSArray *titleArr;
@end
@implementation GXFPopView
- (instancetype)initWithFrame:(CGRect)frame withArr:(NSArray *)titleArr{
self = [super initWithFrame:frame];
if (self) {
self.titleArr = titleArr;
[self bulidLayout];
}
return self;
}
- (void)bulidLayout{
self.backgroundColor = RGBA(0, 0, 0, 0.5);
UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(GXFPOpView_LeftMargin, (ScreenSize.height - GXFPOpView_ContentHeight)/2, ScreenSize.width - GXFPOpView_LeftMargin*2, GXFPOpView_ContentHeight)];
bgView.backgroundColor = XXFBgColor;
bgView.layer.cornerRadius = 4;
bgView.layer.masksToBounds = YES;
[self addSubview:bgView];
UILabel *titlelabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, CGRectGetWidth(bgView.frame)- 20, GXFPOpView_TopHeight-1)];
titlelabel.text = @"选择添加项目";
titlelabel.textColor = GXF_PopView_COLOR;
[bgView addSubview:titlelabel];
UILabel *lineLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, GXFPOpView_TopHeight-1, CGRectGetWidth(bgView.frame), 1)];
lineLabel.backgroundColor = GXF_PopView_COLOR;
[bgView addSubview:lineLabel];
self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, GXFPOpView_TopHeight, CGRectGetWidth(bgView.frame), GXFPOpView_ContentHeight - GXFPOpView_TopHeight*2) style:UITableViewStylePlain];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[bgView addSubview:self.tableView];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, CGRectGetHeight(bgView.frame)- GXFPOpView_TopHeight, CGRectGetWidth(bgView.frame), GXFPOpView_TopHeight);
[btn setTitle:@"返回" forState:UIControlStateNormal];
[btn setTitleColor:GXF_CONTENT_COLOR forState:UIControlStateNormal];
[bgView addSubview:btn];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.titleArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"SurveyID";
GXFPopCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[GXFPopCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
if (self.titleArr.count > 0) {
NSString *titleStr = self.titleArr[indexPath.row];
[cell setTitleStr:titleStr];
}
return cell;
}
@end
......@@ -13,6 +13,7 @@
#import "PurchaseViewController.h"
#import "ShopDetaileViewController.h"
#import "PurchaseBillProduct.h"
#import "GXFPopView.h"
#define TopHeight 328
#define BottomHeight 300
#define SpaceHeight 20
......@@ -33,6 +34,7 @@ typedef enum : NSUInteger {
NSNumber *versionObject;
}
@property (nonatomic,strong)NSString *state;
@property (nonatomic,strong)GXFPopView *popView;
@end
......@@ -149,6 +151,12 @@ typedef enum : NSUInteger {
_purchaseView.total = [NSNumber numberWithFloat:totalPrice+otherPrice];
}
- (void)addPurchaseProduct:(NSNotification *)fication{
// if (!self.popView) {
// NSArray *arr = @[@"添加商品明细",@"选择发运单"];
// self.popView = [[GXFPopView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, ScreenSize.height) withArr:arr];
// [AppWindow addSubview:self.popView];
// }
PurchaseBillProduct *billProduct = [[fication userInfo] objectForKey:@"purchaseBillProduct"];
NSInteger indexTag = [[[fication userInfo] objectForKey:@"indexTag"] integerValue];
......
......@@ -129,7 +129,7 @@ typedef enum : NSUInteger {
}else{
[self hiddenTwoBtn];
}
}else if([self.bill.state isEqualToString:PURCHASE_STATE_APPROVED]){//状态是发运中即已审批
}else if([self.bill.state isEqualToString:PURCHASE_STATE_SHIPPING]){//状态是发运中即已审批
if([self checkIsPermission:PURCHASE_PERMISSIONS_VENDORAPPROVE]){//供应商审批权
//显示确认按钮
_firstBtn.hidden = YES;
......@@ -354,16 +354,16 @@ typedef enum : NSUInteger {
self.stateLabel.text = @"未提交";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {
self.stateLabel.textColor = [UIColor greenColor];
self.stateLabel.text = @"已提交";
self.stateLabel.text = @"已审批";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_REJECTED]) {
self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"已拒绝";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_APPROVED]) {
self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"已审批";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"发运中";
}else if ([self.bill.state isEqualToString:PURCHASE_ACTION_ABORT]) {
self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"已作废";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_FINISHED]) {
self.stateLabel.textColor = [UIColor blackColor];
self.stateLabel.text = @"已完成";
......
......@@ -43,7 +43,9 @@ typedef enum : NSUInteger {
}
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSString *noticeLike;
@property (nonatomic,strong)NSString *titleLike;
@property (nonatomic,strong)NSString *vendorLike;
@property (nonatomic,strong)NSString *state;
@property (nonatomic,strong)NSString *billLike;
@property (nonatomic,strong)NSString *orderDirection;//asc(升序),desc(降序)
......@@ -134,15 +136,13 @@ typedef enum : NSUInteger {
[orderArr addObject:[order dictForCommit]];
}
}
id noticeObject = [NSNull null];
if (self.noticeLike.length > 0) {
noticeObject = self.noticeLike;
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
QueryOrder *order = [QueryOrder new];
order.field = @"noticeNumber";
order.direction = self.orderDirection;
[orderArr addObject:[order dictForCommit]];
}
id titleObject = [NSNull null];
if (self.titleLike.length > 0) {
titleObject = self.titleLike;
}
id vendorObject = [NSNull null];
if (self.vendorLike.length > 0) {
vendorObject = self.vendorLike;
}
if (orderArr.count == 0) {
QueryOrder *order = [QueryOrder new];
......@@ -154,9 +154,8 @@ typedef enum : NSUInteger {
NSDictionary *dict = @{
@"billNumberLike":billObject,
@"state":stateObject,
// @"noticeNumberLike":noticeObject,
@"titleLike":[NSNull null],
@"vendorUuid":[NSNull null],
@"titleLike":titleObject,
@"vendorUuid":vendorObject,
@"queryOrders":orderArr,
@"userUuid":userUtil.userId,
@"pageNumber":@(_currentPage),
......@@ -289,12 +288,12 @@ typedef enum : NSUInteger {
}else{
[btn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal];
if (_boltView == nil) {
_boltView = [[PurchaseBoltView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 274) state:self.state billNumber:self.billLike noticeNumber:self.noticeLike];
_boltView = [[PurchaseBoltView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 274) state:self.state billNumber:self.billLike titleStr:self.titleLike vendorNumber:self.vendorLike];
_boltView.backgroundColor = XXFBgColor;
_boltView.delegate = self;
//initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成)
_boltView.dataArr = [[NSMutableArray alloc]initWithObjects:@"未提交",@"已提交",@"已拒绝" ,@"已审批",@"发运中",@"已完成",nil];
_boltView.dataArr = [[NSMutableArray alloc]initWithObjects:@"未提交",@"未审批",@"已拒绝" ,@"发运中",@"已作废",@"已完成",nil];
[_maskView addSubview:_boltView];
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _boltView.frame;
......@@ -356,7 +355,7 @@ typedef enum : NSUInteger {
}
}
- (void)checkBoltBtnColor{
if (self.state.length > 0 || self.noticeLike.length > 0 || self.billLike.length > 0) {
if (self.state.length > 0 || self.titleLike.length > 0 || self.billLike.length > 0) {
[_boltBtn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal];
}else{
[_boltBtn setImage:[UIImage imageNamed:@"black_filter_with_text"] forState:UIControlStateNormal];
......@@ -366,22 +365,22 @@ typedef enum : NSUInteger {
#pragma mark - 确定
- (void)sureClick{
if (self.state.length > 0 || self.billLike.length > 0 || self.noticeLike.length > 0 ||self.orderDirection.length > 0) {
[_boltView.noticeFiled resignFirstResponder];
[_boltView.billFiled resignFirstResponder];
_currentPage = 0;
//请求
[self getData];
//还原数据
if (_sortView) {
[self hiddenSortMaskView:YES];
}
if (_boltView) {
[self hiddenBoltMaskView:YES];
}
[_boltView.titleFiled resignFirstResponder];
[_boltView.billFiled resignFirstResponder];
[_boltView.vendorFiled resignFirstResponder];
_currentPage = 0;
//请求
[self getData];
//还原数据
if (_sortView) {
[self hiddenSortMaskView:YES];
}
if (_boltView) {
[self hiddenBoltMaskView:YES];
}
}
#pragma mark - sortDelegate
......@@ -400,21 +399,28 @@ typedef enum : NSUInteger {
self.billLike = billLike;
CLog(@"%@",billLike);
}
- (void)getnoticeLike:(NSString *)noticeLike{
self.noticeLike = noticeLike;
CLog(@"%@",noticeLike);
- (void)gettitleLike:(NSString *)titleLike{
self.titleLike = titleLike;
CLog(@"%@",titleLike);
}
- (void)getvendorLike:(NSString *)vendorLike{
self.vendorLike = vendorLike;
CLog(@"%@",vendorLike);
}
- (void)clearBoltInformation{
//清空所有条件
if (self.billLike.length > 0) {
self.billLike = @"";
}
if (self.noticeLike.length > 0) {
self.noticeLike = @"";
if (self.titleLike.length > 0) {
self.titleLike = @"";
}
if (self.state.length > 0) {
self.state = @"";
}
if (self.vendorLike.length > 0) {
self.vendorLike = @"";
}
}
#pragma mark - 协议方法
......
......@@ -11,7 +11,9 @@
@protocol PurchaseViewDelegate <NSObject>
- (void)getBoltValueSelectRow:(NSString *)state;
- (void)getbillLike:(NSString *)billLike;
- (void)getnoticeLike:(NSString *)noticeLike;
- (void)gettitleLike:(NSString *)titleLike;
- (void)getvendorLike:(NSString *)vendorLike;
- (void)clearBoltInformation;
@end
......@@ -21,8 +23,8 @@
@property (nonatomic,weak)id <PurchaseViewDelegate>delegate;
@property (nonatomic,strong)UITextField *billFiled;//采购单号类似于
@property (nonatomic,strong)UITextField *noticeFiled;//通知单号类似于
@property (nonatomic,strong)UITextField *titleFiled;//通知单号类似于
@property (nonatomic,strong)UITextField *vendorFiled;//供应商uuid类似于
- (instancetype)initWithFrame:(CGRect)frame state:(NSString *)state billNumber:(NSString *)billNumber noticeNumber:(NSString *)noticeNumber;
- (instancetype)initWithFrame:(CGRect)frame state:(NSString *)state billNumber:(NSString *)billNumber titleStr:(NSString *)titleStr vendorNumber:(NSString *)vendorNumber;
@end
......@@ -18,26 +18,24 @@
UIView *_leftView;
UIButton *_currentBtn;
NSIndexPath *_currentIndexPath;
UIView *_billView;
UIView *_noticeView;
NSString *_state;
NSString *_billNumber;
NSString *_title;
UIButton *_clearBtn;
}
@property (nonatomic,strong)NSString *state;
@property (nonatomic,strong)NSString *noticeNumber;
@property (nonatomic,strong)NSString *titleStr;
@property (nonatomic,strong)NSString *vendorNumber;
@property (nonatomic,strong)NSString *billNumber;
@end
@implementation PurchaseBoltView
- (instancetype)initWithFrame:(CGRect)frame state:(NSString *)state billNumber:(NSString *)billNumber noticeNumber:(NSString *)noticeNumber{
- (instancetype)initWithFrame:(CGRect)frame state:(NSString *)state billNumber:(NSString *)billNumber titleStr:(NSString *)titleStr vendorNumber:(NSString *)vendorNumber{
self = [super initWithFrame:frame];
if (self) {
self.billNumber = billNumber;
self.noticeNumber = noticeNumber;
self.titleStr = titleStr;
self.vendorNumber = vendorNumber;
self.state = state;
[self createView];
[self createRightView];
......@@ -53,20 +51,24 @@
_currentIndexPath = [NSIndexPath indexPathForRow:1 inSection:0];
}else if ([self.state isEqualToString:PURCHASE_STATE_REJECTED]) {
_currentIndexPath = [NSIndexPath indexPathForRow:2 inSection:0];
}else if ([self.state isEqualToString:PURCHASE_STATE_APPROVED]) {
_currentIndexPath = [NSIndexPath indexPathForRow:3 inSection:0];
}else if ([self.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
_currentIndexPath = [NSIndexPath indexPathForRow:3 inSection:0];
}else if ([self.state isEqualToString:PURCHASE_STATE_ABORTED]) {
_currentIndexPath = [NSIndexPath indexPathForRow:4 inSection:0];
}else if ([self.state isEqualToString:PURCHASE_STATE_FINISHED]) {
_currentIndexPath = [NSIndexPath indexPathForRow:5 inSection:0];
}
_billView.hidden = YES;
self.billFiled.hidden = YES;
if(self.billNumber.length > 0){
self.billFiled.text = self.billNumber;
}
_noticeView.hidden = YES;
if (self.noticeNumber.length > 0) {
self.noticeFiled.text = self.noticeNumber;
self.titleFiled.hidden = YES;
if (self.titleStr.length > 0) {
self.titleFiled.text = self.titleStr;
}
self.vendorFiled.hidden = YES;
if (self.vendorNumber.length > 0) {
self.vendorFiled.text = self.vendorNumber;
}
}
......@@ -75,7 +77,7 @@
{
_leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, LeftMargin,self.frame.size.height- BottomHeight)];
[self addSubview:_leftView];
NSArray *arr = @[@"按状态",@"采购单号",@"通知单号"];
NSArray *arr = @[@"按状态",@"采购单号",@"标题",@"供应商Uuid"];
for (NSInteger i = 0; i<arr.count; i++) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
button.frame = CGRectMake(0, LeftHeight * i , LeftMargin ,LeftHeight);
......@@ -100,43 +102,34 @@
[self addSubview:_clearBtn];
}
- (void)createRightView{
NSArray *arr = @[@"输入类似采购单号",@"输入类似标题",@"输入类似供应商Uuid"];
UIView *contentView = [[UIView alloc]initWithFrame:CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin, self.frame.size.height - BottomHeight)];
contentView.backgroundColor = [UIColor whiteColor];
[self addSubview:contentView];
UILabel *contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, (ScreenSize.width - LeftMargin - 10*2), 20)];
contentLabel.font = GXF_FIFTEENTEN_SIZE;
contentLabel.text = @"类似于:";
[contentView addSubview:contentLabel];
_billView = [[UIView alloc]initWithFrame:CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin, self.frame.size.height - BottomHeight)];
_billView.backgroundColor = [UIColor whiteColor];
[self addSubview:_billView];
UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, (ScreenSize.width - LeftMargin - 10*2), 20)];
titleLabel.font = GXF_FIFTEENTEN_SIZE;
titleLabel.text = @"类似于:";
[_billView addSubview:titleLabel];
self.billFiled = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(titleLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
self.billFiled.textAlignment = NSTextAlignmentLeft;
self.billFiled.textColor = GXF_CONTENT_COLOR;
self.billFiled.placeholder = @"输入类似采购单号";
self.billFiled.borderStyle = UITextBorderStyleRoundedRect;
self.billFiled.font = GXF_FIFTEENTEN_SIZE;
self.billFiled.returnKeyType = UIReturnKeyDone;
self.billFiled.delegate = self;
[_billView addSubview:self.billFiled];
_noticeView = [[UIView alloc]initWithFrame:CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin, self.frame.size.height - BottomHeight)];
_noticeView.backgroundColor = [UIColor whiteColor];
[self addSubview:_noticeView];
UILabel *billLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, (ScreenSize.width - LeftMargin - 10*2), 20)];
billLabel.font = GXF_FIFTEENTEN_SIZE;
billLabel.text = @"类似于:";
[_noticeView addSubview:billLabel];
self.noticeFiled = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(billLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
self.noticeFiled.textAlignment = NSTextAlignmentLeft;
self.noticeFiled.textColor = GXF_CONTENT_COLOR;
self.noticeFiled.placeholder = @"输入类似采购通知单号";
self.noticeFiled.borderStyle = UITextBorderStyleRoundedRect;
self.noticeFiled.font = GXF_FIFTEENTEN_SIZE;
self.noticeFiled.returnKeyType = UIReturnKeyDone;
self.noticeFiled.delegate = self;
[_noticeView addSubview:self.noticeFiled];
for (NSInteger i = 0; i < arr.count; i ++) {
UITextField *contentField = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(contentLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
contentField.textAlignment = NSTextAlignmentLeft;
contentField.textColor = GXF_CONTENT_COLOR;
contentField.borderStyle = UITextBorderStyleRoundedRect;
contentField.font = GXF_FIFTEENTEN_SIZE;
contentField.placeholder = arr[i];
contentField.returnKeyType = UIReturnKeyDone;
contentField.delegate = self;
[contentView addSubview:contentField];
if (i == 0) {
_billFiled = contentField;
}else if(i == 1){
_titleFiled = contentField;
}else if(i == 2){
_vendorFiled = contentField;
}
}
self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin, self.frame.size.height - BottomHeight) style:(UITableViewStylePlain)];
self.tableView.backgroundColor = [UIColor whiteColor];
self.tableView.delegate = self;
......@@ -155,22 +148,33 @@
case 1001://状态
{
self.tableView.hidden = NO;
_billView.hidden = YES;
_noticeView.hidden = YES;
_billFiled.hidden = YES;
_titleFiled.hidden = YES;
_vendorFiled.hidden = YES;
}
break;
case 1002://条件二
{
self.tableView.hidden = YES;
_billView.hidden = NO;
_noticeView.hidden = YES;
_billFiled.hidden = NO;
_titleFiled.hidden = YES;
_vendorFiled.hidden = YES;
}
break;
case 1003://条件三
{
self.tableView.hidden = YES;
_billView.hidden = YES;
_noticeView.hidden = NO;
_billFiled.hidden = YES;
_titleFiled.hidden = NO;
_vendorFiled.hidden = YES;
}
break;
case 1004://条件四
{
self.tableView.hidden = YES;
_billFiled.hidden = YES;
_titleFiled.hidden = YES;
_vendorFiled.hidden = NO;
}
break;
default:
......@@ -182,8 +186,11 @@
if (_billFiled.text.length > 0) {
_billFiled.text = @"";
}
if (_noticeFiled.text.length > 0) {
_noticeFiled.text = @"";
if (_titleFiled.text.length > 0) {
_titleFiled.text = @"";
}
if (_vendorFiled.text.length > 0) {
_vendorFiled.text = @"";
}
if (_currentIndexPath) {
_currentIndexPath = nil;
......@@ -242,9 +249,9 @@
}else if(indexPath.row == 2){
stateStr = PURCHASE_STATE_REJECTED;
}else if(indexPath.row == 3){
stateStr = PURCHASE_STATE_APPROVED;
}else if(indexPath.row == 4){
stateStr = PURCHASE_STATE_SHIPPING;
}else if(indexPath.row == 4){
stateStr = PURCHASE_STATE_ABORTED;
}else if(indexPath.row == 5){
stateStr = PURCHASE_STATE_FINISHED;
}
......@@ -264,7 +271,8 @@
}
- (void)keyBoardHidden{
[self.billFiled resignFirstResponder];
[self.noticeFiled resignFirstResponder];
[self.titleFiled resignFirstResponder];
[self.vendorFiled resignFirstResponder];
}
- (void)textFieldDidEndEditing:(UITextField *)textField{
......@@ -272,9 +280,13 @@
if (self.billFiled.text.length > 0) {
[self.delegate getbillLike:self.billFiled.text];
}
}else if(textField == self.noticeFiled){
if (self.noticeFiled.text.length > 0) {
[self.delegate getnoticeLike:self.noticeFiled.text];
}else if(textField == self.titleFiled){
if (self.titleFiled.text.length > 0) {
[self.delegate gettitleLike:self.titleFiled.text];
}
}else if(textField == self.vendorFiled){
if (self.vendorFiled.text.length > 0) {
[self.delegate getvendorLike:self.vendorFiled.text];
}
}
}
......
......@@ -84,7 +84,7 @@
stateStr = @"已拒绝";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled];
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_APPROVED]) {
}else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
stateStr = @"发运中";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
......
......@@ -79,7 +79,7 @@
textField.textAlignment = NSTextAlignmentRight;
textField.textColor = GXF_CONTENT_COLOR;
textField.font = GXF_FIFTEENTEN_SIZE;
textField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
textField.keyboardType = UIKeyboardTypeDecimalPad;
textField.returnKeyType = UIReturnKeyDone;
textField.delegate = self;
[cell.contentView addSubview:textField];
......
......@@ -69,8 +69,8 @@
self.titleLabel.text = survey.title;
self.billnumberLabel.text = [NSString stringWithFormat:@"单号:%@",survey.billNumber];
self.productnameLabel.text = [NSString stringWithFormat:@"商品:%@[%@]",survey.productName,survey.productCode];
self.begindateLabel.text = [NSString stringWithFormat:@"开始时间:%@",[survey.beginDate substringToIndex:10]];
self.enddateLabel.text = [NSString stringWithFormat:@"结束时间:%@",[survey.endDate substringToIndex:10]];
self.begindateLabel.text = [NSString stringWithFormat:@"开始时间:%@",survey.beginDate.length > 10 ? [survey.beginDate substringToIndex:10] :survey.beginDate];
self.enddateLabel.text = [NSString stringWithFormat:@"结束时间:%@",survey.endDate.length > 10 ? [survey.endDate substringToIndex:10] :survey.endDate];
NSString *stateStr = @"";
if ([survey.state isEqualToString:SURVEY_STATE_INITIAL]) {
stateStr = @"未提交";
......
......@@ -477,27 +477,12 @@ typedef enum : NSUInteger {
#pragma mark delegate
- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{
[_noteTextView resignFirstResponder];
[self setTableFrame:LeftMargin];
return YES;
}
- (void)growingTextViewDidBeginEditing:(HPGrowingTextView *)growingTextView{
CGFloat offset = ScreenSize.height - TotalHeight - KeyboardHeight;
if (offset < 0) {//上移
[self setTableFrame:LeftMargin+offset];
}
}
- (void)setTableFrame:(CGFloat)tabelH{
[UIView animateWithDuration:0.25 animations:^{
CGRect tableFrame = _tableView.frame;
tableFrame.origin.y = tabelH;
_tableView.frame = tableFrame;
}];
}
- (void)keyboardHidden{
[_titleField resignFirstResponder];
[_noteTextView resignFirstResponder];
[self setTableFrame:LeftMargin];
}
- (void)viewWillDisappear:(BOOL)animated{
......
......@@ -204,12 +204,11 @@ typedef enum : NSUInteger {
textField.textColor = GXF_CONTENT_COLOR;
textField.font = GXF_FIFTEENTEN_SIZE;
textField.returnKeyType = UIReturnKeyDone;
textField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
textField.keyboardType = UIKeyboardTypeDecimalPad;
textField.delegate = self;
[cell.contentView addSubview:textField];
if (indexPath.row == 1) {
textField.placeholder = @"输入应付金额";
_actualmoneyField = textField;
}else if(indexPath.row == 2){
textField.placeholder = @"输入已付金额";
......
......@@ -86,7 +86,6 @@ typedef enum : NSUInteger {
- (void)fetchtTransportDetail{
self.billNumberLabel.text = [IBTCommon checkString:self.transport.billnumber];
// self.purchaseLabel.text =
if ([self.transport.state isEqualToString:TRANSPORT_STATE_UNRECEIVED]) {
self.stateLabel.textColor = [UIColor redColor];
self.stateLabel.text = @"未发货";
......@@ -97,20 +96,36 @@ typedef enum : NSUInteger {
self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"已作废";
}
// self.noticeNumberLabel.text = (self.bill.noticeNumber.length == 0) ? @"无":(self.bill.noticeNumber);
self.purchaseLabel.text = [self getPurchaseWith:self.transport.pdtDetails];
self.warehouseLabel.text = [IBTCommon checkString:self.transport.warehouseName];
self.rwarehouseLabel.text = [IBTCommon checkString:self.transport.rwarehouseName];
self.carnumberLabel.text = [IBTCommon checkString:self.transport.carnumber];
self.carhoneLabel.text = [IBTCommon checkString:self.transport.carphone];
self.noteLabel.text = [IBTCommon checkString:self.transport.note];
self.createOperLabel.text = [NSString stringWithFormat:@"%@%@",[IBTCommon checkString:self.transport.create_operName],self.transport.create_time];
self.createOperLabel.text = [NSString stringWithFormat:@"%@%@",[IBTCommon checkString:self.transport.create_operName],self.transport.create_time.length > 10 ? [self.transport.create_time substringToIndex:10] : self.transport.create_time];
[_transView refreshTranProduct:self.transport.pdtDetails];
[_transView refreshCost:self.transport.accountDetails];
[self setNoteHeight];
}
- (NSString *)getPurchaseWith:(NSArray *)purchases{
NSString *purchseNumber = @"";
NSInteger count = 0;
for (NSDictionary *billDict in purchases) {
if (![billDict[@"purchasebillnumber"] isEqual:[NSNull null]]) {
count ++;
if (purchseNumber.length == 0) {
purchseNumber = [purchseNumber stringByAppendingFormat:@"%@",billDict[@"purchasebillnumber"]];
}else{
purchseNumber = [purchseNumber stringByAppendingFormat:@",%@" ,billDict[@"purchasebillnumber"]];
}
}
}
if (count == 0) {
purchseNumber = @"无";
}
return purchseNumber;
}
- (void)setNoteHeight
{
CGFloat height = [self.noteLabel calculateHeight];
......
......@@ -167,7 +167,7 @@
[arr addObject:billProduct];
[arr addObject:billProduct];
bill.products = arr;
cell.bill = bill;
[cell setPurchaseBill:bill selectArr:self.indexArr];
}
return cell;
}
......@@ -185,6 +185,7 @@
- (void)getSelectPurchaseProduct:(NSNotification *)fination{
NSDictionary *dict = fination.userInfo;
TransportPdtDetail *billProduct = dict[@"selectArr"];
NSString *state = dict[@"state"];
if ([state isEqualToString:@"add"]) {
[self.indexArr addObject:billProduct];
......
......@@ -89,12 +89,6 @@ typedef enum : NSUInteger {
id userObject = [NSNull null];
if (self.userLike.length > 0) {
userObject = self.userLike;
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
QueryOrder *order = [QueryOrder new];
order.field = @"uuid";
order.direction = self.orderDirection;
[orderArr addObject:[order dictForCommit]];
}
}
id stateObject = [NSNull null];
if (self.state.length > 0 && ![self.state isEqualToString:@"none"]) {
......@@ -125,10 +119,9 @@ typedef enum : NSUInteger {
}
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSDictionary *dict = @{
// @"userEquals":userObject,
@"state":stateObject,
@"billNumberLike":billObject,
@"creator":[NSNull null],
@"creator":userObject,
@"queryOrders":orderArr,
@"userCode":userUtil.userCode,
@"pageNumber":@(_currentPage),
......@@ -338,22 +331,21 @@ typedef enum : NSUInteger {
#pragma mark - 确定
- (void)sureClick{
if (self.state.length > 0 || self.userLike.length > 0 || self.billLike.length > 0 ||self.orderDirection.length > 0) {
[_boltView.userFiled resignFirstResponder];
[_boltView.billFiled resignFirstResponder];
_currentPage = 0;
//请求
[self getData];
//还原数据
if (_sortView) {
[self hiddenSortMaskView:YES];
}
if (_boltView) {
[self hiddenBoltMaskView:YES];
}
}
[_boltView.userFiled resignFirstResponder];
[_boltView.billFiled resignFirstResponder];
_currentPage = 0;
//请求
[self getData];
//还原数据
if (_sortView) {
[self hiddenSortMaskView:YES];
}
if (_boltView) {
[self hiddenBoltMaskView:YES];
}
}
#pragma mark - sortDelegate
......
......@@ -19,8 +19,6 @@
UIView *_leftView;
UIButton *_currentBtn;
NSIndexPath *_currentIndexPath;
UIView *_userView;
UIView *_billView;
NSString *_state;
NSString *_billNumber;
NSString *_title;
......@@ -56,11 +54,11 @@
}else if ([self.state isEqualToString:TRANSPORT_STATE_ABORTED]) {
_currentIndexPath = [NSIndexPath indexPathForRow:3 inSection:0];
}
_userView.hidden = YES;
self.userFiled.hidden = YES;
if(self.userNumber.length > 0){
self.userFiled.text = self.userNumber;
}
_billView.hidden = YES;
self.billFiled.hidden = YES;
if (self.billNumber.length > 0) {
self.billFiled.text = self.billNumber;
}
......@@ -71,7 +69,7 @@
{
_leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, LeftMargin,self.frame.size.height- BottomHeight)];
[self addSubview:_leftView];
NSArray *arr = @[@"按状态",@"用户代码",@"调研单号"];
NSArray *arr = @[@"按状态",@"创建人代码",@"调研单号"];
for (NSInteger i = 0; i<arr.count; i++) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
button.frame = CGRectMake(0, LeftHeight * i , LeftMargin ,LeftHeight);
......@@ -97,42 +95,34 @@
}
- (void)createRightView{
_userView = [[UIView alloc]initWithFrame:CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin, self.frame.size.height - BottomHeight)];
_userView.backgroundColor = [UIColor whiteColor];
[self addSubview:_userView];
UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, (ScreenSize.width - LeftMargin - 10*2), 20)];
titleLabel.font = GXF_FIFTEENTEN_SIZE;
titleLabel.text = @"类似于:";
[_userView addSubview:titleLabel];
self.userFiled = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(titleLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
self.userFiled.textAlignment = NSTextAlignmentLeft;
self.userFiled.textColor = GXF_CONTENT_COLOR;
self.userFiled.placeholder = @"输入类似登陆用户代码";
self.userFiled.borderStyle = UITextBorderStyleRoundedRect;
self.userFiled.font = GXF_FIFTEENTEN_SIZE;
self.userFiled.returnKeyType = UIReturnKeyDone;
self.userFiled.delegate = self;
[_userView addSubview:self.userFiled];
NSArray *arr = @[@"输入类似创建人代码",@"输入类似调研单号"];
UIView *contentView = [[UIView alloc]initWithFrame:CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin, self.frame.size.height - BottomHeight)];
contentView.backgroundColor = [UIColor whiteColor];
[self addSubview:contentView];
UILabel *contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, (ScreenSize.width - LeftMargin - 10*2), 20)];
contentLabel.font = GXF_FIFTEENTEN_SIZE;
contentLabel.text = @"类似于:";
[contentView addSubview:contentLabel];
_billView = [[UIView alloc]initWithFrame:CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin, self.frame.size.height - BottomHeight)];
_billView.backgroundColor = [UIColor whiteColor];
[self addSubview:_billView];
UILabel *billLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, (ScreenSize.width - LeftMargin - 10*2), 20)];
billLabel.font = GXF_FIFTEENTEN_SIZE;
billLabel.text = @"类似于:";
[_billView addSubview:billLabel];
self.billFiled = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(billLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
self.billFiled.textAlignment = NSTextAlignmentLeft;
self.billFiled.textColor = GXF_CONTENT_COLOR;
self.billFiled.placeholder = @"输入类似调研单号";
self.billFiled.borderStyle = UITextBorderStyleRoundedRect;
self.billFiled.font = GXF_FIFTEENTEN_SIZE;
self.billFiled.returnKeyType = UIReturnKeyDone;
self.billFiled.delegate = self;
[_billView addSubview:self.billFiled];
for (NSInteger i = 0; i < arr.count; i ++) {
UITextField *contentField = [[UITextField alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(contentLabel.frame) + 10, (ScreenSize.width - LeftMargin - 10*2), 30)];
contentField.textAlignment = NSTextAlignmentLeft;
contentField.textColor = GXF_CONTENT_COLOR;
contentField.borderStyle = UITextBorderStyleRoundedRect;
contentField.font = GXF_FIFTEENTEN_SIZE;
contentField.placeholder = arr[i];
contentField.returnKeyType = UIReturnKeyDone;
contentField.delegate = self;
[contentView addSubview:contentField];
if (i == 0) {
self.userFiled = contentField;
}else if(i == 1){
self.billFiled = contentField;
}
}
self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin, self.frame.size.height - BottomHeight) style:(UITableViewStylePlain)];
self.tableView.backgroundColor = [UIColor whiteColor];
self.tableView.delegate = self;
......@@ -151,22 +141,22 @@
case 1001://状态
{
self.tableView.hidden = NO;
_userView.hidden = YES;
_billView.hidden = YES;
self.userFiled.hidden = YES;
self.billFiled.hidden = YES;
}
break;
case 1002://条件二
{
self.tableView.hidden = YES;
_userView.hidden = NO;
_billView.hidden = YES;
self.userFiled.hidden = NO;
self.billFiled.hidden = YES;
}
break;
case 1003://条件三
{
self.tableView.hidden = YES;
_userView.hidden = YES;
_billView.hidden = NO;
self.userFiled.hidden = YES;
self.billFiled.hidden = NO;
}
break;
default:
......
......@@ -21,5 +21,6 @@
@property (nonatomic,strong)NSMutableArray *indexArr;
@property (nonatomic,strong)NSMutableArray *selectArr;
- (void)setPurchaseBill:(PurchaseBill *)bill selectArr:(NSMutableArray *)selectArr;
@end
......@@ -9,6 +9,10 @@
#import "TransportPurchaseCell.h"
#import "TransportPurductCell.h"
#import "HeaderCell.h"
#define TableHeight 44
#define ShowHeight 110
@implementation TransportPurchaseCell
......@@ -50,10 +54,10 @@
}
- (void)setBill:(PurchaseBill *)bill{
self.titleLabel.text = [NSString stringWithFormat:@"[采购单:%@]",bill.billNumber];
- (void)setPurchaseBill:(PurchaseBill *)bill selectArr:(NSMutableArray *)selectArr{
self.titleLabel.text = [NSString stringWithFormat:@"采购单:%@",bill.billNumber];
self.secondArr = [NSMutableArray array];
self.selectArr = [NSMutableArray array];
self.selectArr = selectArr;
[self.secondArr addObjectsFromArray:bill.products];
// for (NSDictionary *billDict in bill.products) {
// PurchaseBillProduct *billProcuct = [PurchaseBillProduct new];
......@@ -74,9 +78,7 @@
self.secondTable.tableHeaderView = headCell;
//重要
[self.secondTable reloadData];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
......@@ -97,24 +99,68 @@
}
TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
[cell setPdtDetail:billProduct row:indexPath.row];
if ([self isHaveIndexPath:indexPath]) {
cell.editBtn.hidden = NO;
// 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.editBtn.hidden = YES;
// 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.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if ([self isHaveIndexPath:indexPath]) {
return ShowHeight + TableHeight;
}
return TableHeight;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
TransportPurductCell *cell = (TransportPurductCell *)[tableView cellForRowAtIndexPath:indexPath];
TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
if (![self isHaveIndexPath:indexPath]) {
cell.editBtn.hidden = NO;
[self.selectArr addObject:indexPath];
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_getSelectPurchaseProduct object:nil userInfo:@{@"selectArr":billProduct,@"state":@"add"}];
}else{
[self.selectArr removeObject:indexPath];
cell.editBtn.hidden = YES;
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_getSelectPurchaseProduct object:nil userInfo:@{@"selectArr":billProduct,@"state":@"remove"}];
}
;
// TransportPurductCell *cell = (TransportPurductCell *)[tableView cellForRowAtIndexPath:indexPath];
// TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
// CGRect Linefrmame = cell.lineLabel.frame;
// CGRect showfrmame = cell.showView.frame;
// if (![self isHaveIndexPath:indexPath]) {
// cell.editBtn.hidden = NO;
// cell.smallImageView.image = [UIImage imageNamed:@"arrowdown"];
// Linefrmame.origin.y = ShowHeight + TableHeight - 1;
// showfrmame.size.height = ShowHeight;
// cell.backgroundColor = [UIColor whiteColor];
// [self.selectArr addObject:billProduct];
// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_getSelectPurchaseProduct object:nil userInfo:@{@"selectArr":billProduct,@"state":@"add"}];
// }else{
// [self.selectArr removeObject:billProduct];
// cell.editBtn.hidden = YES;
// cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
// Linefrmame.origin.y = TableHeight -1;
// showfrmame.size.height = 0;
// cell.backgroundColor = [UIColor whiteColor];
// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_getSelectPurchaseProduct object:nil userInfo:@{@"selectArr":billProduct,@"state":@"remove"}];
// }
//
// cell.lineLabel.frame = Linefrmame;
// cell.showView.frame = showfrmame;
// [self.secondTable reloadData];
}
- (BOOL)isHaveIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in self.selectArr) {
......
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