Commit a7578035 authored by 陈俊俊's avatar 陈俊俊

采购通知单

parent 9e53ce25
...@@ -145,6 +145,10 @@ ...@@ -145,6 +145,10 @@
72C803521B7B897B00990363 /* DataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 72C803511B7B897B00990363 /* DataManager.m */; }; 72C803521B7B897B00990363 /* DataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 72C803511B7B897B00990363 /* DataManager.m */; };
72EDD86E1B96E11700964115 /* ChooseParentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72EDD86D1B96E11700964115 /* ChooseParentViewController.m */; }; 72EDD86E1B96E11700964115 /* ChooseParentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72EDD86D1B96E11700964115 /* ChooseParentViewController.m */; };
72F56CB21B76EC200077F0C9 /* SurveyUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 72F56CB11B76EC200077F0C9 /* SurveyUser.m */; }; 72F56CB21B76EC200077F0C9 /* SurveyUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 72F56CB11B76EC200077F0C9 /* SurveyUser.m */; };
72F9D47F1BA7E97200795A00 /* NoticeProduct.m in Sources */ = {isa = PBXBuildFile; fileRef = 72F9D47E1BA7E97200795A00 /* NoticeProduct.m */; };
72F9D4821BA7EC9600795A00 /* NoticeProductViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72F9D4811BA7EC9600795A00 /* NoticeProductViewController.m */; };
72F9D4851BA7FFC400795A00 /* PurchaseNotice.m in Sources */ = {isa = PBXBuildFile; fileRef = 72F9D4841BA7FFC400795A00 /* PurchaseNotice.m */; };
72F9D4881BA8065500795A00 /* PurchaseNoticeListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 72F9D4871BA8065500795A00 /* PurchaseNoticeListCell.m */; };
871F9F047CDDAC523E4358DC /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 86D33EC280C440156ED1B976 /* libPods.a */; }; 871F9F047CDDAC523E4358DC /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 86D33EC280C440156ED1B976 /* libPods.a */; };
C10214CD1AD8FE200024637E /* ICRStoreDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10214CC1AD8FE200024637E /* ICRStoreDetailViewController.m */; }; C10214CD1AD8FE200024637E /* ICRStoreDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10214CC1AD8FE200024637E /* ICRStoreDetailViewController.m */; };
C10214CE1AD8FE200024637E /* ICRStoreDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10214CC1AD8FE200024637E /* ICRStoreDetailViewController.m */; }; C10214CE1AD8FE200024637E /* ICRStoreDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10214CC1AD8FE200024637E /* ICRStoreDetailViewController.m */; };
...@@ -685,6 +689,14 @@ ...@@ -685,6 +689,14 @@
72EDD86D1B96E11700964115 /* ChooseParentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChooseParentViewController.m; sourceTree = "<group>"; }; 72EDD86D1B96E11700964115 /* ChooseParentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChooseParentViewController.m; sourceTree = "<group>"; };
72F56CB01B76EC200077F0C9 /* SurveyUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurveyUser.h; sourceTree = "<group>"; }; 72F56CB01B76EC200077F0C9 /* SurveyUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurveyUser.h; sourceTree = "<group>"; };
72F56CB11B76EC200077F0C9 /* SurveyUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SurveyUser.m; sourceTree = "<group>"; }; 72F56CB11B76EC200077F0C9 /* SurveyUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SurveyUser.m; sourceTree = "<group>"; };
72F9D47D1BA7E97200795A00 /* NoticeProduct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoticeProduct.h; sourceTree = "<group>"; };
72F9D47E1BA7E97200795A00 /* NoticeProduct.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NoticeProduct.m; sourceTree = "<group>"; };
72F9D4801BA7EC9600795A00 /* NoticeProductViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoticeProductViewController.h; sourceTree = "<group>"; };
72F9D4811BA7EC9600795A00 /* NoticeProductViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NoticeProductViewController.m; sourceTree = "<group>"; };
72F9D4831BA7FFC400795A00 /* PurchaseNotice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurchaseNotice.h; sourceTree = "<group>"; };
72F9D4841BA7FFC400795A00 /* PurchaseNotice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurchaseNotice.m; sourceTree = "<group>"; };
72F9D4861BA8065500795A00 /* PurchaseNoticeListCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurchaseNoticeListCell.h; sourceTree = "<group>"; };
72F9D4871BA8065500795A00 /* PurchaseNoticeListCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurchaseNoticeListCell.m; sourceTree = "<group>"; };
7DDFB1D460448C3B45118195 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; }; 7DDFB1D460448C3B45118195 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
86D33EC280C440156ED1B976 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 86D33EC280C440156ED1B976 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
C10214CB1AD8FE200024637E /* ICRStoreDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRStoreDetailViewController.h; sourceTree = "<group>"; }; C10214CB1AD8FE200024637E /* ICRStoreDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRStoreDetailViewController.h; sourceTree = "<group>"; };
...@@ -1062,6 +1074,10 @@ ...@@ -1062,6 +1074,10 @@
04B4A3861B9CAAD700D88D68 /* ShopDetail.m */, 04B4A3861B9CAAD700D88D68 /* ShopDetail.m */,
04E721E11BA755FD008F9158 /* ProductUnit.h */, 04E721E11BA755FD008F9158 /* ProductUnit.h */,
04E721E21BA755FD008F9158 /* ProductUnit.m */, 04E721E21BA755FD008F9158 /* ProductUnit.m */,
72F9D47D1BA7E97200795A00 /* NoticeProduct.h */,
72F9D47E1BA7E97200795A00 /* NoticeProduct.m */,
72F9D4831BA7FFC400795A00 /* PurchaseNotice.h */,
72F9D4841BA7FFC400795A00 /* PurchaseNotice.m */,
); );
path = Models; path = Models;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1077,6 +1093,10 @@ ...@@ -1077,6 +1093,10 @@
04E721DF1BA73CE2008F9158 /* ChooseProductUnitViewController.m */, 04E721DF1BA73CE2008F9158 /* ChooseProductUnitViewController.m */,
0414FF151B94959700C7B00E /* ShopDetaileViewController.h */, 0414FF151B94959700C7B00E /* ShopDetaileViewController.h */,
0414FF161B94959700C7B00E /* ShopDetaileViewController.m */, 0414FF161B94959700C7B00E /* ShopDetaileViewController.m */,
72F9D4801BA7EC9600795A00 /* NoticeProductViewController.h */,
72F9D4811BA7EC9600795A00 /* NoticeProductViewController.m */,
72F9D4861BA8065500795A00 /* PurchaseNoticeListCell.h */,
72F9D4871BA8065500795A00 /* PurchaseNoticeListCell.m */,
); );
path = Views; path = Views;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2587,6 +2607,7 @@ ...@@ -2587,6 +2607,7 @@
C11A34661B24487D00079129 /* ICRAnswer.m in Sources */, C11A34661B24487D00079129 /* ICRAnswer.m in Sources */,
C1D017171AD8EF8100CD9CB8 /* IBTSegmentedControl.m in Sources */, C1D017171AD8EF8100CD9CB8 /* IBTSegmentedControl.m in Sources */,
C10C90901AE54FE300B911CD /* IBTDatePickerViewController.m in Sources */, C10C90901AE54FE300B911CD /* IBTDatePickerViewController.m in Sources */,
72F9D4881BA8065500795A00 /* PurchaseNoticeListCell.m in Sources */,
0414FF1A1B94959700C7B00E /* SelectCompanyViewController.m in Sources */, 0414FF1A1B94959700C7B00E /* SelectCompanyViewController.m in Sources */,
C1C5644B1AD66EB4006A1050 /* ICRTaskListViewController.m in Sources */, C1C5644B1AD66EB4006A1050 /* ICRTaskListViewController.m in Sources */,
35CF33981B96BB02001211EF /* GXFPaging.m in Sources */, 35CF33981B96BB02001211EF /* GXFPaging.m in Sources */,
...@@ -2597,6 +2618,7 @@ ...@@ -2597,6 +2618,7 @@
C1FE50501AE024FA00C18080 /* UIActionSheet+Blocks.m in Sources */, C1FE50501AE024FA00C18080 /* UIActionSheet+Blocks.m in Sources */,
C123A92B1B26EDDA003C0C36 /* ICRQuestionHelperView.m in Sources */, C123A92B1B26EDDA003C0C36 /* ICRQuestionHelperView.m in Sources */,
7281A0BF1B8980E60052B1AC /* PurchaseBill.m in Sources */, 7281A0BF1B8980E60052B1AC /* PurchaseBill.m in Sources */,
72F9D4851BA7FFC400795A00 /* PurchaseNotice.m in Sources */,
0414FF191B94959700C7B00E /* PurchaseNoticeCell.m in Sources */, 0414FF191B94959700C7B00E /* PurchaseNoticeCell.m in Sources */,
7217E9EB1B72364300FE5C1D /* HPGrowingTextView.m in Sources */, 7217E9EB1B72364300FE5C1D /* HPGrowingTextView.m in Sources */,
724171761B9D30DE0094DF55 /* ChooseCostViewController.m in Sources */, 724171761B9D30DE0094DF55 /* ChooseCostViewController.m in Sources */,
...@@ -2732,6 +2754,7 @@ ...@@ -2732,6 +2754,7 @@
C10C90A11AE5751D00B911CD /* ICRPost.m in Sources */, C10C90A11AE5751D00B911CD /* ICRPost.m in Sources */,
0414FF1B1B94959700C7B00E /* ShopDetaileViewController.m in Sources */, 0414FF1B1B94959700C7B00E /* ShopDetaileViewController.m in Sources */,
7217E9F21B72364300FE5C1D /* StartTimeView.m in Sources */, 7217E9F21B72364300FE5C1D /* StartTimeView.m in Sources */,
72F9D47F1BA7E97200795A00 /* NoticeProduct.m in Sources */,
C1FE50351AE020D400C18080 /* IBTAudioController.m in Sources */, C1FE50351AE020D400C18080 /* IBTAudioController.m in Sources */,
7281A0C21B898A040052B1AC /* PurchaseDetailViewController.m in Sources */, 7281A0C21B898A040052B1AC /* PurchaseDetailViewController.m in Sources */,
C14BE3061ADB84350049F1AA /* IBTTextFieldCell.m in Sources */, C14BE3061ADB84350049F1AA /* IBTTextFieldCell.m in Sources */,
...@@ -2778,6 +2801,7 @@ ...@@ -2778,6 +2801,7 @@
C123A9291B26EDDA003C0C36 /* ICRQInputPopup.m in Sources */, C123A9291B26EDDA003C0C36 /* ICRQInputPopup.m in Sources */,
30D702421ADE37D3008DC0BF /* ICRAnnouncementDetailViewController.m in Sources */, 30D702421ADE37D3008DC0BF /* ICRAnnouncementDetailViewController.m in Sources */,
FE17F6791B85847D0078CE96 /* QueryOrder.m in Sources */, FE17F6791B85847D0078CE96 /* QueryOrder.m in Sources */,
72F9D4821BA7EC9600795A00 /* NoticeProductViewController.m in Sources */,
C15039221ADE39190081A686 /* IBTUIControl.m in Sources */, C15039221ADE39190081A686 /* IBTUIControl.m in Sources */,
C112BC4D1AD91CF800F75F58 /* ICRPatrolDetailViewController.m in Sources */, C112BC4D1AD91CF800F75F58 /* ICRPatrolDetailViewController.m in Sources */,
0414FF181B94959700C7B00E /* SeePurchaseNoticeViewController.m in Sources */, 0414FF181B94959700C7B00E /* SeePurchaseNoticeViewController.m in Sources */,
......
...@@ -182,15 +182,15 @@ static NSString * const ICRHTTPInterface[] = { ...@@ -182,15 +182,15 @@ static NSString * const ICRHTTPInterface[] = {
[XFFHttp_FinishProcess] = @"process/finish", [XFFHttp_FinishProcess] = @"process/finish",
[XFFHttp_AbortProcess] = @"process/abort", [XFFHttp_AbortProcess] = @"process/abort",
//采购通知单 //采购通知单
[XFFHttp_savePurchaseNotice] = @"purchase/notice/save", [XFFHttp_savePurchaseNotice] = @"purchase/notice/save",
[XFFHttp_getPurchaseNoticeList] = @"purchase/notice/query", [XFFHttp_getPurchaseNoticeList] = @"purchase/notice/query",
[XFFHttp_getPurchaseNoticeDetailed] = @"purchase/notice/get/", [XFFHttp_getPurchaseNoticeDetailed] = @"purchase/notice/get",
[XFFHttp_saveAndSubmitPurchaseNotice] = @"purchase/notice/saveandsubmit", [XFFHttp_saveAndSubmitPurchaseNotice] = @"purchase/notice/saveandsubmit",
[XFFHttp_ComitPurchaseNotice] = @"purchase/notice/submit/", [XFFHttp_ComitPurchaseNotice] = @"purchase/notice/submit/",
[XFFHttp_acceptPurchaseNotice] = @"purchase/notice/accept/", [XFFHttp_acceptPurchaseNotice] = @"purchase/notice/accept/",
[XFFHttp_finishPurchaseNotice] = @"purchase/notice/finish/", [XFFHttp_finishPurchaseNotice] = @"purchase/notice/finish/",
[XFFHttp_getPurchaseNoticeRecod] = @"purchase/trace/get/", [XFFHttp_getPurchaseNoticeRecod] = @"purchase/trace/get/",
//采购单 //采购单
...@@ -2340,10 +2340,42 @@ acceptTypeJson:YES ...@@ -2340,10 +2340,42 @@ acceptTypeJson:YES
} }
//3·采购通知单明细(读) //3·采购通知单明细(读)
- (void)getPurchaseNoticeDetailedWithPurchaseUuid:(NSString *)purchaseUuid success:(void (^)(id))succ - (void)getPurchaseNoticeDetailedWithPurchaseUuid:(NSString *)purchaseUuid
failure:(void (^)(id))fail 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 *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_getPurchaseNoticeDetailed] stringByAppendingFormat:@"/%@",purchaseUuid];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self GET:encodeUrlStr
parameters:nil
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
} }
//4·保存并提交采购通知单 //4·保存并提交采购通知单
- (void)saveAndSubmitPurchaseNoticeWithData:(id)data - (void)saveAndSubmitPurchaseNoticeWithData:(id)data
......
...@@ -179,6 +179,17 @@ ...@@ -179,6 +179,17 @@
#define TRANSPORT_STATE_RECEIVED @"received" //已收货 #define TRANSPORT_STATE_RECEIVED @"received" //已收货
#define TRANSPORT_STATE_ABORTED @"aborted" //已废用 #define TRANSPORT_STATE_ABORTED @"aborted" //已废用
//采购通知单状态
//initial("未提交"), notAccepted("未接受"), purchasing("采购中"), finished("已完成")
#define PURCHASENOTICE_STATE_INITIAL @"initial"
#define PURCHASENOTICE_STATE_NOTACCEPTED @"notAccepted"
#define PURCHASENOTICE_STATE_PURCHASEING @"purchasing"
#define PURCHASENOTICE_STATE_FINISHED @"finished"
//采购通知单权限
#define NOTICE_PERMISSIONS_ACCEPTTASK @"500304"//接受任务
#define NOTICE_PERMISSIONS_CREATEBILL @"500305"//新建权
#define NOTICE_PERMISSIONS_FINISH @"500306"//结束
#endif #endif
...@@ -162,6 +162,7 @@ typedef enum : NSUInteger { ...@@ -162,6 +162,7 @@ typedef enum : NSUInteger {
ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init]; ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init];
if (billProduct) { if (billProduct) {
svc.navTitle = @"编辑商品";
ShopDetail *shopDetail=[self coverShopDetail:billProduct]; ShopDetail *shopDetail=[self coverShopDetail:billProduct];
shopDetail.IsXiuGai=YES; shopDetail.IsXiuGai=YES;
svc.choseShopDetail = ^(ShopDetail *Detail){ svc.choseShopDetail = ^(ShopDetail *Detail){
...@@ -177,6 +178,7 @@ typedef enum : NSUInteger { ...@@ -177,6 +178,7 @@ typedef enum : NSUInteger {
svc.shopDetail=shopDetail; svc.shopDetail=shopDetail;
}else{ }else{
// 回调 // 回调
svc.navTitle = @"添加商品";
svc.choseShopDetail = ^(ShopDetail *shopDetail){ svc.choseShopDetail = ^(ShopDetail *shopDetail){
PurchaseBillProduct *billProduct = [self coverPurchaseProduct:shopDetail]; PurchaseBillProduct *billProduct = [self coverPurchaseProduct:shopDetail];
[_pvc.productArr addObject:billProduct]; [_pvc.productArr addObject:billProduct];
......
...@@ -89,11 +89,6 @@ ...@@ -89,11 +89,6 @@
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
} }
// else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
// stateStr = @"发运中";
// [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
//
// }
else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_FINISHED]) { else if ([purchaseBill.state isEqualToString:PURCHASE_STATE_FINISHED]) {
stateStr = @"已完成"; stateStr = @"已完成";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled]; [self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled];
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "ICRBaseViewController.h" #import "ICRBaseViewController.h"
#import "PurchaseNotice.h"
@interface NewPurchaseNoticeViewController : ICRBaseViewController @interface NewPurchaseNoticeViewController : ICRBaseViewController
@property (nonatomic,strong)PurchaseNotice *purchaseNotice;
@end @end
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
// //
#import "PurchaseNoticeViewController.h" #import "PurchaseNoticeViewController.h"
#import "PurchaseCell.h"
#import "PurchaseBill.h"
#import "SeePurchaseNoticeViewController.h" #import "SeePurchaseNoticeViewController.h"
#import "NewPurchaseNoticeViewController.h"
#import "QueryOrder.h" #import "QueryOrder.h"
#import "SortMaskView.h" #import "SortMaskView.h"
#import "PurchaseBoltView.h" #import "PurchaseBoltView.h"
#import "MJRefresh.h" #import "MJRefresh.h"
#import "PurchaseNoticeListCell.h"
#import "PurchaseNotice.h"
#define TopMargin 44 #define TopMargin 44
#define TableHeight 120 #define TableHeight 120
#define LeftMargin 20 #define LeftMargin 20
...@@ -56,39 +56,12 @@ typedef enum : NSUInteger { ...@@ -56,39 +56,12 @@ typedef enum : NSUInteger {
[self createTableView]; [self createTableView];
[self createRefresh]; [self createRefresh];
[self getData]; [self getData];
[self createBackBtn];
// Do any additional setup after loading the view.
} }
- (void)initData{ - (void)initData{
self.view.backgroundColor = XXFBgColor; self.view.backgroundColor = XXFBgColor;
self.dataArr = [NSMutableArray array]; self.dataArr = [NSMutableArray array];
for (NSInteger i = 0; i < 6; i++) {
PurchaseBill *bill = [PurchaseBill new];
bill.billNumber = @"222222222";
bill.noticeNumber = @"134594059654";
bill.create_operName = @"创建人";
bill.create_time = @"2013-03-04";
bill.vendor_name = @"供应商";
bill.total = [NSNumber numberWithFloat:22];
bill.remark = @"备注";
bill.lastModify_operName = @"最后修改人";
bill.vendorConfirmTime = @"否";
if (i == 0) {
bill.state = @"initial";
}else if(i == 1){
bill.state = @"submitted";
}else if(i == 2){
bill.state = @"rejected";
}else if(i == 3){
bill.state = @"approved";
}else if(i == 4){
bill.state = @"shipping";
}else if(i == 5){
bill.state = @"finished";
}
[self.dataArr addObject:bill];
}
} }
- (void)getData{ - (void)getData{
[ICRUserUtil sharedInstance].needFresh = NO; [ICRUserUtil sharedInstance].needFresh = NO;
...@@ -149,31 +122,16 @@ typedef enum : NSUInteger { ...@@ -149,31 +122,16 @@ typedef enum : NSUInteger {
[orderArr addObject:[order dictForCommit]]; [orderArr addObject:[order dictForCommit]];
} }
// 网络请求
NSDictionary *dict = @{ NSDictionary *dict = @{
@"billNumberLike":billObject, @"billNumberLike":billObject,
@"state":stateObject, @"state":stateObject,
@"noticeNumberLike":noticeObject, @"title":[NSNull null],
@"titleLike":[NSNull null], @"orderField":@"created",
@"vendorUuid":[NSNull null], @"orderDirection":@"desc",
@"queryOrders":orderArr, // @"queryOrders":orderArr,
@"userUuid":userUtil.userId,
@"pageNumber":@(_currentPage), @"pageNumber":@(_currentPage),
@"pageSize":@(20)}; @"pageSize":@(20)};
[[ICRHTTPController sharedController] queryPurchaseWithData:dict success:succ failure:fail]; [[ICRHTTPController sharedController] getPurchaseNoticeListWithData:dict success:succ failure:fail];
// NSDictionary *dict = @{
// @"billNumberLike":billObject,
// @"state":stateObject,
// @"noticeNumberLike":noticeObject,
// @"titleLike":[NSNull null],
//// @"orderField":@"created",
//// @"orderDirection":@"desc",
// @"vendorUuid":[NSNull null],
// @"queryOrders":orderArr,
// @"userUuid":userUtil.userId,
// @"pageNumber":@(_currentPage),
// @"pageSize":@(20)};
// [[ICRHTTPController sharedController] queryPurchaseWithData:dict success:succ failure:fail];
} }
//刷新列表 //刷新列表
- (void)fetchtPuchaseList:(id)data{ - (void)fetchtPuchaseList:(id)data{
...@@ -182,13 +140,13 @@ typedef enum : NSUInteger { ...@@ -182,13 +140,13 @@ typedef enum : NSUInteger {
NSString *message = data[@"message"] ; NSString *message = data[@"message"] ;
if (success == 1) { if (success == 1) {
if (_currentPage == 0) { if (_currentPage == 0) {
// if (self.dataArr.count > 0) { if (self.dataArr.count > 0) {
// [self.dataArr removeAllObjects]; [self.dataArr removeAllObjects];
// } }
} }
NSArray *recodesArr = data[ @"data" ][ @"records" ]; NSArray *recodesArr = data[ @"data" ][ @"records" ];
for (NSDictionary *purchaseBillDict in recodesArr) { for (NSDictionary *purchaseBillDict in recodesArr) {
PurchaseBill *purchaseBill = [[PurchaseBill alloc]init]; PurchaseNotice *purchaseBill = [[PurchaseNotice alloc]init];
[purchaseBill setValuesForKeysWithDictionary:purchaseBillDict]; [purchaseBill setValuesForKeysWithDictionary:purchaseBillDict];
[self.dataArr addObject:purchaseBill]; [self.dataArr addObject:purchaseBill];
} }
...@@ -440,38 +398,52 @@ typedef enum : NSUInteger { ...@@ -440,38 +398,52 @@ typedef enum : NSUInteger {
return self.dataArr.count; return self.dataArr.count;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"SurveyID"; static NSString *cellID = @"PurchaseNoticeListCell";
PurchaseCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; PurchaseNoticeListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) { if (cell == nil) {
cell = [[PurchaseCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; cell = [[PurchaseNoticeListCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone; tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
} }
if (self.dataArr.count > 0) { if (self.dataArr.count > 0) {
PurchaseBill *bill = self.dataArr[indexPath.row]; PurchaseNotice *bill = self.dataArr[indexPath.row];
[cell setPurchaseBill:bill]; cell.purchaseNotice = bill;
} }
return cell; return cell;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
SeePurchaseNoticeViewController *pvc = [SeePurchaseNoticeViewController new]; if (_dataArr.count > 0) {
pvc.title = @"查看采购单"; PurchaseNotice *purchaseNotice = _dataArr[indexPath.row];
pvc.bill = _dataArr[indexPath.row]; if ([purchaseNotice.state isEqualToString:PURCHASENOTICE_STATE_INITIAL]) {
if(indexPath.row == 0){ NewPurchaseNoticeViewController *nvc = [NewPurchaseNoticeViewController new];
pvc.indexPerson = 0; nvc.purchaseNotice = purchaseNotice;
}else if(indexPath.row == 1){ nvc.title = @"修改采购单通知";
pvc.indexPerson = 1; [self PushViewController:nvc animated:YES];
}else if(indexPath.row == 2){ }else{
pvc.indexPerson = 2; SeePurchaseNoticeViewController *pvc = [SeePurchaseNoticeViewController new];
pvc.title = @"查看采购单";
pvc.purchaseNotice = purchaseNotice;
[self PushViewController:pvc animated:YES];
}
} }
[self PushViewController:pvc animated:YES];
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return TableHeight; return TableHeight;
} }
- (void)createBackBtn{
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
btn.frame = CGRectMake(0, 0, 12, 20);
[btn addTarget:self action:@selector(backRV) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *back = [[UIBarButtonItem alloc]initWithCustomView:btn];
self.navigationItem.leftBarButtonItem = back;
}
- (void)backRV{
[self PopToRootViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
// //
#import "ICRBaseViewController.h" #import "ICRBaseViewController.h"
#import "PurchaseBill.h" #import "PurchaseNotice.h"
@interface SeePurchaseNoticeViewController : ICRBaseViewController @interface SeePurchaseNoticeViewController : ICRBaseViewController
@property (nonatomic,strong)PurchaseBill *bill; @property (nonatomic,strong)PurchaseNotice *purchaseNotice;
//模拟三个人员
@property (nonatomic,assign)NSInteger indexPerson;//0.1.2 @property (nonatomic,assign)NSInteger indexPerson;//0.1.2
@end @end
//
// NoticeProduct.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/15.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface NoticeProduct : IBTModel
@property (nonatomic,strong)NSString *uuid;//唯一标识
@property (nonatomic,strong)NSString *productUuid;//商品uuid
@property (nonatomic,strong)NSString *productCode;//商品代码
@property (nonatomic,strong)NSString *productName;//商品名称
@property (nonatomic,strong)NSNumber *qpc;//包装规格
@property (nonatomic,strong)NSString *packUnit;//包装单位
@property (nonatomic,strong)NSNumber *qpcQuantity;//包装数量
@property (nonatomic,strong)NSNumber *quantity;//基础数量
@property (nonatomic,strong)NSNumber *purchasedQuantity;//已采购数量
@property (nonatomic,strong)NSString *remark;//备注
@end
//
// NoticeProduct.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/15.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "NoticeProduct.h"
@implementation NoticeProduct
@end
//
// PurchaseNotice.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/15.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTModel.h"
@interface PurchaseNotice : IBTModel
@property (nonatomic,strong)NSString *uuid;//唯一标识
@property (nonatomic,strong)NSString *create_time;//创建时间
@property (nonatomic,strong)NSString *create_id;//创建人代码
@property (nonatomic,strong)NSString *create_operName;//创建人名称
@property (nonatomic,strong)NSString *lastModified_time;//最后修改时间
@property (nonatomic,strong)NSString *lastModified_id;//最后修改人代码
@property (nonatomic,strong)NSString *lastModified_operName;//最后修改人名称
@property (nonatomic,strong)NSString *billnumber;//采购单号
@property (nonatomic,strong)NSNumber *version;//版本号
@property (nonatomic,strong)NSString *title;//标题
@property (nonatomic,strong)NSString *state;//状态
@property (nonatomic,strong)NSString *purchaserUuid;//采购员ID
@property (nonatomic,strong)NSString *purchaserCode;//采购员代码
@property (nonatomic,strong)NSString *purchaserName;//采购员名称
@property (nonatomic,strong)NSString *remark;//备注
@property (nonatomic,strong)NSArray *products;//商品
@end
//
// PurchaseNotice.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/15.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "PurchaseNotice.h"
@implementation PurchaseNotice
@end
//
// NoticeProductViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/15.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "NoticeProduct.h"
typedef void(^ChoseNoticeProduct)(NoticeProduct *noticeProduct,NSIndexPath *indexPath);
typedef void(^DeleteNoticeProduct)(NoticeProduct *accountDetail,NSIndexPath *indexPath);
@interface NoticeProductViewController : ICRBaseViewController
@property (nonatomic,strong)NoticeProduct *noticeProduct;
@property (nonatomic,copy)ChoseNoticeProduct choseNoticeProduct;
@property (nonatomic,copy)DeleteNoticeProduct deleteNoticeProduct;
@property (nonatomic,strong)NSIndexPath *indexPath;
@property (nonatomic,strong)NSString *navTitle;
@end
//
// PurchaseNoticeListCell.h
// XFFruit
//
// Created by 陈俊俊 on 15/9/15.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PurchaseNotice.h"
@interface PurchaseNoticeListCell : UITableViewCell
@property (nonatomic,strong)UILabel *billNumberLabel;//采购单号
@property (nonatomic,strong)UILabel *titleLabel;//标题
@property (nonatomic,strong)UILabel *userLabel;//采购员
@property (nonatomic,strong)UILabel *createOperNameLabel;//创建人
@property (nonatomic,strong)UILabel *createTimeLabel;//创建时间
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIButton *stateBtn;
@property (nonatomic,strong)PurchaseNotice *purchaseNotice;
@end
//
// PurchaseNoticeListCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/9/15.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "PurchaseNoticeListCell.h"
#define TitleSize 16
#define LeftMargin 90
#define TopMargin 10
#define TitleHeight 20
#define TableHeight 120
@implementation PurchaseNoticeListCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayout];
}
return self;
}
- (void)bulidLayout
{
self.stateBtn = [UIButton buttonWithType:UIButtonTypeCustom];
self.stateBtn.frame = CGRectMake(TopMargin *2 , TopMargin, LeftMargin - TopMargin*3, 20);
self.stateBtn.titleLabel.font = GXF_FOURTEENTH_SIZE;
[self.stateBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
self.stateBtn.enabled = NO;
self.billNumberLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, TopMargin, ScreenSize.width - LeftMargin, TitleHeight))];
self.billNumberLabel.textColor = GXF_CONTENT_COLOR;
self.billNumberLabel.font = GXF_SIXTEENTEH_SIZE;
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, CGRectGetMaxY(self.billNumberLabel.frame), ScreenSize.width - LeftMargin, TitleHeight))];
self.titleLabel.numberOfLines = 0;
self.titleLabel.textColor = GXF_CELL_COLOR;
self.titleLabel.font = GXF_FOURTEENTH_SIZE;
self.userLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, CGRectGetMaxY(self.titleLabel.frame), ScreenSize.width - LeftMargin, TitleHeight))];
self.userLabel.textColor = GXF_CELL_COLOR;
self.userLabel.font = GXF_FOURTEENTH_SIZE;
self.createOperNameLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, CGRectGetMaxY(self.userLabel.frame), ScreenSize.width - LeftMargin, TitleHeight))];
self.createOperNameLabel.textColor = GXF_CELL_COLOR;
self.createOperNameLabel.font = GXF_FOURTEENTH_SIZE;
self.createTimeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, CGRectGetMaxY(self.createOperNameLabel.frame), ScreenSize.width - LeftMargin, TitleHeight))];
self.createTimeLabel.textColor = GXF_CELL_COLOR;
self.createTimeLabel.font = GXF_FOURTEENTH_SIZE;
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin,TableHeight-1, ScreenSize.width - LeftMargin - TopMargin * 2, 1))];;
self.lineLabel.backgroundColor = GXF_LINE_COLOR;
[self.contentView addSubview:self.stateBtn];
[self.contentView addSubview:self.billNumberLabel];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.userLabel];
[self.contentView addSubview:self.createOperNameLabel];
[self.contentView addSubview:self.createTimeLabel];
[self.contentView addSubview:self.lineLabel];
}
- (void)setPurchaseNotice:(PurchaseNotice *)purchaseNotice{
self.billNumberLabel.text = [NSString stringWithFormat:@"单号:%@",purchaseNotice.billnumber];
self.titleLabel.text = [NSString stringWithFormat:@"标题:%@",purchaseNotice.title];
self.userLabel.text = [NSString stringWithFormat:@"采购员:%@",purchaseNotice.purchaserName] ;
self.createOperNameLabel.text = [NSString stringWithFormat:@"创建人:%@",purchaseNotice.create_operName] ;
self.createTimeLabel.text =[NSString stringWithFormat:@"创建时间:%@",purchaseNotice.create_time];
NSString *stateStr = @"";
if ([purchaseNotice.state isEqualToString:PURCHASENOTICE_STATE_INITIAL]) {
stateStr = @"未提交";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"initial"] forState:UIControlStateDisabled];
}else if ([purchaseNotice.state isEqualToString:PURCHASENOTICE_STATE_NOTACCEPTED]) {
stateStr = @"未接受";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([purchaseNotice.state isEqualToString:PURCHASENOTICE_STATE_PURCHASEING]) {
stateStr = @"采购中";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"insurvey"] forState:UIControlStateDisabled];
}else if ([purchaseNotice.state isEqualToString:PURCHASE_STATE_FINISHED]) {
stateStr = @"已完成";
[self.stateBtn setBackgroundImage:[UIImage imageNamed:@"finish"] forState:UIControlStateDisabled];
}
[self.stateBtn setTitle:stateStr forState:UIControlStateNormal];
}
@end
...@@ -29,7 +29,7 @@ typedef enum : NSUInteger { ...@@ -29,7 +29,7 @@ typedef enum : NSUInteger {
SaveTag = 2000, SaveTag = 2000,
CommitTag, CommitTag,
} BtnTag; } BtnTag;
@interface ShopDetaileViewController ()<UITableViewDataSource,UITableViewDelegate,HPGrowingTextViewDelegate,UITextFieldDelegate,StartTimeViewDelegate> @interface ShopDetaileViewController ()<UITableViewDataSource,UITableViewDelegate,HPGrowingTextViewDelegate,UITextFieldDelegate>
{ {
UITableView *_tableView; UITableView *_tableView;
NSMutableArray *_dataArr; NSMutableArray *_dataArr;
...@@ -63,7 +63,6 @@ typedef enum : NSUInteger { ...@@ -63,7 +63,6 @@ typedef enum : NSUInteger {
self.title = self.navTitle; self.title = self.navTitle;
[self initData]; [self initData];
[self setupSubviews]; [self setupSubviews];
// Do any additional setup after loading the view.
} }
- (void)initData{ - (void)initData{
merchandise=[[UITextField alloc]init]; merchandise=[[UITextField alloc]init];
...@@ -84,9 +83,7 @@ typedef enum : NSUInteger { ...@@ -84,9 +83,7 @@ typedef enum : NSUInteger {
} }
-(void)setupSubviews -(void)setupSubviews
{ {
// self.view.backgroundColor = XXFBgColor;
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, 0,ScreenSize.width, ScreenSize.height - 64 - LeftMargin)) style:(UITableViewStylePlain)]; _tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, 0,ScreenSize.width, ScreenSize.height - 64 - LeftMargin)) style:(UITableViewStylePlain)];
_tableView.backgroundColor = [UIColor whiteColor]; _tableView.backgroundColor = [UIColor whiteColor];
_tableView.bounces = NO; _tableView.bounces = NO;
...@@ -100,9 +97,7 @@ typedef enum : NSUInteger { ...@@ -100,9 +97,7 @@ typedef enum : NSUInteger {
UIButton *commitBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(saveBtn.frame.origin.x + saveBtn.frame.size.width + LeftMargin, 10, (ScreenSize.width - LeftMargin*3)/2, BtnHeight) target:self sel:@selector(btnClick:) tag:CommitTag image:nil title:@"保存" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_COMMIT_COLOR]; UIButton *commitBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(saveBtn.frame.origin.x + saveBtn.frame.size.width + LeftMargin, 10, (ScreenSize.width - LeftMargin*3)/2, BtnHeight) target:self sel:@selector(btnClick:) tag:CommitTag image:nil title:@"保存" titleColor: [UIColor whiteColor] isCorner:YES corner:CornerRadius bgColor:GXF_COMMIT_COLOR];
[footView addSubview:commitBtn]; [footView addSubview:commitBtn];
_tableView.tableFooterView = footView;
// [self.view addSubview:footView];
_tableView.tableFooterView = footView;
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
} }
...@@ -129,10 +124,6 @@ typedef enum : NSUInteger { ...@@ -129,10 +124,6 @@ typedef enum : NSUInteger {
_PackagingLable.textColor=GXF_CONTENT_COLOR; _PackagingLable.textColor=GXF_CONTENT_COLOR;
} }
} }
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - 按钮点击事件 #pragma mark - 按钮点击事件
- (void)btnClick:(UIButton *)btn{ - (void)btnClick:(UIButton *)btn{
switch (btn.tag) { switch (btn.tag) {
...@@ -149,15 +140,10 @@ typedef enum : NSUInteger { ...@@ -149,15 +140,10 @@ typedef enum : NSUInteger {
{ {
[self clearShopDetail]; [self clearShopDetail];
} }
}else }else
{ {
[self clearShopDetail]; [self clearShopDetail];
} }
// if ([self checkSurvey]) {
// [self saveSurvey:@"initial" message:@"正在保存..."];
// }
} }
break; break;
case CommitTag: case CommitTag:
...@@ -167,7 +153,6 @@ typedef enum : NSUInteger { ...@@ -167,7 +153,6 @@ typedef enum : NSUInteger {
shopDetail.IsDeleted=NO; shopDetail.IsDeleted=NO;
self.choseShopDetail(shopDetail);//回调 self.choseShopDetail(shopDetail);//回调
[self PopViewControllerAnimated:YES]; [self PopViewControllerAnimated:YES];
// [self saveSurvey:@"submitted" message:@"正在提交..."];
} }
} }
break; break;
...@@ -242,87 +227,6 @@ typedef enum : NSUInteger { ...@@ -242,87 +227,6 @@ typedef enum : NSUInteger {
return YES; return YES;
} }
#pragma mark - 保存
- (void)saveSurvey:(NSString *)state message:(NSString *)msg
{
//保存
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"];
if (success == 1) {
//成功
[IBTLoadingView showTips:@"操作成功"];
[self clearAllInformation];
if (self.survey) {
[ICRUserUtil sharedInstance].needFresh = YES;
[self.navigationController popViewControllerAnimated:YES];
}
}else{
[IBTLoadingView showTips:message];
}
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
id uuidObject = [NSNull null];
if(self.survey.uuid.length > 0){
uuidObject = self.survey.uuid;
}
id billNumberObject = [NSNull null];
if (self.survey.billNumber > 0) {
billNumberObject = self.survey.billNumber;
}
NSNumber *version = [NSNumber numberWithLong:0];
if (self.survey) {
version = self.survey.version;
}
NSDictionary *dict = @{@"uuid":uuidObject,
@"version":version,
@"billnumber":billNumberObject,
@"title":[IBTCommon checkString:self.titleStr],
@"state":state,
@"productUuid":[IBTCommon checkString:self.productUuidStr],
@"productCode":[IBTCommon checkString:self.productCodeStr],
@"productName":[IBTCommon checkString:self.productNameStr],
@"beginDate":[IBTCommon checkString:self.beginDateStr],
@"endDate":[IBTCommon checkString:self.endDateStr],
@"remark":[IBTCommon checkString:self.remarkStr],
@"users":self.users};
[IBTLoadingView showProgressLabel:msg];
[[ICRHTTPController sharedController] saveSurveyWithAuthenticode:dict success:succ failure:fail];
}
- (void)clearAllInformation{
_productLabel.text = @"请输入商品";
_productLabel.textColor = GXF_PLACEHOLDER_COLOR;
// _startDateLabel.text = @"选择日期";
// _startDateLabel.textColor = GXF_PLACEHOLDER_COLOR;
// _endDateLabel.text = @"选择日期";
// _endDateLabel.textColor = GXF_PLACEHOLDER_COLOR;
// _personLabel.text = @"选择调研人员";
// _personLabel.textColor = GXF_PLACEHOLDER_COLOR;
_noteTextView.text = @"";
//清空数据
self.titleStr = @"";
self.productCodeStr = @"";
self.productNameStr = @"";
self.productUuidStr = @"";
self.beginDateStr = @"";
self.endDateStr = @"";
[self.users removeAllObjects];
self.remarkStr = @"";
}
#pragma mark - 协议方法 #pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1; return 1;
...@@ -363,12 +267,10 @@ typedef enum : NSUInteger { ...@@ -363,12 +267,10 @@ typedef enum : NSUInteger {
if (indexPath.row==0) { if (indexPath.row==0) {
_productLabel = contentLabel; _productLabel = contentLabel;
contentLabel.text = @"选择商品"; contentLabel.text = @"选择商品";
[self preferDataInProductLabel];
}else if (indexPath.row==3) }else if (indexPath.row==3)
{ {
_PackagingLable = contentLabel; _PackagingLable = contentLabel;
contentLabel.text = @"选择包装单位"; contentLabel.text = @"选择包装单位";
[self preferDataInProductLabel];
} }
}else }else
...@@ -465,15 +367,6 @@ typedef enum : NSUInteger { ...@@ -465,15 +367,6 @@ typedef enum : NSUInteger {
} }
} }
- (void)preferDataInProductLabel{
if (self.survey) {
_productLabel.text = [IBTCommon checkString:self.survey.productName];
_productLabel.textColor = GXF_CONTENT_COLOR;
self.productCodeStr = [IBTCommon checkString:self.survey.productCode];
self.productNameStr = [IBTCommon checkString:self.survey.productName];
self.productUuidStr = [IBTCommon checkString:self.survey.productUuid];
}
}
#pragma mark delegate #pragma mark delegate
- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{ - (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{
[_noteTextView resignFirstResponder]; [_noteTextView resignFirstResponder];
......
...@@ -129,18 +129,6 @@ typedef enum : NSUInteger { ...@@ -129,18 +129,6 @@ typedef enum : NSUInteger {
ShowMessage(@"尾款不能为空"); ShowMessage(@"尾款不能为空");
return NO; return NO;
} }
if (![RegexUtil isValidateNmuberAndFloat:_actualmoneyField.text]) {
ShowMessage(@"应付金额不合法");
return NO;
}
if (![RegexUtil isValidateNmuberAndFloat:_paidmoneyField.text]) {
ShowMessage(@"已付金额额不合法");
return NO;
}
if (![RegexUtil isValidateNmuberAndFloat:_leftmoneyField.text]) {
ShowMessage(@"尾款不合法");
return NO;
}
if (!self.accountDetail) { if (!self.accountDetail) {
self.accountDetail = [[FeeAcountDetail alloc]init]; self.accountDetail = [[FeeAcountDetail alloc]init];
} }
...@@ -232,8 +220,6 @@ typedef enum : NSUInteger { ...@@ -232,8 +220,6 @@ typedef enum : NSUInteger {
_noteTextView.text = self.accountDetail.note; _noteTextView.text = self.accountDetail.note;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return TableRowHeight; return TableRowHeight;
} }
...@@ -250,34 +236,17 @@ typedef enum : NSUInteger { ...@@ -250,34 +236,17 @@ typedef enum : NSUInteger {
[self PushViewController:cvc animated:YES]; [self PushViewController:cvc animated:YES];
} }
} }
#pragma mark delegate #pragma mark delegate
- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{ - (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView{
[_noteTextView resignFirstResponder]; [_noteTextView resignFirstResponder];
[self setTableFrame:LeftMargin];
return YES; return YES;
} }
- (void)growingTextViewDidBeginEditing:(HPGrowingTextView *)growingTextView{
CGFloat offset = ScreenSize.height - TotalHeight - KeyboardHeight;
if (offset < 0) {//上移
[self setTableFrame:LeftMargin+offset];
}
}
- (void)setTableFrame:(CGFloat)tabelH{
[UIView animateWithDuration:0.25 animations:^{
CGRect tableFrame = _tableView.frame;
tableFrame.origin.y = tabelH;
_tableView.frame = tableFrame;
}];
}
- (void)keyboardHidden{ - (void)keyboardHidden{
[_actualmoneyField resignFirstResponder]; [_actualmoneyField resignFirstResponder];
[_paidmoneyField resignFirstResponder]; [_paidmoneyField resignFirstResponder];
[_leftmoneyField resignFirstResponder]; [_leftmoneyField resignFirstResponder];
[_noteTextView resignFirstResponder]; [_noteTextView resignFirstResponder];
[self setTableFrame:LeftMargin];
} }
- (void)viewWillDisappear:(BOOL)animated{ - (void)viewWillDisappear:(BOOL)animated{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment