talentAllowanceInfoIC.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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: 'enterpriseName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  18. {title: '所属镇街', field: 'addressName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  19. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  20. {title: '性别', field: 'sex', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "60px",
  21. formatter(value, row, index) {
  22. if (value == 1) {
  23. return "男";
  24. }
  25. if (value == 2) {
  26. return "女";
  27. }
  28. }
  29. },
  30. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  31. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  32. {title: '认定条件', field: 'identifyConditionText', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  33. {title: '认定条件证书取得时间', field: 'identifyGetTime', visible: true, align: 'center', valign: 'middle', width: "150px"},
  34. {title: '认定条件名称', field: 'identifyConditionName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  35. {title: '公布入选月份', field: 'identifyMonth', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  36. {title: '津补贴类型', field: 'allowanceType', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px",
  37. formatter(value, row, index) {
  38. if (value == null || value == "")
  39. return "未判定";
  40. if (value == 1)
  41. return "人才津贴";
  42. if (value == 2)
  43. return "一次性交通补贴";
  44. if (value == 3)
  45. return "不予兑现";
  46. }
  47. },
  48. {title: '兑现月份', field: 'months', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  49. {title: '兑现金额', field: 'money', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
  50. {title: '金额说明', field: 'moneyDesc', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
  51. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  52. formatter(value, row, index) {
  53. var html = "";
  54. switch (value) {
  55. case 1:
  56. html = "<span class='label'>待提交</span>"
  57. break;
  58. case 5, 13, 15, 20, 25, 35:
  59. html = "<span class='label label-success'>审核中</span>";
  60. break;
  61. case 10:
  62. html = "<span class='label label-danger'>已驳回</span>"
  63. break;
  64. case - 1:
  65. if (row.publicState >= 3) {
  66. html = "<span class='label label-danger'>审核不通过</span>";
  67. } else {
  68. html = "<span class='label label-success'>审核中</span>";
  69. }
  70. break;
  71. case 30:
  72. if (row.publicState == 3) {
  73. html = "<span class='label label-primary'>公示中</span>"
  74. } else if (row.publicState == 4) {
  75. html = row.allowanceType != 3 ? "<span class='label label-success'>待兑现</span>" : "<span class='label label-danger'>不予兑现</span>";
  76. } else if (row.publicState == 5) {
  77. html = "<span class='label label-primary'>已兑现</span>"
  78. }
  79. break;
  80. }
  81. return html;
  82. }
  83. },
  84. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  85. formatter: function (value, row, index) {
  86. return "<span class='label label-success' onclick=\"TalentAllowanceInfo.showLog('" + value + "')\" >" +
  87. "<i class=\"fa fa-book\"></i>日志" +
  88. "</span>";
  89. }
  90. }
  91. ];
  92. };
  93. /**
  94. * 检查是否选中
  95. */
  96. TalentAllowanceInfo.check = function () {
  97. var selected = $('#' + this.id).bootstrapTable('getSelections');
  98. if (selected.length == 0) {
  99. Feng.info("请先选中表格中的某一记录!");
  100. return false;
  101. } else {
  102. TalentAllowanceInfo.seItem = selected[0];
  103. return true;
  104. }
  105. };
  106. /**
  107. * 点击添加优秀人才津补贴
  108. */
  109. TalentAllowanceInfo.openAddTalentAllowanceInfo = function () {
  110. var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
  111. if (data.code == 200) {
  112. var index = layer.open({
  113. type: 2,
  114. title: '津补贴申报',
  115. fix: false, //不固定
  116. maxmin: true,
  117. content: '/enterprise/talentAllowance/apply?year=' + data.batch,
  118. 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;取消'],
  119. btnAlign: 'c',
  120. btn1: function (index, layero) {
  121. var obj = layero.find("iframe")[0].contentWindow;
  122. obj.TalentAllowanceInfoDlg.addSubmit();
  123. }, btn2: function (index, layero) {
  124. var obj = layero.find("iframe")[0].contentWindow;
  125. obj.TalentAllowanceInfoDlg.submitToCheck();
  126. return false;
  127. },
  128. success: function (layero, index) {
  129. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  130. },
  131. end: function () {
  132. layer.closeAll('tips');
  133. TalentAllowanceInfo.table.refresh();
  134. }
  135. });
  136. layer.full(index);
  137. TalentAllowanceInfo.layerIndex = index;
  138. } else {
  139. Feng.error(data.msg);
  140. }
  141. }, function (data) {
  142. Feng.error("查询失败!" + data.responseJSON.message + "!");
  143. });
  144. ajax.set("type", CONFIG.project_jbt);
  145. ajax.start();
  146. };
  147. /**
  148. * 打开查看优秀人才津补贴详情
  149. */
  150. TalentAllowanceInfo.openTalentAllowanceInfoDetail = function () {
  151. if (this.check()) {
  152. var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
  153. if (data.code == 200) {
  154. var index = layer.open({
  155. type: 2,
  156. title: '津补贴申报',
  157. fix: false, //不固定
  158. maxmin: true,
  159. content: Feng.ctxPath + '/api/talentAllowance/apply/id/' + TalentAllowanceInfo.seItem.id,
  160. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  161. btnAlign: 'c',
  162. yes: function (index, layero) {
  163. var obj = layero.find("iframe")[0].contentWindow;
  164. obj.TalentAllowanceInfoDlg.submitToCheck();
  165. },
  166. success: function (layero, index) {
  167. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn0', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  168. },
  169. end: function () {
  170. layer.closeAll('tips');
  171. }
  172. });
  173. layer.full(index);
  174. TalentAllowanceInfo.layerIndex = index;
  175. } else {
  176. Feng.info(data.msg);
  177. }
  178. }, function (data) {
  179. Feng.error("校验失败!" + data.responseJSON.message + "!");
  180. });
  181. ajax.set("type", CONFIG.project_jbt);
  182. ajax.set("year", TalentAllowanceInfo.seItem.year);
  183. ajax.set("first_submit_time", TalentAllowanceInfo.seItem.firstSubmitTime);
  184. ajax.start();
  185. }
  186. };
  187. TalentAllowanceInfo.openTalentAllowanceInfoSelect = function () {
  188. if (this.check()) {
  189. var index = layer.open({
  190. type: 2,
  191. title: '津补贴查看',
  192. fix: false, //不固定
  193. maxmin: true,
  194. content: Feng.ctxPath + '/enterprise/talentAllowance/view/id/' + TalentAllowanceInfo.seItem.id,
  195. btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  196. btnAlign: 'c',
  197. });
  198. layer.full(index);
  199. TalentAllowanceInfo.layerIndex = index;
  200. }
  201. }
  202. /**
  203. * 删除优秀人才津补贴
  204. */
  205. TalentAllowanceInfo.delete = function () {
  206. if (this.check()) {
  207. var operation = function () {
  208. var ajax = new $ax(Feng.ctxPath + "/enterpirse/talentAllowance/delete", function (data) {
  209. if (data.code == 200) {
  210. Feng.success(data.msg);
  211. TalentAllowanceInfo.table.refresh();
  212. } else {
  213. Feng.info(data.msg);
  214. }
  215. }, function (data) {
  216. Feng.error("删除失败!" + data.responseJSON.message + "!");
  217. });
  218. ajax.set("id", TalentAllowanceInfo.seItem.id);
  219. ajax.start();
  220. }
  221. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  222. }
  223. };
  224. /**
  225. * 查询表单提交参数对象
  226. * @returns {{}}
  227. */
  228. TalentAllowanceInfo.formParams = function () {
  229. var queryData = {};
  230. queryData['year'] = $("#year").val();
  231. queryData['enterpriseName'] = $("#enterpriseName").val();
  232. queryData['name'] = $("#name").val();
  233. queryData['idCard'] = $("#idCard").val();
  234. queryData['talentType'] = $("#talentType").val();
  235. queryData['talentArrange'] = $("#talentArrange").val();
  236. queryData['address'] = $("#address").val();
  237. queryData['identifyCondition'] = $("#identifyCondition").val();
  238. return queryData;
  239. }
  240. /**
  241. * 查询人才认定申报列表
  242. */
  243. TalentAllowanceInfo.search = function () {
  244. TalentAllowanceInfo.table.refresh({query: TalentAllowanceInfo.formParams()});
  245. };
  246. /**
  247. * 重置
  248. */
  249. TalentAllowanceInfo.reset = function () {
  250. $("#year").val("");
  251. $("#enterpriseName").val("");
  252. $("#name").val("");
  253. $("#idCard").val("");
  254. $("#talentType").val("");
  255. $("#talentArrange").val("");
  256. $("#address").val("");
  257. $("#identifyCondition").val("");
  258. }
  259. /**
  260. * 获取人才认定
  261. */
  262. TalentAllowanceInfo.getIdentifyCondition = function () {
  263. var level = $("#talentArrange").val();
  264. if (level == null || level == '') {
  265. $("#identifyCondition").empty();
  266. $("#identifyCondition").trigger('chosen:updated');
  267. return;
  268. }
  269. Feng.addAjaxSelect({
  270. "id": "identifyCondition",
  271. "displayCode": "id",
  272. "displayName": "name",
  273. "type": "GET",
  274. "url": Feng.ctxPath + "/common/api/findIdentifyConditionByLevel?level=" + level
  275. });
  276. $("#identifyCondition").trigger('chosen:updated');
  277. }
  278. /**
  279. * 显示审核日志
  280. */
  281. TalentAllowanceInfo.showLog = function (id) {
  282. layer.open({
  283. type: 1,
  284. title: "日志",
  285. fixed: false,
  286. content: '<table id="' + id + '"></table>',
  287. area: ['80%', '80%'],
  288. maxmin: true,
  289. success: function (layero, index) {
  290. $('#' + id).bootstrapTable({
  291. url: Feng.ctxPath + "/common/api/getCheckLog",
  292. method: 'POST',
  293. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  294. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  295. showRefresh: false, // 是否显示刷新按钮
  296. clickToSelect: true, // 是否启用点击选中行
  297. singleSelect: true, // 设置True 将禁止多选
  298. striped: true, // 是否显示行间隔色
  299. pagination: false, // 设置为 true 会在表格底部显示分页条
  300. paginationHAlign: "left",
  301. paginationDetailHAlign: "right",
  302. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  303. showColumns: false,
  304. queryParams: function (params) {
  305. return {"type": CONFIG.project_jbt, "mainId": id, "typeFileId": "", "active": 1}
  306. },
  307. rowStyle: function (row, index) {
  308. return {
  309. css: {
  310. "word-break": "break-word",
  311. "white-space": "inherit"
  312. }
  313. }
  314. },
  315. columns:
  316. [
  317. {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle', width: "10%",
  318. formatter: function (value, row, index) {
  319. return "" + value;
  320. }
  321. },
  322. {title: '操作人', field: 'createUser', visible: false, align: 'center', valign: 'middle', width: "15%"},
  323. {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"},
  324. {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle', width: "65%",
  325. formatter: function (value, row, index) {
  326. return '<span data-toggle="tooltip" title="' + value + '">"' + value + '"</span>';
  327. }
  328. }
  329. ]
  330. ,
  331. onPostBody: function () {
  332. $('#' + id + "td.uitd_showTip").bind("mouseover", function () {
  333. var htm = $(this).html();
  334. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  335. });
  336. }
  337. });
  338. }
  339. });
  340. }
  341. $(function () {
  342. var defaultColunms = TalentAllowanceInfo.initColumn();
  343. var table = new BSTable(TalentAllowanceInfo.id, "/enterprise/talentAllowance/list", defaultColunms);
  344. table.setPaginationType("server");
  345. table.setOnDblClickRow(function () {
  346. TalentAllowanceInfo.openTalentAllowanceInfoDetail();
  347. });
  348. TalentAllowanceInfo.table = table.init();
  349. //批量加载字典表数据
  350. var arr = [
  351. {"name": "address", "code": "street"},
  352. {"name": "talentArrange", "code": "talent_arrange"},
  353. {"name": "nationality", "code": "nationality"}];
  354. Feng.findChildDictBatch(JSON.stringify(arr));
  355. $("#identifyCondition").chosen({
  356. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  357. disable_search: false,
  358. width: "100%",
  359. enable_split_word_search: true
  360. });
  361. });