new task changes and leaveApplcation bug fixed

This commit is contained in:
samsys
2024-07-18 04:31:43 +03:30
parent aafafa27ce
commit 4a84032c16
48 changed files with 4992 additions and 1348 deletions

View File

@@ -10,8 +10,8 @@ public static class Version
{
static Version()
{
StyleVersion = "2.11.24";
AdminVersion = "2.5.9";
StyleVersion = "2.11.26";
AdminVersion = "2.5.11";
CameraVersion = "1.0.3";
}

View File

@@ -18,8 +18,13 @@ public interface ITaskApplication
EditTask GetDetails(long taskId);
//گرفتن تمامی وظایف
List<TaskViewModel> GetTasks(TaskSearchModel searchModel);
// گرفتن مهلت برای یک وظیفه
OperationResult CreateRequestTime(CreateTaskTimeRequest command);
List<TaskViewModel> GetSelfTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetAllNotSelfIncludedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetReceivedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetSentTasks(TaskSearchModel searchModel);
// گرفتن مهلت برای یک وظیفه
OperationResult CreateRequestTime(CreateTaskTimeRequest command);
//تایید مهلت وظیفه
OperationResult AcceptRequestDatetime(long taskId);
OperationResult RejectTimeRequest(long taskId);

View File

@@ -36,6 +36,7 @@ public class TaskViewModel
public string ContractingPartyName { get; set; }
public string? Description { get; set; }
public AccountViewModel Sender { get; set; }
public string Assigner { get; set; }
public string SelfName { get; set; }
public long SenderId { get; set; }
@@ -47,5 +48,9 @@ public class TaskViewModel
public bool SelfAssigned { get; set; }
public long AssignerId { get; set; }
public long AssignedId { get; set; }
public bool CanEdit { get; set; }
public bool CanDelete { get; set; }
public bool CanAssign { get; set; }
public bool CanCheckRequests { get; set; }
}

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
@@ -7,6 +7,8 @@
<ItemGroup>
<ProjectReference Include="..\AccountManagement.Application.Contracts\AccountManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\AccountManagement.Domain\AccountManagement.Domain.csproj" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@@ -10,9 +10,10 @@ using AccountManagement.Domain.AssignAgg;
using AccountManagement.Domain.MediaAgg;
using AccountManagement.Domain.TaskAgg;
using IPE.SmsIrClient.Models.Results;
using Microsoft.AspNetCore.Http;
using TaskManager.Domain.PositionAgg;
using System.Reflection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
namespace AccountManagement.Application;
@@ -24,9 +25,11 @@ public class TaskApplication : ITaskApplication
private readonly IPositionRepository _positionRepository;
private readonly IAssignRepository _assignRepository;
private readonly IHttpContextAccessor _contextAccessor;
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly IAuthHelper _authHelper;
public TaskApplication(ITaskRepository taskRepository, IAccountRepository accountRepository, IMediaRepository mediaRepository, IAssignRepository assignRepository, IHttpContextAccessor contextAccessor, IPositionRepository positionRepository)
public TaskApplication(ITaskRepository taskRepository, IAccountRepository accountRepository, IMediaRepository mediaRepository, IAssignRepository assignRepository, IHttpContextAccessor contextAccessor, IPositionRepository positionRepository, IWebHostEnvironment webHostEnvironment, IAuthHelper authHelper)
{
_taskRepository = taskRepository;
_accountRepository = accountRepository;
@@ -34,6 +37,8 @@ public class TaskApplication : ITaskApplication
_assignRepository = assignRepository;
_contextAccessor = contextAccessor;
_positionRepository = positionRepository;
_webHostEnvironment = webHostEnvironment;
_authHelper = authHelper;
}
//غیرفعال سازی تسک
public OperationResult DeActiveTask(long TaskId)
@@ -127,12 +132,45 @@ public class TaskApplication : ITaskApplication
if (sender.Position.PositionValue < posValue)
{
return operation.Failed("شما حق ویرایش این وظیفه را ندارید");
}
var receivers = _accountRepository.GetAccountsByIds(command.ReceiverId);
if (sender.Position.PositionValue == 1)
{
}
else if (receivers.Any(x => sender.Position.PositionValue >= x.Position.PositionValue))
{
var checkReceiver = receivers.Where(x => sender.Position.PositionValue >= x.Position.PositionValue).ToList();
if (checkReceiver.All(x => x.id == sender.id))
{
}
else
{
return operation.Failed("شما نمیتوانید به سطح بالاتر خود یا هم سطح خود وظیفه ای دهید");
}
}
else if (receivers.Count == 1 && receivers.Any(x => sender.id == x.id))
{
}
var task = _taskRepository.Get(command.Id);
var endTask = command.EndTaskDate.ToGeorgianDateTime();
task.Edit(command.Title, endTask, command.Description, command.SenderId, command.ContractingPartyName);
_taskRepository.SaveChanges();
_assignRepository.RemoveRangeAssigns(task.id);
foreach (var receiver in receivers)
{
var assign = new Assign(task.id, task.SenderId, receiver.id, sender.Position.PositionValue,
receiver.Fullname,
receiver.Position.PositionValue);
_assignRepository.Create(assign);
}
_assignRepository.SaveChanges();
#region ChangeMedias
@@ -162,7 +200,7 @@ public class TaskApplication : ITaskApplication
if (command.Document1?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -185,7 +223,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document2?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -208,7 +246,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document3?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -231,7 +269,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document4?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -254,7 +292,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document5?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -277,7 +315,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document6?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -308,7 +346,7 @@ public class TaskApplication : ITaskApplication
if (command.Voice?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -468,7 +506,7 @@ public class TaskApplication : ITaskApplication
if (command.Document1?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -488,7 +526,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document2?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -508,7 +546,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document3?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -528,7 +566,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document4?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -548,8 +586,8 @@ public class TaskApplication : ITaskApplication
}
if (command.Document5?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
"Task", $"{task.id}");
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, command.Document5.FileName);
@@ -568,7 +606,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document6?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -595,7 +633,7 @@ public class TaskApplication : ITaskApplication
if (command.Voice?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -678,8 +716,8 @@ public class TaskApplication : ITaskApplication
if (command.Document1?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
"Task", $"{task.id}");
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, command.Document1.FileName);
@@ -698,7 +736,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document2?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -718,7 +756,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document3?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -738,8 +776,8 @@ public class TaskApplication : ITaskApplication
}
if (command.Document4?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
"Task", $"{task.id}");
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, command.Document4.FileName);
@@ -758,7 +796,7 @@ public class TaskApplication : ITaskApplication
}
if (command.Document5?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -778,8 +816,8 @@ public class TaskApplication : ITaskApplication
}
if (command.Document6?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
"Task", $"{task.id}");
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, command.Document6.FileName);
@@ -805,7 +843,7 @@ public class TaskApplication : ITaskApplication
if (command.Voice?.Length > 0)
{
var path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).FullName, "ServiceHost", "Storage",
var path = Path.Combine($"{_webHostEnvironment.ContentRootPath}", "Storage",
"Task", $"{task.id}");
Directory.CreateDirectory(path);
@@ -842,9 +880,31 @@ public class TaskApplication : ITaskApplication
return test;
}
public List<TaskViewModel> GetSelfTasks(TaskSearchModel searchModel)
{
return _taskRepository.GetSelfTasks(searchModel);
}
public List<TaskViewModel> GetAllNotSelfIncludedTasks(TaskSearchModel searchModel)
{
return _taskRepository.GetAllNotSelfIncludedTasks(searchModel);
}
public List<TaskViewModel> GetReceivedTasks(TaskSearchModel searchModel)
{
return _taskRepository.GetReceivedTasks(searchModel);
}
public List<TaskViewModel> GetSentTasks(TaskSearchModel searchModel)
{
return _taskRepository.GetSentTasks(searchModel);
}
//ساخت درخواست مهلت
public OperationResult CreateRequestTime(CreateTaskTimeRequest command)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (command.TaskId == 0)
{
@@ -860,10 +920,19 @@ public class TaskApplication : ITaskApplication
{
return operation.Failed("مهلت درخواستی خود را وارد کنید");
}
var task = _taskRepository.Get(command.TaskId);
var requestTime = command.RequestTime.ToGeorgianDateTime();
task.CreateTimeRequest(requestTime, command.Description);
if (task.SenderId==accountId)
{
task.ChangeTimeTask(requestTime);
}
else
{
task.CreateTimeRequest(requestTime, command.Description);
}
_taskRepository.SaveChanges();
return operation.Succcedded(task.id);
}
@@ -893,6 +962,7 @@ public class TaskApplication : ITaskApplication
//ساخت درخواست کنسل
public OperationResult CreateCancelRequest(CreateTaskCancel command)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (string.IsNullOrWhiteSpace(command.Description))
{
@@ -905,6 +975,10 @@ public class TaskApplication : ITaskApplication
}
var task = _taskRepository.Get(command.TaskId);
task.CreateCancelRequest(command.Description);
if (task.SenderId==accountId)
{
task.AcceptCancelRequest();
}
_taskRepository.SaveChanges();
return operation.Succcedded(task.id);
}
@@ -928,6 +1002,7 @@ public class TaskApplication : ITaskApplication
//انجام شدن تسک
public OperationResult CreateCompleteTaskRequest(CompleteTaskViewModel command)
{
var accountId = _authHelper.CurrentAccountId();
var operation = new OperationResult();
if (!_taskRepository.Exists(x => x.id == command.Id))
{
@@ -935,6 +1010,10 @@ public class TaskApplication : ITaskApplication
}
var task = _taskRepository.Get(command.Id);
task.CompleteRequest(command.Description);
if (task.SenderId==accountId)
{
task.Completed();
}
_taskRepository.SaveChanges();
return operation.Succcedded(task.id);
}

View File

@@ -8,5 +8,6 @@ public interface IAssignRepository:IRepository<long,Assign>
{
List<AssignViewModel> GetAssignsByTaskId(long id);
void RemoveRangeAssigns(long taskId);
}

View File

@@ -8,14 +8,18 @@ namespace AccountManagement.Domain.TaskAgg;
public interface ITaskRepository:IRepository<long,Tasks>
{
EditTask GetDetails(long TaskId);
void Remove(long id);
//گرفتن تمامی وظایف
List<TaskViewModel> GetTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetAllRequestedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetSelfTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetAllNotSelfIncludedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetReceivedTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetSentTasks(TaskSearchModel searchModel);
string SetTasksColors(DateTime time,bool isCancel);
int GetRequestedTasksCount();
TaskViewModel GetRequestDetails(long id);

View File

@@ -27,4 +27,11 @@ public class AssignRepository :RepositoryBase<long,Assign>,IAssignRepository
AssignedName = x.AssignedName
}).ToList();
}
public void RemoveRangeAssigns( long taskId)
{
var assigns= _taskManagerContext.Assigns.Where(x => x.TaskId == taskId);
_taskManagerContext.RemoveRange(assigns);
_taskManagerContext.SaveChanges();
}
}

View File

@@ -13,89 +13,89 @@ namespace TaskManager.Infrastructure.EFCore.Repository;
public class PositionRepository : RepositoryBase<long, Position>, IPositionRepository
{
private readonly AccountContext _accountContext;
private readonly IHttpContextAccessor _contextAccessor;
private readonly AccountContext _accountContext;
private readonly IHttpContextAccessor _contextAccessor;
public PositionRepository(AccountContext accountContext, IHttpContextAccessor contextAccessor) : base(accountContext)
{
_accountContext = accountContext;
_contextAccessor = contextAccessor;
}
public PositionRepository(AccountContext accountContext, IHttpContextAccessor contextAccessor) : base(accountContext)
{
_accountContext = accountContext;
_contextAccessor = contextAccessor;
}
public List<PositionViewModel> GetPositions()
{
// این متد تمام سمت ها را بدست می آورد
return _accountContext.Positions.Select(x => new PositionViewModel()
{
Value = x.PositionValue,
Id = x.id,
Name = x.PositionName,
CountUsers = _accountContext.Accounts.Count(a => a.PositionId==x.id)
public List<PositionViewModel> GetPositions()
{
// این متد تمام سمت ها را بدست می آورد
return _accountContext.Positions.Select(x => new PositionViewModel()
{
Value = x.PositionValue,
Id = x.id,
Name = x.PositionName,
CountUsers = _accountContext.Accounts.Count(a => a.PositionId == x.id)
}).OrderBy(x=>x.Value).ToList();
}).OrderBy(x => x.Value).ToList();
}
}
public List<PositionViewModel> GetLowerPosition()
{
var posValue = int.Parse(_contextAccessor.HttpContext.User.FindFirst("PositionValue").Value);
return _accountContext.Positions.Where(x=>x.PositionValue>posValue).Select(x => new PositionViewModel()
{
Value = x.PositionValue,
Id = x.id,
Name = x.PositionName
public List<PositionViewModel> GetLowerPosition()
{
var posValue = int.Parse(_contextAccessor.HttpContext.User.FindFirst("PositionValue").Value);
return _accountContext.Positions.Where(x => x.PositionValue > posValue).Select(x => new PositionViewModel()
{
Value = x.PositionValue,
Id = x.id,
Name = x.PositionName
}).OrderBy(x => x.Value).ToList();
}
}).OrderBy(x => x.Value).ToList();
}
public List<int> GetUnUsedPositionValues()
{
List<int> values= new List<int>() {1,2,3,4,5};
var usedPositions= _accountContext.Positions.Select(x => x.PositionValue).ToList();
return values.Where(x => !usedPositions.Contains(x)).ToList();
}
public List<int> GetUnUsedPositionValues()
{
List<int> values = new List<int>() { 1, 2, 3, 4, 5 };
var usedPositions = _accountContext.Positions.Select(x => x.PositionValue).ToList();
return values.Where(x => !usedPositions.Contains(x)).ToList();
}
//لیست کسانی که سمتی برایشان ثبت نشده است
public List<AccountViewModel> GetNoPositionAccounts()
{
return _accountContext.Accounts.Where(x => x.PositionId == null).Select(x => new AccountViewModel()
{
Id = x.id,
Fullname = x.Fullname
}).ToList();
}
//لیست کسانی که سمتی برایشان ثبت نشده است
public List<AccountViewModel> GetNoPositionAccounts()
{
public List<Account> GetAccountsByIds(List<long> ids)
{
var res =_accountContext.Accounts.Include(x=>x.Position).Where(x => x.PositionId != null);
return res.Where(x => ids.Contains((long)x.PositionId)).ToList();
}
return _accountContext.Accounts.Where(x => x.PositionId == null && x.IsActiveString == "true" && x.AdminAreaPermission == "true").Select(x => new AccountViewModel()
{
Id = x.id,
Fullname = x.Fullname
}).ToList();
}
public void Remove(long id)
{
var position =Get(id);
Remove(position);
}
public List<Account> GetAccountsByIds(List<long> ids)
{
var res = _accountContext.Accounts.Include(x => x.Position).Where(x => x.PositionId != null);
return res.Where(x => ids.Contains((long)x.PositionId)).ToList();
}
public int GetLastPositionValue()
{
if (!_accountContext.Positions.Any())
{
return 1;
}
else
{
return _accountContext.Positions.Max(x => x.PositionValue);
public void Remove(long id)
{
var position = Get(id);
Remove(position);
}
}
}
public int GetLastPositionValue()
{
if (!_accountContext.Positions.Any())
{
return 1;
}
else
{
return _accountContext.Positions.Max(x => x.PositionValue);
}
}
}

View File

@@ -0,0 +1,12 @@
using System;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.Contract;
using CompanyManagment.App.Contracts.WorkingHoursTemp;
namespace Company.Domain.RollCallAgg;
public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
{
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, long leavId);
}

View File

@@ -0,0 +1,11 @@
using System;
using CompanyManagment.App.Contracts.Contract;
using CompanyManagment.App.Contracts.WorkingHoursTemp;
namespace CompanyManagment.App.Contracts.RollCall;
public interface IRollCallMandatoryApplication
{
bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart);
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, long leavId);
}

View File

@@ -12,4 +12,5 @@ public class RollCallViewModel
public DateTime? EndDate { get; set; }
public int Year { get; set; }
public int Month { get; set; }
public TimeSpan ShiftSpan { get; set; }
}

View File

@@ -8,6 +8,7 @@ namespace CompanyManagment.App.Contracts.YearlySalary;
public class DayliFeeViewModel
{
public double DayliFeeDouble { get; set; }
public string DayliFee { get; set; }
public string Basic { get; set; }
}

View File

@@ -57,17 +57,14 @@ public class LeaveApplication : ILeaveApplication
var start = command.StartLeave.ToGeorgianDateTime();
var end = command.PaidLeaveType == "ساعتی"? start : command.EndLeave.ToGeorgianDateTime();
var checkErr = _leaveRepository.CheckErrors(start, end, command.EmployeeId, command.WorkshopId);
if (_leaveRepository.Exists(x =>
x.StartLeave <= start && x.EndLeave >= start && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId))
return op.Failed("برای تاریخ شروع سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave <= end && x.EndLeave >= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId))
return op.Failed("برای تاریخ پایان سابقه مرخصی وجود دارد");
// start = new DateTime(start.Year, start.Month, start.Day, startH.Hours, startH.Minutes, startH.Seconds);
//end = new DateTime(end.Year, end.Month, end.Day, endH.Hours, endH.Minutes, endH.Seconds);
if (checkErr.HasChekout)
return op.Failed(checkErr.CheckoutErrMessage);
@@ -83,19 +80,48 @@ public class LeaveApplication : ILeaveApplication
var totalhourses = "-";
if (command.LeaveType == "استحقاقی" && command.PaidLeaveType == "ساعتی")
{
start = new DateTime(start.Year, start.Month, start.Day, startH.Hours, startH.Minutes, startH.Seconds);
end = new DateTime(start.Year, start.Month, start.Day, endH.Hours, endH.Minutes, endH.Seconds);
if (start > end)
end = end.AddDays(1);
var totalLeavHourses = (end - start);
var totalLeavHourses = (end - start);
var h = totalLeavHourses.Hours < 10 ? $"0{totalLeavHourses.Hours}" : $"{totalLeavHourses.Hours}";
var m = totalLeavHourses.Minutes < 10 ? $"0{totalLeavHourses.Minutes}" : $"{totalLeavHourses.Minutes}";
totalhourses = $"{h}:{m}";
}
if (_leaveRepository.Exists(x =>
x.StartLeave <= start && x.EndLeave >= start && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "ساعتی"))
return op.Failed("برای ساعت شروع سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave <= end && x.EndLeave >= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "ساعتی"))
return op.Failed("برای ساعت پایان سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave >= start && x.EndLeave <= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "ساعتی"))
return op.Failed("در بازه زمانی وارد شده مرخصی ثبت شده است");
var end24 = endH.Hours == 0 && endH.Minutes == 0 ? end.AddDays(-1) : end;
if (_leaveRepository.Exists(x =>
(x.StartLeave.Date == start.Date || x.EndLeave.Date == end24.Date) && (x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه")))
return op.Failed("در بازه زمانی وارد شده مرخصی ثبت شده است");
}
else if (command.LeaveType == "استحقاقی" && command.PaidLeaveType == "روزانه")
{
var totalLeavHourses = (end - start).TotalDays + 1;
totalhourses = $"{(int)totalLeavHourses}";
if (_leaveRepository.Exists(x =>
x.StartLeave <= start && x.EndLeave >= start && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه"))
return op.Failed("برای تاریخ شروع سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave <= end && x.EndLeave >= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه"))
return op.Failed("برای تاریخ پایان سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave >= start && x.EndLeave <= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه"))
return op.Failed("در بازه زمانی وارد شده مرخصی ثبت شده است");
if (_leaveRepository.Exists(x =>
x.StartLeave.Date >= start.Date && x.StartLeave.Date <= end.Date && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "ساعتی"))
return op.Failed("دربازه تاریخ وارد شده مرخصی ساعتی ثبت شده است");
}
if (command.LeaveType == "استعلاجی")
@@ -103,9 +129,21 @@ public class LeaveApplication : ILeaveApplication
var totalLeavHourses = (end - start).TotalDays + 1;
totalhourses = $"{(int)totalLeavHourses}";
command.PaidLeaveType = "روزانه";
}
var year = Convert.ToInt32(command.StartLeave.Substring(0, 4));
if (_leaveRepository.Exists(x =>
x.StartLeave <= start && x.EndLeave >= start && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه"))
return op.Failed("برای تاریخ شروع سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave <= end && x.EndLeave >= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه"))
return op.Failed("برای تاریخ پایان سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave >= start && x.EndLeave <= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه"))
return op.Failed("در بازه زمانی وارد شده مرخصی ثبت شده است");
if (_leaveRepository.Exists(x =>
x.StartLeave.Date >= start.Date && x.StartLeave.Date <= end.Date && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "ساعتی"))
return op.Failed("دربازه تاریخ وارد شده مرخصی ساعتی ثبت شده است");
}
var year = Convert.ToInt32(command.StartLeave.Substring(0, 4));
var month = Convert.ToInt32(command.StartLeave.Substring(5, 2));
var employeeFullName = _employeeRepository.GetDetails(command.EmployeeId).EmployeeFullName;
@@ -165,14 +203,7 @@ public class LeaveApplication : ILeaveApplication
var end = command.PaidLeaveType == "ساعتی" ? start : command.EndLeave.ToGeorgianDateTime();
var checkErr = _leaveRepository.CheckErrors(start, end, command.EmployeeId, command.WorkshopId);
if (_leaveRepository.Exists(x =>
x.StartLeave <= start && x.EndLeave >= start && x.EmployeeId == command.EmployeeId
&& x.WorkshopId == command.WorkshopId && x.id != command.Id))
return op.Failed("برای تاریخ شروع سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave <= end && x.EndLeave >= end && x.EmployeeId == command.EmployeeId
&& x.WorkshopId == command.WorkshopId && x.id != command.Id))
return op.Failed("برای تاریخ پایان سابقه مرخصی وجود دارد");
if (checkErr.HasChekout)
return op.Failed(checkErr.CheckoutErrMessage);
if (checkErr.HasLeftWork)
@@ -192,25 +223,66 @@ public class LeaveApplication : ILeaveApplication
end = new DateTime(start.Year, start.Month, start.Day, endH.Hours, endH.Minutes, endH.Seconds);
if (start > end)
end = end.AddDays(1);
var totalLeavHourses = (end - start);
var totalLeavHourses = (end - start);
var h = totalLeavHourses.Hours < 10 ? $"0{totalLeavHourses.Hours}" : $"{totalLeavHourses.Hours}";
var m = totalLeavHourses.Minutes < 10 ? $"0{totalLeavHourses.Minutes}" : $"{totalLeavHourses.Minutes}";
totalhourses = $"{h}:{m}";
}
if (_leaveRepository.Exists(x =>
x.StartLeave <= start && x.EndLeave >= start && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "ساعتی" && x.id != command.Id))
return op.Failed("برای ساعت شروع سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave <= end && x.EndLeave >= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "ساعتی" && x.id != command.Id))
return op.Failed("برای ساعت پایان سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave >= start && x.EndLeave <= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "ساعتی" && x.id != command.Id))
return op.Failed("در بازه زمانی وارد شده مرخصی ثبت شده است");
var end24 = endH.Hours == 0 && endH.Minutes == 0 ? end.AddDays(-1) : end;
if (_leaveRepository.Exists(x =>
(x.StartLeave.Date == start.Date || x.EndLeave.Date == end24.Date) && (x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه" && x.id != command.Id)))
return op.Failed("در بازه زمانی وارد شده مرخصی ثبت شده است");
}
else if (command.LeaveType == "استحقاقی" && command.PaidLeaveType == "روزانه")
{
var totalLeavHourses = (end - start).TotalDays + 1;
totalhourses = $"{(int)totalLeavHourses}";
}
if (_leaveRepository.Exists(x =>
x.StartLeave <= start && x.EndLeave >= start && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه" && x.id != command.Id))
return op.Failed("برای تاریخ شروع سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave <= end && x.EndLeave >= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه" && x.id != command.Id))
return op.Failed("برای تاریخ پایان سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave >= start && x.EndLeave <= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه" && x.id != command.Id))
return op.Failed("در بازه زمانی وارد شده مرخصی ثبت شده است");
if (_leaveRepository.Exists(x =>
x.StartLeave.Date >= start.Date && x.StartLeave.Date <= end.Date && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "ساعتی" && x.id != command.Id))
return op.Failed("دربازه تاریخ وارد شده مرخصی ساعتی ثبت شده است");
}
if (command.LeaveType == "استعلاجی")
{
var totalLeavHourses = (end - start).TotalDays + 1;
totalhourses = $"{(int)totalLeavHourses}";
command.PaidLeaveType = "روزانه";
}
if (_leaveRepository.Exists(x =>
x.StartLeave <= start && x.EndLeave >= start && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه" && x.id != command.Id))
return op.Failed("برای تاریخ شروع سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave <= end && x.EndLeave >= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه" && x.id != command.Id))
return op.Failed("برای تاریخ پایان سابقه مرخصی وجود دارد");
if (_leaveRepository.Exists(x =>
x.StartLeave >= start && x.EndLeave <= end && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "روزانه" && x.id != command.Id))
return op.Failed("در بازه زمانی وارد شده مرخصی ثبت شده است");
if (_leaveRepository.Exists(x =>
x.StartLeave.Date >= start.Date && x.StartLeave.Date <= end.Date && x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId && x.PaidLeaveType == "ساعتی" && x.id != command.Id))
return op.Failed("دربازه تاریخ وارد شده مرخصی ساعتی ثبت شده است");
}
var year = Convert.ToInt32(command.StartLeave.Substring(0, 4));
var year = Convert.ToInt32(command.StartLeave.Substring(0, 4));
var month = Convert.ToInt32(command.StartLeave.Substring(5, 2));
var employeeFullName = _employeeRepository.GetDetails(command.EmployeeId).EmployeeFullName;
@@ -249,16 +321,6 @@ public class LeaveApplication : ILeaveApplication
return _leaveRepository.searchClient(searchModel);
}
#region Vafa
public List<LeaveViewModel> LastLeaveMain(long workshopId, int pageIndex)
{
return _leaveRepository.LastLeaveMain(workshopId, pageIndex);
}
#endregion
public bool CheckIfValidToEdit(long id)
{
return _leaveRepository.CheckIfValidToEdit(id);
@@ -285,4 +347,9 @@ public class LeaveApplication : ILeaveApplication
{
return _leaveRepository.PrintAll(id);
}
public List<LeaveViewModel> LastLeaveMain(long workshopId, int pageIndex)
{
return _leaveRepository.LastLeaveMain(workshopId, pageIndex);
}
}

View File

@@ -0,0 +1,27 @@
using Company.Domain.RollCallAgg;
using CompanyManagment.App.Contracts.Contract;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.WorkingHoursTemp;
using System;
namespace CompanyManagment.Application;
public class RollCallMandatoryApplication : IRollCallMandatoryApplication
{
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
public RollCallMandatoryApplication(IRollCallMandatoryRepository rollCallMandatoryRepository)
{
_rollCallMandatoryRepository = rollCallMandatoryRepository;
}
public bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart)
{
return _rollCallMandatoryRepository.Exists(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date);
}
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, long leavId)
{
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, leavId);
}
}

View File

@@ -0,0 +1,303 @@
using System;
using System.Collections.Generic;
using System.Linq;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using Company.Domain.LeftWorkAgg;
using Company.Domain.RollCallAgg;
using Company.Domain.YearlySalaryAgg;
using CompanyManagment.App.Contracts.Contract;
using CompanyManagment.App.Contracts.LeftWork;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.WorkingHoursTemp;
namespace CompanyManagment.EFCore.Repository;
public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRollCallMandatoryRepository
{
private readonly CompanyContext _context;
private readonly IYearlySalaryRepository _yearlySalaryRepository;
private readonly ILeftWorkRepository _leftWorkRepository;
public RollCallMandatoryRepository(CompanyContext context, IYearlySalaryRepository yearlySalaryRepository,
ILeftWorkRepository leftWorkRepository) : base(context)
{
_context = context;
_yearlySalaryRepository = yearlySalaryRepository;
_leftWorkRepository = leftWorkRepository;
}
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart,
DateTime contractEnd,
CreateWorkingHoursTemp command, long leavId)
{
#region Entities
string SumWorkeTime = string.Empty;
var weeklyTime = new TimeSpan();
string shift1Hourse = "0";
string shift1Minuts = "0";
string overMandatoryHours = "0";
string overMandatoryMinuts = "0";
#endregion
var rollCallResult = _context.RollCalls.Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
{
StartDate = x.StartDate,
EndDate = x.EndDate,
ShiftSpan = (x.EndDate.Value - x.StartDate.Value)
}).ToList();
var sumSpans = new TimeSpan(rollCallResult.Sum(x => x.ShiftSpan.Ticks));
//***********************************//
//ToTalHourse Employe eWorked
var totalHourses = (sumSpans.TotalMinutes) / 60;
int totalHolidaysAndNotH = (int)sumSpans.TotalHours;
int totalHolidaysAndNotM = (int)(sumSpans.TotalMinutes % 60);
//***********************************//
#region ComputeMandatoryAtThisTime
int TotalContractDays = (int)(contractEnd - contractStart).TotalDays + 1;
int fridays = 0;
int holiday = _context.HolidayItems.Count(x => x.Holidaydate >= contractStart && x.Holidaydate <= contractEnd);
;
for (var gDate = contractStart; gDate <= contractEnd; gDate = gDate.AddDays(1))
{
if (gDate.DayOfWeek == DayOfWeek.Friday)
{
fridays += 1;
}
}
int TotalDaysNoFriday = TotalContractDays - fridays;
int mandatorDays = TotalContractDays - (fridays + holiday);
//***********************************//
//This Time Mandatory Hourse
double mandatoryHours = Math.Round((mandatorDays * 7.33), 2);
//***********************************//
var dailyFix = TimeSpan.Parse("07:20");
dailyFix = dailyFix.Multiply(mandatorDays);
TimeSpan Mandatory = sumSpans.Subtract(dailyFix);
#endregion
#region DailyFeeCompute
var searchModel = new LeftWorkSearchModel()
{
EmployeeId = command.EmployeeId,
WorkshopId = command.WorkshopId,
};
var leftworkList = _leftWorkRepository.search(searchModel);
var basic = "0";
double dayliFeeComplete = 0;
var GetWorkStartDate = command.GetWorkDateHide.ToEnglishNumber();
var styear = Convert.ToInt32(GetWorkStartDate.Substring(0, 4));
var startDate = command.GetWorkDateHide.ToGeorgianDateTime();
var dayliFee = "خطای تاریخ";
double dayliFeeDouble = 0;
if (styear >= 1370)
{
if (leftworkList == null)
leftworkList = new List<LeftWorkViewModel>();
var dayliFeeResult = _yearlySalaryRepository.DayliFeeComputing(startDate, contractStart, contractEnd,
command.EmployeeId, command.WorkshopId, leftworkList);
dayliFee = dayliFeeResult.DayliFee;
dayliFeeDouble = dayliFeeResult.DayliFeeDouble;
dayliFeeComplete = dayliFeeResult.DayliFee.MoneyToDouble();
basic = dayliFeeResult.Basic;
}
#endregion
#region ConsumableItemsAndHousingAndFamily
var ConsumableItems = _yearlySalaryRepository.ConsumableItems(contractEnd);
var HousingAllowance = _yearlySalaryRepository.HousingAllowance(contractEnd);
var familyAllowance = _yearlySalaryRepository.FamilyAllowance(command.EmployeeId, contractEnd);
var MarriedAllowance = _yearlySalaryRepository.MarriedAllowance(contractEnd, command.EmployeeId);
// حق تاهل
string MarriedAllowanceStr = MarriedAllowance > 0 ? MarriedAllowance.ToMoney() : "0";
#endregion
var totalWeek = (int)(TotalContractDays / 6);
#region Fix44Compute
if (totalHourses < mandatoryHours)
{
if (command.ShiftWork == "1" || command.ShiftWork == "2" || command.ShiftWork == "4")
{
var workedHoursePerDay = totalHourses / mandatorDays;
var result = (dayliFeeDouble / 7.33) * workedHoursePerDay;
dayliFee = result.ToMoney();
var HousingAllowonceNumberType = HousingAllowance.MoneyToDouble();
var HousingStep1 = HousingAllowonceNumberType / 30;
var HousingStep2 = HousingStep1 / 7.33;
var HousingStep3 = HousingStep2 * workedHoursePerDay;
var HousingStep4 = HousingStep3 * TotalContractDays;
HousingAllowance = HousingStep4.ToMoney();
var ConsumableItemsNumberType = ConsumableItems.MoneyToDouble();
var consumableItemsStep1 = ConsumableItemsNumberType / 30;
var consumableItemsStep2 = consumableItemsStep1 / 7.33;
var consumableItemsStep3 = consumableItemsStep2 * workedHoursePerDay;
var consumableItemsStep4 = consumableItemsStep3 * TotalContractDays;
ConsumableItems = consumableItemsStep4.ToMoney();
//حق تاهل
if (MarriedAllowance > 0)
{
var MarriedStep1 = MarriedAllowance / 30;
var MarriedStep2 = MarriedStep1 / 7.33;
var MarriedStep3 = MarriedStep2 * workedHoursePerDay;
var MarriedStep4 = MarriedStep3 * TotalContractDays;
MarriedAllowanceStr = MarriedStep4.ToMoney();
}
if (familyAllowance != "0")
{
var familyAllowanceNumberType = familyAllowance.MoneyToDouble();
var familyAllowanceStep1 = familyAllowanceNumberType / 30;
var familyAllowanceStep2 = familyAllowanceStep1 / 7.33;
var familyAllowanceStep3 = familyAllowanceStep2 * workedHoursePerDay;
var familyAllowanceStep4 = familyAllowanceStep3 * TotalContractDays;
familyAllowance = familyAllowanceStep4.ToMoney();
}
if (totalWeek > 1)
{
double weekAvrage = 0;
if (totalHourses < 44.00)
{
weekAvrage = (totalHourses * 6) / TotalContractDays;
}
else
{
weekAvrage = (totalHourses * 6) / TotalDaysNoFriday;
}
//var oneday = weekAvrage * 6;
var totalShiftRound = Math.Round(weekAvrage, 2);
SumWorkeTime = $"{totalShiftRound}";
}
else if (totalWeek <= 1 && TotalDaysNoFriday <= 6)
{
var totalShiftRound = Math.Round(totalHourses, 2);
SumWorkeTime = $"{totalShiftRound}";
}
else if (totalWeek <= 1 && TotalDaysNoFriday > 6)
{
var perDyeWorked = totalHourses / TotalDaysNoFriday;
var weekAvrage = perDyeWorked * 6;
var totalShiftRound = Math.Round(weekAvrage, 2);
SumWorkeTime = $"{totalShiftRound}";
}
weeklyTime = sumSpans;
}
}
else // اگر بیشتر از 44 بود
{
var HousingAllowonceNumberType = HousingAllowance.MoneyToDouble();
var ConsumableItemsNumberType = ConsumableItems.MoneyToDouble();
var familyAllowanceNumberType = familyAllowance.MoneyToDouble();
var HousingStep1 = HousingAllowonceNumberType / 30;
var HousingStep4 = HousingStep1 * TotalContractDays;
HousingAllowance = HousingStep4.ToMoney();
var consumableItemsStep1 = ConsumableItemsNumberType / 30;
var consumableItemsStep4 = consumableItemsStep1 * TotalContractDays;
ConsumableItems = consumableItemsStep4.ToMoney();
//حق تاهل
if (MarriedAllowance > 0)
{
var MarriedStep1 = MarriedAllowance / 30;
var MarriedStep4 = MarriedStep1 * TotalContractDays;
MarriedAllowanceStr = MarriedStep4.ToMoney();
}
if (familyAllowance != "0")
{
var familyAllowanceStep1 = familyAllowanceNumberType / 30;
var familyAllowanceStep4 = familyAllowanceStep1 * TotalContractDays;
familyAllowance = familyAllowanceStep4.ToMoney();
}
SumWorkeTime = $"{44}";
//اضافه کار
if (totalHourses > mandatoryHours)
{
var mandatoryH = (int)Mandatory.TotalHours;
int mandatoryM = (int)(Mandatory.Minutes % 60);
overMandatoryHours = mandatoryH.ToString();
overMandatoryMinuts = mandatoryM.ToString();
}
}
#endregion
#region Result
var res = new ComputingViewModel()
{
NumberOfWorkingDays = "0",
NumberOfFriday = "0",
TotalHoursesH = totalHolidaysAndNotH.ToString(),
TotalHoursesM = totalHolidaysAndNotM.ToString(),
OverTimeWorkH = overMandatoryHours,
OverTimeWorkM = overMandatoryMinuts,
//OverNightWorkH = shiftOver22Hours,
//OverNightWorkM = shiftOver22Minuts,
ComplexNumberOfWorkingDays = "0",
SalaryCompute = dayliFee,
SumTime44 = SumWorkeTime,
ConsumableItems = ConsumableItems,
HousingAllowance = HousingAllowance,
FamilyAllowance = familyAllowance,
OfficialHoliday = holiday,
weeklyTime = weeklyTime,
//RotatingResultList = rotatingResultList,
//RotatingStatus = rotatingFaResult,
//ShiftPay = ShiftPayResult,
Basic = basic,
FridayStartToEnd = fridays,
TotalHolidayAndNotH = totalHolidaysAndNotH.ToString(),
TotalHolidayAndNotM = totalHolidaysAndNotM.ToString(),
DayliFeeComplete = dayliFeeComplete,
MarriedAllowance = MarriedAllowanceStr,
};
#endregion
return new ComputingViewModel();
}
}

View File

@@ -848,6 +848,7 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
var res = new DayliFeeViewModel()
{
DayliFeeDouble = FinalResultDouble,
DayliFee = finalResultMoney,
Basic = basicResultSum.ToMoney()
};

View File

@@ -342,6 +342,9 @@ public class PersonalBootstrapper
services.AddTransient<ITaxJobCategoryRepository, TaxJobCategoryRepository>();
services.AddTransient<ITaxJobCategoryApplication, TaxJobCategoryApplication>();
services.AddTransient<IRollCallMandatoryRepository, RollCallMandatoryRepository>();
services.AddTransient<IRollCallMandatoryApplication, RollCallMandatoryApplication>();
//=========End Of Main====================================
//---File Project------------------------------------

View File

@@ -19,6 +19,7 @@ using CompanyManagment.App.Contracts.Job;
using CompanyManagment.App.Contracts.Leave;
using CompanyManagment.App.Contracts.LeftWork;
using CompanyManagment.App.Contracts.PersonalContractingParty;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.WorkingHours;
using CompanyManagment.App.Contracts.WorkingHoursItems;
using CompanyManagment.App.Contracts.WorkingHoursTemp;
@@ -68,6 +69,7 @@ namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts
public string employeeFullName;
private string InterferenceMessage = string.Empty;
public List<string> YearlyList;
private readonly IRollCallMandatoryApplication _rollCallMandatoryApplication;
private readonly ICheckoutApplication _checkoutApplication;
private readonly IContractApplication _contractApplication;
private readonly IWorkshopApplication _workshopApplication;
@@ -87,7 +89,6 @@ namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts
private readonly IHubContext<CheckoutHub> _hubContext;
private readonly IEmployeeComputeOptionsApplication _employeeComputeOptionsApplication;
public IndexModel(IContractApplication contractApplication, IWorkshopApplication workshopApplication,
IEmployeeApplication employeeApplication,
IEmployerApplication employerApplication,
@@ -98,7 +99,11 @@ namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts
IAuthHelper authHelper, ICheckoutApplication checkoutApplication,
IYearlySalaryRepository yearlySalaryRepository,
IWorkingHoursTempApplication workingHoursTempApplication,
IHolidayItemRepository holidayItemRepository, ILeftWorkApplication leftWorkApplication, IPersonalContractingPartyApp personalContractingPartyApp, ILeaveApplication leaveApplication, IHubContext<CheckoutHub> hubContext, IEmployeeComputeOptionsApplication employeeComputeOptionsApplication)
IHolidayItemRepository holidayItemRepository, ILeftWorkApplication leftWorkApplication,
IPersonalContractingPartyApp personalContractingPartyApp,
ILeaveApplication leaveApplication, IHubContext<CheckoutHub> hubContext,
IEmployeeComputeOptionsApplication employeeComputeOptionsApplication,
IRollCallMandatoryApplication rollCallMandatoryApplication)
{
_contractApplication = contractApplication;
_workshopApplication = workshopApplication;
@@ -119,6 +124,8 @@ namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts
_leaveApplication = leaveApplication;
_hubContext = hubContext;
_employeeComputeOptionsApplication = employeeComputeOptionsApplication;
_rollCallMandatoryApplication = rollCallMandatoryApplication;
}
@@ -474,15 +481,27 @@ namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts
workingHours.WorkshopId = contract.WorkshopIds;
workingHours.EmployeeId = contract.EmployeeId;
var mandatoryCompute = new ComputingViewModel();
var mandatoryCompute = MandatoryHours(workingHours, 0);
var hasLeave = _leaveApplication.LeavOnChekout(separation.ContractStartGr,
separation.ContractEndGr, contract.EmployeeId, contract.WorkshopIds);
if (hasLeave != null)
if (_rollCallMandatoryApplication.HasRollCallRecord(contract.EmployeeId, contract.WorkshopIds,
separation.ContractStartGr))
{
var LeaveCompute = MandatoryHours(workingHours, hasLeave.Id);
mandatoryCompute = _rollCallMandatoryApplication.MandatoryCompute(contract.EmployeeId, contract.WorkshopIds,
separation.ContractStartGr,separation.ContractEndGr,workingHours,0);
}
else
{
mandatoryCompute = MandatoryHours(workingHours, 0);
var hasLeave = _leaveApplication.LeavOnChekout(separation.ContractStartGr,
separation.ContractEndGr, contract.EmployeeId, contract.WorkshopIds);
if (hasLeave != null)
{
var LeaveCompute = MandatoryHours(workingHours, hasLeave.Id);
}
}
var employee = _employeeApplication.GetDetails(contract.EmployeeId);
@@ -4602,8 +4621,6 @@ namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts
#endregion
#region ComplexCompute
@@ -6358,6 +6375,7 @@ namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts
}
#endregion
#region sendResult
@@ -6399,8 +6417,7 @@ namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts
return ress;
#endregion
}
#endregion

View File

@@ -308,7 +308,7 @@ public class IndexModel : PageModel
}
int mandatorDays = totalDays - (fridays + holiday);
double mandatoryHours = Math.Round((mandatorDays * 7.33), 2); ;
double mandatoryHours = Math.Round((mandatorDays * 7.33), 2);
switch (item.MonthNumber)
{
case "01":

View File

@@ -80,22 +80,24 @@
</div>
<div class="col-12 col-lg-6 col-xl-4">
<div class="from-group position-relative">
<input type="text" asp-for="Command.ContractingPartyName" id="partyNameSearch" class="form-control" autocomplete="off" placeholder="طرف حساب">
<input type="text" asp-for="Command.ContractingPartyName" id="partyNameSearch" class="form-control" autocomplete="off" placeholder="طرف حساب" onkeyup="searchPartyNameTask()">
<div id="partyName" class="selectDiv">
<ul class="searchResult">
<ul class="searchResult" id="searchResult">
</ul>
</div>
</div>
<div class="from-group my-1 position-relative">
<input type="text" asp-for="Command.Title" class="form-control m-0 TaskTitleSearch" placeholder="عنوان وظیفه">
<input type="text" asp-for="Command.Title" class="form-control m-0 TaskTitleSearch" placeholder="عنوان وظیفه" onkeyup="searchSubjectTask()">
<div permission="90313" class="position-absolute" style="top: 3px; left:3px; cursor: pointer;" onclick="taskSubjectModal()">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 6L12 18" stroke="#33363F" stroke-width="2" stroke-linecap="round"/>
<path d="M18 12L6 12" stroke="#33363F" stroke-width="2" stroke-linecap="round"/>
</svg>
<div class="btn-add2">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 6L12 18" stroke="#ffffff" stroke-width="2" stroke-linecap="round" />
<path d="M18 12L6 12" stroke="#ffffff" stroke-width="2" stroke-linecap="round" />
</svg>
</div>
</div>
<div id="TaskTitle" class="selectTitleDiv">
<ul class="searchTitleResult">
<ul id="searchTitleResult" class="searchTitleResult">
</ul>
</div>
</div>
@@ -104,21 +106,22 @@
<div class="row">
<div class="col-8">
<div class="from-group">
<input asp-for="Command.EndTaskDate" type="text" id="EndTaskDate" value="@Model.DateFa" class="form-control text-center date" placeholder="تاریخ">
@* <input asp-for="Command.EndTaskDate" type="text" id="EndTaskDate" value="@Model.DateFa" class="form-control text-center date" placeholder="تاریخ"> *@
<input asp-for="Command.EndTaskDate" type="text" id="EndTaskDate" value="" class="form-control text-center date" placeholder="تاریخ">
</div>
<div class="row my-2">
<div class="col-4 pe-0">
<input type="radio" class="tm-rad" name="btnradio" id="today" autocomplete="off" checked>
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="today" style="border-radius: 2; margin:0 2px">امروز</label>
<input type="radio" class="tm-rad" name="btnradio" id="today" autocomplete="off">
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="today" style="margin:0 2px">امروز</label>
</div>
<div class="col-4 p-0">
<input type="radio" class="tm-rad" name="btnradio" id="tommorow" autocomplete="off">
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="tommorow" style="border-radius: 2; margin:0 2px">فردا</label>
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="tommorow" style="margin:0 2px">فردا</label>
</div>
<div class="col-4 ps-0">
<input type="radio" class="tm-rad" name="btnradio" id="two-day-later" autocomplete="off">
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="two-day-later" style="border-radius: 2; margin:0 2px">پس فردا</label>
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="two-day-later" style="margin:0 2px">پس فردا</label>
</div>
</div>
</div>

View File

@@ -7,6 +7,7 @@ using CompanyManagment.App.Contracts.PersonalContractingParty;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
{
@@ -19,8 +20,9 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
private readonly IPersonalContractingPartyApp _contractingPartyApp;
private readonly IPositionApplication _positionApplication;
private readonly ITaskSubjectApplication _taskSubjectApplication;
private readonly IWebHostEnvironment _webHostEnvironment;
public CreateModel(ITaskApplication taskApplication, IAccountApplication accountApplication, IPersonalContractingPartyApp personalContractingPartyApp, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp, IPositionApplication positionApplication, ITaskSubjectApplication taskSubjectApplication)
public CreateModel(ITaskApplication taskApplication, IAccountApplication accountApplication, IPersonalContractingPartyApp personalContractingPartyApp, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp, IPositionApplication positionApplication, ITaskSubjectApplication taskSubjectApplication, IWebHostEnvironment webHostEnvironment)
{
_taskApplication = taskApplication;
_accountApplication = accountApplication;
@@ -29,6 +31,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
_contractingPartyApp = contractingPartyApp;
_positionApplication = positionApplication;
_taskSubjectApplication = taskSubjectApplication;
_webHostEnvironment = webHostEnvironment;
}
public CreateTask Command { get; set; }
@@ -39,19 +42,31 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
public IActionResult OnGet()
{
if (_authHelper.GetPermissions().Any(x=>x==903))
{
var accounts = _accountApplication.GetAccountLowerPositionvalue();
AccountsList = new SelectList(accounts, "Id", "Fullname");
PositionViewModels = _positionApplication.GetLowerPosition();
DateFa = DateTime.Now.ToFarsi();
Id = _authHelper.CurrentAccountId();
return Page();
}
else
{
return Forbid();
}
var positionValue = _authHelper.CurrentAccountInfo().PositionValue == null
? 0
: _authHelper.CurrentAccountInfo().PositionValue;
if (positionValue>0)
{
if (_authHelper.GetPermissions().Any(x=>x==903))
{
var accounts = _accountApplication.GetAccountLowerPositionvalue();
AccountsList = new SelectList(accounts, "Id", "Fullname");
PositionViewModels = _positionApplication.GetLowerPosition();
DateFa = DateTime.Now.ToFarsi();
Id = _authHelper.CurrentAccountId();
return Page();
}
else
{
return Forbid();
}
}
else
{
return Forbid();
}
}

View File

@@ -51,7 +51,7 @@
<div class="detailTitle">تاریخ انجام: </div>
</div>
<div class="col-12 col-sm-9 border rounded">
<div class="detailTitleText">@Model.EndTaskDate</div>
<div class="detailTitleText">@Model.EndTaskDate @Model.EndTaskTime</div>
</div>
</div>

View File

@@ -7,8 +7,8 @@
int fileIndex = 0;
int i = 1;
<script src="~/AssetsClient/js/jquery-ui.js"></script>
<link href="~/assetsclient/css/task-manager-create.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/assetsadminnew/tasks/css/edit.css" rel="stylesheet" />
<link href="~/assetsclient/css/task-manager-create.css?ver=@Version.AdminVersion" rel="stylesheet" />
<link href="~/assetsadminnew/tasks/css/edit.css?ver=@Version.AdminVersion" rel="stylesheet" />
}
@@ -122,9 +122,7 @@
<div class="row">
<div class="col-12">
<div class="from-group">
<textarea asp-for="EditTask.Description" id="Command_Description" class="tm-textarea p-2" rows="10" placeholder="توضیحات ...">
</textarea>
<textarea asp-for="EditTask.Description" id="Command_Description" class="tm-textarea p-2" rows="10" placeholder="توضیحات ..."></textarea>
@* @{
// var Description = HttpUtility.HtmlDecode(Model.EditTask.Description);
@@ -276,9 +274,8 @@
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script>
var AntiForgeryToken = $('@Html.AntiForgeryToken()').val();
var EditSaveTask = '@Url.Page("/Company/Task/Index", "EditSaveTask")';
var SearchContractingParties = '@Url.Page("./Create", "SearchContractingParties")';
var AntiForgeryToken = $('@Html.AntiForgeryToken()').val();
var EditSaveTask = '@Url.Page("/Company/Task/Index", "EditSaveTask")';
var SearchContractingParties = '@Url.Page("./Create", "SearchContractingParties")';
</script>
<script src="~/assetsadminnew/tasks/js/edit.js"></script>
<script src="~/assetsadminnew/tasks/js/edit.js?ver=@Version.AdminVersion"></script>

View File

@@ -1,6 +1,7 @@
@page
@using Version = _0_Framework.Application.Version
@model ServiceHost.Areas.AdminNew.Pages.Company.Task.GroupModel
@inject _0_Framework.Application.IAuthHelper AuthHelper;
@{
ViewData["Title"] = " - " + "کارگاه";
int index = 1;
@@ -137,49 +138,50 @@
@section Script {
<script src="~/AssetsClient/js/jquery-ui.js"></script>
<script src="~/assetsclient/js/site.js?ver=@Version.StyleVersion"></script>
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
<script src="~/AssetsClient/js/jquery-ui.js"></script>
<script src="~/assetsclient/js/site.js?ver=@Version.StyleVersion"></script>
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
<script>
window.onload = function() {
//OpenBootstrapPopup();
};
<script>
var hasDeletePermission = '@AuthHelper.GetPermissions().Any(x => x == 90213)';
window.onload = function() {
//OpenBootstrapPopup();
};
$('.btnPosition').click(function() {
var positionId = $(this).find('.positionId').val();
loadAjax(positionId)
$('.btnPosition').click(function() {
var positionId = $(this).find('.positionId').val();
loadAjax(positionId);
$(this).addClass('active');
$('.btnPosition').not(this).removeClass('active');
$(this).addClass('active');
$('.btnPosition').not(this).removeClass('active');
});
});
function loadAjax(positionId) {
function loadAjax(positionId) {
let accountId = $('#btnPosition').val();
var index = 0;
var html = '';
$('#loadAccountItems').html('');
let accountId = $('#btnPosition').val();
var index = 0;
var html = '';
$('#loadAccountItems').html('');
// var searchModel = {};
// searchModel.ContractingPatyId = Number($('#contractingPatyId').val());
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Group", "GroupAccountsAjax")',
data: {
Id: positionId,
},
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
// var searchModel = {};
// searchModel.ContractingPatyId = Number($('#contractingPatyId').val());
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Group", "GroupAccountsAjax")',
data: {
Id: positionId,
},
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
success: function(response) {
response.accounts.forEach(function(account) {
html += `
success: function(response) {
response.accounts.forEach(function(account) {
html += `
<div></div>
<div class="Rtable-row align-items-center position-relative">
@@ -213,157 +215,159 @@
<!-- <div class="Rtable-cell--heading">
</div> -->
<div class="Rtable-cell--content align-items-center d-flex d-md-block text-end">
<button permission="90213" href="" class="btn-delete" onclick="removeMemberConfirm(${account.id},${account.positionId})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1 d-none">حذف</span>
</button>
${hasDeletePermission === 'True' ? `<button href="" class="btn-delete" onclick="removeMemberConfirm(${account.id},${account.positionId})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1 d-none">حذف</span>
</button>`:``}
</div>
</div>
</div>`;
});
});
$('#loadAccountItems').append(html);
},
failure: function(response) {
console.log(5, response);
}
});
}
$('#loadAccountItems').append(html);
},
failure: function(response) {
console.log(5, response);
}
});
}
$(document).ready(function () {
var positionId = 1;
loadAjax(positionId);
$(document).ready(function() {
var positionId = 1;
loadAjax(positionId);
$('.btnPosition:first-child').addClass('active');
$('.btnPosition:first-child').addClass('active');
});
function CreateGroupModal() {
var goTo = `#showmodal=@Url.Page("/Company/Task/Group", "ShowCreateModal")`;
window.location.href = goTo;
var goTo = `#showmodal=@Url.Page("/Company/Task/Group", "ShowCreateModal")`;
window.location.href = goTo;
}
//Add To Group Modal
function AddToGroupModal(id) {
var ID = Number(id);
var goTo = `#showmodal=/AdminNew/Company/Task/Group?positionId=${ID}&handler=AccountPosition`;
window.location.href = goTo;
//Add To Group Modal
function AddToGroupModal(id) {
var ID = Number(id);
var goTo = `#showmodal=/AdminNew/Company/Task/Group?positionId=${ID}&handler=AccountPosition`;
window.location.href = goTo;
}
function removeConfirm(id) {
swal({
title: "آیا از حذف این گروه اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
}, function (isConfirm) {
if (isConfirm) {
deleteGroup(id);
}
});
swal({
title: "آیا از حذف این گروه اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
},
function(isConfirm) {
if (isConfirm) {
deleteGroup(id);
}
});
}
function deleteGroup(id) {
var ID = Number(id);
function deleteGroup(id) {
var ID = Number(id);
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Group", "RemovePosition")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { positionId: ID },
success: function (response) {
if (response.isSuccedded) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
window.location.reload();
}, 1000);
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (err) {
console.log(err);
}
});
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Group", "RemovePosition")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { positionId: ID },
success: function(response) {
if (response.isSuccedded) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function() {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
window.location.reload();
},
1000);
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function() {
$('.alert-msg').hide();
$('.alert-msg p').text('');
},
3500);
}
},
error: function(err) {
console.log(err);
}
});
}
function removeMemberConfirm(memberId ,id) {
swal({
title: "آیا از حذف اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
}, function (isConfirm) {
if (isConfirm) {
deleteMember(memberId, id);
}
});
function removeMemberConfirm(memberId, id) {
swal({
title: "آیا از حذف اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
},
function(isConfirm) {
if (isConfirm) {
deleteMember(memberId, id);
}
});
}
function deleteMember(memberId, id) {
var ID = Number(id);
var MemberId = Number(memberId);
function deleteMember(memberId, id) {
var ID = Number(id);
var MemberId = Number(memberId);
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Group", "DeleteAccountFromPosition")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { accountIds: MemberId, positionId: ID },
success: function (response) {
if (response.isSuccedded) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
window.location.reload();
}, 1000);
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (err) {
console.log(err);
}
});
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Group", "DeleteAccountFromPosition")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { accountIds: MemberId, positionId: ID },
success: function(response) {
if (response.isSuccedded) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function() {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
window.location.reload();
},
1000);
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function() {
$('.alert-msg').hide();
$('.alert-msg p').text('');
},
3500);
}
},
error: function(err) {
console.log(err);
}
});
}
</script>

View File

@@ -126,5 +126,10 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
message = res.Message,
});
}
}
}
}

View File

@@ -130,17 +130,32 @@
//******************** انتخاب چک باکس ********************
$('.items').click(function() {
var isChecked = $(this).find('input[type="checkbox"]').is(":checked");
$('.items').click(function (e) {
if ($(e.target).is('input[type="checkbox"]')) {
return;
}
if (isChecked) {
$(this).find('input[type="checkbox"]').prop('checked', false);
$(this).removeClass('checked-item');
} else {
$(this).find('input[type="checkbox"]').prop('checked', true);
$(this).addClass('checked-item');
}
var checkbox = $(this).find('input[type="checkbox"]');
var isChecked = checkbox.is(":checked");
checkbox.prop('checked', !isChecked);
$(this).toggleClass('checked-item', !isChecked);
});
$('.items input[type="checkbox"]').click(function (e) {
e.stopPropagation();
var isChecked = $(this).is(":checked");
$(this).closest('.items').toggleClass('checked-item', isChecked);
});
$('.items label').click(function (e) {
e.stopPropagation();
var isChecked = $(this).is(":checked");
$(this).closest('.items').toggleClass('checked-item', isChecked);
});
//******************** انتخاب چک باکس ********************
//******************** انتخاب همه ی چک باکس ها ********************

View File

@@ -1,6 +1,7 @@
@page
@using Version = _0_Framework.Application.Version
@model ServiceHost.Areas.AdminNew.Pages.Company.Task.IndexModel
@inject _0_Framework.Application.IAuthHelper AuthHelper;
@{
var index = 1;
}
@@ -20,9 +21,9 @@
<!-- sweet alerts -->
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
<link href="~/assetsadminnew/tasks/css/index.css" rel="stylesheet" />
<link href="~/assetsadminnew/tasks/css/index.css" rel="stylesheet" />
}
@@ -51,42 +52,67 @@
<!-- List Items -->
<div class="row">
<div class="col-12 mb-2" permission="903">
<a asp-page="/Company/Task/Create" class="btn-register text-white" type="button">
<a asp-page="/Company/Task/Create" class="btn-register-index text-white" type="button">
<span>وظیفه جدید</span>
</a>
</div>
<div class="col-12 mb-2">
<div class="d-flex w-100">
<button type="button" class="btnTaskList active" id="btnTaskList" permission="9011">لیست وظایف</button>
<button type="button" class="btnTaskRequest mx-2 d-flex align-items-center" id="btnTaskRequest"permission="9012">
لیست درخواست ها
<span class="badge bg-danger rounded-pill mx-1" id="badgeRequestCount">@Model.RequestCount</span>
</button>
@if (Model.UserPositionValue == 1)
{
<button type="button" class="btnTaskListSelfTask me-1 active" id="btnTaskListSelfTask" onclick="loadMore('selfTask');">وظایف شخصی</button>
<button type="button" class="btnTaskListAllTask mx-1" id="btnTaskListAllTask" onclick="loadMore('AllTask');">کل وظایف</button>
<button type="button" class="btnTaskListSent mx-1" id="btnTaskListSent" onclick="loadMore('sent');">وظایف ارسالی</button>
<button type="button" class="btnTaskRequest mx-1 d-flex align-items-center" id="btnTaskRequest" permission="9012">
لیست درخواست ها
<span class="badge bg-danger rounded-pill mx-1 @(Model.RequestCount==0 ? "d-none" : "")" id="badgeRequestCount">@Model.RequestCount</span>
</button>
}
else if (Model.UserPositionValue > 1 && Model.UserPositionValue < Model.LastPositionValue)
{
<button type="button" class="btnTaskListSent me-1 active" id="btnTaskListSent" onclick="loadMore('sent');">وظایف ارسالی</button>
<button type="button" class="btnTaskListReceived mx-1" id="btnTaskListReceived" onclick="loadMore('received');">وظایف دریافتی</button>
<button type="button" class="btnTaskRequest mx-1 d-flex align-items-center" id="btnTaskRequest" permission="9012">
لیست درخواست ها
<span class="badge bg-danger rounded-pill mx-1 @(Model.RequestCount==0 ? "d-none" : "")" id="badgeRequestCount">@Model.RequestCount</span>
</button>
}
else if (Model.UserPositionValue == Model.LastPositionValue)
{
<button type="button" class="btnTaskList active me-1 " id="btnTaskList" onclick="loadMore('list');" permission="9011">لیست وظایف</button>
}
</div>
</div>
<div class="col-12 p-0 mb-2 d-none d-md-block">
<div class="search-box card border-0">
<div class="d-grid search-section gap-2">
<div class="search-box card border-0">
<div class="d-grid search-section gap-2">
<div class="d-grid grid-cols-2 gap-2 col-span-2">
<div class=""><input type="text" class="form-control date start-date" asp-for="SearchModel.StartDate" id="StartDate" placeholder="تاریخ شروع"></div>
<div class=""><input type="text" class="form-control date end-date" asp-for="SearchModel.EndDate" id="EndDate" placeholder="تاریخ پایان"></div>
</div>
<div class="d-grid grid-cols-2 gap-2 col-span-2">
<div class=""><input type="text" class="form-control date start-date" asp-for="SearchModel.StartDate" id="StartDate" placeholder="تاریخ شروع"></div>
<div class=""><input type="text" class="form-control date end-date" asp-for="SearchModel.EndDate" id="EndDate" placeholder="تاریخ پایان"></div>
</div>
<div class="col-span-2 md-col-span-3">
<select class="form-select select2Option" aria-label="انتخاب پرسنل ..." asp-for="SearchModel.AccountId" id="AccountId">
<option value="0">پرسنل را انتخاب کنید ...</option>
</select>
</div>
<div class="col-span-2 md-col-span-3">
<select class="form-select select2Option" aria-label="انتخاب پرسنل ..." asp-for="SearchModel.AccountId" id="AccountId">
<option value="0">پرسنل را انتخاب کنید ...</option>
</select>
</div>
<div class="d-grid grid-cols-1 gap-2 col-span-2">
@* <div class="wrapper-dropdown-normal btn-dropdown">
<div class="d-grid grid-cols-1 gap-2 col-span-2">
@* <div class="wrapper-dropdown-normal btn-dropdown">
<span class="selected-display">دارای درخواست مهلت</span>
<svg id="drp-arrow" class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
@@ -97,9 +123,9 @@
<li class="item" value-data-normal="false">خیر</li>
</ul>
</div> *@
<input type="hidden" id="IsTimeRequest" asp-for="SearchModel.IsTimeRequest" />
<input type="hidden" id="IsTimeRequest" asp-for="SearchModel.IsTimeRequest" />
@* <div class="wrapper-dropdown-normal btn-dropdown">
@* <div class="wrapper-dropdown-normal btn-dropdown">
<span class="selected-display">دارای درخواست کنسل</span>
<svg id="drp-arrow" class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
@@ -110,9 +136,9 @@
<li class="item" value-data-normal="false">خیر</li>
</ul>
</div> *@
<input type="hidden" id="IsCancelRequest" asp-for="SearchModel.IsCancelRequest" />
<input type="hidden" id="IsCancelRequest" asp-for="SearchModel.IsCancelRequest" />
@* <div class="wrapper-dropdown-normal btn-dropdown">
@* <div class="wrapper-dropdown-normal btn-dropdown">
<span class="selected-display">کنسل شده</span>
<svg id="drp-arrow" class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
@@ -123,9 +149,9 @@
<li class="item" value-data-normal="false">خیر</li>
</ul>
</div> *@
<input type="hidden" id="IsCanceled" asp-for="SearchModel.IsCanceled" />
<input type="hidden" id="IsCanceled" asp-for="SearchModel.IsCanceled" />
@* <div class="wrapper-dropdown-normal btn-dropdown">
@* <div class="wrapper-dropdown-normal btn-dropdown">
<span class="selected-display">دارای مهلت</span>
<svg id="drp-arrow" class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
@@ -136,9 +162,9 @@
<li class="item" value-data-normal="false">خیر</li>
</ul>
</div> *@
<input type="hidden" id="TimeRequestAccepted" asp-for="SearchModel.TimeRequestAccepted" />
<input type="hidden" id="TimeRequestAccepted" asp-for="SearchModel.TimeRequestAccepted" />
@* <div class="wrapper-dropdown-normal btn-dropdown">
@* <div class="wrapper-dropdown-normal btn-dropdown">
<span class="selected-display">دارای درخواست انجام</span>
<svg id="drp-arrow" class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
@@ -149,38 +175,38 @@
<li class="item" value-data-normal="false">خیر</li>
</ul>
</div> *@
<input type="hidden" id="IsDoneRequest" asp-for="SearchModel.IsDoneRequest" />
<input type="hidden" id="IsDoneRequest" asp-for="SearchModel.IsDoneRequest" />
<div class="wrapper-dropdown-normal btn-dropdown">
<span class="selected-display">دارای انجام شده</span>
<svg id="drp-arrow" class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
<ul class="dropdown-normal dropdown-IsDone boxes">
<li class="item" value-data-normal="">دارای انجام شده</li>
<li class="item" value-data-normal="true">بلی</li>
<li class="item" value-data-normal="false">خیر</li>
</ul>
<input type="hidden" id="IsDone" asp-for="SearchModel.IsDone" />
</div>
<div class="wrapper-dropdown-normal btn-dropdown">
<span class="selected-display">دارای انجام شده</span>
<svg id="drp-arrow" class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
<ul class="dropdown-normal dropdown-IsDone boxes">
<li class="item" value-data-normal="">دارای انجام شده</li>
<li class="item" value-data-normal="true">بلی</li>
<li class="item" value-data-normal="false">خیر</li>
</ul>
<input type="hidden" id="IsDone" asp-for="SearchModel.IsDone" />
</div>
</div>
<div class="d-flex gap-2 col-span-2">
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
<span>جستجو</span>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<circle cx="11" cy="11" r="6" stroke="white" />
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
</svg>
</button>
<a asp-page="/Company/Employees/Leave" class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable" id="filterRemove">
<span>حذف جستجو</span>
</a>
<div class="d-flex gap-2 col-span-2">
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
<span>جستجو</span>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<circle cx="11" cy="11" r="6" stroke="white" />
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
</svg>
</button>
<a asp-page="/Company/Employees/Leave" class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable" id="filterRemove">
<span>حذف جستجو</span>
</a>
</div>
</div>
</div>
</div>
</div>
@@ -190,165 +216,163 @@
<div class="Rtable Rtable--collapse pt-0" id="tasksAjax" style="">
@* <div class="Rtable-row Rtable-row--head align-items-center d-none">
<div class="Rtable-cell column-heading d-md-block d-none">ردیف</div>
<div class="Rtable-cell column-heading">عملیات</div>
</div>
<div class="Rtable-cell column-heading d-md-block d-none">ردیف</div>
<div class="Rtable-cell column-heading">عملیات</div>
</div>
<div class="w-100" >
</div> *@
<div class="w-100" >
</div> *@
@* @foreach (var task in Model.TaskViewModels)
{
<div class="Rtable-row align-items-center position-relative tm-@task.Color">
<div class="Rtable-cell d-md-block d-flex width1">
<div class="Rtable-cell--content">
<span class="d-flex justify-content-center">
@(index++)
</span>
</div>
</div>
{
<div class="Rtable-row align-items-center position-relative tm-@task.Color">
<div class="Rtable-cell d-md-block d-flex width1">
<div class="Rtable-cell--content">
<span class="d-flex justify-content-center">
@(index++)
</span>
</div>
</div>
@foreach (var assign in task.AssignList)
{
if (assign.AssignViewModels.Count > 0)
{
<div class="Rtable-cell d-md-block d-none width2">
@foreach (var item in assign.AssignViewModels)
{
<div class="Rtable-cell--content">@item.AssignedName</div>
}
</div>
}
else
{
<div class="Rtable-cell d-md-block d-none width2">
<div class="Rtable-cell--content">-</div>
@foreach (var assign in task.AssignList)
{
if (assign.AssignViewModels.Count > 0)
{
<div class="Rtable-cell d-md-block d-none width2">
@foreach (var item in assign.AssignViewModels)
{
<div class="Rtable-cell--content">@item.AssignedName</div>
}
</div>
}
else
{
<div class="Rtable-cell d-md-block d-none width2">
<div class="Rtable-cell--content">-</div>
</div>
}
</div>
}
}
}
<div class="Rtable-cell d-md-block d-none width6">
<div class="Rtable-cell--content ">@task.EndTaskDateFA</div>
</div>
<div class="Rtable-cell d-md-block d-none width6">
<div class="Rtable-cell--content ">@task.EndTaskDateFA</div>
</div>
<div class="Rtable-cell d-md-block d-none width7">
<div class="Rtable-cell--content ">@task.ContractingPartyName</div>
</div>
<div class="Rtable-cell d-md-block d-none width7">
<div class="Rtable-cell--content ">@task.ContractingPartyName</div>
</div>
<div class="Rtable-cell d-md-block d-flex width8">
@if (task.Description!=null)
{
<div class="Rtable-cell--content DesLimit">@Html.Raw(task.Description)</div>
}
else
{
<div class="Rtable-cell--content">ندارد</div>
}
</div>
<div class="Rtable-cell d-md-block d-flex width8">
@if (task.Description!=null)
{
<div class="Rtable-cell--content DesLimit">@Html.Raw(task.Description)</div>
}
else
{
<div class="Rtable-cell--content">ندارد</div>
}
</div>
<div class="Rtable-cell width9">
<div class="Rtable-cell--content align-items-center d-flex justify-content-end">
<button class="btn-taskmanager-edit position-relative d-md-block d-none">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1 d-md-none d-flex">ویرایش</span>
</button>
<button href="" class="btn-taskmanager-delete d-md-block d-none">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1 d-md-none d-flex">حذف</span>
</button>
<button class="btn-taskmanager-more position-relative">
<span> </span>
<span> </span>
<span> </span>
<span> </span>
<span class="mx-1 align-items-center d-flex justify-content-center">
<p class="my-0 mx-1">عملیات وظیفه</p>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="currentColor">
<circle cx="8.4001" cy="8.39922" r="1.2" transform="rotate(90 8.4001 8.39922)"/>
<circle cx="8.4001" cy="4.39922" r="1.2" transform="rotate(90 8.4001 4.39922)"/>
<circle cx="8.4001" cy="12.3992" r="1.2" transform="rotate(90 8.4001 12.3992)"/>
</svg>
</span>
</button>
</div>
</div>
<div class="Rtable-cell width9">
<div class="Rtable-cell--content align-items-center d-flex justify-content-end">
<button class="btn-taskmanager-edit position-relative d-md-block d-none">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1 d-md-none d-flex">ویرایش</span>
</button>
<button href="" class="btn-taskmanager-delete d-md-block d-none">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1 d-md-none d-flex">حذف</span>
</button>
<button class="btn-taskmanager-more position-relative">
<span> </span>
<span> </span>
<span> </span>
<span> </span>
<span class="mx-1 align-items-center d-flex justify-content-center">
<p class="my-0 mx-1">عملیات وظیفه</p>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="currentColor">
<circle cx="8.4001" cy="8.39922" r="1.2" transform="rotate(90 8.4001 8.39922)"/>
<circle cx="8.4001" cy="4.39922" r="1.2" transform="rotate(90 8.4001 4.39922)"/>
<circle cx="8.4001" cy="12.3992" r="1.2" transform="rotate(90 8.4001 12.3992)"/>
</svg>
</span>
</button>
</div>
</div>
</div>
</div>
<div class="tm-@task.Color-operation operation-div w-100">
<div class="operations-btns">
<div class="row p-0">
<div class="col-md-12 col-12 p-1">
<div class="tm-@task.Color-operation operation-div w-100">
<div class="operations-btns">
<div class="row p-0">
<div class="col-md-12 col-12 p-1">
<div class="d-flex">
@foreach(var assign in task.AssignViewModels)
{
<div class="Rtable-cell d-md-block d-none width2">
<div class="Rtable-cell--content">@assign.AssignedName</div>
</div>
}
</div>
<div class="d-flex">
@foreach(var assign in task.AssignViewModels)
{
<div class="Rtable-cell d-md-block d-none width2">
<div class="Rtable-cell--content">@assign.AssignedName</div>
</div>
}
</div>
<div class="d-flex justify-content-between">
<div class="d-md-none d-block width7">
<div class="Rtable-cell--content ">@task.ContractingPartyName</div>
</div>
<div class="d-md-none d-block width6">
<div class="Rtable-cell--content ">@task.EndTaskDateFA</div>
</div>
</div>
<div class="d-flex justify-content-between">
<div class="d-md-none d-block width7">
<div class="Rtable-cell--content ">@task.ContractingPartyName</div>
</div>
<div class="d-md-none d-block width6">
<div class="Rtable-cell--content ">@task.EndTaskDateFA</div>
</div>
</div>
</div>
<div class="col-md-12 col-12 text-end p-1">
<div class="d-flex sub-buttons">
<button type="button" class="btn4" data-bs-toggle="modal" data-bs-target="#assignTo">ارجاع</button>
<button type="button" class="btn1" data-bs-toggle="modal" data-bs-target="#taskTime">مهلت برای روز خاص 1</button>
<button type="button" class="btn2">قابل انجام نیست</button>
<button type="button" class="btn3">انجام شد</button>
</div>
</div>
<div class="col-md-12 col-12 p-1">
<div class="d-flex justify-content-between">
<button class="btn-taskmanager-edit position-relative w-100 mx-1 d-md-none d-flex justify-content-center">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1 d-flex">ویرایش</span>
</button>
<button class="btn-taskmanager-delete w-100 mx-1 d-md-none d-flex justify-content-center">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1 d-flex">حذف</span>
</button>
</div>
</div>
</div>
</div>
</div>
} *@
</div>
<div class="col-md-12 col-12 text-end p-1">
<div class="d-flex sub-buttons">
<button type="button" class="btn4" data-bs-toggle="modal" data-bs-target="#assignTo">ارجاع</button>
<button type="button" class="btn1" data-bs-toggle="modal" data-bs-target="#taskTime">مهلت برای روز خاص 1</button>
<button type="button" class="btn2">قابل انجام نیست</button>
<button type="button" class="btn3">انجام شد</button>
</div>
</div>
<div class="col-md-12 col-12 p-1">
<div class="d-flex justify-content-between">
<button class="btn-taskmanager-edit position-relative w-100 mx-1 d-md-none d-flex justify-content-center">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1 d-flex">ویرایش</span>
</button>
<button class="btn-taskmanager-delete w-100 mx-1 d-md-none d-flex justify-content-center">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1 d-flex">حذف</span>
</button>
</div>
</div>
</div>
</div>
</div>
} *@
</div>
</div>
<div class="wrapper table-task-manager card p-2" id="divTaskRequest" style="display:none">
<div class="Rtable Rtable--collapse " id="taskRequestsAjax">
@@ -368,18 +392,26 @@
<!-- مودال -->
@section Script {
<script src="~/assetsclient/js/site.js?ver=@Version.StyleVersion"></script>
<script src="~/AssetsClient/js/dropdown.js?ver=@Version.StyleVersion"></script>
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
<script>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var loadMoreAjax = "@Url.Page("./Index", "TaskPagination")";
var loadMoreAjax = "@Url.Page("./Index", "TaskPagination")";
var loadRequestCountAjax = "@Url.Page("./Index", "RequestCount")";
var removeAjax="@Url.Page("./Index", "RemoveTask")";
var employeeListAjax="@Url.Page("./Index", "EmployeeList")";
</script>
<script src="~/assetsadminnew/tasks/js/index.js"></script>
var removeAjax = "@Url.Page("./Index", "RemoveTask")";
var employeeListAjax = "@Url.Page("./Index", "EmployeeList")";
var AssignPermission = "@AuthHelper.GetPermissions().Any(x => x == 90110)";
var timeRequestPermission = "@AuthHelper.GetPermissions().Any(x => x == 90111)";
var EditPermission = "@AuthHelper.GetPermissions().Any(x => x == 90114)";
var DeletePermission = "@AuthHelper.GetPermissions().Any(x => x == 90115)";
var CheckRequestPermission = "@AuthHelper.GetPermissions().Any(x => x == 90120)";
var userPositionValue = @Model.UserPositionValue;
var LastPositionValue = @Model.LastPositionValue;
</script>
<script src="~/assetsadminnew/tasks/js/index.js"></script>
}

View File

@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
@@ -14,6 +15,7 @@ using CompanyManagment.Application;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using NuGet.Repositories;
using static System.Runtime.InteropServices.JavaScript.JSType;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
@@ -41,6 +43,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
public List<TaskViewModel> TaskViewModels { get; set; }
public TaskSearchModel SearchModel { get; set; }
public int RequestCount { get; set; }
public int LastPositionValue { get; set; }
public int UserPositionValue { get; set; }
@@ -52,6 +56,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
searchModel.PageIndex = 0;
SearchModel = searchModel;
RequestCount = _taskApplication.GetRequestedTasksCount();
LastPositionValue = _positionApplication.GetLastPositionValue();
UserPositionValue = (int)_authHelper.CurrentAccountInfo().PositionValue;
return Page();
}
else
@@ -82,13 +88,69 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
TypeOfTicket = type
};
var lastPosition=_positionApplication.GetLastPositionValue();
var userPositionValue = _authHelper.CurrentAccountInfo().PositionValue;
var taskList = new List<TaskViewModel>();
if (userPositionValue == 1)
{
if (searchModel.TypeOfTicket =="request")
{
taskList = _taskApplication.GetAllRequestedTasks(searchModel);
}
else if(searchModel.TypeOfTicket =="selfTask")
{
taskList = _taskApplication.GetSelfTasks(searchModel);
}
else if (searchModel.TypeOfTicket=="sent")
{
taskList = _taskApplication.GetSentTasks(searchModel);
}
else if(searchModel.TypeOfTicket=="AllTask")
{
taskList = _taskApplication.GetTasks(searchModel);
}
else
{
return BadRequest();
}
}
taskList = searchModel.TypeOfTicket == "request"
? _taskApplication.GetAllRequestedTasks(searchModel)
: _taskApplication.GetTasks(searchModel);
else if (userPositionValue > 1 && userPositionValue < lastPosition)
{
if (searchModel.TypeOfTicket == "request")
{
taskList = _taskApplication.GetAllRequestedTasks(searchModel);
}
else if (searchModel.TypeOfTicket == "received")
{
taskList = _taskApplication.GetReceivedTasks(searchModel);
}
else if (searchModel.TypeOfTicket == "sent")
{
taskList = _taskApplication.GetSentTasks(searchModel);
}
else
{
return BadRequest();
}
}
else if (userPositionValue == lastPosition)
{
if (searchModel.TypeOfTicket=="list")
{
taskList = _taskApplication.GetTasks(searchModel);
}
else
{
return BadRequest();
}
}
else
{
return BadRequest();
}
return new JsonResult(new

View File

@@ -161,7 +161,7 @@
</a>
</li> *@
@*
<li class="open-submenu position-relative" style="cursor:pointer">
<div class="d-flex justify-content-between align-items-center">
<div>
@@ -186,7 +186,7 @@
</a>
</li>
</ul>
</li> *@
</li>
<li class="open-submenu position-relative" style="cursor:pointer" permission="900">
<div class="d-flex justify-content-between align-items-center">

View File

@@ -22,6 +22,17 @@
"applicationUrl": "https://localhost:5004;http://localhost:5003",
"jsWebView2Debugging": false,
"hotReloadEnabled": true
},
"WSL": {
"commandName": "WSL2",
"launchBrowser": true,
"launchUrl": "https://localhost:5004",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation",
"ASPNETCORE_URLS": "https://localhost:5004;http://localhost:5003"
},
"distributionName": ""
}
},
"iisSettings": {

View File

@@ -173,6 +173,13 @@
<None Include="wwwroot\AdminTheme\assets\datatables-new\js\dataTables.responsive.min.js" />
<None Include="wwwroot\AdminTheme\assets\datatables-new\js\jquery.dataTables.min.js" />
<None Include="wwwroot\AdminTheme\assets\images\small\back1.jpg" />
<None Include="wwwroot\AssetsAdminNew\Tasks\js\create.js" />
<None Include="wwwroot\AssetsAdminNew\Tasks\js\CreateCRUDTaskSubjectModal.js" />
<None Include="wwwroot\AssetsAdminNew\Tasks\js\DetailModal.js" />
<None Include="wwwroot\AssetsAdminNew\Tasks\js\Edit.js" />
<None Include="wwwroot\AssetsAdminNew\Tasks\js\Index.js" />
<None Include="wwwroot\AssetsAdminNew\Tasks\js\OperationModal.js" />
<None Include="wwwroot\AssetsAdminNew\Tasks\js\OperationRequestModal.js" />
<None Include="wwwroot\AssetsClient\css\bootstrap-grid.css.map" />
<None Include="wwwroot\AssetsClient\css\bootstrap-grid.min.css.map" />
<None Include="wwwroot\AssetsClient\css\bootstrap-grid.rtl.css.map" />

View File

@@ -94,10 +94,63 @@
right: 20px;
}
.btn-register {
.btn-register-index {
padding: 10px 30px;
width: 210px;
text-align: center;
font-size: 14px;
font-weight: 500;
background-color: #84CC16;
color: #FFFFFF;
border-radius: 8px;
}
.btnTaskListSelfTask {
padding: 10px 30px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
background-color: #bef1f1;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s
}
.btnTaskListAllTask {
padding: 10px 30px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
background-color: #bef1f1;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s
}
.btnTaskListSent {
padding: 10px 30px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
background-color: #bef1f1;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s
}
.btnTaskListReceived {
padding: 10px 30px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
background-color: #bef1f1;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s
}
.btnTaskList {
@@ -124,6 +177,10 @@
transition: all ease -in -out .3s
}
.btnTaskListSelfTask.active,
.btnTaskListAllTask.active,
.btnTaskListSent.active,
.btnTaskListReceived.active,
.btnTaskList.active,
.btnTaskRequest.active {
color: #ffffff;
@@ -150,7 +207,7 @@
font-size: 12px;
}
@media screen and(max-width: 767px) {
@media (max-width: 767px) {
.goToTop {
position: fixed;
bottom: 54px;
@@ -159,4 +216,51 @@
color: #fff;
background-color: #25acac70;
}
.btn-register-index {
padding: 5px;
width: 130px;
font-size: 11px;
}
.btnTaskListSelfTask {
padding: 5px;
width: 130px;
font-size: 11px;
}
.btnTaskListAllTask {
padding: 5px;
width: 130px;
font-size: 11px;
}
.btnTaskListSent {
padding: 5px;
width: 130px;
font-size: 11px;
}
.btnTaskListReceived {
padding: 5px;
width: 130px;
font-size: 11px;
}
.btnTaskList {
padding: 5px;
width: 130px;
font-size: 11px;
}
.btnTaskRequest {
padding: 5px;
width: 130px;
font-size: 11px;
}
.tooltipfull-container:hover .tooltipfull, a:hover.tooltipfull {
opacity: 0;
}
}

View File

@@ -7,6 +7,16 @@ $(document).on('keydown', '#EndTaskDate', function () {
});
$(document).ready(function () {
// نمایش توضیحات و رفع نمایش br
var textarea = $('#Command_Description');
var originalText = textarea.val();
textarea.val(originalText.replace(/<br\s*\/?>/gi, "\n"));
textarea.on('input', function () {
var updatedText = textarea.val().replace(/<br\s*\/?>/gi, "\n");
textarea.val(updatedText);
});
// نمایش توضیحات و رفع نمایش br
$(document).on('click', '#today', function () {
updateDateInput(0);
$("#today").prop('checked', true);

View File

@@ -8,50 +8,22 @@ $(document).on('click', ".openAction", function () {
$(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500);
});
//$(document).on('click', ".btnTaskList", function () {
// $('.btnTaskRequest').removeClass('active');
// $('.btnTaskList').addClass('active');
// $('#divTaskList').show();
// $('#divTaskRequest').hide();
$(document).on('click', ".btnTaskList", function () {
$('.btnTaskRequest').removeClass('active');
$('.btnTaskList').addClass('active');
$('#divTaskList').show();
$('#divTaskRequest').hide();
// $('#tasksAjax').html('');
$('#tasksAjax').html('');
// Number($('#pageIndex').val(0));
// Number($('#AccountId').val(0));
// $('#StartDate').val('');
// $('#EndDate').val('');
// $('#IsDone').val('');
Number($('#pageIndex').val(0));
Number($('#AccountId').val(0));
$('#StartDate').val('');
$('#EndDate').val('');
$('#IsDone').val('');
// $('#IsCanceled').val('');
// $('#IsCancelRequest').val('');
// $('#IsTimeRequest').val('');
// $('#TimeRequestAccepted').val('');
loadMore();
});
$(document).on('click', ".btnTaskRequest", function () {
$('.btnTaskList').removeClass('active');
$('.btnTaskRequest').addClass('active');
$('#divTaskList').hide();
$('#divTaskRequest').show();
$('#taskRequestsAjax').html('');
Number($('#pageIndex').val(0));
Number($('#AccountId').val(0));
$('#StartDate').val('');
$('#EndDate').val('');
$('#IsDone').val('');
// $('#IsCanceled').val('');
// $('#IsCancelRequest').val('');
// $('#IsTimeRequest').val('');
// $('#TimeRequestAccepted').val('');
loadMoreRequest();
});
// //loadMore(type);
//});
$(document).ready(function () {
@@ -92,12 +64,142 @@ function loadSticky() {
$('#searchBtn').on('click', function () {
$('#pageIndex').val(0);
$('#tasksAjax').html('');
loadMore();
loadMore(type);
});
function loadMore() {
$(document).on('click', "#btnTaskListSelfTask", function () {
$('#tasksAjax').html('');
Number($('#pageIndex').val(0));
Number($('#AccountId').val(0));
$('#StartDate').val('');
$('#EndDate').val('');
$('#IsDone').val('');
$('#divTaskList').show();
$('#divTaskRequest').hide();
loadMore('selfTask');
});
$(document).on('click', "#btnTaskListAllTask", function () {
$('#tasksAjax').html('');
Number($('#pageIndex').val(0));
Number($('#AccountId').val(0));
$('#StartDate').val('');
$('#EndDate').val('');
$('#IsDone').val('');
$('#divTaskList').show();
$('#divTaskRequest').hide();
loadMore('AllTask');
});
$(document).on('click', "#btnTaskListSent", function () {
$('#tasksAjax').html('');
Number($('#pageIndex').val(0));
Number($('#AccountId').val(0));
$('#StartDate').val('');
$('#EndDate').val('');
$('#IsDone').val('');
$('#divTaskList').show();
$('#divTaskRequest').hide();
loadMore('sent');
});
$(document).on('click', "#btnTaskListReceived", function () {
$('#tasksAjax').html('');
Number($('#pageIndex').val(0));
Number($('#AccountId').val(0));
$('#StartDate').val('');
$('#EndDate').val('');
$('#IsDone').val('');
$('#divTaskList').show();
$('#divTaskRequest').hide();
loadMore('received');
});
$(document).on('click', "#btnTaskList", function () {
$('#tasksAjax').html('');
Number($('#pageIndex').val(0));
Number($('#AccountId').val(0));
$('#StartDate').val('');
$('#EndDate').val('');
$('#IsDone').val('');
$('#divTaskList').show();
$('#divTaskRequest').hide();
loadMore('list');
});
$(document).on('click', ".btnTaskRequest", function () {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').removeClass('active');
$('#btnTaskListSent').removeClass('active');
$('#btnTaskListReceived').removeClass('active');
$('#btnTaskList').removeClass('active');
$('.btnTaskRequest').addClass('active');
$('#divTaskList').hide();
$('#divTaskRequest').show();
$('#taskRequestsAjax').html('');
Number($('#pageIndex').val(0));
Number($('#AccountId').val(0));
$('#StartDate').val('');
$('#EndDate').val('');
$('#IsDone').val('');
// $('#IsCanceled').val('');
// $('#IsCancelRequest').val('');
// $('#IsTimeRequest').val('');
// $('#TimeRequestAccepted').val('');
loadMoreRequest();
});
function loadMore(type) {
if (type == 'selfTask') {
$('#btnTaskListSelfTask').addClass('active');
$('#btnTaskListAllTask').removeClass('active');
$('#btnTaskListSent').removeClass('active');
$('#btnTaskListReceived').removeClass('active');
$('#btnTaskList').removeClass('active');
$('#btnTaskRequest').removeClass('active');
} else if (type == 'AllTask') {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').addClass('active');
$('#btnTaskListSent').removeClass('active');
$('#btnTaskListReceived').removeClass('active');
$('#btnTaskList').removeClass('active');
$('#btnTaskRequest').removeClass('active');
} else if (type == 'sent') {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').removeClass('active');
$('#btnTaskListSent').addClass('active');
$('#btnTaskListReceived').removeClass('active');
$('#btnTaskList').removeClass('active');
$('#btnTaskRequest').removeClass('active');
} else if (type == 'received') {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').removeClass('active');
$('#btnTaskListSent').removeClass('active');
$('#btnTaskListReceived').addClass('active');
$('#btnTaskList').removeClass('active');
$('#btnTaskRequest').removeClass('active');
} else if (type == 'list') {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').removeClass('active');
$('#btnTaskListSent').removeClass('active');
$('#btnTaskListReceived').removeClass('active');
$('#btnTaskList').addClass('active');
$('#btnTaskRequest').removeClass('active');
}
let pageIndex = Number($('#pageIndex').val());
var b = pageIndex % 30;
var AccountId = Number($('#AccountId').val());
@@ -112,6 +214,7 @@ function loadMore() {
var index = 1;
var html = '';
console.log(type);
if (b === 0) {
// var searchModel = {};
@@ -134,7 +237,7 @@ function loadMore() {
timeRequestAccepted: TimeRequestAccepted,
isDoneRequest: IsDoneRequest,
isDone: IsDone,
type: ''
type: type
},
headers: { "RequestVerificationToken": `${antiForgeryToken}` },
@@ -149,7 +252,7 @@ function loadMore() {
<div class="Rtable-cell column-heading d-md-block d-none width1">ردیف</div>
<div class="Rtable-cell column-heading d-md-flex d-none width2">
<div class="w-100">ارجاع دهنده</div>
<div class="w-100">وظیفه</div>`;
<div class="w-100">خودم</div>`;
if (response.positions.length > 0) {
response.positions.forEach(function (pos) {
@@ -181,7 +284,7 @@ function loadMore() {
</div>
<div class="Rtable-cell d-md-flex d-none width2">
<div class="Rtable-cell--content w-100 position-relative color-width2"><div class="position-relative text-white">${item.sender.fullname}</div></div>
<div class="Rtable-cell--content w-100 position-relative color-width2"><div class="position-relative text-white">${item.assigner}</div></div>
<div class="Rtable-cell--content w-100 position-relative color-width2"><div class="position-relative text-white">${item.selfName}</div></div>`;
if (response.positions.length > 0) {
response.positions.forEach(function (position) {
@@ -267,14 +370,19 @@ function loadMore() {
if (!item.isDone && !item.isCancel) {
html += `<button class="btn-taskmanager-edit position-relative d-md-block d-none" onclick="EditTask(${item.id})">
html += `
${item.canEdit ?
`<button class="btn-taskmanager-edit position-relative d-md-block d-none" onclick="EditTask(${item.id})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1 d-md-none d-flex">ویرایش</span>
</button>
<button href="" class="btn-taskmanager-delete d-md-block d-none" onclick="removeConfirm(${item.id})">
</button>`: ``
}
${item.canDelete ?
`<button href="" class="btn-taskmanager-delete d-md-block d-none" onclick="removeConfirm(${item.id})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
@@ -282,7 +390,9 @@ function loadMore() {
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1 d-md-none d-flex">حذف</span>
</button>
</button>`: ``
}
<button class="btn-taskmanager-more position-relative">
<span> </span>
<span> </span>
@@ -324,8 +434,10 @@ function loadMore() {
if ((item.assignList.filter((x) => x.posValue == position.value && x.assignViewModels.length > 0)).length > 0) {
var assignlistt = item.assignList.filter((x) => x.posValue == position.value && x.assignViewModels.length > 0)
html += `<div class="Rtable-cell d-md-none d-block width2">
<div class="Rtable-cell--content" > ${assignlistt[0].assignViewModels[0].assignedName}</div>
</div>`;
<div class="Rtable-cell--content" > ${assignlistt[0].assignViewModels[0].assignedName}
<span> - </span>
</div>
</div> `;
}
});
}
@@ -343,8 +455,8 @@ function loadMore() {
</div>
<div class="col-md-12 col-12 text-end p-1">
<div class="d-flex sub-buttons">
<button permission="90110" type="button" class="btn1 loadingButton" onclick="Operation(${item.id}, 'assign')">ارجاع</button>
<button permission=""90111 type="button" class="btn1 loadingButton" onclick="Operation(${item.id}, 'request_time')">مهلت برای روز خاص</button>
${item.canAssign && AssignPermission === `True` ? `<button type="button" class="btn1 loadingButton" onclick="Operation(${item.id}, 'assign')">ارجاع</button>` : ``}
${timeRequestPermission === `True` ? `<button type="button" class="btn1 loadingButton" onclick="Operation(${item.id}, 'request_time')">مهلت برای روز خاص</button>` : ``}
<button permission="90112" type="button" class="btn2 loadingButton" onclick="Operation(${item.id}, 'canceled')">قابل انجام نیست</button>
<button type="button" class="btn3 loadingButton" onclick="Operation(${item.id}, 'completed')">انجام شد</button>
<button permission="90113" type="button" class="btn3 loadingButton d-md-block d-none" onclick="Detail(${item.id})">جزئیات</button>
@@ -352,22 +464,22 @@ function loadMore() {
</div>
<div class="col-md-12 col-12 p-1">
<div class="d-flex justify-content-between">
<button permission="90114" class="btn-taskmanager-edit position-relative w-100 mx-1 d-md-none d-flex justify-content-center" onclick="EditTask(${item.id})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1 d-flex">ویرایش</span>
</button>
<button permission="90115" class="btn-taskmanager-delete w-100 mx-1 d-md-none d-flex justify-content-center" onclick="removeConfirm(${item.id})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1 d-flex">حذف</span>
</button>
${EditPermission === `True` ? `<button class="btn-taskmanager-edit position-relative w-100 mx-1 d-md-none d-flex justify-content-center" onclick="EditTask(${item.id})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1 d-flex">ویرایش</span>
</button>`: ``}
${DeletePermission === `True` ? `<button class="btn-taskmanager-delete w-100 mx-1 d-md-none d-flex justify-content-center" onclick="removeConfirm(${item.id})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1 d-flex">حذف</span>
</button>`: ``}
<button class="btn-taskmanager-detail w-100 mx-1 d-md-none d-flex justify-content-center" onclick="Detail(${item.id})">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="currentColor">
<path d="M3.5 9.9C3.5 9.05992 3.5 8.63988 3.66349 8.31901C3.8073 8.03677 4.03677 7.8073 4.31901 7.66349C4.63988 7.5 5.05992 7.5 5.9 7.5H8.31332C8.74409 7.5 8.95947 7.5 9.14963 7.56559C9.31778 7.62359 9.47094 7.71825 9.59801 7.84272C9.74171 7.98347 9.83803 8.17612 10.0307 8.56142L10.9693 10.439C11.162 10.8243 11.2583 11.0169 11.402 11.1577C11.5291 11.2821 11.6822 11.3768 11.8504 11.4348C12.0405 11.5004 12.2559 11.5004 12.6867 11.5004H18.1C18.9401 11.5004 19.3601 11.5004 19.681 11.6639C19.9632 11.8077 20.1927 12.0372 20.3365 12.3194C20.5 12.6403 20.5 13.0603 20.5 13.9004V18.1004C20.5 18.9405 20.5 19.3605 20.3365 19.6814C20.1927 19.9636 19.9632 20.1931 19.681 20.3369C19.3601 20.5004 18.9401 20.5004 18.1 20.5004H5.9C5.05992 20.5004 4.63988 20.5004 4.31901 20.3369C4.03677 20.1931 3.8073 19.9636 3.66349 19.6814C3.5 19.3605 3.5 18.9405 3.5 18.1004V9.9Z"/>
@@ -410,7 +522,7 @@ function loadRequestCount() {
headers: { "RequestVerificationToken": `${antiForgeryToken}` },
success: function (response) {
$('#badgeRequestCount').text(response.result);
},
error: function (err) {
console.log(err);
@@ -520,7 +632,7 @@ function loadMoreRequest() {
</div>
<div class="Rtable-cell d-md-flex d-none width2">
<div class="Rtable-cell--content w-100 position-relative color-width2"><div class="position-relative text-white">${item.sender.fullname}</div></div>
<div class="Rtable-cell--content w-100 position-relative color-width2"><div class="position-relative text-white">${item.assigner}</div></div>
<div class="Rtable-cell--content w-100 position-relative color-width2"><div class="position-relative text-white">${item.selfName}</div></div>`;
if (response.positions.length > 0) {
response.positions.forEach(function (position) {
@@ -609,7 +721,7 @@ function loadMoreRequest() {
html += `<button permission="90120" class="btn-taskmanager-more position-relative" onclick="OperationRequest(${item.id}, '${operation}')">
html += `${item.canCheckRequests && CheckRequestPermission === `True` ? `<button permission="90120" class="btn-taskmanager-more position-relative" onclick="OperationRequest(${item.id}, '${operation}')">
<span class="mx-1 align-items-center d-flex justify-content-center">
<p class="my-0 mx-1">مشاهده درخواست</p>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="currentColor" style="visibility: hidden;">
@@ -618,7 +730,7 @@ function loadMoreRequest() {
<circle cx="8.4001" cy="12.3992" r="1.2" transform="rotate(90 8.4001 12.3992)"/>
</svg>
</span>
</button>`;
</button>`: ``}`;
html += `</div>
@@ -648,7 +760,14 @@ function loadMoreRequest() {
$(document).ready(function () {
loadMore();
if (userPositionValue == 1) {
loadMore('selfTask');
} else if (userPositionValue > 1 && userPositionValue < LastPositionValue) {
loadMore('sent');
} else if (userPositionValue == LastPositionValue) {
loadMore('list');
}
var filterEmployeeId = $('#AccountId').val();
var filterStart = $('#StartDate').val().trim();
@@ -676,7 +795,19 @@ $(document).ready(function () {
// });
$(window).scroll(function () {
if ($(window).scrollTop() + $(window).height() > $(document).height() - 600) {
loadMore();
if ($('#btnTaskListSelfTask').hasClass('active')) {
loadMore('selfTask');
} else if ($('#btnTaskListAllTask').hasClass('active')) {
loadMore('AllTask');
} else if ($('#btnTaskListSent').hasClass('active')) {
loadMore('sent');
} else if ($('#btnTaskListReceived').hasClass('active')) {
loadMore('received');
} else if ($('#btnTaskList').hasClass('active')) {
loadMore('list');
} else if ($('#btnTaskRequest').hasClass('active')) {
loadMore('request');
}
}
});

View File

@@ -17,7 +17,7 @@ function updateDateInput(daysToAdd) {
$(document).ready(function () {
updateDateInput(0);
//updateDateInput(0);
$(document).on('click', '#today', function () {
updateDateInput(0);
@@ -154,7 +154,6 @@ $(document).ready(function () {
headers: { "RequestVerificationToken": antiForgeryToken },
data: data,
success: function (response) {
console.log(response);
if (response.isSuccedded) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
@@ -907,59 +906,113 @@ function selectItem(employeeFullName) {
searchBox.val(employeeFullName);
container.hide();
};
//search by Ajax
searchBox.on('keyup keypress',
function (e) {
searchResul.html('');
//stop submit form with enter
var keyCode = e.keyCode || e.which;
if (keyCode === 13) {
e.preventDefault();
if (count > 0 && count <= liList.length) {
liPointer.click();
$(document).on('click', '#partyNameSearch', function () {
searchResul.html('');
let searchText = $(this).val();
$.ajax({
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: searchContractingPartiesAjax,
data: { "searchName": searchText },
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
$(".opt").remove();
if (response.list.length > 0) {
$(".noResult").remove();
container.show();
$.each(response.list,
function (i, item) {
let li = `<li data-employeeId="${item.id}" onclick="selectItem('${item.fullName}');" >${item.fullName}</li>`;
searchResul.append(li);
});
} else {
$(".noResult").remove();
container.show();
let noResult = `<li class="noResult">نتیجه ای یافت نشد!</li>`;
searchResul.append(noResult);
}
return false;
}
let searchText = $(this).val();
if (searchText.length > 1) {
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: searchContractingPartiesAjax,
data: { "searchName": searchText },
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
$(".opt").remove();
if (response.list.length > 0) {
$(".noResult").remove();
container.show();
$.each(response.list,
function (i, item) {
let li = `<li data-employeeId="${item.id}" onclick="selectItem('${item.fullName}');" >${item.fullName}</li>`;
searchResul.append(li);
});
} else {
$(".noResult").remove();
container.show();
let noResult = `<li class="noResult">نتیجه ای یافت نشد!</li>`;
searchResul.append(noResult);
}
}// endOfSuccess
}); //endOfAjax
} else {
container.hide();
count = 0;
}
});
});
function searchPartyNameTask() {
var input, filter, tbody, tr, a, i;
input = document.getElementById("partyNameSearch");
filter = input.value.toUpperCase();
tbody = document.getElementById("searchResult");
tr = tbody.getElementsByTagName("li");
for (i = 0; i < tr.length; i++) {
td = tr[i];
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
//search by Ajax
//searchBox.on('keyup keypress',
// function (e) {
// searchResul.html('');
// //stop submit form with enter
// var keyCode = e.keyCode || e.which;
// if (keyCode === 13) {
// e.preventDefault();
// if (count > 0 && count <= liList.length) {
// liPointer.click();
// }
// return false;
// }
// let searchText = $(this).val();
// if (searchText.length > 1) {
// $.ajax({
// async: false,
// contentType: 'charset=utf-8',
// dataType: 'json',
// type: 'GET',
// url: searchContractingPartiesAjax,
// data: { "searchName": searchText },
// headers: { "RequestVerificationToken": antiForgeryToken },
// success: function (response) {
// $(".opt").remove();
// if (response.list.length > 0) {
// $(".noResult").remove();
// container.show();
// $.each(response.list,
// function (i, item) {
// let li = `<li data-employeeId="${item.id}" onclick="selectItem('${item.fullName}');" >${item.fullName}</li>`;
// searchResul.append(li);
// });
// } else {
// $(".noResult").remove();
// container.show();
// let noResult = `<li class="noResult">نتیجه ای یافت نشد!</li>`;
// searchResul.append(noResult);
// }
// }// endOfSuccess
// }); //endOfAjax
// } else {
// container.hide();
// count = 0;
// }
// });
// نمایش اسامی کارگاه
@@ -989,57 +1042,120 @@ function selectItemTitle(subject) {
searchBoxTitle.val(subject);
containerTitle.hide();
};
//search by Ajax
searchBoxTitle.on('keyup keypress',
function (e) {
searchResulTitle.html('');
//stop submit form with enter
var keyCode = e.keyCode || e.which;
if (keyCode === 13) {
e.preventDefault();
if (countTitle > 0 && countTitle <= liListTitle.length) {
liPointerTitle.click();
$(document).on('click', '.TaskTitleSearch', function () {
searchResulTitle.html('');
//stop submit form with enter
//var keyCode = e.keyCode || e.which;
//if (keyCode === 13) {
// e.preventDefault();
// if (countTitle > 0 && countTitle <= liListTitle.length) {
// liPointerTitle.click();
// }
// return false;
//}
let searchTextTitle = $(this).val();
$.ajax({
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: searchTaskSubject,
data: { "searchSubject": searchTextTitle },
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
if (response.list.length > 0) {
containerTitle.show();
$.each(response.list,
function (i, item) {
let li = `<li class="li-subject" onclick="selectItemTitle('${item.subject}');">${item.subject}</li>`;
searchResulTitle.append(li);
});
} else {
containerTitle.hide();
}
return false;
}
let searchTextTitle = $(this).val();
});
});
if (searchTextTitle.length > 1) {
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: searchTaskSubject,
data: { "searchSubject": searchTextTitle },
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
if (response.list.length > 0) {
//$(".noResultTitle").remove();
containerTitle.show();
$.each(response.list,
function (i, item) {
let li = `<li onclick="selectItemTitle('${item.subject}');" >${item.subject}</li>`;
searchResulTitle.append(li);
});
} else {
//$(".noResult").remove();
containerTitle.hide();
//let noResultTitle = `<li class="noResult">نتیجه ای یافت نشد!</li>`;
//searchResulTitle.append(noResultTitle);
}
}// endOfSuccess
}); //endOfAjax
function searchSubjectTask() {
var input, filter, tbody, tr, a, i;
input = document.getElementById("Command_Title");
filter = input.value.toUpperCase();
tbody = document.getElementById("searchTitleResult");
tr = tbody.getElementsByClassName("li-subject");
for (i = 0; i < tr.length; i++) {
td = tr[i];
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
container.hide();
count = 0;
tr[i].style.display = "none";
}
});
}
}
//search by Ajax
//searchBoxTitle.on('keyup keypress',
// function (e) {
// searchResulTitle.html('');
// //stop submit form with enter
// var keyCode = e.keyCode || e.which;
// if (keyCode === 13) {
// e.preventDefault();
// if (countTitle > 0 && countTitle <= liListTitle.length) {
// liPointerTitle.click();
// }
// return false;
// }
// let searchTextTitle = $(this).val();
// if (searchTextTitle.length > 0) {
// $.ajax({
// async: false,
// contentType: 'charset=utf-8',
// dataType: 'json',
// type: 'GET',
// url: searchTaskSubject,
// data: { "searchSubject": searchTextTitle },
// headers: { "RequestVerificationToken": antiForgeryToken },
// success: function (response) {
// if (response.list.length > 0) {
// //$(".noResultTitle").remove();
// containerTitle.show();
// $.each(response.list,
// function (i, item) {
// let li = `<li onclick="selectItemTitle('${item.subject}');" >${item.subject}</li>`;
// searchResulTitle.append(li);
// });
// } else {
// //$(".noResult").remove();
// containerTitle.hide();
// //let noResultTitle = `<li class="noResult">نتیجه ای یافت نشد!</li>`;
// //searchResulTitle.append(noResultTitle);
// }
// }// endOfSuccess
// }); //endOfAjax
// } else {
// container.hide();
// count = 0;
// }
// });
// نمایش عنوان دلبخواه

View File

@@ -0,0 +1,288 @@
#my-scrollbar {
height: auto;
max-height: 200px;
}
.row-table-report, .row-table-report-name {
align-items: center;
height: 36px;
margin: 2px 0;
border-radius: 6px;
}
.row-table-report-name:nth-child(n) {
background-color: #DDF4F4;
}
.row-table-report-name:nth-child(2n+1) {
background-color: #ECFFFF;
}
.row-table-report:nth-child(n), .row-table-report:nth-child(2n+1) {
background-color: #ECFFFF;
}
.errored {
color: #FF3A3A !important;
border: 1px solid #FF3A3A !important
}
.personal-paid-leave-scroll {
height: 330px;
overflow-y: scroll;
scrollbar-width: thin;
}
#printSection {
display: none;
}
@media (max-width: 767px) {
.list-box {
padding: 4px 10px 4px 10px !important;
}
}
.tooltipfull-container {
cursor: pointer;
position: relative;
/* display: inline-block;*/
}
.tooltipfull-r {
opacity: 0;
z-index: 99;
color: #fff;
/* width: 180px;*/
display: block;
font-size: 12px;
font-family: 'IranSans';
padding: 1px;
border-radius: 0px 7px 7px 0px;
text-align: center;
/*text-shadow: 1px 1px 2px #111;*/
background: #114343;
border: 1px solid #114343;
box-shadow: 0 0 3px rgba(0,0,0,0.5);
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
/* -ms-transition: all .2s ease-in-out;*/
transition: all .2s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
position: absolute;
bottom: 20px;
white-space: nowrap;
}
.tooltipfull-r:before, .tooltipfull-r:after {
content: '';
border-left: unset !important;
border-right: 10px solid transparent;
border-top: 10px solid #114343;
position: absolute;
bottom: -10px;
left: -1px;
}
.tooltipfull-container:hover .tooltipfull-r, a:hover .tooltipfull-r {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.tooltipfull-l {
opacity: 0;
z-index: 99;
color: #fff;
/* width: 180px; */
display: block;
font-size: 12px;
font-family: 'IranSans';
padding: 1px;
border-radius: 7px 0px 0px 7px;
text-align: center;
/* text-shadow: 1px 1px 2px #111; */
background: #114343;
border: 1px solid #114343;
box-shadow: 0 0 3px rgba(0,0,0,0.5);
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
/* -ms-transition: all .2s ease-in-out; */
transition: all .2s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
position: absolute;
bottom: 20px;
white-space: nowrap;
}
.tooltipfull-l:before {
content: '';
border-left: 10px solid transparent;
border-right: unset !important;
border-top: 10px solid #114343;
position: absolute;
bottom: -10px;
right: -1px;
}
.tooltipfull-container:hover .tooltipfull-l, a:hover .tooltipfull-l {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.btn-success:hover {
background-color: #114343 !important;
border-color: #114343 !important;
}
@media screen and (max-width: 1920px) {
.month-header {
font-size: 14px;
}
}
@media screen and (max-width: 1440px) {
.month-header {
font-size: 11px;
}
}
.anim {
animation-name: animationProgress;
}
.Rtable-cell--content {
font-size: 10px;
height: 40px;
line-height: 40px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
padding: 0 5px 0 0;
font-weight: 700;
}
@media (min-width: 1400px) {
.modal-content {
height: 630px;
}
}
@media (max-width: 1400px) {
.modal-content {
height: 470px;
}
}
@media (max-width: 991px) {
.modal-content {
height: auto;
}
}
@media (max-width: 992px) {
.modal-header h5, .modal-header h6 {
font-size: 12px;
}
.Rtable {
padding: 0;
}
.month-header, .month-header-num {
font-size: 10px;
}
.Rtable-cell.column-heading {
display: flex;
justify-content: center;
}
.Rtable-cell--content {
text-overflow: clip;
overflow-x: auto;
height: auto;
line-height: 4;
}
.width1 {
}
.tooltipfull {
display: none;
}
}
@media (min-width: 768px) {
.personal-name {
display: block
}
}
@media (max-width: 767px) {
.Rtable--collapse .Rtable-row:first-child {
margin-top: 0;
padding: 0;
border: 0;
}
.Rtable--collapse .Rtable-row:first-child {
margin-top: 0;
padding: 0;
border: 0;
}
.Rtable .Rtable-row .Rtable-cell.column-heading {
border: 0;
padding: 0 margin: 0 0;
}
.personal-name {
display: none;
width: auto !important;
}
}
#divTablescrollbar {
overflow-y: scroll;
max-height: calc(100vh - 200px);
position: relative;
scrollbar-width: thin;
scrollbar-gutter: stable;
}
#stickyModal {
position: -webkit-sticky;
position: sticky;
top: -3px;
z-index: 4;
}

View File

@@ -0,0 +1,427 @@
$(document).ready(function () {
$('.loading').hide();
//******************** چسباندن هدر تیبل به صفحه بالا ********************
// Get the offset position of the sticky element
// var stickyDiv = $(".sticky-div-modal");
// var stickyOffset = stickyDiv.offset().top;
// // Add the sticky class to the element when you reach its scroll position
// $('.modal-body').scroll(function () {
// if ($('modal-body').pageYOffset >= stickyOffset) {
// stickyDiv.addClass("sticky");
// } else {
// stickyDiv.removeClass("sticky");
// }
// });
// var $obj = $('.sticky-div-modal');
// var top = $obj.offset().top - parseFloat($obj.css('marginTop').replace(/auto/, 0));
// $(window).scroll(function (event) {
// // what the y position of the scroll is
// var y = $(this).scrollTop();
// // whether that's below the form
// if (y >= top) {
// // if so, ad the fixed class
// $obj.addClass('fixed');
// } else {
// // otherwise remove it
// $obj.removeClass('fixed');
// }
// });
//******************** چسباندن هدر تیبل به صفحه بالا ********************
const selectedAll = document.querySelectorAll(".wrapper-dropdown-year");
// var ScrollbarDiv = window.Scrollbar;
// ScrollbarDiv.init(document.querySelector('#divTablescrollbar'), {
// alwaysShowTracks: true,
// });
// check if anything else ofther than the dropdown is clicked
window.addEventListener("click", function (e) {
if (e.target.closest(".wrapper-dropdown-year") === null) {
closeAllDropdowns();
}
var Scrollbar = window.Scrollbar;
Scrollbar.init(document.querySelector('#my-scrollbar'), {
alwaysShowTracks: true,
});
});
// close all the dropdowns
function closeAllDropdowns() {
const selectedAll = document.querySelectorAll(".wrapper-dropdown-year");
selectedAll.forEach((selected) => {
const optionsContainer = selected.children[2];
let arrow = selected.children[1];
handleDropdown(selected, arrow, false);
});
}
// open all the dropdowns
function handleDropdown(dropdown, arrow, open) {
if (open) {
arrow.classList.add("rotated");
dropdown.classList.add("active");
} else {
arrow.classList.remove("rotated");
dropdown.classList.remove("active");
}
}
$(document).on("click", '.dropdown-year .item', function () {
$('.dropdown-year .item').removeClass("active");
let dataVal = $(this).attr("value-data-year");
$('#sendDropdownYear').val(dataVal);
let sendDropdownYear = $("#sendDropdownYear").val();
if (sendDropdownYear) {
let itemDropdownYear = $(".dropdown-year").find(".item[value-data-year='" + sendDropdownYear + "']");
itemDropdownYear.addClass("active");
var selectedYearDisplay = $(".wrapper-dropdown-year").find(".selected-display");
selectedYearDisplay.text(itemDropdownYear.text());
}
});
let sendDropdownYear = $("#sendDropdownYear").val();
if (sendDropdownYear) {
let itemDropdownYear = $(".dropdown-year").find(".item[value-data-year='" + sendDropdownYear + "']");
itemDropdownYear.addClass("active");
var selectedYearDisplay = $(".wrapper-dropdown-year").find(".selected-display");
selectedYearDisplay.text(itemDropdownYear.text());
}
$(document).on("click", '.dropdown-year .item', function () {
var yearSelect = $("#sendDropdownYear").val();
var workshopValue = $('#workshopId').val();
var selectChooseYear = $(this).attr("value-data-year");
$('#loadingIndicator').show();
$("#RealodData").hide();
$.ajax({
dataType: 'json',
url: ContractCheckoutYearlyStatusJson,
type: 'GET',
data: { workshopId: workshopValue, year: selectChooseYear },
success: function (response) {
var Html = $("#RealodData").html("");
var index = 1;
var dataSearch = response.finalResult;
if (dataSearch.contractAndCheckoutStatusYearlyList.length > 0) {
var SearchHtml = `
<div class="row" id="stickyModal">
<div class="col-1 p-0">
<div class="Rtable Rtable--5cols Rtable--collapse personal-grid-list">
<div class="Rtable-row Rtable-row--head align-items-center d-flex justify-content-center" style="border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left:1px; outline: 0;">
<div class="Rtable-cell column-heading personal-name text-center" style=" top:0; line-height: 1.4; right: 0;"> <span class="month-header">ردیف</span> <span class="month-header-num">ردیف</span></div>
</div>
</div>
</div>
<div class="col-5 col-md-3 col-lg-2 p-0">
<div class="Rtable Rtable--5cols Rtable--collapse personal-grid-list">
<div class="Rtable-row Rtable-row--head align-items-center d-flex justify-content-center" style="border-radius: 0; margin-left:1px; outline: 0;">
<div class="Rtable-cell column-heading personal-name text-right" style=" top:0; line-height: 1.4; right: 0;"> <span class="month-header">نام پرسنل</span> <span class="month-header-num">پرسنل</span></div>
</div>
</div>
</div>
<div class="col-6 col-md-8 col-lg-9 p-0">
<div class="Rtable Rtable--5cols Rtable--collapse personal-grid-list">
<div class="Rtable-row Rtable-row--head align-items-center d-flex justify-content-center" style="border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right:1px; outline: 0;">
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 0; width: 7.9%;"> <span class="month-header">فروردین</span> <span class="month-header-num">1</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 8.3%; width: 7.9%;"><span class="month-header">اردیبهشت</span> <span class="month-header-num">2</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 16.5%; width: 7.9%;"> <span class="month-header">خرداد</span> <span class="month-header-num">3</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 24.7%; width: 7.9%;"><span class="month-header">تیر</span> <span class="month-header-num">4</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 32.9%; width: 7.9%;"><span class="month-header">مرداد</span> <span class="month-header-num">5</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 41.1%; width: 7.9%;"><span class="month-header">شهریور</span> <span class="month-header-num">6</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 49.3%; width: 7.9%;"><span class="month-header">مهر</span><span class="month-header-num">7</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 57.5%; width: 7.9%;"><span class="month-header">آبان</span> <span class="month-header-num">8</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 65.7%; width: 7.9%;"><span class="month-header">آذر</span> <span class="month-header-num">9</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 73.9%; width: 7.9%;"><span class="month-header">دی</span> <span class="month-header-num">10</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 82.1%; width: 7.9%;"><span class="month-header">بهمن</span> <span class="month-header-num">11</span></div>
<div class="Rtable-cell column-heading text-center" style=" top:0; line-height: 1.4; right: 90.3%; width: 7.9%;"><span class="month-header">اسفند</span> <span class="month-header-num">12</span></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-1 p-0">`;
dataSearch.contractAndCheckoutStatusYearlyList.forEach(function (itemEmployee) {
SearchHtml += `<div class="row-table-report-name position-relative" style="border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left:1px;">
<div class="width1 text-center">
<div class="Rtable-cell--content">${index++}</div>
</div>
</div>`;
});
SearchHtml += `</div>
<div class="col-5 col-md-3 col-lg-2 p-0">`;
dataSearch.contractAndCheckoutStatusYearlyList.forEach(function (itemEmployee) {
SearchHtml += `
<div class="row-table-report-name position-relative" style="border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left:1px">
<div class="width1 text-center">
<div class="tooltipfull-container">
<div class="Rtable-cell--content ellipsed">${itemEmployee.personName}</div>
<span class="tooltipfull">
${itemEmployee.personName}
</span>
</div>
</div>
</div>`;
});
SearchHtml += `</div>`;
SearchHtml += `<div class="col-6 col-md-8 col-lg-9 p-0" style="border-top-right-radius: 0; border-bottom-right-radius: 0;">`;
dataSearch.contractAndCheckoutStatusYearlyList.forEach(function (itemEmployee) {
SearchHtml += `<div class="row-table-report position-relative" style="border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right:1px">`;
// empty gray div or null data
for (let i = 1; i <= 12; i++) {
var percent = i * 8.2;
var minusSpace = percent - 8.2;
minusSpace = minusSpace + 0.2;
var spaceString = minusSpace.toFixed(2);
var space = `right: ${spaceString}%;`;
SearchHtml += `<div style="widthNull margin:0px 2px; top:1px; position: absolute; z-index: 0; height: 18px; width: 7.9%; ${space}"> <div class="is_gray"></div></div>`;
SearchHtml += `<div style="widthNull margin:0px 2px; top:19px; position: absolute; z-index: 0; height: 18px; width: 7.9%; ${space}"> <div class="is_gray"></div></div>`;
}
itemEmployee.contractStatusGroupViewModel.contractStatusDivideList.forEach(function (itemContract) {
if (itemContract.monthStart == itemContract.monthEnd) {
if (itemContract.monthStart == 1) {
SearchHtml += `<div class="width${itemContract.MonthStart} tooltipfull-container wow animated progress-animated animated anim" style="display: inline-block; top:1px; margin:0px 2px; position: absolute; height: 18px; right: 0; width: 7.9%;">
<div class="is_green">`;
if (itemContract.signaturStatus == "1") {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 9C6.98528 9 9 6.98528 9 4.5C9 2.01472 6.98528 0 4.5 0C2.01472 0 0 2.01472 0 4.5C0 6.98528 2.01472 9 4.5 9ZM4.38411 6.32009L6.88411 3.32009L6.11589 2.67991L3.9664 5.25929L2.85355 4.14645L2.14645 4.85355L3.64645 6.35355L4.0336 6.74071L4.38411 6.32009Z" fill="#27FB0F"/>
</svg>`;
} else {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5ZM4.5 5.20711L2.85355 6.85355L2.14645 6.14645L3.79289 4.5L2.14645 2.85355L2.85355 2.14645L4.5 3.79289L6.14645 2.14645L6.85355 2.85355L5.20711 4.5L6.85355 6.14645L6.14645 6.85355L4.5 5.20711Z" fill="#F87171"/>
</svg>`;
}
SearchHtml += `<span class="tooltipfull-r" style="left: 100%; font-size: 14px">${itemContract.contractStart}</span>
<span class="tooltipfull-l" style="${itemContract.monthEnd == 12 ? "right: 1%;" : "right: 100%;"} font-size: 14px">${itemContract.contractEnd}</span>
</div>
</div>`;
} else {
var percent = itemContract.monthStart * 8.2;
var minusSpace = percent - 8.2;
minusSpace = minusSpace;
var spaceString = minusSpace.toFixed(2);
var space = `right: ${spaceString}%;`;
SearchHtml += `<div class="width${itemContract.MonthStart} tooltipfull-container wow animated progress-animated animated anim" style="margin:0px 2px; top:1px; position: absolute; height: 18px; width: 7.9%; ${space}">
<div class="is_green">`;
if (itemContract.signaturStatus == "1") {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 9C6.98528 9 9 6.98528 9 4.5C9 2.01472 6.98528 0 4.5 0C2.01472 0 0 2.01472 0 4.5C0 6.98528 2.01472 9 4.5 9ZM4.38411 6.32009L6.88411 3.32009L6.11589 2.67991L3.9664 5.25929L2.85355 4.14645L2.14645 4.85355L3.64645 6.35355L4.0336 6.74071L4.38411 6.32009Z" fill="#27FB0F"/>
</svg>`;
} else {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5ZM4.5 5.20711L2.85355 6.85355L2.14645 6.14645L3.79289 4.5L2.14645 2.85355L2.85355 2.14645L4.5 3.79289L6.14645 2.14645L6.85355 2.85355L5.20711 4.5L6.85355 6.14645L6.14645 6.85355L4.5 5.20711Z" fill="#F87171"/>
</svg>`;
}
SearchHtml += `<span class="tooltipfull-r" style="left: 100%; font-size: 14px">${itemContract.contractStart}</span>
<span class="tooltipfull-l" style="${itemContract.monthEnd == 12 ? "right: 1%;" : "right: 100%;"} font-size: 14px">${itemContract.contractEnd}</span>
</div>
</div>`;
}
}
else {
if (itemContract.monthStart == 1) {
var percent = itemContract.monthEnd * 8.2;
var widthString = percent.toFixed(2);
var width = `width: ${widthString}%;`;
SearchHtml += `<div class="width${itemContract.MonthStart} tooltipfull-container wow animated progress-animated animated anim" style="display: inline-block; top:1px; margin:0px 2px; position: absolute; height: 18px; right: 0; ${width}">
<div class="is_green">`;
if (itemContract.signaturStatus == "1") {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 9C6.98528 9 9 6.98528 9 4.5C9 2.01472 6.98528 0 4.5 0C2.01472 0 0 2.01472 0 4.5C0 6.98528 2.01472 9 4.5 9ZM4.38411 6.32009L6.88411 3.32009L6.11589 2.67991L3.9664 5.25929L2.85355 4.14645L2.14645 4.85355L3.64645 6.35355L4.0336 6.74071L4.38411 6.32009Z" fill="#27FB0F"/>
</svg>`;
} else {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5ZM4.5 5.20711L2.85355 6.85355L2.14645 6.14645L3.79289 4.5L2.14645 2.85355L2.85355 2.14645L4.5 3.79289L6.14645 2.14645L6.85355 2.85355L5.20711 4.5L6.85355 6.14645L6.14645 6.85355L4.5 5.20711Z" fill="#F87171"/>
</svg>`;
}
SearchHtml += `<span class="tooltipfull-r" style="left: 100%; font-size: 14px">${itemContract.contractStart}</span>
<span class="tooltipfull-l" style="${itemContract.monthEnd == 12 ? "right: 1%;" : "right: 100%;"} font-size: 14px">${itemContract.contractEnd}</span>
</div>
</div>`;
}
else {
var value = (itemContract.monthEnd - itemContract.monthStart) + 1;
var percent = value * 8.2;
var widthString = percent.toFixed(2);
var width = `width: ${widthString}%;`;
var startPercent = (itemContract.monthStart - 1) * 8.2;
startPercent = startPercent - 0.1;
var spaceString = startPercent.toFixed(2);
var space = `right: ${spaceString}%;`;
SearchHtml += `<div class="width${itemContract.MonthStart} tooltipfull-container wow animated progress-animated animated anim" style="display: inline-block; top:1px; margin:0px 2px; position: absolute; height: 18px; ${space} ${width}">
<div class="is_green" style="width:99%;">`;
if (itemContract.signaturStatus == "1") {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 9C6.98528 9 9 6.98528 9 4.5C9 2.01472 6.98528 0 4.5 0C2.01472 0 0 2.01472 0 4.5C0 6.98528 2.01472 9 4.5 9ZM4.38411 6.32009L6.88411 3.32009L6.11589 2.67991L3.9664 5.25929L2.85355 4.14645L2.14645 4.85355L3.64645 6.35355L4.0336 6.74071L4.38411 6.32009Z" fill="#27FB0F"/>
</svg>`;
} else {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5ZM4.5 5.20711L2.85355 6.85355L2.14645 6.14645L3.79289 4.5L2.14645 2.85355L2.85355 2.14645L4.5 3.79289L6.14645 2.14645L6.85355 2.85355L5.20711 4.5L6.85355 6.14645L6.14645 6.85355L4.5 5.20711Z" fill="#F87171"/>
</svg>`;
}
SearchHtml += `<span class="tooltipfull-r" style="left: 100%; font-size: 14px">${itemContract.contractStart}</span>
<span class="tooltipfull-l" style="${itemContract.monthEnd == 12 ? "right: 1%;" : "right: 99%;"} font-size: 14px">${itemContract.contractEnd}</span>
</div>
</div>`;
}
}
})
itemEmployee.contractStatusGroupViewModel.checkoutStatusDivideList.forEach(function (itemCheckout) {
if (itemCheckout.monthStart == itemCheckout.monthEnd) {
if (itemCheckout.monthStart == 1) {
SearchHtml += `<div class="width${itemCheckout.MonthStart} tooltipfull-container wow animated progress-animated animated anim" style="display: inline-block; margin:0px 2px; top:19px ; background-color: transparent; position: absolute; height: 18px; right: 0; width: 7.9%;">
<div class="is_green_500">`;
if (itemCheckout.signaturStatus == "1") {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 9C6.98528 9 9 6.98528 9 4.5C9 2.01472 6.98528 0 4.5 0C2.01472 0 0 2.01472 0 4.5C0 6.98528 2.01472 9 4.5 9ZM4.38411 6.32009L6.88411 3.32009L6.11589 2.67991L3.9664 5.25929L2.85355 4.14645L2.14645 4.85355L3.64645 6.35355L4.0336 6.74071L4.38411 6.32009Z" fill="#27FB0F"/>
</svg>`;
} else {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5ZM4.5 5.20711L2.85355 6.85355L2.14645 6.14645L3.79289 4.5L2.14645 2.85355L2.85355 2.14645L4.5 3.79289L6.14645 2.14645L6.85355 2.85355L5.20711 4.5L6.85355 6.14645L6.14645 6.85355L4.5 5.20711Z" fill="#F87171"/>
</svg>`;
}
SearchHtml += `<span class="tooltipfull-r" style="left: 100%; font-size: 14px">${itemCheckout.checkoutStart}</span>
<span class="tooltipfull-l" style="${itemCheckout.monthEnd == 12 ? "right: 1%;" : "right: 100%;"} font-size: 14px">${itemCheckout.checkoutEnd}</span>
</span>
</div>
</div>`;
}
else {
var percent = itemCheckout.monthStart * 8.2;
var minusSpace = percent - 8.2;
var spaceString = minusSpace.toFixed(2);
var space = `right: ${spaceString}%;`;
SearchHtml += `<div class="width${itemCheckout.MonthStart} tooltipfull-container wow animated progress-animated animated anim" style="display: inline-block; margin:0px 2px; top:19px ; background-color: transparent; position: absolute; height: 18px; width: 7.9%; ${space}">
<div class="is_green_500">`;
if (itemCheckout.signaturStatus == "1") {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 9C6.98528 9 9 6.98528 9 4.5C9 2.01472 6.98528 0 4.5 0C2.01472 0 0 2.01472 0 4.5C0 6.98528 2.01472 9 4.5 9ZM4.38411 6.32009L6.88411 3.32009L6.11589 2.67991L3.9664 5.25929L2.85355 4.14645L2.14645 4.85355L3.64645 6.35355L4.0336 6.74071L4.38411 6.32009Z" fill="#27FB0F"/>
</svg>`;
} else {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5ZM4.5 5.20711L2.85355 6.85355L2.14645 6.14645L3.79289 4.5L2.14645 2.85355L2.85355 2.14645L4.5 3.79289L6.14645 2.14645L6.85355 2.85355L5.20711 4.5L6.85355 6.14645L6.14645 6.85355L4.5 5.20711Z" fill="#F87171"/>
</svg>`;
}
SearchHtml += `<span class="tooltipfull-r" style="left: 100%; font-size: 14px">${itemCheckout.checkoutStart}</span>
<span class="tooltipfull-l" style="${itemCheckout.monthEnd == 12 ? "right: 1%;" : "right: 100%;"} font-size: 14px">${itemCheckout.checkoutEnd}</span>
</div>
</div>`;
}
}
else {
if (itemCheckout.monthStart == 1) {
var percent = itemCheckout.monthEnd * 8.2;
var widthString = percent.toFixed(2);
var width = `width: ${widthString}%;`;
SearchHtml += `<div class="width${itemCheckout.MonthStart} tooltipfull-container wow animated progress-animated animated anim" style="display: inline-block; margin:0px 2px; top:19px ; background-color: transparent; position: absolute; height: 18px; right: 0; ${width}">
<div class="is_green_500">`;
if (itemCheckout.signaturStatus == "1") {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 9C6.98528 9 9 6.98528 9 4.5C9 2.01472 6.98528 0 4.5 0C2.01472 0 0 2.01472 0 4.5C0 6.98528 2.01472 9 4.5 9ZM4.38411 6.32009L6.88411 3.32009L6.11589 2.67991L3.9664 5.25929L2.85355 4.14645L2.14645 4.85355L3.64645 6.35355L4.0336 6.74071L4.38411 6.32009Z" fill="#27FB0F"/>
</svg>`;
} else {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5ZM4.5 5.20711L2.85355 6.85355L2.14645 6.14645L3.79289 4.5L2.14645 2.85355L2.85355 2.14645L4.5 3.79289L6.14645 2.14645L6.85355 2.85355L5.20711 4.5L6.85355 6.14645L6.14645 6.85355L4.5 5.20711Z" fill="#F87171"/>
</svg>`;
}
SearchHtml += `<span class="tooltipfull-r" style="left: 100%; font-size: 14px">${itemCheckout.checkoutStart}</span>
<span class="tooltipfull-l" style="${itemCheckout.monthEnd == 12 ? "right: 1%;" : "right: 100%;"} font-size: 14px">${itemCheckout.checkoutEnd}</span>
</div>
</div>`;
}
else {
var value = itemCheckout.monthEnd - itemCheckout.monthStart;
var percent = value * 8.2;
var widthString = percent.toFixed(2);
var width = `width: ${widthString}%;`;
var startPercent = (itemCheckout.monthStart - 1) * 8.2;
startPercent = startPercent + 0.1;
var spaceString = startPercent.toFixed(2);
var space = `right: ${spaceString}%;`;
SearchHtml += `<div class="width${itemCheckout.MonthStart} tooltipfull-container wow animated progress-animated animated anim" style="display: inline-block; margin:0px 2px; top:19px ; background-color: transparent; position: absolute; height: 18px; ${space} ${width}">
<div class="is_green_500">`;
if (itemCheckout.signaturStatus == "1") {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 9C6.98528 9 9 6.98528 9 4.5C9 2.01472 6.98528 0 4.5 0C2.01472 0 0 2.01472 0 4.5C0 6.98528 2.01472 9 4.5 9ZM4.38411 6.32009L6.88411 3.32009L6.11589 2.67991L3.9664 5.25929L2.85355 4.14645L2.14645 4.85355L3.64645 6.35355L4.0336 6.74071L4.38411 6.32009Z" fill="#27FB0F"/>
</svg>`;
} else {
SearchHtml += `<svg width="12" height="12" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5ZM4.5 5.20711L2.85355 6.85355L2.14645 6.14645L3.79289 4.5L2.14645 2.85355L2.85355 2.14645L4.5 3.79289L6.14645 2.14645L6.85355 2.85355L5.20711 4.5L6.85355 6.14645L6.14645 6.85355L4.5 5.20711Z" fill="#F87171"/>
</svg>`;
}
SearchHtml += `<span class="tooltipfull-r" style="left: 100%; font-size: 14px">${itemCheckout.checkoutStart}</span>
<span class="tooltipfull-l" style="${itemCheckout.monthEnd == 12 ? "right: 1%;" : "right: 99%;"} font-size: 14px">${itemCheckout.checkoutEnd}</span>
</div>
</div>`;
}
}
})
SearchHtml += `</div>`;
})
SearchHtml += `</div></div>`;
$('#RealodData').append(SearchHtml);
} else {
var NotDataHtml = `
<div class="row">
<div class="alert alert-danger" style="font-size: 14px; border-radius: 15px;"> <span>${dataSearch.workshopName}</span> هیچ قراردادی ندارد</div>
</div>
`;
$('#RealodData').append(NotDataHtml)
}
$('#loadingIndicator').hide();
$("#RealodData").show();
closeAllDropdowns();
},
failure: function (error) {
console.log(error);
}
});
});
});

View File

@@ -0,0 +1,111 @@
// $(".openAction").click(function () {
// $(this).next().find(".operations-btns").slideToggle(500);
// $(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500);
// });
// $(document).ready(function () {
// $(this).find(".operations-btns").first().slideToggle(500);
// })
$(document).ready(function () {
var filterEmployeeFullName = $('#EmployeeFullName').val();
var filterNationalCode = $('#NationalCode').val();
if (filterEmployeeFullName != '' || filterNationalCode != '') {
$('.btn-clear-filter').removeClass('disable');
} else {
$('.btn-clear-filter').addClass('disable');
}
});
$(document).ready(function () {
$('.loadingButton').on('click', function () {
var button = $(this);
var loadingDiv = button.find('.loading');
loadingDiv.show();
});
});
// var HasEmployees = $('#hasEmployee').val();
// if (HasEmployees) {
// var hasCompletedEmployeesTour = localStorage.getItem('hasCompletedEmployeesTour');
// if (!hasCompletedEmployeesTour) {
// //$('#btnMoreOpenIntro').click();
// introJs().setOptions({
// nextLabel: 'بعد',
// prevLabel: 'قبل',
// doneLabel: 'اتمام',
// showBullets: false,
// steps: [
// {
// element: document.querySelector('#EmployeesListIntro'),
// intro: 'جهت مشاهده لیست اطلاعات هر پرسنل بر روی این گزینه یا گزینه عملیات بیشتر کلیک نمائید.'
// },
// {
// title: 'عملیات مربوط به مرخصی',
// element: document.querySelector('#btnCardLeaveIntro'),
// intro: 'برای عملیات مربوط به مرخصی مانند ثبت مرخصی و لیست مرخصی میتوانید از این دکمه استفاده نمایید.'
// },
// {
// title: 'گزارش وضعیت',
// element: document.querySelector('#btnCardStatusIntro'),
// intro: 'گزارش وضعیت قرارداد و تصفیه حساب یک پرسنل در سال را نمایش میدهد.'
// },
// {
// title: 'عملیات پرداخت حقوق پرسنل',
// element: document.querySelector('#btnCardPaymentToEmployeeIntro'),
// intro: 'به زودی در درسترس خواهد آمد.'
// }
// ]
// }).start();
// localStorage.setItem('hasCompletedEmployeesTour', true);
// }
// }
function printAllPersonnelInfo(workshopId) {
var idlist = "";
$('.idPersonnel').each(function () {
if ($(this).text()) {
var a = $(this).text();
var b = a + "+";
idlist += b;
}
});
console.log(idlist);
var workshop_ID = Number(workshopId);
var goTo = `#showmodal=/Client/Company/Employees/Index?workshopID=${workshop_ID}&idlist=${idlist}&handler=PrintAllDetailsPersonnelInfo`;
window.location.href = goTo;
}
function printAllPersonnelInfoMobile(workshopId) {
var idlist = "";
$('.idPersonnel').each(function () {
if ($(this).text()) {
var a = $(this).text();
var b = a + "+";
idlist += b;
}
});
console.log(idlist);
var workshop_ID = Number(workshopId);
var goTo = `#showmodal=/Client/Company/Employees/Index?workshopID=${workshop_ID}&idlist=${idlist}&handler=PrintAllDetailsPersonnelInfoMobile`;
window.location.href = goTo;
}
function printAllPersonnelList() {
var idlist = "";
if (window.matchMedia('(min-width: 992px)').matches) {
var goTo = `#showmodal=/Client/Company/Employees/Index?idlist=${idlist}&handler=PrintAllPersonnelInfo`;
window.location.href = goTo;
} else {
var goTo = `#showmodal=/Client/Company/Employees/Index?idlist=${idlist}&handler=PrintAllPersonnelInfoMobile`;
window.location.href = goTo;
}
}

View File

@@ -1654,6 +1654,14 @@
grid-template-columns: repeat(1, minmax(0, 1fr));
}
/************************* End Select Workshop from Employee *************************/
.sweet-alert h2 {
font-size: 18px !important;
}
.sweet-alert button {
font-size: 13px !important;
}
}
/*

View File

@@ -0,0 +1,296 @@
.Rtable .Rtable-row .Rtable-cell {
padding: 6px;
}
.Rtable .Rtable-row {
padding: 0;
}
.Rtable .Rtable-row .Rtable-cell .Rtable-cell--content > .table-number {
border-radius: 5px;
background: rgba(87, 227, 227, 0.25);
width: 30px;
height: 30px;
padding: 0;
}
.Rtable .Rtable-row .Rtable-cell .Rtable-cell--content {
font-size: 12px;
color: #0B5959;
white-space: nowrap;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
}
.table-rollcall .width1 {
width: 5% !important;
}
.table-rollcall .width2 {
width: 10% !important;
}
.table-rollcall .width3 {
width: 30% !important;
}
.table-rollcall .width4 {
width: 15% !important;
}
.table-rollcall .width5 {
width: 15% !important;
}
.Rtable .Rtable-row .Rtable-cell.width3 {
text-align: center;
}
.Rtable .Rtable-row .Rtable-cell.width1 .Rtable-cell--content,
.Rtable .Rtable-row .Rtable-cell.width2 .Rtable-cell--content {
font-size: 12px;
color: #0B5959;
white-space: nowrap;
height: 30px;
display: flex;
align-items: center;
justify-content: right;
}
.table-rollcall .column-heading.width4:before,
.table-rollcall .column-heading.width5:before {
content: "";
position: relative;
}
/*.table-rollcall .Rtable-cell.width4:nth-child(n+1):before {
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
}
.table-rollcall .Rtable-cell.width5:nth-child(n+1):before {
border-top-left-radius: 15px;
border-bottom-left-radius: 15px;
}*/
.table-rollcall .width4:before {
content: "";
position: absolute;
top: 0;
left: 0%;
width: 90%;
height: 100%;
background-color: #aeeaeab8
}
.table-rollcall .width5:before {
content: "";
position: absolute;
top: 0;
right: 0%;
width: 90%;
height: 100%;
background-color: #aeeaeab8
}
.Rtable .Rtable-row:nth-child(even), .table-workshop .Rtable .Rtable-row:nth-child(4n+2), .table-personals .Rtable .Rtable-row:nth-child(4n+2) {
background-color: #ddf4f4;
border: 1px solid #eee;
}
.table-rollcall .Rtable .Rtable-row .Rtable-cell .Rtable-cell--content > span {
color: #0B5959;
}
.table-rollcall .Rtable .Rtable-row.no-avatar .Rtable-cell .Rtable-cell--content > span {
color: #ffffff;
background: rgba(255, 0, 0, 0.5);
}
.table-rollcall .Rtable .Rtable-row.deactive .Rtable-cell .Rtable-cell--content > span {
color: #ffffff;
background: rgba(47, 47, 47, 0.5);
}
.table-rollcall .Rtable-row.no-avatar .width4 .Rtable-cell--content{
color: #C30707 !important;
}
.table-rollcall .Rtable-row.no-avatar .btn-upload {
background-color: #F1F2B6;
color: #727407;
}
.table-rollcall .Rtable-row.no-avatar .btn-upload:hover {
background-color: #dedfa8;
}
.table-rollcall .Rtable-row.no-avatar .img-avatar {
border: 2px solid #EA6C6C;
}
.table-rollcall .Rtable-row.deactive .img-avatar {
border: 2px solid #7C8187;
}
.table-rollcall-mobile .Rtable-cell--content:first-child span{
border-radius: 5px;
background: rgba(87, 227, 227, 0.25);
width: 40px;
height: 40px;
display: inline-block;
padding: 6px;
}
.btn-upload-mobile {
background-color: #009EE2;
color: #FFFFFF;
border-radius: 5px;
padding: 9px 8px;
font-weight: 500;
font-size: 10px;
transition: all ease .3s;
}
.btn-upload-mobile:hover {
background-color: #0188c2;
}
.table-rollcall .Rtable-row.no-avatar .table-rollcall-mobile .Rtable-cell--content:first-child span{
color: #ffffff;
background: rgba(255, 0, 0, 0.5);
}
.table-rollcall .Rtable-row.no-avatar .btn-upload-mobile {
background-color: #F1F2B6;
color: #727407;
}
.table-rollcall .Rtable-row.no-avatar .btn-upload-mobile:hover {
background-color: #d2d39f;
}
.table-rollcall .Rtable-row.no-avatar .table-rollcall-mobile .content-mobile{
color: #C30707 !important;
}
.elay {
color: #797979;
font-size: 12px;
}
@media (max-width: 767px) {
.Rtable--collapse .Rtable-row {
outline: 1.8px solid #D6D6D6;
padding: 8px;
}
.title-mobile {
font-weight: 600;
font-size: 13px;
color: #0B5959;
}
.content-mobile {
font-weight: 400;
font-size: 11px;
color: #0B5959;
}
.Rtable--collapse .Rtable-row {
padding: 0;
}
.Rtable .Rtable-row .Rtable-cell {
/*flex-grow: unset;*/
}
.Rtable .Rtable-row .Rtable-cell.width2 {
margin: 0 5px;
}
.Rtable .Rtable-row .Rtable-cell {
font-size: 11px;
}
.table-rollcall .width1 {
width: 3% !important;
}
.table-rollcall .width2 {
width: 40% !important;
overflow: hidden
}
.Rtable .Rtable-row .Rtable-cell.width2 .Rtable-cell--content {
font-size: 11px;
color: #0B5959;
white-space: nowrap;
}
.table-rollcall .width3 {
width: 15% !important;
}
.Rtable .Rtable-row .Rtable-cell.width3 {
justify-content: center;
}
.Rtable .Rtable-row .Rtable-cell.width3 .Rtable-cell--content {
justify-content: center;
font-size: 10px;
color: #0B5959;
}
.table-rollcall .width6 {
width: 15% !important;
text-align: end !important;
}
.btn-taskmanager-more {
background: #B6F2E1;
border: 0.2px solid #0596691c;
border-radius: 6px;
position: relative;
overflow: hidden;
color: #059669;
text-align: center;
font-size: 11px;
padding: 6px;
font-style: normal;
font-weight: 400;
line-height: normal;
white-space: nowrap;
width: 70px;
}
.v-line {
height: 100%;
width: 1px;
border-right: 1px dashed #CACACA;
}
.rollcall-list-mobile .Rtable-cell--heading {
color: #0B5959;
font-size: 13px;
font-weight: 600;
margin: 2px auto 10px;
}
.rollcall-list-mobile .Rtable-cell--content {
color: #0B5959;
font-size: 12px;
font-weight: 500;
margin: 2px auto;
}
}

View File

@@ -3545,3 +3545,6 @@ button.btn-employee-payment {
background-color: #64748b;
}
/************************* End Button *************************/
.sweet-alert h2 {
font-size: 22px !important;
}

View File

@@ -187,11 +187,89 @@
.btnPosition {
outline: 1px solid #138989;
cursor: pointer;
}
.active {
outline: 1px solid transparent;
}
.btn-add {
background-color: #84CC16;
color: #ffffff;
padding: 3px 4px;
font-size: 12px;
font-weight: 500;
border-radius: 5px;
margin: 0 4px;
}
.btn-add:hover {
background-color: #629b0c;
}
.btn-register {
font-size: 14px;
font-weight: 500;
background-color: #84CC16;
color: #FFFFFF;
border-radius: 8px;
padding: 10px 70px;
}
.btn-register:hover {
background-color: #5f9213;
}
.btn-cancel2 {
font-size: 14px;
font-weight: 500;
background-color: #1F2937;
color: #FFFFFF;
border-radius: 8px;
padding: 10px 70px;
}
.btn-cancel2:hover {
background-color: #121820;
}
.items {
border: 1px solid #D9D9D9;
padding: 5px;
border-radius: 8px;
margin: 4px 0;
cursor: pointer;
transition: all ease-in-out .3s;
}
.items:hover {
border: 1px solid #148989;
}
.items.checked-item {
border: 1px solid #148989;
}
.form-control {
color: #797979;
border: 1px solid #DADADA;
border-radius: 7px;
background-color: #F6F6F6;
font-size: 13px;
font-weight: 500;
padding: 0.260rem .75rem;
}
.searchItem {
font-size: 16px;
font-weight: 500;
color: #535353;
}
/* Start Uploading Box */
@@ -245,13 +323,28 @@
font-weight: 500;
}
.upload-box-voice-exist {
position: relative;
/*width: 100%;*/
width: 264px;
height: 36px;
border-radius: 7px;
border: 2px dashed #29B4B4;
display: flex;
justify-content: space-around;
align-items: center;
margin: 5px;
font-size: 12px !important;
font-weight: 500;
}
.upload-box img, .upload-box-voice audio {
max-width: 100%;
max-height: 100%;
}
.upload-box .delete-btn,
.upload-box-voice .delete-btn {
.upload-box-voice-exist .delete-btn {
position: absolute;
top: -10px;
right: -10px;
@@ -433,9 +526,84 @@
/* End Searching Result Box */
/* Start Searching Result Box 2 */
.selectTitleDiv {
position: absolute;
z-index: 2;
border-radius: 10px;
min-height: 20px;
max-height: 190px;
overflow: hidden scroll;
width: 100%;
background-color: rgb(244 244 244);
display: block;
border: 1px solid #DADADA;
}
.selectTitleDiv ul {
list-style-type: none;
padding: 0 5px;
margin: 5px 0;
}
.selectTitleDiv ul li {
display: block;
text-align: right;
color: #797979;
font-size: 12px;
font-weight: 500;
padding: 4px 3px;
transition: all ease-in-out .3s;
cursor: pointer;
width: 100%;
border-radius: 6px;
}
.selectTitleDiv ul li:hover {
background-color: #41e3e3;
color: #ffffff;
}
.noResultTitle:hover {
background-color: transparent !important;
color: #797979 !important;
}
/* End Searching Result Box 2 */
.btn-edit-subject {
border: 1px solid transparent;
width: 30px;
height: 30px;
border-radius: 5px;
padding: 3px 1px;
color: #009EE2;
margin: auto 4px auto 1px;
background-color: rgba(52, 209, 209, 0.20);
box-shadow: 0;
transition: ease .2s;
}
.btn-edit-subject:hover {
background-color: rgba(52, 209, 209, 0.40);
}
.btn-remove-subject {
border: 1px solid transparent;
width: 30px;
height: 30px;
border-radius: 5px;
padding: 3px 1px;
color: #FF5151;
margin: auto 4px auto 1px;
background: rgba(209, 50, 50, 0.15);
transition: ease .2s;
}
.btn-remove-subject:hover {
background-color: rgba(209, 50, 50, 0.25);
}
@media (max-width: 1366px) {
.tm-rad + .btn, :not(.tm-rad) + .btn:active, .btn:first-child:active, .btn.active, .btn.show {
@@ -474,4 +642,8 @@
.upload-box-voice {
width: 100%;
}
#upload-container-voice {
width: 100% !important;
}
}

View File

@@ -38,6 +38,25 @@
color: #ffffff !important;
}
.tm-brown {
background-color: #3b3b3b63 !important;
outline: 1px solid #E3E3E3 !important;
}
.tm-brown .tooltipfull-container {
color: #ffffff;
}
.tm-brown .span-number {
background-color: rgb(24 43 43 / 25%) !important;
}
.tm-brown .Rtable-cell--heading,
.tm-brown .Rtable-cell--content {
color: #ffffff !important;
}
.tm-dark {
background-color: #707070 !important;
outline: 1px solid #E3E3E3!important;
@@ -289,7 +308,8 @@
width: 115px;
}
.tm-green .btn-taskmanager-more {
.tm-green .btn-taskmanager-more,
.tm-brown .btn-taskmanager-more {
background: rgb(53 59 3 / 50%);
border: 0.5px solid #535353;
border-radius: 6px;
@@ -610,39 +630,107 @@
height: 110px
}
.btn-change-date {
border: 1px solid transparent;
width: 60px;
height: 30px;
border-radius: 5px;
padding: 3px 1px;
color: #ffffff;
margin: auto 4px auto 1px;
background-color: #84CC16;
box-shadow: 0;
font-size: 13px;
transition: ease .2s;
}
.btn-change-date:hover {
background-color: #629b0c;
}
.btn-accept {
border: 1px solid transparent;
width: 30px;
height: 30px;
border-radius: 5px;
padding: 3px 1px;
color: $ffffff;
margin: auto 4px auto 1px;
background-color: rgba(52, 209, 209, 0.20);
box-shadow: 0;
transition: ease .2s;
}
.btn-accept:hover {
background-color: rgba(52, 209, 209, 0.40);
}
.btn-reject {
border: 1px solid transparent;
width: 30px;
height: 30px;
border-radius: 5px;
padding: 3px 1px;
color: $ffffff;
margin: auto 4px auto 1px;
background: rgba(209, 50, 50, 0.15);
transition: ease .2s;
}
.btn-reject:hover {
background-color: rgba(209, 50, 50, 0.25);
}
.label-time-request {
white-space: nowrap;
font-size: 12px;
}
@media(max-width: 1366px) {
.btn-register, .btn-cancel2 {
font-size: 12px;
padding: 10px 50px;
}
.table-task-manager .Rtable .Rtable-row * {
font-size: 12px;
}
.table-task-manager .Rtable .Rtable-row .width1 {
width: 5%;
}
.table-task-manager .Rtable .Rtable-row .width2 {
/* width: 60% / 5 */
width: 10%;
width: 30%;
}
.table-task-manager .Rtable .Rtable-row .width3 {
width: 10%;
text-align: center !important;
}
.table-task-manager .Rtable .Rtable-row .width4 {
width: 25%;
width: 12%;
}
.table-task-manager .Rtable .Rtable-row .width5 {
width: 24%;
width: 12%;
}
.table-task-manager .Rtable .Rtable-row .width6 {
width: 5%;
}
text-align: left;
}
.table-task-manager .Rtable .Rtable-row .width6 .Rtable-cell--content {
text-align: left !important;
}
.table-task-manager .Rtable .Rtable-row .width7 {
width: 20%;
width: 18%;
}
}
@@ -695,10 +783,6 @@
justify-content: space-between;
}
.width8 {
width: 60% !important;
}
.Rtable--collapse .Rtable-row .Rtable-cell .Rtable-cell--content {
font-size: 10px;
}
@@ -707,8 +791,11 @@
text-align: start;
}
.width9 {
width: 20% !important;
.table-task-manager .Rtable .Rtable-row .width1 {
width: 10% !important;
}
.table-task-manager .Rtable .Rtable-row .width5 {
width: 50% !important;
}
.operation-div .operations-btns .btn1,

View File

@@ -1,26 +1,30 @@
.group-task-section {
display: grid;
/* display: grid;
grid-template-columns: repeat(12, minmax(0, 1fr));
gap: 10px;
gap: 10px;*/
}
.group-task-section .card-group {
/*grid-column: span 4 / span 5;*/
grid-column: span 4 / span 4;
row-gap: 10px;
/* grid-column: span 4 / span 4;
row-gap: 10px;*/
}
.group-task-section .card-group1 {
grid-column: span 8 / span 8;
row-gap: 10px;
/*grid-column: span 8 / span 8;
row-gap: 10px;*/
}
.group-task-section .card-group .row-index {
#loadAccountItems {
height: 710px;
}
.row-index {
background: #A7EAEA;
color: #716969;
width: 40px;
height: 40px;
width: 36px;
height: 36px;
border-radius: 5px;
display: flex;
align-items: center;
@@ -28,6 +32,14 @@
font-size: 20px;
}
.title-group {
font-size: 15px;
font-weight: 600;
margin: 0;
color: #353232;
}
.group-task-section .card-group .title {
width: 120px;
}
@@ -50,12 +62,12 @@
}
.btnPosition {
outline: 1px solid #138989;
outline: 1px solid #93e9e9;
cursor: pointer;
}
.active {
outline: 1px solid transparent;
outline: 1px solid #138989;
}
.btn-add {
@@ -144,15 +156,65 @@
}
@media(max-width: 1366px) {
.btn-register, .btn-cancel2, .btn-add {
#loadAccountItems {
height: 410px;
}
.row-index {
width: 30px;
height: 30px;
font-size: 17px;
}
.btn-register, .btn-cancel2 {
font-size: 12px;
padding: 10px 50px;
padding: 10px 30px;
}
.btn-add {
padding: 6px 12px;
font-size: 10px;
}
.title-group {
font-size: 13px;
}
.title-group h4 {
font-size: 18px;
}
}
@media (max-width:770px) {
@media (max-width:768px) {
.Rtable .Rtable-row {
margin: 10px 0px 0;
}
.Rtable .Rtable-row .Rtable-cell.column-heading {
margin: 0;
}
.Rtable .Rtable-row .Rtable-cell {
width: auto;
}
.Rtable--collapse .Rtable-row {
outline: none;
}
.btn-register, .btn-cancel2 {
padding: auto;
width: 100%;
}
.btn-register, .btn-cancel2 {
font-size: 12px;
padding: 10px 30px;
}
#loadAccountItems {
height: auto;
}
.btn-add {
padding: 6px 7px;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long