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
c70042bf
Commit
c70042bf
authored
7 years ago
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
a44e79ee
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
185 additions
and
27 deletions
+185
-27
ICRHTTPController.h
XFFruit/Controllers/HTTPController/ICRHTTPController.h
+3
-0
ICRHTTPController.m
XFFruit/Controllers/HTTPController/ICRHTTPController.m
+32
-0
Info.plist
XFFruit/Info.plist
+2
-2
NewPurchaseViewController.m
...trollers/Purchase/Controllers/NewPurchaseViewController.m
+1
-0
PurchaseDetailViewController.m
...llers/Purchase/Controllers/PurchaseDetailViewController.m
+11
-11
ShopDetaileViewController.h
...trollers/PurchaseNotice/Views/ShopDetaileViewController.h
+8
-0
ShopDetaileViewController.m
...trollers/PurchaseNotice/Views/ShopDetaileViewController.m
+57
-4
NewTransportViewController.m
...ollers/Transport/Controllers/NewTransportViewController.m
+16
-0
TransportDetailViewController.m
...ers/Transport/Controllers/TransportDetailViewController.m
+8
-1
TransportPurchaseViewController.h
...s/Transport/Controllers/TransportPurchaseViewController.h
+3
-0
TransportPurchaseViewController.m
...s/Transport/Controllers/TransportPurchaseViewController.m
+38
-9
TransportPdtDetail.h
...uit/ViewControllers/Transport/Models/TransportPdtDetail.h
+6
-0
No files found.
XFFruit/Controllers/HTTPController/ICRHTTPController.h
View file @
c70042bf
...
@@ -378,6 +378,9 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
...
@@ -378,6 +378,9 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
-
(
void
)
purchaseStockWithPurchaseUuid
:(
NSString
*
)
PurchaseUuid
-
(
void
)
purchaseStockWithPurchaseUuid
:(
NSString
*
)
PurchaseUuid
success
:(
void
(
^
)(
id
))
succ
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
failure
:(
void
(
^
)(
id
))
fail
;
-
(
void
)
purchaseStockWithPurchaseUuid
:(
NSString
*
)
PurchaseUuid
product
:(
NSString
*
)
productCode
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
/**
/**
* 是否wms仓库
* 是否wms仓库
...
...
This diff is collapsed.
Click to expand it.
XFFruit/Controllers/HTTPController/ICRHTTPController.m
View file @
c70042bf
...
@@ -2454,6 +2454,38 @@ acceptTypeJson:YES
...
@@ -2454,6 +2454,38 @@ acceptTypeJson:YES
failure
:
failure
];
failure
:
failure
];
}
}
-
(
void
)
purchaseStockWithPurchaseUuid
:
(
NSString
*
)
PurchaseUuid
product
:
(
NSString
*
)
productCode
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
if
(
!
PurchaseUuid
)
{
if
(
fail
)
{
fail
(
[[
self
class
]
ErrorWithMsg
:
ERROR_PARAMETER
code
:
0
]
);
}
return
;
}
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
);
}
};
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/mdata/inv/gets/%@?productCode=%@"
,
HTTP_REST_API_BASE_URL
,
PurchaseUuid
,
productCode
];
NSString
*
encodeUrlStr
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
[
self
GET
:
encodeUrlStr
parameters
:
nil
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
/**
/**
* 是否wms仓库
* 是否wms仓库
...
...
This diff is collapsed.
Click to expand it.
XFFruit/Info.plist
View file @
c70042bf
...
@@ -15,11 +15,11 @@
...
@@ -15,11 +15,11 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.2.1
7
<
/string
>
<
string
>
1.2.1
8
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.2.1
7
<
/string
>
<
string
>
1.2.1
8
<
/string
>
<
k
e
y
>
NSAppTransportSecurity
<
/k
e
y
>
<
k
e
y
>
NSAppTransportSecurity
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
NSAllowsArbitraryLoads
<
/k
e
y
>
<
k
e
y
>
NSAllowsArbitraryLoads
<
/k
e
y
>
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/NewPurchaseViewController.m
View file @
c70042bf
...
@@ -249,6 +249,7 @@ typedef enum : NSUInteger {
...
@@ -249,6 +249,7 @@ typedef enum : NSUInteger {
NSInteger
indexTag
=
[[[
fication
userInfo
]
objectForKey
:
@"indexTag"
]
integerValue
];
NSInteger
indexTag
=
[[[
fication
userInfo
]
objectForKey
:
@"indexTag"
]
integerValue
];
ShopDetaileViewController
*
svc
=
[[
ShopDetaileViewController
alloc
]
init
];
ShopDetaileViewController
*
svc
=
[[
ShopDetaileViewController
alloc
]
init
];
if
(
billProduct
)
{
if
(
billProduct
)
{
svc
.
navTitle
=
@"编辑商品"
;
svc
.
navTitle
=
@"编辑商品"
;
ShopDetail
*
shopDetail
=
[
self
coverShopDetail
:
billProduct
];
ShopDetail
*
shopDetail
=
[
self
coverShopDetail
:
billProduct
];
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Purchase/Controllers/PurchaseDetailViewController.m
View file @
c70042bf
...
@@ -214,23 +214,23 @@ typedef enum : NSUInteger {
...
@@ -214,23 +214,23 @@ typedef enum : NSUInteger {
//显示结束按钮
//显示结束按钮
[
arr
addObject
:
@"结束"
];
[
arr
addObject
:
@"结束"
];
}
}
if
([
self
checkIsPermission
:
PURCHASE_PERMISSIONS_ABORT
]){
//作废权
//
if([self checkIsPermission:PURCHASE_PERMISSIONS_ABORT]){//作废权
//显示作废按钮
//
//显示作废按钮
[
arr
addObject
:
@"作废"
];
//
[arr addObject:@"作废"];
}
//
}
[
self
createBtnWithArr
:
arr
];
[
self
createBtnWithArr
:
arr
];
if
(
arr
.
count
==
0
)
{
if
(
arr
.
count
==
0
)
{
[
self
hiddenTwoBtn
];
[
self
hiddenTwoBtn
];
}
}
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_FINISHED
]){
//完成
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_FINISHED
]){
//完成
if
([
self
checkIsPermission
:
PURCHASE_PERMISSIONS_ABORT
])
{
//有作废权的
//
if ([self checkIsPermission:PURCHASE_PERMISSIONS_ABORT]) {//有作废权的
//显示作废按钮
//
//显示作废按钮
NSArray
*
arr
=
@[
@"作废"
];
//
NSArray *arr = @[@"作废"];
[
self
createBtnWithArr
:
arr
];
//
[self createBtnWithArr:arr];
//
}
else
{
//
}else{
[
self
hiddenTwoBtn
];
[
self
hiddenTwoBtn
];
}
//
}
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_PROCESSFAIL
]){
//系统处理失败的
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_PROCESSFAIL
]){
//系统处理失败的
if
([
self
checkIsPermission
:
PURCHASE_PERMISSIONS_ABORT
])
{
//有作废权的
if
([
self
checkIsPermission
:
PURCHASE_PERMISSIONS_ABORT
])
{
//有作废权的
//显示作废按钮
//显示作废按钮
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.h
View file @
c70042bf
...
@@ -9,10 +9,18 @@
...
@@ -9,10 +9,18 @@
#import "ICRBaseViewController.h"
#import "ICRBaseViewController.h"
#import "Survey.h"
#import "Survey.h"
#import "ShopDetail.h"
#import "ShopDetail.h"
typedef
NS_ENUM
(
NSInteger
,
ShopDetailInterType
)
{
ShopDetailInterTypeTransport
=
1
,
ShopDetailInterTypePurchase
,
ShopDetailInterTypeTranfer
};
typedef
void
(
^
ChoseShopDetail
)(
ShopDetail
*
shopDetail
);
typedef
void
(
^
ChoseShopDetail
)(
ShopDetail
*
shopDetail
);
@interface
ShopDetaileViewController
:
ICRBaseViewController
@interface
ShopDetaileViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
Survey
*
survey
;
@property
(
nonatomic
,
strong
)
Survey
*
survey
;
@property
(
nonatomic
,
strong
)
ShopDetail
*
shopDetail
;
@property
(
nonatomic
,
strong
)
ShopDetail
*
shopDetail
;
@property
(
nonatomic
,
strong
)
ChoseShopDetail
choseShopDetail
;
@property
(
nonatomic
,
strong
)
ChoseShopDetail
choseShopDetail
;
@property
(
nonatomic
,
strong
)
NSString
*
navTitle
;
@property
(
nonatomic
,
strong
)
NSString
*
navTitle
;
@property
(
assign
,
nonatomic
)
ShopDetailInterType
intertype
;
@end
@end
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m
View file @
c70042bf
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#import "GXFSearchVendorViewController.h"
#import "GXFSearchVendorViewController.h"
#import "GXFProductUnit.h"
#import "GXFProductUnit.h"
#import "CalculateHelper.h"
#import "CalculateHelper.h"
#import "ProductStockModel.h"
#define LeftMargin 15
#define LeftMargin 15
#define BtnHeight 44
#define BtnHeight 44
#define TableHeight 46
#define TableHeight 46
...
@@ -174,11 +175,26 @@ typedef enum : NSUInteger {
...
@@ -174,11 +175,26 @@ typedef enum : NSUInteger {
break
;
break
;
case
CommitTag
:
case
CommitTag
:
{
{
if
([
self
informationComplete
])
{
if
([
self
informationComplete
])
{
ShopDetail
*
shopDetail
=
self
.
shopDetail
;
shopDetail
.
IsDeleted
=
NO
;
//只有发运单才需要差库存
self
.
choseShopDetail
(
shopDetail
);
//回调
if
(
self
.
intertype
==
ShopDetailInterTypeTransport
)
{
[
self
PopViewControllerAnimated
:
YES
];
__weak
ShopDetaileViewController
*
weakSelf
=
self
;
[
self
stockValidWithBillNumber
:
self
.
shopDetail
.
sourceBillNumber
complete
:
^
{
ShopDetail
*
shopDetail
=
self
.
shopDetail
;
shopDetail
.
IsDeleted
=
NO
;
weakSelf
.
choseShopDetail
(
shopDetail
);
//回调
[
weakSelf
PopViewControllerAnimated
:
YES
];
}];
}
else
{
ShopDetail
*
shopDetail
=
self
.
shopDetail
;
shopDetail
.
IsDeleted
=
NO
;
self
.
choseShopDetail
(
shopDetail
);
//回调
[
self
PopViewControllerAnimated
:
YES
];
}
}
}
}
}
break
;
break
;
...
@@ -186,6 +202,43 @@ typedef enum : NSUInteger {
...
@@ -186,6 +202,43 @@ typedef enum : NSUInteger {
break
;
break
;
}
}
}
}
-
(
void
)
stockValidWithBillNumber
:
(
NSString
*
)
billNumber
complete
:
(
void
(
^
)(
void
))
complete
{
__weak
ShopDetaileViewController
*
weakSelf
=
self
;
IBTLoadingView
*
hud
=
[
IBTLoadingView
showHUDAddedTo
:
self
.
view
animated
:
YES
];
[
HTTP
purchaseStockWithPurchaseUuid
:
billNumber
product
:
self
.
shopDetail
.
product_code
success
:^
(
id
succ
)
{
[
hud
hide
:
YES
];
[
IBTLoadingView
hideHUDForView
:
weakSelf
.
view
];
if
(
!
[
succ
[
@"data"
]
isKindOfClass
:[
NSArray
class
]])
{
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"该批次<%@>在总部系统的库存不足!"
,
billNumber
];
ShowMessage
(
msg
);
return
;
}
for
(
NSDictionary
*
dict
in
succ
[
@"data"
])
{
ProductStockModel
*
model
=
[
ProductStockModel
new
];
[
model
setValuesForKeysWithDictionary
:
dict
];
if
([
self
.
shopDetail
.
product_code
isEqualToString
:
model
.
productCode
])
{
if
(
self
.
shopDetail
.
foundationQuantity
.
floatValue
>
model
.
qty
.
floatValue
)
{
CLog
(
@"库存不足"
);
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"该批次<%@>在总部系统的库存不足!"
,
billNumber
];
ShowMessage
(
msg
);
return
;
}
}
}
complete
();
}
failure
:^
(
id
fail
)
{
[
hud
hide
:
YES
];
[
IBTLoadingView
showTips
:
fail
];
}];
}
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
if
(
buttonIndex
==
1
)
{
if
(
buttonIndex
==
1
)
{
if
(
self
.
shopDetail
!=
nil
)
{
if
(
self
.
shopDetail
!=
nil
)
{
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/NewTransportViewController.m
View file @
c70042bf
...
@@ -41,6 +41,10 @@ typedef enum : NSUInteger {
...
@@ -41,6 +41,10 @@ typedef enum : NSUInteger {
* 用户选择的第一个商品的采购单
* 用户选择的第一个商品的采购单
*/
*/
@property
(
strong
,
nonatomic
)
PurchaseBill
*
firstBill
;
@property
(
strong
,
nonatomic
)
PurchaseBill
*
firstBill
;
/**
* 缓存的选择的采购单数据
*/
@property
(
strong
,
nonatomic
)
NSMutableDictionary
*
dicProduct
;
@end
@end
@implementation
NewTransportViewController
@implementation
NewTransportViewController
...
@@ -334,8 +338,12 @@ typedef enum : NSUInteger {
...
@@ -334,8 +338,12 @@ typedef enum : NSUInteger {
}
}
};
};
tpv
.
dicProduct
=
self
.
dicProduct
;
[
self
PushViewController
:
tpv
animated
:
YES
];
[
self
PushViewController
:
tpv
animated
:
YES
];
}
}
-
(
void
)
addTransportCost
:
(
NSNotification
*
)
fination
{
-
(
void
)
addTransportCost
:
(
NSNotification
*
)
fination
{
NewCostViewController
*
nvc
=
[
NewCostViewController
new
];
NewCostViewController
*
nvc
=
[
NewCostViewController
new
];
...
@@ -368,6 +376,7 @@ typedef enum : NSUInteger {
...
@@ -368,6 +376,7 @@ typedef enum : NSUInteger {
ShopDetaileViewController
*
svc
=
[[
ShopDetaileViewController
alloc
]
init
];
ShopDetaileViewController
*
svc
=
[[
ShopDetaileViewController
alloc
]
init
];
if
(
billProduct
)
{
if
(
billProduct
)
{
svc
.
intertype
=
ShopDetailInterTypeTransport
;
svc
.
navTitle
=
@"编辑商品"
;
svc
.
navTitle
=
@"编辑商品"
;
ShopDetail
*
shopDetail
=
[
self
coverShopDetail
:
billProduct
];
ShopDetail
*
shopDetail
=
[
self
coverShopDetail
:
billProduct
];
shopDetail
.
IsXiuGai
=
YES
;
shopDetail
.
IsXiuGai
=
YES
;
...
@@ -467,6 +476,13 @@ typedef enum : NSUInteger {
...
@@ -467,6 +476,13 @@ typedef enum : NSUInteger {
}
}
}
}
-
(
NSMutableDictionary
*
)
dicProduct
{
if
(
!
_dicProduct
)
{
_dicProduct
=
[
NSMutableDictionary
dictionary
];
}
return
_dicProduct
;
}
/*
/*
#pragma mark - Navigation
#pragma mark - Navigation
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/TransportDetailViewController.m
View file @
c70042bf
...
@@ -550,7 +550,7 @@ typedef enum : NSUInteger {
...
@@ -550,7 +550,7 @@ typedef enum : NSUInteger {
}
}
}
else
if
(
alertView
.
tag
==
ReceiveTag
){
}
else
if
(
alertView
.
tag
==
ReceiveTag
){
if
(
buttonIndex
==
1
)
{
if
(
buttonIndex
==
1
)
{
[
self
httpRecieve
];
[
self
httpRecieve
];
}
}
}
else
if
(
alertView
.
tag
==
SaveTag
){
}
else
if
(
alertView
.
tag
==
SaveTag
){
if
(
buttonIndex
==
1
)
{
if
(
buttonIndex
==
1
)
{
...
@@ -717,6 +717,13 @@ typedef enum : NSUInteger {
...
@@ -717,6 +717,13 @@ typedef enum : NSUInteger {
return
NO
;
return
NO
;
}
}
for
(
TransferPdtDetail
*
pdt
in
_pvc
.
productArr
)
{
if
(
pdt
.
rctQty
==
nil
)
{
ShowMessage
(
@"有商品未填写收货数量!"
);
return
NO
;
}
}
return
YES
;
return
YES
;
}
}
-
(
void
)
didReceiveMemoryWarning
{
-
(
void
)
didReceiveMemoryWarning
{
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/TransportPurchaseViewController.h
View file @
c70042bf
...
@@ -18,4 +18,7 @@ typedef void(^GetPurchaseProduct)(NSArray *products);
...
@@ -18,4 +18,7 @@ typedef void(^GetPurchaseProduct)(NSArray *products);
* 如果是发运单界面进入,则只显示已收货的。否的话则是转运单进入,则不限时
* 如果是发运单界面进入,则只显示已收货的。否的话则是转运单进入,则不限时
*/
*/
@property
(
nonatomic
,
assign
)
BOOL
isTransportIn
;
@property
(
nonatomic
,
assign
)
BOOL
isTransportIn
;
@property
(
weak
,
nonatomic
)
NSMutableDictionary
*
dicProduct
;
@end
@end
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/TransportPurchaseViewController.m
View file @
c70042bf
...
@@ -124,7 +124,25 @@ NSInteger purchaseStockCheckNumber = 0;
...
@@ -124,7 +124,25 @@ NSInteger purchaseStockCheckNumber = 0;
PurchaseBill
*
purchaseBill
=
[[
PurchaseBill
alloc
]
init
];
PurchaseBill
*
purchaseBill
=
[[
PurchaseBill
alloc
]
init
];
[
purchaseBill
setValuesForKeysWithDictionary
:
purchaseBillDict
];
[
purchaseBill
setValuesForKeysWithDictionary
:
purchaseBillDict
];
purchaseBill
.
products
=
[
self
coverTransportDetProduct
:
purchaseBillDict
[
@"products"
]
purchaseBill
:
purchaseBill
];
purchaseBill
.
products
=
[
self
coverTransportDetProduct
:
purchaseBillDict
[
@"products"
]
purchaseBill
:
purchaseBill
];
[
self
.
dataArr
addObject
:
purchaseBill
];
//*******筛选掉已经选择过的商品******
//获取缓存的商品数据
NSMutableArray
*
arr
=
[
self
.
dicProduct
objectForKey
:
purchaseBill
.
billNumber
];
if
(
arr
.
count
==
purchaseBill
.
products
.
count
)
{
CLog
(
@"采购单中的商品已经全部选择过了,不显示这个采购单"
);
}
else
{
NSMutableArray
*
tempProduct
=
purchaseBill
.
products
.
mutableCopy
;
for
(
TransportPdtDetail
*
pdt
in
arr
)
{
for
(
TransportPdtDetail
*
onlinePdt
in
purchaseBill
.
products
)
{
if
([
pdt
.
productCode
isEqualToString
:
onlinePdt
.
productCode
])
{
[
tempProduct
removeObject
:
onlinePdt
];
}
}
}
purchaseBill
.
products
=
tempProduct
.
mutableCopy
;
[
self
.
dataArr
addObject
:
purchaseBill
];
}
}
}
NSDictionary
*
pageDict
=
data
[
@"data"
][
@"paging"
];
NSDictionary
*
pageDict
=
data
[
@"data"
][
@"paging"
];
...
@@ -160,6 +178,8 @@ NSInteger purchaseStockCheckNumber = 0;
...
@@ -160,6 +178,8 @@ NSInteger purchaseStockCheckNumber = 0;
detail
.
transferBaseQty
=
arrDict
[
@"shippedBaseQty"
];
detail
.
transferBaseQty
=
arrDict
[
@"shippedBaseQty"
];
detail
.
transferQty
=
arrDict
[
@"shippedQty"
];
detail
.
transferQty
=
arrDict
[
@"shippedQty"
];
detail
.
note
=
arrDict
[
@"remark"
]
!=
[
NSNull
null
]
?
arrDict
[
@"remark"
]
:
@"无"
;
detail
.
note
=
arrDict
[
@"remark"
]
!=
[
NSNull
null
]
?
arrDict
[
@"remark"
]
:
@"无"
;
[
transArr
addObject
:
detail
];
[
transArr
addObject
:
detail
];
}
}
return
transArr
;
return
transArr
;
...
@@ -284,15 +304,16 @@ NSInteger purchaseStockCheckNumber = 0;
...
@@ -284,15 +304,16 @@ NSInteger purchaseStockCheckNumber = 0;
-
(
void
)
sureClick
{
-
(
void
)
sureClick
{
NSMutableDictionary
*
dicProduct
=
[
NSMutableDictionary
dictionary
];
//
NSMutableDictionary *dicProduct = [NSMutableDictionary dictionary];
//把选中的商品和采购单对应,根据单号存储对应的商品
//把选中的商品和采购单对应,根据单号存储对应的商品
for
(
PurchaseBill
*
bill
in
self
.
dataArr
)
{
for
(
PurchaseBill
*
bill
in
self
.
dataArr
)
{
for
(
TransportPdtDetail
*
detail
in
bill
.
products
)
{
for
(
TransportPdtDetail
*
detail
in
bill
.
products
)
{
detail
.
purchasebillnumber
=
bill
.
billNumber
;
if
([
self
.
indexArr
containsObject
:
detail
])
{
if
([
self
.
indexArr
containsObject
:
detail
])
{
NSMutableArray
*
arrProduct
=
[
dicProduct
objectForKey
:
bill
.
billNumber
];
NSMutableArray
*
arrProduct
=
[
self
.
dicProduct
objectForKey
:
bill
.
billNumber
];
if
(
!
arrProduct
)
{
if
(
!
arrProduct
)
{
arrProduct
=
[
NSMutableArray
array
];
arrProduct
=
[
NSMutableArray
array
];
[
dicProduct
setObject
:
arrProduct
forKey
:
bill
.
billNumber
];
[
self
.
dicProduct
setObject
:
arrProduct
forKey
:
bill
.
billNumber
];
}
}
[
arrProduct
addObject
:
detail
];
[
arrProduct
addObject
:
detail
];
...
@@ -300,14 +321,14 @@ NSInteger purchaseStockCheckNumber = 0;
...
@@ -300,14 +321,14 @@ NSInteger purchaseStockCheckNumber = 0;
}
}
}
}
NSArray
*
array
=
dicProduct
.
allKeys
;
NSArray
*
array
=
self
.
dicProduct
.
allKeys
;
if
(
array
.
count
==
0
)
{
if
(
array
.
count
==
0
)
{
ShowMessage
(
@"请选择商品!"
);
ShowMessage
(
@"请选择商品!"
);
return
;
return
;
}
}
__weak
TransportPurchaseViewController
*
weakSelf
=
self
;
__weak
TransportPurchaseViewController
*
weakSelf
=
self
;
//判断数量问题
//判断数量问题
[
self
stockValidWithDic
:
dicProduct
billNumbers
:
array
complete
:^
{
[
self
stockValidWithDic
:
self
.
dicProduct
billNumbers
:
array
complete
:^
{
[
weakSelf
PopViewControllerAnimated
:
YES
];
[
weakSelf
PopViewControllerAnimated
:
YES
];
if
(
weakSelf
.
indexArr
.
count
>
0
)
{
if
(
weakSelf
.
indexArr
.
count
>
0
)
{
NSMutableArray
*
arr
=
[
NSMutableArray
array
];
NSMutableArray
*
arr
=
[
NSMutableArray
array
];
...
@@ -345,7 +366,8 @@ NSInteger purchaseStockCheckNumber = 0;
...
@@ -345,7 +366,8 @@ NSInteger purchaseStockCheckNumber = 0;
__weak
TransportPurchaseViewController
*
weakSelf
=
self
;
__weak
TransportPurchaseViewController
*
weakSelf
=
self
;
[
HTTP
purchaseStockWithPurchaseUuid
:
billNum
success
:
^
(
id
succ
)
{
[
HTTP
purchaseStockWithPurchaseUuid
:
billNum
success
:
^
(
id
succ
)
{
if
(
!
[
succ
[
@"data"
]
isKindOfClass
:[
NSArray
class
]])
{
if
(
!
[
succ
[
@"data"
]
isKindOfClass
:[
NSArray
class
]])
{
ShowMessage
(
@"库存不足!"
);
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"该批次<%@>在总部系统的库存不足!"
,
billNum
];
ShowMessage
(
msg
);
return
;
return
;
}
}
...
@@ -355,10 +377,10 @@ NSInteger purchaseStockCheckNumber = 0;
...
@@ -355,10 +377,10 @@ NSInteger purchaseStockCheckNumber = 0;
for
(
TransportPdtDetail
*
detail
in
arrProducts
)
{
for
(
TransportPdtDetail
*
detail
in
arrProducts
)
{
if
([
detail
.
productCode
isEqualToString
:
model
.
productCode
])
{
if
([
detail
.
productCode
isEqualToString
:
model
.
productCode
])
{
if
(
detail
.
q
ty
.
floatValue
>
model
.
qty
.
floatValue
)
{
if
(
detail
.
baseQ
ty
.
floatValue
>
model
.
qty
.
floatValue
)
{
CLog
(
@"库存不足"
);
CLog
(
@"库存不足"
);
purchaseStockCheckNumber
=
0
;
purchaseStockCheckNumber
=
0
;
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"
%@库存不足!"
,
detail
.
productName
];
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"
该批次<%@>的商品%@在总部系统的库存不足!"
,
billNum
,
detail
.
productName
];
ShowMessage
(
msg
);
ShowMessage
(
msg
);
return
;
return
;
}
}
...
@@ -379,6 +401,13 @@ NSInteger purchaseStockCheckNumber = 0;
...
@@ -379,6 +401,13 @@ NSInteger purchaseStockCheckNumber = 0;
}];
}];
}
}
-
(
NSMutableDictionary
*
)
dicProduct
{
if
(
!
_dicProduct
)
{
_dicProduct
=
[
NSMutableDictionary
dictionary
];
}
return
_dicProduct
;
}
-
(
void
)
didReceiveMemoryWarning
{
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
[
super
didReceiveMemoryWarning
];
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Models/TransportPdtDetail.h
View file @
c70042bf
...
@@ -34,6 +34,12 @@
...
@@ -34,6 +34,12 @@
@property
(
strong
,
nonatomic
)
NSNumber
*
receivedQty
;
//收货数量
@property
(
strong
,
nonatomic
)
NSNumber
*
receivedQty
;
//收货数量
@property
(
strong
,
nonatomic
)
NSNumber
*
receivedBaseQty
;
//收货基础数量
@property
(
strong
,
nonatomic
)
NSNumber
*
receivedBaseQty
;
//收货基础数量
///**
// * 自定义的采购单的单号
// */
//@property (nonatomic,strong)NSString *z_purchaseBillNumber;
@end
@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