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
d169f1ef
Commit
d169f1ef
authored
7 years ago
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改造转运单
parent
9f218ce9
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
188 additions
and
70 deletions
+188
-70
ICRUtilsMacro.h
XFFruit/Macro/ICRUtilsMacro.h
+1
-0
ShopDetaileViewController.m
...trollers/PurchaseNotice/Views/ShopDetaileViewController.m
+45
-42
NewTransferViewController.m
...trollers/Transfer/Controllers/NewTransferViewController.m
+105
-3
NewTransportViewController.m
...ollers/Transport/Controllers/NewTransportViewController.m
+8
-1
TransportPurchaseViewController.m
...s/Transport/Controllers/TransportPurchaseViewController.m
+12
-12
TransportPurchaseCell.h
...t/ViewControllers/Transport/Views/TransportPurchaseCell.h
+2
-0
TransportPurchaseCell.m
...t/ViewControllers/Transport/Views/TransportPurchaseCell.m
+15
-12
No files found.
XFFruit/Macro/ICRUtilsMacro.h
View file @
d169f1ef
...
...
@@ -19,5 +19,6 @@
#define IsDictObject(Object) [(Object) isKindOfClass:[NSDictionary class]]
#define IsErrorObject(Object) ![(Object) isKindOfClass:[NSError class]]
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self
#endif
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m
View file @
d169f1ef
...
...
@@ -104,8 +104,11 @@ typedef enum : NSUInteger {
UIView
*
footView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
50
)];
if
(
self
.
intertype
==
ShopDetailInterTypeTransport
)
{
// UIButton *saveBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, 10, (ScreenSize.width - LeftMargin*2), BtnHeight) target:self sel:@selector(btnClick:) tag:SaveTag image:nil title:@"删除" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_SAVE_COLOR];
// [footView addSubview:saveBtn];
}
else
if
(
self
.
intertype
==
ShopDetailInterTypeTranfer
){
UIButton
*
saveBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
LeftMargin
,
10
,
(
ScreenSize
.
width
-
LeftMargin
*
2
),
BtnHeight
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
SaveTag
image
:
nil
title
:
@"删除"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
CornerRadius
bgColor
:
GXF_SAVE_COLOR
];
[
footView
addSubview
:
saveBtn
];
}
else
{
UIButton
*
saveBtn
=
[
IBTCustomButtom
creatButtonWithFrame
:
CGRectMake
(
LeftMargin
,
10
,
(
ScreenSize
.
width
-
LeftMargin
*
3
)
/
2
,
BtnHeight
)
target
:
self
sel
:
@selector
(
btnClick
:
)
tag
:
SaveTag
image
:
nil
title
:
@"删除"
titleColor
:
[
UIColor
whiteColor
]
isCorner
:
YES
corner
:
CornerRadius
bgColor
:
GXF_SAVE_COLOR
];
...
...
@@ -144,15 +147,15 @@ typedef enum : NSUInteger {
//基础数量
foundationQuantity
.
text
=
self
.
shopDetail
.
foundationQuantity
;
//基础单价
// if ([self.shopDetail.foundationUnitPrice floatValue] > 0) {
// if ([self.shopDetail.foundationUnitPrice floatValue] > 0) {
foundationUnitPrice
.
text
=
[
self
.
shopDetail
.
foundationUnitPrice
stringValue
];
// }
// }
self
.
basePrice
=
self
.
shopDetail
.
foundationUnitPrice
;
//包装单价
// if ([self.shopDetail.packageUnitPrice floatValue] > 0) {
// if ([self.shopDetail.packageUnitPrice floatValue] > 0) {
packageUnitPrice
.
text
=
[
self
.
shopDetail
.
packageUnitPrice
stringValue
];
// }
// }
self
.
packPrice
=
self
.
shopDetail
.
packageUnitPrice
;
//总金额
if
([
self
.
shopDetail
.
totalMoney
floatValue
]
<=
0
)
{
...
...
@@ -342,10 +345,10 @@ typedef enum : NSUInteger {
ShowMessage
(
@"商品数量不能为0"
);
return
NO
;
}
// if ([packageUnitPrice.text floatValue] <=0 || [foundationUnitPrice.text floatValue] <= 0 || [totalMoney.text floatValue]<= 0) {
// ShowMessage(@"商品价格不能0");
// return NO;
// }
// if ([packageUnitPrice.text floatValue] <=0 || [foundationUnitPrice.text floatValue] <= 0 || [totalMoney.text floatValue]<= 0) {
// ShowMessage(@"商品价格不能0");
// return NO;
// }
return
YES
;
}
#pragma mark - 协议方法
...
...
@@ -372,7 +375,7 @@ typedef enum : NSUInteger {
}
[
cell
setTitleStr
:
_dataArr
[
indexPath
.
row
]];
if
(
self
.
intertype
==
ShopDetailInterTypeTransport
){
if
(
self
.
intertype
==
ShopDetailInterTypeTransport
||
self
.
intertype
==
ShopDetailInterTypeTranfer
){
cell
.
userInteractionEnabled
=
NO
;
}
return
cell
;
...
...
@@ -547,9 +550,9 @@ typedef enum : NSUInteger {
}
NSMutableString
*
futureString
=
[
NSMutableString
stringWithString
:
textField
.
text
];
// kLOG(@"%@", futureString);
// kLOG(@"%@", futureString);
[
futureString
insertString
:
string
atIndex
:
range
.
location
];
// kLOG(@"----%@", futureString);
// kLOG(@"----%@", futureString);
NSInteger
flag
=
0
;
NSInteger
pointNum
=
0
;
//用于标记小数点的数量,只能有一个小数点
const
NSInteger
limited
=
2
;
//限制小数点后面的位数
...
...
@@ -558,7 +561,7 @@ typedef enum : NSUInteger {
if
([
futureString
characterAtIndex
:
i
]
==
'.'
)
{
pointNum
++
;
// kLOG(@"----->>>%ld",pointNum);
// kLOG(@"----->>>%ld",pointNum);
if
(
pointNum
==
2
)
{
return
NO
;
...
...
@@ -625,15 +628,15 @@ typedef enum : NSUInteger {
-
(
void
)
setPacktAndTotalPrice
{
if
(
self
.
basePrice
&&
foundationUnitPrice
.
text
.
length
>
0
)
{
if
(
foundationQuantity
.
text
.
length
>
0
)
{
// float basePrice = [self.basePrice floatValue] * 100;
// int intBasePrice = (int)basePrice;
// int foundationQtt = [foundationQuantity.text intValue];
// double price = (intBasePrice * foundationQtt * 1.0);
// double totalPrice = price / 100;
// NSDecimalNumber *basePrice = [NSDecimalNumber decimalNumberWithDecimal:[self.basePrice decimalValue]];
// NSDecimalNumber *foundationQty = [NSDecimalNumber decimalNumberWithString:foundationQuantity.text];
// NSDecimalNumber *multiplyResult = [basePrice decimalNumberByMultiplyingBy:foundationQty];
// float basePrice = [self.basePrice floatValue] * 100;
// int intBasePrice = (int)basePrice;
// int foundationQtt = [foundationQuantity.text intValue];
// double price = (intBasePrice * foundationQtt * 1.0);
// double totalPrice = price / 100;
// NSDecimalNumber *basePrice = [NSDecimalNumber decimalNumberWithDecimal:[self.basePrice decimalValue]];
// NSDecimalNumber *foundationQty = [NSDecimalNumber decimalNumberWithString:foundationQuantity.text];
// NSDecimalNumber *multiplyResult = [basePrice decimalNumberByMultiplyingBy:foundationQty];
NSDecimalNumber
*
multiplyResult
=
[
CalculateHelper
calculateNum1
:
self
.
basePrice
num2
:
foundationQuantity
.
text
type
:
CalculateTypeMul
roundingType
:
NSRoundBankers
cutLenth
:
2
];
totalMoney
.
text
=
[
multiplyResult
stringValue
];
self
.
totalPrice
=
multiplyResult
;
...
...
@@ -651,19 +654,19 @@ typedef enum : NSUInteger {
-
(
void
)
setUnitAndTotalPrice
{
if
(
self
.
packPrice
&&
packageUnitPrice
.
text
.
length
>
0
)
{
if
(
packageQuantity
.
text
.
length
>
0
)
{
// float pakePrice = [self.packPrice floatValue] * 100;
// int intPakePrice = (int)pakePrice;
// int pakageQty = [packageQuantity.text intValue];
//
// double price = (intPakePrice * pakageQty * 1.0);
// double totalPrice = price / 100;
// float totalPrice = pakePrice * 100 * pakageQty / 100;
// float pakePrice = [self.packPrice floatValue] * 100;
// int intPakePrice = (int)pakePrice;
// int pakageQty = [packageQuantity.text intValue];
//
// double price = (intPakePrice * pakageQty * 1.0);
// double totalPrice = price / 100;
// float totalPrice = pakePrice * 100 * pakageQty / 100;
NSDecimalNumber
*
totalPrice
=
[
CalculateHelper
calculateNum1
:
self
.
packPrice
num2
:
packageQuantity
.
text
type
:
CalculateTypeMul
roundingType
:
NSRoundBankers
cutLenth
:
2
];
totalMoney
.
text
=
[
totalPrice
stringValue
];
self
.
totalPrice
=
totalPrice
;
if
(
foundationQuantity
.
text
.
length
>
0
&&
[
foundationQuantity
.
text
integerValue
]
>
0
)
{
NSDecimalNumber
*
packagePrice
=
[
CalculateHelper
calculateNum1
:
totalPrice
num2
:
foundationQuantity
.
text
type
:
CalculateTypeDiv
roundingType
:
NSRoundBankers
cutLenth
:
2
];
// float packagePrice = totalPrice / [foundationQuantity.text floatValue];
// float packagePrice = totalPrice / [foundationQuantity.text floatValue];
foundationUnitPrice
.
text
=
packagePrice
.
stringValue
;
self
.
basePrice
=
packagePrice
;
}
}
...
...
@@ -674,14 +677,14 @@ typedef enum : NSUInteger {
if
(
totalMoney
.
text
.
length
>
0
)
{
if
(
packageQuantity
.
text
.
length
>
0
&&
[
packageQuantity
.
text
floatValue
]
>
0
)
{
// float packagePrice = [self.totalPrice floatValue] / [packageQuantity.text floatValue];
// float packagePrice = [self.totalPrice floatValue] / [packageQuantity.text floatValue];
NSDecimalNumber
*
packagePrice
=
[
CalculateHelper
calculateNum1
:
self
.
totalPrice
num2
:
packageQuantity
.
text
type
:
CalculateTypeDiv
roundingType
:
NSRoundBankers
cutLenth
:
2
];
packageUnitPrice
.
text
=
packagePrice
.
stringValue
;
self
.
packPrice
=
packagePrice
;
}
if
(
foundationQuantity
.
text
.
length
>
0
&&
[
foundationQuantity
.
text
floatValue
]
>
0
)
{
// float packagePrice = [self.totalPrice floatValue] / [foundationQuantity.text floatValue];
// float packagePrice = [self.totalPrice floatValue] / [foundationQuantity.text floatValue];
NSDecimalNumber
*
packagePrice
=
[
CalculateHelper
calculateNum1
:
self
.
totalPrice
num2
:
foundationQuantity
.
text
type
:
CalculateTypeDiv
roundingType
:
NSRoundBankers
cutLenth
:
2
];
foundationUnitPrice
.
text
=
packagePrice
.
stringValue
;
self
.
basePrice
=
packagePrice
;
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transfer/Controllers/NewTransferViewController.m
View file @
d169f1ef
...
...
@@ -18,6 +18,7 @@
#import "TransportPdtDetail.h"
#import "ChooseTransportViewController.h"
#import "ChooseTransferViewController.h"
#import "ProductStockModel.h"
typedef
enum
:
NSUInteger
{
SaveTag
=
7000
,
CommitTag
,
...
...
@@ -37,6 +38,12 @@ typedef enum : NSUInteger {
NSNumber
*
versionObject
;
}
@property
(
nonatomic
,
strong
)
NSString
*
state
;
/**
* 缓存的选择的采购单数据
*/
@property
(
strong
,
nonatomic
)
NSMutableDictionary
*
dicProduct
;
@property
(
assign
,
nonatomic
)
NSInteger
purchaseAddStockCheckNumber
;
@end
@implementation
NewTransferViewController
...
...
@@ -59,6 +66,7 @@ typedef enum : NSUInteger {
[
super
viewDidLoad
];
//布局
[
self
bulidLayout
];
self
.
purchaseAddStockCheckNumber
=
0
;
uuidObject
=
[
NSNull
null
];
billNumberObject
=
[
NSNull
null
];
versionObject
=
[
NSNumber
numberWithInteger
:
0
];
...
...
@@ -101,6 +109,18 @@ typedef enum : NSUInteger {
_sheetView
.
transfer
=
self
.
transfer
;
[
_bottomView
refreshCost
:
self
.
transfer
.
accountDetails
];
[
_bottomView
refreshTranProduct
:
self
.
transfer
.
pdtDetails
];
//清空缓存,重新
[
self
.
dicProduct
removeAllObjects
];
for
(
TransferPdtDetail
*
pdtDetail
in
_bottomView
.
productVC
.
transferProductArr
)
{
NSMutableArray
*
arrProduct
=
[
self
.
dicProduct
objectForKey
:
pdtDetail
.
sourcebillnumber
];
if
(
!
arrProduct
)
{
arrProduct
=
[
NSMutableArray
array
];
[
self
.
dicProduct
setObject
:
arrProduct
forKey
:
pdtDetail
.
sourcebillnumber
];
}
[
arrProduct
addObject
:
pdtDetail
];
}
}
-
(
void
)
bulidLayout
{
...
...
@@ -141,9 +161,17 @@ typedef enum : NSUInteger {
break
;
case
CommitTag
:{
if
([
self
checkTransfer
])
{
UIAlertView
*
alertView
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"温馨提示"
message
:
@"请确认提交"
delegate
:
self
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"确认"
,
nil
];
alertView
.
delegate
=
self
;
NSArray
*
array
=
self
.
dicProduct
.
allKeys
;
WS
(
weakSelf
);
//判断数量问题
[
IBTLoadingView
showProgressLabel
:
@""
];
[
self
stockValidWithDic
:
self
.
dicProduct
billNumbers
:
array
complete
:^
{
[
IBTLoadingView
hideHUDWithText
:
@""
];
UIAlertView
*
alertView
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"温馨提示"
message
:
@"请确认提交"
delegate
:
weakSelf
cancelButtonTitle
:
@"取消"
otherButtonTitles
:
@"确认"
,
nil
];
alertView
.
delegate
=
weakSelf
;
[
alertView
show
];
}];
}
}
break
;
...
...
@@ -229,6 +257,59 @@ typedef enum : NSUInteger {
}
}
/**
* 查库存接口
*
* @param dic 存放已选择单据
* @param billNumbers 单号
* @param complete 回调
*/
-
(
void
)
stockValidWithDic
:
(
NSMutableDictionary
*
)
dic
billNumbers
:
(
NSArray
*
)
billNumbers
complete
:
(
void
(
^
)(
void
))
complete
{
//如果billNumbers数量为0,说明没有去选择
NSString
*
billNum
=
billNumbers
[
self
.
purchaseAddStockCheckNumber
];
NSMutableArray
*
arrProducts
=
[
dic
objectForKey
:
billNum
];
WS
(
weakSelf
);
[
HTTP
purchaseStockWithPurchaseUuid
:
billNum
success
:
^
(
id
succ
)
{
if
(
!
[
succ
[
@"data"
]
isKindOfClass
:[
NSArray
class
]])
{
[
IBTLoadingView
hideHUDWithText
:
@""
];
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"该批次<%@>在总部系统的库存不足!"
,
billNum
];
ShowMessage
(
msg
);
return
;
}
for
(
NSDictionary
*
dict
in
succ
[
@"data"
])
{
ProductStockModel
*
model
=
[
ProductStockModel
new
];
[
model
setValuesForKeysWithDictionary
:
dict
];
for
(
TransportPdtDetail
*
detail
in
arrProducts
)
{
if
([
detail
.
productCode
isEqualToString
:
model
.
productCode
])
{
if
(
detail
.
baseQty
.
floatValue
>
model
.
qty
.
floatValue
)
{
CLog
(
@"库存不足"
);
[
IBTLoadingView
hideHUDWithText
:
@""
];
self
.
purchaseAddStockCheckNumber
=
0
;
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"该批次<%@>的商品%@在总部系统的库存不足!"
,
billNum
,
detail
.
productName
];
ShowMessage
(
msg
);
return
;
}
}
}
}
self
.
purchaseAddStockCheckNumber
+=
1
;
if
(
self
.
purchaseAddStockCheckNumber
==
billNumbers
.
count
)
{
self
.
purchaseAddStockCheckNumber
=
0
;
complete
();
}
else
{
[
weakSelf
stockValidWithDic
:
dic
billNumbers
:
billNumbers
complete
:
complete
];
}
}
failure
:^
(
id
fail
)
{
[
IBTLoadingView
hideHUDWithText
:
@""
];
self
.
purchaseAddStockCheckNumber
=
0
;
}];
}
-
(
BOOL
)
checkTransfer
{
...
...
@@ -294,6 +375,8 @@ typedef enum : NSUInteger {
[
_bottomView
reProduct
:
arr
];
}
};
tpv
.
dicProduct
=
self
.
dicProduct
;
[
self
PushViewController
:
tpv
animated
:
YES
];
}
#pragma mark - 通知选择发运单
...
...
@@ -370,6 +453,7 @@ typedef enum : NSUInteger {
NSInteger
indexTag
=
[[[
fication
userInfo
]
objectForKey
:
@"indexTag"
]
integerValue
];
ShopDetaileViewController
*
svc
=
[[
ShopDetaileViewController
alloc
]
init
];
svc
.
intertype
=
ShopDetailInterTypeTranfer
;
if
(
billProduct
)
{
svc
.
navTitle
=
@"编辑商品"
;
ShopDetail
*
shopDetail
=
[
self
coverShopDetail
:
billProduct
];
...
...
@@ -378,6 +462,17 @@ typedef enum : NSUInteger {
TransferPdtDetail
*
tdetail
=
[
self
coverTransportPdtDetail
:
Detail
];
if
(
Detail
.
IsDeleted
)
{
[
_bottomView
refreshDelProduct
:
tdetail
tag
:
indexTag
];
//清空缓存,重新
[
self
.
dicProduct
removeAllObjects
];
for
(
TransferPdtDetail
*
pdtDetail
in
_bottomView
.
productVC
.
transferProductArr
)
{
NSMutableArray
*
arrProduct
=
[
self
.
dicProduct
objectForKey
:
pdtDetail
.
sourcebillnumber
];
if
(
!
arrProduct
)
{
arrProduct
=
[
NSMutableArray
array
];
[
self
.
dicProduct
setObject
:
arrProduct
forKey
:
pdtDetail
.
sourcebillnumber
];
}
[
arrProduct
addObject
:
pdtDetail
];
}
}
else
{
[
_bottomView
refreshEditProduct
:
tdetail
tag
:
indexTag
];
}
...
...
@@ -527,6 +622,13 @@ typedef enum : NSUInteger {
}
}
-
(
NSMutableDictionary
*
)
dicProduct
{
if
(
!
_dicProduct
)
{
_dicProduct
=
[
NSMutableDictionary
dictionary
];
}
return
_dicProduct
;
}
/*
#pragma mark - Navigation
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/NewTransportViewController.m
View file @
d169f1ef
...
...
@@ -202,7 +202,7 @@ typedef enum : NSUInteger {
NSArray
*
array
=
self
.
dicProduct
.
allKeys
;
__weak
NewTransportViewController
*
weakSelf
=
self
;
WS
(
weakSelf
)
;
//判断数量问题
[
IBTLoadingView
showProgressLabel
:
@""
];
[
self
stockValidWithDic
:
self
.
dicProduct
billNumbers
:
array
complete
:^
{
...
...
@@ -220,6 +220,13 @@ typedef enum : NSUInteger {
}
}
/**
* 查库存接口
*
* @param dic 存放已选择单据
* @param billNumbers 单号
* @param complete 回调
*/
-
(
void
)
stockValidWithDic
:
(
NSMutableDictionary
*
)
dic
billNumbers
:
(
NSArray
*
)
billNumbers
complete
:
(
void
(
^
)(
void
))
complete
{
//如果billNumbers数量为0,说明没有去选择
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Controllers/TransportPurchaseViewController.m
View file @
d169f1ef
...
...
@@ -86,7 +86,7 @@ NSInteger purchaseStockCheckNumber = 0;
}
NSDictionary
*
dict
;
if
(
self
.
isTransportIn
)
{
//
if (self.isTransportIn) {
dict
=
@{
@"state"
:
PURCHASE_STATE_RECEIVED
,
@"queryOrders"
:
orderArr
,
...
...
@@ -96,17 +96,17 @@ NSInteger purchaseStockCheckNumber = 0;
@"isProductCenter"
:
@
(
1
),
@"pageNumber"
:
@
(
_currentPage
),
@"pageSize"
:
@
(
20
)};
}
else
{
dict
=
@{
@"state"
:
[
NSNull
null
],
@"stateNotIn"
:
@[
PURCHASE_STATE_ABORTED
,
PURCHASE_STATE_REJECTED
],
@"queryOrders"
:
orderArr
,
@"userUuid"
:
userUtil
.
userId
,
@"billNumberProductLike"
:
billNumberObject
,
@"fetchParts"
:
@"products"
,
@"pageNumber"
:
@
(
_currentPage
),
@"pageSize"
:
@
(
20
)};
}
//
}else{
//
dict = @{
//
@"state":[NSNull null],
//
@"stateNotIn":@[PURCHASE_STATE_ABORTED,PURCHASE_STATE_REJECTED],
//
@"queryOrders":orderArr,
//
@"userUuid":userUtil.userId,
//
@"billNumberProductLike":billNumberObject,
//
@"fetchParts":@"products",
//
@"pageNumber":@(_currentPage),
//
@"pageSize":@(20)};
//
}
[[
ICRHTTPController
sharedController
]
queryPurchaseWithData
:
dict
success
:
succ
failure
:
fail
];
}
-
(
void
)
fetchtPuchaseList
:
(
id
)
data
{
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Views/TransportPurchaseCell.h
View file @
d169f1ef
...
...
@@ -22,6 +22,8 @@
@property
(
nonatomic
,
strong
)
NSMutableArray
*
indexArr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
selectArr
;
/** 是否发运单进入 */
@property
(
assign
,
nonatomic
)
BOOL
isPurchaseIn
;
-
(
void
)
setPurchaseBill
:(
PurchaseBill
*
)
bill
selectArr
:(
NSMutableArray
*
)
selectArr
;
-
(
void
)
setTransPort
:(
Transport
*
)
bill
selectArr
:(
NSMutableArray
*
)
selectArr
;
...
...
This diff is collapsed.
Click to expand it.
XFFruit/ViewControllers/Transport/Views/TransportPurchaseCell.m
View file @
d169f1ef
...
...
@@ -162,18 +162,21 @@
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
// TransportPurductCell *cell = (TransportPurductCell *)[tableView cellForRowAtIndexPath:indexPath];
// TransportPdtDetail * billProduct = self.secondArr[indexPath.row];
// if (![self isHaveIndexPath:billProduct]) {
// cell.editBtn.hidden = NO;
// [self.selectArr addObject:billProduct];
//
// }else{
// [self.selectArr removeObject:billProduct];
// cell.editBtn.hidden = YES;
// }
// self.headCell.checkBox.isSelected = self.selectArr.count == self.secondArr.count;
// [self.secondTable reloadData];
if
(
!
self
.
isPurchaseIn
)
{
TransportPurductCell
*
cell
=
(
TransportPurductCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
TransportPdtDetail
*
billProduct
=
self
.
secondArr
[
indexPath
.
row
];
if
(
!
[
self
isHaveIndexPath
:
billProduct
])
{
cell
.
editBtn
.
hidden
=
NO
;
[
self
.
selectArr
addObject
:
billProduct
];
}
else
{
[
self
.
selectArr
removeObject
:
billProduct
];
cell
.
editBtn
.
hidden
=
YES
;
}
self
.
headCell
.
checkBox
.
isSelected
=
self
.
selectArr
.
count
==
self
.
secondArr
.
count
;
[
self
.
secondTable
reloadData
];
}
}
-
(
BOOL
)
isHaveIndexPath
:
(
TransportPdtDetail
*
)
billProduct
{
for
(
TransportPdtDetail
*
detail
in
self
.
selectArr
)
{
...
...
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