housepurchase.js 43 KB

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