childschoolFees_info.js 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /**
  2. * 初始化学杂费补助详情对话框
  3. */
  4. var ChildschoolFeesInfoDlg = {
  5. childschoolFeesInfoData : {}
  6. };
  7. /**
  8. * 关闭此对话框
  9. */
  10. ChildschoolFeesInfoDlg.close = function() {
  11. parent.layer.close(window.parent.ChildschoolFees.layerIndex);
  12. }
  13. /**
  14. *
  15. */
  16. ChildschoolFeesInfoDlg.creatFieldCheckModal = function(){
  17. return '<form id="checkForm">\n' +
  18. ' <div class="form-group" style="margin: 10px;">\n' +
  19. ' <label for="checkState" class="control-label">审核状态</label>\n' +
  20. ' <select class="form-control" id="checkStateModel" >\n' +
  21. ' <option value="">请选择</option>\n' +
  22. ' <option value="5">审核通过</option>\n' +
  23. ' <option value="4">审核驳回</option>\n' +
  24. ' <option value="-1">审核不通过</option>\n' +
  25. ' </select>\n' +
  26. ' </div>\n' +
  27. ' <div class="form-group" style="margin: 10px;">\n' +
  28. ' <label for="checkMsg" class="control-label" >审核意见</label>\n' +
  29. ' <textarea class="form-control" id="checkMsg" rows="6"></textarea>\n' +
  30. ' </div>\n' +
  31. ' </form>';
  32. }
  33. /**
  34. * 显示审核模态框
  35. */
  36. ChildschoolFeesInfoDlg.showCheckModal = function(){
  37. var ajax = new $ax(Feng.ctxPath + "/childschoolFees/validateIsCheck", function (data) {
  38. if(data.code==200){
  39. layer.open({
  40. type: 1,
  41. id:"neewFieldFormModel",
  42. title: '审核',
  43. area: ['800px', '450px'], //宽高
  44. fix: false, //不固定
  45. shade:0,
  46. maxmin: true,
  47. content: ChildschoolFeesInfoDlg.creatFieldCheckModal(),
  48. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交' ,'<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  49. btnAlign: 'c',
  50. zIndex: layer.zIndex,
  51. success:function(layero, index){
  52. layer.setTop(layero);
  53. $("#checkStateModel").val(data.obj.checkState);
  54. $("#checkMsg").val(data.obj.checkMsg);
  55. },
  56. yes: function (index, layero) {
  57. ChildschoolFeesInfoDlg.check(index);
  58. }
  59. });
  60. }else{
  61. Feng.error(data.msg);
  62. }
  63. }, function (data) {
  64. Feng.error("校验失败!" + data.responseJSON.message + "!");
  65. });
  66. ajax.set("id",$("#id").val());
  67. ajax.set("process",1);
  68. ajax.start();
  69. }
  70. /**
  71. * 审核
  72. * @param index
  73. */
  74. ChildschoolFeesInfoDlg.check = function(index){
  75. var checkState = $("#checkStateModel").val();
  76. var checkMsg = $("#checkMsg").val();
  77. if(checkState==null||checkState==''){
  78. Feng.info("请选择审核状态");
  79. return ;
  80. }
  81. if(checkMsg == null || checkMsg == ''){
  82. Feng.info("请填写审核意见");
  83. return ;
  84. }
  85. var ajax = new $ax(Feng.ctxPath + "/childschoolFees/check", function (data) {
  86. if(data.code==200){
  87. layer.close(index);
  88. Feng.success(data.msg);
  89. }else{
  90. Feng.error(data.msg);
  91. }
  92. }, function (data) {
  93. Feng.error("审核失败!" + data.responseJSON.message + "!");
  94. });
  95. ajax.setData({"id":$("#id").val(),"checkState":checkState,"checkMsg":checkMsg});
  96. ajax.start();
  97. }
  98. /**
  99. * 提交审核
  100. */
  101. ChildschoolFeesInfoDlg.submitCheck = function(){
  102. var checkState = $("#checkState").val();
  103. if(checkState != 2 && checkState != 3){
  104. Feng.info("不在审核范围内");
  105. return ;
  106. }
  107. var operation = function(){
  108. var ajax = new $ax(Feng.ctxPath + "/childschoolFees/submitCheck", function (data) {
  109. if(data.code==200){
  110. Feng.success(data.msg);
  111. window.parent.ChildschoolFees.table.refresh();
  112. ChildschoolFeesInfoDlg.close();
  113. }else{
  114. Feng.error(data.msg);
  115. }
  116. }, function (data) {
  117. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  118. });
  119. ajax.setData({"id":$("#id").val()});
  120. ajax.start();
  121. }
  122. Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
  123. }
  124. /**
  125. * 回显社保及个税
  126. */
  127. ChildschoolFeesInfoDlg.checkSbAndTax = function(){
  128. var pensionDetail = $("#pensionDetail").attr("data-month");
  129. var unemploymentDetail = $("#unemploymentDetail").attr("value");
  130. var medicaDetail = $("#medicaDetail").attr("value");
  131. var taxDetail = $("#taxDetail").attr("value");
  132. $("#pensionDetail input").each(function () {
  133. $(this).attr("style","pointer-events: none;background-color: #eee;");
  134. if(pensionDetail.indexOf($(this).val())!= -1){
  135. $(this).attr("checked", true);
  136. }
  137. })
  138. $("#unemploymentDetail input").each(function () {
  139. $(this).attr("style","pointer-events: none;background-color: #eee;");
  140. if(unemploymentDetail.indexOf($(this).val())!= -1){
  141. $(this).attr("checked", true);
  142. }
  143. })
  144. $("#medicaDetail input").each(function () {
  145. $(this).attr("style","pointer-events: none;background-color: #eee;");
  146. if(medicaDetail.indexOf($(this).val())!= -1){
  147. $(this).attr("checked", true);
  148. }
  149. })
  150. $("#taxDetail input").each(function () {
  151. $(this).attr("style","pointer-events: none;background-color: #eee;");
  152. if(taxDetail.indexOf($(this).val())!= -1){
  153. $(this).attr("checked", true);
  154. }
  155. })
  156. }
  157. $(function() {
  158. var arr = [{"name":"talentArrange","code":"un_talentLevel"},
  159. {"name":"cRelation","code":"un_education_relation"},
  160. {"name":"nowGrade","code":"un_grade"},
  161. {"name":"pCardType","code":"un_cardType"},
  162. {"name":"cCardType","code":"un_cardType"}];
  163. Feng.findChildDictBatch(JSON.stringify(arr))
  164. $("select").each(function () {
  165. $(this).val($(this).attr("value")).trigger("change");
  166. });
  167. var id = $("#id").val();
  168. Feng.getCheckLog("logTable",{"type":CONFIG.project_schoolFees,"mainId":id,"typeFileId":"","active":1})
  169. ChildschoolFeesInfoDlg.checkSbAndTax();
  170. Feng.showMiniFileModal(CONFIG.project_schoolFees,$("#type").val(),$("#id").val());
  171. });