IntegralVerify_library.js 33 KB

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