Onpage Handler CaseHistory-> Edit and WorkFlow->Edit
This commit is contained in:
@@ -8,6 +8,7 @@ namespace Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
public interface ICustomizeWorkshopEmployeeSettingsRepository : IRepository<long, CustomizeWorkshopEmployeeSettings>
|
||||
{
|
||||
EditCustomizeEmployeeSettings GetCustomizeEmployeeSettingsDetails(long customizeEmployeeId);
|
||||
CustomizeWorkshopEmployeeSettings GetByEmployeeIdAndWorkshopIdIncludeGroupSettings(long workshopId, long employeeId);
|
||||
CustomizeWorkshopEmployeeSettings GetByEmployeeIdGroupSettingsId(long workshopId, long employeeId);
|
||||
void Remove(long id);
|
||||
List<CustomizeWorkshopEmployeeSettings> GetBy(long groupId);
|
||||
|
||||
@@ -11,6 +11,7 @@ public interface ICustomizeWorkshopGroupSettingsRepository : IRepository<long, C
|
||||
CustomizeWorkshopGroupSettings GetIncludeWorkshopSettings(long id);
|
||||
CustomizeWorkshopGroupSettings GetWorkshopMainGroup(long workshopId);
|
||||
List<EmployeeViewModel> GetEmployeesWithoutGroup(long workshopId);
|
||||
List<EmployeeViewModel> GetEmployeesWithoutGroupByWorkshopId(long workshopId);
|
||||
CustomizeWorkshopGroupSettings GetWithEmployees(long groupId);
|
||||
List<CustomizeWorkshopEmployeeSettingsViewModel> GetShiftChangedEmployeeSettingsByGroupSettingsId(long groupSettingsId);
|
||||
List<CustomizeWorkshopEmployeeSettingsViewModel> GetSettingChangedEmployeeSettingsByGroupSettingsId(long groupSettingsId);
|
||||
|
||||
@@ -129,23 +129,26 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
||||
Currency = currency;
|
||||
}
|
||||
|
||||
public void ChangeWorkshopShifts(ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts, WorkshopShiftStatus workshopShiftStatus)
|
||||
{
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
CustomizeWorkshopSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopSettingsShifts : new List<CustomizeWorkshopSettingsShift>();
|
||||
if (workshopShiftStatus == WorkshopShiftStatus.Regular)
|
||||
{
|
||||
var date = new DateOnly();
|
||||
var firstStartShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MinBy(x => x.Placement).StartTime);
|
||||
var lastEndShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MaxBy(x => x.Placement).EndTime);
|
||||
|
||||
|
||||
public void ChangeWorkshopShifts(ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts,
|
||||
WorkshopShiftStatus workshopShiftStatus, FridayWork fridayWork, HolidayWork holidayWork)
|
||||
{
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
HolidayWork = holidayWork;
|
||||
FridayWork = fridayWork;
|
||||
CustomizeWorkshopSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopSettingsShifts : new List<CustomizeWorkshopSettingsShift>();
|
||||
if (workshopShiftStatus == WorkshopShiftStatus.Regular)
|
||||
{
|
||||
var date = new DateOnly();
|
||||
var firstStartShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MinBy(x => x.Placement).StartTime);
|
||||
var lastEndShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MaxBy(x => x.Placement).EndTime);
|
||||
|
||||
|
||||
if (lastEndShift > firstStartShift)
|
||||
firstStartShift = firstStartShift.AddDays(1);
|
||||
var offSet = (firstStartShift - lastEndShift).Divide(2);
|
||||
EndTimeOffSet = TimeOnly.FromDateTime(lastEndShift.Add(offSet));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -7,7 +7,6 @@ namespace CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
|
||||
public class CreateCustomizeWorkshopGroupSettings
|
||||
{
|
||||
|
||||
public string Name { get; set; }
|
||||
public string Salary { get; set; }
|
||||
public long CustomizeWorkshopSettingId { get; set; }
|
||||
@@ -15,4 +14,7 @@ public class CreateCustomizeWorkshopGroupSettings
|
||||
public WorkshopShiftStatus WorkshopShiftStatus { get; set; }
|
||||
public IrregularShift IrregularShift { get; set; }
|
||||
public BreakTime BreakTime { get; set; }
|
||||
public int LeavePermittedDays { get; set; }
|
||||
public FridayWork FridayWork { get; set; }
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
}
|
||||
@@ -18,7 +18,10 @@ public class CustomizeWorkshopEmployeeSettingsViewModel
|
||||
public List<CustomizeWorkshopShiftViewModel> RollCallWorkshopShifts { get; set; }
|
||||
public WorkshopShiftStatus WorkshopShiftStatus { get; set; }
|
||||
public IrregularShift IrregularShift { get; set; }
|
||||
|
||||
public long GroupSettingsId { get; set; }
|
||||
public bool ChangeSettingEmployeeShiftIsChange { get; set; }
|
||||
public BreakTime BreakTime { get; set; }
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
public FridayWork FridayWork { get; set; }
|
||||
public int LeavePermittedDays { get; set; }
|
||||
}
|
||||
@@ -50,10 +50,10 @@ public interface ICustomizeWorkshopSettingsApplication
|
||||
/// <param name="workshopShiftStatus"></param>
|
||||
/// <returns></returns>
|
||||
OperationResult EditWorkshopSettingShifts(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
||||
long customizeWorkshopSettingsId,WorkshopShiftStatus workshopShiftStatus);
|
||||
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, FridayWork fridayWork, HolidayWork holidayWork);
|
||||
|
||||
// It will Get the Workshop Settings with its groups and the employees of groups.
|
||||
CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth);
|
||||
// It will Get the Workshop Settings with its groups and the employees of groups.
|
||||
CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth);
|
||||
|
||||
public CustomizeWorkshopEmployeeSettingsViewModel GetEmployeeSettingsByEmployeeIdWorkshopId(long workshopId,
|
||||
long employeeId);
|
||||
@@ -63,6 +63,8 @@ public interface ICustomizeWorkshopSettingsApplication
|
||||
|
||||
List<EmployeeViewModel> GetEmployeesWithoutGroup(long customizeWorkshopSettingId);
|
||||
|
||||
CustomizeWorkshopEmployeeSettingsViewModel GetByEmployeeIdAndWorkshopIdIncludeGroupSettings(long workshopId, long employeeId);
|
||||
|
||||
CustomizeWorkshopEmployeeSettingsViewModel GetEmployeeSettingsByEmployeeIdGroupSettingsId(long workshopId, long employeeId);
|
||||
|
||||
List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsByGroupSettingsId(long groupSettingsId);
|
||||
@@ -80,7 +82,7 @@ public interface ICustomizeWorkshopSettingsApplication
|
||||
|
||||
EditCustomizeEmployeeSettings GetCustomizeEmployeeSettingsDetails(long customizeEmployeeId);
|
||||
|
||||
|
||||
List<EmployeeViewModel> GetEmployeesWithoutGroupByWorkshopId(long workshopId);
|
||||
List<ChangedGroupedViewModel> GetShiftChangesGroupAndEmployees(long customizeWorkshopSettingsId);
|
||||
List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsByWorkshopId(long workshopId);
|
||||
}
|
||||
@@ -4,9 +4,12 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
{
|
||||
public class EmployeeRollCallRecord
|
||||
{
|
||||
public long RollCallId { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public string StartTime { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
public long RollCallId { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public string StartDate { get; set; }
|
||||
public string StartTime { get; set; }
|
||||
public string EndDate { get; set; }
|
||||
public string EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -10,5 +10,6 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string DateFa { get; set; }
|
||||
public List<RollCallViewModel> RollCalls { get; set; }
|
||||
public List<RollCallEditableDatesForManualEditViewModel> EditableDates { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,14 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
TimeSpan GetEmployeeRollCallTimeSpanForDuration(long employeeId, long workshopId, string startFa, string endFa);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// برای صدور فیش حقوقی
|
||||
/// </summary>
|
||||
List<CheckoutDailyRollCallViewModel> GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId,
|
||||
/// <summary>
|
||||
/// دریافت بازه قابل تغییر برای ویرایش دستی حضور غیاب
|
||||
/// </summary>
|
||||
List<RollCallEditableDatesForManualEditViewModel> GetEditableDatesForManualEdit(DateTime date);
|
||||
/// <summary>
|
||||
/// برای صدور فیش حقوقی
|
||||
/// </summary>
|
||||
List<CheckoutDailyRollCallViewModel> GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId,
|
||||
string startDate, string endDate);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.RollCall
|
||||
{
|
||||
public class RollCallEditableDatesForManualEditViewModel
|
||||
{
|
||||
public string StartFa{ get; set; }
|
||||
public string EndFa { get; set; }
|
||||
public string DayOfWeekFa { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -326,7 +326,8 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
}
|
||||
|
||||
//Create Employee Settings with Group data. It will Replace the Group data (such as salary, shifts and ...) on Employee settings On creation.
|
||||
public OperationResult EditWorkshopSettingShifts(List<CustomizeWorkshopShiftViewModel> shiftViewModels, long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus)
|
||||
public OperationResult EditWorkshopSettingShifts(List<CustomizeWorkshopShiftViewModel> shiftViewModels, long customizeWorkshopSettingsId,
|
||||
WorkshopShiftStatus workshopShiftStatus, FridayWork fridayWork, HolidayWork holidayWork)
|
||||
{
|
||||
OperationResult op = new OperationResult();
|
||||
var entity = _customizeWorkshopSettingsRepository.Get(customizeWorkshopSettingsId);
|
||||
@@ -414,7 +415,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
#endregion
|
||||
|
||||
using var transActionScope = new TransactionScope();
|
||||
entity.ChangeWorkshopShifts(shiftCollection, workshopShiftStatus);
|
||||
entity.ChangeWorkshopShifts(shiftCollection, workshopShiftStatus, fridayWork, holidayWork);
|
||||
|
||||
|
||||
//op = ChangeAllGroupsShiftsWithEmployees(entity, replaceChangedGroups);
|
||||
@@ -1115,6 +1116,39 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return record;
|
||||
}
|
||||
|
||||
public CustomizeWorkshopEmployeeSettingsViewModel GetByEmployeeIdAndWorkshopIdIncludeGroupSettings(long workshopId,
|
||||
long employeeId)
|
||||
{
|
||||
var entity =
|
||||
_customizeWorkshopEmployeeSettingsRepository.GetByEmployeeIdAndWorkshopIdIncludeGroupSettings(workshopId, employeeId);
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
string employeeFullName = _employeeRepository.Get(entity.EmployeeId).FullName;
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
EmployeeId = entity.EmployeeId,
|
||||
Id = entity.id,
|
||||
IsSettingChanged = entity.IsSettingChanged,
|
||||
IsShiftChanged = entity.IsShiftChanged,
|
||||
Name = entity.CustomizeWorkshopGroupSettings.GroupName,
|
||||
EmployeeFullName = employeeFullName,
|
||||
Salary = entity.Salary,
|
||||
BreakTime = entity.BreakTime,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
||||
IrregularShift = entity.IrregularShift,
|
||||
RollCallWorkshopShifts = entity.CustomizeWorkshopEmployeeSettingsShifts.Select(x =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
Placement = x.Placement,
|
||||
StartTime = x.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
FridayWork = entity.FridayWork,
|
||||
HolidayWork = entity.HolidayWork
|
||||
};
|
||||
}
|
||||
|
||||
public CustomizeWorkshopEmployeeSettingsViewModel GetEmployeeSettingsByEmployeeIdGroupSettingsId(long workshopId, long employeeId)
|
||||
{
|
||||
var entity =
|
||||
@@ -1194,6 +1228,11 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return _customizeWorkshopEmployeeSettingsRepository.GetCustomizeEmployeeSettingsDetails(customizeEmployeeId);
|
||||
}
|
||||
|
||||
public List<EmployeeViewModel> GetEmployeesWithoutGroupByWorkshopId(long workshopId)
|
||||
{
|
||||
return _customizeWorkshopGroupSettingsRepository.GetEmployeesWithoutGroupByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
public List<ChangedGroupedViewModel> GetShiftChangesGroupAndEmployees(long customizeWorkshopSettingsId)
|
||||
{
|
||||
return _customizeWorkshopSettingsRepository.GetShiftChangesGroupAndEmployees(customizeWorkshopSettingsId);
|
||||
|
||||
@@ -5,10 +5,13 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.LeaveAgg;
|
||||
using Company.Domain.RollCallAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
|
||||
@@ -16,59 +19,63 @@ 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;
|
||||
private readonly IRollCallRepository _rollCallRepository;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ILeaveRepository _leaveRepository;
|
||||
private readonly ICustomizeCheckoutRepository _customizeCheckoutRepository;
|
||||
private readonly ICheckoutRepository _checkoutRepository;
|
||||
|
||||
public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, ILeaveRepository leaveRepository)
|
||||
{
|
||||
_rollCallRepository = rollCallRepository;
|
||||
_employeeApplication = employeeApplication;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_leaveRepository = leaveRepository;
|
||||
}
|
||||
public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, ILeaveRepository leaveRepository, ICustomizeCheckoutRepository customizeCheckoutRepository, ICheckoutRepository checkoutRepository)
|
||||
{
|
||||
_rollCallRepository = rollCallRepository;
|
||||
_employeeApplication = employeeApplication;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_leaveRepository = leaveRepository;
|
||||
_customizeCheckoutRepository = customizeCheckoutRepository;
|
||||
_checkoutRepository = checkoutRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateRollCall command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var startDateFa = command.StartDate.ToFarsi();
|
||||
public OperationResult Create(CreateRollCall command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var startDateFa = command.StartDate.ToFarsi();
|
||||
|
||||
var yearFa = Convert.ToInt32(startDateFa.Substring(0, 4));
|
||||
var monthFa = Convert.ToInt32(startDateFa.Substring(5, 2));
|
||||
var employeeName = _employeeApplication.GetDetails(command.EmployeeId).EmployeeFullName;
|
||||
var create = new RollCall(command.WorkshopId, command.EmployeeId, employeeName, command.StartDate, null,
|
||||
yearFa, monthFa);
|
||||
_rollCallRepository.Create(create);
|
||||
_rollCallRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
var yearFa = Convert.ToInt32(startDateFa.Substring(0, 4));
|
||||
var monthFa = Convert.ToInt32(startDateFa.Substring(5, 2));
|
||||
var employeeName = _employeeApplication.GetDetails(command.EmployeeId).EmployeeFullName;
|
||||
var create = new RollCall(command.WorkshopId, command.EmployeeId, employeeName, command.StartDate, null,
|
||||
yearFa, monthFa);
|
||||
_rollCallRepository.Create(create);
|
||||
_rollCallRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult Edit(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personRollCall = _rollCallRepository.Get(id);
|
||||
if (personRollCall == null)
|
||||
opration.Failed("رکورد مورد نظر وجود ندارد");
|
||||
var now = DateTime.Now;
|
||||
public OperationResult Edit(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personRollCall = _rollCallRepository.Get(id);
|
||||
if (personRollCall == null)
|
||||
opration.Failed("رکورد مورد نظر وجود ندارد");
|
||||
var now = DateTime.Now;
|
||||
personRollCall.SetEndDateTime(now);
|
||||
_rollCallRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
}
|
||||
public EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public EditRollCall GetById(long id)
|
||||
{
|
||||
return _rollCallRepository.GetById(id);
|
||||
}
|
||||
public EditRollCall GetById(long id)
|
||||
{
|
||||
return _rollCallRepository.GetById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -82,305 +89,371 @@ public class RollCallApplication : IRollCallApplication
|
||||
if (endFa.TryToGeorgianDateTime(out DateTime endDateTime) == false)
|
||||
return TimeSpan.Zero;
|
||||
|
||||
if(startDateTime > endDateTime)
|
||||
return TimeSpan.Zero;
|
||||
if (startDateTime > endDateTime)
|
||||
return TimeSpan.Zero;
|
||||
|
||||
return _rollCallRepository.GetEmployeeRollCallTimeSpanForDuration(employeeId, workshopId, startDateTime, endDateTime);
|
||||
}
|
||||
public List<RollCallEditableDatesForManualEditViewModel> GetEditableDatesForManualEdit(DateTime date)
|
||||
{
|
||||
var date1 = new RollCallEditableDatesForManualEditViewModel()
|
||||
{
|
||||
StartFa = date.AddDays(-1).Date.ToFarsi(),
|
||||
EndFa = date.Date.ToFarsi(),
|
||||
|
||||
};
|
||||
var date2 = new RollCallEditableDatesForManualEditViewModel()
|
||||
{
|
||||
StartFa = date.Date.ToFarsi(),
|
||||
EndFa = date.Date.ToFarsi()
|
||||
};
|
||||
var date3 = new RollCallEditableDatesForManualEditViewModel()
|
||||
{
|
||||
StartFa = date.Date.ToFarsi(),
|
||||
EndFa = date.AddDays(1).Date.ToFarsi()
|
||||
};
|
||||
|
||||
return [date1, date2, date3];
|
||||
}
|
||||
|
||||
|
||||
public List<OverlappedRollCallWithLeave> GetOverlappedRollCallsWithLeaveInDates(long workshopId, DateTime start, DateTime end)
|
||||
{
|
||||
return _rollCallRepository.GetOverlappedRollCallsWithLeaveInDates(workshopId, start, end);
|
||||
}
|
||||
|
||||
public List<RollCallsByDateViewModel> GetUndefinedRollCallWorkFlowsService(long workshopId, DateTime durationStart, DateTime durationEnd)
|
||||
{
|
||||
return _rollCallRepository.GetUndefinedRollCallWorkFlowsInDates(workshopId, durationStart, durationEnd);
|
||||
}
|
||||
|
||||
|
||||
public OperationResult RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, string dateFa)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var date = dateFa.ToGeorgianDateTime();
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
return op.Failed("خطای سیستمی");
|
||||
_rollCallRepository.RemoveEmployeeRollCallsInDate(workshopId, employeeId, date);
|
||||
_rollCallRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel)
|
||||
{
|
||||
return _rollCallRepository.GetWorkshopRollCallHistory(searchModel);
|
||||
}
|
||||
|
||||
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
|
||||
{
|
||||
return _rollCallRepository.GetWorkshopCurrentDayRollCalls(workshopId);
|
||||
}
|
||||
|
||||
public List<CheckoutDailyRollCallViewModel> GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId, string startDate,
|
||||
string endDate)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(startDate) || !string.IsNullOrWhiteSpace(endDate))
|
||||
return new();
|
||||
|
||||
var startDateGr = startDate.ToGeorgianDateTime();
|
||||
var endDateGr = endDate.ToGeorgianDateTime();
|
||||
|
||||
if (startDateGr >= endDateGr)
|
||||
return new();
|
||||
|
||||
//if (!_rollCallEmployeeRepository.Exists(x => x.EmployeeId == employeeId &&
|
||||
// x.WorkshopId == workshopId && x.IsActiveString == "true"))
|
||||
// return new();
|
||||
return _rollCallRepository.GetEmployeeRollCallsForMonth(employeeId, workshopId, startDateGr, endDateGr);
|
||||
}
|
||||
|
||||
|
||||
public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, string startDateTime, string endDateTime, string exactDateTime,
|
||||
string dateIndex)
|
||||
{
|
||||
DateTime? startDateTimeGr = null;
|
||||
DateTime? endDateTimeGr = null;
|
||||
if (!string.IsNullOrWhiteSpace(startDateTime) && !string.IsNullOrWhiteSpace(endDateTime))
|
||||
{
|
||||
startDateTimeGr = startDateTime.ToGeorgianDateTime();
|
||||
endDateTimeGr = endDateTime.ToGeorgianDateTime();
|
||||
if (endDateTimeGr < startDateTimeGr)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DateTime? exactDateTimeGr =
|
||||
!string.IsNullOrWhiteSpace(exactDateTime) ? exactDateTime.ToGeorgianDateTime() : null;
|
||||
|
||||
|
||||
DateTime? index = null;
|
||||
if (!string.IsNullOrWhiteSpace(dateIndex))
|
||||
{
|
||||
index = dateIndex.ToGeorgianDateTime();
|
||||
index = (index.Value.Date >= DateTime.Now) || (index.Value == new DateTime(3000, 12, 20, new PersianCalendar())) ? null : index;
|
||||
|
||||
}
|
||||
|
||||
return _rollCallRepository.GetEmployeeRollCallsHistory(employeeId, workshopId, startDateTimeGr, endDateTimeGr, exactDateTimeGr, index);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// افزودن حضور غیاب به صورت دستی. اگر آیدی رکورد صفر باشد رکورد جدید، در غیر این صورت ویرایش می کند
|
||||
/// </summary>
|
||||
public OperationResult ManualEdit(CreateOrEditEmployeeRollCall command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
DateTime date = command.DateFa.ToGeorgianDateTime();
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
return operation.Failed("فرمت تاریخ وارد شده صحیح نمی باشد");
|
||||
|
||||
if (date >= DateTime.Now.Date)
|
||||
{
|
||||
return operation.Failed("امکان اضافه کردن حضور غیاب برای روز جاری و روز های آینده وجود ندارد");
|
||||
}
|
||||
|
||||
var twoDaysEarlier = date.AddDays(-2).Date;
|
||||
var twoDaysLater = date.AddDays(2).Date >= DateTime.Today
|
||||
? (date.AddDays(1).Date >= DateTime.Today ? DateTime.Today : date.AddDays(1).Date)
|
||||
: date.AddDays(2).Date;
|
||||
|
||||
if (command.WorkshopId < 1)
|
||||
{
|
||||
return operation.Failed("خطای سیستمی");
|
||||
}
|
||||
|
||||
if (command.RollCallRecords == null || command.RollCallRecords.Count == 0)
|
||||
return operation.Failed("خطای سیستمی");
|
||||
|
||||
|
||||
if (_leaveRepository.HasDailyLeave(command.EmployeeId, command.WorkshopId, date))
|
||||
return operation.Failed("در روز مرخصی کارمند نمی توانید حضور غیاب ثبت کنید");
|
||||
|
||||
var employeeStatuses = _rollCallEmployeeRepository.GetByEmployeeIdWithStatuses(command.EmployeeId)
|
||||
.FirstOrDefault(x => x.WorkshopId == command.WorkshopId)?.Statuses;
|
||||
|
||||
var employeeRollCalls = _rollCallRepository.GetEmployeeRollCallsHistoryAllInDates(command.WorkshopId, command.EmployeeId, twoDaysEarlier, twoDaysLater);
|
||||
|
||||
//if (employeeRollCalls.Any(x => x.StartDate.Value.Date== x.EndDate == null))
|
||||
// return operation.Failed("به دلیل عدم ثبت خروج پرسنل در این تاریخ، شما قادر به افزودن رکورد جدید نمی باشید");
|
||||
|
||||
if (command.RollCallRecords.Any(x => string.IsNullOrWhiteSpace(x.StartTime) || string.IsNullOrWhiteSpace(x.EndTime)))
|
||||
return operation.Failed("ساعات شروع و پایان نمیتوانند خالی باشد");
|
||||
|
||||
|
||||
DateTime day = command.DateFa.ToGeorgianDateTime();
|
||||
if (day == Tools.GetUndefinedDateTime())
|
||||
return operation.Failed("خطای سیستمی");
|
||||
|
||||
List<EditRollCall> newRollCallDates = new();
|
||||
|
||||
foreach (var record in command.RollCallRecords)
|
||||
{
|
||||
if (record.StartDate.TryToGeorgianDateTime(out var startDateGr) == false || record.EndDate.TryToGeorgianDateTime(out var endDateGr) == false)
|
||||
return operation.Failed("فرمت تاریخ صحیح نمی باشد");
|
||||
|
||||
|
||||
if (TimeOnly.TryParse(record.StartTime, out var startTimeOnly) == false || TimeOnly.TryParse(record.EndTime, out var endTimeOnly) == false)
|
||||
return operation.Failed("فرمت ساعت صحیح نمی باشد");
|
||||
DateTime startDateTime = startDateGr + startTimeOnly.ToTimeSpan();
|
||||
DateTime endDateTime = endDateGr + endTimeOnly.ToTimeSpan();
|
||||
|
||||
if (startDateTime >= endDateTime)
|
||||
return operation.Failed("زمان ورود نمی تواند بعد یا مساوی زمان خروج باشد");
|
||||
|
||||
if (endDateTime.Date >= DateTime.Today)
|
||||
return operation.Failed("نمی توانید برای روز جاری یا روز های آینده حضور غیاب ثبت کنید");
|
||||
|
||||
var rollCall = new EditRollCall
|
||||
{
|
||||
StartDate = startDateTime,
|
||||
EndDate = endDateTime,
|
||||
Id = record.RollCallId
|
||||
};
|
||||
newRollCallDates.Add(rollCall);
|
||||
}
|
||||
|
||||
if (newRollCallDates.Any(x => newRollCallDates.Any(y => x != y && x.EndDate >= y.StartDate && x.StartDate <= y.EndDate)))
|
||||
return operation.Failed("بازه های وارد شده با هم تداخل دارند");
|
||||
|
||||
|
||||
//foreach (var item in preprocessedRollCalls)
|
||||
//{
|
||||
// (DateTime Start, DateTime End, long RollCallId) rollCallWithDateTime =
|
||||
// new()
|
||||
// {
|
||||
// Start = new DateTime(DateOnly.FromDateTime(day), item.start),
|
||||
// End = new DateTime(DateOnly.FromDateTime(day), item.end),
|
||||
// RollCallId = item.rollCallId
|
||||
|
||||
// };
|
||||
|
||||
// if (previousEnd != new DateTime())
|
||||
// {
|
||||
// if (rollCallWithDateTime.Start < previousEnd)
|
||||
// {
|
||||
// rollCallWithDateTime.Start = rollCallWithDateTime.Start.AddDays(1);
|
||||
// }
|
||||
// if (rollCallWithDateTime.Start == previousEnd)
|
||||
// return operation.Failed("ساعت ورود نمی تواند با ساعت خروج حضور غیاب دیگری در آن روز برابر باشد");
|
||||
|
||||
// }
|
||||
// while (rollCallWithDateTime.Start >= rollCallWithDateTime.End)
|
||||
// {
|
||||
// rollCallWithDateTime.End = rollCallWithDateTime.End.AddDays(1);
|
||||
// }
|
||||
// result.Add(rollCallWithDateTime);
|
||||
// previousEnd = rollCallWithDateTime.End;
|
||||
//}
|
||||
//var firstShiftStart = result.OrderBy(x => x.Start).FirstOrDefault().Start;
|
||||
//var lastShiftEnd = result.OrderByDescending(x => x.Start).FirstOrDefault().End;
|
||||
//var lastShiftStart = result.OrderByDescending(x => x.Start).FirstOrDefault().Start;
|
||||
|
||||
//if (firstShiftStart.AddDays(1) < lastShiftEnd)
|
||||
// return operation.Failed("بازه زمانی وارد شده نا معتبر است");
|
||||
//if (result.Sum(x => (x.End - x.Start).TotalHours) > 24)
|
||||
//{
|
||||
// return operation.Failed("بازه زمانی نمیتواند بیشتر از 24 ساعت باشد");
|
||||
//}
|
||||
//if (firstShiftStart.Date != lastShiftStart.Date)
|
||||
// return operation.Failed("شروع رکورد حضور غیاب نمی تواند در روز های بعد از تاریخ تعیین شده باشد");
|
||||
|
||||
|
||||
foreach (var activity in newRollCallDates)
|
||||
{
|
||||
|
||||
//مرخصی روزانه در بالا چک شده است
|
||||
var leave = _leaveRepository.GetByWorkshopIdEmployeeIdInDates(command.WorkshopId, command.EmployeeId, activity.StartDate.Value, activity.EndDate.Value)
|
||||
.Where(x => x.PaidLeaveType == "ساعتی");
|
||||
if (leave.Any())
|
||||
return operation.Failed("کارمند در بازه انتخاب شده مرخصی ساعتی دارد");
|
||||
}
|
||||
|
||||
if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate >= y.StartDateGr && x.EndDate <= y.EndDateGr)))
|
||||
return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
|
||||
var editableDates = GetEditableDatesForManualEdit(date);
|
||||
|
||||
if (newRollCallDates.Any(x => !editableDates.Any(y =>
|
||||
x.StartDate.Value.Date == y.StartFa.ToGeorgianDateTime().Date &&
|
||||
x.EndDate.Value.Date == y.EndFa.ToGeorgianDateTime().Date)))
|
||||
{
|
||||
return operation.Failed("حضور غیاب در حال ویرایش را نمیتوانید بیشتر از یک روز از ثبت حضور غیاب عقب تر یا جلو تر ببرید");
|
||||
}
|
||||
|
||||
if (newRollCallDates.Any(x => employeeRollCalls.Any(y =>
|
||||
y.StartDate.Value.Date != command.DateFa.ToGeorgianDateTime().Date &&
|
||||
x.EndDate >= y.StartDate.Value && x.StartDate <= y.EndDate.Value)))
|
||||
return operation.Failed("بازه های وارد شده با حضور غیاب های مربوط به روز های قبل و بعد تداخل زمانی دارد");
|
||||
|
||||
|
||||
var checkoutViewModels = _checkoutRepository.SimpleSearch(new CheckoutSearchModel() { WorkshopId = command.WorkshopId, EmployeeId = command.EmployeeId });
|
||||
|
||||
if (checkoutViewModels.Any(x => x.HasRollCall && x.WorkshopId == command.WorkshopId && x.EmployeeId == command.EmployeeId &&
|
||||
newRollCallDates.Any(y => (y.StartDate.Value.Date >= x.ContractStartGr.Date)
|
||||
&& (y.StartDate.Value.Date <= x.ContractEndGr.Date))))
|
||||
return operation.Failed("برای بازه های وارد شده فیش حقوقی ثبت شده است");
|
||||
|
||||
//return operation.Failed("برای بازه های وارد شده فیش حقوقی ثبت شده است، برای ویرایش حضور و غیاب باید فیش حقوقی را پاک کنید");
|
||||
|
||||
//if (_customizeCheckoutRepository.Exists(x =>
|
||||
// newRollCallDates.Any(y => y.Start.Date >= x.ContractStart.Date &&
|
||||
// y.Start.Date <= x.ContractEnd.Date)))
|
||||
// return operation.Failed("برای بازه های وارد شده فیش حقوقی غیر رسمی نهایی ثبت شده است");
|
||||
|
||||
|
||||
//if (_customizeCheckoutTempRepository.Exists(x =>
|
||||
// newRollCallDates.Any(y => y.Start.Date >= x.ContractStart.Date &&
|
||||
// y.Start.Date <= x.ContractEnd.Date)))
|
||||
// return operation.Failed("برای بازه های وارد شده فیش حقوقی غیر رسمی موقت شده است");
|
||||
|
||||
var name = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(command.EmployeeId, command.WorkshopId).EmployeeFullName;
|
||||
var rollCallsAsEntityModels = newRollCallDates.Select(x => new RollCall(command.WorkshopId, command.EmployeeId, name, x.StartDate, x.EndDate,
|
||||
Convert.ToInt32(x.StartDate.Value.ToFarsi().Substring(0, 4)), Convert.ToInt32(x.StartDate.ToFarsi().Substring(5, 2)), RollCallModifyType.EditByEmployer)).ToList();
|
||||
_rollCallRepository.RemoveEmployeeRollCallsInDate(command.WorkshopId, command.EmployeeId, date);
|
||||
|
||||
|
||||
_rollCallRepository.AddRange(rollCallsAsEntityModels);
|
||||
_rollCallRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
public List<RollCallViewModel> GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, string dateFa)
|
||||
{
|
||||
DateTime date = Tools.ToGeorgianDateTime(dateFa);
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
return new();
|
||||
var res = _rollCallRepository.GetWorkshopEmployeeRollCallsForDate(workshopId, employeeId, date);
|
||||
return res;
|
||||
}
|
||||
|
||||
public IEnumerable<RollCallViewModel> GetNotSlicedRollCallsByWorkshopId(long workshopId, DateTime durationStart, DateTime durationEnd)
|
||||
{
|
||||
return _rollCallRepository.GetNotSlicedRollCallsByWorkshopId(workshopId, durationStart, durationEnd);
|
||||
}
|
||||
|
||||
public List<RollCallsByDateViewModel> GetWorkshopAbsentHistory(long workshopId, DateTime startSearch, DateTime endSearch)
|
||||
{
|
||||
return _rollCallRepository.GetWorkshopAbsentHistory(workshopId, startSearch, endSearch);
|
||||
}
|
||||
|
||||
public OperationResult SetModifyTypeToNone(long rollCallId)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
var rollCall = _rollCallRepository.Get(rollCallId);
|
||||
|
||||
if (rollCall == null)
|
||||
return operation.Failed("چنین آیتمی یافت نشد");
|
||||
|
||||
rollCall.SetModifyType(RollCallModifyType.None);
|
||||
|
||||
_rollCallRepository.SaveChanges();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult SetModifyTypeToEditByEmployer(long rollCallId)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
var rollCall = _rollCallRepository.Get(rollCallId);
|
||||
|
||||
if (rollCall == null)
|
||||
return operation.Failed("چنین آیتمی یافت نشد");
|
||||
|
||||
rollCall.SetModifyType(RollCallModifyType.EditByEmployer);
|
||||
|
||||
_rollCallRepository.SaveChanges();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<OverlappedRollCallWithLeave> GetOverlappedRollCallsWithLeaveInDates(long workshopId, DateTime start, DateTime end)
|
||||
{
|
||||
return _rollCallRepository.GetOverlappedRollCallsWithLeaveInDates(workshopId, start, end);
|
||||
}
|
||||
public List<RollCallsByDateViewModel> GetRollCallWorkFlowsCutByBgService(long workshopId, DateTime start, DateTime end)
|
||||
{
|
||||
return _rollCallRepository.GetRollCallWorkFlowsCutByBgService(workshopId, start, end);
|
||||
}
|
||||
|
||||
public List<RollCallsByDateViewModel> GetUndefinedRollCallWorkFlowsService(long workshopId, DateTime durationStart, DateTime durationEnd)
|
||||
{
|
||||
return _rollCallRepository.GetUndefinedRollCallWorkFlowsInDates(workshopId, durationStart, durationEnd);
|
||||
}
|
||||
|
||||
|
||||
public OperationResult RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, string dateFa)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var date = dateFa.ToGeorgianDateTime();
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
return op.Failed("خطای سیستمی");
|
||||
_rollCallRepository.RemoveEmployeeRollCallsInDate(workshopId, employeeId, date);
|
||||
_rollCallRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel)
|
||||
{
|
||||
return _rollCallRepository.GetWorkshopRollCallHistory(searchModel);
|
||||
}
|
||||
|
||||
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
|
||||
{
|
||||
return _rollCallRepository.GetWorkshopCurrentDayRollCalls(workshopId);
|
||||
}
|
||||
public RollCallViewModel GetDetails(long rollCallId)
|
||||
{
|
||||
return _rollCallRepository.GetDetails(rollCallId);
|
||||
}
|
||||
#endregion
|
||||
public long Flag(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallRepository.Flag(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public List<CheckoutDailyRollCallViewModel> GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId, string startDate,
|
||||
string endDate)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(startDate) || !string.IsNullOrWhiteSpace(endDate))
|
||||
return new();
|
||||
|
||||
var startDateGr = startDate.ToGeorgianDateTime();
|
||||
var endDateGr = endDate.ToGeorgianDateTime();
|
||||
|
||||
if (startDateGr >= endDateGr)
|
||||
return new();
|
||||
|
||||
//if (!_rollCallEmployeeRepository.Exists(x => x.EmployeeId == employeeId &&
|
||||
// x.WorkshopId == workshopId && x.IsActiveString == "true"))
|
||||
// return new();
|
||||
return _rollCallRepository.GetEmployeeRollCallsForMonth(employeeId, workshopId, startDateGr, endDateGr);
|
||||
}
|
||||
|
||||
|
||||
public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, string startDateTime, string endDateTime, string exactDateTime,
|
||||
string dateIndex)
|
||||
{
|
||||
DateTime? startDateTimeGr = null;
|
||||
DateTime? endDateTimeGr = null;
|
||||
if (!string.IsNullOrWhiteSpace(startDateTime) && !string.IsNullOrWhiteSpace(endDateTime))
|
||||
{
|
||||
startDateTimeGr = startDateTime.ToGeorgianDateTime();
|
||||
endDateTimeGr = endDateTime.ToGeorgianDateTime();
|
||||
if (endDateTimeGr < startDateTimeGr)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DateTime? exactDateTimeGr =
|
||||
!string.IsNullOrWhiteSpace(exactDateTime) ? exactDateTime.ToGeorgianDateTime() : null;
|
||||
|
||||
|
||||
DateTime? index = null;
|
||||
if (!string.IsNullOrWhiteSpace(dateIndex))
|
||||
{
|
||||
index = dateIndex.ToGeorgianDateTime();
|
||||
index = (index.Value.Date >= DateTime.Now) || (index.Value == new DateTime(3000, 12, 20, new PersianCalendar())) ? null : index;
|
||||
|
||||
}
|
||||
|
||||
return _rollCallRepository.GetEmployeeRollCallsHistory(employeeId, workshopId, startDateTimeGr, endDateTimeGr, exactDateTimeGr, index);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// افزودن حضور غیاب به صورت دستی. اگر آیدی رکورد صفر باشد رکورد جدید، در غیر این صورت ویرایش می کند
|
||||
/// </summary>
|
||||
public OperationResult ManualEdit(CreateOrEditEmployeeRollCall command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var activities = command.RollCallRecords.Select(x => (x.StartTime, x.EndTime));
|
||||
|
||||
DateTime date = command.DateFa.ToGeorgianDateTime();
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
return operation.Failed("فرمت تاریخ وارد شده صحیح نمی باشد");
|
||||
|
||||
if (date >= DateTime.Now.Date)
|
||||
{
|
||||
return operation.Failed("امکان اضافه کردن حضور غیاب برای روز جاری و روز های آینده وجود ندارد");
|
||||
}
|
||||
|
||||
if (command.WorkshopId < 1)
|
||||
{
|
||||
return operation.Failed("خطای سیستمی");
|
||||
}
|
||||
|
||||
if (command.RollCallRecords == null || command.RollCallRecords.Count == 0)
|
||||
return operation.Failed("خطای سیستمی");
|
||||
|
||||
if (_leaveRepository.HasDailyLeave(command.EmployeeId, command.WorkshopId, date))
|
||||
return operation.Failed("در روز مرخصی کارمند نمی توانید حضور غیاب ثبت کنید");
|
||||
|
||||
var employeeStatuses = _rollCallEmployeeRepository.GetByEmployeeIdWithStatuses(command.EmployeeId)
|
||||
.FirstOrDefault(x => x.WorkshopId == command.WorkshopId)?.Statuses;
|
||||
|
||||
//var employeeRollCalls = _rollCallRepository.GetWorkshopEmployeeRollCallsForDate(command.WorkshopId, command.EmployeeId, date);
|
||||
|
||||
//if (employeeRollCalls.Any(x => x.EndDate == null && x.))
|
||||
// return operation.Failed("به دلیل عدم ثبت خروج پرسنل در این تاریخ، شما قادر به افزودن رکورد جدید نمی باشید");
|
||||
|
||||
if (command.RollCallRecords.Any(x => string.IsNullOrWhiteSpace(x.StartTime) || string.IsNullOrWhiteSpace(x.EndTime)))
|
||||
return operation.Failed("ساعات شروع و پایان نمیتوانند خالی باشد");
|
||||
|
||||
#region RollCallTimes validation and parse to DateTime
|
||||
|
||||
List<(TimeOnly start, TimeOnly end, long rollCallId)> preprocessedRollCalls = new();
|
||||
try
|
||||
{
|
||||
preprocessedRollCalls = command.RollCallRecords.Select(x =>
|
||||
{
|
||||
|
||||
if (!TimeOnly.TryParseExact(x.StartTime, "HH:mm", out TimeOnly start))
|
||||
throw new Exception();
|
||||
if (!TimeOnly.TryParseExact(x.EndTime, "HH:mm", out TimeOnly end))
|
||||
throw new Exception();
|
||||
return (start, end, x.RollCallId);
|
||||
|
||||
}).ToList();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
return operation.Failed("فرمت ساعات ورودی نادرست می باشد");
|
||||
}
|
||||
|
||||
DateTime day = command.DateFa.ToGeorgianDateTime();
|
||||
if (day == Tools.GetUndefinedDateTime())
|
||||
return operation.Failed("خطای سیستمی");
|
||||
DateTime previousEnd = new DateTime();
|
||||
preprocessedRollCalls = preprocessedRollCalls.OrderBy(x => x.start).ToList();
|
||||
List<(DateTime Start, DateTime End, long RollCallId)> result = new();
|
||||
|
||||
|
||||
foreach (var item in preprocessedRollCalls)
|
||||
{
|
||||
(DateTime Start, DateTime End, long RollCallId) rollCallWithDateTime =
|
||||
new()
|
||||
{
|
||||
Start = new DateTime(DateOnly.FromDateTime(day), item.start),
|
||||
End = new DateTime(DateOnly.FromDateTime(day), item.end),
|
||||
RollCallId = item.rollCallId
|
||||
|
||||
};
|
||||
|
||||
if (previousEnd != new DateTime())
|
||||
{
|
||||
if (rollCallWithDateTime.Start < previousEnd)
|
||||
{
|
||||
rollCallWithDateTime.Start = rollCallWithDateTime.Start.AddDays(1);
|
||||
}
|
||||
if (rollCallWithDateTime.Start == previousEnd)
|
||||
return operation.Failed("ساعت ورود نمی تواند با ساعت خروج حضور غیاب دیگری در آن روز برابر باشد");
|
||||
|
||||
}
|
||||
while (rollCallWithDateTime.Start >= rollCallWithDateTime.End)
|
||||
{
|
||||
rollCallWithDateTime.End = rollCallWithDateTime.End.AddDays(1);
|
||||
}
|
||||
result.Add(rollCallWithDateTime);
|
||||
previousEnd = rollCallWithDateTime.End;
|
||||
}
|
||||
var firstShiftStart = result.OrderBy(x => x.Start).FirstOrDefault().Start;
|
||||
var lastShiftEnd = result.OrderByDescending(x => x.Start).FirstOrDefault().End;
|
||||
var lastShiftStart = result.OrderByDescending(x => x.Start).FirstOrDefault().Start;
|
||||
|
||||
if (firstShiftStart.AddDays(1) < lastShiftEnd)
|
||||
return operation.Failed("بازه زمانی وارد شده نا معتبر است");
|
||||
if (result.Sum(x => (x.End - x.Start).TotalHours) > 24)
|
||||
{
|
||||
return operation.Failed("بازه زمانی نمیتواند بیشتر از 24 ساعت باشد");
|
||||
}
|
||||
if (firstShiftStart.Date != lastShiftStart.Date)
|
||||
return operation.Failed("شروع رکورد حضور غیاب نمی تواند در روز های بعد از تاریخ تعیین شده باشد");
|
||||
|
||||
#endregion
|
||||
foreach (var activity in result)
|
||||
{
|
||||
|
||||
//مرخصی روزانه در بالا چک شده است
|
||||
var leave = _leaveRepository.GetByWorkshopIdEmployeeIdInDates(command.WorkshopId, command.EmployeeId, activity.Start, activity.End)
|
||||
.Where(x => x.PaidLeaveType == "ساعتی");
|
||||
if (leave.Any())
|
||||
return operation.Failed("کارمند در بازه انتخاب شده مرخصی ساعتی دارد");
|
||||
}
|
||||
|
||||
if (result == null || !result.All(x => employeeStatuses.Any(y => x.Start >= y.StartDateGr && x.End <= y.EndDateGr)))
|
||||
return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
|
||||
|
||||
|
||||
var name = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(command.EmployeeId, command.WorkshopId).EmployeeFullName;
|
||||
var rollCallsAsEntityModels = result.Select(x => new RollCall(command.WorkshopId, command.EmployeeId, name, x.Start, x.End,
|
||||
Convert.ToInt32(x.Start.ToFarsi().Substring(0, 4)), Convert.ToInt32(x.Start.ToFarsi().Substring(5, 2)), RollCallModifyType.EditByEmployer)).ToList();
|
||||
_rollCallRepository.RemoveEmployeeRollCallsInDate(command.WorkshopId, command.EmployeeId, date);
|
||||
|
||||
|
||||
_rollCallRepository.AddRange(rollCallsAsEntityModels);
|
||||
_rollCallRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public List<RollCallViewModel> GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, string dateFa)
|
||||
{
|
||||
DateTime date = Tools.ToGeorgianDateTime(dateFa);
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
return new();
|
||||
var res = _rollCallRepository.GetWorkshopEmployeeRollCallsForDate(workshopId, employeeId, date);
|
||||
return res;
|
||||
}
|
||||
|
||||
public IEnumerable<RollCallViewModel> GetNotSlicedRollCallsByWorkshopId(long workshopId, DateTime durationStart, DateTime durationEnd)
|
||||
{
|
||||
return _rollCallRepository.GetNotSlicedRollCallsByWorkshopId(workshopId, durationStart, durationEnd);
|
||||
}
|
||||
|
||||
public List<RollCallsByDateViewModel> GetWorkshopAbsentHistory(long workshopId, DateTime startSearch, DateTime endSearch)
|
||||
{
|
||||
return _rollCallRepository.GetWorkshopAbsentHistory(workshopId, startSearch, endSearch);
|
||||
}
|
||||
|
||||
public OperationResult SetModifyTypeToNone(long rollCallId)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
var rollCall = _rollCallRepository.Get(rollCallId);
|
||||
|
||||
if (rollCall == null)
|
||||
return operation.Failed("چنین آیتمی یافت نشد");
|
||||
|
||||
rollCall.SetModifyType(RollCallModifyType.None);
|
||||
|
||||
_rollCallRepository.SaveChanges();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult SetModifyTypeToEditByEmployer(long rollCallId)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
var rollCall = _rollCallRepository.Get(rollCallId);
|
||||
|
||||
if (rollCall == null)
|
||||
return operation.Failed("چنین آیتمی یافت نشد");
|
||||
|
||||
rollCall.SetModifyType(RollCallModifyType.EditByEmployer);
|
||||
|
||||
_rollCallRepository.SaveChanges();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<RollCallsByDateViewModel> GetRollCallWorkFlowsCutByBgService(long workshopId, DateTime start, DateTime end)
|
||||
{
|
||||
return _rollCallRepository.GetRollCallWorkFlowsCutByBgService(workshopId, start, end);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public RollCallViewModel GetDetails(long rollCallId)
|
||||
{
|
||||
return _rollCallRepository.GetDetails(rollCallId);
|
||||
}
|
||||
#endregion
|
||||
public long Flag(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallRepository.Flag(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public string CheckRepeat(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallRepository.CheckRepeat(employeeId, workshopId);
|
||||
}
|
||||
public string CheckRepeat(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallRepository.CheckRepeat(employeeId, workshopId);
|
||||
}
|
||||
}
|
||||
@@ -509,7 +509,8 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
Year = x.Year,
|
||||
Month = x.Month,
|
||||
ContractNo = x.ContractNo,
|
||||
ContractId = x.ContractId
|
||||
ContractId = x.ContractId,
|
||||
HasRollCall = x.HasRollCall
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -101,6 +101,12 @@ public class CustomizeWorkshopEmployeeSettingsRepository(CompanyContext companyC
|
||||
};
|
||||
}
|
||||
|
||||
public CustomizeWorkshopEmployeeSettings GetByEmployeeIdAndWorkshopIdIncludeGroupSettings(long workshopId, long employeeId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopEmployeeSettings.AsSplitQuery().Include(x => x.CustomizeWorkshopGroupSettings).FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
}
|
||||
|
||||
public CustomizeWorkshopEmployeeSettings GetByEmployeeIdGroupSettingsId(long workshopId, long employeeId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopEmployeeSettings.AsSplitQuery().Include(x => x.CustomizeWorkshopGroupSettings).FirstOrDefault(x =>
|
||||
|
||||
@@ -70,6 +70,31 @@ public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyCont
|
||||
return employees;
|
||||
}
|
||||
|
||||
public List<EmployeeViewModel> GetEmployeesWithoutGroupByWorkshopId(long workshopId)
|
||||
{
|
||||
var workshopSettings = _companyContext.CustomizeWorkshopSettings.Where(x => x.WorkshopId == workshopId);
|
||||
|
||||
if (workshopSettings == null)
|
||||
return new();
|
||||
|
||||
var existsEmployees = _companyContext.CustomizeWorkshopEmployeeSettings
|
||||
.AsSplitQuery().Include(x => x.CustomizeWorkshopGroupSettings)
|
||||
.Where(x => x.WorkshopId == workshopId && !x.CustomizeWorkshopGroupSettings.MainGroup)
|
||||
.Select(x => x.EmployeeId).ToList();
|
||||
|
||||
var rollCallEmployees = _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId);
|
||||
|
||||
var employees = rollCallEmployees
|
||||
.Where(x => !existsEmployees.Contains(x.EmployeeId))
|
||||
.Select(x => new EmployeeViewModel()
|
||||
{
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
Id = x.EmployeeId
|
||||
}).ToList();
|
||||
|
||||
return employees;
|
||||
}
|
||||
|
||||
public CustomizeWorkshopGroupSettings GetWithEmployees(long groupId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery().Include(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
|
||||
}
|
||||
|
||||
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
||||
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, long workshopId)
|
||||
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, long workshopId,FridayWork fridayWork,HolidayWork holidayWork)
|
||||
{
|
||||
if (workshopId < 1)
|
||||
return new JsonResult(new
|
||||
@@ -239,7 +239,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
|
||||
|
||||
//Todo:Vafa!!
|
||||
//Todo: Vafa : to in ja bool replaceChange group ro ezafe kon. hatman ham workshopShiftStatus az front pas bede be in.
|
||||
var result = _customizeWorkshopSettingsApplication.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus);
|
||||
var result = _customizeWorkshopSettingsApplication
|
||||
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, fridayWork, holidayWork);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
if (accountInfo.SubAccountId == 0)
|
||||
{
|
||||
var accountId = accountInfo.Id;
|
||||
var result = _accountApplication.GetDetails(accountId);
|
||||
var result = _accountApplication.Search(new AccountSearchModel() { Id = accountId }).FirstOrDefault();
|
||||
if (result != null)
|
||||
{
|
||||
_accountApplication.SendVerifyCodeToChangingPass(result.Mobile, accountId);
|
||||
|
||||
@@ -371,7 +371,7 @@
|
||||
|
||||
|
||||
<div id="MainModal" class="modal fade" aria-labelledby="myModalLabel" aria-hidden="true" tabindex="-1" data-bs-backdrop="static" style="display: none;">
|
||||
<div class="modal-dialog modal-md modal-dialog-centered">
|
||||
<div class="modal-dialog modal-md modalRollCallWidth modal-dialog-centered">
|
||||
<div class="modal-content" id="ModalContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.Error;
|
||||
using CompanyManagment.App.Contracts.Leave;
|
||||
@@ -12,93 +13,99 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
{
|
||||
[Authorize]
|
||||
public class CaseHistoryModel : PageModel
|
||||
{
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication;
|
||||
private readonly IRollCallApplication _rollCallApplication;
|
||||
private readonly IYearlySalaryApplication _yearlySalaryApplication;
|
||||
private readonly ILeaveApplication _leaveApplication;
|
||||
private readonly ICustomizeWorkshopSettingsApplication _customizeWorkshopSettingsApplication;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
[Authorize]
|
||||
public class CaseHistoryModel : PageModel
|
||||
{
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication;
|
||||
private readonly IRollCallApplication _rollCallApplication;
|
||||
private readonly IYearlySalaryApplication _yearlySalaryApplication;
|
||||
private readonly ILeaveApplication _leaveApplication;
|
||||
private readonly ICustomizeWorkshopSettingsApplication _customizeWorkshopSettingsApplication;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly long _workshopId;
|
||||
|
||||
public RollCallsByDateViewModel RollCallViewModels { get; set; }
|
||||
public EmployeeRollCallsByMonthViewModel RollCallEmployeeViewModels { get; set; }
|
||||
public string WorkshopFullName { get; set; }
|
||||
public List<RollCallEmployeeViewModel> RollCallEmployeeList;
|
||||
public EmployeeRollCallsByMonthViewModel RollCallEmployeeViewModels { get; set; }
|
||||
public string WorkshopFullName { get; set; }
|
||||
public List<RollCallEmployeeViewModel> RollCallEmployeeList;
|
||||
|
||||
public RollCallSearchModel SearchModel { get; set; } = new();
|
||||
public List<string> YearlyList { get; set; }
|
||||
public RollCallSearchModel SearchModel { get; set; } = new();
|
||||
public List<string> YearlyList { get; set; }
|
||||
|
||||
public CaseHistoryModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IWorkshopApplication workshopApplication, IRollCallApplication rollCallApplication, IYearlySalaryApplication yearlySalaryApplication, ILeaveApplication leaveApplication, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IHttpContextAccessor httpContextAccessor)
|
||||
{
|
||||
_authHelper = authHelper;
|
||||
_passwordHasher = passwordHasher;
|
||||
_rollCallEmployeeApplication = rollCallEmployeeApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
_rollCallApplication = rollCallApplication;
|
||||
_yearlySalaryApplication = yearlySalaryApplication;
|
||||
_leaveApplication = leaveApplication;
|
||||
_customizeWorkshopSettingsApplication = customizeWorkshopSettingsApplication;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
public CaseHistoryModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IWorkshopApplication workshopApplication, IRollCallApplication rollCallApplication, IYearlySalaryApplication yearlySalaryApplication, ILeaveApplication leaveApplication, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IHttpContextAccessor httpContextAccessor)
|
||||
{
|
||||
_authHelper = authHelper;
|
||||
_passwordHasher = passwordHasher;
|
||||
_rollCallEmployeeApplication = rollCallEmployeeApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
_rollCallApplication = rollCallApplication;
|
||||
_yearlySalaryApplication = yearlySalaryApplication;
|
||||
_leaveApplication = leaveApplication;
|
||||
_customizeWorkshopSettingsApplication = customizeWorkshopSettingsApplication;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
|
||||
var workshopHash = _httpContextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
var workshopHash = _httpContextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (_workshopId < 1)
|
||||
throw new InvalidDataException("اختلال در کارگاه");
|
||||
if (_workshopId < 1)
|
||||
throw new InvalidDataException("اختلال در کارگاه");
|
||||
}
|
||||
|
||||
//public override void OnPageHandlerExecuting(PageHandlerExecutingContext context)
|
||||
//{
|
||||
// if (IrregularWorkshopHaveGroupedAllPersonnelValidation(_workshopId) == false)
|
||||
// context.HttpContext.Response.Redirect("./grouping");
|
||||
|
||||
// base.OnPageHandlerExecuting(context);
|
||||
//}
|
||||
public override void OnPageHandlerExecuting(PageHandlerExecutingContext context)
|
||||
{
|
||||
if (context.HttpContext.Request.Query["handler"].ToString().ToLower().Trim() == "edit")
|
||||
{
|
||||
|
||||
//public bool IrregularWorkshopHaveGroupedAllPersonnelValidation(long workshopId)
|
||||
//{
|
||||
// var isWorkshopIrregular = _customizeWorkshopSettingsApplication
|
||||
// .GetWorkshopSettingsDetails(workshopId).WorkshopShiftStatus == WorkshopShiftStatus.Irregular;
|
||||
}
|
||||
else if (IrregularWorkshopHaveGroupedAllPersonnelValidation(_workshopId) == false)
|
||||
context.HttpContext.Response.Redirect("./grouping");
|
||||
|
||||
// if (isWorkshopIrregular == false)
|
||||
// return true;
|
||||
// var employeesWithoutGroup = _customizeWorkshopSettingsApplication.GetEmployeesWithoutGroupByWorkshopId(workshopId);
|
||||
// if (employeesWithoutGroup.Any())
|
||||
// return false;
|
||||
// return true;
|
||||
//}
|
||||
base.OnPageHandlerExecuting(context);
|
||||
}
|
||||
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
if (_rollCallEmployeeApplication.GetByWorkshopId(_workshopId).Any())
|
||||
{
|
||||
RollCallEmployeeList = _rollCallEmployeeApplication.GetEmployeeRollCalls(_workshopId);
|
||||
WorkshopFullName = _workshopApplication.GetDetails(_workshopId).WorkshopFullName;
|
||||
public bool IrregularWorkshopHaveGroupedAllPersonnelValidation(long workshopId)
|
||||
{
|
||||
var isWorkshopIrregular = _customizeWorkshopSettingsApplication
|
||||
.GetWorkshopSettingsDetails(workshopId).WorkshopShiftStatus == WorkshopShiftStatus.Irregular;
|
||||
|
||||
var searchModel = new RollCallSearchModel()
|
||||
{
|
||||
WorkshopId = _workshopId
|
||||
};
|
||||
if (isWorkshopIrregular == false)
|
||||
return true;
|
||||
var employeesWithoutGroup = _customizeWorkshopSettingsApplication.GetEmployeesWithoutGroupByWorkshopId(workshopId);
|
||||
if (employeesWithoutGroup.Any())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
RollCallViewModels = _rollCallApplication.GetWorkshopRollCallHistory(searchModel);
|
||||
YearlyList = _yearlySalaryApplication.GetYears();
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
if (_rollCallEmployeeApplication.GetByWorkshopId(_workshopId).Any())
|
||||
{
|
||||
RollCallEmployeeList = _rollCallEmployeeApplication.GetEmployeeRollCalls(_workshopId);
|
||||
WorkshopFullName = _workshopApplication.GetDetails(_workshopId).WorkshopFullName;
|
||||
|
||||
return Page();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Redirect("/Client/Company/RollCall");
|
||||
}
|
||||
}
|
||||
var searchModel = new RollCallSearchModel()
|
||||
{
|
||||
WorkshopId = _workshopId
|
||||
};
|
||||
|
||||
RollCallViewModels = _rollCallApplication.GetWorkshopRollCallHistory(searchModel);
|
||||
YearlyList = _yearlySalaryApplication.GetYears();
|
||||
|
||||
return Page();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Redirect("/Client/Company/RollCall");
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnGetCaseHistoryRollCallAjax(int dateIndex, string exactDateFa, string startDate, string endDate, long employeeId, string dateEmployeeIndex)
|
||||
{
|
||||
@@ -126,21 +133,21 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
RollCallViewModels = _rollCallApplication.GetWorkshopRollCallHistory(searchModel);
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
IsSuccedded = true,
|
||||
data = RollCallViewModels,
|
||||
dataEmployee = RollCallEmployeeViewModels,
|
||||
});
|
||||
}
|
||||
return new JsonResult(new
|
||||
{
|
||||
IsSuccedded = true,
|
||||
data = RollCallViewModels,
|
||||
dataEmployee = RollCallEmployeeViewModels,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetEmployeeRollCallTimeSpan(long employeeId, string start, string end)
|
||||
{
|
||||
var resultData = _rollCallApplication.GetEmployeeRollCallTimeSpanForDuration(employeeId, _workshopId, start, end);
|
||||
public IActionResult OnGetEmployeeRollCallTimeSpan(long employeeId, string start, string end)
|
||||
{
|
||||
var resultData = _rollCallApplication.GetEmployeeRollCallTimeSpanForDuration(employeeId, _workshopId, start, end);
|
||||
|
||||
var hours = (int)resultData.TotalHours;
|
||||
var minutes = resultData.Minutes;
|
||||
var timeString = $"{hours}:{minutes}";
|
||||
var hours = (int)resultData.TotalHours;
|
||||
var minutes = resultData.Minutes;
|
||||
var timeString = $"{hours}:{minutes}";
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
@@ -149,87 +156,166 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetEmployeeList()
|
||||
{
|
||||
var resultData = _rollCallEmployeeApplication.GetRollCallEmployeesByWorkshopId(_workshopId);
|
||||
public IActionResult OnGetEmployeeList()
|
||||
{
|
||||
var resultData = _rollCallEmployeeApplication.GetRollCallEmployeesByWorkshopId(_workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetCreate()
|
||||
{
|
||||
var command = new CreateOrEditEmployeeRollCall();
|
||||
return Partial("ModalAddRollCall", command);
|
||||
}
|
||||
public IActionResult OnGetCreate()
|
||||
{
|
||||
var command = new CreateOrEditEmployeeRollCall();
|
||||
return Partial("ModalAddRollCall", command);
|
||||
}
|
||||
|
||||
public IActionResult OnGetCheckEmployeeData(long employeeId, string date)
|
||||
{
|
||||
bool isSuccess = false;
|
||||
public IActionResult OnGetCheckEmployeeData(long employeeId, string date)
|
||||
{
|
||||
bool isSuccess = false;
|
||||
var dates = _rollCallApplication.GetEditableDatesForManualEdit(date.ToGeorgianDateTime());
|
||||
|
||||
List<RollCallViewModel> resultData = new List<RollCallViewModel>();
|
||||
List<RollCallViewModel> resultData = new List<RollCallViewModel>();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(date))
|
||||
{
|
||||
resultData = _rollCallApplication.GetWorkshopEmployeeRollCallsForDate(_workshopId, employeeId, date);
|
||||
isSuccess = resultData.Any();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(date))
|
||||
{
|
||||
resultData = _rollCallApplication.GetWorkshopEmployeeRollCallsForDate(_workshopId, employeeId, date);
|
||||
isSuccess = resultData.Any();
|
||||
}
|
||||
|
||||
var result = _leaveApplication.HasDailyLeave(_workshopId, employeeId, date);
|
||||
var isLeave = result.IsSuccedded ? result.Data : false;
|
||||
var result = _leaveApplication.HasDailyLeave(_workshopId, employeeId, date);
|
||||
var isLeave = result.IsSuccedded ? result.Data : false;
|
||||
|
||||
var isNullEndDate = resultData.Any(x => x.EndDate == null);
|
||||
var isNullEndDate = resultData.Any(x => x.EndDate == null);
|
||||
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = isSuccess,
|
||||
data = resultData,
|
||||
hasLeave = isLeave,
|
||||
hasNullEndDate = isNullEndDate
|
||||
});
|
||||
}
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = isSuccess,
|
||||
data = resultData,
|
||||
hasLeave = isLeave,
|
||||
EditableDates = dates,
|
||||
hasNullEndDate = isNullEndDate
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetEdit(long employeeId, string date)
|
||||
{
|
||||
public IActionResult OnGetEdit(long employeeId, string date)
|
||||
{
|
||||
var result = _rollCallApplication.GetWorkshopEmployeeRollCallsForDate(_workshopId, employeeId, date);
|
||||
//var dates = _rollCallApplication.GetEditableDatesForManualEdit(DateTime.Parse(date));
|
||||
var name = _rollCallEmployeeApplication.GetByEmployeeIdAndWorkshopId(employeeId, _workshopId);
|
||||
var command = new EmployeeRollCallsViewModel()
|
||||
{
|
||||
EmployeeFullName = name.EmployeeFullName,
|
||||
EmployeeId = employeeId,
|
||||
DateFa = date,
|
||||
RollCalls = result,
|
||||
};
|
||||
var dates = _rollCallApplication.GetEditableDatesForManualEdit(date.ToGeorgianDateTime());
|
||||
var name = _rollCallEmployeeApplication.GetByEmployeeIdAndWorkshopId(employeeId, _workshopId);
|
||||
var command = new EmployeeRollCallsViewModel()
|
||||
{
|
||||
EmployeeFullName = name.EmployeeFullName,
|
||||
EmployeeId = employeeId,
|
||||
DateFa = date,
|
||||
EditableDates = dates,
|
||||
RollCalls = result
|
||||
};
|
||||
|
||||
return Partial("ModalEditRollCall", command);
|
||||
}
|
||||
return Partial("ModalEditRollCall", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostManualCreateOrEdit(CreateOrEditEmployeeRollCall command)
|
||||
{
|
||||
command.WorkshopId = _workshopId;
|
||||
var result = _rollCallApplication.ManualEdit(command);
|
||||
public IActionResult OnGetTotalWorking(string startDate, string startTime, string endDate, string endTime)
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime start = startDate.ToGeorgianDateTime();
|
||||
DateTime end = endDate.ToGeorgianDateTime();
|
||||
TimeOnly startTimeOnly = TimeOnly.Parse(startTime);
|
||||
TimeOnly endTimeOnly = TimeOnly.Parse(endTime);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
start = start + startTimeOnly.ToTimeSpan();
|
||||
end = end + endTimeOnly.ToTimeSpan();
|
||||
if(start >= end)
|
||||
return new JsonResult(new
|
||||
{
|
||||
message = "",
|
||||
});
|
||||
var span = end - start;
|
||||
var hours = (int)span.TotalHours;
|
||||
var minutes = span.Minutes;
|
||||
|
||||
|
||||
|
||||
if (hours > 0 && minutes > 0)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
message = hours + " " + "ساعت و" + " " + minutes + " " + "دقیقه",
|
||||
});
|
||||
}
|
||||
else if (hours > 0 && minutes == 0)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
message = hours + " " + "ساعت ",
|
||||
});
|
||||
}
|
||||
else if (hours == 0 && minutes > 0)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
message = minutes + " " + "دقیقه",
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
message = "",
|
||||
});
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
message = "",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnGetDayOfWeek(string dateFa)
|
||||
{
|
||||
if (dateFa.TryToGeorgianDateTime(out DateTime date) == false)
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
message = "",
|
||||
});
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
message = date.DayOfWeek.DayOfWeeKToPersian(),
|
||||
});
|
||||
}
|
||||
public IActionResult OnPostManualCreateOrEdit(CreateOrEditEmployeeRollCall command)
|
||||
{
|
||||
command.WorkshopId = _workshopId;
|
||||
var result = _rollCallApplication.ManualEdit(command);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostRemoveEmployeeRollCallsInDate(long employeeId, string date)
|
||||
{
|
||||
var result = _rollCallApplication.RemoveEmployeeRollCallsInDate(_workshopId, employeeId, date);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostRemoveEmployeeRollCallsInDate(long employeeId, string date)
|
||||
{
|
||||
var result = _rollCallApplication.RemoveEmployeeRollCallsInDate(_workshopId, employeeId, date);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,15 +45,15 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
base.OnPageHandlerExecuting(context);
|
||||
}
|
||||
|
||||
public bool IrregularWorkshopHaveGroupedAllPersonnelValidation(long customizeWorkshopSettingsId)
|
||||
public bool IrregularWorkshopHaveGroupedAllPersonnelValidation(long workshopId)
|
||||
{
|
||||
var isWorkshopIrregular = _customizeWorkshopSettingsApplication
|
||||
.GetWorkshopSettingsDetails(customizeWorkshopSettingsId).WorkshopShiftStatus == WorkshopShiftStatus.Irregular;
|
||||
.GetWorkshopSettingsDetails(workshopId).WorkshopShiftStatus == WorkshopShiftStatus.Irregular;
|
||||
|
||||
if (isWorkshopIrregular == false)
|
||||
return true;
|
||||
|
||||
if (_customizeWorkshopSettingsApplication.GetEmployeesWithoutGroup(customizeWorkshopSettingsId).Any())
|
||||
var employeesWithoutGroup= _customizeWorkshopSettingsApplication.GetEmployeesWithoutGroupByWorkshopId(workshopId);
|
||||
if (employeesWithoutGroup.Any())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -12,40 +12,62 @@
|
||||
<link href="~/AssetsClient/css/table-style.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/table-responsive.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/operation-button.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/pages/rollcall/css/group.css" rel="stylesheet" />
|
||||
<link href="~/assetsclient/pages/rollcall/css/group.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<div class="content-container">
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row p-2">
|
||||
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
|
||||
<div class="col d-flex align-items-center justify-content-start">
|
||||
<img src="~/AssetsClient/images/icons/workshop.png" alt="" class="img-fluid me-2" style="width: 45px;" />
|
||||
<div>
|
||||
<h4 class="title d-flex align-items-center">عملیات گروهبندی حضور و غیاب</h4>
|
||||
<div class="title d-flex align-items-center">@Model.WorkshopFullName</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
|
||||
<span>بازگشت</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row p-2">
|
||||
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
|
||||
<div class="col d-flex align-items-center justify-content-start">
|
||||
<img src="~/AssetsClient/images/icons/workshop.png" alt="" class="img-fluid me-2" style="width: 45px;"/>
|
||||
<div>
|
||||
<h4 class="title d-flex align-items-center">عملیات گروهبندی حضور و غیاب</h4>
|
||||
<div class="title d-flex align-items-center">@Model.WorkshopFullName</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
|
||||
<span>بازگشت</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 p-0 mt-2">
|
||||
<button class="btnCreateNew" type="button" id="newCreateGroup">
|
||||
گروه جدید
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 p-0 mt-2">
|
||||
<button class="btnCreateNew" type="button" id="newCreateGroup">
|
||||
گروه جدید
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- List Items -->
|
||||
<div class="container-fluid">
|
||||
|
||||
@if (Model.GroupedAllEmployees==false)
|
||||
{
|
||||
<div class="row p-2">
|
||||
<div class="msg-note" style="background: #ff9696; font-size: 16px; color: #ffffff">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12 text-start">
|
||||
<div class="d-flex align-items-center">
|
||||
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="18" cy="18" r="13.5" fill="#2FC1C1"></circle>
|
||||
<path d="M19.5 10.5C19.5 11.3284 18.8284 12 18 12C17.1716 12 16.5 11.3284 16.5 10.5C16.5 9.67157 17.1716 9 18 9C18.8284 9 19.5 9.67157 19.5 10.5Z" fill="white"></path>
|
||||
<path stroke-width="1.5" d="M18 24.75V17.25C18 15.8358 18 15.1287 17.5607 14.6893C17.1213 14.25 16.4142 14.25 15 14.25V14.25M18 24.75H20.25M18 24.75H15.75" stroke="white"></path>
|
||||
</svg>
|
||||
<p class="m-0 ms-2">توجه داشته باشید تا زمانی که تمامی پرسنل شما گروهبندی نشده اند قادر به استفاده از بخش های حضور غیاب جاری و سوابق حضور غیاب نمی باشید</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
<div class="row px-lg-1">
|
||||
|
||||
|
||||
<div class="col-12 col-md-5 p-0 pe-1">
|
||||
<div class="wrapper list-box w-100 table-rollcall-group1">
|
||||
<div class="Rtable Rtable--5cols Rtable--collapse">
|
||||
@@ -81,8 +103,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="MainModal" class="modal fade personalListModal" aria-labelledby="myModalLabel" data-bs-backdrop="static" aria-hidden="true" tabindex="-1" style="display: none;">
|
||||
<div class="modal-dialog modal-md modal-dialog-centered">
|
||||
<div id="MainModal" class="modal fade groupWorkModal" aria-labelledby="myModalLabel" data-bs-backdrop="static" aria-hidden="true" tabindex="-1" style="display: none;">
|
||||
<div class="modal-dialog modal-md modal-dialog-centered groupWorkModal-width">
|
||||
<div class="modal-content" id="ModalContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,7 @@ using CompanyManagment.App.Contracts.Employee;
|
||||
using System.Text.RegularExpressions;
|
||||
using Microsoft.AspNetCore.Mvc.Formatters;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
{
|
||||
@@ -22,7 +23,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
private readonly ICustomizeWorkshopSettingsApplication _customizeWorkshopSettingsApplication;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
|
||||
public bool GroupedAllEmployees;
|
||||
private readonly long _workshopId;
|
||||
public string WorkshopFullName;
|
||||
public CustomizeWorkshopSettingsViewModel RollCallWorkshopSettings;
|
||||
@@ -40,15 +41,29 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
|
||||
if (_workshopId < 1)
|
||||
throw new InvalidDataException("اختلال در کارگاه");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public bool IrregularWorkshopHaveGroupedAllPersonnelValidation(long workshopId)
|
||||
{
|
||||
var isWorkshopIrregular = _customizeWorkshopSettingsApplication
|
||||
.GetWorkshopSettingsDetails(workshopId).WorkshopShiftStatus == WorkshopShiftStatus.Irregular;
|
||||
|
||||
if (isWorkshopIrregular == false)
|
||||
return true;
|
||||
var employeesWithoutGroup = _customizeWorkshopSettingsApplication.GetEmployeesWithoutGroupByWorkshopId(workshopId);
|
||||
if (employeesWithoutGroup.Any())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
//if (_workshopId != 11)
|
||||
// return Redirect("/Client/Company/RollCall");
|
||||
var account = _authHelper.CurrentAccountInfo();
|
||||
GroupedAllEmployees = IrregularWorkshopHaveGroupedAllPersonnelValidation(_workshopId);
|
||||
|
||||
var workshop = _workshopApplication.GetWorkshopInfo(_workshopId);
|
||||
var workshop = _workshopApplication.GetWorkshopInfo(_workshopId);
|
||||
WorkshopFullName = workshop.WorkshopFullName;
|
||||
|
||||
RollCallWorkshopSettings = _customizeWorkshopSettingsApplication.GetWorkshopSettingsByWorkshopId(_workshopId, account);
|
||||
@@ -189,7 +204,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
|
||||
public IActionResult OnGetEditEmployee(long groupId, List<long> employeeId)
|
||||
{
|
||||
var employee = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByEmployeeIdGroupSettingsId(_workshopId, employeeId.First());
|
||||
var employee = _customizeWorkshopSettingsApplication.GetByEmployeeIdAndWorkshopIdIncludeGroupSettings(_workshopId, employeeId.First());
|
||||
var command = new EditCustomizeEmployeeSettings()
|
||||
{
|
||||
Id = employee.Id,
|
||||
@@ -200,7 +215,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
ShiftViewModel = employee.RollCallWorkshopShifts,
|
||||
BreakTime = employee.BreakTime,
|
||||
WorkshopShiftStatus = employee.WorkshopShiftStatus,
|
||||
IrregularShift = employee.IrregularShift
|
||||
IrregularShift = employee.IrregularShift,
|
||||
FridayWork = employee.FridayWork,
|
||||
HolidayWork = employee.HolidayWork,
|
||||
};
|
||||
return Partial("ModalEditEmployeeFromGroup", command);
|
||||
}
|
||||
|
||||
@@ -298,8 +298,8 @@
|
||||
</div>
|
||||
<!-- END MAIN CONTENT -->
|
||||
|
||||
<div id="MainModal" class="modal fade personalListModal" aria-labelledby="myModalLabel" aria-hidden="true" tabindex="-1" data-bs-backdrop="static" style="display: none;">
|
||||
<div class="modal-dialog modal-md modal-dialog-centered">
|
||||
<div id="MainModal" class="modal fade groupSettingModall" aria-labelledby="myModalLabel" aria-hidden="true" tabindex="-1" data-bs-backdrop="static" style="display: none;">
|
||||
<div class="modal-dialog modal-md modal-dialog-centered groupSettingModall-width">
|
||||
<div class="modal-content" id="ModalContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
}
|
||||
|
||||
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
||||
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus)
|
||||
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
|
||||
{
|
||||
var workshopHash = User.FindFirstValue("WorkshopSlug");
|
||||
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
@@ -283,7 +283,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
|
||||
//Todo:Vafa!!
|
||||
//Todo: Vafa : to in ja bool replaceChange group ro ezafe kon. hatman ham workshopShiftStatus az front pas bede be in.
|
||||
var result = _customizeWorkshopSettingsApplication.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus);
|
||||
var result = _customizeWorkshopSettingsApplication
|
||||
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus,fridayWork, holidayWork);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
|
||||
@@ -10,9 +10,13 @@
|
||||
background-color: #fef2f2 !important;
|
||||
border: 1px solid #eb3434 !important;
|
||||
}
|
||||
|
||||
.modalRollCallWidth {
|
||||
max-width: 550px;
|
||||
}
|
||||
|
||||
.modal-dialog, .modal-content {
|
||||
height: 420px;
|
||||
height: 470px;
|
||||
}
|
||||
|
||||
.timeWorkTitle {
|
||||
@@ -33,6 +37,7 @@
|
||||
|
||||
.groupBox .form-control {
|
||||
background-color: #ffffff;
|
||||
padding: .375rem .35rem;
|
||||
}
|
||||
|
||||
.groupBox .form-control::placeholder {
|
||||
@@ -59,12 +64,13 @@
|
||||
.btnRemoveTimeWork {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
background-color: #F87171;
|
||||
border-radius: 7px;
|
||||
padding: 3px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
/* padding: 3px; */
|
||||
width: 63px;
|
||||
height: 24px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ShowMessage {
|
||||
@@ -81,9 +87,64 @@
|
||||
}
|
||||
|
||||
.heightControll {
|
||||
height: 190px;
|
||||
height: 240px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
|
||||
.allSumtxt {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #7f7f7f;
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 6px;
|
||||
}
|
||||
|
||||
.startDatetxt {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #7f7f7f;
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
right: 6px;
|
||||
}
|
||||
|
||||
.endDatetxt {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #7f7f7f;
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 6px;
|
||||
}
|
||||
|
||||
.cusDateTime {
|
||||
width: 66px;
|
||||
}
|
||||
|
||||
@@media (max-width: 768px) {
|
||||
.cusDateTime {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.startDatetxt {
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.endDatetxt {
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.form-control-date {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
@@ -101,33 +162,61 @@
|
||||
<div class="row">
|
||||
<div class="col-12 my-1">
|
||||
<div class="select-alert">
|
||||
<select class="form-select select2OptionAddModal" aria-label="انتخاب پرسنل ..." name="Command.EmployeeId" id="employeeSelectAddModal">
|
||||
</select>
|
||||
<div class="position-relative">
|
||||
<select class="form-select select2OptionAddModal" aria-label="انتخاب پرسنل ..." name="Command.EmployeeId" id="employeeSelectAddModal">
|
||||
</select>
|
||||
<span class="allSumtxt"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 my-1">
|
||||
<input class="form-control form-control-date text-center" name="Command.DateFa" placeholder="تاریخ" style="direction: ltr" />
|
||||
<input class="form-control form-control-date-main text-center" name="Command.DateFa" placeholder="تاریخ" style="direction: ltr" />
|
||||
</div>
|
||||
|
||||
<div class="heightControll">
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
|
||||
<div class="col-12 mb-2 mt-1">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-center">
|
||||
<div class="timeWorkTitle ti">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-end d-flex justify-content-end">
|
||||
<div class="removeBtn">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="d-flex flex-column flex-md-row align-items-center gap-1">
|
||||
<div class="position-relative">
|
||||
<span class="startDatetxt"></span>
|
||||
<input type="text" class="form-control text-end form-control-date StartDate" name="Command.RollCallRecords[0].StartDate" placeholder="0000/00/00" style="direction: ltr;">
|
||||
</div>
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime" name="Command.RollCallRecords[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</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.RollCallRecords[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="d-flex flex-column-reverse flex-md-row align-items-center gap-1">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime me-1" name="Command.RollCallRecords[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="position-relative">
|
||||
<input type="text" class="form-control text-start form-control-date EndDate" name="Command.RollCallRecords[0].EndDate" placeholder="0000/00/00" style="direction: ltr;">
|
||||
<span class="endDatetxt"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
@@ -186,7 +275,8 @@
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var saveRollCallWorkTimeAjax = `@Url.Page("./CaseHistory", "ManualCreateOrEdit")`;
|
||||
var employeeListAjax = `@Url.Page("./CaseHistory", "EmployeeList")`;
|
||||
|
||||
var checkEmployeeData = `@Url.Page("./CaseHistory", "CheckEmployeeData")`;
|
||||
var dayOfWeekDataUrl = `@Url.Page("./CaseHistory", "DayOfWeek")`;
|
||||
var totalWorkingDataUrl = `@Url.Page("./CaseHistory", "TotalWorking")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/ModalAddRollCall.js?ver=@clientVersion"></script>
|
||||
@@ -140,24 +140,23 @@
|
||||
</div>
|
||||
|
||||
<div class="container p-0 m-0" id="step-form2" style="display: none">
|
||||
|
||||
|
||||
<div class="p-0 m-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 mb-2">
|
||||
<p class="m-0">ساعات کاری مجموعه این کارگاه را مشخص نمائید</p>
|
||||
<div class="d-flex align-items-center justify-content-center mb-2">
|
||||
<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="CreateWorkshopSettings.WorkshopShiftStatus" id="organized" class="radio-workTimeOption">
|
||||
<label for="organized" class="radio-label-workTimeOption w-100">منقطع</label>
|
||||
<input type="radio" value="Regular" name="CreateWorkshopSettings.WorkshopShiftStatus" id="organized" class="radio-workTimeOption">
|
||||
<label for="organized" class="radio-label-workTimeOption w-100">منقطع</label>
|
||||
|
||||
<input type="radio" value="Irregular" name="CreateWorkshopSettings.WorkshopShiftStatus" id="disorganized" class="radio-workTimeOption">
|
||||
<label for="disorganized" class="radio-label-workTimeOption w-100">مستمر</label>
|
||||
<input type="radio" value="Irregular" name="CreateWorkshopSettings.WorkshopShiftStatus" id="disorganized" class="radio-workTimeOption">
|
||||
<label for="disorganized" class="radio-label-workTimeOption w-100">مستمر</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row" id="step_workTimeOption" style="height: 0">
|
||||
<div class="row" id="step_workTimeOption" style="height: 0">
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
@@ -307,4 +306,4 @@
|
||||
var hasGroupWorkshop = @(Model.HasGroupWorkshop ? "true" : "false");
|
||||
var saveCameraAccountAndWorkshopSettingAjax = `@Url.Page("./Index", "SaveCameraAccountAndWorkshopSetting")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/modalcameraaccount.js?ver=@clientVersion"></script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/modalcameraaccount.js?ver=123clientVersion"></script>
|
||||
@@ -7,18 +7,19 @@
|
||||
}
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center mb-2 pb-0">
|
||||
<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>ایجاد گروه پرسنلی</h6>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="modal-body pt-2">
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
<input type="hidden" asp-for="@Model.CustomizeWorkshopSettingId" />
|
||||
<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 m-0" asp-for="@Model.Name" placeholder="نام گروه"/>
|
||||
<input type="text" class="form-control m-0" asp-for="@Model.Name" placeholder="نام گروه را وارد نمایید"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -129,7 +130,7 @@
|
||||
<div class="d-flex align-items-center my-1 breakTimeDiv">
|
||||
<input type="checkbox" id="BreakTimeFirst" name="BreakTime.hasBreakTimeValue" class="form-check-input">
|
||||
<label for="BreakTimeFirst" class="lableCheckBreakTime">
|
||||
این پرسنل دارای ساعت استراحت نامشخص با انتخاب این تیک پرسنل باید برای استراحت ورود و خروج ثبت کند.
|
||||
این پرسنل دارای ساعت استراحت نامشخص می باشد با انتخاب این تیک پرسنل باید برای استراحت ورود و خروج ثبت کند.
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -177,6 +178,47 @@
|
||||
@* <span class="mx-1" id="computeTimeText"></span> *@
|
||||
</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="Command.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="Command.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="Command.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="Command.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">
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center mb-2 pb-0">
|
||||
<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">
|
||||
<div class="modal-body pt-2">
|
||||
|
||||
<form role="form" method="post" name="edit-employee-form" id="edit-employee-form" autocomplete="off">
|
||||
|
||||
@@ -31,8 +31,9 @@
|
||||
<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"/>
|
||||
<input type="text" class="form-control" value="@Model.NameGroup" placeholder="نام گروه را وارد نمایید" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -208,7 +209,7 @@
|
||||
<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>
|
||||
@@ -254,6 +255,47 @@
|
||||
</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">
|
||||
|
||||
@@ -9,19 +9,20 @@
|
||||
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header d-block text-center mb-2 pb-0">
|
||||
<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>ویرایش گروه <span>@Model.Name</span></h6>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="modal-body pt-2">
|
||||
<form role="form" method="post" name="edit-form" id="edit-form" autocomplete="off">
|
||||
<input type="hidden" asp-for="@Model.CustomizeWorkshopSettingId" />
|
||||
<div class="container p-0 m-0">
|
||||
<div class="row">
|
||||
<input type="hidden" id="CommandID" asp-for="@Model.Id"/>
|
||||
<input type="hidden" id="CommandID" asp-for="@Model.Id" />
|
||||
<div class="lableCheckBreakTime">نام گروه</div>
|
||||
<div class="col-12 d-flex align-items-center">
|
||||
<input type="text" class="form-control m-0" asp-for="@Model.Name" placeholder="نام گروه"/>
|
||||
<input type="text" class="form-control m-0" asp-for="@Model.Name" placeholder="نام گروه را وارد نمایید"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -40,7 +41,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2" id="step_workTimeOption" style="height: 0; display: none">
|
||||
<div class="row mt-2" id="step_workTimeOption" style="height: 0; display: none">
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
|
||||
@if (Model.ShiftViewModel.Any())
|
||||
@@ -210,7 +211,7 @@
|
||||
<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>
|
||||
@@ -223,7 +224,7 @@
|
||||
</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="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">
|
||||
@@ -257,6 +258,48 @@
|
||||
</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">
|
||||
|
||||
@@ -16,8 +16,12 @@
|
||||
border: 1px solid #eb3434 !important;
|
||||
}
|
||||
|
||||
.modalRollCallWidth {
|
||||
max-width: 550px;
|
||||
}
|
||||
|
||||
.modal-dialog, .modal-content {
|
||||
height: 420px;
|
||||
height: 470px;
|
||||
}
|
||||
|
||||
.timeWorkTitle {
|
||||
@@ -38,6 +42,7 @@
|
||||
|
||||
.groupBox .form-control {
|
||||
background-color: #ffffff;
|
||||
padding: .375rem .35rem;
|
||||
}
|
||||
|
||||
.groupBox .form-control::placeholder {
|
||||
@@ -64,12 +69,13 @@
|
||||
.btnRemoveTimeWork {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
background-color: #F87171;
|
||||
border-radius: 7px;
|
||||
padding: 3px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
/* padding: 3px; */
|
||||
width: 63px;
|
||||
height: 24px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.ShowMessage {
|
||||
@@ -86,9 +92,119 @@
|
||||
}
|
||||
|
||||
.heightControll {
|
||||
height: 190px;
|
||||
height: 240px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.irregularText {
|
||||
color: #5C5C5C;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.irregularBox {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
background-color: #F5F5F5;
|
||||
border-radius: 9px;
|
||||
border: 1px solid #E7E7E7;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.irrregularContent {
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transform: translateX(100%);
|
||||
transition: transform 1s ease-in-out, opacity 1s ease-in-out;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.irrregularContent.active {
|
||||
transform: translateX(0);
|
||||
opacity: 1;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.navButton {
|
||||
background-color: transparent;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
margin: 10px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.navigation svg path {
|
||||
transition: fill 0.3s ease;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.allSumtxt {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #7f7f7f;
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 6px;
|
||||
}
|
||||
|
||||
|
||||
.startDatetxt {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #7f7f7f;
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
right: 6px;
|
||||
}
|
||||
|
||||
.endDatetxt {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #7f7f7f;
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 6px;
|
||||
}
|
||||
|
||||
.cusDateTime {
|
||||
width: 66px;
|
||||
}
|
||||
|
||||
@@media (max-width: 768px){
|
||||
.cusDateTime {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.startDatetxt {
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.endDatetxt {
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.form-control-date {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
@@ -107,7 +223,10 @@
|
||||
<div class="col-12 my-1">
|
||||
<div class="select-alert">
|
||||
<input type="hidden" name="Command.EmployeeId" value="@Model.EmployeeId" />
|
||||
<input class="form-control disable" value="@Model.EmployeeFullName" placeholder="نام پرسنل" />
|
||||
<div class="position-relative">
|
||||
<input class="form-control disable" value="@Model.EmployeeFullName" placeholder="نام پرسنل" />
|
||||
<span class="allSumtxt"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -158,37 +277,62 @@
|
||||
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
نوبت @txtString
|
||||
<div class="col-12 mb-2 mt-1">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4 text-start">
|
||||
<div class="timeWorkTitle">
|
||||
نوبت @txtString
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-center">
|
||||
<div class="timeWorkTitle ti">
|
||||
@item.TotalWorkingHours
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-end d-flex justify-content-end">
|
||||
@if (index == 0)
|
||||
{
|
||||
<div class="removeBtn">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="removeBtn">
|
||||
<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>
|
||||
<span class="text-white ms-1">حذف</span>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[@index].StartTime" placeholder="00:00" value="@item.StartTimeString" style="direction: ltr;">
|
||||
<div class="d-flex flex-column flex-md-row align-items-center gap-1">
|
||||
<div class="position-relative">
|
||||
<span class="startDatetxt">@item.StartDayOfWeekFa</span>
|
||||
<input type="text" class="form-control text-end form-control-date StartDate" name="Command.RollCallRecords[@index].StartDate" value="@item.StartDateFa" placeholder="0000/00/00" style="direction: ltr;">
|
||||
</div>
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime" name="Command.RollCallRecords[@index].StartTime" placeholder="00:00" value="@item.StartTimeString" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[@index].EndTime" placeholder="00:00" value="@item.EndTimeString" style="direction: ltr;">
|
||||
<div class="d-flex flex-column-reverse flex-md-row align-items-center gap-1">
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime" name="Command.RollCallRecords[@index].EndTime" placeholder="00:00" value="@item.EndTimeString" style="direction: ltr;">
|
||||
<div class="position-relative">
|
||||
<input type="text" class="form-control text-start form-control-date EndDate" name="Command.RollCallRecords[@index].EndDate" value="@item.EndDateFa" placeholder="0000/00/00" style="direction: ltr;">
|
||||
<span class="endDatetxt">@item.EndDayOfWeekFa</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (index == 0)
|
||||
{
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-2 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>
|
||||
@@ -200,23 +344,44 @@
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
<div class="col-12 mb-1">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4 text-start">
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-center">
|
||||
<div class="timeWorkTitle ti">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-end d-flex justify-content-end">
|
||||
<div class="removeBtn">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="d-flex flex-column flex-md-row align-items-center gap-1">
|
||||
<div class="position-relative">
|
||||
<span class="startDatetxt"></span>
|
||||
<input type="text" class="form-control text-end form-control-date StartDate" name="Command.RollCallRecords[0].StartDate" placeholder="0000/00/00" style="direction: ltr;">
|
||||
</div>
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime" name="Command.RollCallRecords[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
<div class="d-flex flex-column-reverse flex-md-row align-items-center gap-1">
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime" name="Command.RollCallRecords[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="position-relative">
|
||||
<input type="text" class="form-control text-start form-control-date EndDate" name="Command.RollCallRecords[0].EndDate" placeholder="0000/00/00" style="direction: ltr;">
|
||||
<span class="endDatetxt"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -275,12 +440,140 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-12 my-1 d-none">
|
||||
<div class="irregularBox">
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-2">
|
||||
<div class="navigation">
|
||||
<button type="button" id="prevBox" class="navButton">
|
||||
<svg width="21" height="24" viewBox="0 0 21 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19.5 9.40192C21.5 10.5566 21.5 13.4434 19.5 14.5981L4.5 23.2583C2.5 24.413 -1.17888e-06 22.9697 -1.07793e-06 20.6603L-3.2083e-07 3.33974C-2.19883e-07 1.03034 2.5 -0.413032 4.5 0.741669L19.5 9.40192Z" fill="#2DBDBD" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-8 position-relative overflow-hidden">
|
||||
<div class="irrregularContent active">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">شروع بکار</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" name="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">پایان کار</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" name="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ShowMessage d-none">
|
||||
<p class="m-0" id="ShowSettingMessage"></p>
|
||||
@* if the date is same, then need col-12 *@
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">1403/08/25</div>
|
||||
<div class="irregularText">شنبه</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">1403/08/26</div>
|
||||
<div class="irregularText">یکشنبه</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="irrregularContent">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">شروع بکار</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" name="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">پایان کار</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" name="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@* if the date is same, then need col-12 *@
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">1403/08/25</div>
|
||||
<div class="irregularText">شنبه</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">1403/08/26</div>
|
||||
<div class="irregularText">یکشنبه</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="irrregularContent">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">شروع بکار</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" name="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">پایان کار</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" name="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@* if the date is same, then need col-12 *@
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">1403/08/25</div>
|
||||
<div class="irregularText">شنبه</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="form-group text-center">
|
||||
<div class="irregularText">1403/08/26</div>
|
||||
<div class="irregularText">یکشنبه</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<div class="navigation">
|
||||
<button type="button" id="nextBox" class="navButton">
|
||||
<svg width="21" height="24" viewBox="0 0 21 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1.5 14.5981C-0.500003 13.4434 -0.5 10.5566 1.5 9.40192L16.5 0.741669C18.5 -0.413032 21 1.03034 21 3.33974L21 20.6603C21 22.9697 18.5 24.413 16.5 23.2583L1.5 14.5981Z" fill="#2DBDBD" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ShowMessage d-none">
|
||||
<p class="m-0" id="ShowSettingMessage"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -312,7 +605,9 @@
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var saveRollCallWorkTimeAjax = `@Url.Page("./CaseHistory", "ManualCreateOrEdit")`;
|
||||
var loadByEmployeeRollCallWorkTimeAjax = `@Url.Page("./CaseHistory", "ManualCreateOrEdit")`;
|
||||
var employeeListAjax = `@Url.Page("./CaseHistory", "EmployeeList")`;
|
||||
|
||||
var dayOfWeekDataUrl = `@Url.Page("./CaseHistory", "DayOfWeek")`;
|
||||
var totalWorkingDataUrl = `@Url.Page("./CaseHistory", "TotalWorking")`;
|
||||
|
||||
var itemsEditableDatesData = @Html.Raw(Json.Serialize(Model.EditableDates));
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/ModalEditRollCall.js?ver=@clientVersion"></script>
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="container p-0 m-0">
|
||||
|
||||
<div class="row p-0 m-0">
|
||||
<div class="d-flex flex-column align-items-center justify-content-center h-100">
|
||||
<div class="d-flex flex-column align-items-center justify-content-center h-100 p-0">
|
||||
<div class="d-flex align-items-center justify-content-center mb-2">
|
||||
<p class="m-0">ساعات کاری مجموعه این کارگاه را مشخص نمائید</p>
|
||||
</div>
|
||||
@@ -151,6 +151,52 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
<div class="container my-2">
|
||||
|
||||
<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">
|
||||
|
||||
@@ -427,6 +427,7 @@ button.btn-edit:hover {
|
||||
|
||||
.Rtable--collapse .Rtable-row {
|
||||
outline: none;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.btn-register, .btn-cancel2 {
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
}
|
||||
|
||||
.modal-dialog, .modal-content {
|
||||
height: 610px;
|
||||
height: 700px;
|
||||
}
|
||||
|
||||
.groupWorkModal-width {
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
.timeWorkTitle {
|
||||
@@ -124,7 +128,8 @@
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime {
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
margin: 0 10px;
|
||||
@@ -149,6 +154,12 @@
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.extraOptionBorder {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px 0;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
/************************ Radio Button Input () ************************/
|
||||
.form-check-input[type="radio"],
|
||||
.form-check-input[type="checkbox"] {
|
||||
@@ -198,7 +209,8 @@
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.modal-dialog, .modal-content {
|
||||
height: 622px;
|
||||
/*height: 622px;*/
|
||||
height: 750px;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption {
|
||||
@@ -208,7 +220,14 @@
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime {
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.container, .container-sm {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,11 @@
|
||||
}
|
||||
|
||||
.modal-dialog, .modal-content {
|
||||
height: 610px;
|
||||
height: 700px;
|
||||
}
|
||||
|
||||
.groupWorkModal-width {
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
.timeWorkTitle {
|
||||
@@ -16,6 +20,10 @@
|
||||
margin: auto 0 auto 6px;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
|
||||
.groupBox {
|
||||
background-color: #F5F5F5;
|
||||
border-radius: 10px;
|
||||
@@ -24,18 +32,18 @@
|
||||
margin: 6px 3px;
|
||||
}
|
||||
|
||||
.groupBox .form-control {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.groupBox .form-control {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.groupBox .form-control::placeholder {
|
||||
color: #bfbfbf;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
.groupBox .form-control::placeholder {
|
||||
color: #bfbfbf;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
|
||||
.groupBox .form-control::-ms-input-placeholder { /* Edge 12-18 */
|
||||
color: #bfbfbf;
|
||||
}
|
||||
.groupBox .form-control::-ms-input-placeholder { /* Edge 12-18 */
|
||||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.groupBoxIrregular {
|
||||
background-color: #F5F5F5;
|
||||
@@ -45,18 +53,18 @@
|
||||
margin: 6px 3px;
|
||||
}
|
||||
|
||||
.groupBoxIrregular .form-control {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.groupBoxIrregular .form-control {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.groupBoxIrregular .form-control::placeholder {
|
||||
color: #bfbfbf;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
.groupBoxIrregular .form-control::placeholder {
|
||||
color: #bfbfbf;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
|
||||
.groupBoxIrregular .form-control::-ms-input-placeholder { /* Edge 12-18 */
|
||||
color: #bfbfbf;
|
||||
}
|
||||
.groupBoxIrregular .form-control::-ms-input-placeholder { /* Edge 12-18 */
|
||||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.btnAddTimeWork {
|
||||
display: flex;
|
||||
@@ -104,11 +112,11 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption:hover {
|
||||
color: #FFFFFF;
|
||||
background-color: #1c7474;
|
||||
border-color: #23A8A8;
|
||||
}
|
||||
.radio-label-workTimeOption:hover {
|
||||
color: #FFFFFF;
|
||||
background-color: #1c7474;
|
||||
border-color: #23A8A8;
|
||||
}
|
||||
|
||||
.radio-workTimeOption:checked + .radio-label-workTimeOption {
|
||||
color: #FFFFFF;
|
||||
@@ -120,7 +128,8 @@
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime {
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
margin: 0 10px;
|
||||
@@ -145,6 +154,12 @@
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.extraOptionBorder {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px 0;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
/************************ Radio Button Input () ************************/
|
||||
.form-check-input[type="radio"],
|
||||
.form-check-input[type="checkbox"] {
|
||||
@@ -194,7 +209,8 @@
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.modal-dialog, .modal-content {
|
||||
height: 622px;
|
||||
/*height: 622px;*/
|
||||
height: 750px;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption {
|
||||
@@ -204,7 +220,14 @@
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime {
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.container, .container-sm {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
}
|
||||
|
||||
.modal-dialog, .modal-content {
|
||||
height: 610px;
|
||||
height: 700px;
|
||||
}
|
||||
|
||||
.btn-register {
|
||||
white-space: nowrap;
|
||||
.groupWorkModal-width {
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
.timeWorkTitle {
|
||||
@@ -20,7 +20,6 @@
|
||||
margin: auto 0 auto 6px;
|
||||
}
|
||||
|
||||
|
||||
.form-control {
|
||||
background-color: #ffffff !important;
|
||||
}
|
||||
@@ -33,18 +32,18 @@
|
||||
margin: 6px 3px;
|
||||
}
|
||||
|
||||
.groupBox .form-control {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.groupBox .form-control {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.groupBox .form-control::placeholder {
|
||||
color: #bfbfbf;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
.groupBox .form-control::placeholder {
|
||||
color: #bfbfbf;
|
||||
opacity: 1; /* Firefox */
|
||||
}
|
||||
|
||||
.groupBox .form-control::-ms-input-placeholder { /* Edge 12-18 */
|
||||
color: #bfbfbf;
|
||||
}
|
||||
.groupBox .form-control::-ms-input-placeholder { /* Edge 12-18 */
|
||||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.groupBoxIrregular {
|
||||
background-color: #F5F5F5;
|
||||
@@ -90,106 +89,6 @@
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.submit-is-change-modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
.submit-is-change-modal .modal-content {
|
||||
height: 520px;
|
||||
}
|
||||
|
||||
.overlay-black-modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
background-color: #00000070;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
z-index: 26;
|
||||
}
|
||||
|
||||
.card-list-employee {
|
||||
height: 280px;
|
||||
background: #F5F5F5;
|
||||
border: 1px solid #E7E7E7;
|
||||
border-radius: 10px;
|
||||
padding: 6px 10px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.card-list-employee .card-employee {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 4px 5px;
|
||||
background: #ECFFFF;
|
||||
border: 1px solid #EAEAEA;
|
||||
border-radius: 5px;
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.card-list-employee .card-employee span {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background-color: #A7EAEA;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 5px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.card-list-employee .card-employee p {
|
||||
font-size: 14px;
|
||||
margin: 0 5px !important;
|
||||
}
|
||||
|
||||
|
||||
/************************ Radio Button Input (Like Checkbox appearance) ************************/
|
||||
.form-check-input[type="radio"],
|
||||
.form-check-input[type="checkbox"] {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 6px;
|
||||
padding: 8px;
|
||||
border: 1px solid #CFD3D4;
|
||||
background-color: white;
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
margin-right: 8px;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:checked,
|
||||
.form-check-input[type="checkbox"]:checked {
|
||||
background-color: #148989;
|
||||
border: 1px solid #ffffff !important;
|
||||
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white" stroke-width="3"%3E%3Cpath stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /%3E%3C/svg%3E');
|
||||
background-size: 75%;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:focus,
|
||||
.form-check-input[type="checkbox"]:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"] + label,
|
||||
.form-check-input[type="checkbox"] + label {
|
||||
color: #83898C;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:checked + label,
|
||||
.form-check-input[type="checkbox"]:checked + label {
|
||||
color: #2B2F32;
|
||||
}
|
||||
/************************ Radio Button Input (Like Checkbox appearance) ************************/
|
||||
|
||||
|
||||
.btn-workTimeOption-container {
|
||||
@@ -229,7 +128,8 @@
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime {
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
margin: 0 10px;
|
||||
@@ -254,6 +154,12 @@
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.extraOptionBorder {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px 0;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
/************************ Radio Button Input () ************************/
|
||||
.form-check-input[type="radio"],
|
||||
.form-check-input[type="checkbox"] {
|
||||
@@ -303,7 +209,8 @@
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.modal-dialog, .modal-content {
|
||||
height: 622px;
|
||||
/*height: 622px;*/
|
||||
height: 750px;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption {
|
||||
@@ -313,7 +220,14 @@
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime {
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.container, .container-sm {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
}
|
||||
|
||||
.modal-dialog, .modal-content {
|
||||
height: 420px;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.groupSettingModall-width {
|
||||
max-width: 540px;
|
||||
}
|
||||
|
||||
.timeWorkTitle {
|
||||
@@ -91,8 +95,8 @@
|
||||
background-color: #DDF4F4;
|
||||
text-align: center;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
margin: auto 6px;
|
||||
border-radius: 9px;
|
||||
margin: auto 5px;
|
||||
transition: all 0.3s ease-in-out;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -123,4 +127,99 @@
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: #1B929C;
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
margin: 0 10px;
|
||||
color: #101010;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.breack-time {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px 0;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.extraOptionBorder {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px 0;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
/************************ Radio Button Input () ************************/
|
||||
.form-check-input[type="radio"],
|
||||
.form-check-input[type="checkbox"] {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 6px;
|
||||
padding: 8px;
|
||||
border: 1px solid #CFD3D4;
|
||||
background-color: white;
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
margin-right: 8px;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:checked,
|
||||
.form-check-input[type="checkbox"]:checked {
|
||||
background-color: #148989;
|
||||
border: 1px solid #ffffff !important;
|
||||
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white" stroke-width="3"%3E%3Cpath stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /%3E%3C/svg%3E');
|
||||
background-size: 75%;
|
||||
}
|
||||
|
||||
.form-check-input[type=checkbox]:indeterminate {
|
||||
background-color: #148989;
|
||||
border-color: #ffffff;
|
||||
--bs-form-check-bg-image: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e);
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:focus,
|
||||
.form-check-input[type="checkbox"]:focus {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"] + label,
|
||||
.form-check-input[type="checkbox"] + label {
|
||||
color: #83898C;
|
||||
}
|
||||
|
||||
.form-check-input[type="radio"]:checked + label,
|
||||
.form-check-input[type="checkbox"]:checked + label {
|
||||
color: #2B2F32;
|
||||
}
|
||||
/************************ Radio Button Input (Like Checkbox appearance) ************************/
|
||||
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.modal-dialog, .modal-content {
|
||||
/*height: 622px;*/
|
||||
height: 600px;
|
||||
}
|
||||
|
||||
.radio-label-workTimeOption {
|
||||
font-size: 10px;
|
||||
padding: 8px 8px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
#computeTime span,
|
||||
.lableCheckBreakTime,
|
||||
.labelExtraOption {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.container, .container-sm {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
@@ -212,9 +212,10 @@ function saveEmployeeData() {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
|
||||
$('#MainModal').modal('toggle');
|
||||
loadDataAjax();
|
||||
}, 2000);
|
||||
}, 2000);
|
||||
|
||||
loadDataAjax();
|
||||
$('#MainModal').modal('toggle');
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#modalWorkshopFullname").text($('#caseHistoryWorkshopFullname').text());
|
||||
$('.btn-register').addClass('disable');
|
||||
|
||||
@@ -10,12 +9,26 @@
|
||||
});
|
||||
|
||||
// فعال و غیر فعال شدن برای تنظیمات ساعت کاری براساس ورودی هایی که اعمال میشود
|
||||
if ($('#employeeSelectAddModal').val() !== '0' && $('.form-control-date').val() !== '') {
|
||||
if ($('#employeeSelectAddModal').val() !== '0' && $('.form-control-date-main').val() !== '') {
|
||||
$('.heightControll').removeClass('disable');
|
||||
} else {
|
||||
$('.heightControll').addClass('disable');
|
||||
}
|
||||
|
||||
$(".form-control-date-main").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
@@ -50,13 +63,22 @@
|
||||
$(".btnAddTimeWork").on("click", function () {
|
||||
var currentCount = $('.groupBox').length;
|
||||
var $inputs = $('.dateTime');
|
||||
var $inputsDate = $('.form-control-date');
|
||||
var allFilled = true;
|
||||
|
||||
$inputsDate.each(function () {
|
||||
if ($(this).val() === '') {
|
||||
allFilled = false;
|
||||
$('.btn-register').addClass('disable');
|
||||
showAlert('ابتدا تاریخ و ساعت شروع و پایان را وارد نمائید.', $(this));
|
||||
}
|
||||
});
|
||||
|
||||
$inputs.each(function () {
|
||||
if ($(this).val() === '') {
|
||||
allFilled = false;
|
||||
$('.btn-register').addClass('disable');
|
||||
showAlert('ابتدا ساعت شروع و پایان را وارد نمائید.', $(this));
|
||||
showAlert('ابتدا تاریخ و ساعت شروع و پایان را وارد نمائید.', $(this));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -86,24 +108,48 @@
|
||||
var timeWorkHtml = `
|
||||
<div class="groupBox timeWork">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</div>
|
||||
<div class="col-12 mb-2">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4 text-start">
|
||||
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</div>
|
||||
</div>
|
||||
<div class="col-4 text-center">
|
||||
<div class="timeWorkTitle ti">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-end d-flex justify-content-end">
|
||||
<div class="removeBtn">
|
||||
<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>
|
||||
<span class="text-white ms-1">حذف</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[${currentCount}].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="d-flex flex-column flex-md-row align-items-center gap-1">
|
||||
<div class="position-relative">
|
||||
<span class="startDatetxt"></span>
|
||||
<input type="text" class="form-control text-end form-control-date StartDate" name="Command.RollCallRecords[${currentCount}].StartDate" placeholder="0000/00/00" style="direction: ltr;">
|
||||
</div>
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime ms-1" name="Command.RollCallRecords[${currentCount}].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[${currentCount}].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-2 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 class="d-flex flex-column-reverse flex-md-row align-items-center gap-1">
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime me-1" name="Command.RollCallRecords[${currentCount}].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="position-relative">
|
||||
<input type="text" class="form-control text-start form-control-date EndDate" name="Command.RollCallRecords[${currentCount}].EndDate" placeholder="0000/00/00" style="direction: ltr;">
|
||||
<span class="endDatetxt"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
@@ -111,10 +157,20 @@
|
||||
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
|
||||
|
||||
|
||||
|
||||
const newStartDateInput = $(`input[name="Command.RollCallRecords[${currentCount}].StartDate"]`);
|
||||
const newEndDateInput = $(`input[name="Command.RollCallRecords[${currentCount}].EndDate"]`);
|
||||
const newStartTimeInput = $(`input[name="Command.RollCallRecords[${currentCount}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.RollCallRecords[${currentCount}].EndTime"]`);
|
||||
|
||||
newStartDateInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
newEndDateInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
@@ -125,6 +181,18 @@
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartDateInput[0], {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
new Cleave(newEndDateInput[0], {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
@@ -135,16 +203,6 @@
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${currentCount}].StartTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${currentCount}].EndTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
updateAddButtonText(currentCount + 1);
|
||||
|
||||
if (currentCount + 1 === 5) {
|
||||
@@ -197,6 +255,14 @@ function updateAddButtonText(currentCount) {
|
||||
}
|
||||
|
||||
let allFilled = true;
|
||||
$('.form-control-date').each(function () {
|
||||
const value = $(this).val().trim();
|
||||
if (value === "" || !dateValidCheck(value)) {
|
||||
allFilled = false;
|
||||
return false; // Break the loop
|
||||
}
|
||||
});
|
||||
|
||||
$('.dateTime').each(function () {
|
||||
const value = $(this).val().trim();
|
||||
if (value === "" || !timeValidCheck(value)) {
|
||||
@@ -239,36 +305,115 @@ function ajaxPersonals() {
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('keyup', ".dateTime", function () {
|
||||
$(document).on('keyup', ".dateTime, .form-control-date", function () {
|
||||
let $input = $(this);
|
||||
let value = $input.val();
|
||||
let lengthValue = value.length;
|
||||
let currentCount = $('.groupBox').length;
|
||||
|
||||
if (lengthValue >= 5) {
|
||||
if (!timeValidCheck(value)) {
|
||||
showAlert('ساعت را به درستی وارد نمائید', $input);
|
||||
updateAddButtonText(currentCount);
|
||||
} else {
|
||||
clearAlert($input);
|
||||
// validateAllTimes();
|
||||
updateAddButtonText(currentCount);
|
||||
const $groupBox = $input.closest('.groupBox');
|
||||
|
||||
// focusNextTimeInput($input);
|
||||
const startDate = $groupBox.find('.StartDate').val();
|
||||
const startTime = $groupBox.find('[name*="StartTime"]').val();
|
||||
const endDate = $groupBox.find('.EndDate').val();
|
||||
const endTime = $groupBox.find('[name*="EndTime"]').val();
|
||||
|
||||
// Validate input based on the field type
|
||||
if ($input.hasClass('form-control-date')) {
|
||||
// Date validation logic
|
||||
if (lengthValue >= 10) {
|
||||
if (!dateValidCheck(value)) {
|
||||
showAlert('تاریخ را به درستی وارد نمائید', $input);
|
||||
} else {
|
||||
clearAlert($input);
|
||||
dayOfWeekLoad(this, value);
|
||||
}
|
||||
} else {
|
||||
if ($input.hasClass('StartDate')) {
|
||||
$groupBox.find('.startDatetxt').text('');
|
||||
} else if ($input.hasClass('EndDate')) {
|
||||
$groupBox.find('.endDatetxt').text('');
|
||||
}
|
||||
}
|
||||
} else if ($input.hasClass('dateTime')) {
|
||||
if (lengthValue >= 5) {
|
||||
if (!timeValidCheck(value)) {
|
||||
showAlert('ساعت را به درستی وارد نمائید', $input);
|
||||
} else {
|
||||
clearAlert($input);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
updateAddButtonText(currentCount);
|
||||
}
|
||||
|
||||
if (startDate.length >= 10 && endDate.length >= 10) {
|
||||
if (!validateDates(startDate, endDate)) {
|
||||
showAlert('حضور غیاب در حال ویرایش را نمیتوانید بیشتر از یک روز از ثبت حضور غیاب عقب تر یا جلو تر ببرید', $input);
|
||||
}
|
||||
}
|
||||
|
||||
if (startDate.length >= 10 && startTime.length >= 5 && endDate.length >= 10 && endTime.length >= 5) {
|
||||
totalWorkingDataLoad(startDate, startTime, endDate, endTime, $groupBox);
|
||||
}
|
||||
|
||||
updateAddButtonText(currentCount);
|
||||
});
|
||||
|
||||
//function focusNextTimeInput(currentInput) {
|
||||
// var inputs = $(".dateTime");
|
||||
// var currentIndex = inputs.index(currentInput);
|
||||
function validateDates(startDate, endDate) {
|
||||
return itemsEditableDatesData.some(entry => entry.startFa === startDate && entry.endFa === endDate);
|
||||
}
|
||||
|
||||
|
||||
function dayOfWeekLoad(input, value) {
|
||||
$.ajax({
|
||||
url: dayOfWeekDataUrl,
|
||||
type: 'GET',
|
||||
data: { dateFa: value },
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
const $groupBox = $(input).closest('.groupBox');
|
||||
if ($(input).hasClass('StartDate')) {
|
||||
$groupBox.find('.startDatetxt').text(response.message);
|
||||
} else if ($(input).hasClass('EndDate')) {
|
||||
$groupBox.find('.endDatetxt').text(response.message);
|
||||
}
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function totalWorkingDataLoad(startDateVal, startTimeVal, endDateVal, endTimeVal, $groupBox) {
|
||||
$.ajax({
|
||||
url: totalWorkingDataUrl,
|
||||
type: 'GET',
|
||||
data: { startDate: startDateVal, startTime: startTimeVal, endDate: endDateVal, endTime: endTimeVal },
|
||||
success: function (response) {
|
||||
if (response) {
|
||||
$groupBox.find('.ti').text(response.message);
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// if (currentIndex !== -1 && currentIndex < inputs.length - 1) {
|
||||
// $(inputs[currentIndex + 1]).focus();
|
||||
// }
|
||||
//}
|
||||
|
||||
function showAlert(message, inputElement) {
|
||||
inputElement.addClass("errored");
|
||||
@@ -288,47 +433,11 @@ function timeValidCheck(value) {
|
||||
return timePattern.test(value);
|
||||
}
|
||||
|
||||
//function validateAllTimes() {
|
||||
// let timeRanges = [];
|
||||
function dateValidCheck(value) {
|
||||
const datePattern = /^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])$/;
|
||||
return datePattern.test(value);
|
||||
}
|
||||
|
||||
// $(".groupBox").each(function () {
|
||||
// let startTime = $(this).find('input[name*="StartTime"]').val();
|
||||
// let endTime = $(this).find('input[name*="EndTime"]').val();
|
||||
|
||||
// if (startTime.length === 5 && endTime.length === 5) {
|
||||
// let startParts = startTime.split(':');
|
||||
// let endParts = endTime.split(':');
|
||||
// let startInMinutes = parseInt(startParts[0]) * 60 + parseInt(startParts[1]);
|
||||
// let endInMinutes = parseInt(endParts[0]) * 60 + parseInt(endParts[1]);
|
||||
// timeRanges.push({ start: startInMinutes, end: endInMinutes });
|
||||
// }
|
||||
// });
|
||||
|
||||
// // Check for conflicts and order
|
||||
// for (let i = 0; i < timeRanges.length; i++) {
|
||||
// for (let j = 0; j < i; j++) {
|
||||
// if (timeRanges[i].start >= timeRanges[i].end) {
|
||||
// showAlert('زمان شروع باید قبل از زمان پایان باشد', $(".groupBox").eq(i).find('input[name*="StartTime"]'));
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // Check for overlap with previous entries
|
||||
// if (timeRanges[i].start < timeRanges[j].end && timeRanges[i].end > timeRanges[j].start) {
|
||||
// showAlert('زمانها نباید تداخل داشته باشند', $(".groupBox").eq(i).find('input[name*="StartTime"]'));
|
||||
// return;
|
||||
// }
|
||||
// // Check if the current start time is before the previous start time
|
||||
// if (i > 0 && timeRanges[i].start < timeRanges[i - 1].start) {
|
||||
// showAlert('ساعت جدید نباید کوچکتر از ساعتهای قبلی باشد', $(".groupBox").eq(i).find('input[name*="StartTime"]'));
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//$(document).on('click', '.btn-register', function () {
|
||||
|
||||
//});
|
||||
|
||||
$('.btn-register').click(function() {
|
||||
var loading = $('.btn-register .spinner-loading');
|
||||
@@ -351,18 +460,16 @@ $('.btn-register').click(function() {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
loading.hide();
|
||||
$('#MainModal').modal('hide');
|
||||
//window.location.reload();
|
||||
}, 2000);
|
||||
|
||||
setTimeout(function () {
|
||||
hasData = true;
|
||||
dateIndex = 0;
|
||||
dateEmployeeIndex = null;
|
||||
$('#caseHistoryLoadData').html('');
|
||||
caseHistoryLoadAjax();
|
||||
loadUntilHeightExceeds();
|
||||
}, 1000);
|
||||
hasData = true;
|
||||
dateIndex = 0;
|
||||
dateEmployeeIndex = null;
|
||||
$('#caseHistoryLoadData').html('');
|
||||
caseHistoryLoadAjax();
|
||||
loadUntilHeightExceeds();
|
||||
$('#MainModal').modal('hide');
|
||||
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
@@ -383,7 +490,7 @@ $('.btn-register').click(function() {
|
||||
|
||||
$(document).on('change', '#employeeSelectAddModal', function () {
|
||||
const employeeId = $('#employeeSelectAddModal').val();
|
||||
const dateFa = $('.form-control-date').val();
|
||||
const dateFa = $('.form-control-date-main').val();
|
||||
|
||||
// Toggle .heightControll based on conditions
|
||||
toggleHeightControl();
|
||||
@@ -394,13 +501,11 @@ $(document).on('change', '#employeeSelectAddModal', function () {
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('keyup', '.form-control-date', function () {
|
||||
// Toggle .heightControll based on conditions
|
||||
$(document).on('keyup', '.form-control-date-main', function () {
|
||||
toggleHeightControl();
|
||||
|
||||
// Trigger fetching of roll call data if input length is valid
|
||||
const employeeId = $('#employeeSelectAddModal').val();
|
||||
const dateFa = $('.form-control-date').val();
|
||||
const dateFa = $('.form-control-date-main').val();
|
||||
|
||||
if (dateFa.length >= 10 && employeeId !== '0') {
|
||||
fetchAndDisplayRollCallData(employeeId, dateFa);
|
||||
@@ -409,7 +514,7 @@ $(document).on('keyup', '.form-control-date', function () {
|
||||
|
||||
|
||||
function toggleHeightControl() {
|
||||
if ($('#employeeSelectAddModal').val() !== '0' && $('.form-control-date').val().length >= 10) {
|
||||
if ($('#employeeSelectAddModal').val() !== '0' && $('.form-control-date-main').val().length >= 10) {
|
||||
$('.heightControll').removeClass('disable');
|
||||
$('.btn-register').removeClass('disable');
|
||||
} else {
|
||||
@@ -418,6 +523,9 @@ function toggleHeightControl() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var itemsEditableDatesData = [];
|
||||
// Function to handle the AJAX request and generate HTML for roll call data
|
||||
function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
let htmlElement = '';
|
||||
@@ -432,8 +540,9 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
data: { 'employeeId': employeeId, 'date': dateFa },
|
||||
success: function (response) {
|
||||
const rollCallData = response.data;
|
||||
itemsEditableDatesData = response.editableDates;
|
||||
|
||||
console.log(response);
|
||||
// console.log(response);
|
||||
|
||||
if (response.hasLeave) {
|
||||
htmlElement = `
|
||||
@@ -480,44 +589,76 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
}
|
||||
|
||||
htmlElement += `<div class="groupBox timeWork">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</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.RollCallRecords[${indexRollCallTime}].StartTime" value="${employee.startTimeString}" 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.RollCallRecords[${indexRollCallTime}].EndTime" value="${employee.endTimeString}" placeholder="00:00" style="direction: ltr;">
|
||||
</div>`;
|
||||
|
||||
if (indexRollCallTime === 0) {
|
||||
htmlElement += `<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>`;
|
||||
} else {
|
||||
htmlElement += `<div class="col-2 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 class="row align-items-center justify-content-between">
|
||||
<div class="col-12 mb-2">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4 text-start">
|
||||
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</div>
|
||||
</div>
|
||||
<div class="col-4 text-center">
|
||||
<div class="timeWorkTitle ti">
|
||||
${employee.totalWorkingHours}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-end d-flex justify-content-end">`;
|
||||
if (indexRollCallTime === 0) {
|
||||
htmlElement += `<div class="removeBtn"></div>`;
|
||||
} else {
|
||||
htmlElement += `<div class="removeBtn">
|
||||
<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>
|
||||
<span class="text-white ms-1">حذف</span>
|
||||
</button>
|
||||
</div>`;
|
||||
}
|
||||
htmlElement += `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<div class="d-flex flex-column flex-md-row align-items-center gap-1">
|
||||
<div class="position-relative">
|
||||
<span class="startDatetxt">${employee.startDayOfWeekFa}</span>
|
||||
<input type="text" class="form-control text-end form-control-date StartDate" name="Command.RollCallRecords[${indexRollCallTime}].StartDate" value="${employee.startDateFa}" placeholder="0000/00/00" style="direction: ltr;">
|
||||
</div>
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime ms-1" name="Command.RollCallRecords[${indexRollCallTime}].StartTime" value="${employee.startTimeString}" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<div class="d-flex flex-column-reverse flex-md-row align-items-center gap-1">
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime me-1" name="Command.RollCallRecords[${indexRollCallTime}].EndTime" value="${employee.endTimeString}" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="position-relative">
|
||||
<input type="text" class="form-control text-start form-control-date EndDate" name="Command.RollCallRecords[${indexRollCallTime}].EndDate" value="${employee.endDateFa}" placeholder="0000/00/00" style="direction: ltr;">
|
||||
<span class="endDatetxt">${employee.endDayOfWeekFa}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
htmlElement += `</div>
|
||||
</div>`;
|
||||
|
||||
$('#appendChildTimeWorkHtml').html(htmlElement);
|
||||
|
||||
|
||||
|
||||
const newStartDateInput = $(`input[name="Command.RollCallRecords[${indexRollCallTime}].StartDate"]`);
|
||||
const newEndDateInput = $(`input[name="Command.RollCallRecords[${indexRollCallTime}].EndDate"]`);
|
||||
const newStartTimeInput = $(`input[name="Command.RollCallRecords[${indexRollCallTime}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.RollCallRecords[${indexRollCallTime}].EndTime"]`);
|
||||
|
||||
newStartDateInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
newEndDateInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
@@ -528,6 +669,18 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartDateInput[0], {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
new Cleave(newEndDateInput[0], {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
@@ -539,19 +692,6 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
});
|
||||
|
||||
|
||||
// Apply time formatting with Cleave.js
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${indexRollCallTime}].StartTime"]`,
|
||||
// {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
// });
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${indexRollCallTime}].EndTime"]`,
|
||||
// {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
// });
|
||||
|
||||
// Update add button text
|
||||
updateAddButtonText(indexRollCallTime + 1);
|
||||
|
||||
@@ -567,19 +707,44 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
|
||||
htmlElement += `<div class="groupBox timeWork">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</div>
|
||||
|
||||
<div class="col-12 mb-2">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4 text-start">
|
||||
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</div>
|
||||
</div>
|
||||
<div class="col-4 text-center">
|
||||
<div class="timeWorkTitle ti">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-end d-flex justify-content-end">
|
||||
<div class="removeBtn">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="d-flex flex-column flex-md-row align-items-center gap-1">
|
||||
<div class="position-relative">
|
||||
<span class="startDatetxt"></span>
|
||||
<input type="text" class="form-control text-end form-control-date StartDate" name="Command.RollCallRecords[0].StartDate" placeholder="0000/00/00" style="direction: ltr;">
|
||||
</div>
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime ms-1" name="Command.RollCallRecords[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</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.RollCallRecords[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<div class="d-flex flex-column-reverse flex-md-row align-items-center gap-1">
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime me-1" name="Command.RollCallRecords[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="position-relative">
|
||||
<input type="text" class="form-control text-start form-control-date EndDate" name="Command.RollCallRecords[0].EndDate" placeholder="0000/00/00" style="direction: ltr;">
|
||||
<span class="endDatetxt"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
@@ -588,9 +753,20 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
|
||||
$('#appendChildTimeWorkHtml').html(htmlElement);
|
||||
|
||||
const newStartDateInput = $(`input[name="Command.RollCallRecords[0].StartDate"]`);
|
||||
const newEndDateInput = $(`input[name="Command.RollCallRecords[0].EndDate"]`);
|
||||
const newStartTimeInput = $(`input[name="Command.RollCallRecords[0].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.RollCallRecords[0].EndTime"]`);
|
||||
|
||||
newStartDateInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
newEndDateInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
@@ -601,6 +777,18 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartDateInput[0], {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
new Cleave(newEndDateInput[0], {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
@@ -611,19 +799,6 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
//// Apply time formatting with Cleave.js
|
||||
//new Cleave(`input[name="Command.RollCallRecords[0].StartTime"]`,
|
||||
// {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
// });
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[0].EndTime"]`,
|
||||
// {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
// Update Remove button enable/disable state
|
||||
|
||||
@@ -44,25 +44,8 @@
|
||||
$('#step-form2').addClass('disable');
|
||||
}
|
||||
|
||||
$("#next-step").on("click", function () {
|
||||
$('#step-form1').hide();
|
||||
$('#step-form2').show();
|
||||
|
||||
$('#prev-step').text('مرحله قبل');
|
||||
|
||||
if($('#step-form2').is(':visible'))
|
||||
{
|
||||
$('#step_workTimeOption').hide();
|
||||
$('.dateTime').each(function () {
|
||||
if ($(this).val() === '') {
|
||||
$('#next-step').addClass('disable');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#next-step').text('ثبت');
|
||||
$('#next-step').attr('onclick', 'registerAccount()');
|
||||
$('#step-2').removeClass('not-step');
|
||||
$("#next-step").on("click", function () {
|
||||
checkAccountExist();
|
||||
});
|
||||
|
||||
$("#prev-step").on("click", function () {
|
||||
@@ -432,69 +415,113 @@ $("#signupInputPassword").keyup(function () {
|
||||
passwordCheck(password);
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
//$(document).ready(function () {
|
||||
//var typingTimer;
|
||||
//var typingInterval = 1500;
|
||||
|
||||
//$("#username").on('keyup', function () {
|
||||
// // removed
|
||||
//});
|
||||
//});
|
||||
|
||||
|
||||
function checkAccountExist() {
|
||||
var typingTimer;
|
||||
var typingInterval = 1500;
|
||||
|
||||
$("#username").on('keyup', function () {
|
||||
clearTimeout(typingTimer);
|
||||
var username = $('#username').val();
|
||||
clearTimeout(typingTimer);
|
||||
var username = $('#username').val();
|
||||
|
||||
if (username.length >= 6) {
|
||||
$('#successSvg').addClass("d-none");
|
||||
$('#errorSvg').addClass("d-none");
|
||||
$('#loadingSpinner').removeClass("d-none");
|
||||
if (username.length >= 6) {
|
||||
$('#successSvg').addClass("d-none");
|
||||
$('#errorSvg').addClass("d-none");
|
||||
$('#loadingSpinner').removeClass("d-none");
|
||||
$('#next-step').addClass('disable');
|
||||
|
||||
typingTimer = setTimeout(function () {
|
||||
typingTimer = setTimeout(function () {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: checkAccountAjax,
|
||||
data: { username: username },
|
||||
success: function (response) {
|
||||
$('#loadingSpinner').addClass("d-none");
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: checkAccountAjax,
|
||||
data: { username: username },
|
||||
success: function (response) {
|
||||
$('#loadingSpinner').addClass("d-none");
|
||||
|
||||
if (response.success) {
|
||||
$('#errorSvg').addClass("d-none");
|
||||
$('#successSvg').removeClass("d-none");
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 2000);
|
||||
} else {
|
||||
$('#successSvg').addClass("d-none");
|
||||
$('#errorSvg').removeClass("d-none");
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 2000);
|
||||
if (response.success) {
|
||||
$('#errorSvg').addClass("d-none");
|
||||
$('#successSvg').removeClass("d-none");
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 2000);
|
||||
|
||||
|
||||
|
||||
$('#step-form1').hide();
|
||||
$('#step-form2').show();
|
||||
$('#prev-step').text('مرحله قبل');
|
||||
if ($('#step-form2').is(':visible')) {
|
||||
//$('#step_workTimeOption').hide();
|
||||
$('.dateTime').each(function () {
|
||||
if ($(this).val() === '') {
|
||||
if (hasGroupWorkshop) {
|
||||
$('#next-step').removeClass('disable');
|
||||
} else {
|
||||
$('#next-step').addClass('disable');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
$('#loadingSpinner').addClass("d-none");
|
||||
console.log(err);
|
||||
$('#next-step').text('ثبت');
|
||||
$('#next-step').attr('onclick', 'registerAccount()');
|
||||
$('#step-2').removeClass('not-step');
|
||||
if (hasGroupWorkshop) {
|
||||
$('#next-step').removeClass('disable');
|
||||
} else {
|
||||
$('#next-step').addClass('disable');
|
||||
}
|
||||
|
||||
} else {
|
||||
$('#successSvg').addClass("d-none");
|
||||
$('#errorSvg').removeClass("d-none");
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 2000);
|
||||
|
||||
$("#next-step").removeAttr("onclick");
|
||||
$('#next-step').removeClass('disable');
|
||||
$('#step-form2').hide();
|
||||
$('#prev-step').text('انصراف');
|
||||
$('#next-step').text('مرحله بعد');
|
||||
$('#step-2').addClass('not-step');
|
||||
$('#next-step').removeClass('disable');
|
||||
}
|
||||
});
|
||||
}, typingInterval);
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text("نام کاربری حداقل باید 6 حرف باشد");
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 4000);
|
||||
$('#loadingSpinner').addClass("d-none");
|
||||
$('#successSvg').addClass("d-none");
|
||||
$('#errorSvg').removeClass("d-none");
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
error: function (err) {
|
||||
$('#loadingSpinner').addClass("d-none");
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}, typingInterval);
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text("نام کاربری حداقل باید 6 حرف باشد");
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 4000);
|
||||
$('#loadingSpinner').addClass("d-none");
|
||||
$('#successSvg').addClass("d-none");
|
||||
$('#errorSvg').removeClass("d-none");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function registerAccount() {
|
||||
|
||||
@@ -41,13 +41,13 @@ $('#createData').click(function() {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
loading.hide();
|
||||
$('#MainModal').modal('hide');
|
||||
}, 2000);
|
||||
|
||||
|
||||
$(`#EmployeeFullName_${employeeId}`).html($('#EmployeeFName').val() + ' ' + $('#EmployeeLName').val());
|
||||
$(`#EmployeeFullNameMobile_${employeeId}`).html($('#EmployeeFName').val() + ' ' + $('#EmployeeLName').val());
|
||||
|
||||
$('#MainModal').modal('hide');
|
||||
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
|
||||
@@ -549,14 +549,31 @@ function ajaxEditEmployeeSaveData() {
|
||||
}
|
||||
//var hasBreakTime = $("#BreakTime").prop("checked") ? "true" : "false";
|
||||
var breakTimeValue = $("#TimeOnly").val();
|
||||
|
||||
|
||||
var FridayWork = "Default";
|
||||
if ($('#Friday1').prop('checked')) {
|
||||
FridayWork = "Default";
|
||||
} else if ($('#Friday2').prop('checked')) {
|
||||
FridayWork = "WorkInFriday";
|
||||
}
|
||||
|
||||
|
||||
var HolidayWork = "Default";
|
||||
if ($('#OffDays1').prop('checked')) {
|
||||
HolidayWork = "Default";
|
||||
} else if ($('#OffDays2').prop('checked')) {
|
||||
HolidayWork = "WorkInHolidays";
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
@@ -573,10 +590,11 @@ function ajaxEditEmployeeSaveData() {
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
loadDataAjax();
|
||||
}, 2000);
|
||||
|
||||
loadDataAjax();
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
|
||||
@@ -582,11 +582,31 @@ function ajaxSaveSubmit() {
|
||||
|
||||
//console.log(breakTimeValue);
|
||||
//return;
|
||||
|
||||
var FridayWork = "Default";
|
||||
if ($('#Friday1').prop('checked')) {
|
||||
FridayWork = "Default";
|
||||
} else if ($('#Friday2').prop('checked')) {
|
||||
FridayWork = "WorkInFriday";
|
||||
}
|
||||
|
||||
|
||||
var HolidayWork = "Default";
|
||||
if ($('#OffDays1').prop('checked')) {
|
||||
HolidayWork = "Default";
|
||||
} else if ($('#OffDays2').prop('checked')) {
|
||||
HolidayWork = "WorkInHolidays";
|
||||
}
|
||||
|
||||
|
||||
data.push({ name: 'BreakTime.HasBreakTimeValue', value: hasBreakTime });
|
||||
data.push({ name: 'BreakTime.BreakTimeValue', value: breakTimeValue });
|
||||
data.push({ name: 'FridayWork', value: FridayWork });
|
||||
data.push({ name: 'HolidayWork', value: HolidayWork });
|
||||
|
||||
data.push({ name: 'IsShiftChanged', value: isShiftChanged });
|
||||
|
||||
|
||||
var requestData = $.param(data);
|
||||
|
||||
$.ajax({
|
||||
@@ -603,11 +623,12 @@ function ajaxSaveSubmit() {
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
loadDataAjax();
|
||||
$('#btnSave').removeClass('disable');
|
||||
}, 2000);
|
||||
|
||||
loadDataAjax();
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
} else {
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
|
||||
@@ -32,18 +32,40 @@ $(document).ready(function () {
|
||||
});
|
||||
});
|
||||
|
||||
$(".dateTimeIrregular").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
});
|
||||
|
||||
// updateDateInput(0);
|
||||
|
||||
$(".btnAddTimeWork").on("click", function () {
|
||||
var currentCount = $('.groupBox').length;
|
||||
var $inputs = $('.dateTime');
|
||||
var $inputsDate = $('.form-control-date');
|
||||
var allFilled = true;
|
||||
|
||||
$inputsDate.each(function () {
|
||||
if ($(this).val() === '') {
|
||||
allFilled = false;
|
||||
$('.btn-register').addClass('disable');
|
||||
showAlert('ابتدا تاریخ و ساعت شروع و پایان را وارد نمائید.', $(this));
|
||||
}
|
||||
});
|
||||
|
||||
$inputs.each(function () {
|
||||
if ($(this).val() === '') {
|
||||
allFilled = false;
|
||||
$('.btn-register').addClass('disable');
|
||||
showAlert('ابتدا ساعت شروع و پایان را وارد نمائید.', $(this));
|
||||
showAlert('ابتدا تاریخ و ساعت شروع و پایان را وارد نمائید.', $(this));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -74,33 +96,68 @@ $(document).ready(function () {
|
||||
var timeWorkHtml = `
|
||||
<div class="groupBox timeWork">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</div>
|
||||
<div class="col-12 mb-2">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4 text-start">
|
||||
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</div>
|
||||
</div>
|
||||
<div class="col-4 text-center">
|
||||
<div class="timeWorkTitle ti">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-end d-flex justify-content-end">
|
||||
<div class="removeBtn">
|
||||
<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>
|
||||
<span class="text-white ms-1">حذف</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[${currentCount}].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="d-flex flex-column flex-md-row align-items-center gap-1">
|
||||
<div class="position-relative">
|
||||
<span class="startDatetxt"></span>
|
||||
<input type="text" class="form-control text-end form-control-date StartDate" name="Command.RollCallRecords[${currentCount}].StartDate" placeholder="0000/00/00" style="direction: ltr;">
|
||||
</div>
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime" name="Command.RollCallRecords[${currentCount}].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="col-6 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.RollCallRecords[${currentCount}].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-2 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 class="d-flex flex-column-reverse flex-md-row align-items-center gap-1">
|
||||
<input type="text" class="form-control text-center cusDateTime dateTime" name="Command.RollCallRecords[${currentCount}].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
<div class="position-relative">
|
||||
<input type="text" class="form-control text-start form-control-date EndDate" name="Command.RollCallRecords[${currentCount}].EndDate" placeholder="0000/00/00" style="direction: ltr;">
|
||||
<span class="endDatetxt"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
|
||||
|
||||
const newStartDateInput = $(`input[name="Command.RollCallRecords[${currentCount}].StartDate"]`);
|
||||
const newEndDateInput = $(`input[name="Command.RollCallRecords[${currentCount}].EndDate"]`);
|
||||
const newStartTimeInput = $(`input[name="Command.RollCallRecords[${currentCount}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.RollCallRecords[${currentCount}].EndTime"]`);
|
||||
|
||||
newStartDateInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
newEndDateInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
@@ -111,6 +168,19 @@ $(document).ready(function () {
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
|
||||
new Cleave(newStartDateInput[0], {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
new Cleave(newEndDateInput[0], {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
@@ -121,28 +191,17 @@ $(document).ready(function () {
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${currentCount}].StartTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${currentCount}].EndTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
updateAddButtonText(currentCount + 1);
|
||||
|
||||
if (currentCount + 1 === 5) {
|
||||
$(".btnAddTimeWork").hide();
|
||||
}
|
||||
|
||||
|
||||
// Update Remove button enable/disable state
|
||||
updateRemoveButtons();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", ".btnRemoveTimeWork", function () {
|
||||
$(this).closest(".groupBox").remove();
|
||||
var currentCount = $('.groupBox').length;
|
||||
@@ -156,6 +215,75 @@ $(document).ready(function () {
|
||||
// Update Remove button enable/disable state
|
||||
updateRemoveButtons();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------
|
||||
const $boxes = $('.irrregularContent');
|
||||
const $forwardArrow = $('#nextBox').parent().find('svg path:first-child');
|
||||
const $backwardArrow = $('#prevBox').parent().find('svg path:first-child');
|
||||
let currentIndex = 0;
|
||||
|
||||
const updateBoxes = () => {
|
||||
$boxes.each((index, box) => {
|
||||
const $box = $(box);
|
||||
if (index < currentIndex) {
|
||||
// Previous boxes
|
||||
$box.css({
|
||||
transform: 'translateX(-100%)',
|
||||
opacity: 0,
|
||||
position: 'absolute',
|
||||
});
|
||||
} else if (index === currentIndex) {
|
||||
// Current box
|
||||
$box.addClass('active').css({
|
||||
transform: 'translateX(0)',
|
||||
opacity: 1,
|
||||
position: 'relative',
|
||||
});
|
||||
} else {
|
||||
// Next boxes
|
||||
$box.css({
|
||||
transform: 'translateX(100%)',
|
||||
opacity: 0,
|
||||
position: 'absolute',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (currentIndex === 0) {
|
||||
$backwardArrow.attr('fill', '#D9D9D9');
|
||||
$forwardArrow.attr('fill', '#2DBDBD');
|
||||
} else if (currentIndex === $boxes.length - 1) {
|
||||
$backwardArrow.attr('fill', '#2DBDBD');
|
||||
$forwardArrow.attr('fill', '#D9D9D9');
|
||||
} else {
|
||||
$backwardArrow.attr('fill', '#2DBDBD');
|
||||
$forwardArrow.attr('fill', '#2DBDBD');
|
||||
}
|
||||
};
|
||||
|
||||
$('#nextBox').on('click', function () {
|
||||
if (currentIndex < $boxes.length - 1) {
|
||||
currentIndex++;
|
||||
updateBoxes();
|
||||
}
|
||||
});
|
||||
|
||||
$('#prevBox').on('click', function () {
|
||||
if (currentIndex > 0) {
|
||||
currentIndex--;
|
||||
updateBoxes();
|
||||
}
|
||||
});
|
||||
|
||||
updateBoxes();
|
||||
//--------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
});
|
||||
function updateRemoveButtons() {
|
||||
$(".btnRemoveTimeWork").addClass("disable");
|
||||
@@ -183,6 +311,14 @@ function updateAddButtonText(currentCount) {
|
||||
}
|
||||
|
||||
let allFilled = true;
|
||||
$('.form-control-date').each(function () {
|
||||
const value = $(this).val().trim();
|
||||
if (value === "" || !dateValidCheck(value)) {
|
||||
allFilled = false;
|
||||
return false; // Break the loop
|
||||
}
|
||||
});
|
||||
|
||||
$('.dateTime').each(function () {
|
||||
const value = $(this).val().trim();
|
||||
if (value === "" || !timeValidCheck(value)) {
|
||||
@@ -198,36 +334,112 @@ function updateAddButtonText(currentCount) {
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('keyup', ".dateTime", function () {
|
||||
$(document).on('keyup', ".dateTime, .form-control-date", function () {
|
||||
let $input = $(this);
|
||||
let value = $input.val();
|
||||
let lengthValue = value.length;
|
||||
let currentCount = $('.groupBox').length;
|
||||
|
||||
if (lengthValue >= 5) {
|
||||
if (!timeValidCheck(value)) {
|
||||
showAlert('ساعت را به درستی وارد نمائید', $input);
|
||||
updateAddButtonText(currentCount);
|
||||
} else {
|
||||
clearAlert($input);
|
||||
// validateAllTimes();
|
||||
updateAddButtonText(currentCount);
|
||||
const $groupBox = $input.closest('.groupBox');
|
||||
|
||||
// focusNextTimeInput($input);
|
||||
const startDate = $groupBox.find('.StartDate').val();
|
||||
const startTime = $groupBox.find('[name*="StartTime"]').val();
|
||||
const endDate = $groupBox.find('.EndDate').val();
|
||||
const endTime = $groupBox.find('[name*="EndTime"]').val();
|
||||
|
||||
// Validate input based on the field type
|
||||
if ($input.hasClass('form-control-date')) {
|
||||
// Date validation logic
|
||||
if (lengthValue >= 10) {
|
||||
if (!dateValidCheck(value)) {
|
||||
showAlert('تاریخ را به درستی وارد نمائید', $input);
|
||||
} else {
|
||||
clearAlert($input);
|
||||
dayOfWeekLoad(this, value);
|
||||
}
|
||||
} else {
|
||||
if ($input.hasClass('StartDate')) {
|
||||
$groupBox.find('.startDatetxt').text('');
|
||||
} else if ($input.hasClass('EndDate')) {
|
||||
$groupBox.find('.endDatetxt').text('');
|
||||
}
|
||||
}
|
||||
} else if ($input.hasClass('dateTime')) {
|
||||
if (lengthValue >= 5) {
|
||||
if (!timeValidCheck(value)) {
|
||||
showAlert('ساعت را به درستی وارد نمائید', $input);
|
||||
} else {
|
||||
clearAlert($input);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
updateAddButtonText(currentCount);
|
||||
}
|
||||
|
||||
if (startDate.length >= 10 && endDate.length >= 10) {
|
||||
if (!validateDates(startDate, endDate)) {
|
||||
showAlert('حضور غیاب در حال ویرایش را نمیتوانید بیشتر از یک روز از ثبت حضور غیاب عقب تر یا جلو تر ببرید', $input);
|
||||
}
|
||||
}
|
||||
|
||||
if (startDate.length >= 10 && startTime.length >= 5 && endDate.length >= 10 && endTime.length >= 5) {
|
||||
totalWorkingDataLoad(startDate, startTime, endDate, endTime, $groupBox);
|
||||
}
|
||||
|
||||
updateAddButtonText(currentCount);
|
||||
});
|
||||
|
||||
//function focusNextTimeInput(currentInput) {
|
||||
// var inputs = $(".dateTime");
|
||||
// var currentIndex = inputs.index(currentInput);
|
||||
function validateDates(startDate, endDate) {
|
||||
return itemsEditableDatesData.some(entry => entry.startFa === startDate && entry.endFa === endDate);
|
||||
}
|
||||
|
||||
// if (currentIndex !== -1 && currentIndex < inputs.length - 1) {
|
||||
// $(inputs[currentIndex + 1]).focus();
|
||||
// }
|
||||
//}
|
||||
function dayOfWeekLoad(input, value) {
|
||||
$.ajax({
|
||||
url: dayOfWeekDataUrl,
|
||||
type: 'GET',
|
||||
data: { dateFa: value },
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
const $groupBox = $(input).closest('.groupBox');
|
||||
if ($(input).hasClass('StartDate')) {
|
||||
$groupBox.find('.startDatetxt').text(response.message);
|
||||
} else if ($(input).hasClass('EndDate')) {
|
||||
$groupBox.find('.endDatetxt').text(response.message);
|
||||
}
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
function totalWorkingDataLoad(startDateVal, startTimeVal, endDateVal, endTimeVal, $groupBox) {
|
||||
$.ajax({
|
||||
url: totalWorkingDataUrl,
|
||||
type: 'GET',
|
||||
data: { startDate: startDateVal, startTime: startTimeVal, endDate: endDateVal, endTime: endTimeVal },
|
||||
success: function (response) {
|
||||
if (response) {
|
||||
$groupBox.find('.ti').text(response.message);
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showAlert(message, inputElement) {
|
||||
inputElement.addClass("errored");
|
||||
@@ -247,50 +459,14 @@ function timeValidCheck(value) {
|
||||
return timePattern.test(value);
|
||||
}
|
||||
|
||||
//function validateAllTimes() {
|
||||
// let timeRanges = [];
|
||||
|
||||
// $(".groupBox").each(function () {
|
||||
// let startTime = $(this).find('input[name*="StartTime"]').val();
|
||||
// let endTime = $(this).find('input[name*="EndTime"]').val();
|
||||
|
||||
// if (startTime.length === 5 && endTime.length === 5) {
|
||||
// let startParts = startTime.split(':');
|
||||
// let endParts = endTime.split(':');
|
||||
// let startInMinutes = parseInt(startParts[0]) * 60 + parseInt(startParts[1]);
|
||||
// let endInMinutes = parseInt(endParts[0]) * 60 + parseInt(endParts[1]);
|
||||
// timeRanges.push({ start: startInMinutes, end: endInMinutes });
|
||||
// }
|
||||
// });
|
||||
|
||||
// // Check for conflicts and order
|
||||
// for (let i = 0; i < timeRanges.length; i++) {
|
||||
// for (let j = 0; j < i; j++) {
|
||||
// if (timeRanges[i].start >= timeRanges[i].end) {
|
||||
// showAlert('زمان شروع باید قبل از زمان پایان باشد', $(".groupBox").eq(i).find('input[name*="StartTime"]'));
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // Check for overlap with previous entries
|
||||
// if (timeRanges[i].start < timeRanges[j].end && timeRanges[i].end > timeRanges[j].start) {
|
||||
// showAlert('زمانها نباید تداخل داشته باشند', $(".groupBox").eq(i).find('input[name*="StartTime"]'));
|
||||
// return;
|
||||
// }
|
||||
// // Check if the current start time is before the previous start time
|
||||
// if (i > 0 && timeRanges[i].start < timeRanges[i - 1].start) {
|
||||
// showAlert('ساعت جدید نباید کوچکتر از ساعتهای قبلی باشد', $(".groupBox").eq(i).find('input[name*="StartTime"]'));
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
function dateValidCheck(value) {
|
||||
const datePattern = /^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])$/;
|
||||
return datePattern.test(value);
|
||||
}
|
||||
|
||||
$('.btn-register').click(function () {
|
||||
|
||||
var loading = $('.btn-register .spinner-loading');
|
||||
|
||||
var data = $('#create-form').serialize();
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
@@ -310,7 +486,6 @@ $('.btn-register').click(function () {
|
||||
}, 2000);
|
||||
|
||||
if (urlPathname.indexOf('/Client/Company/WorkFlow/RollCall') > -1) {
|
||||
$('#MainModal').modal('hide');
|
||||
_RefreshCountMenu();
|
||||
CountWorkFlowOfAbsentAndCut();
|
||||
LoadWorkFlowsCutList();
|
||||
@@ -318,16 +493,17 @@ $('.btn-register').click(function () {
|
||||
loadWorkFlowEmployeesWithoutLunchBreakList();
|
||||
loadUndefinedRollCallsList();
|
||||
loadOverlappingLeavesList();
|
||||
$('#MainModal').modal('hide');
|
||||
}
|
||||
|
||||
if (urlPathname.indexOf('/Client/Company/RollCall/CaseHistory') > -1) {
|
||||
$('#MainModal').modal('hide');
|
||||
hasData = true;
|
||||
dateIndex = 0;
|
||||
dateEmployeeIndex = null;
|
||||
$('#caseHistoryLoadData').html('');
|
||||
caseHistoryLoadAjax();
|
||||
loadUntilHeightExceeds();
|
||||
$('#MainModal').modal('hide');
|
||||
}
|
||||
|
||||
//window.location.reload();
|
||||
|
||||
@@ -577,8 +577,26 @@ function ajaxSaveData() {
|
||||
|
||||
var breakTimeValue = $("#TimeOnly").val();
|
||||
|
||||
var FridayWork = "Default";
|
||||
if ($('#Friday1').prop('checked')) {
|
||||
FridayWork = "Default";
|
||||
} else if ($('#Friday2').prop('checked')) {
|
||||
FridayWork = "WorkInFriday";
|
||||
}
|
||||
|
||||
|
||||
var HolidayWork = "Default";
|
||||
if ($('#OffDays1').prop('checked')) {
|
||||
HolidayWork = "Default";
|
||||
} else if ($('#OffDays2').prop('checked')) {
|
||||
HolidayWork = "WorkInHolidays";
|
||||
}
|
||||
|
||||
|
||||
data.push({ name: 'BreakTime.HasBreakTimeValue', value: hasBreakTime });
|
||||
data.push({ name: 'BreakTime.BreakTimeValue', value: breakTimeValue });
|
||||
data.push({ name: 'FridayWork', value: FridayWork });
|
||||
data.push({ name: 'HolidayWork', value: HolidayWork });
|
||||
|
||||
var requestData = $.param(data);
|
||||
|
||||
@@ -596,11 +614,13 @@ function ajaxSaveData() {
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
loadDataAjax();
|
||||
$('#btnSave').removeClass('disable');
|
||||
}, 2000);
|
||||
|
||||
loadDataAjax();
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
|
||||
} else {
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('.alert-msg').show();
|
||||
|
||||
@@ -286,7 +286,7 @@ public class WorkFlowApplication : IWorkFlowApplication
|
||||
var rollCalls = _rollCallACL.GetRollCallsOverlappingLeaves(workshopId, startOfDay, endOfDay);
|
||||
var activeEmployees = _rollCallACL.GetActiveWorkshopRollCallEmployees(workshopId, startOfDay, endOfDay);
|
||||
|
||||
var rollCallsForDate = rollCalls.FirstOrDefault(x=>x.Date==date);
|
||||
var rollCallsForDate = rollCalls.FirstOrDefault(x => x.Date == date);
|
||||
if (rollCallsForDate == null)
|
||||
return new();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace WorkFlow.Infrastructure.ACL.CustomizedWorkshopSettings
|
||||
public List<(long EmployeeId, string Name)> GetEmployeesWithoutBreakTime(long workshopId)
|
||||
{
|
||||
var list = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByWorkshopId(workshopId);
|
||||
return list.Where(x => x.BreakTime.BreakTimeType == BreakTimeType.WithTime)
|
||||
return list.Where(x => x.BreakTime.BreakTimeType == BreakTimeType.WithoutTime)
|
||||
.Select(x => (x.EmployeeId, x.EmployeeFullName)).ToList();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user