livingAllowanceInfo.js 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340
  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. {title: '引进方式', field: 'introductionMethod', visible: true, align: 'center', valign: 'middle', width: '80px',
  32. formatter: function (value, row, index) {
  33. if (value == 1) {
  34. return "新引进";
  35. }
  36. if (value == 2) {
  37. return "其他";
  38. }
  39. }
  40. },
  41. {
  42. title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip',
  43. formatter: function (value, row, index) {
  44. return row.sex == 1 ? value + '<span style="color:#6495ED">【男】</span>' : value + '<span style="color:#FF82AB">【女】</span>';
  45. }
  46. },
  47. // {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',width:"100px",
  48. // formatter : function (value,row,index){
  49. // return value == 1?"晋江市优秀人才":"集成电路优秀人才";
  50. // }
  51. // },
  52. {
  53. title: '证件号码',
  54. field: 'idCard',
  55. visible: true,
  56. align: 'center',
  57. valign: 'middle',
  58. 'class': 'uitd_showTip',
  59. width: "150px"
  60. },
  61. {
  62. title: '企业名称',
  63. field: 'enterpriseName',
  64. visible: true,
  65. align: 'center',
  66. valign: 'middle',
  67. 'class': 'uitd_showTip',
  68. width: "100px"
  69. },
  70. {
  71. title: '最高学历',
  72. field: 'highEducation',
  73. visible: true,
  74. align: 'center',
  75. valign: 'middle',
  76. 'class': 'uitd_showTip',
  77. width: "100px"
  78. },
  79. {
  80. title: '毕业学校',
  81. field: 'graduateSchool',
  82. visible: true,
  83. align: 'center',
  84. valign: 'middle',
  85. 'class': 'uitd_showTip',
  86. width: "100px"
  87. },
  88. {
  89. title: '手机号码',
  90. field: 'phone',
  91. visible: true,
  92. align: 'center',
  93. valign: 'middle',
  94. 'class': 'uitd_showTip',
  95. width: "100px"
  96. },
  97. {
  98. title: '本单位入职时间',
  99. field: 'entryTime',
  100. visible: true,
  101. align: 'center',
  102. valign: 'middle',
  103. 'class': 'uitd_showTip',
  104. width: "100px"
  105. },
  106. {
  107. title: '首次来晋工作时间',
  108. field: 'firstInJJTime',
  109. visible: true,
  110. align: 'center',
  111. valign: 'middle',
  112. 'class': 'uitd_showTip',
  113. width: "100px"
  114. },
  115. {
  116. title: '推荐兑现状态',
  117. field: 'recommendIsPay',
  118. visible: $("#process").val() == 4,
  119. align: 'center',
  120. valign: 'middle',
  121. 'class': 'uitd_showTip',
  122. width: "100px",
  123. formatter: function (value, row, index) {
  124. if (value == -1) {
  125. return "<span style='color: red'>不予兑现</span>"
  126. }
  127. if (value == 0) {
  128. return "<span style='color: #2401fd'>未知</span>"
  129. }
  130. if (value == 1) {
  131. return "<span style='color: green'>待兑现</span>"
  132. }
  133. if (value == 2) {
  134. return "<span style='color: #6d008b'>已兑现</span>"
  135. }
  136. }
  137. },
  138. {
  139. title: '推荐兑现金额', field: 'recommendAmount', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  140. },
  141. {
  142. title: '推荐判定描述', field: 'recommendJudgmentDetails', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  143. // formatter: function (value,row,index) {
  144. // if(Feng.isNotEmptyStr(value)){
  145. // var arr = value.split(";");
  146. // var str = "";
  147. // for(var i=0;i<arr.length;i++){
  148. // if(Feng.isNotEmptyStr($.trim(arr[i]))){
  149. // str = str + (i+1) + "." + arr[i]
  150. // }
  151. // }
  152. // return str
  153. // }
  154. // return value;
  155. // }
  156. },
  157. {
  158. title: '推荐计算描述', field: 'recommendAmountDesc', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  159. // formatter: function (value,row,index) {
  160. // if(Feng.isNotEmptyStr(value)){
  161. // var arr = value.split(";");
  162. // var str = "";
  163. // for(var i=0;i<arr.length;i++){
  164. // if(Feng.isNotEmptyStr($.trim(arr[i]))) {
  165. // str = str + (i + 1) + "." + arr[i] +
  166. // }
  167. // }
  168. // return str
  169. // }
  170. // return value;
  171. // }
  172. },
  173. {
  174. title: '实际兑现状态',
  175. field: 'isPay',
  176. visible: $("#process").val() == 4,
  177. align: 'center',
  178. valign: 'middle',
  179. 'class': 'uitd_showTip',
  180. width: "100px",
  181. formatter: function (value, row, index) {
  182. if (value == -1) {
  183. return "<span style='color: red'>不予兑现</span>"
  184. }
  185. if (value == 0) {
  186. return "<span style='color: #2401fd'>未知</span>"
  187. }
  188. if (value == 1) {
  189. return "<span style='color: green'>待兑现</span>"
  190. }
  191. if (value == 2) {
  192. return "<span style='color: #6d008b'>已兑现</span>"
  193. }
  194. }
  195. },
  196. {
  197. title: '实际兑现金额', field: 'amount', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  198. },
  199. {
  200. title: '实际判定描述', field: 'judgmentDetails', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  201. formatter: function (value, row, index) {
  202. if (Feng.isNotEmptyStr(value)) {
  203. var arr = value.split(";");
  204. return arr.join("</br>")
  205. }
  206. return value;
  207. }
  208. },
  209. {
  210. title: '实际计算描述', field: 'amountDesc', visible: $("#process").val() == 4, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  211. formatter: function (value, row, index) {
  212. if (Feng.isNotEmptyStr(value)) {
  213. var arr = value.split(";");
  214. return arr.join("</br>")
  215. }
  216. return value;
  217. }
  218. },
  219. {
  220. title: '审核状态',
  221. field: 'checkState',
  222. visible: $("#process").val() == 1,
  223. align: 'center',
  224. valign: 'middle',
  225. width: "100px",
  226. formatter: function (value, row, index) {
  227. if (value == -1) {
  228. return "<span class='label label-danger'>审核不通过</span>"
  229. }
  230. if (value == 1) {
  231. return "<span class='label'>待提交</span>"
  232. }
  233. if (value == 7) {
  234. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 1) {
  235. return "<span class='label label-success'>重新提交</span>"
  236. } else {
  237. return "<span class='label label-success'>待审核</span>"
  238. }
  239. }
  240. if (value == 20) {
  241. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 1) {
  242. return "<span class='label label-success'>上级驳回</span>"
  243. } else {
  244. return "<span class='label label-success'>待审核</span>"
  245. }
  246. }
  247. if (value == 10) {
  248. return "<span class='label label-danger'>已驳回</span>"
  249. }
  250. if (value == 15 || value >= 25) {
  251. return "<span class='label label-primary'>已通过</span>"
  252. }
  253. }
  254. },
  255. {
  256. title: '审核状态',
  257. field: 'checkState',
  258. visible: $("#process").val() == 2,
  259. align: 'center',
  260. valign: 'middle',
  261. width: "100px",
  262. formatter: function (value, row, index) {
  263. if (value == -1) {
  264. return "<span class='label label-danger'>审核不通过</span>"
  265. } else if (value <= 10 || value == 20) {
  266. return "<span class='label label-danger'>已驳回</span>"
  267. } else if (value == 15) {
  268. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 2) {
  269. return "<span class='label label-success'>重新提交</span>"
  270. } else {
  271. return "<span class='label label-success'>待审核</span>"
  272. }
  273. } else if (value >= 25) {
  274. return "<span class='label label-primary'>已通过</span>"
  275. }
  276. }
  277. },
  278. {
  279. title: '审核状态',
  280. field: 'checkState',
  281. visible: $("#process").val() == 3,
  282. align: 'center',
  283. valign: 'middle',
  284. width: "120px",
  285. formatter: function (value, row, index) {
  286. if (value == -1) {
  287. return "<span class='label label-danger'>审核不通过</span>"
  288. }
  289. if (value == 25) {
  290. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 3) {
  291. return "<span class='label label-success'>重新提交</span>"
  292. } else {
  293. return "<span class='label label-success'>待审核</span>"
  294. }
  295. }
  296. if (value == 30 || value <= 20) {
  297. return "<span class='label label-danger'>已驳回</span>"
  298. }
  299. if (value >= 35) {
  300. return "<span class='label label-primary'>已通过</span>"
  301. }
  302. }
  303. },
  304. {
  305. title: '审核状态',
  306. field: 'checkState',
  307. visible: $("#process").val() == 4,
  308. align: 'center',
  309. valign: 'middle',
  310. width: "120px",
  311. formatter: function (value, row, index) {
  312. if (value == -1) {
  313. return "<span class='label label-danger'>审核不通过</span>"
  314. }
  315. if (value == 35) {
  316. return "<span class='label label-primary'>已通过</span>"
  317. }
  318. }
  319. },
  320. {
  321. title: '公示状态',
  322. field: 'isPublic',
  323. visible: true,
  324. align: 'center',
  325. valign: 'middle',
  326. 'class': 'uitd_showTip',
  327. width: "100px",
  328. formatter: function (value, row, index) {
  329. if (value == 1) {
  330. return "<span class='label label-info'>待核查征信</span>"
  331. }
  332. if (value == 2) {
  333. return "<span class='label label-success'>待公示</span>"
  334. }
  335. if (value == 3) {
  336. return "<span class='label label-danger'>公示中</span>"
  337. }
  338. if (value == 4) {
  339. if (row.checkState == -1) {
  340. return "<span class='label label-danger'>审核不通过</span>"
  341. }
  342. return "<span class='label label-primary'>待兑现</span>"
  343. }
  344. if (value == 5) {
  345. return "<span class='label label-primary'>已兑现</span>"
  346. }
  347. }
  348. },
  349. {
  350. title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: '80px',
  351. formatter: function (value, row, index) {
  352. return "<span class='label label-success' onclick=\"LivingAllowanceInfo.showLog('" + value + "')\" >" +
  353. "<i class=\"fa fa-book\"></i>日志" +
  354. "</span>";
  355. }
  356. }
  357. ];
  358. };
  359. /**
  360. * 检查是否选中
  361. */
  362. LivingAllowanceInfo.check = function () {
  363. var selected = $('#' + this.id).bootstrapTable('getSelections');
  364. if (selected.length == 0) {
  365. Feng.info("请先选中表格中的某一记录!");
  366. return false;
  367. } else {
  368. LivingAllowanceInfo.seItem = selected[0];
  369. return true;
  370. }
  371. };
  372. /**
  373. * 点击审核硕博人才生活补贴申报
  374. * @param process
  375. */
  376. LivingAllowanceInfo.openCheckLivingAllowanceInfo = function (process) {
  377. if (this.check()) {
  378. var index = layer.open({
  379. type: 2,
  380. title: '硕博人才生活补贴审核',
  381. area: ['800px', '420px'], //宽高
  382. fix: false, //不固定
  383. maxmin: true,
  384. content: Feng.ctxPath + '/admin/living_allowance/detail?id=' + LivingAllowanceInfo.seItem.id + "&process=" + process,
  385. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-save"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  386. btnAlign: 'c',
  387. btn1: function (index, layero) {
  388. var obj = layero.find("iframe")[0].contentWindow;
  389. obj.LivingAllowanceInfoInfoDlg.showCheckModal(process);
  390. }, btn2: function (index, layero) {
  391. var obj = layero.find("iframe")[0].contentWindow;
  392. obj.LivingAllowanceInfoInfoDlg.submitCheck(process);
  393. return false;
  394. }
  395. });
  396. layer.full(index);
  397. LivingAllowanceInfo.layerIndex = index;
  398. }
  399. };
  400. /**
  401. * 打开查看硕博人才生活补贴申报详情
  402. */
  403. LivingAllowanceInfo.openLivingAllowanceInfoDetail = function () {
  404. if (this.check()) {
  405. var index = layer.open({
  406. type: 2,
  407. title: '硕博人才生活补贴申报详情',
  408. area: ['800px', '420px'], //宽高
  409. fix: false, //不固定
  410. maxmin: true,
  411. content: Feng.ctxPath + '/livingAllowanceInfo/livingAllowanceInfo_update/' + LivingAllowanceInfo.seItem.id
  412. });
  413. this.layerIndex = index;
  414. }
  415. };
  416. /**
  417. * 显示核查征信驳回模态框
  418. */
  419. LivingAllowanceInfo.showHczxRejectModal = function () {
  420. if (this.check()) {
  421. if (LivingAllowanceInfo.seItem.isPublic != 1) {
  422. Feng.info("当前记录不是待核查征信状态,无法核查");
  423. return;
  424. }
  425. $("#hczxId").val(LivingAllowanceInfo.seItem.id);
  426. $("#hczxMsg").val("");
  427. $("#hczxRejectModal").modal("show");
  428. }
  429. }
  430. /**
  431. * 核查征信驳回提交
  432. */
  433. LivingAllowanceInfo.hczxReject = function () {
  434. var id = $("#hczxId").val();
  435. var msg = $("#hczxMsg").val();
  436. if (msg == null || msg == '') {
  437. Feng.info("请填写失信原因");
  438. return;
  439. }
  440. var operation = function () {
  441. var ajax = new $ax(Feng.ctxPath + "/livingAllowanceInfo/hczxReject", function (data) {
  442. if (data.code == 200) {
  443. Feng.success(data.msg);
  444. LivingAllowanceInfo.table.refresh();
  445. $("#hczxRejectModal").modal("hide");
  446. } else {
  447. Feng.error(data.msg);
  448. }
  449. }, function (data) {
  450. Feng.error("核查征信失败!" + data.responseJSON.message + "!");
  451. });
  452. ajax.setData({"id": id, "outMsg": msg, "creditStatus": 3});
  453. ajax.start();
  454. }
  455. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  456. }
  457. LivingAllowanceInfo.showDataCheckModal = function (type) {
  458. $("#hczxForm").css("display", "none");
  459. switch (type) {
  460. case 1: //待核查征信名单-导出
  461. $("#hczxButton").attr("onclick", "LivingAllowanceInfo.checkExport()").text("导出");
  462. $("#exportCommonModalLabel").text("待核查征信名单");
  463. break;
  464. case 2: //待核查征信名单-核查征信通过
  465. $("#hczxButton").attr("onclick", "LivingAllowanceInfo.hczxPass()").text("提交");
  466. $("#exportCommonModalLabel").text("待核查征信名单");
  467. break;
  468. case 3: //公示(批量)
  469. $("#hczxButton").attr("onclick", "LivingAllowanceInfo.public()").text("公示");
  470. $("#exportCommonModalLabel").text("待公示名单");
  471. $("#hczxForm").css("display", "block");
  472. $(".time").each(function () {
  473. laydate.render({
  474. elem: "#" + $(this).attr("id")
  475. , type: 'date'
  476. , format: 'yyyy年MM月dd日'
  477. });
  478. });
  479. break;
  480. case 4: //公示通过(批量)
  481. $("#hczxButton").attr("onclick", "LivingAllowanceInfo.publicPass()").text("提交");
  482. $("#exportCommonModalLabel").text("公示通过名单");
  483. break;
  484. case 5: //待公布名单
  485. $("#hczxButton").attr("onclick", "LivingAllowanceInfo.publish()").text("公布");
  486. $("#exportCommonModalLabel").text("待公布名单");
  487. break;
  488. case 6: //待发证名单
  489. $("#hczxButton").attr("onclick", "LivingAllowanceInfo.issue()").text("提交");
  490. $("#exportCommonModalLabel").text("待发证名单");
  491. break;
  492. case 7: //公示名单预览
  493. $("#hczxButton").attr("onclick", "LivingAllowanceInfo.needPublicExport()").text("导出");
  494. $("#exportCommonModalLabel").text("待公示名单");
  495. break;
  496. }
  497. $('#dataTable').bootstrapTable('destroy');
  498. $('#dataTable').bootstrapTable({
  499. url: Feng.ctxPath + "/admin/living_allowance/selectNeedCheckData?type=" + type,
  500. method: 'POST',
  501. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  502. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  503. showRefresh: false, // 是否显示刷新按钮
  504. clickToSelect: true, // 是否启用点击选中行
  505. singleSelect: false, // 设置True 将禁止多选
  506. striped: true, // 是否显示行间隔色
  507. pagination: true, // 设置为 true 会在表格底部显示分页条
  508. paginationHAlign: "left",
  509. paginationDetailHAlign: "right",
  510. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  511. pageNumber: 1, //初始化加载第一页,默认第一页
  512. pageSize: 10, //每页的记录行数(*)
  513. pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*)
  514. maintainSelected: true, //全表全选需要开启
  515. showColumns: false,
  516. responseHandler: function (res) {
  517. $("#exportCommonModal").modal("show");
  518. return res.obj.rows;
  519. },
  520. columns:
  521. [
  522. {field: "selectItem", checkbox: true},
  523. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "20%"},
  524. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle', width: "30%"},
  525. {
  526. title: '企业名称',
  527. field: 'enterpriseName',
  528. visible: true,
  529. align: 'center',
  530. valign: 'middle',
  531. width: "40%"
  532. },
  533. {
  534. title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "10%",
  535. formatter: function (value, row, index) {
  536. if (value == -1) {
  537. return "<span style='color: #ed5565;'>审核不通过</span>";
  538. }
  539. if (value == 35) {
  540. return "<span style='color: #1ab394;'>审核通过</span>";
  541. }
  542. }
  543. },
  544. ]
  545. });
  546. }
  547. /**
  548. * 选择导出提交
  549. */
  550. LivingAllowanceInfo.checkExport = function () {
  551. var selected = $('#dataTable').bootstrapTable('getSelections');
  552. if (!selected || selected.length < 1) {
  553. Feng.info("请至少选择一行数据!");
  554. return;
  555. }
  556. var ids = "";
  557. for (var i = 0; i < selected.length; i++) {
  558. ids = ids + selected[i].id + ",";
  559. }
  560. window.location.href = Feng.ctxPath + "/admin/living_allowance/exportHczx?ids=" + ids;
  561. }
  562. LivingAllowanceInfo.actalUpload = function () {
  563. $("#file,#fileName").val("");
  564. $("#importModal").modal("show");
  565. }
  566. /**
  567. *
  568. */
  569. LivingAllowanceInfo.importSubmit = function () {
  570. $("#import-form")[0].submit();
  571. // layer.confirm('您需要导入数据并提交吗?', {
  572. // btn: ['仅导入','导入并提交','取消'] //按钮
  573. // }, function(index){
  574. // $("#importType").val(1);
  575. // $("#import-form")[0].submit();
  576. // layer.close(index);
  577. // }, function(index){
  578. // $("#importType").val(2);
  579. // $("#import-form")[0].submit();
  580. // layer.close(index);
  581. // }, function(index){
  582. // layer.close(index);
  583. // });
  584. }
  585. LivingAllowanceInfo.importCallBack = function (data) {
  586. if (data.code == 200) {
  587. $("#importModal").modal("hide");
  588. LivingAllowanceInfo.table.refresh();
  589. Feng.success(data.msg);
  590. } else {
  591. Feng.error(data.msg);
  592. }
  593. }
  594. LivingAllowanceInfo.initCheckFileTable = function () {
  595. $('#checkFileTable').bootstrapTable('destroy');
  596. $('#checkFileTable').bootstrapTable({
  597. url: Feng.ctxPath + "/common/api/listTalentFile",
  598. method: 'POST',
  599. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  600. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  601. showRefresh: false, // 是否显示刷新按钮
  602. clickToSelect: true, // 是否启用点击选中行
  603. singleSelect: true, // 设置True 将禁止多选
  604. striped: true, // 是否显示行间隔色
  605. pagination: false, // 设置为 true 会在表格底部显示分页条
  606. paginationHAlign: "left",
  607. paginationDetailHAlign: "right",
  608. sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  609. showColumns: false,
  610. queryParams: function (params) {
  611. return {"mainId": $("#batch").val(), "fileTypeId": "master_living_allowance"};
  612. },
  613. rowStyle: function (row, index) {
  614. return {css: {"word-break": "break-word", "white-space": "inherit"}}
  615. },
  616. columns:
  617. [
  618. {title: '附件原名', field: 'orignName', visible: true, align: 'center', valign: 'middle', width: '120px'},
  619. {title: '预览', field: 'url', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px",
  620. formatter: function (value, row, index) {
  621. var sn = value.lastIndexOf(".");
  622. var suffix = value.substring(sn + 1, value.length);
  623. var imgStr = "";
  624. if (suffix == "pdf" || suffix == "PDF") {
  625. imgStr = "<button type='button' onclick=\"Feng.showPdf('" + value + "','" + row.id + "','" + row.orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
  626. } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
  627. imgStr = "<button type='button' onclick=\"Feng.showExcel('" + value + "','" + row.id + "','" + row.orignName + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
  628. } else {
  629. imgStr = '<img class=\"imgUrl\" src=\"' + value + '\" style=\"width:25px;height:25px;\">';
  630. }
  631. return imgStr;
  632. }
  633. },
  634. {title: '操作', field: 'url', visible: true, align: 'center', valign: 'middle', width: '80px',
  635. formatter: function (value, row, index) {
  636. return "<button type='button' onclick=\"downloadFile('" + row.id + "','" + row.type + "')\" class=\"btn btn-xs btn-success\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i>下载</button>" +
  637. "<button type='button' onclick=\"LivingAllowanceInfo.deleteCheckFile('" + row.id + "','" + CONFIG.project_master_living_allowance + "')\" class=\"btn btn-xs btn-danger\">" +
  638. "<i class=\"fa fa-times\"></i>删除" +
  639. "</button>";
  640. }
  641. },
  642. ],
  643. onPostBody: function () {
  644. $('#checkFileTable' + "td.uitd_showTip").bind("mouseover", function () {
  645. var htm = $(this).html();
  646. $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
  647. });
  648. $(".imgUrl").viewer({fullscreen: false});
  649. },
  650. });
  651. }
  652. /**
  653. * 核查材料留存上传
  654. */
  655. LivingAllowanceInfo.showCheckFileModal = function () {
  656. Feng.addAjaxSelect({
  657. "id": "batch",
  658. "displayCode": "id",
  659. "displayName": "batch",
  660. "type": "GET",
  661. "url": Feng.ctxPath + "/admin/batch/listBatchByType?type=" + CONFIG.project_master_living_allowance
  662. });
  663. $("#upload_file").val("");
  664. $("#checkFileModal").modal("show");
  665. }
  666. LivingAllowanceInfo.checkFileUpload = function () {
  667. var batch = $("#batch").val();
  668. if (Feng.isEmptyStr(batch)) {
  669. Feng.info("请选择申报批次后再上传!");
  670. return;
  671. }
  672. $("#upload_file ").unbind("change");
  673. $("#upload_file ").change(function () {
  674. var formData = new FormData();
  675. formData.append("fileTypeId", "master_living_allowance");
  676. formData.append("mainId", batch);
  677. formData.append("fileId", "");
  678. for (var i = 0; i < $('#upload_file')[0].files.length; i++) {
  679. formData.append('file', $('#upload_file')[0].files[i]);
  680. }
  681. $.ajax({
  682. url: Feng.ctxPath + "/admin/talentCommonFile/uploadBatch",
  683. type: "POST",
  684. processData: false,
  685. contentType: false,
  686. data: formData,
  687. success: function (data) {
  688. $("#checkFileTable").bootstrapTable("refresh", {});
  689. Feng.info(data.msg);
  690. }, error: function (data) {
  691. Feng.error("上传失败!" + data.responseJSON.message + "!");
  692. }
  693. });
  694. });
  695. $('#upload_file').val("");
  696. $('#upload_file').click();
  697. }
  698. LivingAllowanceInfo.deleteCheckFile = function (id, type) {
  699. var operation = function () {
  700. var ajax = new $ax(Feng.ctxPath + "/common/api/deleteFile", function (data) {
  701. if (data.code = 200) {
  702. Feng.success(data.msg);
  703. $("#checkFileTable").bootstrapTable("refresh", {});
  704. } else {
  705. Feng.error(data.msg);
  706. }
  707. }, function (data) {
  708. Feng.error("删除失败!" + data.responseJSON.message + "!");
  709. });
  710. ajax.set("id", id);
  711. ajax.set("type", type);
  712. ajax.start();
  713. }
  714. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  715. }
  716. /**
  717. * 审核不通过
  718. */
  719. LivingAllowanceInfo.setNotPass = function () {
  720. var selecteds = $('#' + this.id).bootstrapTable('getSelections');
  721. if (selecteds.length == 0) {
  722. Feng.info("请选择需要设置审核不通过的行");
  723. return;
  724. }
  725. var ids = "";
  726. for (var key in selecteds) {
  727. ids = ids + selecteds[key].id + ",";
  728. }
  729. ids = ids.substring(0, ids.length - 1);
  730. layer.open({
  731. type: 1,
  732. id: "notPassModal",
  733. title: '修改',
  734. area: ['800px', '450px'], //宽高
  735. fix: false, //不固定
  736. shade: 0,
  737. maxmin: true,
  738. content: '<form id="checkNotPass">\n' +
  739. ' <div class="form-group" style="margin: 10px;">\n' +
  740. ' <label for="checkMsgNotPass" class="control-label" >审核不通过原因</label>\n' +
  741. ' <textarea class="form-control" id="checkMsgNotPass" placeholder="此功能适用于未在申报提交截止时间内提交的数据" rows="6"></textarea>\n' +
  742. ' </div>\n' +
  743. ' </form>',
  744. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  745. btnAlign: 'c',
  746. zIndex: layer.zIndex,
  747. yes: function (index, layero) {
  748. var checkMsg = $("#checkMsgNotPass").val();
  749. if (Feng.isEmptyStr(checkMsg)) {
  750. Feng.info("请填写审核不通过原因");
  751. return;
  752. }
  753. var operation = function () {
  754. var ajax = new $ax(Feng.ctxPath + "/admin/living_allowance/setNotPass", function (data) {
  755. if (data.code == 200) {
  756. Feng.success(data.msg);
  757. LivingAllowanceInfo.table.refresh();
  758. layer.close(index);
  759. } else {
  760. Feng.error(data.msg);
  761. }
  762. }, function (data) {
  763. Feng.error("设置审核不通过失败!" + data.responseJSON.message + "!");
  764. });
  765. ajax.set("ids", ids);
  766. ajax.set("msg", checkMsg);
  767. ajax.start();
  768. }
  769. Feng.confirm("一旦提交无法修改,确定设置所选数据为审核不通过?", operation);
  770. }
  771. });
  772. }
  773. /**
  774. * 批量征信通过
  775. */
  776. LivingAllowanceInfo.hczxPass = function () {
  777. var selected = $('#dataTable').bootstrapTable('getSelections');
  778. if (!selected || selected.length < 1) {
  779. Feng.info("请至少选择一行数据!");
  780. return;
  781. }
  782. var ids = "";
  783. for (var i = 0; i < selected.length; i++) {
  784. ids = ids + selected[i].id + ",";
  785. }
  786. var operation = function () {
  787. var ajax = new $ax(Feng.ctxPath + "/admin/living_allowance/hczxPass", function (data) {
  788. if (data.code == 200) {
  789. Feng.success(data.msg);
  790. LivingAllowanceInfo.table.refresh();
  791. $("#exportCommonModal").modal("hide");
  792. } else {
  793. Feng.error(data.msg);
  794. }
  795. }, function (data) {
  796. Feng.error("核查征信失败!" + data.responseJSON.message + "!");
  797. });
  798. ajax.set("ids", ids);
  799. ajax.start();
  800. }
  801. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  802. }
  803. /**
  804. * 公示预览
  805. */
  806. LivingAllowanceInfo.needPublicExport = function () {
  807. var selected = $('#dataTable').bootstrapTable('getSelections');
  808. if (!selected || selected.length < 1) {
  809. Feng.info("请至少选择一行数据!");
  810. return;
  811. }
  812. var ids = "";
  813. for (var i = 0; i < selected.length; i++) {
  814. ids = ids + selected[i].id + ",";
  815. }
  816. var operation = function () {
  817. $("#exportCommonModal").modal("hide");
  818. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/admin/living_allowance/exportPublic?ids=" + ids));
  819. }
  820. Feng.confirm("确定要公示预览吗?", operation);
  821. }
  822. /**
  823. * 公示
  824. */
  825. LivingAllowanceInfo.public = function () {
  826. var selected = $('#dataTable').bootstrapTable('getSelections');
  827. if (!selected || selected.length < 1) {
  828. Feng.info("请至少选择一行数据!");
  829. return;
  830. }
  831. var ids = "";
  832. for (var i = 0; i < selected.length; i++) {
  833. ids = ids + selected[i].id + ",";
  834. }
  835. var isMessage = $("input[name='isSend']:checked").val();
  836. var typeName = $("#typeName").val();
  837. var address = $("#web").val();
  838. var publicStartTime = $("#publicStartTime").val();
  839. var publicEndTime = $("#publicEndTime").val();
  840. var dep = $("#dep").val();
  841. var phone = $("#fyphone").val();
  842. var email = $("#fyemail").val();
  843. if (isMessage == 1) {
  844. if (typeName == null || typeName == '') {
  845. Feng.info("请填写公示类型");
  846. return;
  847. }
  848. if (address == null || address == '') {
  849. Feng.info("请填写公示平台");
  850. return;
  851. }
  852. if (publicStartTime == null || publicStartTime == '') {
  853. Feng.info("请填写公示开始时间");
  854. return;
  855. }
  856. if (publicEndTime == null || publicEndTime == '') {
  857. Feng.info("请填写公示截止时间");
  858. return;
  859. }
  860. if (dep == null || dep == '') {
  861. Feng.info("请填写反映单位");
  862. return;
  863. }
  864. if (phone == null || phone == '') {
  865. Feng.info("请填写联系电话");
  866. return;
  867. }
  868. if (email == null || email == '') {
  869. Feng.info("请填写联系邮箱");
  870. return;
  871. }
  872. }
  873. var operation = function () {
  874. var index = layer.open({
  875. type: 1,
  876. title: '公示',
  877. area: ['300px', '220px'], //宽高
  878. fix: false, //不固定
  879. maxmin: true,
  880. content: "<input class='form-control' id='publicBatchId' style='width:90%;margin: 10px' placeholder='请输入公示批次'>",
  881. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  882. btnAlign: 'c',
  883. success: function () {
  884. laydate.render({elem: "#publicBatchId", type: 'month', trigger: 'click', format: "yyyyMM"});
  885. },
  886. yes: function (index, layero) {
  887. var month = $("#publicBatchId").val();
  888. if (Feng.isEmptyStr(month)) {
  889. Feng.info("请填写公示批次");
  890. return;
  891. }
  892. layer.close(index);
  893. var ajax = new $ax(Feng.ctxPath + "/admin/living_allowance/publicBatch", function (data) {
  894. if (data.code == 200) {
  895. Feng.success(data.msg);
  896. LivingAllowanceInfo.table.refresh();
  897. $("#exportCommonModal").modal("hide");
  898. } else {
  899. Feng.error(data.msg);
  900. }
  901. }, function (data) {
  902. Feng.error("公示失败!" + data.responseJSON.message + "!");
  903. });
  904. ajax.set("ids", ids);
  905. ajax.set("typeName", typeName);
  906. ajax.set("address", address);
  907. ajax.set("publicStartTime", publicStartTime);
  908. ajax.set("publicEndTime", publicEndTime);
  909. ajax.set("dep", dep);
  910. ajax.set("phone", phone);
  911. ajax.set("email", email);
  912. ajax.set("isMessage", isMessage);
  913. ajax.set("batch", month);
  914. ajax.start();
  915. }
  916. });
  917. }
  918. Feng.confirm("确定要公示吗?", operation);
  919. }
  920. //已公示的数据根据公示批次公示导出
  921. LivingAllowanceInfo.publicExport = function (type) {
  922. var url = "", dateType = '', format = '';
  923. if (type == 1) { //公示导出
  924. url = Feng.ctxPath + "/admin/living_allowance/publicExport";
  925. dateType = 'month';
  926. format = "yyyyMM";
  927. } else if (type == 2) { //公布导出
  928. url = Feng.ctxPath + "/admin/living_allowance/publishExport";
  929. dateType = 'date';
  930. format = "yyyy-MM-dd";
  931. }
  932. layer.open({
  933. type: 1,
  934. title: type == 1 ? '公示导出' : "公布导出",
  935. area: ['800px', '300px'], //宽高
  936. fix: false, //不固定
  937. maxmin: true,
  938. content: "<form id=\"publicExportForm\" action=\"" + url + "\" target=\"hiddenIframe\" class=\"form-horizontal \" style='padding-top: 10px;'>\n" +
  939. " <div class=\"form-group col-sm-12\">\n" +
  940. " <div class=\"row\">\n" +
  941. " <label class=\"col-sm-2 control-label\">开始时间</label>\n" +
  942. " <div class=\"col-sm-4\">\n" +
  943. " <input type=\"text\" id=\"startTime\" name=\"startTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
  944. " </div>\n" +
  945. " <label class=\"col-sm-2 control-label\">截止时间</label>\n" +
  946. " <div class=\"col-sm-4\">\n" +
  947. " <input type=\"text\" id=\"endTime\" name=\"endTime\" time=\"time\" format=\"month\" class=\"form-control\">\n" +
  948. " </div>\n" +
  949. " </div>\n" +
  950. " </div>\n" +
  951. " </form>",
  952. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  953. btnAlign: 'c',
  954. success: function (index, layero) {
  955. $("#publicExportForm")[0].reset();
  956. $("input[time='time']").each(function () {
  957. laydate.render({
  958. elem: "#" + $(this).attr("id")
  959. , type: dateType
  960. , format: format
  961. , trigger: 'click'
  962. });
  963. });
  964. },
  965. yes: function (index) {
  966. var startTime = $("#startTime").val();
  967. var endTime = $("#endTime").val();
  968. if (startTime == null || startTime == '') {
  969. Feng.info("请选择开始时间");
  970. return;
  971. }
  972. if (endTime == null || endTime == '') {
  973. Feng.info("请选择结束时间");
  974. return;
  975. }
  976. $("#publicExportForm")[0].submit();
  977. layer.close(index)
  978. }
  979. });
  980. }
  981. /**
  982. * 公示再审核
  983. */
  984. LivingAllowanceInfo.afterCheck = function () {
  985. if (this.check()) {
  986. if (LivingAllowanceInfo.seItem.isPublic != 3) {
  987. Feng.info("当前记录不是公示中状态,无法审核");
  988. return;
  989. }
  990. if (LivingAllowanceInfo.seItem.creditStatus == 3) {
  991. $("#zxNotice").text("当前申请人核查征信不通过,请谨慎选择审核状态!征信意见为:" + LivingAllowanceInfo.seItem.outMsg);
  992. }
  993. if (LivingAllowanceInfo.seItem.checkState == -1) {
  994. var html = '<option value="">请选择</option>\n' +
  995. ' <option value="2">驳回/恢复</option>';
  996. $("#checkStateAfter").empty().append(html);
  997. }
  998. if (LivingAllowanceInfo.seItem.checkState == 35) {
  999. var html = '<option value="">请选择</option>\n' +
  1000. ' <option value="-1">审核不通过</option>' +
  1001. ' <option value="2">驳回</option>';
  1002. $("#checkStateAfter").empty().append(html);
  1003. }
  1004. $("#checkForm")[0].reset();
  1005. $("#mainId").val(LivingAllowanceInfo.seItem.id);
  1006. $("#checkModal").modal("show");
  1007. }
  1008. }
  1009. /**
  1010. * 公示后审核提交
  1011. */
  1012. LivingAllowanceInfo.afterCheckSubmit = function () {
  1013. var checkState = $("#checkStateAfter").val();
  1014. var msg = $("#msg").val();
  1015. if (checkState == null || checkState == '') {
  1016. Feng.info("请选择审核状态");
  1017. return;
  1018. }
  1019. if (msg == null || msg == '') {
  1020. Feng.info("请填写审核意见");
  1021. return;
  1022. }
  1023. var operation = function () {
  1024. var ajax = new $ax(Feng.ctxPath + "/admin/living_allowance/afterCheck", function (data) {
  1025. if (data.code == 200) {
  1026. Feng.success(data.msg);
  1027. LivingAllowanceInfo.table.refresh();
  1028. $("#checkModal").modal("hide");
  1029. } else {
  1030. Feng.error(data.msg);
  1031. }
  1032. }, function (data) {
  1033. Feng.error("审核失败!" + data.responseJSON.message + "!");
  1034. });
  1035. ajax.setData({"id": $("#mainId").val(), "checkState": $("#checkStateAfter").val(), "checkMsg": msg});
  1036. ajax.start();
  1037. }
  1038. Feng.confirm("一旦提交无法修改,确定提交吗?", operation);
  1039. }
  1040. /**
  1041. * 批量公示通过
  1042. * @param type
  1043. */
  1044. LivingAllowanceInfo.publicPass = function () {
  1045. var selected = $('#dataTable').bootstrapTable('getSelections');
  1046. if (!selected || selected.length < 1) {
  1047. Feng.info("请至少选择一行数据!");
  1048. return;
  1049. }
  1050. var ids = "";
  1051. for (var i = 0; i < selected.length; i++) {
  1052. ids = ids + selected[i].id + ",";
  1053. }
  1054. var operation = function () {
  1055. var ajax = new $ax(Feng.ctxPath + "/admin/living_allowance/publicPass", function (data) {
  1056. if (data.code == 200) {
  1057. Feng.success(data.msg);
  1058. LivingAllowanceInfo.table.refresh();
  1059. $("#exportCommonModal").modal("hide");
  1060. } else {
  1061. Feng.error(data.msg);
  1062. }
  1063. }, function (data) {
  1064. Feng.error("公示通过失败!" + data.responseJSON.message + "!");
  1065. });
  1066. ajax.set("ids", ids);
  1067. ajax.start();
  1068. }
  1069. Feng.confirm("一旦提交无法修改,确定公示通过吗?", operation);
  1070. }
  1071. /**
  1072. * 兑现
  1073. */
  1074. LivingAllowanceInfo.issue = function () {
  1075. var selected = $('#dataTable').bootstrapTable('getSelections');
  1076. if (!selected || selected.length < 1) {
  1077. Feng.info("请至少选择一行数据!");
  1078. return;
  1079. }
  1080. var ids = "";
  1081. for (var i = 0; i < selected.length; i++) {
  1082. ids = ids + selected[i].id + ",";
  1083. }
  1084. var operation = function () {
  1085. var ajax = new $ax(Feng.ctxPath + "/admin/living_allowance/issue", function (data) {
  1086. if (data.code == 200) {
  1087. Feng.success(data.msg);
  1088. LivingAllowanceInfo.table.refresh();
  1089. $("#exportCommonModal").modal("hide");
  1090. } else {
  1091. Feng.error(data.msg);
  1092. }
  1093. }, function (data) {
  1094. Feng.error("兑现失败!" + data.responseJSON.message + "!");
  1095. });
  1096. ajax.set("ids", ids);
  1097. ajax.start();
  1098. }
  1099. Feng.confirm("一旦兑现无法修改,确定要兑现吗?", operation);
  1100. }
  1101. LivingAllowanceInfo.showExportModal = function () {
  1102. $("#exportForm")[0].reset();
  1103. $("#commonExportModal").modal("show");
  1104. }
  1105. LivingAllowanceInfo.export = function (process) {
  1106. var operation = function () {
  1107. var names = '';
  1108. var fieldCodes = '';
  1109. $("#field_info li input").each(function (index) {
  1110. if ($(this).is(":checked")) {
  1111. fieldCodes = fieldCodes + $(this).val() + ",";
  1112. names = names + $(this).next().text() + ",";
  1113. }
  1114. });
  1115. var param = LivingAllowanceInfo.formParams();
  1116. param.names = names;
  1117. param.values = fieldCodes;
  1118. param.process = process;
  1119. window.location.href = Feng.setUrlParam(Feng.ctxPath + "/admin/living_allowance/commonExport", param);
  1120. // window.location.href = Feng.ctxPath + "/api/talentInfoExport/export?names=" + names + "&fieldCodes=" + fieldCodes + "&name=" + $("#name").val() + "&idCard=" + $("#idCard").val()
  1121. // + "&sex=" + $("#sex").val()+ "&nation=" + $("#nation").val()+ "&nationality=" + $("#nationality").val()+ "&talentType=" + $("#talentType").val()+ "&talentArrange=" + $("#talentArrange").val();
  1122. };
  1123. Feng.confirm("确定要导出数据吗?", operation);
  1124. }
  1125. LivingAllowanceInfo.prepareSearch = function () {
  1126. var sex = $("#pub_sex").val();
  1127. var checkState = $("#pub_checkState").val();
  1128. var name = $("#pub_name").val();
  1129. $('#dataTable').bootstrapTable("refresh", {"query": {"sex": sex, "checkState": checkState, "name": name}});
  1130. }
  1131. LivingAllowanceInfo.prepareReset = function () {
  1132. $("#pub_sex").val("");
  1133. $("#pub_checkState").val("");
  1134. $("#pub_name").val("");
  1135. }
  1136. /**
  1137. * 是否发送短信
  1138. */
  1139. LivingAllowanceInfo.toggleMessage = function () {
  1140. var isMessage = $("input[name='isSend']:checked").val();
  1141. if (isMessage == 1) {
  1142. $("#messageEdit").css("display", "block");
  1143. } else if (isMessage == 2) {
  1144. $("#messageEdit").css("display", "none");
  1145. }
  1146. }
  1147. //回调
  1148. LivingAllowanceInfo.callBack = function (data) {
  1149. Feng.info(data.msg);
  1150. if (data.code == 200) {
  1151. $("#hczxModal").modal("hide");
  1152. LivingAllowanceInfo.table.refresh();
  1153. }
  1154. }
  1155. LivingAllowanceInfo.checkAll = function () {
  1156. $("#field_info input").each(function () {
  1157. this.checked = true;
  1158. })
  1159. }
  1160. /**
  1161. * 反选
  1162. */
  1163. LivingAllowanceInfo.unCheckAll = function () {
  1164. $("#field_info input").each(function () {
  1165. if (this.checked) {
  1166. this.checked = false;
  1167. } else {
  1168. this.checked = true;
  1169. }
  1170. })
  1171. }
  1172. LivingAllowanceInfo.showLog = function (id) {
  1173. layer.open({
  1174. type: 1,
  1175. title: "日志",
  1176. fixed: false,
  1177. content: '<table id="' + id + '"></table>',
  1178. area: ['80%', '80%'],
  1179. maxmin: true,
  1180. success: function (layero, index) {
  1181. Feng.getCheckLog(id, {
  1182. "type": CONFIG.project_master_living_allowance,
  1183. "mainId": id,
  1184. "typeFileId": "",
  1185. "active": 1
  1186. })
  1187. }
  1188. });
  1189. }
  1190. /**
  1191. * 查询表单提交参数对象
  1192. * @returns {{}}
  1193. */
  1194. LivingAllowanceInfo.formParams = function () {
  1195. var queryData = {};
  1196. queryData['name'] = $("#name").val();
  1197. queryData['idCard'] = $("#idCard").val();
  1198. queryData['sex'] = $("#sex").val();
  1199. queryData['nation'] = $("#nation").val();
  1200. queryData['nationality'] = $("#nationality").val();
  1201. queryData['provinceCode'] = $("#provinceCode").val();
  1202. queryData['politics'] = $("#politics").val();
  1203. queryData['enterpriseId'] = $("#enterpriseId").val();
  1204. queryData['industryField'] = $("#industryField").val();
  1205. queryData['introductionMode'] = $("#introductionMode").val();
  1206. queryData['highEducation'] = $("#highEducation").val();
  1207. queryData['major'] = $("#major").val();
  1208. queryData['title'] = $("#title").val();
  1209. queryData['studyAbroad'] = $("#studyAbroad").val();
  1210. queryData['phone'] = $("#phone").val();
  1211. queryData['email'] = $("#email").val();
  1212. queryData['address'] = $("#address").val();
  1213. queryData['checkState'] = $("#checkState").val();
  1214. queryData['isPublic'] = $("#isPublic").val();
  1215. queryData['year'] = $("#year").val();
  1216. queryData['declareType'] = $("#declareType").val();
  1217. queryData['introductionMethod'] = $("#introductionMethod").val();
  1218. return queryData;
  1219. }
  1220. /**
  1221. * 查询硕博人才生活补贴申报列表
  1222. */
  1223. LivingAllowanceInfo.search = function () {
  1224. LivingAllowanceInfo.table.refresh({query: LivingAllowanceInfo.formParams()});
  1225. };
  1226. /**
  1227. * 重置查询参数
  1228. */
  1229. LivingAllowanceInfo.reset = function () {
  1230. $("#name").val("");
  1231. $("#idCard").val("");
  1232. $("#sex").val("");
  1233. $("#nation").val("");
  1234. $("#nationality").val("");
  1235. $("#provinceCode").val("");
  1236. $("#politics").val("");
  1237. $("#enterpriseId").val("").trigger("chosen:updated");
  1238. $("#industryField").val("");
  1239. // $("#introductionMode").val("");
  1240. $("#highEducation").val("");
  1241. $("#major").val("");
  1242. $("#title").val("");
  1243. $("#studyAbroad").val("");
  1244. $("#phone").val("");
  1245. $("#email").val("");
  1246. $("#address").val("");
  1247. $("#checkState").val("");
  1248. $("#isPublic").val("");
  1249. $("#year").val("");
  1250. $("#declareType").val("");
  1251. $("#introductionMethod").val("");
  1252. }
  1253. $(function () {
  1254. var defaultColunms = LivingAllowanceInfo.initColumn();
  1255. var table = new BSTable(LivingAllowanceInfo.id, "/admin/living_allowance/list?process=" + $("#process").val(), defaultColunms);
  1256. table.setPaginationType("server");
  1257. table.setOnDblClickRow(function () {
  1258. LivingAllowanceInfo.openCheckLivingAllowanceInfo($("#process").val());
  1259. });
  1260. LivingAllowanceInfo.table = table.init();
  1261. //批量加载字典表数据
  1262. var arr = [
  1263. {"name": "nation", "code": "un_nation"},
  1264. {"name": "nationality", "code": "un_nationality"},
  1265. {"name": "politics", "code": "un_political"},
  1266. {"name": "industryField", "code": "un_industryField"},
  1267. {"name": "introductionMode", "code": "un_introduction_mode"},
  1268. {"name": "highEducation", "code": "un_education"},
  1269. {"name": "declareType", "code": "un_master_education"},
  1270. {"name": "address", "code": "un_street"}];
  1271. Feng.findChildDictBatch(JSON.stringify(arr));
  1272. $("#enterpriseId").on('chosen:ready', function (e, params) {
  1273. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  1274. });
  1275. $("#enterpriseId").chosen({
  1276. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  1277. disable_search: false,
  1278. width: "100%",
  1279. enable_split_word_search: true
  1280. });
  1281. $('#checkAll').click(function () {
  1282. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  1283. })
  1284. $('#uncheckAll').click(function () {
  1285. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  1286. })
  1287. });