Commit 4d457235 authored by 管鹏飞's avatar 管鹏飞

『新建采购单』『查看采购单』增加采购员 Sandy

parent e593fd68
......@@ -166,7 +166,7 @@
}
break;
case kFunctionSeePurchase:{
case kFunctionSeePurchase:{//查看采购单
PurchaseViewController *pvc = [[PurchaseViewController alloc]init];
pvc.title = @"采购单";
[self PushViewController:pvc animated:YES];
......
......@@ -333,17 +333,24 @@ typedef enum : NSUInteger {
@"receiveWrh_uuid":[IBTCommon checkString:_purchaseView.receiveWrh_uuid],
@"receiveWrh_code":[IBTCommon checkString:_purchaseView.receiveWrh_code],
@"receiveWrh_name":[IBTCommon checkString:_purchaseView.receiveWrh_name],
@"purchaserUuid":_purchaseView.selectPerson.userUuid,
@"purchaserCode":_purchaseView.selectPerson.userCode,
@"purchaserName":_purchaseView.selectPerson.userName,
@"total":_purchaseView.total,
@"charge":_purchaseView.chargePurchase,
@"remark":[IBTCommon checkString:_purchaseView.remark],
@"products":billProducts,
@"accountDetails":costs0};
@"accountDetails":costs};
[IBTLoadingView showProgressLabel:msg];
[[ICRHTTPController sharedController] savePurchaseWithData:dict success:succ failure:fail];
}
#pragma mark - checkNull
- (BOOL)checkPurchase{
_purchaseView.remark = _purchaseView.remarkTextView.text;
if (_purchaseView.selectPerson == nil) {
ShowMessage(@"采购员不能为空");
return NO;
}
if (_purchaseView.type.length == 0 ) {
ShowMessage(@"采购类型不能为空");
return NO;
......
......@@ -43,7 +43,7 @@ typedef enum : NSUInteger {
@property (nonatomic,strong)UILabel *checkNameLabel;
@property (nonatomic,strong)UILabel *stateLabel;
@property (nonatomic,strong)UILabel *lastModifyNameLabel;
@property (nonatomic, strong) UILabel *purchaserLabel;
@property (nonatomic,strong)UILabel *typeLabel;
@property (nonatomic,strong)UILabel *vendorNameLabel;
@property (nonatomic,strong)UILabel *vendorIsSureLabel;
......@@ -302,7 +302,7 @@ typedef enum : NSUInteger {
}
- (void)createPurchaseView{
_leftArr = @[@"单号:",@"采购通知单:",@"创建人:",@"状态:",@"类型:",@"供应商:",@"供应商确认:",@"收货仓库:",@"其他费用:",@"总金额:",@"备注:"];
_leftArr = @[@"单号:",@"采购通知单:",@"创建人:",@"采购员:",@"状态:",@"类型:",@"供应商:",@"供应商确认:",@"收货仓库:",@"其他费用:",@"总金额:",@"备注:"];
_purchaseView= [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, LeftHeight*_leftArr.count +LeftMargin)];
_purchaseView.backgroundColor = [UIColor whiteColor];
......@@ -325,15 +325,18 @@ typedef enum : NSUInteger {
self.noticeNumberLabel = rightLabel;
}else if(i == 2){
self.createOperNameLabel = rightLabel;
}else if(i == 3){
}else if (i == 3){
self.purchaserLabel = rightLabel;
}
else if(i == 4){
self.stateLabel = rightLabel;
}else if(i == 4){
self.typeLabel = rightLabel;
}else if(i == 5){
self.vendorNameLabel = rightLabel;
self.typeLabel = rightLabel;
}else if(i == 6){
self.vendorIsSureLabel = rightLabel;
self.vendorNameLabel = rightLabel;
}else if(i == 7){
self.vendorIsSureLabel = rightLabel;
}else if(i == 8){
self.warehouseLabel = rightLabel;
}else if(i == _leftArr.count - 3){
self.otherPriceLabel = rightLabel;
......@@ -342,6 +345,7 @@ typedef enum : NSUInteger {
}else if(i == _leftArr.count - 1){
rightLabel.numberOfLines = 0;
self.noteLabel = rightLabel;
//rightLabel.backgroundColor = [UIColor redColor];
}
[_purchaseView addSubview:rightLabel];
}
......@@ -383,6 +387,7 @@ typedef enum : NSUInteger {
self.lastModifyNameLabel.text = [IBTCommon checkString:self.bill.lastModify_operName];
NSString *type = [self.bill.type isEqualToString:GXF_Critical] ? @"紧急" : @"普通";
self.typeLabel.text = type;
self.purchaserLabel.text = self.bill.purchaserName;
self.vendorIsSureLabel.text = (self.bill.vendorConfirmTime.length > 0 && self.bill.vendorConfirmTime)? @"是":@"否";
self.warehouseLabel.text = [IBTCommon checkString:self.bill.receiveWrh_name];
self.otherPriceLabel.text = [self.bill.charge stringValue];
......
......@@ -34,6 +34,7 @@
@property (nonatomic,strong)NSString *lastModify_id;//最后修改人代码
@property (nonatomic,strong)NSString *lastModify_operName;//最后修改人名称
@property (nonatomic,strong)NSString *type;//类型
@property (nonatomic, strong) NSString *purchaserName;//采购员名字
@property (nonatomic,strong)NSArray *products;
@end
......@@ -9,6 +9,7 @@
#import <UIKit/UIKit.h>
#import "HPGrowingTextView.h"
#import "PurchaseBill.h"
#import "SurveyUser.h"
@protocol TopPurchaseViewDelegate <NSObject>
- (void)hiddenKeyBoard;
......@@ -38,6 +39,7 @@
@property (nonatomic,strong)NSNumber *chargePurchase;
@property (nonatomic,strong)NSString *remark;
@property (nonatomic,strong)PurchaseBill *bill;
@property (nonatomic,strong)SurveyUser *selectPerson;
@property (nonatomic,weak)id <TopPurchaseViewDelegate>delegate;
......
......@@ -12,7 +12,9 @@
#import "ChooseVendorViewController.h"
#import "ChooseTypeViewController.h"
#import "ChooseWarehouseViewController.h"
#import "ChosePersonViewController.h"
#import "Vendor.h"
#import "SurveyUser.h"
#define LeftMargin 15
#define LeftWidth 80
#define SpaceHeight 10
......@@ -45,7 +47,7 @@
{
self.backgroundColor = XXFBgColor;
_dataArr = [NSMutableArray array];
NSArray *arr = @[@"采购通知:",@"类型:",@"供应商:",@"收货仓库:",@"其他费用:",@"总金额:",@"备注:"];
NSArray *arr = @[@"采购:",@"类型:",@"供应商:",@"收货仓库:",@"其他费用:",@"总金额:",@"备注:"];
[_dataArr addObjectsFromArray:arr];
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, TopMargin,self.frame.size.width, self.frame.size.height - TopMargin)) style:(UITableViewStylePlain)];
......@@ -69,7 +71,7 @@
cell = [[SurveyCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (indexPath.row > 0 && indexPath.row < 4) {
if (indexPath.row >= 0 && indexPath.row < 4) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
[self createViewInCell:cell indexPath:indexPath];
......@@ -104,10 +106,10 @@
self.remarkTextView.isScrollable = YES;
self.remarkTextView.font = GXF_FIFTEENTEN_SIZE;
self.remarkTextView.textAlignment = NSTextAlignmentRight;
self.remarkTextView.delegate = self;
self.remarkTextView.delegate = self;
self.remarkTextView.returnKeyType = UIReturnKeyDone;
self.remarkTextView.placeholder = @"输入备注内容";
[cell.contentView addSubview:self.remarkTextView];
}else{
UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-15, TableHeight))];
......@@ -116,7 +118,7 @@
contentLabel.font = GXF_FIFTEENTEN_SIZE;
[cell.contentView addSubview:contentLabel];
if (indexPath.row == 0) {
contentLabel.text = @"采购通知单号";
contentLabel.text = @"选择采购员";
self.purchaseNoticeLabel = contentLabel;
}else if(indexPath.row == 1){
......@@ -140,7 +142,7 @@
label.textColor = GXF_CONTENT_COLOR;
label.font = GXF_FIFTEENTEN_SIZE;
[cell.contentView addSubview:label];
}
}
[self prepareDataInCell];
......@@ -253,6 +255,19 @@
self.selectWarehouse = self.receiveWrh_uuid;
};
[self.delegate pushNextViewController:wvc];
}else if (indexPath.row == 0){
ChosePersonViewController *cvc = [ChosePersonViewController new];
cvc.choseBaseInfo = ^(NSArray *users){
if(users.count == 1){
self.selectPerson = users[0];
self.purchaseNoticeLabel.text = _selectPerson.userName;
self.purchaseNoticeLabel.textColor = GXF_CONTENT_COLOR;
}
};
cvc.isMoreChose = NO;
[self.delegate pushNextViewController:cvc];
}
}
- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{
......
......@@ -65,10 +65,10 @@ typedef enum : NSUInteger {
self.dataArr = [NSMutableArray array];
}
- (void)getData{
[ICRUserUtil sharedInstance].needFresh = NO;
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[ICRUserUtil sharedInstance].needFresh = NO;
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchtPuchaseList:data];
};
......@@ -77,7 +77,7 @@ typedef enum : NSUInteger {
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
// ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
// ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSMutableArray *orderArr =[NSMutableArray array];
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
......
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