housepurchase.js 43 KB

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