如何学好java

如何学好java,其实很简单,只要用心体会,慢慢积累!
posts - 106, comments - 7, trackbacks - 0, articles - 3
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

改变状态

Posted on 2011-12-15 15:54 哈希 阅读(168) 评论(0)  编辑  收藏 所属分类: Js and Jquery 常用总结
/**
 * 修改状态
 */
function changeStates(flag) {
 if(flag == 1){
  if(confirm('确认审批是否通过?')){
   saveStates(flag,"<c:url value='/j8_distributorSettle/listSettle/approval'/>");
  }
 }else if(flag == 4){
  if(confirm('确认付款?')){
   saveStates(flag,"<c:url value='/j8_distributorSettle/listSettle/payment'/>");
  }
 }else{
  saveStates(flag,"<c:url value='/j8_distributorSettle/listSettle/approval'/>");
 }

//审批数据提交
function saveStates(flag,url){
 $.ajax({
    type: 'get',
    url: "<c:url value='/j8_distributorSettle/changeStates/'/>"+flag+"/<c:out value='${result.settleMaster.id}'/>",
    dataType: 'html',
    success: function(data){        
     if(data > 0){
       showInfo("操作成功");       
    window.location.href=url; 
     }else{
       showError("操作失败"); 
    return false;
     }
    }
 });
}

$(document).ready(function () {
 ConvertMoney();
});
/**
 * 修改状态
 */
function changeStates(states) {
 $.ajax({
    type: 'get',
    url: "<c:url value='/j8_clientSummary/changeStates/'/>"+states+"/<c:out value='${result.repurchseMaster.id}'/>",
    dataType: 'html',
    success: function(data){        
     if(data > 0){
       showInfo("操作成功");
       if(states == 1){
        url = "<c:url value='/j8_clientSummary/summaryList/1'/>";
       }
       if(states == 2){
        url = "<c:url value='/j8_clientSummary/summaryList/2'/>";
       }
       if(states == 3){
        url = "<c:url value='/j8_clientSummary/summaryList/2'/>";
       }
       if(states == 4){
        url = "<c:url value='/j8_clientSummary/summaryList/3'/>";
       }
       window.location.href = url;       
    query();      
     }else{
       showError("操作失败"); 
    return false;
     }
    }
  });
}

function create() {
  var checkValues = getCoulmnValue(oTable,'key');
  if(isEmpty(checkValues)){
   showInfo("请选择要结算的行");
   return false;
  } else {
   checkSettle(checkValues);   
  }
 }
 //结算检查
 function checkSettle(checkValues){  
  $.ajax({
     type: 'get',
     url: "<c:url value='/j8_distributorSummary/checkSettle/'/>"+checkValues,
     dataType: 'html',
     success: function(data){        
      if(data == '1'){       
     window.location.href="<c:url value='/j8_distributorSummary/createSettle/'/>"+checkValues;
      }else{
        showInfo("只能对同一客户进行结算");
     return false;
      }
     }
   });
 }


 function changeStates(flag) {
  var checkValues = getCoulmnValue(oTable,'key');
  if(isEmpty(checkValues)){
   showInfo("请选择数据");
   return false;
  } else {
   if(flag == 1){
    if(confirm('确认审批是否通过?')){
     saveStates(flag,checkValues);
    }
   }else if(flag == 4){
    if(confirm('确认付款?')){
     saveStates(flag,checkValues);
    }
   }else{
    saveStates(flag,checkValues);
   }     
  }
 } 
 //审批数据提交
 function saveStates(flag,checkValues){
  $.ajax({
     type: 'get',
     url: "<c:url value='/j8_distributorSettle/changeStates/'/>"+flag+"/"+checkValues,
     dataType: 'html',
     success: function(data){        
      if(data > 0){
        showInfo("操作成功");       
     query();      
      }else{
        showError("操作失败"); 
     return false;
      }
     }
  });
 }

function changeStates(states) {
  var checkValues = getCoulmnValue(oTable,'key');
  if(isEmpty(checkValues)){
   showInfo("请选择数据");
   return false;
  } else {
   $.ajax({
      type: 'get',
      url: "<c:url value='/j8_clientSummary/changeStates/'/>"+states+"/"+checkValues,
      dataType: 'html',
      success: function(data){        
       if(data > 0){
         showInfo("操作成功");       
      query();      
       }else{
         showError("操作失败"); 
      return false;
       }
      }
    });  
  }
 }

只有注册用户登录后才能发表评论。


网站导航: