Files
Web_AUTSDATA_Mvc_Prod/AUTS.Web/Content/myFunction.js

92 lines
2.9 KiB
JavaScript
Raw Normal View History

2025-11-20 13:11:05 +08:00
/// <reference path="layui/layui.js" />
//提交
function UpDate(btnID, url, formID, suUrl) {
var btnText = $('#' + btnID).html();
$('#' + btnID).attr("disabled", "true"); //设置禁用按钮
$('#' + btnID).text('提交中...'); //显示提交中
$('#' + formID).ajaxSubmit({
url: url,
type: "POST",
success: function (res) {
if (res.Status == 200) {
alert("保存成功");
//layui.alert("保存成功");
//location.href = suUrl;
window.close();
$('#' + btnID).text(btnText); //还原显示
$('#' + btnID).removeAttr('disabled')//重置按钮
} else {
alert("保存失败");
$('#' + btnID).text(btnText); //还原显示
$('#' + btnID).removeAttr('disabled')//重置按钮
}
},
error: function (error) {
$('#' + btnID).removeAttr('disabled')//重置按钮
$('#' + btnID).text(btnText); //还原显示
alert(error);
}
});
};
//添加修改内部单生产计划
function excutedUpDatePPlan(btnID, url, formID, orderInternalID) {
var btnText = $('#' + btnID).html();
$('#' + btnID).attr("disabled", "true"); //设置禁用按钮
$('#' + btnID).text('提交中...'); //显示提交中
$('#' + formID).ajaxSubmit({
url: url,
type: "POST",
success: function (res) {
if (res.Status == 200) {
$.toastr.success('保存成功',
{
position: 'top-center',
time: 2000,
callback: function () {
$('#' + btnID).text(btnText); //还原显示
$('#' + btnID).removeAttr('disabled')//重置按钮
gotoDetailPartial('/APP/PPlan/PPlanInternalDetails', orderInternalID, 'pPlanInterBox_Content')
}
});
} else {
$.toastr.error('保存失败! <br />' + res.Message, {
time: 3000,
position: 'top-center'
});
$('#' + btnID).text(btnText); //还原显示
$('#' + btnID).removeAttr('disabled')//重置按钮
}
},
error: function (error) {
$('#' + btnID).removeAttr('disabled')//重置按钮
$('#' + btnID).text(btnText); //还原显示
alert(error);
}
});
};
function leave() {
var name = $("input[name='Matlab']").val();
console.log(name);
$.ajax({
url: "/APP/ProductMaintain/judgecode",
data: { name: name },
type: "POST",
success: function (res) {
if (res) {
$('#hintname').val("已用此不良代码");
}
}
})
}