IntegralVerify_library.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  1. /**
  2. * 人才认定申报管理初始化
  3. */
  4. var IntegralInfo = {
  5. id: "IntegralInfoTable", //表格id
  6. checkAll: false,
  7. seItem: null, //选中的条目
  8. table: null,
  9. layerIndex: -1
  10. };
  11. /**
  12. * 初始化表格的列
  13. */
  14. IntegralInfo.initColumn = function () {
  15. var type = $("#usertype").val();
  16. var isShow = true;
  17. if (type == 2) {
  18. isShow = false;
  19. }
  20. ;
  21. return [
  22. {field: 'selectItem', radio: true},
  23. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
  24. formatter: function (value, row, index) {
  25. if (row.sex == 1) {
  26. return value + '<span style="color:#6495ED">【男】</span>';
  27. } else if (row.sex == 2) {
  28. return value + '<span style="color:#FF82AB">【女】</span>';
  29. } else {
  30. return value;
  31. }
  32. }
  33. },
  34. {title: '所属单位', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "100px"},
  35. {title: '证件类型', field: 'card_type', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  36. formatter: function (value, row, index) {
  37. switch (value) {
  38. case 1:
  39. return "身份证";
  40. case 2:
  41. return "港澳通行证";
  42. case 3:
  43. return "护照";
  44. }
  45. }
  46. },
  47. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  48. {title: '总积分', field: 'totalPoints', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  49. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: '80px',
  50. formatter: function (value, row, index) {
  51. return "<span class='label label-success' onclick=\"IntegralInfo.showIntegralLog('" + row.card_type + "','" + row.card_number + "')\" >" +
  52. "<i class=\"fa fa-history\"></i> 积分记录" +
  53. "</span>";
  54. }
  55. }
  56. ];
  57. };
  58. /**
  59. * 显示积分记录
  60. */
  61. IntegralInfo.showIntegralLog = function (card_type, card_number) {
  62. layer.open({
  63. type: 2,
  64. title: "积分记录",
  65. fixed: false,
  66. content: '/admin/integralVerify/integralLog/cardType/' + card_type + '/cardNumber/' + card_number,
  67. area: ['80%', '80%'],
  68. fix: false, //不固定
  69. maxmin: true
  70. });
  71. }
  72. /**
  73. * 检查是否选中
  74. */
  75. IntegralInfo.check = function () {
  76. var selected = $('#' + this.id).bootstrapTable('getSelections');
  77. if (selected.length == 0) {
  78. Feng.info("请先选中表格中的某一记录!");
  79. return false;
  80. } else {
  81. IntegralInfo.seItem = selected[0];
  82. return true;
  83. }
  84. };
  85. /**
  86. * 打开查看积分申报-初级审核详情
  87. */
  88. IntegralInfo.openIntegralInfoDetail = function () {
  89. if (this.check()) {
  90. var index = layer.open({
  91. type: 2,
  92. title: '人才认定审核详情',
  93. area: ['800px', '420px'], //宽高
  94. fix: false, //不固定
  95. maxmin: true,
  96. content: '/admin/integralVerify/detail/id/' + IntegralInfo.seItem.id
  97. });
  98. layer.full(index);
  99. IntegralInfo.layerIndex = index;
  100. }
  101. };
  102. IntegralInfo.prepareSearch = function () {
  103. var sex = $("#pub_sex").val();
  104. var checkState = $("#pub_checkState").val();
  105. var name = $("#pub_name").val();
  106. $('#dataTable').bootstrapTable("refresh", {"query": {"sex": sex, "checkState": checkState, "name": name}});
  107. }
  108. IntegralInfo.prepareReset = function () {
  109. $("#pub_sex").val("");
  110. $("#pub_checkState").val("");
  111. $("#pub_name").val("");
  112. }
  113. /**
  114. * 查询需要处理的数据
  115. * @param type
  116. */
  117. IntegralInfo.showDataCheckModal = function (type) {
  118. $("#hczxForm").css("display", "none");
  119. switch (type) {
  120. case 1: //待核查征信名单-导出
  121. $("#hczxButton").attr("onclick", "IntegralInfo.checkExport()").text("导出");
  122. $("#exportCommonModalLabel").text("待核查征信名单");
  123. break;
  124. case 2: //待核查征信名单-核查征信通过
  125. $("#hczxButton").attr("onclick", "IntegralInfo.hczxPass()").text("提交");
  126. $("#exportCommonModalLabel").text("待核查征信名单");
  127. break;
  128. case 3: //公示(批量)
  129. $("#hczxButton").attr("onclick", "IntegralInfo.public()").text("公示");
  130. $("#exportCommonModalLabel").text("待公示名单");
  131. $("#hczxForm").css("display", "block");
  132. $(".time").each(function () {
  133. laydate.render({
  134. elem: "#" + $(this).attr("id")
  135. , type: 'date'
  136. , format: 'yyyy年MM月dd日'
  137. });
  138. });
  139. break;
  140. case 4: //公示通过(批量)
  141. $("#hczxButton").attr("onclick", "IntegralInfo.publicPass()").text("提交");
  142. $("#exportCommonModalLabel").text("公示通过名单");
  143. break;
  144. case 5: //待公布名单
  145. $("#hczxButton").attr("onclick", "IntegralInfo.publish()").text("公布");
  146. $("#exportCommonModalLabel").text("待公布名单");
  147. break;
  148. case 6: //待发放人才码名单
  149. $("#hczxButton").attr("onclick", "IntegralInfo.sendCard()").text("提交");
  150. $("#exportCommonModalLabel").text("待发放积分名单");
  151. break;
  152. case 7: //公示名单预览
  153. $("#hczxButton").attr("onclick", "IntegralInfo.needPublicExport()").text("导出");
  154. $("#exportCommonModalLabel").text("待公示名单");
  155. break;
  156. case 8: //公布预览
  157. $("#hczxButton").attr("onclick", "IntegralInfo.publishExportBefore()").text("导出");
  158. $("#exportCommonModalLabel").text("待公布名单");
  159. break;
  160. }
  161. $('#dataTable').bootstrapTable('destroy');
  162. $('#dataTable').bootstrapTable({
  163. url: "/admin/integralVerify/selectNeedCheckData?type=" + type,
  164. method: 'POST',
  165. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  166. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  167. showRefresh: false, // 是否显示刷新按钮
  168. clickToSelect: true, // 是否启用点击选中行
  169. singleSelect: false, // 设置True 将禁止多选
  170. striped: true, // 是否显示行间隔色
  171. pagination: true, // 设置为 true 会在表格底部显示分页条
  172. paginationHAlign: "left",
  173. paginationDetailHAlign: "right",
  174. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  175. pageNumber: 1, //初始化加载第一页,默认第一页
  176. pageSize: 10, //每页的记录行数(*)
  177. pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*)
  178. maintainSelected: true, //全表全选需要开启
  179. showColumns: false,
  180. responseHandler: function (res) {
  181. $("#exportCommonModal").modal("show");
  182. return res.obj.rows;
  183. },
  184. columns:
  185. [
  186. {field: "selectItem", checkbox: true},
  187. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "20%"},
  188. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', width: "30%"},
  189. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "40%"},
  190. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "10%",
  191. formatter: function (value, row, index) {
  192. if (value == 8 || value == 22 || value == 25 || value == 27) {
  193. return "<span style='color: #ed5565;'>审核不通过</span>";
  194. }
  195. if (value == 6 || value == 21 || value == 23 || value == 24 || value == 26 || value == 28) {
  196. return "<span style='color: #1ab394;'>审核通过</span>";
  197. }
  198. }
  199. },
  200. ]
  201. });
  202. }
  203. /**
  204. * 选择导出提交
  205. */
  206. IntegralInfo.checkExport = function () {
  207. var selected = $('#dataTable').bootstrapTable('getSelections');
  208. if (!selected || selected.length < 1) {
  209. Feng.info("请至少选择一行数据!");
  210. return;
  211. }
  212. var ids = "";
  213. for (var i = 0; i < selected.length; i++) {
  214. ids = ids + selected[i].id + ",";
  215. }
  216. window.location.href = Feng.ctxPath + "/admin/integralVerify/prepareHczx?ids=" + ids;
  217. }
  218. /**
  219. * 核查征信批量通过提交
  220. */
  221. IntegralInfo.hczxPass = function () {
  222. var selected = $('#dataTable').bootstrapTable('getSelections');
  223. if (!selected || selected.length < 1) {
  224. Feng.info("请至少选择一行数据!");
  225. return;
  226. }
  227. var ids = "";
  228. for (var i = 0; i < selected.length; i++) {
  229. ids = ids + selected[i].id + ",";
  230. }
  231. var operation = function () {
  232. var ajax = new $ax("/admin/integralVerify/hczxPass", function (data) {
  233. if (data.code == 200) {
  234. Feng.success(data.msg);
  235. IntegralInfo.table.refresh();
  236. $("#exportCommonModal").modal("hide");
  237. } else {
  238. Feng.error(data.msg);
  239. }
  240. }, function (data) {
  241. Feng.error("核查征信失败!" + data.responseJSON.message + "!");
  242. });
  243. ajax.set("ids", ids);
  244. ajax.start();
  245. }
  246. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  247. }
  248. /**
  249. * 显示核查征信驳回模态框
  250. */
  251. IntegralInfo.showHczxRejectModal = function () {
  252. if (this.check()) {
  253. if (IntegralInfo.seItem.checkState != 6) {
  254. Feng.info("当前记录不是待核查征信状态,无法核查");
  255. return;
  256. }
  257. $("#hczxId").val(IntegralInfo.seItem.id);
  258. $("#hczxMsg").val("");
  259. $("#hczxRejectModal").modal("show");
  260. }
  261. }
  262. /**
  263. * 核查征信驳回提交
  264. */
  265. IntegralInfo.hczxReject = function () {
  266. var id = $("#hczxId").val();
  267. var msg = $("#hczxMsg").val();
  268. if (msg == null || msg == '') {
  269. Feng.info("请填写失信原因");
  270. return;
  271. }
  272. var operation = function () {
  273. var ajax = new $ax("/admin/integralVerify/hczxReject", function (data) {
  274. if (data.code == 200) {
  275. Feng.success(data.msg);
  276. IntegralInfo.table.refresh();
  277. $("#hczxRejectModal").modal("hide");
  278. } else {
  279. Feng.error(data.msg);
  280. }
  281. }, function (data) {
  282. Feng.error("核查征信失败!" + data.responseJSON.message + "!");
  283. });
  284. ajax.setData({"id": id, "outMsg": msg});
  285. ajax.start();
  286. }
  287. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  288. }
  289. // /**
  290. // * 导入核查征信名单
  291. // * @param type
  292. // */
  293. // IntegralInfo.importHczx = function(){
  294. // $("#importHczx-form")[0].reset();
  295. // $("#hczxModal").modal("show");
  296. // }
  297. // /**
  298. // * 导入提交
  299. // */
  300. // IntegralInfo.importHczxSubmit = function(){
  301. // $("#importHczx-form")[0].submit();
  302. // }
  303. /**
  304. * 是否发送短信
  305. */
  306. IntegralInfo.toggleMessage = function () {
  307. var isMessage = $("input[name='isSend']:checked").val();
  308. if (isMessage == 1) {
  309. $("#messageEdit").css("display", "block");
  310. } else if (isMessage == 2) {
  311. $("#messageEdit").css("display", "none");
  312. }
  313. }
  314. /**
  315. * 公示预览
  316. */
  317. IntegralInfo.needPublicExport = function () {
  318. var selected = $('#dataTable').bootstrapTable('getSelections');
  319. if (!selected || selected.length < 1) {
  320. Feng.info("请至少选择一行数据!");
  321. return;
  322. }
  323. var ids = "";
  324. for (var i = 0; i < selected.length; i++) {
  325. ids = ids + selected[i].id + ",";
  326. }
  327. var operation = function () {
  328. $("#exportCommonModal").modal("hide");
  329. window.location.href = encodeURI(encodeURI("/admin/integralVerify/publicExportBefore?ids=" + ids));
  330. }
  331. Feng.confirm("确定要公示预览吗?", operation);
  332. }
  333. /**
  334. * 公示
  335. */
  336. IntegralInfo.public = function () {
  337. var selected = $('#dataTable').bootstrapTable('getSelections');
  338. if (!selected || selected.length < 1) {
  339. Feng.info("请至少选择一行数据!");
  340. return;
  341. }
  342. var ids = "";
  343. for (var i = 0; i < selected.length; i++) {
  344. ids = ids + selected[i].id + ",";
  345. }
  346. var isMessage = $("input[name='isSend']:checked").val();
  347. var typeName = $("#typeName").val();
  348. var address = $("#web").val();
  349. var publicStartTime = $("#publicStartTime").val();
  350. var publicEndTime = $("#publicEndTime").val();
  351. var dep = $("#dep").val();
  352. var phone = $("#fyphone").val();
  353. var email = $("#fyemail").val();
  354. if (isMessage == 1) {
  355. if (typeName == null || typeName == '') {
  356. Feng.info("请填写公示类型");
  357. return;
  358. }
  359. if (address == null || address == '') {
  360. Feng.info("请填写公示平台");
  361. return;
  362. }
  363. if (publicStartTime == null || publicStartTime == '') {
  364. Feng.info("请填写公示开始时间");
  365. return;
  366. }
  367. if (publicEndTime == null || publicEndTime == '') {
  368. Feng.info("请填写公示截止时间");
  369. return;
  370. }
  371. if (dep == null || dep == '') {
  372. Feng.info("请填写反映单位");
  373. return;
  374. }
  375. if (phone == null || phone == '') {
  376. Feng.info("请填写联系电话");
  377. return;
  378. }
  379. if (email == null || email == '') {
  380. Feng.info("请填写联系邮箱");
  381. return;
  382. }
  383. }
  384. var operation = function () {
  385. var index = layer.open({
  386. type: 1,
  387. title: '公示',
  388. area: ['300px', '220px'], //宽高
  389. fix: false, //不固定
  390. maxmin: true,
  391. content: "<input class='form-control' id='publicBatchId' style='width:90%;margin: 10px' placeholder='请输入公示批次'>",
  392. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  393. btnAlign: 'c',
  394. success: function () {
  395. laydate.render({elem: "#publicBatchId", type: 'month', trigger: 'click', format: "yyyyMM"});
  396. },
  397. yes: function (index, layero) {
  398. var month = $("#publicBatchId").val();
  399. if (Feng.isEmptyStr(month)) {
  400. Feng.info("请填写公示批次");
  401. return;
  402. }
  403. layer.close(index);
  404. var ajax = new $ax("/admin/integralVerify/preparePublic", function (data) {
  405. if (data.code == 200) {
  406. Feng.success(data.msg);
  407. IntegralInfo.table.refresh();
  408. $("#exportCommonModal").modal("hide");
  409. } else {
  410. Feng.error(data.msg);
  411. }
  412. }, function (data) {
  413. Feng.error("公示失败!" + data.responseJSON.message + "!");
  414. });
  415. ajax.set("ids", ids);
  416. ajax.set("typeName", typeName);
  417. ajax.set("address", address);
  418. ajax.set("publicStartTime", publicStartTime);
  419. ajax.set("publicEndTime", publicEndTime);
  420. ajax.set("dep", dep);
  421. ajax.set("phone", phone);
  422. ajax.set("email", email);
  423. ajax.set("isMessage", isMessage);
  424. ajax.set("batch", month);
  425. ajax.start();
  426. }
  427. });
  428. }
  429. Feng.confirm("确定要公示吗?", operation);
  430. }
  431. //已公示的数据根据公示批次公示导出
  432. IntegralInfo.publicExport = function (type) {
  433. var url = "", dateType = '', format = '';
  434. if (type == 1) { //公示导出
  435. url = "/admin/integralVerify/publicExport";
  436. dateType = 'month';
  437. format = "yyyyMM";
  438. } else if (type == 2) { //公布导出
  439. url = Feng.ctxPath + "/admin/integralVerify/publishExport";
  440. dateType = 'date';
  441. format = "yyyy-MM-dd";
  442. }
  443. layer.open({
  444. type: 1,
  445. title: type == 1 ? '公示导出' : "公布导出",
  446. area: ['800px', '300px'], //宽高
  447. fix: false, //不固定
  448. maxmin: true,
  449. content: "<form id=\"publicExportForm\" action=\"" + url + "\" target=\"hiddenIframe\" class=\"form-horizontal \" style='padding-top: 10px;'>\n" +
  450. " <div class=\"form-group col-sm-12\">\n" +
  451. " <div class=\"row\">\n" +
  452. " <label class=\"col-sm-2 control-label\">开始时间</label>\n" +
  453. " <div class=\"col-sm-4\">\n" +
  454. " <input type=\"text\" id=\"startTime\" name=\"startTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
  455. " </div>\n" +
  456. " <label class=\"col-sm-2 control-label\">截止时间</label>\n" +
  457. " <div class=\"col-sm-4\">\n" +
  458. " <input type=\"text\" id=\"endTime\" name=\"endTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
  459. " </div>\n" +
  460. " </div>\n" +
  461. " </div>\n" +
  462. " </form>",
  463. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  464. btnAlign: 'c',
  465. success: function (index, layero) {
  466. $("#publicExportForm")[0].reset();
  467. $("input[time='time']").each(function () {
  468. laydate.render({
  469. elem: "#" + $(this).attr("id")
  470. , type: dateType
  471. , format: format
  472. , trigger: 'click'
  473. });
  474. });
  475. },
  476. yes: function (index) {
  477. var startTime = $("#startTime").val();
  478. var endTime = $("#endTime").val();
  479. if (startTime == null || startTime == '') {
  480. Feng.info("请选择开始时间");
  481. return;
  482. }
  483. if (endTime == null || endTime == '') {
  484. Feng.info("请选择结束时间");
  485. return;
  486. }
  487. $("#publicExportForm")[0].submit();
  488. layer.close(index)
  489. }
  490. });
  491. }
  492. /**
  493. * 公示再审核
  494. */
  495. IntegralInfo.afterCheck = function () {
  496. if (this.check()) {
  497. if (IntegralInfo.seItem.checkState != 23) {
  498. Feng.info("当前记录不是公示中状态,无法审核");
  499. return;
  500. }
  501. if (IntegralInfo.seItem.outMsg != null && IntegralInfo.seItem.outMsg != '') {
  502. Feng.info("当前申请人核查征信不通过,请谨慎选择审核状态!");
  503. }
  504. if (IntegralInfo.seItem.checkState == 16) {
  505. var html = '<option value="">请选择</option>\n' +
  506. ' <option value="2">驳回/恢复</option>';
  507. $("#checkStateAfter").empty().append(html);
  508. }
  509. if (IntegralInfo.seItem.checkState == 14) {
  510. var html = '<option value="">请选择</option>\n' +
  511. ' <option value="-1">审核不通过</option>' +
  512. ' <option value="2">驳回</option>';
  513. $("#checkStateAfter").empty().append(html);
  514. }
  515. $("#checkForm")[0].reset();
  516. $("#mainId").val(IntegralInfo.seItem.id);
  517. $("#checkModal").modal("show");
  518. }
  519. }
  520. /**
  521. * 公示后审核提交
  522. */
  523. IntegralInfo.afterCheckSubmit = function () {
  524. var checkState = $("#checkStateAfter").val();
  525. var msg = $("#msg").val();
  526. if (checkState == null || checkState == '') {
  527. Feng.info("请选择审核状态");
  528. return;
  529. }
  530. if (msg == null || msg == '') {
  531. Feng.info("请填写审核意见");
  532. return;
  533. }
  534. var operation = function () {
  535. var ajax = new $ax(Feng.ctxPath + "/admin/integralVerify/prepareCheck", function (data) {
  536. if (data.code == 200) {
  537. Feng.success(data.msg);
  538. IntegralInfo.table.refresh();
  539. $("#checkModal").modal("hide");
  540. } else {
  541. Feng.error(data.msg);
  542. }
  543. }, function (data) {
  544. Feng.error("审核失败!" + data.responseJSON.message + "!");
  545. });
  546. ajax.setData({"id": $("#mainId").val(), "checkState": $("#checkStateAfter").val(), "checkMsg": msg});
  547. ajax.start();
  548. }
  549. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  550. }
  551. /**
  552. * 批量公示通过
  553. * @param type
  554. */
  555. IntegralInfo.publicPass = function () {
  556. var selected = $('#dataTable').bootstrapTable('getSelections');
  557. if (!selected || selected.length < 1) {
  558. Feng.info("请至少选择一行数据!");
  559. return;
  560. }
  561. var ids = "";
  562. for (var i = 0; i < selected.length; i++) {
  563. ids = ids + selected[i].id + ",";
  564. }
  565. var operation = function () {
  566. var ajax = new $ax("/admin/integralVerify/publicPass", function (data) {
  567. if (data.code == 200) {
  568. Feng.success(data.msg);
  569. IntegralInfo.table.refresh();
  570. $("#exportCommonModal").modal("hide");
  571. } else {
  572. Feng.error(data.msg);
  573. }
  574. }, function (data) {
  575. Feng.error("公示通过失败!" + data.responseJSON.message + "!");
  576. });
  577. ajax.set("ids", ids);
  578. ajax.start();
  579. }
  580. Feng.confirm("一旦提交无法修改,确定公示通过吗?", operation);
  581. }
  582. /**
  583. * 公布预览
  584. */
  585. IntegralInfo.publishExportBefore = function () {
  586. var selected = $('#dataTable').bootstrapTable('getSelections');
  587. if (!selected || selected.length < 1) {
  588. Feng.info("请至少选择一行数据!");
  589. return;
  590. }
  591. var ids = "";
  592. for (var i = 0; i < selected.length; i++) {
  593. ids = ids + selected[i].id + ",";
  594. }
  595. var operation = function () {
  596. $("#exportCommonModal").modal("hide");
  597. window.location.href = "/admin/integralVerify/publishExportBefore?ids=" + ids;
  598. }
  599. Feng.confirm("确定要导出吗?", operation);
  600. }
  601. /**
  602. * 公布审核
  603. */
  604. IntegralInfo.singlePublish = function () {
  605. if (this.check()) {
  606. if (IntegralInfo.seItem.checkState != 24) {
  607. Feng.info("当前记录不是公示再审核通过状态,无法审核");
  608. return;
  609. }
  610. /*if (IntegralInfo.seItem.checkState == 13) {
  611. var html = '<option value="">请选择</option>\n' +
  612. ' <option value="2">驳回/恢复</option>';
  613. $("#checkStateAfter").empty().append(html);
  614. }
  615. if (IntegralInfo.seItem.checkState == 11) {
  616. var html = '<option value="">请选择</option>\n' +
  617. ' <option value="-1">审核不通过</option>' +
  618. ' <option value="2">驳回</option>';
  619. $("#checkStateAfter").empty().append(html);
  620. }*/
  621. $("#checkForm")[0].reset();
  622. $("#mainId").val(IntegralInfo.seItem.id);
  623. $("#publishModal").modal("show");
  624. laydate.render({elem: "#publishBatch", type: 'date', trigger: 'click', format: "yyyy-MM-dd"});
  625. }
  626. }
  627. IntegralInfo.publishStateChange = function () {
  628. var state = $("#checkStatePublish").val();
  629. if (state == 1) {
  630. $("#checkStatePublish").parents(".row").next(".row").css("display", "block");
  631. } else {
  632. $("#checkStatePublish").parents(".row").next(".row").css("display", "none");
  633. }
  634. }
  635. /**
  636. * 公示后审核提交
  637. */
  638. IntegralInfo.singlePublishSubmit = function () {
  639. var checkState = $("#checkStatePublish").val();
  640. var msg = $("#publishMsg").val();
  641. var month = $("#publishBatch").val();
  642. if (checkState == null || checkState == '') {
  643. Feng.info("请选择审核状态");
  644. return;
  645. }
  646. if (Feng.isEmptyStr(month)) {
  647. Feng.info("请填写公布批次");
  648. return;
  649. }
  650. if (msg == null || msg == '') {
  651. Feng.info("请填写审核意见");
  652. return;
  653. }
  654. var operation = function () {
  655. var ajax = new $ax("/admin/integralVerify/publish", function (data) {
  656. if (data.code == 200) {
  657. Feng.success(data.msg);
  658. IntegralInfo.table.refresh();
  659. $("#publishModal").modal("hide");
  660. } else {
  661. Feng.error(data.msg);
  662. }
  663. }, function (data) {
  664. Feng.error("审核失败!" + data.responseJSON.message + "!");
  665. });
  666. ajax.setData({"id": $("#mainId").val(), "checkState": checkState, "checkMsg": msg, batch: month});
  667. ajax.start();
  668. }
  669. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  670. }
  671. /**
  672. * 批量公布
  673. */
  674. IntegralInfo.publish = function () {
  675. var selected = $('#dataTable').bootstrapTable('getSelections');
  676. if (!selected || selected.length < 1) {
  677. Feng.info("请至少选择一行数据!");
  678. return;
  679. }
  680. var ids = "";
  681. for (var i = 0; i < selected.length; i++) {
  682. ids = ids + selected[i].id + ",";
  683. }
  684. var operation = function () {
  685. var index = layer.open({
  686. type: 1,
  687. title: '公布',
  688. area: ['300px', '220px'], //宽高
  689. fix: false, //不固定
  690. maxmin: true,
  691. content: "<input class='form-control' id='publicBatchId' style='width:90%;margin: 10px' placeholder='请输入公布日期(公布入选月份)'>",
  692. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  693. btnAlign: 'c',
  694. success: function () {
  695. laydate.render({elem: "#publicBatchId", type: 'date', trigger: 'click', format: "yyyy-MM-dd"});
  696. },
  697. yes: function (index, layero) {
  698. var month = $("#publicBatchId").val();
  699. if (Feng.isEmptyStr(month)) {
  700. Feng.info("请填写公布批次");
  701. return;
  702. }
  703. layer.close(index);
  704. var ajax = new $ax(Feng.ctxPath + "/admin/integralVerify/preparePublish", function (data) {
  705. if (data.code == 200) {
  706. Feng.success(data.msg);
  707. IntegralInfo.table.refresh();
  708. $("#exportCommonModal").modal("hide");
  709. } else {
  710. Feng.error(data.msg);
  711. }
  712. }, function (data) {
  713. Feng.error("公布失败!" + data.responseJSON.message + "!");
  714. });
  715. ajax.set("ids", ids);
  716. ajax.set("batch", month);
  717. ajax.start();
  718. }
  719. });
  720. }
  721. Feng.confirm("一旦确认无法修改,确定要公布吗?", operation);
  722. }
  723. /**
  724. * 撤销公布
  725. */
  726. IntegralInfo.canclePublish = function () {
  727. if (this.check()) {
  728. var operation = function () {
  729. var ajax = new $ax(Feng.ctxPath + "/talentInfo/canclePublish", function (data) {
  730. if (data.code == 200) {
  731. Feng.success(data.msg);
  732. IntegralInfo.table.refresh();
  733. } else {
  734. Feng.error(data.msg);
  735. }
  736. }, function (data) {
  737. Feng.error("撤销公布失败!" + data.responseJSON.message + "!");
  738. });
  739. ajax.set("id", IntegralInfo.seItem.id);
  740. ajax.start();
  741. }
  742. Feng.confirm("一旦撤销无法修改,确定要撤销公布吗?", operation);
  743. }
  744. }
  745. //发放积分
  746. IntegralInfo.sendCard = function () {
  747. var selected = $('#dataTable').bootstrapTable('getSelections');
  748. if (!selected || selected.length < 1) {
  749. Feng.info("请至少选择一行数据!");
  750. return;
  751. }
  752. var ids = "";
  753. for (var i = 0; i < selected.length; i++) {
  754. ids = ids + selected[i].id + ",";
  755. }
  756. var operation = function () {
  757. var ajax = new $ax("/admin/integralVerify/prepareCertification", function (data) {
  758. if (data.code == 200) {
  759. Feng.success(data.msg);
  760. IntegralInfo.table.refresh();
  761. $("#exportCommonModal").modal("hide");
  762. } else {
  763. Feng.error(data.msg);
  764. }
  765. }, function (data) {
  766. Feng.error("发放积分失败!" + data.responseJSON.message + "!");
  767. });
  768. ajax.set("ids", ids);
  769. ajax.start();
  770. }
  771. Feng.confirm("积分发放后无法修改,确定要发放积分吗?", operation);
  772. }
  773. //回调
  774. IntegralInfo.callBack = function (data) {
  775. Feng.info(data.msg);
  776. if (data.code == 200) {
  777. $("#hczxModal").modal("hide");
  778. IntegralInfo.table.refresh();
  779. }
  780. }
  781. $(function () {
  782. var defaultColunms = IntegralInfo.initColumn();
  783. var table = new BSTable(IntegralInfo.id, "/admin/integralVerify/list/process/4", defaultColunms);
  784. table.setPaginationType("server");
  785. table.setSingleSelect(false);
  786. table.setOnDblClickRow(function () {
  787. IntegralInfo.openIntegralInfoDetail();
  788. });
  789. var t = IntegralInfo.table = table.init();
  790. IntegralInfo.init();
  791. $('#checkAll').click(function () {
  792. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  793. })
  794. $('#uncheckAll').click(function () {
  795. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  796. })
  797. });