houseRentingFees.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /**
  2. * 房租补助管理初始化
  3. */
  4. var HouseRentingFees = {
  5. id: "HouseRentingFeesTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. HouseRentingFees.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip',
  17. formatter : function (value,row,index) {
  18. if(row.sex==1){
  19. return value+'<span style="color:#6495ED">【男】</span>';
  20. }if(row.sex==2){
  21. return value+'<span style="color:#FF82AB">【女】</span>';
  22. }
  23. }
  24. },
  25. {title: '证件类型', field: 'cardTypeName', visible: true, align: 'center', valign: 'middle',width:"80px",'class': 'uitd_showTip'},
  26. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  27. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  28. {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  29. {title: '婚姻状态', field: 'marryStatusName', visible: true, align: 'center', valign: 'middle',width:"80px",'class': 'uitd_showTip'},
  30. {title: '配偶姓名', field: 'spouseName', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip',
  31. formatter : function (value,row,index) {
  32. if(row.spouseSex==1){
  33. return value+'<span style="color:#6495ED">【男】</span>';
  34. }if(row.spouseSex==2){
  35. return value+'<span style="color:#FF82AB">【女】</span>';
  36. }
  37. }
  38. },
  39. {title: '配偶证件类型', field: 'spouseCardTypeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  40. {title: '配偶证件号码', field: 'spouseIdCard', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  41. {title: '配偶人才层次', field: 'spouseTalentArrangeName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  42. {title: '拟申请租住人才社区', field: 'houseTypeName', visible: true, align: 'center', valign: 'middle',width:"130px",'class': 'uitd_showTip'},
  43. {title: '承租开始日期', field: 'rentStartTime', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  44. {title: '承租截止时间', field: 'rentEndTime', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  45. {title: '承租详细地址', field: 'rentAddress', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  46. {title: '承租金额', field: 'rentMoney', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip'},
  47. {title: '开户银行网点', field: 'bankAddress', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  48. {title: '银行账号', field: 'bankAccount', visible: true, align: 'center', valign: 'middle',width:"120px",'class': 'uitd_showTip'},
  49. {title: '审核状态', field: 'checkStateName', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip',width:"100px",},
  50. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px",
  51. formatter : function (value,row,index){
  52. return "<span class='label label-success' onclick=\"Feng.getCheckLogModel('"+value+"','"+CONFIG.project_rentingFees+"',null)\" >" +
  53. "<i class=\"fa fa-book\"></i>日志" +
  54. "</span>";
  55. }
  56. }
  57. ];
  58. };
  59. /**
  60. * 检查是否选中
  61. */
  62. HouseRentingFees.check = function () {
  63. var selected = $('#' + this.id).bootstrapTable('getSelections');
  64. if(selected.length == 0){
  65. Feng.info("请先选中表格中的某一记录!");
  66. return false;
  67. }else{
  68. HouseRentingFees.seItem = selected[0];
  69. return true;
  70. }
  71. };
  72. /**
  73. * 点击添加房租补助
  74. */
  75. HouseRentingFees.openAddHouseRentingFees = function () {
  76. var index = layer.open({
  77. type: 2,
  78. title: '添加租房申请',
  79. area: ['800px', '420px'], //宽高
  80. fix: false, //不固定
  81. maxmin: true,
  82. content: Feng.ctxPath + '/api/houseRentingFees/houseRentingFees_add',
  83. 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;取消'],
  84. btnAlign: 'c',
  85. btn1: function (index, layero) {
  86. var obj = layero.find("iframe")[0].contentWindow;
  87. obj.HouseRentingFeesInfoDlg.addSubmit();
  88. },btn2: function(index, layero){
  89. var obj = layero.find("iframe")[0].contentWindow;
  90. obj.HouseRentingFeesInfoDlg.editSubmit(2);
  91. return false;
  92. },
  93. success :function (layero, index) {
  94. layer.tips('添加基本信息并上传附件后点击','.layui-layer-btn1',{tips:[1,"#78BA32"],time:0,closeBtn :2});
  95. },
  96. end :function () {
  97. layer.closeAll('tips');
  98. HouseRentingFees.table.refresh();
  99. }
  100. });
  101. HouseRentingFees.layerIndex = index;
  102. layer.full(index);
  103. };
  104. /**
  105. * 打开查看房租补助详情
  106. */
  107. HouseRentingFees.openHouseRentingFeesDetail = function () {
  108. if (this.check()) {
  109. var index = layer.open({
  110. type: 2,
  111. title: '房租补助详情',
  112. area: ['800px', '420px'], //宽高
  113. fix: false, //不固定
  114. maxmin: true,
  115. content: Feng.ctxPath + '/api/houseRentingFees/houseRentingFees_update/' + HouseRentingFees.seItem.id+"/1",
  116. 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;取消'],
  117. btnAlign: 'c',
  118. btn1: function (index, layero) {
  119. var obj = layero.find("iframe")[0].contentWindow;
  120. obj.HouseRentingFeesInfoDlg.addSubmit();
  121. },btn2: function(index, layero){
  122. var obj = layero.find("iframe")[0].contentWindow;
  123. obj.HouseRentingFeesInfoDlg.editSubmit(2);
  124. return false;
  125. },
  126. success :function (layero, index) {
  127. layer.tips('添加基本信息并上传附件后点击','.layui-layer-btn1',{tips:[1,"#78BA32"],time:0,closeBtn :2});
  128. },
  129. end :function () {
  130. layer.closeAll('tips');
  131. HouseRentingFees.table.refresh();
  132. }
  133. });
  134. HouseRentingFees.layerIndex = index;
  135. layer.full(index);
  136. }
  137. };
  138. HouseRentingFees.openHouseRentingFeesSelect = function(){
  139. if (this.check()) {
  140. var index = layer.open({
  141. type: 2,
  142. title: '房租补助详情',
  143. area: ['800px', '420px'], //宽高
  144. fix: false, //不固定
  145. maxmin: true,
  146. content: Feng.ctxPath + '/api/houseRentingFees/houseRentingFees_update/' + HouseRentingFees.seItem.id+"/2",
  147. });
  148. HouseRentingFees.layerIndex = index;
  149. layer.full(index);
  150. }
  151. }
  152. /**
  153. * 删除房租补助
  154. */
  155. HouseRentingFees.delete = function () {
  156. if (this.check()) {
  157. var operation = function() {
  158. var ajax = new $ax(Feng.ctxPath + "/api/houseRentingFees/delete", function (data) {
  159. if (data.code == 200){
  160. Feng.success(data.msg);
  161. HouseRentingFees.table.refresh();
  162. }else{
  163. Feng.info(data.msg);
  164. }
  165. }, function (data) {
  166. Feng.error("删除失败!" + data.responseJSON.message + "!");
  167. });
  168. ajax.set("houseRentingFeesId", HouseRentingFees.seItem.id);
  169. ajax.start();
  170. }
  171. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  172. }
  173. };
  174. /**
  175. * 查询表单提交参数对象
  176. * @returns {{}}
  177. */
  178. HouseRentingFees.formParams = function() {
  179. var queryData = {};
  180. queryData['name'] = $("#name").val();
  181. queryData['sex'] = $("#sex").val();
  182. queryData['cardType'] = $("#cardType").val();
  183. queryData['idCard'] = $("#idCard").val();
  184. queryData['talentArrange'] = $("#talentArrange").val();
  185. queryData['marryStatus'] = $("#marryStatus").val();
  186. queryData['spouseName'] = $("#spouseName").val();
  187. queryData['spouseSex'] = $("#spouseSex").val();
  188. queryData['spouseCardType'] = $("#spouseCardType").val();
  189. queryData['spouseIdcard'] = $("#spouseIdcard").val();
  190. queryData['spouseTalentArrange'] = $("#spouseTalentArrange").val();
  191. queryData['houseType'] = $("#houseType").val();
  192. queryData['checkState'] = $("#checkState").val();
  193. return queryData;
  194. }
  195. /**
  196. * 查询购房补贴列表
  197. */
  198. HouseRentingFees.search = function () {
  199. HouseRentingFees.table.refresh({query: HouseRentingFees.formParams()});
  200. };
  201. /**
  202. * 重置
  203. */
  204. HouseRentingFees.reset = function(){
  205. $("#name").val("");
  206. $("#sex").val("");
  207. $("#cardType").val("");
  208. $("#idCard").val("");
  209. $("#talentArrange").val("");
  210. $("#marryStatus").val("");
  211. $("#spouseName").val("");
  212. $("#spouseSex").val("");
  213. $("#spouseCardType").val("");
  214. $("#spouseIdcard").val("");
  215. $("#spouseTalentArrange").val("");
  216. $("#houseType").val("");
  217. $("#checkState").val("");
  218. }
  219. $(function () {
  220. var defaultColunms = HouseRentingFees.initColumn();
  221. var table = new BSTable(HouseRentingFees.id, "/api/houseRentingFees/list", defaultColunms);
  222. table.setPaginationType("server");
  223. HouseRentingFees.table = table.init();
  224. //批量加载字典表数据
  225. var arr = [
  226. {"name":"marryStatus","code":"un_marryStatus"},
  227. {"name":"talentArrange","code":"un_talentLevel"},
  228. {"name":"cardType","code":"un_cardType"},
  229. {"name":"spouseCardType","code":"un_cardType"},
  230. {"name":"spouseTalentArrange","code":"un_talentLevel"},
  231. {"name":"houseType","code":"un_renting_houseType"},
  232. {"name":"childCardType","code":"un_cardType"}];
  233. Feng.findChildDictBatch(JSON.stringify(arr));
  234. });