talentAllowanceInfo.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  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 + '/admin/talentAllowance/toCheckPage/id/' + TalentAllowanceInfo.seItem.id + "/process/" + $("#process").val() + "/companyId/" + 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 + '/admin/talentAllowance/toCheckPage/id/' + TalentAllowanceInfo.seItem.id + "/process/" + $("#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 + '/admin/talentAllowance/toCheckPage/id/' + TalentAllowanceInfo.seItem.id + "/process/" + $("#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 + '/admin/talentAllowance/toSelectPage/id/' + TalentAllowanceInfo.seItem.id + "/process/" + $("#process").val() + "/null";
  108. if (process == 1) {
  109. url = Feng.ctxPath + '/admin/talentAllowance/toSelectPage/id/' + TalentAllowanceInfo.seItem.id + "/process/" + $("#process").val() + "/companyId/" + 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 + "/admin/talentAllowance/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 + "/admin/talentAllowance/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 + "/admin/talentAllowance/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 + "/admin/talentAllowance/findFieldsAndFiles?id=" + TalentAllowanceInfo.seItem.id, function (data) {
  372. var obj = data.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" id="typeChange" class="icheckbox" value="allowanceType"><span>津补贴类型</span></li>\n' +
  390. ($("#type").val() == 6 ? '<li style="width: 100%"><input type="checkbox" class="icheckbox" value="postType"><span>岗位类型</span></li>' : "") +
  391. ($("#type").val() == 6 ? '<li style="width: 100%"><input type="checkbox" class="icheckbox" value="institution"><span>所属编制</span></li>' : "") +
  392. ' </ul></div>\n' +
  393. ' <label for="field_project" class="control-label">可修改项目</label>\n' +
  394. ' <div id="field_project">\n' +
  395. ' </div>\n' +
  396. ' <label for="field_file" class="control-label">可修改附件</label>\n' +
  397. ' <div id="field_file">\n' +
  398. ' </div>\n' +
  399. ' <div class="form-group" style="text-align: center">\n' +
  400. ' <button type="button" class="btn btn-primary" onclick="TalentAllowanceInfoSupple.checkAll(\'field\')">全选</button>\n' +
  401. ' <button type="button" class="btn btn-success" onclick="TalentAllowanceInfoSupple.unCheckAll(\'field\')">反选</button>\n' +
  402. ' </div>\n' +
  403. ' </div>\n' +
  404. ' </form>',
  405. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  406. btnAlign: 'c',
  407. zIndex: layer.zIndex,
  408. success: function (layero, index) {
  409. var projectList = data.obj.projects;
  410. var fileList = data.obj.files;
  411. var concatList = data.obj.concats;
  412. var files = data.obj.info.files;
  413. var projects = data.obj.info.projects;
  414. var concats = data.obj.info.concats;
  415. var fields = data.obj.info.fields;
  416. //初始化附件、核查项目、合同
  417. if (projectList != null && projectList.length != 0) {
  418. var html = '<ul>';
  419. for (var key in projectList) {
  420. html = html + '<li style="width: 100%"><input type="checkbox" class="icheckbox" value="' + projectList[key].id + '"><span>' + projectList[key].projectName + '</span></li>';
  421. }
  422. html = html + "</ul>";
  423. $("#field_project").empty().append(html);
  424. }
  425. if (fileList != null && fileList.length != 0) {
  426. var html = '';
  427. for (var key in fileList) {
  428. html = html + '<ul><li style="width: 100%"><input type="checkbox" class="icheckbox" data-type="' + fileList[key].isConditionFile + '" value="' + fileList[key].id + '"><span>' + fileList[key].name + '</span></li></ul>';
  429. }
  430. $("#field_file").empty().append(html);
  431. }
  432. if (concatList != null && concatList.length != 0) {
  433. var html = '';
  434. for (var key in concatList) {
  435. html = html + '<ul><li style="width: 100%"><input type="checkbox" class="icheckbox" value="' + concatList[key].id + '"><span>' + concatList[key].enterpriseName + '</span></li></ul>';
  436. }
  437. $("#field_concat").empty().append(html);
  438. }
  439. TalentAllowanceInfoSupple.initICheck();
  440. if (Feng.isNotEmptyStr(projects)) {
  441. $("#field_project input").each(function () {
  442. if (projects.indexOf($(this).val()) != -1) {
  443. $(this).iCheck("check");
  444. }
  445. });
  446. }
  447. if (files != null && files != '') {
  448. $("#field_file input").each(function () {
  449. if (files.indexOf($(this).val()) != -1) {
  450. $(this).iCheck("check");
  451. }
  452. });
  453. }
  454. if (concats != null && concats != '') {
  455. $("#field_concat input").each(function () {
  456. if (concats.indexOf($(this).val()) != -1) {
  457. $(this).iCheck("check");
  458. }
  459. });
  460. }
  461. if (Feng.isNotEmptyStr(fields)) {
  462. $("#field_field input").each(function () {
  463. if (fields.indexOf($(this).val()) != -1) {
  464. $(this).iCheck("check");
  465. }
  466. });
  467. }
  468. $("input[type=checkbox][value=allowanceType]").on("ifChanged", function (e) {
  469. var isChecked = $(this).is(":checked") ? "check" : "uncheck";
  470. $("#field_file input").each(function () {
  471. $(this).iCheck(isChecked);
  472. })
  473. $("#field_project input").each(function () {
  474. $(this).iCheck(isChecked);
  475. })
  476. })
  477. },
  478. yes: function (index, layero) {
  479. var projects = '', files = '', concats = '', fields = '';
  480. $("#field_project li input").each(function (index) {
  481. if ($(this).is(":checked")) {
  482. projects = projects + $(this).val() + ",";
  483. }
  484. });
  485. $("#field_file li input").each(function (index) {
  486. if ($(this).is(":checked")) {
  487. files = files + $(this).val() + ",";
  488. }
  489. });
  490. $("#field_concat li input").each(function (index) {
  491. if ($(this).is(":checked")) {
  492. concats = concats + $(this).val() + ",";
  493. }
  494. });
  495. $("#field_field li input").each(function (index) {
  496. if ($(this).is(":checked")) {
  497. fields = fields + $(this).val() + ",";
  498. }
  499. });
  500. fields = fields.substring(0, fields.length - 1);
  501. if (Feng.isEmptyStr(projects) && Feng.isEmptyStr(files) && Feng.isEmptyStr(concats) && Feng.isEmptyStr(fields)) {
  502. Feng.info("请选择可修改的字段、附件或合同!");
  503. return;
  504. }
  505. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/updateFieldsAndFiles", function (data) {
  506. if (data.code == 200) {
  507. layer.close(index);
  508. Feng.success(data.msg);
  509. } else {
  510. Feng.error(data.msg);
  511. }
  512. }, function (data) {
  513. Feng.error("修改失败!" + data.responseJSON.message + "!");
  514. });
  515. ajax.setData({
  516. "id": TalentAllowanceInfo.seItem.id,
  517. "projects": projects,
  518. "files": files,
  519. "concats": concats,
  520. "fields": fields
  521. })
  522. ajax.start();
  523. }
  524. });
  525. } else {
  526. Feng.error(data.msg);
  527. }
  528. }, function (data) {
  529. Feng.error("查询失败!" + data.responseJSON.message + "!");
  530. });
  531. ajax.start();
  532. }
  533. }
  534. /**
  535. * 撤销审核
  536. */
  537. TalentAllowanceInfo.firstCancleCheck = function () {
  538. if (this.check()) {
  539. var index = layer.open({
  540. type: 1,
  541. title: '撤销审核',
  542. area: ['800px', '420px'], //宽高
  543. fix: false, //不固定
  544. maxmin: true,
  545. content: '<form >\n' +
  546. ' <div class="form-group" style="margin: 10px;">\n' +
  547. ' <label for="checkMsg" class="control-label">撤销原因</label>\n' +
  548. ' <textarea class="form-control" id="cancleMsg" rows="6"></textarea>\n' +
  549. ' </div>\n' +
  550. ' </form>',
  551. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  552. yes: function (index, layero) {
  553. var cancleMsg = $("#cancleMsg").val();
  554. if (Feng.isEmptyStr(cancleMsg)) {
  555. Feng.error("撤销原因不能为空");
  556. return;
  557. }
  558. var operation = function () {
  559. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/cancleFirstCheck", function (data) {
  560. if (data.code == 200) {
  561. Feng.success(data.msg);
  562. TalentAllowanceInfo.table.refresh();
  563. layer.close(index);
  564. } else {
  565. Feng.error(data.msg);
  566. }
  567. locked = false;
  568. }, function (data) {
  569. Feng.error("撤销审核失败!" + data.responseJSON.message + "!");
  570. locked = false;
  571. });
  572. ajax.setData({
  573. "id": TalentAllowanceInfo.seItem.id,
  574. "companyId": TalentAllowanceInfo.seItem.companyId,
  575. "checkMsg": cancleMsg
  576. })
  577. ajax.start();
  578. };
  579. Feng.confirm("一旦提交无法修改,确定要撤销吗?", operation);
  580. }
  581. });
  582. }
  583. }
  584. /**
  585. * 撤销复核
  586. */
  587. TalentAllowanceInfo.reviewCancleCheck = function () {
  588. if (this.check()) {
  589. var index = layer.open({
  590. type: 1,
  591. title: '撤销审核',
  592. area: ['800px', '420px'], //宽高
  593. fix: false, //不固定
  594. maxmin: true,
  595. content: '<form >\n' +
  596. ' <div class="form-group" style="margin: 10px;">\n' +
  597. ' <label for="checkMsg" class="control-label">撤销原因</label>\n' +
  598. ' <textarea class="form-control" id="cancleMsg" rows="6"></textarea>\n' +
  599. ' </div>\n' +
  600. ' </form>',
  601. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  602. yes: function (index, layero) {
  603. var cancleMsg = $("#cancleMsg").val();
  604. if (Feng.isEmptyStr(cancleMsg)) {
  605. Feng.error("撤销原因不能为空");
  606. return;
  607. }
  608. var operation = function () {
  609. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/reviewCancleCheck", function (data) {
  610. if (data.code == 200) {
  611. Feng.success(data.msg);
  612. TalentAllowanceInfo.table.refresh();
  613. layer.close(index);
  614. } else {
  615. Feng.error(data.msg);
  616. }
  617. locked = false;
  618. }, function (data) {
  619. Feng.error("撤销复核失败!" + data.responseJSON.message + "!");
  620. locked = false;
  621. });
  622. ajax.setData({"id": TalentAllowanceInfo.seItem.id, "checkMsg": cancleMsg})
  623. ajax.start();
  624. };
  625. Feng.confirm("一旦提交无法修改,确定要撤销吗?", operation);
  626. }
  627. });
  628. }
  629. }
  630. TalentAllowanceInfo.repair = function () {
  631. var operation = function () {
  632. var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/repairTalentType", function (data) {
  633. if (data.code == 200) {
  634. Feng.success(data.msg);
  635. TalentAllowanceInfo.table.refresh();
  636. } else {
  637. Feng.error(data.msg);
  638. }
  639. }, function (data) {
  640. Feng.error("修复失败!" + data.responseJSON.message + "!");
  641. });
  642. ajax.start();
  643. };
  644. Feng.confirm("一旦修复无法修改,确定要修复吗?", operation);
  645. }
  646. /**
  647. * 导出基础信息
  648. */
  649. TalentAllowanceInfo.exportBasicInfo = function () {
  650. var process = $("#process").val();
  651. var queryData = TalentAllowanceInfo.formParams();
  652. queryData['process'] = process;
  653. var url = Feng.setUrlParam(Feng.ctxPath + "/admin/talentAllowance/exportBasicInfo", queryData);
  654. window.hiddenIframe.location.href = url;
  655. }
  656. /**
  657. * 导出项目数据
  658. */
  659. TalentAllowanceInfo.exportProjectData = function () {
  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. window.hiddenIframe.location.href = Feng.ctxPath + "/talentAllowanceInfoExport/exportProjectData?ids=" + ids + "&process=" + $("#process").val();
  670. }
  671. /**
  672. * 导出
  673. */
  674. TalentAllowanceInfo.export = function (type) {
  675. var selected = $("#dataTable").bootstrapTable('getSelections');
  676. if (selected.length == 0) {
  677. Feng.info("请先选择需要导出的数据!");
  678. return false;
  679. }
  680. var ids = "";
  681. for (var i = 0; i < selected.length; i++) {
  682. ids = ids + selected[i].id + ",";
  683. }
  684. switch (type) {
  685. case 1: //导出社保录入模板
  686. var operation = function () {
  687. window.hiddenIframe.location.href = Feng.ctxPath + "/admin/talentAllowance/exportProject?type=1&projectType=1&ids=" + ids + "&process=" + $("#process").val();
  688. }
  689. Feng.confirm("请确认所选数据为未录入社保的数据,确认导出吗?", operation);
  690. break;
  691. case 2: //导出项目录入模板(走访核查)
  692. var operation = function () {
  693. window.hiddenIframe.location.href = Feng.ctxPath + "/admin/talentAllowance/exportProject?type=1&projectType=2&ids=" + ids + "&process=" + $("#process").val();
  694. }
  695. Feng.confirm("请确认所选数据为未录入走访核查项目的数据,确认导出吗?", operation);
  696. break;
  697. case 3: //导出社保核查结果
  698. var operation = function () {
  699. window.hiddenIframe.location.href = Feng.ctxPath + "/admin/talentAllowance/exportProject?type=2&projectType=1&ids=" + ids + "&process=" + $("#process").val();
  700. }
  701. Feng.confirm("确认导出吗?", operation);
  702. break;
  703. case 4: //导出项目核查结果(走访核查)
  704. var operation = function () {
  705. window.hiddenIframe.location.href = Feng.ctxPath + "/admin/talentAllowance/exportProject?type=2&projectType=2&ids=" + ids + "&process=" + $("#process").val();
  706. }
  707. Feng.confirm("确认导出吗?", operation);
  708. break;
  709. case 5: //导出项目核查结果(所有)
  710. var operation = function () {
  711. window.hiddenIframe.location.href = Feng.ctxPath + "/admin/talentAllowance/exportProject?type=2&projectType=3&ids=" + ids + "&process=" + $("#process").val();
  712. }
  713. Feng.confirm("确认导出吗?", operation);
  714. break;
  715. }
  716. }
  717. /**
  718. * 显示导入模态框
  719. */
  720. TalentAllowanceInfo.showImportModal = function (type) {
  721. if (type == 1) {
  722. $("#importModalLabel").html("社保核查情况导入");
  723. } else if (type == 2) {
  724. $("#importModalLabel").html("走访核查情况导入");
  725. }
  726. $("#file,#fileName").val("");
  727. $("#importModal").modal("show");
  728. }
  729. /**
  730. * 导入附件提交
  731. */
  732. TalentAllowanceInfo.importSubmit = function () {
  733. var operation = function () {
  734. $("#import-form")[0].submit();
  735. }
  736. Feng.confirm("导入前请确认仔细确认所选文件,一旦导入无法修改,确认导入吗?", operation);
  737. }
  738. /**
  739. * 回调
  740. */
  741. TalentAllowanceInfo.callBack = function (data) {
  742. if (data.code == 200) {
  743. $("#importModal").modal("hide");
  744. Feng.success(data.msg);
  745. } else {
  746. Feng.error(data.msg);
  747. }
  748. }
  749. /**
  750. * 查询表单提交参数对象
  751. * @returns {{}}
  752. */
  753. TalentAllowanceInfo.formParams = function () {
  754. var queryData = {};
  755. queryData['year'] = $("#year").val();
  756. queryData['enterpriseName'] = $("#enterpriseName").val();
  757. queryData['name'] = $("#name").val();
  758. queryData['idCard'] = $("#idCard").val();
  759. queryData['talentType'] = $("#talentType").val();
  760. queryData['talentArrange'] = $("#talentArrange").val();
  761. queryData['address'] = $("#address").val();
  762. queryData['identifyCondition'] = $("#identifyCondition").val();
  763. queryData['isSupple'] = $("#isSupple").val();
  764. queryData['checkState'] = $("#checkState").val();
  765. queryData['isPublicCheck'] = $("#isPublicCheck").val();
  766. queryData['publicState'] = $("#publicState").val();
  767. queryData['allowanceType'] = $("#allowanceType").val();
  768. queryData['recommendAllowanceType'] = $("#recommendAllowanceType").val();
  769. queryData['companyName'] = $("#companyName").val();
  770. queryData['introductionMode'] = $("#introductionMode").val();
  771. queryData['firstJJStartTime'] = $("#firstJJStartTime").val();
  772. queryData['firstJJEndTime'] = $("#firstJJEndTime").val();
  773. return queryData;
  774. }
  775. /**
  776. * 查询人才认定申报列表
  777. */
  778. TalentAllowanceInfo.search = function () {
  779. TalentAllowanceInfo.table.refresh({
  780. query: TalentAllowanceInfo.formParams()
  781. });
  782. };
  783. /**
  784. * 重置
  785. */
  786. TalentAllowanceInfo.reset = function () {
  787. $("#year").val("");
  788. $("#enterpriseName").val("");
  789. $("#name").val("");
  790. $("#idCard").val("");
  791. $("#talentType").val("");
  792. $("#talentArrange").val("");
  793. $("#address").val("");
  794. $("#identifyCondition").val("");
  795. $("#isSupple").val("");
  796. $("#checkState").val("");
  797. $("#isPublicCheck").val("");
  798. $("#publicState").val("");
  799. $("#recommendAllowanceType").val("");
  800. $("#companyName").val("");
  801. $("#introductionMode").val("");
  802. $("#firstJJStartTime").val("");
  803. $("#firstJJEndTime").val("");
  804. }
  805. /**
  806. * 获取人才认定
  807. */
  808. TalentAllowanceInfo.getIdentifyCondition = function () {
  809. var level = $("#talentArrange").val();
  810. if (level == null || level == '') {
  811. $("#identifyCondition").empty();
  812. $("#identifyCondition").trigger('chosen:updated');
  813. return;
  814. }
  815. Feng.addAjaxSelect({
  816. "id": "identifyCondition",
  817. "displayCode": "id",
  818. "displayName": "name",
  819. "type": "GET",
  820. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel?level=" + level
  821. });
  822. $("#identifyCondition").trigger('chosen:updated');
  823. }
  824. /**
  825. * 下载附件
  826. */
  827. TalentAllowanceInfo.download = function () {
  828. if (this.check()) {
  829. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=2&id=" + TalentAllowanceInfo.seItem.id));
  830. }
  831. }
  832. /**
  833. * 下载通用附件
  834. */
  835. TalentAllowanceInfo.downloadCommonFile = function () {
  836. if (this.check()) {
  837. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadCommonZip?id=" + TalentAllowanceInfo.seItem.id + "&year=" + TalentAllowanceInfo.seItem.year));
  838. }
  839. }
  840. $(function () {
  841. var process = $("#process").val();
  842. var defaultColunms = TalentAllowanceInfoSupple.initColumn(process);
  843. var table = new BSTable(TalentAllowanceInfo.id, "/admin/talentAllowance/list/process/" + process, defaultColunms);
  844. table.setPaginationType("server");
  845. table.setOnDblClickRow(function () {
  846. TalentAllowanceInfo.openCheckTalentAllowanceInfo();
  847. });
  848. table.setSingleSelect(false);
  849. // table.setHeaderStyle(function headerStyle(column) {
  850. // return {
  851. // name: {
  852. // css: {background: 'yellow'}
  853. // }
  854. // }[column.field]
  855. // });
  856. TalentAllowanceInfo.table = table.init();
  857. //批量加载字典表数据
  858. var arr = [{
  859. "name": "address",
  860. "code": "street"
  861. }, {
  862. "name": "talentArrange",
  863. "code": "talent_arrange"
  864. }, {
  865. "name": "nationality",
  866. "code": "nationality"
  867. }, {
  868. "name": "talentType",
  869. "code": "talent_type"
  870. }, {"name": "introductionMode", "code": "un_introduction_mode"}];
  871. Feng.findChildDictBatch(JSON.stringify(arr));
  872. $("#identifyCondition").on('chosen:ready', function (e, params) {
  873. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  874. });
  875. $("#identifyCondition").chosen({
  876. search_contains: true,
  877. //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  878. disable_search: false,
  879. width: "100%",
  880. enable_split_word_search: true
  881. });
  882. $('#checkAll').click(function () {
  883. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  884. })
  885. $('#uncheckAll').click(function () {
  886. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  887. })
  888. $('#checkAllPrepare').click(function () {
  889. $("#prepareTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  890. })
  891. $('#uncheckAllPrepare').click(function () {
  892. $("#prepareTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  893. })
  894. $(".time").each(function () {
  895. laydate.render({
  896. elem: "#" + $(this).attr("id")
  897. , type: "date"
  898. , trigger: 'click'
  899. });
  900. });
  901. });