fix bug đồng bộ dữ liệu

This commit is contained in:
2020-12-09 11:54:10 +07:00
parent bc8812ebed
commit ecd76e6c58
2 changed files with 9 additions and 5 deletions

View File

@@ -365,10 +365,14 @@ function syncStaffs(device_id, device_ip, page, fullData) {
data: device_id
},
success: function (data) {
appendLogs("[" + data.IP + "] Đồng bộ dữ liệu " + data.staff + " nhân viên từ " + data.from + " đến " + data.to + " tới thiết bị", "green", "check");
processProgress(secondIncrement);
currentPage++;
if (currentPage <= totalPage)
if (totalPage == 0)
appendLogs("[" + data.IP + "] Không có dữ liệu nhân viên đồng bộ tới thiết bị", "orange", "info-circle");
else {
appendLogs("[" + data.IP + "] Đồng bộ dữ liệu " + data.staff + " nhân viên từ " + data.from + " đến " + data.to + " tới thiết bị", "green", "check");
processProgress(secondIncrement);
currentPage++;
}
if (totalPage > 0 && currentPage <= totalPage)
syncStaffs(device_id, device_ip, currentPage, fullData);
else {
currentPage = 1;