noticeCtrl.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. angular.module('push')
  2. .controller('noticeCtrl', ['$scope', 'AccountService', '$ionicPopup', function ($scope, AccountService, $ionicPopup) {
  3. $scope.epidemicService = {};
  4. //便民服务需求征集
  5. $scope.demandCollectList = [{
  6. itemvalue: 0,
  7. itemkey: '应急快递',
  8. isSelected: false
  9. }, {
  10. itemvalue: 1,
  11. itemkey: '配药',
  12. isSelected: false
  13. }, {
  14. itemvalue: 2,
  15. itemkey: '其他(特别急、险的事项)',
  16. isSelected: false
  17. }];
  18. //政务服务需求
  19. $scope.govServiceDemandList = [{
  20. itemvalue: 0,
  21. itemkey: '公积金业务',
  22. isSelected: false
  23. }, {
  24. itemvalue: 1,
  25. itemkey: '车驾管、违章业务',
  26. isSelected: false
  27. }, {
  28. itemvalue: 2,
  29. itemkey: '市民卡业务',
  30. isSelected: false
  31. }, {
  32. itemvalue: 3,
  33. itemkey: '社保医保业务(咨询解答)',
  34. isSelected: false
  35. }, {
  36. itemvalue: 4,
  37. itemkey: '企业复工申报',
  38. isSelected: false
  39. }, {
  40. itemvalue: 5,
  41. itemkey: '商事登记业务',
  42. isSelected: false
  43. }, {
  44. itemvalue: 6,
  45. itemkey: '税务业务',
  46. isSelected: false
  47. }, {
  48. itemvalue: 7,
  49. itemkey: '水电气电视业务',
  50. isSelected: false
  51. }, {
  52. itemvalue: 8,
  53. itemkey: '其他业务',
  54. isSelected: false
  55. }];
  56. $scope.selectDemandCollect = function (index) {
  57. $scope.demandCollectList[index].isSelected = !$scope.demandCollectList[index].isSelected;
  58. if ($scope.demandCollectList[index].isSelected) {
  59. if (index == 0) {
  60. $scope.showIndex0 = true;
  61. $scope.epidemicService.demandcollect0 = true;
  62. }
  63. if (index == 1) {
  64. $scope.showIndex1 = true;
  65. $scope.epidemicService.demandcollect1 = true;
  66. }
  67. if (index == 2) {
  68. $scope.showIndex2 = true;
  69. $scope.epidemicService.demandcollect2 = true;
  70. }
  71. } else {
  72. if (index == 0) {
  73. $scope.showIndex0 = false;
  74. $scope.epidemicService.demandcollect0 = false;
  75. $scope.epidemicService.indexinfo0 = "";
  76. }
  77. if (index == 1) {
  78. $scope.showIndex1 = false;
  79. $scope.epidemicService.demandCollect1 = false;
  80. $scope.epidemicService.indexinfo1 = "";
  81. }
  82. if (index == 2) {
  83. $scope.showIndex2 = false;
  84. $scope.epidemicService.demandCollect2 = false;
  85. $scope.epidemicService.indexinfo2 = "";
  86. }
  87. }
  88. }
  89. $scope.selectGovServiceDemand = function (index) {
  90. $scope.govServiceDemandList[index].isSelected = !$scope.govServiceDemandList[index].isSelected;
  91. if ($scope.govServiceDemandList[index].isSelected) {
  92. if (index == 0) {
  93. $scope.epidemicService.govservicedemand0 = true;
  94. }
  95. if (index == 1) {
  96. $scope.epidemicService.govservicedemand1 = true;
  97. }
  98. if (index == 2) {
  99. $scope.epidemicService.govservicedemand2 = true;
  100. }
  101. if (index == 3) {
  102. $scope.epidemicService.govservicedemand3 = true;
  103. }
  104. if (index == 4) {
  105. $scope.epidemicService.govservicedemand4 = true;
  106. }
  107. if (index == 5) {
  108. $scope.epidemicService.govservicedemand5 = true;
  109. }
  110. if (index == 6) {
  111. $scope.epidemicService.govservicedemand6 = true;
  112. }
  113. if (index == 7) {
  114. $scope.epidemicService.govservicedemand7 = true;
  115. }
  116. if (index == 8) {
  117. $scope.epidemicService.govservicedemand8 = true;
  118. }
  119. } else {
  120. if (index == 0) {
  121. $scope.epidemicService.govservicedemand0 = false;
  122. }
  123. if (index == 1) {
  124. $scope.epidemicService.govservicedemand1 = false;
  125. }
  126. if (index == 2) {
  127. $scope.epidemicService.govservicedemand2 = false;
  128. }
  129. if (index == 3) {
  130. $scope.epidemicService.govservicedemand3 = false;
  131. }
  132. if (index == 4) {
  133. $scope.epidemicService.govservicedemand4 = false;
  134. }
  135. if (index == 5) {
  136. $scope.epidemicService.govservicedemand5 = false;
  137. }
  138. if (index == 6) {
  139. $scope.epidemicService.govservicedemand6 = false;
  140. }
  141. if (index == 7) {
  142. $scope.epidemicService.govservicedemand7 = false;
  143. }
  144. if (index == 8) {
  145. $scope.epidemicService.govservicedemand8 = false;
  146. $scope.epidemicService.govservicedemandinfo8 = "";
  147. }
  148. }
  149. }
  150. //提交疫情服务
  151. $scope.submitEpidemicService = function () {
  152. if (!$scope.epidemicService.name) {
  153. $ionicPopup.alert({
  154. title: '提示',
  155. template:'<p style="text-align: center;">请输入姓名</p>',
  156. buttons:[{text:"确定"}]
  157. })
  158. return;
  159. }
  160. if (!$scope.epidemicService.phone) {
  161. $ionicPopup.alert({
  162. title: '提示',
  163. template:'<p style="text-align: center;">请输入手机号</p>',
  164. buttons:[{text:"确定"}]
  165. })
  166. return;
  167. }
  168. if ($scope.epidemicService.demandcollect0) {
  169. if (!$scope.epidemicService.indexinfo0) {
  170. $ionicPopup.alert({
  171. title: '提示',
  172. template:'<p style="text-align: center;">请输入应急快递具体信息</p>',
  173. buttons:[{text:"确定"}]
  174. })
  175. return;
  176. }
  177. }
  178. if ($scope.epidemicService.demandcollect1) {
  179. if (!$scope.epidemicService.indexinfo1) {
  180. $ionicPopup.alert({
  181. title: '提示',
  182. template:'<p style="text-align: center;">请输入配药具体信息</p>',
  183. buttons:[{text:"确定"}]
  184. })
  185. return;
  186. }
  187. }
  188. if ($scope.epidemicService.demandcollect2) {
  189. if (!$scope.epidemicService.indexinfo2) {
  190. $ionicPopup.alert({
  191. title: '提示',
  192. template:'<p style="text-align: center;">请输入其他需求具体信息</p>',
  193. buttons:[{text:"确定"}]
  194. })
  195. return;
  196. }
  197. }
  198. if ($scope.epidemicService.govservicedemand8) {
  199. if (!$scope.epidemicService.govservicedemandinfo8) {
  200. $ionicPopup.alert({
  201. title: '提示',
  202. template:'<p style="text-align: center;">请输入其他业务具体信息</p>',
  203. buttons:[{text:"确定"}]
  204. })
  205. return;
  206. }
  207. }
  208. var netStatue = navigator.onLine;
  209. if(netStatue){
  210. AccountService.submitEpidemicService($scope.epidemicService).then(function (res) {
  211. if (res.code == 3350) {
  212. $scope.go('noticeDetail', {
  213. list: $scope.govServiceDemandList,
  214. otherinfo: $scope.epidemicService.govservicedemandinfo8
  215. });
  216. }
  217. })
  218. }else{
  219. $ionicPopup.alert({
  220. title: '提示',
  221. template:'<p style="text-align: center;">网络未连接,请检查您的网络!</p>',
  222. buttons:[{text:"确定"}]
  223. })
  224. return;
  225. }
  226. }
  227. }])
  228. ;