Commit 08dde6a9 authored by 曹云霄's avatar 曹云霄

新建工单接口调用

parent fd6ee8b2
...@@ -8,10 +8,15 @@ ...@@ -8,10 +8,15 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
29278C412004986800656DF1 /* TodoResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29278C402004986800656DF1 /* TodoResultModel.swift */; }; 29278C412004986800656DF1 /* TodoResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29278C402004986800656DF1 /* TodoResultModel.swift */; };
296968062007142B0049B5CC /* PublicFilterModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296968052007142B0049B5CC /* PublicFilterModel.swift */; };
29696808200728F50049B5CC /* EmptyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29696807200728F50049B5CC /* EmptyModel.swift */; };
296AAC5A1FFCB2A4008BE04C /* BaseTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AAC591FFCB2A4008BE04C /* BaseTableViewController.swift */; }; 296AAC5A1FFCB2A4008BE04C /* BaseTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AAC591FFCB2A4008BE04C /* BaseTableViewController.swift */; };
296AAC9D1FFDF533008BE04C /* SearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AAC991FFDF532008BE04C /* SearchViewController.swift */; }; 296AAC9D1FFDF533008BE04C /* FilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AAC991FFDF532008BE04C /* FilterViewController.swift */; };
296AAC9F1FFDF54A008BE04C /* SearchTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AAC9E1FFDF54A008BE04C /* SearchTableViewCell.swift */; }; 296AAC9F1FFDF54A008BE04C /* FilterTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AAC9E1FFDF54A008BE04C /* FilterTableViewCell.swift */; };
296AACB31FFE31FC008BE04C /* SearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AACB21FFE31FC008BE04C /* SearchViewModel.swift */; }; 296AACB31FFE31FC008BE04C /* FilterViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296AACB21FFE31FC008BE04C /* FilterViewModel.swift */; };
296DAD7C2006F63B00615A2D /* ProjectSponsorsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296DAD7B2006F63B00615A2D /* ProjectSponsorsModel.swift */; };
296DAD7E2006FBEB00615A2D /* RepairOrderAddViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296DAD7D2006FBEB00615A2D /* RepairOrderAddViewModel.swift */; };
296DAD82200711CA00615A2D /* InitiatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296DAD81200711CA00615A2D /* InitiatorModel.swift */; };
296FE4391FFB1DB300810820 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 296FE4381FFB1DB300810820 /* Main.storyboard */; }; 296FE4391FFB1DB300810820 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 296FE4381FFB1DB300810820 /* Main.storyboard */; };
296FE43C1FFB2D1D00810820 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296FE43B1FFB2D1D00810820 /* HomeViewController.swift */; }; 296FE43C1FFB2D1D00810820 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296FE43B1FFB2D1D00810820 /* HomeViewController.swift */; };
296FE43E1FFB2D2700810820 /* Home.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 296FE43D1FFB2D2700810820 /* Home.storyboard */; }; 296FE43E1FFB2D2700810820 /* Home.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 296FE43D1FFB2D2700810820 /* Home.storyboard */; };
...@@ -66,7 +71,6 @@ ...@@ -66,7 +71,6 @@
29DA418B200475AC002762A2 /* AccountViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29DA418A200475AC002762A2 /* AccountViewModel.swift */; }; 29DA418B200475AC002762A2 /* AccountViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29DA418A200475AC002762A2 /* AccountViewModel.swift */; };
29DA418D200486D6002762A2 /* ChangePasswordTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29DA418C200486D6002762A2 /* ChangePasswordTableViewController.swift */; }; 29DA418D200486D6002762A2 /* ChangePasswordTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29DA418C200486D6002762A2 /* ChangePasswordTableViewController.swift */; };
29EA0BF81FEA3156005A6170 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 29EA0BBD1FEA3156005A6170 /* Assets.xcassets */; }; 29EA0BF81FEA3156005A6170 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 29EA0BBD1FEA3156005A6170 /* Assets.xcassets */; };
29EA0BFB1FEA3156005A6170 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 29EA0BC21FEA3156005A6170 /* Info.plist */; };
29EA0BFC1FEA3156005A6170 /* AppManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA0BC61FEA3156005A6170 /* AppManager.swift */; }; 29EA0BFC1FEA3156005A6170 /* AppManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA0BC61FEA3156005A6170 /* AppManager.swift */; };
29EA0BFD1FEA3156005A6170 /* AppStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA0BC71FEA3156005A6170 /* AppStyle.swift */; }; 29EA0BFD1FEA3156005A6170 /* AppStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA0BC71FEA3156005A6170 /* AppStyle.swift */; };
29EA0BFE1FEA3156005A6170 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA0BCA1FEA3156005A6170 /* LoginViewController.swift */; }; 29EA0BFE1FEA3156005A6170 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA0BCA1FEA3156005A6170 /* LoginViewController.swift */; };
...@@ -98,15 +102,27 @@ ...@@ -98,15 +102,27 @@
29EA0C191FEA3156005A6170 /* EmptyTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29EA0BF31FEA3156005A6170 /* EmptyTableViewCell.xib */; }; 29EA0C191FEA3156005A6170 /* EmptyTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29EA0BF31FEA3156005A6170 /* EmptyTableViewCell.xib */; };
29EA0C1B1FEA3156005A6170 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA0BF61FEA3156005A6170 /* WebViewController.swift */; }; 29EA0C1B1FEA3156005A6170 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA0BF61FEA3156005A6170 /* WebViewController.swift */; };
29EA0C1C1FEA3156005A6170 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA0BF71FEA3156005A6170 /* AppDelegate.swift */; }; 29EA0C1C1FEA3156005A6170 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29EA0BF71FEA3156005A6170 /* AppDelegate.swift */; };
29F6B8E82007452B00EE4630 /* LocationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B8E72007452B00EE4630 /* LocationModel.swift */; };
29F6B8EC2007488C00EE4630 /* DeviceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B8EB2007488C00EE4630 /* DeviceModel.swift */; };
29F6B8EE2007498A00EE4630 /* DeviceQueryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B8ED2007498A00EE4630 /* DeviceQueryModel.swift */; };
29F6B8F0200753CD00EE4630 /* SaveRepairOrderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B8EF200753CD00EE4630 /* SaveRepairOrderModel.swift */; };
29F6B8F22007577A00EE4630 /* PublicResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B8F12007577A00EE4630 /* PublicResultModel.swift */; };
29F6B8F4200772BF00EE4630 /* RepairOrderQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B8F3200772BE00EE4630 /* RepairOrderQuery.swift */; };
29F6B8F62007747900EE4630 /* RepairOrderResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B8F52007747900EE4630 /* RepairOrderResult.swift */; };
F04C5934BDBBB8EA12141331 /* Pods_IFS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35B66002AC5D38FD80592FA3 /* Pods_IFS.framework */; }; F04C5934BDBBB8EA12141331 /* Pods_IFS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35B66002AC5D38FD80592FA3 /* Pods_IFS.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
29278C402004986800656DF1 /* TodoResultModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TodoResultModel.swift; sourceTree = "<group>"; }; 29278C402004986800656DF1 /* TodoResultModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TodoResultModel.swift; sourceTree = "<group>"; };
296968052007142B0049B5CC /* PublicFilterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicFilterModel.swift; sourceTree = "<group>"; };
29696807200728F50049B5CC /* EmptyModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyModel.swift; sourceTree = "<group>"; };
296AAC591FFCB2A4008BE04C /* BaseTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTableViewController.swift; sourceTree = "<group>"; }; 296AAC591FFCB2A4008BE04C /* BaseTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTableViewController.swift; sourceTree = "<group>"; };
296AAC991FFDF532008BE04C /* SearchViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchViewController.swift; sourceTree = "<group>"; }; 296AAC991FFDF532008BE04C /* FilterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterViewController.swift; sourceTree = "<group>"; };
296AAC9E1FFDF54A008BE04C /* SearchTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchTableViewCell.swift; sourceTree = "<group>"; }; 296AAC9E1FFDF54A008BE04C /* FilterTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterTableViewCell.swift; sourceTree = "<group>"; };
296AACB21FFE31FC008BE04C /* SearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewModel.swift; sourceTree = "<group>"; }; 296AACB21FFE31FC008BE04C /* FilterViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterViewModel.swift; sourceTree = "<group>"; };
296DAD7B2006F63B00615A2D /* ProjectSponsorsModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProjectSponsorsModel.swift; sourceTree = "<group>"; };
296DAD7D2006FBEB00615A2D /* RepairOrderAddViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepairOrderAddViewModel.swift; sourceTree = "<group>"; };
296DAD81200711CA00615A2D /* InitiatorModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InitiatorModel.swift; sourceTree = "<group>"; };
296FE4381FFB1DB300810820 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; }; 296FE4381FFB1DB300810820 /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
296FE43B1FFB2D1D00810820 /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = "<group>"; }; 296FE43B1FFB2D1D00810820 /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = "<group>"; };
296FE43D1FFB2D2700810820 /* Home.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Home.storyboard; sourceTree = "<group>"; }; 296FE43D1FFB2D2700810820 /* Home.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Home.storyboard; sourceTree = "<group>"; };
...@@ -197,6 +213,13 @@ ...@@ -197,6 +213,13 @@
29EA0BF31FEA3156005A6170 /* EmptyTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EmptyTableViewCell.xib; sourceTree = "<group>"; }; 29EA0BF31FEA3156005A6170 /* EmptyTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EmptyTableViewCell.xib; sourceTree = "<group>"; };
29EA0BF61FEA3156005A6170 /* WebViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = "<group>"; }; 29EA0BF61FEA3156005A6170 /* WebViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = "<group>"; };
29EA0BF71FEA3156005A6170 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 29EA0BF71FEA3156005A6170 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
29F6B8E72007452B00EE4630 /* LocationModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationModel.swift; sourceTree = "<group>"; };
29F6B8EB2007488C00EE4630 /* DeviceModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceModel.swift; sourceTree = "<group>"; };
29F6B8ED2007498A00EE4630 /* DeviceQueryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceQueryModel.swift; sourceTree = "<group>"; };
29F6B8EF200753CD00EE4630 /* SaveRepairOrderModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SaveRepairOrderModel.swift; sourceTree = "<group>"; };
29F6B8F12007577A00EE4630 /* PublicResultModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PublicResultModel.swift; sourceTree = "<group>"; };
29F6B8F3200772BE00EE4630 /* RepairOrderQuery.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RepairOrderQuery.swift; sourceTree = "<group>"; };
29F6B8F52007747900EE4630 /* RepairOrderResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RepairOrderResult.swift; sourceTree = "<group>"; };
35B66002AC5D38FD80592FA3 /* Pods_IFS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_IFS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 35B66002AC5D38FD80592FA3 /* Pods_IFS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_IFS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A6BACB82FD689EB241DCA577 /* Pods-IFS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IFS.release.xcconfig"; path = "Pods/Target Support Files/Pods-IFS/Pods-IFS.release.xcconfig"; sourceTree = "<group>"; }; A6BACB82FD689EB241DCA577 /* Pods-IFS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IFS.release.xcconfig"; path = "Pods/Target Support Files/Pods-IFS/Pods-IFS.release.xcconfig"; sourceTree = "<group>"; };
F6BA9AE73F42B2E00206B76C /* Pods-IFS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IFS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-IFS/Pods-IFS.debug.xcconfig"; sourceTree = "<group>"; }; F6BA9AE73F42B2E00206B76C /* Pods-IFS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IFS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-IFS/Pods-IFS.debug.xcconfig"; sourceTree = "<group>"; };
...@@ -228,7 +251,7 @@ ...@@ -228,7 +251,7 @@
296AAC981FFDF532008BE04C /* Controller */ = { 296AAC981FFDF532008BE04C /* Controller */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
296AAC991FFDF532008BE04C /* SearchViewController.swift */, 296AAC991FFDF532008BE04C /* FilterViewController.swift */,
); );
path = Controller; path = Controller;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -236,6 +259,13 @@ ...@@ -236,6 +259,13 @@
296AAC9A1FFDF532008BE04C /* Model */ = { 296AAC9A1FFDF532008BE04C /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
296968052007142B0049B5CC /* PublicFilterModel.swift */,
296DAD7B2006F63B00615A2D /* ProjectSponsorsModel.swift */,
296DAD81200711CA00615A2D /* InitiatorModel.swift */,
29696807200728F50049B5CC /* EmptyModel.swift */,
29F6B8E72007452B00EE4630 /* LocationModel.swift */,
29F6B8EB2007488C00EE4630 /* DeviceModel.swift */,
29F6B8ED2007498A00EE4630 /* DeviceQueryModel.swift */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -243,7 +273,7 @@ ...@@ -243,7 +273,7 @@
296AAC9B1FFDF532008BE04C /* ViewModel */ = { 296AAC9B1FFDF532008BE04C /* ViewModel */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
296AACB21FFE31FC008BE04C /* SearchViewModel.swift */, 296AACB21FFE31FC008BE04C /* FilterViewModel.swift */,
); );
path = ViewModel; path = ViewModel;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -251,7 +281,7 @@ ...@@ -251,7 +281,7 @@
296AAC9C1FFDF532008BE04C /* View */ = { 296AAC9C1FFDF532008BE04C /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
296AAC9E1FFDF54A008BE04C /* SearchTableViewCell.swift */, 296AAC9E1FFDF54A008BE04C /* FilterTableViewCell.swift */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -377,7 +407,11 @@ ...@@ -377,7 +407,11 @@
29D530731FFF626500851F00 /* Model */ = { 29D530731FFF626500851F00 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
29F6B8F3200772BE00EE4630 /* RepairOrderQuery.swift */,
29F6B8F52007747900EE4630 /* RepairOrderResult.swift */,
29D530741FFF626500851F00 /* PhotoAttachmentModel.swift */, 29D530741FFF626500851F00 /* PhotoAttachmentModel.swift */,
29F6B8EF200753CD00EE4630 /* SaveRepairOrderModel.swift */,
29F6B8F12007577A00EE4630 /* PublicResultModel.swift */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -407,6 +441,7 @@ ...@@ -407,6 +441,7 @@
29D530781FFF626500851F00 /* ViewModel */ = { 29D530781FFF626500851F00 /* ViewModel */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
296DAD7D2006FBEB00615A2D /* RepairOrderAddViewModel.swift */,
29D530791FFF626500851F00 /* RepairOrderViewModel.swift */, 29D530791FFF626500851F00 /* RepairOrderViewModel.swift */,
29DA417120035AC3002762A2 /* ReparirChildBillViewModel.swift */, 29DA417120035AC3002762A2 /* ReparirChildBillViewModel.swift */,
); );
...@@ -852,7 +887,7 @@ ...@@ -852,7 +887,7 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 0910; LastSwiftUpdateCheck = 0910;
LastUpgradeCheck = 0910; LastUpgradeCheck = 0920;
ORGANIZATIONNAME = "上海勾芒信息科技有限公司"; ORGANIZATIONNAME = "上海勾芒信息科技有限公司";
TargetAttributes = { TargetAttributes = {
29EA0B941FEA2F9C005A6170 = { 29EA0B941FEA2F9C005A6170 = {
...@@ -886,7 +921,6 @@ ...@@ -886,7 +921,6 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
29DA417C200367F5002762A2 /* RepairOrderEditSonOrderCompleteView.xib in Resources */, 29DA417C200367F5002762A2 /* RepairOrderEditSonOrderCompleteView.xib in Resources */,
29EA0BFB1FEA3156005A6170 /* Info.plist in Resources */,
296FE4391FFB1DB300810820 /* Main.storyboard in Resources */, 296FE4391FFB1DB300810820 /* Main.storyboard in Resources */,
29DA416020031329002762A2 /* RepairOrderDetailSectionView.xib in Resources */, 29DA416020031329002762A2 /* RepairOrderDetailSectionView.xib in Resources */,
296FE4401FFB2D3400810820 /* Function.storyboard in Resources */, 296FE4401FFB2D3400810820 /* Function.storyboard in Resources */,
...@@ -1024,11 +1058,15 @@ ...@@ -1024,11 +1058,15 @@
29EA0C091FEA3156005A6170 /* Enums.swift in Sources */, 29EA0C091FEA3156005A6170 /* Enums.swift in Sources */,
29EA0C021FEA3156005A6170 /* BaseModel.swift in Sources */, 29EA0C021FEA3156005A6170 /* BaseModel.swift in Sources */,
29B0C66A1FEA382F00FF37ED /* MBProgressView.swift in Sources */, 29B0C66A1FEA382F00FF37ED /* MBProgressView.swift in Sources */,
296DAD7E2006FBEB00615A2D /* RepairOrderAddViewModel.swift in Sources */,
29EA0C0B1FEA3156005A6170 /* Public.swift in Sources */, 29EA0C0B1FEA3156005A6170 /* Public.swift in Sources */,
296AAC9F1FFDF54A008BE04C /* SearchTableViewCell.swift in Sources */, 296AAC9F1FFDF54A008BE04C /* FilterTableViewCell.swift in Sources */,
29DA416C2003419A002762A2 /* RepairOrderDetailSuspendView.swift in Sources */, 29DA416C2003419A002762A2 /* RepairOrderDetailSuspendView.swift in Sources */,
29F6B8EE2007498A00EE4630 /* DeviceQueryModel.swift in Sources */,
296968062007142B0049B5CC /* PublicFilterModel.swift in Sources */,
29DA417A200367EF002762A2 /* RepairOrderEditSonOrderCompleteView.swift in Sources */, 29DA417A200367EF002762A2 /* RepairOrderEditSonOrderCompleteView.swift in Sources */,
29D530931FFF715D00851F00 /* PhotoAttachmentViewModel.swift in Sources */, 29D530931FFF715D00851F00 /* PhotoAttachmentViewModel.swift in Sources */,
296DAD7C2006F63B00615A2D /* ProjectSponsorsModel.swift in Sources */,
29D5307E1FFF626500851F00 /* FunctionViewModel.swift in Sources */, 29D5307E1FFF626500851F00 /* FunctionViewModel.swift in Sources */,
29DA417020035610002762A2 /* RepairOrderEditSonOrderViewController.swift in Sources */, 29DA417020035610002762A2 /* RepairOrderEditSonOrderViewController.swift in Sources */,
29D530831FFF626500851F00 /* RepairOrderTableViewCell.swift in Sources */, 29D530831FFF626500851F00 /* RepairOrderTableViewCell.swift in Sources */,
...@@ -1036,7 +1074,9 @@ ...@@ -1036,7 +1074,9 @@
29EA0C0F1FEA3156005A6170 /* String+Extension.swift in Sources */, 29EA0C0F1FEA3156005A6170 /* String+Extension.swift in Sources */,
29D5307D1FFF626500851F00 /* FunctionCollectionViewCell.swift in Sources */, 29D5307D1FFF626500851F00 /* FunctionCollectionViewCell.swift in Sources */,
29DA4169200334BC002762A2 /* RepairOrderSubOrderTableViewCell.swift in Sources */, 29DA4169200334BC002762A2 /* RepairOrderSubOrderTableViewCell.swift in Sources */,
29F6B8F62007747900EE4630 /* RepairOrderResult.swift in Sources */,
29DA418B200475AC002762A2 /* AccountViewModel.swift in Sources */, 29DA418B200475AC002762A2 /* AccountViewModel.swift in Sources */,
296DAD82200711CA00615A2D /* InitiatorModel.swift in Sources */,
29EA0C011FEA3156005A6170 /* BaseColletionViewPullController.swift in Sources */, 29EA0C011FEA3156005A6170 /* BaseColletionViewPullController.swift in Sources */,
29D530801FFF626500851F00 /* RepairOrderViewController.swift in Sources */, 29D530801FFF626500851F00 /* RepairOrderViewController.swift in Sources */,
29D530911FFF6FA800851F00 /* PhotoAttachmentViewController.swift in Sources */, 29D530911FFF6FA800851F00 /* PhotoAttachmentViewController.swift in Sources */,
...@@ -1044,18 +1084,23 @@ ...@@ -1044,18 +1084,23 @@
29D5307B1FFF626500851F00 /* FunctionModel.swift in Sources */, 29D5307B1FFF626500851F00 /* FunctionModel.swift in Sources */,
29EA0C141FEA3156005A6170 /* UIViewController+Extension.swift in Sources */, 29EA0C141FEA3156005A6170 /* UIViewController+Extension.swift in Sources */,
29EA0C0E1FEA3156005A6170 /* Date+Extensions.swift in Sources */, 29EA0C0E1FEA3156005A6170 /* Date+Extensions.swift in Sources */,
29F6B8F0200753CD00EE4630 /* SaveRepairOrderModel.swift in Sources */,
29D530981FFF76DB00851F00 /* RepairAttachmentTableViewCell.swift in Sources */, 29D530981FFF76DB00851F00 /* RepairAttachmentTableViewCell.swift in Sources */,
296FE44E1FFB5D9A00810820 /* HomeTableViewCell.swift in Sources */, 296FE44E1FFB5D9A00810820 /* HomeTableViewCell.swift in Sources */,
29EA0C0C1FEA3156005A6170 /* Urls.swift in Sources */, 29EA0C0C1FEA3156005A6170 /* Urls.swift in Sources */,
29DA417820036763002762A2 /* RepairOrderChildBillDetailViewController.swift in Sources */, 29DA417820036763002762A2 /* RepairOrderChildBillDetailViewController.swift in Sources */,
29F6B8E82007452B00EE4630 /* LocationModel.swift in Sources */,
29D5307A1FFF626500851F00 /* FunctionViewController.swift in Sources */, 29D5307A1FFF626500851F00 /* FunctionViewController.swift in Sources */,
29F6B8F22007577A00EE4630 /* PublicResultModel.swift in Sources */,
29DA417E20036FDD002762A2 /* LoginResultModel.swift in Sources */, 29DA417E20036FDD002762A2 /* LoginResultModel.swift in Sources */,
29EA0C051FEA3156005A6170 /* BaseViewController.swift in Sources */, 29EA0C051FEA3156005A6170 /* BaseViewController.swift in Sources */,
29F6B8F4200772BF00EE4630 /* RepairOrderQuery.swift in Sources */,
29EA0C081FEA3156005A6170 /* ConstKey.swift in Sources */, 29EA0C081FEA3156005A6170 /* ConstKey.swift in Sources */,
296FE44A1FFB5C9600810820 /* HomeContentViewController.swift in Sources */, 296FE44A1FFB5C9600810820 /* HomeContentViewController.swift in Sources */,
29D530861FFF628A00851F00 /* TodoViewController.swift in Sources */, 29D530861FFF628A00851F00 /* TodoViewController.swift in Sources */,
29EA0BFC1FEA3156005A6170 /* AppManager.swift in Sources */, 29EA0BFC1FEA3156005A6170 /* AppManager.swift in Sources */,
29DA4180200373C3002762A2 /* LoginViewModel.swift in Sources */, 29DA4180200373C3002762A2 /* LoginViewModel.swift in Sources */,
29696808200728F50049B5CC /* EmptyModel.swift in Sources */,
296FE44C1FFB5CAB00810820 /* HomeTableViewController.swift in Sources */, 296FE44C1FFB5CAB00810820 /* HomeTableViewController.swift in Sources */,
29EA0C131FEA3156005A6170 /* UIView+Extension.swift in Sources */, 29EA0C131FEA3156005A6170 /* UIView+Extension.swift in Sources */,
29D5308A1FFF635C00851F00 /* TodoViewModel.swift in Sources */, 29D5308A1FFF635C00851F00 /* TodoViewModel.swift in Sources */,
...@@ -1065,11 +1110,12 @@ ...@@ -1065,11 +1110,12 @@
29D5307C1FFF626500851F00 /* FunctionCollectionReusableView.swift in Sources */, 29D5307C1FFF626500851F00 /* FunctionCollectionReusableView.swift in Sources */,
296FE4441FFB393C00810820 /* AccountTableViewController.swift in Sources */, 296FE4441FFB393C00810820 /* AccountTableViewController.swift in Sources */,
29DA418220045AC3002762A2 /* QueryTodoModel.swift in Sources */, 29DA418220045AC3002762A2 /* QueryTodoModel.swift in Sources */,
296AAC9D1FFDF533008BE04C /* SearchViewController.swift in Sources */, 296AAC9D1FFDF533008BE04C /* FilterViewController.swift in Sources */,
29D530881FFF62CB00851F00 /* TodoTableViewCell.swift in Sources */, 29D530881FFF62CB00851F00 /* TodoTableViewCell.swift in Sources */,
29EA0C181FEA3156005A6170 /* EmptyTableViewCell.swift in Sources */, 29EA0C181FEA3156005A6170 /* EmptyTableViewCell.swift in Sources */,
29278C412004986800656DF1 /* TodoResultModel.swift in Sources */, 29278C412004986800656DF1 /* TodoResultModel.swift in Sources */,
29DA417620035B3C002762A2 /* RepairBeforAttachmentTableViewCell.swift in Sources */, 29DA417620035B3C002762A2 /* RepairBeforAttachmentTableViewCell.swift in Sources */,
29F6B8EC2007488C00EE4630 /* DeviceModel.swift in Sources */,
29EA0C161FEA3156005A6170 /* Network.swift in Sources */, 29EA0C161FEA3156005A6170 /* Network.swift in Sources */,
29EA0C041FEA3156005A6170 /* BaseTableViewPullController.swift in Sources */, 29EA0C041FEA3156005A6170 /* BaseTableViewPullController.swift in Sources */,
296FE43C1FFB2D1D00810820 /* HomeViewController.swift in Sources */, 296FE43C1FFB2D1D00810820 /* HomeViewController.swift in Sources */,
...@@ -1077,7 +1123,7 @@ ...@@ -1077,7 +1123,7 @@
29D530951FFF724600851F00 /* PhotoAttachmentCollectionViewCell.swift in Sources */, 29D530951FFF724600851F00 /* PhotoAttachmentCollectionViewCell.swift in Sources */,
29EA0C1B1FEA3156005A6170 /* WebViewController.swift in Sources */, 29EA0C1B1FEA3156005A6170 /* WebViewController.swift in Sources */,
29EA0BFD1FEA3156005A6170 /* AppStyle.swift in Sources */, 29EA0BFD1FEA3156005A6170 /* AppStyle.swift in Sources */,
296AACB31FFE31FC008BE04C /* SearchViewModel.swift in Sources */, 296AACB31FFE31FC008BE04C /* FilterViewModel.swift in Sources */,
29EA0C071FEA3156005A6170 /* UIImage+Category.m in Sources */, 29EA0C071FEA3156005A6170 /* UIImage+Category.m in Sources */,
29DA418D200486D6002762A2 /* ChangePasswordTableViewController.swift in Sources */, 29DA418D200486D6002762A2 /* ChangePasswordTableViewController.swift in Sources */,
); );
......
...@@ -18,7 +18,6 @@ class BaseTableViewPullController: BaseViewController { ...@@ -18,7 +18,6 @@ class BaseTableViewPullController: BaseViewController {
/// 分页下标 /// 分页下标
final var pullPageIndex: Int = kONE final var pullPageIndex: Int = kONE
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -47,7 +46,6 @@ class BaseTableViewPullController: BaseViewController { ...@@ -47,7 +46,6 @@ class BaseTableViewPullController: BaseViewController {
let header = MJRefreshNormalHeader(refreshingTarget: self, refreshingAction: #selector(BaseTableViewPullController.loadTableViewHeader)) let header = MJRefreshNormalHeader(refreshingTarget: self, refreshingAction: #selector(BaseTableViewPullController.loadTableViewHeader))
header?.lastUpdatedTimeLabel.isHidden = true header?.lastUpdatedTimeLabel.isHidden = true
header?.stateLabel.isHidden = true header?.stateLabel.isHidden = true
header?.stateLabel.textColor = kNavColor
header?.beginRefreshing() header?.beginRefreshing()
tableView.mj_header = header tableView.mj_header = header
} }
...@@ -55,7 +53,7 @@ class BaseTableViewPullController: BaseViewController { ...@@ -55,7 +53,7 @@ class BaseTableViewPullController: BaseViewController {
// MARK: - 添加上拉加载更多 // MARK: - 添加上拉加载更多
func setupTableViewFooter() { func setupTableViewFooter() {
let footer = MJRefreshAutoNormalFooter(refreshingTarget: self, refreshingAction: #selector(BaseTableViewPullController.loadTableViewFooter)) let footer = MJRefreshAutoNormalFooter(refreshingTarget: self, refreshingAction: #selector(BaseTableViewPullController.loadTableViewFooter))
footer?.setTitle("", for: .idle) footer?.setTitle("~ 加载更多 ~", for: .idle)
footer?.setTitle("~ 加载中 ~", for: .refreshing) footer?.setTitle("~ 加载中 ~", for: .refreshing)
footer?.setTitle("~ end ~", for: .noMoreData) footer?.setTitle("~ end ~", for: .noMoreData)
footer?.stateLabel.textColor = kNavColor footer?.stateLabel.textColor = kNavColor
...@@ -107,7 +105,7 @@ class BaseTableViewPullController: BaseViewController { ...@@ -107,7 +105,7 @@ class BaseTableViewPullController: BaseViewController {
extension BaseTableViewPullController: DZNEmptyDataSetSource,DZNEmptyDataSetDelegate { extension BaseTableViewPullController: DZNEmptyDataSetSource,DZNEmptyDataSetDelegate {
func image(forEmptyDataSet scrollView: UIScrollView!) -> UIImage! { func image(forEmptyDataSet scrollView: UIScrollView!) -> UIImage! {
return UIImage(named: "logo-github") return UIImage(named: "not_data")
} }
func description(forEmptyDataSet scrollView: UIScrollView!) -> NSAttributedString! { func description(forEmptyDataSet scrollView: UIScrollView!) -> NSAttributedString! {
......
...@@ -87,6 +87,34 @@ public enum TODO_STATE: String { ...@@ -87,6 +87,34 @@ public enum TODO_STATE: String {
} }
/// 工单状态类型
///
/// - CREATED: 未发出
/// - SUBMIT: 已发出
/// - PROCESSING: 处理中
/// - FINISHED: 已完成
/// - DELETED: 已删除
/// - CANCLED: 已作废
public enum SUBMIT_REPAIR_ORDER_STATE: String {
case CREATED = "created"
case SUBMIT = "submit"
case PROCESSING = "processing"
case FINISHED = "finished"
case DELETED = "deleted"
case CANCLED = "cancled"
}
...@@ -15,6 +15,8 @@ public var kNavColor: UIColor = UIColor.RGB(44, g: 48, b: 52) ...@@ -15,6 +15,8 @@ public var kNavColor: UIColor = UIColor.RGB(44, g: 48, b: 52)
public let kMainColor: UIColor = UIColor.RGB(67, g: 132, b: 196) public let kMainColor: UIColor = UIColor.RGB(67, g: 132, b: 196)
public let kBlueColor: UIColor = UIColor.RGB(77, g: 131, b: 242) public let kBlueColor: UIColor = UIColor.RGB(77, g: 131, b: 242)
public let kGaryColor: UIColor = UIColor.RGB(240, g: 240, b: 240) public let kGaryColor: UIColor = UIColor.RGB(240, g: 240, b: 240)
public let kLightGaryColor: UIColor = UIColor.RGB(170, g: 170, b: 170)
public let kBlackColor: UIColor = UIColor.black
...@@ -36,7 +38,7 @@ public let kWindow: UIWindow = ((UIApplication.shared.delegate?.window)!)! ...@@ -36,7 +38,7 @@ public let kWindow: UIWindow = ((UIApplication.shared.delegate?.window)!)!
/// 用户信息 /// 用户信息
public func kUser() -> UserModel { public func kUser() -> UserModel {
return AppManager.shareInstance.userModel return AppManager.shareInstance.userModel!
} }
......
...@@ -10,11 +10,44 @@ import Foundation ...@@ -10,11 +10,44 @@ import Foundation
/// BaseUrl /// BaseUrl
//public let BaseUrl: String = "http://192.168.1.176:9030/ifs-server/rest" public let BaseUrl: String = "http://192.168.1.176:9030/ifs-server/rest"
public let BaseUrl: String = "http://dev.gomoretech.com/ifs-server/rest" //public let BaseUrl: String = "http://dev.gomoretech.com/ifs-server/rest"
/// 登录 /// 登录
public let loginUrl: String = "/user/login/%@" public let loginUrl: String = "/user/login/%@"
/// 待办事项 /// 待办事项
public let todoUrl: String = "/message/query" public let todoUrl: String = "/message/query"
/// 新建工单来源
public let sourceUrl: String = "/config/getValue/source"
/// 新建工单服务类型
public let serviceTypeUrl: String = "/config/getValue/serviceType"
/// 新建工单优先级
public let prorityUrl: String = "/config/getValue/prorityOption"
/// 新建工单报事人
public let initiatorUrl: String = "/user/query"
/// 新建工单位置
public let positionUrl: String = "/information/position/query"
/// 新建工单设施
public let deviceUrl: String = "/information/device/query"
/// 新建工单提交
public let saveRepairOrderUrl: String = "/work/saveOrUpdate"
/// 工单列表查询
public let repairOrderUrl: String = "/work/query"
...@@ -77,3 +77,18 @@ extension NSString { ...@@ -77,3 +77,18 @@ extension NSString {
} }
extension String {
//将原始的url编码为合法的url
func urlEncoded() -> String {
let encodeUrlString = self.addingPercentEncoding(withAllowedCharacters:
.urlQueryAllowed)
return encodeUrlString ?? ""
}
//将编码后的url转换回原始的url
func urlDecoded() -> String {
return self.removingPercentEncoding ?? ""
}
}
...@@ -7,18 +7,21 @@ ...@@ -7,18 +7,21 @@
// //
import Moya import Moya
import SwiftyJSON import SwiftyJSON
import YXAlertController
struct Network { struct Network {
// 请求头 // 请求头
static let publicParamEndpointClosure = { (target: Service) -> Endpoint<Service> in static let publicParamEndpointClosure = { (target: Service) -> Endpoint<Service> in
let url = target.baseURL.appendingPathComponent(target.path).absoluteString // let url = target.baseURL.appendingPathComponent(target.path).absoluteString
let url = target.baseURL.absoluteString + target.path
let endpoint = Endpoint<Service>(url: url, sampleResponseClosure: { .networkResponse(200, target.sampleData) }, method: target.method, task: target.task, httpHeaderFields: target.headers) let endpoint = Endpoint<Service>(url: url, sampleResponseClosure: { .networkResponse(200, target.sampleData) }, method: target.method, task: target.task, httpHeaderFields: target.headers)
return endpoint.adding(newHTTPHeaderFields: ["Content-Type" : "application/json;charset=utf-8"]) if let userModel = AppManager.shareInstance.userModel {
return endpoint.adding(newHTTPHeaderFields: ["enterprise" : userModel.enterpriseUuid,"Content-Type" : "application/json;charset=utf-8"])
}
return endpoint.adding(newHTTPHeaderFields: ["Content-Type" : "application/json;charset=utf-8"])
} }
// 设置超时时间 // 设置超时时间
static let myRequestClosure = {(endpoint: Endpoint<Service>, closure: MoyaProvider<Service>.RequestResultClosure) -> Void in static let myRequestClosure = {(endpoint: Endpoint<Service>, closure: MoyaProvider<Service>.RequestResultClosure) -> Void in
do { do {
...@@ -64,8 +67,10 @@ struct Network { ...@@ -64,8 +67,10 @@ struct Network {
//打印参数、返回 //打印参数、返回
print("url = " + (response.request?.url?.absoluteString)!) print("url = " + (response.request?.url?.absoluteString)!)
do { do {
let body = try JSON(data: (response.request?.httpBody)!) if let data = response.request!.httpBody {
print(body) let body = try JSON(data: data)
print(body)
}
let result = try JSON(data: response.data) let result = try JSON(data: response.data)
print(result) print(result)
}catch {} }catch {}
......
...@@ -12,11 +12,26 @@ import Alamofire ...@@ -12,11 +12,26 @@ import Alamofire
import SwiftyJSON import SwiftyJSON
public enum Service { public enum Service {
// MARK: - 登录 // MARK: - 登录
case Login(String,String) case Login(String,String)
// MARK: - 待办事项查询 // MARK: - 待办事项查询
case QueryTodo(QueryTodoModel) case QueryTodo(QueryTodoModel)
// MARK: - 新建工单查询来源
case QuerySource()
// MARK: - 新建工单服务类型
case QueryServerType()
// MARK: - 新建工单优先级
case QueryPrority()
// MARK: - 查询报事人
case QueryInitiator()
// MARK: - 查询位置
case QueryPosition()
// MARK: - 查询设施
case QueryDevice(DeviceQueryModel)
// MARK: - 提交工单
case SubmitOrder(SaveRepairOrderModel)
// MARK: - 查询工单列表
case QueryRepairOrder(RepairOrderQuery)
} }
extension Service: TargetType { extension Service: TargetType {
...@@ -30,15 +45,40 @@ extension Service: TargetType { ...@@ -30,15 +45,40 @@ extension Service: TargetType {
return String(format: loginUrl, name) return String(format: loginUrl, name)
case .QueryTodo(_): case .QueryTodo(_):
return todoUrl return todoUrl
case .QuerySource:
return sourceUrl
case .QueryServerType:
return serviceTypeUrl
case .QueryPrority:
return prorityUrl
case .QueryInitiator():
return initiatorUrl
case .QueryPosition():
return positionUrl
case .QueryDevice(_):
return deviceUrl
case .SubmitOrder(_):
let path = saveRepairOrderUrl + "?operator.operId=\(kUser().userCode!)&operator.operName=\(kUser().userName!)&time=\(NSDate().httpParameterString()!)"
return path.urlEncoded()
case .QueryRepairOrder(_):
return repairOrderUrl
} }
} }
public var method: Moya.Method { public var method: Moya.Method {
switch self { switch self {
case .Login(_, _), case .Login(_, _),
.QueryTodo(_): .QueryTodo(_),
.QueryPosition(),
.QueryDevice(_),
.SubmitOrder(_),
.QueryRepairOrder(_),
.QueryInitiator(_):
return .post return .post
case .QuerySource(),
.QueryServerType(),
.QueryPrority():
return .get
} }
} }
...@@ -55,6 +95,24 @@ extension Service: TargetType { ...@@ -55,6 +95,24 @@ extension Service: TargetType {
case .QueryTodo(let model): case .QueryTodo(let model):
return .requestParameters(parameters: model.toDictionary(), return .requestParameters(parameters: model.toDictionary(),
encoding: JSONEncoding.default) encoding: JSONEncoding.default)
case .QuerySource(),
.QueryServerType(),
.QueryPrority():
return .requestPlain
case .QueryInitiator(),
.QueryPosition():
let model = EmptyModel()
return .requestParameters(parameters: model.toJSON()!,
encoding: JSONEncoding.default)
case .QueryDevice(let queryModel):
return .requestParameters(parameters: queryModel.toDictionary(),
encoding: JSONEncoding.default)
case .SubmitOrder(let submitModel):
return .requestParameters(parameters: submitModel.toDictionary(),
encoding: JSONEncoding.default)
case .QueryRepairOrder(let queryModel):
return .requestParameters(parameters: queryModel.toDictionary(),
encoding: JSONEncoding.default)
} }
} }
......
//
// FilterViewController.swift
// IFS
//
// Created by 曹云霄 on 2018/1/4.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
/// 确认选择后回传数据
typealias SendValueClosure = (PublicFilterModel,Int) ->Void
class FilterViewController: BaseViewController {
/// 搜索关键字
@IBOutlet weak var searchBar: UISearchBar!
/// 搜索
@IBOutlet weak var filterTablView: UITableView!
/// 公共过滤ViewModel
lazy final var publicViewModel: FilterViewModel = {
var publicViewModel = FilterViewModel()
return publicViewModel;
}()
/// 回传数据
open var affirmSelectedBlock: SendValueClosure?
override func viewDidLoad() {
super.viewDidLoad()
addBarButtonItem()
setupConfigAction()
}
// MARK: - 添加提交按钮
fileprivate func addBarButtonItem() {
navigationItem.rightBarButtonItem = createButtonItem("确认", nil, self, #selector(FilterViewController.affirmButtonClickAction))
}
// MARK: - 设置导航栏
open func setNavigationTitle(_ title: String, _ block: @escaping SendValueClosure) {
self.title = title
self.affirmSelectedBlock = block
}
// MARK: - 初始化
func setupConfigAction() {
publicViewModel.displayArray = NSArray(array: publicViewModel.filterArray)
filterTablView.reloadData()
}
// MARK: - 确认选择
@objc func affirmButtonClickAction() {
if let affirmSelectedBlock = affirmSelectedBlock {
let predicate = NSPredicate(format: "isSelected=%@", "\(kONE)")
let tempArray = publicViewModel.displayArray.filtered(using: predicate)
let model = tempArray.first as! PublicFilterModel
affirmSelectedBlock(model, publicViewModel.filterArray.index(of: model))
popVC()
}
}
}
// MARK: - UITableViewDelegate,UITableDataSource
extension FilterViewController: UITableViewDelegate,UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return publicViewModel.dequeueReusableCell(indexPath, FilterTableViewCell.name(), tableView)
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return publicViewModel.displayArray.count
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
view.endEditing(true)
publicViewModel.deselectRow(indexPath)
tableView.reloadData()
}
}
extension FilterViewController: UISearchBarDelegate {
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
let predicate = NSPredicate(format: "title CONTAINS [cd] %@ ", searchText)
publicViewModel.displayArray = publicViewModel.filterArray.filtered(using: predicate) as NSArray
if searchText.isEmpty {
publicViewModel.displayArray = NSArray(array: publicViewModel.filterArray)
}
filterTablView.reloadData()
}
}
//
// SearchViewController.swift
// IFS
//
// Created by 曹云霄 on 2018/1/4.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
class SearchViewController: BaseTableViewPullController {
override func viewDidLoad() {
super.viewDidLoad()
}
}
//
// DeviceModel.swift
//
// Create by 云霄 曹 on 11/1/2018
// Copyright © 2018. All rights reserved.
import Foundation
import SwiftyJSON
class DeviceModel {
var data : DeviceData!
var message : String!
var success : Bool!
init(fromJson json: JSON!){
if json.isEmpty{
return
}
let dataJson = json["data"]
if !dataJson.isEmpty{
data = DeviceData(fromJson: dataJson)
}
message = json["message"].stringValue
success = json["success"].boolValue
}
}
class DeviceData{
var paging : Paging!
var records : [DeviceRecord]!
init(fromJson json: JSON!){
if json.isEmpty{
return
}
let pagingJson = json["paging"]
if !pagingJson.isEmpty{
paging = Paging(fromJson: pagingJson)
}
records = [DeviceRecord]()
let recordsArray = json["records"].arrayValue
for recordsJson in recordsArray{
let value = DeviceRecord(fromJson: recordsJson)
records.append(value)
}
}
}
class DeviceRecord{
var code : String!
var createId : String!
var createOperName : String!
var createTime : String!
var deviceType : AnyObject!
var enabled : Bool!
var lastModifyId : String!
var lastModifyOperName : String!
var lastModifyTime : String!
var name : String!
var position : UCN!
var store : UCN!
var uuid : String!
var version : Int!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
code = json["code"].stringValue
createId = json["create_id"].stringValue
createOperName = json["create_operName"].stringValue
createTime = json["create_time"].stringValue
deviceType = json["deviceType"] as AnyObject
enabled = json["enabled"].boolValue
lastModifyId = json["lastModify_id"].stringValue
lastModifyOperName = json["lastModify_operName"].stringValue
lastModifyTime = json["lastModify_time"].stringValue
name = json["name"].stringValue
let positionJson = json["position"]
if !positionJson.isEmpty{
position = UCN(fromJson: positionJson)
}
let storeJson = json["store"]
if !storeJson.isEmpty{
store = UCN(fromJson: storeJson)
}
uuid = json["uuid"].stringValue
version = json["version"].intValue
}
}
class UCN {
var code : String!
var name : String!
var uuid : String!
init(_ code: String, _ name: String ,_ uuid: String) {
self.code = code
self.name = name
self.uuid = uuid
}
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
code = json["code"].stringValue
name = json["name"].stringValue
uuid = json["uuid"].stringValue
}
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if code != nil{
dictionary["code"] = code
}
if name != nil{
dictionary["name"] = name
}
if uuid != nil{
dictionary["uuid"] = uuid
}
return dictionary
}
}
//
// DeviceQueryModel.swift
// IFS
//
// Created by 曹云霄 on 2018/1/11.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
import SwiftyJSON
open class DeviceQueryModel {
var codeEquals : String!
var nameLike : String!
var order : DeviceOrder!
var page : Int!
var pageSize : Int!
var stateEquals : String!
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if codeEquals != nil{
dictionary["codeEquals"] = codeEquals
}
if nameLike != nil{
dictionary["nameLike"] = nameLike
}
if order != nil{
dictionary["order"] = order.toDictionary()
}
if page != nil{
dictionary["page"] = page
}
if pageSize != nil{
dictionary["pageSize"] = pageSize
}
if stateEquals != nil{
dictionary["stateEquals"] = stateEquals
}
return dictionary
}
}
class DeviceOrder{
var direction : String!
var field : String!
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if direction != nil{
dictionary["direction"] = direction
}
if field != nil{
dictionary["field"] = field
}
return dictionary
}
}
// //
// SearchViewModel.swift // EmptyModel.swift
// IFS // IFS
// //
// Created by 曹云霄 on 2018/1/4. // Created by 曹云霄 on 2018/1/11.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved. // Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
// //
import UIKit import UIKit
class SearchViewModel: BaseViewModel { class EmptyModel: BaseModel {
} }
//
// InitiatorModel.swift
//
// Create by 云霄 曹 on 11/1/2018
// Copyright © 2018. All rights reserved.
//报事人
import Foundation
import SwiftyJSON
class InitiatorModel{
var data : InitiatorData!
var message : String!
var success : Bool!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
let dataJson = json["data"]
if !dataJson.isEmpty{
data = InitiatorData(fromJson: dataJson)
}
message = json["message"].stringValue
success = json["success"].boolValue
}
}
class InitiatorData {
var paging : Paging!
var records : [InitiatorRecord]!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
let pagingJson = json["paging"]
if !pagingJson.isEmpty{
paging = Paging(fromJson: pagingJson)
}
records = [InitiatorRecord]()
let recordsArray = json["records"].arrayValue
for recordsJson in recordsArray{
let value = InitiatorRecord(fromJson: recordsJson)
records.append(value)
}
}
}
class InitiatorRecord{
var login : String!
var name : String!
var position : String!
var uuid : String!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
login = json["login"].stringValue
name = json["name"].stringValue
position = json["position"].stringValue
uuid = json["uuid"].stringValue
}
}
//
// LocationModel.swift
//
// Create by 云霄 曹 on 11/1/2018
// Copyright © 2018. All rights reserved.
import Foundation
import SwiftyJSON
class LocationModel{
var data : LocationData!
var message : String!
var success : Bool!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
let dataJson = json["data"]
if !dataJson.isEmpty{
data = LocationData(fromJson: dataJson)
}
message = json["message"].stringValue
success = json["success"].boolValue
}
}
class LocationData{
var paging : Paging!
var records : [LocationRecord]!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
let pagingJson = json["paging"]
if !pagingJson.isEmpty{
paging = Paging(fromJson: pagingJson)
}
records = [LocationRecord]()
let recordsArray = json["records"].arrayValue
for recordsJson in recordsArray{
let value = LocationRecord(fromJson: recordsJson)
records.append(value)
}
}
}
class LocationRecord{
var buldingName : AnyObject!
var code : String!
var createId : String!
var createOperName : String!
var createTime : String!
var enabled : Bool!
var floorName : AnyObject!
var lastModifyId : String!
var lastModifyOperName : String!
var lastModifyTime : String!
var name : String!
var positionCategory : AnyObject!
var store : AnyObject!
var uuid : String!
var version : Int!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
buldingName = json["buldingName"] as AnyObject
code = json["code"].stringValue
createId = json["create_id"].stringValue
createOperName = json["create_operName"].stringValue
createTime = json["create_time"].stringValue
enabled = json["enabled"].boolValue
floorName = json["floorName"] as AnyObject
lastModifyId = json["lastModify_id"].stringValue
lastModifyOperName = json["lastModify_operName"].stringValue
lastModifyTime = json["lastModify_time"].stringValue
name = json["name"].stringValue
positionCategory = json["positionCategory"] as AnyObject
store = json["store"] as AnyObject
uuid = json["uuid"].stringValue
version = json["version"].intValue
}
}
//
// ProjectSponsorsModel.swift
//
// Create by 云霄 曹 on 11/1/2018
// Copyright © 2018. All rights reserved.
//来源、服务类型、优先级
import Foundation
import SwiftyJSON
class ProjectSponsorsModel : NSObject{
var data : [String]!
var message : String!
var success : Bool!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
data = [String]()
let dataArray = json["data"].arrayValue
for dataJson in dataArray{
data.append(dataJson.stringValue)
}
message = json["message"].stringValue
success = json["success"].boolValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if data != nil{
dictionary["data"] = data
}
if message != nil{
dictionary["message"] = message
}
if success != nil{
dictionary["success"] = success
}
return dictionary
}
}
//
// PublicFilterModel.swift
// IFS
//
// Created by 曹云霄 on 2018/1/11.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
class PublicFilterModel: NSObject {
var uuid: String?
@objc var title: String!
// 0 表示为选中
// 1 表示选中
@objc var isSelected: String!
init(uuid: String, title: String, isSelected: String) {
self.uuid = uuid
self.title = title
self.isSelected = isSelected
}
}
// //
// SearchTableViewCell.swift // FilterTableViewCell.swift
// IFS // IFS
// //
// Created by 曹云霄 on 2018/1/4. // Created by 曹云霄 on 2018/1/4.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import UIKit import UIKit
class SearchTableViewCell: UITableViewCell { class FilterTableViewCell: UITableViewCell {
/// 标题 /// 标题
......
//
// FilterViewModel.swift
// IFS
//
// Created by 曹云霄 on 2018/1/4.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
import RxSwift
class FilterViewModel: BaseViewModel {
/// 公共过滤数组,需要把外界传入数据转化为此类型
lazy final var filterArray: NSMutableArray = {
var filterArray = NSMutableArray()
return filterArray
}()
/// 过滤后显示数据源
lazy final var displayArray: NSArray = {
var displayArray = NSArray()
return displayArray
}()
}
// MARK: - UI
extension FilterViewModel {
func dequeueReusableCell(_ indexPath: IndexPath,_ identifier: String, _ tableView: UITableView) ->UITableViewCell {
let publicFilterCell = tableView.dequeueReusableCell(withIdentifier: identifier, for: indexPath) as! FilterTableViewCell
let model = displayArray[indexPath.row] as! PublicFilterModel
publicFilterCell.accessoryType = model.isSelected == "\(kONE)" ? .checkmark : .none
publicFilterCell.titleLabel.text = model.title
return publicFilterCell
}
func deselectRow(_ indexPath: IndexPath){
for model in displayArray {
(model as! PublicFilterModel).isSelected = "\(kZERO)"
}
for model in filterArray {
(model as! PublicFilterModel).isSelected = "\(kZERO)"
}
(displayArray[indexPath.row] as! PublicFilterModel).isSelected = "\(kONE)"
}
}
// MARK: - 数据请求
extension FilterViewModel {
// MARK: - 查询工程发起方
func queryProjectSponsors() ->Observable<[String]> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QuerySource(), success: { (json) in
let resultModel = ProjectSponsorsModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data)
}else {
ShowMessage(resultModel.message)
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
})
return Disposables.create()
})
}
// MARK: - 查询服务类型
func queryServerType() ->Observable<[String]> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryServerType(), success: { (json) in
let resultModel = ProjectSponsorsModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data)
}else {
ShowMessage(resultModel.message)
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
})
return Disposables.create()
})
}
// MARK: - 查询优先级
func queryProrityOption() ->Observable<[String]> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryPrority(), success: { (json) in
let resultModel = ProjectSponsorsModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data)
}else {
ShowMessage(resultModel.message)
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
})
return Disposables.create()
})
}
// MARK: - 查询报事人
func queryInitiator() ->Observable<[InitiatorRecord]> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryInitiator(), success: { (json) in
let resultModel = InitiatorModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data.records)
}else {
ShowMessage(resultModel.message)
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
})
return Disposables.create()
})
}
// MARK: - 查询报事人
func queryLocation() ->Observable<[LocationRecord]> {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryPosition(), success: { (json) in
let resultModel = LocationModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data.records)
}else {
ShowMessage(resultModel.message)
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
})
return Disposables.create()
})
}
// MARK: - 查询设施
func queryDevice() ->Observable<[DeviceRecord]> {
let queryModel = DeviceQueryModel()
return Observable.create({ (observer) -> Disposable in
Network.request(target: .QueryDevice(queryModel), success: { (json) in
let resultModel = DeviceModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data.records)
}else {
ShowMessage(resultModel.message)
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
})
return Disposables.create()
})
}
}
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
import UIKit import UIKit
import Kingfisher import Kingfisher
import YXAlertController
class AccountTableViewController: BaseTableViewController { class AccountTableViewController: BaseTableViewController {
......
...@@ -7,21 +7,20 @@ ...@@ -7,21 +7,20 @@
// //
import UIKit import UIKit
import YXAlertController
class AccountViewModel: BaseViewModel { class AccountViewModel: BaseViewModel {
// MARK: - 退出登录 // MARK: - 退出登录
func loginOutAction() { func loginOutAction() {
ShowAlertView("提示", "请确认是否退出登录?", ["取消","确认"], .alert) { (index) in // ShowAlertView("提示", "请确认是否退出登录?", ["取消","确认"], .alert) { (index) in
if index == kZERO { return } // if index == kZERO { return }
do { // do {
try FileManager.default.removeItem(atPath: accountPath) // try FileManager.default.removeItem(atPath: accountPath)
}catch { // }catch {
ShowMessage("删除用户信息失败") // ShowMessage("删除用户信息失败")
} // }
AppManager.shareInstance.openLoginVc() // AppManager.shareInstance.openLoginVc()
} // }
} }
} }
...@@ -32,6 +32,12 @@ class RepairOrderAddTableViewController: BaseTableViewController { ...@@ -32,6 +32,12 @@ class RepairOrderAddTableViewController: BaseTableViewController {
@IBOutlet weak var specifiedLocationLabel: UILabel! @IBOutlet weak var specifiedLocationLabel: UILabel!
/// 设施信息 /// 设施信息
@IBOutlet weak var facilitiesSwitch: UISwitch! @IBOutlet weak var facilitiesSwitch: UISwitch!
/// 设施
@IBOutlet weak var deviceTitleLabel: UILabel!
/// 设施位置
@IBOutlet weak var deviceLocationLabel: UITextField!
/// 设置故障时间
@IBOutlet weak var deviceFaultTimeLabel: UILabel!
/// 联系电话 /// 联系电话
@IBOutlet weak var phoneNumberText: UITextField! @IBOutlet weak var phoneNumberText: UITextField!
/// 工单描述 /// 工单描述
...@@ -48,10 +54,11 @@ class RepairOrderAddTableViewController: BaseTableViewController { ...@@ -48,10 +54,11 @@ class RepairOrderAddTableViewController: BaseTableViewController {
return attachmentVc return attachmentVc
}() }()
/// RepairOrderViewModel /// RepairOrderAddViewModel
lazy final var repairOrderViewModel: RepairOrderViewModel = { /// 新建工单ViewModel
var repairOrderViewModel = RepairOrderViewModel() lazy final var repairOrderAddViewModel: RepairOrderAddViewModel = {
return repairOrderViewModel var repairOrderAddViewModel = RepairOrderAddViewModel()
return repairOrderAddViewModel
}() }()
override func viewDidLoad() { override func viewDidLoad() {
...@@ -72,7 +79,12 @@ class RepairOrderAddTableViewController: BaseTableViewController { ...@@ -72,7 +79,12 @@ class RepairOrderAddTableViewController: BaseTableViewController {
// MARK: - 提交工单 // MARK: - 提交工单
@objc fileprivate func submitButtonClickAction() { @objc fileprivate func submitButtonClickAction() {
if repairOrderAddViewModel.repairOrderAvailable(facilitiesSwitch) {
repairOrderAddViewModel.submitRepairOrder().subscribe(onNext: {[weak self] (result) in
ShowMessage("提交成功")
self?.popVC()
}).disposed(by: disposeBag)
}
} }
// MARK: - 设置附件VC // MARK: - 设置附件VC
...@@ -87,6 +99,10 @@ class RepairOrderAddTableViewController: BaseTableViewController { ...@@ -87,6 +99,10 @@ class RepairOrderAddTableViewController: BaseTableViewController {
facilitiesSwitch.rx.controlEvent(UIControlEvents.valueChanged).subscribe(onNext: {[weak self] (event) in facilitiesSwitch.rx.controlEvent(UIControlEvents.valueChanged).subscribe(onNext: {[weak self] (event) in
self?.tableView.reloadData() self?.tableView.reloadData()
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
describeTextView.rx.text.subscribe(onNext: {[weak self] (string) in
self?.repairOrderAddViewModel.saveOrderModel.descriptionField = string
}).disposed(by: disposeBag)
} }
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
...@@ -126,7 +142,7 @@ class RepairOrderAddTableViewController: BaseTableViewController { ...@@ -126,7 +142,7 @@ class RepairOrderAddTableViewController: BaseTableViewController {
} }
return kSectionZero return kSectionZero
} }
return 10 return kSectionTen
} }
override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
...@@ -139,8 +155,17 @@ class RepairOrderAddTableViewController: BaseTableViewController { ...@@ -139,8 +155,17 @@ class RepairOrderAddTableViewController: BaseTableViewController {
} }
return super.tableView(tableView, viewForHeaderInSection: section) return super.tableView(tableView, viewForHeaderInSection: section)
} }
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
repairOrderAddViewModel.didSelectRowAtIndePath(indexPath, self)
}
deinit {
print("释放")
}
} }
// MARK: - 更新附件高度
extension RepairOrderAddTableViewController: PhotoAttachmentDelegate { extension RepairOrderAddTableViewController: PhotoAttachmentDelegate {
func updatePhotoAttachment(_ height: CGFloat, _ key: String?) { func updatePhotoAttachment(_ height: CGFloat, _ key: String?) {
attachmentHeight = height attachmentHeight = height
......
...@@ -25,7 +25,6 @@ class RepairOrderViewController: BaseTableViewPullController { ...@@ -25,7 +25,6 @@ class RepairOrderViewController: BaseTableViewPullController {
/// 优先级选择 /// 优先级选择
@IBOutlet weak var priorityChooseButton: UIButton! @IBOutlet weak var priorityChooseButton: UIButton!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -118,6 +117,10 @@ class RepairOrderViewController: BaseTableViewPullController { ...@@ -118,6 +117,10 @@ class RepairOrderViewController: BaseTableViewPullController {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
self.performSegue(withIdentifier: RepairOrderDetailViewController.name(), sender: nil) self.performSegue(withIdentifier: RepairOrderDetailViewController.name(), sender: nil)
} }
deinit {
print("释放")
}
} }
......
//
// PublicResultModel.swift
//
// Create by 云霄 曹 on 11/1/2018
// Copyright © 2018. All rights reserved.
import Foundation
import SwiftyJSON
class PublicResultModel : NSObject{
var data : String!
var message : String!
var success : Bool!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
data = json["data"].stringValue
message = json["message"].stringValue
success = json["success"].boolValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if data != nil{
dictionary["data"] = data
}
if message != nil{
dictionary["message"] = message
}
if success != nil{
dictionary["success"] = success
}
return dictionary
}
}
//
// RootClass.swift
//
// Create by 云霄 曹 on 11/1/2018
// Copyright © 2018. All rights reserved.
import Foundation
import SwiftyJSON
open class RepairOrderQuery : NSObject{
var endCreateTime : String!
var level : AnyObject!
var order : Order!
var page : Int!
var pageSize : Int!
var source : String!
var startCreateTime : String!
var state : AnyObject!
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if endCreateTime != nil{
dictionary["endCreateTime"] = endCreateTime
}
if level != nil{
dictionary["level"] = level
}
if order != nil{
dictionary["order"] = order.toDictionary()
}
if page != nil{
dictionary["page"] = page
}
if pageSize != nil{
dictionary["pageSize"] = pageSize
}
if source != nil{
dictionary["source"] = source
}
if startCreateTime != nil{
dictionary["startCreateTime"] = startCreateTime
}
if state != nil{
dictionary["state"] = state
}
return dictionary
}
}
//
// RootClass.swift
//
// Create by 云霄 曹 on 11/1/2018
// Copyright © 2018. All rights reserved.
import Foundation
import SwiftyJSON
class RepairOrderResult : NSObject{
var data : RepairOrderData!
var message : String!
var success : Bool!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
let dataJson = json["data"]
if !dataJson.isEmpty{
data = RepairOrderData(fromJson: dataJson)
}
message = json["message"].stringValue
success = json["success"].boolValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if data != nil{
dictionary["data"] = data.toDictionary()
}
if message != nil{
dictionary["message"] = message
}
if success != nil{
dictionary["success"] = success
}
return dictionary
}
}
class RepairOrderData : NSObject{
var paging : Paging!
var records : [RepairOrderRecord]!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
let pagingJson = json["paging"]
if !pagingJson.isEmpty{
paging = Paging(fromJson: pagingJson)
}
records = [RepairOrderRecord]()
let recordsArray = json["records"].arrayValue
for recordsJson in recordsArray{
let value = RepairOrderRecord(fromJson: recordsJson)
records.append(value)
}
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if paging != nil{
dictionary["paging"] = paging.toDictionary()
}
if records != nil{
var dictionaryElements = [[String:Any]]()
for recordsElement in records {
dictionaryElements.append(recordsElement.toDictionary())
}
dictionary["records"] = dictionaryElements
}
return dictionary
}
}
class RepairOrderRecord : NSObject{
var attachmentId : String!
var attachments : AnyObject!
var brokenTime : AnyObject!
var cancleReason : AnyObject!
var cancleTime : AnyObject!
var cancleUser : AnyObject!
var createId : String!
var createOperName : String!
var createTime : String!
var descriptionField : String!
var device : UCN!
var deviceType : AnyObject!
var executes : [RepairOrderExecute]!
var feedback : AnyObject!
var feedbackNote : AnyObject!
var finish : Bool!
var finishNote : AnyObject!
var finishTime : AnyObject!
var finishUser : AnyObject!
var labourfee : AnyObject!
var lastModifyId : String!
var lastModifyOperName : String!
var lastModifyTime : String!
var level : AnyObject!
var materielfee : AnyObject!
var note : String!
var position : UCN!
var receiveTime : String!
var reportOrg : String!
var reportUser : UCN!
var reporterPhone : String!
var requestTime : String!
var serviceType : String!
var source : String!
var state : String!
var store : AnyObject!
var tenant : UCN!
var uuid : String!
var version : Int!
var workNo : String!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
attachmentId = json["attachmentId"].stringValue
attachments = json["attachments"] as AnyObject
brokenTime = json["brokenTime"].stringValue as AnyObject
cancleReason = json["cancleReason"] as AnyObject
cancleTime = json["cancleTime"] as AnyObject
cancleUser = json["cancleUser"] as AnyObject
createId = json["create_id"].stringValue
createOperName = json["create_operName"].stringValue
createTime = json["create_time"].stringValue
descriptionField = json["description"].stringValue
let deviceJson = json["device"]
if !deviceJson.isEmpty{
device = UCN(fromJson: deviceJson)
}
deviceType = json["deviceType"].stringValue as AnyObject
executes = [RepairOrderExecute]()
let executesArray = json["executes"].arrayValue
for executesJson in executesArray{
let value = RepairOrderExecute(fromJson: executesJson)
executes.append(value)
}
feedback = json["feedback"] as AnyObject
feedbackNote = json["feedbackNote"] as AnyObject
finish = json["finish"].boolValue
finishNote = json["finishNote"] as AnyObject
finishTime = json["finishTime"] as AnyObject
finishUser = json["finishUser"] as AnyObject
labourfee = json["labourfee"] as AnyObject
lastModifyId = json["lastModify_id"].stringValue
lastModifyOperName = json["lastModify_operName"].stringValue
lastModifyTime = json["lastModify_time"].stringValue
level = json["level"] as AnyObject
materielfee = json["materielfee"] as AnyObject
note = json["note"].stringValue
let positionJson = json["position"]
if !positionJson.isEmpty{
position = UCN(fromJson: positionJson)
}
receiveTime = json["receiveTime"].stringValue
reportOrg = json["reportOrg"].stringValue
let reportUserJson = json["reportUser"]
if !reportUserJson.isEmpty{
reportUser = UCN(fromJson: reportUserJson)
}
reporterPhone = json["reporterPhone"].stringValue
requestTime = json["requestTime"].stringValue
serviceType = json["serviceType"].stringValue
source = json["source"].stringValue
state = json["state"].stringValue
store = json["store"] as AnyObject
let tenantJson = json["tenant"]
if !tenantJson.isEmpty{
tenant = UCN(fromJson: tenantJson)
}
uuid = json["uuid"].stringValue
version = json["version"].intValue
workNo = json["workNo"].stringValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if attachmentId != nil{
dictionary["attachmentId"] = attachmentId
}
if attachments != nil{
dictionary["attachments"] = attachments
}
if brokenTime != nil{
dictionary["brokenTime"] = brokenTime
}
if cancleReason != nil{
dictionary["cancleReason"] = cancleReason
}
if cancleTime != nil{
dictionary["cancleTime"] = cancleTime
}
if cancleUser != nil{
dictionary["cancleUser"] = cancleUser
}
if createId != nil{
dictionary["create_id"] = createId
}
if createOperName != nil{
dictionary["create_operName"] = createOperName
}
if createTime != nil{
dictionary["create_time"] = createTime
}
if descriptionField != nil{
dictionary["description"] = descriptionField
}
if device != nil{
dictionary["device"] = device.toDictionary()
}
if deviceType != nil{
dictionary["deviceType"] = deviceType
}
if executes != nil{
var dictionaryElements = [[String:Any]]()
for executesElement in executes {
dictionaryElements.append(executesElement.toDictionary())
}
dictionary["executes"] = dictionaryElements
}
if feedback != nil{
dictionary["feedback"] = feedback
}
if feedbackNote != nil{
dictionary["feedbackNote"] = feedbackNote
}
if finish != nil{
dictionary["finish"] = finish
}
if finishNote != nil{
dictionary["finishNote"] = finishNote
}
if finishTime != nil{
dictionary["finishTime"] = finishTime
}
if finishUser != nil{
dictionary["finishUser"] = finishUser
}
if labourfee != nil{
dictionary["labourfee"] = labourfee
}
if lastModifyId != nil{
dictionary["lastModify_id"] = lastModifyId
}
if lastModifyOperName != nil{
dictionary["lastModify_operName"] = lastModifyOperName
}
if lastModifyTime != nil{
dictionary["lastModify_time"] = lastModifyTime
}
if level != nil{
dictionary["level"] = level
}
if materielfee != nil{
dictionary["materielfee"] = materielfee
}
if note != nil{
dictionary["note"] = note
}
if position != nil{
dictionary["position"] = position.toDictionary()
}
if receiveTime != nil{
dictionary["receiveTime"] = receiveTime
}
if reportOrg != nil{
dictionary["reportOrg"] = reportOrg
}
if reportUser != nil{
dictionary["reportUser"] = reportUser.toDictionary()
}
if reporterPhone != nil{
dictionary["reporterPhone"] = reporterPhone
}
if requestTime != nil{
dictionary["requestTime"] = requestTime
}
if serviceType != nil{
dictionary["serviceType"] = serviceType
}
if source != nil{
dictionary["source"] = source
}
if state != nil{
dictionary["state"] = state
}
if store != nil{
dictionary["store"] = store
}
if tenant != nil{
dictionary["tenant"] = tenant.toDictionary()
}
if uuid != nil{
dictionary["uuid"] = uuid
}
if version != nil{
dictionary["version"] = version
}
if workNo != nil{
dictionary["workNo"] = workNo
}
return dictionary
}
}
class RepairOrderExecute : NSObject{
var beginAttachmentId : String!
var beginAttachments : AnyObject!
var createId : String!
var createOperName : String!
var createTime : String!
var dept : UCN!
var endAttachmentId : String!
var endAttachments : AnyObject!
var executeMateriels : [AnyObject]!
var executeNo : String!
var executeOutsources : [AnyObject]!
var hasOut : Bool!
var hasPaid : Bool!
var labourfee : AnyObject!
var lastModifyId : String!
var lastModifyOperName : String!
var lastModifyTime : String!
var materielfee : Int!
var note : AnyObject!
var owner : UCN!
var ownerTime : String!
var processBegin : AnyObject!
var processEnd : AnyObject!
var processMode : AnyObject!
var processor : AnyObject!
var property1 : AnyObject!
var property2 : AnyObject!
var reason : AnyObject!
var state : String!
var uuid : String!
var version : Int!
var workid : String!
/**
* Instantiate the instance using the passed json values to set the properties values
*/
init(fromJson json: JSON!){
if json.isEmpty{
return
}
beginAttachmentId = json["beginAttachmentId"].stringValue
beginAttachments = json["beginAttachments"] as AnyObject
createId = json["create_id"].stringValue
createOperName = json["create_operName"].stringValue
createTime = json["create_time"].stringValue
let deptJson = json["dept"]
if !deptJson.isEmpty{
dept = UCN(fromJson: deptJson)
}
endAttachmentId = json["endAttachmentId"].stringValue
endAttachments = json["endAttachments"] as AnyObject
executeMateriels = [AnyObject]()
let executeMaterielsArray = json["executeMateriels"].arrayValue
for executeMaterielsJson in executeMaterielsArray{
executeMateriels.append(executeMaterielsJson.stringValue as AnyObject)
}
executeNo = json["executeNo"].stringValue
executeOutsources = [AnyObject]()
let executeOutsourcesArray = json["executeOutsources"].arrayValue
for executeOutsourcesJson in executeOutsourcesArray{
executeOutsources.append(executeOutsourcesJson.stringValue as AnyObject)
}
hasOut = json["hasOut"].boolValue
hasPaid = json["hasPaid"].boolValue
labourfee = json["labourfee"].stringValue as AnyObject
lastModifyId = json["lastModify_id"].stringValue
lastModifyOperName = json["lastModify_operName"].stringValue
lastModifyTime = json["lastModify_time"].stringValue
materielfee = json["materielfee"].intValue
note = json["note"].stringValue as AnyObject
let ownerJson = json["owner"]
if !ownerJson.isEmpty{
owner = UCN(fromJson: ownerJson)
}
ownerTime = json["ownerTime"].stringValue
processBegin = json["processBegin"].stringValue as AnyObject
processEnd = json["processEnd"].stringValue as AnyObject
processMode = json["processMode"].stringValue as AnyObject
processor = json["processor"].stringValue as AnyObject
property1 = json["property1"].stringValue as AnyObject
property2 = json["property2"].stringValue as AnyObject
reason = json["reason"].stringValue as AnyObject
state = json["state"].stringValue
uuid = json["uuid"].stringValue
version = json["version"].intValue
workid = json["workid"].stringValue
}
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if beginAttachmentId != nil{
dictionary["beginAttachmentId"] = beginAttachmentId
}
if beginAttachments != nil{
dictionary["beginAttachments"] = beginAttachments
}
if createId != nil{
dictionary["create_id"] = createId
}
if createOperName != nil{
dictionary["create_operName"] = createOperName
}
if createTime != nil{
dictionary["create_time"] = createTime
}
if dept != nil{
dictionary["dept"] = dept.toDictionary()
}
if endAttachmentId != nil{
dictionary["endAttachmentId"] = endAttachmentId
}
if endAttachments != nil{
dictionary["endAttachments"] = endAttachments
}
if executeMateriels != nil{
dictionary["executeMateriels"] = executeMateriels
}
if executeNo != nil{
dictionary["executeNo"] = executeNo
}
if executeOutsources != nil{
dictionary["executeOutsources"] = executeOutsources
}
if hasOut != nil{
dictionary["hasOut"] = hasOut
}
if hasPaid != nil{
dictionary["hasPaid"] = hasPaid
}
if labourfee != nil{
dictionary["labourfee"] = labourfee
}
if lastModifyId != nil{
dictionary["lastModify_id"] = lastModifyId
}
if lastModifyOperName != nil{
dictionary["lastModify_operName"] = lastModifyOperName
}
if lastModifyTime != nil{
dictionary["lastModify_time"] = lastModifyTime
}
if materielfee != nil{
dictionary["materielfee"] = materielfee
}
if note != nil{
dictionary["note"] = note
}
if owner != nil{
dictionary["owner"] = owner.toDictionary()
}
if ownerTime != nil{
dictionary["ownerTime"] = ownerTime
}
if processBegin != nil{
dictionary["processBegin"] = processBegin
}
if processEnd != nil{
dictionary["processEnd"] = processEnd
}
if processMode != nil{
dictionary["processMode"] = processMode
}
if processor != nil{
dictionary["processor"] = processor
}
if property1 != nil{
dictionary["property1"] = property1
}
if property2 != nil{
dictionary["property2"] = property2
}
if reason != nil{
dictionary["reason"] = reason
}
if state != nil{
dictionary["state"] = state
}
if uuid != nil{
dictionary["uuid"] = uuid
}
if version != nil{
dictionary["version"] = version
}
if workid != nil{
dictionary["workid"] = workid
}
return dictionary
}
}
//
// SaveRepairOrderModel.swift
//
// Create by 云霄 曹 on 11/1/2018
// Copyright © 2018. All rights reserved.
import Foundation
import SwiftyJSON
open class SaveRepairOrderModel {
var attachmentId : String!
var brokenTime : String!
var descriptionField : String!
var device : UCN!
var level : String!
var position : UCN!
var receiveTime : String!
var reportOrg : String!
var reportUser : UCN!
var reporterPhone : String!
var requestTime : String!
var serviceType : String!
var source : String!
var state : String!
var workNo : String!
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if attachmentId != nil{
dictionary["attachmentId"] = attachmentId
}
if brokenTime != nil{
dictionary["brokenTime"] = brokenTime
}
if descriptionField != nil{
dictionary["description"] = descriptionField
}
if device != nil{
dictionary["device"] = device.toDictionary()
}
if level != nil{
dictionary["level"] = level
}
if position != nil{
dictionary["position"] = position.toDictionary()
}
if receiveTime != nil{
dictionary["receiveTime"] = receiveTime
}
if reportOrg != nil{
dictionary["reportOrg"] = reportOrg
}
if reportUser != nil{
dictionary["reportUser"] = reportUser.toDictionary()
}
if reporterPhone != nil{
dictionary["reporterPhone"] = reporterPhone
}
if requestTime != nil{
dictionary["requestTime"] = requestTime
}
if serviceType != nil{
dictionary["serviceType"] = serviceType
}
if source != nil{
dictionary["source"] = source
}
if state != nil{
dictionary["state"] = state
}
if workNo != nil{
dictionary["workNo"] = workNo
}
return dictionary
}
}
//
// RepairOrderAddViewModel.swift
// IFS
//
// Created by 曹云霄 on 2018/1/11.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
import RxSwift
class RepairOrderAddViewModel: BaseViewModel {
/// RxSwift自动释放
let disposeBag = DisposeBag()
/// 过滤ViewModel
lazy final var filterViewModel: FilterViewModel = {
var filterViewModel = FilterViewModel()
return filterViewModel
}()
/// 提交工单model
lazy final var saveOrderModel: SaveRepairOrderModel = {
var saveOrderModel = SaveRepairOrderModel()
return saveOrderModel
}()
}
extension RepairOrderAddViewModel {
// MARK: - 是否允许提交工单
func repairOrderAvailable(_ sender: UISwitch) ->Bool {
guard saveOrderModel.source != nil else {
ShowMessage("请选择工单来源")
return false
}
guard saveOrderModel.serviceType != nil else {
ShowMessage("请选择工单服务类型")
return false
}
guard saveOrderModel.level != nil else {
ShowMessage("请选择工单优先级")
return false
}
guard saveOrderModel.reportUser != nil else {
ShowMessage("请选择工单报事人")
return false
}
guard saveOrderModel.receiveTime != nil else {
ShowMessage("请选择工单接报时间")
return false
}
guard saveOrderModel.requestTime != nil else {
ShowMessage("请选择工单指定时间")
return false
}
guard saveOrderModel.position != nil else {
ShowMessage("请选择工单指定位置")
return false
}
if sender.isOn {
guard saveOrderModel.device != nil else {
ShowMessage("请选择故障设施")
return false
}
guard saveOrderModel.brokenTime != nil else {
ShowMessage("请选择设施故障时间")
return false
}
}
return true
}
// MARK: - 提交工单
func submitRepairOrder() ->Observable<String> {
saveOrderModel.state = SUBMIT_REPAIR_ORDER_STATE.CREATED.rawValue
return Observable.create({ (observer) -> Disposable in
Network.request(target: .SubmitOrder(self.saveOrderModel), success: { (json) in
let resultModel = PublicResultModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data)
}else {
ShowMessage(resultModel.message)
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
})
return Disposables.create()
})
}
}
extension RepairOrderAddViewModel {
// MARK: - 选择Item
func didSelectRowAtIndePath(_ indexPath: IndexPath, _ controller: RepairOrderAddTableViewController) {
switch indexPath {
case IndexPath(row: 0, section: 0):
filterViewModel.queryProjectSponsors().subscribe(onNext: {[weak self] (result) in
YXPickerManager.share().showGeneralPickerView(kMainColor, dataArray: result, defaultString: controller.sourceLabel.text, commit: { (text, index) in
controller.sourceLabel.text = text
controller.sourceLabel.textColor = kBlackColor
self?.saveOrderModel.source = text
}, cancel: nil)
}).disposed(by: disposeBag)
break
case IndexPath(row: 1, section: 0):
filterViewModel.queryServerType().subscribe(onNext: {[weak self] (result) in
YXPickerManager.share().showGeneralPickerView(kMainColor, dataArray: result, defaultString: controller.serviceTypeLabel.text, commit: { (text, index) in
controller.serviceTypeLabel.text = text
controller.serviceTypeLabel.textColor = kBlackColor
self?.saveOrderModel.serviceType = text
}, cancel: nil)
}).disposed(by: disposeBag)
break
case IndexPath(row: 2, section: 0):
filterViewModel.queryProrityOption().subscribe(onNext: {[weak self] (result) in
YXPickerManager.share().showGeneralPickerView(kMainColor, dataArray: result, defaultString: controller.priorityLabel.text, commit: { (text, index) in
controller.priorityLabel.text = text
controller.priorityLabel.textColor = kBlackColor
self?.saveOrderModel.level = text
}, cancel: nil)
}).disposed(by: disposeBag)
break
case IndexPath(row: 3, section: 0):
filterViewModel.queryInitiator().subscribe(onNext: {[weak self] (result) in
let publicFilterVc = FilterViewController.instantiateViewController(.Function) as! FilterViewController
for model in result {
let filterModel = PublicFilterModel(uuid: model.uuid, title: model.name, isSelected: "\(kZERO)")
publicFilterVc.publicViewModel.filterArray.add(filterModel)
}
controller.pushVC(publicFilterVc)
publicFilterVc.setNavigationTitle("筛选报事人", { (model, index) in
controller.originatorLabel.text = model.title
controller.originatorLabel.textColor = kBlackColor
let model = result[index]
let user = UCN(model.login, model.name, model.uuid)
self?.saveOrderModel.reportUser = user
})
}).disposed(by: disposeBag)
break
case IndexPath(row: 5, section: 0):
let defaultDate = controller.originatorTimeLabel.text == "工单接报时间" ? NSDate().httpParameterString() : controller.originatorTimeLabel.text
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
controller.originatorTimeLabel.text = time
controller.originatorTimeLabel.textColor = kBlackColor
self?.saveOrderModel.receiveTime = time
}, cancel: nil)
break
case IndexPath(row: 6, section: 0):
let defaultDate = controller.specifiedTimeLabel.text == "工单指定时间" ? NSDate().httpParameterString() : controller.originatorTimeLabel.text
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
controller.specifiedTimeLabel.text = time
controller.specifiedTimeLabel.textColor = kBlackColor
self?.saveOrderModel.requestTime = time
}, cancel: nil)
break
case IndexPath(row: 7, section: 0):
filterViewModel.queryLocation().subscribe(onNext: {[weak self] (result) in
let publicFilterVc = FilterViewController.instantiateViewController(.Function) as! FilterViewController
for model in result {
let filterModel = PublicFilterModel(uuid: model.uuid, title: model.name, isSelected: "\(kZERO)")
publicFilterVc.publicViewModel.filterArray.add(filterModel)
}
controller.pushVC(publicFilterVc)
publicFilterVc.setNavigationTitle("筛选位置", { (model, index) in
controller.specifiedLocationLabel.text = model.title
controller.specifiedLocationLabel.textColor = kBlackColor
let model = result[index]
let location = UCN(model.code, model.name, model.uuid)
self?.saveOrderModel.position = location
})
}).disposed(by: disposeBag)
break
case IndexPath(row: 0, section: 1):
filterViewModel.queryDevice().subscribe(onNext: {[weak self] (result) in
let publicFilterVc = FilterViewController.instantiateViewController(.Function) as! FilterViewController
for model in result {
let filterModel = PublicFilterModel(uuid: model.uuid, title: model.name, isSelected: "\(kZERO)")
publicFilterVc.publicViewModel.filterArray.add(filterModel)
}
publicFilterVc.setNavigationTitle("筛选设施", { (model, index) in
let deviceModel = result[index]
controller.deviceTitleLabel.text = model.title
controller.deviceLocationLabel.text = deviceModel.position.name
controller.deviceTitleLabel.textColor = kBlackColor
controller.deviceLocationLabel.textColor = kBlackColor
let model = result[index]
let device = UCN(model.code, model.name, model.uuid)
self?.saveOrderModel.device = device
})
controller.pushVC(publicFilterVc)
}).disposed(by: disposeBag)
break
case IndexPath(row: 2, section: 1):
let defaultDate = controller.deviceFaultTimeLabel.text == "设施故障时间" ? NSDate().httpParameterString() : controller.deviceFaultTimeLabel.text
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
controller.deviceFaultTimeLabel.text = time
controller.deviceFaultTimeLabel.textColor = kBlackColor
self?.saveOrderModel.brokenTime = time
}, cancel: nil)
break
default:
break
}
}
}
...@@ -28,7 +28,7 @@ class TodoResultModel{ ...@@ -28,7 +28,7 @@ class TodoResultModel{
} }
} }
class Record{ class TodoRecord{
var content : String! var content : String!
var createTime : String! var createTime : String!
...@@ -82,12 +82,34 @@ class Paging{ ...@@ -82,12 +82,34 @@ class Paging{
recordCount = json["recordCount"].intValue recordCount = json["recordCount"].intValue
} }
/**
* Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if page != nil{
dictionary["page"] = page
}
if pageCount != nil{
dictionary["pageCount"] = pageCount
}
if pageSize != nil{
dictionary["pageSize"] = pageSize
}
if recordCount != nil{
dictionary["recordCount"] = recordCount
}
return dictionary
}
} }
class TodoData{ class TodoData{
var paging : Paging! var paging : Paging!
var records : [Record]! var records : [TodoRecord]!
/** /**
* Instantiate the instance using the passed json values to set the properties values * Instantiate the instance using the passed json values to set the properties values
...@@ -100,10 +122,10 @@ class TodoData{ ...@@ -100,10 +122,10 @@ class TodoData{
if !pagingJson.isEmpty{ if !pagingJson.isEmpty{
paging = Paging(fromJson: pagingJson) paging = Paging(fromJson: pagingJson)
} }
records = [Record]() records = [TodoRecord]()
let recordsArray = json["records"].arrayValue let recordsArray = json["records"].arrayValue
for recordsJson in recordsArray{ for recordsJson in recordsArray{
let value = Record(fromJson: recordsJson) let value = TodoRecord(fromJson: recordsJson)
records.append(value) records.append(value)
} }
} }
......
...@@ -20,8 +20,8 @@ class TodoViewModel: BaseViewModel { ...@@ -20,8 +20,8 @@ class TodoViewModel: BaseViewModel {
}() }()
/// 待办事项结果 /// 待办事项结果
lazy final var todoArray: Array<Record> = { lazy final var todoArray: Array<TodoRecord> = {
var todoArray = Array<Record>() var todoArray = Array<TodoRecord>()
return todoArray return todoArray
}() }()
......
...@@ -2231,7 +2231,7 @@ ...@@ -2231,7 +2231,7 @@
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="设施位置" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="RU6-Ko-ArY"> <textField opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="设施位置" textAlignment="right" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="RU6-Ko-ArY">
<rect key="frame" x="177" y="7" width="178" height="30"/> <rect key="frame" x="177" y="7" width="178" height="30"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="30" id="3ge-2h-6nJ"/> <constraint firstAttribute="height" constant="30" id="3ge-2h-6nJ"/>
...@@ -2334,6 +2334,9 @@ ...@@ -2334,6 +2334,9 @@
</tableView> </tableView>
<connections> <connections>
<outlet property="describeTextView" destination="FOQ-jt-XWe" id="cZ8-3z-plz"/> <outlet property="describeTextView" destination="FOQ-jt-XWe" id="cZ8-3z-plz"/>
<outlet property="deviceFaultTimeLabel" destination="cWq-pB-V59" id="lTg-JL-70h"/>
<outlet property="deviceLocationLabel" destination="RU6-Ko-ArY" id="Xfh-Yd-NGV"/>
<outlet property="deviceTitleLabel" destination="DNT-zw-QBe" id="AyI-ho-vLY"/>
<outlet property="facilitiesSwitch" destination="3eR-qR-Yth" id="d6r-tH-PvV"/> <outlet property="facilitiesSwitch" destination="3eR-qR-Yth" id="d6r-tH-PvV"/>
<outlet property="originatorLabel" destination="Uew-aE-Bpk" id="hOV-CM-3cw"/> <outlet property="originatorLabel" destination="Uew-aE-Bpk" id="hOV-CM-3cw"/>
<outlet property="originatorTimeLabel" destination="7V7-W8-vDD" id="Rhs-0w-COm"/> <outlet property="originatorTimeLabel" destination="7V7-W8-vDD" id="Rhs-0w-COm"/>
...@@ -2349,10 +2352,10 @@ ...@@ -2349,10 +2352,10 @@
</objects> </objects>
<point key="canvasLocation" x="1413.5999999999999" y="103.89805097451276"/> <point key="canvasLocation" x="1413.5999999999999" y="103.89805097451276"/>
</scene> </scene>
<!--Search View Controller--> <!--Filter View Controller-->
<scene sceneID="20S-eS-CdS"> <scene sceneID="20S-eS-CdS">
<objects> <objects>
<viewController storyboardIdentifier="SearchViewController" id="8GR-Sb-4CG" customClass="SearchViewController" customModule="IFS" customModuleProvider="target" sceneMemberID="viewController"> <viewController storyboardIdentifier="FilterViewController" id="8GR-Sb-4CG" customClass="FilterViewController" customModule="IFS" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="QR7-6q-ejE"> <view key="view" contentMode="scaleToFill" id="QR7-6q-ejE">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
...@@ -2367,8 +2370,9 @@ ...@@ -2367,8 +2370,9 @@
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="yYK-zZ-1UW"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="yYK-zZ-1UW">
<rect key="frame" x="0.0" y="76" width="375" height="591"/> <rect key="frame" x="0.0" y="76" width="375" height="591"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="tintColor" red="0.17254901959999999" green="0.1764705882" blue="0.21176470589999999" alpha="1" colorSpace="calibratedRGB"/>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="checkmark" indentationWidth="10" reuseIdentifier="SearchTableViewCell" id="XfJ-qw-Kjk" customClass="SearchTableViewCell" customModule="IFS" customModuleProvider="target"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" accessoryType="checkmark" indentationWidth="10" reuseIdentifier="FilterTableViewCell" id="XfJ-qw-Kjk" customClass="FilterTableViewCell" customModule="IFS" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="375" height="44"/> <rect key="frame" x="0.0" y="28" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="XfJ-qw-Kjk" id="0w7-kb-upd"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="XfJ-qw-Kjk" id="0w7-kb-upd">
...@@ -2392,6 +2396,10 @@ ...@@ -2392,6 +2396,10 @@
</connections> </connections>
</tableViewCell> </tableViewCell>
</prototypes> </prototypes>
<connections>
<outlet property="dataSource" destination="8GR-Sb-4CG" id="5G0-R8-i32"/>
<outlet property="delegate" destination="8GR-Sb-4CG" id="CAJ-OT-ff0"/>
</connections>
</tableView> </tableView>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
...@@ -2407,7 +2415,8 @@ ...@@ -2407,7 +2415,8 @@
<viewLayoutGuide key="safeArea" id="MNG-bG-b3U"/> <viewLayoutGuide key="safeArea" id="MNG-bG-b3U"/>
</view> </view>
<connections> <connections>
<outlet property="tableView" destination="yYK-zZ-1UW" id="A0m-tL-mEA"/> <outlet property="filterTablView" destination="yYK-zZ-1UW" id="pyV-ui-6k8"/>
<outlet property="searchBar" destination="3to-sp-EdU" id="XJc-8E-SUw"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="VmD-ke-gmg" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="VmD-ke-gmg" userLabel="First Responder" sceneMemberID="firstResponder"/>
......
...@@ -12,7 +12,7 @@ import Hero ...@@ -12,7 +12,7 @@ import Hero
class AppManager: NSObject { class AppManager: NSObject {
/// 登录用户信息 /// 登录用户信息
open var userModel: UserModel! open var userModel: UserModel?
/// 单例模式 /// 单例模式
static var shareInstance: AppManager = { static var shareInstance: AppManager = {
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "空页面.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#import "UIImage+Category.h" #import "UIImage+Category.h"
#import "UINavigationController+FDFullscreenPopGesture.h" #import "UINavigationController+FDFullscreenPopGesture.h"
#import "YXKitHeader.h" #import "YXKitHeader.h"
#import "YXPickerManager.h" @import YXPickerView;
@import YXAlertController;
#import "IQTextView.h" #import "IQTextView.h"
#import "UIDevice+Helper.h" #import "UIDevice+Helper.h"
...@@ -15,10 +15,10 @@ target ‘IFS’ do ...@@ -15,10 +15,10 @@ target ‘IFS’ do
pod 'HandyJSON', '~> 4.0.0-beta.1' pod 'HandyJSON', '~> 4.0.0-beta.1'
pod 'MJRefresh', '~> 3.1.15.1' pod 'MJRefresh', '~> 3.1.15.1'
pod 'YXKit' pod 'YXKit'
pod 'YXAlertController', '~> 1.0.8'
pod 'IQKeyboardManager', '~> 5.0.6' pod 'IQKeyboardManager', '~> 5.0.6'
pod 'FDFullscreenPopGesture', '~> 1.1' pod 'FDFullscreenPopGesture', '~> 1.1'
pod 'YXPickerView', '~> 0.0.4'
pod 'ImagePicker' pod 'ImagePicker'
pod 'SKPhotoBrowser', '~> 5.0.0' pod 'SKPhotoBrowser', '~> 5.0.0'
pod 'YXPickerView'
pod 'YXAlertController'
end end
...@@ -24,7 +24,7 @@ PODS: ...@@ -24,7 +24,7 @@ PODS:
- SwiftyJSON (4.0.0) - SwiftyJSON (4.0.0)
- YXAlertController (1.0.8) - YXAlertController (1.0.8)
- YXKit (0.0.8) - YXKit (0.0.8)
- YXPickerView (0.0.5) - YXPickerView (1.0.0)
DEPENDENCIES: DEPENDENCIES:
- DeviceKit - DeviceKit
...@@ -43,9 +43,9 @@ DEPENDENCIES: ...@@ -43,9 +43,9 @@ DEPENDENCIES:
- SKPhotoBrowser (~> 5.0.0) - SKPhotoBrowser (~> 5.0.0)
- SnapKit - SnapKit
- SwiftyJSON - SwiftyJSON
- YXAlertController (~> 1.0.8) - YXAlertController
- YXKit - YXKit
- YXPickerView (~> 0.0.4) - YXPickerView
SPEC CHECKSUMS: SPEC CHECKSUMS:
Alamofire: f41a599bd63041760b26d393ec1069d9d7b917f4 Alamofire: f41a599bd63041760b26d393ec1069d9d7b917f4
...@@ -68,8 +68,8 @@ SPEC CHECKSUMS: ...@@ -68,8 +68,8 @@ SPEC CHECKSUMS:
SwiftyJSON: 070dabdcb1beb81b247c65ffa3a79dbbfb3b48aa SwiftyJSON: 070dabdcb1beb81b247c65ffa3a79dbbfb3b48aa
YXAlertController: 37a54642cb8e8b43b79004fe9148bb8ff2fab814 YXAlertController: 37a54642cb8e8b43b79004fe9148bb8ff2fab814
YXKit: 73d6ffbcf7530f1159e030460207286e9153b080 YXKit: 73d6ffbcf7530f1159e030460207286e9153b080
YXPickerView: 435b7b1362931fe63f2aab25d2810b1cf5ca2226 YXPickerView: 720c5568f16e4ebcfc5468e3a29d1a0e69293b0c
PODFILE CHECKSUM: 36ab8d11dc09b068c8608b937c8558d98c298b69 PODFILE CHECKSUM: bbdde573a885a7ec99a2e993aa40f5a213c0d05d
COCOAPODS: 1.3.0 COCOAPODS: 1.3.0
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