talentAllowanceInfo.js 42 KB

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