Commit 7adc37d4 authored by 陈俊俊's avatar 陈俊俊

1、发运单,如果是系统处理失败状态,应该可以再提交或者作废。(注意,不能修改内容)

3、采购单,供应商已经确认过的单据,不能再看到供应商确认按钮。
parent d79bbfe0
......@@ -217,7 +217,7 @@
//转运单
#define TRANSFER_ACTION_ABORT @"500605" //作废权
#define RECEIVE_ACTION_RECEIVE @"500803" //收货权
#define TRANSFER_ACTION_NEW @"500601" //新建权
//采购通知单权限
#define NOTICE_PERMISSIONS_ACCEPTTASK @"500304"//接受任务
#define NOTICE_PERMISSIONS_CREATEBILL @"500305"//新建权
......@@ -225,7 +225,7 @@
//发运单权限
#define TRANSPORT_ACTION_FINISH @"500504" //结束权
#define TRANSPORT_ACTION_ABORT @"500505" //作废权
#define TRANSPORT_ACTION_NEW @"500501" //新建权
//选中的颜色
......
......@@ -151,7 +151,7 @@ typedef enum : NSUInteger {
}
}else if([self.bill.state isEqualToString:PURCHASE_STATE_SHIPPING]){//状态是发运中即已审批
NSMutableArray *arr = [NSMutableArray array];
if([self checkIsPermission:PURCHASE_PERMISSIONS_VENDORAPPROVE]){//供应商审批权
if([self checkIsPermission:PURCHASE_PERMISSIONS_VENDORAPPROVE] && (!self.bill.vendorConfirmTime || self.bill.vendorConfirmTime.length < 1)){//供应商审批权
//显示确认按钮
[arr addObject:@"确认"];
}
......@@ -173,6 +173,15 @@ typedef enum : NSUInteger {
NSArray *arr = @[@"作废"];
[self createBtnWithArr:arr];
}else{
[self hiddenTwoBtn];
}
}else if([self.bill.state isEqualToString:PURCHASE_STATE_PROCESSFAIL]){//系统处理失败的
if ([self checkIsPermission:PURCHASE_PERMISSIONS_ABORT]) {//有作废权的
//显示作废按钮
NSArray *arr = @[@"作废"];
[self createBtnWithArr:arr];
}else{
[self hiddenTwoBtn];
}
......@@ -374,7 +383,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.vendorIsSureLabel.text = self.bill.vendorConfirmTime.length > 0 ? @"是":@"否";
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];
NSMutableArray *productArr = [NSMutableArray array];
......@@ -397,7 +406,7 @@ typedef enum : NSUInteger {
noteFrame.size.height = height;
self.noteLabel.frame = noteFrame;
CGFloat totalHeight = height + LeftHeight*_leftArr.count;
CGFloat totalHeight = height + LeftHeight*_leftArr.count + LeftMargin;
CGRect purchaseFrame = _purchaseView.frame;
purchaseFrame.size.height = totalHeight;
_purchaseView.frame = purchaseFrame;
......
......@@ -409,7 +409,7 @@ typedef enum : NSUInteger {
CGFloat height = [self.noteLabel calculateHeight];
self.noteLabel.height = height;
CGFloat totalHeight = height + LeftHeight *_leftArr.count;
CGFloat totalHeight = height + LeftHeight *_leftArr.count + LeftMargin;
_purchaseView.height = totalHeight;
CGRect bottomFrame = _bottomView.frame;
......
......@@ -16,7 +16,8 @@
#define TopMargin 15
typedef enum : NSUInteger {
AbortTag = 20000,
EndTag
EndTag,
SubmitTag
} BtnTag;
@interface TransferDetailViewController (){
......@@ -114,14 +115,15 @@ typedef enum : NSUInteger {
self.noteLabel.frame = noteFrame;
CGFloat totalHeight = height + LeftHeight*9;
// CGRect purchaseFrame = _purchaseView.frame;
// purchaseFrame.size.height = totalHeight;
// _purchaseView.frame = purchaseFrame;
//
//
// CGRect bottomFrame = _bottomView.frame;
// bottomFrame.origin.y = CGRectGetMaxY(_purchaseView.frame) + TopMargin;
// _bottomView.frame = bottomFrame;
CGRect purchaseFrame = _transportView.frame;
purchaseFrame.size.height = totalHeight + LeftMargin;
_transportView.frame = purchaseFrame;
CGRect bottomFrame = _bottomView.frame;
bottomFrame.origin.y = CGRectGetMaxY(_transportView.frame) + TopMargin;
_bottomView.frame = bottomFrame;
_scrollView.contentSize = CGSizeMake(ScreenSize.width, totalHeight + CGRectGetHeight(_bottomView.frame) + TopMargin*2);
}
......@@ -153,6 +155,8 @@ typedef enum : NSUInteger {
btnTag = EndTag;
}else if ([arr[i] isEqualToString:@"作废"]) {
btnTag = AbortTag;
}else if ([arr[i] isEqualToString:@"提交"]) {
btnTag = SubmitTag;
}
CGRect btnFrame = CGRectMake(LeftMargin + (LeftMargin + btnWidth)*i, ScreenSize.height - 64 - BottomHeight +5, btnWidth, 40);
UIButton *perBtn = [IBTCustomButtom creatButtonWithFrame:btnFrame target:self sel:@selector(btnClick:) tag:btnTag image:nil title:arr[i] titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_COMMIT_COLOR];
......@@ -175,6 +179,19 @@ typedef enum : NSUInteger {
}else{
[self hiddenBottomView];
}
#warning 测试
}else if ([self.transfer.state isEqualToString:TRANSFER_STATE_PROCESSFAIL]){
NSMutableArray *arr = [NSMutableArray array];
if ([IBTCommon checkIsPermission:TRANSPORT_ACTION_ABORT]) {
[arr addObject:@"作废"];
}if ([IBTCommon checkIsPermission:TRANSPORT_ACTION_NEW]) {
[arr addObject:@"提交"];
}
if (arr.count == 0) {
[self hiddenBottomView];
}else{
[self createBtnWithArr:arr];
}
}else{
[self hiddenBottomView];
}
......@@ -261,6 +278,15 @@ typedef enum : NSUInteger {
[alertView show];
}
break;
case SubmitTag:
{
CLog(@"提交");
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:@"请确认提交" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil];
alertView.delegate = self;
alertView.tag = SubmitTag;
[alertView show];
}
break;
default:
break;
......@@ -277,6 +303,10 @@ typedef enum : NSUInteger {
if (buttonIndex == 1) {
[self dealByAction:TRANSFER_STATE_RECEIVED];//结束
}
}else if (alertView.tag == SubmitTag){
if (buttonIndex == 1) { //提交
[self getDataFromServer:TRANSFER_STATE_PROCESSFAIL msg:@"正在提交..."];
}
}
}
- (void)dealByAction:(NSString *)action{
......@@ -307,7 +337,49 @@ typedef enum : NSUInteger {
[[ICRHTTPController sharedController] endTransferWithTransferUuid:self.transfer.uuid version:self.transfer.version success:succ failure:fail];
}
}
#pragma mark - 提交数据
- (void)getDataFromServer:(NSString *)state msg:(NSString *)msg{
//保存
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"];
if (success == 1) {
[ICRUserUtil sharedInstance].needFresh = YES;
[self PopViewControllerAnimated:YES];
}else{
[IBTLoadingView showTips:message];
}
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
NSDictionary *dict = @{@"uuid":self.transfer.uuid,
@"version":self.transfer.version,
@"billnumber":self.transfer.billnumber,
@"enterprise":[ICRUserUtil sharedInstance].orgId,
@"state":TRANSFER_STATE_UNRECEIVED,
@"warehouseUuid":[IBTCommon checkString:self.transfer.warehouseUuid],
@"warehouseCode":[IBTCommon checkString:self.transfer.warehouseCode],
@"warehouseName":[IBTCommon checkString:self.transfer.warehouseName],
@"rwarehouseUuid":[IBTCommon checkString:self.transfer.rwarehouseUuid],
@"rwarehouseCode":[IBTCommon checkString:self.transfer.rwarehouseCode],
@"rwarehouseName":[IBTCommon checkString:self.transfer.rwarehouseName],
@"carnumber":[IBTCommon checkString:self.transfer.carnumber],
@"type":[IBTCommon checkString:self.transfer.type],
@"carphone":[IBTCommon checkString:self.transfer.carphone],
@"arriveDate":[IBTCommon checkString:self.transfer.arriveDate],
@"note":[IBTCommon checkString:self.transfer.note],
@"pdtDetails":self.transfer.pdtDetails,
@"accountDetails":self.transfer.accountDetails
};
[IBTLoadingView showProgressLabel:msg];
[[ICRHTTPController sharedController] saveTransferWithData:dict success:succ failure:fail];
}
- (void)didReceiveMemoryWarning {
......
......@@ -19,7 +19,8 @@
#define TopMargin 15
typedef enum : NSUInteger {
AbortTag = 20000,
EndTag
EndTag,
SubmitTag
} BtnTag;
......@@ -143,14 +144,14 @@ typedef enum : NSUInteger {
self.noteLabel.frame = noteFrame;
CGFloat totalHeight = height + LeftHeight*9;
// CGRect purchaseFrame = _purchaseView.frame;
// purchaseFrame.size.height = totalHeight;
// _purchaseView.frame = purchaseFrame;
//
//
// CGRect bottomFrame = _bottomView.frame;
// bottomFrame.origin.y = CGRectGetMaxY(_purchaseView.frame) + TopMargin;
// _bottomView.frame = bottomFrame;
CGRect purchaseFrame = _transportView.frame;
purchaseFrame.size.height = totalHeight + LeftMargin;
_transportView.frame = purchaseFrame;
CGRect bottomFrame = _bottomView.frame;
bottomFrame.origin.y = CGRectGetMaxY(_transportView.frame) + TopMargin;
_bottomView.frame = bottomFrame;
_scrollView.contentSize = CGSizeMake(ScreenSize.width, totalHeight + CGRectGetHeight(_bottomView.frame) + TopMargin*2);
}
......@@ -176,7 +177,15 @@ typedef enum : NSUInteger {
[alertView show];
}
break;
case SubmitTag:
{
CLog(@"提交");
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:@"请确认提交" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil];
alertView.delegate = self;
alertView.tag = SubmitTag;
[alertView show];
}
break;
default:
break;
}
......@@ -223,6 +232,8 @@ typedef enum : NSUInteger {
btnTag = EndTag;
}else if ([arr[i] isEqualToString:@"作废"]) {
btnTag = AbortTag;
}else if ([arr[i] isEqualToString:@"提交"]) {
btnTag = SubmitTag;
}
CGRect btnFrame = CGRectMake(LeftMargin + (LeftMargin + btnWidth)*i, ScreenSize.height - 64 - BottomHeight +5, btnWidth, 40);
UIButton *perBtn = [IBTCustomButtom creatButtonWithFrame:btnFrame target:self sel:@selector(btnClick:) tag:btnTag image:nil title:arr[i] titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_COMMIT_COLOR];
......@@ -263,6 +274,18 @@ typedef enum : NSUInteger {
}else{
[self createBtnWithArr:arr];
}
}else if ([self.transport.state isEqualToString:TRANSPORT_STATE_PROCESSFAIL]){
NSMutableArray *arr = [NSMutableArray array];
if ([IBTCommon checkIsPermission:TRANSPORT_ACTION_ABORT]) {
[arr addObject:@"作废"];
}if ([IBTCommon checkIsPermission:TRANSPORT_ACTION_NEW]) {
[arr addObject:@"提交"];
}
if (arr.count == 0) {
[self hiddenAllBtn];
}else{
[self createBtnWithArr:arr];
}
}else{
[self hiddenAllBtn];
}
......@@ -333,9 +356,56 @@ typedef enum : NSUInteger {
if (buttonIndex == 1) {
[self dealByAction:TRANSPORT_STATE_RECEIVED];//结束
}
}else if (alertView.tag == SubmitTag){
if (buttonIndex == 1) {
[self getDataFromServer:TRANSPORT_STATE_RECEIVED msg:@"正在提交..."];
}
}
}
#pragma mark - 提交
- (void)getDataFromServer:(NSString *)state msg:(NSString *)msg{
//保存
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"];
if (success == 1) {
[ICRUserUtil sharedInstance].needFresh = YES;
[self PopViewControllerAnimated:YES];
}else{
[IBTLoadingView showTips:message];
}
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
NSDictionary *dict = @{@"uuid":self.transport.uuid,
@"version":self.transport.version,
@"billnumber":self.transport.billnumber,
@"enterprise":[ICRUserUtil sharedInstance].orgId,
@"state":TRANSPORT_STATE_RECEIVED,
@"warehouseUuid":[IBTCommon checkString:self.transport.warehouseUuid],
@"warehouseCode":[IBTCommon checkString:self.transport.warehouseCode],
@"warehouseName":[IBTCommon checkString:self.transport.warehouseName],
@"rwarehouseUuid":[IBTCommon checkString:self.transport.rwarehouseUuid],
@"rwarehouseCode":[IBTCommon checkString:self.transport.rwarehouseCode],
@"rwarehouseName":[IBTCommon checkString:self.transport.rwarehouseName],
@"carnumber":[IBTCommon checkString:self.transport.carnumber],
@"type":[IBTCommon checkString:self.transport.type],
@"carphone":[IBTCommon checkString:self.transport.carphone],
@"arriveDate":[IBTCommon checkString:self.transport.arriveDate],
@"note":[IBTCommon checkString:self.transport.note],
@"pdtDetails":self.transport.pdtDetails,
@"accountDetails":self.transport.accountDetails};
[IBTLoadingView showProgressLabel:msg];
[[ICRHTTPController sharedController] saveAndSubmitTransportWithData:dict success:succ failure:fail];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
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