housepurchase.js 39 KB

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