update: lấy dữ liệu mã thẻ từ thiết bị, mở cửa từ phần mềm
This commit is contained in:
@@ -478,3 +478,22 @@ function processProgress(ai) {
|
||||
$("#close-modal").attr("disabled", false);
|
||||
}
|
||||
}
|
||||
|
||||
function openDoor(e) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr('data-href'),
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
if (data.ErrorCode === "0")
|
||||
notification.success("Mở cửa thành công", 2000);
|
||||
else
|
||||
notification.error("Mở cửa thất bại, không có kết nối tới thiết bị", 2000);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -257,4 +257,39 @@ function btnImage() {
|
||||
}
|
||||
}).addInstance('AnhNhanVien');
|
||||
}
|
||||
;
|
||||
|
||||
function formGetRTLog(e) {
|
||||
var stt = $(e).attr("data-stt");
|
||||
if (stt === "true") {
|
||||
$("#device-lists").removeClass("hidden");
|
||||
$(e).attr("data-stt", false);
|
||||
} else {
|
||||
$("#device-lists").addClass("hidden");
|
||||
$(e).attr("data-stt", true);
|
||||
}
|
||||
}
|
||||
|
||||
function getRTLog(e) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr('data-href'),
|
||||
type: 'POST',
|
||||
data: {
|
||||
device: $("select[name='Device']").val()
|
||||
},
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
if (data.ErrorCode === "1") {
|
||||
$("input[name='CardNumber']").val(data.CardNumber);
|
||||
$("#device-lists").addClass("hidden");
|
||||
$("#btn-get-rtlog").attr("data-stt", true);
|
||||
} else {
|
||||
alert("Không có tín hiệu thẻ");
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
alert("Không có tín hiệu thẻ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user