livingAllowanceInfo.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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{
  160. if(row.isPublic>=4){
  161. if(value==-1){
  162. return "<span class='label label-danger'>审核不通过</span>"
  163. }else if(value==35){
  164. return "<span class='label label-primary'>审核通过</span>"
  165. }else{
  166. return "<span class='label label-success'>审核中</span>"
  167. }
  168. }else{
  169. return "<span class='label label-success'>审核中</span>"
  170. }
  171. }
  172. }
  173. },
  174. {title: '审核意见', field: 'checkMsg', visible: false, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px",
  175. formatter : function (value,row,index) {
  176. if(value==1){
  177. return ""
  178. }else if(value==10 || value==5){
  179. return value;
  180. }else{
  181. if(row.isPublic>=5){
  182. if(value==-1){
  183. return value
  184. }else if(value==35){
  185. return value;
  186. }else{
  187. return ""
  188. }
  189. }else{
  190. return ""
  191. }
  192. }
  193. }
  194. },
  195. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px",
  196. formatter : function (value,row,index){
  197. return "<span class='label label-success' onclick=\"LivingAllowanceInfo.showLog('"+value+"')\" >" +
  198. "<i class=\"fa fa-book\"></i>日志" +
  199. "</span>";
  200. }
  201. }
  202. ];
  203. };
  204. /**
  205. * 检查是否选中
  206. */
  207. LivingAllowanceInfo.check = function () {
  208. var selected = $('#' + this.id).bootstrapTable('getSelections');
  209. if (selected.length == 0) {
  210. Feng.info("请先选中表格中的某一记录!");
  211. return false;
  212. } else {
  213. LivingAllowanceInfo.seItem = selected[0];
  214. return true;
  215. }
  216. };
  217. /**
  218. * 点击添加硕博人才生活补贴申报
  219. */
  220. LivingAllowanceInfo.openAddLivingAllowanceInfo = function () {
  221. var ajax = new $ax(Feng.ctxPath + "/api/commonBatch/valiateIsAdd", function (data) {
  222. if (data.code == 200) {
  223. var index = layer.open({
  224. type: 2,
  225. title: '添加人才生活补贴申报',
  226. fix: false, //不固定
  227. maxmin: true,
  228. content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_add?year=' + data.obj,
  229. 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;取消'],
  230. btnAlign: 'c',
  231. btn1: function (index, layero) {
  232. var obj = layero.find("iframe")[0].contentWindow;
  233. obj.LivingAllowanceInfoInfoDlg.addSubmit();
  234. }, btn2: function (index, layero) {
  235. var obj = layero.find("iframe")[0].contentWindow;
  236. obj.LivingAllowanceInfoInfoDlg.submitToCheck();
  237. return false;
  238. },
  239. success: function (layero, index) {
  240. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  241. },
  242. end: function () {
  243. layer.closeAll('tips');
  244. }
  245. });
  246. layer.full(index);
  247. LivingAllowanceInfo.layerIndex = index;
  248. } else {
  249. Feng.info(data.msg);
  250. }
  251. }, function (data) {
  252. Feng.error("校验失败!" + data.responseJSON.message + "!");
  253. });
  254. ajax.set("type", CONFIG.project_master_living_allowance);
  255. ajax.start();
  256. };
  257. /**
  258. * 打开查看硕博人才生活补贴申报详情
  259. */
  260. LivingAllowanceInfo.openLivingAllowanceInfoDetail = function () {
  261. if (this.check()) {
  262. var ajax = new $ax(Feng.ctxPath + "/api/commonBatch/valiateIsEditOrSubmit", function (data) {
  263. if (data.code == 200) {
  264. var index = layer.open({
  265. type: 2,
  266. title: '硕博人才生活补贴修改',
  267. area: ['800px', '420px'], //宽高
  268. fix: false, //不固定
  269. maxmin: true,
  270. content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_update/' + LivingAllowanceInfo.seItem.id + "/update",
  271. 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;取消'],
  272. btnAlign: 'c',
  273. btn1: function (index, layero) {
  274. var obj = layero.find("iframe")[0].contentWindow;
  275. obj.LivingAllowanceInfoInfoDlg.addSubmit();
  276. }, btn2: function (index, layero) {
  277. var obj = layero.find("iframe")[0].contentWindow;
  278. obj.LivingAllowanceInfoInfoDlg.submitToCheck();
  279. return false;
  280. },
  281. success: function (layero, index) {
  282. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  283. },
  284. end: function () {
  285. layer.closeAll('tips');
  286. }
  287. });
  288. layer.full(index);
  289. LivingAllowanceInfo.layerIndex = index;
  290. } else {
  291. Feng.info(data.msg);
  292. }
  293. }, function (data) {
  294. Feng.error("校验失败!" + data.responseJSON.message + "!");
  295. });
  296. ajax.set("type", CONFIG.project_master_living_allowance);
  297. ajax.set("year", LivingAllowanceInfo.seItem.year);
  298. ajax.start();
  299. }
  300. };
  301. /**
  302. * 打开查看窗口
  303. */
  304. LivingAllowanceInfo.openLivingAllowanceInfoSelect = function () {
  305. if (this.check()) {
  306. var index = layer.open({
  307. type: 2,
  308. title: '硕博人才生活补贴详情',
  309. area: ['800px', '420px'], //宽高
  310. fix: false, //不固定
  311. maxmin: true,
  312. content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_update/' + LivingAllowanceInfo.seItem.id + "/select",
  313. btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  314. btnAlign: 'c',
  315. });
  316. layer.full(index);
  317. LivingAllowanceInfo.layerIndex = index;
  318. }
  319. }
  320. /**
  321. * 删除硕博人才生活补贴申报
  322. */
  323. LivingAllowanceInfo.delete = function () {
  324. if (this.check()) {
  325. if (LivingAllowanceInfo.seItem.checkState != 0) {
  326. Feng.error("该申报已提交审核,无法删除");
  327. return;
  328. }
  329. var operation = function () {
  330. var ajax = new $ax(Feng.ctxPath + "/api/livingAllowanceInfo/delete", function (data) {
  331. Feng.success("删除成功!");
  332. LivingAllowanceInfo.table.refresh();
  333. }, function (data) {
  334. Feng.error("删除失败!" + data.responseJSON.message + "!");
  335. });
  336. ajax.set("livingAllowanceInfoId", LivingAllowanceInfo.seItem.id);
  337. ajax.start();
  338. }
  339. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  340. }
  341. };
  342. /**
  343. * 查询硕博人才生活补贴申报列表
  344. */
  345. LivingAllowanceInfo.search = function () {
  346. var queryData = {};
  347. queryData['name'] = $("#name").val();
  348. queryData['idCard'] = $("#idCard").val();
  349. LivingAllowanceInfo.table.refresh({query: queryData});
  350. };
  351. LivingAllowanceInfo.reset = function (){
  352. $("#name").val("");
  353. $("#idCard").val("");
  354. }
  355. LivingAllowanceInfo.showLog = function (id){
  356. layer.open({
  357. type: 1,
  358. title:"日志",
  359. fixed:false,
  360. content: '<table id="'+id+'"></table>',
  361. area: ['80%', '80%'],
  362. maxmin: true,
  363. success :function (layero, index) {
  364. Feng.getCheckLog(id,{"type":CONFIG.project_master_living_allowance,"mainId":id,"typeFileId":"","active":1})
  365. }
  366. });
  367. }
  368. $(function () {
  369. var defaultColunms = LivingAllowanceInfo.initColumn();
  370. var table = new BSTable(LivingAllowanceInfo.id, "/api/livingAllowanceInfo/list", defaultColunms);
  371. table.setOnDblClickRow(function () {
  372. LivingAllowanceInfo.openLivingAllowanceInfoSelect();
  373. });
  374. table.setPaginationType("server");
  375. LivingAllowanceInfo.table = table.init();
  376. });