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;
}
}
});
}
}