Skip to content

Commit

Permalink
完善进货历史 增加销售历史
Browse files Browse the repository at this point in the history
  • Loading branch information
woaomo committed Sep 12, 2015
1 parent 651716f commit 881b719
Show file tree
Hide file tree
Showing 17 changed files with 553 additions and 21 deletions.
18 changes: 18 additions & 0 deletions YHB_Prj/YHB_Prj.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
ABDDB3791BA3BCDA00DCD659 /* UploadImgViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABDDB3781BA3BCDA00DCD659 /* UploadImgViewController.m */; };
ABDDB3801BA3C2E300DCD659 /* XSLSTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = ABDDB37E1BA3C2E300DCD659 /* XSLSTableViewCell.m */; };
ABDDB3811BA3C2E300DCD659 /* XSLSTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = ABDDB37F1BA3C2E300DCD659 /* XSLSTableViewCell.xib */; };
ABDDB3841BA4190B00DCD659 /* JHLSMode.m in Sources */ = {isa = PBXBuildFile; fileRef = ABDDB3831BA4190B00DCD659 /* JHLSMode.m */; };
ABDDB3871BA41FC400DCD659 /* XSLSViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABDDB3861BA41FC400DCD659 /* XSLSViewController.m */; };
ABDDB38A1BA421B200DCD659 /* XSLSMode.m in Sources */ = {isa = PBXBuildFile; fileRef = ABDDB3891BA421B200DCD659 /* XSLSMode.m */; };
ABE71E241B9C32E2000651A9 /* FBViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABE71E231B9C32E2000651A9 /* FBViewController.m */; };
ABEF1DA71B929D5400C1C2EA /* SupplierDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABEF1DA61B929D5400C1C2EA /* SupplierDetailViewController.m */; };
ABEF1DAB1B92A18E00C1C2EA /* ClerkDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABEF1DAA1B92A18E00C1C2EA /* ClerkDetailViewController.m */; };
Expand Down Expand Up @@ -435,6 +438,12 @@
ABDDB37D1BA3C2E300DCD659 /* XSLSTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSLSTableViewCell.h; sourceTree = "<group>"; };
ABDDB37E1BA3C2E300DCD659 /* XSLSTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XSLSTableViewCell.m; sourceTree = "<group>"; };
ABDDB37F1BA3C2E300DCD659 /* XSLSTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = XSLSTableViewCell.xib; sourceTree = "<group>"; };
ABDDB3821BA4190B00DCD659 /* JHLSMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JHLSMode.h; sourceTree = "<group>"; };
ABDDB3831BA4190B00DCD659 /* JHLSMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JHLSMode.m; sourceTree = "<group>"; };
ABDDB3851BA41FC400DCD659 /* XSLSViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSLSViewController.h; sourceTree = "<group>"; };
ABDDB3861BA41FC400DCD659 /* XSLSViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XSLSViewController.m; sourceTree = "<group>"; };
ABDDB3881BA421B200DCD659 /* XSLSMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSLSMode.h; sourceTree = "<group>"; };
ABDDB3891BA421B200DCD659 /* XSLSMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XSLSMode.m; sourceTree = "<group>"; };
ABE71E221B9C32E2000651A9 /* FBViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBViewController.h; sourceTree = "<group>"; };
ABE71E231B9C32E2000651A9 /* FBViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBViewController.m; sourceTree = "<group>"; };
ABEF1DA51B929D5400C1C2EA /* SupplierDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SupplierDetailViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1181,11 +1190,17 @@
ABDDB3721BA3B1ED00DCD659 /* JHLSTableViewCell.h */,
ABDDB3731BA3B1ED00DCD659 /* JHLSTableViewCell.m */,
ABDDB3741BA3B1ED00DCD659 /* JHLSTableViewCell.xib */,
ABDDB3821BA4190B00DCD659 /* JHLSMode.h */,
ABDDB3831BA4190B00DCD659 /* JHLSMode.m */,
ABDDB3771BA3BCDA00DCD659 /* UploadImgViewController.h */,
ABDDB3781BA3BCDA00DCD659 /* UploadImgViewController.m */,
ABDDB3851BA41FC400DCD659 /* XSLSViewController.h */,
ABDDB3861BA41FC400DCD659 /* XSLSViewController.m */,
ABDDB37D1BA3C2E300DCD659 /* XSLSTableViewCell.h */,
ABDDB37E1BA3C2E300DCD659 /* XSLSTableViewCell.m */,
ABDDB37F1BA3C2E300DCD659 /* XSLSTableViewCell.xib */,
ABDDB3881BA421B200DCD659 /* XSLSMode.h */,
ABDDB3891BA421B200DCD659 /* XSLSMode.m */,
);
path = EditSPVC;
sourceTree = "<group>";
Expand Down Expand Up @@ -1998,6 +2013,7 @@
FF5C87081B82FE5200F79EC1 /* LoginViewController.m in Sources */,
FF357C851BA01B8A00DFCAC0 /* SPGLManager.m in Sources */,
FF2A6C751A0F3B7B001607AC /* UIImage+GIF.m in Sources */,
ABDDB3871BA41FC400DCD659 /* XSLSViewController.m in Sources */,
5B1F7FAC1B91CEB100763059 /* DJProductCheckSrl.m in Sources */,
FF357C9C1BA12D6E00DFCAC0 /* SPGLProductDetail.m in Sources */,
FFD26CEF1B8C3F940003F491 /* ZXBJCell.m in Sources */,
Expand Down Expand Up @@ -2126,6 +2142,7 @@
FF2A6C6E1A0F3B7B001607AC /* SDWebImageCompat.m in Sources */,
FFF3919B1B846F58007DC652 /* AFURLResponseSerialization.m in Sources */,
AB25793C1B8F02010015039A /* IQTextView.m in Sources */,
ABDDB3841BA4190B00DCD659 /* JHLSMode.m in Sources */,
FF357CBA1BA2B56100DFCAC0 /* WYJHSXViewcontroller.m in Sources */,
FF4DFD081B85B21C00617660 /* NSDateTool.m in Sources */,
ABFAB0EC1BA1C0DE009D8654 /* SPEditViewController.m in Sources */,
Expand Down Expand Up @@ -2157,6 +2174,7 @@
FF012FB31B8EB92C00AE563C /* HYDetailViewController.m in Sources */,
FF012FB01B8EB92C00AE563C /* HYGLOneMothMode.m in Sources */,
AB2579391B8F02010015039A /* IQKeyboardManager.m in Sources */,
ABDDB38A1BA421B200DCD659 /* XSLSMode.m in Sources */,
FF5CC7161B94264D00F55713 /* JCCXMode.m in Sources */,
AB40EAC11B8C020700DE5ED7 /* SupplierViewController.m in Sources */,
FF2A6C731A0F3B7B001607AC /* SDWebImagePrefetcher.m in Sources */,
Expand Down
43 changes: 43 additions & 0 deletions YHB_Prj/YHB_Prj/shangpinguanli/EditSPVC/JHLSMode.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// JHLSMode.h
// YHB_Prj
//
// Created by Johnny's on 15/9/12.
// Copyright (c) 2015年 striveliu. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface JHLSMode : NSObject
@property (nonatomic, strong) NSString *strAdd_date;

@property (nonatomic, strong) NSString *strId;

@property (nonatomic, strong) NSString *strProduct_code;

@property (nonatomic, strong) NSString *strProduct_id;

@property (nonatomic, strong) NSString *strProduct_name;

@property (nonatomic, strong) NSString *strSale_price;

@property (nonatomic, strong) NSString *strShelf_dys;

@property (nonatomic, strong) NSString *strStay_qty;

@property (nonatomic, strong) NSString *strStock_num;

@property (nonatomic, strong) NSString *strStock_price;

@property (nonatomic, strong) NSString *strStock_qty;

@property (nonatomic, strong) NSString *strSup_id;

@property (nonatomic, strong) NSString *strSup_name;
- (void)unPacketData:(NSDictionary *)aDataDict;
@end

@interface JHLSList : NSObject
@property (nonatomic, strong) NSMutableArray *productList;
- (void)unPacketData:(NSDictionary *)aDataDict;
@end
76 changes: 76 additions & 0 deletions YHB_Prj/YHB_Prj/shangpinguanli/EditSPVC/JHLSMode.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
//
// JHLSMode.m
// YHB_Prj
//
// Created by Johnny's on 15/9/12.
// Copyright (c) 2015年 striveliu. All rights reserved.
//

#import "JHLSMode.h"

@implementation JHLSMode
- (void)unPacketData:(NSDictionary *)aDataDict
{

AssignMentID(self.strAdd_date, [aDataDict objectForKey:@"add_date"]);

AssignMentID(self.strId, [aDataDict objectForKey:@"id"]);
BaseIntToNSString(self.strId);

AssignMentID(self.strProduct_code, [aDataDict objectForKey:@"product_code"]);

AssignMentID(self.strProduct_id, [aDataDict objectForKey:@"product_id"]);
BaseIntToNSString(self.strProduct_id);

AssignMentID(self.strProduct_name, [aDataDict objectForKey:@"product_name"]);

AssignMentID(self.strSale_price, [aDataDict objectForKey:@"sale_price"]);
BaseIntToNSString(self.strSale_price);

AssignMentID(self.strShelf_dys, [aDataDict objectForKey:@"shelf_dys"]);
BaseIntToNSString(self.strShelf_dys);

AssignMentID(self.strStay_qty, [aDataDict objectForKey:@"stay_qty"]);
BaseLongLongToNSString(self.strStay_qty);

AssignMentID(self.strStock_num, [aDataDict objectForKey:@"stock_num"]);
BaseIntToNSString(self.strStock_num);

AssignMentID(self.strStock_price, [aDataDict objectForKey:@"stock_price"]);

AssignMentID(self.strStock_qty, [aDataDict objectForKey:@"stock_qty"]);
BaseIntToNSString(self.strStock_qty);

AssignMentID(self.strSup_id, [aDataDict objectForKey:@"sup_id"]);
BaseFloadToNSString(self.strSup_id);

AssignMentID(self.strSup_name, [aDataDict objectForKey:@"sup_name"]);
}
@end

@implementation JHLSList

- (instancetype)init
{
if(self = [super init]){
self.productList = [NSMutableArray arrayWithCapacity:0];
}
return self;
}

- (void)unPacketData:(NSDictionary *)aDataDict
{
NSArray *arry = [aDataDict objectForKey:@"rows"];
if(arry && arry.count > 0)
{
for(NSDictionary *dict in arry)
{
JHLSMode *mode = [[JHLSMode alloc] init];
[mode unPacketData:dict];
[self.productList addObject:mode];
}
}
}


@end
4 changes: 2 additions & 2 deletions YHB_Prj/YHB_Prj/shangpinguanli/EditSPVC/JHLSTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
//

#import <UIKit/UIKit.h>

@class JHLSMode;
@interface JHLSTableViewCell : UITableViewCell
@property (strong, nonatomic) IBOutlet UILabel *laTime;
@property (strong, nonatomic) IBOutlet UILabel *laName;
@property (strong, nonatomic) IBOutlet UILabel *laPrice;
@property (strong, nonatomic) IBOutlet UILabel *laNum;
@property (strong, nonatomic) IBOutlet UILabel *laSum;


+ (CGFloat)heightForCell;
- (void)setCellWithMode:(JHLSMode *)aMode;
@end
11 changes: 11 additions & 0 deletions YHB_Prj/YHB_Prj/shangpinguanli/EditSPVC/JHLSTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "JHLSTableViewCell.h"
#import "JHLSMode.h"

@implementation JHLSTableViewCell

Expand All @@ -19,6 +20,16 @@ + (CGFloat)heightForCell
return 108;
}

- (void)setCellWithMode:(JHLSMode *)aMode
{
[self resetCell];
_laName.text = aMode.strSup_name;
_laNum.text = aMode.strStock_num;
_laPrice.text = [NSString stringWithFormat:@"%.2f", [aMode.strStock_price floatValue]];
_laSum.text = [NSString stringWithFormat:@"%.2f", [aMode.strStock_price floatValue]*[aMode.strStock_num floatValue]];
_laTime.text = aMode.strAdd_date;
}

- (void)resetCell
{
_laName.text = @"";
Expand Down
4 changes: 2 additions & 2 deletions YHB_Prj/YHB_Prj/shangpinguanli/EditSPVC/JHLSTableViewCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="南京母婴商贸有限公司" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5VD-WC-vRY">
<rect key="frame" x="55" y="30" width="180" height="21"/>
<rect key="frame" x="55" y="30" width="250" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -93,7 +93,7 @@
<outlet property="laSum" destination="w8M-V2-5TP" id="Rfh-2n-lyo"/>
<outlet property="laTime" destination="t8g-1f-PyW" id="DQe-tU-7TF"/>
</connections>
<point key="canvasLocation" x="33" y="279"/>
<point key="canvasLocation" x="-228" y="229"/>
</tableViewCell>
</objects>
</document>
4 changes: 3 additions & 1 deletion YHB_Prj/YHB_Prj/shangpinguanli/EditSPVC/JHLSViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
[tableView registerNib:[UINib nibWithNibName:@"JHLSTableViewCell" bundle:nil] forCellReuseIdentifier:cellId];
cell = [tableView dequeueReusableCellWithIdentifier:cellId];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;

return cell;
}

- (void)tableView:(UITableView *)tableView willDisplayCell:(JHLSTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{

JHLSMode *mode = _arrData[indexPath.row];
[cell setCellWithMode:mode];
}

- (void)didReceiveMemoryWarning {
Expand Down
6 changes: 6 additions & 0 deletions YHB_Prj/YHB_Prj/shangpinguanli/EditSPVC/SPManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@
- (void)appGetProductStockDetail:(NSString *)aProductId finishBlock:(void (^)(NSArray *))FBlock isRefresh:(BOOL)aBool;

@end

@interface XSLSManager : NSObject

- (void)getSaleHisByProductIdApp:(NSString *)aProductId finishBlock:(void (^)(NSArray *))FBlock isRefresh:(BOOL)aBool;

@end
43 changes: 42 additions & 1 deletion YHB_Prj/YHB_Prj/shangpinguanli/EditSPVC/SPManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import "SPManager.h"
#import "NetManager.h"
#import "JHLSMode.h"
#import "XSLSMode.h"

@implementation SPManager

Expand Down Expand Up @@ -39,7 +41,7 @@ - (void)appGetProductStockDetail:(NSString *)aProductId finishBlock:(void (^)(NS
[dict setObject:aProductId forKey:@"productId"];
[dict setObject:@0 forKey:@"status"];
[dict setObject:@-1 forKey:@"orderFrom"];
[dict setObject:[NSString stringWithFormat:@"%d",currentPage] forKey:@"pageNo"];
[dict setObject:@(currentPage) forKey:@"pageNo"];
[dict setObject:@20 forKey:@"pageSize"];
[dict setObject:@"true" forKey:@"needPage"];
[NetManager requestWith:dict apiName:@"appGetProductStockDetail" method:@"post" succ:^(NSDictionary *successDict) {
Expand All @@ -48,6 +50,9 @@ - (void)appGetProductStockDetail:(NSString *)aProductId finishBlock:(void (^)(NS
if ([code isEqualToString:@"success"] && code)
{
NSDictionary *dictResult = successDict[@"result"];
JHLSList *list = [[JHLSList alloc] init];
[list unPacketData:dictResult];
FBlock(list.productList);
}
else FBlock(nil);
} failure:^(NSDictionary *failDict, NSError *error) {
Expand All @@ -56,3 +61,39 @@ - (void)appGetProductStockDetail:(NSString *)aProductId finishBlock:(void (^)(NS
}

@end

@interface XSLSManager()
{
int currentPage;
}
@end

@implementation XSLSManager

- (void)getSaleHisByProductIdApp:(NSString *)aProductId finishBlock:(void (^)(NSArray *))FBlock isRefresh:(BOOL)aBool
{
if (aBool) currentPage=0;
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:0];
[dict setObject:aProductId forKey:@"product_id"];
[dict setObject:@(currentPage) forKey:@"pageNo"];
[dict setObject:@20 forKey:@"pageSize"];
[dict setObject:@"true" forKey:@"needPage"];
[NetManager requestWith:dict apiName:@"getSaleHisByProductIdApp" method:@"post" succ:^(NSDictionary *successDict) {
MLOG(@"%@", successDict);
NSString *code = successDict[@"msg"];
MLOG(@"%@", successDict[@"RErrorInfo"]);
if ([code isEqualToString:@"success"] && code)
{
NSDictionary *dictResult = successDict[@"result"];
XSLSList *list = [[XSLSList alloc] init];
[list unPacketData:dictResult];
FBlock(list.productList);
}
else FBlock(nil);
} failure:^(NSDictionary *failDict, NSError *error) {
FBlock(nil);
}];

}

@end
Loading

0 comments on commit 881b719

Please sign in to comment.