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
a44e79ee
Commit
a44e79ee
authored
May 22, 2017
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
03dec024
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
171 additions
and
66 deletions
+171
-66
project.pbxproj
XFFruit.xcodeproj/project.pbxproj
+5
-5
GXFFunctionDB.m
XFFruit/Controllers/DataBaseController/GXFFunctionDB.m
+7
-5
Info.plist
XFFruit/Info.plist
+2
-2
ICRLoginViewController.m
XFFruit/ViewControllers/Login/ICRLoginViewController.m
+1
-1
NewPurchaseViewController.m
...trollers/Purchase/Controllers/NewPurchaseViewController.m
+19
-6
PurchaseDetailViewController.m
...llers/Purchase/Controllers/PurchaseDetailViewController.m
+42
-18
ReceiveProductCell.m
XFFruit/ViewControllers/Receiving/Views/ReceiveProductCell.m
+9
-1
TransferPdtDetail.m
XFFruit/ViewControllers/Transfer/Models/TransferPdtDetail.m
+5
-0
TransportDetailViewController.m
...ers/Transport/Controllers/TransportDetailViewController.m
+55
-21
TransportPurchaseViewController.m
...s/Transport/Controllers/TransportPurchaseViewController.m
+26
-7
No files found.
XFFruit.xcodeproj/project.pbxproj
View file @
a44e79ee
...
...
@@ -4417,8 +4417,8 @@
baseConfigurationReference
=
1B0B22845F5CD40B5CF655F2
/* Pods.debug.xcconfig */
;
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CODE_SIGN_IDENTITY
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_IDENTITY
=
"iPhone Developer
: jie zhang (9V9955H2BK)
"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer
: jie zhang (9V9955H2BK)
"
;
COPYING_PRESERVES_HFS_DATA
=
NO
;
ENABLE_BITCODE
=
NO
;
GCC_PREFIX_HEADER
=
"XFFruit/XFFruit-Prefix.pch"
;
...
...
@@ -4432,7 +4432,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.xffruit
;
PRODUCT_NAME
=
XFFruit
;
PROVISIONING_PROFILE
=
"
e2cec26c-3666-4512-9b9a-cdb4cd9da56d
"
;
PROVISIONING_PROFILE
=
"
d5f475ae-9bae-4ae0-a45a-673e85b7e684
"
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
};
name
=
Debug
;
...
...
@@ -4442,7 +4442,7 @@
baseConfigurationReference
=
7DDFB1D460448C3B45118195
/* Pods.release.xcconfig */
;
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CODE_SIGN_IDENTITY
=
"iPhone D
eveloper
"
;
CODE_SIGN_IDENTITY
=
"iPhone D
istribution: Shanghai Gomore Information Technology Co.,Ltd
"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
COPYING_PRESERVES_HFS_DATA
=
NO
;
ENABLE_BITCODE
=
NO
;
...
...
@@ -4457,7 +4457,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.xffruit
;
PRODUCT_NAME
=
XFFruit
;
PROVISIONING_PROFILE
=
"
e2cec26c-3666-4512-9b9a-cdb4cd9da56d
"
;
PROVISIONING_PROFILE
=
"
d5f475ae-9bae-4ae0-a45a-673e85b7e684
"
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
};
name
=
Release
;
...
...
XFFruit/Controllers/DataBaseController/GXFFunctionDB.m
View file @
a44e79ee
...
...
@@ -322,15 +322,17 @@
hasSeeOption7
=
NO
;
}
//"收货单"
if
(
displayFunction
.
functionId
==
500802
&&
hasSeeOption8
==
NO
)
{
hasSeeOption8
=
YES
;
}
if
(
displayFunction
.
functionId
==
500803
&&
hasSeeOption8
==
YES
)
{
//
//"收货单"
//
if (displayFunction.functionId == 500802 && hasSeeOption8 == NO) {
//
hasSeeOption8 = YES;
//
}
if
(
displayFunction
.
functionId
==
500803
)
{
[
muArr
removeObject
:
displayFunction
];
hasSeeOption8
=
NO
;
}
continue
;
}
...
...
XFFruit/Info.plist
View file @
a44e79ee
...
...
@@ -15,11 +15,11 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.2.1
6
<
/string
>
<
string
>
1.2.1
7
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.2.1
6
<
/string
>
<
string
>
1.2.1
7
<
/string
>
<
k
e
y
>
NSAppTransportSecurity
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
NSAllowsArbitraryLoads
<
/k
e
y
>
...
...
XFFruit/ViewControllers/Login/ICRLoginViewController.m
View file @
a44e79ee
...
...
@@ -102,7 +102,7 @@
}
#ifdef DEBUG
self
.
m_containerView
.
m_cCodeTextF
.
text
=
@"
211534962
"
;
self
.
m_containerView
.
m_cCodeTextF
.
text
=
@"
923
"
;
self
.
m_containerView
.
m_userNameTextF
.
text
=
@"admin"
;
self
.
m_containerView
.
m_passwordTextF
.
text
=
@"thoradmin"
;
#else
...
...
XFFruit/ViewControllers/Purchase/Controllers/NewPurchaseViewController.m
View file @
a44e79ee
...
...
@@ -62,6 +62,19 @@ typedef enum : NSUInteger {
return
self
;
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
if
(
self
.
purchaseBill
&&
[
self
.
state
isEqualToString
:
PURCHASE_STATE_INITIAL
]){
[
ICRUserUtil
sharedInstance
].
needFresh
=
YES
;
}
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
//布局
...
...
@@ -310,9 +323,15 @@ typedef enum : NSUInteger {
if
(
self
.
purchaseNotice
)
{
[
self
PopViewControllerAnimated
:
YES
];
}
else
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
SetProductTotalPrice
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
KNOTIFICATION_AddPurchaseProduct
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
KNOTIFICATION_AddTransportCost
object
:
nil
];
PurchaseViewController
*
svc
=
[
PurchaseViewController
new
];
svc
.
title
=
@"查看采购单"
;
[
self
PushViewController
:
svc
animated
:
YES
];
}
}
}
else
{
...
...
@@ -508,12 +527,6 @@ typedef enum : NSUInteger {
[
_purchaseView
.
otherPriceFiled
resignFirstResponder
];
[
_purchaseView
.
remarkTextView
resignFirstResponder
];
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
if
(
self
.
purchaseBill
&&
[
self
.
state
isEqualToString
:
PURCHASE_STATE_INITIAL
]){
[
ICRUserUtil
sharedInstance
].
needFresh
=
YES
;
}
}
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
if
(
buttonIndex
==
1
)
{
...
...
XFFruit/ViewControllers/Purchase/Controllers/PurchaseDetailViewController.m
View file @
a44e79ee
...
...
@@ -396,6 +396,10 @@ typedef enum : NSUInteger {
}
-
(
void
)
createBottomView
{
_aBottomView
=
[[
BottomPurchaseView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_purchaseView
.
frame
)
+
TopMargin
,
ScreenSize
.
width
,
300
)
withHidden
:
YES
];
_aBottomView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_scrollView
addSubview
:
_aBottomView
];
if
(
self
.
type
==
PurchaseTypeAfterVerify
)
{
_recieveBottomView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_purchaseView
.
frame
)
+
TopMargin
,
ScreenSize
.
width
,
300
)];
_recieveBottomView
.
backgroundColor
=
[
UIColor
redColor
];
...
...
@@ -405,11 +409,13 @@ typedef enum : NSUInteger {
_pvc
.
viewFrame
=
_recieveBottomView
.
bounds
;
_pvc
.
isHiddenAdd
=
YES
;
[
_recieveBottomView
addSubview
:
_pvc
.
view
];
}
else
{
_aBottomView
=
[[
BottomPurchaseView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_purchaseView
.
frame
)
+
TopMargin
,
ScreenSize
.
width
,
300
)
withHidden
:
YES
];
_aBottomView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
_scrollView
addSubview
:
_aBottomView
];
}
CGRect
frame
=
_aBottomView
.
productVC
.
view
.
frame
;
_recieveBottomView
.
frame
=
frame
;
[
_aBottomView
.
productVC
.
view
addSubview
:
_recieveBottomView
];
}
-
(
void
)
createPurchaseView
{
...
...
@@ -542,14 +548,20 @@ typedef enum : NSUInteger {
[
p
setValuesForKeysWithDictionary
:
billDict
];
billProbuct
.
purchasePdt
=
p
;
//待收货
并且已收货数小于1
的时候才可以显示默认值
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_WAITE_RECIEVE
]
&&
billProbuct
.
rctQty
.
floatValue
<
1
)
{
//待收货的时候才可以显示默认值
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_WAITE_RECIEVE
]
&&
self
.
bill
.
receive_id
==
nil
&&
billProbuct
.
rctQty
.
floatValue
==
0
)
{
if
(
self
.
isCenter
)
{
[
billProbuct
z_setRctQty
:
p
.
qty
.
floatValue
];
}
else
if
(
self
.
isWms
){
[
billProbuct
z_setRctQty
:
0
];
}
else
{
billProbuct
.
rctQty
=
nil
;
billProbuct
.
rctBaseQty
=
nil
;
billProbuct
.
rctTotal
=
nil
;
}
}
else
{
[
billProbuct
z_setRctQty
:
billProbuct
.
rctQty
.
floatValue
];
}
[
productArr
addObject
:
billProbuct
];
}
...
...
@@ -562,7 +574,6 @@ typedef enum : NSUInteger {
// }
}
else
{
for
(
NSDictionary
*
billDict
in
self
.
bill
.
products
)
{
PurchaseBillProduct
*
billProbuct
=
[
PurchaseBillProduct
new
];
[
billProbuct
setValuesForKeysWithDictionary
:
billDict
];
...
...
@@ -571,9 +582,7 @@ typedef enum : NSUInteger {
_aBottomView
.
productVC
.
productArr
=
productArr
;
[
_aBottomView
.
productVC
.
tableView
reloadData
];
}
[
self
setNoteHeight
];
}
...
...
@@ -591,18 +600,18 @@ typedef enum : NSUInteger {
purchaseFrame
.
size
.
height
=
totalHeight
;
_purchaseView
.
frame
=
purchaseFrame
;
if
(
self
.
type
==
PurchaseTypeAfterVerify
)
{
CGRect
bottomFrame
=
_recieveBottomView
.
frame
;
bottomFrame
.
origin
.
y
=
CGRectGetMaxY
(
_purchaseView
.
frame
)
+
TopMargin
;
_recieveBottomView
.
backgroundColor
=
[
UIColor
redColor
];
_recieveBottomView
.
frame
=
bottomFrame
;
_scrollView
.
contentSize
=
CGSizeMake
(
ScreenSize
.
width
,
totalHeight
+
CGRectGetHeight
(
_recieveBottomView
.
frame
)
+
TopMargin
*
2
+
100
);
}
else
{
//
if (self.type == PurchaseTypeAfterVerify) {
//
CGRect bottomFrame = _recieveBottomView.frame;
//
bottomFrame.origin.y = CGRectGetMaxY(_purchaseView.frame) + TopMargin;
//
_recieveBottomView.backgroundColor = [UIColor redColor];
//
_recieveBottomView.frame = bottomFrame;
//
_scrollView.contentSize = CGSizeMake(ScreenSize.width, totalHeight + CGRectGetHeight(_recieveBottomView.frame) + TopMargin*2 + 100);
//
}else{
CGRect
bottomFrame
=
_aBottomView
.
frame
;
bottomFrame
.
origin
.
y
=
CGRectGetMaxY
(
_purchaseView
.
frame
)
+
TopMargin
;
_aBottomView
.
frame
=
bottomFrame
;
_scrollView
.
contentSize
=
CGSizeMake
(
ScreenSize
.
width
,
totalHeight
+
CGRectGetHeight
(
_aBottomView
.
frame
)
+
TopMargin
*
2
);
}
//
}
}
...
...
@@ -639,6 +648,14 @@ typedef enum : NSUInteger {
-
(
void
)
httpRecieve
{
for
(
TransferPdtDetail
*
detail
in
_pvc
.
productArr
)
{
if
(
detail
.
rctQty
==
nil
)
{
ShowMessage
(
@"请选择商品实收数量后再提交!"
);
return
;
}
}
NSString
*
receiveTime
=
[[
NSDate
date
]
httpParameterString
];
self
.
bill
.
receive_time
=
receiveTime
;
self
.
bill
.
receive_id
=
[
ICRUserUtil
sharedInstance
].
userId
;
...
...
@@ -695,6 +712,13 @@ typedef enum : NSUInteger {
}
-
(
void
)
httpSave
{
for
(
TransferPdtDetail
*
detail
in
_pvc
.
productArr
)
{
if
(
detail
.
rctQty
==
nil
)
{
ShowMessage
(
@"请选择商品实收数量后再保存!"
);
return
;
}
}
//保存
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
...
...
XFFruit/ViewControllers/Receiving/Views/ReceiveProductCell.m
View file @
a44e79ee
...
...
@@ -168,15 +168,23 @@
self
.
showbzCountLabel
.
text
=
[
NSString
stringWithFormat
:
@"包装数量:%@%@"
,[
transferProduct
.
qty
stringValue
],
transferProduct
.
unit
];
self
.
showshCountLabel
.
text
=
[
NSString
stringWithFormat
:
@"包装数量[实收]:%@%@"
,
transferProduct
.
rctQty
?([
transferProduct
.
rctQty
stringValue
]):
@"0"
,
transferProduct
.
unit
];
if
(
transferProduct
.
rctQty
==
nil
)
{
self
.
showshCountLabel
.
text
=
@"包装数量[实收]:空"
;
}
self
.
showjcCountLabel
.
text
=
[
NSString
stringWithFormat
:
@"基础数量:%@%@"
,[
transferProduct
.
baseQty
stringValue
],
transferProduct
.
baseUnit
];
self
.
showshjcCountLabel
.
text
=
[
NSString
stringWithFormat
:
@"基础数量[实收]:%@%@"
,
transferProduct
.
rctBaseQty
?[
transferProduct
.
rctBaseQty
stringValue
]:
@"0"
,
transferProduct
.
baseUnit
];
if
(
transferProduct
.
rctBaseQty
==
nil
)
{
self
.
showshjcCountLabel
.
text
=
@"基础数量[实收]:空"
;
}
self
.
showbzPriceLabel
.
text
=
[
NSString
stringWithFormat
:
@"包装单价:%.2f元"
,[
transferProduct
.
packprice
floatValue
]];
self
.
showjcPriceLabel
.
text
=
[
NSString
stringWithFormat
:
@"基础单价:%.2f元"
,[
transferProduct
.
price
floatValue
]];
self
.
showshTotalLabel
.
text
=
[
NSString
stringWithFormat
:
@"总金额[实收]:%.2f元"
,
transferProduct
.
rctTotal
?[
transferProduct
.
rctTotal
floatValue
]:
0
.
00
f
];
if
(
transferProduct
.
rctTotal
==
nil
)
{
self
.
showshTotalLabel
.
text
=
@"总金额[实收]:空"
;
}
self
.
showTotalLabel
.
text
=
[
NSString
stringWithFormat
:
@"总金额:%.2f元"
,
transferProduct
.
total
?[
transferProduct
.
total
floatValue
]:
0
.
00
f
];
self
.
showNoteLabel
.
text
=
[
NSString
stringWithFormat
:
@"备注:%@"
,
transferProduct
.
note
?
transferProduct
.
note
:
@"无"
];
...
...
XFFruit/ViewControllers/Transfer/Models/TransferPdtDetail.m
View file @
a44e79ee
...
...
@@ -28,6 +28,11 @@
self
.
rctBaseQty
=
transportPdt
.
receivedBaseQty
;
}
/**
* 转化为采购单对象
*
* @return return value description
*/
-
(
PurchaseBillProduct
*
)
changeToPurchasePdt
{
if
(
!
self
.
purchasePdt
)
{
self
.
purchasePdt
=
[
PurchaseBillProduct
new
];
...
...
XFFruit/ViewControllers/Transport/Controllers/TransportDetailViewController.m
View file @
a44e79ee
...
...
@@ -184,23 +184,30 @@ typedef enum : NSUInteger {
[
t
setValuesForKeysWithDictionary
:
billDict
];
billProbuct
.
transportPdt
=
t
;
if
([
self
.
transport
.
state
isEqualToString
:
TRANSPORT_STATE_UNRECEIVED
])
{
if
([
self
.
transport
.
state
isEqualToString
:
TRANSPORT_STATE_UNRECEIVED
]
&&
billProbuct
.
rctQty
.
floatValue
==
0
)
{
if
(
self
.
isWms
){
[
billProbuct
z_setRctQty
:
0
];
}
else
{
billProbuct
.
rctQty
=
nil
;
billProbuct
.
rctBaseQty
=
nil
;
billProbuct
.
rctTotal
=
nil
;
}
}
else
{
[
billProbuct
z_setRctQty
:
billProbuct
.
rctQty
.
floatValue
];
}
[
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
{
...
...
@@ -244,20 +251,20 @@ typedef enum : NSUInteger {
_transportView
.
frame
=
purchaseFrame
;
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
{
//
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
);
}
//
}
}
...
...
@@ -294,9 +301,19 @@ typedef enum : NSUInteger {
case
SaveTag
:
{
[
self
httpSave
];
if
([
self
checkReceive
])
{
[
self
httpSave
];
}
}
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
:
break
;
}
...
...
@@ -489,6 +506,12 @@ typedef enum : NSUInteger {
}
-
(
void
)
createBottomView
{
_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
];
if
(
self
.
type
==
TransportTypeAfterSubmit
)
{
_recieveBottomView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
CGRectGetMaxY
(
_transportView
.
frame
)
+
TopMargin
,
ScreenSize
.
width
,
300
)];
_recieveBottomView
.
backgroundColor
=
[
UIColor
redColor
];
...
...
@@ -498,15 +521,13 @@ typedef enum : NSUInteger {
_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
];
}
CGRect
frame
=
_transView
.
productVC
.
view
.
frame
;
_recieveBottomView
.
frame
=
frame
;
[
_transView
.
productVC
.
view
addSubview
:
_recieveBottomView
];
}
...
...
@@ -531,7 +552,12 @@ typedef enum : NSUInteger {
if
(
buttonIndex
==
1
)
{
[
self
httpRecieve
];
}
}
else
if
(
alertView
.
tag
==
SaveTag
){
if
(
buttonIndex
==
1
)
{
[
self
httpSave
];
}
}
}
#pragma mark - 提交
...
...
@@ -633,6 +659,14 @@ typedef enum : NSUInteger {
-
(
void
)
httpSave
{
for
(
TransferPdtDetail
*
detail
in
_pvc
.
productArr
)
{
if
(
detail
.
rctQty
==
nil
)
{
ShowMessage
(
@"请选择商品实收数量后再保存!"
);
return
;
}
}
NSMutableDictionary
*
param
=
[
self
.
transport
dictForCommit
].
mutableCopy
;
NSMutableArray
*
arrProduct
=
[
NSMutableArray
array
];
for
(
TransferPdtDetail
*
pdt
in
_pvc
.
productArr
)
{
...
...
XFFruit/ViewControllers/Transport/Controllers/TransportPurchaseViewController.m
View file @
a44e79ee
...
...
@@ -22,6 +22,9 @@ NSInteger purchaseStockCheckNumber = 0;
NSInteger
_currentPage
;
id
billNumberObject
;
}
/**
* 选中的商品
*/
@property
(
nonatomic
,
strong
)
NSMutableArray
*
indexArr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
dataArr
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
...
...
@@ -279,8 +282,10 @@ NSInteger purchaseStockCheckNumber = 0;
}
#pragma mark - 按钮确定
-
(
void
)
sureClick
{
NSMutableDictionary
*
dicProduct
=
[
NSMutableDictionary
dictionary
];
//把选中的商品和采购单对应
//把选中的商品和采购单对应
,根据单号存储对应的商品
for
(
PurchaseBill
*
bill
in
self
.
dataArr
)
{
for
(
TransportPdtDetail
*
detail
in
bill
.
products
)
{
if
([
self
.
indexArr
containsObject
:
detail
])
{
...
...
@@ -296,7 +301,12 @@ NSInteger purchaseStockCheckNumber = 0;
}
NSArray
*
array
=
dicProduct
.
allKeys
;
if
(
array
.
count
==
0
)
{
ShowMessage
(
@"请选择商品!"
);
return
;
}
__weak
TransportPurchaseViewController
*
weakSelf
=
self
;
//判断数量问题
[
self
stockValidWithDic
:
dicProduct
billNumbers
:
array
complete
:^
{
[
weakSelf
PopViewControllerAnimated
:
YES
];
if
(
weakSelf
.
indexArr
.
count
>
0
)
{
...
...
@@ -329,20 +339,29 @@ NSInteger purchaseStockCheckNumber = 0;
}
-
(
void
)
stockValidWithDic
:
(
NSMutableDictionary
*
)
dic
billNumbers
:
(
NSArray
*
)
billNumbers
complete
:
(
void
(
^
)(
void
))
complete
{
NSString
*
billNum
=
billNumbers
[
purchaseStockCheckNumber
];
NSMutableArray
*
arrProducts
=
[
dic
objectForKey
:
billNum
];
__weak
TransportPurchaseViewController
*
weakSelf
=
self
;
[
HTTP
purchaseStockWithPurchaseUuid
:
billNum
success
:
^
(
id
succ
)
{
if
(
!
[
succ
[
@"data"
]
isKindOfClass
:[
NSArray
class
]])
{
ShowMessage
(
@"库存不足!"
);
return
;
}
for
(
NSDictionary
*
dict
in
succ
[
@"data"
])
{
ProductStockModel
*
model
=
[
ProductStockModel
new
];
[
model
setValuesForKeysWithDictionary
:
dict
];
for
(
TransportPdtDetail
*
detail
in
arrProducts
)
{
if
(
detail
.
qty
.
floatValue
>
model
.
qty
.
floatValue
)
{
CLog
(
@"库存不足"
);
purchaseStockCheckNumber
=
0
;
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"%@库存不足!"
,
detail
.
productName
];
ShowMessage
(
msg
);
return
;
if
([
detail
.
productCode
isEqualToString
:
model
.
productCode
])
{
if
(
detail
.
qty
.
floatValue
>
model
.
qty
.
floatValue
)
{
CLog
(
@"库存不足"
);
purchaseStockCheckNumber
=
0
;
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"%@库存不足!"
,
detail
.
productName
];
ShowMessage
(
msg
);
return
;
}
}
}
}
...
...
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