update gán lịch trình cho nhân viên
This commit is contained in:
@@ -267,4 +267,19 @@ table > tbody > tr.success >td>a {
|
||||
}
|
||||
.alert{
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
border: 1px groove #ddd !important;
|
||||
padding: 0 5px 5px 5px !important;
|
||||
margin: 0 0 1.5em 0 !important;
|
||||
-webkit-box-shadow: 0px 0px 0px 0px #000;
|
||||
box-shadow: 0px 0px 0px 0px #000;
|
||||
}
|
||||
|
||||
legend {
|
||||
width:inherit;
|
||||
font-size: 14px;
|
||||
border-bottom:none;
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
103
web/js/assign.js
Normal file
103
web/js/assign.js
Normal file
@@ -0,0 +1,103 @@
|
||||
$(function () {
|
||||
$("#schedule-department-tree").height($("#create-schedule-main").height() - 28);
|
||||
$("#schedule-door-lists").height($("#create-schedule-main").height() - 28);
|
||||
common.checkboxInit("door-schedule");
|
||||
});
|
||||
|
||||
var schedule = {};
|
||||
schedule.tree = function (e) {
|
||||
var stt = $(e).attr("data-stt");
|
||||
if (stt === "true") {
|
||||
$(e).removeClass("fa-minus-square-o").addClass("fa-plus-square-o").attr("data-stt", "false");
|
||||
$("#sub-department-schedule-" + $(e).attr("data")).addClass("hidden");
|
||||
} else {
|
||||
$(e).removeClass("fa-plus-square-o").addClass("fa-minus-square-o").attr("data-stt", "true");
|
||||
$("#sub-department-schedule-" + $(e).attr("data")).removeClass("hidden");
|
||||
}
|
||||
};
|
||||
schedule.chooseDepartment = function (e) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
$("#schedule-search-staff").html(data);
|
||||
$(".department-schedule").removeClass("department-schedule-active");
|
||||
$(e).addClass("department-schedule-active");
|
||||
common.checkboxInit("staff-schedule");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
};
|
||||
schedule.searchStaff = function (e) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
data: {
|
||||
key: $(e).val()
|
||||
},
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
$("#schedule-search-staff").html(data);
|
||||
$(".department-schedule").removeClass("department-schedule-active");
|
||||
common.checkboxInit("staff-schedule");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
};
|
||||
schedule.setSchedule = function (e) {
|
||||
var staffs = [];
|
||||
$.each($("input[name='checkbox-staff-schedule']:checked"), function () {
|
||||
if ($(this).val() !== "0") {
|
||||
staffs.push($(this).val());
|
||||
}
|
||||
});
|
||||
if (staffs.length == 0) {
|
||||
alert("Hãy chọn nhân viên");
|
||||
return;
|
||||
}
|
||||
var doors = [];
|
||||
$.each($("input[name='checkbox-door-schedule']:checked"), function () {
|
||||
if ($(this).val() !== "0") {
|
||||
doors.push($(this).val());
|
||||
}
|
||||
});
|
||||
if (doors.length == 0) {
|
||||
alert("Hãy chọn cửa");
|
||||
return;
|
||||
}
|
||||
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
data: {
|
||||
staffs: staffs,
|
||||
doors: doors,
|
||||
schedule: $("select[name='ScheduleLists']").val()
|
||||
},
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
notification.success("Đã lưu thông tin", 1000);
|
||||
$.each($("input[name='checkbox-staff-schedule']:checked"), function () {
|
||||
if ($(this).val() !== "0") {
|
||||
$("#schedule-staff-results-" + $(this).val()).html(data.schedule);
|
||||
$("#schedule-door-results-" + $(this).val()).html(data.doors);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user