talentAllowanceInfo.js 45 KB

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