Commit f539c42d authored by Sandy's avatar Sandy

销售录入审核功能

parent 16ccdd30
...@@ -28,7 +28,7 @@ pod 'IQKeyboardManager', '~> 3.2.3' ...@@ -28,7 +28,7 @@ pod 'IQKeyboardManager', '~> 3.2.3'
#pod 'Reveal-iOS-SDK', :configurations => ['Debug'] #pod 'Reveal-iOS-SDK', :configurations => ['Debug']
pod 'DZNEmptyDataSet' pod 'DZNEmptyDataSet'
pod 'CustomBadge', '~> 3.0.0' pod 'CustomBadge', '~> 3.0.0'
pod 'MJRefresh', '~> 3.1.12'
#should be removed later #should be removed later
#pod 'CocoaAsyncSocket', '~> 7.4.1' #pod 'CocoaAsyncSocket', '~> 7.4.1'
#pod 'CocoaLumberjack', '~> 2.0.0' #pod 'CocoaLumberjack', '~> 2.0.0'
\ No newline at end of file
...@@ -78,6 +78,13 @@ ...@@ -78,6 +78,13 @@
19D76AA11D2667AB006245D6 /* SaleInputPictureTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 19D76A9E1D2667AB006245D6 /* SaleInputPictureTableViewCell.xib */; }; 19D76AA11D2667AB006245D6 /* SaleInputPictureTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 19D76A9E1D2667AB006245D6 /* SaleInputPictureTableViewCell.xib */; };
19D76AA21D2667AB006245D6 /* SaleInputPictureCellHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = 19D76A9F1D2667AB006245D6 /* SaleInputPictureCellHeader.xib */; }; 19D76AA21D2667AB006245D6 /* SaleInputPictureCellHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = 19D76A9F1D2667AB006245D6 /* SaleInputPictureCellHeader.xib */; };
19D76AA51D266910006245D6 /* CALayer+Addtions.m in Sources */ = {isa = PBXBuildFile; fileRef = 19D76AA41D266910006245D6 /* CALayer+Addtions.m */; }; 19D76AA51D266910006245D6 /* CALayer+Addtions.m in Sources */ = {isa = PBXBuildFile; fileRef = 19D76AA41D266910006245D6 /* CALayer+Addtions.m */; };
8F0419ED1D6ABEF70062800C /* SaleInputAuditViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F0419EC1D6ABEF70062800C /* SaleInputAuditViewController.m */; };
8F0419F01D6AC0D20062800C /* SaleInputAuditTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F0419EF1D6AC0D20062800C /* SaleInputAuditTableViewCell.m */; };
8F8D6A511D6D3734001199FB /* VankeAffairsTenantBoard_iPhone.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F8D6A501D6D3734001199FB /* VankeAffairsTenantBoard_iPhone.m */; };
8F8D6A531D6D3894001199FB /* VankeAffairsTenantBoard_iPhone.xml in Resources */ = {isa = PBXBuildFile; fileRef = 8F8D6A521D6D3894001199FB /* VankeAffairsTenantBoard_iPhone.xml */; };
8FBE1E181D6ACDA2002584E5 /* SalesInputAuditListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE1E141D6ACDA2002584E5 /* SalesInputAuditListModel.m */; };
8FBE1E191D6ACDA2002584E5 /* SalesInputLines.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FBE1E171D6ACDA2002584E5 /* SalesInputLines.m */; };
8FBE1E1B1D6ADF28002584E5 /* audit.png in Resources */ = {isa = PBXBuildFile; fileRef = 8FBE1E1A1D6ADF28002584E5 /* audit.png */; };
A0D453625552DAC91D4EB4A7 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C5987243B74E897E93DEC7D3 /* libPods.a */; }; A0D453625552DAC91D4EB4A7 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C5987243B74E897E93DEC7D3 /* libPods.a */; };
C10F161B1BF77CA00065F18C /* ICRAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10F16121BF77CA00065F18C /* ICRAboutViewController.m */; }; C10F161B1BF77CA00065F18C /* ICRAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10F16121BF77CA00065F18C /* ICRAboutViewController.m */; };
C10F161C1BF77CA00065F18C /* ICRConfigurationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10F16141BF77CA00065F18C /* ICRConfigurationViewController.m */; }; C10F161C1BF77CA00065F18C /* ICRConfigurationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10F16141BF77CA00065F18C /* ICRConfigurationViewController.m */; };
...@@ -906,6 +913,19 @@ ...@@ -906,6 +913,19 @@
19D76AA31D266910006245D6 /* CALayer+Addtions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+Addtions.h"; sourceTree = "<group>"; }; 19D76AA31D266910006245D6 /* CALayer+Addtions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+Addtions.h"; sourceTree = "<group>"; };
19D76AA41D266910006245D6 /* CALayer+Addtions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CALayer+Addtions.m"; sourceTree = "<group>"; }; 19D76AA41D266910006245D6 /* CALayer+Addtions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CALayer+Addtions.m"; sourceTree = "<group>"; };
710E0C5D8A5E02D32E5C6C2D /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; }; 710E0C5D8A5E02D32E5C6C2D /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
8F0419EB1D6ABEF70062800C /* SaleInputAuditViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SaleInputAuditViewController.h; sourceTree = "<group>"; };
8F0419EC1D6ABEF70062800C /* SaleInputAuditViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SaleInputAuditViewController.m; sourceTree = "<group>"; };
8F0419EE1D6AC0D20062800C /* SaleInputAuditTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SaleInputAuditTableViewCell.h; sourceTree = "<group>"; };
8F0419EF1D6AC0D20062800C /* SaleInputAuditTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SaleInputAuditTableViewCell.m; sourceTree = "<group>"; };
8F8D6A4F1D6D3734001199FB /* VankeAffairsTenantBoard_iPhone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VankeAffairsTenantBoard_iPhone.h; sourceTree = "<group>"; };
8F8D6A501D6D3734001199FB /* VankeAffairsTenantBoard_iPhone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VankeAffairsTenantBoard_iPhone.m; sourceTree = "<group>"; };
8F8D6A521D6D3894001199FB /* VankeAffairsTenantBoard_iPhone.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = VankeAffairsTenantBoard_iPhone.xml; sourceTree = "<group>"; };
8FBE1E131D6ACDA2002584E5 /* SalesInputAuditListModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SalesInputAuditListModel.h; sourceTree = "<group>"; };
8FBE1E141D6ACDA2002584E5 /* SalesInputAuditListModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SalesInputAuditListModel.m; sourceTree = "<group>"; };
8FBE1E151D6ACDA2002584E5 /* SalesInputAuditModels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SalesInputAuditModels.h; sourceTree = "<group>"; };
8FBE1E161D6ACDA2002584E5 /* SalesInputLines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SalesInputLines.h; sourceTree = "<group>"; };
8FBE1E171D6ACDA2002584E5 /* SalesInputLines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SalesInputLines.m; sourceTree = "<group>"; };
8FBE1E1A1D6ADF28002584E5 /* audit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = audit.png; sourceTree = "<group>"; };
C10F16111BF77CA00065F18C /* ICRAboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ICRAboutViewController.h; path = view_iPhone/templates/settings/ICRAboutViewController.h; sourceTree = "<group>"; }; C10F16111BF77CA00065F18C /* ICRAboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ICRAboutViewController.h; path = view_iPhone/templates/settings/ICRAboutViewController.h; sourceTree = "<group>"; };
C10F16121BF77CA00065F18C /* ICRAboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ICRAboutViewController.m; path = view_iPhone/templates/settings/ICRAboutViewController.m; sourceTree = "<group>"; }; C10F16121BF77CA00065F18C /* ICRAboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ICRAboutViewController.m; path = view_iPhone/templates/settings/ICRAboutViewController.m; sourceTree = "<group>"; };
C10F16131BF77CA00065F18C /* ICRConfigurationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ICRConfigurationViewController.h; path = view_iPhone/templates/settings/ICRConfigurationViewController.h; sourceTree = "<group>"; }; C10F16131BF77CA00065F18C /* ICRConfigurationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ICRConfigurationViewController.h; path = view_iPhone/templates/settings/ICRConfigurationViewController.h; sourceTree = "<group>"; };
...@@ -2164,6 +2184,8 @@ ...@@ -2164,6 +2184,8 @@
19B34CC51D3B35BB0060E272 /* SaleInputPicCollectionViewController.m */, 19B34CC51D3B35BB0060E272 /* SaleInputPicCollectionViewController.m */,
19B34CD61D3C8AF80060E272 /* GalleryViewController.h */, 19B34CD61D3C8AF80060E272 /* GalleryViewController.h */,
19B34CD71D3C8AF80060E272 /* GalleryViewController.m */, 19B34CD71D3C8AF80060E272 /* GalleryViewController.m */,
8F0419EB1D6ABEF70062800C /* SaleInputAuditViewController.h */,
8F0419EC1D6ABEF70062800C /* SaleInputAuditViewController.m */,
); );
path = Controller; path = Controller;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2175,6 +2197,11 @@ ...@@ -2175,6 +2197,11 @@
1912FCE21CCDECF8004CF976 /* PaymentTypeModel.m */, 1912FCE21CCDECF8004CF976 /* PaymentTypeModel.m */,
19B34CCA1D3C7C9E0060E272 /* AttachmentModel.h */, 19B34CCA1D3C7C9E0060E272 /* AttachmentModel.h */,
19B34CCB1D3C7C9E0060E272 /* AttachmentModel.m */, 19B34CCB1D3C7C9E0060E272 /* AttachmentModel.m */,
8FBE1E131D6ACDA2002584E5 /* SalesInputAuditListModel.h */,
8FBE1E141D6ACDA2002584E5 /* SalesInputAuditListModel.m */,
8FBE1E151D6ACDA2002584E5 /* SalesInputAuditModels.h */,
8FBE1E161D6ACDA2002584E5 /* SalesInputLines.h */,
8FBE1E171D6ACDA2002584E5 /* SalesInputLines.m */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2209,6 +2236,8 @@ ...@@ -2209,6 +2236,8 @@
19B34CD11D3C832B0060E272 /* GalleryCollectionViewCell.m */, 19B34CD11D3C832B0060E272 /* GalleryCollectionViewCell.m */,
19B34CD31D3C83D20060E272 /* SingleScrollView.h */, 19B34CD31D3C83D20060E272 /* SingleScrollView.h */,
19B34CD41D3C83D20060E272 /* SingleScrollView.m */, 19B34CD41D3C83D20060E272 /* SingleScrollView.m */,
8F0419EE1D6AC0D20062800C /* SaleInputAuditTableViewCell.h */,
8F0419EF1D6AC0D20062800C /* SaleInputAuditTableViewCell.m */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2954,6 +2983,9 @@ ...@@ -2954,6 +2983,9 @@
C1A069FC1BE105140082006F /* VankeAffairsBoard_iPhone.h */, C1A069FC1BE105140082006F /* VankeAffairsBoard_iPhone.h */,
C1A069FD1BE105140082006F /* VankeAffairsBoard_iPhone.m */, C1A069FD1BE105140082006F /* VankeAffairsBoard_iPhone.m */,
C1A069FE1BE105140082006F /* VankeAffairsBoard_iPhone.xml */, C1A069FE1BE105140082006F /* VankeAffairsBoard_iPhone.xml */,
8F8D6A4F1D6D3734001199FB /* VankeAffairsTenantBoard_iPhone.h */,
8F8D6A501D6D3734001199FB /* VankeAffairsTenantBoard_iPhone.m */,
8F8D6A521D6D3894001199FB /* VankeAffairsTenantBoard_iPhone.xml */,
); );
name = affairs; name = affairs;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3201,6 +3233,7 @@ ...@@ -3201,6 +3233,7 @@
C1D594761BB2E5B000D297FE /* img */ = { C1D594761BB2E5B000D297FE /* img */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
8FBE1E1A1D6ADF28002584E5 /* audit.png */,
C19ADE341BC6C71F00206213 /* floor-def.jpg */, C19ADE341BC6C71F00206213 /* floor-def.jpg */,
C14D6F591BB8071700210172 /* aboutme_unchecked.png */, C14D6F591BB8071700210172 /* aboutme_unchecked.png */,
C14D6F5A1BB8071700210172 /* aboutme_unchecked@2x.png */, C14D6F5A1BB8071700210172 /* aboutme_unchecked@2x.png */,
...@@ -4678,6 +4711,7 @@ ...@@ -4678,6 +4711,7 @@
C19BBC001BBE85F500831290 /* VankeServiceDashBoard_iPhone.xml in Resources */, C19BBC001BBE85F500831290 /* VankeServiceDashBoard_iPhone.xml in Resources */,
C1CF9F561BEFB1530033C35E /* PriorityTagRed.png in Resources */, C1CF9F561BEFB1530033C35E /* PriorityTagRed.png in Resources */,
C1A06A0C1BE10B080082006F /* notice@2x.png in Resources */, C1A06A0C1BE10B080082006F /* notice@2x.png in Resources */,
8F8D6A531D6D3894001199FB /* VankeAffairsTenantBoard_iPhone.xml in Resources */,
C11786471C0B3A5900DB7E4B /* money@3x.png in Resources */, C11786471C0B3A5900DB7E4B /* money@3x.png in Resources */,
C1DED3301BCEC4B40049BB2D /* business_checked@2x.png in Resources */, C1DED3301BCEC4B40049BB2D /* business_checked@2x.png in Resources */,
C14D6F571BB8041B00210172 /* homepage_logo.png in Resources */, C14D6F571BB8041B00210172 /* homepage_logo.png in Resources */,
...@@ -4826,6 +4860,7 @@ ...@@ -4826,6 +4860,7 @@
C1D595041BB42A6800D297FE /* splash1.xml in Resources */, C1D595041BB42A6800D297FE /* splash1.xml in Resources */,
C17ABD4E1BFCD48A00908573 /* VankeStatementDetailListBoard_iPhone.xml in Resources */, C17ABD4E1BFCD48A00908573 /* VankeStatementDetailListBoard_iPhone.xml in Resources */,
C1D595071BB42A6800D297FE /* splash4.xml in Resources */, C1D595071BB42A6800D297FE /* splash4.xml in Resources */,
8FBE1E1B1D6ADF28002584E5 /* audit.png in Resources */,
C14D6F751BB8098400210172 /* car.png in Resources */, C14D6F751BB8098400210172 /* car.png in Resources */,
C14D6F821BB813D300210172 /* little_down_icon@2x.png in Resources */, C14D6F821BB813D300210172 /* little_down_icon@2x.png in Resources */,
C19AC89F1C1735E600DE260E /* rejected_big@3x.png in Resources */, C19AC89F1C1735E600DE260E /* rejected_big@3x.png in Resources */,
...@@ -5049,6 +5084,7 @@ ...@@ -5049,6 +5084,7 @@
C1D599471BB44B2100D297FE /* NSObject+BeeNotification.mm in Sources */, C1D599471BB44B2100D297FE /* NSObject+BeeNotification.mm in Sources */,
C18A953B1C01E8E100429BF7 /* ICRAttachmentCellContentView.m in Sources */, C18A953B1C01E8E100429BF7 /* ICRAttachmentCellContentView.m in Sources */,
C1D5996D1BB44B2100D297FE /* Bee_Socket.m in Sources */, C1D5996D1BB44B2100D297FE /* Bee_Socket.m in Sources */,
8FBE1E191D6ACDA2002584E5 /* SalesInputLines.m in Sources */,
C1D598721BB44B2000D297FE /* BeeUIStyle+Builder.m in Sources */, C1D598721BB44B2000D297FE /* BeeUIStyle+Builder.m in Sources */,
C1D5992C1BB44B2100D297FE /* Bee_MYSQL.m in Sources */, C1D5992C1BB44B2100D297FE /* Bee_MYSQL.m in Sources */,
19000E8B1CC6215000DF8D71 /* SalesInputTableViewCell.m in Sources */, 19000E8B1CC6215000DF8D71 /* SalesInputTableViewCell.m in Sources */,
...@@ -5073,6 +5109,7 @@ ...@@ -5073,6 +5109,7 @@
C1D599201BB44B2100D297FE /* Bee_CacheProtocol.mm in Sources */, C1D599201BB44B2100D297FE /* Bee_CacheProtocol.mm in Sources */,
C1D598571BB44B2000D297FE /* UIFont+BeeExtension.m in Sources */, C1D598571BB44B2000D297FE /* UIFont+BeeExtension.m in Sources */,
C1D599331BB44B2100D297FE /* Bee_Assertion.mm in Sources */, C1D599331BB44B2100D297FE /* Bee_Assertion.mm in Sources */,
8F0419F01D6AC0D20062800C /* SaleInputAuditTableViewCell.m in Sources */,
C1CF9F2B1BEE5C690033C35E /* UISearchBar+BeeUIStyle.m in Sources */, C1CF9F2B1BEE5C690033C35E /* UISearchBar+BeeUIStyle.m in Sources */,
C1D598F71BB44B2000D297FE /* BeeUIQuery+Miscellaneous.m in Sources */, C1D598F71BB44B2000D297FE /* BeeUIQuery+Miscellaneous.m in Sources */,
C1D598A81BB44B2000D297FE /* Bee_UIPageControl.m in Sources */, C1D598A81BB44B2000D297FE /* Bee_UIPageControl.m in Sources */,
...@@ -5101,6 +5138,7 @@ ...@@ -5101,6 +5138,7 @@
C1D5987C1BB44B2000D297FE /* UITextView+BeeUIStyle.m in Sources */, C1D5987C1BB44B2000D297FE /* UITextView+BeeUIStyle.m in Sources */,
C1D599181BB44B2100D297FE /* UIScrollView+XMLParser.m in Sources */, C1D599181BB44B2100D297FE /* UIScrollView+XMLParser.m in Sources */,
190AFDAC1CF55F30002698FC /* ScrollMultipleWebView.m in Sources */, 190AFDAC1CF55F30002698FC /* ScrollMultipleWebView.m in Sources */,
8F0419ED1D6ABEF70062800C /* SaleInputAuditViewController.m in Sources */,
C16BA62A1BD3952E001ACB26 /* VankePassengerFlowAPI.m in Sources */, C16BA62A1BD3952E001ACB26 /* VankePassengerFlowAPI.m in Sources */,
C10F18131BF7ACA80065F18C /* NSMutableArray+SafeInsert.m in Sources */, C10F18131BF7ACA80065F18C /* NSMutableArray+SafeInsert.m in Sources */,
C1D5995F1BB44B2100D297FE /* Bee_HTTPResponse2.m in Sources */, C1D5995F1BB44B2100D297FE /* Bee_HTTPResponse2.m in Sources */,
...@@ -5383,6 +5421,7 @@ ...@@ -5383,6 +5421,7 @@
C1D598C91BB44B2000D297FE /* Bee_UIFootLoader.m in Sources */, C1D598C91BB44B2000D297FE /* Bee_UIFootLoader.m in Sources */,
19D76A8D1D265A1B006245D6 /* TZPhotoPickerController.m in Sources */, 19D76A8D1D265A1B006245D6 /* TZPhotoPickerController.m in Sources */,
C1D5984E1BB44B2000D297FE /* BeeMessage+BeeXML.mm in Sources */, C1D5984E1BB44B2000D297FE /* BeeMessage+BeeXML.mm in Sources */,
8F8D6A511D6D3734001199FB /* VankeAffairsTenantBoard_iPhone.m in Sources */,
19B34CE51D3CCE9F0060E272 /* StatementModel.m in Sources */, 19B34CE51D3CCE9F0060E272 /* StatementModel.m in Sources */,
C1D598A91BB44B2000D297FE /* Bee_UIPageViewController.m in Sources */, C1D598A91BB44B2000D297FE /* Bee_UIPageViewController.m in Sources */,
C1D599851BB44B2100D297FE /* CXMLDocument_PrivateExtensions.m in Sources */, C1D599851BB44B2100D297FE /* CXMLDocument_PrivateExtensions.m in Sources */,
...@@ -5397,6 +5436,7 @@ ...@@ -5397,6 +5436,7 @@
C1D5984D1BB44B2000D297FE /* BeeMessage+BeeNetwork.mm in Sources */, C1D5984D1BB44B2000D297FE /* BeeMessage+BeeNetwork.mm in Sources */,
C10F184B1BF7ACA80065F18C /* IBTUIViewController.m in Sources */, C10F184B1BF7ACA80065F18C /* IBTUIViewController.m in Sources */,
C1D599391BB44B2100D297FE /* Bee_Singleton.mm in Sources */, C1D599391BB44B2100D297FE /* Bee_Singleton.mm in Sources */,
8FBE1E181D6ACDA2002584E5 /* SalesInputAuditListModel.m in Sources */,
C1D598501BB44B2000D297FE /* Bee_Model.mm in Sources */, C1D598501BB44B2000D297FE /* Bee_Model.mm in Sources */,
C1D598EB1BB44B2000D297FE /* UIScrollView+LayoutParser.m in Sources */, C1D598EB1BB44B2000D297FE /* UIScrollView+LayoutParser.m in Sources */,
C19BBC011BBE85F500831290 /* VankeServiceSaleCell_iPhone.m in Sources */, C19BBC011BBE85F500831290 /* VankeServiceSaleCell_iPhone.m in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_audited.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_audited@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_to_audit.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_to_audit@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.4.8</string> <string>1.5.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -10,25 +10,25 @@ ...@@ -10,25 +10,25 @@
#define VankeConfig_h #define VankeConfig_h
// 当前用户信息 // 当前用户信息
#define KEY_CURRENT_USER_INFO @"VANKE_CUR_USER_INFO" static NSString *const KEY_CURRENT_USER_INFO = @"VANKE_CUR_USER_INFO";
// 当前用户密码 // 当前用户密码
#define KEY_CURRENT_USER_PWD @"VANKE_CUR_USER_PWD" static NSString *const KEY_CURRENT_USER_PWD = @"VANKE_CUR_USER_PWD";
// 百度服务AK // 百度服务AKy
#define VANKE_BAIDU_API_KEY @"442b5fb0a1dc4dcbbccd26975e180e29" static NSString *const VANKE_BAIDU_API_KEY = @"442b5fb0a1dc4dcbbccd26975e180e29";
// 百度天气服务地址 // 百度天气服务地址
#define VANKE_BAIDU_WEATHER_SERVER_URL @"http://api.map.baidu.com/telematics/v3/weather" static NSString *const VANKE_BAIDU_WEATHER_SERVER_URL = @"http://api.map.baidu.com/telematics/v3/weather";
//正式环境 //正式环境
#define VANKE_SERVER_BASE_URL @"http://140.206.62.178:8080/wanke-server/rest" //正式 static NSString *const VANKE_SERVER_BASE_URL = @"http://140.206.62.178:8080/wanke-server/rest"; //正式
//后台多媒体文件基准地址 //后台多媒体文件基准地址
#define VANKE_SERVER_MEDIA_BASE_URL @"http://140.206.62.178:8080" //正式 static NSString *const VANKE_SERVER_MEDIA_BASE_URL = @"http://140.206.62.178:8080"; //正式
// 测试环境 // 测试环境
//#define VANKE_SERVER_BASE_URL @"http://139.196.39.77:6080/wanke-server/rest" //static NSString *const VANKE_SERVER_BASE_URL = @"http://139.196.39.77:6080/wanke-server/rest";
//#define VANKE_SERVER_MEDIA_BASE_URL @"http://139.196.39.77:6080" //static NSString *const VANKE_SERVER_MEDIA_BASE_URL = @"http://139.196.39.77:6080";
// 后台服务企业认证码 // 后台服务企业认证码
#define VANKE_AUTHENTI_CODE @"211534962" #define VANKE_AUTHENTI_CODE @"211534962"
......
vanke/view_iPhone/resource/img/bill.png

3.02 KB | W: | H:

vanke/view_iPhone/resource/img/bill.png

3.21 KB | W: | H:

vanke/view_iPhone/resource/img/bill.png
vanke/view_iPhone/resource/img/bill.png
vanke/view_iPhone/resource/img/bill.png
vanke/view_iPhone/resource/img/bill.png
  • 2-up
  • Swipe
  • Onion skin
//
// VankeAffairsTenantBoard_iPhone.h
// vanke
//
// Created by Javen on 16/8/24.
// Copyright © 2016年 gomore. All rights reserved.
//
#import "Bee_UIBoard.h"
#import "UIPopoverListView.h"
@interface VankeAffairsTenantBoard_iPhone : BeeUIBoard<UIPopoverListViewDataSource, UIPopoverListViewDelegate>
AS_OUTLET( BeeUIButton, btnNotice )
AS_OUTLET( BeeUIButton, btnBill )
AS_OUTLET( BeeUIButton, btnSaleInput )
AS_OUTLET( BeeUIButton, btnServiceApply )
@end
//
// VankeAffairsTenantBoard_iPhone.m
// vanke
//
// Created by Javen on 16/8/24.
// Copyright © 2016年 gomore. All rights reserved.
//
#import "VankeAffairsTenantBoard_iPhone.h"
#import "VankeUtil.h"
#import "GEToast.h"
#import "VankeCommonModel.h"
#import "VankeAppBoard_iPhone.h"
#import "VankeNoticeListBoard_iPhone.h"
#import "VankeStatementListBoard_iPhone.h"
#import "ICRAnnouncementViewController.h"
#import "SalesInputViewController.h"
#import "StatementViewController.h"
#import "ChooseProjectTableViewController.h"
#import "ICRAppMacro.h"
@interface VankeAffairsTenantBoard_iPhone ()
{
//
NSArray *authorizedOrgs;
}
@end
@implementation VankeAffairsTenantBoard_iPhone
SUPPORT_AUTOMATIC_LAYOUT( YES )
SUPPORT_RESOURCE_LOADING( YES )
DEF_OUTLET( BeeUIButton, btnNotice )
DEF_OUTLET( BeeUIButton, btnBill )
DEF_OUTLET( BeeUIButton, btnSaleInput )
DEF_OUTLET( BeeUIButton, btnServiceApply )
- (void)load
{
}
- (void)unload
{
}
#pragma mark - Signal
ON_CREATE_VIEWS( signal )
{
self.navigationBarShown = YES;
self.navigationBarTitle = @"业务";
}
ON_DELETE_VIEWS( signal )
{
}
ON_LAYOUT_VIEWS( signal )
{
}
ON_WILL_APPEAR( signal )
{
self.navigationController.navigationBar.backgroundImage = [UIImage imageWithColor:[UIColor colorWithR:63 g:134 b:244 a:1]];
UIColor *color = [VankeUtil rgbStringToColor: @"237,27,35"];
if ( IOS7_OR_LATER ) {
self.navigationController.navigationBar.barTintColor = color;
} else {
self.navigationController.navigationBar.tintColor = color;
}
[[VankeAppBoard_iPhone sharedInstance] showMenu];
}
ON_DID_APPEAR( signal )
{
}
ON_WILL_DISAPPEAR( signal )
{
}
ON_DID_DISAPPEAR( signal )
{
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnNotice, signal) {
[[VankeAppBoard_iPhone sharedInstance] hideMenu];
VankeNoticeListBoard_iPhone *board = [VankeNoticeListBoard_iPhone board];
// ICRAnnouncementViewController *board = [ICRAnnouncementViewController board];
[self.stack pushBoard:board animated:YES];
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnBill, signal) {
VankeCommonModel *userModel = [VankeCommonModel sharedInstance];
authorizedOrgs = [userModel getAuthOrgs];
if (authorizedOrgs.count == 0) {
return;
}
else if (authorizedOrgs.count == 1) {
AuthorizedOrg *org = [authorizedOrgs objectAtIndex:0];
//跳转对账单
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Statement" bundle:nil];
StatementViewController *statementVC = [storyboard instantiateViewControllerWithIdentifier:@"StatementViewController"];
statementVC.org = org;
[self.navigationController pushViewController:statementVC animated:YES];
}
else {
CGFloat xWidth = self.view.bounds.size.width - 20.0f;
CGFloat yHeight = authorizedOrgs.count * 60 + 50;
if (yHeight > 400) {
yHeight = 400.0f;
}
CGFloat yOffset = (self.view.bounds.size.height - yHeight)/2.0f;
UIPopoverListView *poplistview = [[UIPopoverListView alloc] initWithFrame:CGRectMake(10, yOffset, xWidth, yHeight)];
poplistview.tag = 10000;
poplistview.delegate = self;
poplistview.datasource = self;
poplistview.listView.scrollEnabled = YES;
[poplistview setTitle:@"请选择查看项目"];
[poplistview show];
}
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnSaleInput, signal) {
// [GEToast showWithText:@"销售录入正在开发中..." bottomOffset:60.0f duration:1.0f];
// if ([[model getAuthOrgs] count] > 1) {
// ChooseProjectTableViewController *chooseVC = [[ChooseProjectTableViewController alloc] init];
// chooseVC.arrAuthorized = [model getAuthOrgs];
// chooseVC.chooseAuthorized = ^(AuthorizedOrg *author){
// salesVC.authorizedOrg = author;
// [weakSelf.navigationController pushViewController:salesVC animated:YES];
// };
// UINavigationController *navc = [[UINavigationController alloc] initWithRootViewController:chooseVC];
// [self.navigationController presentViewController:navc animated:YES completion:nil];
// }else{
// salesVC.authorizedOrg = [model getAuthOrgs][0];
// [self.navigationController pushViewController:salesVC animated:YES];
// }
SalesInputViewController *salesVC = [[SalesInputViewController alloc] init];
salesVC.type = SalesInputViewControllerTypeInput;
VankeCommonModel *userModel = [VankeCommonModel sharedInstance];
if ([[userModel getAuthOrgs] count] == 1) {
salesVC.authorizedOrg = [userModel getAuthOrgs][0];
[self.navigationController pushViewController:salesVC animated:YES];
}else{
authorizedOrgs = [userModel getAuthOrgs];
CGFloat xWidth = self.view.bounds.size.width - 20.0f;
CGFloat yHeight = authorizedOrgs.count * 60 + 50;
if (yHeight > 400) {
yHeight = 400.0f;
}
CGFloat yOffset = (self.view.bounds.size.height - yHeight)/2.0f;
UIPopoverListView *poplistview = [[UIPopoverListView alloc] initWithFrame:CGRectMake(10, yOffset, xWidth, yHeight)];
poplistview.tag = 10001;
poplistview.delegate = self;
poplistview.datasource = self;
poplistview.listView.scrollEnabled = YES;
[poplistview setTitle:@"请选择查看项目"];
[poplistview show];
}
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnServiceApply, signal) {
[GEToast showWithText:@"服务申请正在开发中..." bottomOffset:60.0f duration:1.0f];
}
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnBillAudit, signal) {
// [[VankeAppBoard_iPhone sharedInstance] hideMenu];
// CLog(@"销售录入审核");
// UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"SalesInPut" bundle:nil];
// SaleInputAuditViewController *auditVC = [storyBoard instantiateViewControllerWithIdentifier:@"SaleInputAuditViewController"];
// [self.navigationController pushViewController:auditVC animated:YES];
}
#pragma mark - UIPopoverListViewDataSource
- (UITableViewCell *)popoverListView:(UIPopoverListView *)popoverListView
cellForIndexPath:(NSIndexPath *)indexPath
{
static NSString *identifier = @"cell";
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:identifier];
AuthorizedOrg *org = [authorizedOrgs objectAtIndex:indexPath.row];
cell.textLabel.text = org.name;
[cell.imageView sd_setImageWithURL:[NSURL URLWithString:org.picture] placeholderImage:[UIImage imageNamed:@"bill_no_image_default"]];
return cell;
}
- (NSInteger)popoverListView:(UIPopoverListView *)popoverListView
numberOfRowsInSection:(NSInteger)section
{
return authorizedOrgs.count;
}
#pragma mark - UIPopoverListViewDelegate
- (void)popoverListView:(UIPopoverListView *)popoverListView
didSelectIndexPath:(NSIndexPath *)indexPath
{
if (popoverListView.tag == 10000) {
//跳转对账单
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Statement" bundle:nil];
StatementViewController *statementVC = [storyboard instantiateViewControllerWithIdentifier:@"StatementViewController"];
AuthorizedOrg *org = [authorizedOrgs objectAtIndex:indexPath.row];
statementVC.org = org;
[self.navigationController pushViewController:statementVC animated:YES];
}else{
SalesInputViewController *salesVC = [[SalesInputViewController alloc] init];
salesVC.authorizedOrg = [authorizedOrgs objectAtIndex:indexPath.row];
[self.navigationController pushViewController:salesVC animated:YES];
}
}
- (CGFloat)popoverListView:(UIPopoverListView *)popoverListView
heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 60.0f;
}
-(void) showStatementList: (AuthorizedOrg*) org {
if (nil == org) {
ERROR(@"Authorized Org cannot be null.");
return;
}
[[VankeAppBoard_iPhone sharedInstance] hideMenu];
VankeStatementListBoard_iPhone *board = [VankeStatementListBoard_iPhone board];
board.authorizedOrgUuidEquals = org.code;
[self.stack pushBoard:board animated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
<?xml version="1.0" encoding="UTF-8"?>
<ui namespace="VankeAffairsTenantBoard_iPhone">
<linear orientation="v" class="wrapper">
<image class="bg" />
<linear orientation="h" class="row row1">
<linear orientation="v" class="cell notice">
<button id="btnNotice" class="mask" />
<image src="notice.png" />
</linear>
<linear orientation="v" class="cell">
<button id="btnBill" class="mask" />
<image src="bill.png" />
</linear>
</linear>
<linear orientation="h" class="row row2">
<linear orientation="v" class="cell sale-input">
<button id="btnSaleInput" class="mask" />
<image src="sale_input.png" />
</linear>
<linear orientation="v" class="cell">
<button id="btnServiceApply" class="mask" />
<image src="service_apply.png" />
</linear>
</linear>
</linear>
<style type="text/css">
.wrapper {
width: 100%;
height: 100%;
margin-top: 64px;
padding: 5px;
}
.wrapper > .bg {
position: absolute;
width: 100%;
height: 100%;
background-color: #f6f6f6;
}
.wrapper > .row {
width: 100%;
height: 135px;
margin-bottom: 5px;
}
.row > .cell {
width: 50%;
height: 100%;
}
.row > .cell > .mask {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
}
.row > .cell > image {
image-mode: fill;
}
.row1 > .notice,
.row2 > .sale-input {
padding-right: 5px;
}
.row3 > .audit {
padding-right: 5px;
}
</style>
</ui>
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#import "ICRModifyPwdViewController.h" #import "ICRModifyPwdViewController.h"
#import "ReportViewController.h" #import "ReportViewController.h"
#import "ReportBoardsViewController.h" #import "ReportBoardsViewController.h"
#import "VankeAffairsTenantBoard_iPhone.h"
#pragma mark - #pragma mark -
@interface VankeAppBoard_iPhone () @interface VankeAppBoard_iPhone ()
...@@ -56,6 +57,7 @@ ON_CREATE_VIEWS( signal ) ...@@ -56,6 +57,7 @@ ON_CREATE_VIEWS( signal )
_router.view.alpha = 0.0f; _router.view.alpha = 0.0f;
[_router map:@"home" toClass:[VankeMainBoard_iPhone class]]; [_router map:@"home" toClass:[VankeMainBoard_iPhone class]];
[_router map:@"affairs" toClass:[VankeAffairsBoard_iPhone class]]; [_router map:@"affairs" toClass:[VankeAffairsBoard_iPhone class]];
[_router map:@"tenantAffairs" toClass:[VankeAffairsTenantBoard_iPhone class]];
[_router map:@"me" toClass:[ICRSystemViewController class]]; [_router map:@"me" toClass:[ICRSystemViewController class]];
[_router map:@"report" toClass:[ReportBoardsViewController class]]; [_router map:@"report" toClass:[ReportBoardsViewController class]];
[self.view addSubview:_router.view]; [self.view addSubview:_router.view];
...@@ -193,7 +195,7 @@ ON_SIGNAL3( VankeMainTabBoard_iPhone, me, signal ) ...@@ -193,7 +195,7 @@ ON_SIGNAL3( VankeMainTabBoard_iPhone, me, signal )
//商户用户 //商户用户
ON_SIGNAL3( VankeTenantTabBoard_iPhone, affairs, signal ) ON_SIGNAL3( VankeTenantTabBoard_iPhone, affairs, signal )
{ {
[_router open:@"affairs" animated:YES]; [_router open:@"tenantAffairs" animated:YES];
[_tenantTabbar selectAffairs]; [_tenantTabbar selectAffairs];
} }
......
...@@ -26,5 +26,7 @@ AS_OUTLET( BeeUIButton, btnNotice ) ...@@ -26,5 +26,7 @@ AS_OUTLET( BeeUIButton, btnNotice )
AS_OUTLET( BeeUIButton, btnBill ) AS_OUTLET( BeeUIButton, btnBill )
AS_OUTLET( BeeUIButton, btnSaleInput ) AS_OUTLET( BeeUIButton, btnSaleInput )
AS_OUTLET( BeeUIButton, btnServiceApply ) AS_OUTLET( BeeUIButton, btnServiceApply )
AS_OUTLET( BeeUIButton, btnBillAudit )
@end @end
...@@ -27,11 +27,12 @@ ...@@ -27,11 +27,12 @@
#import "StatementViewController.h" #import "StatementViewController.h"
#import "ChooseProjectTableViewController.h" #import "ChooseProjectTableViewController.h"
#import "ICRAppMacro.h" #import "ICRAppMacro.h"
#import "SaleInputAuditViewController.h"
#pragma mark - #pragma mark -
@interface VankeAffairsBoard_iPhone() @interface VankeAffairsBoard_iPhone()
{ {
//<#@private var#> //
NSArray *authorizedOrgs; NSArray *authorizedOrgs;
} }
@end @end
...@@ -45,7 +46,7 @@ DEF_OUTLET( BeeUIButton, btnNotice ) ...@@ -45,7 +46,7 @@ DEF_OUTLET( BeeUIButton, btnNotice )
DEF_OUTLET( BeeUIButton, btnBill ) DEF_OUTLET( BeeUIButton, btnBill )
DEF_OUTLET( BeeUIButton, btnSaleInput ) DEF_OUTLET( BeeUIButton, btnSaleInput )
DEF_OUTLET( BeeUIButton, btnServiceApply ) DEF_OUTLET( BeeUIButton, btnServiceApply )
DEF_OUTLET( BeeUIButton, btnBillAudit )
- (void)load - (void)load
{ {
} }
...@@ -149,6 +150,7 @@ ON_SIGNAL3(VankeAffairsBoard_iPhone, btnSaleInput, signal) { ...@@ -149,6 +150,7 @@ ON_SIGNAL3(VankeAffairsBoard_iPhone, btnSaleInput, signal) {
// [self.navigationController pushViewController:salesVC animated:YES]; // [self.navigationController pushViewController:salesVC animated:YES];
// } // }
SalesInputViewController *salesVC = [[SalesInputViewController alloc] init]; SalesInputViewController *salesVC = [[SalesInputViewController alloc] init];
salesVC.type = SalesInputViewControllerTypeInput;
VankeCommonModel *userModel = [VankeCommonModel sharedInstance]; VankeCommonModel *userModel = [VankeCommonModel sharedInstance];
if ([[userModel getAuthOrgs] count] == 1) { if ([[userModel getAuthOrgs] count] == 1) {
salesVC.authorizedOrg = [userModel getAuthOrgs][0]; salesVC.authorizedOrg = [userModel getAuthOrgs][0];
...@@ -177,6 +179,15 @@ ON_SIGNAL3(VankeAffairsBoard_iPhone, btnServiceApply, signal) { ...@@ -177,6 +179,15 @@ ON_SIGNAL3(VankeAffairsBoard_iPhone, btnServiceApply, signal) {
[GEToast showWithText:@"服务申请正在开发中..." bottomOffset:60.0f duration:1.0f]; [GEToast showWithText:@"服务申请正在开发中..." bottomOffset:60.0f duration:1.0f];
} }
ON_SIGNAL3(VankeAffairsBoard_iPhone, btnBillAudit, signal) {
[[VankeAppBoard_iPhone sharedInstance] hideMenu];
CLog(@"销售录入审核");
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"SalesInPut" bundle:nil];
SaleInputAuditViewController *auditVC = [storyBoard instantiateViewControllerWithIdentifier:@"SaleInputAuditViewController"];
[self.navigationController pushViewController:auditVC animated:YES];
}
#pragma mark - UIPopoverListViewDataSource #pragma mark - UIPopoverListViewDataSource
- (UITableViewCell *)popoverListView:(UIPopoverListView *)popoverListView - (UITableViewCell *)popoverListView:(UIPopoverListView *)popoverListView
......
...@@ -24,9 +24,18 @@ ...@@ -24,9 +24,18 @@
</linear> </linear>
<linear orientation="v" class="cell"> <linear orientation="v" class="cell">
<button id="btnBillAudit" class="mask" />
<image src="audit.png" />
</linear>
</linear>
<linear orientation="h" class="row row3">
<linear orientation="v" class="cell audit">
<button id="btnServiceApply" class="mask" /> <button id="btnServiceApply" class="mask" />
<image src="service_apply.png" /> <image src="service_apply.png" />
</linear> </linear>
</linear> </linear>
</linear> </linear>
...@@ -73,5 +82,8 @@ ...@@ -73,5 +82,8 @@
.row2 > .sale-input { .row2 > .sale-input {
padding-right: 5px; padding-right: 5px;
} }
.row3 > .audit {
padding-right: 5px;
}
</style> </style>
</ui> </ui>
...@@ -205,8 +205,8 @@ ON_SIGNAL3( VankeServiceSaleCell_iPhone, btnHistoryMask, signal ) { ...@@ -205,8 +205,8 @@ ON_SIGNAL3( VankeServiceSaleCell_iPhone, btnHistoryMask, signal ) {
ON_SIGNAL3(VankeServiceBoardCell_iPhone, mask, signal) { ON_SIGNAL3(VankeServiceBoardCell_iPhone, mask, signal) {
[[VankeAppBoard_iPhone sharedInstance] hideMenu]; // [[VankeAppBoard_iPhone sharedInstance] hideMenu];
[self showListView: CELL_TYPE_FLOOR]; // [self showListView: CELL_TYPE_FLOOR];
// VankeServiceBoardCell_iPhone *cell = (VankeServiceBoardCell_iPhone *)signal.sourceCell; // VankeServiceBoardCell_iPhone *cell = (VankeServiceBoardCell_iPhone *)signal.sourceCell;
// if ([@"昨日客流" eq:[cell name]]) { // if ([@"昨日客流" eq:[cell name]]) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#import "VankeTenantTabBoard_iPhone.h" #import "VankeTenantTabBoard_iPhone.h"
#import "VankeCommonModel.h" #import "VankeCommonModel.h"
NSString *const TENANT_TAB_NAME_AFFAIRS = @"affairs"; // affairs NSString *const TENANT_TAB_NAME_AFFAIRS = @"tenantAffairs"; // affairs
NSString *const TENANT_TAB_NAME_ME = @"me"; // me NSString *const TENANT_TAB_NAME_ME = @"me"; // me
#pragma mark - #pragma mark -
......
...@@ -8,9 +8,17 @@ ...@@ -8,9 +8,17 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, GalleryType) {
GalleryTypeHistory,
GalleryTypeAudit
};
typedef void (^closeBlock)(NSInteger);
@interface GalleryViewController : UIViewController @interface GalleryViewController : UIViewController
@property (nonatomic, strong) NSMutableArray *arrData; @property (nonatomic, strong) NSMutableArray *arrData;
@property (nonatomic, assign) NSInteger page; @property (nonatomic, assign) NSInteger page;
@property (nonatomic, assign) GalleryType type;
@property (nonatomic, strong) NSMutableArray *arrOnlineUuids;
@end @end
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
@interface GalleryViewController ()<UIScrollViewDelegate> @interface GalleryViewController ()<UIScrollViewDelegate>
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView; @property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *flowLayout; @property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *flowLayout;
@property (nonatomic, strong) NSMutableArray *arrPic;
@end @end
...@@ -23,10 +25,51 @@ ...@@ -23,10 +25,51 @@
self.flowLayout.minimumLineSpacing = 0; self.flowLayout.minimumLineSpacing = 0;
self.flowLayout.minimumInteritemSpacing = 0; self.flowLayout.minimumInteritemSpacing = 0;
self.flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; self.flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
// Do any additional setup after loading the view. switch (self.type) {
case GalleryTypeHistory: {
self.arrPic = self.arrData;
break;
}
case GalleryTypeAudit: {
UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(deletePic)];
self.navigationItem.rightBarButtonItem = rightBtn;
self.arrPic = [self.arrData mutableCopy];
[self.arrPic removeLastObject];
break;
}
}
}
- (void)deletePic {
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"确认删除这张图片?" message:nil preferredStyle:UIAlertControllerStyleAlert];
WS(weakSelf);
UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
if (weakSelf.page < weakSelf.arrOnlineUuids.count) {
[weakSelf.arrOnlineUuids removeObjectAtIndex:weakSelf.page];
}
[weakSelf.arrPic removeObjectAtIndex:weakSelf.page];
[weakSelf.arrData removeObjectAtIndex:weakSelf.page];
[weakSelf.collectionView reloadData];
weakSelf.page--;
if (self.arrPic.count == 0) {
[weakSelf.navigationController popViewControllerAnimated:YES];
}
}];
[alertVC addAction:action];
UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
[alertVC addAction:actionCancel];
[self.navigationController presentViewController:alertVC animated:YES completion:nil];
} }
- (void)viewDidLayoutSubviews { - (void)viewDidLayoutSubviews {
if (self.page < 0) {
return;
}
[self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:self.page inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:NO]; [self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:self.page inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:NO];
} }
...@@ -37,20 +80,31 @@ ...@@ -37,20 +80,31 @@
} }
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.arrData.count; return self.arrPic.count;
} }
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
GalleryCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GalleryCollectionViewCell" forIndexPath:indexPath]; GalleryCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GalleryCollectionViewCell" forIndexPath:indexPath];
AttachmentModel *model = self.arrData[indexPath.row]; // [cell setUpCellWithModel:model];
[cell setUpCellWithModel:model]; switch (self.type) {
// Configure the cell case GalleryTypeHistory: {
self.title = [NSString stringWithFormat:@"(%ld/%.0lu)", indexPath.row + 1, (unsigned long)self.arrData.count];
AttachmentModel *model = self.arrPic[indexPath.row];
[cell setUpCell:[NSString stringWithFormat:@"%@%@",VANKE_SERVER_MEDIA_BASE_URL, model.fileUrl]];
break;
}
case GalleryTypeAudit: {
[cell setUpCell:self.arrPic[indexPath.row]];
break;
}
}
self.title = [NSString stringWithFormat:@"(%ld/%.0lu)", indexPath.row + 1, (unsigned long)self.arrPic.count];
return cell; return cell;
} }
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
self.title = [NSString stringWithFormat:@"(%.0f/%.0lu)", scrollView.contentOffset.x / SCREEN_WIDTH + 1, (unsigned long)self.arrData.count]; self.title = [NSString stringWithFormat:@"(%.0f/%.0lu)", scrollView.contentOffset.x / SCREEN_WIDTH + 1, (unsigned long)self.arrPic.count];
self.page = scrollView.contentOffset.x / SCREEN_WIDTH;
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
label.tag = j - 1; label.tag = j - 1;
if (i == 0) { if (i == 0) {
label.tag = 3000 + j; label.tag = 3000 + j;
}else if(i == 1){//金额 }else if(i == 2){//金额
label.textColor = [UIColor redColor]; label.textColor = [UIColor redColor];
} }
} }
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
[self.scrollView insertSubview:labelBottom belowSubview:[self.scrollView viewWithTag:2000 + i -1]];//防止前面的别挡住 [self.scrollView insertSubview:labelBottom belowSubview:[self.scrollView viewWithTag:2000 + i -1]];//防止前面的别挡住
if (i==1) { if (i==2) {
labelBottom.textColor = [UIColor redColor]; labelBottom.textColor = [UIColor redColor];
}else{ }else{
labelBottom.textColor = [UIColor whiteColor]; labelBottom.textColor = [UIColor whiteColor];
...@@ -308,29 +308,35 @@ ...@@ -308,29 +308,35 @@
NSMutableArray *arrDate = [NSMutableArray array];//日期 NSMutableArray *arrDate = [NSMutableArray array];//日期
[arrDate addObject:@"日期"]; [arrDate addObject:@"日期"];
NSMutableArray *arrBills = [NSMutableArray array];//笔数
[arrBills addObject:@"笔数"];
NSMutableArray *arrAmount = [NSMutableArray array];//金额 NSMutableArray *arrAmount = [NSMutableArray array];//金额
[arrAmount addObject:@"金额(元)"]; [arrAmount addObject:@"金额(元)"];
// 日期金额笔数这三项是固定在前面,所以在前面先写,后面的是动态的。
weakSelf.arrRecords = dic[@"data"][@"records"]; weakSelf.arrRecords = dic[@"data"][@"records"];
NSMutableArray *payment = [NSMutableArray array]; NSMutableArray *payment = [NSMutableArray array];
for (NSDictionary *obj in dic[@"data"][@"records"]) { for (NSDictionary *obj in dic[@"data"][@"records"]) {
[arrDate addObject:obj[@"salesDate"]]; [arrDate addObject:obj[@"salesDate"]];
[arrAmount addObject:[NSString stringWithFormat:@"%.0f", [obj[@"amount"] floatValue]]]; [arrAmount addObject:[NSString stringWithFormat:@"%.0f", [obj[@"amount"] floatValue]]];
[arrBills addObject:[NSString stringWithFormat:@"%.0f", [obj[@"transactions"] floatValue]]];
NSMutableArray *arr = [NSMutableArray array]; NSMutableArray *arr = [NSMutableArray array];
for (NSDictionary *dic in obj[@"lines"]) { for (NSDictionary *dic in obj[@"payments"]) {
[arr addObject:dic]; [arr addObject:dic];
} }
[payment addObject:arr]; [payment addObject:arr];
} }
[arrData addObject:arrDate]; [arrData addObject:arrDate];
[arrData addObject:arrBills];
[arrData addObject:arrAmount]; [arrData addObject:arrAmount];
NSMutableArray *paytype = [NSMutableArray array]; NSMutableArray *paytype = [NSMutableArray array];
if (payment.count > 0) { if (payment.count > 0) {
for (NSDictionary *dic in payment[0]) { for (NSDictionary *dic in payment[0]) {
NSMutableArray *apay = [NSMutableArray array]; NSMutableArray *apay = [NSMutableArray array];
[apay addObject:dic[@"payment"]]; [apay addObject:dic[@"paymentName"]];
[paytype addObject:apay]; [paytype addObject:apay];
} }
} }
......
//
// SaleInputAuditViewController.h
// vanke
//
// Created by Javen on 16/8/22.
// Copyright © 2016年 gomore. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SaleInputAuditViewController : UIViewController
@end
//
// SaleInputAuditViewController.m
// vanke
//
// Created by Javen on 16/8/22.
// Copyright © 2016年 gomore. All rights reserved.
//
#import "SaleInputAuditViewController.h"
#import "SalesInputAuditModels.h"
#import "SaleInputAuditTableViewCell.h"
#import "MJRefresh.h"
#import "SalesInputViewController.h"
@interface SaleInputAuditViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *arrData;
@property (nonatomic, assign) NSInteger page;
@property (nonatomic, strong) MBProgressHUD *hud;
@end
@implementation SaleInputAuditViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.page = 0;
self.title = @"审批列表";
self.tableView.estimatedRowHeight = 159;
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.navigationController.navigationBar.backgroundImage = [UIImage imageWithColor:[UIColor colorWithRed:0.918 green:0.392 blue:0.004 alpha:1.000]];
WS(weakSelf);
self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
weakSelf.page++;
[weakSelf httpRequest];
}];
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
[weakSelf.arrData removeAllObjects];
weakSelf.page = 0;
weakSelf.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
[weakSelf httpRequest];
}];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.tableView.mj_header beginRefreshing];
}
- (void)httpRequest{
NSDictionary *dic = @{@"beginDateEquals":@"2016-07-10",
@"endDateEquals":[[NSDate date] yearMonthDayString],
@"pageNumber":@(self.page),
@"pageSize":@20};
WS(weakSelf);
[[ICRHTTPController sharedController] getUrl:@"salesinput/bill/query" params:dic success:^(id data) {
NSString *strData = [data JSONString];
CLog(@"%@",strData);
for (NSDictionary *dic in data[@"data"][@"records"]) {
SalesInputAuditListModel *model = [SalesInputAuditListModel modelObjectWithDictionary:dic];
[weakSelf.arrData addObject:model];
}
[self.hud hide:YES];
[weakSelf.tableView.mj_header endRefreshing];
if ([data[@"data"][@"records"] count] == 0) {
[weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
}else{
[weakSelf.tableView.mj_footer endRefreshing];
}
[weakSelf.tableView reloadData];
} failure:^(id data) {
}];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.arrData.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
SaleInputAuditTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SaleInputAuditTableViewCell" forIndexPath:indexPath];
[cell configCellWithArr:self.arrData index:indexPath];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
SalesInputViewController *saleInputVC = [[SalesInputViewController alloc] init];
saleInputVC.type = SalesInputViewControllerTypeAudit;
saleInputVC.model = self.arrData[indexPath.row];
[self.navigationController pushViewController:saleInputVC animated:YES];
}
- (NSMutableArray *)arrData {
if (!_arrData) {
_arrData = [NSMutableArray array];
}
return _arrData;
}
- (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
...@@ -103,6 +103,7 @@ static NSString * const reuseIdentifier = @"saleInputCollection"; ...@@ -103,6 +103,7 @@ static NSString * const reuseIdentifier = @"saleInputCollection";
GalleryViewController *seePicVC = [storyBoard instantiateViewControllerWithIdentifier:@"GalleryViewController"]; GalleryViewController *seePicVC = [storyBoard instantiateViewControllerWithIdentifier:@"GalleryViewController"];
seePicVC.arrData = self.dataArr; seePicVC.arrData = self.dataArr;
seePicVC.page = indexPath.row; seePicVC.page = indexPath.row;
seePicVC.type = GalleryTypeHistory;
[self.navigationController pushViewController:seePicVC animated:YES]; [self.navigationController pushViewController:seePicVC animated:YES];
} }
......
...@@ -116,8 +116,182 @@ ...@@ -116,8 +116,182 @@
</objects> </objects>
<point key="canvasLocation" x="921.5" y="461.5"/> <point key="canvasLocation" x="921.5" y="461.5"/>
</scene> </scene>
<!--Sale Input Audit View Controller-->
<scene sceneID="8SZ-ri-K4G">
<objects>
<viewController storyboardIdentifier="SaleInputAuditViewController" automaticallyAdjustsScrollViewInsets="NO" hidesBottomBarWhenPushed="YES" id="483-8y-537" customClass="SaleInputAuditViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="ywC-E1-bZU"/>
<viewControllerLayoutGuide type="bottom" id="RWB-4b-vt3"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="iFu-zr-u7G">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="159" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="yXe-5q-LD3">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<inset key="separatorInset" minX="15" minY="0.0" maxX="0.0" maxY="0.0"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="SaleInputAuditTableViewCell" rowHeight="159" id="Eja-98-pea" customClass="SaleInputAuditTableViewCell">
<rect key="frame" x="0.0" y="28" width="375" height="159"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Eja-98-pea" id="QBe-4U-xQG">
<rect key="frame" x="0.0" y="0.0" width="375" height="159"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="商铺名称:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="m8M-Jj-Pzz">
<rect key="frame" x="20" y="8" width="95" height="23"/>
<constraints>
<constraint firstAttribute="height" constant="23" id="yOj-AY-WOE"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="19"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="录入日期:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="F81-D8-CgE">
<rect key="frame" x="20" y="81" width="80" height="19.5"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="000002332340034" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hup-Du-r5k">
<rect key="frame" x="100" y="81" width="146" height="19.5"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="265-dg-klt">
<rect key="frame" x="20" y="72" width="335" height="1"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="2Ep-B0-Y4q"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YWO-KQ-c7f">
<rect key="frame" x="113" y="39" width="10" height="23"/>
<constraints>
<constraint firstAttribute="height" constant="23" id="IHo-KV-wbD"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="w0x-Sy-CwS">
<rect key="frame" x="293" y="79" width="62" height="22.5"/>
<constraints>
<constraint firstAttribute="height" constant="22.5" id="Spf-I2-0DH"/>
<constraint firstAttribute="width" constant="62" id="dER-Ys-Peg"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<inset key="titleEdgeInsets" minX="-40" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="40" minY="0.0" maxX="0.0" maxY="0.0"/>
<state key="normal" title="查看" image="right_arrow.png">
<color key="titleColor" red="0.43529411759999997" green="0.4431372549" blue="0.47450980390000003" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rEM-6P-6gP">
<rect key="frame" x="0.0" y="112.5" width="375" height="10"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="10" id="vj3-0J-xTb"/>
</constraints>
</view>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="w3c-bz-mqE">
<rect key="frame" x="292" y="0.0" width="63" height="51"/>
<constraints>
<constraint firstAttribute="width" constant="63" id="NVS-Hk-pDY"/>
<constraint firstAttribute="height" constant="51" id="XwW-U2-uKT"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="录入笔数:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7Xe-Jo-2eL">
<rect key="frame" x="20" y="39" width="80" height="23"/>
<constraints>
<constraint firstAttribute="height" constant="23" id="76t-9i-G9K"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="星巴克" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="x0w-3a-X4L">
<rect key="frame" x="113" y="8" width="57" height="23"/>
<constraints>
<constraint firstAttribute="height" constant="23" id="aEH-2O-zBx"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="19"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="w0x-Sy-CwS" secondAttribute="bottom" id="2Ad-cR-dTP"/>
<constraint firstItem="265-dg-klt" firstAttribute="leading" secondItem="QBe-4U-xQG" secondAttribute="leading" constant="20" id="4fj-IE-vgy"/>
<constraint firstAttribute="trailing" secondItem="rEM-6P-6gP" secondAttribute="trailing" id="7gY-F1-j65"/>
<constraint firstAttribute="bottom" secondItem="F81-D8-CgE" secondAttribute="bottom" constant="22" id="AAt-PE-5XG"/>
<constraint firstItem="265-dg-klt" firstAttribute="top" secondItem="7Xe-Jo-2eL" secondAttribute="bottom" constant="10.5" id="B70-HK-gvi"/>
<constraint firstAttribute="trailing" secondItem="265-dg-klt" secondAttribute="trailing" constant="20" id="DaK-zi-Zsu"/>
<constraint firstAttribute="trailing" secondItem="w3c-bz-mqE" secondAttribute="trailing" constant="20" id="Dwg-6R-m0r"/>
<constraint firstItem="x0w-3a-X4L" firstAttribute="top" secondItem="QBe-4U-xQG" secondAttribute="top" constant="8" id="E0O-4H-UwM"/>
<constraint firstItem="F81-D8-CgE" firstAttribute="leading" secondItem="7Xe-Jo-2eL" secondAttribute="leading" id="JCe-gW-Avx"/>
<constraint firstItem="hup-Du-r5k" firstAttribute="centerY" secondItem="F81-D8-CgE" secondAttribute="centerY" id="LwW-EX-xMr"/>
<constraint firstItem="m8M-Jj-Pzz" firstAttribute="leading" secondItem="QBe-4U-xQG" secondAttribute="leading" constant="20" id="N48-lY-BIz"/>
<constraint firstItem="YWO-KQ-c7f" firstAttribute="leading" secondItem="x0w-3a-X4L" secondAttribute="leading" id="NZa-aH-xDs"/>
<constraint firstItem="m8M-Jj-Pzz" firstAttribute="top" secondItem="QBe-4U-xQG" secondAttribute="top" constant="8" id="Phj-tD-Aa3"/>
<constraint firstAttribute="trailing" secondItem="w0x-Sy-CwS" secondAttribute="trailing" constant="20" id="Qxn-Hi-F1t"/>
<constraint firstItem="w0x-Sy-CwS" firstAttribute="centerY" secondItem="F81-D8-CgE" secondAttribute="centerY" id="RBo-uU-br8"/>
<constraint firstAttribute="bottom" secondItem="rEM-6P-6gP" secondAttribute="bottom" id="SCe-4K-HPf"/>
<constraint firstItem="hup-Du-r5k" firstAttribute="leading" secondItem="F81-D8-CgE" secondAttribute="trailing" id="Wd0-kd-xyl"/>
<constraint firstItem="x0w-3a-X4L" firstAttribute="leading" secondItem="m8M-Jj-Pzz" secondAttribute="trailing" constant="-2" id="Ydt-3S-enD"/>
<constraint firstItem="w0x-Sy-CwS" firstAttribute="top" secondItem="265-dg-klt" secondAttribute="bottom" id="ds7-NT-nuR"/>
<constraint firstAttribute="bottom" secondItem="265-dg-klt" secondAttribute="bottom" constant="40" id="e5V-hU-Q3g"/>
<constraint firstItem="7Xe-Jo-2eL" firstAttribute="top" secondItem="m8M-Jj-Pzz" secondAttribute="bottom" constant="8" id="fOF-a5-WrQ"/>
<constraint firstItem="YWO-KQ-c7f" firstAttribute="centerY" secondItem="7Xe-Jo-2eL" secondAttribute="centerY" id="gq2-Xs-8MA"/>
<constraint firstItem="F81-D8-CgE" firstAttribute="top" secondItem="265-dg-klt" secondAttribute="bottom" constant="8" id="lZ4-B6-C52"/>
<constraint firstItem="7Xe-Jo-2eL" firstAttribute="leading" secondItem="m8M-Jj-Pzz" secondAttribute="leading" id="qAm-qt-QfN"/>
<constraint firstItem="rEM-6P-6gP" firstAttribute="leading" secondItem="QBe-4U-xQG" secondAttribute="leading" id="vTo-Vz-JPF"/>
<constraint firstItem="w3c-bz-mqE" firstAttribute="top" secondItem="QBe-4U-xQG" secondAttribute="top" id="xd8-7S-VeF"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="2Ad-cR-dTP"/>
<exclude reference="ds7-NT-nuR"/>
</mask>
</variation>
</tableViewCellContentView>
<connections>
<outlet property="billsCount" destination="YWO-KQ-c7f" id="zS0-87-osf"/>
<outlet property="date" destination="hup-Du-r5k" id="GkO-Jt-DGP"/>
<outlet property="shopName" destination="x0w-3a-X4L" id="f9A-Xa-4i1"/>
<outlet property="statePic" destination="w3c-bz-mqE" id="fmd-ST-v7i"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="483-8y-537" id="lwI-Dt-gbn"/>
<outlet property="delegate" destination="483-8y-537" id="9V4-91-J2g"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="RWB-4b-vt3" firstAttribute="top" secondItem="yXe-5q-LD3" secondAttribute="bottom" id="8sl-7w-r2H"/>
<constraint firstItem="yXe-5q-LD3" firstAttribute="leading" secondItem="iFu-zr-u7G" secondAttribute="leading" id="O1F-Mj-iVf"/>
<constraint firstItem="yXe-5q-LD3" firstAttribute="top" secondItem="ywC-E1-bZU" secondAttribute="bottom" id="Qh2-fN-AqN"/>
<constraint firstAttribute="trailing" secondItem="yXe-5q-LD3" secondAttribute="trailing" id="gsD-tP-QAn"/>
</constraints>
</view>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<connections>
<outlet property="tableView" destination="yXe-5q-LD3" id="Tcx-0R-zvx"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="YWS-oY-UQw" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="424.5" y="3288.5"/>
</scene>
</scenes> </scenes>
<resources> <resources>
<image name="SystemImage.png" width="320" height="147"/> <image name="SystemImage.png" width="320" height="147"/>
<image name="right_arrow.png" width="32" height="32"/>
</resources> </resources>
</document> </document>
...@@ -9,9 +9,16 @@ ...@@ -9,9 +9,16 @@
#import "IBTUIViewController.h" #import "IBTUIViewController.h"
#import "VankeShopModel.h" #import "VankeShopModel.h"
#import "VankeCommonModel.h" #import "VankeCommonModel.h"
#import "SalesInputAuditModels.h"
typedef NS_ENUM(NSInteger, SalesInputViewControllerType) {
SalesInputViewControllerTypeInput,
SalesInputViewControllerTypeAudit,
};
@interface SalesInputViewController : UIViewController @interface SalesInputViewController : UIViewController
@property (nonatomic, strong) VankeShopModel *shop; @property (nonatomic, strong) VankeShopModel *shop;
@property (nonatomic, strong) AuthorizedOrg *authorizedOrg; @property (nonatomic, strong) AuthorizedOrg *authorizedOrg;
@property (nonatomic, assign) SalesInputViewControllerType type;
@property (nonatomic, strong) SalesInputAuditListModel *model;
@property (nonatomic, assign) BOOL isReadOnly;
@end @end
...@@ -26,11 +26,14 @@ ...@@ -26,11 +26,14 @@
#import "UIImage+Helper.h" #import "UIImage+Helper.h"
#import "NSDate+FormatterAdditions.h" #import "NSDate+FormatterAdditions.h"
#import "CalculateHelper.h" #import "CalculateHelper.h"
#import "AttachmentModel.h"
#import "GalleryViewController.h"
#define kCellCount 20 #define kCellCount 20
#define kCellID @"SalesInputTableViewCell.h" #define kCellID @"SalesInputTableViewCell.h"
#define kPicCellId @"SaleInputPictureTableViewCell.h" #define kPicCellId @"SaleInputPictureTableViewCell.h"
#define kAutoValue(value) (float)value / 375 * self.view.frame.size.width #define kAutoValue(value) (float)value / 375 * self.view.frame.size.width
static NSInteger const MaxPicNum = 5;
@interface SalesInputViewController ()<UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> @interface SalesInputViewController ()<UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
...@@ -45,6 +48,8 @@ ...@@ -45,6 +48,8 @@
@property (nonatomic, copy) NSString *todayTotalAmount; @property (nonatomic, copy) NSString *todayTotalAmount;
@property (nonatomic, strong) NSMutableArray *arrPics; @property (nonatomic, strong) NSMutableArray *arrPics;
@property (nonatomic, strong) NSMutableArray *selectedAssets; @property (nonatomic, strong) NSMutableArray *selectedAssets;
@property (nonatomic, strong) NSMutableArray *arrOnlineUuids;
@end @end
@implementation SalesInputViewController @implementation SalesInputViewController
...@@ -54,41 +59,87 @@ static NSInteger const TOP_HEIGHT = 145; ...@@ -54,41 +59,87 @@ static NSInteger const TOP_HEIGHT = 145;
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.arrOnlineUuids = [self.model.attachments mutableCopy];
self.cellDataDic = [NSMutableDictionary dictionary]; self.cellDataDic = [NSMutableDictionary dictionary];
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
self.isReadOnly = [self.model.state isEqualToString:@"approved"];
[self setUpNavigationBar]; [self setUpNavigationBar];
[self setUpTopView]; [self setUpTopView];
[self setUpTableView]; [self setUpTableView];
[self setUpTotalView]; [self setUpTotalView];
[self setUpCommitView]; [self setUpCommitView];
switch (self.type) {
case SalesInputViewControllerTypeInput: {
self.navigationItem.title = @"销售录入";
UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithTitle:@"历史查询" style:UIBarButtonItemStyleDone target:self action:@selector(goToHistory)];
rightBtn.tintColor = [UIColor whiteColor];
self.navigationItem.rightBarButtonItem = rightBtn;
[self setUpData]; [self setUpData];
// Do any additional setup after loading the view. [self.submitView.buttonCommit addTarget:self action:@selector(submit) forControlEvents:UIControlEventTouchUpInside];
break;
}
case SalesInputViewControllerTypeAudit: {
self.navigationItem.title = @"销售录入审批";
[self.submitView.buttonCommit addTarget:self action:@selector(audit) forControlEvents:UIControlEventTouchUpInside];
[self.submitView.buttonCommit setTitle:@"审批通过" forState:UIControlStateNormal];
[self configWithAuditModel];
[self httpGetAttachments];
break;
}
}
}
- (void)configWithAuditModel{
[self.topView setShopName:[NSString stringWithFormat:@"%@", self.model.shopName]];
self.topView.textfieldDate.enabled = NO;
self.topView.textfieldDate.text = self.model.salesDate;
self.totalView.textFieldBillCount.text = [NSString stringWithFormat:@"%.0f",self.model.transactions];
self.totalView.labelTotal.text = [NSString stringWithFormat:@"%.0f",self.model.amount];
for (SalesInputLines *line in self.model.lines) {
PaymentTypeModel *payType = [[PaymentTypeModel alloc] init];
payType.name = line.payment;
[self.arrPaymentType addObject:payType];
}
if (self.isReadOnly) {
[self.submitView.buttonCommit setTitle:@"已审核" forState:UIControlStateNormal];
[self.submitView.buttonCommit setBackgroundColor:[UIColor darkGrayColor]];
self.submitView.buttonCommit.enabled = NO;
self.totalView.textFieldBillCount.userInteractionEnabled = NO;
}
[self.tableView reloadData];
} }
- (void)setUpCommitView { - (void)setUpCommitView {
self.submitView = [self viewWithNibName:@"SalesInputCommitView"]; self.submitView = [self viewWithNibName:@"SalesInputCommitView"];
self.submitView.frame = CGRectMake(0, SCREEN_HEIGHT - 70 - 64, SCREEN_WIDTH, 70 + 64); self.submitView.frame = CGRectMake(0, SCREEN_HEIGHT - 70 - 64, SCREEN_WIDTH, 70 + 64);
[self.submitView.buttonCommit addTarget:self action:@selector(submit) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.submitView]; [self.view addSubview:self.submitView];
} }
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[self getTodayTotalAmount];
[[VankeAppBoard_iPhone sharedInstance] hideMenu]; [[VankeAppBoard_iPhone sharedInstance] hideMenu];
switch (self.type) {
case SalesInputViewControllerTypeInput: {
if (self.shop == nil) { if (self.shop == nil) {
[self.topView setShopName:@"请选择店铺"]; [self.topView setShopName:@"请选择店铺"];
}else{ }else{
[self.topView setShopName:[NSString stringWithFormat:@"%@【%@】", self.shop.name, self.shop.code]]; [self.topView setShopName:[NSString stringWithFormat:@"%@", self.shop.name]];
}
break;
}
case SalesInputViewControllerTypeAudit: {
[self.tableView reloadData];
break;
}
} }
[self getTodayTotalAmount];
} }
ON_WILL_APPEAR( signal ) ON_WILL_APPEAR( signal )
...@@ -98,6 +149,10 @@ ON_WILL_APPEAR( signal ) ...@@ -98,6 +149,10 @@ ON_WILL_APPEAR( signal )
- (void)setUpTableView { - (void)setUpTableView {
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, TOP_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT - self.topView.bottom - 70) style:UITableViewStylePlain]; self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, TOP_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT - self.topView.bottom - 70) style:UITableViewStylePlain];
if (self.type == SalesInputViewControllerTypeAudit) {
self.tableView.top = TOP_HEIGHT - 45;
[self.topView hideBottom];
}
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
...@@ -145,26 +200,46 @@ ON_WILL_APPEAR( signal ) ...@@ -145,26 +200,46 @@ ON_WILL_APPEAR( signal )
[weakSelf.cellDataDic setObject:dataArr forKey:indexPath]; [weakSelf.cellDataDic setObject:dataArr forKey:indexPath];
[weakSelf countTotalMonney]; [weakSelf countTotalMonney];
}; };
cell.userInteractionEnabled = !self.isReadOnly;
return cell; return cell;
}else{ }else{
SaleInputPictureTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kPicCellId forIndexPath:indexPath]; SaleInputPictureTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kPicCellId forIndexPath:indexPath];
cell.userInteractionEnabled = !self.isReadOnly;
[cell setUpCellWithPictureArr:self.arrPics indexPath:indexPath]; [cell setUpCellWithPictureArr:self.arrPics indexPath:indexPath];
cell.addPicBlock = ^(NSInteger tag){ cell.addPicBlock = ^(NSInteger tag){
[self pushImagePickerController]; [self pushImagePickerController];
}; };
cell.seePicBlock = ^(NSInteger tag){ cell.seePicBlock = ^(NSInteger tag){
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithSelectedAssets:_selectedAssets selectedPhotos:_arrPics index:tag]; UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"SalesInPut" bundle:nil];
imagePickerVc.allowPickingOriginalPhoto = NO; GalleryViewController *galleryVC = [storyBoard instantiateViewControllerWithIdentifier:@"GalleryViewController"];
imagePickerVc.isSelectOriginalPhoto = NO; galleryVC.arrData = self.arrPics;
[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) { galleryVC.page = tag;
_selectedAssets = [NSMutableArray arrayWithArray:assets]; galleryVC.type = GalleryTypeAudit;
_arrPics = [NSMutableArray arrayWithArray:photos]; galleryVC.arrOnlineUuids = self.arrOnlineUuids;
[self.tableView reloadData]; [self.navigationController pushViewController:galleryVC animated:YES];
};
WS(weakSelf);
cell.deleteBolock = ^(NSInteger tag){
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"确认删除这张图片?" message:nil preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[weakSelf.arrPics removeObjectAtIndex:tag];
if (tag < weakSelf.arrOnlineUuids.count) {
[weakSelf.arrOnlineUuids removeObjectAtIndex:tag];
}
[weakSelf.tableView reloadData];
}]; }];
[self presentViewController:imagePickerVc animated:YES completion:nil]; [alertVC addAction:action];
UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
[alertVC addAction:actionCancel];
[weakSelf.navigationController presentViewController:alertVC animated:YES completion:nil];
}; };
return cell; return cell;
} }
...@@ -173,18 +248,30 @@ ON_WILL_APPEAR( signal ) ...@@ -173,18 +248,30 @@ ON_WILL_APPEAR( signal )
#pragma mark - TZImagePickerController #pragma mark - TZImagePickerController
- (void)pushImagePickerController { - (void)pushImagePickerController {
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:5 delegate:nil]; NSInteger allowSelectNumber = MaxPicNum - (self.arrPics.count - 1);
if (allowSelectNumber <= 0) {
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"提示" message:[NSString stringWithFormat:@"最多只能选择%ld张图片",MaxPicNum] preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleCancel handler:nil];
[alertVC addAction:action];
[self.navigationController presentViewController:alertVC animated:YES completion:nil];
return;
}
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:allowSelectNumber delegate:nil];
#pragma mark - 四类个性化设置,这些参数都可以不传,此时会走默认设置 #pragma mark - 四类个性化设置,这些参数都可以不传,此时会走默认设置
imagePickerVc.isSelectOriginalPhoto = NO; imagePickerVc.isSelectOriginalPhoto = NO;
imagePickerVc.selectedAssets = _selectedAssets; // optional, 可选的 // imagePickerVc.selectedAssets = _selectedAssets; // optional, 可选的
imagePickerVc.navigationBar.barTintColor = kMainOrangeColor; imagePickerVc.navigationBar.barTintColor = kMainOrangeColor;
imagePickerVc.oKButtonTitleColorNormal = kMainOrangeColor; imagePickerVc.oKButtonTitleColorNormal = kMainOrangeColor;
imagePickerVc.allowPickingOriginalPhoto = NO; imagePickerVc.allowPickingOriginalPhoto = NO;
[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) { [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
_selectedAssets = [NSMutableArray arrayWithArray:assets];
_arrPics = [NSMutableArray arrayWithArray:photos]; //把选择中的图片加入数组
[_arrPics addObject:[UIImage imageNamed:@"add-photo_icon"]]; for (id obj in photos) {
[self addPic:obj];
}
[self.tableView reloadData]; [self.tableView reloadData];
}]; }];
...@@ -203,13 +290,8 @@ ON_WILL_APPEAR( signal ) ...@@ -203,13 +290,8 @@ ON_WILL_APPEAR( signal )
} }
- (void)setUpNavigationBar { - (void)setUpNavigationBar {
self.navigationItem.title = @"销售录入";
self.navigationController.navigationBar.backgroundImage = [UIImage imageWithColor:[UIColor colorWithRed:0.918 green:0.392 blue:0.004 alpha:1.000]]; self.navigationController.navigationBar.backgroundImage = [UIImage imageWithColor:[UIColor colorWithRed:0.918 green:0.392 blue:0.004 alpha:1.000]];
UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithTitle:@"历史查询" style:UIBarButtonItemStyleDone target:self action:@selector(goToHistory)];
rightBtn.tintColor = [UIColor whiteColor];
self.navigationItem.rightBarButtonItem = rightBtn;
self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
} }
...@@ -217,6 +299,10 @@ ON_WILL_APPEAR( signal ) ...@@ -217,6 +299,10 @@ ON_WILL_APPEAR( signal )
- (void)setUpTopView { - (void)setUpTopView {
SalesInputTopView *topView = [self viewWithNibName:@"SalesInputTopView"]; SalesInputTopView *topView = [self viewWithNibName:@"SalesInputTopView"];
topView.frame = CGRectMake(0, 0, SCREEN_WIDTH, TOP_HEIGHT + 64); topView.frame = CGRectMake(0, 0, SCREEN_WIDTH, TOP_HEIGHT + 64);
if (self.type == SalesInputViewControllerTypeAudit) {
topView.frame = CGRectMake(0, 0, SCREEN_WIDTH, TOP_HEIGHT + 64 - 45);
}
self.topView = topView; self.topView = topView;
topView.textfieldDate.inputView = self.datePicker; topView.textfieldDate.inputView = self.datePicker;
topView.textfieldDate.delegate = self; topView.textfieldDate.delegate = self;
...@@ -226,7 +312,9 @@ ON_WILL_APPEAR( signal ) ...@@ -226,7 +312,9 @@ ON_WILL_APPEAR( signal )
topView.textfieldDate.text = strTime; topView.textfieldDate.text = strTime;
WS(weakSelf) WS(weakSelf)
topView.nameTapActionBlock = ^{ topView.nameTapActionBlock = ^{
if (weakSelf.type == SalesInputViewControllerTypeInput) {
[weakSelf chooseShopAction]; [weakSelf chooseShopAction];
}
}; };
[self.view addSubview:topView]; [self.view addSubview:topView];
if ([[VankeCommonModel sharedInstance] curUserIsTenant]) { if ([[VankeCommonModel sharedInstance] curUserIsTenant]) {
...@@ -346,10 +434,24 @@ ON_WILL_APPEAR( signal ) ...@@ -346,10 +434,24 @@ ON_WILL_APPEAR( signal )
- (NSArray *)getCellDataArrWithIndexPath:(NSIndexPath *)indextPath { - (NSArray *)getCellDataArrWithIndexPath:(NSIndexPath *)indextPath {
switch (self.type) {
case SalesInputViewControllerTypeInput: {
//利用字典key的唯一性,保存每个cell上的数据 //利用字典key的唯一性,保存每个cell上的数据
if (![self.cellDataDic objectForKey:indextPath]) { if (![self.cellDataDic objectForKey:indextPath]) {
[self.cellDataDic setObject:@[@""] forKey:indextPath]; [self.cellDataDic setObject:@[@""] forKey:indextPath];
} }
break;
}
case SalesInputViewControllerTypeAudit: {
if (![self.cellDataDic objectForKey:indextPath]) {
SalesInputLines *line = self.model.lines[indextPath.row];
[self.cellDataDic setObject:@[[NSString stringWithFormat:@"%.0f",line.amount]] forKey:indextPath];
}
break;
}
}
return [self.cellDataDic objectForKey:indextPath]; return [self.cellDataDic objectForKey:indextPath];
} }
...@@ -375,8 +477,8 @@ ON_WILL_APPEAR( signal ) ...@@ -375,8 +477,8 @@ ON_WILL_APPEAR( signal )
NSDateFormatter *f = [[NSDateFormatter alloc] init]; NSDateFormatter *f = [[NSDateFormatter alloc] init];
[f setDateFormat:@"yyyy-MM-dd"]; [f setDateFormat:@"yyyy-MM-dd"];
self.arrPaymentType = [NSMutableArray array]; WS(weakSelf);
WS(weakSelf) [self.arrPaymentType removeAllObjects];
[httpCtrl getUrl:@"payment/getall" params:nil success:^(id data) { [httpCtrl getUrl:@"payment/getall" params:nil success:^(id data) {
NSDictionary *dic = data; NSDictionary *dic = data;
for (NSDictionary *obj in dic[@"data"]) { for (NSDictionary *obj in dic[@"data"]) {
...@@ -391,22 +493,42 @@ ON_WILL_APPEAR( signal ) ...@@ -391,22 +493,42 @@ ON_WILL_APPEAR( signal )
} }
/** 获取已上传的附件 */
- (void)httpGetAttachments {
NSString *url = @"attachment/get_urls_by_uuids";
NSArray *attachmentUuids = self.model.attachments;
__weak typeof(self)weakSelf = self;
[[ICRHTTPController sharedController] postUrl:url params:attachmentUuids success:^(id data) {
NSDictionary *dic = data;
CLog(@"%@", dic.JSONString);
for (NSDictionary *dict in data[@"data"]) {
AttachmentModel *model = [[AttachmentModel alloc] init];
[model setValuesForKeysWithDictionary:dict];
NSString *imageUrl = [NSString stringWithFormat:@"%@%@",VANKE_SERVER_MEDIA_BASE_URL, model.fileUrl];
[weakSelf addPic:imageUrl];
}
[weakSelf.tableView reloadData];
} failure:^(id data) {
}];
}
- (void)submit { - (void)submit {
if (self.shop == nil) { if (self.shop == nil) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请选择店铺!" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请选择店铺!" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alertView show]; [alertView show];
}else{ }else{
[self httpPostAttachments]; [self httpPostAttachments];
} }
} }
- (void)httpPostAttachments { - (void)httpPostAttachments {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
ICRHTTPController *httpCtrl = [ICRHTTPController sharedController]; ICRHTTPController *httpCtrl = [ICRHTTPController sharedController];
NSString *string = [NSString stringWithFormat:@"attachment/upload_by_file?entity_type=%@&entity_uuid=%@",@"salesInput",[NSString stringWithFormat:@"%@%@",self.shop.code, self.topView.textfieldDate.text]]; NSString *string = [NSString stringWithFormat:@"attachment/upload_by_file?entity_type=%@&entity_uuid=%@",@"salesInput",[NSString stringWithFormat:@"%@%@",self.shop.code, self.topView.textfieldDate.text]];
WS(weakSelf); WS(weakSelf);
NSMutableArray *pics = [self.arrPics mutableCopy]; NSMutableArray *pics = [self.arrPics mutableCopy];
...@@ -442,7 +564,6 @@ ON_WILL_APPEAR( signal ) ...@@ -442,7 +564,6 @@ ON_WILL_APPEAR( signal )
NSMutableArray *lines = [NSMutableArray array]; NSMutableArray *lines = [NSMutableArray array];
for (int i = 0; i < self.arrPaymentType.count; i++) { for (int i = 0; i < self.arrPaymentType.count; i++) {
// NSString *bill = [self.cellDataDic objectForKey:[NSIndexPath indexPathForRow:i inSection:0]][1];
NSString *amount = [self.cellDataDic objectForKey:[NSIndexPath indexPathForRow:i inSection:0]][0]; NSString *amount = [self.cellDataDic objectForKey:[NSIndexPath indexPathForRow:i inSection:0]][0];
NSString *filter = amount.length > 0 ? amount : @"0"; NSString *filter = amount.length > 0 ? amount : @"0";
PaymentTypeModel *model = self.arrPaymentType[i]; PaymentTypeModel *model = self.arrPaymentType[i];
...@@ -473,7 +594,89 @@ ON_WILL_APPEAR( signal ) ...@@ -473,7 +594,89 @@ ON_WILL_APPEAR( signal )
@"lines" : lines}; @"lines" : lines};
} }
return myDictionary; NSMutableDictionary *dic = [myDictionary mutableCopy];
if (self.type == SalesInputViewControllerTypeAudit) {
[dic setObject:self.model.uuid forKey:@"uuid"];
}
return dic;
}
/** 审批通过 */
- (void)audit {
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"确认审核通过?" message:nil preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
//----------------------
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
ICRHTTPController *httpCtrl = [ICRHTTPController sharedController];
NSString *string = [NSString stringWithFormat:@"attachment/upload_by_file?entity_type=%@&entity_uuid=%@",@"salesInput",self.model.attachmentUuid];
WS(weakSelf);
NSMutableArray *postPic = [NSMutableArray array];
for (id obj in self.arrPics) {
if ([obj isKindOfClass:[UIImage class]]) {
[postPic addObject:obj];
}
}
[postPic removeLastObject];
NSMutableArray *uuids = [self.arrOnlineUuids mutableCopy];
[httpCtrl POST:string pictures:postPic param:nil complete:^(id responseObject, NSError *error) {
for (NSDictionary *data in responseObject[@"data"]) {
[uuids addObject:data[@"uuid"]];
}
NSString *url = [NSString stringWithFormat:@"salesinput/approve?time=%@&operId=%@&operName=%@",
[[NSDate date] httpParameterString],
[[[VankeCommonModel sharedInstance] getLoginInfo] user_uuid],
[[[VankeCommonModel sharedInstance] getLoginInfo] user_name]];
NSString *utf8String = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSMutableArray *lines = [NSMutableArray array];
for (int i = 0; i < self.model.lines.count; i++) {
NSString *amount = [self.cellDataDic objectForKey:[NSIndexPath indexPathForRow:i inSection:0]][0];
NSString *filter = amount.length > 0 ? amount : @"0";
SalesInputLines *aLine = self.model.lines[i];
NSDictionary *pay = @{@"payment" : aLine.payment,
@"sortNumber" : [NSNumber numberWithDouble:aLine.sortNumber],
@"transactions" : @"0",
@"amount" : [NSDecimalNumber decimalNumberWithString:filter]};
[lines addObject:pay];
}
NSDictionary *myDictionary = @{@"projectId" : self.model.projectId,
@"shopCode" : self.model.shopCode,
@"shopName" : self.model.shopName,
@"salesDate" : self.topView.textfieldDate.text,
@"attachments" : uuids,
@"transactions":self.totalView.textFieldBillCount.text,
@"attachmentUuid" : self.model.attachmentUuid ? self.model.attachmentUuid : [NSNull null],
@"lines" : lines,
@"uuid":self.model.uuid};
[httpCtrl postUrl:utf8String params:myDictionary success:^(id data) {
[hud hide:YES];
[weakSelf.navigationController popViewControllerAnimated:YES];
} failure:^(id data) {
}];
}];
//----------------------
}];
[alertVC addAction:action];
UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];
[alertVC addAction:actionCancel];
[self.navigationController presentViewController:alertVC animated:YES completion:nil];
} }
- (NSMutableArray *)arrPics { - (NSMutableArray *)arrPics {
...@@ -488,8 +691,15 @@ ON_WILL_APPEAR( signal ) ...@@ -488,8 +691,15 @@ ON_WILL_APPEAR( signal )
return _arrPics; return _arrPics;
} }
- (NSMutableArray *)arrPaymentType {
if (!_arrPaymentType) {
_arrPaymentType = [NSMutableArray array];
}
return _arrPaymentType;
}
/** 添加选择的照片 */ /** 添加选择的照片 */
- (void)addPic:(UIImage *)image { - (void)addPic:(id)image {
[self.arrPics insertObject:image atIndex:self.arrPics.count - 1]; [self.arrPics insertObject:image atIndex:self.arrPics.count - 1];
} }
......
...@@ -16,4 +16,7 @@ ...@@ -16,4 +16,7 @@
@property (nonatomic, copy) NSString *fileName; @property (nonatomic, copy) NSString *fileName;
@property (nonatomic, strong) UIImage *image;
@end @end
//
// SalesInputAuditListModel.h
//
// Created by 杰 张 on 16/8/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SalesInputAuditListModel : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) double amount;
@property (nonatomic, strong) NSArray *lines;
@property (nonatomic, strong) NSString *salesDate;
@property (nonatomic, strong) NSString *attachmentUuid;
@property (nonatomic, strong) NSString *uuid;
@property (nonatomic, strong) NSString *shopName;
@property (nonatomic, assign) double transactions;
@property (nonatomic, strong) NSString *shopCode;
@property (nonatomic, strong) NSArray *attachments;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) NSString *projectId;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// SalesInputAuditListModel.m
//
// Created by 杰 张 on 16/8/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "SalesInputAuditListModel.h"
#import "SalesInputLines.h"
NSString *const kSalesInputAuditListModelAmount = @"amount";
NSString *const kSalesInputAuditListModelLines = @"lines";
NSString *const kSalesInputAuditListModelSalesDate = @"salesDate";
NSString *const kSalesInputAuditListModelAttachmentUuid = @"attachmentUuid";
NSString *const kSalesInputAuditListModelUuid = @"uuid";
NSString *const kSalesInputAuditListModelShopName = @"shopName";
NSString *const kSalesInputAuditListModelTransactions = @"transactions";
NSString *const kSalesInputAuditListModelShopCode = @"shopCode";
NSString *const kSalesInputAuditListModelAttachments = @"attachments";
NSString *const kSalesInputAuditListModelState = @"state";
NSString *const kSalesInputAuditListModelProjectId = @"projectId";
@interface SalesInputAuditListModel ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation SalesInputAuditListModel
@synthesize amount = _amount;
@synthesize lines = _lines;
@synthesize salesDate = _salesDate;
@synthesize attachmentUuid = _attachmentUuid;
@synthesize uuid = _uuid;
@synthesize shopName = _shopName;
@synthesize transactions = _transactions;
@synthesize shopCode = _shopCode;
@synthesize attachments = _attachments;
@synthesize state = _state;
@synthesize projectId = _projectId;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.amount = [[self objectOrNilForKey:kSalesInputAuditListModelAmount fromDictionary:dict] doubleValue];
NSObject *receivedSalesInputLines = [dict objectForKey:kSalesInputAuditListModelLines];
NSMutableArray *parsedSalesInputLines = [NSMutableArray array];
if ([receivedSalesInputLines isKindOfClass:[NSArray class]]) {
for (NSDictionary *item in (NSArray *)receivedSalesInputLines) {
if ([item isKindOfClass:[NSDictionary class]]) {
[parsedSalesInputLines addObject:[SalesInputLines modelObjectWithDictionary:item]];
}
}
} else if ([receivedSalesInputLines isKindOfClass:[NSDictionary class]]) {
[parsedSalesInputLines addObject:[SalesInputLines modelObjectWithDictionary:(NSDictionary *)receivedSalesInputLines]];
}
self.lines = [NSArray arrayWithArray:parsedSalesInputLines];
self.salesDate = [self objectOrNilForKey:kSalesInputAuditListModelSalesDate fromDictionary:dict];
self.attachmentUuid = [self objectOrNilForKey:kSalesInputAuditListModelAttachmentUuid fromDictionary:dict];
self.uuid = [self objectOrNilForKey:kSalesInputAuditListModelUuid fromDictionary:dict];
self.shopName = [self objectOrNilForKey:kSalesInputAuditListModelShopName fromDictionary:dict];
self.transactions = [[self objectOrNilForKey:kSalesInputAuditListModelTransactions fromDictionary:dict] doubleValue];
self.shopCode = [self objectOrNilForKey:kSalesInputAuditListModelShopCode fromDictionary:dict];
self.attachments = [self objectOrNilForKey:kSalesInputAuditListModelAttachments fromDictionary:dict];
self.state = [self objectOrNilForKey:kSalesInputAuditListModelState fromDictionary:dict];
self.projectId = [self objectOrNilForKey:kSalesInputAuditListModelProjectId fromDictionary:dict];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[NSNumber numberWithDouble:self.amount] forKey:kSalesInputAuditListModelAmount];
NSMutableArray *tempArrayForLines = [NSMutableArray array];
for (NSObject *subArrayObject in self.lines) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForLines addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForLines addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForLines] forKey:kSalesInputAuditListModelLines];
[mutableDict setValue:self.salesDate forKey:kSalesInputAuditListModelSalesDate];
[mutableDict setValue:self.attachmentUuid forKey:kSalesInputAuditListModelAttachmentUuid];
[mutableDict setValue:self.uuid forKey:kSalesInputAuditListModelUuid];
[mutableDict setValue:self.shopName forKey:kSalesInputAuditListModelShopName];
[mutableDict setValue:[NSNumber numberWithDouble:self.transactions] forKey:kSalesInputAuditListModelTransactions];
[mutableDict setValue:self.shopCode forKey:kSalesInputAuditListModelShopCode];
NSMutableArray *tempArrayForAttachments = [NSMutableArray array];
for (NSObject *subArrayObject in self.attachments) {
if([subArrayObject respondsToSelector:@selector(dictionaryRepresentation)]) {
// This class is a model object
[tempArrayForAttachments addObject:[subArrayObject performSelector:@selector(dictionaryRepresentation)]];
} else {
// Generic object
[tempArrayForAttachments addObject:subArrayObject];
}
}
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForAttachments] forKey:kSalesInputAuditListModelAttachments];
[mutableDict setValue:self.state forKey:kSalesInputAuditListModelState];
[mutableDict setValue:self.projectId forKey:kSalesInputAuditListModelProjectId];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.amount = [aDecoder decodeDoubleForKey:kSalesInputAuditListModelAmount];
self.lines = [aDecoder decodeObjectForKey:kSalesInputAuditListModelLines];
self.salesDate = [aDecoder decodeObjectForKey:kSalesInputAuditListModelSalesDate];
self.attachmentUuid = [aDecoder decodeObjectForKey:kSalesInputAuditListModelAttachmentUuid];
self.uuid = [aDecoder decodeObjectForKey:kSalesInputAuditListModelUuid];
self.shopName = [aDecoder decodeObjectForKey:kSalesInputAuditListModelShopName];
self.transactions = [aDecoder decodeDoubleForKey:kSalesInputAuditListModelTransactions];
self.shopCode = [aDecoder decodeObjectForKey:kSalesInputAuditListModelShopCode];
self.attachments = [aDecoder decodeObjectForKey:kSalesInputAuditListModelAttachments];
self.state = [aDecoder decodeObjectForKey:kSalesInputAuditListModelState];
self.projectId = [aDecoder decodeObjectForKey:kSalesInputAuditListModelProjectId];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeDouble:_amount forKey:kSalesInputAuditListModelAmount];
[aCoder encodeObject:_lines forKey:kSalesInputAuditListModelLines];
[aCoder encodeObject:_salesDate forKey:kSalesInputAuditListModelSalesDate];
[aCoder encodeObject:_attachmentUuid forKey:kSalesInputAuditListModelAttachmentUuid];
[aCoder encodeObject:_uuid forKey:kSalesInputAuditListModelUuid];
[aCoder encodeObject:_shopName forKey:kSalesInputAuditListModelShopName];
[aCoder encodeDouble:_transactions forKey:kSalesInputAuditListModelTransactions];
[aCoder encodeObject:_shopCode forKey:kSalesInputAuditListModelShopCode];
[aCoder encodeObject:_attachments forKey:kSalesInputAuditListModelAttachments];
[aCoder encodeObject:_state forKey:kSalesInputAuditListModelState];
[aCoder encodeObject:_projectId forKey:kSalesInputAuditListModelProjectId];
}
- (id)copyWithZone:(NSZone *)zone
{
SalesInputAuditListModel *copy = [[SalesInputAuditListModel alloc] init];
if (copy) {
copy.amount = self.amount;
copy.lines = [self.lines copyWithZone:zone];
copy.salesDate = [self.salesDate copyWithZone:zone];
copy.attachmentUuid = [self.attachmentUuid copyWithZone:zone];
copy.uuid = [self.uuid copyWithZone:zone];
copy.shopName = [self.shopName copyWithZone:zone];
copy.transactions = self.transactions;
copy.shopCode = [self.shopCode copyWithZone:zone];
copy.attachments = [self.attachments copyWithZone:zone];
copy.state = [self.state copyWithZone:zone];
copy.projectId = [self.projectId copyWithZone:zone];
}
return copy;
}
@end
//
// DataModels.h
//
// Created by 杰 张 on 16/8/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "SalesInputLines.h" #import "SalesInputAuditListModel.h"
\ No newline at end of file
//
// SalesInputLines.h
//
// Created by 杰 张 on 16/8/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SalesInputLines : NSObject <NSCoding, NSCopying>
@property (nonatomic, assign) double amount;
@property (nonatomic, strong) NSString *payment;
@property (nonatomic, assign) double sortNumber;
@property (nonatomic, assign) double transactions;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict;
- (instancetype)initWithDictionary:(NSDictionary *)dict;
- (NSDictionary *)dictionaryRepresentation;
@end
//
// SalesInputLines.m
//
// Created by 杰 张 on 16/8/22
// Copyright (c) 2016 __MyCompanyName__. All rights reserved.
//
#import "SalesInputLines.h"
NSString *const kSalesInputLinesAmount = @"amount";
NSString *const kSalesInputLinesPayment = @"payment";
NSString *const kSalesInputLinesSortNumber = @"sortNumber";
NSString *const kSalesInputLinesTransactions = @"transactions";
@interface SalesInputLines ()
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
@end
@implementation SalesInputLines
@synthesize amount = _amount;
@synthesize payment = _payment;
@synthesize sortNumber = _sortNumber;
@synthesize transactions = _transactions;
+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
return [[self alloc] initWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict
{
self = [super init];
// This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.amount = [[self objectOrNilForKey:kSalesInputLinesAmount fromDictionary:dict] doubleValue];
self.payment = [self objectOrNilForKey:kSalesInputLinesPayment fromDictionary:dict];
self.sortNumber = [[self objectOrNilForKey:kSalesInputLinesSortNumber fromDictionary:dict] doubleValue];
self.transactions = [[self objectOrNilForKey:kSalesInputLinesTransactions fromDictionary:dict] doubleValue];
}
return self;
}
- (NSDictionary *)dictionaryRepresentation
{
NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
[mutableDict setValue:[NSNumber numberWithDouble:self.amount] forKey:kSalesInputLinesAmount];
[mutableDict setValue:self.payment forKey:kSalesInputLinesPayment];
[mutableDict setValue:[NSNumber numberWithDouble:self.sortNumber] forKey:kSalesInputLinesSortNumber];
[mutableDict setValue:[NSNumber numberWithDouble:self.transactions] forKey:kSalesInputLinesTransactions];
return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
}
#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
id object = [dict objectForKey:aKey];
return [object isEqual:[NSNull null]] ? nil : object;
}
#pragma mark - NSCoding Methods
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
self.amount = [aDecoder decodeDoubleForKey:kSalesInputLinesAmount];
self.payment = [aDecoder decodeObjectForKey:kSalesInputLinesPayment];
self.sortNumber = [aDecoder decodeDoubleForKey:kSalesInputLinesSortNumber];
self.transactions = [aDecoder decodeDoubleForKey:kSalesInputLinesTransactions];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeDouble:_amount forKey:kSalesInputLinesAmount];
[aCoder encodeObject:_payment forKey:kSalesInputLinesPayment];
[aCoder encodeDouble:_sortNumber forKey:kSalesInputLinesSortNumber];
[aCoder encodeDouble:_transactions forKey:kSalesInputLinesTransactions];
}
- (id)copyWithZone:(NSZone *)zone
{
SalesInputLines *copy = [[SalesInputLines alloc] init];
if (copy) {
copy.amount = self.amount;
copy.payment = [self.payment copyWithZone:zone];
copy.sortNumber = self.sortNumber;
copy.transactions = self.transactions;
}
return copy;
}
@end
...@@ -13,5 +13,6 @@ ...@@ -13,5 +13,6 @@
@property (nonatomic, strong) UIImageView *imgView; @property (nonatomic, strong) UIImageView *imgView;
- (void)setUpCellWithModel:(AttachmentModel *)model; - (void)setUpCellWithModel:(AttachmentModel *)model;
- (void)setUpCell:(id)img;
- (void)cellWithImgName:(NSString *)imgUrl; - (void)cellWithImgName:(NSString *)imgUrl;
@end @end
...@@ -21,16 +21,33 @@ ...@@ -21,16 +21,33 @@
} }
- (void)setUpCellWithModel:(AttachmentModel *)model { - (void)setUpCellWithModel:(AttachmentModel *)model {
NSString *imageUrl; id imageUrl;
if (model.fileUrl.length < 3) { if (model.fileUrl.length < 3) {
imageUrl = @"floor-def"; imageUrl = @"floor-def";
}else if ([model.fileUrl hasPrefix:@"http://"]){
imageUrl = model.fileUrl;
}else{ }else{
imageUrl = [NSString stringWithFormat:@"%@%@",VANKE_SERVER_MEDIA_BASE_URL, model.fileUrl]; imageUrl = [NSString stringWithFormat:@"%@%@",VANKE_SERVER_MEDIA_BASE_URL, model.fileUrl];
} }
[self cellWithImgName:imageUrl]; [self cellWithImgName:imageUrl];
} }
- (void)cellWithImgName:(NSString *)imgUrl { - (void)setUpCell:(id)img {
id imageUrl;
if ([img isKindOfClass:[NSString class]]) {
if ([img hasPrefix:@"http://"]){
imageUrl = img;
}else{
imageUrl = [UIImage imageNamed:img];
}
}else if ([img isKindOfClass:[UIImage class]]){
imageUrl = img;
}
[self cellWithImgName:imageUrl];
}
- (void)cellWithImgName:(id)imgUrl {
[self.imageScrollView setImage:imgUrl placeHolder:[UIImage imageNamed:@"no_picture"]]; [self.imageScrollView setImage:imgUrl placeHolder:[UIImage imageNamed:@"no_picture"]];
} }
......
//
// SaleInputAuditTableViewCell.h
// vanke
//
// Created by Javen on 16/8/22.
// Copyright © 2016年 gomore. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SalesInputAuditModels.h"
@interface SaleInputAuditTableViewCell : UITableViewCell
/** 店铺名称 */
@property (weak, nonatomic) IBOutlet UILabel *shopName;
/** 笔数 */
@property (weak, nonatomic) IBOutlet UILabel *billsCount;
/** 录入时间 */
@property (weak, nonatomic) IBOutlet UILabel *date;
/** 状态图片 */
@property (weak, nonatomic) IBOutlet UIImageView *statePic;
@property (nonatomic, strong) SalesInputAuditListModel *model;
- (void)configCellWithArr:(NSArray *)arr index:(NSIndexPath *)indexPath;
@end
//
// SaleInputAuditTableViewCell.m
// vanke
//
// Created by Javen on 16/8/22.
// Copyright © 2016年 gomore. All rights reserved.
//
#import "SaleInputAuditTableViewCell.h"
@implementation SaleInputAuditTableViewCell
- (void)awakeFromNib {
// Initialization code
}
- (void)configCellWithArr:(NSArray *)arr index:(NSIndexPath *)indexPath {
SalesInputAuditListModel *model = arr[indexPath.row];
self.shopName.text = model.shopName;
self.billsCount.text = [NSString stringWithFormat:@"%.0f",model.transactions];
self.date.text = model.salesDate;
if ([model.state isEqualToString:@"submited"]) {
self.statePic.image = [UIImage imageNamed:@"img_to_audit"];
}else if ([model.state isEqualToString:@"approved"]){
self.statePic.image = [UIImage imageNamed:@"img_audited"];
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
...@@ -13,7 +13,8 @@ typedef void (^actionBlock)(NSInteger); ...@@ -13,7 +13,8 @@ typedef void (^actionBlock)(NSInteger);
@property (weak, nonatomic) IBOutlet UIButton *btnRight; @property (weak, nonatomic) IBOutlet UIButton *btnRight;
@property (nonatomic, copy) actionBlock addPicBlock; @property (nonatomic, copy) actionBlock addPicBlock;
@property (nonatomic, copy) actionBlock seePicBlock; @property (nonatomic, copy) actionBlock seePicBlock;
@property (nonatomic, copy) actionBlock deleteBolock;
- (void)setUpCellWithPictureArr:(NSArray *)arrPic indexPath:(NSIndexPath *)indexPath; - (void)setUpCellWithPictureArr:(NSMutableArray *)arrPic indexPath:(NSIndexPath *)indexPath;
@end @end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "SaleInputPictureTableViewCell.h" #import "SaleInputPictureTableViewCell.h"
#import "UIButton+WebCache.h"
@interface SaleInputPictureTableViewCell () @interface SaleInputPictureTableViewCell ()
@property (nonatomic, strong) NSMutableArray *arrPictures; @property (nonatomic, strong) NSMutableArray *arrPictures;
@end @end
...@@ -20,17 +20,32 @@ ...@@ -20,17 +20,32 @@
// Initialization code // Initialization code
} }
- (void)setUpCellWithPictureArr:(NSArray *)arrPic indexPath:(NSIndexPath *)indexPath { - (void)setUpCellWithPictureArr:(NSMutableArray *)arrPic indexPath:(NSIndexPath *)indexPath {
self.arrPictures = arrPic; self.arrPictures = arrPic;
[self.btnLeft setImage:arrPic[indexPath.row * 2] forState:UIControlStateNormal]; id img = arrPic[indexPath.row * 2];
if ([img isKindOfClass:[UIImage class]]) {
[self.btnLeft setImage:img forState:UIControlStateNormal];
}else if ([img isKindOfClass:[NSString class]]) {
[self.btnLeft sd_setImageWithURL:[NSURL URLWithString:img] forState:UIControlStateNormal];
}
self.btnLeft.tag = indexPath.row * 2; self.btnLeft.tag = indexPath.row * 2;
self.btnRight.hidden = YES; self.btnRight.hidden = YES;
if (indexPath.row * 2 + 1 <= arrPic.count - 1) { if (indexPath.row * 2 + 1 <= arrPic.count - 1) {
[self.btnRight setImage:arrPic[indexPath.row * 2 + 1] forState:UIControlStateNormal]; id image = arrPic[indexPath.row * 2 + 1];
if ([image isKindOfClass:[UIImage class]]) {
[self.btnRight setImage:image forState:UIControlStateNormal];
}else if ([image isKindOfClass:[NSString class]]) {
[self.btnRight sd_setImageWithURL:[NSURL URLWithString:image] forState:UIControlStateNormal];
}
self.btnRight.tag = indexPath.row * 2 + 1; self.btnRight.tag = indexPath.row * 2 + 1;
self.btnRight.hidden = NO; self.btnRight.hidden = NO;
} }
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
UILongPressGestureRecognizer *lp2 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
[self.btnLeft addGestureRecognizer:longPress];
[self.btnRight addGestureRecognizer:lp2];
[self.btnLeft addTarget:self action:@selector(actionPic:) forControlEvents:UIControlEventTouchUpInside]; [self.btnLeft addTarget:self action:@selector(actionPic:) forControlEvents:UIControlEventTouchUpInside];
[self.btnRight addTarget:self action:@selector(actionPic:) forControlEvents:UIControlEventTouchUpInside]; [self.btnRight addTarget:self action:@selector(actionPic:) forControlEvents:UIControlEventTouchUpInside];
...@@ -45,6 +60,15 @@ ...@@ -45,6 +60,15 @@
} }
} }
- (void)longPress:(UILongPressGestureRecognizer *)recognizer{
UIButton *btn = (UIButton *)recognizer.view;
if (btn.tag == self.arrPictures.count - 1) {
self.addPicBlock(0);
}else{
self.deleteBolock(btn.tag);
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated]; [super setSelected:selected animated:animated];
......
...@@ -15,7 +15,13 @@ typedef void (^tapBlock)(void); ...@@ -15,7 +15,13 @@ typedef void (^tapBlock)(void);
@property (weak, nonatomic) IBOutlet UITextField *textfieldDate; @property (weak, nonatomic) IBOutlet UITextField *textfieldDate;
@property (weak, nonatomic) IBOutlet UIButton *buttonName; @property (weak, nonatomic) IBOutlet UIButton *buttonName;
@property (weak, nonatomic) IBOutlet UITextField *textFieldTotalAmount; @property (weak, nonatomic) IBOutlet UITextField *textFieldTotalAmount;
@property (weak, nonatomic) IBOutlet UILabel *totalTitle;
@property (weak, nonatomic) IBOutlet UILabel *totalUnit;
/** 右边的两个小剪头 */
@property (weak, nonatomic) IBOutlet UIImageView *rightIcon1;
@property (weak, nonatomic) IBOutlet UIImageView *rightIcon2;
- (void)setShopName:(NSString *)name; - (void)setShopName:(NSString *)name;
- (void)setDate:(NSString *)date; - (void)setDate:(NSString *)date;
- (void)hideBottom;
@end @end
...@@ -28,6 +28,13 @@ ...@@ -28,6 +28,13 @@
- (void)awakeFromNib { - (void)awakeFromNib {
} }
- (void)hideBottom {
self.totalUnit.hidden = YES;
self.totalTitle.hidden = YES;
self.textFieldTotalAmount.hidden = YES;
self.rightIcon1.hidden = YES;
self.rightIcon2.hidden = YES;
}
- (IBAction)labelNameTapAction:(id)sender { - (IBAction)labelNameTapAction:(id)sender {
self.nameTapActionBlock(); self.nameTapActionBlock();
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="星巴克【A01-01】" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dRE-Ph-BBH"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="星巴克【A01-01】" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dRE-Ph-BBH">
<rect key="frame" x="129" y="23" width="213" height="21"/> <rect key="frame" x="129" y="23" width="213" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<action selector="labelNameTapAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="8Y1-hG-eN4"/> <action selector="labelNameTapAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="8Y1-hG-eN4"/>
</connections> </connections>
</button> </button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="2016-02-4" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="g0n-5F-LTn"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="2016-02-4" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="g0n-5F-LTn">
<rect key="frame" x="129" y="71" width="213" height="22"/> <rect key="frame" x="129" y="71" width="213" height="22"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/> <fontDescription key="fontDescription" type="system" pointSize="18"/>
...@@ -154,8 +154,12 @@ ...@@ -154,8 +154,12 @@
<connections> <connections>
<outlet property="buttonName" destination="7BV-nx-jgh" id="GzA-Vh-lYV"/> <outlet property="buttonName" destination="7BV-nx-jgh" id="GzA-Vh-lYV"/>
<outlet property="labelShopName" destination="dRE-Ph-BBH" id="KsU-if-OPN"/> <outlet property="labelShopName" destination="dRE-Ph-BBH" id="KsU-if-OPN"/>
<outlet property="rightIcon1" destination="stJ-qB-AhQ" id="BNR-sn-ta6"/>
<outlet property="rightIcon2" destination="JFd-La-Uz1" id="Jkz-nz-jue"/>
<outlet property="textFieldTotalAmount" destination="zUU-xk-nju" id="Tt8-sa-E0R"/> <outlet property="textFieldTotalAmount" destination="zUU-xk-nju" id="Tt8-sa-E0R"/>
<outlet property="textfieldDate" destination="g0n-5F-LTn" id="fXf-XI-RTH"/> <outlet property="textfieldDate" destination="g0n-5F-LTn" id="fXf-XI-RTH"/>
<outlet property="totalTitle" destination="VmV-iM-1La" id="hbd-QJ-FZK"/>
<outlet property="totalUnit" destination="Zqk-gi-ME5" id="e7Y-ja-x7k"/>
</connections> </connections>
<point key="canvasLocation" x="213.5" y="-61.5"/> <point key="canvasLocation" x="213.5" y="-61.5"/>
</view> </view>
......
...@@ -11,5 +11,5 @@ ...@@ -11,5 +11,5 @@
@interface SingleScrollView : UIScrollView @interface SingleScrollView : UIScrollView
// //
- (SingleScrollView *)initWithFrame:(CGRect)frame image:(NSString *)image; - (SingleScrollView *)initWithFrame:(CGRect)frame image:(NSString *)image;
- (void)setImage:(NSString *)image placeHolder:(UIImage *)placeHolder; - (void)setImage:(id)image placeHolder:(UIImage *)placeHolder;
@end @end
...@@ -52,15 +52,20 @@ ...@@ -52,15 +52,20 @@
[self addSubview:_imageView]; [self addSubview:_imageView];
} }
- (void)setImage:(NSString *)image placeHolder:(UIImage *)placeHolder{ - (void)setImage:(id)image placeHolder:(UIImage *)placeHolder{
//每次重新设置图片的时候设置缩放比例(场景是在做相册的时候) //每次重新设置图片的时候设置缩放比例(场景是在做相册的时候)
self.zoomScale = 1.0; self.zoomScale = 1.0;
if ([image hasPrefix:@"http://"]) { if ([image isKindOfClass:[NSString class]]) {
if ([image hasPrefix:@"http://"]){
NSURL *url = [NSURL URLWithString:image]; NSURL *url = [NSURL URLWithString:image];
[_imageView sd_setImageWithURL:url placeholderImage:placeHolder]; [_imageView sd_setImageWithURL:url placeholderImage:placeHolder];
}else{ }else{
_imageView.image=[UIImage imageNamed:image]; _imageView.image = [UIImage imageNamed:image];
} }
}else if ([image isKindOfClass:[UIImage class]]){
_imageView.image = image;
}
} }
//双击定点缩放 //双击定点缩放
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
[self setDefaults]; [self setDefaults];
[self setUpDatePicker]; [self setUpDatePicker];
self.paramModel = [[StatementListParamModel alloc] init]; self.paramModel = [[StatementListParamModel alloc] init];
self.title = @"对账单"; self.title = @"商铺对账";
self.tableView.estimatedRowHeight = 90; self.tableView.estimatedRowHeight = 90;
self.tableView.emptyDataSetSource = self; self.tableView.emptyDataSetSource = self;
self.tableView.emptyDataSetDelegate = self; self.tableView.emptyDataSetDelegate = self;
......
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