talentAllowanceInfoIC.js 30 KB

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