childschoolFees.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. /**
  2. * 学杂费补助管理初始化
  3. */
  4. var ChildschoolFees = {
  5. id: "ChildschoolFeesTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. ChildschoolFees.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle',width:"80px",'class': 'uitd_showTip'},
  17. {title: '父母姓名', field: 'pName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip',
  18. formatter : function (value,row,index) {
  19. if(row.pSex==1){
  20. return value+'<span style="color:#6495ED">【男】</span>';
  21. }if(row.pSex==2){
  22. return value+'<span style="color:#FF82AB">【女】</span>';
  23. }
  24. }
  25. },
  26. {title: '父母证件号码', field: 'pIdcard', visible: true, align: 'center', valign: 'middle',width:"150px",'class': 'uitd_showTip'},
  27. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  28. {title: '人才编号', field: 'certificateNo', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  29. {title: '籍贯', field: 'nativePlace', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  30. {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  31. {title: '子女姓名', field: 'cName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip',
  32. formatter : function (value,row,index) {
  33. if(row.cSex==1){
  34. return value+'<span style="color:#6495ED">【男】</span>';
  35. }if(row.cSex==2){
  36. return value+'<span style="color:#FF82AB">【女】</span>';
  37. }
  38. }
  39. },
  40. {title: '子女证件号码', field: 'cIdcard', visible: true, align: 'center', valign: 'middle',width:"150px",'class': 'uitd_showTip'},
  41. {title: '子女出生日期', field: 'cBirthday', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  42. {title: '与申报人关系', field: 'cRelationName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  43. {title: '现就读学校', field: 'nowSchool', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  44. {title: '现就读年级', field: 'nowGradeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  45. {title: '实缴学杂费金额', field: 'paidInMoeny', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  46. {title: '开户银行', field: 'bankName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  47. {title: '开户银行网点', field: 'bankAddress', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  48. {title: '银行账号', field: 'bankNumber', visible: true, align: 'center', valign: 'middle',width:"130px",'class': 'uitd_showTip'},
  49. {title: '兑现金额', field: 'cashMoney', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  50. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip',
  51. formatter : function (value,row,index) {
  52. if(value==-1){
  53. return '<span class=\'label label-danger\'>审核不通过</span>';
  54. }if(value==1){
  55. return '<span class=\'label\'>待提交</span>';
  56. }if(value==2){
  57. return '<span class=\'label label-info\'>待审核</span>';
  58. }if(value==3){
  59. return '<span class=\'label label-success\'>重新提交</span>';
  60. }if(value==4){
  61. return '<span class=\'label label-danger\'>审核驳回</span>';
  62. }if(value==5){
  63. return '<span class=\'label label-primary\'>审核通过</span>';
  64. }
  65. }
  66. },
  67. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px",
  68. formatter : function (value,row,index){
  69. return "<span class='label label-success' onclick=\"ChildschoolFees.showLog('"+value+"')\" >" +
  70. "<i class=\"fa fa-book\"></i>日志" +
  71. "</span>";
  72. }
  73. }
  74. ];
  75. };
  76. /**
  77. * 检查是否选中
  78. */
  79. ChildschoolFees.check = function () {
  80. var selected = $('#' + this.id).bootstrapTable('getSelections');
  81. if(selected.length == 0){
  82. Feng.info("请先选中表格中的某一记录!");
  83. return false;
  84. }else{
  85. ChildschoolFees.seItem = selected[0];
  86. return true;
  87. }
  88. };
  89. /**
  90. * 点击添加学杂费补助
  91. */
  92. ChildschoolFees.openAddChildschoolFees = function () {
  93. var ajax = new $ax(Feng.ctxPath + "/api/commonBatch/valiateIsAdd", function (data) {
  94. if (data.code == 200) {
  95. var index = layer.open({
  96. type: 2,
  97. title: '学杂费补助申报',
  98. area: 'auto', //宽高
  99. fix: false, //不固定
  100. maxmin: true,
  101. content: Feng.ctxPath + '/api/childschoolFees/childschoolFees_add?year='+data.obj,
  102. 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;取消'],
  103. btnAlign: 'c',
  104. btn1: function (index, layero) {
  105. var obj = layero.find("iframe")[0].contentWindow;
  106. obj.ChildschoolFeesInfoDlg.addSubmit();
  107. },btn2: function(index, layero){
  108. var obj = layero.find("iframe")[0].contentWindow;
  109. obj.ChildschoolFeesInfoDlg.submitToCheck();
  110. return false;
  111. },
  112. success :function (layero, index) {
  113. layer.tips('添加基本信息并上传附件后点击','.layui-layer-btn1',{tips:[1,"#78BA32"],time:0,closeBtn :2});
  114. },
  115. end :function () {
  116. layer.closeAll('tips');
  117. }
  118. });
  119. ChildschoolFees.layerIndex = index;
  120. layer.full(index);
  121. }else{
  122. Feng.info(data.msg);
  123. }
  124. }, function (data) {
  125. Feng.error("校验失败!" + data.responseJSON.message + "!");
  126. });
  127. ajax.set("type",CONFIG.project_schoolFees);
  128. ajax.start();
  129. };
  130. /**
  131. * 打开查看学杂费补助详情
  132. */
  133. ChildschoolFees.openChildschoolFeesDetail = function () {
  134. if (this.check()) {
  135. var ajax = new $ax(Feng.ctxPath + "/api/commonBatch/valiateIsEditOrSubmit", function (data) {
  136. if (data.code == 200) {
  137. var index = layer.open({
  138. type: 2,
  139. title: '学杂费补助修改',
  140. area: ['800px', '420px'], //宽高
  141. fix: false, //不固定
  142. maxmin: true,
  143. content: Feng.ctxPath + '/api/childschoolFees/childschoolFees_update/1/' + ChildschoolFees.seItem.id,
  144. 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;取消'],
  145. btnAlign: 'c',
  146. btn1: function (index, layero) {
  147. var obj = layero.find("iframe")[0].contentWindow;
  148. obj.ChildschoolFeesInfoDlg.editSubmit();
  149. },btn2: function(index, layero){
  150. var obj = layero.find("iframe")[0].contentWindow;
  151. obj.ChildschoolFeesInfoDlg.submitToCheck();
  152. return false;
  153. },
  154. success :function (layero, index) {
  155. layer.tips('添加基本信息并上传附件后点击','.layui-layer-btn1',{tips:[1,"#78BA32"],time:0,closeBtn :2});
  156. },
  157. end :function () {
  158. layer.closeAll('tips');
  159. ChildschoolFees.table.refresh();
  160. }
  161. });
  162. ChildschoolFees.layerIndex = index;
  163. layer.full(index);
  164. }else{
  165. Feng.info(data.msg);
  166. }
  167. }, function (data) {
  168. Feng.error("校验失败!" + data.responseJSON.message + "!");
  169. });
  170. ajax.set("type",CONFIG.project_schoolFees);
  171. ajax.set("year",ChildschoolFees.seItem.year);
  172. ajax.start();
  173. }
  174. };
  175. ChildschoolFees.openChildschoolFeesSelect = function(){
  176. if (this.check()) {
  177. var index = layer.open({
  178. type: 2,
  179. title: '学杂费补助查看',
  180. area: ['800px', '420px'], //宽高
  181. fix: false, //不固定
  182. maxmin: true,
  183. content: Feng.ctxPath + '/api/childschoolFees/childschoolFees_update/2/' + ChildschoolFees.seItem.id,
  184. });
  185. ChildschoolFees.layerIndex = index;
  186. layer.full(index);
  187. }
  188. }
  189. /**
  190. * 删除学杂费补助
  191. */
  192. ChildschoolFees.delete = function () {
  193. if (this.check()) {
  194. if(ChildschoolFees.seItem.checkState != 1){
  195. Feng.error("仅能删除未提交的数据");
  196. return ;
  197. }
  198. var operation = function() {
  199. var ajax = new $ax(Feng.ctxPath + "/api/childschoolFees/delete", function (data) {
  200. if(data.code == 200){
  201. Feng.success(data.msg);
  202. ChildschoolFees.table.refresh();
  203. }else{
  204. Feng.info(data.msg);
  205. }
  206. }, function (data) {
  207. Feng.error("删除失败!" + data.responseJSON.message + "!");
  208. });
  209. ajax.set("childschoolFeesId",ChildschoolFees.seItem.id);
  210. ajax.start();
  211. }
  212. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  213. }
  214. };
  215. /**
  216. * 收集数据
  217. */
  218. ChildschoolFees.formParams = function(){
  219. var queryData = {};
  220. queryData['year'] = $("#year").val();
  221. queryData['pName'] = $("#pName").val();
  222. queryData['pSex'] = $("#pSex").val();
  223. queryData['pCardType'] = $("#pCardType").val();
  224. queryData['pIdcard'] = $("#pIdcard").val();
  225. queryData['talentArrange'] = $("#talentArrange").val();
  226. queryData['certificateNo'] = $("#certificateNo").val();
  227. queryData['address'] = $("#address").val();
  228. queryData['phone'] = $("#phone").val();
  229. queryData['cName'] = $("#cName").val();
  230. queryData['cSex'] = $("#cSex").val();
  231. queryData['cCardType'] = $("#cCardType").val();
  232. queryData['cIdcard'] = $("#cIdcard").val();
  233. queryData['cRelation'] = $("#cRelation").val();
  234. queryData['nowSchool'] = $("#nowSchool").val();
  235. queryData['nowGrade'] = $("#nowGrade").val();
  236. queryData['checkState'] = $("#checkState").val();
  237. return queryData;
  238. }
  239. /**
  240. * 重置
  241. */
  242. ChildschoolFees.reset = function(){
  243. $("#year").val("");
  244. $("#pName").val("");
  245. $("#pSex").val("");
  246. $("#pCardType").val("");
  247. $("#pIdcard").val("");
  248. $("#talentArrange").val("");
  249. $("#certificateNo").val("");
  250. $("#address").val("");
  251. $("#phone").val("");
  252. $("#cName").val("");
  253. $("#cSex").val("");
  254. $("#cCardType").val("");
  255. $("#cIdcard").val("");
  256. $("#cRelation").val("");
  257. $("#nowSchool").val("");
  258. $("#nowGrade").val("");
  259. $("#checkState").val("");
  260. }
  261. /**
  262. * 查询学杂费补助列表
  263. */
  264. ChildschoolFees.search = function () {
  265. ChildschoolFees.table.refresh({query: ChildschoolFees.formParams()});
  266. };
  267. /**
  268. * 显示审核日志
  269. */
  270. ChildschoolFees.showLog = function (id){
  271. layer.open({
  272. type: 1,
  273. title:"日志",
  274. fixed:false,
  275. content: '<table id="'+id+'"></table>',
  276. area: ['80%', '80%'],
  277. maxmin: true,
  278. success :function (layero, index) {
  279. Feng.getCheckLog(id,{"type":CONFIG.project_schoolFees,"mainId":id,"typeFileId":"","active":1})
  280. }
  281. });
  282. }
  283. $(function () {
  284. var defaultColunms = ChildschoolFees.initColumn();
  285. var table = new BSTable(ChildschoolFees.id, "/api/childschoolFees/list", defaultColunms);
  286. table.setPaginationType("server");
  287. table.setOnDblClickRow(function () {
  288. ChildschoolFees.openChildschoolFeesDetail();
  289. });
  290. ChildschoolFees.table = table.init();
  291. //批量加载字典表数据
  292. var arr = [
  293. {"name":"talentArrange","code":"un_talentLevel"},
  294. {"name":"cRelation","code":"un_education_relation"},
  295. {"name":"nowGrade","code":"un_grade"},
  296. {"name":"pCardType","code":"un_cardType"},
  297. {"name":"cCardType","code":"un_cardType"}];
  298. Feng.findChildDictBatch(JSON.stringify(arr));
  299. });