houseRentingPurchaseFees.js 12 KB

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