IntegralVerify_library.js 32 KB

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