fix lỗi đồng bộ dữ liệu không xóa các dữ liệu cũ

This commit is contained in:
2020-10-21 17:11:45 +07:00
parent 88ff9d32bd
commit 3c8300c74b
11 changed files with 2147 additions and 2038 deletions

View File

@@ -297,18 +297,18 @@ function syncSchedule(device_id, device_ip, fullData) {
},
success: function (data) {
var totalsStaff = data.staffs;
totalPage = parseInt(totalsStaff / 200);
if (totalsStaff % 200 > 0)
totalPage = parseInt(totalsStaff / parseInt($("input[name='pageSize']").val()));
if (totalsStaff % parseInt($("input[name='pageSize']").val()) > 0)
totalPage++;
secondIncrement = 1 / (totalPage + 1);
if (data.res.ErrorCode == "-1") {
appendLogs("[" + data.IP + "] Đồng bộ lịch trình tới thiết bị thất bại", "red", "remove");
processProgress(1);
index++;
if (index < totals)
syncSchedule(fullData.lists[index].id, fullData.lists[index].ip, fullData);
else {
index = 0;
processProgress(1);
}
} else {
appendLogs("[" + data.IP + "] Đồng bộ lịch trình tới thiết bị thành công", "green", "check");