houseRenting_info.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /**
  2. * 初始化租房申请详情对话框
  3. */
  4. var HouseRentingInfoDlg = {
  5. houseRentingInfoData : {}
  6. };
  7. /**
  8. * 关闭此对话框
  9. */
  10. HouseRentingInfoDlg.close = function() {
  11. parent.layer.close(window.parent.HouseRenting.layerIndex);
  12. }
  13. HouseRentingInfoDlg.checkSbAndTax = function(){
  14. var pensionDetail = $("#pensionDetail").attr("value");
  15. var unemploymentDetail = $("#unemploymentDetail").attr("value");
  16. var medicaDetail = $("#medicaDetail").attr("value");
  17. var taxDetail = $("#taxDetail").attr("value");
  18. $("#pensionDetail input").each(function () {
  19. if(pensionDetail.indexOf($(this).val())!= -1){
  20. $(this).attr("checked", true);
  21. }
  22. })
  23. $("#unemploymentDetail input").each(function () {
  24. if(unemploymentDetail.indexOf($(this).val())!= -1){
  25. $(this).attr("checked", true);
  26. }
  27. })
  28. $("#medicaDetail input").each(function () {
  29. if(medicaDetail.indexOf($(this).val())!= -1){
  30. $(this).attr("checked", true);
  31. }
  32. })
  33. $("#taxDetail input").each(function () {
  34. if(taxDetail.indexOf($(this).val())!= -1){
  35. $(this).attr("checked", true);
  36. }
  37. })
  38. }
  39. /**
  40. * 显示初审审核模态框
  41. */
  42. HouseRentingInfoDlg.showCheckModal = function(process){
  43. var ajax = new $ax(Feng.ctxPath + "/houseRenting/validateIsCheck", function (data) {
  44. if(data.code==200){
  45. layer.open({
  46. type: 1,
  47. id:"checkModel",
  48. title: '审核',
  49. area: ['800px', '450px'], //宽高
  50. fix: false, //不固定
  51. shade:0,
  52. maxmin: true,
  53. content:HouseRentingInfoDlg.createCheckHtml(process),
  54. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  55. btnAlign: 'c',
  56. zIndex: layer.zIndex,
  57. success:function(layero, index){
  58. layer.setTop(layero);
  59. var obj = data.obj.obj;
  60. $("#checkForm")[0].reset();
  61. $("#checkStateModal").val(obj.checkState).trigger("change");
  62. $("#checkMsg").val(obj.checkMsg);
  63. },
  64. yes: function (index, layero) {
  65. var checkState = $("#checkStateModal").val();
  66. var checkMsg = $("#checkMsg").val();
  67. if(process != 2 && (checkState==null||checkState=='')){
  68. Feng.info("请选择审核状态");
  69. return ;
  70. }
  71. if(checkMsg == null || checkMsg == ''){
  72. Feng.info("请填写审核意见");
  73. return ;
  74. }
  75. var ajax = new $ax(Feng.ctxPath + "/houseRenting/check", function (data) {
  76. if(data.code==200){
  77. layer.close(index);
  78. Feng.success(data.msg);
  79. }else{
  80. Feng.error(data.msg);
  81. }
  82. }, function (data) {
  83. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  84. });
  85. ajax.setData({"id":$("#id").val(),"checkState":checkState,"checkMsg":checkMsg, "process":process,"companyId":$("#companyId").val()})
  86. ajax.start();
  87. }
  88. });
  89. }else{
  90. Feng.error(data.msg);
  91. }
  92. }, function (data) {
  93. Feng.error("校验失败!" + data.responseJSON.message + "!");
  94. });
  95. ajax.setData({"id":$("#id").val(),"process":process,"companyId":$("#companyId").val()})
  96. ajax.start();
  97. }
  98. HouseRentingInfoDlg.createCheckHtml = function(process){
  99. return process == 2?
  100. '<form id="checkForm">\n' +
  101. '<div class="form-group" style="margin: 10px;">\n' +
  102. '<label for="checkMsg" class="control-label" >核查结果</label>\n' +
  103. '<textarea class="form-control" id="checkMsg" placeholder="" rows="10"></textarea>\n' +
  104. '</div>\n' +
  105. '</form>'
  106. :
  107. '<form id="checkForm">\n' +
  108. '<div class="form-group" style="margin: 10px;">\n' +
  109. '<label for="checkState" class="control-label">审核状态</label>\n' +
  110. '<select class="form-control" id="checkStateModal" >\n' +
  111. '<option value="">请选择</option>\n' +
  112. '<option value="3">审核通过</option>\n' +
  113. '<option value="2">审核驳回</option>\n' +
  114. '<option value="-1">审核不通过</option>\n' +
  115. '</select>\n' +
  116. '</div>\n' +
  117. '<div class="form-group" style="margin: 10px;">\n' +
  118. '<label for="checkMsg" class="control-label" >审核意见</label>\n' +
  119. '<textarea class="form-control" id="checkMsg" placeholder="" rows="6"></textarea>\n' +
  120. '</div>\n' +
  121. '</form>';
  122. }
  123. /**
  124. * 提交审核
  125. */
  126. HouseRentingInfoDlg.submitToCheck = function(process){
  127. var operation = function(){
  128. var ajax = new $ax(Feng.ctxPath + "/houseRenting/submitCheck", function (data) {
  129. if(data.code==200){
  130. Feng.success(data.msg);
  131. window.parent.HouseRenting.table.refresh();
  132. HouseRentingInfoDlg.close();
  133. }else{
  134. Feng.error(data.msg);
  135. }
  136. }, function (data) {
  137. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  138. });
  139. ajax.setData({"id":$("#id").val(),"process":process,"companyId":$("#companyId").val()});
  140. ajax.start();
  141. }
  142. Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
  143. }
  144. $(function() {
  145. $("select").each(function () {$(this).val($(this).attr("value")).trigger("change");});
  146. HouseRentingInfoDlg.checkSbAndTax();
  147. Feng.getCheckLog("logTable",{"type":CONFIG.project_renting,"mainId":$("#id").val(),"typeFileId":"","active":1})
  148. Feng.showMiniFileModal(CONFIG.project_renting,$("#type").val(),$("#id").val());
  149. });