|
|
|
@ -138,60 +138,6 @@ var Common = {
|
|
|
|
|
error: function (info) {
|
|
|
|
|
Common.openConfirm(info)
|
|
|
|
|
},
|
|
|
|
|
post: function (url, paras, next) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: Common.ctxPath + url,
|
|
|
|
|
type: "POST",
|
|
|
|
|
data: paras,
|
|
|
|
|
success: function (rsp) {
|
|
|
|
|
if (rsp.code != 0) {
|
|
|
|
|
Common.error(rsp.msg);
|
|
|
|
|
} else {
|
|
|
|
|
//成功
|
|
|
|
|
if (next != null) {
|
|
|
|
|
next(rsp.data);
|
|
|
|
|
} else {
|
|
|
|
|
Common.success(rsp.responseJSON.msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function (rsp) {
|
|
|
|
|
if(rsp.responseJSON && rsp.responseJSON.msg)
|
|
|
|
|
Common.error(rsp.responseJSON.msg);
|
|
|
|
|
else
|
|
|
|
|
Common.error('服务器错误,请联系管理员');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
postJSON: function (url, paras, next) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: Common.ctxPath + url,
|
|
|
|
|
type: "POST",
|
|
|
|
|
contentType:'application/json;charset=utf-8',
|
|
|
|
|
dataType:'json',
|
|
|
|
|
data: paras,
|
|
|
|
|
success: function (rsp) {
|
|
|
|
|
if (rsp.code != 0) {
|
|
|
|
|
Common.error(rsp.msg);
|
|
|
|
|
} else {
|
|
|
|
|
//成功
|
|
|
|
|
if (next != null) {
|
|
|
|
|
next(rsp.data);
|
|
|
|
|
} else {
|
|
|
|
|
Common.success(rsp.msg || rsp.responseJSON.msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function (rsp) {
|
|
|
|
|
if(rsp.responseJSON && rsp.responseJSON.msg)
|
|
|
|
|
Common.error(rsp.responseJSON.msg);
|
|
|
|
|
else
|
|
|
|
|
Common.error('服务器错误,请联系管理员');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
downLoad: function (url, data, method) {
|
|
|
|
|
if(!method) {
|
|
|
|
|
method = 'POST';
|
|
|
|
@ -344,7 +290,66 @@ var Common = {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}, postAjax: function (url, paras) {
|
|
|
|
|
},
|
|
|
|
|
post: function (url, paras, next) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: Common.ctxPath + url,
|
|
|
|
|
type: "POST",
|
|
|
|
|
data: paras,
|
|
|
|
|
success: function (rsp) {
|
|
|
|
|
if (rsp.code != 0) {
|
|
|
|
|
Common.error(rsp.msg);
|
|
|
|
|
} else {
|
|
|
|
|
//成功
|
|
|
|
|
if (next != null) {
|
|
|
|
|
next(rsp.data);
|
|
|
|
|
} else {
|
|
|
|
|
Common.success(rsp.responseJSON.msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function (rsp) {
|
|
|
|
|
if(rsp.responseJSON && rsp.responseJSON.msg)
|
|
|
|
|
Common.error(rsp.responseJSON.msg);
|
|
|
|
|
else
|
|
|
|
|
Common.error('服务器错误,请联系管理员');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
postJSON: function (url, paras, next) {
|
|
|
|
|
var r = "";
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: Common.ctxPath + url,
|
|
|
|
|
type: "POST",
|
|
|
|
|
contentType:'application/json;charset=utf-8',
|
|
|
|
|
dataType:'json',
|
|
|
|
|
data: paras,
|
|
|
|
|
async: false,
|
|
|
|
|
success: function (rsp) {
|
|
|
|
|
r = rsp;
|
|
|
|
|
if (rsp.code != 0) {
|
|
|
|
|
Common.error(rsp.msg);
|
|
|
|
|
} else {
|
|
|
|
|
//成功
|
|
|
|
|
if (next != null) {
|
|
|
|
|
next(rsp.data);
|
|
|
|
|
} else {
|
|
|
|
|
Common.success(rsp.msg || rsp.responseJSON.msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function (rsp) {
|
|
|
|
|
r = rsp.responseJSON;
|
|
|
|
|
if(rsp.responseJSON && rsp.responseJSON.msg)
|
|
|
|
|
Common.error(rsp.responseJSON.msg);
|
|
|
|
|
else
|
|
|
|
|
Common.error('服务器错误,请联系管理员');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return r;
|
|
|
|
|
},
|
|
|
|
|
postAjax: function (url, paras) {
|
|
|
|
|
var r = "";
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: Common.ctxPath + url,
|
|
|
|
@ -362,7 +367,8 @@ var Common = {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return r;
|
|
|
|
|
},getAjax: function (url, paras) {
|
|
|
|
|
},
|
|
|
|
|
getAjax: function (url, paras) {
|
|
|
|
|
var r = "";
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: Common.ctxPath + url,
|
|
|
|
@ -380,7 +386,8 @@ var Common = {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return r;
|
|
|
|
|
},stateMatching:function (state,sign){ //state状态(-1:作废 0:计划换线 1:待换/护线 2:换/护线中 3:待检验 4:检验中 5:样件通过 6:检验不通过 7:待填单) sign类型(1换线 2护线)
|
|
|
|
|
},
|
|
|
|
|
stateMatching:function (state,sign){ //state状态(-1:作废 0:计划换线 1:待换/护线 2:换/护线中 3:待检验 4:检验中 5:样件通过 6:检验不通过 7:待填单) sign类型(1换线 2护线)
|
|
|
|
|
var text = sign == 1?"换线":"护线";
|
|
|
|
|
return state == -1 ? text + "作废" :
|
|
|
|
|
state == 0 ? "计划" + text :
|
|
|
|
|