childschoolFees.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. /**
  2. * 学杂费补助管理初始化
  3. */
  4. var ChildschoolFees = {
  5. id: "ChildschoolFeesTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. ChildschoolFees.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {
  17. title: '申报年度',
  18. field: 'year',
  19. visible: true,
  20. align: 'center',
  21. valign: 'middle',
  22. width: "80px",
  23. 'class': 'uitd_showTip'
  24. },
  25. {
  26. title: '企业名称',
  27. field: 'enterpriseName',
  28. visible: true,
  29. align: 'center',
  30. valign: 'middle',
  31. width: "120px",
  32. 'class': 'uitd_showTip'
  33. },
  34. {
  35. title: '父母姓名',
  36. field: 'pName',
  37. visible: true,
  38. align: 'center',
  39. valign: 'middle',
  40. width: "150px",
  41. 'class': 'uitd_showTip',
  42. formatter: function (value, row, index) {
  43. if (row.pSex == 1) {
  44. return value + '<span style="color:#6495ED">【男】</span>';
  45. }
  46. if (row.pSex == 2) {
  47. return value + '<span style="color:#FF82AB">【女】</span>';
  48. }
  49. }
  50. },
  51. {
  52. title: '父母证件号码',
  53. field: 'pIdcard',
  54. visible: true,
  55. align: 'center',
  56. valign: 'middle',
  57. width: "150px",
  58. 'class': 'uitd_showTip'
  59. },
  60. {
  61. title: '人才层次',
  62. field: 'talentArrangeName',
  63. visible: true,
  64. align: 'center',
  65. valign: 'middle',
  66. width: "100px",
  67. 'class': 'uitd_showTip'
  68. },
  69. // {title: '人才编号', field: 'certificateNo', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  70. {
  71. title: '籍贯',
  72. field: 'nativePlace',
  73. visible: true,
  74. align: 'center',
  75. valign: 'middle',
  76. width: "100px",
  77. 'class': 'uitd_showTip'
  78. },
  79. {
  80. title: '联系电话',
  81. field: 'phone',
  82. visible: true,
  83. align: 'center',
  84. valign: 'middle',
  85. width: "100px",
  86. 'class': 'uitd_showTip'
  87. },
  88. {
  89. title: '子女姓名',
  90. field: 'cName',
  91. visible: true,
  92. align: 'center',
  93. valign: 'middle',
  94. width: "120px",
  95. 'class': 'uitd_showTip',
  96. formatter: function (value, row, index) {
  97. if (row.cSex == 1) {
  98. return value + '<span style="color:#6495ED">【男】</span>';
  99. }
  100. if (row.cSex == 2) {
  101. return value + '<span style="color:#FF82AB">【女】</span>';
  102. }
  103. }
  104. },
  105. {
  106. title: '子女证件号码',
  107. field: 'cIdcard',
  108. visible: true,
  109. align: 'center',
  110. valign: 'middle',
  111. width: "150px",
  112. 'class': 'uitd_showTip'
  113. },
  114. // {title: '子女出生日期', field: 'cBirthday', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  115. {
  116. title: '与申报人关系',
  117. field: 'cRelationName',
  118. visible: true,
  119. align: 'center',
  120. valign: 'middle',
  121. width: "120px",
  122. 'class': 'uitd_showTip'
  123. },
  124. {
  125. title: '现就读学校',
  126. field: 'nowSchool',
  127. visible: true,
  128. align: 'center',
  129. valign: 'middle',
  130. width: "100px",
  131. 'class': 'uitd_showTip'
  132. },
  133. {
  134. title: '现就读年级',
  135. field: 'nowGradeName',
  136. visible: true,
  137. align: 'center',
  138. valign: 'middle',
  139. width: "100px",
  140. 'class': 'uitd_showTip'
  141. },
  142. {
  143. title: '实缴学杂费金额',
  144. field: 'paidInMoeny',
  145. visible: true,
  146. align: 'center',
  147. valign: 'middle',
  148. width: "120px",
  149. 'class': 'uitd_showTip'
  150. },
  151. {
  152. title: '开户银行网点',
  153. field: 'bankAddress',
  154. visible: true,
  155. align: 'center',
  156. valign: 'middle',
  157. width: "120px",
  158. 'class': 'uitd_showTip'
  159. },
  160. {
  161. title: '银行账号',
  162. field: 'bankNumber',
  163. visible: true,
  164. align: 'center',
  165. valign: 'middle',
  166. width: "130px",
  167. 'class': 'uitd_showTip'
  168. },
  169. {
  170. title: '兑现金额',
  171. field: 'cashMoney',
  172. visible: true,
  173. align: 'center',
  174. valign: 'middle',
  175. width: "100px",
  176. 'class': 'uitd_showTip'
  177. },
  178. {
  179. title: '审核状态',
  180. field: 'checkState',
  181. visible: true,
  182. align: 'center',
  183. valign: 'middle',
  184. width: "100px",
  185. 'class': 'uitd_showTip',
  186. formatter: function (value, row, index) {
  187. if (value == -1) {
  188. return '<span class=\'label label-danger\'>审核不通过</span>';
  189. }
  190. if (value == 1) {
  191. return '<span class=\'label\'>待提交</span>';
  192. }
  193. if (value == 2) {
  194. return '<span class=\'label label-info\'>待审核</span>';
  195. }
  196. if (value == 3) {
  197. return '<span class=\'label label-success\'>重新提交</span>';
  198. }
  199. if (value == 4) {
  200. return '<span class=\'label label-danger\'>审核驳回</span>';
  201. }
  202. if (value == 5) {
  203. return '<span class=\'label label-primary\'>审核通过</span>';
  204. }
  205. }
  206. },
  207. {
  208. title: '公示状态',
  209. field: 'publicState',
  210. visible: true,
  211. align: 'center',
  212. valign: 'middle',
  213. width: "100px",
  214. 'class': 'uitd_showTip',
  215. formatter: function (value, row, index) {
  216. if (value == 1) {
  217. return '<span class=\'label label-success\'>待公示</span>';
  218. }
  219. if (value == 2) {
  220. return '<span class=\'label label-danger\'>公示中</span>';
  221. }
  222. if (value == 3) {
  223. return '<span class=\'label label-info\'>待兑现</span>';
  224. }
  225. if (value == 4) {
  226. return '<span class=\'label label-primary\'>已兑现</span>';
  227. }
  228. }
  229. },
  230. {
  231. title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  232. formatter: function (value, row, index) {
  233. return "<span class='label label-success' onclick=\"ChildschoolFees.showLog('" + value + "')\" >" +
  234. "<i class=\"fa fa-book\"></i>日志" +
  235. "</span>";
  236. }
  237. }
  238. ];
  239. };
  240. /**
  241. * 检查是否选中
  242. */
  243. ChildschoolFees.check = function () {
  244. var selected = $('#' + this.id).bootstrapTable('getSelections');
  245. if (selected.length == 0) {
  246. Feng.info("请先选中表格中的某一记录!");
  247. return false;
  248. } else {
  249. ChildschoolFees.seItem = selected[0];
  250. return true;
  251. }
  252. };
  253. /**
  254. * 收集数据
  255. */
  256. ChildschoolFees.formParams = function () {
  257. var queryData = {};
  258. queryData['year'] = $("#year").val();
  259. queryData['enterpriseName'] = $("#enterpriseName").val();
  260. queryData['pName'] = $("#pName").val();
  261. queryData['pSex'] = $("#pSex").val();
  262. queryData['pCardType'] = $("#pCardType").val();
  263. queryData['pIdcard'] = $("#pIdcard").val();
  264. queryData['talentArrange'] = $("#talentArrange").val();
  265. queryData['certificateNo'] = $("#certificateNo").val();
  266. queryData['address'] = $("#address").val();
  267. queryData['phone'] = $("#phone").val();
  268. queryData['cName'] = $("#cName").val();
  269. queryData['cSex'] = $("#cSex").val();
  270. queryData['cCardType'] = $("#cCardType").val();
  271. queryData['cIdcard'] = $("#cIdcard").val();
  272. queryData['cRelation'] = $("#cRelation").val();
  273. queryData['nowSchool'] = $("#nowSchool").val();
  274. queryData['nowGrade'] = $("#nowGrade").val();
  275. queryData['checkState'] = $("#checkState").val();
  276. return queryData;
  277. }
  278. /**
  279. * 重置
  280. */
  281. ChildschoolFees.reset = function () {
  282. $("#year").val("");
  283. $("#enterpriseName").val("");
  284. $("#pName").val("");
  285. $("#pSex").val("");
  286. $("#pCardType").val("");
  287. $("#pIdcard").val("");
  288. $("#talentArrange").val("");
  289. $("#certificateNo").val("");
  290. $("#address").val("");
  291. $("#phone").val("");
  292. $("#cName").val("");
  293. $("#cSex").val("");
  294. $("#cCardType").val("");
  295. $("#cIdcard").val("");
  296. $("#cRelation").val("");
  297. $("#nowSchool").val("");
  298. $("#nowGrade").val("");
  299. $("#checkState").val("");
  300. }
  301. /**
  302. * 查询学杂费补助列表
  303. */
  304. ChildschoolFees.search = function () {
  305. ChildschoolFees.table.refresh({query: ChildschoolFees.formParams()});
  306. };
  307. /**
  308. * 显示审核日志
  309. */
  310. ChildschoolFees.showLog = function (id) {
  311. layer.open({
  312. type: 1,
  313. title: "日志",
  314. fixed: false,
  315. content: '<table id="' + id + '"></table>',
  316. area: ['80%', '80%'],
  317. maxmin: true,
  318. success: function (layero, index) {
  319. Feng.getCheckLog(id, {"type": CONFIG.project_schoolFees, "mainId": id, "typeFileId": "", "active": 1})
  320. }
  321. });
  322. }
  323. ChildschoolFees.openCheckChildschoolFees = function () {
  324. if (this.check()) {
  325. var index = layer.open({
  326. type: 2,
  327. title: '学杂费补助审核',
  328. area: 'auto', //宽高
  329. fix: false, //不固定
  330. maxmin: true,
  331. content: Feng.ctxPath + '/childschoolFees/toCheckPage/' + ChildschoolFees.seItem.id,
  332. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-check layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  333. btnAlign: 'c',
  334. btn1: function (index, layero) {
  335. var obj = layero.find("iframe")[0].contentWindow;
  336. obj.ChildschoolFeesInfoDlg.showCheckModal();
  337. }, btn2: function (index, layero) {
  338. var obj = layero.find("iframe")[0].contentWindow;
  339. obj.ChildschoolFeesInfoDlg.submitCheck();
  340. return false;
  341. },
  342. success: function (layero, index) {
  343. layer.tips('审核完成并确认无误后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  344. },
  345. end: function () {
  346. layer.closeAll('tips');
  347. }
  348. });
  349. ChildschoolFees.layerIndex = index;
  350. layer.full(index);
  351. }
  352. }
  353. /**
  354. * 显示需要处理的数据
  355. * @param type
  356. */
  357. ChildschoolFees.showDataCheckModal = function (type) {
  358. $("#hczxForm").css("display", "none");
  359. switch (type) {
  360. case 1: //公式预览
  361. $("#hczxButton").attr("onclick", "ChildschoolFees.publicExport()").text("导出");
  362. $("#exportCommonModalLabel").text("公式预览");
  363. break;
  364. case 2: //待核查征信名单-核查征信通过
  365. $("#hczxButton").attr("onclick", "ChildschoolFees.public()").text("提交");
  366. $("#exportCommonModalLabel").text("公示");
  367. $("#hczxForm").css("display", "block");
  368. $(".time").each(function () {
  369. laydate.render({
  370. elem: "#" + $(this).attr("id")
  371. , type: 'date'
  372. , format: 'yyyy年MM月dd日'
  373. });
  374. });
  375. break;
  376. case 3: //公示通过
  377. $("#hczxButton").attr("onclick", "ChildschoolFees.publicPass()").text("提交");
  378. $("#exportCommonModalLabel").text("批量公示通过");
  379. break;
  380. case 4: //兑现
  381. $("#hczxButton").attr("onclick", "ChildschoolFees.cash()").text("兑现");
  382. $("#exportCommonModalLabel").text("兑现");
  383. break;
  384. }
  385. $('#dataTable').bootstrapTable('destroy');
  386. $('#dataTable').bootstrapTable({
  387. url: Feng.ctxPath + "/childschoolFees/selectNeedCheckData?type=" + type,
  388. method: 'POST',
  389. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  390. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  391. showRefresh: false, // 是否显示刷新按钮
  392. clickToSelect: true, // 是否启用点击选中行
  393. singleSelect: false, // 设置True 将禁止多选
  394. striped: true, // 是否显示行间隔色
  395. pagination: true, // 设置为 true 会在表格底部显示分页条
  396. paginationHAlign: "left",
  397. paginationDetailHAlign: "right",
  398. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  399. pageNumber: 1, //初始化加载第一页,默认第一页
  400. pageSize: 10, //每页的记录行数(*)
  401. pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*)
  402. maintainSelected: true, //全表全选需要开启
  403. showColumns: false,
  404. responseHandler: function (res) {
  405. $("#exportCommonModal").modal("show");
  406. return res.obj.rows;
  407. },
  408. columns:
  409. [
  410. {field: "selectItem", checkbox: true},
  411. {title: '父母姓名', field: 'pName', visible: true, align: 'center', valign: 'middle', width: "10%"},
  412. {title: '父母证件号码', field: 'pIdcard', visible: true, align: 'center', valign: 'middle', width: "30%"},
  413. {title: '子女姓名', field: 'cName', visible: true, align: 'center', valign: 'middle', width: "10%"},
  414. {title: '子女证件号码', field: 'cIdcard', visible: true, align: 'center', valign: 'middle', width: "30%"},
  415. {
  416. title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "10%",
  417. formatter: function (value, row, index) {
  418. if (value == -1) {
  419. return "<span style='color: #ed5565;'>审核不通过</span>";
  420. }
  421. if (value == 5) {
  422. return "<span style='color: #1ab394;'>审核通过</span>";
  423. }
  424. }
  425. },
  426. ]
  427. });
  428. }
  429. /**
  430. * 是否发送短信
  431. */
  432. ChildschoolFees.toggleMessage = function () {
  433. var isMessage = $("input[name='isSend']:checked").val();
  434. if (isMessage == 1) {
  435. $("#messageEdit").css("display", "block");
  436. } else if (isMessage == 2) {
  437. $("#messageEdit").css("display", "none");
  438. }
  439. }
  440. ChildschoolFees.prepareSearch = function () {
  441. var sex = $("#pub_sex").val();
  442. var checkState = $("#pub_checkState").val();
  443. var name = $("#pub_name").val();
  444. $('#dataTable').bootstrapTable("refresh", {"query": {"cSex": sex, "checkState": checkState, "cName": name}});
  445. }
  446. ChildschoolFees.prepareReset = function () {
  447. $("#pub_sex").val("");
  448. $("#pub_checkState").val("");
  449. $("#pub_name").val("");
  450. }
  451. /**
  452. * 公式预览
  453. */
  454. ChildschoolFees.publicExport = function () {
  455. var selected = $('#dataTable').bootstrapTable('getSelections');
  456. if (!selected || selected.length < 1) {
  457. Feng.info("请至少选择一行数据!");
  458. return;
  459. }
  460. var ids = "";
  461. for (var i = 0; i < selected.length; i++) {
  462. ids = ids + selected[i].id + ",";
  463. }
  464. var operation = function () {
  465. $("#exportCommonModal").modal("hide");
  466. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/childschoolFees/exportPublic?ids=" + ids));
  467. }
  468. Feng.confirm("确定要公示预览吗?", operation);
  469. }
  470. /**
  471. * 公示
  472. */
  473. ChildschoolFees.public = function () {
  474. var selected = $('#dataTable').bootstrapTable('getSelections');
  475. if (!selected || selected.length < 1) {
  476. Feng.info("请至少选择一行数据!");
  477. return;
  478. }
  479. var ids = "";
  480. for (var i = 0; i < selected.length; i++) {
  481. ids = ids + selected[i].id + ",";
  482. }
  483. var isMessage = $("input[name='isSend']:checked").val();
  484. var typeName = $("#typeName").val();
  485. var address = $("#web").val();
  486. var publicStartTime = $("#publicStartTime").val();
  487. var publicEndTime = $("#publicEndTime").val();
  488. var dep = $("#dep").val();
  489. var phone = $("#fyphone").val();
  490. var email = $("#fyemail").val();
  491. if (isMessage == 1) {
  492. if (typeName == null || typeName == '') {
  493. Feng.info("请填写公示类型");
  494. return;
  495. }
  496. if (address == null || address == '') {
  497. Feng.info("请填写公示平台");
  498. return;
  499. }
  500. if (publicStartTime == null || publicStartTime == '') {
  501. Feng.info("请填写公示开始时间");
  502. return;
  503. }
  504. if (publicEndTime == null || publicEndTime == '') {
  505. Feng.info("请填写公示截止时间");
  506. return;
  507. }
  508. if (dep == null || dep == '') {
  509. Feng.info("请填写反映单位");
  510. return;
  511. }
  512. if (phone == null || phone == '') {
  513. Feng.info("请填写联系电话");
  514. return;
  515. }
  516. if (email == null || email == '') {
  517. Feng.info("请填写联系邮箱");
  518. return;
  519. }
  520. }
  521. var operation = function () {
  522. var ajax = new $ax(Feng.ctxPath + "/childschoolFees/publicBatch", function (data) {
  523. if (data.code == 200) {
  524. Feng.success(data.msg);
  525. ChildschoolFees.table.refresh();
  526. $("#exportCommonModal").modal("hide");
  527. } else {
  528. Feng.error(data.msg);
  529. }
  530. }, function (data) {
  531. Feng.error("公示失败!" + data.responseJSON.message + "!");
  532. });
  533. ajax.set("ids", ids);
  534. ajax.set("typeName", typeName);
  535. ajax.set("address", address);
  536. ajax.set("publicStartTime", publicStartTime);
  537. ajax.set("publicEndTime", publicEndTime);
  538. ajax.set("dep", dep);
  539. ajax.set("phone", phone);
  540. ajax.set("email", email);
  541. ajax.set("isMessage", isMessage);
  542. ajax.start();
  543. }
  544. Feng.confirm("确定要公示吗?", operation);
  545. }
  546. /**
  547. * 公示后审核
  548. */
  549. ChildschoolFees.afterCheck = function () {
  550. if (this.check()) {
  551. var ajax = new $ax(Feng.ctxPath + "/childschoolFees/validateIsCheck", function (data) {
  552. if (data.code == 200) {
  553. layer.open({
  554. type: 1,
  555. id: "neewFieldFormModel",
  556. title: '公示再审核',
  557. area: ['800px', '450px'], //宽高
  558. fix: false, //不固定
  559. shade: 0,
  560. maxmin: true,
  561. content: ChildschoolFees.creatFieldCheckModal(),
  562. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  563. btnAlign: 'c',
  564. zIndex: layer.zIndex,
  565. success: function (layero, index) {
  566. layer.setTop(layero);
  567. },
  568. yes: function (index, layero) {
  569. var checkState = $("#checkStateModel").val();
  570. var checkMsg = $("#checkMsg").val();
  571. if (checkState == null || checkState == '') {
  572. Feng.info("请选择审核状态");
  573. return;
  574. }
  575. if (checkMsg == null || checkMsg == '') {
  576. Feng.info("请填写审核意见");
  577. return;
  578. }
  579. var ajax = new $ax(Feng.ctxPath + "/childschoolFees/afterCheck", function (data) {
  580. if (data.code == 200) {
  581. layer.close(index);
  582. ChildschoolFees.table.refresh();
  583. Feng.success(data.msg);
  584. } else {
  585. Feng.error(data.msg);
  586. }
  587. }, function (data) {
  588. Feng.error("审核失败!" + data.responseJSON.message + "!");
  589. });
  590. ajax.setData({"id": ChildschoolFees.seItem.id, "checkState": checkState, "checkMsg": checkMsg});
  591. ajax.start();
  592. }
  593. });
  594. } else {
  595. Feng.error(data.msg);
  596. }
  597. }, function (data) {
  598. Feng.error("校验失败!" + data.responseJSON.message + "!");
  599. });
  600. ajax.set("id", ChildschoolFees.seItem.id);
  601. ajax.set("process", 2);
  602. ajax.start();
  603. }
  604. }
  605. /**
  606. *
  607. */
  608. ChildschoolFees.creatFieldCheckModal = function () {
  609. return '<form id="checkForm">\n' +
  610. ' <div class="form-group" style="margin: 10px;">\n' +
  611. ' <label for="checkState" class="control-label">审核状态</label>\n' +
  612. ' <select class="form-control" id="checkStateModel" >\n' +
  613. ' <option value="">请选择</option>\n' +
  614. ' <option value="4">审核驳回</option>\n' +
  615. ' <option value="-1">审核不通过</option>\n' +
  616. ' </select>\n' +
  617. ' </div>\n' +
  618. ' <div class="form-group" style="margin: 10px;">\n' +
  619. ' <label for="checkMsg" class="control-label" >审核意见</label>\n' +
  620. ' <textarea class="form-control" id="checkMsg" rows="6"></textarea>\n' +
  621. ' </div>\n' +
  622. ' </form>';
  623. }
  624. /**
  625. * 公示通过
  626. */
  627. ChildschoolFees.publicPass = function () {
  628. var selected = $('#dataTable').bootstrapTable('getSelections');
  629. if (!selected || selected.length < 1) {
  630. Feng.info("请至少选择一行数据!");
  631. return;
  632. }
  633. var ids = "";
  634. for (var i = 0; i < selected.length; i++) {
  635. ids = ids + selected[i].id + ",";
  636. }
  637. var operation = function () {
  638. var ajax = new $ax(Feng.ctxPath + "/childschoolFees/publicPass", function (data) {
  639. if (data.code == 200) {
  640. Feng.success(data.msg);
  641. ChildschoolFees.table.refresh();
  642. $("#exportCommonModal").modal("hide");
  643. } else {
  644. Feng.error(data.msg);
  645. }
  646. }, function (data) {
  647. Feng.error("公示通过失败!" + data.responseJSON.message + "!");
  648. });
  649. ajax.set("ids", ids);
  650. ajax.start();
  651. }
  652. Feng.confirm("一旦提交无法修改,确定公示通过吗?", operation);
  653. }
  654. /**
  655. * 兑现
  656. */
  657. ChildschoolFees.cash = function () {
  658. var selected = $('#dataTable').bootstrapTable('getSelections');
  659. if (!selected || selected.length < 1) {
  660. Feng.info("请至少选择一行数据!");
  661. return;
  662. }
  663. var ids = "";
  664. for (var i = 0; i < selected.length; i++) {
  665. ids = ids + selected[i].id + ",";
  666. }
  667. var operation = function () {
  668. var ajax = new $ax(Feng.ctxPath + "/childschoolFees/cash", function (data) {
  669. if (data.code == 200) {
  670. Feng.success(data.msg);
  671. ChildschoolFees.table.refresh();
  672. $("#exportCommonModal").modal("hide");
  673. } else {
  674. Feng.error(data.msg);
  675. }
  676. }, function (data) {
  677. Feng.error("兑现失败!" + data.responseJSON.message + "!");
  678. });
  679. ajax.set("ids", ids);
  680. ajax.start();
  681. }
  682. Feng.confirm("一旦兑现无法修改,确定兑现吗?", operation);
  683. }
  684. /**
  685. * 显示导出模态框
  686. */
  687. ChildschoolFees.showExportModel = function(){
  688. $("#exportForm")[0].reset();
  689. $("#basicExportModal").modal("show");
  690. }
  691. /**
  692. * 导出基础信息
  693. */
  694. ChildschoolFees.export = function(){
  695. var names = '';
  696. var values = '';
  697. $("#field_info li input").each(function(index){
  698. if($(this).is(":checked")){
  699. values = values + $(this).val() + ",";
  700. names = names + $(this).next().text() + ",";
  701. }
  702. });
  703. var queryData = ChildschoolFees.formParams();
  704. queryData['names'] = names;
  705. queryData['values'] = values;
  706. var url = Feng.setUrlParam(Feng.ctxPath + "/childschoolFees/exportBasicInfo",queryData);
  707. $("#basicExportModal").modal('hide');
  708. window.location.href = url;
  709. }
  710. $(function () {
  711. var defaultColunms = ChildschoolFees.initColumn();
  712. var table = new BSTable(ChildschoolFees.id, "/childschoolFees/list", defaultColunms);
  713. table.setPaginationType("server");
  714. table.setOnDblClickRow(function () {
  715. ChildschoolFees.openCheckChildschoolFees();
  716. });
  717. ChildschoolFees.table = table.init();
  718. //批量加载字典表数据
  719. var arr = [
  720. {"name": "talentArrange", "code": "un_talentLevel"},
  721. {"name": "cRelation", "code": "un_education_relation"},
  722. {"name": "nowGrade", "code": "un_grade"},
  723. {"name": "pCardType", "code": "un_cardType"},
  724. {"name": "cCardType", "code": "un_cardType"}];
  725. Feng.findChildDictBatch(JSON.stringify(arr));
  726. $('#checkAll').click(function () {
  727. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  728. })
  729. $('#uncheckAll').click(function () {
  730. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  731. })
  732. });