livingAllowanceInfo.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. /**
  2. * 硕博人才生活补贴申报管理初始化
  3. */
  4. var LivingAllowanceInfo = {
  5. id: "LivingAllowanceInfoTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. LivingAllowanceInfo.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle', width: '80px'},
  17. {title: '申报补贴年次', field: 'applyCount', visible: true, align: 'center', valign: 'middle', width: '100px',
  18. formatter: function (value, row, index) {
  19. if (value == 1) {
  20. return "首年";
  21. }
  22. if (value == 2) {
  23. return "第二年";
  24. }
  25. if (value == 3) {
  26. return "第三年";
  27. }
  28. }
  29. },
  30. {title: '申报类型', field: 'declareTypeName', visible: true, align: 'center', valign: 'middle', width: '80px'},
  31. {
  32. title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
  33. formatter: function (value, row, index) {
  34. return row.sex == 1 ? value + '<span style="color:#6495ED">【男】</span>' : value + '<span style="color:#FF82AB">【女】</span>';
  35. }
  36. },
  37. // {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',width:"100px",
  38. // formatter : function (value,row,index){
  39. // return value == 1?"晋江市优秀人才":"集成电路优秀人才";
  40. // }
  41. // },
  42. {
  43. title: '证件号码',
  44. field: 'idCard',
  45. visible: true,
  46. align: 'center',
  47. valign: 'middle',
  48. 'class': 'uitd_showTip',
  49. width: "150px"
  50. },
  51. {
  52. title: '企业名称',
  53. field: 'enterpriseName',
  54. visible: true,
  55. align: 'center',
  56. valign: 'middle',
  57. 'class': 'uitd_showTip',
  58. width: "100px"
  59. },
  60. {
  61. title: '最高学历',
  62. field: 'highEducation',
  63. visible: true,
  64. align: 'center',
  65. valign: 'middle',
  66. 'class': 'uitd_showTip',
  67. width: "100px"
  68. },
  69. {
  70. title: '毕业学校',
  71. field: 'graduateSchool',
  72. visible: true,
  73. align: 'center',
  74. valign: 'middle',
  75. 'class': 'uitd_showTip',
  76. width: "100px"
  77. },
  78. {
  79. title: '手机号码',
  80. field: 'phone',
  81. visible: true,
  82. align: 'center',
  83. valign: 'middle',
  84. 'class': 'uitd_showTip',
  85. width: "100px"
  86. },
  87. {
  88. title: '本单位入职时间',
  89. field: 'entryTime',
  90. visible: true,
  91. align: 'center',
  92. valign: 'middle',
  93. 'class': 'uitd_showTip',
  94. width: "100px"
  95. },
  96. {
  97. title: '首次来晋工作时间',
  98. field: 'firstInJJTime',
  99. visible: true,
  100. align: 'center',
  101. valign: 'middle',
  102. 'class': 'uitd_showTip',
  103. width: "100px"
  104. },
  105. {
  106. title: '兑现状态',
  107. field: 'isPay',
  108. visible: true,
  109. align: 'center',
  110. valign: 'middle',
  111. 'class': 'uitd_showTip',
  112. width: "80px",
  113. formatter: function (value, row, index) {
  114. if (value == -1) {
  115. return "<span style='color: red'>不予兑现</span>"
  116. }
  117. if (value == 0) {
  118. return "<span style='color: grey'>未知</span>"
  119. }
  120. if (value == 1) {
  121. return "<span style='color: green'>待兑现</span>"
  122. }
  123. if (value == 2) {
  124. return "<span style='color: darkred'>已兑现</span>"
  125. }
  126. }
  127. },
  128. {
  129. title: '兑现金额',
  130. field: 'amount',
  131. visible: true,
  132. align: 'center',
  133. valign: 'middle',
  134. 'class': 'uitd_showTip',
  135. width: "100px",
  136. },
  137. {
  138. title: '判断描述',
  139. field: 'amountDesc',
  140. visible: true,
  141. align: 'center',
  142. valign: 'middle',
  143. 'class': 'uitd_showTip',
  144. width: "100px",
  145. },
  146. {
  147. title: '审核状态',
  148. field: 'checkState',
  149. visible: true,
  150. align: 'center',
  151. valign: 'middle',
  152. 'class': 'uitd_showTip',
  153. width: "100px",
  154. formatter: function (value, row, index) {
  155. if (value == 1) {
  156. return "<span class='label'>待提交</span>"
  157. } else if (value == 10 || value == 5) {
  158. return "<span class='label label-danger'>已驳回</span>"
  159. } else if (value == -1) {
  160. return "<span class='label label-danger'>审核不通过</span>"
  161. } else {
  162. if (row.isPublic >= 4) {
  163. if (value == -1) {
  164. return "<span class='label label-danger'>审核不通过</span>"
  165. } else if (value == 35) {
  166. return "<span class='label label-primary'>审核通过</span>"
  167. } else {
  168. return "<span class='label label-success'>审核中</span>"
  169. }
  170. } else {
  171. return "<span class='label label-success'>审核中</span>"
  172. }
  173. }
  174. }
  175. },
  176. {title: '审核意见', field: 'checkMsg', visible: false, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  177. formatter: function (value, row, index) {
  178. if (value == 1) {
  179. return ""
  180. } else if (value == 10 || value == 5) {
  181. return value;
  182. } else {
  183. if (row.isPublic >= 5) {
  184. if (value == -1) {
  185. return value
  186. } else if (value == 35) {
  187. return value;
  188. } else {
  189. return ""
  190. }
  191. } else {
  192. return ""
  193. }
  194. }
  195. }
  196. },
  197. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  198. formatter: function (value, row, index) {
  199. return "<span class='label label-success' onclick=\"LivingAllowanceInfo.showLog('" + value + "')\" >" +
  200. "<i class=\"fa fa-book\"></i>日志" +
  201. "</span>";
  202. }
  203. }
  204. ];
  205. };
  206. /**
  207. * 检查是否选中
  208. */
  209. LivingAllowanceInfo.check = function () {
  210. var selected = $('#' + this.id).bootstrapTable('getSelections');
  211. if (selected.length == 0) {
  212. Feng.info("请先选中表格中的某一记录!");
  213. return false;
  214. } else {
  215. LivingAllowanceInfo.seItem = selected[0];
  216. return true;
  217. }
  218. };
  219. /**
  220. * 点击添加硕博人才生活补贴申报
  221. */
  222. LivingAllowanceInfo.openAddLivingAllowanceInfo = function () {
  223. var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
  224. if (data.code == 200) {
  225. var index = layer.open({
  226. type: 2,
  227. title: '添加人才生活补贴申报',
  228. fix: false, //不固定
  229. maxmin: true,
  230. content: '/enterprise/living_allowance/apply?year=' + data.batch,
  231. 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;取消'],
  232. btnAlign: 'c',
  233. btn1: function (index, layero) {
  234. var obj = layero.find("iframe")[0].contentWindow;
  235. obj.LivingAllowanceInfoInfoDlg.addSubmit();
  236. }, btn2: function (index, layero) {
  237. var obj = layero.find("iframe")[0].contentWindow;
  238. obj.LivingAllowanceInfoInfoDlg.submitToCheck();
  239. return false;
  240. },
  241. success: function (layero, index) {
  242. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  243. },
  244. end: function () {
  245. layer.closeAll('tips');
  246. }
  247. });
  248. layer.full(index);
  249. LivingAllowanceInfo.layerIndex = index;
  250. } else {
  251. Feng.info(data.msg);
  252. }
  253. }, function (data) {
  254. Feng.error("校验失败!" + data.responseJSON.message + "!");
  255. });
  256. ajax.set("type", CONFIG.project_master_living_allowance);
  257. ajax.start();
  258. };
  259. /**
  260. * 打开查看硕博人才生活补贴申报详情
  261. */
  262. LivingAllowanceInfo.openLivingAllowanceInfoDetail = function () {
  263. if (this.check()) {
  264. var ajax = new $ax("/common/batch/checkBatchValid", function (data) {
  265. if (data.code == 200) {
  266. var index = layer.open({
  267. type: 2,
  268. title: '硕博人才生活补贴修改',
  269. area: ['800px', '420px'], //宽高
  270. fix: false, //不固定
  271. maxmin: true,
  272. content: Feng.ctxPath + '/enterprise/living_allowance/apply/id/' + LivingAllowanceInfo.seItem.id,
  273. 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;取消'],
  274. btnAlign: 'c',
  275. btn1: function (index, layero) {
  276. var obj = layero.find("iframe")[0].contentWindow;
  277. obj.LivingAllowanceInfoInfoDlg.addSubmit();
  278. }, btn2: function (index, layero) {
  279. var obj = layero.find("iframe")[0].contentWindow;
  280. obj.LivingAllowanceInfoInfoDlg.submitToCheck();
  281. return false;
  282. },
  283. success: function (layero, index) {
  284. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  285. },
  286. end: function () {
  287. layer.closeAll('tips');
  288. }
  289. });
  290. layer.full(index);
  291. LivingAllowanceInfo.layerIndex = index;
  292. } else {
  293. Feng.info(data.msg);
  294. }
  295. }, function (data) {
  296. Feng.error("校验失败!" + data.responseJSON.message + "!");
  297. });
  298. ajax.set("type", CONFIG.project_master_living_allowance);
  299. ajax.set("year", LivingAllowanceInfo.seItem.year);
  300. ajax.set("first_submit_time", LivingAllowanceInfo.seItem.firstSubmitTime);
  301. ajax.start();
  302. }
  303. };
  304. /**
  305. * 打开查看窗口
  306. */
  307. LivingAllowanceInfo.openLivingAllowanceInfoSelect = function () {
  308. if (this.check()) {
  309. var index = layer.open({
  310. type: 2,
  311. title: '硕博人才生活补贴详情',
  312. area: ['800px', '420px'], //宽高
  313. fix: false, //不固定
  314. maxmin: true,
  315. content: Feng.ctxPath + '/enterprise/living_allowance/detail/id/' + LivingAllowanceInfo.seItem.id,
  316. btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  317. btnAlign: 'c',
  318. });
  319. layer.full(index);
  320. LivingAllowanceInfo.layerIndex = index;
  321. }
  322. }
  323. /**
  324. * 删除硕博人才生活补贴申报
  325. */
  326. LivingAllowanceInfo.delete = function () {
  327. if (this.check()) {
  328. if (LivingAllowanceInfo.seItem.checkState != 0) {
  329. Feng.error("该申报已提交审核,无法删除");
  330. return;
  331. }
  332. var operation = function () {
  333. var ajax = new $ax(Feng.ctxPath + "/enterprise/living_allowance/delete", function (data) {
  334. Feng.success("删除成功!");
  335. LivingAllowanceInfo.table.refresh();
  336. }, function (data) {
  337. Feng.error("删除失败!" + data.responseJSON.message + "!");
  338. });
  339. ajax.set("id", LivingAllowanceInfo.seItem.id);
  340. ajax.start();
  341. }
  342. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  343. }
  344. };
  345. /**
  346. * 查询硕博人才生活补贴申报列表
  347. */
  348. LivingAllowanceInfo.search = function () {
  349. var queryData = {};
  350. queryData['name'] = $("#name").val();
  351. queryData['idCard'] = $("#idCard").val();
  352. LivingAllowanceInfo.table.refresh({query: queryData});
  353. };
  354. LivingAllowanceInfo.reset = function () {
  355. $("#name").val("");
  356. $("#idCard").val("");
  357. }
  358. LivingAllowanceInfo.showLog = function (id) {
  359. layer.open({
  360. type: 1,
  361. title: "日志",
  362. fixed: false,
  363. content: '<table id="' + id + '"></table>',
  364. area: ['80%', '80%'],
  365. maxmin: true,
  366. success: function (layero, index) {
  367. Feng.getCheckLog(id, {"type": CONFIG.project_master_living_allowance, "mainId": id, "typeFileId": "", "active": 1})
  368. }
  369. });
  370. }
  371. $(function () {
  372. var defaultColunms = LivingAllowanceInfo.initColumn();
  373. var table = new BSTable(LivingAllowanceInfo.id, "/enterprise/living_allowance/list", defaultColunms);
  374. table.setOnDblClickRow(function () {
  375. LivingAllowanceInfo.openLivingAllowanceInfoSelect();
  376. });
  377. table.setPaginationType("server");
  378. LivingAllowanceInfo.table = table.init();
  379. });