talentAllowanceInfoIC.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  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.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "60px"},
  17. {title: '所属镇街', field: 'addressName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  18. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  19. {title: '性别', field: 'sex', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "60px",
  20. formatter(value, row, index) {
  21. if (value == 1) {
  22. return "男";
  23. }
  24. if (value == 2) {
  25. return "女";
  26. }
  27. }
  28. },
  29. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  30. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  31. {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  32. {title: '认定条件证书取得时间', field: 'identifyGetTime', visible: true, align: 'center', valign: 'middle', width: "150px"},
  33. {title: '认定条件名称', field: 'identifyConditionName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  34. {title: '公布入选月份', field: 'identifyMonth', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  35. {title: '津补贴类型', field: 'allowanceType', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px",
  36. formatter(value, row, index) {
  37. if (value == null || value == "")
  38. return "未判定";
  39. if (value == 1)
  40. return "工作津贴";
  41. if (value == 2)
  42. return "一次性交通补贴";
  43. if (value == 3)
  44. return "不予兑现";
  45. }
  46. },
  47. {title: '兑现月份', field: 'months', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  48. {title: '兑现金额', field: 'money', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
  49. {title: '金额说明', field: 'moneyDesc', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
  50. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  51. formatter(value, row, index) {
  52. var html = "";
  53. switch (value) {
  54. case 1:
  55. html = "<span class='label'>待提交</span>"
  56. break;
  57. case 3:
  58. html = "<span class='label label-success''>待总院审核</span>"
  59. break;
  60. case 5:
  61. case 13:
  62. case 15:
  63. case 20:
  64. case 25:
  65. case 35:
  66. html = "<span class='label label-success'>审核中</span>";
  67. break;
  68. case 8:
  69. html = "<span class='label label-danger'>总院驳回</span>"
  70. break;
  71. case 9:
  72. case 10:
  73. html = "<span class='label label-danger'>已驳回</span>"
  74. break;
  75. case - 1:
  76. if (row.publicState >= 3) {
  77. html = "<span class='label label-danger'>审核不通过</span>";
  78. } else {
  79. html = "<span class='label label-success'>审核中</span>";
  80. }
  81. break;
  82. case 30:
  83. if (row.publicState == 1) {
  84. html = "<span class='label label-primary'>待核查征信</span>"
  85. } else if (row.publicState == 2) {
  86. html = "<span class='label label-primary'>待公示</span>"
  87. } else if (row.publicState == 3) {
  88. html = "<span class='label label-primary'>公示中</span>"
  89. } else if (row.publicState == 4) {
  90. html = row.allowanceType != 3 ? "<span class='label label-success'>待兑现</span>" : "<span class='label label-danger'>不予兑现</span>";
  91. } else if (row.publicState == 5) {
  92. html = "<span class='label label-primary'>已兑现</span>"
  93. }
  94. break;
  95. }
  96. return html;
  97. }
  98. },
  99. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  100. formatter: function (value, row, index) {
  101. return "<span class='label label-success' onclick=\"TalentAllowanceInfo.showLog('" + value + "')\" >" +
  102. "<i class=\"fa fa-book\"></i>日志" +
  103. "</span>";
  104. }
  105. }
  106. ];
  107. };
  108. /**
  109. * 检查是否选中
  110. */
  111. TalentAllowanceInfo.check = function () {
  112. var selected = $('#' + this.id).bootstrapTable('getSelections');
  113. if (selected.length == 0) {
  114. Feng.info("请先选中表格中的某一记录!");
  115. return false;
  116. } else {
  117. TalentAllowanceInfo.seItem = selected[0];
  118. return true;
  119. }
  120. };
  121. /**
  122. * 点击添加优秀人才津补贴
  123. */
  124. TalentAllowanceInfo.openAddTalentAllowanceInfo = function () {
  125. var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
  126. if (data.code == 200) {
  127. var index = layer.open({
  128. type: 2,
  129. title: '津补贴申报',
  130. fix: false, //不固定
  131. maxmin: true,
  132. content: '/enterprise/talentAllowance/apply?year=' + data.batch,
  133. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-check layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-calculator"></i>&nbsp;&nbsp;试算', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  134. btnAlign: 'c',
  135. btn1: function (index, layero) {
  136. var obj = layero.find("iframe")[0].contentWindow;
  137. obj.TalentAllowanceInfoDlg.addSubmit();
  138. }, btn2: function (index, layero) {
  139. var obj = layero.find("iframe")[0].contentWindow;
  140. obj.TalentAllowanceInfoDlg.submitToCheck();
  141. return false;
  142. }, btn3: function (index, layero) {
  143. var obj = layero.find("iframe")[0].contentWindow;
  144. obj.TalentAllowanceInfoDlg.calculator();
  145. return false;
  146. }, success: function (layero, index) {
  147. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  148. },
  149. end: function () {
  150. layer.closeAll('tips');
  151. TalentAllowanceInfo.table.refresh();
  152. }
  153. });
  154. layer.full(index);
  155. TalentAllowanceInfo.layerIndex = index;
  156. } else {
  157. Feng.error(data.msg);
  158. }
  159. }, function (data) {
  160. Feng.error("查询失败!" + data.responseJSON.message + "!");
  161. });
  162. ajax.set("type", CONFIG.project_jbt);
  163. ajax.start();
  164. };
  165. /**
  166. * 打开查看优秀人才津补贴详情
  167. */
  168. TalentAllowanceInfo.openTalentAllowanceInfoDetail = function () {
  169. if (this.check()) {
  170. var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
  171. if (data.code == 200) {
  172. var index = layer.open({
  173. type: 2,
  174. title: '津补贴申报',
  175. fix: false, //不固定
  176. maxmin: true,
  177. content: Feng.ctxPath + '/enterprise/talentAllowance/apply/id/' + TalentAllowanceInfo.seItem.id,
  178. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-check"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-calculator"></i>&nbsp;&nbsp;试算', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  179. btnAlign: 'c',
  180. btn1: function (index, layero) {
  181. var obj = layero.find("iframe")[0].contentWindow;
  182. obj.TalentAllowanceInfoDlg.editSubmit();
  183. },
  184. btn2: function (index, layero) {
  185. var obj = layero.find("iframe")[0].contentWindow;
  186. obj.TalentAllowanceInfoDlg.submitToCheck();
  187. return false;
  188. }, btn3: function (index, layero) {
  189. var obj = layero.find("iframe")[0].contentWindow;
  190. obj.TalentAllowanceInfoDlg.calculator();
  191. return false;
  192. },
  193. success: function (layero, index) {
  194. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn0', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  195. },
  196. end: function () {
  197. layer.closeAll('tips');
  198. }
  199. });
  200. layer.full(index);
  201. TalentAllowanceInfo.layerIndex = index;
  202. } else {
  203. Feng.info(data.msg);
  204. }
  205. }, function (data) {
  206. Feng.error("校验失败!" + data.responseJSON.message + "!");
  207. });
  208. ajax.set("type", CONFIG.project_jbt);
  209. ajax.set("year", TalentAllowanceInfo.seItem.year);
  210. ajax.set("first_submit_time", TalentAllowanceInfo.seItem.firstSubmitTime);
  211. ajax.start();
  212. }
  213. };
  214. TalentAllowanceInfo.openTalentAllowanceInfoSelect = function () {
  215. if (this.check()) {
  216. var index = layer.open({
  217. type: 2,
  218. title: '津补贴查看',
  219. fix: false, //不固定
  220. maxmin: true,
  221. content: Feng.ctxPath + '/enterprise/talentAllowance/detail/id/' + TalentAllowanceInfo.seItem.id,
  222. btn: ['<i class="fa fa-calculator"></i>&nbsp;&nbsp;试算', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  223. btnAlign: 'c',
  224. btn1: function (index, layero) {
  225. var obj = layero.find("iframe")[0].contentWindow;
  226. obj.TalentAllowanceInfoDlg.calculator();
  227. return false;
  228. }
  229. });
  230. layer.full(index);
  231. TalentAllowanceInfo.layerIndex = index;
  232. }
  233. }
  234. /**
  235. * 删除优秀人才津补贴
  236. */
  237. TalentAllowanceInfo.delete = function () {
  238. if (this.check()) {
  239. var operation = function () {
  240. var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/delete", function (data) {
  241. if (data.code == 200) {
  242. Feng.success(data.msg);
  243. TalentAllowanceInfo.table.refresh();
  244. } else {
  245. Feng.info(data.msg);
  246. }
  247. }, function (data) {
  248. Feng.error("删除失败!" + data.responseJSON.message + "!");
  249. });
  250. ajax.set("id", TalentAllowanceInfo.seItem.id);
  251. ajax.start();
  252. }
  253. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  254. }
  255. };
  256. /**
  257. * 查询表单提交参数对象
  258. * @returns {{}}
  259. */
  260. TalentAllowanceInfo.formParams = function () {
  261. var queryData = {};
  262. queryData['year'] = $("#year").val();
  263. queryData['enterpriseName'] = $("#enterpriseName").val();
  264. queryData['name'] = $("#name").val();
  265. queryData['idCard'] = $("#idCard").val();
  266. queryData['talentType'] = $("#talentType").val();
  267. queryData['talentArrange'] = $("#talentArrange").val();
  268. queryData['identifyCondition'] = $("#identifyCondition").val();
  269. queryData['allowanceType'] = $("#allowanceType").val();
  270. queryData['address'] = $("#address").val();
  271. return queryData;
  272. }
  273. /**
  274. * 查询人才认定申报列表
  275. */
  276. TalentAllowanceInfo.search = function () {
  277. TalentAllowanceInfo.table.refresh({query: TalentAllowanceInfo.formParams()});
  278. };
  279. /**
  280. * 重置
  281. */
  282. TalentAllowanceInfo.reset = function () {
  283. $("#year").val("");
  284. $("#enterpriseName").val("");
  285. $("#name").val("");
  286. $("#idCard").val("");
  287. $("#talentType").val("");
  288. $("#talentArrange").val("");
  289. $("#identifyCondition").val("");
  290. $("#allowance").val("");
  291. $("#address").val("");
  292. }
  293. /**
  294. * 获取人才认定
  295. */
  296. TalentAllowanceInfo.getIdentifyCondition = function () {
  297. var level = $("#talentArrange").val();
  298. if (level == null || level == '') {
  299. $("#identifyCondition").empty();
  300. $("#identifyCondition").trigger('chosen:updated');
  301. return;
  302. }
  303. Feng.addAjaxSelect({
  304. "id": "identifyCondition",
  305. "displayCode": "id",
  306. "displayName": "name",
  307. "type": "GET",
  308. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel?level=" + level
  309. });
  310. $("#identifyCondition").trigger('chosen:updated');
  311. }
  312. TalentAllowanceInfo.initCheckFileTable = function () {
  313. $('#checkFileTable').bootstrapTable('destroy');
  314. $('#checkFileTable').bootstrapTable({
  315. url: Feng.ctxPath + "/enterprise/talentAllowance/listCommonFile",
  316. method: 'POST',
  317. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  318. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  319. showRefresh: false, // 是否显示刷新按钮
  320. clickToSelect: true, // 是否启用点击选中行
  321. singleSelect: true, // 设置True 将禁止多选
  322. striped: true, // 是否显示行间隔色
  323. pagination: false, // 设置为 true 会在表格底部显示分页条
  324. paginationHAlign: "left",
  325. paginationDetailHAlign: "right",
  326. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  327. showColumns: false,
  328. queryParams: function (params) {
  329. return {"batch": $("#batch").val()};
  330. },
  331. rowStyle: function (row, index) {
  332. return {css: {"word-break": "break-word", "white-space": "inherit"}}
  333. },
  334. columns:
  335. [
  336. {title: '附件原名', field: 'originalName', visible: true, align: 'center', valign: 'middle', width: '120px'},
  337. {title: '预览', field: 'url', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px",
  338. formatter: function (value, row, index) {
  339. var sn = value.lastIndexOf(".");
  340. var suffix = value.substring(sn + 1, value.length);
  341. var imgStr = "";
  342. if (suffix == "pdf" || suffix == "PDF") {
  343. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + value + "','" + row.id + "','" + row.originalName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  344. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  345. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + value + "','" + row.id + "','" + row.originalName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  346. } else {
  347. imgStr = '<img class=\"imgUrl\" src=\"' + value + '\" style=\"width:25px;height:25px;\">';
  348. }
  349. return imgStr;
  350. }
  351. },
  352. {title: '操作', field: 'url', visible: true, align: 'center', valign: 'middle', width: '80px',
  353. formatter: function (value, row, index) {
  354. var selector = '<select style="background:#fff;border:1px solid #000;margin-right:2px;" onchange="TalentAllowanceInfo.onCommonTypeChangeAndBind(\'' + row.id + '\',this.value);"><option value="">关联通用附件类型</option>';
  355. for (var i = 0; i < row.fileTypes.length; i++) {
  356. var selectedStr = row.fileTypes[i].id == row.fileTypeId ? "selected" : "";
  357. selector += '<option value="' + row.fileTypes[i].id + '" ' + selectedStr + '>' + row.fileTypes[i].name + '</option>'
  358. }
  359. selector += '</select>';
  360. return selector + "<button type='button' onclick=\"downloadFile('" + row.id + "','6')\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button>" +
  361. "<button type='button' onclick=\"TalentAllowanceInfo.deleteCheckFile('" + row.id + "','" + CONFIG.project_jbt + "')\" class=\"btn btn-xs btn-danger\">" +
  362. "<i class=\"fa fa-times\"></i>删除" +
  363. "</button>";
  364. }
  365. },
  366. ],
  367. onPostBody: function () {
  368. $('#checkFileTable' + "td.uitd_showTip").bind("mouseover", function () {
  369. var htm = $(this).html();
  370. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  371. });
  372. $(".imgUrl").viewer({fullscreen: false});
  373. },
  374. });
  375. }
  376. TalentAllowanceInfo.onCommonTypeChangeAndBind = function (fileId, fileTypeId) {
  377. var formData = new FormData();
  378. formData.append('fileId', fileId.toString());
  379. formData.append('fileTypeId', fileTypeId.toString());
  380. $.ajax({
  381. url: Feng.ctxPath + "/enterprise/talentAllowance/bindCommonFileWithFileType",
  382. type: "POST",
  383. processData: false,
  384. contentType: false,
  385. data: formData,
  386. success: function (data) {
  387. Feng.info(data.msg);
  388. }, error: function (data) {
  389. Feng.error("关联失败!" + data.responseJSON.message + "!");
  390. }
  391. });
  392. }
  393. TalentAllowanceInfo.commonColumns = function () {
  394. return [
  395. {field: "selectItem", checkbox: true},
  396. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "30%"},
  397. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "40%"},
  398. {title: '入职时间', field: 'cur_entry_time', visible: true, align: 'center', valign: 'middle', width: "30%"}
  399. ];
  400. }
  401. TalentAllowanceInfo.openBatchApplyModal = function (type) {
  402. var columns = TalentAllowanceInfo.commonColumns();
  403. $('#batchApplyTable').bootstrapTable('destroy');
  404. $('#batchApplyTable').bootstrapTable({
  405. url: Feng.ctxPath + "/enterprise/talentAllowance/findTalentAllowance",
  406. method: 'POST',
  407. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  408. search: true, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  409. showRefresh: false, // 是否显示刷新按钮
  410. clickToSelect: true, // 是否启用点击选中行
  411. singleSelect: false, // 设置True 将禁止多选
  412. striped: true, // 是否显示行间隔色
  413. pagination: true, // 设置为 true 会在表格底部显示分页条
  414. paginationHAlign: "left",
  415. paginationDetailHAlign: "right",
  416. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  417. pageNumber: 1, //初始化加载第一页,默认第一页
  418. pageSize: 10, //每页的记录行数(*)
  419. pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*)
  420. maintainSelected: true, //全表全选需要开启
  421. showColumns: false,
  422. responseHandler: function (res) {
  423. $(".time").each(function () {
  424. laydate.render({
  425. elem: "#" + $(this).attr("id")
  426. , type: 'date'
  427. , format: 'yyyy年MM月dd日'
  428. });
  429. });
  430. $("#batchApplyModal").modal("show");
  431. return res.obj.rows;
  432. },
  433. columns: columns
  434. });
  435. }
  436. TalentAllowanceInfo.batchApply = function () {
  437. var selected = $('#batchApplyTable').bootstrapTable('getSelections');
  438. if (!selected || selected.length < 1) {
  439. Feng.info("请至少选择一行数据!");
  440. return;
  441. }
  442. var ids = "";
  443. var count = 0;
  444. for (var i = 0; i < selected.length; i++) {
  445. count++;
  446. ids = ids + selected[i].id + ",";
  447. }
  448. var operation = function () {
  449. var index = layer.open({
  450. type: 1,
  451. title: '请确认补贴类型',
  452. area: ['300px', '220px'], //宽高
  453. fix: false, //不固定
  454. maxmin: true,
  455. content: '<div class="rowGroup" style="padding:20px;"><label class="control-label spacing"><span style="color: red">*</span>补贴类型</label><br><input type="radio" name="batchAllowanceType" value="1"/><label for="batchAllowanceType">工作津贴</label>&nbsp;&nbsp;<input type="radio" name="batchAllowanceType" value="2"/><label for="batchAllowanceType">一次性交通补贴</label></div>',
  456. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;确定', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  457. btnAlign: 'c',
  458. success: function () {
  459. },
  460. yes: function (index, layero) {
  461. var allowanceType = $("input[name=batchAllowanceType]:checked").val();
  462. if (Feng.isEmptyStr(allowanceType) || typeof allowanceType == "undefined") {
  463. Feng.info("请选择补贴类型");
  464. return;
  465. }
  466. layer.close(index);
  467. var allowanceTypeStr = allowanceType == 1 ? "工作津贴" : "一次性交通补贴";
  468. Feng.confirm("已选<span style='color:#ff0000;'>" + count + "</span>人,确定要批量申请<span style='color:#ff0000;'>" + allowanceTypeStr + "</span>吗?<br><span style='color:#ff0000;'>*此方法不能撤销,请谨慎操作</span>", function () {
  469. var ajax = new $ax("/enterprise/talentAllowance/batchApply", function (data) {
  470. if (data.code == 200) {
  471. Feng.success(data.msg);
  472. TalentInfo.table.refresh();
  473. $("#batchApplyModal").modal("hide");
  474. } else {
  475. Feng.error(data.msg);
  476. }
  477. }, function (data) {
  478. Feng.error("公示失败!" + data.responseJSON.message + "!");
  479. });
  480. ajax.set("ids", ids);
  481. ajax.set("allowanceType", allowanceType);
  482. ajax.start();
  483. });
  484. }
  485. });
  486. }
  487. Feng.confirm("确定进入下一步选择补贴类型吗?", operation);
  488. }
  489. $('#checkAllBatch').click(function () {
  490. $("#batchApplyTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  491. })
  492. $('#uncheckAllBatch').click(function () {
  493. $("#batchApplyTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  494. })
  495. TalentAllowanceInfo.batchImportApply = function () {
  496. $("#file,#fileName").val("");
  497. $("#importModal").modal("show");
  498. }
  499. /**
  500. *
  501. */
  502. TalentAllowanceInfo.importSubmit = function () {
  503. $("#import-form")[0].submit();
  504. }
  505. TalentAllowanceInfo.importCallBack = function (data) {
  506. if (data.code == 200) {
  507. $("#importModal").modal("hide");
  508. TalentAllowanceInfo.table.refresh();
  509. Feng.success(data.msg);
  510. } else {
  511. Feng.error(data.msg);
  512. }
  513. }
  514. /**
  515. * 核查材料留存上传
  516. */
  517. TalentAllowanceInfo.showCheckFileModal = function () {
  518. Feng.addAjaxSelect({
  519. "id": "batch",
  520. "displayCode": "id",
  521. "displayName": "batch",
  522. "type": "GET",
  523. "url": "/common/batch/listBatchByType?type=" + CONFIG.project_jbt + "&source=" + $("#type").val()
  524. });
  525. $("#upload_file").val("");
  526. $("#checkFileModal").modal("show");
  527. }
  528. TalentAllowanceInfo.checkFileUpload = function () {
  529. var batch = $("#batch").val();
  530. if (Feng.isEmptyStr(batch)) {
  531. Feng.info("请选择申报批次后再上传!");
  532. return;
  533. }
  534. $("#upload_file ").unbind("change");
  535. $("#upload_file ").change(function () {
  536. var formData = new FormData();
  537. formData.append("batch", batch);
  538. for (var i = 0; i < $('#upload_file')[0].files.length; i++) {
  539. formData.append('file', $('#upload_file')[0].files[i]);
  540. }
  541. $.ajax({
  542. url: Feng.ctxPath + "/enterprise/talentAllowance/uploadCommonFile",
  543. type: "POST",
  544. processData: false,
  545. contentType: false,
  546. data: formData,
  547. success: function (data) {
  548. $("#checkFileTable").bootstrapTable("refresh", {});
  549. Feng.info(data.msg);
  550. }, error: function (data) {
  551. Feng.error("上传失败!" + data.responseJSON.message + "!");
  552. }
  553. });
  554. });
  555. $('#upload_file').val("");
  556. $('#upload_file').click();
  557. }
  558. TalentAllowanceInfo.deleteCheckFile = function (id, type) {
  559. var operation = function () {
  560. var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/deleteCommonFile", function (data) {
  561. if (data.code == 200) {
  562. Feng.success(data.msg);
  563. $("#checkFileTable").bootstrapTable("refresh", {});
  564. } else {
  565. Feng.error(data.msg);
  566. }
  567. }, function (data) {
  568. Feng.error("删除失败!" + data.responseJSON.message + "!");
  569. });
  570. ajax.set("id", id);
  571. ajax.set("type", type);
  572. ajax.start();
  573. }
  574. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  575. }
  576. /**
  577. * 导出基础信息
  578. */
  579. TalentAllowanceInfo.export = function () {
  580. var queryData = TalentAllowanceInfo.formParams();
  581. var url = Feng.setUrlParam(Feng.ctxPath + "/enterprise/talentAllowance/export", queryData);
  582. window.hiddenIframe.location.href = url;
  583. }
  584. /**
  585. * 显示审核日志
  586. */
  587. TalentAllowanceInfo.showLog = function (id) {
  588. layer.open({
  589. type: 1,
  590. title: "日志",
  591. fixed: false,
  592. content: '<table id="' + id + '"></table>',
  593. area: ['80%', '80%'],
  594. maxmin: true,
  595. success: function (layero, index) {
  596. $('#' + id).bootstrapTable({
  597. url: Feng.ctxPath + "/common/api/getCheckLog",
  598. method: 'POST',
  599. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  600. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  601. showRefresh: false, // 是否显示刷新按钮
  602. clickToSelect: true, // 是否启用点击选中行
  603. singleSelect: true, // 设置True 将禁止多选
  604. striped: true, // 是否显示行间隔色
  605. pagination: false, // 设置为 true 会在表格底部显示分页条
  606. paginationHAlign: "left",
  607. paginationDetailHAlign: "right",
  608. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  609. showColumns: false,
  610. queryParams: function (params) {
  611. return {"type": CONFIG.project_jbt, "mainId": id, "typeFileId": "", "active": 1}
  612. },
  613. rowStyle: function (row, index) {
  614. return {
  615. css: {
  616. "word-break": "break-word",
  617. "white-space": "inherit"
  618. }
  619. }
  620. },
  621. columns:
  622. [
  623. {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle', width: "10%",
  624. formatter: function (value, row, index) {
  625. return "" + value;
  626. }
  627. },
  628. {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle', width: "65%",
  629. formatter: function (value, row, index) {
  630. return '<span data-toggle="tooltip" title="' + value + '">"' + value + '"</span>';
  631. }
  632. },
  633. {title: '操作人', field: 'createUser', visible: false, align: 'center', valign: 'middle', width: "15%"},
  634. {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"},
  635. ]
  636. ,
  637. onPostBody: function () {
  638. $('#' + id + "td.uitd_showTip").bind("mouseover", function () {
  639. var htm = $(this).html();
  640. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  641. });
  642. }
  643. });
  644. }
  645. });
  646. }
  647. $(function () {
  648. var defaultColunms = TalentAllowanceInfo.initColumn();
  649. var table = new BSTable(TalentAllowanceInfo.id, "/enterprise/talentAllowance/list", defaultColunms);
  650. table.setPaginationType("server");
  651. table.setOnDblClickRow(function () {
  652. TalentAllowanceInfo.openTalentAllowanceInfoDetail();
  653. });
  654. TalentAllowanceInfo.table = table.init();
  655. //批量加载字典表数据
  656. var arr = [
  657. {"name": "address", "code": "street"},
  658. {"name": "talentArrange", "code": "talent_arrange"},
  659. {"name": "nationality", "code": "nationality"}];
  660. Feng.findChildDictBatch(JSON.stringify(arr));
  661. $("#identifyCondition").chosen({
  662. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  663. disable_search: false,
  664. width: "100%",
  665. enable_split_word_search: true
  666. });
  667. });