123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- /**
- * 初始化学杂费补助详情对话框
- */
- var ChildschoolFeesInfoDlg = {
- childschoolFeesInfoData : {}
- };
- /**
- * 关闭此对话框
- */
- ChildschoolFeesInfoDlg.close = function() {
- parent.layer.close(window.parent.ChildschoolFees.layerIndex);
- }
- /**
- *
- */
- ChildschoolFeesInfoDlg.creatFieldCheckModal = function(){
- return '<form id="checkForm">\n' +
- ' <div class="form-group" style="margin: 10px;">\n' +
- ' <label for="checkState" class="control-label">审核状态</label>\n' +
- ' <select class="form-control" id="checkStateModel" >\n' +
- ' <option value="">请选择</option>\n' +
- ' <option value="5">审核通过</option>\n' +
- ' <option value="4">审核驳回</option>\n' +
- ' <option value="-1">审核不通过</option>\n' +
- ' </select>\n' +
- ' </div>\n' +
- ' <div class="form-group" style="margin: 10px;">\n' +
- ' <label for="checkMsg" class="control-label" >审核意见</label>\n' +
- ' <textarea class="form-control" id="checkMsg" rows="6"></textarea>\n' +
- ' </div>\n' +
- ' </form>';
- }
- /**
- * 显示审核模态框
- */
- ChildschoolFeesInfoDlg.showCheckModal = function(){
- var ajax = new $ax(Feng.ctxPath + "/childschoolFees/validateIsCheck", function (data) {
- if(data.code==200){
- layer.open({
- type: 1,
- id:"neewFieldFormModel",
- title: '审核',
- area: ['800px', '450px'], //宽高
- fix: false, //不固定
- shade:0,
- maxmin: true,
- content: ChildschoolFeesInfoDlg.creatFieldCheckModal(),
- btn: ['<i class="fa fa-save"></i> 提交' ,'<i class="fa fa-eraser"></i> 关闭'],
- btnAlign: 'c',
- zIndex: layer.zIndex,
- success:function(layero, index){
- layer.setTop(layero);
- $("#checkStateModel").val(data.obj.checkState);
- $("#checkMsg").val(data.obj.checkMsg);
- },
- yes: function (index, layero) {
- ChildschoolFeesInfoDlg.check(index);
- }
- });
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("校验失败!" + data.responseJSON.message + "!");
- });
- ajax.set("id",$("#id").val());
- ajax.set("process",1);
- ajax.start();
- }
- /**
- * 审核
- * @param index
- */
- ChildschoolFeesInfoDlg.check = function(index){
- var checkState = $("#checkStateModel").val();
- var checkMsg = $("#checkMsg").val();
- if(checkState==null||checkState==''){
- Feng.info("请选择审核状态");
- return ;
- }
- if(checkMsg == null || checkMsg == ''){
- Feng.info("请填写审核意见");
- return ;
- }
- var ajax = new $ax(Feng.ctxPath + "/childschoolFees/check", function (data) {
- if(data.code==200){
- layer.close(index);
- Feng.success(data.msg);
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("审核失败!" + data.responseJSON.message + "!");
- });
- ajax.setData({"id":$("#id").val(),"checkState":checkState,"checkMsg":checkMsg});
- ajax.start();
- }
- /**
- * 提交审核
- */
- ChildschoolFeesInfoDlg.submitCheck = function(){
- var checkState = $("#checkState").val();
- if(checkState != 2 && checkState != 3){
- Feng.info("不在审核范围内");
- return ;
- }
- var operation = function(){
- var ajax = new $ax(Feng.ctxPath + "/childschoolFees/submitCheck", function (data) {
- if(data.code==200){
- Feng.success(data.msg);
- window.parent.ChildschoolFees.table.refresh();
- ChildschoolFeesInfoDlg.close();
- }else{
- Feng.error(data.msg);
- }
- }, function (data) {
- Feng.error("提交审核失败!" + data.responseJSON.message + "!");
- });
- ajax.setData({"id":$("#id").val()});
- ajax.start();
- }
- Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
- }
- /**
- * 回显社保及个税
- */
- ChildschoolFeesInfoDlg.checkSbAndTax = function(){
- var pensionDetail = $("#pensionDetail").attr("data-month");
- var unemploymentDetail = $("#unemploymentDetail").attr("value");
- var medicaDetail = $("#medicaDetail").attr("value");
- var taxDetail = $("#taxDetail").attr("value");
- $("#pensionDetail input").each(function () {
- $(this).attr("style","pointer-events: none;background-color: #eee;");
- if(pensionDetail.indexOf($(this).val())!= -1){
- $(this).attr("checked", true);
- }
- })
- $("#unemploymentDetail input").each(function () {
- $(this).attr("style","pointer-events: none;background-color: #eee;");
- if(unemploymentDetail.indexOf($(this).val())!= -1){
- $(this).attr("checked", true);
- }
- })
- $("#medicaDetail input").each(function () {
- $(this).attr("style","pointer-events: none;background-color: #eee;");
- if(medicaDetail.indexOf($(this).val())!= -1){
- $(this).attr("checked", true);
- }
- })
- $("#taxDetail input").each(function () {
- $(this).attr("style","pointer-events: none;background-color: #eee;");
- if(taxDetail.indexOf($(this).val())!= -1){
- $(this).attr("checked", true);
- }
- })
- }
- $(function() {
- var arr = [{"name":"talentArrange","code":"un_talentLevel"},
- {"name":"cRelation","code":"un_education_relation"},
- {"name":"nowGrade","code":"un_grade"},
- {"name":"pCardType","code":"un_cardType"},
- {"name":"cCardType","code":"un_cardType"}];
- Feng.findChildDictBatch(JSON.stringify(arr))
- $("select").each(function () {
- $(this).val($(this).attr("value")).trigger("change");
- });
- var id = $("#id").val();
- Feng.getCheckLog("logTable",{"type":CONFIG.project_schoolFees,"mainId":id,"typeFileId":"","active":1})
- ChildschoolFeesInfoDlg.checkSbAndTax();
- Feng.showMiniFileModal(CONFIG.project_schoolFees,$("#type").val(),$("#id").val());
- });
|