livingAllowanceInfo.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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. {
  18. title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
  19. formatter: function (value, row, index) {
  20. return row.sex == 1 ? value + '<span style="color:#6495ED">【男】</span>' : value + '<span style="color:#FF82AB">【女】</span>';
  21. }
  22. },
  23. // {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',width:"100px",
  24. // formatter : function (value,row,index){
  25. // return value == 1?"晋江市现代产业体系人才":"集成电路优秀人才";
  26. // }
  27. // },
  28. {
  29. title: '人才标签',
  30. field: 'talentTypeName',
  31. visible: true,
  32. align: 'center',
  33. valign: 'middle',
  34. 'class': 'uitd_showTip',
  35. width: "100px"
  36. },
  37. {
  38. title: '证件号码',
  39. field: 'idCard',
  40. visible: true,
  41. align: 'center',
  42. valign: 'middle',
  43. 'class': 'uitd_showTip',
  44. width: "150px"
  45. },
  46. {
  47. title: '企业名称',
  48. field: 'enterpriseName',
  49. visible: true,
  50. align: 'center',
  51. valign: 'middle',
  52. 'class': 'uitd_showTip',
  53. width: "100px"
  54. },
  55. {
  56. title: '最高学历',
  57. field: 'highEducation',
  58. visible: true,
  59. align: 'center',
  60. valign: 'middle',
  61. 'class': 'uitd_showTip',
  62. width: "100px"
  63. },
  64. {
  65. title: '毕业学校',
  66. field: 'graduateSchool',
  67. visible: true,
  68. align: 'center',
  69. valign: 'middle',
  70. 'class': 'uitd_showTip',
  71. width: "100px"
  72. },
  73. {
  74. title: '手机号码',
  75. field: 'phone',
  76. visible: true,
  77. align: 'center',
  78. valign: 'middle',
  79. 'class': 'uitd_showTip',
  80. width: "100px"
  81. },
  82. {
  83. title: '本单位入职时间',
  84. field: 'entryTime',
  85. visible: true,
  86. align: 'center',
  87. valign: 'middle',
  88. 'class': 'uitd_showTip',
  89. width: "100px"
  90. },
  91. {
  92. title: '首次来晋工作时间',
  93. field: 'firstInJJTime',
  94. visible: true,
  95. align: 'center',
  96. valign: 'middle',
  97. 'class': 'uitd_showTip',
  98. width: "100px"
  99. },
  100. {
  101. title: '申请次数',
  102. field: 'applyCount',
  103. visible: true,
  104. align: 'center',
  105. valign: 'middle',
  106. 'class': 'uitd_showTip',
  107. width: "100px"
  108. },
  109. {
  110. title: '审核状态',
  111. field: 'checkStateName',
  112. visible: true,
  113. align: 'center',
  114. valign: 'middle',
  115. 'class': 'uitd_showTip',
  116. width: "100px"
  117. },
  118. {
  119. title: '公示状态',
  120. field: 'isPublicName',
  121. visible: true,
  122. align: 'center',
  123. valign: 'middle',
  124. 'class': 'uitd_showTip',
  125. width: "100px"
  126. },
  127. ];
  128. };
  129. /**
  130. * 检查是否选中
  131. */
  132. LivingAllowanceInfo.check = function () {
  133. var selected = $('#' + this.id).bootstrapTable('getSelections');
  134. if (selected.length == 0) {
  135. Feng.info("请先选中表格中的某一记录!");
  136. return false;
  137. } else {
  138. LivingAllowanceInfo.seItem = selected[0];
  139. return true;
  140. }
  141. };
  142. /**
  143. * 点击添加硕博人才生活补贴申报
  144. */
  145. LivingAllowanceInfo.openAddLivingAllowanceInfo = function () {
  146. var ajax = new $ax(Feng.ctxPath + "/api/commonBatch/valiateIsAdd", function (data) {
  147. if (data.code == 200) {
  148. var index = layer.open({
  149. type: 2,
  150. title: '添加人才生活补贴申报',
  151. fix: false, //不固定
  152. maxmin: true,
  153. content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_add?year=' + data.obj,
  154. 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;取消'],
  155. btnAlign: 'c',
  156. btn1: function (index, layero) {
  157. var obj = layero.find("iframe")[0].contentWindow;
  158. obj.LivingAllowanceInfoInfoDlg.addSubmit();
  159. }, btn2: function (index, layero) {
  160. var obj = layero.find("iframe")[0].contentWindow;
  161. obj.LivingAllowanceInfoInfoDlg.submitToCheck();
  162. return false;
  163. },
  164. success: function (layero, index) {
  165. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  166. },
  167. end: function () {
  168. layer.closeAll('tips');
  169. }
  170. });
  171. layer.full(index);
  172. LivingAllowanceInfo.layerIndex = index;
  173. } else {
  174. Feng.info(data.msg);
  175. }
  176. }, function (data) {
  177. Feng.error("校验失败!" + data.responseJSON.message + "!");
  178. });
  179. ajax.set("type", CONFIG.project_master_living_allowance);
  180. ajax.start();
  181. };
  182. /**
  183. * 打开查看硕博人才生活补贴申报详情
  184. */
  185. LivingAllowanceInfo.openLivingAllowanceInfoDetail = function () {
  186. if (this.check()) {
  187. var ajax = new $ax(Feng.ctxPath + "/api/commonBatch/valiateIsEditOrSubmit", function (data) {
  188. if (data.code == 200) {
  189. var index = layer.open({
  190. type: 2,
  191. title: '硕博人才生活补贴修改',
  192. area: ['800px', '420px'], //宽高
  193. fix: false, //不固定
  194. maxmin: true,
  195. content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_update/' + LivingAllowanceInfo.seItem.id + "/update",
  196. 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;取消'],
  197. btnAlign: 'c',
  198. btn1: function (index, layero) {
  199. var obj = layero.find("iframe")[0].contentWindow;
  200. obj.LivingAllowanceInfoInfoDlg.addSubmit();
  201. }, btn2: function (index, layero) {
  202. var obj = layero.find("iframe")[0].contentWindow;
  203. obj.LivingAllowanceInfoInfoDlg.submitToCheck();
  204. return false;
  205. },
  206. success: function (layero, index) {
  207. layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
  208. },
  209. end: function () {
  210. layer.closeAll('tips');
  211. }
  212. });
  213. layer.full(index);
  214. LivingAllowanceInfo.layerIndex = index;
  215. } else {
  216. Feng.info(data.msg);
  217. }
  218. }, function (data) {
  219. Feng.error("校验失败!" + data.responseJSON.message + "!");
  220. });
  221. ajax.set("type", CONFIG.project_master_living_allowance);
  222. ajax.set("year", LivingAllowanceInfo.seItem.year);
  223. ajax.start();
  224. }
  225. };
  226. /**
  227. * 打开查看窗口
  228. */
  229. LivingAllowanceInfo.openLivingAllowanceInfoSelect = function () {
  230. if (this.check()) {
  231. var index = layer.open({
  232. type: 2,
  233. title: '硕博人才生活补贴详情',
  234. area: ['800px', '420px'], //宽高
  235. fix: false, //不固定
  236. maxmin: true,
  237. content: Feng.ctxPath + '/api/livingAllowanceInfo/livingAllowanceInfo_update/' + LivingAllowanceInfo.seItem.id + "/select",
  238. btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  239. btnAlign: 'c',
  240. });
  241. layer.full(index);
  242. LivingAllowanceInfo.layerIndex = index;
  243. }
  244. }
  245. /**
  246. * 删除硕博人才生活补贴申报
  247. */
  248. LivingAllowanceInfo.delete = function () {
  249. if (this.check()) {
  250. if (LivingAllowanceInfo.seItem.checkState != 0) {
  251. Feng.error("该申报已提交审核,无法删除");
  252. return;
  253. }
  254. var operation = function () {
  255. var ajax = new $ax(Feng.ctxPath + "/api/livingAllowanceInfo/delete", function (data) {
  256. Feng.success("删除成功!");
  257. LivingAllowanceInfo.table.refresh();
  258. }, function (data) {
  259. Feng.error("删除失败!" + data.responseJSON.message + "!");
  260. });
  261. ajax.set("livingAllowanceInfoId", LivingAllowanceInfo.seItem.id);
  262. ajax.start();
  263. }
  264. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  265. }
  266. };
  267. /**
  268. * 查询硕博人才生活补贴申报列表
  269. */
  270. LivingAllowanceInfo.search = function () {
  271. var queryData = {};
  272. queryData['name'] = $("#name").val();
  273. queryData['idCard'] = $("#idCard").val();
  274. LivingAllowanceInfo.table.refresh({query: queryData});
  275. };
  276. $(function () {
  277. var defaultColunms = LivingAllowanceInfo.initColumn();
  278. var table = new BSTable(LivingAllowanceInfo.id, "/api/livingAllowanceInfo/list", defaultColunms);
  279. table.setOnDblClickRow(function () {
  280. LivingAllowanceInfo.openLivingAllowanceInfoSelect();
  281. });
  282. table.setPaginationType("server");
  283. LivingAllowanceInfo.table = table.init();
  284. });