Commit 9ce3345a authored by freecui's avatar freecui

新建发运单

parent b94eefca
......@@ -8,3 +8,4 @@ pod 'Base64nl', '~> 1.2'
pod 'Reveal-iOS-SDK', '~> 1.5.1'
pod 'BaiduMapAPI', '~> 2.7.0'
pod 'MJRefresh', '~> 2.2.0'
pod 'IQKeyboardManager', '~> 3.2.3'
\ No newline at end of file
......@@ -27,6 +27,7 @@ PODS:
- FMDB/common (2.5)
- FMDB/standard (2.5):
- FMDB/common
- IQKeyboardManager (3.2.4)
- MBProgressHUD (0.9.1)
- MJRefresh (2.2.0)
- Reveal-iOS-SDK (1.5.1)
......@@ -40,6 +41,7 @@ DEPENDENCIES:
- BaiduMapAPI (~> 2.7.0)
- Base64nl (~> 1.2)
- FMDB (~> 2.5)
- IQKeyboardManager (~> 3.2.3)
- MBProgressHUD (~> 0.9.1)
- MJRefresh (~> 2.2.0)
- Reveal-iOS-SDK (~> 1.5.1)
......@@ -51,6 +53,7 @@ SPEC CHECKSUMS:
BaiduMapAPI: d6433624b0b4dd156f2d842f394a5011b02a6401
Base64nl: a497bdcd1c01ea793d36b399016195a8713c0e95
FMDB: 96e8f1bcc1329e269330f99770ad4285d9003e52
IQKeyboardManager: 555b1231fefafb21b19278d7cca72986a27b748b
MBProgressHUD: c47f2c166c126cf2ce36498d80f33e754d4e93ad
MJRefresh: 65a2bf14abb6feeaed8696aa1551f70e15ab0a08
Reveal-iOS-SDK: c9c55cad2729c85f6ced415f1b21857c9a2d8ef9
......
......@@ -47,6 +47,11 @@
351CFF5C1B90633700F30866 /* GXFFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = 351CFF531B90633700F30866 /* GXFFunction.m */; };
351CFF5D1B90633700F30866 /* GXFFunctionCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 351CFF561B90633700F30866 /* GXFFunctionCollectionViewCell.m */; };
351CFF5E1B90633700F30866 /* GXFNoticeFunctionTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 351CFF581B90633700F30866 /* GXFNoticeFunctionTableViewCell.m */; };
35321F671B97EF1100E5C670 /* GXFPopNewMaterialViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35321F661B97EF1100E5C670 /* GXFPopNewMaterialViewController.m */; };
35321F6A1B97EF3600E5C670 /* GXFPopNewProductViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35321F691B97EF3600E5C670 /* GXFPopNewProductViewController.m */; };
35321F6D1B98C66400E5C670 /* GXFButtonAndLineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 35321F6C1B98C66400E5C670 /* GXFButtonAndLineView.m */; };
358432EE1B993BAF007E73ED /* GXFProcessMaterialTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 358432ED1B993BAF007E73ED /* GXFProcessMaterialTableViewCell.m */; };
358432F11B993BD8007E73ED /* GXFProcessProductTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 358432F01B993BD8007E73ED /* GXFProcessProductTableViewCell.m */; };
35A1C3551B8EFBBF004AC9F7 /* PermissionJson in Resources */ = {isa = PBXBuildFile; fileRef = 35A1C3541B8EFBBF004AC9F7 /* PermissionJson */; };
35A1C3581B8F09D2004AC9F7 /* GXFFunctionDB.m in Sources */ = {isa = PBXBuildFile; fileRef = 35A1C3571B8F09D2004AC9F7 /* GXFFunctionDB.m */; };
35B9B40E1B8FFB59009851CC /* GXFFunctionDBHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 35B9B40D1B8FFB59009851CC /* GXFFunctionDBHelper.m */; };
......@@ -59,6 +64,18 @@
35C3C0B91AE9567B0035AC8A /* ICRNavigationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35C3C0B81AE9567B0035AC8A /* ICRNavigationViewController.mm */; };
35C3C0BC1AE959B80035AC8A /* ICRNavigationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 35C3C0BB1AE959B80035AC8A /* ICRNavigationViewController.xib */; };
35C3C0BF1AE95F1D0035AC8A /* UIImage+Rotate.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C3C0BE1AE95F1D0035AC8A /* UIImage+Rotate.m */; };
35CF33781B953F07001211EF /* GXFProcessBill.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF33771B953F07001211EF /* GXFProcessBill.m */; };
35CF337B1B953F9A001211EF /* GXFProcessMaterial.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF337A1B953F9A001211EF /* GXFProcessMaterial.m */; };
35CF337E1B953FFF001211EF /* GXFProcessProduct.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF337D1B953FFF001211EF /* GXFProcessProduct.m */; };
35CF33811B9542BE001211EF /* GXFNewProcessViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF33801B9542BE001211EF /* GXFNewProcessViewController.m */; };
35CF33841B954F35001211EF /* GXFTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF33831B954F35001211EF /* GXFTableViewCell.m */; };
35CF33871B956CF7001211EF /* GXFBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF33861B956CF7001211EF /* GXFBottomView.m */; };
35CF338D1B95A442001211EF /* GXFSearchView.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF338C1B95A442001211EF /* GXFSearchView.m */; };
35CF33901B95AF1B001211EF /* GXFBaseSearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF338F1B95AF1B001211EF /* GXFBaseSearchViewController.m */; };
35CF33951B95B492001211EF /* GXFSearchVendorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF33941B95B492001211EF /* GXFSearchVendorViewController.m */; };
35CF33981B96BB02001211EF /* GXFPaging.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF33971B96BB02001211EF /* GXFPaging.m */; };
35CF339B1B96E41F001211EF /* GXFVendorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF339A1B96E41F001211EF /* GXFVendorViewController.m */; };
35CF339E1B96E606001211EF /* GXFWarehouseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35CF339D1B96E606001211EF /* GXFWarehouseViewController.m */; };
7217E9E51B72364300FE5C1D /* NewSurveyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7217E9C51B72364300FE5C1D /* NewSurveyViewController.m */; };
7217E9E61B72364300FE5C1D /* SurveyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7217E9C71B72364300FE5C1D /* SurveyViewController.m */; };
7217E9E71B72364300FE5C1D /* Attachment.m in Sources */ = {isa = PBXBuildFile; fileRef = 7217E9CA1B72364300FE5C1D /* Attachment.m */; };
......@@ -451,6 +468,16 @@
351CFF561B90633700F30866 /* GXFFunctionCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFFunctionCollectionViewCell.m; sourceTree = "<group>"; };
351CFF571B90633700F30866 /* GXFNoticeFunctionTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFNoticeFunctionTableViewCell.h; sourceTree = "<group>"; };
351CFF581B90633700F30866 /* GXFNoticeFunctionTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFNoticeFunctionTableViewCell.m; sourceTree = "<group>"; };
35321F651B97EF1100E5C670 /* GXFPopNewMaterialViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GXFPopNewMaterialViewController.h; path = ../Views/GXFPopNewMaterialViewController.h; sourceTree = "<group>"; };
35321F661B97EF1100E5C670 /* GXFPopNewMaterialViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GXFPopNewMaterialViewController.m; path = ../Views/GXFPopNewMaterialViewController.m; sourceTree = "<group>"; };
35321F681B97EF3600E5C670 /* GXFPopNewProductViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GXFPopNewProductViewController.h; path = ../Views/GXFPopNewProductViewController.h; sourceTree = "<group>"; };
35321F691B97EF3600E5C670 /* GXFPopNewProductViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GXFPopNewProductViewController.m; path = ../Views/GXFPopNewProductViewController.m; sourceTree = "<group>"; };
35321F6B1B98C66400E5C670 /* GXFButtonAndLineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFButtonAndLineView.h; sourceTree = "<group>"; };
35321F6C1B98C66400E5C670 /* GXFButtonAndLineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFButtonAndLineView.m; sourceTree = "<group>"; };
358432EC1B993BAF007E73ED /* GXFProcessMaterialTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFProcessMaterialTableViewCell.h; sourceTree = "<group>"; };
358432ED1B993BAF007E73ED /* GXFProcessMaterialTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFProcessMaterialTableViewCell.m; sourceTree = "<group>"; };
358432EF1B993BD8007E73ED /* GXFProcessProductTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFProcessProductTableViewCell.h; sourceTree = "<group>"; };
358432F01B993BD8007E73ED /* GXFProcessProductTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFProcessProductTableViewCell.m; sourceTree = "<group>"; };
35A1C3541B8EFBBF004AC9F7 /* PermissionJson */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PermissionJson; sourceTree = "<group>"; };
35A1C3561B8F09D2004AC9F7 /* GXFFunctionDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFFunctionDB.h; sourceTree = "<group>"; };
35A1C3571B8F09D2004AC9F7 /* GXFFunctionDB.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFFunctionDB.m; sourceTree = "<group>"; };
......@@ -467,6 +494,30 @@
35C3C0BB1AE959B80035AC8A /* ICRNavigationViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ICRNavigationViewController.xib; sourceTree = "<group>"; };
35C3C0BD1AE95F1C0035AC8A /* UIImage+Rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Rotate.h"; sourceTree = "<group>"; };
35C3C0BE1AE95F1D0035AC8A /* UIImage+Rotate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Rotate.m"; sourceTree = "<group>"; };
35CF33761B953F07001211EF /* GXFProcessBill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GXFProcessBill.h; path = ../Views/GXFProcessBill.h; sourceTree = "<group>"; };
35CF33771B953F07001211EF /* GXFProcessBill.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GXFProcessBill.m; path = ../Views/GXFProcessBill.m; sourceTree = "<group>"; };
35CF33791B953F9A001211EF /* GXFProcessMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GXFProcessMaterial.h; path = ../Views/GXFProcessMaterial.h; sourceTree = "<group>"; };
35CF337A1B953F9A001211EF /* GXFProcessMaterial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GXFProcessMaterial.m; path = ../Views/GXFProcessMaterial.m; sourceTree = "<group>"; };
35CF337C1B953FFF001211EF /* GXFProcessProduct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GXFProcessProduct.h; path = ../Views/GXFProcessProduct.h; sourceTree = "<group>"; };
35CF337D1B953FFF001211EF /* GXFProcessProduct.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GXFProcessProduct.m; path = ../Views/GXFProcessProduct.m; sourceTree = "<group>"; };
35CF337F1B9542BE001211EF /* GXFNewProcessViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFNewProcessViewController.h; sourceTree = "<group>"; };
35CF33801B9542BE001211EF /* GXFNewProcessViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFNewProcessViewController.m; sourceTree = "<group>"; };
35CF33821B954F35001211EF /* GXFTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFTableViewCell.h; sourceTree = "<group>"; };
35CF33831B954F35001211EF /* GXFTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFTableViewCell.m; sourceTree = "<group>"; };
35CF33851B956CF7001211EF /* GXFBottomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFBottomView.h; sourceTree = "<group>"; };
35CF33861B956CF7001211EF /* GXFBottomView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFBottomView.m; sourceTree = "<group>"; };
35CF338B1B95A442001211EF /* GXFSearchView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFSearchView.h; sourceTree = "<group>"; };
35CF338C1B95A442001211EF /* GXFSearchView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFSearchView.m; sourceTree = "<group>"; };
35CF338E1B95AF1B001211EF /* GXFBaseSearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GXFBaseSearchViewController.h; path = ../../Process/Views/GXFBaseSearchViewController.h; sourceTree = "<group>"; };
35CF338F1B95AF1B001211EF /* GXFBaseSearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GXFBaseSearchViewController.m; path = ../../Process/Views/GXFBaseSearchViewController.m; sourceTree = "<group>"; };
35CF33931B95B492001211EF /* GXFSearchVendorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFSearchVendorViewController.h; sourceTree = "<group>"; };
35CF33941B95B492001211EF /* GXFSearchVendorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFSearchVendorViewController.m; sourceTree = "<group>"; };
35CF33961B96BB02001211EF /* GXFPaging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFPaging.h; sourceTree = "<group>"; };
35CF33971B96BB02001211EF /* GXFPaging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFPaging.m; sourceTree = "<group>"; };
35CF33991B96E41F001211EF /* GXFVendorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFVendorViewController.h; sourceTree = "<group>"; };
35CF339A1B96E41F001211EF /* GXFVendorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFVendorViewController.m; sourceTree = "<group>"; };
35CF339C1B96E606001211EF /* GXFWarehouseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFWarehouseViewController.h; sourceTree = "<group>"; };
35CF339D1B96E606001211EF /* GXFWarehouseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFWarehouseViewController.m; sourceTree = "<group>"; };
7217E9C41B72364300FE5C1D /* NewSurveyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewSurveyViewController.h; sourceTree = "<group>"; };
7217E9C51B72364300FE5C1D /* NewSurveyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewSurveyViewController.m; sourceTree = "<group>"; };
7217E9C61B72364300FE5C1D /* SurveyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurveyViewController.h; sourceTree = "<group>"; };
......@@ -943,6 +994,88 @@
name = Navigation;
sourceTree = "<group>";
};
35CF33721B953E8D001211EF /* Process(加工单) */ = {
isa = PBXGroup;
children = (
35CF33731B953E8D001211EF /* Controllers */,
35CF33741B953E8D001211EF /* Models */,
35CF33751B953E8D001211EF /* Views */,
);
name = "Process(加工单)";
path = Process;
sourceTree = "<group>";
};
35CF33731B953E8D001211EF /* Controllers */ = {
isa = PBXGroup;
children = (
35321F651B97EF1100E5C670 /* GXFPopNewMaterialViewController.h */,
35321F661B97EF1100E5C670 /* GXFPopNewMaterialViewController.m */,
35321F681B97EF3600E5C670 /* GXFPopNewProductViewController.h */,
35321F691B97EF3600E5C670 /* GXFPopNewProductViewController.m */,
35CF337F1B9542BE001211EF /* GXFNewProcessViewController.h */,
35CF33801B9542BE001211EF /* GXFNewProcessViewController.m */,
);
path = Controllers;
sourceTree = "<group>";
};
35CF33741B953E8D001211EF /* Models */ = {
isa = PBXGroup;
children = (
35CF33761B953F07001211EF /* GXFProcessBill.h */,
35CF33771B953F07001211EF /* GXFProcessBill.m */,
35CF33791B953F9A001211EF /* GXFProcessMaterial.h */,
35CF337A1B953F9A001211EF /* GXFProcessMaterial.m */,
35CF337C1B953FFF001211EF /* GXFProcessProduct.h */,
35CF337D1B953FFF001211EF /* GXFProcessProduct.m */,
);
path = Models;
sourceTree = "<group>";
};
35CF33751B953E8D001211EF /* Views */ = {
isa = PBXGroup;
children = (
35CF33821B954F35001211EF /* GXFTableViewCell.h */,
35CF33831B954F35001211EF /* GXFTableViewCell.m */,
35CF33851B956CF7001211EF /* GXFBottomView.h */,
35CF33861B956CF7001211EF /* GXFBottomView.m */,
35CF338B1B95A442001211EF /* GXFSearchView.h */,
35CF338C1B95A442001211EF /* GXFSearchView.m */,
35321F6B1B98C66400E5C670 /* GXFButtonAndLineView.h */,
35321F6C1B98C66400E5C670 /* GXFButtonAndLineView.m */,
358432EC1B993BAF007E73ED /* GXFProcessMaterialTableViewCell.h */,
358432ED1B993BAF007E73ED /* GXFProcessMaterialTableViewCell.m */,
358432EF1B993BD8007E73ED /* GXFProcessProductTableViewCell.h */,
358432F01B993BD8007E73ED /* GXFProcessProductTableViewCell.m */,
);
path = Views;
sourceTree = "<group>";
};
35CF33911B95B419001211EF /* GXFCommon */ = {
isa = PBXGroup;
children = (
35CF33961B96BB02001211EF /* GXFPaging.h */,
35CF33971B96BB02001211EF /* GXFPaging.m */,
35CF33921B95B419001211EF /* GXFSelect(选择内容) */,
);
path = GXFCommon;
sourceTree = "<group>";
};
35CF33921B95B419001211EF /* GXFSelect(选择内容) */ = {
isa = PBXGroup;
children = (
35CF338E1B95AF1B001211EF /* GXFBaseSearchViewController.h */,
35CF338F1B95AF1B001211EF /* GXFBaseSearchViewController.m */,
35CF33931B95B492001211EF /* GXFSearchVendorViewController.h */,
35CF33941B95B492001211EF /* GXFSearchVendorViewController.m */,
35CF33991B96E41F001211EF /* GXFVendorViewController.h */,
35CF339A1B96E41F001211EF /* GXFVendorViewController.m */,
35CF339C1B96E606001211EF /* GXFWarehouseViewController.h */,
35CF339D1B96E606001211EF /* GXFWarehouseViewController.m */,
);
name = "GXFSelect(选择内容)";
path = GXFSelect;
sourceTree = "<group>";
};
7217E9C01B72364300FE5C1D /* Survey */ = {
isa = PBXGroup;
children = (
......@@ -1794,6 +1927,8 @@
C1C6FEED1AB88A3400D4C41A /* ViewControllers */ = {
isa = PBXGroup;
children = (
35CF33911B95B419001211EF /* GXFCommon */,
35CF33721B953E8D001211EF /* Process(加工单) */,
7281A0A71B8974120052B1AC /* Purchase */,
FE17F67A1B85CA5B0078CE96 /* PurchaseNotice */,
72C803431B7B6F0200990363 /* WorkSheet */,
......@@ -2174,12 +2309,15 @@
C15918851AC460BC0013B391 /* ICRAppViewControllerManager.m in Sources */,
C10C909B1AE56E8700B911CD /* JTOptionsEntity.m in Sources */,
C11A34621B24485100079129 /* ICRStoreResult.m in Sources */,
35CF33841B954F35001211EF /* GXFTableViewCell.m in Sources */,
7217E9E91B72364300FE5C1D /* SurveyResult.m in Sources */,
C10214DB1AD90A3F0024637E /* ICRFunctionBaseView.m in Sources */,
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 */,
35CF33901B95AF1B001211EF /* GXFBaseSearchViewController.m in Sources */,
FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */,
C182E40E1AD4CE0B009BB9DB /* IBTModel.m in Sources */,
C1FE50411AE0240300C18080 /* IBTAVAudioPlayWrapper.m in Sources */,
......@@ -2189,6 +2327,7 @@
C142D2BE1AC3A155000109A7 /* UIView+FindUIViewController.m in Sources */,
35C3C0BF1AE95F1D0035AC8A /* UIImage+Rotate.m in Sources */,
7281A0C51B89BF1C0052B1AC /* ChooseVendorViewController.m in Sources */,
35CF337E1B953FFF001211EF /* GXFProcessProduct.m in Sources */,
C11A344D1B1BE27200079129 /* ICRPatrolAllStoreViewController.m in Sources */,
C10214DD1AD90A3F0024637E /* ICRFunctionEntity.m in Sources */,
FE17F6831B85CA5B0078CE96 /* NewPurchaseNoticeViewController.m in Sources */,
......@@ -2220,10 +2359,13 @@
04040E001B6FE75800326D12 /* ICRPerson.m in Sources */,
C159183F1AC062460013B391 /* IBTTableViewInfo.m in Sources */,
7281A0BC1B897EAB0052B1AC /* PurchaseCell.m in Sources */,
35CF339E1B96E606001211EF /* GXFWarehouseViewController.m in Sources */,
C11A34661B24487D00079129 /* ICRAnswer.m in Sources */,
C1D017171AD8EF8100CD9CB8 /* IBTSegmentedControl.m in Sources */,
C10C90901AE54FE300B911CD /* IBTDatePickerViewController.m in Sources */,
C1C5644B1AD66EB4006A1050 /* ICRTaskListViewController.m in Sources */,
35CF33981B96BB02001211EF /* GXFPaging.m in Sources */,
35CF338D1B95A442001211EF /* GXFSearchView.m in Sources */,
C123A9331B27BDCD003C0C36 /* ICRQResultViewController.m in Sources */,
C18AEA881AC8D31000A1DB7B /* IBTUIView.m in Sources */,
C1FE50501AE024FA00C18080 /* UIActionSheet+Blocks.m in Sources */,
......@@ -2233,6 +2375,7 @@
72C803521B7B897B00990363 /* DataManager.m in Sources */,
C1C5643E1AD62BD8006A1050 /* ICRPlaceholderTextView.m in Sources */,
307059D21AF2211300E9DB8E /* ICRSyncCellContentView.m in Sources */,
35CF33811B9542BE001211EF /* GXFNewProcessViewController.m in Sources */,
FEA2F30F1B846F0100D64735 /* MaterialCell.m in Sources */,
0406BFD91B7C97E700DD65A7 /* BusinessViewController.m in Sources */,
C1374F581B33C40D00594D19 /* IBTWebViewController.m in Sources */,
......@@ -2252,10 +2395,12 @@
C159184F1AC062460013B391 /* IBTTableViewCell.m in Sources */,
C11A34521B1DE6E900079129 /* ICRQuestionBaseViewController.m in Sources */,
C15918491AC062460013B391 /* IBTObject.m in Sources */,
35CF339B1B96E41F001211EF /* GXFVendorViewController.m in Sources */,
C142D2B01AC3A155000109A7 /* UIColor+Helper.m in Sources */,
C142D2AC1AC3A155000109A7 /* NSNull+OVNatural.m in Sources */,
300DD94A1B184B450080EE12 /* ICRPatrolPlan.m in Sources */,
C12C24D11B0BA3C700E1FEBF /* ICRTaskHandleViewController.m in Sources */,
35CF33781B953F07001211EF /* GXFProcessBill.m in Sources */,
FE7155D91B7B328400595B0A /* Product.m in Sources */,
FE4678B61B8D986900B5EDA3 /* PurchaseBoltView.m in Sources */,
C159188A1AC4615D0013B391 /* ICRHTTPController.m in Sources */,
......@@ -2277,6 +2422,7 @@
30D7FE5D1AD4F941003D92EE /* ICRAboutViewController.m in Sources */,
7281A0B31B8974120052B1AC /* NewPurchaseViewController.m in Sources */,
C10214DF1AD90A3F0024637E /* ICRFunctionItemControl.m in Sources */,
358432F11B993BD8007E73ED /* GXFProcessProductTableViewCell.m in Sources */,
C15918431AC062460013B391 /* IBTTableViewUserInfo.m in Sources */,
30D702461ADE3862008DC0BF /* ICRAnnouncementDetailHeadView.m in Sources */,
C17E50D91B09830200C15359 /* ICRPostAttachment.m in Sources */,
......@@ -2298,6 +2444,7 @@
C11A346B1B2451D500079129 /* NALLabelsMatrix.m in Sources */,
C17DE85A1AD81D1600581AA6 /* NSMutableArray+SafeInsert.m in Sources */,
35C3C0B91AE9567B0035AC8A /* ICRNavigationViewController.mm in Sources */,
35321F6A1B97EF3600E5C670 /* GXFPopNewProductViewController.m in Sources */,
C123A8FB1B2561E1003C0C36 /* JTPopOverWindow.m in Sources */,
72F56CB21B76EC200077F0C9 /* SurveyUser.m in Sources */,
FE17F6861B85CA5B0078CE96 /* ShopDetaileViewController.m in Sources */,
......@@ -2308,17 +2455,21 @@
C15918801AC4362D0013B391 /* UIApplication+CheckFirstRun.m in Sources */,
C1F696091AB870B400F9F5DD /* main.m in Sources */,
30D9D8811AD3AC5A0086EEE7 /* ICRHelpAndFeedBackViewController.m in Sources */,
35CF33871B956CF7001211EF /* GXFBottomView.m in Sources */,
C14E3F7F1ADA336F0093325D /* ICRTaskProcessViewController.m in Sources */,
C1E91C471AD77842007B00D4 /* ICRTask.m in Sources */,
C1D0171B1AD8F0D600CD9CB8 /* IBTSegmentContainer.m in Sources */,
C10C90991AE56E8700B911CD /* JTOptionCell.m in Sources */,
35321F671B97EF1100E5C670 /* GXFPopNewMaterialViewController.m in Sources */,
C1E9F55E1B2E3B9200BF1356 /* JTImagePreviewer.m in Sources */,
C15295B31B24297D00DF60D1 /* ICRQMutiSelectViewController.m in Sources */,
C123A8FD1B2561E1003C0C36 /* JTPopupView.m in Sources */,
300DD94E1B184EA70080EE12 /* ICRQuestion.m in Sources */,
35321F6D1B98C66400E5C670 /* GXFButtonAndLineView.m in Sources */,
7217E9E81B72364300FE5C1D /* Survey.m in Sources */,
FEAE16EC1B79CAA0009D9E01 /* TPCustomImageVIew.m in Sources */,
FE4678AD1B8D636300B5EDA3 /* ChooseWarehouseViewController.m in Sources */,
35CF33951B95B492001211EF /* GXFSearchVendorViewController.m in Sources */,
7281A0B51B8974120052B1AC /* ProductCell.m in Sources */,
C1FE50561AE3587F00C18080 /* ICRAttachmentUnit.m in Sources */,
30D7494C1ACE340D00C63BA1 /* ICRModifyPwdViewController.m in Sources */,
......@@ -2356,6 +2507,7 @@
C10C909D1AE56E8700B911CD /* JTOptionsViewController.m in Sources */,
351CFF5D1B90633700F30866 /* GXFFunctionCollectionViewCell.m in Sources */,
7281A0B91B897BB20052B1AC /* PurchaseViewController.m in Sources */,
358432EE1B993BAF007E73ED /* GXFProcessMaterialTableViewCell.m in Sources */,
C1C5644F1AD6719B006A1050 /* ICRTaskDetailViewController.m in Sources */,
C1E1085D1ADA577500620375 /* ICRTaskDetailContentView.m in Sources */,
C14BE30E1ADB86DB0049F1AA /* NSData+EncodeAdditions.m in Sources */,
......
......@@ -230,6 +230,8 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
@end
......@@ -1618,52 +1618,123 @@ acceptTypeJson:YES
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (IsDictObject(responseObject)) {
void (^complete)(void) = ^(void){
if (succ) {
[IBTCommon runOnMainThreadWithoutDeadlocking:^{
succ( responseObject );
}];
}
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
objectClass:NSClassFromString( @"Vendor" )
deleteLocal:YES
handleData:NULL
complete:complete
fail:fail];
}
else {
if (fail) {
fail( nil );
}
}
};
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
CLog(@"%@", error);
if (fail) {
fail( error );
}
};
NSString *dateStr = @"2015-05-04";
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetVendor] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self GET:encodeUrlStr
parameters:NULL
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetVendor ClassName:@"Vendor" Page_number:page_number page_size:page_size success:succ failure:fail];
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
// objectClass:NSClassFromString( @"Vendor" )
// deleteLocal:YES
// handleData:NULL
// complete:complete
// fail:fail];
// }
// else {
// if (fail) {
// fail( nil );
// }
// }
// };
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// NSString *dateStr = @"2015-05-04";
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetVendor] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
// NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// [self GET:encodeUrlStr
// parameters:NULL
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
//仓库
-(void)getWarehouseWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetWarehouse ClassName:@"Warehouse" Page_number:page_number page_size:page_size success:succ failure:fail];
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
// objectClass:NSClassFromString( @"Warehouse" )
// deleteLocal:YES
// handleData:NULL
// complete:complete
// fail:fail];
// }
// else {
// if (fail) {
// fail( nil );
// }
// }
// };
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// NSString *dateStr = @"2015-05-04";
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetWarehouse] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
// NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// [self GET:encodeUrlStr
// parameters:NULL
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
- (void)p_getDownloadWithICRHTTPAction: (NSUInteger)urlAction
ClassName: (NSString *)class_Name
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail {
[self p_downloadWithIsPost:NO ICRHTTPAction:urlAction ClassName:class_Name Page_number:page_number page_size:page_size success:succ failure:fail];
}
- (void)p_postDownloadWithICRHTTPAction: (NSUInteger)urlAction
ClassName: (NSString *)class_Name
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail {
[self p_downloadWithIsPost:YES ICRHTTPAction:urlAction ClassName:class_Name Page_number:page_number page_size:page_size success:succ failure:fail];
}
- (void)p_downloadWithIsPost: (BOOL)isPost
ICRHTTPAction: (NSUInteger)urlAction
ClassName: (NSString *)class_Name
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail {
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
CLog(@"%@", responseObject);
if (IsDictObject(responseObject)) {
......@@ -1677,7 +1748,7 @@ acceptTypeJson:YES
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
objectClass:NSClassFromString( @"Warehouse" )
objectClass:NSClassFromString( class_Name ) ///
deleteLocal:YES
handleData:NULL
complete:complete
......@@ -1696,14 +1767,25 @@ acceptTypeJson:YES
}
};
NSString *dateStr = @"2015-05-04";
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetWarehouse] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:urlAction] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", dateStr,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
if (isPost) {
[self POST:encodeUrlStr
parameters:NULL
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
} else {
[self GET:encodeUrlStr
parameters:NULL
needToken:NO
acceptTypeJson:YES
acceptTypeJson:YES
success:success
failure:failure];
}
}
}
@end
......@@ -41,4 +41,28 @@
#import "NSData+EncodeAdditions.h"
#import "UIScrollView+Content.h"
//Avatar
//颜色
#define GXF_LABLE_TINT_COLOR HexColor(@"444444")
#define GXF_LABLE_BG_COLOR XXFBgColor
#define GXF_GREEN_COLOR HexColor(@"50bd62")
#define GXF_ORIGIN_COLOR HexColor(@"f69100")
//字体大小
#define GXF_LABLE_FONT FontSize(15)
// 高度
#define NavigationBarHeight 64
#define BottomViewHeight 60
#define GXF_TABLEVIEW_NOMALCELL_HEIGHT 44
#define KeyboardHeight 258
#define SEARCH_TOP_HEIGHT 50
#define SEARCH_TABLECELL_HEIGHT 50
#endif
......@@ -36,6 +36,7 @@
+ (NSString *)stringFromDate:(NSDate*)aDate;
+ (NSString*)dictionaryToJson:(id)dic;
+ (NSString *)checkString:(NSString *)str;
+ (BOOL)checkStringIsNilOrSpance: (NSString *)str;
+ (NSMutableAttributedString *)setTextViewFontOfString:(NSString *)string paragraphStyle:(NSInteger)lineHeight fontSize:(float)size color:(UIColor *)color;
@end
......@@ -198,6 +198,13 @@
return (str)?str:@"";
}
+ (BOOL)checkStringIsNilOrSpance:(NSString *)str {
if (!str || [str isEqualToString:@"" ] || [str isEqual:[NSNull null]]) {
return YES;
} else {
return NO;
}
}
+ (NSMutableAttributedString *)setTextViewFontOfString:(NSString *)string paragraphStyle:(NSInteger)lineHeight fontSize:(float)size color:(UIColor *)color {
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
paragraphStyle.lineSpacing = lineHeight;
......
......@@ -11,5 +11,4 @@
@interface IBTTableViewCell : UITableViewCell
- (void)setAccessoryType:(UITableViewCellAccessoryType)accessoryType;
@end
......@@ -10,4 +10,10 @@
@interface IBTUILabel : UILabel
- (instancetype)initWithFrame:(CGRect)frame
Text: (NSString *)text
textAligment: (NSTextAlignment)textAlignment
backgroundColor: (UIColor *)bgColor
textColor: (UIColor *)textColor
font: (UIFont *)font;
@end
......@@ -21,7 +21,29 @@
return self;
}
/*
- (instancetype)initWithFrame:(CGRect)frame
Text: (NSString *)text
textAligment: (NSTextAlignment)textAlignment
backgroundColor: (UIColor *)bgColor
textColor: (UIColor *)textColor
font: (UIFont *)font
{
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
// IBTUILabel *lbl = [[IBTUILabel alloc]initWithFrame:frame];
self.text = text;
self.textAlignment = textAlignment;
self.backgroundColor = bgColor;
self.textColor = textColor;
self.font = font;
return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
......
......@@ -132,7 +132,7 @@
[self PushViewController:svc animated:YES];
}
break;
case kFunctionSeeSurvey://查看行情
case kFunctionSeeSurvey://查看行情调研
{
SurveyViewController *svc = [[SurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey"];
......
//
// GXFPaging.h
// XFFruit
//
// Created by freecui on 15/9/2.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface GXFPaging : NSObject
@property (nonatomic, assign) NSInteger pageNumber; //页码
@property (nonatomic, assign) NSInteger pageSize;// 分页大小
@property (nonatomic, assign) NSInteger page;//当前分页
@property (nonatomic, assign) NSInteger pageCount;//总页数
@property (nonatomic, assign) NSInteger recordCount;//总记录数
- (instancetype)initWithPageNumber: (NSInteger)pageNumber
andPageSize: (NSInteger)pageSize;
@end
//
// GXFPaging.m
// XFFruit
//
// Created by freecui on 15/9/2.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFPaging.h"
@implementation GXFPaging
- (instancetype)initWithPageNumber:(NSInteger)pageNumber andPageSize:(NSInteger)pageSize {
self = [super init];
if (!self) {
return nil;
}
self.pageNumber = pageNumber;
self.pageSize = pageSize;
return self;
}
@end
//
// GXFSearchVendorViewController.h
// XFFruit
// 供应商选择界面
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFBaseSearchViewController.h"
typedef void(^ChoseVendor)(NSArray *vendor);
@interface GXFSearchVendorViewController : UIViewController
@property (nonatomic,copy)ChoseVendor choseVendor;
- (instancetype)initWithTitle: (NSString *)title;
- (instancetype)initWithTitle: (NSString *)title
isMoreChoices: (BOOL)isMoreChoices;
@end
//
// GXFSearchVendorViewController.m
// XFFruit
// 供应商选择界面
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFSearchVendorViewController.h"
#import "MaskCell.h"
#import "GXFSearchView.h"
#import "Vendor.h"
#import "Product.h"
#import "Warehouse.h"
@interface GXFSearchVendorViewController ()<UITableViewDataSource,UITableViewDelegate,GXFSearchViewDelegate>
{
// UITextField *_selectTextFiled;
NSIndexPath *_currentIndexPath;
}
@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) GXFSearchView *c_searchView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)NSMutableArray *indexArr;
@property (nonatomic,assign) BOOL d_isMoreChoices;//是否是多选
@end
@implementation GXFSearchVendorViewController
- (instancetype)initWithTitle: (NSString *)title {
self = [super init];
if (!self) {
return nil;
}
self.title = title;
self.d_isMoreChoices = NO;
return self;
}
- (instancetype) initWithTitle:(NSString *)title isMoreChoices:(BOOL)isMoreChoices {
self = [super init];
if (!self) {
return nil;
}
self.title = title;
self.d_isMoreChoices = isMoreChoices;
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initData];
[self initSubViews];
}
- (void)initData{
self.dataArr = [NSMutableArray array];
self.indexArr = [NSMutableArray array];
[self fetchVendorList];
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchVendorList];
}else{
[IBTLoadingView showTips:data];
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
//判断选择
if ([self.title isEqualToString:[IBTCommon localizableString:@"ProductTitle"]]) {
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"VendorTitle"]]) {
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"WarehouseTitle"]]) {
[[ICRHTTPController sharedController] getWarehouseWithPage_number:0 page_size:100 success:succ failure:fail];
} else {
}
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
}
/*
//判断选择
if ([self.title isEqualToString:[IBTCommon localizableString:@"ProductTitle"]]) {
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"VendorTitle"]]) {
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"WarehouseTitle"]]) {
} else {
}
*/
- (void)fetchVendorList{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql;
//判断选择
if ([self.title isEqualToString:[IBTCommon localizableString:@"ProductTitle"]]) {
sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", [Product TableName], @"uuid"];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"VendorTitle"]]) {
sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", [Vendor TableName], @"uuid"];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"WarehouseTitle"]]) {
sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", [Warehouse TableName], @"uuid"];
} else {
}
// sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", [Vendor TableName], @"uuid"];
return [db executeQuery:sql];
};
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf.dataArr removeAllObjects];
[strongSelf.dataArr addObjectsFromArray:fetchedObjects];
[strongSelf.f_tableView reloadData];
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
//判断选择
if ([self.title isEqualToString:[IBTCommon localizableString:@"ProductTitle"]]) {
[dbCtrl runFetchForClass:[Product class]
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"VendorTitle"]]) {
[dbCtrl runFetchForClass:[Vendor class]
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"WarehouseTitle"]]) {
[dbCtrl runFetchForClass:[Warehouse class]
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
} else {
}
}
- (void)initSubViews {
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClicked)];
self.navigationItem.rightBarButtonItem = rightItem;
self.c_searchView = [[GXFSearchView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, TopMargin)];
self.c_searchView.delegate = self;
[self.view addSubview:_c_searchView];
self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, TopMargin, self.view.width, self.view.height - TopMargin - NavigationBarHeight) style:UITableViewStylePlain];
self.f_tableView.delegate = self;
self.f_tableView.dataSource = self;
[self.view addSubview: _f_tableView];
}
- (void)sureClicked {
if (_d_isMoreChoices) {
NSMutableArray *arr = [[NSMutableArray alloc]init];
for (NSIndexPath *index in self.indexArr) {
//Vendor *vendor = self.dataArr[index.row];
// [arr addObject:vendor];
[arr addObject:self.dataArr[index.row]];
}
self.choseVendor(arr);
}else{
NSMutableArray *arr = [[NSMutableArray alloc]init];
if (self.dataArr.count > 0) {
// Vendor *vendor = self.dataArr[_currentIndexPath.row];
// [arr addObject:vendor];
[arr addObject:self.dataArr[_currentIndexPath.row]];
self.choseVendor(arr);
}
}
[self PopViewControllerAnimated:YES];
}
- (void)searchViewClickedDelegateBtn {
if (_d_isMoreChoices) {
[self.indexArr removeAllObjects];
}else{
_currentIndexPath = nil;
}
self.c_searchView.f_textFiled.text = @"";
//_selectTextFiled.text = @"";
[self.f_tableView reloadData];
}
#pragma mark - UITableViewDataSource 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArr.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 50;
}
- (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:self.view.width totalHeight:SEARCH_TABLECELL_HEIGHT];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (_d_isMoreChoices) {
if ([self hasIndexPath:indexPath]) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
cell.Commitbtn.hidden = YES;
}
}
//cell的现实内容
if (self.dataArr.count > 0) {
NSString *proStr;
if ([self.title isEqualToString:[IBTCommon localizableString:@"ProductTitle"]]) {
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"VendorTitle"]]) {
Vendor *vendor = self.dataArr[indexPath.row];
proStr = [NSString stringWithFormat:@"%@[%@]",vendor.name,vendor.code];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"WarehouseTitle"]]) {
Warehouse *warehouse = self.dataArr[indexPath.row];
proStr = [NSString stringWithFormat:@"%@[%@]",warehouse.name,warehouse.code];
} else {
}
[cell setTitleStr:proStr];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (_d_isMoreChoices == YES) {
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
if (![self hasIndexPath:indexPath]) {
[self.indexArr addObject:indexPath];
}
NSString *personStr = @"";
for (NSIndexPath *index in self.indexArr) {
Vendor *vendor = self.dataArr[index.row];
if (personStr.length == 0) {
personStr = [personStr stringByAppendingFormat:@"%@",vendor.name];
}else{
personStr = [personStr stringByAppendingFormat:@"、%@",vendor.name];
}
}
self.c_searchView.f_textFiled.text = personStr;
// _selectTextFiled.text = personStr;
}else{
MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:_currentIndexPath];
currentCell.Commitbtn.hidden = YES;
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
_currentIndexPath = indexPath;
NSString *textStr;
if ([self.title isEqualToString:[IBTCommon localizableString:@"ProductTitle"]]) {
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"VendorTitle"]]) {
Vendor *vendor = self.dataArr[indexPath.row];
textStr = vendor.name;
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"WarehouseTitle"]]) {
Warehouse *warehouse = self.dataArr[indexPath.row];
textStr = warehouse .name;
} else {
}
self.c_searchView.f_textFiled.text = textStr;
}
}
- (BOOL)hasIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in self.indexArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
//
// GXFVendorViewController.h
// XFFruit
//
// Created by freecui on 15/9/2.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFVendorViewController : UIViewController
typedef void(^ChoseVendor)(NSArray *vendor);
@property (nonatomic,copy)ChoseVendor choseVendor;
- (instancetype)initWithTitle: (NSString *)title;
- (instancetype)initWithTitle: (NSString *)title
isMoreChoices: (BOOL)isMoreChoices;
@end
//
// GXFSearchVendorViewController.m
// XFFruit
// 供应商选择界面
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFVendorViewController.h"
#import "MaskCell.h"
#import "GXFSearchView.h"
#import "Vendor.h"
@interface GXFVendorViewController ()<UITableViewDataSource,UITableViewDelegate,GXFSearchViewDelegate>
{
// UITextField *_selectTextFiled;
NSIndexPath *_currentIndexPath;
}
@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) GXFSearchView *c_searchView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)NSMutableArray *indexArr;
@property (nonatomic,assign) BOOL d_isMoreChoices;//是否是多选
@end
@implementation GXFVendorViewController
- (instancetype)initWithTitle: (NSString *)title {
self = [super init];
if (!self) {
return nil;
}
self.title = title;
self.d_isMoreChoices = NO;
return self;
}
- (instancetype) initWithTitle:(NSString *)title isMoreChoices:(BOOL)isMoreChoices {
self = [super init];
if (!self) {
return nil;
}
self.title = title;
self.d_isMoreChoices = isMoreChoices;
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initData];
[self initSubViews];
}
- (void)initData{
self.dataArr = [NSMutableArray array];
self.indexArr = [NSMutableArray array];
[self fetchVendorList];
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchVendorList];
}else{
[IBTLoadingView showTips:data];
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
}
- (void)fetchVendorList{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", [Vendor TableName], @"uuid"];;
return [db executeQuery:sql];
};
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf.dataArr removeAllObjects];
[strongSelf.dataArr addObjectsFromArray:fetchedObjects];
[strongSelf.f_tableView reloadData];
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl runFetchForClass:[Vendor class]
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
}
- (void)initSubViews {
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClicked)];
self.navigationItem.rightBarButtonItem = rightItem;
self.c_searchView = [[GXFSearchView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, SEARCH_TABLECELL_HEIGHT)];
self.c_searchView.delegate = self;
[self.view addSubview:_c_searchView];
self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, SEARCH_TABLECELL_HEIGHT, self.view.width, self.view.height - SEARCH_TABLECELL_HEIGHT - NavigationBarHeight) style:UITableViewStylePlain];
self.f_tableView.delegate = self;
self.f_tableView.dataSource = self;
[self.view addSubview: _f_tableView];
}
- (void)sureClicked {
if (_d_isMoreChoices) {
NSMutableArray *arr = [[NSMutableArray alloc]init];
for (NSIndexPath *index in self.indexArr) {
Vendor *vendor = self.dataArr[index.row];
[arr addObject:vendor];
}
self.choseVendor(arr);
}else{
NSMutableArray *arr = [[NSMutableArray alloc]init];
if (self.dataArr.count > 0) {
Vendor *vendor = self.dataArr[_currentIndexPath.row];
[arr addObject:vendor];
self.choseVendor(arr);
}
}
[self PopViewControllerAnimated:YES];
}
- (void)searchViewClickedDelegateBtn {
if (_d_isMoreChoices) {
[self.indexArr removeAllObjects];
}else{
_currentIndexPath = nil;
}
self.c_searchView.f_textFiled.text = @"";
//_selectTextFiled.text = @"";
[self.f_tableView reloadData];
}
#pragma mark - UITableViewDataSource 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArr.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 50;
}
- (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:self.view.width totalHeight:SEARCH_TABLECELL_HEIGHT];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (_d_isMoreChoices) {
if ([self hasIndexPath:indexPath]) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
cell.Commitbtn.hidden = YES;
}
}
//cell的现实内容
if (self.dataArr.count > 0) {
Vendor *vendor = self.dataArr[indexPath.row];
NSString *proStr = [NSString stringWithFormat:@"%@[%@]",vendor.name,vendor.code];
[cell setTitleStr:proStr];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (_d_isMoreChoices == YES) {
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
if (![self hasIndexPath:indexPath]) {
[self.indexArr addObject:indexPath];
}
NSString *personStr = @"";
for (NSIndexPath *index in self.indexArr) {
Vendor *vendor = self.dataArr[index.row];
if (personStr.length == 0) {
personStr = [personStr stringByAppendingFormat:@"%@",vendor.name];
}else{
personStr = [personStr stringByAppendingFormat:@"、%@",vendor.name];
}
}
self.c_searchView.f_textFiled.text = personStr;
// _selectTextFiled.text = personStr;
}else{
MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:_currentIndexPath];
currentCell.Commitbtn.hidden = YES;
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
_currentIndexPath = indexPath;
Vendor *vendor = self.dataArr[indexPath.row];
self.c_searchView.f_textFiled.text = vendor.name;
}
}
- (BOOL)hasIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in self.indexArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
//
// GXFWarehouseViewController.h
// XFFruit
//
// Created by freecui on 15/9/2.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFWarehouseViewController : UIViewController
typedef void(^blockChooceWarehouse)(NSArray *warehouses);
@property (nonatomic,copy)blockChooceWarehouse chooceWarehouse;
- (instancetype)initWithTitle: (NSString *)title;
- (instancetype)initWithTitle: (NSString *)title
isMoreChoices: (BOOL)isMoreChoices;
@end
//
// GXFSearchVendorViewController.m
// XFFruit
// 供应商选择界面
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFWarehouseViewController.h"
#import "MaskCell.h"
#import "GXFSearchView.h"
#import "Warehouse.h"
@interface GXFWarehouseViewController ()<UITableViewDataSource,UITableViewDelegate,GXFSearchViewDelegate>
{
NSIndexPath *_currentIndexPath;
}
@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) GXFSearchView *c_searchView;
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)NSMutableArray *indexArr;
@property (nonatomic,assign) BOOL d_isMoreChoices;//是否是多选
@end
@implementation GXFWarehouseViewController
- (instancetype)initWithTitle: (NSString *)title {
self = [super init];
if (!self) {
return nil;
}
self.title = title;
self.d_isMoreChoices = NO;
return self;
}
- (instancetype) initWithTitle:(NSString *)title isMoreChoices:(BOOL)isMoreChoices {
self = [super init];
if (!self) {
return nil;
}
self.title = title;
self.d_isMoreChoices = isMoreChoices;
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initData];
[self initSubViews];
}
- (void)initData{
self.dataArr = [NSMutableArray array];
self.indexArr = [NSMutableArray array];
[self fetchVendorList];
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchVendorList];
}else{
[IBTLoadingView showTips:data];
}
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getWarehouseWithPage_number:0 page_size:100 success:succ failure:fail];
}
- (void)fetchVendorList{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql = [NSString stringWithFormat:@"SELECT * FROM %@ ORDER BY %@", [Warehouse TableName], @"uuid"];;
return [db executeQuery:sql];
};
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf.dataArr removeAllObjects];
[strongSelf.dataArr addObjectsFromArray:fetchedObjects];
[strongSelf.f_tableView reloadData];
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl runFetchForClass:[Warehouse class]
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
}
- (void)initSubViews {
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClicked)];
self.navigationItem.rightBarButtonItem = rightItem;
self.c_searchView = [[GXFSearchView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, SEARCH_TABLECELL_HEIGHT)];
self.c_searchView.delegate = self;
[self.view addSubview:_c_searchView];
self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, SEARCH_TABLECELL_HEIGHT, self.view.width, self.view.height - SEARCH_TABLECELL_HEIGHT - NavigationBarHeight) style:UITableViewStylePlain];
self.f_tableView.delegate = self;
self.f_tableView.dataSource = self;
[self.view addSubview: _f_tableView];
}
- (void)sureClicked {
if (_d_isMoreChoices) {
NSMutableArray *arr = [[NSMutableArray alloc]init];
for (NSIndexPath *index in self.indexArr) {
Warehouse *warehouse = self.dataArr[index.row];
[arr addObject:warehouse];
}
self.chooceWarehouse(arr);
}else{
NSMutableArray *arr = [[NSMutableArray alloc]init];
if (self.dataArr.count > 0) {
Warehouse *warehouse = self.dataArr[_currentIndexPath.row];
[arr addObject:warehouse];
self.chooceWarehouse(arr);
}
}
[self PopViewControllerAnimated:YES];
}
- (void)searchViewClickedDelegateBtn {
if (_d_isMoreChoices) {
[self.indexArr removeAllObjects];
}else{
_currentIndexPath = nil;
}
self.c_searchView.f_textFiled.text = @"";
//_selectTextFiled.text = @"";
[self.f_tableView reloadData];
}
#pragma mark - UITableViewDataSource 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArr.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 50;
}
- (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:self.view.width totalHeight:SEARCH_TABLECELL_HEIGHT];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (_d_isMoreChoices) {
if ([self hasIndexPath:indexPath]) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
cell.Commitbtn.hidden = YES;
}
}
//cell的现实内容
if (self.dataArr.count > 0) {
Warehouse *warehouse = self.dataArr[indexPath.row];
NSString *proStr = [NSString stringWithFormat:@"%@[%@]",warehouse.name,warehouse.code];
[cell setTitleStr:proStr];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (_d_isMoreChoices == YES) {
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
if (![self hasIndexPath:indexPath]) {
[self.indexArr addObject:indexPath];
}
NSString *personStr = @"";
for (NSIndexPath *index in self.indexArr) {
Warehouse *warehouse = self.dataArr[indexPath.row];
if (personStr.length == 0) {
personStr = [personStr stringByAppendingFormat:@"%@",warehouse.name];
}else{
personStr = [personStr stringByAppendingFormat:@"、%@",warehouse.name];
}
}
self.c_searchView.f_textFiled.text = personStr;
// _selectTextFiled.text = personStr;
}else{
MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:_currentIndexPath];
currentCell.Commitbtn.hidden = YES;
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
_currentIndexPath = indexPath;
Warehouse *warehouse = self.dataArr[indexPath.row];
self.c_searchView.f_textFiled.text = warehouse.name;
}
}
- (BOOL)hasIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in self.indexArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
......@@ -25,6 +25,7 @@
#import "NewPurchaseViewController.h"
#import "PurchaseViewController.h"
#import "GXFNewProcessViewController.h"
#import "GXFFunctionsViewController.h"
#import "GXFDisplayFunction.h"
......@@ -34,6 +35,7 @@
#import "GXFFunctionDB.h"
#define ICRFUNCTION_IMG_TOP_PADDING (25)
......@@ -57,6 +59,7 @@
@implementation ICRHomeViewController
static NSString *cellID = @"cell";
static NSString *secondCellID = @"secondCell";
static NSString *collectionCellID = @"collectionCell";
//static CGFloat colletionCellHeight [UIScreen mainScreen].bounds.size.width / 3.0
#pragma mark - Life Cycle
......@@ -196,6 +199,11 @@ static NSString *collectionCellID = @"collectionCell";
[cell.contentView addSubview:_f_functionBaseView];
NSLog(@"%@",NSStringFromCGRect(cell.frame));
}
} else {
while ([cell.contentView.subviews lastObject] != nil) {
[(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
}
}
return cell;
......@@ -259,6 +267,18 @@ static NSString *collectionCellID = @"collectionCell";
PurchaseViewController *pvc = [[PurchaseViewController alloc]init];
pvc.title = @"采购单";
[self PushViewController:pvc animated:YES];
}
break;
case kFunctionNewProcessing:{
GXFNewProcessViewController *pvc = [[GXFNewProcessViewController alloc]init];
//pvc.title = @"采购单";
[self PushViewController:pvc animated:YES];
}
break;
case kFunctionSeeProcessing:{
// PurchaseViewController *pvc = [[PurchaseViewController alloc]init];
// pvc.title = @"采购单";
// [self PushViewController:pvc animated:YES];
}
break;
default:
......
//
// GXFProcessViewController.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface GXFNewProcessViewController : ICRBaseViewController
@end
//
// GXFProcessViewController.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFNewProcessViewController.h"
#import "GXFBottomView.h"
#import "GXFTableViewCell.h"
#import "GXFButtonAndLineView.h"
#import "GXFSearchVendorViewController.h"
#import "Vendor.h"
#import "Warehouse.h"
#import "GXFProcessBill.h"
#import "GXFProcessMaterial.h"
#import "GXFProcessProduct.h"
#import "GXFPopNewMaterialViewController.h"
#import "GXFProcessMaterialTableViewCell.h"
#import "GXFProcessProductTableViewCell.h"
#import "ProductCell.h"
typedef NS_ENUM(NSUInteger, processType){
kMaterial = 0,
kProduct
};
typedef NS_ENUM(NSInteger, cellRow) {
kTitle = 0,
kVendor,
kContact,
kContactPhone,
kWarehouse,
kTotal,
kRemark,
};
@interface GXFNewProcessViewController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,GXFBottomViewDelegate>
{
NSMutableArray *_selectRowArr;//记录当前选中的cell
}
@property (nonatomic, strong) UIScrollView *c_scrollView;
@property (nonatomic, strong) UITableView *c_tableView;
@property (nonatomic, strong) IBTSegmentContainer *c_segContainer;
@property (nonatomic, strong) IBTSegmentedControl *c_segmentControl;
@property (nonatomic, strong) GXFPopNewMaterialViewController *c_materialVC;
@property (nonatomic, strong) GXFButtonAndLineView *c_materialView;
@property (nonatomic, strong) GXFButtonAndLineView *c_productView;
@property (nonatomic, strong) NSArray *d_arrRightTableV;
@property (nonatomic, strong) NSArray *d_arrLeftTableV;
@property (nonatomic, strong) NSMutableArray *d_materialMuArr;
@property (nonatomic, strong) NSMutableArray *d_productMuArr;
@property (nonatomic, strong) GXFProcessBill *d_processBill;
@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,assign)BOOL isHiddenEdit;
@end
@implementation GXFNewProcessViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initData];
[self initSubViews];
}
- (void)initData {
self.d_arrLeftTableV =@[@"标题:",@"供应商:",@"联系人:",@"联系电话:",@"加工工厂:",@"总费用:",@"备注:"];
self.d_arrRightTableV = @[@"请输入标题",@"选择供应商",@"请输入联系人姓名",@"请输入联系电话",@"选择加工工厂",@"",@"请输入备注"];
self.d_meteilHeaderArr = @[@"原料",@"基础数量",@"入库时间"];
self.d_productHeaderArr = @[@"原料",@"基础数量",@"出库时间"];
_selectRowArr = [[NSMutableArray alloc]init];
self.d_processBill = [[GXFProcessBill alloc]init];
if (!self.d_meteilArr) {
self.d_meteilArr = [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];
if (!self.d_productArr) {
self.d_productArr = [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];
}
- (void)initSubViews {
self.view.backgroundColor = XXFBgColor;
self.c_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height - BottomViewHeight - NavigationBarHeight) style:UITableViewStyleGrouped];
self.c_tableView.dataSource = self;
self.c_tableView.delegate = self;
[self.view addSubview:_c_tableView];
[_c_tableView reloadData];
GXFBottomView *bottomV = [[GXFBottomView alloc]initWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, BottomViewHeight) LeftBtnTitle:@"结束" rightBtnTitle:@"保存"];
bottomV.delegate = self;
[self.view addSubview:bottomV];
}
#pragma UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return _d_arrLeftTableV.count;
} else {
if (_d_isProduct) {
return 2 + _d_productArr.count;
}
return 2 + _d_meteilArr.count;
}
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 1) {
if (indexPath.row > 1) {
if ([self isHaveIndexPath:indexPath]) {
return 200;
} else {
return GXF_TABLEVIEW_NOMALCELL_HEIGHT;
}
} else {
return GXF_TABLEVIEW_NOMALCELL_HEIGHT;
}
} else {
return GXF_TABLEVIEW_NOMALCELL_HEIGHT;
}
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (section == 0) {
return nil;
} else {
UIView * headV = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, 44)];
headV.backgroundColor = [UIColor whiteColor];
GXFButtonAndLineView *materialView = [[GXFButtonAndLineView alloc]initViewLineAndButtonWithFrame:CGRectMake(0, 0, self.view.width * 0.5, headV.height ) isSeleted:!_d_isProduct buttonTitle: @"原料明细" selectColor:GXF_GREEN_COLOR]; [materialView.f_btn addTarget:self action:@selector(selecNewMaterial) forControlEvents:UIControlEventTouchUpInside];
self.c_materialView = materialView;
GXFButtonAndLineView *productView = [[GXFButtonAndLineView alloc]initViewLineAndButtonWithFrame:CGRectMake(self.view.width * 0.5, 0, materialView.width, materialView.height) isSeleted:_d_isProduct buttonTitle: @"成品明细" selectColor:GXF_GREEN_COLOR];
[productView.f_btn addTarget:self action:@selector(selecNewMaterial) forControlEvents:UIControlEventTouchUpInside];
self.c_productView= productView;
[headV addSubview:_c_materialView];
[headV addSubview:_c_productView];
[headV addSubview:productView];
return headV;
}
}
- (UIView *)viewLineAndButtonWithFrame: (CGRect)frame
isSeleted: (BOOL)isSelected
buttonTitle: (NSString *)title
selectColor: (UIColor *)color
// target: (id)target
action:(SEL)action
forControlEvents:(UIControlEvents)controlEvents
{
UIView *view = [[UIView alloc]initWithFrame:frame];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, 0, view.width, view.height - 1);
[btn setTitle:title forState:UIControlStateNormal];
[btn addTarget:self action:action forControlEvents:controlEvents];
CGSize labelSize = [btn.titleLabel.text sizeWithAttributes:@{NSFontAttributeName: btn.titleLabel.font}];
UIView *line = [[UIView alloc]initWithFrame:CGRectMake((view.width - labelSize.width ) * 0.5, btn.bottom, labelSize.width, 1)];
if (isSelected) {
[btn setTitleColor:GXF_GREEN_COLOR forState:UIControlStateNormal];
line.backgroundColor = GXF_GREEN_COLOR;
} else {
[btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
line.backgroundColor = [UIColor whiteColor];
}
[view addSubview:line];
[view addSubview:btn];
return view;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if (section == 0) {
return 0.1;
} else {
return 44;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
GXFTableViewCell *xfCell ;
if (indexPath.section == 0) {
if (indexPath.row == kTitle || indexPath.row == kContact ||
indexPath.row == kContactPhone ||indexPath.row == kRemark) {
xfCell = [tableView dequeueReusableCellWithIdentifier:noLblCell];
if (!xfCell ) {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:noLblCell textFieldPlaceholder:_d_arrRightTableV[indexPath.row] isEdit:YES];
}
} else if (indexPath.row == kVendor || indexPath.row ==kWarehouse ) {
xfCell = [tableView dequeueReusableCellWithIdentifier:arrowCell];
if ( !xfCell) {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:arrowCell textFieldPlaceholder:_d_arrRightTableV[indexPath.row] isEdit:NO];
//xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableVie<#(NSString *)#>wCellStyleDefault reuseIdentifier:arrowCell];
}
xfCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else if (indexPath.row == kTotal ){
xfCell = [tableView dequeueReusableCellWithIdentifier:lblCell];
if (!xfCell ) {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:lblCell textFieldPlaceholder:_d_arrRightTableV[indexPath.row] hasLable:YES backLableText:@"元"];
}
} else {
xfCell = [tableView dequeueReusableCellWithIdentifier:noLblCell];
if (!xfCell ) {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:noLblCell textFieldPlaceholder:_d_arrRightTableV[indexPath.row] isEdit:YES];
}
}
if (xfCell.f_textField) {
xfCell.f_textField.delegate = self;
}
xfCell.f_textField.tag = indexPath.row;
xfCell.textLabel.text = _d_arrLeftTableV[indexPath.row];
xfCell.textLabel.textColor = [UIColor blackColor];
xfCell.selectionStyle = UITableViewCellAccessoryNone;
return xfCell;
} else {
if (indexPath.row == 0) {
xfCell = [tableView dequeueReusableCellWithIdentifier:addDetailCell];
if (!xfCell) {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:addDetailCell];
UIButton *addDetailedButton=[UIButton buttonWithType: UIButtonTypeCustom];
[addDetailedButton setFrame:CGRectMake(xfCell.width * 0.5, 0, xfCell.width * 0.5, xfCell.height)];
[addDetailedButton setTitle:@"+ 点击添加商品明细" forState:UIControlStateNormal];
[addDetailedButton addTarget:self action:@selector(addShopeDetailed) forControlEvents:UIControlEventTouchUpInside];
[addDetailedButton setTitleColor:HexColor(@"444444") forState:UIControlStateNormal];
[xfCell.contentView addSubview:addDetailedButton];
}
xfCell.selectionStyle = UITableViewCellAccessoryNone;
return xfCell;
} else if ( indexPath.row == 1){
xfCell = [tableView dequeueReusableCellWithIdentifier:addHeaderCell];
if (!xfCell) {
NSArray *arr = [NSArray arrayWithArray: _d_isProduct ? _d_productHeaderArr :_d_meteilHeaderArr] ;
if (arr) {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:addHeaderCell contentArray:arr];
} else {
xfCell = [[GXFTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:addHeaderCell];
}
}
xfCell.selectionStyle = UITableViewCellAccessoryNone;
return xfCell;
}else {
static NSString *cellID = @"ProductCell";
GXFProcessMaterialTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
if (_d_isProduct) {
GXFProcessProduct *processP = (GXFProcessProduct *)_d_productArr[indexPath.row - 2];
cell = [[GXFProcessProductTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID processProduct:processP];
} else {
GXFProcessMaterial *pm = (GXFProcessMaterial *)_d_meteilArr[indexPath.row - 2];
cell = [[GXFProcessMaterialTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID processMaterial:pm];
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (self.isHiddenEdit) {
cell.editBtn.hidden = YES;
}
}
if ([self isHaveIndexPath:indexPath]) {
cell.smallImageView.image = [UIImage imageNamed:@"arrowdown"];
CGRect Linefrmame = cell.lineLabel.frame;
Linefrmame.origin.y = 200-1;
cell.lineLabel.frame = Linefrmame;
CGRect showfrmame = cell.showView.frame;
showfrmame.size.height = 150;
cell.showView.frame = showfrmame;
cell.backgroundColor = XXFBgColor;
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
CGRect Linefrmame = cell.lineLabel.frame;
Linefrmame.origin.y = GXF_TABLEVIEW_NOMALCELL_HEIGHT-1;
cell.lineLabel.frame = Linefrmame;
CGRect showfrmame = cell.showView.frame;
showfrmame.size.height = 0;
cell.showView.frame = showfrmame;
cell.backgroundColor = [UIColor whiteColor];
}
cell.editBtn.tag = indexPath.row;
[cell.editBtn addTarget:self action:@selector(editClick:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
}
}
#pragma UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
GXFTableViewCell *xfCell = (GXFTableViewCell *)[_c_tableView cellForRowAtIndexPath:indexPath];
switch (indexPath.row) {
case kVendor:
{
GXFSearchVendorViewController *vc = [[GXFSearchVendorViewController alloc]initWithTitle:[IBTCommon localizableString:@"VendorTitle"]];
vc.choseVendor = ^(NSArray *vendors){
if (vendors.count > 0) {
Vendor *vendor = vendors[0];
xfCell.f_textField.text = [NSString stringWithFormat:@"%@[%@]",vendor.name,vendor.code];
_d_processBill.vendor_uuid = vendor.uuid;
_d_processBill.vendor_code = vendor.code;
_d_processBill.vendor_name = vendor.name;
}
};
[self PushViewController:vc animated:YES];
}
break;
case kWarehouse:
{
GXFSearchVendorViewController *vc = [[GXFSearchVendorViewController alloc]initWithTitle:[IBTCommon localizableString:@"WarehouseTitle"]];
vc.choseVendor = ^(NSArray *vendors){
if (vendors.count > 0) {
Warehouse *warehouse = vendors[0];
xfCell.f_textField.text = [NSString stringWithFormat:@"%@[%@]",warehouse.name,warehouse.code];
_d_processBill.warehouse_uuid = warehouse.uuid;
_d_processBill.warehouse_code = warehouse.code;
_d_processBill.warehouse_name = warehouse.name;
}
};
[self PushViewController:vc animated:YES];
}
break;
default:
break;
}
} else {
ProductCell *cell = (ProductCell *)[tableView cellForRowAtIndexPath:indexPath];
CGRect Linefrmame = cell.lineLabel.frame;
CGRect showfrmame = cell.showView.frame;
if (Linefrmame.origin.y == GXF_TABLEVIEW_NOMALCELL_HEIGHT - 1) {
cell.smallImageView.image = [UIImage imageNamed:@"arrowdown"];
Linefrmame.origin.y = 200-1;
showfrmame.size.height = 150;
cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr addObject:indexPath];
}else{
cell.smallImageView.image = [UIImage imageNamed:@"arrowright"];
Linefrmame.origin.y = GXF_TABLEVIEW_NOMALCELL_HEIGHT -1;
showfrmame.size.height = 0;
cell.backgroundColor = [UIColor whiteColor];
[_selectRowArr removeObject:indexPath];
}
cell.lineLabel.frame = Linefrmame;
cell.showView.frame = showfrmame;
NSIndexSet *indexSet = [[NSIndexSet alloc]initWithIndex:1];
[self.c_tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];
}
}
- (BOOL)isHaveIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in _selectRowArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
#pragma buttonAction
- (void)addShopeDetailed {
GXFPopNewMaterialViewController *materialVC = [[GXFPopNewMaterialViewController alloc]init];
[self PushViewController:materialVC animated:YES];
}
- (void)selecNewMaterial {
self.d_isProduct = !_d_isProduct;
if (!_d_isProduct) {
[self.c_materialView.f_btn setTitleColor:GXF_GREEN_COLOR forState:UIControlStateNormal];
self.c_materialView.f_line.backgroundColor = GXF_GREEN_COLOR;
[self.c_productView.f_btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
self.c_productView.f_line.backgroundColor = [UIColor whiteColor];
} else {
[self.c_materialView.f_btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
self.c_materialView.f_line.backgroundColor = [UIColor whiteColor];
[self.c_productView.f_btn setTitleColor:GXF_GREEN_COLOR forState:UIControlStateNormal];
self.c_productView.f_line.backgroundColor = GXF_GREEN_COLOR;
}
NSIndexSet *indexSet = [[NSIndexSet alloc]initWithIndex:1];
[self.c_tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];
}
#pragma GXFBottomViewDelegate
- (void)bottomViewleftButtonClicked:(UIButton *)leftBtn {
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.warehouse_name]) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"请选择加工工厂" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
return;
}
}
- (void)bottomViewRightButtonClicked:(UIButton *)rightBtn {
}
/*
kTitle = 0, 不为空
kVendor, 不为空
kContact,
kContactPhone,
kWarehouse, 不为空
kTotal,
kRemark,
*/
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
switch (textField.tag) {
case kTitle:
self.d_processBill.title = textField.text;
break;
case kVendor:
// self.d_processBill.title = textField.text;
break;
case kContact:
self.d_processBill.contact = textField.text;
break;
case kContactPhone:
self.d_processBill.contactPhone = textField.text;
break;
case kTotal:
self.d_processBill.total = textField.text;
break;
case kRemark:
self.d_processBill.remark = textField.text;
break;
default:
break;
}
[textField resignFirstResponder];
return YES;
}
- (void)textFieldDidEndEditing:(UITextField *)textField {
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
//
// GXFBaseSearchViewController.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTUIViewController.h"
#define TopMargin 50
#define TableCellHeight 50
@class GXFBaseSearchViewController;
@protocol GXFBaseSearchViewControllerDelegate <NSObject>
- (void)baseSearchViewControllernClickedNavigationRightButton;
- (void)baseSearchViewControllerClickedDelegateButton;
@end
@interface GXFBaseSearchViewController : IBTUIViewController
//@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) UITextField *f_textFiled;
@property (nonatomic, strong) id<GXFBaseSearchViewControllerDelegate>delegate;
- (instancetype)initWithSubViews;
@end
//
// GXFBaseSearchViewController.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#define BACKGROUND_CLOLOR HexColor(@"f8f8f8");
#import "GXFBaseSearchViewController.h"
@interface GXFBaseSearchViewController ()
@end
@implementation GXFBaseSearchViewController
- (instancetype)initWithSubViews {
self = [super init];
if (!self) {
return nil;
}
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClick)];
self.navigationItem.rightBarButtonItem = rightItem;
self.f_textFiled = [[UITextField alloc]initWithFrame:CGRectMake(20, 5, self.view.width - 20 * 2, TopMargin - 10)];
self.f_textFiled.textAlignment = NSTextAlignmentLeft;
self.f_textFiled.background = [UIImage imageNamed:@"textFiled"];
self.f_textFiled.font = FontSize(15);
[self.view addSubview:_f_textFiled];
UIImageView *leftImgV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 35, 40)];
leftImgV.image = [UIImage imageNamed:@"search"];
self.f_textFiled.leftView = leftImgV;
self.f_textFiled.leftViewMode = UITextFieldViewModeAlways;
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[rightBtn setImage:[UIImage imageNamed:@"delete"] forState:UIControlStateNormal];
rightBtn.frame = CGRectMake(0, 0, 35, 40);
[rightBtn addTarget:self action:@selector(deleteClicked) forControlEvents:UIControlEventTouchUpInside];
self.f_textFiled.rightView = rightBtn;
self.f_textFiled.rightViewMode = UITextFieldViewModeAlways;
self.view.backgroundColor = BACKGROUND_CLOLOR;
// self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, TopMargin, self.view.width, self.view.height - TopMargin - NavigationBarHeight) style:UITableViewStylePlain];
// [self.view addSubview:_f_tableView];
return self;
}
- (void)sureClick {
if ([_delegate respondsToSelector:@selector(baseSearchViewControllernClickedNavigationRightButton)]) {
[_delegate baseSearchViewControllernClickedNavigationRightButton];
}
}
- (void)deleteClicked {
if ([_delegate respondsToSelector:@selector(baseSearchViewControllerClickedDelegateButton)]) {
[_delegate baseSearchViewControllernClickedNavigationRightButton];
}
}
- (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
//
// GXFBottomView.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTUIView.h"
@class GXFBottomView;
@protocol GXFBottomViewDelegate <NSObject>
- (void)bottomViewleftButtonClicked: (UIButton *)leftBtn;
- (void)bottomViewRightButtonClicked: (UIButton *)rightBtn;
@end
@interface GXFBottomView : IBTUIView
typedef NS_ENUM(NSInteger, buttonTag){
leftTag = 1,
rightTag
};
@property (nonatomic, weak) id<GXFBottomViewDelegate>delegate;
- (instancetype)initWithFrame:(CGRect)frame
LeftBtnTitle: (NSString *)leftTitle
rightBtnTitle: (NSString *)rightTitle;
@end
//
// GXFBottomView.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFBottomView.h"
#define LEFT_PADDING (15)
#define TOP_PADDING (8)
#define BUTTON_WIDTH (self.width - 3.0 * LEFT_PADDING ) / 2.0
#define BUTTON_HEIGHT (44)
#define LEFT_BUTTON_COLOR HexColor(@"50bd62")
#define RIGHT_BUTTON_COLOR HexColor(@"f69100")
@interface GXFBottomView ()
@property (nonatomic, strong) UIButton *c_leftBtn;
@property (nonatomic, strong) UIButton *c_rightBtn;
@end
@implementation GXFBottomView
- (instancetype)initWithFrame:(CGRect)frame LeftBtnTitle:(NSString *)leftTitle rightBtnTitle:(NSString *)rightTitle{
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
CGRect leftRect = CGRectMake(LEFT_PADDING, TOP_PADDING, BUTTON_WIDTH, BUTTON_HEIGHT);
UIButton *leftBtn = [IBTCustomButtom creatButtonWithFrame:leftRect target:self sel:@selector(leftBtnClicked) tag:leftTag image:nil title:leftTitle titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:LEFT_BUTTON_COLOR];
self.c_leftBtn = leftBtn;
[self addSubview:_c_leftBtn];
CGRect rightRect = CGRectMake(leftBtn.right + LEFT_PADDING, TOP_PADDING, BUTTON_WIDTH, BUTTON_HEIGHT);
UIButton *rightBtn = [IBTCustomButtom creatButtonWithFrame:rightRect target:self sel:@selector(rightBtnClicked) tag:rightTag image:nil title:rightTitle titleColor:[UIColor whiteColor] isCorner:YES corner:5 bgColor:RIGHT_BUTTON_COLOR];
self.c_rightBtn = rightBtn;
[self addSubview:_c_rightBtn];
return self;
}
- (void)leftBtnClicked {
if ([_delegate respondsToSelector:@selector(bottomViewleftButtonClicked:)]) {
[_delegate bottomViewleftButtonClicked:_c_leftBtn];
}
}
- (void)rightBtnClicked {
if ([_delegate respondsToSelector:@selector(bottomViewRightButtonClicked:)]) {
[_delegate bottomViewRightButtonClicked:_c_rightBtn];
}
}
@end
//
// GXFButtonAndLineView.h
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFButtonAndLineView : UIView
@property (nonatomic, strong) UIButton *f_btn;
@property (nonatomic, strong) UIView *f_line;
- (instancetype)initViewLineAndButtonWithFrame: (CGRect)frame
isSeleted: (BOOL)isSelected
buttonTitle: (NSString *)title
selectColor: (UIColor *)color;
- (instancetype)initViewLineAndButtonWithFrame: (CGRect)frame
isSeleted: (BOOL)isSelected
buttonTitle: (NSString *)title
selectColor: (UIColor *)color
action:(SEL)action
forControlEvents:(UIControlEvents)controlEvents;
@end
//
// GXFButtonAndLineView.m
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFButtonAndLineView.h"
@implementation GXFButtonAndLineView
- (instancetype)initViewLineAndButtonWithFrame: (CGRect)frame
isSeleted: (BOOL)isSelected
buttonTitle: (NSString *)title
selectColor: (UIColor *)color {
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, 0, self.width, self.height - 1);
[btn setTitle:title forState:UIControlStateNormal];
CGSize labelSize = [btn.titleLabel.text sizeWithAttributes:@{NSFontAttributeName: btn.titleLabel.font}];
UIView *line = [[UIView alloc]initWithFrame:CGRectMake((self.width - labelSize.width ) * 0.5, btn.bottom, labelSize.width, 1)];
if (isSelected) {
[btn setTitleColor:GXF_GREEN_COLOR forState:UIControlStateNormal];
line.backgroundColor = GXF_GREEN_COLOR;
} else {
[btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
line.backgroundColor = [UIColor whiteColor];
}
self.f_btn = btn;
self.f_line = line;
[self addSubview:line];
[self addSubview:btn];
return self;
}
- (instancetype)initViewLineAndButtonWithFrame: (CGRect)frame
isSeleted: (BOOL)isSelected
buttonTitle: (NSString *)title
selectColor: (UIColor *)color
action:(SEL)action
forControlEvents:(UIControlEvents)controlEvents
{
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, 0, self.width, self.height - 1);
[btn setTitle:title forState:UIControlStateNormal];
[btn addTarget:self action:action forControlEvents:controlEvents];
CGSize labelSize = [btn.titleLabel.text sizeWithAttributes:@{NSFontAttributeName: btn.titleLabel.font}];
UIView *line = [[UIView alloc]initWithFrame:CGRectMake((self.width - labelSize.width ) * 0.5, btn.bottom, labelSize.width, 1)];
if (isSelected) {
[btn setTitleColor:GXF_GREEN_COLOR forState:UIControlStateNormal];
line.backgroundColor = GXF_GREEN_COLOR;
} else {
[btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
line.backgroundColor = [UIColor whiteColor];
}
self.f_btn = btn;
self.f_line = line;
[self addSubview:line];
[self addSubview:btn];
return self;
}
@end
//
// GXFPopNewMaterialView.h
// XFFruit
//
// Created by freecui on 15/9/3.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFPopNewMaterialViewController : UIViewController
@end
//
// GXFPopNewMaterialView.m
// XFFruit
//
// Created by freecui on 15/9/3.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
//#define GXF_LEFT_MARGIIN 0
//#define GXF_TABLEVIEW_HEADER_HEITHT 50
//#define GXF_TABLEVIEW_FOOT_HEITHT 50
#import "GXFPopNewMaterialViewController.h"
#import "GXFBottomView.h"
#import "GXFTableViewCell.h"
#import "StartTimeView.h"
#import "GXFProcessMaterial.h"
@interface GXFPopNewMaterialViewController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,StartTimeViewDelegate,GXFBottomViewDelegate>
{
StartTimeView *_startTimeView;
}
@property (nonatomic, strong) UIView *c_bgView;
@property (nonatomic, strong) UITableView *c_tableView;
@property (nonatomic, strong) NSArray *d_leftArr;//uitableView左边显示的提示
@property (nonatomic, strong) NSArray *d_rightArr;//右边placeholder提示
@property (nonatomic, strong) NSArray *d_lableTextArr;
@property (nonatomic, strong) GXFProcessMaterial *d_processMaterial;
@property (nonatomic, strong) NSIndexPath *d_dateIndexPath;
@end
@implementation GXFPopNewMaterialViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"新增原料明细";
[self initData];
[self initSubViews];
}
- (void)initData {
self.d_leftArr = @[@"原料商品:",@"入库日期:",@"产地:",@"品质描述:",@"基础数量",@"基础单价:",@"总金额:",@"备注:",];
self.d_rightArr = @[@"选择商品",@"",@"输入产地",@"输入品质描述",@"基础数量",@"基础单价",@"总金额",@"输入备注内容"];
self.d_lableTextArr = @[@"斤",@"元",@"元"];
self.d_processMaterial = [[GXFProcessMaterial alloc]init];
}
- (void)initSubViews {
//self.view.backgroundColor = RGBA(0, 0, 0, 0.5);
// CGFloat tableVH = GXF_TABLEVIEW_FOOT_HEITHT + GXF_TABLEVIEW_HEADER_HEITHT + GXF_TABLEVIEW_NOMALCELL_HEIGHT * _d_leftArr.count;
self.c_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.width , GXF_TABLEVIEW_NOMALCELL_HEIGHT * _d_leftArr.count) style:UITableViewStylePlain];
self.c_tableView.delegate = self;
self.c_tableView.dataSource = self;
[self.view addSubview:_c_tableView];
GXFBottomView *bottomV = [[GXFBottomView alloc]initWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, BottomViewHeight) LeftBtnTitle:@"结束" rightBtnTitle:@"保存"];
bottomV.delegate = self;
[self.view addSubview:bottomV];
}
- (void)viewDidAppear:(BOOL)animated {
// [self registerForKeyboardNotifications];
}
- (void)viewWillDisappear:(BOOL)animated {
// [[NSNotificationCenter defaultCenter] removeObserver:self];
}
#pragma UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return _d_leftArr.count;
}
//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
// return GXF_TABLEVIEW_HEADER_HEITHT;
//}
//- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
// return GXF_TABLEVIEW_FOOT_HEITHT;
//}
//- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
// UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, _c_tableView.width, GXF_TABLEVIEW_HEADER_HEITHT)];
// IBTUILabel *lbl = [[IBTUILabel alloc]initWithFrame:headerView.frame Text:@"新增原料明细" textAligment:NSTextAlignmentCenter backgroundColor:GXF_LABLE_BG_COLOR textColor:GXF_LABLE_TINT_COLOR font:GXF_LABLE_FONT];
// UIButton *btn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(_c_tableView.width - GXF_TABLEVIEW_HEADER_HEITHT, 0, GXF_TABLEVIEW_HEADER_HEITHT, GXF_TABLEVIEW_HEADER_HEITHT) target:self sel:@selector(closeClicked) tag:0 image:nil title:@"关闭" titleColor:[UIColor blackColor] isCorner:NO corner:0 bgColor:nil];
//
// [headerView addSubview:lbl];
// [headerView addSubview:btn];
// return headerView;
//}
//- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
// UIView *footView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, _c_tableView.width, GXF_TABLEVIEW_HEADER_HEITHT )];
// GXFBottomView *bottomV = [[GXFBottomView alloc]initWithFrame:footView.frame LeftBtnTitle:@"删除" rightBtnTitle:@"保存"];
// [footView addSubview:bottomV];
// return footView;
//}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
GXFTableViewCell *xfCell ;
xfCell.width = _c_tableView.width;
if ( indexPath.row == 1) {
xfCell = [tableView dequeueReusableCellWithIdentifier:arrowCell];
if (!xfCell) {
xfCell = [[GXFTableViewCell alloc]initWithWidth:_c_tableView.width Style:UITableViewCellStyleDefault reuseIdentifier:arrowCell textFieldPlaceholder:_d_rightArr[indexPath.row] isEdit:NO];
xfCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
} else if (indexPath.row == 0 || indexPath.row == 2 || indexPath.row == 3 || indexPath.row == 7) {
xfCell = [tableView dequeueReusableCellWithIdentifier:noLblCell];//-
if (!xfCell) {
xfCell = [[GXFTableViewCell alloc]initWithWidth:_c_tableView.width Style:UITableViewCellStyleDefault reuseIdentifier:arrowCell textFieldPlaceholder:_d_rightArr[indexPath.row] isEdit:YES];
}
}else if (indexPath.row == 4 || indexPath.row == 5 || indexPath.row == 6) {
xfCell = [tableView dequeueReusableCellWithIdentifier:lblCell]; //
if (!xfCell) {
xfCell = [[GXFTableViewCell alloc]initWithWidth:_c_tableView.width Style:UITableViewCellStyleDefault reuseIdentifier:lblCell textFieldPlaceholder:_d_rightArr[indexPath.row] hasLable:YES backLableText:_d_lableTextArr[indexPath.row - 4]];
}
}
if (xfCell.f_textField) {
xfCell.f_textField.delegate = self;
}
xfCell.selectionStyle = UITableViewCellAccessoryNone;
xfCell.f_textField.tag = indexPath.row;
xfCell.textLabel.text = _d_leftArr[indexPath.row];
return xfCell;
}
#pragma UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 1) {
[self startDatePickView];
self.d_dateIndexPath = indexPath;
}
}
#pragma StartTimeViewDelegate
- (void)cancelTimeView{
[self clearDatePickView];
}
- (void)okTimeView:(NSDate *)time{
GXFTableViewCell *xfCell = (GXFTableViewCell *)[_c_tableView cellForRowAtIndexPath:_d_dateIndexPath];
xfCell.f_textField.text = [IBTCommon stringFromDate:time]; ;
self.d_processMaterial.instockDate = time;
// 关闭选择器
[self clearDatePickView];
}
#pragma mark - 取消
- (void)clearDatePickView{
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = _startTimeView.frame;
startFrame.origin.y = ScreenSize.height;
_startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
[_startTimeView removeFromSuperview];
_startTimeView = nil;
}];
}
- (void)startDatePickView{
if (!_startTimeView) {
_startTimeView = [[StartTimeView alloc] initWithFrame:CGRectMake(0, ScreenSize.height, ScreenSize.width, ScreenSize.height - 64)];
_startTimeView.delegate = self;
_startTimeView.backgroundColor = RGBA(0, 0, 0 ,0.5);
[self.view addSubview:_startTimeView];
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = _startTimeView.frame;
startFrame.origin.y = 0;
_startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
}];
}
}
//- (void)textFieldDidBeginEditing:(UITextField *)textField {
// if (textField.tag == 1) {
// [textField resignFirstResponder];
// }
// CGFloat texfFiledH = GXF_TABLEVIEW_NOMALCELL_HEIGHT * (textField.tag + 1) + 64;
// CGFloat offset = KeyboardHeight - (ScreenSize.height - texfFiledH) ;
// if (offset > 0) {
// [self setTableFrame: offset];
//
// }
//
//}
- (void)textFieldDidEndEditing:(UITextField *)textField {
[self textFieldShouldReturn:textField];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
// [self recoverTableViewFrame];
[textField resignFirstResponder];
switch (textField.tag) {
case 0:
self.d_processMaterial.productName = textField.text;
break;
case 1:
// self.d_processMaterial.productName = textField.text;
break;
case 2:
self.d_processMaterial.place = textField.text;
break;
case 3:
self.d_processMaterial.quality = textField.text;
break;
case 4:
self.d_processMaterial.baseQty = [NSNumber numberWithFloat:[textField.text floatValue]];
break;
case 5:
self.d_processMaterial.basePrice = [NSNumber numberWithFloat:[textField.text floatValue]];;
break;
case 6:
self.d_processMaterial.total = [NSNumber numberWithFloat:[textField.text floatValue]];;
break;
case 7:
self.d_processMaterial.remark = textField.text;
break;
default:
break;
}
return YES;
}
//- (void)setTableFrame: (CGFloat)tableOffset {
// [UIView animateWithDuration:0.25 animations:^{
// CGRect tableFrame = _c_tableView.frame;
// tableFrame.origin.y -= tableOffset;
// self.c_tableView.frame = tableFrame;
// }];
//}
//- (void)recoverTableViewFrame {
// [UIView animateWithDuration:0.25 animations:^{
// CGRect tableFrame = _c_tableView.frame;
// tableFrame.origin.y = 0;
// self.c_tableView.frame = tableFrame;
// }];
//}
////注册通知观察者
//- (void)registerForKeyboardNotifications {
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];
//
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillBeHidden:) name:UIKeyboardWillHideNotification object:nil];
//}
//
//- (void)keyboardWasShown: (NSNotification *)aNotification {
// NSDictionary *info = [aNotification userInfo];
// CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
//
// [UIView animateWithDuration:0.25 animations:^{
// CGRect tableFrame = _c_tableView.frame;
// tableFrame.origin.y = kbSize.height;
// }];
//}
@end
//
// GXFPopNewProductView.h
// XFFruit
//
// Created by freecui on 15/9/3.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFPopNewProductViewController : UIViewController
@end
//
// GXFPopNewMaterialView.m
// XFFruit
//
// Created by freecui on 15/9/3.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFPopNewProductViewController.h"
#import "GXFBottomView.h"
#import "GXFTableViewCell.h"
#import "StartTimeView.h"
#import "GXFProcessProduct.h"
@interface GXFPopNewProductViewController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,StartTimeViewDelegate,GXFBottomViewDelegate>
{
StartTimeView *_startTimeView;
}
@property (nonatomic, strong) UIView *c_bgView;
@property (nonatomic, strong) UITableView *c_tableView;
@property (nonatomic, strong) NSArray *d_leftArr;//uitableView左边显示的提示
@property (nonatomic, strong) NSArray *d_rightArr;//右边placeholder提示
@property (nonatomic, strong) NSArray *d_lableTextArr;
@property (nonatomic, strong) GXFProcessProduct *d_processProduct;
@property (nonatomic, strong) NSIndexPath *d_dateIndexPath;
@end
@implementation GXFPopNewProductViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"新增成品明细";
[self initData];
[self initSubViews];
}
- (void)initData {
self.d_leftArr = @[@"商品:",@"出库时间:",@"包装单位:",@"包装规格:",@"包装数量",@"基础数量:",@"备注:",];
self.d_rightArr = @[@"选择商品",@"",@"出库时间",@"选择包装单位",@"",@"基础数量",@"输入备注内容"];
self.d_lableTextArr = @[@"斤",@"筐",@"斤"];
self.d_processProduct = [[GXFProcessProduct alloc]init];
}
- (void)initSubViews {
self.c_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.width , GXF_TABLEVIEW_NOMALCELL_HEIGHT * _d_leftArr.count) style:UITableViewStylePlain];
self.c_tableView.delegate = self;
self.c_tableView.dataSource = self;
[self.view addSubview:_c_tableView];
GXFBottomView *bottomV = [[GXFBottomView alloc]initWithFrame:CGRectMake(0, _c_tableView.bottom, self.view.width, BottomViewHeight) LeftBtnTitle:@"结束" rightBtnTitle:@"保存"];
bottomV.delegate = self;
[self.view addSubview:bottomV];
}
- (void)viewDidAppear:(BOOL)animated {
// [self registerForKeyboardNotifications];
}
- (void)viewWillDisappear:(BOOL)animated {
// [[NSNotificationCenter defaultCenter] removeObserver:self];
}
#pragma UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return _d_leftArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
GXFTableViewCell *xfCell ;
xfCell.width = _c_tableView.width;
if ( indexPath.row == 0 || indexPath.row == 1 ||indexPath.row == 2) {
xfCell = [tableView dequeueReusableCellWithIdentifier:arrowCell];
if (!xfCell) {
xfCell = [[GXFTableViewCell alloc]initWithWidth:_c_tableView.width Style:UITableViewCellStyleDefault reuseIdentifier:arrowCell textFieldPlaceholder:_d_rightArr[indexPath.row] isEdit:NO];
xfCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
} else if ( indexPath.row == 6) {
xfCell = [tableView dequeueReusableCellWithIdentifier:noLblCell];//-
if (!xfCell) {
xfCell = [[GXFTableViewCell alloc]initWithWidth:_c_tableView.width Style:UITableViewCellStyleDefault reuseIdentifier:arrowCell textFieldPlaceholder:_d_rightArr[indexPath.row] isEdit:YES];
}
}else if (indexPath.row == 3 || indexPath.row == 4 || indexPath.row == 5) {
xfCell = [tableView dequeueReusableCellWithIdentifier:lblCell]; //
if (!xfCell) {
xfCell = [[GXFTableViewCell alloc]initWithWidth:_c_tableView.width Style:UITableViewCellStyleDefault reuseIdentifier:lblCell textFieldPlaceholder:_d_rightArr[indexPath.row] hasLable:YES backLableText:_d_lableTextArr[indexPath.row - 3]];
}
}
if (xfCell.f_textField) {
xfCell.f_textField.delegate = self;
}
xfCell.selectionStyle = UITableViewCellAccessoryNone;
xfCell.f_textField.tag = indexPath.row;
xfCell.textLabel.text = _d_leftArr[indexPath.row];
return xfCell;
}
#pragma UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 1) {
[self startDatePickView];
self.d_dateIndexPath = indexPath;
}
}
#pragma StartTimeViewDelegate
- (void)cancelTimeView{
[self clearDatePickView];
}
- (void)okTimeView:(NSDate *)time{
GXFTableViewCell *xfCell = (GXFTableViewCell *)[_c_tableView cellForRowAtIndexPath:_d_dateIndexPath];
xfCell.f_textField.text = [IBTCommon stringFromDate:time]; ;
self.d_processProduct.outstockDate = time;
// 关闭选择器
[self clearDatePickView];
}
#pragma mark - 取消
- (void)clearDatePickView{
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = _startTimeView.frame;
startFrame.origin.y = ScreenSize.height;
_startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
[_startTimeView removeFromSuperview];
_startTimeView = nil;
}];
}
- (void)startDatePickView{
if (!_startTimeView) {
_startTimeView = [[StartTimeView alloc] initWithFrame:CGRectMake(0, ScreenSize.height, ScreenSize.width, ScreenSize.height - 64)];
_startTimeView.delegate = self;
_startTimeView.backgroundColor = RGBA(0, 0, 0 ,0.5);
[self.view addSubview:_startTimeView];
[UIView animateWithDuration:0.15 animations:^{
CGRect startFrame = _startTimeView.frame;
startFrame.origin.y = 0;
_startTimeView.frame = startFrame;
} completion:^(BOOL finished) {
}];
}
}
- (void)textFieldDidEndEditing:(UITextField *)textField {
[self textFieldShouldReturn:textField];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
// [self recoverTableViewFrame];
[textField resignFirstResponder];
switch (textField.tag) {
case 0:
self.d_processProduct.productName = textField.text;
break;
case 1:
// self.d_processProduct.productName = textField.text;
break;
case 2:
self.d_processProduct.unit = textField.text;
break;
case 3:
self.d_processProduct.qpc = [NSNumber numberWithFloat:[textField.text floatValue]];
break;
case 4:
self.d_processProduct.quantity= [NSNumber numberWithFloat:[textField.text floatValue]];
break;
case 5:
self.d_processProduct.baseQty = [NSNumber numberWithFloat:[textField.text floatValue]];;
break;
case 6:
self.d_processProduct.remark = textField.text;
break;
default:
break;
}
return YES;
}
//- (void)setTableFrame: (CGFloat)tableOffset {
// [UIView animateWithDuration:0.25 animations:^{
// CGRect tableFrame = _c_tableView.frame;
// tableFrame.origin.y -= tableOffset;
// self.c_tableView.frame = tableFrame;
// }];
//}
//- (void)recoverTableViewFrame {
// [UIView animateWithDuration:0.25 animations:^{
// CGRect tableFrame = _c_tableView.frame;
// tableFrame.origin.y = 0;
// self.c_tableView.frame = tableFrame;
// }];
//}
////注册通知观察者
//- (void)registerForKeyboardNotifications {
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];
//
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillBeHidden:) name:UIKeyboardWillHideNotification object:nil];
//}
//
//- (void)keyboardWasShown: (NSNotification *)aNotification {
// NSDictionary *info = [aNotification userInfo];
// CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
//
// [UIView animateWithDuration:0.25 animations:^{
// CGRect tableFrame = _c_tableView.frame;
// tableFrame.origin.y = kbSize.height;
// }];
//}
@end
//
// GXFProcess.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFProcessBill : IBTModel
@property (nonatomic, copy) NSString *uuid;//唯一标识
@property (nonatomic, copy) NSString *version;//版本
@property (nonatomic, copy) NSString *billNumber;//加工单号
@property (nonatomic, copy) NSString *state;// initial(未提交)submitted(已提交)rejected(已拒绝)approved(已审批)shipping(发运中)finished(已完成)
@property (nonatomic, copy) NSString *title;//标题
@property (nonatomic, strong) NSDate *beginDate;//开始日期
@property (nonatomic, strong) NSDate *endDate;//结束日期
@property (nonatomic,copy)NSString *vendor_uuid;//供应商uuid
@property (nonatomic,copy)NSString *vendor_code;//供应商代码
@property (nonatomic,copy)NSString *vendor_name;//供应商姓名
@property (nonatomic,copy)NSString *warehouse_uuid;//加工工厂uuid
@property (nonatomic,copy)NSString *warehouse_code;//加工工厂代码
@property (nonatomic,copy)NSString *warehouse_name;//加工工厂姓名
@property (nonatomic,copy)NSString *contact;//联系人
@property (nonatomic,copy)NSString *contactPhone;//联系人电话
@property (nonatomic,copy)NSString *total;//总金额
@property (nonatomic,copy)NSString *remark;//备注
@property (nonatomic, strong) NSDate *create_time;//创建时间
@property (nonatomic, copy) NSString *create_id;// 创建人代码
@property (nonatomic, copy) NSString *create_operName;//创建人名称
@property (nonatomic, strong) NSDate *lastModified_time;//最后修改时间
@property (nonatomic, copy) NSString *lastModified_id;//最后修改人代码
@property (nonatomic, copy) NSString *lastModified_operName;//最后修改人名称
//@property (nonatomic,copy)NSString *materials;原料明细
//@property (nonatomic,copy)NSString *procucts;商品明细
@end
//
// GXFProcess.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFProcessBill.h"
@implementation GXFProcessBill
@end
//
// GXFMaterial.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFProcessMaterial : IBTModel
@property (nonatomic, copy) NSString *uuid;//唯一标识
@property (nonatomic, copy) NSString *productUuid;//商品uuid
@property (nonatomic, copy) NSString *productCode;//商品代码
@property (nonatomic,copy) NSString *productName;//商品名称
@property (nonatomic,strong) NSDate *instockDate;//入库日期
@property (nonatomic,copy) NSString *place;//产地
@property (nonatomic,copy) NSString *quality;//品质信息
@property (nonatomic,strong) NSNumber *baseQty;//基础数量
@property (nonatomic,strong) NSNumber *basePrice;//基础单价
@property (nonatomic,strong) NSNumber *total;//金额
@property (nonatomic,copy) NSString *remark;//备注
@end
//
// GXFMaterial.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFProcessMaterial.h"
@implementation GXFProcessMaterial
@end
//
// GXFProcessMaterialTableViewCell.h
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GXFProcessMaterial.h"
@interface GXFProcessMaterialTableViewCell : UITableViewCell
@property (nonatomic,strong)UIImageView *smallImageView;
@property (nonatomic,strong)UIButton *editBtn;
@property (nonatomic,strong)UILabel *seqLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIView *showView;
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
processMaterial: (GXFProcessMaterial *)processMaterial;
@end
@interface GXFProcessMaterialTableViewCell (Configure)
- (void)updateWithProcessMaterial: (GXFProcessMaterial *)processMaterial;
@end
\ No newline at end of file
//
// GXFProcessMaterialTableViewCell.m
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#define LeftMargin 13
#define TableHeight 44
#define SmallSize 10
#define SmallWidth 20
#define ContentColor @"444444"
#define ContentSize 16
#define SpaceMargin 1
#define LeftWidth 45
#define RightWidth 30
#define ShowColor @"bbbbbb"
#define ShowSize 13
#define ShowWidth 150
#define ShowHeight 20
#import "GXFProcessMaterialTableViewCell.h"
@interface GXFProcessMaterialTableViewCell ()
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *baseQtyLabel;
@property (nonatomic,strong)UILabel *instockDateLabel;
@property (nonatomic,strong)UILabel *showTitleLabel;
@property (nonatomic,strong)UILabel *showBaseCountLabel;
@property (nonatomic,strong)UILabel *showDateLabel;
@property (nonatomic,strong)UILabel *basebaseQtyLabel;
@property (nonatomic,strong)UILabel *totalbaseQtyLabel;
@property (nonatomic,strong)UILabel *placeLabel;
@property (nonatomic,strong)UILabel *qualityLabel;
@property (nonatomic,strong)UILabel *remarkLabel;
@end
@implementation GXFProcessMaterialTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
processMaterial: (GXFProcessMaterial *)processMaterial {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayoutWithprocessMaterial: processMaterial];
}
return self;
}
- (void)bulidLayoutWithprocessMaterial: (GXFProcessMaterial *)processMaterial
{
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (3 -1))/3;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"arrowright"];
self.smallImageView.contentMode = UIViewContentModeScaleAspectFit;
self.seqLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.smallImageView.frame), 0, SmallWidth, TableHeight))];
self.seqLabel.textColor = HexColor(ContentColor);
self.seqLabel.text = processMaterial.productUuid;//@"13";
self.seqLabel.font = FontSize(ContentSize);
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftWidth, 0, headWidth, TableHeight))];
self.titleLabel.textAlignment = NSTextAlignmentLeft;
self.titleLabel.textColor = HexColor(ContentColor);
self.titleLabel.text = processMaterial.productName;//@"苹果桃子";
self.titleLabel.font = FontSize(ContentSize);
self.baseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.baseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.baseQtyLabel.textColor = HexColor(ContentColor);
self.baseQtyLabel.text = [NSString stringWithFormat:@"%@",processMaterial.baseQty];
self.baseQtyLabel.font = FontSize(ContentSize);
self.instockDateLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.baseQtyLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.instockDateLabel.textAlignment = NSTextAlignmentLeft;
self.instockDateLabel.text = [NSString stringWithFormat:@"%@",processMaterial.instockDate
];
self.instockDateLabel.textColor = HexColor(ContentColor);
self.instockDateLabel.font = FontSize(ContentSize);
self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)];
// self.showView.hidden = YES;
self.showView.clipsToBounds = YES;
self.showTitleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.seqLabel.frame), 0, ShowWidth, ShowHeight))];
self.showTitleLabel.textAlignment = NSTextAlignmentLeft;
self.showTitleLabel.textColor = HexColor(ShowColor);
self.showTitleLabel.text = [NSString stringWithFormat:@"原料:%@",processMaterial.productName];
self.showTitleLabel.font = FontSize(ShowSize);
self.showBaseCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showTitleLabel.frame), 0, ShowWidth, ShowHeight))];
self.showBaseCountLabel.textAlignment = NSTextAlignmentLeft;
self.showBaseCountLabel.textColor = HexColor(ShowColor);
self.showBaseCountLabel.text = @"基础数量:10000";
self.showBaseCountLabel.font = FontSize(ShowSize);
self.showDateLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.showTitleLabel.frame), ShowWidth, ShowHeight))];
self.showDateLabel.textAlignment = NSTextAlignmentLeft;
self.showDateLabel.textColor = HexColor(ShowColor);
self.showDateLabel.text = @"入库时间:2015-02-04";
self.showDateLabel.font = FontSize(ShowSize);
self.basebaseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showBaseCountLabel.frame), CGRectGetMaxY(self.showTitleLabel.frame), ShowWidth, ShowHeight))];
self.basebaseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.basebaseQtyLabel.textColor = HexColor(ShowColor);
self.basebaseQtyLabel.text = @"基础单价:11元";
self.basebaseQtyLabel.font = FontSize(ShowSize);
self.totalbaseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.showDateLabel.frame), ShowWidth, ShowHeight))];
self.totalbaseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.totalbaseQtyLabel.textColor = HexColor(ShowColor);
self.totalbaseQtyLabel.text = @"总金额:1000";
self.totalbaseQtyLabel.font = FontSize(ShowSize);
self.placeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showBaseCountLabel.frame), CGRectGetMaxY(self.showDateLabel.frame), ShowWidth, ShowHeight))];
self.placeLabel.textAlignment = NSTextAlignmentLeft;
self.placeLabel.textColor = HexColor(ShowColor);
self.placeLabel.text = @"产地:河南省";
self.placeLabel.font = FontSize(ShowSize);
self.qualityLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.totalbaseQtyLabel.frame), ShowWidth, ShowHeight))];
self.qualityLabel.textAlignment = NSTextAlignmentLeft;
self.qualityLabel.textColor = HexColor(ShowColor);
self.qualityLabel.text = @"质量:1000";
self.qualityLabel.font = FontSize(ShowSize);
self.remarkLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.qualityLabel.frame), ShowWidth, ShowHeight))];
self.remarkLabel.textAlignment = NSTextAlignmentLeft;
self.remarkLabel.textColor = HexColor(ShowColor);
self.remarkLabel.text = @"描述:河南省";
self.remarkLabel.font = FontSize(ShowSize);
self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.editBtn setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateNormal];
self.editBtn.frame = CGRectMake(ScreenSize.width - LeftWidth, 0, LeftWidth , TableHeight);
self.editBtn.contentMode = UIViewContentModeScaleAspectFit;
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin,TableHeight-1, ScreenSize.width - LeftMargin * 2, 1))];;
self.lineLabel.backgroundColor = HexColor(@"e5e5e5");
[self.contentView addSubview:self.smallImageView];
[self.contentView addSubview:self.seqLabel];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.baseQtyLabel];
// [self.contentView addSubview:self.standardLabel];
[self.contentView addSubview:self.instockDateLabel];
[self.contentView addSubview:self.editBtn];
[self.contentView addSubview:self.showView];
[self.showView addSubview:self.showTitleLabel];
[self.showView addSubview:self.showBaseCountLabel];
[self.showView addSubview:self.showDateLabel];
[self.showView addSubview:self.basebaseQtyLabel];
[self.showView addSubview:self.totalbaseQtyLabel];
[self.showView addSubview:self.placeLabel];
[self.showView addSubview:self.qualityLabel];
[self.showView addSubview:self.remarkLabel];
[self.contentView addSubview:self.lineLabel];
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
@implementation GXFProcessMaterialTableViewCell (Configure)
- (void)updateWithProcessMaterial:(GXFProcessMaterial *)processMaterial {
}
@end
//
// GXFProduct.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFProcessProduct : IBTModel
@property (nonatomic, copy) NSString *uuid;//唯一标识
@property (nonatomic, copy) NSString *productUuid;//商品uuid
@property (nonatomic, copy) NSString *productCode;//商品代码
@property (nonatomic,copy) NSString *productName;//商品名称
@property (nonatomic,strong) NSDate *outstockDate;//出库日期
@property (nonatomic,copy) NSString *unit;//包装单位
@property (nonatomic,strong) NSNumber *qpc;//包装规格
@property (nonatomic,copy) NSString *qpcStr;//包装规格描述
@property (nonatomic,strong) NSNumber *quantity;//包装数量
@property (nonatomic,strong) NSNumber *baseQty;//基础数量
@property (nonatomic,copy) NSString *remark;//备注
@end
//
// GXFProduct.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFProcessProduct.h"
@implementation GXFProcessProduct
@end
//
// GXFProcessProductTableViewCell.h
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GXFProcessProduct.h"
@interface GXFProcessProductTableViewCell : UITableViewCell
@property (nonatomic,strong)UIImageView *smallImageView;
@property (nonatomic,strong)UIButton *editBtn;
@property (nonatomic,strong)UILabel *seqLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIView *showView;
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
processProduct: (GXFProcessProduct *)processProduct;
@end
//
// GXFProcessProductTableViewCell.m
// XFFruit
//
// Created by freecui on 15/9/4.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#define LeftMargin 13
#define TableHeight 44
#define SmallSize 10
#define SmallWidth 20
#define ContentColor @"444444"
#define ContentSize 16
#define SpaceMargin 1
#define LeftWidth 45
#define RightWidth 30
#define ShowColor @"bbbbbb"
#define ShowSize 13
#define ShowWidth 150
#define ShowHeight 20
#import "GXFProcessProductTableViewCell.h"
@interface GXFProcessProductTableViewCell ()
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *baseQtyLabel;
@property (nonatomic,strong)UILabel *instockDateLabel;
@property (nonatomic,strong)UILabel *showTitleLabel;
@property (nonatomic,strong)UILabel *showBaseCountLabel;
@property (nonatomic,strong)UILabel *showDateLabel;
@property (nonatomic,strong)UILabel *basebaseQtyLabel;
@property (nonatomic,strong)UILabel *totalbaseQtyLabel;
@property (nonatomic,strong)UILabel *placeLabel;
@property (nonatomic,strong)UILabel *qualityLabel;
@property (nonatomic,strong)UILabel *remarkLabel;
@end
@implementation GXFProcessProductTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
processProduct: (GXFProcessProduct *)processProduct {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayoutWithprocessProduct: processProduct];
}
return self;
}
- (void)bulidLayoutWithprocessProduct: (GXFProcessProduct *)processProduct
{
CGFloat headWidth = (ScreenSize.width - LeftWidth*2 - SpaceMargin* (3 -1))/3;
self.smallImageView = [[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - SmallSize)/2 , SmallSize, SmallSize)];
self.smallImageView.image = [UIImage imageNamed:@"arrowright"];
self.smallImageView.contentMode = UIViewContentModeScaleAspectFit;
self.seqLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.smallImageView.frame), 0, SmallWidth, TableHeight))];
self.seqLabel.textColor = HexColor(ContentColor);
self.seqLabel.text = processProduct.productUuid;//@"13";
self.seqLabel.font = FontSize(ContentSize);
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftWidth, 0, headWidth, TableHeight))];
self.titleLabel.textAlignment = NSTextAlignmentLeft;
self.titleLabel.textColor = HexColor(ContentColor);
self.titleLabel.text = processProduct.productName;//@"苹果桃子";
self.titleLabel.font = FontSize(ContentSize);
self.baseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.baseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.baseQtyLabel.textColor = HexColor(ContentColor);
self.baseQtyLabel.text = [NSString stringWithFormat:@"%@",processProduct.baseQty];
self.baseQtyLabel.font = FontSize(ContentSize);
self.instockDateLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.baseQtyLabel.frame) + SpaceMargin, 0, headWidth, TableHeight))];
self.instockDateLabel.textAlignment = NSTextAlignmentLeft;
self.instockDateLabel.text = [NSString stringWithFormat:@"%@",processProduct.outstockDate
];
self.instockDateLabel.textColor = HexColor(ContentColor);
self.instockDateLabel.font = FontSize(ContentSize);
self.showView = [[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, ScreenSize.width, 0)];
// self.showView.hidden = YES;
self.showView.clipsToBounds = YES;
self.showTitleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.seqLabel.frame), 0, ShowWidth, ShowHeight))];
self.showTitleLabel.textAlignment = NSTextAlignmentLeft;
self.showTitleLabel.textColor = HexColor(ShowColor);
self.showTitleLabel.text = [NSString stringWithFormat:@"原料:%@",processProduct.productName];
self.showTitleLabel.font = FontSize(ShowSize);
self.showBaseCountLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.showTitleLabel.frame), 0, ShowWidth, ShowHeight))];
self.showBaseCountLabel.textAlignment = NSTextAlignmentLeft;
self.showBaseCountLabel.textColor = HexColor(ShowColor);
self.showBaseCountLabel.text = @"基础数量:10000";
self.showBaseCountLabel.font = FontSize(ShowSize);
self.showDateLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.showTitleLabel.frame), ShowWidth, ShowHeight))];
self.showDateLabel.textAlignment = NSTextAlignmentLeft;
self.showDateLabel.textColor = HexColor(ShowColor);
self.showDateLabel.text = @"入库时间:2015-02-04";
self.showDateLabel.font = FontSize(ShowSize);
self.basebaseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showBaseCountLabel.frame), CGRectGetMaxY(self.showTitleLabel.frame), ShowWidth, ShowHeight))];
self.basebaseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.basebaseQtyLabel.textColor = HexColor(ShowColor);
self.basebaseQtyLabel.text = @"基础单价:11元";
self.basebaseQtyLabel.font = FontSize(ShowSize);
self.totalbaseQtyLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.showDateLabel.frame), ShowWidth, ShowHeight))];
self.totalbaseQtyLabel.textAlignment = NSTextAlignmentLeft;
self.totalbaseQtyLabel.textColor = HexColor(ShowColor);
self.totalbaseQtyLabel.text = @"总金额:1000";
self.totalbaseQtyLabel.font = FontSize(ShowSize);
self.placeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showBaseCountLabel.frame), CGRectGetMaxY(self.showDateLabel.frame), ShowWidth, ShowHeight))];
self.placeLabel.textAlignment = NSTextAlignmentLeft;
self.placeLabel.textColor = HexColor(ShowColor);
self.placeLabel.text = @"产地:河南省";
self.placeLabel.font = FontSize(ShowSize);
self.qualityLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.totalbaseQtyLabel.frame), ShowWidth, ShowHeight))];
self.qualityLabel.textAlignment = NSTextAlignmentLeft;
self.qualityLabel.textColor = HexColor(ShowColor);
self.qualityLabel.text = @"质量:1000";
self.qualityLabel.font = FontSize(ShowSize);
self.remarkLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.showTitleLabel.frame), CGRectGetMaxY(self.qualityLabel.frame), ShowWidth, ShowHeight))];
self.remarkLabel.textAlignment = NSTextAlignmentLeft;
self.remarkLabel.textColor = HexColor(ShowColor);
self.remarkLabel.text = @"描述:河南省";
self.remarkLabel.font = FontSize(ShowSize);
self.editBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.editBtn setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateNormal];
self.editBtn.frame = CGRectMake(ScreenSize.width - LeftWidth, 0, LeftWidth , TableHeight);
self.editBtn.contentMode = UIViewContentModeScaleAspectFit;
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin,TableHeight-1, ScreenSize.width - LeftMargin * 2, 1))];;
self.lineLabel.backgroundColor = HexColor(@"e5e5e5");
[self.contentView addSubview:self.smallImageView];
[self.contentView addSubview:self.seqLabel];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.baseQtyLabel];
// [self.contentView addSubview:self.standardLabel];
[self.contentView addSubview:self.instockDateLabel];
[self.contentView addSubview:self.editBtn];
[self.contentView addSubview:self.showView];
[self.showView addSubview:self.showTitleLabel];
[self.showView addSubview:self.showBaseCountLabel];
[self.showView addSubview:self.showDateLabel];
[self.showView addSubview:self.basebaseQtyLabel];
[self.showView addSubview:self.totalbaseQtyLabel];
[self.showView addSubview:self.placeLabel];
[self.showView addSubview:self.qualityLabel];
[self.showView addSubview:self.remarkLabel];
[self.contentView addSubview:self.lineLabel];
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// GXFSearchView.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTUIView.h"
@class GXFSearchView ;
@protocol GXFSearchViewDelegate <NSObject>
- (void)searchViewClickedDelegateBtn;
@end
@interface GXFSearchView : IBTUIView
@property (nonatomic, strong) UITextField *f_textFiled;
@property (nonatomic, weak) id<GXFSearchViewDelegate>delegate;
@end
//
// GXFSearchView.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#define TopMargin 50
#import "GXFSearchView.h"
@interface GXFSearchView ()<UITextFieldDelegate>
@end
@implementation GXFSearchView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
self.f_textFiled = [[UITextField alloc]initWithFrame:CGRectMake(20, 5, self.width - 20 * 2, TopMargin - 10)];
self.f_textFiled.textAlignment = NSTextAlignmentLeft;
self.f_textFiled.font = FontSize(15);
[self addSubview:_f_textFiled];
UIImageView *leftImgV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 35, 40)];
leftImgV.image = [UIImage imageNamed:@"search"];
self.f_textFiled.background = [UIImage imageNamed:@"textFiled"];
self.f_textFiled.leftView = leftImgV;
self.f_textFiled.leftViewMode = UITextFieldViewModeAlways;
UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[rightBtn setImage:[UIImage imageNamed:@"delete"] forState:UIControlStateNormal];
rightBtn.frame = CGRectMake(0, 0, 35, 40);
[rightBtn addTarget:self action:@selector(deleteClicked) forControlEvents:UIControlEventTouchUpInside];
self.f_textFiled.rightView = rightBtn;
self.f_textFiled.rightViewMode = UITextFieldViewModeAlways;
return self;
}
- (void)deleteClicked {
if ([_delegate respondsToSelector:@selector(searchViewClickedDelegateBtn)]) {
[_delegate searchViewClickedDelegateBtn];
}
}
@end
//
// GXFTableViewCell.h
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
static NSString *noLblCell = @"noLblCell";
static NSString *lblCell = @"lblCell";
static NSString *arrowCell = @"arrowCell";
static NSString *remarkCell = @"remarkCell";
static NSString *addHeaderCell = @"addHeaderCell";
static NSString *addDetailCell = @"addDetailCell";
//static NSString *actionFootCell = @"actionFootCell";
@interface GXFTableViewCell : UITableViewCell
@property (nonatomic, strong) UITextField *f_textField;
- (instancetype)initWithStyle: (UITableViewCellStyle)style
reuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
// textField: (UITextField *)textF
hasLable: (BOOL)hasLbl
backLableText: (NSString *)lblText; //带有placeholder和label
- (instancetype)initWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
// hasLable: (BOOL)hasLbl
backLableText: (NSString *)lblText;//@"lblCell" :无箭头cellstyle为默认 :带有placeholder和label ,,没箭头可编辑
- (instancetype)initWithStyle: (UITableViewCellStyle)style
reuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder //带有placeholder分两张情况 :1),有箭头 2)没箭头可编辑
isEdit: (BOOL)isEdit;
- (instancetype)initAccessorWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder; //@"arrowCell":带有placeholder :1),有箭头
- (instancetype)initEditNoAccessorWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder; // @"noLblCell" :带有placeholder :2)没箭头可编辑
- (instancetype)initWithStyle: (UITableViewCellStyle)style
reuseIdentifier: (NSString *)reuseIdentifier
contentArray: (NSArray *)array; // cell 一行中显示的内容
//- (instancetype)initwithBottom: ()
@end
#pragma cell 默认的宽度好像是320 ????
@interface GXFTableViewCell (Frame)
- (instancetype)initWithWidth: (CGFloat)width
Style: (UITableViewCellStyle)style
reuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
// textField: (UITextField *)textF
hasLable: (BOOL)hasLbl
backLableText: (NSString *)lblText; //带有placeholder和label
- (instancetype)initWithWidth: (CGFloat)width
Style: (UITableViewCellStyle)style
reuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder //带有placeholder分两张情况 :1),有箭头 2)没箭头可编辑
isEdit: (BOOL)isEdit;
//- (instancetype)initWithWidth: (CGFloat)width
// Style: (UITableViewCellStyle)style
// reuseIdentifier: (NSString *)reuseIdentifier
// contentArray: (NSArray *)array; // cell 一行中显示的内容
@end
//
// GXFTableViewCell.m
// XFFruit
//
// Created by freecui on 15/9/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFTableViewCell.h"
@interface GXFTableViewCell ()
@end
@implementation GXFTableViewCell
//带有placeholder和label
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
textFieldPlaceholder:(NSString *)placeholder
hasLable:(BOOL)hasLbl
backLableText:(NSString *)lblText {
self = [self initWithStyle:style reuseIdentifier:reuseIdentifier textFieldPlaceholder:placeholder isEdit:YES];
UILabel *lbl = [[UILabel alloc]initWithFrame:CGRectMake(self.width - 25, 0, 25, self.height)];
lbl.textAlignment = NSTextAlignmentLeft;
lbl.text = lblText;
[self.contentView addSubview:lbl];
return self;
}
//@"lblCell" :无箭头cellstyle为默认 :带有placeholder和label ,,没箭头可编辑
- (instancetype)initWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
// hasLable: (BOOL)hasLbl
backLableText: (NSString *)lblText {
self = [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier textFieldPlaceholder:placeholder hasLable:YES backLableText:lblText];
return self;
return self;
}
#pragma 共同调用原始的初始化方法待有textfield
//带有placeholder分两张情况 :1),有箭头 2)没箭头可编辑
- (instancetype)initWithStyle:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
isEdit:(BOOL)isEdit {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (!self) {
return nil;
}
UITextField *textF = [[UITextField alloc]initWithFrame:CGRectMake(self.width * 0.2, 0, self.width * 0.8 - 30, self.height)];
textF.textAlignment = NSTextAlignmentRight;
textF.placeholder = placeholder;
textF.enabled = isEdit;
self.f_textField = textF;
[self.contentView addSubview:_f_textField];
return self;
}
//@"arrowCell":带有placeholder :1),有箭头不可编辑
- (instancetype)initAccessorWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder {
self = [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier textFieldPlaceholder:placeholder isEdit:NO];
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return self;
}
//// @"noLblCell" :带有placeholder :2)没箭头可编辑
- (instancetype)initEditNoAccessorWithreuseIdentifier: (NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder {
self = [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier textFieldPlaceholder:placeholder isEdit:YES];
return self;
}
// cell 一行中显示的内容
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier contentArray:(NSArray *)array {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (!self) {
return nil;
}
[self p_setSubViews:array];
return self;
}
- (void)p_setSubViews: (NSArray *)array{
for (NSInteger i = 0; i < array.count; i++) {
CGFloat lblW = self.width * 1.0 / 3.0;
CGFloat lblX = lblW * i;
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(lblX,0,lblW,self.height)];
label.font = FontSize(15);
label.textAlignment = NSTextAlignmentCenter;
label.textColor = HexColor(@"bbbbbb");
label.text = array[i];
[self.contentView addSubview:label];
}
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
@implementation GXFTableViewCell (Frame)
//带有placeholder和label
- (instancetype)initWithWidth: (CGFloat)width
Style:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
textFieldPlaceholder:(NSString *)placeholder
hasLable:(BOOL)hasLbl
backLableText:(NSString *)lblText {
self = [self initWithWidth:width Style:style reuseIdentifier:reuseIdentifier textFieldPlaceholder:placeholder isEdit:YES];
self.width = width;
UILabel *lbl = [[UILabel alloc]initWithFrame:CGRectMake(self.width - 25, 0, 25, self.height)];
lbl.textAlignment = NSTextAlignmentLeft;
lbl.text = lblText;
[self.contentView addSubview:lbl];
return self;
}
#pragma 共同调用原始的初始化方法待有textfield
//带有placeholder分两张情况 :1),有箭头 2)没箭头可编辑
- (instancetype)initWithWidth: (CGFloat)width
Style:(UITableViewCellStyle)style
reuseIdentifier:(NSString *)reuseIdentifier
textFieldPlaceholder: (NSString *)placeholder
isEdit:(BOOL)isEdit {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (!self) {
return nil;
}
self.width = width;
UITextField *textF = [[UITextField alloc]initWithFrame:CGRectMake(self.width * 0.2, 0, self.width * 0.8 - 30, self.height)];
textF.textAlignment = NSTextAlignmentRight;
textF.placeholder = placeholder;
textF.enabled = isEdit;
self.f_textField = textF;
[self.contentView addSubview:_f_textField];
return self;
}
//// cell 一行中显示的内容
//- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier contentArray:(NSArray *)array {
// self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
// if (!self) {
// return nil;
// }
// [self p_setSubViews:array];
// return self;
//}
@end
......@@ -155,13 +155,13 @@
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[MaskCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID totalWidth:ScreenSize.width totalHeight:TableHeight];
cell = [[MaskCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID totalWidth:ScreenSize.width totalHeight:SEARCH_TABLECELL_HEIGHT];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (self.isMoreChose) {
if ([self isHaveIndexPath:indexPath]) {
if ([self hasIndexPath:indexPath]) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
......@@ -190,7 +190,7 @@
if (self.isMoreChose == YES) {
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
if (![self isHaveIndexPath:indexPath]) {
if (![self hasIndexPath:indexPath]) {
[self.indexArr addObject:indexPath];
}
......@@ -219,7 +219,7 @@
}
}
- (BOOL)isHaveIndexPath:(NSIndexPath *)indexPath{
- (BOOL)hasIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in self.indexArr) {
if (path.row == indexPath.row) {
return YES;
......
......@@ -181,3 +181,14 @@
"AddSurvey" = "新建行情调研";
"AddPurchase" = "新建采购单";
"Purchase" = "采购单";
//Avatar
//选择界面 的title
"ProductTitle" = "商品选择";
"VendorTitle" = "供应商";
"WarehouseTitle" = "加工工厂";
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