IntegralVerify.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. /**
  2. * 积分申报审核
  3. */
  4. var IntegralVerify = {
  5. id: "IntegralVerifyTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. IntegralVerify.formParams = function () {
  11. var queryData = {};
  12. queryData['name'] = $("#name").val();
  13. queryData['card_number'] = $("#card_number").val();
  14. queryData['phone'] = $("#phone").val();
  15. queryData['email'] = $("#email").val();
  16. queryData['checkState'] = $("#checkState").val();
  17. queryData['apply_year'] = $("#apply_year").val();
  18. queryData['enterprise_id'] = $("#enterprise_id").val();
  19. queryData['shareholder'] = $("#shareholder").val();
  20. return queryData;
  21. }
  22. /**
  23. * 初始化表格的列
  24. */
  25. IntegralVerify.initColumn = function () {
  26. var type = $("#type").val();
  27. return [
  28. {field: 'selectItem', radio: true},
  29. {title: '申报年度', field: 'apply_year', visible: true, align: 'center', valign: 'middle', width: '80px'},
  30. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
  31. formatter: function (value, row, index) {
  32. if (row.sex == 1) {
  33. return value + '<span style="color:#6495ED">【男】</span>';
  34. } else if (row.sex == 2) {
  35. return value + '<span style="color:#FF82AB">【女】</span>';
  36. } else {
  37. return value;
  38. }
  39. }
  40. },
  41. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  42. {title: '所属单位', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "100px"},
  43. {title: '是否股东', field: 'shareholder', visible: true, align: 'center', valign: 'middle', width: "100px",
  44. formatter: function (value, row, index) {
  45. if (value == 1) {
  46. return '是';
  47. }
  48. if (value == 2) {
  49. return '否';
  50. }
  51. }
  52. },
  53. {title: '申报标准', field: 'details', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  54. {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  55. {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  56. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "100px",
  57. formatter: function (value, row, index) {
  58. if (row.real_state != row.checkState) {
  59. switch (row.real_state) {
  60. case 4:
  61. return "<span class='label label-danger'>初审驳回</span>";
  62. case 7:
  63. //复审驳回
  64. return "<span class='label label-success'>待重新初审</span>";
  65. }
  66. } else {
  67. switch (value) {
  68. case 2:
  69. if (row.last_state == 4) {
  70. return "<span class='label label-success'>待初审(重新提交)</span>";
  71. }
  72. return "<span class='label label-success'>待初审</span>";
  73. case 3:
  74. return "<span class='label label-success'>待复审</span>";
  75. case 5:
  76. return "<span class='label label-danger'>初审不通过</span>";
  77. case 6:
  78. return "<span class='label label-success'>复审通过待核查征信</span>";
  79. case 8:
  80. return "<span class='label label-danger'>复审不通过</span>";
  81. }
  82. }
  83. }
  84. },
  85. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  86. formatter: function (value, row, index) {
  87. return "<span class='label label-success' onclick=\"IntegralVerify.showLog('" + value + "')\" >" +
  88. "<i class=\"fa fa-book\"></i>日志" +
  89. "</span>";
  90. }
  91. }
  92. ];
  93. };
  94. /**
  95. * 检查是否选中
  96. */
  97. IntegralVerify.check = function () {
  98. var selected = $('#' + this.id).bootstrapTable('getSelections');
  99. if (selected.length != 1) {
  100. Feng.info("请先选中表格中的某一记录!");
  101. return false;
  102. } else {
  103. IntegralVerify.seItem = selected[0];
  104. return true;
  105. }
  106. };
  107. /**
  108. * 查询人才认定申报列表
  109. */
  110. IntegralVerify.search = function () {
  111. IntegralVerify.table.refresh({query: IntegralVerify.formParams()});
  112. };
  113. /**
  114. * 重置
  115. */
  116. IntegralVerify.reset = function () {
  117. $("#name").val("");
  118. $("#card_number").val("");
  119. $("#phone").val("");
  120. $("#email").val("");
  121. $("#checkState").val("");
  122. $("#apply_year").val("");
  123. $("#enterprise_id").val("").trigger("chosen:updated");
  124. $("#shareholder").val("");
  125. }
  126. /**
  127. * 显示导出模态框
  128. */
  129. IntegralVerify.showExportModal = function () {
  130. $("#exportForm")[0].reset();
  131. $("#commonExportModal").modal("show");
  132. }
  133. /**
  134. * 导出提交
  135. */
  136. IntegralVerify.export = function (process) {
  137. var names = '';
  138. var values = '';
  139. var commonExport = "";
  140. $("#field_info li input").each(function (index) {
  141. if ($(this).is(":checked")) {
  142. values = values + $(this).val() + ",";
  143. names = names + $(this).next().text() + ",";
  144. }
  145. });
  146. var queryData = IntegralVerify.formParams();
  147. var process = parseInt($("#process").val());
  148. switch (process) {
  149. case 1:
  150. commonExport = "fstVerifyListExport";
  151. break;
  152. case 2:
  153. commonExport = "reVerifyListExport";
  154. break;
  155. case 3:
  156. commonExport = "preListExport";
  157. break;
  158. }
  159. $("#commonExportModal").modal('hide');
  160. var params = $("#exportForm").serialize();
  161. var url = "/admin/integralVerify/" + commonExport + "?" + params;
  162. window.location.href = url;
  163. }
  164. /**
  165. * 下载
  166. */
  167. IntegralVerify.download = function () {
  168. if (this.check()) {
  169. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=20&id=" + IntegralVerify.seItem.id));
  170. }
  171. }
  172. IntegralVerify.openCheckIntegralVerify = function () {
  173. var process = $("#process").val();
  174. var title = "";
  175. switch (process) {
  176. case "1":
  177. title = "初审";
  178. break;
  179. case "2":
  180. title = "复审";
  181. break;
  182. default:
  183. break;
  184. }
  185. if (this.check()) {
  186. var index = layer.open({
  187. type: 2,
  188. title: '积分申报' + " - " + title,
  189. area: ['800px', '420px'], //宽高
  190. fix: false, //不固定
  191. maxmin: true,
  192. content: '/admin/integralVerify/detail/id/' + IntegralVerify.seItem.id + '/1',
  193. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-save"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  194. btnAlign: 'c',
  195. btn1: function (index, layero) {
  196. var obj = layero.find("iframe")[0].contentWindow;
  197. obj.IntegralVerifyInfoDlg.showFirstCheckModal();
  198. }, btn2: function (index, layero) {
  199. var obj = layero.find("iframe")[0].contentWindow;
  200. obj.IntegralVerifyInfoDlg.submitCheck();
  201. return false;
  202. }
  203. });
  204. layer.full(index);
  205. IntegralVerify.layerIndex = index;
  206. }
  207. }
  208. /**
  209. * 显示审核日志
  210. */
  211. IntegralVerify.showLog = function (id) {
  212. layer.open({
  213. type: 1,
  214. title: "日志",
  215. fixed: false,
  216. content: '<table id="' + id + '"></table>',
  217. area: ['80%', '80%'],
  218. maxmin: true,
  219. success: function (layero, index) {
  220. Feng.getCheckLog(id, {"type": CONFIG.project_integral_apply, "mainId": id, "typeFileId": "", "active": 1})
  221. }
  222. });
  223. }
  224. /**
  225. * 修改驳回的字段及附件
  226. */
  227. IntegralVerify.updateFieldsAndFiles = function () {
  228. if (this.check()) {
  229. var ajax = new $ax("/admin/integralVerify/findFieldsAndFiles?id=" + IntegralVerify.seItem.id, function (data) {
  230. var obj = data.obj;
  231. if (data.code == 200) {
  232. layer.open({
  233. type: 1,
  234. id: "neewFieldFormModel",
  235. title: '修改',
  236. area: ['800px', '450px'], //宽高
  237. fix: false, //不固定
  238. shade: 0,
  239. maxmin: true,
  240. content: IntegralVerify.creatFieldCheckModal(),
  241. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  242. btnAlign: 'c',
  243. zIndex: layer.zIndex,
  244. success: function (layero, index) {
  245. var obj = data.obj.record;
  246. if (typeof data.obj.fieldList != "undefined" && data.obj.fieldList.length > 0) {
  247. var fieldList = data.obj.fieldList;
  248. var html1 = '';
  249. for (var key in fieldList) {
  250. html1 = html1 + '<li style="float:left;margin:0 10px 10px 0;"><input type="checkbox" value="' + fieldList[key]["key"] + '"><span>' + fieldList[key]["value"] + '</span></li>';
  251. }
  252. }
  253. var html2 = '';
  254. html2 = html2 + '<ul><li style="width: 100%"><input type="checkbox" value="1"><span>允许修改</span></li></ul>';
  255. $("#field_info ul").css("overflow", "hidden").empty().append(html1);
  256. $("#field_file").css("overflow", "hidden").empty().append(html2);
  257. if (obj.fields != null && obj.fields != '') {
  258. $("#field_info input").each(function () {
  259. for (var key in obj.fields) {
  260. if ($(this).val() == obj.fields[key]) {
  261. this.checked = true;
  262. }
  263. }
  264. });
  265. }
  266. if (obj.files == 1) {
  267. $("#field_file input").each(function () {
  268. this.checked = true;
  269. });
  270. }
  271. },
  272. yes: function (index, layero) {
  273. IntegralVerify.submitFieldsAndFiles(index, IntegralVerify.seItem.id);
  274. }
  275. });
  276. } else {
  277. Feng.error(data.msg);
  278. }
  279. }, function (data) {
  280. Feng.error("查询失败!" + data.responseJSON.message + "!");
  281. });
  282. ajax.start();
  283. }
  284. }
  285. /**
  286. * 修改提交
  287. * @param index
  288. * @param id
  289. */
  290. IntegralVerify.submitFieldsAndFiles = function (index, id) {
  291. var fields = '';
  292. var files = '';
  293. $("#firstCheckForm #field_info li input").each(function (index) {
  294. if ($(this).is(":checked")) {
  295. fields = fields + $(this).val() + ",";
  296. }
  297. });
  298. $("#field_file li input").each(function (index) {
  299. if ($(this).is(":checked")) {
  300. files = files + $(this).val() + ",";
  301. }
  302. });
  303. if (fields == '' && files == '') {
  304. Feng.info("请选择可修改的字段或附件!");
  305. return;
  306. }
  307. var ajax = new $ax("/admin/integralVerify/updateFieldsAndFiles", function (data) {
  308. if (data.code == 200) {
  309. layer.close(index);
  310. Feng.success(data.msg);
  311. } else {
  312. Feng.error(data.msg);
  313. }
  314. }, function (data) {
  315. Feng.error("修改失败!" + data.responseJSON.message + "!");
  316. });
  317. ajax.setData({"id": id, "fields": fields, "files": files})
  318. ajax.start();
  319. }
  320. /**
  321. * 审核不通过
  322. */
  323. IntegralVerify.setNotPass = function () {
  324. var selecteds = $('#' + this.id).bootstrapTable('getSelections');
  325. if (selecteds.length == 0) {
  326. Feng.info("请选择需要设置审核不通过的行");
  327. return;
  328. }
  329. var ids = "";
  330. for (var key in selecteds) {
  331. ids = ids + selecteds[key].id + ",";
  332. }
  333. ids = ids.substring(0, ids.length - 1);
  334. layer.open({
  335. type: 1,
  336. id: "notPassModal",
  337. title: '修改',
  338. area: ['800px', '450px'], //宽高
  339. fix: false, //不固定
  340. shade: 0,
  341. maxmin: true,
  342. content: '<form id="checkNotPass">\n' +
  343. ' <div class="form-group" style="margin: 10px;">\n' +
  344. ' <label for="checkMsgNotPass" class="control-label" >审核不通过原因</label>\n' +
  345. ' <textarea class="form-control" id="checkMsgNotPass" placeholder="此功能适用于未在申报提交截止时间内提交的数据" rows="6"></textarea>\n' +
  346. ' </div>\n' +
  347. ' </form>',
  348. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  349. btnAlign: 'c',
  350. zIndex: layer.zIndex,
  351. yes: function (index, layero) {
  352. var checkMsg = $("#checkMsgNotPass").val();
  353. if (Feng.isEmptyStr(checkMsg)) {
  354. Feng.info("请填写审核不通过原因");
  355. return;
  356. }
  357. var operation = function () {
  358. var ajax = new $ax("/admin/integralVerify/cancel_verify", function (data) {
  359. if (data.code == 200) {
  360. Feng.success(data.msg);
  361. IntegralVerify.table.refresh();
  362. layer.close(index);
  363. } else {
  364. Feng.error(data.msg);
  365. }
  366. }, function (data) {
  367. Feng.error("设置审核不通过失败!" + data.responseJSON.message + "!");
  368. });
  369. ajax.set("ids", ids);
  370. ajax.set("msg", checkMsg);
  371. ajax.start();
  372. }
  373. Feng.confirm("一旦提交无法修改,确定设置所选数据为审核不通过?", operation);
  374. }
  375. });
  376. }
  377. IntegralVerify.creatFieldCheckModal = function () {
  378. return '<form id="firstCheckForm">\n' +
  379. ' <div class="form-group" style="margin: 10px;">\n' +
  380. ' <div >\n' +
  381. ' <label for="checkMsg" class="control-label">可修改字段</label>\n' +
  382. ' <div id="field_info">\n' +
  383. ' <ul>\n' +
  384. ' </ul>\n' +
  385. ' </div>\n' +
  386. ' <label for="checkMsg" class="control-label">可修改附件</label>\n' +
  387. ' <div id="field_file">\n' +
  388. ' </div>\n' +
  389. ' <div class="form-group" style="text-align: center">\n' +
  390. ' <button type="button" class="btn btn-primary" onclick="IntegralVerify.checkAll()">全选</button>\n' +
  391. ' <button type="button" class="btn btn-success" onclick="IntegralVerify.unCheckAll()">反选</button>\n' +
  392. ' </div>\n' +
  393. ' </div>\n' +
  394. ' </div>\n' +
  395. ' </form>';
  396. }
  397. IntegralVerify.fieldCheckd = function (context) {
  398. if ($(context).get(0).checked) {
  399. $(context).parent().next().children()[0].checked = true;
  400. $(context).parent().next().children().eq(0).trigger("change");
  401. }
  402. }
  403. IntegralVerify.sourceCheckd = function (context) {
  404. if ($(context).get(0).checked) {
  405. $("#talentArrangeCheckBox").attr("checked", true);
  406. $("#talentArrangeCheckBox").trigger("change");
  407. }
  408. }
  409. IntegralVerify.getPhones = function () {
  410. var process = $("#process").val();
  411. var ajax = new $ax("/admin/integralVerify/getPhones/process/" + process, function (data) {
  412. if (data.code == 200) {
  413. layer.open({
  414. type: 1,
  415. title: "手机号码",
  416. area: ['830px', '300px'], //宽高
  417. fix: false, //不固定
  418. maxmin: true,
  419. content: "<span style='word-break:break-all'>" + data.obj + "</span>"
  420. });
  421. } else {
  422. Feng.info(data.msg);
  423. }
  424. }, function (data) {
  425. Feng.error("操作失败!");
  426. });
  427. ajax.setData(IntegralVerify.formParams());
  428. ajax.start();
  429. }
  430. IntegralVerify.getEnterprisePhones = function () {
  431. var process = $("#process").val();
  432. var ajax = new $ax("/admin/integralVerify/getEnterprisePhones/process/" + process, function (data) {
  433. if (data.code == 200) {
  434. layer.open({
  435. type: 1,
  436. title: "手机号码",
  437. area: ['830px', '300px'], //宽高
  438. fix: false, //不固定
  439. maxmin: true,
  440. content: "<span style='word-break:break-all'>" + data.obj + "</span>"
  441. });
  442. } else {
  443. Feng.info(data.msg);
  444. }
  445. }, function (data) {
  446. Feng.error("操作失败!");
  447. });
  448. ajax.setData(IntegralVerify.formParams());
  449. ajax.start();
  450. }
  451. /**
  452. * 全选
  453. */
  454. IntegralVerify.checkAll = function () {
  455. $("#field_info input").each(function () {
  456. this.checked = true;
  457. })
  458. }
  459. /**
  460. * 反选
  461. */
  462. IntegralVerify.unCheckAll = function () {
  463. $("#field_info input").each(function () {
  464. if (this.checked) {
  465. this.checked = false;
  466. } else {
  467. this.checked = true;
  468. }
  469. })
  470. }
  471. $(function () {
  472. var defaultColunms = IntegralVerify.initColumn();
  473. var process = $("#process").val();
  474. var table = new BSTable(IntegralVerify.id, "/admin/integralVerify/list/process/" + process, defaultColunms);
  475. table.setPaginationType("server");
  476. table.setSingleSelect(false);
  477. table.setOnDblClickRow(function () {
  478. IntegralVerify.openCheckIntegralVerify();
  479. });
  480. IntegralVerify.table = table.init();
  481. $("#enterprise_id").on('chosen:ready', function (e, params) {
  482. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  483. });
  484. $("#enterprise_id").val("");
  485. $("#enterprise_id").trigger('chosen:updated');
  486. $("#enterprise_id").chosen({
  487. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  488. disable_search: false,
  489. width: "100%",
  490. enable_split_word_search: true
  491. });
  492. });