talentAllowancePrepare.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. TalentAllowanceInfo.commonColumns = function () {
  2. return [
  3. {field: "selectItem", checkbox: true},
  4. {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: "10%"},
  5. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "10%"},
  6. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "35%"},
  7. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "35%"},
  8. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "15%",
  9. formatter(value, row, index) {
  10. if (value == -1) {
  11. return "<span class='label label-warning-light'>审核不通过</span>";
  12. }
  13. if (value == 30) {
  14. return "<span class='label label-primary'>已通过</span>"
  15. }
  16. }
  17. },
  18. {title: '公示状态', field: 'publicState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "15%",
  19. formatter(value, row, index) {
  20. if (value == 1)
  21. return "<span class='label label-danger'>待核查征信</span>";
  22. if (value == 2)
  23. return "<span class='label label-warning'>待公示</span>";
  24. if (value == 3)
  25. return "<span class='label label-success'>公示中</span>";
  26. if (value == 4){
  27. if(row.allowanceType == 3){
  28. return "<span class='label label-danger'>不予兑现</span>";
  29. }
  30. return "<span class='label label-info'>待兑现</span>";
  31. }
  32. if (value == 5)
  33. return "<span class='label label-primary'>已兑现</span>";
  34. }
  35. },
  36. ];
  37. }
  38. TalentAllowanceInfo.cashColumns = function () {
  39. return [
  40. {field: "selectItem", checkbox: true},
  41. {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: "10%"},
  42. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "10%"},
  43. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "20%"},
  44. {title: '津补贴类型', field: 'allowanceType', visible: true, align: 'center', valign: 'middle', width: "10%",
  45. formatter(value, row, index) {
  46. if (value == null || value == "")
  47. return "未判定";
  48. if (value == 1)
  49. return "工作津贴";
  50. if (value == 2)
  51. return "一次性交通补贴";
  52. if (value == 3)
  53. return "不予兑现";
  54. }
  55. },
  56. {title: '拟兑现金额', field: 'recommendMoney', visible: true, align: 'center', valign: 'middle', width: "20%"},
  57. {title: '兑现月份', field: 'months', visible: true, align: 'center', valign: 'middle', width: "25%"},
  58. {title: '兑现金额', field: 'money', visible: true, align: 'center', valign: 'middle', width: "20%"},
  59. ];
  60. }
  61. TalentAllowanceInfo.showPrepareDataModal = function (type) {
  62. var columns = TalentAllowanceInfo.commonColumns();
  63. $("#hczxForm").css("display", "none");
  64. switch (type) {
  65. case 1: //核查征信
  66. $("#exportPrepareModalLable").text("待核查征信导出");
  67. $("#prepareButton").attr("onclick", "TalentAllowanceInfo.exportHczx()").text("导出");
  68. break;
  69. case 2: //征信通过
  70. $("#exportPrepareModalLable").text("批量征信通过");
  71. $("#prepareButton").attr("onclick", "TalentAllowanceInfo.hczxPass()").text("提交");
  72. break;
  73. case 3: //公示(不予兑现)
  74. $("#exportPrepareModalLable").text("批量公示(不予兑现)");
  75. $("#prepareButton").attr("onclick", "TalentAllowanceInfo.public()").text("提交");
  76. $("#hczxForm").css("display", "block");
  77. break;
  78. case 4: //公示(兑现)
  79. $("#exportPrepareModalLable").text("批量公示(兑现)");
  80. $("#prepareButton").attr("onclick", "TalentAllowanceInfo.public()").text("提交");
  81. $("#hczxForm").css("display", "block");
  82. break;
  83. case 5: //公示通过
  84. $("#exportPrepareModalLable").text("批量公示通过");
  85. $("#prepareButton").attr("onclick", "TalentAllowanceInfo.publicPass()").text("提交");
  86. break;
  87. case 6: //兑现
  88. $("#exportPrepareModalLable").text("批量兑现");
  89. $("#prepareButton").attr("onclick", "TalentAllowanceInfo.cashPass()").text("提交");
  90. columns = TalentAllowanceInfo.cashColumns();
  91. break;
  92. case 7: //公示预览(不予兑现)
  93. $("#exportPrepareModalLable").text("公示预览(不予兑现)");
  94. $("#prepareButton").attr("onclick", "TalentAllowanceInfo.publishExportBefore(1)").text("提交");
  95. break;
  96. case 8: //公示预览(兑现)
  97. $("#exportPrepareModalLable").text("公示预览(兑现)");
  98. $("#prepareButton").attr("onclick", "TalentAllowanceInfo.publishExportBefore(2)").text("提交");
  99. break;
  100. }
  101. $('#prepareTable').bootstrapTable('destroy');
  102. $('#prepareTable').bootstrapTable({
  103. url: Feng.ctxPath + "/admin/talentAllowance/findTalentAllowanceByPage?type=" + type,
  104. method: 'POST',
  105. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  106. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  107. showRefresh: false, // 是否显示刷新按钮
  108. clickToSelect: true, // 是否启用点击选中行
  109. singleSelect: false, // 设置True 将禁止多选
  110. striped: true, // 是否显示行间隔色
  111. pagination: true, // 设置为 true 会在表格底部显示分页条
  112. paginationHAlign: "left",
  113. paginationDetailHAlign: "right",
  114. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  115. pageNumber: 1, //初始化加载第一页,默认第一页
  116. pageSize: 10, //每页的记录行数(*)
  117. pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*)
  118. maintainSelected: true, //全表全选需要开启
  119. showColumns: false,
  120. responseHandler: function (res) {
  121. $(".time").each(function () {
  122. laydate.render({
  123. elem: "#" + $(this).attr("id")
  124. , type: 'date'
  125. , format: 'yyyy年MM月dd日'
  126. });
  127. });
  128. $("#exportPrepareModal").modal("show");
  129. return res.obj.rows;
  130. },
  131. columns: columns
  132. });
  133. }
  134. TalentAllowanceInfo.exportHczx = function () {
  135. var selected = $('#prepareTable').bootstrapTable('getSelections');
  136. if (!selected || selected.length < 1) {
  137. Feng.info("请至少选择一行数据!");
  138. return;
  139. }
  140. var ids = "";
  141. for (var i = 0; i < selected.length; i++) {
  142. ids = ids + selected[i].id + ",";
  143. }
  144. ids = ids.substring(0, ids.length - 1);
  145. var operation = function () {
  146. window.location.href = Feng.ctxPath + "/admin/talentAllowance/exportHczx?ids=" + ids;
  147. }
  148. Feng.confirm("确定导出吗?", operation);
  149. }
  150. /**
  151. * 征信通过
  152. */
  153. TalentAllowanceInfo.hczxPass = function () {
  154. var selected = $('#prepareTable').bootstrapTable('getSelections');
  155. if (!selected || selected.length < 1) {
  156. Feng.info("请至少选择一行数据!");
  157. return;
  158. }
  159. var ids = "";
  160. for (var i = 0; i < selected.length; i++) {
  161. ids = ids + selected[i].id + ",";
  162. }
  163. ids = ids.substring(0, ids.length - 1);
  164. var operation = function () {
  165. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/hczxPass", function (data) {
  166. if (data.code == 200) {
  167. Feng.success(data.msg);
  168. TalentAllowanceInfo.table.refresh();
  169. $("#exportPrepareModal").modal("hide");
  170. } else {
  171. Feng.error(data.msg);
  172. }
  173. }, function (data) {
  174. Feng.error("核查征信失败!" + data.responseJSON.message + "!");
  175. });
  176. ajax.set("ids", ids);
  177. ajax.start();
  178. }
  179. Feng.confirm("一旦提交无法修改,确定核查征信通过吗?", operation);
  180. }
  181. /**
  182. * 公式预览
  183. * @param type 1-不予兑现,2-兑现
  184. */
  185. TalentAllowanceInfo.publishExportBefore = function (type) {
  186. var selected = $('#prepareTable').bootstrapTable('getSelections');
  187. if (!selected || selected.length < 1) {
  188. Feng.info("请至少选择一行数据!");
  189. return;
  190. }
  191. var ids = "";
  192. for (var i = 0; i < selected.length; i++) {
  193. ids = ids + selected[i].id + ",";
  194. }
  195. var operation = function () {
  196. $("#exportPrepareModal").modal("hide");
  197. var url = (type == 1) ? "/admin/talentAllowance/exportPublicNotCash?ids=" + ids : "/admin/talentAllowance/exportPublic?ids=" + ids;
  198. window.location.href = encodeURI(encodeURI(Feng.ctxPath + url));
  199. }
  200. Feng.confirm("确定要公示预览吗?", operation);
  201. }
  202. /**
  203. * 批量公示
  204. */
  205. TalentAllowanceInfo.public = function () {
  206. var selected = $('#prepareTable').bootstrapTable('getSelections');
  207. if (!selected || selected.length < 1) {
  208. Feng.info("请至少选择一行数据!");
  209. return;
  210. }
  211. var ids = "";
  212. for (var i = 0; i < selected.length; i++) {
  213. ids = ids + selected[i].id + ",";
  214. }
  215. ids = ids.substring(0, ids.length - 1);
  216. var isMessage = $("input[name='isSend']:checked").val();
  217. var typeName = $("#typeName").val();
  218. var address = $("#web").val();
  219. var publicStartTime = $("#publicStartTime").val();
  220. var publicEndTime = $("#publicEndTime").val();
  221. var dep = $("#dep").val();
  222. var phone = $("#publicPhone").val();
  223. var email = $("#publicemail").val();
  224. if (isMessage == 1) {
  225. if (typeName == null || typeName == '') {
  226. Feng.info("请填写公示类型");
  227. return;
  228. }
  229. if (address == null || address == '') {
  230. Feng.info("请填写公示平台");
  231. return;
  232. }
  233. if (publicStartTime == null || publicStartTime == '') {
  234. Feng.info("请填写公示开始时间");
  235. return;
  236. }
  237. if (publicEndTime == null || publicEndTime == '') {
  238. Feng.info("请填写公示截止时间");
  239. return;
  240. }
  241. if (dep == null || dep == '') {
  242. Feng.info("请填写反映单位");
  243. return;
  244. }
  245. if (phone == null || phone == '') {
  246. Feng.info("请填写联系电话");
  247. return;
  248. }
  249. if (email == null || email == '') {
  250. Feng.info("请填写联系邮箱");
  251. return;
  252. }
  253. }
  254. var operation = function () {
  255. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/publicBatch", function (data) {
  256. if (data.code == 200) {
  257. Feng.success(data.msg);
  258. TalentAllowanceInfo.table.refresh();
  259. $("#exportPrepareModal").modal("hide");
  260. } else {
  261. Feng.error(data.msg);
  262. }
  263. }, function (data) {
  264. Feng.error("公示失败!" + data.responseJSON.message + "!");
  265. });
  266. ajax.set("ids", ids);
  267. ajax.set("typeName", typeName);
  268. ajax.set("address", address);
  269. ajax.set("publicStartTime", publicStartTime);
  270. ajax.set("publicEndTime", publicEndTime);
  271. ajax.set("dep", dep);
  272. ajax.set("phone", phone);
  273. ajax.set("email", email);
  274. ajax.set("isMessage", isMessage);
  275. ajax.start();
  276. }
  277. Feng.confirm("一旦公示,无法恢复,确定公示吗?", operation);
  278. }
  279. /**
  280. * 公示通过
  281. */
  282. TalentAllowanceInfo.publicPass = function () {
  283. var selected = $('#prepareTable').bootstrapTable('getSelections');
  284. if (!selected || selected.length < 1) {
  285. Feng.info("请至少选择一行数据!");
  286. return;
  287. }
  288. var ids = "";
  289. for (var i = 0; i < selected.length; i++) {
  290. ids = ids + selected[i].id + ",";
  291. }
  292. ids = ids.substring(0, ids.length - 1);
  293. var operation = function () {
  294. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/publicPass", function (data) {
  295. if (data.code == 200) {
  296. Feng.success(data.msg);
  297. TalentAllowanceInfo.table.refresh();
  298. $("#exportPrepareModal").modal("hide");
  299. } else {
  300. Feng.error(data.msg);
  301. }
  302. }, function (data) {
  303. Feng.error("公示失败!" + data.responseJSON.message + "!");
  304. });
  305. ajax.set("ids", ids);
  306. ajax.start();
  307. }
  308. Feng.confirm("一旦提交无法修改,确定公示通过吗?", operation);
  309. }
  310. /**
  311. * 兑现
  312. */
  313. TalentAllowanceInfo.cashPass = function () {
  314. var selected = $('#prepareTable').bootstrapTable('getSelections');
  315. if (!selected || selected.length < 1) {
  316. Feng.info("请至少选择一行数据!");
  317. return;
  318. }
  319. var ids = "";
  320. for (var i = 0; i < selected.length; i++) {
  321. ids = ids + selected[i].id + ",";
  322. }
  323. ids = ids.substring(0, ids.length - 1);
  324. var operation = function () {
  325. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/cash", function (data) {
  326. if (data.code == 200) {
  327. Feng.success(data.msg);
  328. TalentAllowanceInfo.table.refresh();
  329. $("#exportPrepareModal").modal("hide");
  330. } else {
  331. Feng.error(data.msg);
  332. }
  333. }, function (data) {
  334. Feng.error("兑现失败!" + data.responseJSON.message + "!");
  335. });
  336. ajax.set("ids", ids);
  337. ajax.start();
  338. }
  339. Feng.confirm("一旦兑现无法修改,确定兑现吗?", operation);
  340. }
  341. /**
  342. * 是否发送短信
  343. */
  344. TalentAllowanceInfo.toggleMessage = function () {
  345. var isMessage = $("input[name='isSend']:checked").val();
  346. if (isMessage == 1) {
  347. $("#messageEdit").css("display", "block");
  348. } else if (isMessage == 2) {
  349. $("#messageEdit").css("display", "none");
  350. }
  351. }
  352. /***
  353. * 显示核查征信失信
  354. */
  355. TalentAllowanceInfo.showHczxRejectModal = function () {
  356. if (this.check()) {
  357. if (TalentAllowanceInfo.seItem.publicState != 1) {
  358. Feng.info("当前记录不是待核查征信状态,无法核查");
  359. return;
  360. }
  361. layer.open({
  362. type: 1,
  363. id: "neewFieldFormModel",
  364. title: '征信失信',
  365. area: ['800px', '450px'], //宽高
  366. fix: false, //不固定
  367. shade: 0,
  368. maxmin: true,
  369. content: '<form id="hczxRejectForm" class="form-horizontal">\n' +
  370. ' <input type="hidden" name="hczxId" id="hczxId" >\n' +
  371. ' <div class="form-group" style="margin: 10px;">\n' +
  372. ' <label class=" control-label">失信原因</label>\n' +
  373. ' <textarea id="hczxMsg" name="hczxMsg" class="form-control"></textarea>\n' +
  374. ' </div>\n' +
  375. ' </form>',
  376. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  377. btnAlign: 'c',
  378. zIndex: layer.zIndex,
  379. success: function (layero, index) {
  380. $("#hczxId").val(TalentAllowanceInfo.seItem.id);
  381. $("#hczxMsg").val("");
  382. },
  383. yes: function (index, layero) {
  384. var id = $("#hczxId").val();
  385. var msg = $("#hczxMsg").val();
  386. if (msg == null || msg == '') {
  387. Feng.info("请填写失信原因");
  388. return;
  389. }
  390. var operation = function () {
  391. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/hczxReject", function (data) {
  392. if (data.code == 200) {
  393. Feng.success(data.msg);
  394. TalentAllowanceInfo.table.refresh();
  395. layer.close(index);
  396. } else {
  397. Feng.error(data.msg);
  398. }
  399. }, function (data) {
  400. Feng.error("核查征信失败!" + data.responseJSON.message + "!");
  401. });
  402. ajax.setData({"id": id, "outMsg": msg});
  403. ajax.start();
  404. }
  405. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  406. }
  407. });
  408. }
  409. }
  410. /***
  411. * 公示再审核
  412. */
  413. TalentAllowanceInfo.afterCheck = function () {
  414. if (this.check()) {
  415. var index = layer.open({
  416. type: 2,
  417. title: '津补贴公示再审核',
  418. fix: false, //不固定
  419. maxmin: true,
  420. content: Feng.ctxPath + '/admin/talentAllowance/toSupplePage/id/' + TalentAllowanceInfo.seItem.id,
  421. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;计算津补贴', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  422. btnAlign: 'c',
  423. yes: function (index, layero) {
  424. var obj = layero.find("iframe")[0].contentWindow;
  425. obj.TalentAllowanceInfoDlg.showCheckModal();
  426. },
  427. });
  428. layer.full(index);
  429. TalentAllowanceInfo.layerIndex = index;
  430. }
  431. }
  432. /**
  433. * 公示后审核提交
  434. */
  435. TalentAllowanceInfo.afterCheckSubmit = function () {
  436. var operation = function () {
  437. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/afterCheck", function (data) {
  438. if (data.code == 200) {
  439. Feng.success(data.msg);
  440. TalentAllowanceInfo.table.refresh();
  441. $("#checkModal").modal("hide");
  442. } else {
  443. Feng.error(data.msg);
  444. }
  445. }, function (data) {
  446. Feng.error("审核失败!" + data.responseJSON.message + "!");
  447. });
  448. ajax.setData({"id": $("#mainId").val(), "checkState": $("#checkState").val(), "checkMsg": $("#msg").val(), "toProcess": $("#toProcess").val()});
  449. ajax.start();
  450. }
  451. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  452. }
  453. TalentAllowanceInfo.toggleProcess = function () {
  454. var checkState = $("#checkState").val();
  455. if (checkState == -1)
  456. $("#processDiv").hide();
  457. if (checkState == 2)
  458. $("#processDiv").show();
  459. }
  460. /**
  461. * 核查征信回调
  462. */
  463. TalentAllowanceInfo.hczxCallBack = function (data) {
  464. Feng.info(data.msg);
  465. }
  466. /**
  467. * 刷新检索
  468. */
  469. TalentAllowanceInfo.prepareSearch = function () {
  470. var name = $("#preName").val();
  471. var idCard = $("#preIdCard").val();
  472. $('#prepareTable').bootstrapTable("refresh", {"query": {"name": name, "idCard": idCard}});
  473. }
  474. /**
  475. * 重置
  476. */
  477. TalentAllowanceInfo.prepareReset = function () {
  478. $("#preName").val("");
  479. $("#preIdCard").val("");
  480. }