修改錯誤

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

View File

@ -631,29 +631,6 @@
if ($("#device-item-sub-form").valid()) { 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); $("#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 = { var send_data = {
id: selected_system_device_item_guid, id: selected_system_device_item_guid,
@ -690,12 +667,36 @@
.fail(function (xhr, status, error) { .fail(function (xhr, status, error) {
$("#save-device-item-btn").html('確定').attr("disabled", false); $("#save-device-item-btn").html('確定').attr("disabled", false);
}); });
} //var uurl = "/SystemCategory/HaveSamePoints";
} //var ssend_data = {
}, 'json') // subId: selected_system_sub_guid,
.fail(function (xhr, status, error) { // id: selected_system_device_item_guid,
$("#save-device-item-btn").html('確定').attr("disabled", false); // 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 //#endregion