sửa UX nhận tín hiệu thẻ khi gán thẻ cho nhân viên

This commit is contained in:
2020-11-11 11:11:51 +07:00
parent 1225b1bd2f
commit 096be1a116
4 changed files with 23 additions and 9 deletions

View File

@@ -222,13 +222,17 @@ common.getUrlParameter = function (sParam) {
}
};
common.error = function (id, text) {
$("#" + id).addClass("has-error").removeClass("has-success");
$("#" + id).addClass("has-error").removeClass("has-success").removeClass("has-warning");
$("#" + id).find(".help-block").html(text).removeClass("hidden");
};
common.success = function (id) {
$("#" + id).addClass("has-success").removeClass("has-error");
$("#" + id).find(".help-block").addClass("hidden");
};
common.warning = function (id, text) {
$("#" + id).addClass("has-warning").removeClass("has-error").removeClass("has-success");
$("#" + id).find(".help-block").html(text).removeClass("hidden");
};
common.form = function (e, obj, bigSize) {
var size = bigSize | false;
common.modalBlock(true);

View File

@@ -270,7 +270,9 @@ function formGetRTLog(e) {
}
function getRTLog(e) {
common.modalBlock(true);
// common.modalBlock(true);
common.warning("device-lists", "<i class='fa fa-info-circle'></i> Chờ tín hiệu thẻ (tối đa 60 giây)");
$("#spin-icon").removeClass("hidden");
$.ajax({
url: $(e).attr('data-href'),
type: 'POST',
@@ -278,18 +280,23 @@ function getRTLog(e) {
device: $("select[name='Device']").val()
},
success: function (data) {
common.modalBlock(false);
// common.modalBlock(false);
if (data.ErrorCode === "1") {
$("input[name='CardNumber']").val(data.CardNumber);
$("#device-lists").addClass("hidden");
$("#btn-get-rtlog").attr("data-stt", true);
$("#device-lists").removeClass("has-error").removeClass("has-warning");
$("#device-lists").find(".help-block").addClass("hidden");
$("#spin-icon").addClass("hidden");
} else {
alert("Không có tín hiệu thẻ");
common.error("device-lists", "<i class='fa fa-info-circle'></i> Không nhận được tín hiệu thẻ hoặc không có kết nối tới service");
$("#spin-icon").addClass("hidden");
}
},
error: function (jqXHR, textStatus, errorThrown) {
common.modalBlock(false);
alert("Không có tín hiệu thẻ");
// common.modalBlock(false);
common.error("device-lists", "<i class='fa fa-info-circle'></i> Không nhận được tín hiệu thẻ hoặc không có kết nối tới service");
$("#spin-icon").addClass("hidden");
}
});
}