talentAllowanceInfo.js 45 KB

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