houserRentingPurchaseApply.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. /**
  2. * 购房申请管理初始化
  3. */
  4. var HouserRentingPurchaseApply = {
  5. id: "HouserRentingPurchaseApplyTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. HouserRentingPurchaseApply.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: 'pensionDetail', visible: true, align: 'center', valign: 'middle'},
  58. // {title: '失业保险缴纳月份', field: 'unemploymentDetail', visible: true, align: 'center', valign: 'middle'},
  59. // {title: '医疗保险缴纳月份', field: 'medicaDetail', visible: true, align: 'center', valign: 'middle'},
  60. // {title: '个税缴纳月份', field: 'taxDetail', visible: true, align: 'center', valign: 'middle'},
  61. {title: '拟申请购买房产地址', field: 'applyAddress', visible: true, align: 'center', valign: 'middle',width:"150px",'class': 'uitd_showTip'},
  62. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle',width:"100px",'class': 'uitd_showTip',width:"100px",
  63. formatter : function (value,row,index) {
  64. if(value==1){
  65. return "<span class='label'>待提交</span>"
  66. }else if(value==10){
  67. return "<span class='label label-danger'>已驳回</span>"
  68. }else if(value==-1){
  69. return "<span class='label label-danger'>审核不通过</span>"
  70. }else if(value==30){
  71. return "<span class='label label-primary'>审核通过</span>"
  72. }else{
  73. return "<span class='label label-success'>审核中</span>"
  74. }
  75. }
  76. },
  77. // {title: '申请购房详细地址', field: 'rentAddress', visible: true, align: 'center', valign: 'middle'},
  78. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px",
  79. formatter : function (value,row,index){
  80. return "<span class='label label-success' onclick=\"Feng.getCheckLogModel('"+value+"','"+CONFIG.project_renting_purchase_apply+"',null)\" >" +
  81. "<i class=\"fa fa-book\"></i>日志" +
  82. "</span>";
  83. }
  84. }
  85. ];
  86. };
  87. /**
  88. * 检查是否选中
  89. */
  90. HouserRentingPurchaseApply.check = function () {
  91. var selected = $('#' + this.id).bootstrapTable('getSelections');
  92. if(selected.length == 0){
  93. Feng.info("请先选中表格中的某一记录!");
  94. return false;
  95. }else{
  96. HouserRentingPurchaseApply.seItem = selected[0];
  97. return true;
  98. }
  99. };
  100. /**
  101. * 点击添加购房申请
  102. */
  103. HouserRentingPurchaseApply.openAddHouserRentingPurchaseApply = function () {
  104. var index = layer.open({
  105. type: 2,
  106. title: '添加购房申请',
  107. area: ['800px', '420px'], //宽高
  108. fix: false, //不固定
  109. maxmin: true,
  110. content: Feng.ctxPath + '/api/houserRentingPurchaseApply/houserRentingPurchaseApply_add',
  111. 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;取消'],
  112. btnAlign: 'c',
  113. btn1: function (index, layero) {
  114. var obj = layero.find("iframe")[0].contentWindow;
  115. obj.HouserRentingPurchaseApplyInfoDlg.addSubmit();
  116. },btn2: function(index, layero){
  117. var obj = layero.find("iframe")[0].contentWindow;
  118. obj.HouserRentingPurchaseApplyInfoDlg.editSubmit(2);
  119. return false;
  120. },
  121. success :function (layero, index) {
  122. layer.tips('添加基本信息并上传附件后点击','.layui-layer-btn1',{tips:[1,"#78BA32"],time:0,closeBtn :2});
  123. },
  124. end :function () {
  125. layer.closeAll('tips');
  126. HouserRentingPurchaseApply.table.refresh();
  127. }
  128. });
  129. HouserRentingPurchaseApply.layerIndex = index;
  130. layer.full(index);
  131. };
  132. /**
  133. * 打开查看购房申请详情
  134. */
  135. HouserRentingPurchaseApply.openHouserRentingPurchaseApplyDetail = function () {
  136. if (this.check()) {
  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/houserRentingPurchaseApply/houserRentingPurchaseApply_update/' + HouserRentingPurchaseApply.seItem.id+"/1",
  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.HouserRentingPurchaseApplyInfoDlg.editSubmit(1);
  149. },btn2: function(index, layero){
  150. var obj = layero.find("iframe")[0].contentWindow;
  151. obj.HouserRentingPurchaseApplyInfoDlg.editSubmit(2);
  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. HouserRentingPurchaseApply.table.refresh();
  160. }
  161. });
  162. HouserRentingPurchaseApply.layerIndex = index;
  163. layer.full(index);
  164. }
  165. };
  166. HouserRentingPurchaseApply.openHouserRentingPurchaseApplySelect = function(){
  167. if (this.check()) {
  168. var index = layer.open({
  169. type: 2,
  170. title: '购房申请详情',
  171. area: ['800px', '420px'], //宽高
  172. fix: false, //不固定
  173. maxmin: true,
  174. content: Feng.ctxPath + '/api/houserRentingPurchaseApply/houserRentingPurchaseApply_update/' + HouserRentingPurchaseApply.seItem.id+"/2",
  175. });
  176. HouserRentingPurchaseApply.layerIndex = index;
  177. layer.full(index);
  178. }
  179. }
  180. /**
  181. * 删除购房申请
  182. */
  183. HouserRentingPurchaseApply.delete = function () {
  184. if (this.check()) {
  185. var operation = function() {
  186. var ajax = new $ax(Feng.ctxPath + "/api/houserRentingPurchaseApply/delete", function (data) {
  187. if (data.code == 200){
  188. Feng.success(data.msg);
  189. HouserRentingPurchaseApply.table.refresh();
  190. }else{
  191. Feng.info(data.msg);
  192. }
  193. }, function (data) {
  194. Feng.error("删除失败!" + data.responseJSON.message + "!");
  195. });
  196. ajax.set("houserRentingPurchaseApplyId", HouserRentingPurchaseApply.seItem.id);
  197. ajax.start();
  198. }
  199. Feng.confirm("删除后无法恢复,确认删除吗?", operation);
  200. }
  201. };
  202. /**
  203. * 查询表单提交参数对象
  204. * @returns {{}}
  205. */
  206. HouserRentingPurchaseApply.formParams = function() {
  207. var queryData = {};
  208. queryData['name'] = $("#name").val();
  209. queryData['sex'] = $("#sex").val();
  210. queryData['cardType'] = $("#cardType").val();
  211. queryData['idCard'] = $("#idCard").val();
  212. queryData['talentArrange'] = $("#talentArrange").val();
  213. queryData['marryStatus'] = $("#marryStatus").val();
  214. queryData['spouseName'] = $("#spouseName").val();
  215. queryData['spouseSex'] = $("#spouseSex").val();
  216. queryData['spouseCardType'] = $("#spouseCardType").val();
  217. queryData['spouseIdcard'] = $("#spouseIdcard").val();
  218. queryData['spouseTalentArrange'] = $("#spouseTalentArrange").val();
  219. queryData['houseType'] = $("#houseType").val();
  220. queryData['checkState'] = $("#checkState").val();
  221. return queryData;
  222. }
  223. /**
  224. * 查询购房补贴列表
  225. */
  226. HouserRentingPurchaseApply.search = function () {
  227. HouserRentingPurchaseApply.table.refresh({query: HouserRentingPurchaseApply.formParams()});
  228. };
  229. /**
  230. * 重置
  231. */
  232. HouserRentingPurchaseApply.reset = function(){
  233. $("#name").val("");
  234. $("#sex").val("");
  235. $("#cardType").val("");
  236. $("#idCard").val("");
  237. $("#talentArrange").val("");
  238. $("#marryStatus").val("");
  239. $("#spouseName").val("");
  240. $("#spouseSex").val("");
  241. $("#spouseCardType").val("");
  242. $("#spouseIdcard").val("");
  243. $("#spouseTalentArrange").val("");
  244. $("#houseType").val("");
  245. $("#checkState").val("");
  246. }
  247. $(function () {
  248. var defaultColunms = HouserRentingPurchaseApply.initColumn();
  249. var table = new BSTable(HouserRentingPurchaseApply.id, "/api/houserRentingPurchaseApply/list", defaultColunms);
  250. table.setPaginationType("server");
  251. HouserRentingPurchaseApply.table = table.init();
  252. //批量加载字典表数据
  253. var arr = [
  254. {"name":"marryStatus","code":"un_marryStatus"},
  255. {"name":"talentArrange","code":"un_talentLevel"},
  256. {"name":"cardType","code":"un_cardType"},
  257. {"name":"spouseCardType","code":"un_cardType"},
  258. {"name":"spouseTalentArrange","code":"un_talentLevel"},
  259. {"name":"houseType","code":"un_renting_houseType"},
  260. {"name":"childCardType","code":"un_cardType"}];
  261. Feng.findChildDictBatch(JSON.stringify(arr));
  262. });