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

Merge branch 'DEV_20150805_001' of http://121.42.32.57/root/xffruit into DEV_20150805_001

Conflicts:
	XFFruit/Controllers/HTTPController/ICRHTTPController.m
	XFFruit/ViewControllers/Business/BusinessViewController.m
	XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m
	XFFruit/ViewControllers/Survey/controllers/ChooseProductViewController.m
parents b27addf1 e6b29715
......@@ -9,6 +9,12 @@
/* Begin PBXBuildFile section */
04040E001B6FE75800326D12 /* ICRPerson.m in Sources */ = {isa = PBXBuildFile; fileRef = 04040DFF1B6FE75800326D12 /* ICRPerson.m */; };
0406BFD91B7C97E700DD65A7 /* BusinessViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0406BFD81B7C97E700DD65A7 /* BusinessViewController.m */; };
0414FF171B94959700C7B00E /* NewPurchaseNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF0C1B94959700C7B00E /* NewPurchaseNoticeViewController.m */; };
0414FF181B94959700C7B00E /* SeePurchaseNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF0E1B94959700C7B00E /* SeePurchaseNoticeViewController.m */; };
0414FF191B94959700C7B00E /* PurchaseNoticeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF121B94959700C7B00E /* PurchaseNoticeCell.m */; };
0414FF1A1B94959700C7B00E /* SelectCompanyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF141B94959700C7B00E /* SelectCompanyViewController.m */; };
0414FF1B1B94959700C7B00E /* ShopDetaileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0414FF161B94959700C7B00E /* ShopDetaileViewController.m */; };
04F6E70A1B9B08A500550849 /* PurchaseNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F6E7091B9B08A500550849 /* PurchaseNoticeViewController.m */; };
300DD94A1B184B450080EE12 /* ICRPatrolPlan.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD9491B184B450080EE12 /* ICRPatrolPlan.m */; };
300DD94B1B184B450080EE12 /* ICRPatrolPlan.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD9491B184B450080EE12 /* ICRPatrolPlan.m */; };
300DD94E1B184EA70080EE12 /* ICRQuestion.m in Sources */ = {isa = PBXBuildFile; fileRef = 300DD94D1B184EA70080EE12 /* ICRQuestion.m */; };
......@@ -392,10 +398,6 @@
C1FE50571AE3587F00C18080 /* ICRAttachmentUnit.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FE50551AE3587F00C18080 /* ICRAttachmentUnit.m */; };
FE0C9B091B7C543D00335B39 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = FE0C9B081B7C543D00335B39 /* User.m */; };
FE17F6791B85847D0078CE96 /* QueryOrder.m in Sources */ = {isa = PBXBuildFile; fileRef = FE17F6781B85847D0078CE96 /* QueryOrder.m */; };
FE17F6831B85CA5B0078CE96 /* NewPurchaseNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE17F67C1B85CA5B0078CE96 /* NewPurchaseNoticeViewController.m */; };
FE17F6841B85CA5B0078CE96 /* PurchaseNoticeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FE17F67E1B85CA5B0078CE96 /* PurchaseNoticeCell.m */; };
FE17F6851B85CA5B0078CE96 /* SeePurchaseNoticeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE17F6801B85CA5B0078CE96 /* SeePurchaseNoticeViewController.m */; };
FE17F6861B85CA5B0078CE96 /* ShopDetaileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE17F6821B85CA5B0078CE96 /* ShopDetaileViewController.m */; };
FE2FCC7F1B74511000BBC6FB /* ChooseProductViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE2FCC7E1B74511000BBC6FB /* ChooseProductViewController.m */; };
FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE2FCC811B745E1A00BBC6FB /* SurveyDetailViewController.m */; };
FE2FCC881B7492C500BBC6FB /* ResultDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE2FCC871B7492C500BBC6FB /* ResultDetailViewController.m */; };
......@@ -434,6 +436,18 @@
04040DFF1B6FE75800326D12 /* ICRPerson.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRPerson.m; sourceTree = "<group>"; };
0406BFD71B7C97E700DD65A7 /* BusinessViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BusinessViewController.h; path = ../ViewControllers/Business/BusinessViewController.h; sourceTree = "<group>"; };
0406BFD81B7C97E700DD65A7 /* BusinessViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BusinessViewController.m; path = ../ViewControllers/Business/BusinessViewController.m; sourceTree = "<group>"; };
0414FF0B1B94959700C7B00E /* NewPurchaseNoticeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewPurchaseNoticeViewController.h; sourceTree = "<group>"; };
0414FF0C1B94959700C7B00E /* NewPurchaseNoticeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewPurchaseNoticeViewController.m; sourceTree = "<group>"; };
0414FF0D1B94959700C7B00E /* SeePurchaseNoticeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SeePurchaseNoticeViewController.h; sourceTree = "<group>"; };
0414FF0E1B94959700C7B00E /* SeePurchaseNoticeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SeePurchaseNoticeViewController.m; sourceTree = "<group>"; };
0414FF111B94959700C7B00E /* PurchaseNoticeCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurchaseNoticeCell.h; sourceTree = "<group>"; };
0414FF121B94959700C7B00E /* PurchaseNoticeCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurchaseNoticeCell.m; sourceTree = "<group>"; };
0414FF131B94959700C7B00E /* SelectCompanyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectCompanyViewController.h; sourceTree = "<group>"; };
0414FF141B94959700C7B00E /* SelectCompanyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectCompanyViewController.m; sourceTree = "<group>"; };
0414FF151B94959700C7B00E /* ShopDetaileViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopDetaileViewController.h; sourceTree = "<group>"; };
0414FF161B94959700C7B00E /* ShopDetaileViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopDetaileViewController.m; sourceTree = "<group>"; };
04F6E7081B9B08A500550849 /* PurchaseNoticeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurchaseNoticeViewController.h; sourceTree = "<group>"; };
04F6E7091B9B08A500550849 /* PurchaseNoticeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurchaseNoticeViewController.m; sourceTree = "<group>"; };
1B0B22845F5CD40B5CF655F2 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
300DD9481B184B450080EE12 /* ICRPatrolPlan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRPatrolPlan.h; sourceTree = "<group>"; };
300DD9491B184B450080EE12 /* ICRPatrolPlan.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRPatrolPlan.m; sourceTree = "<group>"; };
......@@ -896,14 +910,6 @@
FE0C9B081B7C543D00335B39 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = User.m; path = ../Views/User.m; sourceTree = "<group>"; };
FE17F6771B85847D0078CE96 /* QueryOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QueryOrder.h; sourceTree = "<group>"; };
FE17F6781B85847D0078CE96 /* QueryOrder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QueryOrder.m; sourceTree = "<group>"; };
FE17F67B1B85CA5B0078CE96 /* NewPurchaseNoticeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewPurchaseNoticeViewController.h; sourceTree = "<group>"; };
FE17F67C1B85CA5B0078CE96 /* NewPurchaseNoticeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewPurchaseNoticeViewController.m; sourceTree = "<group>"; };
FE17F67D1B85CA5B0078CE96 /* PurchaseNoticeCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurchaseNoticeCell.h; sourceTree = "<group>"; };
FE17F67E1B85CA5B0078CE96 /* PurchaseNoticeCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurchaseNoticeCell.m; sourceTree = "<group>"; };
FE17F67F1B85CA5B0078CE96 /* SeePurchaseNoticeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SeePurchaseNoticeViewController.h; sourceTree = "<group>"; };
FE17F6801B85CA5B0078CE96 /* SeePurchaseNoticeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SeePurchaseNoticeViewController.m; sourceTree = "<group>"; };
FE17F6811B85CA5B0078CE96 /* ShopDetaileViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopDetaileViewController.h; sourceTree = "<group>"; };
FE17F6821B85CA5B0078CE96 /* ShopDetaileViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopDetaileViewController.m; sourceTree = "<group>"; };
FE2FCC7D1B74511000BBC6FB /* ChooseProductViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChooseProductViewController.h; sourceTree = "<group>"; };
FE2FCC7E1B74511000BBC6FB /* ChooseProductViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChooseProductViewController.m; sourceTree = "<group>"; };
FE2FCC801B745E1A00BBC6FB /* SurveyDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurveyDetailViewController.h; sourceTree = "<group>"; };
......@@ -982,6 +988,39 @@
name = Business;
sourceTree = "<group>";
};
0414FF0A1B94959700C7B00E /* Controllers */ = {
isa = PBXGroup;
children = (
0414FF0B1B94959700C7B00E /* NewPurchaseNoticeViewController.h */,
0414FF0C1B94959700C7B00E /* NewPurchaseNoticeViewController.m */,
04F6E7081B9B08A500550849 /* PurchaseNoticeViewController.h */,
04F6E7091B9B08A500550849 /* PurchaseNoticeViewController.m */,
0414FF0D1B94959700C7B00E /* SeePurchaseNoticeViewController.h */,
0414FF0E1B94959700C7B00E /* SeePurchaseNoticeViewController.m */,
);
path = Controllers;
sourceTree = "<group>";
};
0414FF0F1B94959700C7B00E /* Models */ = {
isa = PBXGroup;
children = (
);
path = Models;
sourceTree = "<group>";
};
0414FF101B94959700C7B00E /* Views */ = {
isa = PBXGroup;
children = (
0414FF111B94959700C7B00E /* PurchaseNoticeCell.h */,
0414FF121B94959700C7B00E /* PurchaseNoticeCell.m */,
0414FF131B94959700C7B00E /* SelectCompanyViewController.h */,
0414FF141B94959700C7B00E /* SelectCompanyViewController.m */,
0414FF151B94959700C7B00E /* ShopDetaileViewController.h */,
0414FF161B94959700C7B00E /* ShopDetaileViewController.m */,
);
path = Views;
sourceTree = "<group>";
};
351CFF4A1B90633700F30866 /* Controllers */ = {
isa = PBXGroup;
children = (
......@@ -2228,14 +2267,9 @@
FE17F67A1B85CA5B0078CE96 /* PurchaseNotice */ = {
isa = PBXGroup;
children = (
FE17F67B1B85CA5B0078CE96 /* NewPurchaseNoticeViewController.h */,
FE17F67C1B85CA5B0078CE96 /* NewPurchaseNoticeViewController.m */,
FE17F67D1B85CA5B0078CE96 /* PurchaseNoticeCell.h */,
FE17F67E1B85CA5B0078CE96 /* PurchaseNoticeCell.m */,
FE17F67F1B85CA5B0078CE96 /* SeePurchaseNoticeViewController.h */,
FE17F6801B85CA5B0078CE96 /* SeePurchaseNoticeViewController.m */,
FE17F6811B85CA5B0078CE96 /* ShopDetaileViewController.h */,
FE17F6821B85CA5B0078CE96 /* ShopDetaileViewController.m */,
0414FF0A1B94959700C7B00E /* Controllers */,
0414FF0F1B94959700C7B00E /* Models */,
0414FF101B94959700C7B00E /* Views */,
);
path = PurchaseNotice;
sourceTree = "<group>";
......@@ -2404,9 +2438,12 @@
35CF337B1B953F9A001211EF /* GXFProcessMaterial.m in Sources */,
FE4F17251B72FAAB00924DED /* ChosePersonViewController.m in Sources */,
30D7495F1ACE8F4400C63BA1 /* ICRConfigurationViewController.m in Sources */,
FE17F6841B85CA5B0078CE96 /* PurchaseNoticeCell.m in Sources */,
FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */,
0414FF171B94959700C7B00E /* NewPurchaseNoticeViewController.m in Sources */,
35CF33901B95AF1B001211EF /* GXFBaseSearchViewController.m in Sources */,
FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */,
C182E40E1AD4CE0B009BB9DB /* IBTModel.m in Sources */,
C1FE50411AE0240300C18080 /* IBTAVAudioPlayWrapper.m in Sources */,
......@@ -2416,10 +2453,13 @@
C142D2BE1AC3A155000109A7 /* UIView+FindUIViewController.m in Sources */,
35C3C0BF1AE95F1D0035AC8A /* UIImage+Rotate.m in Sources */,
7281A0C51B89BF1C0052B1AC /* ChooseVendorViewController.m in Sources */,
04F6E70A1B9B08A500550849 /* PurchaseNoticeViewController.m in Sources */,
35CF337E1B953FFF001211EF /* GXFProcessProduct.m in Sources */,
C11A344D1B1BE27200079129 /* ICRPatrolAllStoreViewController.m in Sources */,
C10214DD1AD90A3F0024637E /* ICRFunctionEntity.m in Sources */,
FE17F6831B85CA5B0078CE96 /* NewPurchaseNoticeViewController.m in Sources */,
FE4678AA1B8D60F900B5EDA3 /* ChooseTypeViewController.m in Sources */,
725581E51B9C3C05001EB0E1 /* TransportPurchaseViewController.m in Sources */,
30DB92A61ADD039F00271835 /* ICRAnnocementContentView.m in Sources */,
......@@ -2454,6 +2494,7 @@
C11A34661B24487D00079129 /* ICRAnswer.m in Sources */,
C1D017171AD8EF8100CD9CB8 /* IBTSegmentedControl.m in Sources */,
C10C90901AE54FE300B911CD /* IBTDatePickerViewController.m in Sources */,
0414FF1A1B94959700C7B00E /* SelectCompanyViewController.m in Sources */,
C1C5644B1AD66EB4006A1050 /* ICRTaskListViewController.m in Sources */,
35CF33981B96BB02001211EF /* GXFPaging.m in Sources */,
35CF338D1B95A442001211EF /* GXFSearchView.m in Sources */,
......@@ -2463,6 +2504,7 @@
C1FE50501AE024FA00C18080 /* UIActionSheet+Blocks.m in Sources */,
C123A92B1B26EDDA003C0C36 /* ICRQuestionHelperView.m in Sources */,
7281A0BF1B8980E60052B1AC /* PurchaseBill.m in Sources */,
0414FF191B94959700C7B00E /* PurchaseNoticeCell.m in Sources */,
7217E9EB1B72364300FE5C1D /* HPGrowingTextView.m in Sources */,
72C803521B7B897B00990363 /* DataManager.m in Sources */,
C1C5643E1AD62BD8006A1050 /* ICRPlaceholderTextView.m in Sources */,
......@@ -2541,7 +2583,6 @@
C123A8FB1B2561E1003C0C36 /* JTPopOverWindow.m in Sources */,
725581F41B9C7F23001EB0E1 /* FeeAcountDetail.m in Sources */,
72F56CB21B76EC200077F0C9 /* SurveyUser.m in Sources */,
FE17F6861B85CA5B0078CE96 /* ShopDetaileViewController.m in Sources */,
C142D2B41AC3A155000109A7 /* UIImage+Helper.m in Sources */,
C18AEA9E1AD2F48200A1DB7B /* ICRStore.m in Sources */,
C15295BB1B244C8E00DF60D1 /* ICRQScoreViewController.m in Sources */,
......@@ -2573,13 +2614,13 @@
FEAE16E91B79C9F9009D9E01 /* ResultView.m in Sources */,
FEA2F30C1B84687D00D64735 /* FooterCell.m in Sources */,
C142D2C01AC3A155000109A7 /* UIView+ViewFrameGeometry.m in Sources */,
FE17F6851B85CA5B0078CE96 /* SeePurchaseNoticeViewController.m in Sources */,
C1FE50451AE0249A00C18080 /* IBTImagePicker.m in Sources */,
FEA2F3091B8459DA00D64735 /* HeaderCell.m in Sources */,
C1E108611ADA8D3800620375 /* ICRAttachment.m in Sources */,
C159187C1AC435DF0013B391 /* IBTAdditionsObserver.m in Sources */,
C18AEA8C1AC9855400A1DB7B /* IBTLoadingView.m in Sources */,
C10C90A11AE5751D00B911CD /* ICRPost.m in Sources */,
0414FF1B1B94959700C7B00E /* ShopDetaileViewController.m in Sources */,
7217E9F21B72364300FE5C1D /* StartTimeView.m in Sources */,
C1FE50351AE020D400C18080 /* IBTAudioController.m in Sources */,
7281A0C21B898A040052B1AC /* PurchaseDetailViewController.m in Sources */,
......@@ -2630,6 +2671,7 @@
FE17F6791B85847D0078CE96 /* QueryOrder.m in Sources */,
C15039221ADE39190081A686 /* IBTUIControl.m in Sources */,
C112BC4D1AD91CF800F75F58 /* ICRPatrolDetailViewController.m in Sources */,
0414FF181B94959700C7B00E /* SeePurchaseNoticeViewController.m in Sources */,
C142D2BC1AC3A155000109A7 /* UITableViewCell+Helper.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -2847,7 +2889,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
......@@ -2885,7 +2927,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MTL_ENABLE_DEBUG_INFO = NO;
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
......@@ -2909,7 +2951,9 @@
"$(PROJECT_DIR)",
);
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Debug;
......@@ -2930,7 +2974,9 @@
"$(PROJECT_DIR)",
);
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Release;
......@@ -2953,7 +2999,7 @@
INFOPLIST_FILE = XFFruitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = XFFruitTests;
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/XFFruit.app/XFFruit";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
......@@ -2973,7 +3019,7 @@
INFOPLIST_FILE = XFFruitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = XFFruitTests;
PROVISIONING_PROFILE = "a12432a9-50b3-4cef-bae7-dcb35f965ce4";
PROVISIONING_PROFILE = "cfc700e3-f78e-4893-a7fd-62daba6a0c6c";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/XFFruit.app/XFFruit";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
......
......@@ -66,7 +66,7 @@
if (![_dataBase open]) {
[self openDb];
}
NSString *createTableSql = @"CREATE TABLE IF NOT EXISTS displayFunction (Id INTEGER PRIMARY KEY AUTOINCREMENT,functionId INTEGER,functionName VARCHAR ,functionImgName VARCHAR,functionSmallImgName VARCHAR, isSelected INTEGER,functionItemTag INTEGER )";
NSString *createTableSql = @"CREATE TABLE IF NOT EXISTS displayFunction (Id INTEGER PRIMARY KEY AUTOINCREMENT,functionId INTEGER,functionName VARCHAR ,functionImgName VARCHAR,functionSmallImgName VARCHAR, isSelected INTEGER,hasPermission INTEGER,functionItemTag INTEGER )";
BOOL work = [_dataBase executeUpdate:createTableSql];
return work;
......@@ -196,24 +196,31 @@
#pragma displayFunction
- (BOOL)insertDisplayFunction: (GXFDisplayFunction *)displayFunction {
NSString *inserSql = @"INSERT INTO displayFunction(functionId,functionName,functionImgName,functionSmallImgName,functionItemTag) VALUES(?,?,?,?,?)";
BOOL work = [_dataBase executeUpdate:inserSql,@(displayFunction.functionId),displayFunction.functionName,displayFunction.functionImgName,displayFunction.functionSmallImgName,@(displayFunction.functionItemTag)];
NSString *inserSql = @"INSERT INTO displayFunction(functionId,functionName,functionImgName,functionSmallImgName,hasPermission,functionItemTag) VALUES(?,?,?,?,?,?)";
BOOL work = [_dataBase executeUpdate:inserSql,@(displayFunction.functionId),displayFunction.functionName,displayFunction.functionImgName,displayFunction.functionSmallImgName,@(0),@(displayFunction.functionItemTag)];
return work;
}
- (GXFDisplayFunction *)selectDisplayFunctionByFunctionId: (NSInteger)functionId{
GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init];
FMResultSet *rs = [_dataBase executeQuery:@"SELET * FROM displayFunction WHERE functionId = ? ",@(functionId)];
while ([rs next]) {
displayFunction.functionId = [rs intForColumn:@"functionId"];
displayFunction.functionName = [rs stringForColumn:@"functionName"];
displayFunction.functionImgName = [rs stringForColumn:@"functionImgName"];
displayFunction.functionSmallImgName = [rs stringForColumn:@"functionSmallImgName"];
displayFunction.functionItemTag = [rs intForColumn:@"functionItemTag"];
break;
}
return displayFunction;
//- (GXFDisplayFunction *)upDatePermissionDisplayFunctionByFunctionId: (NSInteger)functionId {
// GXFDisplayFunction *displayFunction = [[GXFDisplayFunction alloc]init];
// FMResultSet *rs = [_dataBase executeQuery:@"SELET * FROM displayFunction WHERE functionId = ? ",@(functionId)];
// while ([rs next]) {
// displayFunction.functionId = [rs intForColumn:@"functionId"];
// displayFunction.functionName = [rs stringForColumn:@"functionName"];
// displayFunction.functionImgName = [rs stringForColumn:@"functionImgName"];
// displayFunction.functionSmallImgName = [rs stringForColumn:@"functionSmallImgName"];
// displayFunction.functionItemTag = [rs intForColumn:@"functionItemTag"];
// break;
// }
// return displayFunction;
//}
//更新权限
- (BOOL)updateDisplayFunctionPermissionWithId: (GXFDisplayFunction *)displayFunction{
BOOL work = [_dataBase executeUpdate:@"UPDATE displayFunction SET hasPermission = ? where functionId = ?",@(displayFunction.hasPermission),@(displayFunction.functionId)];
return work;
}
//更新是否选中
- (BOOL)updateDisplayFunctionIsSelectedWithId: (GXFDisplayFunction *)displayFunction{
BOOL work = [_dataBase executeUpdate:@"UPDATE displayFunction SET isSelected = ? where functionId = ?",@(displayFunction.isSelected),@(displayFunction.functionId)];
......@@ -221,31 +228,195 @@
}
#pragma 有权限的displayfunctions
//待改正,最好的办法是两张表关联起来查找但是我还没做到
//返回有权限的,并更新了权限
-(NSArray *)displayFunctionsHasPermission{
NSMutableArray *muArr = [NSMutableArray array];
NSArray *hasPermission = [self p_functionsIdPermission];
BOOL hasSeeOption1 = NO;
BOOL hasSeeOption3 = NO;
BOOL hasSeeOption4 = NO;
BOOL hasSeeOption5 = NO;
BOOL hasSeeOption6 = NO;
BOOL hasSeeOption7 = NO;
for (int count = 0; count < hasPermission.count; count ++) {
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction WHERE functionId = ?",hasPermission[count] ];
while ([rs next]) {
GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs];
displayFunction.hasPermission = YES;
[self updateDisplayFunctionPermissionWithId:displayFunction];
[muArr addObject:displayFunction];
if (displayFunction.functionId == 500102 && hasSeeOption1 == NO) {
hasSeeOption1 = YES;
}
if (displayFunction.functionId == 500103 && hasSeeOption1 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption1 = NO;
}
//"采购通知"
if (displayFunction.functionId == 500302 && hasSeeOption3 == NO) {
hasSeeOption3 = YES;
}
if (displayFunction.functionId == 500303 && hasSeeOption3 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption3 = NO;
}
//采购单???? 有三个:"全部查看权"、"本人查看权"、 "供应商查看权"
if (displayFunction.functionId == 500402 && hasSeeOption4 == NO) {
hasSeeOption4 = YES;
}
if (displayFunction.functionId == 500403 && hasSeeOption4 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption4 = YES;
}
//"发运单"
if (displayFunction.functionId == 500502 && hasSeeOption5 == NO) {
hasSeeOption5 = YES;
}
if (displayFunction.functionId == 500503 && hasSeeOption5 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption5 = NO;
}
//"转运单"
if (displayFunction.functionId == 500602 && hasSeeOption6 == NO) {
hasSeeOption6 = YES;
}
if (displayFunction.functionId == 500603 && hasSeeOption6 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption6 = NO;
}
//"加工单"
if (displayFunction.functionId == 500702 && hasSeeOption7 == NO) {
hasSeeOption7 = YES;
}
if (displayFunction.functionId == 500703 && hasSeeOption7 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption7 = NO;
}
continue;
}
}
return muArr;
}
////把显示重复功能的去掉
//- (NSArray *)siftDuplicationDisplayFunctionsButton {
// NSMutableArray *allDisplayFunctionsArr = [NSMutableArray arrayWithArray:[self displayFunctionsHasPermission]];
// NSMutableArray *muArr = [NSMutableArray array];
//
// NSArray *hasPermission = [self p_functionsIdPermission];
// BOOL hasSeeOption1 = NO;
//
// BOOL hasSeeOption3 = NO;
// BOOL hasSeeOption4 = NO;
// BOOL hasSeeOption5 = NO;
// BOOL hasSeeOption6 = NO;
// BOOL hasSeeOption7 = NO;
//
// for (int count = 0; count < hasPermission.count; count ++) {
// FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction WHERE functionId = ?",hasPermission[count] ];
// while ([rs next]) {
// GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs];
//
// [muArr addObject:displayFunction];
// //"行情反馈",
// if (displayFunction.functionId == 500102 && hasSeeOption1 == NO) {
// hasSeeOption1 = YES;
// }
// if (displayFunction.functionId == 500103 && hasSeeOption1 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption1 = NO;
// }
//
// //"采购通知"
// if (displayFunction.functionId == 500302 && hasSeeOption3 == NO) {
// hasSeeOption3 = YES;
// }
// if (displayFunction.functionId == 500303 && hasSeeOption3 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption3 = NO;
// }
//
// //采购单???? 有三个:"全部查看权"、"本人查看权"、 "供应商查看权"
// if (displayFunction.functionId == 500402 && hasSeeOption4 == NO) {
// hasSeeOption4 = YES;
// }
// if (displayFunction.functionId == 500403 && hasSeeOption4 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption4 = YES;
// }
//// if (displayFunction.functionId == 500403 && hasSeeOption4 == NO) {
//// //[muArr removeObject:displayFunction];
//// hasSeeOption4 = YES;
//// }
//// if (displayFunction.functionId == 500403 && hasSeeOption4 == YES) {
//// [muArr removeObject:displayFunction];
//// hasSeeOption4 = YES;
//// }
//// if (displayFunction.functionId == 500404 && hasSeeOption4 == YES) {
//// [muArr removeObject:displayFunction];
//// hasSeeOption4 = YES;
//// }
//
// //"发运单"
// if (displayFunction.functionId == 500502 && hasSeeOption5 == NO) {
// hasSeeOption5 = YES;
// }
// if (displayFunction.functionId == 500503 && hasSeeOption5 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption5 = NO;
// }
//
// //"转运单"
// if (displayFunction.functionId == 500602 && hasSeeOption6 == NO) {
// hasSeeOption6 = YES;
// }
// if (displayFunction.functionId == 500603 && hasSeeOption6 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption6 = NO;
// }
// //"加工单"
// if (displayFunction.functionId == 500702 && hasSeeOption7 == NO) {
// hasSeeOption7 = YES;
// }
// if (displayFunction.functionId == 500703 && hasSeeOption7 == YES) {
// [muArr removeObject:displayFunction];
// hasSeeOption7 = NO;
// }
//
// }
// }
//
// return muArr;
//
//}
//默认配置显示功能 初始配置为
- (NSArray *)defaultdisplayFunctions {
NSMutableArray *arr = [NSMutableArray arrayWithArray:[self displayFunctionsHasPermission]];
for (int count = 0; count < arr.count; count ++) {
if ((count % 2) || (count == 0)) {
GXFDisplayFunction *displayFunction = (GXFDisplayFunction *)arr[count];
displayFunction.isSelected = YES;
[self updateDisplayFunctionIsSelectedWithId:displayFunction];
[arr replaceObjectAtIndex:count withObject:displayFunction];
}
}
......@@ -256,9 +427,72 @@
- (NSArray *)originDisplayFunctions {
NSMutableArray *muArr = [NSMutableArray array];
FMResultSet *rs = [_dataBase executeQuery: @"SELECT * FROM displayFunction"];
BOOL hasSeeOption1 = NO;
BOOL hasSeeOption3 = NO;
BOOL hasSeeOption4 = NO;
BOOL hasSeeOption5 = NO;
BOOL hasSeeOption6 = NO;
BOOL hasSeeOption7 = NO;
while ([rs next]) {
GXFDisplayFunction *displayFunction = [self p_resultSetDisplayFunction:rs];
[muArr addObject:displayFunction];
//"行情反馈",
if (displayFunction.functionId == 500102 && hasSeeOption1 == NO) {
hasSeeOption1 = YES;
}
if (displayFunction.functionId == 500103 && hasSeeOption1 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption1 = NO;
}
//"采购通知"
if (displayFunction.functionId == 500302 && hasSeeOption3 == NO) {
hasSeeOption3 = YES;
}
if (displayFunction.functionId == 500303 && hasSeeOption3 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption3 = NO;
}
//采购单???? 有三个:"全部查看权"、"本人查看权"、 "供应商查看权"
if (displayFunction.functionId == 500402 && hasSeeOption4 == NO) {
hasSeeOption4 = YES;
}
if (displayFunction.functionId == 500403 && hasSeeOption4 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption4 = YES;
}
//"发运单"
if (displayFunction.functionId == 500502 && hasSeeOption5 == NO) {
hasSeeOption5 = YES;
}
if (displayFunction.functionId == 500503 && hasSeeOption5 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption5 = NO;
}
//"转运单"
if (displayFunction.functionId == 500602 && hasSeeOption6 == NO) {
hasSeeOption6 = YES;
}
if (displayFunction.functionId == 500603 && hasSeeOption6 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption6 = NO;
}
//"加工单"
if (displayFunction.functionId == 500702 && hasSeeOption7 == NO) {
hasSeeOption7 = YES;
}
if (displayFunction.functionId == 500703 && hasSeeOption7 == YES) {
[muArr removeObject:displayFunction];
hasSeeOption7 = NO;
}
}
return muArr;
......@@ -271,6 +505,7 @@
displayFunction.functionImgName = [rs stringForColumn:@"functionImgName"];
displayFunction.functionSmallImgName = [rs stringForColumn:@"functionSmallImgName"];
displayFunction.isSelected = [rs intForColumn:@"isSelected"];
displayFunction.hasPermission = [rs intForColumn:@"hasPermission"];
displayFunction.functionItemTag = [rs intForColumn:@"functionItemTag"];
return displayFunction;
}
......
......@@ -89,7 +89,7 @@
@(500101),@(500102),@(500103),
@(500201),
@(500301),@(500302),@(500303),//"采购通知",
@(500401),@(500402),@(500403),@(500406),//"采购单"
@(500401),@(500402),@(500403),@(500404),//"采购单"
@(500501),@(500502),@(500503),//"发运单"
@(500601),@(500602),@(500603),//"转运单"
@(500701),@(500702),@(500703),];//加工单
......@@ -97,7 +97,7 @@
@"新建行情调研",@"查看行情调研", @"查看行情调研",
@"填写行情反馈",
@"新建采购通知",@"查看采购通知", @"查看采购通知",
@"新建采购单",@"查看采购单", @"查看采购单", @"审核采购单【供应商】",
@"新建采购单",@"查看采购单", @"查看采购单", @"审核采购单",//【供应商】",
@"新建发运单",@"查看发运单", @"查看发运单",
@"新增加工单",@"查看加工单", @"查看加工单",
@"新建转运单", @"查看转运单", @"查看转运单"];
......
......@@ -253,6 +253,40 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
failure:(void (^)(id))fail;
//1·保存采购通知单
- (void)savePurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//2·获取采购通知单列表
- (void)getPurchaseNoticeListWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//3·采购通知单明细(读)
- (void)getPurchaseNoticeDetailedWithPurchaseUuid:(NSString *)purchaseUuid success:(void (^)(id))succ
failure:(void (^)(id))fail;
//4·保存并提交采购通知单
- (void)saveAndSubmitPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//5·提交采购通知单
- (void)ComitPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//6·接受采购通知单
- (void)acceptPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//7·结束采购通知单
- (void)finishPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//8·获取采购通知单跟进记录
- (void)getPurchaseNoticeRecodWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//添加采购单
- (void)savePurchaseWithData:(id)data
......
......@@ -86,6 +86,16 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
//加工单
XFFHttp_QueryProcess,
XFFHttp_GetProcess,
//采购通知单
XFFHttp_savePurchaseNotice,
XFFHttp_getPurchaseNoticeList,
XFFHttp_getPurchaseNoticeDetailed,
XFFHttp_saveAndSubmitPurchaseNotice,
XFFHttp_ComitPurchaseNotice,
XFFHttp_acceptPurchaseNotice,
XFFHttp_finishPurchaseNotice,
XFFHttp_getPurchaseNoticeRecod,
//采购单
XFFHttp_PurchaseSave,
......@@ -159,6 +169,16 @@ static NSString * const ICRHTTPInterface[] = {
//加工单
[XFFHttp_QueryProcess ] = @"process/query",
[XFFHttp_GetProcess ] = @"process/get",
//采购通知单
[XFFHttp_savePurchaseNotice] = @"purchase/notice/save",
[XFFHttp_getPurchaseNoticeList] = @"purchase/notice/query",
[XFFHttp_getPurchaseNoticeDetailed] = @"purchase/notice/get/",
[XFFHttp_saveAndSubmitPurchaseNotice] = @"purchase/notice/saveandsubmit",
[XFFHttp_ComitPurchaseNotice] = @"purchase/notice/submit/",
[XFFHttp_acceptPurchaseNotice] = @"purchase/notice/accept/",
[XFFHttp_finishPurchaseNotice] = @"purchase/notice/finish/",
[XFFHttp_getPurchaseNoticeRecod] = @"purchase/trace/get/",
//采购单
......@@ -1721,8 +1741,9 @@ acceptTypeJson:YES
fail( error );
}
};
// NSString *dateStr = [[NSDate date] httpParameterString];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:urlAction] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", @"2015-05-06",@(page_number),@(page_size)];
#pragma 请求参数的下载时间应该有要求????
NSString *dateStr = @"2015-05-04";//[[NSDate date] httpParameterString];//urlAction
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:urlAction] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
if (isPost) {
......@@ -1978,5 +1999,80 @@ acceptTypeJson:YES
success:success
failure:failure];
}
//1·保存采购通知单
- (void)savePurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//2·获取采购通知单列表
- (void)getPurchaseNoticeListWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
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 );
}
};
NSDictionary *dict = data;
NSString *urlStr = [[self class] UrlForPluginHTTPAction:XFFHttp_getPurchaseNoticeList];
[self POST:urlStr
parameters:dict
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
//3·采购通知单明细(读)
- (void)getPurchaseNoticeDetailedWithPurchaseUuid:(NSString *)purchaseUuid success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//4·保存并提交采购通知单
- (void)saveAndSubmitPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//5·提交采购通知单
- (void)ComitPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//6·接受采购通知单
- (void)acceptPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//7·结束采购通知单
- (void)finishPurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
//8·获取采购通知单跟进记录
- (void)getPurchaseNoticeRecodWithData:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail
{
}
@end
......@@ -290,6 +290,7 @@
}
- (NSString *)httpParameterString {
NSString *str = [self stringWithFormatter:@"%Y-%m-%d %H:%M:%S"];
return [self stringWithFormatter:@"%Y-%m-%d %H:%M:%S"];
}
- (NSString *)coverStringFromString {
......
......@@ -20,6 +20,7 @@
// Fuctions
- (NSDictionary *)dictForCommit;
- (NSMutableDictionary *)mutableDictDateToStringForCommit;//把属性为日期类型的转化为string
- (NSDictionary *)dictForLocalSave;
- (void)praseFromJsonDict:(NSDictionary *)dict;
- (void)praseFromLocalDict:(NSDictionary *)dict;
......
......@@ -418,6 +418,48 @@
return mDict;
}
- (NSMutableDictionary *)mutableDictDateToStringForCommit {
unsigned int count;
objc_property_t *properties = class_copyPropertyList([self class], &count);
if (count == 0) {
free(properties);
return nil;
}
NSMutableDictionary *mDict = [NSMutableDictionary dictionary];
NSDictionary *dictSpKeyDict = [[self class] specialKeysAndReplaceKeys];
NSArray *arrSpecialKeys = [dictSpKeyDict allKeys];
NSArray *arrCustomKeys = [[self class] customAcitonKeys];
NSArray *arrLocalKeys = [[self class] localKeys];
for (unsigned int i = 0; i < count; i++) {
objc_property_t property = properties[i];
NSString *key = [NSString stringWithUTF8String:property_getName(property)];
id value = [self valueForKey:key];
if ([value isKindOfClass:[NSDate class]]) {
value = [value httpParameterString];
}
if (value) {
if ([arrCustomKeys containsObject:key] ||
[arrLocalKeys containsObject:key]) {
continue;
} else if ([arrSpecialKeys containsObject:key]) {
[mDict addEntriesFromDictionary:@{dictSpKeyDict[key]: value}];
} else {
[mDict addEntriesFromDictionary:@{key: value}];
}
}
}
free(properties);
return mDict;
}
- (NSDictionary *)dictForLocalSave {
unsigned int count;
objc_property_t *properties = class_copyPropertyList([self class], &count);
......
......@@ -8,11 +8,6 @@
#import "BusinessViewController.h"
#import "ICRTaskListViewController.h"
#import "ICRPatrolPlanViewController.h"
#import "ICRStoreListViewController.h"
#import "ICRStoreDetailViewController.h"
#import "ICRAnnouncementViewController.h"
#import "NewSurveyViewController.h"
#import "SurveyViewController.h"
......@@ -30,7 +25,15 @@
#import "PurchaseViewController.h"
#import "NewTransportViewController.h"
@interface BusinessViewController ()<ICRFunctionBaseViewDelegate>
#import"PurchaseNoticeViewController.h"
#import "GXFFunctionDB.h"
#import "GXFNewProcessViewController.h"
#import "GXFSeeProcessViewController.h"
@interface BusinessViewController ()<ICRFunctionBaseViewDelegate,UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, strong) ICRFunctionBaseView *c_functionBaseView;
@property (nonatomic, strong) UITableView *c_tableView;
@end
......@@ -38,79 +41,74 @@
- (void)viewDidLoad {
[super viewDidLoad];
// [self initView];
[self setupSubviews];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)setupSubviews
{
NSMutableArray *arrFunctionEntities = [NSMutableArray array];
NSArray *functionImageNames = @[ @"AnnouncementIcon",@"create_surver",@"watch_surver",@"create_surver_result",@"create_needs",@"watch_needs",@"create_purchase",@"watch_purchase",@"review_purchase",@"create_transport",@"watch_transort",@"create_process"];
NSArray *fuctionNames = @[ [IBTCommon localizableString:@"Announcement"],
[IBTCommon localizableString:@"AddSurvey"],
[IBTCommon localizableString:@"Survey"],
[IBTCommon localizableString:@"Survey1"],
[IBTCommon localizableString:@"Survey2"],
[IBTCommon localizableString:@"Survey3"],
[IBTCommon localizableString:@"AddPurchase"],
[IBTCommon localizableString:@"Purchase"],
[IBTCommon localizableString:@"Survey6"],
[IBTCommon localizableString:@"Survey7"],
[IBTCommon localizableString:@"Survey8"],[IBTCommon localizableString:@"Survey9"],
];
NSArray *functionTags = @[ @(kFunctionNotice),
//公告
@(kFunctionNewSurvey),
//新建行情调研
@(kFunctionSeeSurvey),
//查看行情调研
@(kFunctionFeeBackSurvey),
//填写行情反馈
@(kFunctionNewPurchaseNotice),
//新建采购通知
@(kFunctionSeePurchaseNotice),
//查看采购通知
@(kFunctionNewPurchase),
//新建采购单
@(kFunctionSeePurchase),
//查看采购单
@(kFunctionExaminePurchase),
//审核采购单
@(kFunctionNewShipment),
//新建发运单
@(kFunctionSeeShipment),
//查看发运单
@(kFunctionNewProcessing)];
//新建加工单
int i = 0;
for (NSString *functionName in fuctionNames) {
ICRFunctionEntity *funtionEntity = [[ICRFunctionEntity alloc] init];
funtionEntity.functionName = functionName;
funtionEntity.iconName = [functionImageNames objectAtIndex:i];
funtionEntity.functionItemTag = [[functionTags objectAtIndex:i] integerValue];
[arrFunctionEntities addObject:funtionEntity];
i ++;
}
ICRFunctionBaseView *baseView = [ICRFunctionBaseView initWithFunctionData:arrFunctionEntities];
- (void)setupFunctionBaseView {
NSMutableArray *funtionEntitlesArr = [NSMutableArray array];
baseView.frame = (CGRect){
NSArray *arrFunctions = [NSArray arrayWithArray:[[GXFFunctionDB sharedInstance] displayFunctionsHasPermission]];
for (GXFDisplayFunction *displayFunction in arrFunctions) {
ICRFunctionEntity *functionEntity = [[ICRFunctionEntity alloc]init];
functionEntity.functionName = displayFunction.functionName;
functionEntity.iconName = displayFunction.functionImgName;
functionEntity.functionItemTag = displayFunction.functionItemTag;
[funtionEntitlesArr addObject:functionEntity];
}
self.c_functionBaseView = [ICRFunctionBaseView initWithFunctionData:funtionEntitlesArr];
_c_functionBaseView.frame = (CGRect){
.origin.x = 0,
.origin.y =0,
.size.width = CGRectGetWidth(self.view.frame),
.size.height = CGRectGetHeight(self.view.frame),};
baseView.backgroundColor = [UIColor clearColor];
baseView.m_delegate = self;
[self.view addSubview:baseView];
.size.height = _c_functionBaseView.height};//CGRectGetHeight(self.view.frame),};
_c_functionBaseView.backgroundColor = [UIColor clearColor];
_c_functionBaseView.m_delegate = self;
}
-(void)setupSubviews
{
self.c_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height - 64) style:UITableViewStyleGrouped];
self.c_tableView.delegate = self;
self.c_tableView.dataSource = self;
[self.view addSubview:_c_tableView];
[self setupFunctionBaseView];
}
#pragma UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return _c_functionBaseView.height + 44 ;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellId = @"cellId";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
}
[cell.contentView addSubview:_c_functionBaseView];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
#pragma mark - ICRFunctionBaseViewDelegate
- (void)ICRFunctionBaseView:(ICRFunctionItemControl *)imageView {
/*
......@@ -122,21 +120,22 @@
switch (imageView.tag) {
case kFunctionNotice://公告
{
ICRAnnouncementViewController *aVC = [[ICRAnnouncementViewController alloc] init];
[self PushViewController:aVC animated:YES];
// ICRAnnouncementViewController *aVC = [[ICRAnnouncementViewController alloc] init];
// [self PushViewController:aVC animated:YES];
}
break;
case kFunctionNewSurvey://新建行情
{
NewSurveyViewController *svc = [[NewSurveyViewController alloc] init];
svc.navTitle = [IBTCommon localizableString:@"AddSurvey"];
svc.title = [IBTCommon localizableString:@"AddSurvey"];
[self PushViewController:svc animated:YES];
}
break;
case kFunctionSeeSurvey://查看行情调研
case kFunctionSeeSurvey://查看行情
{
SurveyViewController *svc = [[SurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey"];
svc.navigationItem.hidesBackButton = YES;
[self PushViewController:svc animated:YES];
}
break;
......@@ -149,8 +148,8 @@
break;
case kFunctionSeePurchaseNotice://查看采购通知单
{
SeePurchaseNoticeViewController *svc =
[[SeePurchaseNoticeViewController alloc] init];
PurchaseNoticeViewController *svc =
[[PurchaseNoticeViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey3"];
[self PushViewController:svc animated:YES];
}
......@@ -171,7 +170,6 @@
}
break;
case kFunctionNewShipment://任务管理
{
NewTransportViewController *tVC = [[NewTransportViewController alloc] init];
......@@ -195,35 +193,38 @@
// }
// break;
case kFunctionNewProcessing:{
GXFNewProcessViewController *pvc = [[GXFNewProcessViewController alloc]init];
//pvc.title = @"采购单";
[self PushViewController:pvc animated:YES];
}
break;
case kFunctionSeeProcessing:{
GXFSeeProcessViewController *seeProcessVC= [[GXFSeeProcessViewController alloc]init];
[self PushViewController:seeProcessVC animated:YES];
}
break;
default:
return;
break;
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
-(void)initView
{
NSArray *butArray=[[NSArray alloc]initWithObjects:@"公告", @"新建行情调研",@"查看行情调研",@"填写行情反馈",@"新建采购通知",@"查看采购通知",@"新建采购单",@"查看采购单",@"审核采购单",@"新建发运单",@"查看发运单",@"新建加工单",nil];
for (int i=0; i<butArray.count; i++) {
UIButton *but=[UIButton buttonWithType:UIButtonTypeCustom];
but.frame=CGRectMake(15+i%3*(90+10),10+(i/3)*(100+10) , 90, 90) ;
// but.titleLabel.text=[NSString stringWithFormat:@"%@",[butArray objectAtIndex:i]];
NSString *str=[butArray objectAtIndex:i];
[but setTitle:str forState:UIControlStateNormal];
but.backgroundColor=[UIColor redColor];
[self .view addSubview:but];
}
}
//-(void)initView
//{
// NSArray *butArray=[[NSArray alloc]initWithObjects:@"公告", @"新建行情调研",@"查看行情调研",@"填写行情反馈",@"新建采购通知",@"查看采购通知",@"新建采购单",@"查看采购单",@"审核采购单",@"新建发运单",@"查看发运单",@"新建加工单",nil];
// for (int i=0; i<butArray.count; i++) {
// UIButton *but=[UIButton buttonWithType:UIButtonTypeCustom];
// but.frame=CGRectMake(15+i%3*(90+10),10+(i/3)*(100+10) , 90, 90) ;
// // but.titleLabel.text=[NSString stringWithFormat:@"%@",[butArray objectAtIndex:i]];
// NSString *str=[butArray objectAtIndex:i];
// [but setTitle:str forState:UIControlStateNormal];
// but.backgroundColor=[UIColor redColor];
// [self .view addSubview:but];
//
// }
//
//}
@end
......@@ -54,7 +54,7 @@ static NSString *cellID = @"cell";
self.navigationItem.rightBarButtonItem = rightBarBtn;
}
- (void)setupTableView {
self.f_tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height - 64) style:UITableViewStyleGrouped];
self.f_tableView.dataSource = self;
self.f_tableView.delegate = self;
//[self.f_tableView dequeueReusableCellWithIdentifier ]
......
......@@ -58,7 +58,7 @@
@end
@implementation ICRHomeViewController
static NSString *cellID = @"cell";
static NSString *firestCellID = @"firestCell";
static NSString *secondCellID = @"secondCell";
static NSString *collectionCellID = @"collectionCell";
//static CGFloat colletionCellHeight [UIScreen mainScreen].bounds.size.width / 3.0
......@@ -187,24 +187,30 @@ static NSString *collectionCellID = @"collectionCell";
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
UITableViewCell *cell; //= [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
if (indexPath.section == 0) {
cell = [[GXFNoticeFunctionTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
cell = [tableView dequeueReusableCellWithIdentifier:firestCellID];
if (!cell) {
cell = [[GXFNoticeFunctionTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:firestCellID];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.text = @"查看行情反馈-进行中";
} else {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"secondCell"];
[cell.contentView addSubview:_f_functionBaseView];
NSLog(@"%@",NSStringFromCGRect(cell.frame));
}
} else {
cell = [tableView dequeueReusableCellWithIdentifier:secondCellID];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:secondCellID];
} else {
while ([cell.contentView.subviews lastObject] != nil) {
[(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
[(UIView *)[cell.contentView.subviews lastObject]removeFromSuperview];
}
}
[cell.contentView addSubview:_f_functionBaseView];
NSLog(@"%@",NSStringFromCGRect(cell.frame));
}
return cell;
}
......
......@@ -15,6 +15,7 @@
@property (nonatomic, copy) NSString *functionImgName; //
@property (nonatomic, copy) NSString *functionSmallImgName;
@property (nonatomic, assign) BOOL isSelected; //选中
@property (nonatomic, assign) BOOL hasPermission;
@property (nonatomic, assign) NSInteger functionItemTag;
+ (instancetype)initClassWithDictionary: (NSDictionary *)dict;
......
......@@ -163,12 +163,14 @@
}
}
if (![[GXFFunctionDB sharedInstance]defaultdisplayFunctions]) {
//配置功能 不是默认配置
NSUserDefaults *f_default = [NSUserDefaults standardUserDefaults];
BOOL noDefault = [[f_default objectForKey:@"noDefault"] integerValue] > 0 ? YES : NO;
if (!noDefault) {
[[GXFFunctionDB sharedInstance]defaultdisplayFunctions];
}
};
void(^fail)(id) = ^(id data) {
......
......@@ -58,8 +58,8 @@ typedef NS_ENUM(NSInteger, cellRow) {
@property (nonatomic, assign) BOOL d_isProduct;
@property (nonatomic, strong) NSArray *d_meteilHeaderArr;
@property (nonatomic, strong) NSArray *d_productHeaderArr;
@property (nonatomic, strong) NSMutableArray *d_meteilArr;
@property (nonatomic, strong) NSMutableArray *d_productArr;
//@property (nonatomic, strong) NSMutableArray *d_meteilArr;
//@property (nonatomic, strong) NSMutableArray *d_productArr;
@property (nonatomic, assign) NSInteger d_editOrDelete;
......@@ -86,29 +86,29 @@ typedef NS_ENUM(NSInteger, cellRow) {
}
- (void)addNewMaterail: (NSNotification *)aNotification {
GXFProcessMaterial *material = aNotification.object;
if (_d_meteilArr) {
[_d_meteilArr addObject:material];
if (_d_materialMuArr) {
[_d_materialMuArr addObject:material];
[self p_refreshData];
}
}
- (void)addNewProduct: (NSNotification *)aNotification {
GXFProcessProduct *product = aNotification.object;
if (_d_productArr) {
[_d_productArr addObject:product];
if (_d_productMuArr) {
[_d_productMuArr addObject:product];
[self p_refreshData];
}
}
- (void)editProduct: (NSNotification *)aNotification {
GXFProcessProduct *product = aNotification.object;
if (_d_productArr) {
[_d_productArr replaceObjectAtIndex:_d_editOrDelete withObject:product];//待做:优化为刷新这一条
if (_d_productMuArr) {
[_d_productMuArr replaceObjectAtIndex:_d_editOrDelete withObject:product];//待做:优化为刷新这一条
[self p_refreshData];
}
}
- (void)deleteProduct: (NSNotification *)aNotification {
GXFProcessProduct *product = aNotification.object;
if (_d_productArr) {
[_d_productArr removeObject:product];////待做:优化为刷新这一条
if (_d_productMuArr) {
[_d_productMuArr removeObject:product];////待做:优化为刷新这一条
[self p_refreshData];
}
}
......@@ -184,31 +184,31 @@ typedef NS_ENUM(NSInteger, cellRow) {
_selectRowArr = [[NSMutableArray alloc]init];
self.d_processBill = [[GXFProcessBill alloc]init];
if (!self.d_meteilArr) {
self.d_meteilArr = [NSMutableArray array];
if (!self.d_materialMuArr) {
self.d_materialMuArr = [NSMutableArray array];
}
GXFProcessMaterial *processM = [[GXFProcessMaterial alloc]init];
processM.uuid = @"00";
processM.productName = @"Material";
processM.productUuid = @"01";
processM.baseQty = @(10);
processM.instockDate = [NSDate date];
[self.d_meteilArr addObject:processM];
[self.d_meteilArr addObject:processM];
// GXFProcessMaterial *processM = [[GXFProcessMaterial alloc]init];
// processM.uuid = @"00";
// processM.productName = @"Material";
// processM.productUuid = @"01";
// processM.baseQty = @(10);
// processM.instockDate = [NSDate date];
// [self.d_materialMuArr addObject:processM];
// [self.d_materialMuArr addObject:processM];
if (!self.d_productArr) {
self.d_productArr = [NSMutableArray array];
if (!self.d_productMuArr) {
self.d_productMuArr = [NSMutableArray array];
}
GXFProcessProduct *processP = [[GXFProcessProduct alloc]init];
processP.uuid = @"11";
processP.productName = @"product";
processP.productUuid = @"12";
processP.baseQty = @(10);
processP.outstockDate = [NSDate date];
[self.d_productArr addObject:processP];
// GXFProcessProduct *processP = [[GXFProcessProduct alloc]init];
// processP.uuid = @"11";
// processP.productName = @"product";
// processP.productUuid = @"12";
// processP.baseQty = @(10);
// processP.outstockDate = [NSDate date];
// [self.d_productMuArr addObject:processP];
NSDictionary *dict = [processP dictForCommit];
}
- (void)initSubViews {
self.view.backgroundColor = XXFBgColor;
......@@ -231,9 +231,9 @@ typedef NS_ENUM(NSInteger, cellRow) {
return _d_arrLeftTableV.count;
} else {
if (_d_isProduct) {
return 2 + _d_productArr.count;
return 2 + _d_productMuArr.count;
}
return 2 + _d_meteilArr.count;
return 2 + _d_materialMuArr.count;
}
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
......@@ -394,10 +394,10 @@ typedef NS_ENUM(NSInteger, cellRow) {
if (cell == nil) {
if (_d_isProduct) {
GXFProcessProduct *processP = (GXFProcessProduct *)_d_productArr[indexPath.row - 2];
GXFProcessProduct *processP = (GXFProcessProduct *)_d_productMuArr[indexPath.row - 2];
cell = [[GXFProcessProductTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID processProduct:processP];
} else {
GXFProcessMaterial *pm = (GXFProcessMaterial *)_d_meteilArr[indexPath.row - 2];
GXFProcessMaterial *pm = (GXFProcessMaterial *)_d_materialMuArr[indexPath.row - 2];
cell = [[GXFProcessMaterialTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID processMaterial:pm];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
......@@ -527,7 +527,7 @@ typedef NS_ENUM(NSInteger, cellRow) {
- (void)editClick: (UIButton *)btn{
if (_d_isProduct) {
self.d_editOrDelete = btn.tag - 2;
GXFProcessProduct *product = _d_productArr[btn.tag - 2];
GXFProcessProduct *product = _d_productMuArr[btn.tag - 2];
GXFPopNewProductViewController *productVC = [[GXFPopNewProductViewController alloc]initWithProcessProduct:product isEdit: YES];
[self PushViewController:productVC animated:NO];
} else {
......@@ -558,18 +558,22 @@ typedef NS_ENUM(NSInteger, cellRow) {
#pragma GXFBottomViewDelegate
- (void)bottomViewleftButtonClicked:(UIButton *)leftBtn {
}
- (void)bottomViewRightButtonClicked:(UIButton *)rightBtn {
CLog(@"ffff");
//[IBTCommon checkString:_d_processBill.title]
if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.title]) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"标题不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
return;
}
if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.vendor_name]) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"请选择供应商" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
return;
}
// if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.title]) {
// UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"标题不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
// [alert show];
// return;
// }
// if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.vendor_name]) {
// UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"请选择供应商" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
// [alert show];
// return;
// }
if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.warehouse_name]) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"请选择加工工厂" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
......@@ -614,18 +618,22 @@ typedef NS_ENUM(NSInteger, cellRow) {
// version = self.survey.version;
// }
// NSDictionary *material = @{@"uuid":@"",@"productUuid":@"",@"productCode":@"",@"productName":@"",@"instockDate":@"",@"place":@"",@"quality":@"",@"baseQty":@"",@"basePrice":@"",@"total":@"",@"remark":@"",};
// NSDictionary *product = @{@"uuid":@"",@"productUuid":@"",@"productCode":@"",@"productName":@"",@"instockDate":@"",@"place":@"",@"quality":@"",@"baseQty":@"",@"basePrice":@"",@"total":@"",@"remark":@"",};
NSMutableArray *productMuArr = [NSMutableArray array];
for (int count = 0; count < _d_productArr.count; count ++) {
GXFProcessProduct *product = (GXFProcessProduct *)_d_productArr[count];
[productMuArr addObject:[product dictForCommit]];
for (int count = 0; count < _d_productMuArr.count; count ++) {
GXFProcessProduct *product = (GXFProcessProduct *)_d_productMuArr[count];
NSMutableDictionary *dic = [product mutableDictDateToStringForCommit];
// NSDictionary *materialdict = @{@"uuid":@"11",@"productUuid":@"402880e64e287fe2014e28895b8a0032",@"productCode":@"农夫山泉",@"productName":@"dd",@"outstockDate":@"2015-09-05 13:36:16 +0000",@"unit":@"",@"qpc":@"kk",@"qpcStr":@"ll",@"quality":@"9",@"baseQty":@"8",@"remark":@""};
[productMuArr addObject:dic];//productdict];
}
NSMutableArray *materialMuArr = [NSMutableArray array];
for (int count = 0; count < _d_productArr.count; count ++) {
for (int count = 0; count < _d_materialMuArr.count; count ++) {
GXFProcessMaterial *material = (GXFProcessMaterial *)_d_materialMuArr[count];
[materialMuArr addObject:[material dictForCommit]];
NSMutableDictionary *dic = [material mutableDictDateToStringForCommit];
// NSDictionary *productdict = @{@"uuid":@"",@"productUuid":@"402880e64e287fe2014e28895b8a0032",@"productCode":@"农夫山泉",@"productName":@"dd",@"outstockDate":@"2015-09-05 13:36:16 +0000",@"place":@"",@"quality":@"",@"baseQty":@"1",@"basePrice":@"2",@"total":@"2",@"remark":@""};
[materialMuArr addObject:dic];//materialdict];
}
......@@ -633,14 +641,14 @@ typedef NS_ENUM(NSInteger, cellRow) {
@"version":@(0),
@"billnumber":@"",
@"title":@"title",//[IBTCommon checkString:self.titleStr],
@"vendor_uuid":_d_processBill.vendor_uuid,
@"vendor_code":_d_processBill.vendor_code,
@"vendor_name":_d_processBill.vendor_name,
@"vendor_uuid": @"000",//_d_processBill.vendor_uuid,
@"vendor_code": @"111",//_d_processBill.vendor_code,
@"vendor_name": @"ff",//_d_processBill.vendor_name,
@"warehouse_uuid":_d_processBill.warehouse_uuid,
@"warehouse_code":_d_processBill.warehouse_code,
@"warehouse_name":_d_processBill.warehouse_name,
@"contact":[IBTCommon checkString: _d_processBill.contact],
@"contactPhone":[IBTCommon checkString:_d_processBill.contact],
@"contactPhone":[IBTCommon checkString:_d_processBill.contactPhone],
@"total":_d_processBill.total,
@"remark":[IBTCommon checkString:_d_processBill.remark],
@"materials":materialMuArr,
......@@ -648,9 +656,6 @@ typedef NS_ENUM(NSInteger, cellRow) {
//[IBTLoadingView showProgressLabel:msg];
[[ICRHTTPController sharedController] saveSurveyWithAuthenticode:dict success:succ failure:fail];
}
- (void)bottomViewRightButtonClicked:(UIButton *)rightBtn {
}
/*
......
......@@ -34,7 +34,7 @@
[IBTLoadingView showProgressLabel:@"正在加载..."];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSDictionary *queryOrderDict = @{@"direction":@"desc",@"field":@"billNumber"};
NSDictionary *queryOrderDict = @{@"direction":@"",@"field":@"billNumber"};
NSDictionary *dict = @{
@"billNumberLike":@"",
@"state":@"",
......
......@@ -16,11 +16,10 @@
#import "Survey.h"
#import "PurchaseNoticeCell.h"
#import "ShopDetaileViewController.h"
#define LeftMargin 15
#define LeftWidth 40
#define RightWidth 30
#define SpaceMargin 1
#define BtnHeight 44
#define TableHeight 46
#define CornerRadius 5
......@@ -30,6 +29,13 @@
#define KeyboardHeight 258
#define DateViewHeight 300
#define FootOfsetHeight 140
#define BottomViewHeight 60
typedef enum : NSUInteger {
SaveTag = 8000,
CommitTag,
} BtnTag;
@interface NewPurchaseNoticeViewController()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,HPGrowingTextViewDelegate>
{
UITableView *_tableView;
......@@ -41,11 +47,8 @@
UILabel *_personLabel;
HPGrowingTextView *_noteTextView;
NSIndexPath *selectedCellIndexPath;
NSMutableArray *selectCellAry;
BOOL _isClickStart;
UITableView *mingXiTableView;
......@@ -76,17 +79,18 @@
}
-(void)setupSubviews
{
selectCellAry=[[NSMutableArray alloc]initWithCapacity:1000];
_dataArr=[[NSMutableArray alloc]initWithObjects:@"标题:",@"采购员:",@"备注:", nil];
self.view.backgroundColor = XXFBgColor;
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, LeftMargin,ScreenSize.width, ScreenSize.height/2 - FootOfsetHeight - LeftMargin)) style:(UITableViewStylePlain)];
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, LeftMargin,ScreenSize.width, ScreenSize.height/3-LeftMargin)) style:(UITableViewStylePlain)];
_tableView.backgroundColor = [UIColor whiteColor];
_tableView.tag=1001;
_tableView.bounces = NO;
_tableView.delegate = self;
_tableView.dataSource = self;
mingXiTableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 2*LeftMargin+_tableView.frame.size.height, ScreenSize.width, ScreenSize.height-_tableView.height-TableHeight-LeftMargin)];
mingXiTableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 2*LeftMargin+_tableView.frame.size.height, ScreenSize.width, ScreenSize.height-_tableView.height-ScreenSize.height/5)];
mingXiTableView.backgroundColor = [UIColor whiteColor];
mingXiTableView.tag=1002;
mingXiTableView.bounces=NO;
......@@ -95,15 +99,34 @@
UIView *footView2=[[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, TableHeight)];
footView2.backgroundColor=[UIColor clearColor];
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, TableHeight)];
lable.text=@" 商品 价格 包装规格 包装数量";
NSArray *ary=[NSArray arrayWithObjects:@"商品",@"价格",@"包装规格",@"包装数量", nil];
CGFloat gipWidth = (ScreenSize.width-(((RightWidth+70)+(LeftWidth+35))+(35+70)))/3;
for (int i=0; i< ary.count;i++ ) {
UILabel *lable=[[UILabel alloc]init];
if (i==0) {
lable.frame=CGRectMake(LeftWidth, 0, 35,TableHeight);
}
if (i==1) {
lable.frame=CGRectMake(LeftWidth+35+gipWidth, 0, 35,TableHeight);
}
if (i==2) {
lable.frame=CGRectMake(LeftWidth+35+gipWidth+35+gipWidth, 0, 70,TableHeight);
}
if (i==3) {
lable.frame=CGRectMake(ScreenSize.width-RightWidth-70, 0, 70,TableHeight);
}
// UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(LeftWidth + (SpaceMargin + headWidth)*i,0, headWidth, 50)];
lable.text=[ary objectAtIndex:i];
lable.textColor=HexColor(@"444444");
[footView2 addSubview:lable];
}
UIView *footView3 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, TableHeight)];
footView3.backgroundColor=[UIColor clearColor];
self.addDetailedButton=[UIButton buttonWithType: UIButtonTypeCustom];
[self.addDetailedButton setFrame:CGRectMake(90, 0, 200, TableHeight)];
[self.addDetailedButton setFrame:CGRectMake(0, 0, ScreenSize.width, TableHeight)];
[self.addDetailedButton setTitle:@"+ 点击添加商品明细" forState:UIControlStateNormal];
[self.addDetailedButton addTarget:self action:@selector(addShopeDetailed) forControlEvents:UIControlEventTouchUpInside];
[self.addDetailedButton setTitleColor:HexColor(@"444444") forState:UIControlStateNormal];
......@@ -115,6 +138,15 @@
self.HeardLabel.font = FontSize(TitleSize);
//HexColor(@"e5e5e5")
UIView *footView4 = [[UIView alloc]initWithFrame:CGRectMake(0, ScreenSize.height - BottomViewHeight - 64, ScreenSize.width, BottomViewHeight)];
UIButton *saveBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(15, 8, (ScreenSize.width - 15*3)/2, 44) target:self sel:@selector(btnClick:) tag:SaveTag image:nil title:@"保存" titleColor: [UIColor whiteColor] isCorner:YES corner:5 bgColor:HexColor(@"50bd62")];
[footView4 addSubview:saveBtn];
UIButton *commitBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(CGRectGetMaxX(saveBtn.frame) + 15, 8, (ScreenSize.width - 15*3)/2, 44) target:self sel:@selector(btnClick:) tag:CommitTag image:nil title:@"提交" titleColor: [UIColor whiteColor] isCorner:YES corner:5 bgColor:HexColor(@"f69100")];
[footView4 addSubview:commitBtn];
[self.view addSubview:footView4];
[footView3 addSubview:self.addDetailedButton];
[footView3 addSubview:self.HeardLabel];
[footView3 addSubview:self.FootLabel];
......@@ -125,6 +157,7 @@
mingXiTableView.tableHeaderView=footView2;
[self.view addSubview:_tableView];
[self.view addSubview:mingXiTableView];
[self.view addSubview:footView4];
}
......@@ -177,17 +210,18 @@
// Cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;向左箭头
}
if(selectedCellIndexPath != nil&[selectedCellIndexPath compare:indexPath] == NSOrderedSame){
if (Cell.isSelected==YES) {
Cell.arrowView.image = [UIImage imageNamed:@"arrowdown"];
Cell.backgroundColor=XXFBgColor;
Cell.subSview.hidden=NO;
}else
{
Cell.subSview.hidden=YES;
Cell.arrowView.image = [UIImage imageNamed:@"arrowright"];
Cell.backgroundColor=[UIColor whiteColor];
Cell.subSview.hidden=YES;
}
[Cell.button addTarget:self action:@selector(didtoucher) forControlEvents:UIControlEventTouchUpInside];
// [cell setTitleStr:_dataArr[indexPath.row]];
return Cell;
}
......@@ -204,15 +238,14 @@
}else if ([tableView isEqual:mingXiTableView])
{
if(selectedCellIndexPath != nil&[selectedCellIndexPath compare:indexPath] == NSOrderedSame){
if ([self comperIndexpath:indexPath]) {
return TableHeight*3;
}else
{
return TableHeight;
}
return TableHeight;
}
return TableHeight;
}
......@@ -252,11 +285,16 @@
}else if ([tableView isEqual:mingXiTableView])
{
PurchaseNoticeCell *Cell=(PurchaseNoticeCell*)[mingXiTableView cellForRowAtIndexPath:indexPath ];
if (Cell.isSelected==NO) {
Cell.isSelected=YES;
[selectCellAry addObject:indexPath];
}else{
Cell.isSelected=NO;
[selectCellAry removeObject:indexPath];
}
selectedCellIndexPath = indexPath;
// [Cell setTitleStr:@"selected"];
// [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
[mingXiTableView reloadData];
}
......@@ -273,11 +311,7 @@
_titleField.returnKeyType = UIReturnKeyDone;
_titleField.delegate = self;
[cell.contentView addSubview:_titleField];
// if (self.survey) {
// _titleField.text = [IBTCommon checkString:self.survey.title];
// self.titleStr = [IBTCommon checkString:self.survey.title];
// }
// }else
}else if (indexPath.row == _dataArr.count -1){
_noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
_noteTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
......@@ -289,10 +323,6 @@
_noteTextView.returnKeyType = UIReturnKeyDone;
_noteTextView.placeholder = @"输入备注内容";
[cell.contentView addSubview:_noteTextView];
// if (self.survey) {
// _noteTextView.text = [IBTCommon checkString:self.survey.remark];
// self.remarkStr = [IBTCommon checkString:self.survey.remark];
// }
CGRect lineFrame = cell.lineLabel.frame;
lineFrame.origin.y = TableHeight*2-1;
cell.lineLabel.frame = lineFrame;
......@@ -309,7 +339,15 @@
}
}
}
-(BOOL)comperIndexpath:(NSIndexPath *)indexPath
{
for (NSIndexPath *path in selectCellAry) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
- (void)preferDataInPersonLabel{
if (self.survey) {
if (self.survey.users.count > 0) {
......@@ -336,7 +374,7 @@
ShopDetaileViewController *svc = [[ShopDetaileViewController alloc] init];
svc.title = [IBTCommon localizableString:@"AddShopDetail"];
[self PushViewController:svc animated:YES];
NSLog(@"1111111111");
}
//编辑
- (void)didtoucher
......@@ -373,6 +411,26 @@
[_noteTextView resignFirstResponder];
[self setTableFrame:LeftMargin];
}
- (void)btnClick:(UIButton *)btn{
switch (btn.tag) {
case SaveTag:
{
// if ([self checkSurvey]) {
// [self saveSurvey:@"initial" message:@"正在保存..."];
// }
}
break;
case CommitTag:
{
// if ([self checkSurvey]) {
// [self saveSurvey:@"submitted" message:@"正在提交..."];
// }
}
break;
default:
break;
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
......
//
// PurchaseNoticeViewController.h
// XFFruit
//
// Created by mac on 15/9/5.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface PurchaseNoticeViewController : ICRBaseViewController
@end
//
// PurchaseNoticeViewController.m
// XFFruit
//
// Created by mac on 15/9/5.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "PurchaseNoticeViewController.h"
#import "PurchaseCell.h"
#import "PurchaseBill.h"
#import "SeePurchaseNoticeViewController.h"
#import "QueryOrder.h"
#import "SortMaskView.h"
#import "PurchaseBoltView.h"
#import "MJRefresh.h"
#define TopMargin 44
#define TableHeight 120
#define LeftMargin 20
#define BtnWidth 60
#define BtnHeight 24
#define BtnSize 16
typedef enum : NSUInteger {
SortTag = 3000,
BoltTag
} BtnTag;
@interface PurchaseNoticeViewController ()<UITableViewDataSource,UITableViewDelegate,PurchaseViewDelegate,SortMaskViewDelegate>
{
UIView *_maskView;
UIButton *currentBtn;
SortMaskView *_sortView;
PurchaseBoltView *_boltView;
UIBarButtonItem *_sureBtn;
UIButton *_sortBtn;
UIButton *_boltBtn;
BOOL _isRefresh;
BOOL _isLoadMore;
NSInteger _currentPage;
}
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSString *noticeLike;
@property (nonatomic,strong)NSString *state;
@property (nonatomic,strong)NSString *billLike;
@property (nonatomic,strong)NSString *orderDirection;//asc(升序),desc(降序)
@end
@implementation PurchaseNoticeViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self initData];
[self createTableView];
[self createRefresh];
[self getData];
// Do any additional setup after loading the view.
}
- (void)initData{
self.view.backgroundColor = XXFBgColor;
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{
[ICRUserUtil sharedInstance].needFresh = NO;
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchtPuchaseList:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSMutableArray *orderArr =[NSMutableArray array];
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
QueryOrder *order = [QueryOrder new];
order.field = @"lastModified";
order.direction = self.orderDirection;
[orderArr addObject:[order dictForCommit]];
}
id billObject = [NSNull null];
if (self.billLike.length > 0) {
billObject = self.billLike;
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
QueryOrder *order = [QueryOrder new];
order.field = @"billNumber";
order.direction = self.orderDirection;
[orderArr addObject:[order dictForCommit]];
}
}
id stateObject = [NSNull null];
if (self.state.length > 0 && ![self.state isEqualToString:@"none"]) {
stateObject = self.state;
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
QueryOrder *order = [QueryOrder new];
order.field = @"state";
order.direction = self.orderDirection;
[orderArr addObject:[order dictForCommit]];
}
}
id noticeObject = [NSNull null];
if (self.noticeLike.length > 0) {
noticeObject = self.noticeLike;
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
QueryOrder *order = [QueryOrder new];
order.field = @"noticeNumber";
order.direction = self.orderDirection;
[orderArr addObject:[order dictForCommit]];
}
}
if (orderArr.count == 0) {
QueryOrder *order = [QueryOrder new];
order.field = @"billNumber";
order.direction = @"desc";
[orderArr addObject:[order dictForCommit]];
}
// 网络请求
NSDictionary *dict = @{
@"billNumberLike":billObject,
@"state":stateObject,
@"noticeNumberLike":noticeObject,
@"titleLike":[NSNull null],
@"vendorUuid":[NSNull null],
@"queryOrders":orderArr,
@"userUuid":userUtil.userId,
@"pageNumber":@(_currentPage),
@"pageSize":@(20)};
[[ICRHTTPController sharedController] queryPurchaseWithData: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{
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"] ;
if (success == 1) {
if (_currentPage == 0) {
// if (self.dataArr.count > 0) {
// [self.dataArr removeAllObjects];
// }
}
NSArray *recodesArr = data[ @"data" ][ @"records" ];
for (NSDictionary *purchaseBillDict in recodesArr) {
PurchaseBill *purchaseBill = [[PurchaseBill alloc]init];
[purchaseBill setValuesForKeysWithDictionary:purchaseBillDict];
[self.dataArr addObject:purchaseBill];
}
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
[self.tableView reloadData];
[self endRefreshing];
if (pageCount <= _currentPage) {
[self.tableView.footer noticeNoMoreData];
}
if (_currentPage == 0 && self.dataArr.count > 0) {
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
}
}else{
[IBTLoadingView showTips:message];
}
}else{
[IBTLoadingView showTips:@" 无记录 "];
}
}
- (void)createRefresh{
self.tableView.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
if (_isRefresh) {
return ;
}
_isRefresh = YES;
_currentPage = 0;
[self getData];
}];
self.tableView.header.lastUpdatedTimeKey = PurchaseUpdateDate;
self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if (_isLoadMore) {
return ;
}
_isLoadMore = YES;
_currentPage ++;
[self getData];
} ];
}
#pragma mark - 结束刷新
- (void)endRefreshing{
_isLoadMore = NO;
_isRefresh = NO;
[self.tableView.header endRefreshing];
[self.tableView.footer endRefreshing];
}
- (void)createTableView
{
_sureBtn = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClick)];
self.navigationItem.rightBarButtonItem = _sureBtn;
_sortBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, 10, BtnWidth, BtnHeight) target:self sel:@selector(sortClick:) tag:SortTag image:@"black_arrow_down_with_text" title:nil titleColor:GXF_DETAIL_COLOR isCorner:NO corner:0 bgColor:nil];
_sortBtn.titleLabel.font = FontSize(BtnSize);
[self.view addSubview:_sortBtn];
_boltBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(ScreenSize.width-BtnWidth - LeftMargin,10,BtnWidth, BtnHeight) target:self sel:@selector(sortClick:) tag:BoltTag image:@"black_filter_with_text" title:nil titleColor:GXF_DETAIL_COLOR isCorner:NO corner:0 bgColor:nil];
_boltBtn.titleLabel.font = FontSize(BtnSize);
[self.view addSubview:_boltBtn];
self.tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, TopMargin,ScreenSize.width, ScreenSize.height - 64 - TopMargin)) style:(UITableViewStylePlain)];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.view addSubview:self.tableView];
_maskView = [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, ScreenSize.height - 64- TopMargin)];
_maskView.backgroundColor = RGBA(0, 0, 0, 0.5);
_maskView.hidden = YES;
[self.view addSubview:_maskView];
}
#pragma mark -按钮事件
- (void)sortClick:(UIButton *)btn{
_maskView.backgroundColor = RGBA(0, 0, 0, 0.5);
_maskView.hidden = NO;
if (btn.tag == SortTag) {
if(_boltView){
[self hiddenBoltMaskView:NO];
}
if (currentBtn == btn) {
[btn setImage:[UIImage imageNamed:@"black_arrow_down_with_text"] forState:UIControlStateNormal];
[self hiddenSortMaskView:YES];
currentBtn = nil;
}else{
[btn setImage:[UIImage imageNamed:@"select_arrow_up_text"] forState:UIControlStateNormal];
if (_sortView == nil) {
_sortView = [[SortMaskView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 150) withOrderDirection:self.orderDirection];
_sortView.dataArr = [[NSMutableArray alloc]initWithObjects:@"按时间顺序",@"按时间逆序",@"默认排序",nil];
_sortView.delegate = self;
[_maskView addSubview:_sortView];
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _sortView.frame;
sortFrame.origin.y = 0;
_sortView.frame = sortFrame;
}];
}
currentBtn = btn;
}
}else if(btn.tag == BoltTag){
if (_sortView) {
[self hiddenSortMaskView:NO];
}
if (currentBtn == btn) {
[btn setImage:[UIImage imageNamed:@"black_filter_with_text"] forState:UIControlStateNormal];
[self hiddenBoltMaskView:YES];
currentBtn = nil;
}else{
[btn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal];
if (_boltView == nil) {
_boltView = [[PurchaseBoltView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 274) state:self.state billNumber:self.billLike noticeNumber:self.noticeLike];
_boltView.backgroundColor = XXFBgColor;
_boltView.delegate = self;
//initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成)
_boltView.dataArr = [[NSMutableArray alloc]initWithObjects:@"未提交",@"已提交",@"已拒绝" ,@"已审批",@"发运中",@"已完成",nil];
[_maskView addSubview:_boltView];
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _boltView.frame;
sortFrame.origin.y = 0;
_boltView.frame = sortFrame;
}];
currentBtn = btn;
}
}
}
}
- (void)hiddenSortMaskView:(BOOL)isHide{
currentBtn = nil;
[self checkSortBtnColor];
if (isHide == NO) {
[_sortView removeFromSuperview];
_sortView = nil;
}else{
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _sortView.frame;
sortFrame.origin.y = -105;
_sortView.frame = sortFrame;
_maskView.backgroundColor = RGBA(0, 0, 0, 0);
}completion:^(BOOL finished) {
[_sortView removeFromSuperview];
_sortView = nil;
_maskView.hidden = YES;
}];
}
}
- (void)hiddenBoltMaskView:(BOOL)isHide{
currentBtn = nil;
[self checkBoltBtnColor];
if (isHide == NO) {
[_boltView removeFromSuperview];
_boltView = nil;
}else{
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _boltView.frame;
sortFrame.origin.y = -105;
_boltView.frame = sortFrame;
_maskView.backgroundColor = RGBA(0, 0, 0, 0);
}completion:^(BOOL finished) {
[_boltView removeFromSuperview];
_boltView = nil;
_maskView.hidden = YES;
}];
}
}
//检测排序的颜色
- (void)checkSortBtnColor{
if (self.orderDirection.length > 0) {
[_sortBtn setImage:[UIImage imageNamed:@"select_arrow_up_text"] forState:UIControlStateNormal];
}else{
[_sortBtn setImage:[UIImage imageNamed:@"black_arrow_down_with_text"] forState:UIControlStateNormal];
}
}
- (void)checkBoltBtnColor{
if (self.state.length > 0 || self.noticeLike.length > 0 || self.billLike.length > 0) {
[_boltBtn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal];
}else{
[_boltBtn setImage:[UIImage imageNamed:@"black_filter_with_text"] forState:UIControlStateNormal];
}
}
#pragma mark - 确定
- (void)sureClick{
if (self.state.length > 0 || self.billLike.length > 0 || self.noticeLike.length > 0 ||self.orderDirection.length > 0) {
[_boltView.noticeFiled resignFirstResponder];
[_boltView.billFiled resignFirstResponder];
_currentPage = 0;
//请求
[self getData];
//还原数据
if (_sortView) {
[self hiddenSortMaskView:YES];
}
if (_boltView) {
[self hiddenBoltMaskView:YES];
}
}
}
#pragma mark - sortDelegate
- (void)getSortValueSelectRow:(NSString *)state{
if (state.length > 0) {
self.orderDirection = state;
CLog(@"%@",state);
}
}
#pragma mark - boltDelegate
- (void)getBoltValueSelectRow:(NSString *)state{
self.state = state;
CLog(@"%@",state);
}
- (void)getbillLike:(NSString *)billLike{
self.billLike = billLike;
CLog(@"%@",billLike);
}
- (void)getnoticeLike:(NSString *)noticeLike{
self.noticeLike = noticeLike;
CLog(@"%@",noticeLike);
}
- (void)clearBoltInformation{
//清空所有条件
if (self.billLike.length > 0) {
self.billLike = @"";
}
if (self.noticeLike.length > 0) {
self.noticeLike = @"";
}
if (self.state.length > 0) {
self.state = @"";
}
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"SurveyID";
PurchaseCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[PurchaseCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
if (self.dataArr.count > 0) {
PurchaseBill *bill = self.dataArr[indexPath.row];
[cell setPurchaseBill:bill];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
SeePurchaseNoticeViewController *pvc = [SeePurchaseNoticeViewController new];
pvc.title = @"查看采购单";
pvc.bill = _dataArr[indexPath.row];
if(indexPath.row == 0){
pvc.indexPerson = 0;
}else if(indexPath.row == 1){
pvc.indexPerson = 1;
}else if(indexPath.row == 2){
pvc.indexPerson = 2;
}
[self PushViewController:pvc animated:YES];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return TableHeight;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -7,7 +7,10 @@
//
#import "ICRBaseViewController.h"
#import "PurchaseBill.h"
@interface SeePurchaseNoticeViewController : ICRBaseViewController
@property (nonatomic,strong)PurchaseBill *bill;
//模拟三个人员
@property (nonatomic,assign)NSInteger indexPerson;//0.1.2
@end
//
// SeePurchaseNoticeViewController.m
// XFFruit
//
// Created by mac on 15/8/16.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "SeePurchaseNoticeViewController.h"
#import "ProductBillViewController.h"
#import "PurchaseBillProduct.h"
#define BottomHeight 50
#define LeftMargin 15
#define LeftWidth 100
#define LeftHeight 30
#define TopMargin 15
typedef enum : NSUInteger {
CancleTag = 3500,
EndTag,
RejectTag,
PassTag,
SureTag
} BtnTag;
@interface SeePurchaseNoticeViewController ()
{
UIScrollView *_scrollView;
UIView *_purchaseView;
UIView *_bottomView;
ProductBillViewController *_pvc;
NSArray *_leftArr;
UIButton *_endBtn;
UIButton *_rejectBtn;
}
@property (nonatomic,strong)UILabel *billNumberLabel;
@property (nonatomic,strong)UILabel *noticeNumberLabel;
@property (nonatomic,strong)UILabel *createOperNameLabel;
@property (nonatomic,strong)UILabel *checkNameLabel;
@property (nonatomic,strong)UILabel *stateLabel;
@property (nonatomic,strong)UILabel *lastModifyNameLabel;
@property (nonatomic,strong)UILabel *typeLabel;
@property (nonatomic,strong)UILabel *vendorNameLabel;
@property (nonatomic,strong)UILabel *vendorIsSureLabel;
@property (nonatomic,strong)UILabel *warehouseLabel;
@property (nonatomic,strong)UILabel *otherPriceLabel;
@property (nonatomic,strong)UILabel *totalPriceLabel;
@property (nonatomic,strong)UILabel *noteLabel;
@end
@implementation SeePurchaseNoticeViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self bulidLayout];
[self getDataFromServer];
// Do any additional setup after loading the view.
}
- (void)getDataFromServer{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"] ;
if (success == 1) {
NSDictionary *dictData = data[@"data"];
PurchaseBill *bill = [[PurchaseBill alloc]init];
[bill setValuesForKeysWithDictionary:dictData];
self.bill = bill;
[strongSelf fetchtPurchaseDetail];
}else{
[IBTLoadingView showTips:message];
}
}else{
[IBTLoadingView showTips:@" 无记录 "];
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getPurchaseResultWithPurchaseUuid:@"5a7417014f926eb5014f93b18fbc000f" success:succ failure:fail];
}
#pragma mark - 视图初始化
- (void)bulidLayout{
_scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, ScreenSize.height - 64 - BottomHeight)];
_scrollView.showsHorizontalScrollIndicator = NO;
_scrollView.showsVerticalScrollIndicator = NO;
_scrollView.backgroundColor = XXFBgColor;
[self.view addSubview:_scrollView];
[self createBtn];
[self createPurchaseView];
[self createBottomView];
if ([self.bill.state isEqualToString:@"finished"]) {
_endBtn.hidden = YES;
_rejectBtn.hidden = YES;
CGRect scrollViewFrame = _scrollView.frame;
scrollViewFrame.size.height = ScreenSize.height - 64;
_scrollView.frame = scrollViewFrame;
}
}
- (void)createBtn{
_rejectBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, (ScreenSize.width - LeftMargin*3)/2, 40) target:self sel:@selector(btnClick:) tag:RejectTag image:nil title:@"" titleColor: [UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_SAVE_COLOR];
[self.view addSubview:_rejectBtn];
_endBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(CGRectGetMaxX(_rejectBtn.frame)+ LeftMargin, ScreenSize.height - 64 - BottomHeight +5, (ScreenSize.width - LeftMargin*3)/2, 40) target:self sel:@selector(btnClick:) tag:0 image:nil title:@"" titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_COMMIT_COLOR];
[self.view addSubview:_endBtn];
if (self.indexPerson == 0) {
_rejectBtn.hidden = NO;
_rejectBtn.tag = CancleTag;
[_rejectBtn setTitle:@"作废" forState:UIControlStateNormal];
_endBtn.tag = EndTag;
[_endBtn setTitle:@"结束" forState:UIControlStateNormal];
}else if(self.indexPerson == 1){
_rejectBtn.hidden = NO;
_rejectBtn.tag = RejectTag;
[_rejectBtn setTitle:@"拒绝" forState:UIControlStateNormal];
[_endBtn setTitle:@"审核通过" forState:UIControlStateNormal];
_endBtn.tag = PassTag;
}else{
_rejectBtn.hidden = YES;
_endBtn.frame = CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, ScreenSize.width - LeftMargin * 2, 40);
_endBtn.tag = SureTag;
[_endBtn setTitle:@"确认" forState:UIControlStateNormal];
}
}
- (void)btnClick:(UIButton *)btn{
NSLog(@"%ld",(long)btn.tag);
switch (btn.tag) {
case CancleTag:
{
NSLog(@"作废");
}
break;
case EndTag:
{
NSLog(@"结束");
}
break;
case RejectTag:
{
NSLog(@"拒绝");
}
break;
case PassTag:
{
NSLog(@"审核通过");
}
break;
case SureTag:
{
NSLog(@"确定");
}
break;
default:
break;
}
}
- (void)createBottomView{
_bottomView= [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_purchaseView.frame) + TopMargin, ScreenSize.width, 200)];
_bottomView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_bottomView];
_pvc = [[ProductBillViewController alloc]init];
[self addChildViewController:_pvc];
_pvc.viewFrame = _bottomView.bounds;
_pvc.isHiddenEdit = YES;
[_bottomView addSubview:_pvc.view];
}
- (void)createPurchaseView{
if (self.indexPerson == 0) {
_leftArr = @[@"单号:",@"采购通知单:",@"创建人:",@"最后修改人:",@"状态:",@"类型:",@"供应商:",@"供应商确认:",@"收货仓库:",@"其他费用:",@"总金额:",@"备注:"];
}else if (self.indexPerson == 1) {
_leftArr = @[@"单号:",@"采购通知单:",@"创建人:",@"审核人:",@"状态:",@"类型:",@"供应商:",@"供应商确认:",@"收货仓库:",@"其他费用:",@"总金额:",@"备注:"];
}else{
_leftArr = @[@"单号:",@"采购通知单:",@"创建人:",@"审核人:",@"状态:",@"供应商:",@"其他费用:",@"总金额:",@"备注:"];
}
_purchaseView= [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, LeftHeight*_leftArr.count +LeftMargin)];
_purchaseView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_purchaseView];
for (NSInteger i = 0 ; i < _leftArr.count; i++) {
UILabel *leftLabel = [[UILabel alloc]initWithFrame:CGRectMake(LeftMargin, 10 + LeftHeight *i, LeftWidth, LeftHeight)];
leftLabel.font = GXF_SEVENTEENTH_SIZE;
leftLabel.text = _leftArr[i];
leftLabel.textColor = GXF_DETAIL_COLOR;
[_purchaseView addSubview:leftLabel];
UILabel *rightLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(leftLabel.frame), 10 + LeftHeight *i, _purchaseView.frame.size.width - LeftMargin - LeftWidth, LeftHeight)];
rightLabel.font = GXF_SEVENTEENTH_SIZE;
rightLabel.textColor = GXF_DETAIL_COLOR;
if (i == 0) {
self.billNumberLabel = rightLabel;
}else if (i == 1) {
self.noticeNumberLabel = rightLabel;
}else if(i == 2){
self.createOperNameLabel = rightLabel;
}else if(i == _leftArr.count - 3){
self.otherPriceLabel = rightLabel;
}else if(i == _leftArr.count - 2){
self.totalPriceLabel = rightLabel;
}else if(i == _leftArr.count - 1){
rightLabel.numberOfLines = 0;
self.noteLabel = rightLabel;
}
if (self.indexPerson == 0 || self.indexPerson == 1) {
if (self.indexPerson == 0) {
if (i == 3) {
self.lastModifyNameLabel = rightLabel;
}
}else{
if (i == 3) {
self.checkNameLabel = rightLabel;
}
}
if(i == 4){
self.stateLabel = rightLabel;
}else if(i == 5){
self.typeLabel = rightLabel;
}else if(i == 6){
self.vendorNameLabel = rightLabel;
}else if(i == 7){
self.vendorIsSureLabel = rightLabel;
}else if(i == 8){
self.warehouseLabel = rightLabel;
}
}else{
if(i == 3){
self.checkNameLabel = rightLabel;
}else if(i == 4){
self.stateLabel = rightLabel;
}else if(i == 5){
self.vendorNameLabel = rightLabel;
}
}
[_purchaseView addSubview:rightLabel];
}
}
- (void)fetchtPurchaseDetail{
self.billNumberLabel.text = [IBTCommon checkString:self.bill.billNumber];
if ([self.bill.state isEqualToString:PURCHASE_STATE_INITIAL]) {
self.stateLabel.textColor = [UIColor redColor];
self.stateLabel.text = @"未提交";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_SUBMITTED]) {
self.stateLabel.textColor = [UIColor greenColor];
self.stateLabel.text = @"已提交";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_REJECTED]) {
self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"已拒绝";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_APPROVED]) {
self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"已审批";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_SHIPPING]) {
self.stateLabel.textColor = [UIColor grayColor];
self.stateLabel.text = @"发运中";
}else if ([self.bill.state isEqualToString:PURCHASE_STATE_FINISHED]) {
self.stateLabel.textColor = [UIColor blackColor];
self.stateLabel.text = @"已完成";
}
self.noticeNumberLabel.text = (self.bill.noticeNumber.length == 0) ? @"无":(self.bill.noticeNumber);
self.createOperNameLabel.text = [IBTCommon checkString:self.bill.create_operName];
self.checkNameLabel.text = [IBTCommon checkString:self.bill.vendor_name];
self.vendorNameLabel.text = [IBTCommon checkString:self.bill.vendor_name];
self.totalPriceLabel.text = [IBTCommon checkString:[self.bill.total stringValue]];
self.noteLabel.text = [IBTCommon checkString:self.bill.remark];
self.lastModifyNameLabel.text = [IBTCommon checkString:self.bill.lastModify_operName];
NSString *type = [self.bill.type isEqualToString:GXF_Critical] ? @"紧急" : @"普通";
self.typeLabel.text = type;
self.vendorIsSureLabel.text = self.bill.vendorConfirmTime.length > 0 ? @"是":@"否";
self.warehouseLabel.text = [IBTCommon checkString:self.bill.receiveWrh_name];
self.otherPriceLabel.text = [self.bill.charge stringValue];
NSMutableArray *productArr = [NSMutableArray array];
for (NSDictionary *billDict in self.bill.products) {
PurchaseBillProduct *billProbuct = [PurchaseBillProduct new];
[billProbuct setValuesForKeysWithDictionary:billDict];
[productArr addObject:billProbuct];
}
_pvc.productArr = productArr;
[_pvc.tableView reloadData];
[self setNoteHeight];
}
- (void)setNoteHeight
{
CGFloat height = [self.noteLabel calculateHeight];
CGRect noteFrame = self.noteLabel.frame;
noteFrame.size.height = height;
self.noteLabel.frame = noteFrame;
CGFloat totalHeight = height + LeftHeight*_leftArr.count;
CGRect purchaseFrame = _purchaseView.frame;
purchaseFrame.size.height = totalHeight;
_purchaseView.frame = purchaseFrame;
CGRect bottomFrame = _bottomView.frame;
bottomFrame.origin.y = CGRectGetMaxY(_purchaseView.frame) + TopMargin;
_bottomView.frame = bottomFrame;
_scrollView.contentSize = CGSizeMake(ScreenSize.width, totalHeight + CGRectGetHeight(_bottomView.frame) + TopMargin*2);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
//
// SeePurchaseNoticeViewController.m
// XFFruit
//
// Created by mac on 15/8/16.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "SeePurchaseNoticeViewController.h"
@interface SeePurchaseNoticeViewController ()
@end
@implementation SeePurchaseNoticeViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -11,6 +11,7 @@
@interface PurchaseNoticeCell : UITableViewCell
@property (nonatomic,strong)UILabel *HeardLabel;
@property (nonatomic,strong)UILabel *FootLabel;
@property (nonatomic,strong)UIImageView *arrowView;
@property (nonatomic,strong)UILabel *SpLabel;
@property (nonatomic,strong)UILabel *DjLabel;
@property (nonatomic,strong)UILabel *BzggLabel;
......
......@@ -11,6 +11,8 @@
#define LeftMargin 15
#define TableHeight 46
#define TableWidth 60
#define LeftWidth 40
#define RightWidth 30
@implementation PurchaseNoticeCell
......@@ -18,7 +20,6 @@
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.isSelected=NO;
[self bulidLayout];
}
......@@ -27,30 +28,35 @@
- (void)bulidLayout
{
CGFloat gipWidth = (ScreenSize.width-4*TableWidth-(LeftMargin+20)-RightWidth)/3;
self.HeardLabel=[[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin * 2, 1))];
self.HeardLabel.backgroundColor = HexColor(@"e5e5e5");
self.HeardLabel.font = FontSize(TitleSize);
self.FootLabel=[[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, self.size.height-1, ScreenSize.width - LeftMargin * 2, 1))];
self.HeardLabel.backgroundColor = HexColor(@"e5e5e5");
self.HeardLabel.font = FontSize(TitleSize);
self.FootLabel.backgroundColor = HexColor(@"e5e5e5");
self.FootLabel.font = FontSize(TitleSize);
self.arrowView=[[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - 10)/2 , 10, 10)];
self.arrowView.image = [UIImage imageNamed:@"arrowright"];
self.arrowView.contentMode = UIViewContentModeScaleAspectFit;
self.SpLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20, 0, TableWidth, TableHeight))];
self.SpLabel.textAlignment= NSTextAlignmentLeft;
self.SpLabel.textColor = HexColor(@"666666");
self.SpLabel.font = FontSize(TitleSize);
self.DjLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+80, 0, TableWidth,TableHeight ))];
self.DjLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20+self.SpLabel.size.width+gipWidth , 0, TableWidth,TableHeight ))];
self.DjLabel.textAlignment= NSTextAlignmentLeft;
self.DjLabel.textColor = HexColor(@"666666");
self.DjLabel.font = FontSize(TitleSize);
self.BzggLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+150, 0, TableWidth, TableHeight)];
self.BzggLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.DjLabel.frame.origin.x+self.DjLabel.size.width+gipWidth, 0, TableWidth, TableHeight)];
self.BzggLabel.textAlignment= NSTextAlignmentLeft;
self.BzggLabel.textColor = HexColor(@"666666");
self.BzggLabel.font = FontSize(TitleSize);
self.BzslLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+240, 0, TableWidth, TableHeight)];
self.BzslLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.BzggLabel.frame.origin.x+self.BzggLabel.size.width+gipWidth, 0, TableWidth, TableHeight)];
self.BzslLabel.textAlignment= NSTextAlignmentLeft;
self.BzslLabel.textColor = HexColor(@"666666");
self.BzslLabel.font = FontSize(TitleSize);
......@@ -67,14 +73,17 @@
NSArray*array1=[NSArray arrayWithObjects:@"包装数量",@"基础单价" ,@"总金额",nil];
for (int i=0; i<array.count; i++) {
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(TableWidth-10, i*(10+10), 100, 10)];
UILabel *lable=[[UILabel alloc]init];
// if (i==0) {
lable.frame=CGRectMake(LeftWidth, i*(10+10), 100, 10);
// }
lable.text=[array objectAtIndex:i];
lable.font=FontSize(TitleSize-2);
[lable setTextColor:HexColor(@"444444")];
[self.subSview addSubview:lable];
}
for (int i=0; i<array1.count; i++) {
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(TableWidth+150, i*(10+10), 100, 10)];
UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(ScreenSize.width/2, i*(10+10), 60, 10)];
lable.text=[array objectAtIndex:i];
lable.font=FontSize(TitleSize-2);
[lable setTextColor:HexColor(@"444444")];
......@@ -83,10 +92,8 @@
self.subSview.hidden=YES;
self.button=[UIButton buttonWithType:UIButtonTypeCustom];
[self.button setFrame:CGRectMake(310, 0, 50, 50)];
[self.button setImage:[UIImage imageNamed:@"AttachHide"] forState:UIControlStateNormal];
// [self.button setTitle:@"编辑" forState:UIControlStateNormal];
// [self.button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[self.button setFrame:CGRectMake(ScreenSize.width-50, 0, 50, 50)];
[self.button setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateNormal];
[self.contentView addSubview:self.button];
[self.contentView addSubview:self.subSview];
[self.contentView addSubview:self.SpLabel];
......@@ -94,6 +101,7 @@
[self.contentView addSubview:self.BzslLabel];
[self.contentView addSubview:self.BzggLabel];
[self.contentView addSubview:self.HeardLabel];
[self.contentView addSubview:self.arrowView];
// [self.contentView addSubview:self.FootLabel];
}
- (void)setTitleStr:(NSString *)str
......
//
// SelectCompanyViewController.h
// XFFruit
//
// Created by mac on 15/8/31.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "MaskCell.h"
typedef void(^ChosePackaging)(NSString *Packaging);
@interface SelectCompanyViewController : ICRBaseViewController
@property (nonatomic,copy)ChosePackaging chosePackaging;
@end
//
// SelectCompanyViewController.m
// XFFruit
//
// Created by mac on 15/8/31.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "SelectCompanyViewController.h"
#define TableHeight 45
@interface SelectCompanyViewController ()<UITableViewDataSource,UITableViewDelegate>
{
}
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)UITableView *tableView;
@end
@implementation SelectCompanyViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self initData];
[self initView];
// Do any additional setup after loading the view.
}
-(void)initData
{
self.dataArr=[NSMutableArray arrayWithObjects:@"筐",@"斤",nil];
self.title = @"选择包装单位";
}
-(void)initView
{
self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0,ScreenSize.width, ScreenSize.height) style:(UITableViewStylePlain)];
self.tableView.backgroundColor = [UIColor whiteColor];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.view addSubview:self.tableView];
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[MaskCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID totalWidth:ScreenSize.width totalHeight:TableHeight];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textAlignment = UITextAlignmentCenter;
cell.textLabel.text=self.dataArr[indexPath.row];
cell.Commitbtn.hidden = YES;
}
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 40;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSString *ChosePackaging = self.dataArr[indexPath.row];
//block 回调
self.chosePackaging(ChosePackaging);
[self PopViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -12,6 +12,7 @@
#import "StartTimeView.h"
#import "ChosePersonViewController.h"
#import "ChooseProductViewController.h"
#import "SelectCompanyViewController.h"
#import "SurveyUser.h"
#import "Survey.h"
#import "Product.h"
......@@ -34,6 +35,7 @@ typedef enum : NSUInteger {
NSMutableArray *_dataArr;
UITextField *_titleField;
UILabel *_productLabel;
UILabel *_PackagingLable;
UILabel *_startDateLabel;
UILabel *_endDateLabel;
UILabel *_personLabel;
......@@ -58,7 +60,6 @@ typedef enum : NSUInteger {
[super viewDidLoad];
self.title = self.navTitle;
[self initData];
// [self createTableView];
[self setupSubviews];
// Do any additional setup after loading the view.
}
......@@ -260,7 +261,7 @@ typedef enum : NSUInteger {
}else if (indexPath.row==3)
{
contentLabel.text = @"选择包装单位";
_productLabel = contentLabel;
_PackagingLable = contentLabel;
[self preferDataInProductLabel];
}
......@@ -295,79 +296,9 @@ typedef enum : NSUInteger {
{
_titleField.placeholder = @"输入备注内容";
}
// if (self.survey) {
// _titleField.text = [IBTCommon checkString:self.survey.title];
// self.titleStr = [IBTCommon checkString:self.survey.title];
// }
}
// _titleField = [[UITextField alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
// _titleField.textAlignment = NSTextAlignmentRight;
// _titleField.textColor = HexColor(@"444444");
// _titleField.placeholder = @"输入调研标题";
// _titleField.font = FontSize(15);
// _titleField.returnKeyType = UIReturnKeyDone;
// _titleField.delegate = self;
// [cell.contentView addSubview:_titleField];
// if (self.survey) {
// _titleField.text = [IBTCommon checkString:self.survey.title];
// self.titleStr = [IBTCommon checkString:self.survey.title];
// }
// }else if (indexPath.row == _dataArr.count -1){
// _noteTextView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight)];
// _noteTextView.contentInset = UIEdgeInsetsMake(5, 5, 5, 0);
// _noteTextView.minNumberOfLines = 1;
// _noteTextView.maxNumberOfLines = 4;
// _noteTextView.font = FontSize(15);
// _noteTextView.textAlignment = NSTextAlignmentRight;
// _noteTextView.delegate = self;
// _noteTextView.returnKeyType = UIReturnKeyDone;
// _noteTextView.placeholder = @"输入备注内容";
// [cell.contentView addSubview:_noteTextView];
// if (self.survey) {
// _noteTextView.text = [IBTCommon checkString:self.survey.remark];
// self.remarkStr = [IBTCommon checkString:self.survey.remark];
// }
// CGRect lineFrame = cell.lineLabel.frame;
// lineFrame.origin.y = TableHeight*2-1;
// cell.lineLabel.frame = lineFrame;
// }else{
// UILabel *contentLabel = [[UILabel alloc]initWithFrame:(CGRectMake(100+LeftMargin, 0, ScreenSize.width - 100 - LeftMargin*2-10, TableHeight))];
// contentLabel.textAlignment= NSTextAlignmentRight;
// contentLabel.textColor = HexColor(@"bbbbbb");
// contentLabel.font = FontSize(TitleSize);
// [cell.contentView addSubview:contentLabel];
// if (indexPath.row == 1) {
// contentLabel.text = @"选择商品";
// _productLabel = contentLabel;
// [self preferDataInProductLabel];
// }else if(indexPath.row == 2){
// contentLabel.text = @"选择日期";
// _startDateLabel = contentLabel;
// if (self.survey) {
// if (self.survey.beginDate.length > 9) {
// _startDateLabel.text = [[IBTCommon checkString:self.survey.beginDate]substringToIndex:10];
// }
// _startDateLabel.textColor = HexColor(@"444444");
// self.beginDateStr =[IBTCommon checkString:self.survey.beginDate];
//
// }
// }else if(indexPath.row == 3){
// contentLabel.text = @"选择日期";
// _endDateLabel = contentLabel;
// if (self.survey) {
// if (self.survey.endDate.length > 9) {
// _endDateLabel.text = [[IBTCommon checkString:self.survey.endDate]substringToIndex:10];
// }
// _endDateLabel.textColor = HexColor(@"444444");
// self.endDateStr = [IBTCommon checkString:self.survey.endDate];
// }
// }else if(indexPath.row == 4){
// contentLabel.text = @"选择调研人员";
// _personLabel = contentLabel;
// [self preferDataInPersonLabel];
// }
// }
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
......@@ -403,6 +334,10 @@ typedef enum : NSUInteger {
ChooseProductViewController *cvc = [ChooseProductViewController new];
cvc.choseBaseInfo = ^(NSArray *products){
Product *product = products[0];
if(indexPath.row == 0){
ChooseProductViewController *cvc = [ChooseProductViewController new];
cvc.choseProduct = ^(Product *product){
_productLabel.text = [NSString stringWithFormat:@"%@[%@]",product.name,product.code];
_productLabel.textColor = HexColor(@"444444");
self.productNameStr = product.name;
......@@ -411,6 +346,18 @@ typedef enum : NSUInteger {
};
cvc.isMoreChose = NO;
[self PushViewController:cvc animated:YES];
}else if (indexPath.row ==3)
{
SelectCompanyViewController *vc=[SelectCompanyViewController new];
vc.chosePackaging = ^(NSString *Packaging){
_PackagingLable.text = [NSString stringWithFormat:@"%@",Packaging];
_PackagingLable.textColor = HexColor(@"444444");
};
[self PushViewController:vc animated:YES];
}
}
......
......@@ -37,6 +37,55 @@
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getProductWithPage_number:0 page_size:100 success:succ failure:fail];
}
#pragma mark -成功
- (void)fetchProductList:(NSString *)titleStr{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql = @"";
if (titleStr.length > 0) {
sql = [NSString stringWithFormat:@"SELECT * FROM %@ WHERE NAME LIKE '%%%@%%' ORDER BY %@", [Product TableName],titleStr, @"uuid"];
}else{
sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", [Product TableName], @"uuid"];
}
return [db executeQuery:sql];
};
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (![GXF_NSUSERFEFTAULTS objectForKey:ChooseProductUpdateDate]) {
[GXF_NSUSERFEFTAULTS setObject:[NSDate date] forKey:ChooseProductUpdateDate];
[GXF_NSUSERFEFTAULTS synchronize];
[self getBaseDataFromServer];
}else{
[strongSelf.dataArr removeAllObjects];
[strongSelf.dataArr addObject:self.tableView.header.lastUpdatedTime];
[strongSelf.dataArr addObjectsFromArray:fetchedObjects];
[self tableViewRefresh];
}
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl runFetchForClass:[Product class]
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
}
- (void)sureClick{
if(self.isMoreChose){
}else{
if (self.dataArr.count > 0) {
if (_currentIndexPath) {
Product *product = self.dataArr[_currentIndexPath.row];
//block 回调
self.choseProduct(product);
}
}
}
[self PopViewControllerAnimated:YES];
}
>>>>>>> e6b29715c43eb45494ed926219a5a1609fa46838
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
......
......@@ -195,5 +195,21 @@
"AddSurvey" = "新建行情调研";
"AddPurchase" = "新建采购单";
"Purchase" = "采购单";
//Business
"Business" = "业务";
"Announcement" = "公告";
"AddSurvey" = "新建行情调研";
"Survey" = "查看行情调研";
"Survey1" = "填写行情反馈";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey4" = "新建采购单";
"Survey5" = "查看采购单";
"Survey6" = "审核采购单";
"Survey7" = "新建发运单";
"Survey8" = "查看发运单";
"Survey9" = "新建加工单";
"EditorShopDetail" ="编辑商品明细";
"AddShopDetail" ="添加商品明细";
......@@ -182,6 +182,24 @@
"AddPurchase" = "新建采购单";
"Purchase" = "采购单";
//Business
"Business" = "业务";
"Announcement" = "公告";
"AddSurvey" = "新建行情调研";
"Survey" = "查看行情调研";
"Survey1" = "填写行情反馈";
"Survey2" = "新建采购通知";
"Survey3" = "查看采购通知";
"Survey4" = "新建采购单";
"Survey5" = "查看采购单";
"Survey6" = "审核采购单";
"Survey7" = "新建发运单";
"Survey8" = "查看发运单";
"Survey9" = "新建加工单";
"EditorShopDetail" ="编辑商品明细";
"AddShopDetail" ="添加商品明细";
......@@ -193,3 +211,4 @@
"VendorTitle" = "供应商";
"WarehouseTitle" = "加工工厂";
"ProductUnitTitle" = "商品单位";
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