controller.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140
  1. 'use strict';
  2. var app = angular.module('app')
  3. .controller('step1Ctrl', ['$scope', '$http', '$state','main_host','UserService', function($scope, $http, $state,main_host,UserService) {
  4. var user = UserService.getUserInfo();
  5. console.log(user);
  6. $('.mytab>li').eq(0).addClass('on').siblings().removeClass('on');
  7. $scope.applyParm = {
  8. "year": "",
  9. "name": "",
  10. "status": "",
  11. "pageIndex": 1,
  12. "pageSize": 20
  13. }
  14. $scope.applyData = {
  15. "year": "",
  16. "name": "",
  17. "status": "",
  18. "startTime": "",
  19. "endTime": ""
  20. }
  21. $scope.pageData = {}
  22. $scope.getBmData = function() {
  23. $http.get(main_host + '/api/EvalStudentBmManages', {
  24. params: $scope.applyParm
  25. }).success(function(data) {
  26. if (data.success) {
  27. $scope.applylists = data.map.data.list;
  28. $scope.pageData = {
  29. "pageIndex": data.map.data.pageIndex,
  30. "pageSize": data.map.data.pageSize,
  31. "totalCounts": data.map.data.totalCounts,
  32. "totalPages": data.map.data.totalPages
  33. }
  34. }
  35. });
  36. }
  37. //日期选择
  38. var start = {
  39. elem: '#startDate',
  40. choose: function(datas) {
  41. end.min = datas;
  42. end.start = datas;
  43. $scope.applyData.startTime = datas;
  44. }
  45. };
  46. var end = {
  47. elem: '#endDate',
  48. choose: function(datas) {
  49. start.max = datas;
  50. $scope.applyData.endTime = datas;
  51. }
  52. };
  53. $scope.startDate = function() {
  54. laydate(start);
  55. }
  56. $scope.endDate = function() {
  57. laydate(end);
  58. }
  59. console.log($scope);
  60. //添加报名
  61. $scope.addApply = function() {
  62. $scope.applyData = {
  63. "year": "",
  64. "name": "",
  65. "status": "",
  66. "startTime": "",
  67. "endTime": ""
  68. }
  69. var d = dialog({
  70. title: "添加学生报名",
  71. content: $('.pop_stdBm'),
  72. width: 500,
  73. ok: function() {
  74. $http.post(main_host + '/api/EvalStudentBmManages', $scope.applyData).success(function(data) {
  75. if (data.success) {
  76. $scope.getBmData();
  77. $scope.$parent.$parent.getBmYear();
  78. }
  79. })
  80. },
  81. okValue: '确定',
  82. cancel: function() {},
  83. cancelValue: '取消'
  84. }).showModal();
  85. }
  86. //修改报名
  87. $scope.editApply = function() {
  88. for (k in $scope.applylists) {
  89. if ($scope.applylists[k].id == $scope.choseArr[0]) {
  90. $scope.applyData = {
  91. "year": $scope.applylists[k].year,
  92. "name": $scope.applylists[k].name,
  93. "status": $scope.applylists[k].status,
  94. "startTime": $scope.applylists[k].startTime,
  95. "endTime": $scope.applylists[k].endTime
  96. }
  97. }
  98. }
  99. var d = dialog({
  100. title: "添加学生报名",
  101. content: $('.pop_stdBm'),
  102. width: 500,
  103. ok: function() {
  104. $http.put(main_host + '/api/EvalStudentBmManages/' + $scope.choseArr[0], $scope.applyParm).success(function(data) {
  105. if (data.success) {
  106. $scope.getBmData();
  107. $scope.$parent.$parent.getBmYear();
  108. }
  109. });
  110. },
  111. okValue: '确定',
  112. cancel: function() {},
  113. cancelValue: '取消'
  114. }).showModal();
  115. }
  116. //删除报名
  117. $scope.delApply = function() {
  118. if ($scope.choseArr.length > 0) {
  119. var d = dialog({
  120. title: "提示",
  121. content: "是否确定要删除这条报名信息?",
  122. ok: function() {
  123. $http.delete(main_host + '/api/EvalStudentBmManages/' + $scope.choseArr.join(',')).success(function(data) {
  124. if (data.success) {
  125. $scope.getBmData();
  126. $scope.$parent.$parent.getBmYear();
  127. }
  128. })
  129. },
  130. okValue: "确定",
  131. cancel: function() {},
  132. cancelValue: "取消"
  133. }).showModal();
  134. }
  135. }
  136. $scope.choseArr = [];
  137. $scope.showEdit = false;
  138. $scope.multipleChecked = function(x, z) {
  139. if (x) {
  140. if ($scope.choseArr.indexOf(z) == -1) {
  141. $scope.choseArr.push(z);
  142. }
  143. } else {
  144. for (k in $scope.choseArr) {
  145. if ($scope.choseArr[k] == z) {
  146. $scope.choseArr.splice(k,1);
  147. }
  148. }
  149. }
  150. if ($scope.choseArr.length == 1) {
  151. $scope.showEdit = true;
  152. } else {
  153. $scope.showEdit = false;
  154. }
  155. }
  156. //报名状态
  157. $scope.bmStatus = function(id, status) {
  158. var statusParm = {
  159. "status": status
  160. }
  161. if (status == '1') {
  162. statusParm.status = "0"
  163. } else {
  164. statusParm.status = "1"
  165. }
  166. $http.put(main_host + '/api/EvalStudentBmManageStatus/' + id, statusParm).success(function(data) {
  167. if (data.success) {
  168. $scope.getBmData();
  169. $scope.$parent.$parent.getBmYear();
  170. }
  171. })
  172. }
  173. //查询
  174. $scope.queryBmData = function() {
  175. $scope.getBmData();
  176. }
  177. //首页
  178. $scope.bmFirstPage = function() {
  179. $scope.applyParm.pageIndex = 1;
  180. $scope.getBmData();
  181. }
  182. //上一页
  183. $scope.bmPrevPage = function() {
  184. if ($scope.applyParm.pageIndex > 1) {
  185. $scope.applyParm.pageIndex--;
  186. $scope.getBmData();
  187. }
  188. }
  189. //下一页
  190. $scope.bmNextPage = function() {
  191. if ($scope.applyParm.pageIndex < $scope.pageData.totalPages) {
  192. $scope.applyParm.pageIndex++;
  193. $scope.getBmData();
  194. }
  195. }
  196. //尾页
  197. $scope.bmLastPage = function() {
  198. $scope.applyParm.pageIndex = $scope.pageData.totalPages;
  199. $scope.getBmData();
  200. }
  201. }])
  202. .controller('step2Ctrl', ['$scope', '$http', '$state', function($scope, $http, $state) {
  203. $('.mytab>li').eq(1).addClass('on').siblings().removeClass('on');
  204. $scope.commentParm = {
  205. "pageIndex": 1,
  206. "pageSize": 20
  207. }
  208. $scope.pageData = {}
  209. $scope.getCommentData = function() {
  210. $http.get(main_host + '/api/EvalCalibrationInfos', {
  211. params: $scope.commentParm
  212. }).success(function(data) {
  213. console.log(data);
  214. if (data.success) {
  215. $scope.commentlists = data.map.data.list;
  216. $scope.pageData = {
  217. "pageIndex": data.map.data.pageIndex,
  218. "pageSize": data.map.data.pageSize,
  219. "totalCounts": data.map.data.totalCounts,
  220. "totalPages": data.map.data.totalPages
  221. }
  222. }
  223. })
  224. }
  225. //添加数据
  226. $scope.addCommentData = function() {
  227. $state.go('app.step9');
  228. }
  229. //首页
  230. $scope.bmFirstPage = function() {
  231. $scope.commentParm.pageIndex = 1;
  232. $scope.getCommentData();
  233. }
  234. //上一页
  235. $scope.bmPrevPage = function() {
  236. if ($scope.commentParm.pageIndex > 1) {
  237. $scope.commentParm.pageIndex--;
  238. $scope.getCommentData();
  239. }
  240. }
  241. //下一页
  242. $scope.bmNextPage = function() {
  243. if ($scope.commentParm.pageIndex < $scope.pageData.totalPages) {
  244. $scope.commentParm.pageIndex++;
  245. $scope.getCommentData();
  246. }
  247. }
  248. //尾页
  249. $scope.bmLastPage = function() {
  250. $scope.commentParm.pageIndex = $scope.pageData.totalPages;
  251. $scope.getCommentData();
  252. }
  253. }])
  254. .controller('step9Ctrl', ['$scope', '$http', '$state', function($scope, $http, $state) {
  255. $('.mytab>li').eq(1).addClass('on').siblings().removeClass('on');
  256. $scope.sampleParm = {
  257. "yearId": "",
  258. "tryPercent": ""
  259. }
  260. $scope.launchParm = {
  261. "yearId": "",
  262. "tryPercent": "",
  263. "total": "",
  264. "executor": [],
  265. "time": ""
  266. }
  267. $scope.getSampleData = function() {
  268. $scope.sampleParm.tryPercent = parseFloat($scope.sampleParm.tryPercent / 100);
  269. $http.get(main_host + '/api/EvalCalibrationStudents', {
  270. params: $scope.sampleParm
  271. }).success(function(data) {
  272. console.log(data);
  273. if (data.success) {
  274. $scope.samplelists = data.map.provinces;
  275. $scope.sampletotle = data.map.total;
  276. }
  277. $scope.sampleParm.tryPercent = $scope.sampleParm.tryPercent * 100;
  278. });
  279. }
  280. //选择日期
  281. $scope.spEndTime = function() {
  282. laydate({
  283. elem: '#spEndTime',
  284. min: laydate.now(),
  285. choose: function(datas) {
  286. $scope.launchParm.time = datas;
  287. }
  288. });
  289. }
  290. //发起试评
  291. $scope.launchComment = function() {
  292. $scope.launchParm.yearId = $scope.sampleParm.yearId;
  293. $scope.launchParm.tryPercent = parseFloat($scope.sampleParm.tryPercent / 100);
  294. $scope.launchParm.total = $scope.sampletotle;
  295. console.log($scope.launchParm);
  296. if($scope.launchParm.yearId == '' || $scope.launchParm.tryPercent == '' || $scope.launchParm.total == 'underfined' || $scope.launchParm.executor.length == 0 || $scope.launchParm.time == ''){
  297. dialog({
  298. title:"提示",
  299. content:"请完善试评信息后再次发起试评",
  300. ok:function(){},
  301. okValue:"确定",
  302. cancel:function(){},
  303. cancelValue:"取消"
  304. }).showModal();
  305. }else{
  306. dialog({
  307. title:"提示",
  308. content:"是否发起试评",
  309. ok:function(){
  310. $http.post(main_host + '/api/EvalCalibrationInfos', $scope.launchParm).success(function(data) {
  311. if (data.success) {
  312. console.log(data);
  313. if (data.map.code == 1) {
  314. var d = dialog({
  315. title: "提示",
  316. content: data.map.msg,
  317. width: 200,
  318. height: 40,
  319. ok: function() {
  320. $state.go('app.step2');
  321. },
  322. okValue: "确定"
  323. }).showModal();
  324. }
  325. }
  326. })
  327. },
  328. okValue:"确定",
  329. cancel:function(){},
  330. cancelValue:"取消"
  331. }).showModal();
  332. }
  333. }
  334. //选择定标专家
  335. $scope.selectExpert = function() {
  336. $scope.expertname = [];
  337. var expertUserIdArr = [];
  338. var expertNameArr = [];
  339. var d = dialog({
  340. title: '选择专家',
  341. content: '',
  342. width: 500,
  343. ok: function() {
  344. var arr = [];
  345. $.each(expertUserIdArr, function(i, n) {
  346. arr.push(n);
  347. if (i % 2 == 1) {
  348. $scope.launchParm.executor.push(arr);
  349. arr = [];
  350. }
  351. });
  352. $(this).parent().html('<ul>' + $('#showExpert .group').html() + '</ul>');
  353. },
  354. okValue: '确定',
  355. cancel: function() {},
  356. cancelValue: '取消'
  357. }).showModal();
  358. $http.get(main_host + '/api/EvalCalibrationExecutors').success(function(data) {
  359. if (data.success) {
  360. $scope.dbexpertlists = data.map.data;
  361. d.content($('#showExpert'));
  362. }
  363. });
  364. $('#showExpert .list').off('click').on('click', 'label', function() {
  365. if (expertUserIdArr.length < 6) {
  366. var ename = $(this).text();
  367. var euserid = $(this).data('userid');
  368. $(this).parent().remove();
  369. expertUserIdArr.push(euserid);
  370. expertNameArr.push(ename);
  371. if ((expertUserIdArr.length) % 2 == 0) {
  372. $scope.$apply(function() {
  373. $scope.expertname.push(expertNameArr.join(' '));
  374. });
  375. expertNameArr = [];
  376. }
  377. }
  378. });
  379. }
  380. }])
  381. .controller('step3Ctrl', ['$scope', '$http', '$state', function($scope, $http, $state) {
  382. $('.mytab>li').eq(2).addClass('on').siblings().removeClass('on');
  383. $scope.calibrationParm = {
  384. "averageScoreStart": "",
  385. "averageScoreEnd": "",
  386. "executorName": "",
  387. "simpleType": "",
  388. "studentName": "",
  389. "pageIndex": 1,
  390. "pageSize": 20
  391. }
  392. $scope.pageData = {}
  393. $scope.getCalibrationData = function() {
  394. $http.get(main_host + '/api/EvalCalibrationSimples', {
  395. params: $scope.calibrationParm
  396. }).success(function(data) {
  397. console.log(data);
  398. if (data.success) {
  399. $scope.calibrationlists = data.map.data.list;
  400. $scope.pageData = {
  401. "pageIndex": data.map.data.pageIndex,
  402. "pageSize": data.map.data.pageSize,
  403. "totalCounts": data.map.data.totalCounts,
  404. "totalPages": data.map.data.totalPages
  405. }
  406. }
  407. })
  408. }
  409. //查询
  410. $scope.queryCalibration = function() {
  411. $scope.getCalibrationData();
  412. }
  413. //设置样本类型
  414. $scope.simpleParm = {
  415. "simpleType": ""
  416. }
  417. $scope.setSimplesType = function(id) {
  418. function putSimpleType(){
  419. $http.post(main_host + '/api/EvalCalibrationSimples/'+id, $scope.simpleParm).success(function(data) {
  420. if (data.success) {
  421. $scope.getCalibrationData();
  422. }
  423. });
  424. }
  425. dialog({
  426. title:"设置样本类型",
  427. content:$('.pop_simplestype'),
  428. ok:function(){
  429. putSimpleType();
  430. },
  431. okValue:"确定",
  432. cancel:function(){
  433. $scope.simpleParm.simpleType = "";
  434. putSimpleType();
  435. },
  436. cancelValue:"重置"
  437. }).showModal();
  438. }
  439. //选择标本类型
  440. $scope.selectSimpleType = function(type,row){
  441. $scope.simpleChecked = row;
  442. $scope.simpleParm.simpleType = type;
  443. }
  444. //首页
  445. $scope.bmFirstPage = function() {
  446. $scope.calibrationParm.pageIndex = 1;
  447. $scope.getCalibrationData();
  448. }
  449. //上一页
  450. $scope.bmPrevPage = function() {
  451. if ($scope.calibrationParm.pageIndex > 1) {
  452. $scope.calibrationParm.pageIndex--;
  453. $scope.getCalibrationData();
  454. }
  455. }
  456. //下一页
  457. $scope.bmNextPage = function() {
  458. if ($scope.calibrationParm.pageIndex < $scope.pageData.totalPages) {
  459. $scope.calibrationParm.pageIndex++;
  460. $scope.getCalibrationData();
  461. }
  462. }
  463. //尾页
  464. $scope.bmLastPage = function() {
  465. $scope.calibrationParm.pageIndex = $scope.pageData.totalPages;
  466. $scope.getCalibrationData();
  467. }
  468. }])
  469. .controller('step4Ctrl', ['$scope', '$http', '$state', function($scope, $http, $state) {
  470. $('.mytab>li').eq(3).addClass('on').siblings().removeClass('on');
  471. $scope.evaluationsParm = {
  472. "pageIndex": 1,
  473. "pageSize": 20
  474. }
  475. $scope.pageData = {}
  476. //获取历史分组评审
  477. $scope.getEvaluationsData = function() {
  478. $http.get(main_host + '/api/EvalRealEvaluations', {
  479. params: $scope.evaluationsParm
  480. }).success(function(data) {
  481. console.log(data);
  482. if (data.success) {
  483. $scope.evaluationslists = data.map.data.list;
  484. $scope.pageData = {
  485. "pageIndex": data.map.data.pageIndex,
  486. "pageSize": data.map.data.pageSize,
  487. "totalCounts": data.map.data.totalCounts,
  488. "totalPages": data.map.data.totalPages
  489. }
  490. }
  491. });
  492. }
  493. //首页
  494. $scope.bmFirstPage = function() {
  495. $scope.evaluationsParm.pageIndex = 1;
  496. $scope.getEvaluationsData();
  497. }
  498. //上一页
  499. $scope.bmPrevPage = function() {
  500. if ($scope.evaluationsParm.pageIndex > 1) {
  501. $scope.evaluationsParm.pageIndex--;
  502. $scope.getEvaluationsData();
  503. }
  504. }
  505. //下一页
  506. $scope.bmNextPage = function() {
  507. if ($scope.evaluationsParm.pageIndex < $scope.pageData.totalPages) {
  508. $scope.evaluationsParm.pageIndex++;
  509. $scope.getEvaluationsData();
  510. }
  511. }
  512. //尾页
  513. $scope.bmLastPage = function() {
  514. $scope.evaluationsParm.pageIndex = $scope.pageData.totalPages;
  515. $scope.getEvaluationsData();
  516. }
  517. //点击添加
  518. $scope.addEvaluations = function() {
  519. $state.go('app.step10');
  520. }
  521. }])
  522. .controller('step10Ctrl', ['$scope', '$http', '$state', function($scope, $http, $state) {
  523. $('.mytab>li').eq(3).addClass('on').siblings().removeClass('on');
  524. $scope.areaParm = {
  525. "areas": [],
  526. "pageIndex": 1,
  527. "pageSize": 20
  528. }
  529. $scope.launchParm = {
  530. "yearId": "",
  531. "areas": [],
  532. "executors": [],
  533. "time": ""
  534. }
  535. $scope.pageData = {}
  536. $scope.getAreaStdData = function() {
  537. $http.get(main_host + '/api/EvalAreaStudents', {
  538. params: $scope.areaParm
  539. }).success(function(data) {
  540. console.log(data);
  541. if (data.success) {
  542. $scope.areastdlists = data.map.data.list;
  543. $scope.pageData = {
  544. "pageIndex": data.map.data.pageIndex,
  545. "pageSize": data.map.data.pageSize,
  546. "totalCounts": data.map.data.totalCounts,
  547. "totalPages": data.map.data.totalPages
  548. }
  549. }
  550. });
  551. }
  552. //发起分组评审
  553. $scope.launchEvaluation = function() {
  554. console.log('---------- controller.js -------------');
  555. $scope.launchParm.areas = $scope.areaParm.areas;
  556. console.log($scope.launchParm)
  557. $http.post(main_host + '/api/EvalRealEvaluation', $scope.launchParm).success(function(data) {
  558. if (data.success) {
  559. console.log(data);
  560. }
  561. });
  562. }
  563. //选择日期
  564. $scope.psEndTime = function() {
  565. laydate({
  566. elem: '#psEndTime',
  567. min: laydate.now(),
  568. choose: function(datas) {
  569. $scope.launchParm.time = datas;
  570. }
  571. });
  572. }
  573. //查询学生数量
  574. $scope.queryAreaStdData = function(){
  575. $scope.getAreaStdData();
  576. }
  577. //首页
  578. $scope.bmFirstPage = function() {
  579. $scope.areaParm.pageIndex = 1;
  580. $scope.getAreaStdData();
  581. }
  582. //上一页
  583. $scope.bmPrevPage = function() {
  584. if ($scope.areaParm.pageIndex > 1) {
  585. $scope.areaParm.pageIndex--;
  586. $scope.getAreaStdData();
  587. }
  588. }
  589. //下一页
  590. $scope.bmNextPage = function() {
  591. if ($scope.areaParm.pageIndex < $scope.pageData.totalPages) {
  592. $scope.areaParm.pageIndex++;
  593. $scope.getAreaStdData();
  594. }
  595. }
  596. //尾页
  597. $scope.bmLastPage = function() {
  598. $scope.areaParm.pageIndex = $scope.pageData.totalPages;
  599. $scope.getAreaStdData();
  600. }
  601. //选择定标专家
  602. $scope.selectExpert = function() {
  603. $scope.expertname = [];
  604. var expertUserIdArr = [];
  605. var expertNameArr = [];
  606. var d = dialog({
  607. title: '选择专家',
  608. content: '',
  609. width: 500,
  610. ok: function() {
  611. var arr = [];
  612. $.each(expertUserIdArr, function(i, n) {
  613. arr.push(n);
  614. if (i % 2 == 1) {
  615. $scope.launchParm.executors.push(arr);
  616. arr = [];
  617. }
  618. });
  619. $(this).parent().html('<ul>' + $('#showExpert .group').html() + '</ul>');
  620. },
  621. okValue: '确定',
  622. cancel: function() {},
  623. cancelValue: '取消'
  624. }).showModal();
  625. $http.get(main_host + '/api/EvalReviewTeachers').success(function(data) {
  626. if (data.success) {
  627. $scope.dbexpertlists = data.map.data;
  628. d.content($('#showExpert'));
  629. }
  630. });
  631. $('#showExpert .list').off('click').on('click', 'label', function() {
  632. if (expertUserIdArr.length < 6) {
  633. var ename = $(this).text();
  634. var euserid = $(this).data('userid');
  635. $(this).parent().remove();
  636. expertUserIdArr.push(euserid);
  637. expertNameArr.push(ename);
  638. if ((expertUserIdArr.length) % 2 == 0) {
  639. $scope.$apply(function() {
  640. $scope.expertname.push(expertNameArr.join(' '));
  641. });
  642. expertNameArr = [];
  643. }
  644. }
  645. });
  646. }
  647. //选择高考区域
  648. $scope.selectExamArea = function() {
  649. getProvData();
  650. var provArr = [],cityArr = [], distArr = [];
  651. function areaPopBox(tit,fn){
  652. var d = dialog({
  653. title: tit,
  654. content: $('#showExamArea'),
  655. width: 500,
  656. ok:function(){
  657. if(fn){
  658. fn();
  659. }
  660. },
  661. okValue: '确定'
  662. }).showModal();
  663. }
  664. function getProvData() {
  665. $http.get(main_host + '/api/EvalStudentFzpsAreas').success(function(data) {
  666. if (data.success) {
  667. $scope.schoolprovs = data.map.data;
  668. areaPopBox('选择省份',function(){
  669. if(provArr.length > 1){
  670. for(k in provArr){
  671. $scope.areaParm.areas.push({
  672. "province":provArr[k],
  673. "city":"",
  674. "dist":""
  675. })
  676. }
  677. }else{
  678. getCityData(provArr[0]);
  679. }
  680. });
  681. }
  682. });
  683. }
  684. function getCityData(prov){
  685. $http.get(main_host + '/api/EvalStudentFzpsAreas/'+prov).success(function(data){
  686. if(data.success){
  687. $scope.schoolcity = data.map.data;
  688. areaPopBox('选择城市',function(){
  689. if(cityArr.length > 1){
  690. for(k in cityArr){
  691. $scope.areaParm.areas.push({
  692. "province":provArr[0],
  693. "city":cityArr[k],
  694. "dist":""
  695. })
  696. }
  697. }else{
  698. getDistData(cityArr[0]);
  699. }
  700. });
  701. }
  702. })
  703. }
  704. function getDistData(city){
  705. $http.get(main_host + '/api/EvalStudentFzpsAreas/'+city).success(function(data){
  706. if(data.success){
  707. $scope.schoolcity = data.map.data;
  708. areaPopBox('选择地区',function(){
  709. if(distArr.length > 1){
  710. for(k in distArr){
  711. $scope.areaParm.areas.push({
  712. "province":provArr[0],
  713. "city":cityArr[0],
  714. "dist":distArr[k]
  715. })
  716. }
  717. }else{
  718. $scope.areaParm.areas.push({
  719. "province":provArr[0],
  720. "city":cityArr[0],
  721. "dist":distArr[0]
  722. })
  723. }
  724. });
  725. }
  726. })
  727. }
  728. $('#showExamArea ul.prov').off('click').on('click','li',function(){
  729. if(provArr.indexOf($(this).text()) == -1){
  730. $(this).addClass('on');
  731. provArr.push($(this).text());
  732. }else{
  733. for(k in provArr){
  734. if(provArr[k] == $(this).text()){
  735. $(this).removeAttr('class');
  736. provArr.splice(k,1);
  737. }
  738. }
  739. }
  740. });
  741. $('#showExamArea ul.city').off('click').on('click','li',function(){
  742. if(cityArr.indexOf($(this).text()) == -1){
  743. $(this).addClass('on');
  744. cityArr.push($(this).text());
  745. }else{
  746. for(k in cityArr){
  747. if(cityArr[k] == $(this).text()){
  748. $(this).removeAttr('class');
  749. cityArr.splice(k,1);
  750. }
  751. }
  752. }
  753. });
  754. $('#showExamArea ul.dist').off('click').on('click','li',function(){
  755. if(distArr.indexOf($(this).text()) == -1){
  756. $(this).addClass('on');
  757. distArr.push($(this).text());
  758. }else{
  759. for(k in distArr){
  760. if(distArr[k] == $(this).text()){
  761. $(this).removeAttr('class');
  762. distArr.splice(k,1);
  763. }
  764. }
  765. }
  766. });
  767. }
  768. }])
  769. .controller('step5Ctrl', ['$scope', '$http', '$state', function($scope, $http, $state) {
  770. $('.mytab>li').eq(4).addClass('on').siblings().removeClass('on');
  771. //获取预发布数据
  772. $scope.prepublishParm = {
  773. "pageIndex": 1,
  774. "pageSize": 20
  775. }
  776. $scope.pageData = {}
  777. $scope.getPrePublishData = function() {
  778. $http.get(main_host + '/api/EvalPrepublishedStudents', {
  779. params: $scope.prepublishParm
  780. }).success(function(data) {
  781. if (data.success) {
  782. $scope.prepublishlists = data.map.data.list;
  783. console.log(data.map.data);
  784. $scope.pageData = {
  785. "pageIndex": data.map.data.pageIndex,
  786. "pageSize": data.map.data.pageSize,
  787. "totalCounts": data.map.data.totalCounts,
  788. "totalPages": data.map.data.totalPages
  789. }
  790. }
  791. });
  792. }
  793. $scope.choseArr = [];
  794. $scope.multipleChecked = function(x, z) {
  795. if (x) {
  796. if ($scope.choseArr.indexOf(z) == -1) {
  797. $scope.choseArr.push(z);
  798. }
  799. } else {
  800. for (k in $scope.choseArr) {
  801. if ($scope.choseArr[k] == z) {
  802. $scope.choseArr.splice(k,1);
  803. }
  804. }
  805. }
  806. }
  807. $scope.addPrePublish = function() {
  808. $state.go('app.step11');
  809. }
  810. $scope.delPrePublish = function() {
  811. $http.delete(main_host + '/api/EvalPrePublishs/'+$scope.choseArr.join(',')).success(function(data){
  812. if(data.success){
  813. $scope.getPrePublishData()
  814. }
  815. })
  816. }
  817. //首页
  818. $scope.bmFirstPage = function() {
  819. $scope.areaParm.pageIndex = 1;
  820. $scope.getAreaStdData();
  821. }
  822. //上一页
  823. $scope.bmPrevPage = function() {
  824. if ($scope.areaParm.pageIndex > 1) {
  825. $scope.areaParm.pageIndex--;
  826. $scope.getAreaStdData();
  827. }
  828. }
  829. //下一页
  830. $scope.bmNextPage = function() {
  831. if ($scope.areaParm.pageIndex < $scope.pageData.totalPages) {
  832. $scope.areaParm.pageIndex++;
  833. $scope.getAreaStdData();
  834. }
  835. }
  836. //尾页
  837. $scope.bmLastPage = function() {
  838. $scope.areaParm.pageIndex = $scope.pageData.totalPages;
  839. $scope.getAreaStdData();
  840. }
  841. }])
  842. .controller('step11Ctrl', ['$scope', '$http', '$state', function($scope, $http, $state) {
  843. $('.mytab>li').eq(4).addClass('on').siblings().removeClass('on');
  844. $scope.prepublishstdParm = {
  845. "province":"",
  846. "sex":"",
  847. "wenliType":"",
  848. "pageIndex":1,
  849. "pageSize":20
  850. }
  851. //获取待预发布考生
  852. $scope.pageData = {}
  853. $scope.getPrePublishStdData = function(){
  854. $http.get(main_host + '/api/EvalPrePublishStudents',{params:$scope.prepublishstdParm}).success(function(data){
  855. if(data.success){
  856. $scope.prepublishstdlists = data.map.data.list;
  857. $scope.pageData = {
  858. "pageIndex": data.map.data.pageIndex,
  859. "pageSize": data.map.data.pageSize,
  860. "totalCounts": data.map.data.totalCounts,
  861. "totalPages": data.map.data.totalPages
  862. }
  863. }
  864. })
  865. }
  866. //查询学生数据
  867. $scope.queryPrePublishStd = function(){
  868. $scope.getPrePublishStdData();
  869. }
  870. $scope.choseArr = [];
  871. $scope.multipleChecked = function(x, z) {
  872. if (x) {
  873. if ($scope.choseArr.indexOf(z) == -1) {
  874. $scope.choseArr.push(z);
  875. }
  876. } else {
  877. for (k in $scope.choseArr) {
  878. if ($scope.choseArr[k] == z) {
  879. $scope.choseArr.splice(k,1);
  880. }
  881. }
  882. }
  883. }
  884. //发起初审
  885. $scope.launchpreParm = {
  886. "studentIds":$scope.choseArr
  887. }
  888. $scope.launchPrePublish = function(){
  889. $http.post(main_host + '/api/EvalPrePublishs',$scope.launchpreParm).success(function(data){
  890. if(data.success){
  891. console.log(data);
  892. }
  893. });
  894. }
  895. //首页
  896. $scope.bmFirstPage = function() {
  897. $scope.areaParm.pageIndex = 1;
  898. $scope.getAreaStdData();
  899. }
  900. //上一页
  901. $scope.bmPrevPage = function() {
  902. if ($scope.areaParm.pageIndex > 1) {
  903. $scope.areaParm.pageIndex--;
  904. $scope.getAreaStdData();
  905. }
  906. }
  907. //下一页
  908. $scope.bmNextPage = function() {
  909. if ($scope.areaParm.pageIndex < $scope.pageData.totalPages) {
  910. $scope.areaParm.pageIndex++;
  911. $scope.getAreaStdData();
  912. }
  913. }
  914. //尾页
  915. $scope.bmLastPage = function() {
  916. $scope.areaParm.pageIndex = $scope.pageData.totalPages;
  917. $scope.getAreaStdData();
  918. }
  919. }])
  920. .controller('step6Ctrl', ['$scope', '$http', '$state', function($scope, $http, $state) {
  921. $('.mytab>li').eq(5).addClass('on').siblings().removeClass('on');
  922. $scope.releaseParm = {
  923. "province": "",
  924. "name": "",
  925. "status": "",
  926. "pageIndex": 1,
  927. "pageSize": 20
  928. }
  929. //获取已经预发布的考生
  930. $scope.pageData = {}
  931. $scope.getReleaseStdData = function() {
  932. $http.get(main_host+'/api/EvalPrepublishedStudents',{params:$scope.releaseParm}).success(function(data){
  933. if(data.success){
  934. console.log(data);
  935. $scope.releaselists = data.map.data.list;
  936. $scope.pageData = {
  937. "pageIndex": data.map.data.pageIndex,
  938. "pageSize": data.map.data.pageSize,
  939. "totalCounts": data.map.data.totalCounts,
  940. "totalPages": data.map.data.totalPages
  941. }
  942. }
  943. })
  944. }
  945. //获取预发布的考生所在高中区域
  946. $scope.getPrePublishProvinces = function(){
  947. $http.get(main_host+'/api/EvalPrepublishedStudentAreas').success(function(data){
  948. console.log(data);
  949. if(data.success){
  950. $scope.provinces = data.map.provinces;
  951. }
  952. })
  953. }
  954. //查询预发布的考生
  955. $scope.queryReleaseStd = function(){
  956. $scope.getReleaseStdData();
  957. }
  958. $scope.publishParm = {
  959. "students":$scope.choseArr,
  960. "feedbackTime":""
  961. }
  962. $scope.choseArr = [];
  963. $scope.multipleChecked = function(x, z) {
  964. if (x) {
  965. if ($scope.choseArr.indexOf(z) == -1) {
  966. $scope.choseArr.push(z);
  967. }
  968. } else {
  969. for (k in $scope.choseArr) {
  970. if ($scope.choseArr[k] == z) {
  971. $scope.choseArr.splice(k,1);
  972. }
  973. }
  974. }
  975. }
  976. $scope.zsEndTime = function() {
  977. laydate({
  978. elem: '#zsEndTime',
  979. min: laydate.now(),
  980. choose: function(datas) {
  981. $scope.publishParm.feedbackTime = datas;
  982. }
  983. });
  984. }
  985. //正式发布
  986. $scope.releasePublish = function(){
  987. $http.post(main_host + '/api/EvalPublishStudents',$scope.publishParm).success(function(data){
  988. if(data.success){
  989. console.log(data);
  990. }
  991. })
  992. }
  993. }])
  994. .controller('step7Ctrl', ['$scope', '$http', '$state', function($scope, $http, $state) {
  995. $('.mytab>li').eq(6).addClass('on').siblings().removeClass('on');
  996. $scope.abilitytestParm = {
  997. "province": "",
  998. "name": "",
  999. "accepted": "",
  1000. "pageIndex": 1,
  1001. "pageSize": 20
  1002. }
  1003. $scope.pageData = {}
  1004. //获取能力测试数据
  1005. $scope.getAbilityTestData = function() {
  1006. $http.get(main_host + '/api/EvalAbilityTestStudents', {
  1007. params: $scope.abilitytestParm
  1008. }).success(function(data) {
  1009. if (data.success) {
  1010. console.log(data);
  1011. $scope.abilitytestlists = data.map.data.list;
  1012. $scope.pageData = {
  1013. "pageIndex": data.map.data.pageIndex,
  1014. "pageSize": data.map.data.pageSize,
  1015. "totalCounts": data.map.data.totalCounts,
  1016. "totalPages": data.map.data.totalPages
  1017. }
  1018. }
  1019. });
  1020. }
  1021. //查询
  1022. $scope.queryAbilityTestData = function() {
  1023. console.log($scope.abilitytestParm);
  1024. $scope.getAbilityTestData();
  1025. }
  1026. //导出
  1027. $scope.exportAbilityTestData = function(){
  1028. $http.get(main_host + '/api/EvalAbilityStudentExports', {
  1029. params: $scope.abilitytestParm
  1030. }).success(function(data) {});
  1031. }
  1032. //首页
  1033. $scope.bmFirstPage = function() {
  1034. $scope.allstdParm.pageIndex = 1;
  1035. $scope.getAbilityTestData();
  1036. }
  1037. //上一页
  1038. $scope.bmPrevPage = function() {
  1039. if ($scope.allstdParm.pageIndex > 1) {
  1040. $scope.allstdParm.pageIndex--;
  1041. $scope.getAbilityTestData();
  1042. }
  1043. }
  1044. //下一页
  1045. $scope.bmNextPage = function() {
  1046. if ($scope.allstdParm.pageIndex < $scope.pageData.totalPages) {
  1047. $scope.allstdParm.pageIndex++;
  1048. $scope.getAbilityTestData();
  1049. }
  1050. }
  1051. //尾页
  1052. $scope.bmLastPage = function() {
  1053. $scope.allstdParm.pageIndex = $scope.pageData.totalPages;
  1054. $scope.getAbilityTestData();
  1055. }
  1056. }])
  1057. .controller('step8Ctrl', ['$scope', '$http', '$state', '$rootScope', function($scope, $http, $state, $rootScope) {
  1058. $('.mytab>li').eq(7).addClass('on').siblings().removeClass('on');
  1059. $scope.allstdParm = {
  1060. "province": "",
  1061. "name": "",
  1062. "wenliType": "",
  1063. "studentType": "",
  1064. "sex": "",
  1065. "pageIndex": 1,
  1066. "pageSize": 20
  1067. }
  1068. $scope.pageData = {}
  1069. //获取所有学生数据
  1070. $scope.getAllStdData = function() {
  1071. $http.get(main_host + '/api/EvalAllStudents',{
  1072. params: $scope.allstdParm
  1073. }).success(function(data) {
  1074. console.log(data);
  1075. if (data.success) {
  1076. $scope.allstdlists = data.map.data.list;
  1077. $scope.pageData = {
  1078. "pageIndex": data.map.data.pageIndex,
  1079. "pageSize": data.map.data.pageSize,
  1080. "totalCounts": data.map.data.totalCounts,
  1081. "totalPages": data.map.data.totalPages
  1082. }
  1083. }
  1084. })
  1085. }
  1086. $scope.getAllProvList = function() {
  1087. $http.get(main_host + '/api/EvalStudentAreas').success(function(data) {
  1088. if (data.success) {
  1089. $scope.stdprovlists = data.map.data;
  1090. }
  1091. });
  1092. }
  1093. //导出数据
  1094. $scope.exportsStdData = function() {
  1095. $http.get(main_host + '/api/EvalStatisticsStudentExports', {
  1096. params: $scope.allstdParm
  1097. }).success(function(data) {
  1098. if (data.success) {
  1099. console.log(EvalStatisticsStudentExports)
  1100. }
  1101. })
  1102. }
  1103. //查询
  1104. $scope.queryAllStdData = function() {
  1105. console.log();
  1106. $scope.getAllStdData();
  1107. }
  1108. //首页
  1109. $scope.bmFirstPage = function() {
  1110. $scope.allstdParm.pageIndex = 1;
  1111. $scope.getAllStdData();
  1112. }
  1113. //上一页
  1114. $scope.bmPrevPage = function() {
  1115. if ($scope.allstdParm.pageIndex > 1) {
  1116. $scope.allstdParm.pageIndex--;
  1117. $scope.getAllStdData();
  1118. }
  1119. }
  1120. //下一页
  1121. $scope.bmNextPage = function() {
  1122. if ($scope.allstdParm.pageIndex < $scope.pageData.totalPages) {
  1123. $scope.allstdParm.pageIndex++;
  1124. $scope.getAllStdData();
  1125. }
  1126. }
  1127. //尾页
  1128. $scope.bmLastPage = function() {
  1129. $scope.allstdParm.pageIndex = $scope.pageData.totalPages;
  1130. $scope.getAllStdData();
  1131. }
  1132. $scope.lookStdDetail = function(id) {
  1133. console.log($rootScope.$state.go('detail'));
  1134. $state.go('detail');
  1135. }
  1136. }]);