talentAllowanceInfoIC.js 28 KB

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