Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
xffruit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
xffruit
Commits
70926883
Commit
70926883
authored
7 years ago
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发运单收货逻辑完成
parent
c8199aad
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
301 additions
and
89 deletions
+301
-89
project.pbxproj
XFFruit.xcodeproj/project.pbxproj
+2
-2
ICRHTTPController.h
XFFruit/Controllers/HTTPController/ICRHTTPController.h
+10
-0
ICRHTTPController.m
XFFruit/Controllers/HTTPController/ICRHTTPController.m
+28
-0
IBTConstants.h
XFFruit/Utilities/IBTUIKit/IBTConstants.h
+4
-1
PurchaseDetailViewController.m
...llers/Purchase/Controllers/PurchaseDetailViewController.m
+11
-8
TransferPdtDetail.h
XFFruit/ViewControllers/Transfer/Models/TransferPdtDetail.h
+3
-0
TransferPdtDetail.m
XFFruit/ViewControllers/Transfer/Models/TransferPdtDetail.m
+18
-0
NewTransportViewController.m
...ollers/Transport/Controllers/NewTransportViewController.m
+9
-0
TransportDetailViewController.h
...ers/Transport/Controllers/TransportDetailViewController.h
+20
-0
TransportDetailViewController.m
...ers/Transport/Controllers/TransportDetailViewController.m
+173
-64
TransportPurchaseViewController.m
...s/Transport/Controllers/TransportPurchaseViewController.m
+1
-1
TransportViewController.m
...ntrollers/Transport/Controllers/TransportViewController.m
+18
-12
Transport.h
XFFruit/ViewControllers/Transport/Models/Transport.h
+1
-1
TransportPdtDetail.h
...uit/ViewControllers/Transport/Models/TransportPdtDetail.h
+3
-0
No files found.
XFFruit.xcodeproj/project.pbxproj
View file @
70926883
...
...
@@ -4432,7 +4432,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.xffruit
;
PRODUCT_NAME
=
XFFruit
;
PROVISIONING_PROFILE
=
"
e2cec26c-3666-4512-9b9a-cdb4cd9da56d
"
;
PROVISIONING_PROFILE
=
""
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
};
name
=
Debug
;
...
...
@@ -4457,7 +4457,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.xffruit
;
PRODUCT_NAME
=
XFFruit
;
PROVISIONING_PROFILE
=
"
e2cec26c-3666-4512-9b9a-cdb4cd9da56d
"
;
PROVISIONING_PROFILE
=
""
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
};
name
=
Release
;
...
...
This diff is collapsed.
Click to expand it.
XFFruit/Controllers/HTTPController/ICRHTTPController.h
View file @
70926883
...
...
@@ -358,6 +358,16 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
-
(
void
)
recievePurchase
:(
id
)
data
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
/**
* 发运单收货
*
* @param data data description
* @param succ succ description
* @param fail fail description
*/
-
(
void
)
recieveTransport
:(
id
)
data
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
/**
* 获取采购单库存库存
*
...
...
This diff is collapsed.
Click to expand it.
XFFruit/Controllers/HTTPController/ICRHTTPController.m
View file @
70926883
...
...
@@ -2386,6 +2386,34 @@ acceptTypeJson:YES
success
:
success
failure
:
failure
];
}
-
(
void
)
recieveTransport
:
(
id
)
data
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
void
(
^
success
)(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
=
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
CLog
(
@"%@"
,
responseObject
);
if
(
succ
)
{
succ
(
responseObject
);
}
};
void
(
^
failure
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
=
^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
CLog
(
@"%@"
,
error
);
if
(
fail
)
{
fail
(
error
);
}
};
ICRUserUtil
*
userUtil
=
[
ICRUserUtil
sharedInstance
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/transport/receive?time=%@&operId=%@&operName=%@"
,
HTTP_REST_API_BASE_URL
,[[
NSDate
date
]
httpParameterString
],
userUtil
.
userCode
,
userUtil
.
displayName
];
NSString
*
encodeUrlStr
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
[
self
POST
:
encodeUrlStr
parameters
:
data
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
/**
* 获取采购单库存库存
*
...
...
This diff is collapsed.
Click to expand it.
XFFruit/Utilities/IBTUIKit/IBTConstants.h
View file @
70926883
...
...
@@ -185,12 +185,15 @@
//发运单状态
#define TRANSPORT_STATE_INITIAL @"initial" //未提交
#define TRANSPORT_STATE_UNRECEIVED @"
unreceived
"//未收货
#define TRANSPORT_STATE_UNRECEIVED @"
waitReceive
"//未收货
#define TRANSPORT_STATE_RECEIVED @"received" //已收货
#define TRANSPORT_STATE_ABORTED @"aborted" //已废用
#define TRANSPORT_STATE_FINISHED @"finished" //已完成
#define TRANSPORT_STATE_PROCESS @"process"//提交系统处理
#define TRANSPORT_STATE_PROCESSFAIL @"processFail"//系统处理失败
//采购通知单状态
//initial("未提交"), notAccepted("未接受"), purchasing("采购中"), finished("已完成")
#define PURCHASENOTICE_STATE_INITIAL @"initial"
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/PurchaseDetailViewController.m
View file @
70926883
...
...
@@ -88,8 +88,6 @@ typedef enum : NSUInteger {
* 外部单据号
*/
@property
(
strong
,
nonatomic
)
UILabel
*
labelOutSideNum
;
@property
(
nonatomic
,
assign
)
BOOL
isNotShowEdit
;
//@property (nonatomic,strong)RejectView *rejectView;
@property
(
nonatomic
,
strong
)
NSString
*
rejectCause
;
//拒接原因
@end
...
...
@@ -103,7 +101,9 @@ typedef enum : NSUInteger {
[
self
bulidLayout
];
[
self
getDataFromServer
];
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
void
)
judgeType
{
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_WAITE_RECIEVE
]
||
[
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_RECEIVED
]
||
...
...
@@ -415,7 +415,6 @@ typedef enum : NSUInteger {
_pvc
=
[[
ReceiveProductViewController
alloc
]
init
];
_pvc
.
viewFrame
=
_recieveBottomView
.
bounds
;
_pvc
.
isHiddenAdd
=
YES
;
_pvc
.
isHiddenEdit
=
self
.
isNotShowEdit
;
[
_recieveBottomView
addSubview
:
_pvc
.
view
];
}
else
{
_aBottomView
=
[[
BottomPurchaseView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_purchaseView
.
frame
)
+
TopMargin
,
ScreenSize
.
width
,
300
)
withHidden
:
YES
];
...
...
@@ -552,16 +551,20 @@ typedef enum : NSUInteger {
[
p
setValuesForKeysWithDictionary
:
billDict
];
billProbuct
.
purchasePdt
=
p
;
if
(
self
.
isCenter
)
{
[
billProbuct
z_setRctQty
:
p
.
qty
.
floatValue
];
}
else
if
(
self
.
isWms
){
[
billProbuct
z_setRctQty
:
0
];
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_WAITE_RECIEVE
])
{
if
(
self
.
isCenter
)
{
[
billProbuct
z_setRctQty
:
p
.
qty
.
floatValue
];
}
else
if
(
self
.
isWms
){
[
billProbuct
z_setRctQty
:
0
];
}
}
[
productArr
addObject
:
billProbuct
];
}
_pvc
.
productArr
=
productArr
;
[
_pvc
.
tableView
reloadData
];
//如果是wms,非中心仓,则审核直接收货
if
(
self
.
isWms
&&
self
.
isCenter
==
NO
)
{
[
self
httpRecieve
];
}
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transfer/Models/TransferPdtDetail.h
View file @
70926883
...
...
@@ -8,6 +8,7 @@
#import "IBTModel.h"
#import "PurchaseBillProduct.h"
#import "TransportPdtDetail.h"
@interface
TransferPdtDetail
:
IBTModel
@property
(
nonatomic
,
strong
)
NSString
*
uuid
;
//唯一标识
@property
(
nonatomic
,
strong
)
NSString
*
productUuid
;
//商品id
...
...
@@ -56,7 +57,9 @@
@property
(
nonatomic
,
strong
)
NSNumber
*
shippedQty
;
//发运包装数量
@property
(
nonatomic
,
strong
)
NSNumber
*
shippedBaseQty
;
//发运基础数量
@property
(
strong
,
nonatomic
)
PurchaseBillProduct
*
purchasePdt
;
@property
(
strong
,
nonatomic
)
TransportPdtDetail
*
transportPdt
;
-
(
PurchaseBillProduct
*
)
changeToPurchasePdt
;
-
(
TransportPdtDetail
*
)
changeToTransportPdt
;
-
(
void
)
z_setRctQty
:(
CGFloat
)
qty
;
@end
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transfer/Models/TransferPdtDetail.m
View file @
70926883
...
...
@@ -19,6 +19,13 @@
self
.
packprice
=
purchasePdt
.
price
;
self
.
rctQty
=
purchasePdt
.
receivedQty
;
self
.
rctBaseQty
=
purchasePdt
.
receivedBaseQty
;
}
-
(
void
)
setTransportPdt
:(
TransportPdtDetail
*
)
transportPdt
{
_transportPdt
=
transportPdt
;
self
.
rctQty
=
transportPdt
.
receivedQty
;
self
.
rctBaseQty
=
transportPdt
.
receivedBaseQty
;
}
-
(
PurchaseBillProduct
*
)
changeToPurchasePdt
{
...
...
@@ -32,6 +39,17 @@
return
self
.
purchasePdt
;
}
-
(
TransportPdtDetail
*
)
changeToTransportPdt
{
if
(
!
self
.
transportPdt
)
{
self
.
transportPdt
=
[
TransportPdtDetail
new
];
NSDictionary
*
dict
=
[
self
dictForCommit
];
[
self
.
transportPdt
setValuesForKeysWithDictionary
:
dict
];
}
self
.
transportPdt
.
receivedQty
=
self
.
rctQty
;
self
.
transportPdt
.
receivedBaseQty
=
self
.
rctBaseQty
;
return
self
.
transportPdt
;
}
-
(
void
)
z_setRctQty
:
(
CGFloat
)
qty
{
//基础数量【实收】= 包装数量【实收】* 规格
float
baseCount
=
qty
*
[
self
.
qpc
floatValue
];
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/NewTransportViewController.m
View file @
70926883
...
...
@@ -209,11 +209,20 @@ typedef enum : NSUInteger {
[
costs
addObject
:[
fee
dictForCommit
]];
}
//获取到期时间
NSString
*
dateString
=
[[
NSDate
date
]
httpParameterString
];
NSDateFormatter
*
f
=
[
NSDateFormatter
new
];
[
f
setDateFormat
:
@"yyy-MM-dd HH:ss:mm"
];
NSDate
*
date
=
[
f
dateFromString
:
dateString
];
NSDate
*
new
=
[
NSDate
dateWithTimeInterval
:
60
*
60
*
24
*
5
sinceDate
:
date
];
NSString
*
expiredTime
=
[
f
stringFromDate
:
new
];
NSDictionary
*
dict
=
@{
@"uuid"
:
uuidObject
,
@"version"
:
versionObject
,
@"billnumber"
:
billNumberObject
,
@"enterprise"
:
[
ICRUserUtil
sharedInstance
].
orgId
,
@"state"
:
stateObject
,
@"expiredDate"
:
expiredTime
,
@"warehouseUuid"
:
[
IBTCommon
checkString
:
_sheetView
.
warehouseUuid
],
@"warehouseCode"
:
[
IBTCommon
checkString
:
_sheetView
.
warehouseCode
],
@"warehouseName"
:
[
IBTCommon
checkString
:
_sheetView
.
warehouseName
],
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/TransportDetailViewController.h
View file @
70926883
...
...
@@ -8,6 +8,26 @@
#import "ICRBaseViewController.h"
#import "Transport.h"
/**
* 发运单状态
*/
typedef
NS_ENUM
(
NSInteger
,
TransportType
)
{
/**
* 审核之前的状态(已保存、已提交)
*/
TransportTypeBeforeSubmit
=
1
,
/**
* 审核之后的状态(待收货、发运中等。。)
*/
TransportTypeAfterSubmit
,
};
@interface
TransportDetailViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
Transport
*
transport
;
@property
(
assign
,
nonatomic
)
TransportType
type
;
/**
* 收货仓库是否wms
*/
@property
(
nonatomic
,
assign
)
BOOL
isWms
;
@end
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/TransportDetailViewController.m
View file @
70926883
...
...
@@ -12,6 +12,11 @@
#import "TransportPdtDetail.h"
#import "FeeAcountDetail.h"
#import "BottomTransportView.h"
#import "TransferPdtDetail.h"
#import "ReceiveProductViewController.h"
#import "NewReceiveProductViewController.h"
#define BottomHeight 50
#define LeftMargin 15
#define LeftWidth 130
...
...
@@ -20,8 +25,8 @@
typedef
enum
:
NSUInteger
{
AbortTag
=
20000
,
EndTag
,
SubmitTag
SubmitTag
,
ReceiveTag
,
//收货状态:收货
}
BtnTag
;
@interface
TransportDetailViewController
()
...
...
@@ -32,6 +37,9 @@ typedef enum : NSUInteger {
UIButton
*
_firstBtn
;
UIButton
*
_secondBtn
;
BottomTransportView
*
_transView
;
ReceiveProductViewController
*
_pvc
;
UIView
*
_recieveBottomView
;
}
@property
(
nonatomic
,
strong
)
UILabel
*
billNumberLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
purchaseLabel
;
...
...
@@ -57,6 +65,7 @@ typedef enum : NSUInteger {
@property
(
nonatomic
,
strong
)
UILabel
*
leftArriveDateLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
leftNoteLabel
;
/**
* 创建时间
*/
...
...
@@ -92,6 +101,11 @@ typedef enum : NSUInteger {
self
.
title
=
@"发运单详情"
;
[
self
bulifLayout
];
[
self
getDataFromServer
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
editReceiveProduct
:
)
name
:
KNOTIFICATION_EditReceiveProduct
object
:
nil
];
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
void
)
getDataFromServer
{
...
...
@@ -127,6 +141,7 @@ typedef enum : NSUInteger {
-
(
void
)
fetchtTransportDetail
{
_pvc
.
isHiddenEdit
=
!
[
self
.
transport
.
state
isEqualToString
:
TRANSPORT_STATE_UNRECEIVED
];
self
.
billNumberLabel
.
text
=
[
IBTCommon
checkString
:
self
.
transport
.
billnumber
];
if
([
self
.
transport
.
state
isEqualToString
:
TRANSPORT_STATE_UNRECEIVED
])
{
self
.
stateLabel
.
textColor
=
[
UIColor
redColor
];
...
...
@@ -153,14 +168,39 @@ typedef enum : NSUInteger {
self
.
createOperLabel
.
text
=
[
IBTCommon
checkString
:
self
.
transport
.
create_operName
];
self
.
labelCreateTime
.
text
=
[
IBTCommon
checkString
:
self
.
transport
.
create_time
];
self
.
labelCreateTime
.
text
=
[
IBTCommon
checkString
:
self
.
transport
.
create_time
];
self
.
label
Inspector
.
text
=
[
IBTCommon
checkString
:
self
.
transport
.
approv
_operName
];
self
.
label
InspectTime
.
text
=
[
IBTCommon
checkString
:
self
.
transport
.
approv
_time
];
self
.
label
Reciever
.
text
=
[
IBTCommon
checkString
:
self
.
transport
.
receive
_operName
];
self
.
label
RecieveTime
.
text
=
[
IBTCommon
checkString
:
self
.
transport
.
receive
_time
];
self
.
labelExpiredDate
.
text
=
[
IBTCommon
checkString
:
self
.
transport
.
expiredDate
];
self
.
lastModifierLabel
.
text
=
[
IBTCommon
checkString
:
self
.
transport
.
lastModify_operName
];
self
.
arriveDateLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@"
,
self
.
transport
.
arriveDate
?[[
IBTCommon
checkString
:
self
.
transport
.
arriveDate
]
substringToIndex
:
10
]:
@"无"
];
[
_transView
refreshTranProduct
:
self
.
transport
.
pdtDetails
];
[
_transView
refreshCost
:
self
.
transport
.
accountDetails
];
[
self
setNoteHeight
];
NSMutableArray
*
productArr
=
[
NSMutableArray
array
];
if
(
self
.
type
==
TransportTypeAfterSubmit
)
{
for
(
NSDictionary
*
billDict
in
self
.
transport
.
pdtDetails
)
{
TransferPdtDetail
*
billProbuct
=
[
TransferPdtDetail
new
];
[
billProbuct
setValuesForKeysWithDictionary
:
billDict
];
TransportPdtDetail
*
t
=
[
TransportPdtDetail
new
];
[
t
setValuesForKeysWithDictionary
:
billDict
];
billProbuct
.
transportPdt
=
t
;
if
([
self
.
transport
.
state
isEqualToString
:
TRANSPORT_STATE_UNRECEIVED
])
{
if
(
self
.
isWms
){
[
billProbuct
z_setRctQty
:
0
];
}
}
[
productArr
addObject
:
billProbuct
];
}
_pvc
.
productArr
=
productArr
;
[
_pvc
.
tableView
reloadData
];
[
self
setNoteHeight
];
}
else
{
[
_transView
refreshTranProduct
:
self
.
transport
.
pdtDetails
];
[
_transView
refreshCost
:
self
.
transport
.
accountDetails
];
[
self
setNoteHeight
];
}
}
-
(
NSString
*
)
getPurchaseWith
:
(
NSArray
*
)
purchases
{
NSString
*
purchseNumber
=
@""
;
...
...
@@ -202,11 +242,22 @@ typedef enum : NSUInteger {
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
);
if
(
self
.
type
==
TransportTypeAfterSubmit
)
{
CGRect
bottomFrame
=
_recieveBottomView
.
frame
;
bottomFrame
.
origin
.
y
=
CGRectGetMaxY
(
_transportView
.
frame
)
+
TopMargin
;
_recieveBottomView
.
backgroundColor
=
[
UIColor
redColor
];
_recieveBottomView
.
frame
=
bottomFrame
;
_scrollView
.
contentSize
=
CGSizeMake
(
ScreenSize
.
width
,
totalHeight
+
CGRectGetHeight
(
_recieveBottomView
.
frame
)
+
TopMargin
*
2
+
100
);
}
else
{
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
);
}
}
-
(
void
)
btnClick
:
(
UIButton
*
)
btn
{
...
...
@@ -237,6 +288,17 @@ typedef enum : NSUInteger {
alertView
.
delegate
=
self
;
alertView
.
tag
=
SubmitTag
;
[
alertView
show
];
}
break
;
case
ReceiveTag
:
{
if
([
self
checkReceive
])
{
UIAlertView
*
alertView
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"温馨提示"
message
:
@"收货后不能重复收货,请确认是否要收货?"
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"确认"
,
nil
];
alertView
.
delegate
=
self
;
alertView
.
tag
=
ReceiveTag
;
[
alertView
show
];
}
}
break
;
default
:
...
...
@@ -287,6 +349,8 @@ typedef enum : NSUInteger {
btnTag
=
AbortTag
;
}
else
if
([
arr
[
i
]
isEqualToString
:
@"提交"
])
{
btnTag
=
SubmitTag
;
}
else
if
([
arr
[
i
]
isEqualToString
:
@"收货"
]){
btnTag
=
ReceiveTag
;
}
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
];
...
...
@@ -318,10 +382,10 @@ typedef enum : NSUInteger {
if
([
IBTCommon
checkIsPermission
:
TRANSPORT_ACTION_ABORT
])
{
[
arr
addObject
:
@"作废"
];
}
if
([
IBTCommon
checkIsPermission
:
TRANSPORT_ACTION_FINISH
])
{
[
arr
addObject
:
@"结束"
];
}
//
if([IBTCommon checkIsPermission:TRANSPORT_ACTION_FINISH])
//
{
//
[arr addObject:@"结束"];
//
}
if
(
arr
.
count
==
0
)
{
[
self
hiddenAllBtn
];
}
else
{
...
...
@@ -339,10 +403,14 @@ typedef enum : NSUInteger {
}
else
{
[
self
createBtnWithArr
:
arr
];
}
}
else
if
([
self
.
transport
.
state
isEqualToString
:
TRANSPORT_STATE_UNRECEIVED
]
&&
!
self
.
isWms
){
[
self
createBtnWithArr
:@[
@"收货"
]];
}
else
{
[
self
hiddenAllBtn
];
}
NSArray
*
leftArr
=
@[
@"单号:"
,
@"采购单:"
,
@"状态:"
,
@"发货仓库:"
,
@"收货仓库:"
,
@"车辆:"
,
@"司机电话:"
,
@"创建人:"
,
@"创建时间:"
,
@"
审核人:"
,
@"审核时间:"
,
@"
收货人:"
,
@"收货时间:"
,
@"有效期:"
,
@"最后修改人:"
,
@"预计到货时间:"
,
@"备注:"
];
NSArray
*
leftArr
=
@[
@"单号:"
,
@"采购单:"
,
@"状态:"
,
@"发货仓库:"
,
@"收货仓库:"
,
@"车辆:"
,
@"司机电话:"
,
@"创建人:"
,
@"创建时间:"
,
@"收货人:"
,
@"收货时间:"
,
@"有效期:"
,
@"最后修改人:"
,
@"预计到货时间:"
,
@"备注:"
];
self
.
leftArr
=
leftArr
;
CGFloat
height
=
LeftHeight
*
leftArr
.
count
+
LeftMargin
;
_transportView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
TopMargin
,
ScreenSize
.
width
,
height
)];
...
...
@@ -417,62 +485,31 @@ typedef enum : NSUInteger {
}
else
if
([
title
isEqualToString
:
@"有效期:"
]){
self
.
labelExpiredDate
=
rightLabel
;
}
// if (i == 0) {
// self.billNumberLabel = rightLabel;
// self.leftBillNumberLabel = leftLabel;
// }else if (i == 1) {
// self.purchaseLabel = rightLabel;
// self.purchaseLabel.numberOfLines = 0;
// self.leftPurchaseLabel = leftLabel;
// }else if(i == 2){
// self.stateLabel = rightLabel;
// self.leftStateLabel = leftLabel;
// }else if(i == 3){
// self.warehouseLabel = rightLabel;
// self.leftWarehouseLabel = leftLabel;
// }else if(i == 4){
// self.rwarehouseLabel = rightLabel;
// self.leftRwarehouseLabel = leftLabel;
// }else if(i == 5){
// self.carnumberLabel = rightLabel;
// self.leftCarnumberLabel = leftLabel;
// }else if(i == 6){
// self.carhoneLabel = rightLabel;
// self.leftCarhoneLabel = leftLabel;
// }else if(i == 7){
// self.createOperLabel = rightLabel;
// self.leftCreateOperLabel = leftLabel;
// }else if(i == 8){//最后修改人
// self.lastModifierLabel = rightLabel;
// self.leftLastModifierLabel = leftLabel;
// }else if(i == 9){
// leftLabel.width = LeftWidth + 10;
// rightLabel.left = leftLabel.right;
// rightLabel.width = ScreenSize.width - leftLabel.width - LeftMargin;
// self.arriveDateLabel = rightLabel;
// self.leftArriveDateLabel = leftLabel;
// }else if(i == leftArr.count - 1){
// rightLabel.numberOfLines = 0;
// self.noteLabel = rightLabel;
// self.leftNoteLabel = leftLabel;
// }
[
_transportView
addSubview
:
rightLabel
];
}
[
self
createBottomView
];
}
-
(
void
)
createBottomView
{
_bottomView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_transportView
.
frame
)
+
TopMargin
,
ScreenSize
.
width
,
300
)];
_bottomView
.
backgroundColor
=
[
UIColor
whiteColor
];
if
(
self
.
type
==
TransportTypeAfterSubmit
)
{
_recieveBottomView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_transportView
.
frame
)
+
TopMargin
,
ScreenSize
.
width
,
300
)];
_recieveBottomView
.
backgroundColor
=
[
UIColor
redColor
];
[
_scrollView
addSubview
:
_recieveBottomView
];
_pvc
=
[[
ReceiveProductViewController
alloc
]
init
];
_pvc
.
viewFrame
=
_recieveBottomView
.
bounds
;
_pvc
.
isHiddenAdd
=
YES
;
[
_recieveBottomView
addSubview
:
_pvc
.
view
];
}
else
{
_bottomView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_transportView
.
frame
)
+
TopMargin
,
ScreenSize
.
width
,
300
)];
_bottomView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_scrollView
addSubview
:
_bottomView
];
_transView
=
[[
BottomTransportView
alloc
]
initWithFrame
:
_bottomView
.
bounds
withHidden
:
YES
];
[
_bottomView
addSubview
:
_transView
];
}
[
_scrollView
addSubview
:
_bottomView
];
_transView
=
[[
BottomTransportView
alloc
]
initWithFrame
:
_bottomView
.
bounds
withHidden
:
YES
];
[
_bottomView
addSubview
:
_transView
];
}
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
...
...
@@ -488,6 +525,10 @@ typedef enum : NSUInteger {
if
(
buttonIndex
==
1
)
{
[
self
getDataFromServer
:
TRANSPORT_STATE_RECEIVED
msg
:
@"正在提交..."
];
}
}
else
if
(
alertView
.
tag
==
ReceiveTag
){
if
(
buttonIndex
==
1
)
{
[
self
httpRecieve
];
}
}
}
...
...
@@ -534,6 +575,74 @@ typedef enum : NSUInteger {
}
-
(
void
)
editReceiveProduct
:
(
NSNotification
*
)
fination
{
NewReceiveProductViewController
*
nvc
=
[
NewReceiveProductViewController
new
];
NSInteger
indexTag
=
[[[
fination
userInfo
]
objectForKey
:
@"indexPath"
]
integerValue
];
TransferPdtDetail
*
transferPdtDetail
=
[[
fination
userInfo
]
objectForKey
:
@"transferPdtDetail"
];
if
(
transferPdtDetail
)
{
nvc
.
navTitle
=
@"商品明细"
;
nvc
.
indexTag
=
indexTag
;
nvc
.
noticeProduct
=
transferPdtDetail
;
}
nvc
.
editReceiveProduct
=
^
(
TransferPdtDetail
*
transferPdtDetail
,
NSInteger
indexTag
){
if
(
transferPdtDetail
)
{
[
_pvc
.
productArr
replaceObjectAtIndex
:
indexTag
withObject
:
transferPdtDetail
];
[
_pvc
.
defaultState
replaceObjectAtIndex
:
indexTag
withObject
:
@"YES"
];
[
_pvc
.
tableView
reloadData
];
}
};
[
self
PushViewController
:
nvc
animated
:
YES
];
}
-
(
void
)
httpRecieve
{
NSString
*
receiveTime
=
[[
NSDate
date
]
httpParameterString
];
self
.
transport
.
receive_time
=
receiveTime
;
self
.
transport
.
receive_id
=
[
ICRUserUtil
sharedInstance
].
userId
;
self
.
transport
.
receive_operName
=
[
ICRUserUtil
sharedInstance
].
userName
;
NSMutableDictionary
*
param
=
[
self
.
transport
dictForCommit
].
mutableCopy
;
NSMutableArray
*
arrProduct
=
[
NSMutableArray
array
];
for
(
TransferPdtDetail
*
pdt
in
_pvc
.
productArr
)
{
TransportPdtDetail
*
pPdt
=
[
pdt
changeToTransportPdt
];
NSDictionary
*
dict
=
[
pPdt
dictForCommit
];
[
arrProduct
addObject
:
dict
];
}
[
param
setObject
:
arrProduct
forKey
:
@"pdtDetails"
];
[
param
setObject
:
self
.
transport
.
accountDetails
forKey
:
@"accountDetails"
];
IBTLoadingView
*
hud
=
[
IBTLoadingView
showHUDAddedTo
:
self
.
view
animated
:
YES
];
__weak
UIViewController
*
weakSelf
=
self
;
[
HTTP
recieveTransport
:
param
success
:
^
(
id
succ
)
{
[
hud
hide
:
YES
];
if
([
succ
[
@"success"
]
boolValue
])
{
[
ICRUserUtil
sharedInstance
].
needFresh
=
YES
;
[
IBTLoadingView
showTips
:
@" 收货成功! "
];
[
weakSelf
.
navigationController
popViewControllerAnimated
:
YES
];
}
}
failure
:^
(
id
fail
)
{
[
IBTLoadingView
showTips
:
fail
];
}];
}
-
(
BOOL
)
checkReceive
{
for
(
NSString
*
isEdit
in
_pvc
.
defaultState
)
{
if
([
isEdit
isEqualToString
:
@"NO"
])
{
ShowMessage
(
@"有商品行没有编辑过收货数量,请先编辑再收货"
);
return
NO
;
}
}
if
(
_pvc
.
productArr
.
count
==
0
)
{
ShowMessage
(
@"商品不能为空"
);
return
NO
;
}
return
YES
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/TransportPurchaseViewController.m
View file @
70926883
...
...
@@ -82,7 +82,7 @@ NSInteger purchaseStockCheckNumber = 0;
billNumberObject
=
self
.
contentStr
;
}
NSDictionary
*
dict
=
@{
@"state"
:
@"shipping"
,
@"state"
:
PURCHASE_STATE_RECEIVED
,
@"queryOrders"
:
orderArr
,
@"userUuid"
:
userUtil
.
userId
,
@"billNumberProductLike"
:
billNumberObject
,
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/TransportViewController.m
View file @
70926883
...
...
@@ -450,10 +450,16 @@ typedef enum : NSUInteger {
nvc
.
title
=
@"修改发运单"
;
[
self
PushViewController
:
nvc
animated
:
YES
];
}
else
{
TransportDetailViewController
*
pvc
=
[
TransportDetailViewController
new
];
pvc
.
title
=
@"查看发运单"
;
pvc
.
transport
=
transport
;
[
self
PushViewController
:
pvc
animated
:
YES
];
[
HTTP
isWmsWarehouse
:
transport
.
rwarehouseUuid
success
:
^
(
id
succ
)
{
TransportDetailViewController
*
pvc
=
[
TransportDetailViewController
new
];
pvc
.
title
=
@"查看发运单"
;
pvc
.
type
=
TransportTypeAfterSubmit
;
pvc
.
isWms
=
[
succ
[
@"data"
]
boolValue
];
pvc
.
transport
=
transport
;
[
self
PushViewController
:
pvc
animated
:
YES
];
}
failure
:
nil
];
}
}
}
...
...
@@ -485,13 +491,13 @@ typedef enum : NSUInteger {
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Models/Transport.h
View file @
70926883
...
...
@@ -14,7 +14,7 @@
@property
(
nonatomic
,
strong
)
NSString
*
warehouseUuid
;
//仓库id
@property
(
nonatomic
,
strong
)
NSString
*
warehouseCode
;
//仓库代码
@property
(
nonatomic
,
strong
)
NSString
*
warehouseName
;
//仓库名称
@property
(
strong
,
nonatomic
)
NSString
*
enterprise
;
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseUuid
;
//收货仓库id
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseCode
;
//收货仓库代码
@property
(
nonatomic
,
strong
)
NSString
*
rwarehouseName
;
//收货仓库名称
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Models/TransportPdtDetail.h
View file @
70926883
...
...
@@ -32,5 +32,8 @@
@property
(
nonatomic
,
strong
)
NSString
*
carphone
;
//司机电话
@property
(
nonatomic
,
strong
)
NSString
*
carnumber
;
//车牌号
@property
(
strong
,
nonatomic
)
NSNumber
*
receivedQty
;
//收货数量
@property
(
strong
,
nonatomic
)
NSNumber
*
receivedBaseQty
;
//收货基础数量
@end
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment