housepurchase.js 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
  1. /**
  2. * 购房补贴管理初始化
  3. */
  4. var Housepurchase = {
  5. id: "housepurchaseTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. Housepurchase.formParams = function() {
  11. var queryData = {};
  12. queryData['companyName'] = $("#companyName").val();
  13. queryData['year'] = $("#year").val();
  14. queryData['name'] = $("#name").val();
  15. queryData['idCard'] = $("#idCard").val();
  16. queryData['talentArrange'] = $("#talentArrange").val();
  17. queryData['spouseName'] = $("#spouseName").val();
  18. queryData['spouseIdcard'] = $("#spouseIdcard").val();
  19. queryData['childName'] = $("#childName").val();
  20. queryData['childIdCard'] = $("#childIdCard").val();
  21. queryData['marryStatus'] = $("#marryStatus").val();
  22. queryData['checkState'] = $("#checkState").val();
  23. queryData['isConflict'] = $("isConflict").val();
  24. queryData['isRecover'] = $("isRecover").val()
  25. return queryData;
  26. }
  27. /**
  28. * 查询购房补贴列表
  29. */
  30. Housepurchase.search = function () {
  31. Housepurchase.table.refresh({query: Housepurchase.formParams()});
  32. };
  33. /**
  34. * 重置
  35. */
  36. Housepurchase.reset = function(){
  37. $("#companyName").val("");
  38. $("#year").val("");
  39. $("#name").val("");
  40. $("#idCard").val("");
  41. $("#talentArrange").val("");
  42. $("#spouseName").val("");
  43. $("#spouseIdcard").val("");
  44. $("#childName").val("");
  45. $("#childIdCard").val("");
  46. $("#marryStatus").val("");
  47. $("#checkState").val("");
  48. $("isConflict").val("");
  49. $("isRecover").val("");
  50. }
  51. /**
  52. * 初始化表格的列
  53. */
  54. Housepurchase.initColumn = function () {
  55. var process = $("#process").val();
  56. var type = $("#type").val();
  57. return [
  58. {field: 'selectItem', radio: true},
  59. {title: '审核单位', field: 'companyName', visible: process == 2, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"130px"},
  60. {title: '申报年度', field: 'year', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
  61. {title: '申报企业', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
  62. {title: '申报类型', field: 'declareType', visible: type==1, align: 'center', valign: 'middle',width:"80px",
  63. formatter(value,row,index){
  64. if(value==1){
  65. return "购房补贴";
  66. }else if(value==2){
  67. return "免租入住";
  68. }
  69. }
  70. },
  71. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
  72. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"150px"},
  73. {title: '人才标签', field: 'talentTypeName', visible: type==1, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  74. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
  75. {title: '认定条件', field: 'identifyConditionCH', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
  76. {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"120px"},
  77. {title: '婚姻状态', field: 'marryStatusName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  78. {title: '配偶姓名', field: 'spouseName', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px"},
  79. // {title: '配偶证件类型', field: 'spouseCardTypeName', visible: true, align: 'center', valign: 'middle'},
  80. {title: '配偶证件号码', field: 'spouseIdcard', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"150px"},
  81. {title: '享受第几次购房补贴', field: 'number', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"140px"},
  82. // {title: '房产编号', field: 'houseCode', visible: process != 2, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  83. {title: '房屋坐落地址', field: 'houseAddress', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  84. {title: '房屋建筑面积', field: 'houseArea', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  85. // {title: '商品房购房合同备案时间', field: 'recordTime', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"150px"},
  86. {title: '房屋成交金额', field: 'houseMoney', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  87. {title: '兑现状态', field: "cashType", visible: process ==4, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px",
  88. formatter : function (value,row,index){
  89. if(Feng.isEmptyStr(value))return "<span style='color: black'>未判定</span>";
  90. if(value==1)return "<span style='color: green'>兑现</span>";
  91. if(value==2)return "<span style='color: red'>不予兑现</span>";
  92. }
  93. },
  94. // {title: '兑现对象', field: 'cashIdCards', visible: process ==4 , align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px"},
  95. {title: '计算结果', field: 'realEnjoyMoney', visible: process ==4 , align: 'center', valign: 'middle','class': 'uitd_showTip',width:"100px",
  96. formatter : function (value,row,index){
  97. if (row.cashType == 1 && row.declareType == 1){
  98. var html = "1.可享受总金额(首套房产金额):"+ (parseFloat(row.totalMoney)/10000).toFixed(2)+
  99. "万元</br>2.个人余额(未扣除本次):"+(parseFloat(row.balanceMoney)/10000).toFixed(2)+
  100. "万元</br>3.房产余额(未扣除本次):"+(parseFloat(row.houseBalanceMoney)/10000).toFixed(2)+
  101. "万元</br>4.上一年度未扣除其他政策金额:"+(parseFloat(row.lastOtherMoney)/10000).toFixed(2) +
  102. "万元</br>5.本年度新增享受其他政策金额:"+(parseFloat(row.nowOtherMoney)/10000).toFixed(2)+
  103. "万元</br>6.本年度人才层次可享受金额:"+(parseFloat(row.talentArrangeMoney)/10000).toFixed(2)+
  104. "万元</br>7.本年度应享受金额(2,3,6比较得到):"+(parseFloat(row.shouldEnjoyMoney)/10000).toFixed(2)+
  105. "万元</br>8.本年度扣除享受其他政策金额:"+(parseFloat(row.nowSubOtherMoney)/10000).toFixed(2)+
  106. "万元</br>9.本年度未扣除享受其他政策金额:"+(parseFloat(row.nowNotSubOtherMoney)/10000).toFixed(2)+
  107. "万元</br>10.本年度最终可到账金额:"+(parseFloat(row.realEnjoyMoney)/10000).toFixed(2)+
  108. "万元</br>11.社保缴纳情况:"+ row.sbPayDetail +
  109. "</br>12.个税缴纳情况:"+ row.taxPayDetail +
  110. "</br>13.判定说明:"+ row.decideDetail;
  111. return "<span class='label label-success' onclick=\"layer.alert('"+html+"', {title:'计算结果', skin: 'layui-layer-molv',closeBtn: 0,area: ['500px', '500px']})\" >" +
  112. "<i class=\"fa fa-book\"></i>查看" +
  113. "</span>";
  114. }else{
  115. return "无";
  116. }
  117. }
  118. },
  119. {title: '审核状态', field: process == 2?'state':'checkState', visible: true, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px",
  120. formatter : function (value,row,index){
  121. if(process == 1 ){
  122. if(value==-1){
  123. return "<span class='label label-danger'>审核不通过</span>";
  124. }if(value==1){
  125. return "<span class='label'>待提交</span>"
  126. }if(value==5){
  127. return (Feng.isNotEmptyStr(row.highProcess) && row.highProcess>=1)?"<span class='label label-success'>重新提交</span>":"<span class='label label-success'>待审核</span>";
  128. }if(value==10){
  129. return "<span class='label label-danger'>已驳回</span>"
  130. }if(value==15 || value == 25){
  131. return "<span class='label label-success'>上级驳回</span>"
  132. }
  133. if(value == 20 ||value>=30){
  134. return "<span class='label label-primary'>已通过</span>"
  135. }
  136. }else if(process == 2){
  137. if(value == 1){
  138. return "<span class='label label-success'>待审核</span>"
  139. }if(value == 2){
  140. return "<span class='label label-danger'>已驳回</span>"
  141. }if(value == 3){
  142. return "<span class='label label-primary'>已通过</span>"
  143. }if(value == 4){
  144. return "<span class='label label-warning'>上级驳回</span>"
  145. }if(value == 9){
  146. return "<span class='label label-success'>重新提交</span>"
  147. }
  148. }else if(process == 3){
  149. if(value<=30){
  150. return "<span class='label label-danger'>已驳回</span>"
  151. }else if(value == 35){
  152. return (Feng.isNotEmptyStr(row.highProcess) && row.highProcess>=3)?"<span class='label label-success'>重新提交</span>":"<span class='label label-success'>待审核</span>";
  153. }else if(value == 40){
  154. return "<span class='label label-primary'>已通过</span>";
  155. }
  156. }else if(process == 4){
  157. if(value==-1){
  158. return "<span class='label label-danger'>审核不通过</span>";
  159. }else if(value == 40){
  160. return "<span class='label label-primary'>已通过</span>";
  161. }
  162. }
  163. }
  164. },
  165. {title: '公示状态', field: "publicState", visible: process == 4, align: 'center', valign: 'middle','class': 'uitd_showTip',width:"80px",
  166. formatter : function (value,row,index){
  167. if(value==1)return "<span class='label label-warning'>待公示</span>";
  168. if(value==2)return "<span class='label label-success'>公示中</span>";
  169. if(value==3)return "<span class='label label-info'>待兑现</span>";
  170. if(value==4)return "<span class='label label-primary'>已兑现</span>";
  171. }
  172. },
  173. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle',width:"80px",
  174. formatter : function (value,row,index){
  175. return "<span class='label label-success' onclick=\"Feng.getCheckLogModel('"+value+"','"+CONFIG.project_house+"',null)\" >" +
  176. "<i class=\"fa fa-book\"></i>日志" +
  177. "</span>";
  178. }
  179. }
  180. ];
  181. };
  182. /**
  183. * 检查是否选中
  184. */
  185. Housepurchase.check = function () {
  186. var selected = $('#' + this.id).bootstrapTable('getSelections');
  187. if(selected.length == 0){
  188. Feng.info("请先选中表格中的某一记录!");
  189. return false;
  190. }else{
  191. Housepurchase.seItem = selected[0];
  192. return true;
  193. }
  194. };
  195. /**
  196. * 修改驳回字段
  197. */
  198. Housepurchase.updateFieldsAndFiles = function(){
  199. if (this.check()) {
  200. var ajax = new $ax(Feng.ctxPath + "/housepurchase/findFieldsAndFiles?id="+Housepurchase.seItem.id, function (data) {
  201. var obj = data.obj.obj;
  202. if(data.code==200){
  203. layer.open({
  204. type: 1,
  205. id: "neewFieldFormModel",
  206. title: '修改',
  207. area: ['800px', '450px'], //宽高
  208. fix: false, //不固定
  209. shade: 0,
  210. maxmin: true,
  211. content: Housepurchase.creatFieldCheckModal(data.obj.obj),
  212. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  213. btnAlign: 'c',
  214. zIndex: layer.zIndex,
  215. success: function (layero, index) {
  216. var fileList = data.obj.fileList;
  217. var html = '';
  218. for(var key in fileList){
  219. html = html + '<ul><li style="width: 100%"><input type="checkbox" value="'+fileList[key].id+'"><span>'+fileList[key].name+'</span></li></ul>';
  220. }
  221. $("#field_file").empty().append(html);
  222. if(obj.fields!=null && obj.fields!=''){
  223. $("#field_info input").each(function () {
  224. var arr = obj.fields.split(",");
  225. for(var key in arr){
  226. if($(this).val()==arr[key]){
  227. this.checked = true;
  228. }
  229. }
  230. });
  231. }
  232. if(obj.files!=null && obj.files!=''){
  233. $("#field_file input").each(function () {
  234. if(obj.files.indexOf($(this).val())!=-1){
  235. this.checked=true;
  236. }
  237. });
  238. }
  239. },
  240. yes: function (index, layero) {
  241. var fields = '';
  242. var files = '';
  243. $("#field_info li input").each(function(index){
  244. if($(this).is(":checked")){
  245. fields = fields + $(this).val() + ",";
  246. }
  247. });
  248. $("#field_file li input").each(function(index){
  249. if($(this).is(":checked")){
  250. files = files + $(this).val() + ",";
  251. }
  252. });
  253. if( Feng.isEmptyStr(fields) && Feng.isEmptyStr(files)){
  254. Feng.info("请选择可修改的字段或附件!");
  255. return ;
  256. }
  257. var ajax = new $ax(Feng.ctxPath + "/housepurchase/updateFieldsAndFiles", function (data) {
  258. if(data.code==200){
  259. layer.close(index);
  260. Feng.success(data.msg);
  261. }else{
  262. Feng.error(data.msg);
  263. }
  264. }, function (data) {
  265. Feng.error("修改失败!" + data.responseJSON.message + "!");
  266. });
  267. ajax.setData({"id":Housepurchase.seItem.id,"fields":fields,"files":files})
  268. ajax.start();
  269. }
  270. });
  271. }else{
  272. Feng.error(data.msg);
  273. }
  274. }, function (data) {
  275. Feng.error("查询失败!" + data.responseJSON.message + "!");
  276. });
  277. ajax.start();
  278. }
  279. }
  280. Housepurchase.creatFieldCheckModal = function (obj) {
  281. var field =
  282. '<li style="width:10%"><input type="checkbox" value="phone"/><span>手机号码</span></li>\n' +
  283. '<li style="width:10%"><input type="checkbox" value="marryStatus"/><span>婚姻状态</span></li>\n' +
  284. '<li style="width:10%"><input type="checkbox" value="spouseName"/><span>配偶姓名</span></li>\n' +
  285. '<li style="width:20.5%"><input type="checkbox" value="spouseCardType"/><span>配偶证件类型</span></li>\n' +
  286. '<li style="width:20.5%"><input type="checkbox" value="spouseIdcard"/><span>配偶证件号码</span></li>\n' ;
  287. if(obj.declareType == 1 ){
  288. field = field +
  289. '<li style="width:20.5%"><input type="checkbox" value="realEstateNo"/><span>不动产权证编号</span></li>\n' +
  290. '<li style="width:20.5%"><input type="checkbox" value="recordNo"/><span>备案合同编号</span></li>\n' +
  291. '<li style="width:20.5%"><input type="checkbox" value="houseAddress"/><span>房屋坐落地址</span></li>\n' +
  292. '<li style="width:20.5%"><input type="checkbox" value="houseArea"/><span>房屋建筑面积</span></li>\n' +
  293. '<li style="width:63%"><input type="checkbox" value="recordTime"/><span>商品房购房合同备案时间/不动产权证书办理时间</span></li>\n' +
  294. '<li style="width:20.5%"><input type="checkbox" value="houseMoney"/><span>房屋成交金额</span></li>\n' +
  295. '<li style="width:20.5%"><input type="checkbox" value="isEnjoyOther"/><span>是否享受我市其他政策</span></li>\n' ;
  296. }
  297. return '<form id="firstCheckForm">\n' +
  298. ' <div class="form-group" style="margin: 10px;">\n' +
  299. ' <div id="field">\n' +
  300. ' <label for="checkMsg" class="control-label">可修改字段</label>\n' +
  301. ' <div id="field_info">\n' +
  302. ' <ul>\n' + field+
  303. ' </ul>\n' +
  304. ' </div>\n' +
  305. ' <label for="checkMsg" class="control-label">可修改附件</label>\n' +
  306. ' <div id="field_file">\n' +
  307. ' </div>\n' +
  308. ' <div class="form-group" style="text-align: center">\n' +
  309. ' <button type="button" class="btn btn-primary" onclick="Feng.checkAll("field")">全选</button>\n' +
  310. ' <button type="button" class="btn btn-success" onclick="Feng.unCheckAll("field")">反选</button>\n' +
  311. ' </div>\n' +
  312. ' </div>\n' +
  313. ' </div>\n' +
  314. ' </form>';
  315. }
  316. /**
  317. * 点击添加购房补贴
  318. */
  319. Housepurchase.openCheckHousepurchase = function () {
  320. if (this.check()) {
  321. var companyId = Feng.isEmptyStr(Housepurchase.seItem.companyId)?null:Housepurchase.seItem.companyId;
  322. var process = $("#process").val();
  323. var index = layer.open({
  324. type: 2,
  325. title: '购房补贴审核',
  326. area: ['800px', '420px'], //宽高
  327. fix: false, //不固定
  328. maxmin: true,
  329. content: Feng.ctxPath + '/housepurchase/toCheckPage/' + Housepurchase.seItem.id + '/'+$("#process").val()+"/"+companyId+"/1",
  330. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交','<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交审核' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  331. btnAlign: 'c',
  332. btn1: function (index, layero) {
  333. var obj = layero.find("iframe")[0].contentWindow;
  334. if(process == 1){
  335. obj.HousepurchaseInfoDlg.showFirstCheckModal();
  336. }
  337. if(process == 2){
  338. // obj.HousepurchaseInfoDlg.showDepCheckModal();
  339. obj.HousepurchaseInfoDlg.saveDepCheckData();
  340. }
  341. if(process == 3){
  342. obj.HousepurchaseInfoDlg.showThirdCheckModal();
  343. }
  344. if(process == 4){
  345. obj.HousepurchaseInfoDlg.afterCheckEdit();
  346. }
  347. },btn2: function(index, layero){
  348. var obj = layero.find("iframe")[0].contentWindow;
  349. if(process == 4){
  350. obj.HousepurchaseInfoDlg.showAfterCheckModal();
  351. }else{
  352. obj.HousepurchaseInfoDlg.submitCheck();
  353. }
  354. return false;
  355. },end:function () {
  356. Housepurchase.table.refresh();
  357. }
  358. });
  359. layer.full(index);
  360. Housepurchase.layerIndex = index;
  361. }
  362. };
  363. Housepurchase.openHousepurchaseDetail = function(){
  364. if (this.check()) {
  365. var companyId = Feng.isEmptyStr(Housepurchase.seItem.companyId)?null:Housepurchase.seItem.companyId;
  366. var process = $("#process").val();
  367. var index = layer.open({
  368. type: 2,
  369. title: '购房补贴查看',
  370. area: ['800px', '420px'], //宽高
  371. fix: false, //不固定
  372. maxmin: true,
  373. content: Feng.ctxPath + '/housepurchase/toCheckPage/' + Housepurchase.seItem.id + '/'+$("#process").val()+"/"+companyId+"/2",
  374. });
  375. layer.full(index);
  376. Housepurchase.layerIndex = index;
  377. }
  378. }
  379. /**
  380. * 点击添加购房补贴
  381. */
  382. Housepurchase.openAfterCheckHousepurchase = function () {
  383. if (this.check()) {
  384. var companyId = Feng.isEmptyStr(Housepurchase.seItem.companyId)?null:Housepurchase.seItem.companyId;
  385. var index = layer.open({
  386. type: 2,
  387. title: '购房补贴审核',
  388. area: ['800px', '420px'], //宽高
  389. fix: false, //不固定
  390. maxmin: true,
  391. content: Feng.ctxPath + '/housepurchase/toCheckPage/' + Housepurchase.seItem.id + '/'+$("#process").val()+"/"+companyId,
  392. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;审核' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  393. btnAlign: 'c',
  394. btn1: function (index, layero) {
  395. var obj = layero.find("iframe")[0].contentWindow;
  396. obj.HousepurchaseInfoDlg.showAfterCheckModal();
  397. },end:function () {
  398. Housepurchase.table.refresh();
  399. }
  400. });
  401. layer.full(index);
  402. Housepurchase.layerIndex = index;
  403. }
  404. };
  405. /**
  406. * 撤销复核
  407. */
  408. Housepurchase.cancleReview = function(){
  409. if (this.check()) {
  410. var index = layer.open({
  411. type: 1,
  412. title: '撤销复核',
  413. area: ['800px', '420px'], //宽高
  414. fix: false, //不固定
  415. maxmin: true,
  416. content: '<form >\n' +
  417. ' <div class="form-group" style="margin: 10px;">\n' +
  418. ' <label for="checkMsg" class="control-label">撤销原因</label>\n' +
  419. ' <textarea class="form-control" id="msg" rows="6"></textarea>\n' +
  420. ' </div>\n' +
  421. ' </form>',
  422. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  423. yes: function (index, layero) {
  424. var cancleMsg = $("#msg").val();
  425. if(Feng.isEmptyStr(cancleMsg)){
  426. Feng.error("撤销原因不能为空");return ;
  427. }
  428. var operation = function(){
  429. var ajax = new $ax(Feng.ctxPath + "/housepurchase/cancleThirdCheck", function (data) {
  430. if(data.code==200){
  431. Feng.success(data.msg);
  432. Housepurchase.table.refresh();
  433. layer.close(index);
  434. }else{
  435. Feng.error(data.msg);
  436. }
  437. }, function (data) {
  438. Feng.error("撤销复核失败!" + data.responseJSON.message + "!");
  439. });
  440. ajax.setData({"id":Housepurchase.seItem.id,"checkMsg":cancleMsg})
  441. ajax.start();
  442. };
  443. Feng.confirm("一旦提交无法修改,确定要撤销吗?", operation);
  444. }
  445. });
  446. }
  447. }
  448. /**
  449. * 显示需要审核的数据(公示/公式通过/兑现)
  450. * @param type
  451. */
  452. Housepurchase.showDataCheckModal = function(type){
  453. $("#hczxForm").css("display","none");
  454. switch (type) {
  455. case 1: //待公示名单(兑现)
  456. $("#hczxButton").attr("onclick","Housepurchase.public(1)").text("公示");
  457. $("#exportCommonModalLabel").text("待公示名单(兑现)");
  458. $("#hczxForm").css("display","block");
  459. $(".time").each(function(){
  460. laydate.render({
  461. elem: "#"+$(this).attr("id")
  462. ,type: 'date'
  463. ,format:'yyyy年MM月dd日'
  464. });
  465. });
  466. break;
  467. case 2: //待公示名单(不予兑现)
  468. $("#hczxButton").attr("onclick","Housepurchase.public(2)").text("公示");
  469. $("#exportCommonModalLabel").text("待公示名单(不予兑现)");
  470. $("#hczxForm").css("display","block");
  471. $(".time").each(function(){
  472. laydate.render({
  473. elem: "#"+$(this).attr("id")
  474. ,type: 'date'
  475. ,format:'yyyy年MM月dd日'
  476. });
  477. });
  478. break;
  479. case 3: //公示通过(批量)
  480. $("#hczxButton").attr("onclick","Housepurchase.publicPass()").text("提交");
  481. $("#exportCommonModalLabel").text("公示通过名单");
  482. break;
  483. case 4: //待兑现名单
  484. $("#hczxButton").attr("onclick","Housepurchase.cash()").text("提交");
  485. $("#exportCommonModalLabel").text("待兑现名单");
  486. break;
  487. case 5: //公示预览(兑现)
  488. $("#hczxButton").attr("onclick","Housepurchase.publicExport(1)").text("导出");
  489. $("#exportCommonModalLabel").text("公示预览(兑现)");
  490. break;
  491. case 6: //待公示名单(不予兑现)
  492. $("#hczxButton").attr("onclick","Housepurchase.publicExport(2)").text("导出");
  493. $("#exportCommonModalLabel").text("公示预览(不予兑现)");
  494. break;
  495. }
  496. $('#dataTable').bootstrapTable('destroy');
  497. $('#dataTable').bootstrapTable({
  498. url: Feng.ctxPath + "/housepurchase/selectNeedCheckData?type="+type,
  499. method: 'POST',
  500. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  501. search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
  502. showRefresh: false, // 是否显示刷新按钮
  503. clickToSelect: true, // 是否启用点击选中行
  504. singleSelect: false, // 设置True 将禁止多选
  505. striped: true, // 是否显示行间隔色
  506. pagination: true, // 设置为 true 会在表格底部显示分页条
  507. paginationHAlign: "left",
  508. paginationDetailHAlign: "right",
  509. sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
  510. pageNumber:1, //初始化加载第一页,默认第一页
  511. pageSize: 10, //每页的记录行数(*)
  512. pageList: [10, 25, 50, 100,500,1000,1500], //可供选择的每页的行数(*)
  513. maintainSelected:true, //全表全选需要开启
  514. showColumns: false,
  515. responseHandler : function(res){
  516. $("#exportCommonModal").modal("show");
  517. return res.obj.rows;
  518. },
  519. columns:
  520. [
  521. {field:"selectItem",checkbox:true},
  522. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',width:"20%"},
  523. {title: '证件号码', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:"30%"},
  524. {title: '企业名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle',width:"50%"},
  525. ]
  526. });
  527. }
  528. /**
  529. * 公示预览
  530. * @param type 1-需要兑现,2-不予兑现
  531. */
  532. Housepurchase.publicExport = function(type){
  533. var selected = $('#dataTable').bootstrapTable('getSelections');
  534. if(!selected || selected.length<1){
  535. Feng.info("请至少选择一行数据!");
  536. return;
  537. }
  538. var ids = "";
  539. for(var i=0; i<selected.length; i++){
  540. ids = ids + selected[i].id + ",";
  541. }
  542. var operation = function(){
  543. $("#exportCommonModal").modal("hide");
  544. window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/housepurchase/exportPublic?ids="+ids+"&type="+type));
  545. }
  546. Feng.confirm("确定要预览吗?", operation);
  547. }
  548. /**
  549. * 公示
  550. * @param type 1-需要兑现,2-不予兑现
  551. */
  552. Housepurchase.public = function(type){
  553. var selected = $('#dataTable').bootstrapTable('getSelections');
  554. if(!selected || selected.length<1){
  555. Feng.info("请至少选择一行数据!");
  556. return;
  557. }
  558. var ids = "";
  559. for(var i=0; i<selected.length; i++){
  560. ids = ids + selected[i].id + ",";
  561. }
  562. var isMessage = $("input[name='isSend']:checked").val();
  563. var typeName = $("#typeName").val();
  564. var address = $("#web").val();
  565. var publicStartTime = $("#publicStartTime").val();
  566. var publicEndTime = $("#publicEndTime").val();
  567. var dep = $("#dep").val();
  568. var phone = $("#fyphone").val();
  569. var email = $("#fyemail").val();
  570. if(isMessage == 1){
  571. if(typeName == null || typeName == ''){
  572. Feng.info("请填写公示类型");return ;
  573. }if(address == null || address == ''){
  574. Feng.info("请填写公示平台");return ;
  575. }if(publicStartTime == null || publicStartTime == ''){
  576. Feng.info("请填写公示开始时间");return ;
  577. }if(publicEndTime == null || publicEndTime == ''){
  578. Feng.info("请填写公示截止时间");return ;
  579. }if(dep == null || dep == ''){
  580. Feng.info("请填写反映单位");return ;
  581. }if(phone == null || phone == ''){
  582. Feng.info("请填写联系电话");return ;
  583. }if(email == null || email == ''){
  584. Feng.info("请填写联系邮箱");return ;
  585. }
  586. }
  587. var operation = function(){
  588. var ajax = new $ax(Feng.ctxPath + "/housepurchase/publicBatch", function (data) {
  589. if(data.code==200){
  590. Feng.success(data.msg);
  591. Housepurchase.table.refresh();
  592. $("#exportCommonModal").modal("hide");
  593. }else{
  594. Feng.error(data.msg);
  595. }
  596. }, function (data) {
  597. Feng.error("公示失败!" + data.responseJSON.message + "!");
  598. });
  599. ajax.set("ids",ids);
  600. ajax.set("typeName",typeName);
  601. ajax.set("address",address);
  602. ajax.set("publicStartTime",publicStartTime);
  603. ajax.set("publicEndTime",publicEndTime);
  604. ajax.set("dep",dep);
  605. ajax.set("phone",phone);
  606. ajax.set("email",email);
  607. ajax.set("isMessage",isMessage);
  608. ajax.start();
  609. }
  610. Feng.confirm("一旦公示,无法恢复,确定公示吗?", operation);
  611. }
  612. /**
  613. * 批量公示通过
  614. * @param type
  615. */
  616. Housepurchase.publicPass = function(){
  617. var selected = $('#dataTable').bootstrapTable('getSelections');
  618. if(!selected || selected.length<1){
  619. Feng.info("请至少选择一行数据!");
  620. return;
  621. }
  622. var ids = "";
  623. for(var i=0; i<selected.length; i++){
  624. ids = ids + selected[i].id + ",";
  625. }
  626. var operation = function(){
  627. var ajax = new $ax(Feng.ctxPath + "/housepurchase/publicPass", function (data) {
  628. if(data.code==200){
  629. Feng.success(data.msg);
  630. Housepurchase.table.refresh();
  631. $("#exportCommonModal").modal("hide");
  632. }else{
  633. Feng.error(data.msg);
  634. }
  635. }, function (data) {
  636. Feng.error("公示通过失败!" + data.responseJSON.message + "!");
  637. });
  638. ajax.set("ids",ids);
  639. ajax.start();
  640. }
  641. Feng.confirm("一旦提交无法修改,确定公示通过吗?", operation);
  642. }
  643. /**
  644. * 兑现
  645. */
  646. Housepurchase.cash = function(){
  647. var selected = $('#dataTable').bootstrapTable('getSelections');
  648. if(!selected || selected.length<1){
  649. Feng.info("请至少选择一行数据!");
  650. return;
  651. }
  652. var ids = "";
  653. for(var i=0; i<selected.length; i++){
  654. ids = ids + selected[i].id + ",";
  655. }
  656. var operation = function(){
  657. var ajax = new $ax(Feng.ctxPath + "/housepurchase/cash", function (data) {
  658. if(data.code==200){
  659. Feng.success(data.msg);
  660. Housepurchase.table.refresh();
  661. $("#exportCommonModal").modal("hide");
  662. }else{
  663. Feng.error(data.msg);
  664. }
  665. }, function (data) {
  666. Feng.error("兑现失败!" + data.responseJSON.message + "!");
  667. });
  668. ajax.set("ids",ids);
  669. ajax.start();
  670. }
  671. Feng.confirm("一旦确认无法修改,确定要兑现吗?", operation);
  672. }
  673. /**
  674. * 部门批量提交审核
  675. */
  676. Housepurchase.depSubmitBatch = function(){
  677. var selected = $('#' + this.id).bootstrapTable('getSelections');
  678. if(selected.length == 0){
  679. Feng.info("请先选择提交审核的名单!");
  680. return false;
  681. }
  682. var ids = "";
  683. for(var key in selected){
  684. ids = ids + selected[key].id + ",";
  685. }
  686. var operation = function(){
  687. var ajax = new $ax(Feng.ctxPath + "/housepurchase/depSubmitBatch", function (data) {
  688. if(data.code==200){
  689. Feng.success(data.msg);
  690. Housepurchase.table.refresh();
  691. }else{
  692. Feng.error(data.msg);
  693. }
  694. }, function (data) {
  695. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  696. });
  697. ajax.set("ids",ids);
  698. ajax.set("companyId",selected[0].companyId);
  699. ajax.start();
  700. }
  701. Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
  702. }
  703. /**
  704. * 显示导出模态框
  705. */
  706. Housepurchase.showExportModal = function(){
  707. $("#exportForm")[0].reset();
  708. $("#exportModal").modal('show');
  709. }
  710. /**
  711. * 导出
  712. */
  713. Housepurchase.export = function(){
  714. var names = '';
  715. var values = '';
  716. $("#field_info li input").each(function(index){
  717. if($(this).is(":checked")){
  718. values = values + $(this).val() + ",";
  719. names = names + $(this).next().text() + ",";
  720. }
  721. });
  722. var queryData = Housepurchase.formParams();
  723. queryData['names'] = names;
  724. queryData['values'] = values;
  725. queryData['process'] = $("#process").val();
  726. $("#exportModal").modal('hide');
  727. var url = Feng.setUrlParam(Feng.ctxPath + "/housepurchaseExport/basicDataExport",queryData);
  728. window.hiddenIframe.location.href = url;
  729. }
  730. /**
  731. * 导出录入模板
  732. * @param type 模板类型
  733. */
  734. Housepurchase.exportTemplate = function(type){
  735. var selected = $('#' + this.id).bootstrapTable('getSelections');
  736. if(selected.length == 0){
  737. Feng.info("请先选择名单!");
  738. return false;
  739. }
  740. var ids = "";
  741. for(var key in selected){
  742. ids = ids + selected[key].id + ",";
  743. }
  744. window.hiddenIframe.location.href = Feng.ctxPath + "/housepurchaseExport/exportTemplate?type="+type+"&ids="+ids;
  745. }
  746. /**
  747. * 导入核查结果
  748. * @param type
  749. */
  750. Housepurchase.import = function(type){
  751. $("#import-form")[0].reset();
  752. $('#importModal').on('show.bs.modal', function () {
  753. $("#type").val(type);
  754. });
  755. $("#importModal").modal("show");
  756. }
  757. /**
  758. * 导入核查结果提交
  759. */
  760. Housepurchase.importSubmit = function(){
  761. var file = $("#file").val();
  762. if(Feng.isEmptyStr(file)){
  763. Feng.info("请选择需要导入的文件");return;
  764. }
  765. $("#import-form")[0].submit();
  766. }
  767. /**
  768. * 回调
  769. * @param data
  770. */
  771. Housepurchase.callBack = function(data){
  772. Feng.info(data.msg);
  773. }
  774. /**
  775. * 是否发送短信
  776. */
  777. Housepurchase.toggleMessage = function(){
  778. var isMessage = $("input[name='isSend']:checked").val();
  779. if (isMessage==1) {
  780. $("#messageEdit").css("display","block");
  781. } else if ( isMessage == 2){
  782. $("#messageEdit").css("display","none");
  783. }
  784. }
  785. /**
  786. * 刷新检索
  787. */
  788. Housepurchase.prepareSearch = function () {
  789. var name = $("#preName").val();
  790. var idCard = $("#preIdCard").val();
  791. $('#dataTable').bootstrapTable("refresh",{"query":{"name":name,"idCard":idCard}});
  792. }
  793. /**
  794. * 重置
  795. */
  796. Housepurchase.prepareReset = function () {
  797. $("#preName").val("");
  798. $("#preIdCard").val("");
  799. }
  800. $(function () {
  801. var defaultColunms = Housepurchase.initColumn();
  802. var table = new BSTable(Housepurchase.id, "/housepurchase/list/"+$("#process").val(), defaultColunms);
  803. table.setPaginationType("server");
  804. table.setOnDblClickRow(function () {
  805. Housepurchase.openCheckHousepurchase();
  806. });
  807. table.setRowStyle(function (row, index) {
  808. if(row.isConflict == 1){
  809. return {classes: 'danger'}
  810. }
  811. if(row.isRecover == 1){
  812. return {classes:'info'};
  813. }
  814. return {};
  815. });
  816. Housepurchase.table = table.init();
  817. $('#checkAll').click(function () {
  818. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
  819. })
  820. $('#uncheckAll').click(function () {
  821. $("#dataTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
  822. })
  823. });