CRUD laboratory

This commit is contained in:
2026-06-16 15:06:11 +07:00
parent f4c7af85e9
commit 09de1c3e92
12 changed files with 67 additions and 70 deletions

View File

@@ -11,12 +11,10 @@ $("#btnSave").on('click',function(e){
uid : data_id,
name: $('#name').val(),
email: $('#email').val(),
is_manager: isManager,
role_id: $('#role-id').val(),
password: $('#password').val(),
default_manager: $('#default-manager').val(),
signature: $('#signature').val(),
sample_source_id: ($('#role-id').val() == 6 ? $('#sample-source-id').val():0)
},
success:function(res){
handleMessage(res.success, res.message)
@@ -106,7 +104,7 @@ $('#modal-user').on('show.bs.modal', function (event) {
modal.find('.modal-body input[name="name"]').val(data.name);
modal.find('.modal-body input[name="email"]').val(data.email);
modal.find('.modal-body input[name="password"]').val('***************');
modal.find('.modal-body input[name="is_manager"]').prop( "checked", data.is_manager);
//modal.find('.modal-body input[name="is_manager"]').prop( "checked", data.is_manager);
modal.find('.modal-body select[name="role_id"]').val(data.role_id).trigger('change');
isManager = data.is_manager
if(data.role_id==6) {
@@ -139,8 +137,8 @@ $('#modal-user-labs').on('show.bs.modal', function (event) {
success:function(res){
let data = res.data;
organization_ids = []
if(data.lab_covers.length) {
$.each(data.lab_covers, function (key, value) {
if(data.user_organizations.length) {
$.each(data.user_organizations, function (key, value) {
organization_ids[key] = value.organization_id
});
}