talentAllowanceInfoIC.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  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 + "/enterpirse/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. return "<button type='button' onclick=\"downloadFile('" + row.id + "','6')\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button>" +
  348. "<button type='button' onclick=\"TalentAllowanceInfo.deleteCheckFile('" + row.id + "','" + CONFIG.project_jbt + "')\" class=\"btn btn-xs btn-danger\">" +
  349. "<i class=\"fa fa-times\"></i>删除" +
  350. "</button>";
  351. }
  352. },
  353. ],
  354. onPostBody: function () {
  355. $('#checkFileTable' + "td.uitd_showTip").bind("mouseover", function () {
  356. var htm = $(this).html();
  357. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  358. });
  359. $(".imgUrl").viewer({fullscreen: false});
  360. },
  361. });
  362. }
  363. TalentAllowanceInfo.commonColumns = function () {
  364. return [
  365. {field: "selectItem", checkbox: true},
  366. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "30%"},
  367. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "40%"},
  368. {title: '入职时间', field: 'cur_entry_time', visible: true, align: 'center', valign: 'middle', width: "30%"}
  369. ];
  370. }
  371. TalentAllowanceInfo.openBatchApplyModal = function (type) {
  372. var columns = TalentAllowanceInfo.commonColumns();
  373. $('#batchApplyTable').bootstrapTable('destroy');
  374. $('#batchApplyTable').bootstrapTable({
  375. url: Feng.ctxPath + "/enterprise/talentAllowance/findTalentAllowance",
  376. method: 'POST',
  377. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  378. search: true, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  379. showRefresh: false, // 是否显示刷新按钮
  380. clickToSelect: true, // 是否启用点击选中行
  381. singleSelect: false, // 设置True 将禁止多选
  382. striped: true, // 是否显示行间隔色
  383. pagination: true, // 设置为 true 会在表格底部显示分页条
  384. paginationHAlign: "left",
  385. paginationDetailHAlign: "right",
  386. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  387. pageNumber: 1, //初始化加载第一页,默认第一页
  388. pageSize: 10, //每页的记录行数(*)
  389. pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*)
  390. maintainSelected: true, //全表全选需要开启
  391. showColumns: false,
  392. responseHandler: function (res) {
  393. $(".time").each(function () {
  394. laydate.render({
  395. elem: "#" + $(this).attr("id")
  396. , type: 'date'
  397. , format: 'yyyy年MM月dd日'
  398. });
  399. });
  400. $("#batchApplyModal").modal("show");
  401. return res.obj.rows;
  402. },
  403. columns: columns
  404. });
  405. }
  406. TalentAllowanceInfo.batchApply = function () {
  407. var selected = $('#batchApplyTable').bootstrapTable('getSelections');
  408. if (!selected || selected.length < 1) {
  409. Feng.info("请至少选择一行数据!");
  410. return;
  411. }
  412. var ids = "";
  413. var count = 0;
  414. for (var i = 0; i < selected.length; i++) {
  415. count++;
  416. ids = ids + selected[i].id + ",";
  417. }
  418. var operation = function () {
  419. var index = layer.open({
  420. type: 1,
  421. title: '请确认补贴类型',
  422. area: ['300px', '220px'], //宽高
  423. fix: false, //不固定
  424. maxmin: true,
  425. 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>',
  426. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;确定', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  427. btnAlign: 'c',
  428. success: function () {
  429. },
  430. yes: function (index, layero) {
  431. var allowanceType = $("input[name=batchAllowanceType]:checked").val();
  432. if (Feng.isEmptyStr(allowanceType) || typeof allowanceType == "undefined") {
  433. Feng.info("请选择补贴类型");
  434. return;
  435. }
  436. layer.close(index);
  437. var allowanceTypeStr = allowanceType == 1 ? "工作津贴" : "一次性交通补贴";
  438. Feng.confirm("已选<span style='color:#ff0000;'>" + count + "</span>人,确定要批量申请<span style='color:#ff0000;'>" + allowanceTypeStr + "</span>吗?<br><span style='color:#ff0000;'>*此方法不能撤销,请谨慎操作</span>", function () {
  439. var ajax = new $ax("/enterprise/talentAllowance/batchApply", function (data) {
  440. if (data.code == 200) {
  441. Feng.success(data.msg);
  442. TalentInfo.table.refresh();
  443. $("#batchApplyModal").modal("hide");
  444. } else {
  445. Feng.error(data.msg);
  446. }
  447. }, function (data) {
  448. Feng.error("公示失败!" + data.responseJSON.message + "!");
  449. });
  450. ajax.set("ids", ids);
  451. ajax.set("allowanceType", allowanceType);
  452. ajax.start();
  453. });
  454. }
  455. });
  456. }
  457. Feng.confirm("确定进入下一步选择补贴类型吗?", operation);
  458. }
  459. $('#checkAllBatch').click(function () {
  460. $("#batchApplyTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  461. })
  462. $('#uncheckAllBatch').click(function () {
  463. $("#batchApplyTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  464. })
  465. TalentAllowanceInfo.batchImportApply = function () {
  466. $("#file,#fileName").val("");
  467. $("#importModal").modal("show");
  468. }
  469. /**
  470. *
  471. */
  472. TalentAllowanceInfo.importSubmit = function () {
  473. $("#import-form")[0].submit();
  474. }
  475. TalentAllowanceInfo.importCallBack = function (data) {
  476. if (data.code == 200) {
  477. $("#importModal").modal("hide");
  478. TalentAllowanceInfo.table.refresh();
  479. Feng.success(data.msg);
  480. } else {
  481. Feng.error(data.msg);
  482. }
  483. }
  484. /**
  485. * 核查材料留存上传
  486. */
  487. TalentAllowanceInfo.showCheckFileModal = function () {
  488. Feng.addAjaxSelect({
  489. "id": "batch",
  490. "displayCode": "id",
  491. "displayName": "batch",
  492. "type": "GET",
  493. "url": "/common/batch/listBatchByType?type=" + CONFIG.project_jbt + "&source=" + $("#type").val()
  494. });
  495. $("#upload_file").val("");
  496. $("#checkFileModal").modal("show");
  497. }
  498. TalentAllowanceInfo.checkFileUpload = function () {
  499. var batch = $("#batch").val();
  500. if (Feng.isEmptyStr(batch)) {
  501. Feng.info("请选择申报批次后再上传!");
  502. return;
  503. }
  504. $("#upload_file ").unbind("change");
  505. $("#upload_file ").change(function () {
  506. var formData = new FormData();
  507. formData.append("batch", batch);
  508. for (var i = 0; i < $('#upload_file')[0].files.length; i++) {
  509. formData.append('file', $('#upload_file')[0].files[i]);
  510. }
  511. $.ajax({
  512. url: Feng.ctxPath + "/enterprise/talentAllowance/uploadCommonFile",
  513. type: "POST",
  514. processData: false,
  515. contentType: false,
  516. data: formData,
  517. success: function (data) {
  518. $("#checkFileTable").bootstrapTable("refresh", {});
  519. Feng.info(data.msg);
  520. }, error: function (data) {
  521. Feng.error("上传失败!" + data.responseJSON.message + "!");
  522. }
  523. });
  524. });
  525. $('#upload_file').val("");
  526. $('#upload_file').click();
  527. }
  528. TalentAllowanceInfo.deleteCheckFile = function (id, type) {
  529. var operation = function () {
  530. var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/deleteCommonFile", function (data) {
  531. if (data.code == 200) {
  532. Feng.success(data.msg);
  533. $("#checkFileTable").bootstrapTable("refresh", {});
  534. } else {
  535. Feng.error(data.msg);
  536. }
  537. }, function (data) {
  538. Feng.error("删除失败!" + data.responseJSON.message + "!");
  539. });
  540. ajax.set("id", id);
  541. ajax.set("type", type);
  542. ajax.start();
  543. }
  544. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  545. }
  546. /**
  547. * 导出基础信息
  548. */
  549. TalentAllowanceInfo.export = function () {
  550. var queryData = TalentAllowanceInfo.formParams();
  551. var url = Feng.setUrlParam(Feng.ctxPath + "/enterprise/talentAllowance/export", queryData);
  552. window.hiddenIframe.location.href = url;
  553. }
  554. /**
  555. * 显示审核日志
  556. */
  557. TalentAllowanceInfo.showLog = function (id) {
  558. layer.open({
  559. type: 1,
  560. title: "日志",
  561. fixed: false,
  562. content: '<table id="' + id + '"></table>',
  563. area: ['80%', '80%'],
  564. maxmin: true,
  565. success: function (layero, index) {
  566. $('#' + id).bootstrapTable({
  567. url: Feng.ctxPath + "/common/api/getCheckLog",
  568. method: 'POST',
  569. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  570. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  571. showRefresh: false, // 是否显示刷新按钮
  572. clickToSelect: true, // 是否启用点击选中行
  573. singleSelect: true, // 设置True 将禁止多选
  574. striped: true, // 是否显示行间隔色
  575. pagination: false, // 设置为 true 会在表格底部显示分页条
  576. paginationHAlign: "left",
  577. paginationDetailHAlign: "right",
  578. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  579. showColumns: false,
  580. queryParams: function (params) {
  581. return {"type": CONFIG.project_jbt, "mainId": id, "typeFileId": "", "active": 1}
  582. },
  583. rowStyle: function (row, index) {
  584. return {
  585. css: {
  586. "word-break": "break-word",
  587. "white-space": "inherit"
  588. }
  589. }
  590. },
  591. columns:
  592. [
  593. {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle', width: "10%",
  594. formatter: function (value, row, index) {
  595. return "" + value;
  596. }
  597. },
  598. {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle', width: "65%",
  599. formatter: function (value, row, index) {
  600. return '<span data-toggle="tooltip" title="' + value + '">"' + value + '"</span>';
  601. }
  602. },
  603. {title: '操作人', field: 'createUser', visible: false, align: 'center', valign: 'middle', width: "15%"},
  604. {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"},
  605. ]
  606. ,
  607. onPostBody: function () {
  608. $('#' + id + "td.uitd_showTip").bind("mouseover", function () {
  609. var htm = $(this).html();
  610. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  611. });
  612. }
  613. });
  614. }
  615. });
  616. }
  617. $(function () {
  618. var defaultColunms = TalentAllowanceInfo.initColumn();
  619. var table = new BSTable(TalentAllowanceInfo.id, "/enterprise/talentAllowance/list", defaultColunms);
  620. table.setPaginationType("server");
  621. table.setOnDblClickRow(function () {
  622. TalentAllowanceInfo.openTalentAllowanceInfoDetail();
  623. });
  624. TalentAllowanceInfo.table = table.init();
  625. //批量加载字典表数据
  626. var arr = [
  627. {"name": "address", "code": "street"},
  628. {"name": "talentArrange", "code": "talent_arrange"},
  629. {"name": "nationality", "code": "nationality"}];
  630. Feng.findChildDictBatch(JSON.stringify(arr));
  631. $("#identifyCondition").chosen({
  632. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  633. disable_search: false,
  634. width: "100%",
  635. enable_split_word_search: true
  636. });
  637. });