修改錯誤

This commit is contained in:
dev02 2023-04-27 17:58:53 +08:00
parent 4ec1f0f5bd
commit f7cc7cfb4c

View File

@ -631,30 +631,7 @@
if ($("#device-item-sub-form").valid()) {
$("#save-device-item-btn").html('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>').attr("disabled", true);
var uurl = "/SystemCategory/HaveSamePoints";
var ssend_data = {
subId: selected_system_sub_guid,
id: selected_system_device_item_guid,
points: $('#device_sub_points_modal').val(),
}
$.post(uurl, ssend_data, function (rel) {
if (rel.code != "0000") {
$("#save-device-item-btn").html('確定').attr("disabled", false);
if (rel.code == "9999") {
toast_error(rel.msg);
}
else {
toast_warning(rel.msg);
}
return;
}
else {
if (rel.data) {
toast_warning("點位名稱已存在");
$("#save-device-item-btn").html('確定').attr("disabled", false);
}
else {
var url = "/SystemCategory/Savedevice_item";
var url = "/SystemCategory/Savedevice_item";
var send_data = {
id: selected_system_device_item_guid,
device_system_tag: selected_system_main_guid,
@ -690,12 +667,36 @@
.fail(function (xhr, status, error) {
$("#save-device-item-btn").html('確定').attr("disabled", false);
});
}
}
}, 'json')
.fail(function (xhr, status, error) {
$("#save-device-item-btn").html('確定').attr("disabled", false);
});
//var uurl = "/SystemCategory/HaveSamePoints";
//var ssend_data = {
// subId: selected_system_sub_guid,
// id: selected_system_device_item_guid,
// points: $('#device_sub_points_modal').val(),
//}
//$.post(uurl, ssend_data, function (rel) {
// if (rel.code != "0000") {
// $("#save-device-item-btn").html('確定').attr("disabled", false);
// if (rel.code == "9999") {
// toast_error(rel.msg);
// }
// else {
// toast_warning(rel.msg);
// }
// return;
// }
// else {
// if (rel.data) {
// toast_warning("點位名稱已存在");
// $("#save-device-item-btn").html('確定').attr("disabled", false);
// }
// else {
// }
// }
//}, 'json')
//.fail(function (xhr, status, error) {
// $("#save-device-item-btn").html('確定').attr("disabled", false);
//});
}
}
//#endregion