function SubmitRefund(){
var msg = $(o).parent().siblings(".reason");
var remark = msg.children("textarea").val();
var total = parseInt(msg.children(".refund-money").children("input").val());
if(!remark && remark.length < 15){
layer.open({content:'请输入15字以上的原因!',skin:'msg',time:3});
return;
}
if(total<0){
layer.open({content:'请输入正确的总数!',skin:'msg',time:3});
return;
}
if(id<1){
layer.open({content:'页面发送错误!',skin:'msg',time:3});
return;
}
o.disabled = true;
//数据传输类型、地址、传给服务器的数据、接受服务器传过来的数据(data)
$.post('./?c=equipmentrepair',{'id':id,'act':'refund',remark:remar,total:total},function(data){
if(!data){
layer.open({content:'请求超时!请稍后重试!',skin:'msg',time:3});
o.disabled = false;
return;
}
if(data.code == 1){
layer.open({content:'保存成功!',skin:'msg',time:3});
//3s后跳转到维修中心
setTimeout(()=>{
window.location.href='./?c=equipmentrepair';
},3000);
}else if(data.msg!=''){
layer.open({content:data.msg,skin:'msg',time:3});
o.disabled = false;
}else{
layer.open({content:'发生未知错误!',skin:'msg',time:3});
o.disabled = false;
}
},'json');
}
// 地址:./?c=equipmentrepair; 方式:post; 数据:act:refund;id remark refund total;