talentAllowanceInfo.js 45 KB

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