talentAllowanceInfo.js 44 KB

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