123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- angular.module('push')
- .controller('noticeCtrl', ['$scope', 'AccountService', '$ionicPopup', function ($scope, AccountService, $ionicPopup) {
- $scope.epidemicService = {};
- //便民服务需求征集
- $scope.demandCollectList = [{
- itemvalue: 0,
- itemkey: '应急快递',
- isSelected: false
- }, {
- itemvalue: 1,
- itemkey: '配药',
- isSelected: false
- }, {
- itemvalue: 2,
- itemkey: '其他(特别急、险的事项)',
- isSelected: false
- }];
- //政务服务需求
- $scope.govServiceDemandList = [{
- itemvalue: 0,
- itemkey: '公积金业务',
- isSelected: false
- }, {
- itemvalue: 1,
- itemkey: '车驾管、违章业务',
- isSelected: false
- }, {
- itemvalue: 2,
- itemkey: '市民卡业务',
- isSelected: false
- }, {
- itemvalue: 3,
- itemkey: '社保医保业务(咨询解答)',
- isSelected: false
- }, {
- itemvalue: 4,
- itemkey: '企业复工申报',
- isSelected: false
- }, {
- itemvalue: 5,
- itemkey: '商事登记业务',
- isSelected: false
- }, {
- itemvalue: 6,
- itemkey: '税务业务',
- isSelected: false
- }, {
- itemvalue: 7,
- itemkey: '水电气电视业务',
- isSelected: false
- }, {
- itemvalue: 8,
- itemkey: '其他业务',
- isSelected: false
- }];
- $scope.selectDemandCollect = function (index) {
- $scope.demandCollectList[index].isSelected = !$scope.demandCollectList[index].isSelected;
- if ($scope.demandCollectList[index].isSelected) {
- if (index == 0) {
- $scope.showIndex0 = true;
- $scope.epidemicService.demandcollect0 = true;
- }
- if (index == 1) {
- $scope.showIndex1 = true;
- $scope.epidemicService.demandcollect1 = true;
- }
- if (index == 2) {
- $scope.showIndex2 = true;
- $scope.epidemicService.demandcollect2 = true;
- }
- } else {
- if (index == 0) {
- $scope.showIndex0 = false;
- $scope.epidemicService.demandcollect0 = false;
- $scope.epidemicService.indexinfo0 = "";
- }
- if (index == 1) {
- $scope.showIndex1 = false;
- $scope.epidemicService.demandCollect1 = false;
- $scope.epidemicService.indexinfo1 = "";
- }
- if (index == 2) {
- $scope.showIndex2 = false;
- $scope.epidemicService.demandCollect2 = false;
- $scope.epidemicService.indexinfo2 = "";
- }
- }
- }
- $scope.selectGovServiceDemand = function (index) {
- $scope.govServiceDemandList[index].isSelected = !$scope.govServiceDemandList[index].isSelected;
- if ($scope.govServiceDemandList[index].isSelected) {
- if (index == 0) {
- $scope.epidemicService.govservicedemand0 = true;
- }
- if (index == 1) {
- $scope.epidemicService.govservicedemand1 = true;
- }
- if (index == 2) {
- $scope.epidemicService.govservicedemand2 = true;
- }
- if (index == 3) {
- $scope.epidemicService.govservicedemand3 = true;
- }
- if (index == 4) {
- $scope.epidemicService.govservicedemand4 = true;
- }
- if (index == 5) {
- $scope.epidemicService.govservicedemand5 = true;
- }
- if (index == 6) {
- $scope.epidemicService.govservicedemand6 = true;
- }
- if (index == 7) {
- $scope.epidemicService.govservicedemand7 = true;
- }
- if (index == 8) {
- $scope.epidemicService.govservicedemand8 = true;
- }
- } else {
- if (index == 0) {
- $scope.epidemicService.govservicedemand0 = false;
- }
- if (index == 1) {
- $scope.epidemicService.govservicedemand1 = false;
- }
- if (index == 2) {
- $scope.epidemicService.govservicedemand2 = false;
- }
- if (index == 3) {
- $scope.epidemicService.govservicedemand3 = false;
- }
- if (index == 4) {
- $scope.epidemicService.govservicedemand4 = false;
- }
- if (index == 5) {
- $scope.epidemicService.govservicedemand5 = false;
- }
- if (index == 6) {
- $scope.epidemicService.govservicedemand6 = false;
- }
- if (index == 7) {
- $scope.epidemicService.govservicedemand7 = false;
- }
- if (index == 8) {
- $scope.epidemicService.govservicedemand8 = false;
- $scope.epidemicService.govservicedemandinfo8 = "";
- }
- }
- }
- //提交疫情服务
- $scope.submitEpidemicService = function () {
- if (!$scope.epidemicService.name) {
- $ionicPopup.alert({
- title: '提示',
- template:'<p style="text-align: center;">请输入姓名</p>',
- buttons:[{text:"确定"}]
- })
- return;
- }
- if (!$scope.epidemicService.phone) {
- $ionicPopup.alert({
- title: '提示',
- template:'<p style="text-align: center;">请输入手机号</p>',
- buttons:[{text:"确定"}]
- })
- return;
- }
- if ($scope.epidemicService.demandcollect0) {
- if (!$scope.epidemicService.indexinfo0) {
- $ionicPopup.alert({
- title: '提示',
- template:'<p style="text-align: center;">请输入应急快递具体信息</p>',
- buttons:[{text:"确定"}]
- })
- return;
- }
- }
- if ($scope.epidemicService.demandcollect1) {
- if (!$scope.epidemicService.indexinfo1) {
- $ionicPopup.alert({
- title: '提示',
- template:'<p style="text-align: center;">请输入配药具体信息</p>',
- buttons:[{text:"确定"}]
- })
- return;
- }
- }
- if ($scope.epidemicService.demandcollect2) {
- if (!$scope.epidemicService.indexinfo2) {
- $ionicPopup.alert({
- title: '提示',
- template:'<p style="text-align: center;">请输入其他需求具体信息</p>',
- buttons:[{text:"确定"}]
- })
- return;
- }
- }
- if ($scope.epidemicService.govservicedemand8) {
- if (!$scope.epidemicService.govservicedemandinfo8) {
- $ionicPopup.alert({
- title: '提示',
- template:'<p style="text-align: center;">请输入其他业务具体信息</p>',
- buttons:[{text:"确定"}]
- })
- return;
- }
- }
- var netStatue = navigator.onLine;
- if(netStatue){
- AccountService.submitEpidemicService($scope.epidemicService).then(function (res) {
- if (res.code == 3350) {
- $scope.go('noticeDetail', {
- list: $scope.govServiceDemandList,
- otherinfo: $scope.epidemicService.govservicedemandinfo8
- });
- }
- })
- }else{
- $ionicPopup.alert({
- title: '提示',
- template:'<p style="text-align: center;">网络未连接,请检查您的网络!</p>',
- buttons:[{text:"确定"}]
- })
- return;
- }
- }
- }])
- ;
|