add recalculate values
This commit is contained in:
@@ -15,4 +15,5 @@ public interface ICustomizeWorkshopEmployeeSettingsRepository : IRepository<long
|
||||
List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingNotInMainGroup(long entityWorkshopId);
|
||||
void RemoveByWorkshopIdAndEmployeeId(long workshopId, long employeeId);
|
||||
|
||||
bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command);
|
||||
}
|
||||
@@ -87,6 +87,9 @@ namespace Company.Domain.RollCallAgg
|
||||
long workshopId);
|
||||
|
||||
Task<List<RollCall>> GetRollCallsInShiftDate(DateTime rollCallShiftDate, long employeeId, long workshopId);
|
||||
|
||||
Task<List<RollCall>> GetRollCallsUntilNowWithWorkshopIdEmployeeIds(long workshopId, List<long> employeeIds,
|
||||
DateTime fromDate);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
|
||||
@@ -34,7 +36,8 @@ public interface ICustomizeWorkshopSettingsApplication
|
||||
OperationResult EditSimpleRollCallGroupSetting(EditCustomizeWorkshopGroupSettings command);
|
||||
|
||||
#region Vafa
|
||||
OperationResult EditSimpleRollCallEmployeeSetting(EditCustomizeEmployeeSettings command);
|
||||
OperationResult EditSimpleRollCallEmployeeSetting(EditCustomizeEmployeeSettings command,
|
||||
List<ReCalculateRollCallValues> reCalculateCommand);
|
||||
#endregion
|
||||
|
||||
OperationResult RemoveGroupSettings(long employeeSettingsId);
|
||||
@@ -89,4 +92,10 @@ public interface ICustomizeWorkshopSettingsApplication
|
||||
|
||||
|
||||
bool HasAnyEmployeeWithoutGroup(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// این متد چک میکند که آیا شیفت پرسنل تغییر کرده است یا نه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command);
|
||||
}
|
||||
@@ -42,6 +42,9 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
DateTime end);
|
||||
|
||||
List<RollCallsByDateViewModel> GetUndefinedRollCallWorkFlowsService(long workshopId, DateTime durationStart, DateTime durationEnd);
|
||||
|
||||
|
||||
|
||||
OperationResult RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, string dateFa);
|
||||
|
||||
|
||||
@@ -114,5 +117,18 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
|
||||
OperationResult SetModifyTypeToEditByEmployerForRollCallsInDate(long workshopId, long employeeId, string absenceDate);
|
||||
List<RollCallViewModel> GetWorkshopEmployeeRollCallsWithUndefinedForDate(long workshopId, long employeeId, string date);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه مجدد مقادیر حضور غیاب
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
OperationResult RecalculateValues(long workshopId, List<ReCalculateRollCallValues> command);
|
||||
}
|
||||
public class ReCalculateRollCallValues
|
||||
{
|
||||
public long EmployeeId { get; set; }
|
||||
public string FromDate { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,10 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -26,7 +29,8 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
IAuthHelper authHelper, IPasswordHasher passwordHasher, ICameraAccountApplication cameraAccountApplication,
|
||||
ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, IEmployeeRepository employeeRepository,
|
||||
ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository,
|
||||
IRollCallEmployeeApplication rollCallEmployeeApplication)
|
||||
IRollCallEmployeeApplication rollCallEmployeeApplication,
|
||||
IRollCallApplication rollCallAppllication)
|
||||
: ICustomizeWorkshopSettingsApplication
|
||||
{
|
||||
private readonly ICustomizeWorkshopSettingsRepository _customizeWorkshopSettingsRepository = customizeWorkshopSettingsRepository;
|
||||
@@ -37,8 +41,9 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
private readonly IPasswordHasher _passwordHasher = passwordHasher;
|
||||
private readonly ICameraAccountApplication _cameraAccountApplication = cameraAccountApplication;
|
||||
private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication = rollCallEmployeeApplication;
|
||||
private readonly IRollCallApplication _rollCallApplication = rollCallAppllication;
|
||||
|
||||
#region RollCallShifts
|
||||
#region RollCallShifts
|
||||
|
||||
//Create workshop settings
|
||||
public OperationResult CreateWorkshopSettings(CreateCustomizeWorkshopSettings command)
|
||||
@@ -102,7 +107,12 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
|
||||
if (previousEnd != new DateTime())
|
||||
{
|
||||
if (newShift.start <= previousEnd)
|
||||
if (newShift.start == previousEnd)
|
||||
{
|
||||
return op.Failed("در شیفت منظم پایان شیفت نمیتواند با شروع شیفت بعدی برابر باشد");
|
||||
}
|
||||
|
||||
if (newShift.start <= previousEnd)
|
||||
{
|
||||
newShift.start = newShift.start.AddDays(1);
|
||||
}
|
||||
@@ -242,7 +252,12 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
|
||||
if (previousEnd != new DateTime())
|
||||
{
|
||||
if (newShift.start <= previousEnd)
|
||||
if (newShift.start == previousEnd)
|
||||
{
|
||||
return op.Failed("در شیفت منظم پایان شیفت نمیتواند با شروع شیفت بعدی برابر باشد");
|
||||
}
|
||||
|
||||
if (newShift.start <= previousEnd)
|
||||
{
|
||||
newShift.start = newShift.start.AddDays(1);
|
||||
}
|
||||
@@ -340,17 +355,6 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return createDefaultEmployee;
|
||||
}
|
||||
|
||||
if (_customizeWorkshopEmployeeSettingsRepository.Exists(x =>
|
||||
x.WorkshopId == command.WorkshopId && command.EmployeeIds.First()== x.EmployeeId &&
|
||||
x.CustomizeWorkshopGroupSettingId == command.GroupId))
|
||||
{
|
||||
var employeeSettings = _customizeWorkshopEmployeeSettingsRepository
|
||||
.GetByEmployeeIdAndWorkshopIdIncludeGroupSettings(command.WorkshopId,command.EmployeeIds.First());
|
||||
|
||||
_customizeWorkshopEmployeeSettingsRepository.Remove(employeeSettings.id);
|
||||
_customizeWorkshopEmployeeSettingsRepository.SaveChanges();
|
||||
}
|
||||
|
||||
|
||||
List<CustomizeWorkshopEmployeeSettingsShift> shiftCollection = new List<CustomizeWorkshopEmployeeSettingsShift>();
|
||||
List<CustomizeRotatingShift> rotatingShift = [];
|
||||
@@ -412,7 +416,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return op.Failed("در شیفت منظم پایان شیفت نمیتواند با شروع شیفت بعدی برابر باشد");
|
||||
}
|
||||
|
||||
if (newShift.start <= previousEnd)
|
||||
if (newShift.start <= previousEnd)
|
||||
{
|
||||
newShift.start = newShift.start.AddDays(1);
|
||||
}
|
||||
@@ -599,7 +603,12 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
|
||||
if (previousEnd != new DateTime())
|
||||
{
|
||||
if (newShift.start <= previousEnd)
|
||||
if (newShift.start == previousEnd)
|
||||
{
|
||||
return op.Failed("در شیفت منظم پایان شیفت نمیتواند با شروع شیفت بعدی برابر باشد");
|
||||
}
|
||||
|
||||
if (newShift.start <= previousEnd)
|
||||
{
|
||||
newShift.start = newShift.start.AddDays(1);
|
||||
}
|
||||
@@ -758,7 +767,8 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
public OperationResult EditSimpleRollCallEmployeeSetting(EditCustomizeEmployeeSettings command)
|
||||
public OperationResult EditSimpleRollCallEmployeeSetting(EditCustomizeEmployeeSettings command,
|
||||
List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
@@ -774,7 +784,9 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
var groupSettings =
|
||||
_customizeWorkshopGroupSettingsRepository.GetIncludeWorkshopSettings(
|
||||
entity.CustomizeWorkshopGroupSettingId);
|
||||
|
||||
List<CustomizeWorkshopEmployeeSettingsShift> employeesShifts = [];
|
||||
|
||||
ICollection<CustomizeRotatingShift> rotatingShift = [];
|
||||
bool isChanged = false;
|
||||
if (command.WorkshopShiftStatus == WorkshopShiftStatus.Regular)
|
||||
@@ -833,7 +845,12 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
|
||||
if (previousEnd != new DateTime())
|
||||
{
|
||||
if (newShift.start <= previousEnd)
|
||||
if (newShift.start == previousEnd)
|
||||
{
|
||||
return op.Failed("در شیفت منظم پایان شیفت نمیتواند با شروع شیفت بعدی برابر باشد");
|
||||
}
|
||||
|
||||
if (newShift.start <= previousEnd)
|
||||
{
|
||||
newShift.start = newShift.start.AddDays(1);
|
||||
}
|
||||
@@ -928,13 +945,26 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
|
||||
}
|
||||
|
||||
|
||||
using var transaction = new TransactionScope();
|
||||
|
||||
entity.SimpleEdit(employeesShifts, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime,
|
||||
isChanged, command.FridayWork, command.HolidayWork,rotatingShift);
|
||||
|
||||
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
||||
if (reCalculateCommand.Count>0)
|
||||
{
|
||||
var result = _rollCallApplication.RecalculateValues(command.WorkshopId, reCalculateCommand);
|
||||
|
||||
if (result.IsSuccedded == false)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
transaction.Complete();
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
//Remove the Employee From the Group Settings
|
||||
@@ -994,7 +1024,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
//if (!_customizeWorkshopGroupSettingsRepository.Exists(x => x.id == command.GroupId))
|
||||
// return op.Failed("چنین گروهی وجود ندارد");
|
||||
|
||||
if (!_employeeRepository.Exists(x => command.EmployeeIds.Any(y => x.id == y)))
|
||||
if (!_employeeRepository.ExistsIgnoreQueryFilter(x => command.EmployeeIds.Any(y => x.id == y)))
|
||||
return op.Failed("چنین پرسنلی وجود ندارد");
|
||||
|
||||
#endregion
|
||||
@@ -1392,7 +1422,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
if (entity == null)
|
||||
return null;
|
||||
|
||||
string employeeFullName = _employeeRepository.Get(entity.EmployeeId).FullName;
|
||||
string employeeFullName = _employeeRepository.GetIgnoreQueryFilter(entity.EmployeeId).FullName;
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
EmployeeId = entity.EmployeeId,
|
||||
@@ -1497,6 +1527,11 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return _customizeWorkshopGroupSettingsRepository.HasAnyEmployeeWithoutGroup(workshopId);
|
||||
}
|
||||
|
||||
public bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command)
|
||||
{
|
||||
return _customizeWorkshopEmployeeSettingsRepository.CheckEmployeeShiftHasChanged(command);
|
||||
}
|
||||
|
||||
private OperationResult CreateGeneralGroup(CustomizeWorkshopSettings entity)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
|
||||
@@ -49,7 +49,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly ICustomizeWorkshopSettingsApplication _customizeWorkshopSettingsApplication;
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
private readonly IEmployeeDocumentsRepository _employeeDocumentsRepository;
|
||||
private readonly IEmployeeBankInformationApplication _employeeBankInformationApplication;
|
||||
private readonly ILeftWorkTempRepository _leftWorkTempRepository;
|
||||
private readonly IUidService _uidService;
|
||||
@@ -57,9 +56,14 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
|
||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository) : base(context)
|
||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context,
|
||||
IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment,
|
||||
IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository,
|
||||
ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication,
|
||||
IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository,
|
||||
IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository,
|
||||
IEmployeeClientTempRepository employeeClientTempRepository, ILeftWorkRepository leftWorkRepository) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_WorkShopRepository = workShopRepository;
|
||||
@@ -68,14 +72,12 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_customizeWorkshopSettingsApplication = customizeWorkshopSettingsApplication;
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
_employeeDocumentsRepository = employeeDocumentsRepository;
|
||||
_employeeBankInformationApplication = employeeBankInformationApplication;
|
||||
_leftWorkTempRepository = leftWorkTempRepository;
|
||||
_uidService = uidService;
|
||||
_customizeWorkshopEmployeeSettingsRepository = customizeWorkshopEmployeeSettingsRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_employeeClientTempRepository = employeeClientTempRepository;
|
||||
_customizeWorkshopGroupSettingsRepository = customizeWorkshopGroupSettingsRepository;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_EmployeeRepository = employeeRepository;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
using Company.Domain.CustomizeWorkshopSettingsAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
@@ -24,7 +25,6 @@ namespace CompanyManagment.Application;
|
||||
public class RollCallApplication : IRollCallApplication
|
||||
{
|
||||
private readonly IRollCallRepository _rollCallRepository;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ILeaveRepository _leaveRepository;
|
||||
@@ -33,11 +33,11 @@ public class RollCallApplication : IRollCallApplication
|
||||
private readonly IRollCallDomainService _rollCallDomainService;
|
||||
private readonly ICustomizeWorkshopSettingsRepository _customizeWorkshopSettingsRepository;
|
||||
private readonly ICustomizeWorkshopEmployeeSettingsRepository _customizeWorkshopEmployeeSettingsRepository;
|
||||
private readonly ICustomizeCheckoutTempRepository _customizeCheckoutTempRepository;
|
||||
|
||||
public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, ILeaveRepository leaveRepository, ICustomizeCheckoutRepository customizeCheckoutRepository, ICheckoutRepository checkoutRepository, IRollCallDomainService rollCallDomainService, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository)
|
||||
public RollCallApplication(IRollCallRepository rollCallRepository, IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, ILeaveRepository leaveRepository, ICustomizeCheckoutRepository customizeCheckoutRepository, ICheckoutRepository checkoutRepository, IRollCallDomainService rollCallDomainService, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository)
|
||||
{
|
||||
_rollCallRepository = rollCallRepository;
|
||||
_employeeApplication = employeeApplication;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_leaveRepository = leaveRepository;
|
||||
@@ -46,7 +46,8 @@ public class RollCallApplication : IRollCallApplication
|
||||
_rollCallDomainService = rollCallDomainService;
|
||||
_customizeWorkshopSettingsRepository = customizeWorkshopSettingsRepository;
|
||||
_customizeWorkshopEmployeeSettingsRepository = customizeWorkshopEmployeeSettingsRepository;
|
||||
}
|
||||
_customizeCheckoutTempRepository = customizeCheckoutTempRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateRollCall command)
|
||||
{
|
||||
@@ -55,7 +56,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
|
||||
var yearFa = Convert.ToInt32(startDateFa.Substring(0, 4));
|
||||
var monthFa = Convert.ToInt32(startDateFa.Substring(5, 2));
|
||||
var employeeName = _employeeApplication.GetDetails(command.EmployeeId).EmployeeFullName;
|
||||
var employeeName = _employeeRepository.GetDetails(command.EmployeeId).EmployeeFullName;
|
||||
var create = new RollCall(command.WorkshopId, command.EmployeeId, employeeName, command.StartDate.Value, null,
|
||||
yearFa, monthFa, _rollCallDomainService);
|
||||
_rollCallRepository.Create(create);
|
||||
@@ -772,4 +773,56 @@ public class RollCallApplication : IRollCallApplication
|
||||
{
|
||||
return _rollCallRepository.CheckRepeat(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public OperationResult RecalculateValues(long workshopId, List<ReCalculateRollCallValues> commands)
|
||||
{
|
||||
var operationResult = new OperationResult();
|
||||
try
|
||||
{
|
||||
List<DateTime> fromDates = commands.Select(x => x.FromDate.ToGeorgianDateTime()).ToList();
|
||||
var employeeIds = commands.Select(x => x.EmployeeId).ToList();
|
||||
if (_checkoutRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش رسمی است");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش غیررسمی نهایی است");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش غیررسمی موقت است");
|
||||
}
|
||||
|
||||
var oldestDate = commands.MinBy(x => x.FromDate).FromDate.ToGeorgianDateTime();
|
||||
|
||||
var allRollCalls = _rollCallRepository
|
||||
.GetRollCallsUntilNowWithWorkshopIdEmployeeIds(workshopId, commands.Select(x => x.EmployeeId).ToList(),
|
||||
oldestDate).GetAwaiter().GetResult();
|
||||
|
||||
|
||||
foreach (var command in commands)
|
||||
{
|
||||
var rollCalls = allRollCalls
|
||||
.Where(x => x.EmployeeId == command.EmployeeId && x.ShiftDate >= command.FromDate.ToGeorgianDateTime()).ToList();
|
||||
|
||||
foreach (var rollCall in rollCalls)
|
||||
{
|
||||
rollCall.ClearTimeDiff();
|
||||
_rollCallRepository.SaveChanges();
|
||||
rollCall.SetEndDateTime(rollCall.EndDate!.Value, _rollCallDomainService);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return operationResult.Succcedded();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return operationResult.Failed(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg.Entities;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
@@ -174,4 +177,65 @@ public class CustomizeWorkshopEmployeeSettingsRepository(CompanyContext companyC
|
||||
if (entity != null)
|
||||
Remove(entity);
|
||||
}
|
||||
|
||||
public bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command)
|
||||
{
|
||||
var employeeSettings = _companyContext.CustomizeWorkshopEmployeeSettings.Find(command.Id);
|
||||
if (employeeSettings == null)
|
||||
{
|
||||
throw new InvalidDataException();
|
||||
}
|
||||
|
||||
if (command.WorkshopShiftStatus != employeeSettings.WorkshopShiftStatus)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (employeeSettings.WorkshopShiftStatus)
|
||||
{
|
||||
case WorkshopShiftStatus.Irregular:
|
||||
if (command.IrregularShift != employeeSettings.IrregularShift)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case WorkshopShiftStatus.Rotating:
|
||||
var rotatingShift = command.CustomizeRotatingShifts
|
||||
.Select(x => new CustomizeRotatingShift(TimeOnly.Parse(x.StartTime), TimeOnly.Parse(x.EndTime)))
|
||||
.ToList();
|
||||
|
||||
if (!rotatingShift.All(x => employeeSettings.CustomizeRotatingShifts.Any(x.Equals)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case WorkshopShiftStatus.Regular:
|
||||
var employeesShifts =
|
||||
command.ShiftViewModel.Select(x =>
|
||||
{
|
||||
var placement = x.Placement switch
|
||||
{
|
||||
ShiftPlacement.First => "اول",
|
||||
ShiftPlacement.Second => "دوم",
|
||||
ShiftPlacement.Third => "سوم"
|
||||
};
|
||||
if (!TimeOnly.TryParseExact(x.StartTime, "HH:mm", out TimeOnly start))
|
||||
throw new InvalidDataException($"فرمت شروع نوبت{placement}نادرست است");
|
||||
if (!TimeOnly.TryParseExact(x.EndTime, "HH:mm", out TimeOnly end))
|
||||
throw new InvalidDataException($"فرمت پایان نوبت{placement}نادرست است");
|
||||
|
||||
|
||||
return new CustomizeWorkshopEmployeeSettingsShift(start, end, x.Placement);
|
||||
|
||||
}).ToList();
|
||||
if (!employeesShifts.All(x => employeeSettings.CustomizeWorkshopEmployeeSettingsShifts.Any(x.Equals)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2049,5 +2049,12 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public async Task<List<RollCall>> GetRollCallsUntilNowWithWorkshopIdEmployeeIds(long workshopId, List<long> employeeIds, DateTime fromDate)
|
||||
{
|
||||
return await _context.RollCalls.Where(x =>
|
||||
x.ShiftDate >= fromDate && x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) &&
|
||||
x.EndDate != null).ToListAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
@@ -221,54 +222,54 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
|
||||
return Partial("ModalEditEmployeeFromGroup", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostChangeEditEmployee(EditCustomizeEmployeeSettings command, long workshopId)
|
||||
{
|
||||
command.WorkshopId = workshopId;
|
||||
OperationResult result = _customizeWorkshopSettingsApplication.EditSimpleRollCallEmployeeSetting(command);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
public IActionResult OnPostChangeEditEmployee(EditCustomizeEmployeeSettings command, long workshopId, List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
{
|
||||
command.WorkshopId = workshopId;
|
||||
OperationResult result = _customizeWorkshopSettingsApplication.EditSimpleRollCallEmployeeSetting(command, reCalculateCommand);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
// public IActionResult OnGetGroupingSetting(long groupId)
|
||||
// {
|
||||
// var command = _customizeWorkshopSettingsApplication.GetCustomizeWorkshopGroupSettingsDetails(groupId);
|
||||
// public IActionResult OnGetGroupingSetting(long groupId)
|
||||
// {
|
||||
// var command = _customizeWorkshopSettingsApplication.GetCustomizeWorkshopGroupSettingsDetails(groupId);
|
||||
|
||||
// return Partial("ModalSettingGroup", command);
|
||||
//}
|
||||
// return Partial("ModalSettingGroup", command);
|
||||
//}
|
||||
|
||||
// public IActionResult OnPostGroupingSetting(EditCustomizeWorkshopGroupSettings command)
|
||||
// {
|
||||
// command.EmployeeIds = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByGroupSettingsId(command.Id).Select(x => x.EmployeeId).ToList();
|
||||
// OperationResult result = _customizeWorkshopSettingsApplication.EditRollCallGroupSetting(command);
|
||||
// public IActionResult OnPostGroupingSetting(EditCustomizeWorkshopGroupSettings command)
|
||||
// {
|
||||
// command.EmployeeIds = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByGroupSettingsId(command.Id).Select(x => x.EmployeeId).ToList();
|
||||
// OperationResult result = _customizeWorkshopSettingsApplication.EditRollCallGroupSetting(command);
|
||||
|
||||
// return new JsonResult(new
|
||||
// {
|
||||
// isSuccess = result.IsSuccedded,
|
||||
// message = result.Message
|
||||
// });
|
||||
//}
|
||||
// return new JsonResult(new
|
||||
// {
|
||||
// isSuccess = result.IsSuccedded,
|
||||
// message = result.Message
|
||||
// });
|
||||
//}
|
||||
|
||||
//public IActionResult OnGetGroupingEmployeeSetting(long customizeEmployeeId, List<long> employeeId)
|
||||
// {
|
||||
// var command = _customizeWorkshopSettingsApplication.GetCustomizeEmployeeSettingsDetails(customizeEmployeeId);
|
||||
// command.EmployeeIds = employeeId;
|
||||
//public IActionResult OnGetGroupingEmployeeSetting(long customizeEmployeeId, List<long> employeeId)
|
||||
// {
|
||||
// var command = _customizeWorkshopSettingsApplication.GetCustomizeEmployeeSettingsDetails(customizeEmployeeId);
|
||||
// command.EmployeeIds = employeeId;
|
||||
|
||||
// return Partial("ModalSettingGroupEmployee", command);
|
||||
// }
|
||||
// return Partial("ModalSettingGroupEmployee", command);
|
||||
// }
|
||||
|
||||
// public IActionResult OnPostGroupingEmployeeSetting(EditCustomizeEmployeeSettings command)
|
||||
// {
|
||||
// command.WorkshopId = _workshopId;
|
||||
// OperationResult result = _customizeWorkshopSettingsApplication.EditRollCallEmployeeSettings(command);
|
||||
// public IActionResult OnPostGroupingEmployeeSetting(EditCustomizeEmployeeSettings command)
|
||||
// {
|
||||
// command.WorkshopId = _workshopId;
|
||||
// OperationResult result = _customizeWorkshopSettingsApplication.EditRollCallEmployeeSettings(command);
|
||||
|
||||
// return new JsonResult(new
|
||||
// {
|
||||
// isSuccess = result.IsSuccedded,
|
||||
// message = result.Message
|
||||
// });
|
||||
//}
|
||||
}
|
||||
// return new JsonResult(new
|
||||
// {
|
||||
// isSuccess = result.IsSuccedded,
|
||||
// message = result.Message
|
||||
// });
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using CompanyManagement.Infrastructure.Excel.CWS;
|
||||
using CompanyManagement.Infrastructure.Excel.EmployeeBankInfo;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
{
|
||||
@@ -30,13 +31,14 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
private readonly ICustomizeWorkshopSettingsApplication _customizeWorkshopSettingsApplication;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IRollCallApplication _rollCallApplication;
|
||||
public bool GroupedAllEmployees;
|
||||
private readonly long _workshopId;
|
||||
public string WorkshopFullName;
|
||||
public CustomizeWorkshopSettingsViewModel RollCallWorkshopSettings;
|
||||
public List<RollCallEmployeeViewModel> RollCallEmployeeList;
|
||||
|
||||
public GroupingModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, ICustomizeWorkshopSettingsApplication rollCallWorkshopSettingsApplication, IEmployeeApplication employeeApplication, IHttpContextAccessor contextAccessor, IAuthHelper authHelper, IRollCallEmployeeApplication rollCallEmployeeApplication)
|
||||
public GroupingModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, ICustomizeWorkshopSettingsApplication rollCallWorkshopSettingsApplication, IEmployeeApplication employeeApplication, IHttpContextAccessor contextAccessor, IAuthHelper authHelper, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallApplication rollCallApplication)
|
||||
{
|
||||
_passwordHasher = passwordHasher;
|
||||
_workshopApplication = workshopApplication;
|
||||
@@ -45,6 +47,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
_contextAccessor = contextAccessor;
|
||||
_authHelper = authHelper;
|
||||
_rollCallEmployeeApplication = rollCallEmployeeApplication;
|
||||
_rollCallApplication = rollCallApplication;
|
||||
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
@@ -244,10 +247,21 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
return Partial("ModalEditEmployeeFromGroup", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostChangeEditEmployee(EditCustomizeEmployeeSettings command)
|
||||
public IActionResult OnGetEmployeesHaveToChange(long groupId, bool isChange)
|
||||
{
|
||||
command.WorkshopId = _workshopId;
|
||||
OperationResult result = _customizeWorkshopSettingsApplication.EditSimpleRollCallEmployeeSetting(command);
|
||||
var result = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByGroupSettingsId(groupId)
|
||||
.Where(x => x.IsSettingChanged = isChange).ToList();
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = result
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostChangeEditEmployee(EditCustomizeEmployeeSettings command, List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
{
|
||||
command.WorkshopId = _workshopId;
|
||||
OperationResult result = _customizeWorkshopSettingsApplication.EditSimpleRollCallEmployeeSetting(command, reCalculateCommand);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
@@ -255,6 +269,26 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetEmployeeSettingsHasChangedValue(EditCustomizeEmployeeSettings command)
|
||||
{
|
||||
var employeeChange = _customizeWorkshopSettingsApplication.CheckEmployeeShiftHasChanged(command);
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = employeeChange
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostReCalculateValues(List<ReCalculateRollCallValues> command)
|
||||
{
|
||||
var result = _rollCallApplication.RecalculateValues(_workshopId, command);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetDownloadExcel()
|
||||
{
|
||||
var groupData = _customizeWorkshopSettingsApplication.GetWorkshopSettingsByWorkshopIdForAdmin(_workshopId);
|
||||
|
||||
@@ -12,434 +12,454 @@
|
||||
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center mb-0 pb-0">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<h6>ویرایش ساعت کاری پرسنل @Model.EmployeeFullName</h6>
|
||||
</div>
|
||||
<div class="modal-body pt-2">
|
||||
<div class="modal-header d-block text-center mb-0 pb-0">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<h6>ویرایش ساعت کاری پرسنل @Model.EmployeeFullName</h6>
|
||||
</div>
|
||||
<div class="modal-body pt-2">
|
||||
|
||||
<form role="form" method="post" name="edit-employee-form" id="edit-employee-form" autocomplete="off">
|
||||
<form role="form" method="post" name="edit-employee-form" id="edit-employee-form" autocomplete="off">
|
||||
|
||||
<input type="hidden" name="Command.Id" value="@Model.Id" />
|
||||
<input type="hidden" name="Command.Id" value="@Model.Id" />
|
||||
|
||||
@foreach (var itemEmployee in Model.EmployeeIds)
|
||||
{
|
||||
<input type="hidden" name="Command.EmployeeIds[@indexEmployee]" value="@itemEmployee" />
|
||||
indexEmployee++;
|
||||
}
|
||||
@foreach (var itemEmployee in Model.EmployeeIds)
|
||||
{
|
||||
<input type="hidden" name="Command.EmployeeIds[@indexEmployee]" value="@itemEmployee" />
|
||||
indexEmployee++;
|
||||
}
|
||||
|
||||
|
||||
<div class="container p-0 m-0">
|
||||
<div class="container p-0 m-0">
|
||||
|
||||
<div class="row">
|
||||
<div class="lableCheckBreakTime">نام گروه</div>
|
||||
<div class="col-12 d-flex align-items-center">
|
||||
<input type="text" class="form-control" value="@Model.NameGroup" placeholder="نام گروه را وارد نمایید" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="lableCheckBreakTime">نام گروه</div>
|
||||
<div class="col-12 d-flex align-items-center">
|
||||
<input type="text" class="form-control" value="@Model.NameGroup" placeholder="نام گروه را وارد نمایید" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-0">
|
||||
<div class="d-flex flex-column align-items-center justify-content-center h-100">
|
||||
<div class="d-flex align-items-center justify-content-center mt-3 mb-1">
|
||||
<p class="m-0">ساعات کاری پرسنل را مشخص نمائید</p>
|
||||
</div>
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center w-100">
|
||||
<input type="radio" value="Regular" name="Command.workshopShiftStatus" id="organized" class="radio-workTimeOption">
|
||||
<label for="organized" class="radio-label-workTimeOption w-100">منظم</label>
|
||||
<div class="row p-0">
|
||||
<div class="d-flex flex-column align-items-center justify-content-center h-100">
|
||||
<div class="d-flex align-items-center justify-content-center mt-3 mb-1">
|
||||
<p class="m-0">ساعات کاری پرسنل را مشخص نمائید</p>
|
||||
</div>
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center w-100">
|
||||
<input type="radio" value="Regular" name="Command.workshopShiftStatus" id="organized" class="radio-workTimeOption">
|
||||
<label for="organized" class="radio-label-workTimeOption w-100">منظم</label>
|
||||
|
||||
<input type="radio" value="Rotating" name="Command.workshopShiftStatus" id="rotating_shift" class="radio-workTimeOption">
|
||||
<label for="rotating_shift" class="radio-label-workTimeOption w-100">گردشی</label>
|
||||
<input type="radio" value="Rotating" name="Command.workshopShiftStatus" id="rotating_shift" class="radio-workTimeOption">
|
||||
<label for="rotating_shift" class="radio-label-workTimeOption w-100">گردشی</label>
|
||||
|
||||
<input type="radio" value="Irregular" name="Command.workshopShiftStatus" id="disorganized" class="radio-workTimeOption">
|
||||
<label for="disorganized" class="radio-label-workTimeOption w-100">مختلط</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="radio" value="Irregular" name="Command.workshopShiftStatus" id="disorganized" class="radio-workTimeOption">
|
||||
<label for="disorganized" class="radio-label-workTimeOption w-100">مختلط</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2" id="step_workTimeOption" style="height: 0; display: none">
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
<div class="row mt-2" id="step_workTimeOption" style="height: 0; display: none">
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
|
||||
@if (Model.ShiftViewModel.Any())
|
||||
{
|
||||
@foreach (var item in Model.ShiftViewModel)
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<input type="hidden" name="Command.ShiftViewModel[@iteration].Placement" value="@item.Placement"/>
|
||||
<div class="timeWorkTitle">
|
||||
@(item.Placement.ToString() == "First" ? "نوبت اول" : (item.Placement.ToString() == "Second" ? "نوبت دوم" : "نوبت سوم"))
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[@iteration].StartTime" value="@item.StartTime" placeholder="00:00" style="direction: ltr;"/>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[@iteration].EndTime" value="@item.EndTime" placeholder="00:00" style="direction: ltr;"/>
|
||||
</div>
|
||||
@if (iteration == 0)
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M6.875 11H15.125" stroke="white"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
iteration++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<input type="hidden" name="Command.ShiftViewModel[0].Placement" value="First"/>
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[0].StartTime" value="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[0].EndTime" value="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
|
||||
@if (Model.ShiftViewModel.Any())
|
||||
{
|
||||
@foreach (var item in Model.ShiftViewModel)
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<input type="hidden" name="Command.ShiftViewModel[@iteration].Placement" value="@item.Placement"/>
|
||||
<div class="timeWorkTitle">
|
||||
@(item.Placement.ToString() == "First" ? "نوبت اول" : (item.Placement.ToString() == "Second" ? "نوبت دوم" : "نوبت سوم"))
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWork @(Model.ShiftViewModel.Count() == 3 ? "d-none" : "")">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
@if (Model.ShiftViewModel.Count() == 2)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت سوم</div>
|
||||
}
|
||||
else if (Model.ShiftViewModel.Count() == 1)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت دوم</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork"></div>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="m-0" id="ShowSettingMessage"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[@iteration].StartTime" value="@item.StartTime" placeholder="00:00" style="direction: ltr;"/>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2" id="step_workTimeOptionRotatingShift" style="height: 0; display: none">
|
||||
<div class="col-12" id="appendChildTimeWorkHtmlRS">
|
||||
|
||||
@if (Model.CustomizeRotatingShifts.Any())
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[@iteration].EndTime" value="@item.EndTime" placeholder="00:00" style="direction: ltr;"/>
|
||||
</div>
|
||||
@if (iteration == 0)
|
||||
{
|
||||
@foreach (var item in Model.CustomizeRotatingShifts)
|
||||
{
|
||||
|
||||
<div class="groupBoxRS">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
@if (iterationRS == 0)
|
||||
{
|
||||
@("نوبت اول")
|
||||
}
|
||||
else if (iterationRS == 1)
|
||||
{
|
||||
@("نوبت دوم")
|
||||
}
|
||||
else if (iterationRS == 2)
|
||||
{
|
||||
@("نوبت سوم")
|
||||
}
|
||||
else if (iterationRS == 3)
|
||||
{
|
||||
@("نوبت چهارم")
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" name="Command.CustomizeRotatingShifts[@iterationRS].StartTime" value="@item.StartTime" placeholder="00:00" style="direction: ltr;" />
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" name="Command.CustomizeRotatingShifts[@iterationRS].EndTime" value="@item.EndTime" placeholder="00:00" style="direction: ltr;" />
|
||||
</div>
|
||||
@if (iterationRS == 0)
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWorkRS">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white" />
|
||||
<path d="M6.875 11H15.125" stroke="white" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@{
|
||||
iterationRS++;
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="groupBoxRS">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">نوبت اول</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" id="startDateTimeRS" name="Command.CustomizeRotatingShifts[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" id="endDateTimeRS" name="Command.CustomizeRotatingShifts[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M6.875 11H15.125" stroke="white"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWorkRS @(Model.CustomizeRotatingShifts.Count() == 4 ? "d-none" : "")">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
iteration++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
|
||||
@if (Model.CustomizeRotatingShifts.Count() == 1)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت دوم</div>
|
||||
}
|
||||
else if (Model.CustomizeRotatingShifts.Count() == 2)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت سوم</div>
|
||||
}
|
||||
else if (Model.CustomizeRotatingShifts.Count() == 3)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت چهارم</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS"></div>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="m-0" id="ShowSettingMessageRS"></p>
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<input type="hidden" name="Command.ShiftViewModel[0].Placement" value="First"/>
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-0" id="step_workTimeOptionIrregular" style="height: 0; gap: 12px; @(Model.WorkshopShiftStatus == WorkshopShiftStatus.Regular ? "display: none" : "")">
|
||||
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center mt-4">
|
||||
<input type="radio" id="TwelveTwentyFour" value="@WorkshopIrregularShifts.TwelveTwentyFour" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwelveTwentyFour ? "checked" : "")>
|
||||
<label for="TwelveTwentyFour" class="radio-label-workTimeOption w-100 outlineDate">12 ساعت کار 24 ساعت استراحت</label>
|
||||
|
||||
<input type="radio" id="TwentyFourTwentyFour" value="@WorkshopIrregularShifts.TwentyFourTwentyFour" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwentyFourTwentyFour ? "checked" : "")>
|
||||
<label for="TwentyFourTwentyFour" class="radio-label-workTimeOption w-100 outlineDate">24 ساعت کار 24 ساعت استراحت</label>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[0].StartTime" value="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center">
|
||||
<input type="radio" id="TwelveThirtySix" value="@WorkshopIrregularShifts.TwelveThirtySix" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwelveThirtySix ? "checked" : "")>
|
||||
<label for="TwelveThirtySix" class="radio-label-workTimeOption w-100 outlineDate">12 ساعت کار 36 ساعت استراحت</label>
|
||||
|
||||
<input type="radio" id="TwentyFourFortyEight" value="@WorkshopIrregularShifts.TwentyFourFortyEight" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwentyFourFortyEight ? "checked" : "")>
|
||||
<label for="TwentyFourFortyEight" class="radio-label-workTimeOption w-100 outlineDate">24 ساعت کار 48 ساعت استراحت</label>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[0].EndTime" value="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="hrLine"></div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="groupBoxIrregular @(Model.WorkshopShiftStatus != WorkshopShiftStatus.Regular ? "" : "disable")" id="irregularShiftsDateTime">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle"></div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" id="irregularShiftsStartDateTime" value="@Model.IrregularShift.StartTime.ToString("HH:mm")" name="Command.IrregularShift.StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" id="irregularShiftsEndDateTime" value="@Model.IrregularShift.EndTime.ToString("HH:mm")" name="Command.IrregularShift.EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="container my-2">
|
||||
<div class="row breack-time">
|
||||
<div>
|
||||
<div class="d-flex align-items-center my-1 breakTimeDiv">
|
||||
<input type="checkbox" id="BreakTimeFirst" name="BreakTime.hasBreakTimeValue" class="form-check-input" @(Model.BreakTime.BreakTimeType == BreakTimeType.WithoutTime ? "checked" : "")>
|
||||
<label for="BreakTimeFirst" class="lableCheckBreakTime">
|
||||
این پرسنل دارای ساعت استراحت نامشخص می باشد با انتخاب این تیک پرسنل باید برای استراحت ورود و خروج ثبت کند.
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWork @(Model.ShiftViewModel.Count() == 3 ? "d-none" : "")">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
@if (Model.ShiftViewModel.Count() == 2)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت سوم</div>
|
||||
}
|
||||
else if (Model.ShiftViewModel.Count() == 1)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت دوم</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork"></div>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="m-0" id="ShowSettingMessage"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="d-block">
|
||||
<div class="d-flex align-items-center my-1 breakTimeDiv">
|
||||
<input type="checkbox" id="BreakTime" name="BreakTime.hasBreakTimeValue" class="form-check-input" @(Model.BreakTime.BreakTimeType == BreakTimeType.WithTime ? "checked" : "")>
|
||||
<label for="BreakTime" class="lableCheckBreakTime">
|
||||
این پرسنل دارای ساعت استراحت ثابت روزانه می باشد که بصورت خودکار در فیش حقوقی محاسبه می گردد:
|
||||
</label>
|
||||
</div>
|
||||
<div class="row mt-2" id="step_workTimeOptionRotatingShift" style="height: 0; display: none">
|
||||
<div class="col-12" id="appendChildTimeWorkHtmlRS">
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center my-1 mt-3 @(Model.BreakTime.BreakTimeType == BreakTimeType.None || Model.BreakTime.BreakTimeType == BreakTimeType.WithoutTime ? "disable" : "")" id="computeTime">
|
||||
<div class="position-relative">
|
||||
<label for="hour" class="position-absolute" style="bottom: 25px; font-size: 13px; font-weight: 700; right: 5px; background-color: #fff; padding: 0 4px;">ساعت</label>
|
||||
<select id="hour" asp-for="@Model.BreakTime.BreakTimeValue.Hour" name="selectCheckBreakTime" class="form-select selectCheckBreakTime">
|
||||
<option value="0" selected>ساعت</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
</select>
|
||||
</div>
|
||||
<span class="mx-1">:</span>
|
||||
<div class="position-relative">
|
||||
<label for="min" class="position-absolute" style="bottom: 25px; font-size: 13px; font-weight: 700; right: 5px; background-color: #fff; padding: 0 4px;">دقیقه</label>
|
||||
<select id="min" asp-for="@Model.BreakTime.BreakTimeValue.Minute" name="selectCheckBreakTime" class="form-select selectCheckBreakTime">
|
||||
<option value="00" selected>دقیقه</option>
|
||||
<option value="5">5</option>
|
||||
<option value="10">10</option>
|
||||
<option value="15">15</option>
|
||||
<option value="20">20</option>
|
||||
<option value="25">25</option>
|
||||
<option value="30">30</option>
|
||||
<option value="35">35</option>
|
||||
<option value="40">40</option>
|
||||
<option value="45">45</option>
|
||||
<option value="50">50</option>
|
||||
<option value="55">55</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" id="TimeOnly" name="Command.BreakTime.BreakTimeValue" value="@Model.BreakTime.BreakTimeValue.ToString("HH:mm")"/>
|
||||
@* <span class="mx-1" id="computeTimeText"></span> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Model.CustomizeRotatingShifts.Any())
|
||||
{
|
||||
@foreach (var item in Model.CustomizeRotatingShifts)
|
||||
{
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-12">
|
||||
<div class="lableCheckBreakTime text-center">وضعیت فعالیت مجموعه در روز های جمعه و تعطیلات رسمی</div>
|
||||
<div class="row extraOptionBorder">
|
||||
|
||||
<div class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||
</div>
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های تعطیلات رسمی</div> *@
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays1" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.Default ? "checked" : "") value="@((int)(HolidayWork.Default))" />
|
||||
<label for="OffDays1" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار نمیکند.</label>
|
||||
</div>
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays2" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.WorkInHolidays ? "checked" : "") value="@((int)(HolidayWork.WorkInHolidays))" />
|
||||
<label for="OffDays2" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار میکند.</label>
|
||||
</div>
|
||||
<div class="groupBoxRS">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
@if (iterationRS == 0)
|
||||
{
|
||||
@("نوبت اول")
|
||||
}
|
||||
else if (iterationRS == 1)
|
||||
{
|
||||
@("نوبت دوم")
|
||||
}
|
||||
else if (iterationRS == 2)
|
||||
{
|
||||
@("نوبت سوم")
|
||||
}
|
||||
else if (iterationRS == 3)
|
||||
{
|
||||
@("نوبت چهارم")
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" name="Command.CustomizeRotatingShifts[@iterationRS].StartTime" value="@item.StartTime" placeholder="00:00" style="direction: ltr;" />
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" name="Command.CustomizeRotatingShifts[@iterationRS].EndTime" value="@item.EndTime" placeholder="00:00" style="direction: ltr;" />
|
||||
</div>
|
||||
@if (iterationRS == 0)
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white" />
|
||||
<path d="M6.875 11H15.125" stroke="white" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@{
|
||||
iterationRS++;
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="groupBoxRS">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">نوبت اول</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" id="startDateTimeRS" name="Command.CustomizeRotatingShifts[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" id="endDateTimeRS" name="Command.CustomizeRotatingShifts[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWorkRS @(Model.CustomizeRotatingShifts.Count() == 4 ? "d-none" : "")">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 d-flex justify-content-center w-100">انصراف</button>
|
||||
@if (Model.CustomizeRotatingShifts.Count() == 1)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت دوم</div>
|
||||
}
|
||||
else if (Model.CustomizeRotatingShifts.Count() == 2)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت سوم</div>
|
||||
}
|
||||
else if (Model.CustomizeRotatingShifts.Count() == 3)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت چهارم</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS"></div>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="m-0" id="ShowSettingMessageRS"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-0" id="step_workTimeOptionIrregular" style="height: 0; gap: 12px; @(Model.WorkshopShiftStatus == WorkshopShiftStatus.Regular ? "display: none" : "")">
|
||||
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center mt-4">
|
||||
<input type="radio" id="TwelveTwentyFour" value="@WorkshopIrregularShifts.TwelveTwentyFour" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwelveTwentyFour ? "checked" : "")>
|
||||
<label for="TwelveTwentyFour" class="radio-label-workTimeOption w-100 outlineDate">12 ساعت کار 24 ساعت استراحت</label>
|
||||
|
||||
<input type="radio" id="TwentyFourTwentyFour" value="@WorkshopIrregularShifts.TwentyFourTwentyFour" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwentyFourTwentyFour ? "checked" : "")>
|
||||
<label for="TwentyFourTwentyFour" class="radio-label-workTimeOption w-100 outlineDate">24 ساعت کار 24 ساعت استراحت</label>
|
||||
</div>
|
||||
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center">
|
||||
<input type="radio" id="TwelveThirtySix" value="@WorkshopIrregularShifts.TwelveThirtySix" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwelveThirtySix ? "checked" : "")>
|
||||
<label for="TwelveThirtySix" class="radio-label-workTimeOption w-100 outlineDate">12 ساعت کار 36 ساعت استراحت</label>
|
||||
|
||||
<input type="radio" id="TwentyFourFortyEight" value="@WorkshopIrregularShifts.TwentyFourFortyEight" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwentyFourFortyEight ? "checked" : "")>
|
||||
<label for="TwentyFourFortyEight" class="radio-label-workTimeOption w-100 outlineDate">24 ساعت کار 48 ساعت استراحت</label>
|
||||
</div>
|
||||
|
||||
<div class="hrLine"></div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="groupBoxIrregular @(Model.WorkshopShiftStatus != WorkshopShiftStatus.Regular ? "" : "disable")" id="irregularShiftsDateTime">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle"></div>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" id="btnSave" class="btn-register w-100" onclick="ajaxEditEmployeeSaveData()">ثبت ویرایش</button>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" id="irregularShiftsStartDateTime" value="@Model.IrregularShift.StartTime.ToString("HH:mm")" name="Command.IrregularShift.StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" id="irregularShiftsEndDateTime" value="@Model.IrregularShift.EndTime.ToString("HH:mm")" name="Command.IrregularShift.EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="container my-2">
|
||||
<div class="row breack-time">
|
||||
<div>
|
||||
<div class="d-flex align-items-center my-1 breakTimeDiv">
|
||||
<input type="checkbox" id="BreakTimeFirst" name="BreakTime.hasBreakTimeValue" class="form-check-input" @(Model.BreakTime.BreakTimeType == BreakTimeType.WithoutTime ? "checked" : "")>
|
||||
<label for="BreakTimeFirst" class="lableCheckBreakTime">
|
||||
این پرسنل دارای ساعت استراحت نامشخص می باشد با انتخاب این تیک پرسنل باید برای استراحت ورود و خروج ثبت کند.
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-block">
|
||||
<div class="d-flex align-items-center my-1 breakTimeDiv">
|
||||
<input type="checkbox" id="BreakTime" name="BreakTime.hasBreakTimeValue" class="form-check-input" @(Model.BreakTime.BreakTimeType == BreakTimeType.WithTime ? "checked" : "")>
|
||||
<label for="BreakTime" class="lableCheckBreakTime">
|
||||
این پرسنل دارای ساعت استراحت ثابت روزانه می باشد که بصورت خودکار در فیش حقوقی محاسبه می گردد:
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center my-1 mt-3 @(Model.BreakTime.BreakTimeType == BreakTimeType.None || Model.BreakTime.BreakTimeType == BreakTimeType.WithoutTime ? "disable" : "")" id="computeTime">
|
||||
<div class="position-relative">
|
||||
<label for="hour" class="position-absolute" style="bottom: 25px; font-size: 13px; font-weight: 700; right: 5px; background-color: #fff; padding: 0 4px;">ساعت</label>
|
||||
<select id="hour" asp-for="@Model.BreakTime.BreakTimeValue.Hour" name="selectCheckBreakTime" class="form-select selectCheckBreakTime">
|
||||
<option value="0" selected>ساعت</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
</select>
|
||||
</div>
|
||||
<span class="mx-1">:</span>
|
||||
<div class="position-relative">
|
||||
<label for="min" class="position-absolute" style="bottom: 25px; font-size: 13px; font-weight: 700; right: 5px; background-color: #fff; padding: 0 4px;">دقیقه</label>
|
||||
<select id="min" asp-for="@Model.BreakTime.BreakTimeValue.Minute" name="selectCheckBreakTime" class="form-select selectCheckBreakTime">
|
||||
<option value="00" selected>دقیقه</option>
|
||||
<option value="5">5</option>
|
||||
<option value="10">10</option>
|
||||
<option value="15">15</option>
|
||||
<option value="20">20</option>
|
||||
<option value="25">25</option>
|
||||
<option value="30">30</option>
|
||||
<option value="35">35</option>
|
||||
<option value="40">40</option>
|
||||
<option value="45">45</option>
|
||||
<option value="50">50</option>
|
||||
<option value="55">55</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" id="TimeOnly" name="Command.BreakTime.BreakTimeValue" value="@Model.BreakTime.BreakTimeValue.ToString("HH:mm")"/>
|
||||
@* <span class="mx-1" id="computeTimeText"></span> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-12">
|
||||
<div class="lableCheckBreakTime text-center">وضعیت فعالیت مجموعه در روز های جمعه و تعطیلات رسمی</div>
|
||||
<div class="row extraOptionBorder">
|
||||
|
||||
<div class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
|
||||
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمیکند.</label>
|
||||
</div>
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
|
||||
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار میکند.</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های تعطیلات رسمی</div> *@
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays1" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.Default ? "checked" : "") value="@((int)(HolidayWork.Default))" />
|
||||
<label for="OffDays1" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار نمیکند.</label>
|
||||
</div>
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays2" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.WorkInHolidays ? "checked" : "") value="@((int)(HolidayWork.WorkInHolidays))" />
|
||||
<label for="OffDays2" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار میکند.</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 d-flex justify-content-center w-100">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" id="btnSave" class="btn-register w-100 position-relative" onclick="ajaxEditEmployeeSaveData()">
|
||||
<span class="text-nowrap">ثبت ویرایش</span>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- مودال -->
|
||||
<div id="ConfirmModal" style="display: none" data-bs-backdrop="static" aria-hidden="true" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered ConfirmSection">
|
||||
<div class="" id="ModalConfirmChange">
|
||||
<partial name="_Partials/ConfirmEmployeeTimeChangeModal" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- مودال -->
|
||||
|
||||
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var ajaxPostChangeEditEmployee = `@Url.Page("./Grouping", "ChangeEditEmployee")`;
|
||||
var ajaxReCalculateValuesUrl = `@Url.Page("./Grouping", "ReCalculateValues")`;
|
||||
var ajaxEmployeeSettingsHasChangedValueUrl = `@Url.Page("./Grouping", "EmployeeSettingsHasChangedValue")`;
|
||||
|
||||
var indexShiftViewModel = Number(@iteration);
|
||||
var indexShiftViewModelRS = Number(@iterationRS);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<label for="organized" class="radio-label-workTimeOption w-100">منظم</label>
|
||||
|
||||
<input type="radio" value="Rotating" name="workshopShiftStatus" id="rotating_shift" class="radio-workTimeOption">
|
||||
<label for="rotating_shift" class=" radio-label-workTimeOption w-100" >گردشی</label>
|
||||
<label for="rotating_shift" class="radio-label-workTimeOption w-100">گردشی</label>
|
||||
|
||||
<input type="radio" value="Irregular" name="workshopShiftStatus" id="disorganized" class="radio-workTimeOption">
|
||||
<label for="disorganized" class="radio-label-workTimeOption w-100">مختلط</label>
|
||||
@@ -257,7 +257,7 @@
|
||||
}
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWorkRS @(Model.ShiftViewModel.Count() == 4 ? "d-none" : "")">
|
||||
<button type="button" class="btnAddTimeWorkRS @(Model.CustomizeRotatingShiftsViewModels.Count() == 4 ? "d-none" : "")">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
@@ -439,7 +439,12 @@
|
||||
<button type="button" class="btn-cancel2 d-flex align-items-center justify-content-center w-100">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" id="btnSave" class="btn-register d-flex align-items-center justify-content-center w-100" onclick="ajaxEditGroupingSaveData()">ثبت ویرایش</button>
|
||||
<button type="button" id="btnSave" class="btn-register d-flex align-items-center justify-content-center w-100" onclick="ajaxEditGroupingSaveData()">
|
||||
<span class="text-nowrap">ثبت ویرایش</span>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -457,6 +462,17 @@
|
||||
</div>
|
||||
<!-- مودال -->
|
||||
|
||||
|
||||
<!-- مودال تاییده -->
|
||||
<div id="ConfirmModal" style="display: none">
|
||||
<div class="modal-dialog modal-dialog-centered ConfirmSection">
|
||||
<div class="" id="ModalConfirmChange">
|
||||
<partial name="_Partials/ConfirmEditGroupTimeChangeModal" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- مودال تاییده -->
|
||||
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
@@ -468,6 +484,7 @@
|
||||
var groupId = Number(@Model.Id);
|
||||
|
||||
var IsRegularWorkshop = @(Model.WorkshopShiftStatus == WorkshopShiftStatus.Regular ? 0 : Model.WorkshopShiftStatus == WorkshopShiftStatus.Irregular ? 1 : 2);
|
||||
var ajaxReCalculateValuesUrl = `@Url.Page("./Grouping", "ReCalculateValues")`;
|
||||
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/modaleditgroup.js?ver=@clientVersion"></script>
|
||||
@@ -0,0 +1,65 @@
|
||||
@using _0_Framework.Application
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link href="~/assetsclient/pages/RollCall/css/ConfirmEditGroupTimeChangeModal.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<div class="modal-content" style="height: auto;" id="modalEmplyeeTimeChange" style="display: none">
|
||||
<div class="modal-header d-block text-center position-relative">
|
||||
<button type="button" class="btn-close position-absolute text-start closeConfirmModal2"></button>
|
||||
<div class="modal-header d-flex flex-column " id="morakhasiEstehghaghiModalLabel" style="font-size: 19px; padding: 0 20px !important;">
|
||||
<span class="header-title mb-4 "> تغییرات ساعت کار پرسنل به صورت گروهی : </span>
|
||||
<span class="header-description">
|
||||
تاریخ تغییرات ساعت کاری را میتوانید بصورت انفرادی در منوی
|
||||
ذیل انجام دهید :
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body pt-0">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="cardModal2">
|
||||
|
||||
<div class="cardModal2-content">
|
||||
<div class="Table d-flex flex-column gap-2">
|
||||
<div class="TableHeader d-flex w-100 justify-content-between align-items-center px-3 " style="background: linear-gradient(180deg, #41D1D1 0%, #2CD0D0 100%); height: 49px; border-radius: 5px; position: sticky;top: 0; ">
|
||||
|
||||
<div class="d-flex gap-3">
|
||||
<div class="TableHeaderCell text-white" style="font-size: 14px; font-weight: 400">ردیف</div>
|
||||
<div class="TableHeaderCell text-white" style="font-size: 14px; font-weight: 400">نام پرسنل</div>
|
||||
</div>
|
||||
|
||||
<input
|
||||
id="initialDateInput"
|
||||
type="text" value="" class="form-control m-0 py-0 dateInput" style="width: 120px; height: 36px; text-align: center; font-size: 16px; color: #5C5C5C; font-weight: 500; border: 2px solid #C6C6C6; direction: ltr">
|
||||
|
||||
</div>
|
||||
|
||||
@* load employees *@
|
||||
<div class="TableRow d-flex flex-column gap-2" id="employeeTable">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer d-flex gap-2 justify-content-center pt-0 pb-3">
|
||||
<button class="btn-quit flex-grow-1 closeConfirmModal2">انصراف</button>
|
||||
<button class="btn-confirm flex-grow-1" onclick="ajaxSaveSubmit()">
|
||||
<span>تایید</span>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var dateNow = `@DateTime.Now.ToFarsi()`;
|
||||
var loadEmployeesIsSettingChangeAjax = '@Url.Page("./Grouping", "EmployeeIsChangeList")';
|
||||
</script>
|
||||
@@ -23,11 +23,11 @@
|
||||
<div class="mt-3 d-flex align-items-center justify-content-between">
|
||||
<p class="m-0">آیا تغییرات کنونی شامل پرسنل بالا بشود؟</p>
|
||||
<div class="form-group my-1">
|
||||
<input type="radio" name="IsShiftChanged" id="YesConfirm" class="form-check-input" value="true" />
|
||||
<input type="radio" name="IsShiftChanged" id="YesConfirm" class="form-check-input modal2" value="true" />
|
||||
<label for="YesConfirm">بله</label>
|
||||
</div>
|
||||
<div class="form-group my-1">
|
||||
<input type="radio" name="IsShiftChanged" id="NotConfirm" class="form-check-input" value="false"/>
|
||||
<input type="radio" name="IsShiftChanged" id="NotConfirm" class="form-check-input modal2" value="false" />
|
||||
<label for="NotConfirm">خیر</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,6 +41,7 @@
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="position-relative">
|
||||
@* ajaxConfirm() *@
|
||||
<button type="button" class="btn-primary w-100 disable" id="finalSaveRollCallSetting" onclick="ajaxSaveSubmit()">ثبت نهایی</button>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
@@ -55,6 +56,7 @@
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var loadEmployeesIsSettingChangeAjax = '@Url.Page("./Grouping", "EmployeeIsChangeList")';
|
||||
var loadEmployeesIsSettingChangeAjax = '@Url.Page("./Grouping", "EmployeeIsChangeList")';
|
||||
var ajaxEmployeesHaveToChangeUrl = `@Url.Page("./Grouping", "EmployeesHaveToChange")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/confirmemployeechange.js?ver=@clientVersion"></script>
|
||||
@@ -0,0 +1,63 @@
|
||||
@using _0_Framework.Application
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link href="~/assetsclient/pages/RollCall/css/ConfirmEmployeeTimeChangeModal.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<div class="modal-content" style="height: auto;" id="modalConfirm">
|
||||
|
||||
<div class="modal-header d-block text-center position-relative">
|
||||
<button type="button" class="btn-close position-absolute text-start closeConfirmModal"></button>
|
||||
<div class="modal-title d-flex flex-column justify-content-center " id="morakhasiEstehghaghiModalLabel" style="font-size: 19px;">
|
||||
<div class="header-title"> تغییرات ساعت کاری پرسنل</div>
|
||||
<div class="header-title"> محمد مهدی تقی نژاد</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-content">
|
||||
<h3 class="card-title">از تاریخ ذیل تغییرات اعمال میگردد</h3>
|
||||
<div class="flex-container d-flex justify-content-center align-items-center">
|
||||
<input type="text" class="form-control m-0 py-0 dateModal" name="Command.FromDate"
|
||||
style="width: 120px; height: 36px; text-align: center; font-size: 16px; color: #5C5C5C; font-weight: 500; border: 2px solid #C6C6C6; direction: ltr">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer d-flex gap-2 justify-content-center">
|
||||
<button class="btn-quit flex-grow-1 closeConfirmModal">انصراف</button>
|
||||
<button class="btn-confirm flex-grow-1 position-relative" onclick="postChangeEditEmployee()">
|
||||
<span class="text-nowrap">تایید</span>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var dateNow = `@DateTime.Now.ToFarsi()`;
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
new Cleave('.dateModal', {
|
||||
date: true,
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
$('.dateModal').val(dateNow);
|
||||
|
||||
$(".closeConfirmModal").on("click", function () {
|
||||
$('#ConfirmModal').hide();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,222 @@
|
||||
#modalEmplyeeTimeChange {
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.sweet-alert {
|
||||
font-family: 'IranSans' !important
|
||||
}
|
||||
|
||||
#ConfirmModal {
|
||||
width: 100%;
|
||||
background: #00000085;
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 20000;
|
||||
}
|
||||
|
||||
.ConfirmSection {
|
||||
max-width: max-content;
|
||||
}
|
||||
|
||||
|
||||
.btn-add {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 7px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
transition: ease-in-out .3s;
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
|
||||
.btn-add:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
|
||||
.btnPosition {
|
||||
outline: 1px solid #138989;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.active {
|
||||
outline: 1px solid transparent;
|
||||
}
|
||||
|
||||
.btn-register {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 60px;
|
||||
}
|
||||
|
||||
.btn-register:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
.btn-cancel2 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #1F2937;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 70px;
|
||||
}
|
||||
|
||||
.btn-cancel2:hover {
|
||||
background-color: #121820;
|
||||
}
|
||||
|
||||
.items {
|
||||
border: 1px solid #D9D9D9;
|
||||
padding: 5px;
|
||||
border-radius: 8px;
|
||||
margin: 4px 0;
|
||||
cursor: pointer;
|
||||
transition: all ease-in-out .3s;
|
||||
}
|
||||
|
||||
.items:hover {
|
||||
border: 1px solid #148989;
|
||||
}
|
||||
|
||||
.items.checked-item {
|
||||
border: 1px solid #148989;
|
||||
}
|
||||
|
||||
.searchItem {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #535353;
|
||||
}
|
||||
|
||||
.btn-edit-subject {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #009EE2;
|
||||
margin: auto 4px auto 1px;
|
||||
background-color: rgba(52, 209, 209, 0.20);
|
||||
box-shadow: 0;
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-edit-subject:hover {
|
||||
background-color: rgba(52, 209, 209, 0.40);
|
||||
}
|
||||
|
||||
.btn-remove-subject {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #FF5151;
|
||||
margin: auto 4px auto 1px;
|
||||
background: rgba(209, 50, 50, 0.15);
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-remove-subject:hover {
|
||||
background-color: rgba(209, 50, 50, 0.25);
|
||||
}
|
||||
|
||||
.header-title {
|
||||
font-size: 17px;
|
||||
line-height: 32px;
|
||||
font-weight: 700;
|
||||
color: #000000;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.header-description {
|
||||
font-size: 17px;
|
||||
line-height: 24px;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
text-align: right
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.cardModal2 {
|
||||
background: #F5F5F5;
|
||||
border-radius: 10px;
|
||||
width: 100%;
|
||||
height: 372px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #E7E7E7
|
||||
}
|
||||
|
||||
|
||||
.cardModal2-content {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
height: 400px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.btn-quit {
|
||||
background-color: #292D32;
|
||||
color: white;
|
||||
height: 46px;
|
||||
border-radius: 6px;
|
||||
transition: 0.15s linear;
|
||||
font-size: 17px;
|
||||
line-height: 100%;
|
||||
font-weight: 500
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
background-color: #84CC16;
|
||||
color: white;
|
||||
height: 46px;
|
||||
border-radius: 6px;
|
||||
transition: 0.15s linear;
|
||||
font-size: 17px;
|
||||
line-height: 100%;
|
||||
font-weight: 500
|
||||
}
|
||||
|
||||
.btn-confirm:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
.btn-quit:hover {
|
||||
background-color: #121820;
|
||||
}
|
||||
|
||||
input.form-control:focus {
|
||||
border-color: #C6C6C6;
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
|
||||
input:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.btn-card {
|
||||
color: #0B5959;
|
||||
width: 33px;
|
||||
height: 33px;
|
||||
border-radius: 3px;
|
||||
background-color: #57E3E340;
|
||||
font-size: 14px;
|
||||
line-height: 29px;
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
.sweet-alert {
|
||||
font-family: 'IranSans' !important
|
||||
}
|
||||
|
||||
#ConfirmModal {
|
||||
width: 100%;
|
||||
background: #00000085;
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.ConfirmSection {
|
||||
max-width: max-content;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.employee-item {
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
margin: 16px 0 0 0;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 10px;
|
||||
overflow-y: scroll;
|
||||
padding: 10px;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.employee-item ul {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.employee-item ul li {
|
||||
list-style: decimal;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.btn-add {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 7px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
transition: ease-in-out .3s;
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
|
||||
.btn-add:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
|
||||
.btnPosition {
|
||||
outline: 1px solid #138989;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.active {
|
||||
outline: 1px solid transparent;
|
||||
}
|
||||
|
||||
.btn-register {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 60px;
|
||||
}
|
||||
|
||||
.btn-register:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
.btn-cancel2 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #1F2937;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 70px;
|
||||
}
|
||||
|
||||
.btn-cancel2:hover {
|
||||
background-color: #121820;
|
||||
}
|
||||
|
||||
.items {
|
||||
border: 1px solid #D9D9D9;
|
||||
padding: 5px;
|
||||
border-radius: 8px;
|
||||
margin: 4px 0;
|
||||
cursor: pointer;
|
||||
transition: all ease-in-out .3s;
|
||||
}
|
||||
|
||||
.items:hover {
|
||||
border: 1px solid #148989;
|
||||
}
|
||||
|
||||
.items.checked-item {
|
||||
border: 1px solid #148989;
|
||||
}
|
||||
|
||||
.searchItem {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #535353;
|
||||
}
|
||||
|
||||
.btn-edit-subject {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #009EE2;
|
||||
margin: auto 4px auto 1px;
|
||||
background-color: rgba(52, 209, 209, 0.20);
|
||||
box-shadow: 0;
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-edit-subject:hover {
|
||||
background-color: rgba(52, 209, 209, 0.40);
|
||||
}
|
||||
|
||||
.btn-remove-subject {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #FF5151;
|
||||
margin: auto 4px auto 1px;
|
||||
background: rgba(209, 50, 50, 0.15);
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-remove-subject:hover {
|
||||
background-color: rgba(209, 50, 50, 0.25);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.header-title {
|
||||
font-size: 17px;
|
||||
line-height: 32px;
|
||||
font-weight: 700;
|
||||
color: #000000;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.header-description {
|
||||
font-size: 17px;
|
||||
line-height: 24px;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
|
||||
|
||||
.card {
|
||||
background: #F5F5F5;
|
||||
border-radius: 10px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
border: 1px solid #E7E7E7
|
||||
}
|
||||
|
||||
|
||||
.card-content {
|
||||
padding: 10px;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
margin-bottom: 15px;
|
||||
font-weight: 400;
|
||||
line-height: 24px;
|
||||
color: #000000
|
||||
}
|
||||
|
||||
.card-text {
|
||||
margin: 10px 0;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 109px;
|
||||
height: 36px;
|
||||
color: #5C5C5C !important;
|
||||
background-color: white;
|
||||
border: 2px solid #C6C6C6;
|
||||
border-radius: 6px;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
margin: 0 auto
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
background-color: white;
|
||||
border-color: #C6C6C6;
|
||||
}
|
||||
|
||||
.btn-quit {
|
||||
background-color: #292D32;
|
||||
color: white;
|
||||
border-radius: 6px;
|
||||
transition: 0.15s linear;
|
||||
font-size: 16px;
|
||||
line-height: 100%;
|
||||
font-weight: 500;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
background-color: #84CC16;
|
||||
color: white;
|
||||
border-radius: 6px;
|
||||
transition: 0.15s linear;
|
||||
font-size: 16px;
|
||||
line-height: 100%;
|
||||
font-weight: 500;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.btn-confirm:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
.btn-quit:hover {
|
||||
background-color: #121820;
|
||||
}
|
||||
|
||||
|
||||
input.form-control:focus {
|
||||
border-color: #C6C6C6;
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
|
||||
input:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#modalConfirm {
|
||||
width: 450px;
|
||||
}
|
||||
|
||||
@media (max-width: 526px) {
|
||||
#modalConfirm {
|
||||
width: 350px;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,22 @@
|
||||
$(document).ready(function () {
|
||||
$(".closeConfirmModal").on("click", function () {
|
||||
$('#ConfirmEmployeeModal').hide();
|
||||
});
|
||||
$(".closeConfirmModal2").on("click", function () {
|
||||
$('#ConfirmModal').hide();
|
||||
});
|
||||
|
||||
loadEmployeeIsChangeAjax();
|
||||
// const cleave = new Cleave('.dateInput', {
|
||||
// date: true,
|
||||
// datePattern: ['Y', 'm', 'd'],
|
||||
// });
|
||||
|
||||
new Cleave('.dateInput', {
|
||||
date: true,
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
loadEmployeeIsChangeAjax();
|
||||
});
|
||||
|
||||
function loadEmployeeIsChangeAjax() {
|
||||
@@ -51,4 +64,69 @@ function loadEmployeeIsChangeAjax() {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ajaxConfirm() {
|
||||
$('#ConfirmModal').show();
|
||||
employeeList();
|
||||
}
|
||||
|
||||
|
||||
function employeeList() {
|
||||
var htmlEmployeeList = ``;
|
||||
var isChange = $('.modal2:checked').val();
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: ajaxEmployeesHaveToChangeUrl,
|
||||
data: { 'groupId': groupId, 'isChange': isChange },
|
||||
headers: { "RequestVerificationToken": `${antiForgeryToken}` },
|
||||
success: function (response) {
|
||||
var employeeList = response.data;
|
||||
var index = 1;
|
||||
if (response.success) {
|
||||
employeeList.forEach(function (item) {
|
||||
htmlEmployeeList += `<div class="TaleRowCell d-flex w-100 justify-content-between align-items-center px-3 " style="background: #F1FFFF; height: 49px; border-radius: 5px">
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<span class="btn-card">${index++}</span>
|
||||
<span style="color: #0B5959; font-size: 14px; font-weight: 400; text-align: right">${item.name}</span>
|
||||
</div>
|
||||
<input type="hidden" name="EmployeeId[]" value="${item.employeeId}" />
|
||||
<input type="text" class="form-control m-0 py-0 dateInput"
|
||||
name="FromDate[]"
|
||||
value=""
|
||||
style="width: 120px; height: 36px; text-align: center; font-size: 16px; color: #5C5C5C; font-weight: 500; border: 2px solid #C6C6C6; direction: ltr" />
|
||||
</div>`;
|
||||
});
|
||||
|
||||
$('#employeeTable').html(htmlEmployeeList);
|
||||
|
||||
|
||||
|
||||
$('.dateInput').each(function () {
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
$(this).val(dateNow);
|
||||
});
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#initialDateInput').on('input', function () {
|
||||
new Cleave('.dateInput', {
|
||||
date: true,
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
$('.dateInput').val($(this).val());
|
||||
});
|
||||
@@ -1,4 +1,5 @@
|
||||
$(document).ready(function () {
|
||||
var ajaxService = new AjaxService(antiForgeryToken);
|
||||
$(document).ready(function () {
|
||||
$(document).on("click", ".btn-cancel2", function () {
|
||||
$('#MainModal').modal('toggle');
|
||||
});
|
||||
@@ -494,6 +495,8 @@
|
||||
// Update Remove button enable/disable state
|
||||
updateRemoveButtonsRS();
|
||||
});
|
||||
|
||||
saveDataLocal();
|
||||
});
|
||||
|
||||
|
||||
@@ -736,7 +739,7 @@ function timeValidCheck(value) {
|
||||
}
|
||||
//******************** برای نوشتن تاریخ ********************
|
||||
|
||||
function ajaxEditEmployeeSaveData() {
|
||||
async function ajaxEditEmployeeSaveData() {
|
||||
if ($('#BreakTime').prop('checked')) {
|
||||
if ($('#hour').val() === "0" && $('#min').val() === "00") {
|
||||
showAlert('لطفا ساعت یا دقیقه استراحت را مشخص نمایید', $('#hour, #min'));
|
||||
@@ -744,7 +747,25 @@ function ajaxEditEmployeeSaveData() {
|
||||
}
|
||||
}
|
||||
|
||||
var data = $('#edit-employee-form').serializeArray();
|
||||
saveDataLocal();
|
||||
|
||||
try {
|
||||
const responseCheckCal = await checkEmployeeSettingsHasChangedValue(saveData);
|
||||
|
||||
if (responseCheckCal) {
|
||||
$('#ConfirmModal').show();
|
||||
} else {
|
||||
postChangeEditEmployee();
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
|
||||
// save all data
|
||||
var saveData = {};
|
||||
function saveDataLocal() {
|
||||
var hasBreakTime = "false";
|
||||
if ($('#BreakTime').prop('checked')) {
|
||||
hasBreakTime = $("#BreakTime").prop("checked") ? "true" : "false";
|
||||
@@ -753,7 +774,7 @@ function ajaxEditEmployeeSaveData() {
|
||||
}
|
||||
//var hasBreakTime = $("#BreakTime").prop("checked") ? "true" : "false";
|
||||
var breakTimeValue = $("#TimeOnly").val();
|
||||
|
||||
|
||||
|
||||
var FridayWork = "Default";
|
||||
if ($('#Friday1').prop('checked')) {
|
||||
@@ -761,7 +782,7 @@ function ajaxEditEmployeeSaveData() {
|
||||
} else if ($('#Friday2').prop('checked')) {
|
||||
FridayWork = "WorkInFriday";
|
||||
}
|
||||
|
||||
|
||||
|
||||
var HolidayWork = "Default";
|
||||
if ($('#OffDays1').prop('checked')) {
|
||||
@@ -771,45 +792,88 @@ function ajaxEditEmployeeSaveData() {
|
||||
}
|
||||
|
||||
|
||||
data.push({ name: 'Command.BreakTime.HasBreakTimeValue', value: hasBreakTime });
|
||||
data.push({ name: 'Command.BreakTime.BreakTimeValue', value: breakTimeValue });
|
||||
data.push({ name: 'Command.FridayWork', value: FridayWork });
|
||||
data.push({ name: 'Command.HolidayWork', value: HolidayWork });
|
||||
var formData = $('#edit-employee-form').serializeArray();
|
||||
|
||||
var requestData = $.param(data);
|
||||
formData.forEach(function (item) {
|
||||
saveData[item.name] = item.value;
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
|
||||
saveData['Command.BreakTime.HasBreakTimeValue'] = hasBreakTime;
|
||||
saveData['Command.BreakTime.BreakTimeValue'] = breakTimeValue;
|
||||
saveData['Command.FridayWork'] = FridayWork;
|
||||
saveData['Command.HolidayWork'] = HolidayWork;
|
||||
|
||||
//data.push({ name: 'Command.BreakTime.HasBreakTimeValue', value: hasBreakTime });
|
||||
//data.push({ name: 'Command.BreakTime.BreakTimeValue', value: breakTimeValue });
|
||||
//data.push({ name: 'Command.FridayWork', value: FridayWork });
|
||||
//data.push({ name: 'Command.HolidayWork', value: HolidayWork });
|
||||
|
||||
//var requestData = $.param(data);
|
||||
}
|
||||
|
||||
var hasChangedValueEmployeeSettings = false;
|
||||
async function checkEmployeeSettingsHasChangedValue(command) {
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: ajaxEmployeeSettingsHasChangedValueUrl,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: command
|
||||
});
|
||||
hasChangedValueEmployeeSettings = response.data;
|
||||
return response.data;
|
||||
} catch (e) {
|
||||
console.error('Error:', e);
|
||||
if (e.responseJSON) console.error('Response JSON:', e.responseJSON);
|
||||
if (e.responseText) console.error('Response Text:', e.responseText);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function postChangeEditEmployee() {
|
||||
var command = [
|
||||
{
|
||||
EmployeeId: $('[name="Command.EmployeeIds[0]"]').val(),
|
||||
FromDate: $('[name="Command.FromDate"]').val()
|
||||
}
|
||||
];
|
||||
|
||||
if (!hasChangedValueEmployeeSettings) {
|
||||
command = [];
|
||||
}
|
||||
|
||||
const response = await $.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxPostChangeEditEmployee,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: requestData,
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
isShiftChangedGlobal = true;
|
||||
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 2000);
|
||||
|
||||
loadDataAjax();
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
console.log(err);
|
||||
}
|
||||
data: { ...saveData, reCalculateCommand: command }
|
||||
});
|
||||
}
|
||||
|
||||
if (response.success) {
|
||||
isShiftChangedGlobal = true;
|
||||
|
||||
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 2000);
|
||||
|
||||
loadDataAjax();
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
//}
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
}
|
||||
@@ -764,7 +764,7 @@ $('#YesConfirm, #NotConfirm').on('change', function () {
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
});
|
||||
|
||||
function ajaxSaveSubmit() {
|
||||
async function ajaxSaveSubmit() {
|
||||
if ($('#BreakTime').prop('checked')) {
|
||||
if ($('#hour').val() === "0" && $('#min').val() === "00") {
|
||||
showAlert('لطفا ساعت یا دقیقه استراحت را مشخص نمایید', $('#hour, #min'));
|
||||
@@ -812,45 +812,113 @@ function ajaxSaveSubmit() {
|
||||
data.push({ name: 'HolidayWork', value: HolidayWork });
|
||||
|
||||
data.push({ name: 'IsShiftChanged', value: isShiftChanged });
|
||||
|
||||
|
||||
|
||||
var requestData = $.param(data);
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxEditGroupSave,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: requestData,
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 2000);
|
||||
|
||||
loadDataAjax();
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
} else {
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
var commandGroup = [];
|
||||
|
||||
$('input[name="EmployeeId[]"]').each(function (index) {
|
||||
var employeeId = $(this).val();
|
||||
var fromDate = $('input[name="FromDate[]"]').eq(index).val();
|
||||
|
||||
commandGroup.push({
|
||||
EmployeeId: employeeId,
|
||||
FromDate: fromDate
|
||||
});
|
||||
});
|
||||
|
||||
// console.log(commandGroup);
|
||||
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxEditGroupSave,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: requestData
|
||||
});
|
||||
|
||||
if (response.success) {
|
||||
//const responseSaveCal = await saveReCalculateValues(commandGroup);
|
||||
//if (responseSaveCal) {
|
||||
// loadDataAjax();
|
||||
// $('#btn-register').addClass('disable');
|
||||
// $('#MainModal').modal('hide');
|
||||
//}
|
||||
loadDataAjax();
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
$('#btn-register').removeClass('disable');
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
}
|
||||
} catch (err) {
|
||||
$('#btn-register').removeClass('disable');
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function saveReCalculateValues(command) {
|
||||
|
||||
var btnConfirm = $('.btn-confirm').addClass('disable');
|
||||
var btnQuit = $('.btn-quit').addClass('disable');
|
||||
var loading = $('.btn-confirm .loading').show();
|
||||
|
||||
try {
|
||||
// const response = await ajaxService.post(ajaxReCalculateValuesUrl, { command: command }, true);
|
||||
const response = await $.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxReCalculateValuesUrl,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { command: command },
|
||||
});
|
||||
if (response.success) {
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 2000);
|
||||
|
||||
btnConfirm.removeClass("disable");
|
||||
btnQuit.removeClass("disable");
|
||||
loading.hide();
|
||||
|
||||
loadDataAjax();
|
||||
$('#MainModal').modal('hide');
|
||||
|
||||
return true;
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
|
||||
btnConfirm.removeClass("disable");
|
||||
btnQuit.removeClass("disable");
|
||||
loading.hide();
|
||||
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error:', e);
|
||||
if (e.responseJSON) console.error('Response JSON:', e.responseJSON);
|
||||
if (e.responseText) console.error('Response Text:', e.responseText);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user