talentAllowanceInfo.js 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890
  1. /**
  2. * 优秀人才津补贴管理初始化
  3. */
  4. var TalentAllowanceInfo = {
  5. id: "TalentAllowanceInfoTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 检查是否选中
  12. */
  13. TalentAllowanceInfo.check = function () {
  14. var selected = $('#' + this.id).bootstrapTable('getSelections');
  15. if (selected.length != 1) {
  16. Feng.info("请先选中表格中的某一记录!");
  17. return false;
  18. } else {
  19. TalentAllowanceInfo.seItem = selected[0];
  20. return true;
  21. }
  22. };
  23. /**
  24. * 点击添加优秀人才津补贴
  25. */
  26. TalentAllowanceInfo.openCheckTalentAllowanceInfo = function () {
  27. if (this.check()) {
  28. var index = null;
  29. var process = $("#process").val();
  30. if (process == 1) {
  31. index = layer.open({
  32. type: 2,
  33. title: '津补贴初级审核',
  34. fix: false, //不固定
  35. maxmin: true,
  36. content: Feng.ctxPath + '/talentAllowanceInfo/toCheckPage/' + TalentAllowanceInfo.seItem.id + "/" + $("#process").val() + "/" + TalentAllowanceInfo.seItem.companyId,
  37. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  38. btnAlign: 'c',
  39. btn1: function (index, layero) {
  40. var obj = layero.find("iframe")[0].contentWindow;
  41. obj.TalentAllowanceInfoDlg.showCheckModal();
  42. },
  43. btn2: function (index, layero) {
  44. var obj = layero.find("iframe")[0].contentWindow;
  45. obj.TalentAllowanceInfoDlg.submitCheck();
  46. return false;
  47. },
  48. end: function () {
  49. layer.closeAll('tips');
  50. TalentAllowanceInfo.table.refresh();
  51. }
  52. });
  53. } else if (process == 2) {
  54. index = layer.open({
  55. type: 2,
  56. title: '津补贴走访核查',
  57. fix: false, //不固定
  58. maxmin: true,
  59. content: Feng.ctxPath + '/talentAllowanceInfo/toCheckPage/' + TalentAllowanceInfo.seItem.id + "/" + $("#process").val() + "/null",
  60. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  61. btnAlign: 'c',
  62. btn1: function (index, layero) {
  63. var obj = layero.find("iframe")[0].contentWindow;
  64. obj.TalentAllowanceInfoDlg.submitCheck();
  65. return false;
  66. },
  67. end: function () {
  68. layer.closeAll('tips');
  69. TalentAllowanceInfo.table.refresh();
  70. }
  71. });
  72. } else if (process == 3) {
  73. index = layer.open({
  74. type: 2,
  75. title: '津补贴复核',
  76. fix: false, //不固定
  77. maxmin: true,
  78. shadeClose: false,
  79. content: Feng.ctxPath + '/talentAllowanceInfo/toCheckPage/' + TalentAllowanceInfo.seItem.id + "/" + $("#process").val() + "/null",
  80. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  81. btnAlign: 'c',
  82. btn1: function (index, layero) {
  83. var obj = layero.find("iframe")[0].contentWindow;
  84. obj.TalentAllowanceInfoDlg.showCheckModal();
  85. },
  86. btn2: function (index, layero) {
  87. var obj = layero.find("iframe")[0].contentWindow;
  88. obj.TalentAllowanceInfoDlg.submitCheck();
  89. return false;
  90. },
  91. end: function () {
  92. layer.closeAll('tips');
  93. TalentAllowanceInfo.table.refresh();
  94. }
  95. });
  96. }
  97. layer.full(index);
  98. TalentAllowanceInfo.layerIndex = index;
  99. }
  100. };
  101. /**
  102. * 查看
  103. */
  104. TalentAllowanceInfo.select = function () {
  105. if (this.check()) {
  106. var process = $("#process").val();
  107. var url = Feng.ctxPath + '/talentAllowanceInfo/toSelectPage/' + TalentAllowanceInfo.seItem.id + "/" + $("#process").val() + "/null";
  108. if (process == 1) {
  109. url = Feng.ctxPath + '/talentAllowanceInfo/toSelectPage/' + TalentAllowanceInfo.seItem.id + "/" + $("#process").val() + "/" + TalentAllowanceInfo.seItem.companyId;
  110. }
  111. var index = layer.open({
  112. type: 2,
  113. title: '津补贴查看',
  114. fix: false, //不固定
  115. maxmin: true,
  116. shadeClose: false,
  117. content: url,
  118. btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  119. btnAlign: 'c',
  120. });
  121. layer.full(index);
  122. TalentAllowanceInfo.layerIndex = index;
  123. }
  124. }
  125. TalentAllowanceInfo.showDataModal = function (type) {
  126. switch (type) {
  127. case 1: //批量提交审核(社保局)
  128. $("#exportCommonModalLabel").text("批量提交审核");
  129. $("#exportButton").attr("onclick", "TalentAllowanceInfo.submitBatch()").text("提交");
  130. break;
  131. case 2: //导出社保录入模板
  132. $("#exportCommonModalLabel").text("导出社保录入模板");
  133. $("#exportButton").attr("onclick", "TalentAllowanceInfo.export(1)").text("导出");
  134. break;
  135. case 3: //导出社保核查结果
  136. $("#exportCommonModalLabel").text("导出社保核查结果");
  137. $("#exportButton").attr("onclick", "TalentAllowanceInfo.export(3)").text("导出");
  138. break;
  139. case 4: //导出项目核查结果(初审)
  140. $("#exportCommonModalLabel").text("导出项目核查结果");
  141. $("#exportButton").attr("onclick", "TalentAllowanceInfo.export(5)").text("导出");
  142. break;
  143. case 5: //批量提交审核(走访核查)
  144. $("#exportCommonModalLabel").text("批量提交审核");
  145. $("#exportButton").attr("onclick", "TalentAllowanceInfo.submitBatchVisit()").text("提交");
  146. break;
  147. case 6: //导出项目录入模板(走访核查)
  148. $("#exportCommonModalLabel").text("导出项目录入模板");
  149. $("#exportButton").attr("onclick", "TalentAllowanceInfo.export(2)").text("导出");
  150. break;
  151. case 7: //导出项目核查结果(走访核查)
  152. $("#exportCommonModalLabel").text("导出项目核查结果");
  153. $("#exportButton").attr("onclick", "TalentAllowanceInfo.export(4)").text("导出");
  154. break;
  155. case 8: //导出项目核查结果(复核)
  156. $("#exportCommonModalLabel").text("导出项目核查结果");
  157. $("#exportButton").attr("onclick", "TalentAllowanceInfo.export(5)").text("导出");
  158. break;
  159. case 9: //导出项目核查结果(预备库)
  160. $("#exportCommonModalLabel").text("导出项目核查结果");
  161. $("#exportButton").attr("onclick", "TalentAllowanceInfo.export(5)").text("导出");
  162. break;
  163. }
  164. $('#dataTable').bootstrapTable('destroy');
  165. $('#dataTable').bootstrapTable({
  166. url: Feng.ctxPath + "/talentAllowanceInfo/selectNeedData?type=" + type,
  167. method: 'POST',
  168. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  169. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  170. showRefresh: false, // 是否显示刷新按钮
  171. clickToSelect: true, // 是否启用点击选中行
  172. singleSelect: false, // 设置True 将禁止多选
  173. striped: true, // 是否显示行间隔色
  174. pagination: true, // 设置为 true 会在表格底部显示分页条
  175. paginationHAlign: "left",
  176. paginationDetailHAlign: "right",
  177. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  178. pageNumber: 1, //初始化加载第一页,默认第一页
  179. pageSize: 10, //每页的记录行数(*)
  180. pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*)
  181. maintainSelected: true, //全表全选需要开启
  182. showColumns: false,
  183. responseHandler: function (res) {
  184. $("#exportCommonModal").modal("show");
  185. return res.obj.rows;
  186. },
  187. columns:
  188. [
  189. {field: "selectItem", checkbox: true},
  190. {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: "10%"},
  191. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "10%"},
  192. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "30%"},
  193. {
  194. title: '企业名称',
  195. field: 'enterpriseName',
  196. visible: true,
  197. align: 'center',
  198. valign: 'middle',
  199. width: "35%"
  200. },
  201. {
  202. title: '审核状态',
  203. field: 'checkState',
  204. visible: true,
  205. align: 'center',
  206. valign: 'middle',
  207. 'class': 'uitd_showTip',
  208. width: "15%",
  209. formatter(value, row, index) {
  210. switch (type) {
  211. case 1: //批量提交审核(社保局)
  212. case 2: //导出社保录入模板
  213. case 3: //导出社保核查结果
  214. if (value == -2) {
  215. return "<span class='label'>待提交</span>";
  216. } else if (value == -1) {
  217. return "<span class='label label-warning-light'>审核不通过</span>";
  218. } else if (value == 1) {
  219. return "<span class='label label-success'>待审核</span>";
  220. } else if (value == 2) {
  221. return "<span class='label label-danger'>已驳回</span>";
  222. } else if (value == 3) {
  223. return "<span class='label label-primary'>已通过</span>"
  224. } else if (value == 4) {
  225. return "<span class='label label-success'>上级驳回</span>";
  226. } else if (value == 9) {
  227. return "<span class='label label-success'>重新提交</span>";
  228. }
  229. break;
  230. case 4: //导出项目核查结果(初审)
  231. if (value == -1) {
  232. return "<span class='label label-warning-light'>审核不通过</span>";
  233. } else if (value == 1) {
  234. return "<span class='label'>待提交</span>"
  235. } else if (value == 5) {
  236. return (Feng.isNotEmptyStr(row.highProcess) && row.highProcess > 1) ? "<span class='label label-success'>重新提交</span>" : "<span class='label label-success'>待审核</span>";
  237. } else if (value == 13) {
  238. return "<span class='label label-success'>上级驳回</span>";
  239. } else if (value == 10) {
  240. return "<span class='label label-danger'>已驳回</span>";
  241. } else if (value == 15 || value == 20 || value == 25 || value == 30) {
  242. return "<span class='label label-primary'>已通过</span>";
  243. }
  244. break;
  245. case 5: //批量提交审核(走访核查)
  246. case 6: //导出项目录入模板(走访核查)
  247. case 7: //导出项目核查结果(走访核查)
  248. if (value == -1) {
  249. return "<span class='label label-warning-light'>审核不通过</span>";
  250. } else if (value == 1 || value == 5 || value == 10) {
  251. return "<span class='label label-danger'>已驳回</span>";
  252. } else if (value == 15) {
  253. return (Feng.isNotEmptyStr(row.highProcess) && row.highProcess >= 2) ? "<span class='label label-success'>重新提交</span>" : "<span class='label label-success'>待审核</span>";
  254. } else if (value == 20 || value == 30) {
  255. return "<span class='label label-primary'>已通过</span>"
  256. } else if (value == 25) {
  257. return "<span class='label label-success'>上级驳回</span>";
  258. }
  259. break;
  260. case 8: //导出项目核查结果(复核)
  261. if (value == -1) {
  262. return "<span class='label label-warning-light'>审核不通过</span>";
  263. } else if (value == 1 || value == 5 || value == 10 || value == 13 || value == 15 || value == 25) {
  264. return "<span class='label label-danger'>已驳回</span>";
  265. } else if (value == 20) {
  266. return (Feng.isNotEmptyStr(row.highProcess) && row.highProcess >= 3) ? "<span class='label label-success'>重新提交</span>" : "<span class='label label-success'>待审核</span>";
  267. } else if (value == 30) {
  268. return "<span class='label label-primary'>已通过</span>"
  269. } else if (value == 35) {
  270. return "<span class='label label-success'>公示驳回</span>";
  271. }
  272. break;
  273. case 9: //导出项目核查结果(预备库)
  274. if (value == -1) {
  275. return "<span class='label label-warning-light'>审核不通过</span>";
  276. }
  277. if (value == 30) {
  278. return "<span class='label label-primary'>已通过</span>"
  279. }
  280. break;
  281. }
  282. }
  283. },
  284. ]
  285. });
  286. }
  287. /**
  288. * 刷新检索
  289. */
  290. TalentAllowanceInfo.commonSearch = function () {
  291. var name = $("#commonName").val();
  292. var idCard = $("#commonIdCard").val();
  293. var year = $("#commonYear").val();
  294. $('#dataTable').bootstrapTable("refresh", {"query": {"name": name, "idCard": idCard,"year":year}});
  295. }
  296. /**
  297. * 重置
  298. */
  299. TalentAllowanceInfo.commonReset = function () {
  300. $("#commonName").val("");
  301. $("#commonIdCard").val("");
  302. }
  303. /**
  304. * 社保局批量提交审核
  305. */
  306. TalentAllowanceInfo.submitBatch = function () {
  307. var selected = $('#dataTable').bootstrapTable('getSelections');
  308. if (selected.length == 0) {
  309. Feng.info("请先选择需要提交审核的数据!");
  310. return false;
  311. }
  312. var ids = "";
  313. for (var i = 0; i < selected.length; i++) {
  314. ids = ids + selected[i].id + ",";
  315. }
  316. var operation = function () {
  317. var ajax = new $ax(Feng.ctxPath + "/talentAllowanceInfo/submitCheckBatch", function (data) {
  318. if (data.code == 200) {
  319. Feng.success(data.msg);
  320. TalentAllowanceInfo.table.refresh();
  321. $("#exportCommonModal").modal("hide");
  322. } else {
  323. Feng.error(data.msg);
  324. }
  325. }, function (data) {
  326. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  327. });
  328. ajax.set("ids", ids);
  329. ajax.start();
  330. }
  331. Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
  332. }
  333. /**
  334. * 走访核查批量提交审核
  335. */
  336. TalentAllowanceInfo.submitBatchVisit = function () {
  337. var selected = $('#dataTable').bootstrapTable('getSelections');
  338. if (selected.length == 0) {
  339. Feng.info("请先选择需要提交审核的数据!");
  340. return false;
  341. }
  342. var ids = "";
  343. for (var i = 0; i < selected.length; i++) {
  344. ids = ids + selected[i].id + ",";
  345. }
  346. var operation = function () {
  347. var i = layer.msg('提交中,请稍后!', {
  348. icon: 16
  349. , shade: 0.3
  350. });
  351. var ajax = new $ax(Feng.ctxPath + "/talentAllowanceInfo/submitBatchVisit", function (data) {
  352. layer.close(i);
  353. if (data.code == 200) {
  354. Feng.success(data.msg);
  355. TalentAllowanceInfo.table.refresh();
  356. $("#exportCommonModal").modal("hide");
  357. } else {
  358. Feng.error(data.msg);
  359. }
  360. }, function (data) {
  361. layer.close(i);
  362. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  363. });
  364. ajax.set("ids", ids);
  365. ajax.start();
  366. }
  367. Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
  368. }
  369. TalentAllowanceInfo.updateFieldsAndFiles = function () {
  370. if (this.check()) {
  371. var ajax = new $ax(Feng.ctxPath + "/talentAllowanceInfo/findFieldsAndFiles?id=" + TalentAllowanceInfo.seItem.id, function (data) {
  372. var obj = data.obj.obj;
  373. if (data.code == 200) {
  374. layer.open({
  375. type: 1,
  376. id: "neewFieldFormModel",
  377. title: '修改',
  378. area: ['800px', '450px'], //宽高
  379. fix: false, //不固定
  380. shade: 0,
  381. maxmin: true,
  382. content: '<form id="checkForm">\n' +
  383. ' <div class="form-group" id="field" style="margin: 10px">\n' +
  384. ' <label for="field_concat" class="control-label">可修改合同时间</label>\n' +
  385. ' <div id="field_concat">\n' +
  386. ' </div>\n' +
  387. ' <label for="field_project" class="control-label">可修改字段</label>\n' +
  388. ' <div id="field_field">\n' +
  389. ' <ul><li style="width: 100%"><input type="checkbox" value="wage"><span>上一年度年薪(元)</span></li></ul>'+
  390. ' </div>\n'+
  391. ' <label for="field_project" class="control-label">可修改项目</label>\n' +
  392. ' <div id="field_project">\n' +
  393. ' </div>\n' +
  394. ' <label for="field_file" class="control-label">可修改附件</label>\n' +
  395. ' <div id="field_file">\n' +
  396. ' </div>\n' +
  397. ' <div class="form-group" style="text-align: center">\n' +
  398. ' <button type="button" class="btn btn-primary" onclick="TalentAllowanceInfoSupple.checkAll(\'field\')">全选</button>\n' +
  399. ' <button type="button" class="btn btn-success" onclick="TalentAllowanceInfoSupple.unCheckAll(\'field\')">反选</button>\n' +
  400. ' </div>\n' +
  401. ' </div>\n' +
  402. ' </form>',
  403. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  404. btnAlign: 'c',
  405. zIndex: layer.zIndex,
  406. success: function (layero, index) {
  407. var projectList = data.obj.projects;
  408. var fileList = data.obj.files;
  409. var concatList = data.obj.concats;
  410. var files = data.obj.info.files;
  411. var projects = data.obj.info.projects;
  412. var concats = data.obj.info.concats;
  413. var fields = data.obj.fields;
  414. //初始化附件、核查项目、合同
  415. if (projectList != null && projectList.length != 0) {
  416. var html = '<ul>';
  417. for (var key in projectList) {
  418. html = html + '<li style="width: 100%"><input type="checkbox" class="icheckbox" value="' + projectList[key].id + '"><span>' + projectList[key].projectName + '</span></li>';
  419. }
  420. html = html + "</ul>";
  421. $("#field_project").empty().append(html);
  422. }
  423. if (fileList != null && fileList.length != 0) {
  424. var html = '';
  425. for (var key in fileList) {
  426. html = html + '<ul><li style="width: 100%"><input type="checkbox" class="icheckbox" value="' + fileList[key].id + '"><span>' + fileList[key].name + '</span></li></ul>';
  427. }
  428. $("#field_file").empty().append(html);
  429. }
  430. if (concatList != null && concatList.length != 0) {
  431. var html = '';
  432. for (var key in concatList) {
  433. html = html + '<ul><li style="width: 100%"><input type="checkbox" class="icheckbox" value="' + concatList[key].id + '"><span>' + concatList[key].enterpriseName + '</span></li></ul>';
  434. }
  435. $("#field_concat").empty().append(html);
  436. }
  437. TalentAllowanceInfoSupple.initICheck();
  438. if (Feng.isNotEmptyStr(projects)) {
  439. $("#field_project input").each(function () {
  440. if (projects.indexOf($(this).val()) != -1) {
  441. $(this).iCheck("check");
  442. }
  443. });
  444. }
  445. if (files != null && files != '') {
  446. $("#field_file input").each(function () {
  447. if (files.indexOf($(this).val()) != -1) {
  448. $(this).iCheck("check");
  449. }
  450. });
  451. }
  452. if (concats != null && concats != '') {
  453. $("#field_concat input").each(function () {
  454. if (concats.indexOf($(this).val()) != -1) {
  455. $(this).iCheck("check");
  456. }
  457. });
  458. }
  459. if(Feng.isNotEmptyStr(fields) && fields == "wage"){
  460. $("#field_field ul input[value='wage']").iCheck("check");
  461. }
  462. },
  463. yes: function (index, layero) {
  464. var projects = '', files = '', concats = '' ,fields = '';
  465. $("#field_project li input").each(function (index) {
  466. if ($(this).is(":checked")) {
  467. projects = projects + $(this).val() + ",";
  468. }
  469. });
  470. $("#field_file li input").each(function (index) {
  471. if ($(this).is(":checked")) {
  472. files = files + $(this).val() + ",";
  473. }
  474. });
  475. $("#field_concat li input").each(function (index) {
  476. if ($(this).is(":checked")) {
  477. concats = concats + $(this).val() + ",";
  478. }
  479. });
  480. $("#field_field li input").each(function(index){
  481. if($(this).is(":checked")){
  482. fields = fields + $(this).val() + ",";
  483. }
  484. });
  485. fields = fields.substring(0,fields.length-1);
  486. if (Feng.isEmptyStr(projects) && Feng.isEmptyStr(files) && Feng.isEmptyStr(concats) && Feng.isEmptyStr(fields)) {
  487. Feng.info("请选择可修改的字段、附件或合同!");
  488. return;
  489. }
  490. var ajax = new $ax(Feng.ctxPath + "/talentAllowanceInfo/updateFieldsAndFiles", function (data) {
  491. if (data.code == 200) {
  492. layer.close(index);
  493. Feng.success(data.msg);
  494. } else {
  495. Feng.error(data.msg);
  496. }
  497. }, function (data) {
  498. Feng.error("修改失败!" + data.responseJSON.message + "!");
  499. });
  500. ajax.setData({
  501. "id": TalentAllowanceInfo.seItem.id,
  502. "projects": projects,
  503. "files": files,
  504. "concats": concats,
  505. "fields" : fields
  506. })
  507. ajax.start();
  508. }
  509. });
  510. } else {
  511. Feng.error(data.msg);
  512. }
  513. }, function (data) {
  514. Feng.error("查询失败!" + data.responseJSON.message + "!");
  515. });
  516. ajax.start();
  517. }
  518. }
  519. /**
  520. * 撤销审核
  521. */
  522. TalentAllowanceInfo.firstCancleCheck = function () {
  523. if (this.check()) {
  524. var index = layer.open({
  525. type: 1,
  526. title: '撤销审核',
  527. area: ['800px', '420px'], //宽高
  528. fix: false, //不固定
  529. maxmin: true,
  530. content: '<form >\n' +
  531. ' <div class="form-group" style="margin: 10px;">\n' +
  532. ' <label for="checkMsg" class="control-label">撤销原因</label>\n' +
  533. ' <textarea class="form-control" id="cancleMsg" rows="6"></textarea>\n' +
  534. ' </div>\n' +
  535. ' </form>',
  536. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  537. yes: function (index, layero) {
  538. var cancleMsg = $("#cancleMsg").val();
  539. if (Feng.isEmptyStr(cancleMsg)) {
  540. Feng.error("撤销原因不能为空");
  541. return;
  542. }
  543. var operation = function () {
  544. var ajax = new $ax(Feng.ctxPath + "/talentAllowanceInfo/cancleFirstCheck", function (data) {
  545. if (data.code == 200) {
  546. Feng.success(data.msg);
  547. TalentAllowanceInfo.table.refresh();
  548. layer.close(index);
  549. } else {
  550. Feng.error(data.msg);
  551. }
  552. locked = false;
  553. }, function (data) {
  554. Feng.error("撤销审核失败!" + data.responseJSON.message + "!");
  555. locked = false;
  556. });
  557. ajax.setData({
  558. "id": TalentAllowanceInfo.seItem.id,
  559. "companyId": TalentAllowanceInfo.seItem.companyId,
  560. "checkMsg": cancleMsg
  561. })
  562. ajax.start();
  563. };
  564. Feng.confirm("一旦提交无法修改,确定要撤销吗?", operation);
  565. }
  566. });
  567. }
  568. }
  569. /**
  570. * 撤销复核
  571. */
  572. TalentAllowanceInfo.reviewCancleCheck = function () {
  573. if (this.check()) {
  574. var index = layer.open({
  575. type: 1,
  576. title: '撤销审核',
  577. area: ['800px', '420px'], //宽高
  578. fix: false, //不固定
  579. maxmin: true,
  580. content: '<form >\n' +
  581. ' <div class="form-group" style="margin: 10px;">\n' +
  582. ' <label for="checkMsg" class="control-label">撤销原因</label>\n' +
  583. ' <textarea class="form-control" id="cancleMsg" rows="6"></textarea>\n' +
  584. ' </div>\n' +
  585. ' </form>',
  586. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  587. yes: function (index, layero) {
  588. var cancleMsg = $("#cancleMsg").val();
  589. if (Feng.isEmptyStr(cancleMsg)) {
  590. Feng.error("撤销原因不能为空");
  591. return;
  592. }
  593. var operation = function () {
  594. var ajax = new $ax(Feng.ctxPath + "/talentAllowanceInfo/reviewCancleCheck", function (data) {
  595. if (data.code == 200) {
  596. Feng.success(data.msg);
  597. TalentAllowanceInfo.table.refresh();
  598. layer.close(index);
  599. } else {
  600. Feng.error(data.msg);
  601. }
  602. locked = false;
  603. }, function (data) {
  604. Feng.error("撤销复核失败!" + data.responseJSON.message + "!");
  605. locked = false;
  606. });
  607. ajax.setData({"id": TalentAllowanceInfo.seItem.id, "checkMsg": cancleMsg})
  608. ajax.start();
  609. };
  610. Feng.confirm("一旦提交无法修改,确定要撤销吗?", operation);
  611. }
  612. });
  613. }
  614. }
  615. TalentAllowanceInfo.repair = function (){
  616. var operation = function () {
  617. var ajax = new $ax(Feng.ctxPath + "/talentAllowanceInfo/repairTalentType", function (data) {
  618. if (data.code == 200) {
  619. Feng.success(data.msg);
  620. TalentAllowanceInfo.table.refresh();
  621. } else {
  622. Feng.error(data.msg);
  623. }
  624. }, function (data) {
  625. Feng.error("修复失败!" + data.responseJSON.message + "!");
  626. });
  627. ajax.start();
  628. };
  629. Feng.confirm("一旦修复无法修改,确定要修复吗?", operation);
  630. }
  631. /**
  632. * 导出基础信息
  633. */
  634. TalentAllowanceInfo.exportBasicInfo = function () {
  635. var process = $("#process").val();
  636. var queryData = TalentAllowanceInfo.formParams();
  637. queryData['process'] = process;
  638. var url = Feng.setUrlParam(Feng.ctxPath + "/talentAllowanceInfoExport/exportBasicInfo", queryData);
  639. window.hiddenIframe.location.href = url;
  640. }
  641. /**
  642. * 导出项目数据
  643. */
  644. TalentAllowanceInfo.exportProjectData = function () {
  645. var selected = $("#dataTable").bootstrapTable('getSelections');
  646. if (selected.length == 0) {
  647. Feng.info("请先选择需要导出的数据!");
  648. return false;
  649. }
  650. var ids = "";
  651. for (var i = 0; i < selected.length; i++) {
  652. ids = ids + selected[i].id + ",";
  653. }
  654. window.hiddenIframe.location.href = Feng.ctxPath + "/talentAllowanceInfoExport/exportProjectData?ids=" + ids + "&process=" + $("#process").val();
  655. }
  656. /**
  657. * 导出
  658. */
  659. TalentAllowanceInfo.export = function (type) {
  660. var selected = $("#dataTable").bootstrapTable('getSelections');
  661. if (selected.length == 0) {
  662. Feng.info("请先选择需要导出的数据!");
  663. return false;
  664. }
  665. var ids = "";
  666. for (var i = 0; i < selected.length; i++) {
  667. ids = ids + selected[i].id + ",";
  668. }
  669. switch (type) {
  670. case 1: //导出社保录入模板
  671. var operation = function () {
  672. window.hiddenIframe.location.href = Feng.ctxPath + "/talentAllowanceInfoExportProject/exportProject?type=1&projectType=1&ids=" + ids + "&process=" + $("#process").val();
  673. }
  674. Feng.confirm("请确认所选数据为未录入社保的数据,确认导出吗?", operation);
  675. break;
  676. case 2: //导出项目录入模板(走访核查)
  677. var operation = function () {
  678. window.hiddenIframe.location.href = Feng.ctxPath + "/talentAllowanceInfoExportProject/exportProject?type=1&projectType=2&ids=" + ids + "&process=" + $("#process").val();
  679. }
  680. Feng.confirm("请确认所选数据为未录入走访核查项目的数据,确认导出吗?", operation);
  681. break;
  682. case 3: //导出社保核查结果
  683. var operation = function () {
  684. window.hiddenIframe.location.href = Feng.ctxPath + "/talentAllowanceInfoExportProject/exportProject?type=2&projectType=1&ids=" + ids + "&process=" + $("#process").val();
  685. }
  686. Feng.confirm("确认导出吗?", operation);
  687. break;
  688. case 4: //导出项目核查结果(走访核查)
  689. var operation = function () {
  690. window.hiddenIframe.location.href = Feng.ctxPath + "/talentAllowanceInfoExportProject/exportProject?type=2&projectType=2&ids=" + ids + "&process=" + $("#process").val();
  691. }
  692. Feng.confirm("确认导出吗?", operation);
  693. break;
  694. case 5: //导出项目核查结果(所有)
  695. var operation = function () {
  696. window.hiddenIframe.location.href = Feng.ctxPath + "/talentAllowanceInfoExportProject/exportProject?type=2&projectType=3&ids=" + ids + "&process=" + $("#process").val();
  697. }
  698. Feng.confirm("确认导出吗?", operation);
  699. break;
  700. }
  701. }
  702. /**
  703. * 显示导入模态框
  704. */
  705. TalentAllowanceInfo.showImportModal = function (type) {
  706. if (type == 1) {
  707. $("#importModalLabel").html("社保核查情况导入");
  708. } else if (type == 2) {
  709. $("#importModalLabel").html("走访核查情况导入");
  710. }
  711. $("#file,#fileName").val("");
  712. $("#importModal").modal("show");
  713. }
  714. /**
  715. * 导入附件提交
  716. */
  717. TalentAllowanceInfo.importSubmit = function () {
  718. var operation = function () {
  719. $("#import-form")[0].submit();
  720. }
  721. Feng.confirm("导入前请确认仔细确认所选文件,一旦导入无法修改,确认导入吗?", operation);
  722. }
  723. /**
  724. * 回调
  725. */
  726. TalentAllowanceInfo.callBack = function (data) {
  727. if (data.code == 200) {
  728. $("#importModal").modal("hide");
  729. Feng.success(data.msg);
  730. } else {
  731. Feng.error(data.msg);
  732. }
  733. }
  734. /**
  735. * 查询表单提交参数对象
  736. * @returns {{}}
  737. */
  738. TalentAllowanceInfo.formParams = function () {
  739. var queryData = {};
  740. queryData['year'] = $("#year").val();
  741. queryData['enterpriseName'] = $("#enterpriseName").val();
  742. queryData['name'] = $("#name").val();
  743. queryData['idCard'] = $("#idCard").val();
  744. queryData['talentType'] = $("#talentType").val();
  745. queryData['talentArrange'] = $("#talentArrange").val();
  746. queryData['address'] = $("#address").val();
  747. queryData['identifyCondition'] = $("#identifyCondition").val();
  748. queryData['isSupple'] = $("#isSupple").val();
  749. queryData['checkState'] = $("#checkState").val();
  750. queryData['isPublicCheck'] = $("#isPublicCheck").val();
  751. queryData['publicState'] = $("#publicState").val();
  752. queryData['recommendAllowanceType'] = $("#recommendAllowanceType").val();
  753. queryData['companyName'] = $("#companyName").val();
  754. queryData['introductionMode'] = $("#introductionMode").val();
  755. queryData['firstJJStartTime'] = $("#firstJJStartTime").val();
  756. queryData['firstJJEndTime'] = $("#firstJJEndTime").val();
  757. return queryData;
  758. }
  759. /**
  760. * 查询人才认定申报列表
  761. */
  762. TalentAllowanceInfo.search = function () {
  763. TalentAllowanceInfo.table.refresh({
  764. query: TalentAllowanceInfo.formParams()
  765. });
  766. };
  767. /**
  768. * 重置
  769. */
  770. TalentAllowanceInfo.reset = function () {
  771. $("#year").val("");
  772. $("#enterpriseName").val("");
  773. $("#name").val("");
  774. $("#idCard").val("");
  775. $("#talentType").val("");
  776. $("#talentArrange").val("");
  777. $("#address").val("");
  778. $("#identifyCondition").val("");
  779. $("#isSupple").val("");
  780. $("#checkState").val("");
  781. $("#isPublicCheck").val("");
  782. $("#publicState").val("");
  783. $("#recommendAllowanceType").val("");
  784. $("#companyName").val("");
  785. $("#introductionMode").val("");
  786. $("#firstJJStartTime").val("");
  787. $("#firstJJEndTime").val("");
  788. }
  789. /**
  790. * 获取人才认定
  791. */
  792. TalentAllowanceInfo.getIdentifyCondition = function () {
  793. var level = $("#talentArrange").val();
  794. if (level == null || level == '') {
  795. $("#identifyCondition").empty();
  796. $("#identifyCondition").trigger('chosen:updated');
  797. return;
  798. }
  799. Feng.addAjaxSelect({
  800. "id": "identifyCondition",
  801. "displayCode": "id",
  802. "displayName": "name",
  803. "type": "GET",
  804. "url": Feng.ctxPath + "/api/common/findIdentifyConditionByLevel?talentLevel=" + level + "&type=1"
  805. });
  806. $("#identifyCondition").trigger('chosen:updated');
  807. }
  808. $(function () {
  809. var process = $("#process").val();
  810. var defaultColunms = TalentAllowanceInfoSupple.initColumn(process);
  811. var table = new BSTable(TalentAllowanceInfo.id, "/talentAllowanceInfo/list/" + process, defaultColunms);
  812. table.setPaginationType("server");
  813. table.setOnDblClickRow(function () {
  814. TalentAllowanceInfo.openCheckTalentAllowanceInfo();
  815. });
  816. table.setSingleSelect(false);
  817. // table.setHeaderStyle(function headerStyle(column) {
  818. // return {
  819. // name: {
  820. // css: {background: 'yellow'}
  821. // }
  822. // }[column.field]
  823. // });
  824. TalentAllowanceInfo.table = table.init();
  825. //批量加载字典表数据
  826. var arr = [{
  827. "name": "address",
  828. "code": "un_street"
  829. }, {
  830. "name": "talentArrange",
  831. "code": "un_talentLevel"
  832. }, {
  833. "name": "nationality",
  834. "code": "un_nationality"
  835. }, {
  836. "name": "talentType",
  837. "code": "un_jbt_talentType"
  838. }, {"name": "introductionMode", "code": "un_introduction_mode"}];
  839. Feng.findChildDictBatch(JSON.stringify(arr));
  840. $("#identifyCondition").on('chosen:ready', function (e, params) {
  841. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  842. });
  843. $("#identifyCondition").chosen({
  844. search_contains: true,
  845. //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  846. disable_search: false,
  847. width: "100%",
  848. enable_split_word_search: true
  849. });
  850. $('#checkAll').click(function () {
  851. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  852. })
  853. $('#uncheckAll').click(function () {
  854. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  855. })
  856. $('#checkAllPrepare').click(function () {
  857. $("#prepareTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  858. })
  859. $('#uncheckAllPrepare').click(function () {
  860. $("#prepareTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  861. })
  862. $(".time").each(function(){
  863. laydate.render({
  864. elem: "#"+$(this).attr("id")
  865. ,type: "date"
  866. ,trigger: 'click'
  867. });
  868. });
  869. });