IntegralVerify.js 19 KB

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