merge Task schedule with customize checkout header

This commit is contained in:
MahanCh
2025-04-08 17:04:47 +03:30
37 changed files with 5980 additions and 532 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using IPE.SmsIrClient.Models.Results;
using Microsoft.AspNetCore.Http;
namespace AccountManagement.Application.Contracts.Task;
@@ -19,9 +20,9 @@ public class CreateTask
#region Task Schedule
public string ScheduleCount { get; set; }
public string ScheduleType{ get; set; }
public TaskScheduleType ScheduleType { get; set; }
public bool HasSchedule { get; set; }
public string ScheduleUnitType { get; set; }
public TaskScheduleUnitType ScheduleUnitType { get; set; }
public string ScheduleUnitNumber { get; set; }
public long TaskScheduleId { get; set; }
@@ -30,4 +31,18 @@ public class CreateTask
}
public enum TaskScheduleType
{
Limited,
Unlimited
}
public enum TaskScheduleUnitType
{
Day,
Week,
Month,
Year
}

View File

@@ -20,4 +20,5 @@ public class EditTask:CreateTask
public long? TicketId { get; set; }
public List<AccountViewModel> AssignsLists { get; set; }
public bool HasTicket { get; set; }
public long TaskScheduleId { get; set; }
}

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Assign;
using AccountManagement.Application.Contracts.TaskMessage;
@@ -24,6 +25,13 @@ public interface ITaskApplication
List<TaskViewModel> GetSentTasks(TaskSearchModel searchModel);
List<TaskViewModel> GetTasksHaveTicket(TaskSearchModel searchModel);
/// <summary>
/// لیست تسک های دوره ای ایجاد شده توسط کاربر
/// </summary>
/// <param name="searchModel"></param>
/// <returns></returns>
List<TaskViewModel> GetTaskScheduleList(TaskSearchModel searchModel);
// گرفتن مهلت برای یک وظیفه
OperationResult CreateRequestTime(CreateTaskTimeRequest command);
List<TaskViewModel> GetRequestTaskHasTicket(TaskSearchModel searchModel);
@@ -46,10 +54,10 @@ public interface ITaskApplication
OperationResult CreateTaskByPosition(CreateTask command, List<long> positionIds);
List<TaskViewModel> GetRequestedTasks(TaskSearchModel searchModel);
List<TaskViewModel> AllRequestedTasks(TaskSearchModel searchModel);
int GetRequestedTasksCount();
Task<int> GetRequestedTasksCount();
int TasksHaveTicketCounts(long userId);
int TasksHaveTicketRequestsCount(long userId);
Task<int> TasksHaveTicketCounts(long userId);
Task<int> TasksHaveTicketRequestsCount(long userId);
List<TaskMessageViewModel> GetTaskMessages(long assignId);
@@ -63,16 +71,14 @@ public interface ITaskApplication
List<AssignViewModel> GetAssignsByTaskId(long taskId);
int RequestedAndOverdueTasksCount(long userId);
Task<int> RequestedAndOverdueTasksCount(long userId);
/// <summary>
///تعداد تسک های شخصی و دریافتی برای امروز و یا عقب افتاده
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
int OverdueTasksCount(long userId);
/// <summary>
/// تعداد تسک های شخصی و دریافتی برای امروز و یا عقب افتاده
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
Task<int> OverdueTasksCount(long userId);
//متد انتقال داده از تسک به ارجاعی ها
//OperationResult MoveDataFRomTaskToAssign();
}
}

View File

@@ -50,5 +50,7 @@ public class TaskViewModel
public bool CanCheckRequests { get; set; }
public AssignViewModel AssignedReceiverViewModel { get; set; }
public TaskScheduleType ScheduleType { get; set; }
public TaskScheduleUnitType ScheduleUnitType { get; set; }
public long TaskScheduleId { get; set; }
}

View File

@@ -1,4 +1,6 @@
using _0_Framework.Application;
using System;
using System.Threading.Tasks;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Task;
namespace AccountManagement.Application.Contracts.TaskSchedule;
@@ -6,7 +8,8 @@ namespace AccountManagement.Application.Contracts.TaskSchedule;
public interface ITaskScheduleApplication
{
OperationResult Create(CreateTask command);
OperationResult CreateLimitedTasks(CreateTask command);
OperationResult CreateUnlimitedTasks(CreateTask command);
Task<TaskScheduleDetailsViewModel> GetDetails(long id);
OperationResult Remove(long taskScheduleId);
}

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
using AccountManagement.Application.Contracts.Media;
using AccountManagement.Application.Contracts.Task;
namespace AccountManagement.Application.Contracts.TaskSchedule;
public class TaskScheduleDetailsViewModel
{
public string SenderName { get; set; }
public List<string> AssignedName { get; set; }
public TaskScheduleType TaskScheduleType { get; set; }
public TaskScheduleUnitType TaskScheduleUnitType { get; set; }
public string UnitNumber { get; set; }
public string CreationDateFa { get; set; }
public string ContractingPartyName { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public List<MediaViewModel> Medias { get; set; }
}

View File

@@ -16,6 +16,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace AccountManagement.Application;
@@ -508,6 +509,11 @@ public class TaskApplication : ITaskApplication
return _taskRepository.GetTasksHaveTicket(searchModel);
}
public List<TaskViewModel> GetTaskScheduleList(TaskSearchModel searchModel)
{
return _taskRepository.GetTaskScheduleList(searchModel);
}
//ساخت درخواست مهلت
public OperationResult CreateRequestTime(CreateTaskTimeRequest command)
{
@@ -589,6 +595,9 @@ public class TaskApplication : ITaskApplication
{
return operation.Failed("تاریخی برای درخواست وظیفه ثبت نشده است");
}
assign.AcceptTimeRequest();
message = string.IsNullOrWhiteSpace(message) ? "درخواست شما مورد تایید قرار گرفت" : message;
var messageEntity = new TaskMessage(message, "تایید درخواست مهلت", assign.id);
@@ -865,14 +874,14 @@ public class TaskApplication : ITaskApplication
return _taskRepository.AllRequestedTasks(searchModel);
}
public int TasksHaveTicketCounts(long userId)
public async Task<int> TasksHaveTicketCounts(long userId)
{
return _taskRepository.TasksHaveTicketCounts(userId);
return await _taskRepository.TasksHaveTicketCounts(userId);
}
public int TasksHaveTicketRequestsCount(long userId)
public async Task<int> TasksHaveTicketRequestsCount(long userId)
{
return _taskRepository.TasksHaveTicketRequestsCount(userId);
return await _taskRepository.TasksHaveTicketRequestsCount(userId);
}
@@ -881,9 +890,9 @@ public class TaskApplication : ITaskApplication
return _taskMessageRepository.GetTaskMessages(assignId);
}
public int GetRequestedTasksCount()
public async Task<int> GetRequestedTasksCount()
{
return _taskRepository.GetRequestedTasksCount();
return await _taskRepository.GetRequestedTasksCount();
}
public OperationResult ChangeRequestTimeAndAccept(string time, long taskId, long assignedId, string message)
@@ -1007,15 +1016,15 @@ public class TaskApplication : ITaskApplication
return _assignRepository.GetAssignsByTaskId(taskId);
}
public int RequestedAndOverdueTasksCount(long userId)
public async Task<int> RequestedAndOverdueTasksCount(long userId)
{
return _taskRepository.RequestedAndOverdueTasksCount(userId);
return await _taskRepository.RequestedAndOverdueTasksCount(userId);
}
public int OverdueTasksCount(long userId)
public async Task<int> OverdueTasksCount(long userId)
{
return _taskRepository.OverdueTasksCount(userId);
return await _taskRepository.OverdueTasksCount(userId);
}
//public OperationResult MoveDataFRomTaskToAssign()

View File

@@ -4,222 +4,347 @@ using AccountManagement.Application.Contracts.TaskSchedule;
using AccountManagement.Domain.TaskScheduleAgg;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Transactions;
using AccountManagement.Domain.TaskAgg;
using Company.Domain.HolidayItemAgg;
using PersianTools.Core;
using CompanyManagment.App.Contracts.Loan;
namespace AccountManagement.Application;
public class TaskScheduleApplication : ITaskScheduleApplication
{
private readonly ITaskApplication _taskApplication;
private readonly ITaskScheduleRepository _taskScheduleRepository;
private readonly IHolidayItemRepository _holidayItemRepository;
private readonly ITaskApplication _taskApplication;
private readonly ITaskScheduleRepository _taskScheduleRepository;
private readonly IHolidayItemRepository _holidayItemRepository;
private readonly ITaskRepository _taskRepository;
public TaskScheduleApplication(ITaskApplication taskApplication, ITaskScheduleRepository taskScheduleRepository, IHolidayItemRepository holidayItemRepository, ITaskRepository taskRepository)
{
_taskApplication = taskApplication;
_taskScheduleRepository = taskScheduleRepository;
_holidayItemRepository = holidayItemRepository;
_taskRepository = taskRepository;
}
public TaskScheduleApplication(ITaskApplication taskApplication, ITaskScheduleRepository taskScheduleRepository, IHolidayItemRepository holidayItemRepository)
{
_taskApplication = taskApplication;
_taskScheduleRepository = taskScheduleRepository;
_holidayItemRepository = holidayItemRepository;
}
public OperationResult Create(CreateTask command)
{
OperationResult operation = new OperationResult();
public OperationResult Create(CreateTask command)
{
OperationResult operation = new OperationResult();
if (command.HasSchedule)
{
switch (command.ScheduleType)
{
case "limited":
if (Convert.ToInt32(command.ScheduleCount) > 60)
{
return operation.Failed("تعداد وارد شده بیشتر از حد مجاز است");
}
return CreateLimitedTasks(command);
break;
if (command.HasSchedule)
{
switch (command.ScheduleType)
{
case TaskScheduleType.Limited:
if (Convert.ToInt32(command.ScheduleCount) > 60)
{
return operation.Failed("تعداد وارد شده بیشتر از حد مجاز است");
}
return CreateLimitedTasks(command);
break;
case "unlimited":
return CreateUnlimitedTasks(command);
break;
case TaskScheduleType.Unlimited:
return CreateUnlimitedTasks(command);
break;
default:
return operation.Failed("خطای سیستمی!");
default:
return operation.Failed("نوع وظیفه محول شده مشخص نمیباشد");
}
}
else
{
return operation.Failed("این تسک بصورت زمان بندی شده نمیباشد");
}
}
}
}
else
{
return operation.Failed("این تسک بصورت دوره ای نمیباشد");
}
}
public OperationResult CreateLimitedTasks(CreateTask command)
{
OperationResult operation = new OperationResult();
if (Convert.ToInt32(command.ScheduleCount) < 1 || string.IsNullOrWhiteSpace(command.ScheduleCount))
{
return operation.Failed("تعداد وارد شده باید بیشتر از 2 باشد");
}
public async Task<TaskScheduleDetailsViewModel> GetDetails(long id)
{
return await _taskScheduleRepository.GetDetails(id);
}
switch (command.ScheduleUnitType)
{
case "year":
if (Convert.ToInt32(command.ScheduleCount) != 1)
{
return operation.Failed("دوره نمیتواند بیشتر از 1 سال باشد");
}
break;
case "month":
if (Convert.ToInt32(command.ScheduleCount) > 12)
{
return operation.Failed("بازه وارد شده نا معتبر است");
}
break;
case "week":
if (command.ScheduleUnitNumber != "first" && command.ScheduleUnitNumber != "last")
{
return operation.Failed("بازه وارد شده نا معتبر است");
}
break;
case "day":
if (Convert.ToInt32(command.ScheduleUnitNumber) > 29)
{
return operation.Failed("بازه وارد شده نا معتبر است");
}
break;
default:
return operation.Failed("نوع بازه مشخص نمیباشد");
break;
public OperationResult Remove(long taskScheduleId)
{
var op = new OperationResult();
var taskSchedule = _taskScheduleRepository.Get(taskScheduleId);
if (taskSchedule == null)
return op.Failed("وظیفه مورد نظر یافت نشد");
var tasks = _taskRepository.GetTasksByTaskScheduleId(taskScheduleId);
var assigns = tasks.SelectMany(x => x.Assigns);
if (assigns.Any(x => x.IsCanceledRequest || x.IsDone || x.IsCancel || x.TimeRequest || x.AcceptedTimeRequest > 0))
{
taskSchedule.DeActive();
}
try
{
DateTime previousDateRaw = command.EndTaskDate.ToEndDayOfGeorgianDateTime();
DateTime previousDateEdited = command.EndTaskDate.ToEndDayOfGeorgianDateTime();
var removableTask = tasks.Where(x => x.Assigns.All(a => a.IsDone == false && a.IsCancel == false)).ToList();
_taskRepository.RemoveRange(removableTask);
int count = Convert.ToInt32(command.ScheduleCount);
bool isInt = int.TryParse(command.ScheduleUnitNumber, out int unitNumber);
string kindOfWeekUnit = isInt ? "" : command.ScheduleUnitNumber;
var taskSchedule = new TaskSchedule(command.ScheduleCount, command.ScheduleType, command.ScheduleUnitType,
command.ScheduleUnitNumber, previousDateEdited);
_taskScheduleRepository.Create(taskSchedule);
_taskScheduleRepository.SaveChanges();
command.TaskScheduleId = taskSchedule.id;
}
else
{
_taskScheduleRepository.Remove(taskSchedule);
_taskRepository.RemoveRange(tasks);
}
_taskRepository.SaveChanges();
return op.Succcedded();
}
switch (command.ScheduleUnitType)
{
case "year":
for (int i = 1; i <= count; i++)
{
command.EndTaskDate = previousDateEdited.ToFarsi();
operation = _taskApplication.CreateTask(command);
taskSchedule.SetLastEndTaskDate(previousDateEdited);
private OperationResult CreateLimitedTasks(CreateTask command)
{
OperationResult operation = new OperationResult();
if (Convert.ToInt32(command.ScheduleCount) < 1 || string.IsNullOrWhiteSpace(command.ScheduleCount))
{
return operation.Failed("تعداد وارد شده باید بیشتر از 2 باشد");
}
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
switch (command.ScheduleUnitType)
{
case TaskScheduleUnitType.Year:
if (Convert.ToInt32(command.ScheduleCount) != 1)
{
return operation.Failed("دوره نمیتواند بیشتر از 1 سال باشد");
}
break;
case TaskScheduleUnitType.Month:
if (Convert.ToInt32(command.ScheduleCount) > 60)
{
return operation.Failed("بازه وارد شده نا معتبر است");
}
break;
case TaskScheduleUnitType.Week:
if (command.ScheduleUnitNumber != "first" && command.ScheduleUnitNumber != "last")
{
return operation.Failed("بازه وارد شده نا معتبر است");
}
break;
case TaskScheduleUnitType.Day:
if (Convert.ToInt32(command.ScheduleUnitNumber) > 29)
{
return operation.Failed("بازه وارد شده نا معتبر است");
}
break;
default:
return operation.Failed("نوع بازه مشخص نمیباشد");
break;
}
previousDateRaw = previousDateRaw.AddYears(unitNumber);
previousDateEdited = previousDateRaw;
}
try
{
//using var transaction = new TransactionScope();
DateTime previousDateRaw = command.EndTaskDate.ToEndDayOfGeorgianDateTime();
DateTime previousDateEdited = command.EndTaskDate.ToEndDayOfGeorgianDateTime();
var day = Convert.ToInt32(command.EndTaskDate.Substring(8, 2));
var month = Convert.ToInt32(command.EndTaskDate.Substring(5, 2));
var year = Convert.ToInt32(command.EndTaskDate.Substring(0, 4));
}
break;
int count = Convert.ToInt32(command.ScheduleCount);
bool isInt = int.TryParse(command.ScheduleUnitNumber, out int unitNumber);
string kindOfWeekUnit = isInt ? "" : command.ScheduleUnitNumber;
var taskSchedule = new TaskSchedule(command.ScheduleCount, command.ScheduleType, command.ScheduleUnitType,
command.ScheduleUnitNumber, previousDateEdited);
_taskScheduleRepository.Create(taskSchedule);
_taskScheduleRepository.SaveChanges();
command.TaskScheduleId = taskSchedule.id;
case "month":
for (int i = 1; i <= count; i++)
{
command.EndTaskDate = previousDateEdited.ToFarsi();
operation = _taskApplication.CreateTask(command);
taskSchedule.SetLastEndTaskDate(previousDateEdited);
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
switch (command.ScheduleUnitType)
{
case TaskScheduleUnitType.Year:
for (int i = 1; i <= count; i++)
{
command.EndTaskDate = previousDateEdited.ToFarsi();
operation = _taskApplication.CreateTask(command);
taskSchedule.SetLastEndTaskDate(previousDateEdited);
}
previousDateRaw = previousDateRaw.AddMonths(unitNumber);
previousDateEdited = previousDateRaw;
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
}
previousDateRaw = previousDateRaw.AddYears(unitNumber);
previousDateEdited = previousDateRaw;
}
break;
}
break;
case TaskScheduleUnitType.Month:
bool endOfMonth = day == 31;
case "week":
for (int i = 1; i <= count; i++)
{
if (string.IsNullOrWhiteSpace(kindOfWeekUnit))
{
throw new InvalidDataException();
}
if (endOfMonth)
{
for (int i = 1; i < count; i++)
{
command.EndTaskDate = previousDateEdited.ToFarsi();
operation = _taskApplication.CreateTask(command);
taskSchedule.SetLastEndTaskDate(previousDateEdited);
if (month >= 12)
{
var extra = month - 12;
year++;
month = extra+unitNumber;
}
else
{
month = unitNumber + month;
}
previousDateRaw = $"{year:0000}/{month:00}/01".FindeEndOfMonth().ToGeorgianDateTime();
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
command.EndTaskDate = kindOfWeekUnit switch
{
"first" => previousDateRaw.GetNextDayOfWeek(DayOfWeek.Saturday).ToFarsi(),
"last" => previousDateRaw.GetNextDayOfWeek(DayOfWeek.Thursday).ToFarsi(),
_ => throw new InvalidDataException()
};
operation = _taskApplication.CreateTask(command);
taskSchedule.SetLastEndTaskDate(previousDateEdited);
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
}
}
previousDateRaw = command.EndTaskDate.ToGeorgianDateTime();
previousDateEdited = previousDateRaw;
previousDateEdited = previousDateRaw;
}
}
else
{
for (int i = 1; i < count; i++)
{
command.EndTaskDate = previousDateEdited.ToFarsi();
operation = _taskApplication.CreateTask(command);
taskSchedule.SetLastEndTaskDate(previousDateEdited);
var endDay = 0;
if (month >= 12)
{
var extra = month - 12;
year++;
month = extra + unitNumber;
}
else
{
month = unitNumber + month;
}
if (day == 30)
{
if (month == 12)
{
var lastYearDay = Convert.ToInt32($"{year:0000}/{month:00}/1".FindeEndOfMonth()
.Substring(8, 2));
endDay = lastYearDay == 30 ? lastYearDay : 29;
}
}
previousDateEdited = endDay == 0
? $"{year:0000}/{month:00}/{day:00}".ToGeorgianDateTime()
: $"{year:0000}/{month:00}/{endDay:00}".ToGeorgianDateTime();
}
}
break;
//for (int i = 1; i <= count; i++)
//{
// command.EndTaskDate = previousDateEdited.ToFarsi();
// operation = _taskApplication.CreateTask(command);
// taskSchedule.SetLastEndTaskDate(previousDateEdited);
// previousDateRaw = $"{year:0000}/{month:00}/01".FindeEndOfMonth().ToGeorgianDateTime();
// bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
// while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
// {
// previousDateEdited = previousDateRaw.AddDays(1);
// isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
case "day":
// }
// previousDateEdited = previousDateRaw;
for (int i = 1; i <= count; i++)
{
command.EndTaskDate = previousDateEdited.ToFarsi();
operation = _taskApplication.CreateTask(command);
taskSchedule.SetLastEndTaskDate(previousDateEdited);
previousDateRaw = previousDateRaw.AddDays(unitNumber);
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
//}
}
}
break;
previousDateEdited = previousDateRaw;
}
break;
case TaskScheduleUnitType.Week:
for (int i = 1; i <= count; i++)
{
if (string.IsNullOrWhiteSpace(kindOfWeekUnit))
{
throw new InvalidDataException();
}
}
_taskScheduleRepository.SaveChanges();
operation = operation.Succcedded();
return operation;
}
catch (Exception e)
{
return operation.Failed(e.ToString());
}
}
command.EndTaskDate = kindOfWeekUnit switch
{
"first" => previousDateRaw.GetNextDayOfWeek(DayOfWeek.Saturday).ToFarsi(),
"last" => previousDateRaw.GetNextDayOfWeek(DayOfWeek.Thursday).ToFarsi(),
_ => throw new InvalidDataException()
};
operation = _taskApplication.CreateTask(command);
taskSchedule.SetLastEndTaskDate(previousDateEdited);
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
public OperationResult CreateUnlimitedTasks(CreateTask command)
{
var operation = _taskApplication.CreateTask(command);
if (!operation.IsSuccedded)
return operation;
var lastDate = command.EndTaskDate.ToGeorgianDateTime();
var taskSchedule = new TaskSchedule(command.ScheduleCount, command.ScheduleType, command.ScheduleUnitType,
command.ScheduleUnitNumber, lastDate);
_taskScheduleRepository.Create(taskSchedule);
_taskScheduleRepository.SaveChanges();
return operation.Succcedded();
}
previousDateRaw = command.EndTaskDate.ToGeorgianDateTime();
previousDateEdited = previousDateRaw;
}
}
break;
case TaskScheduleUnitType.Day:
for (int i = 1; i <= count; i++)
{
command.EndTaskDate = previousDateEdited.ToFarsi();
operation = _taskApplication.CreateTask(command);
taskSchedule.SetLastEndTaskDate(previousDateEdited);
previousDateRaw = previousDateRaw.AddDays(unitNumber);
bool isHoliday = _holidayItemRepository.GetHoliday(previousDateRaw);
while (isHoliday || previousDateEdited.DayOfWeek == DayOfWeek.Friday)
{
previousDateEdited = previousDateRaw.AddDays(1);
isHoliday = _holidayItemRepository.GetHoliday(previousDateEdited);
}
previousDateEdited = previousDateRaw;
}
break;
}
_taskScheduleRepository.SaveChanges();
//transaction.Complete();
operation = operation.Succcedded();
return operation;
}
catch (Exception e)
{
return operation.Failed(e.ToString());
}
}
private OperationResult CreateUnlimitedTasks(CreateTask command)
{
using var transaction = new TransactionScope();
var lastDate = command.EndTaskDate.ToGeorgianDateTime();
var taskSchedule = new TaskSchedule(command.ScheduleCount, command.ScheduleType, command.ScheduleUnitType,
command.ScheduleUnitNumber, lastDate);
_taskScheduleRepository.Create(taskSchedule);
_taskScheduleRepository.SaveChanges();
command.TaskScheduleId = taskSchedule.id;
var operation = _taskApplication.CreateTask(command);
if (!operation.IsSuccedded)
return operation;
_taskScheduleRepository.SaveChanges();
transaction.Complete();
return operation.Succcedded();
}
}

View File

@@ -1,7 +1,9 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.TaskSubject;
using AccountManagement.Domain.TaskSubjectAgg;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
namespace AccountManagement.Application;

View File

@@ -7,6 +7,7 @@ using AccountManagement.Application.Contracts.Role;
using AccountManagement.Application.Contracts.SubAccount;
using AccountManagement.Application.Contracts.SubAccountPermissionSubtitle;
using AccountManagement.Application.Contracts.Task;
using AccountManagement.Application.Contracts.TaskSchedule;
using AccountManagement.Application.Contracts.TaskSubject;
using AccountManagement.Application.Contracts.Ticket;
using AccountManagement.Application.Contracts.TicketAccessAccount;
@@ -25,6 +26,7 @@ using AccountManagement.Domain.SubAccountPermissionSubtitle4Agg;
using AccountManagement.Domain.SubAccountRoleAgg;
using AccountManagement.Domain.TaskAgg;
using AccountManagement.Domain.TaskMessageAgg;
using AccountManagement.Domain.TaskScheduleAgg;
using AccountManagement.Domain.TaskSubjectAgg;
using AccountManagement.Domain.TicketAccessAccountAgg;
using AccountManagement.Domain.TicketAgg;
@@ -62,6 +64,8 @@ namespace AccountManagement.Configuration
services.AddScoped<ITaskRepository, TaskRepository>();
services.AddTransient<ITaskApplication, TaskApplication>();
services.AddTransient<ITaskScheduleApplication, TaskScheduleApplication>();
services.AddTransient<ITaskScheduleRepository, TaskScheduleRepository>();
services.AddTransient<ITaskSubjectRepository, TaskSubjectRepository>();
services.AddTransient<ITaskSubjectApplication, TaskSubjectApplication>();

View File

@@ -8,7 +8,7 @@ namespace AccountManagement.Domain.AssignAgg;
public class Assign : EntityBase
{
public Assign(long taskId, long assignerId, long assignedId, int assignerPositionValue, string assignedName, int assignedPositionValue, DateTime endTaskDate, bool firstTimeCreation = false)
public Assign(long taskId, long assignerId, long assignedId, int assignerPositionValue, string assignedName, int assignedPositionValue, DateTime endTaskDate, bool firstTimeCreation=false)
{
TaskId = taskId;
AssignerId = assignerId;
@@ -18,7 +18,7 @@ public class Assign : EntityBase
AssignedPositionValue = assignedPositionValue;
EndTaskDate = endTaskDate;
FirstTimeCreation = firstTimeCreation;
}
}
//آیدی شخص ارسال کننده
public long TaskId { get; private set; }
@@ -52,7 +52,9 @@ public class Assign : EntityBase
public string? DoneDescription { get; private set; }
public bool IsCanceledRequest { get; private set; }
public bool FirstTimeCreation { get; private set; }
public Tasks Task { get; set; }
public List<TaskMessage> TaskMessageList { get; set; }
@@ -71,9 +73,9 @@ public class Assign : EntityBase
{
TimeRequest = false;
AcceptedTimeRequest++;
EndTaskDate = RequestDate.Value;
EndTaskDate = RequestDate < DateTime.Today ? DateTime.Today : RequestDate.Value;
}
}
public void RejectTimeRequest()
{
TimeRequest = false;

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.Domain;
using AccountManagement.Application.Contracts.Task;
@@ -88,11 +89,22 @@ public interface ITaskRepository:IRepository<long,Tasks>
/// <returns></returns>
List<TaskViewModel> GetTasksHaveTicket(TaskSearchModel searchModel);
/// <summary>
/// لیست تسک های دوره ای ایجاد شده توسط کاربر
/// </summary>
/// <param name="searchModel"></param>
/// <returns></returns>
List<TaskViewModel> GetTaskScheduleList(TaskSearchModel searchModel);
/// <summary>
/// تعداد تسک های درخواستی. بدون تیکت
/// </summary>
/// <returns></returns>
int GetRequestedTasksCount();
Task<int> GetRequestedTasksCount();
/// <summary>
/// گرفتن جزئیات درخواست وظیفه
@@ -114,39 +126,38 @@ public interface ITaskRepository:IRepository<long,Tasks>
/// <returns></returns>
bool HasOverdueTasks(long userId);
/// <summary>
///مجوع تعداد تسک های عقب افتاده و درخواستی
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
int RequestedAndOverdueTasksCount(long userId);
/// <summary>
/// مجوع تعداد تسک های عقب افتاده و درخواستی
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
Task<int> RequestedAndOverdueTasksCount(long userId);
/// <summary>
/// تعداد تسک های دارای تیکت
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
int TasksHaveTicketCounts(long userId);
Task<int> TasksHaveTicketCounts(long userId);
/// <summary>
/// تعداد درخواست های تسک های دارا تیکت
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
int TasksHaveTicketRequestsCount(long userId);
Task<int> TasksHaveTicketRequestsCount(long userId);
/// <summary>
///تعداد تسک های شخصی و دریافتی برای امروز و یا عقب افتاده
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
int OverdueTasksCount(long userId);
/// <summary>
/// تعداد تسک های شخصی و دریافتی برای امروز و یا عقب افتاده
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
Task<int> OverdueTasksCount(long userId);
// گرفتن پیام های مربوط به هر تسک
List<Tasks> GetTasksByTaskScheduleId(long taskScheduleId);
//OperationResult MoveDataFRomTaskToAssign();
void RemoveRange(IEnumerable<Tasks> tasks);
}

View File

@@ -1,8 +1,11 @@
using _0_Framework.Domain;
using System.Threading.Tasks;
using _0_Framework.Domain;
using AccountManagement.Application.Contracts.TaskSchedule;
namespace AccountManagement.Domain.TaskScheduleAgg;
public interface ITaskScheduleRepository:IRepository<long,TaskSchedule>
public interface ITaskScheduleRepository : IRepository<long, TaskSchedule>
{
Task<TaskScheduleDetailsViewModel> GetDetails(long id);
void Remove(TaskSchedule entity);
}

View File

@@ -1,29 +1,38 @@
using System;
using System.Collections.Generic;
using _0_Framework.Application;
using _0_Framework.Domain;
using AccountManagement.Application.Contracts.Task;
using AccountManagement.Domain.TaskAgg;
namespace AccountManagement.Domain.TaskScheduleAgg;
public class TaskSchedule:EntityBase
{
public TaskSchedule(string count, string type, string unitType, string unitNumber, DateTime lastEndTaskDate)
public TaskSchedule(string count, TaskScheduleType type, TaskScheduleUnitType unitType, string unitNumber, DateTime lastEndTaskDate)
{
Count = count;
Type = type;
UnitType = unitType;
UnitNumber = unitNumber;
LastEndTaskDate = lastEndTaskDate;
IsCanceled = IsActive.True;
}
public string Count { get; private set; }
public string Type { get; private set; }
public string UnitType { get; private set; }
public TaskScheduleType Type { get; private set; }
public TaskScheduleUnitType UnitType { get; private set; }
public string UnitNumber { get; private set; }
public DateTime LastEndTaskDate { get; private set; }
public IsActive IsCanceled { get; private set; }
public List<Tasks> TasksList { get; set; }
public void SetLastEndTaskDate(DateTime lastEndTaskDate)
{
LastEndTaskDate = lastEndTaskDate;
}
public void DeActive()
{
IsCanceled = IsActive.False;
}
}

View File

@@ -27,6 +27,7 @@ using AccountManagement.Domain.SubAccountPermissionSubtitle3Agg;
using AccountManagement.Domain.SubAccountPermissionSubtitle4Agg;
using AccountManagement.Domain.SubAccountRoleAgg;
using AccountMangement.Infrastructure.EFCore.Seed;
using AccountManagement.Domain.TaskScheduleAgg;
namespace AccountMangement.Infrastructure.EFCore
{
@@ -57,6 +58,9 @@ namespace AccountMangement.Infrastructure.EFCore
public DbSet<TicketAccessAccount> TicketAccessAccounts { get; set; }
public DbSet<TaskSchedule> TaskSchedules { get; set; }
#endregion
#region Pooya

View File

@@ -12,9 +12,10 @@ public class TaskScheduleMapping : IEntityTypeConfiguration<TaskSchedule>
builder.HasKey(x => x.id);
builder.Property(x => x.Count).HasMaxLength(10);
builder.Property(x => x.Type).HasMaxLength(12);
builder.Property(x => x.Type).HasConversion<string>().HasMaxLength(12);
builder.Property(x => x.UnitNumber).HasMaxLength(10);
builder.Property(x => x.UnitType).HasMaxLength(10);
builder.Property(x => x.UnitType).HasConversion<string>().HasMaxLength(10);
builder.Property(x => x.IsCanceled).HasConversion<string>().HasMaxLength(5);
builder.HasMany(x => x.TasksList).WithOne(x => x.TaskSchedule)
.HasForeignKey(x => x.TaskScheduleId);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,74 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
/// <inheritdoc />
public partial class addTaskSchedule : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "UnitType",
table: "TaskSchedules",
type: "nvarchar(10)",
maxLength: 10,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(10)",
oldMaxLength: 10,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Type",
table: "TaskSchedules",
type: "nvarchar(12)",
maxLength: 12,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(12)",
oldMaxLength: 12,
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "IsCanceled",
table: "TaskSchedules",
type: "nvarchar(5)",
maxLength: 5,
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsCanceled",
table: "TaskSchedules");
migrationBuilder.AlterColumn<string>(
name: "UnitType",
table: "TaskSchedules",
type: "nvarchar(10)",
maxLength: 10,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(10)",
oldMaxLength: 10);
migrationBuilder.AlterColumn<string>(
name: "Type",
table: "TaskSchedules",
type: "nvarchar(12)",
maxLength: 12,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(12)",
oldMaxLength: 12);
}
}
}

View File

@@ -759,10 +759,16 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("IsCanceled")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<DateTime>("LastEndTaskDate")
.HasColumnType("datetime2");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(12)
.HasColumnType("nvarchar(12)");
@@ -771,6 +777,7 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
.HasColumnType("nvarchar(10)");
b.Property<string>("UnitType")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");

View File

@@ -4,6 +4,7 @@ using _0_Framework.InfraStructure;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.Assign;
@@ -46,7 +47,6 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
public EditTask GetDetails(long TaskId)
{
var task = Get(TaskId);
var userId = _authHelper.CurrentAccountId();
@@ -94,7 +94,8 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
Fullname = a.Fullname,
Id = a.id,
}).FirstOrDefault()
}).FirstOrDefault(),
TaskScheduleId = x.TaskScheduleId ?? 0
}).FirstOrDefault();
@@ -112,6 +113,17 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
res.IsCancel = res.AssignViewModels.First(x => x.AssignedId == userId).IsCancel;
}
if (res.TaskScheduleId>0)
{
var taskSchedule = _accountContext.TaskSchedules.FirstOrDefault(x => x.id == res.TaskScheduleId);
res.ScheduleUnitType = taskSchedule.UnitType;
res.ScheduleType = taskSchedule.Type;
res.ScheduleCount = taskSchedule.Count;
res.ScheduleUnitNumber = taskSchedule.UnitNumber;
}
//_accountContext.Tasks.Where(x => x.id == TaskId).Select(x => new EditTask()
//{
// EndTaskDate = x.EndTaskDate.ToFarsi(),
@@ -968,7 +980,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
.ThenInclude(x => x.Media)
.Where(x =>
x.Task.IsActiveString == "true" && (x.AssignerId == accountId && x.AssignedId != accountId) && (!x.IsCanceledRequest && !x.TimeRequest && !x.IsDoneRequest) && x.Task.TicketId == null &&
x.Task.SenderId == accountId)
x.Task.SenderId == accountId && x.Task.TaskScheduleId == null)
.Select(x =>
new TaskViewModel()
{
@@ -1839,7 +1851,307 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
return final;
}
public List<TaskViewModel> GetTaskScheduleList(TaskSearchModel searchModel)
{
var accountId = long.Parse(_contextAccessor.HttpContext.User.FindFirst("AccountId").Value);
var positionValue = int.Parse(_contextAccessor.HttpContext.User.FindFirst("PositionValue").Value);
var emptyAcc = new AccountViewModel()
{
Fullname = "-",
PositionValue = 0
};
var raw = _accountContext.Assigns.Include(x => x.Task).ThenInclude(x => x.TaskMedias)
.ThenInclude(x => x.Media)
.Include(x => x.Task).ThenInclude(x => x.TaskSchedule)
.Where(x =>
x.Task.IsActiveString == "true" && x.Task.SenderId == accountId
&& x.Task.TaskScheduleId != null && x.Task.TaskScheduleId > 0 && (!x.IsCanceledRequest && !x.TimeRequest && !x.IsDoneRequest));
if (!string.IsNullOrWhiteSpace(searchModel.GeneralSearch))
{
raw = raw.Where(x =>
(x.Task.Description != null && x.Task.Description.Contains(searchModel.GeneralSearch))
|| x.Task.ContractingPartyName.Contains(searchModel.GeneralSearch)
|| x.Task.Title.Contains(searchModel.GeneralSearch));
}
var query = raw.GroupBy(x => x.Task.TaskScheduleId).Select(x =>
new TaskViewModel()
{
AssignedId = x.First().AssignedId,
AssignerId = x.First().AssignerId,
CreateDate = x.First().Task.CreationDate.ToFarsi(),
EndTaskDateFA = x.First().EndTaskDate.ToFarsi(),
IsDone = x.First().IsDone,
EndTaskDateGE = x.First().EndTaskDate,
Name = x.First().Task.Title,
RequestCancel = x.First().IsCanceledRequest,
RequestTime = x.First().TimeRequest,
Id = x.First().Task.id,
CreateTaskDateGE = x.First().Task.CreationDate,
IsCancel = x.First().IsCancel,
AcceptedTimeRequest = x.First().AcceptedTimeRequest,
IsCancelRequest = x.First().IsCanceledRequest,
ContractingPartyName = x.First().Task.ContractingPartyName,
MediaCount = _accountContext.TaskMedias.Count(m => m.TaskId == x.First().Task.id),
Description = x.First().Task.Description,
IsDoneRequest = x.First().IsDoneRequest,
ScheduleType = x.First().Task.TaskSchedule.Type,
ScheduleUnitType = x.First().Task.TaskSchedule.UnitType,
TaskScheduleId = (long)x.First().Task.TaskScheduleId
}
);
if (!string.IsNullOrWhiteSpace(searchModel.GeneralSearch))
{
query = query.Where(x =>
(x.Description != null && x.Description.Contains(searchModel.GeneralSearch))
|| x.ContractingPartyName.Contains(searchModel.GeneralSearch)
|| x.Name.Contains(searchModel.GeneralSearch));
}
var res = query.Select(x => new TaskViewModel()
{
Sender = _accountContext.Accounts.Include(a => a.Position).Select(a => new AccountViewModel()
{
PositionValue = a.Position.PositionValue,
Id = a.id,
Fullname = a.Fullname,
}).FirstOrDefault(a => a.Id == x.AssignerId),
SelfName = _accountContext.Accounts.FirstOrDefault(a => a.id == accountId).Fullname,
Assigned = _accountContext.Assigns.Where(a => a.TaskId == x.Id)
.Where(a => a.AssignedPositionValue >= positionValue).Select(a => a.AssignedId)
.ToList(),
CreateDate = x.CreateDate,
EndTaskDateFA = x.EndTaskDateFA,
IsDone = x.IsDone,
EndTaskDateGE = x.EndTaskDateGE,
Name = x.Name,
RequestCancel = x.RequestCancel,
RequestTime = x.RequestTime,
Id = x.Id,
CreateTaskDateGE = x.CreateTaskDateGE,
IsCancel = x.IsCancel,
AcceptedTimeRequest = x.AcceptedTimeRequest,
IsCancelRequest = x.IsCancelRequest,
ContractingPartyName = x.ContractingPartyName,
MediaCount = x.MediaCount,
Description = x.Description,
IsDoneRequest = x.IsDoneRequest,
ScheduleType = x.ScheduleType,
ScheduleUnitType = x.ScheduleUnitType,
TaskScheduleId = x.TaskScheduleId
});
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) && !string.IsNullOrWhiteSpace(searchModel.EndDate))
{
var start = searchModel.StartDate.ToGeorgianDateTime();
var end = searchModel.EndDate.ToGeorgianDateTime();
res = res.Where(x =>
((start > x.CreateTaskDateGE && x.CreateTaskDateGE < end) &&
(end > x.EndTaskDateGE && x.EndTaskDateGE > start))
|| ((start < x.CreateTaskDateGE && x.CreateTaskDateGE < end) &&
(end < x.EndTaskDateGE && x.EndTaskDateGE > start))
|| ((start < x.CreateTaskDateGE && x.CreateTaskDateGE < end) &&
(end > x.EndTaskDateGE && x.EndTaskDateGE > start))
|| ((start > x.CreateTaskDateGE && x.CreateTaskDateGE < end) &&
(end < x.EndTaskDateGE && x.EndTaskDateGE > end)));
}
if (!string.IsNullOrWhiteSpace(searchModel.IsDoneRequest))
{
bool isDoneReq = bool.Parse(searchModel.IsDoneRequest);
res = res.Where(x => x.IsDoneRequest == isDoneReq);
}
if (!string.IsNullOrWhiteSpace(searchModel.IsDone))
{
bool isDone = bool.Parse(searchModel.IsDone);
res = res.Where(x => x.IsDone == isDone);
}
if (!string.IsNullOrWhiteSpace(searchModel.IsCanceled))
{
bool isCancel = bool.Parse(searchModel.IsCanceled);
res = res.Where(x => x.IsCancel == isCancel);
}
if (!string.IsNullOrWhiteSpace(searchModel.IsTimeRequest))
{
bool isTimeRequest = bool.Parse(searchModel.IsTimeRequest);
res = res.Where(x => x.RequestTime == isTimeRequest);
}
if (!string.IsNullOrWhiteSpace(searchModel.TimeRequestAccepted))
{
res = res.Where(x => x.AcceptedTimeRequest > 0);
}
if (!string.IsNullOrWhiteSpace(searchModel.IsCancelRequest))
{
bool isCancelReq = bool.Parse(searchModel.IsCancelRequest);
res = res.Where(x => x.IsCancelRequest == isCancelReq);
}
var result = res.AsEnumerable();
if (searchModel.AccountId > 0)
{
result = result.Where(x =>
x.Sender.Id == searchModel.AccountId || x.Assigned.Contains(searchModel.AccountId));
}
var orderResult = result.OrderByDescending(x => x.IsCancel ? 0 : 1).ThenBy(x => x.IsDone ? 1 : 0)
.ThenBy(x => x.EndTaskDateGE);
var final = orderResult.Skip(searchModel.PageIndex).Take(30).ToList();
final = final.Select(x => new TaskViewModel()
{
AssignViewModels = _accountContext.Accounts.Include(x => x.Position)
.Where(a => x.Assigned.Contains(a.id) && accountId != a.id)
.Select(a => new AssignViewModel()
{
AssignedName = a.Fullname,
AssignedPositionValue = a.Position.PositionValue
}).ToList(),
Sender = x.Sender,
SelfAssigner = x.Sender.Id == accountId ? true : false,
Assigned = x.Assigned,
SelfAssigned = x.Assigned.Any(a => a == accountId) ? true : false,
CreateDate = x.CreateDate,
EndTaskDateFA = x.EndTaskDateFA,
IsDone = x.IsDone,
EndTaskDateGE = x.EndTaskDateGE,
Name = x.Name,
RequestCancel = x.RequestCancel,
RequestTime = x.RequestTime,
Id = x.Id,
CreateTaskDateGE = x.CreateTaskDateGE,
IsCancel = x.IsCancel,
AcceptedTimeRequest = x.AcceptedTimeRequest,
IsCancelRequest = x.IsCancelRequest,
ContractingPartyName = x.ContractingPartyName,
MediaCount = x.MediaCount,
SelfName = x.SelfName,
Description = x.Description,
IsDoneRequest = x.IsDoneRequest,
ScheduleType = x.ScheduleType,
ScheduleUnitType = x.ScheduleUnitType,
TaskScheduleId = x.TaskScheduleId
}).ToList();
final = final.Select(x => new TaskViewModel()
{
AssignList = x.AssignViewModels.GroupBy(a => a.AssignedPositionValue).Select(a => new AssignList()
{
AssignViewModels = a.ToList(),
PosValue = a.Key
}).ToList(),
Sender = x.Sender,
Assigned = x.Assigned,
CreateDate = x.CreateDate,
EndTaskDateFA = x.EndTaskDateFA,
IsDone = x.IsDone,
EndTaskDateGE = x.EndTaskDateGE,
Name = x.Name,
RequestCancel = x.RequestCancel,
RequestTime = x.RequestTime,
Id = x.Id,
CreateTaskDateGE = x.CreateTaskDateGE,
IsCancel = x.IsCancel,
AcceptedTimeRequest = x.AcceptedTimeRequest,
IsCancelRequest = x.IsCancelRequest,
ContractingPartyName = x.ContractingPartyName,
Color = x.IsDone ? "green" : SetTasksColors(x.EndTaskDateGE, x.IsCancel),
MediaCount = x.MediaCount,
HasAttachment = x.MediaCount > 0,
SelfName = x.SelfName,
SelfAssigned = x.SelfAssigned,
SelfAssigner = x.SelfAssigner,
Description = x.Description,
IsDoneRequest = x.IsDoneRequest,
AssignViewModels = x.AssignViewModels,
ScheduleType = x.ScheduleType,
ScheduleUnitType = x.ScheduleUnitType,
TaskScheduleId = x.TaskScheduleId
}).ToList();
final = final.Select(x => new TaskViewModel()
{
AssignList = !(x.SelfAssigned || x.SelfAssigner)
? AddAssign(x.AssignList, x.Sender)
: x.AssignList,
Sender = !(x.SelfAssigned || x.SelfAssigner)
? new AccountViewModel()
{
PositionValue = 0,
Fullname = "-"
}
: x.Sender,
Assigned = x.Assigned,
CreateDate = x.CreateDate,
EndTaskDateFA = x.EndTaskDateFA,
IsDone = x.IsDone,
EndTaskDateGE = x.EndTaskDateGE,
Name = x.Name,
RequestCancel = x.RequestCancel,
RequestTime = x.RequestTime,
Id = x.Id,
CreateTaskDateGE = x.CreateTaskDateGE,
IsCancel = x.IsCancel,
AcceptedTimeRequest = x.AcceptedTimeRequest,
IsCancelRequest = x.IsCancelRequest,
ContractingPartyName = x.ContractingPartyName,
Color = x.Color,
MediaCount = x.MediaCount,
HasAttachment = x.HasAttachment,
SelfName = !(x.SelfAssigned || x.SelfAssigner) ? "-" : x.SelfName,
EndTaskTime = $"{x.EndTaskDateGE.Hour}:{x.EndTaskDateGE.Minute}:{x.EndTaskDateGE.Second}" != "23:59:59"
? $"{x.EndTaskDateGE.Hour}:{x.EndTaskDateGE.Minute}"
: "",
Description = x.Description,
IsDoneRequest = x.IsDoneRequest,
CanAssign = _positionRepository.GetLastPositionValue() != positionValue,
CanDelete = x.Sender.Id == accountId,
CanEdit = x.Sender.Id == accountId && !(_accountContext.Assigns.Any(a => a.TaskId == x.Id && (a.AcceptedTimeRequest > 0 || a.IsCanceledRequest
|| a.IsDoneRequest || a.TimeRequest || a.IsCancel || a.IsDone))),
Assigner = x.Sender.Id == accountId ? emptyAcc.Fullname : x.Sender.Fullname,
AssignedReceiverViewModel = x.AssignViewModels.Any()
? x.AssignViewModels.MinBy(a => a.AssignedPositionValue)
: new()
{
AssignedName = "-",
AssignedPositionValue = 0
},
ScheduleType = x.ScheduleType,
ScheduleUnitType = x.ScheduleUnitType,
TaskScheduleId = x.TaskScheduleId
}).ToList();
return final;
}
public string SetTasksColors(DateTime date, bool isCancel)
{
@@ -1888,23 +2200,23 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
}
public int GetRequestedTasksCount()
public async Task<int> GetRequestedTasksCount()
{
var positionValue = int.Parse(_contextAccessor.HttpContext.User.FindFirst("PositionValue").Value);
var accountId = long.Parse(_contextAccessor.HttpContext.User.FindFirst("AccountId").Value);
if (positionValue == 1)
{
return _accountContext.Assigns.Include(x => x.Task).Where(x =>
return await _accountContext.Assigns.Include(x => x.Task).Where(x =>
!x.IsDone && x.Task.IsActiveString == "true" && !x.IsCancel &&
(x.IsCanceledRequest || x.TimeRequest || x.IsDoneRequest) && (accountId == x.Task.SenderId) && x.Task.TicketId == null).GroupBy(x => x.TaskId)
.Select(x => x.First()).Count();
.Select(x => x.First()).CountAsync();
}
else
{
return _accountContext.Assigns.Include(x => x.Task).Where(x =>
return await _accountContext.Assigns.Include(x => x.Task).Where(x =>
!x.IsDone && x.Task.IsActiveString == "true" && !x.IsCancel &&
(x.IsCanceledRequest || x.TimeRequest || x.IsDoneRequest) && (accountId == x.Task.SenderId) && x.Task.TicketId == null).GroupBy(x => x.TaskId)
.Select(x => x.First()).Count();
.Select(x => x.First()).CountAsync();
}
}
@@ -2001,7 +2313,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
}
public int RequestedAndOverdueTasksCount(long userId)
public async Task<int> RequestedAndOverdueTasksCount(long userId)
{
var account = _accountRepository.GetIncludePositions(userId);
if (account.Position == null)
@@ -2009,7 +2321,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
DateTime now = DateTime.Now;
var overdueTasksCount = OverdueTasksCount(userId);
var overdueTasksCount = await OverdueTasksCount(userId);
//overdueTasksCount = _accountContext.Tasks.Include(x =>
@@ -2018,10 +2330,10 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
// !x.Assigns.Any(a => a.TimeRequest)
// && x.Assigns.Any(a => a.AssignedId == userId) &&
// (x.Assigns.First(a => a.AssignedId == userId).EndTaskDate.Date <= DateTime.Now.Date));
var overdueRequestsCount = GetRequestedTasksCount();
var overdueRequestsCount = await GetRequestedTasksCount();
var ticketRequested = TasksHaveTicketRequestsCount(userId);
var overdueTicket = TasksHaveTicketCounts(userId);
var ticketRequested = await TasksHaveTicketRequestsCount(userId);
var overdueTicket = await TasksHaveTicketCounts(userId);
return overdueTasksCount + overdueRequestsCount + ticketRequested + overdueTicket;
}
@@ -2036,7 +2348,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
return overdueRequestsCount;
}
public int OverdueTasksCount(long userId)
public async Task<int> OverdueTasksCount(long userId)
{
var account = _accountRepository.GetIncludePositions(userId);
@@ -2048,12 +2360,12 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
int overdueTasksCount;
if (positionValue == 1)
{
overdueTasksCount = _accountContext.Assigns.Include(x => x.Task).Where(x => x.AssignedId == userId &&
overdueTasksCount = await _accountContext.Assigns.Include(x => x.Task).Where(x => x.AssignedId == userId &&
x.AssignerId == userId && x.Task.Assigns.Count == 1 &&
!x.IsCancel && !x.IsCanceledRequest &&
!x.IsDone && !x.TimeRequest && !x.IsDoneRequest && x.EndTaskDate.Date <= DateTime.Now.Date &&
x.Task.IsActiveString == "true" && x.Task.TicketId == null)
.GroupBy(x => x.TaskId).Select(x => x.First()).Count();
.GroupBy(x => x.TaskId).Select(x => x.First()).CountAsync();
//overdueTasksCount = _accountContext.Tasks.Include(x =>
// x.Assigns).Count(x => !x.Assigns.Any(a => a.IsCancel) && !x.Assigns.Any(a => a.IsCanceledRequest) &&
@@ -2065,43 +2377,49 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
}
else
{
overdueTasksCount = _accountContext.Assigns.Include(x => x.Task).Where(x => x.AssignedId == userId &&
overdueTasksCount = await _accountContext.Assigns.Include(x => x.Task).Where(x => x.AssignedId == userId &&
!x.IsCancel && !x.IsCanceledRequest &&
!x.IsDone && !x.TimeRequest && !x.IsDoneRequest && x.EndTaskDate.Date <= DateTime.Now.Date &&
x.Task.IsActiveString == "true" && x.Task.TicketId == null)
.GroupBy(x => x.TaskId).Select(x => x.First()).Count();
.GroupBy(x => x.TaskId).Select(x => x.First()).CountAsync();
;
}
return overdueTasksCount;
}
public int TasksHaveTicketCounts(long userId)
public List<Tasks> GetTasksByTaskScheduleId(long taskScheduleId)
{
return _accountContext.Assigns.Include(x => x.Task).Where(x =>
return _accountContext.Tasks.Include(x=>x.Assigns).Where(x => x.TaskScheduleId != null && x.TaskScheduleId == taskScheduleId).ToList();
}
public async Task<int> TasksHaveTicketCounts(long userId)
{
return await _accountContext.Assigns.Include(x => x.Task).Where(x =>
!x.IsDone && x.Task.IsActiveString == "true" && !x.IsCancel &&
!x.IsCanceledRequest && !x.IsDoneRequest &&
!x.TimeRequest && (x.AssignerId == userId || x.AssignedId == userId) &&
(x.Task.TicketId != null && x.Task.TicketId > 0)).GroupBy(x => x.TaskId).Count();
(x.Task.TicketId != null && x.Task.TicketId > 0)).GroupBy(x => x.TaskId).CountAsync();
}
public int TasksHaveTicketRequestsCount(long userId)
public async Task<int> TasksHaveTicketRequestsCount(long userId)
{
var positionValue = int.Parse(_contextAccessor.HttpContext.User.FindFirst("PositionValue").Value);
var accountId = long.Parse(_contextAccessor.HttpContext.User.FindFirst("AccountId").Value);
if (positionValue == 1)
{
return _accountContext.Assigns.Include(x => x.Task).Where(x =>
return await _accountContext.Assigns.Include(x => x.Task).Where(x =>
!x.IsDone && x.Task.IsActiveString == "true" && !x.IsCancel &&
(x.IsCanceledRequest || x.TimeRequest || x.IsDoneRequest) && (accountId == x.Task.SenderId) && x.Task.TicketId != null && x.Task.TicketId > 0).GroupBy(x => x.TaskId)
.Select(x => x.First()).Count();
.Select(x => x.First()).CountAsync();
}
else
{
return _accountContext.Assigns.Include(x => x.Task).Where(x =>
return await _accountContext.Assigns.Include(x => x.Task).Where(x =>
!x.IsDone && x.Task.IsActiveString == "true" && !x.IsCancel &&
(x.IsCanceledRequest || x.TimeRequest || x.IsDoneRequest) && (accountId == x.Task.SenderId) && x.Task.TicketId != null && x.Task.TicketId > 0).GroupBy(x => x.TaskId)
.Select(x => x.First()).Count();
.Select(x => x.First()).CountAsync();
}
}

View File

@@ -0,0 +1,66 @@
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using AccountManagement.Application.Contracts.Media;
using AccountManagement.Application.Contracts.TaskSchedule;
using AccountManagement.Domain.TaskScheduleAgg;
using Microsoft.EntityFrameworkCore;
namespace AccountMangement.Infrastructure.EFCore.Repository;
public class TaskScheduleRepository: RepositoryBase<long, TaskSchedule>, ITaskScheduleRepository
{
private readonly AccountContext _accountContext;
public TaskScheduleRepository(AccountContext accountContext):base(accountContext)
{
_accountContext = accountContext;
}
public async Task<TaskScheduleDetailsViewModel> GetDetails(long id)
{
var taskSchedule=await _accountContext.TaskSchedules.Include(x=>x.TasksList).ThenInclude(x=>x.Assigns)
.Include(x=>x.TasksList).ThenInclude(x=>x.TaskMedias).ThenInclude(x=>x.Media).FirstOrDefaultAsync(x => x.id == id);
if (taskSchedule == null)
{
return null;
}
var firstTaskDetails = taskSchedule.TasksList.First();
var firstTimeAssigns = firstTaskDetails.Assigns.Where(x=>x.FirstTimeCreation).ToList();
var assignedIds = firstTimeAssigns.Select(x => x.AssignedId).ToList();
var senderId = firstTaskDetails.SenderId;
var assignedAccounts = await _accountContext.Accounts.Where(x => assignedIds.Contains(x.id)).ToListAsync();
var sender =
await _accountContext.Accounts.FirstOrDefaultAsync(x => senderId == x.id);
var viewModel = new TaskScheduleDetailsViewModel()
{
Title = firstTaskDetails.Title,
Description = firstTaskDetails.Description,
ContractingPartyName = firstTaskDetails.ContractingPartyName,
AssignedName = assignedAccounts.Select(x=>x.Fullname).ToList(),
CreationDateFa = firstTaskDetails.CreationDate.ToFarsi(),
SenderName = sender.Fullname,
TaskScheduleType = taskSchedule.Type,
TaskScheduleUnitType = taskSchedule.UnitType,
UnitNumber = taskSchedule.UnitNumber,
Medias = firstTaskDetails.TaskMedias.Select(x=> new MediaViewModel()
{
Category = x.Media.Category,
Id = x.MediaId,
Type = x.Media.Type,
Path = x.Media.Path,
}).ToList(),
};
return viewModel;
}
}

View File

@@ -59,7 +59,7 @@ namespace ServiceHost.Areas.Admin.Pages
_ticketApplication = ticketApplication;
}
public void OnGet()
public async Task OnGet()
{
long userId = _authHelper.CurrentAccountId();
var todayGr = DateTime.Now;
@@ -75,7 +75,7 @@ namespace ServiceHost.Areas.Admin.Pages
day = todayFa.Substring(8, 2);
year = todayFa.Substring(0, 4);
TaskCount = _taskApplication.RequestedAndOverdueTasksCount(userId);
TaskCount = await _taskApplication.RequestedAndOverdueTasksCount(userId);
TicketCount = _ticketApplication.GetAdminTicketsCount();
//foreach (string fileEntry in fileEntries)

View File

@@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System.Collections.Generic;
using System.Globalization;
using AccountManagement.Application.Contracts.TaskSchedule;
using Microsoft.AspNetCore.Authorization;
using Company.Domain.HolidayAgg;
using CompanyManagment.App.Contracts.Employer;
@@ -32,9 +33,9 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
private readonly IHolidayItemApplication _holidayItemApplication;
private readonly IEmployerApplication _employerApplication;
private readonly IWorkshopApplication _workshopApplication;
private readonly ITaskScheduleApplication _taskScheduleApplication;
public CreateModel(ITaskApplication taskApplication, IAccountApplication accountApplication, IPersonalContractingPartyApp personalContractingPartyApp, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp, IPositionApplication positionApplication, ITaskSubjectApplication taskSubjectApplication, IWebHostEnvironment webHostEnvironment, IHolidayApplication holidayApplication, IHolidayItemApplication holidayItemApplication, IEmployerApplication employerApplication, IWorkshopApplication workshopApplication)
public CreateModel(ITaskApplication taskApplication, IAccountApplication accountApplication, IPersonalContractingPartyApp personalContractingPartyApp, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp, IPositionApplication positionApplication, ITaskSubjectApplication taskSubjectApplication, IWebHostEnvironment webHostEnvironment, IHolidayApplication holidayApplication, IHolidayItemApplication holidayItemApplication, IEmployerApplication employerApplication, IWorkshopApplication workshopApplication, ITaskScheduleApplication taskScheduleApplication)
{
_taskApplication = taskApplication;
_accountApplication = accountApplication;
@@ -45,6 +46,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
_holidayItemApplication = holidayItemApplication;
_employerApplication = employerApplication;
_workshopApplication = workshopApplication;
_taskScheduleApplication = taskScheduleApplication;
}
public CreateTask Command { get; set; }
@@ -87,6 +89,16 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
{
Command.SenderId = _authHelper.CurrentAccountId();
Command.Description = Command.Description?.Replace("\n", "<br>");
if (Command.HasSchedule)
{
var scheduleResult = _taskScheduleApplication.Create(Command);
return new JsonResult(new
{
IsSuccedded = scheduleResult.IsSuccedded,
message = scheduleResult.Message,
});
}
var result = _taskApplication.CreateTask(Command);
return new JsonResult(new
{

View File

@@ -0,0 +1,445 @@
@model AccountManagement.Application.Contracts.Task.CreateTaskModal
@* @model ServiceHost.Areas.AdminNew.Pages.Company.Task.CreateModel *@
@inject _0_Framework.Application.IAuthHelper AuthHelper;
@{
string adminVersion = _0_Framework.Application.Version.AdminVersion;
ViewData["title"] = " - وظیفه جدید";
}
<script src="~/AssetsClient/js/jquery-ui.js"></script>
<link href="~/assetsadminnew/tasks/css/task-manager-create.css?ver=@adminVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/select2.css?ver=@adminVersion" rel="stylesheet" />
<link href="~/assetsadminnew/tasks/css/createschedulemodal.css?ver=@adminVersion" rel="stylesheet" />
<div class="modal-content">
<div class="modal-header d-block text-center position-relative">
<button type="button" class="btn-close position-absolute text-start cancelAndRefresh"></button>
<h5 class="modal-title" id="morakhasiEstehghaghiModalLabel">ایجاد وظیفه</h5>
</div>
<div class="modal-body tm-create">
<form role="form" method="post" id="create-form" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" asp-for="Command.SenderId" />
<input type="hidden" asp-for="TicketId" id="TicketId" />
<div class="row">
<div class="col-12 mb-1" id="PermissionDisable">
<div class="d-flex justify-content-between align-items-center mb-2">
<div class="form-check form-checked selectRadioBox">
<input type="radio" class="tm-selection-rad" name="Command.HasSchedule" id="normalTask" value="false" autocomplete="off">
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="normalTask">وظیفه معمولی</label>
</div>
<div class="form-check form-checked selectRadioBox">
<input type="radio" class="tm-selection-rad" name="Command.HasSchedule" value="true" id="scheduleTask" autocomplete="off">
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="scheduleTask">وظیفه دوره ای</label>
</div>
</div>
<div class="d-flex justify-content-between align-items-center">
<div permission="90310" class="form-check form-checked selectRadioBox">
<input type="radio" class="tm-selection-rad" name="selectMemberOrGroup" id="memberSelect" autocomplete="off" @(AuthHelper.GetPermissions().Any(x => x == 90311) ? "" : "checked")>
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="memberSelect">ارسال انفرادی</label>
</div>
<div permission="90311" class="form-check form-checked selectRadioBox">
<input type="radio" class="tm-selection-rad" name="selectMemberOrGroup" id="groupSelect" autocomplete="off">
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="groupSelect">ارسال گروهی</label>
</div>
</div>
</div>
<div class="col-12 my-1">
<div class="from-group" id="select2MemberList">
<select class="form-select select2Member disable" multiple="multiple" name="Command.ReceiverId" @(AuthHelper.GetPermissions().Any(x => x == 90311) ? Html.Raw("disabled") : "")>
<option value="@Model.Id">خودم</option>
@foreach (var item in Model.AccountsList)
{
<option value="@item.Id">@item.Fullname</option>
}
</select>
</div>
<div class="from-group" id="select2GroupList" style="display: none">
<select class="form-select select2Group disable" multiple="multiple" asp-for="Command.PositionId" disabled="disabled">
@foreach (var item in Model.PositionViewModels)
{
<option value="@item.Id">@item.Name</option>
}
</select>
</div>
</div>
<div class="col-12 my-1">
<div class="from-group position-relative ">
<input type="text" asp-for="Command.ContractingPartyName" id="partyNameSearch" class="form-control" autocomplete="off" placeholder="طرف حساب" onkeyup="searchPartyNameTask()">
<div id="partyName" class="selectDiv" style="display: none;">
<ul class="searchResult" id="searchResult">
</ul>
</div>
</div>
</div>
<div class="col-12 my-1">
<div class="from-group input-group position-relative taskTitle" style="height: 35px;">
<span class="input-group-text" id="append_title" style="display: none;font-size: 12px; border-radius: 0px 8px 8px 0px;width: 170px;"></span>
<input type="text" asp-for="Command.Title" class="form-control m-0 TaskTitleSearch" placeholder="عنوان وظیفه" id="taskTitle" onkeyup="searchSubjectTask()" style="border-radius: 8px 0 0 8px">
<div permission="90313" class="position-absolute" style="top: 5px; left: 3px; cursor: pointer; z-index: 6" id="CRUDTaskSubjectBtn">
@* onclick="taskSubjectModal() *@
<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 w-100" style="display: none;">
<ul id="searchTitleResult" class="searchTitleResult">
</ul>
</div>
</div>
</div>
<div class="col-12 my-1 scheduleTask">
<div class="d-flex justify-content-between align-items-center gap-2">
<div class="btn-Holder">
<input type="radio" class="tm-rad btn-schedule" asp-for="Command.ScheduleType" value="Unlimited" id="infinity" autocomplete="off">
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="infinity">نامحدود</label>
</div>
<div class="btn-Holder">
<input type="radio" class="tm-rad btn-schedule" asp-for="Command.ScheduleType" value="Limited" id="limit" autocomplete="off">
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="limit">محدود</label>
</div>
<div class="input-Holder">
<input class="input-schedule disable" asp-for="Command.ScheduleCount" id="count" type="text" dir="ltr" placeholder="تعداد"/>
</div>
</div>
</div>
<div class="col-12 my-1 scheduleTask">
<div class="from-group scheduleTaskHolder">
<label class="labelTM">بازه دوره</label>
<div class="d-flex schedulePartHodler">
<div class="from-group schedulePart" id="scheduleTypeSelector">
<select class="form-select select2ScheduleTypeSelector scheduleTypeSelector">
<option id="type0" value="0">انتخاب...</option>
<option id="type1" value="Day">روزانه</option>
<option id="type2" value="Week">هفتگی</option>
<option id="type3" value="Month">ماهانه</option>
</select>
</div>
<div class="from-group schedulePart selectType default" id="scheduleTypeDefault">
<select class="form-select select2Period ">
<option id ="default0" value=0>انتخاب...</option>
</select>
</div>
<div class="from-group schedulePart selectType" id="scheduleTypeDay" style="display: none;">
<select class="form-select select2Period ">
<option id ="day0" value=0>انتخاب...</option>
<option id="d1" value="1">1</option>
<option id="d2" value="2">2</option>
<option id="d3" value="3">3</option>
<option id="d4" value="4">4</option>
<option id="d5" value="5">5</option>
<option id="d6" value="6">6</option>
<option id="d7" value="7">7</option>
<option id="d8" value="8">8</option>
<option id="d9" value="9">9</option>
<option id="d10" value="10">10</option>
<option id="d11" value="11">11</option>
<option id="d12" value="12">12</option>
<option id="d13" value="13">13</option>
<option id="d14" value="14">14</option>
<option id="d15" value="15">15</option>
<option id="d16" value="16">16</option>
<option id="d17" value="17">17</option>
<option id="d18" value="18">18</option>
<option id="d19" value="19">19</option>
<option id="d20" value="20">20</option>
<option id="d21" value="21">21</option>
<option id="d22" value="22">22</option>
<option id="d23" value="23">23</option>
<option id="d24" value="24">24</option>
<option id="d25" value="25">25</option>
<option id="d26" value="26">26</option>
<option id="d27" value="27">27</option>
<option id="d28" value="28">28</option>
<option id="d29" value="29">29</option>
</select>
</div>
<div class="from-group schedulePart selectType" id="scheduleTypeWeek" style="display: none;">
<select class="form-select select2Period ">
<option value=0>انتخاب...</option>
<option value="first">اول هفته</option>
<option value="last">آخر هفته</option>
</select>
</div>
<div class="from-group schedulePart selectType" id="scheduleTypeMonth" style="display: none;">
<select class="form-select select2Period ">
<option id="m0" value=0>انتخاب...</option>
<option id="m1" value="1">1</option>
<option id="m2" value="2">2</option>
<option id="m3" value="3">3</option>
<option id="m4" value="4">4</option>
<option id="m5" value="5">5</option>
<option id="m6" value="6">6</option>
<option id="m7" value="7">7</option>
<option id="m8" value="8">8</option>
<option id="m9" value="9">9</option>
<option id="m10" value="10">10</option>
<option id="m11" value="11">11</option>
<option id="m12" value="12">12</option>
</select>
</div>
</div>
</div>
</div>
<div class="col-12 my-1">
<div class="row select-time-section">
<div class="col-4 timeSelect1 pe-0">
<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">امروز</label>
</div>
<div class="col-4 timeSelect2 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">فردا</label>
</div>
<div class="col-4 timeSelect3 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">پس فردا</label>
</div>
<div class="from-group position-relative ">
<input asp-for="Command.EndTaskDate" type="text" id="EndTaskDate" value="" class="form-control text-center date EndTaskDateStyle textFormTM m-0" placeholder="تاریخ" onkeyup="CheckHoliday()">
<div class="text-center" id="HolidayError" style="font-size: 11px; color: red; position: absolute; top: 50%; right: 40px; font-weight: 700; transform: translate(0px, -50%); display: none;">تعطیل</div>
</div>
</div>
</div>
<div class="col-12 my-1">
<div class="from-group">
<label for="EndTaskTime" class="labelTM">ساعت انجام وظیفه (اختیاری)</label>
<input asp-for="Command.EndTaskTime" id="EndTaskTime" type="text" class="form-control text-center textFormTM m-0" placeholder="00:00">
</div>
</div>
@* <div class="col-5 col-md-4">
<span class="sumDays">مهلت زمانی: </span>
</div> *@
<div class="col-12 my-1">
<div class="from-group">
<textarea asp-for="Command.Description" id="Command_Description" class="tm-textarea p-2" rows="6" placeholder="توضیحات ..." style="resize: none; display: block"></textarea>
<div class="upload-voice-container align-items-center justify-content-center" style="display: none">
<div id="upload-voice-recording" class="text-center" style="display: none">
<svg width="63" height="62" viewBox="0 0 63 62" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M29.94 42.8076V42.5805L29.7139 42.5588C25.9145 42.1942 22.709 40.6562 20.4538 38.2294C18.1993 35.8033 16.8813 32.4746 16.8813 28.5034V24.6695C16.8813 23.7829 17.5993 23.0901 18.4997 23.0901C19.4 23.0901 20.118 23.7829 20.118 24.6695V28.3672C20.118 31.7435 21.2628 34.5597 23.2701 36.532C25.2769 38.5039 28.1261 39.6129 31.4999 39.6129C34.8737 39.6129 37.7229 38.5039 39.7298 36.532C41.7371 34.5597 42.8819 31.7435 42.8819 28.3672V24.6695C42.8819 23.7863 43.6159 23.0901 44.5197 23.0901C45.4165 23.0901 46.1185 23.7796 46.1185 24.6695V28.5034C46.1185 32.4746 44.8006 35.8033 42.5461 38.2294C40.2909 40.6562 37.0853 42.1942 33.286 42.5588L33.0599 42.5805V42.8076V46.7583V47.0083H33.3099H40.4522C41.3524 47.0083 42.09 47.7205 42.09 48.6071C42.09 49.476 41.3507 50.206 40.4522 50.206H22.5476C21.6492 50.206 20.9099 49.476 20.9099 48.6071C20.9099 47.7205 21.6474 47.0083 22.5476 47.0083H29.69H29.94V46.7583V42.8076ZM38.1198 28.0558C38.1198 32.2488 35.3021 35.0844 31.4999 35.0844C27.6977 35.0844 24.88 32.2488 24.88 28.0558V14.9388C24.88 10.7457 27.6977 7.91016 31.4999 7.91016C35.3021 7.91016 38.1198 10.7457 38.1198 14.9388V28.0558Z" fill="url(#paint0_linear_1349_16648)" stroke="url(#paint1_linear_1349_16648)" stroke-width="0.5" />
<g filter="url(#filter0_bd_1349_16648)">
<circle cx="31.5" cy="31" r="13" fill="#2AB8B8" fill-opacity="0.6" shape-rendering="crispEdges" />
<circle cx="31.5" cy="31" r="12.65" stroke="url(#paint2_linear_1349_16648)" stroke-width="0.7" shape-rendering="crispEdges" />
</g>
<path d="M30.63 36.1383C30.9524 36.1383 31.1933 35.8829 31.1933 35.575V25.9867C31.1933 25.6716 30.9452 25.4234 30.63 25.4234C30.3149 25.4234 30.0667 25.6716 30.0667 25.9867V35.575C30.0667 35.8837 30.3141 36.1383 30.63 36.1383ZM34.1048 35.0139C34.4264 35.0139 34.6681 34.7649 34.6681 34.4506V27.1111C34.6681 26.796 34.42 26.5478 34.1048 26.5478C33.7833 26.5478 33.5415 26.7968 33.5415 27.1111V34.4506C33.5415 34.7649 33.7833 35.0139 34.1048 35.0139ZM28.8898 34.206C29.2098 34.206 29.4587 33.9586 29.4587 33.6426V27.9191C29.4587 27.6032 29.2098 27.3558 28.8898 27.3558C28.573 27.3558 28.3321 27.6056 28.3321 27.9191V33.6426C28.3321 33.9562 28.573 34.206 28.8898 34.206ZM32.3703 33.494C32.6878 33.494 32.9279 33.2378 32.9279 32.9307V28.631C32.9279 28.3175 32.687 28.0677 32.3703 28.0677C32.0479 28.0677 31.8069 28.3231 31.8069 28.631V32.9307C31.8069 33.2386 32.0479 33.494 32.3703 33.494ZM35.8394 32.5335C36.161 32.5335 36.4027 32.2845 36.4027 31.9702V29.5915C36.4027 29.2772 36.161 29.0282 35.8394 29.0282C35.5178 29.0282 35.2761 29.2772 35.2761 29.5915V31.9702C35.2761 32.2853 35.5243 32.5335 35.8394 32.5335ZM27.1552 32.0872C27.4768 32.0872 27.7185 31.8382 27.7185 31.5239V30.0379C27.7185 29.7243 27.4719 29.4689 27.1552 29.4689C26.832 29.4689 26.5919 29.7251 26.5919 30.0379V31.5239C26.5919 31.8382 26.8336 32.0872 27.1552 32.0872Z" fill="url(#paint3_linear_1349_16648)" fill-opacity="0.8" stroke="url(#paint4_linear_1349_16648)" stroke-width="0.2" />
<defs>
<filter id="filter0_bd_1349_16648" x="10.5" y="10" width="42" height="42" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix" />
<feGaussianBlur in="BackgroundImageFix" stdDeviation="3" />
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_1349_16648" />
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
<feOffset />
<feGaussianBlur stdDeviation="4" />
<feComposite in2="hardAlpha" operator="out" />
<feColorMatrix type="matrix" values="0 0 0 0 0.164706 0 0 0 0 0.721569 0 0 0 0 0.721569 0 0 0 0.64 0" />
<feBlend mode="normal" in2="effect1_backgroundBlur_1349_16648" result="effect2_dropShadow_1349_16648" />
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_1349_16648" result="shape" />
</filter>
<linearGradient id="paint0_linear_1349_16648" x1="16.4428" y1="5.31527" x2="57.5413" y2="18.8131" gradientUnits="userSpaceOnUse">
<stop stop-color="#329E7A" />
<stop offset="1" stop-color="#25A2A2" />
</linearGradient>
<linearGradient id="paint1_linear_1349_16648" x1="32.739" y1="7.66016" x2="31.3903" y2="50.4134" gradientUnits="userSpaceOnUse">
<stop stop-color="#CFFFFF" />
<stop offset="1" stop-color="#CFFFFF" stop-opacity="0.5" />
</linearGradient>
<linearGradient id="paint2_linear_1349_16648" x1="32.5833" y1="18" x2="32.0137" y2="43.9875" gradientUnits="userSpaceOnUse">
<stop stop-color="#CFFFFF" />
<stop offset="1" stop-color="#CFFFFF" stop-opacity="0.5" />
</linearGradient>
<linearGradient id="paint3_linear_1349_16648" x1="26.5911" y1="24.4548" x2="41.2864" y2="29.531" gradientUnits="userSpaceOnUse">
<stop stop-color="#FFFAFA" />
<stop offset="1" stop-color="#FFFAFA" stop-opacity="0.4" />
</linearGradient>
<linearGradient id="paint4_linear_1349_16648" x1="31.4973" y1="36.0383" x2="31.7227" y2="25.5283" gradientUnits="userSpaceOnUse">
<stop stop-color="white" stop-opacity="0.8" />
<stop offset="1" stop-color="white" stop-opacity="0.2" />
</linearGradient>
</defs>
</svg>
</div>
<div id="waveArea" class="align-items-center" style="width: 100%; padding:5px;">
<input type="file" class="d-none" id="Command_Voice">
@* <audio controls id="playAudio" style="display: none;">
<source src="" type="audio/ogg" >
Your browser does not support the audio element.
</audio> *@
<div class="audio-player">
<div id="showUploadedVoice">
</div>
<div id="waveform" class="waveform"></div>
<button type="button" id="play-pause" class="player-btn play"></button>
</div>
<div class="d-flex justify-content-between align-items-center mx-1 d-none" id="upload-container-voice">
<div class="upload-box-voice empty loadingButton" id="msg_box" style="display: none">
<div class="spinner-loading loading" style="display: none">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="fileAttchaMentBtns px-2 d-flex justify-content-between align-items-center">
<div class="d-flex justify-content-between alien-items-center">
<button class="upload-file align-items-center justify-content-center d-flex record_btn" id="upload-voice" type="button">
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="11.855" y="7" width="5.25" height="10.2667" rx="2.625" stroke="white" stroke-width="1.5" stroke-linejoin="round" />
<path d="M8.47998 14.4672C8.47998 16.1363 9.10112 17.7459 10.2205 18.9399C11.3414 20.1356 12.8725 20.8172 14.48 20.8172C16.0875 20.8172 17.6185 20.1356 18.7394 18.9399C19.8588 17.7459 20.48 16.1363 20.48 14.4672" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M14.48 23.8003V21.9336" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<span class="d-none" style="font-size: 12px">پیام صوتی</span>
</button>
<button class="upload-file" id="upload-doc" type="submit">
<svg id="svgFileUpload" width="16" height="18" viewBox="0 0 16 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.1643 9.60644L7.07781 15.9186C6.41012 16.611 5.50455 17 4.5603 17C3.61605 17 2.71047 16.611 2.04279 15.9186C1.3751 15.2261 1 14.287 1 13.3077C1 12.3285 1.3751 11.3893 2.04279 10.6969L10.6982 1.72061C10.9187 1.49207 11.1804 1.31081 11.4684 1.18716C11.7564 1.06352 12.0651 0.999924 12.3768 1C12.6886 1.00008 12.9972 1.06383 13.2852 1.18761C13.5731 1.31139 13.8348 1.49278 14.0551 1.72143C14.2755 1.95007 14.4503 2.22149 14.5695 2.52019C14.6887 2.81889 14.7501 3.13902 14.75 3.46229C14.7499 3.78557 14.6885 4.10566 14.5691 4.4043C14.4497 4.70294 14.2748 4.97428 14.0544 5.20282L5.39261 14.1857M5.39261 14.1857L5.39973 14.1775M5.39261 14.1857C5.1679 14.4091 4.86756 14.5311 4.5563 14.5271C4.24504 14.523 3.94779 14.3922 3.72862 14.163C3.50944 13.9337 3.38589 13.6244 3.38459 13.3016C3.38328 12.9787 3.50434 12.6683 3.72165 12.4372L9.90071 6.02906" stroke="white" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<span class="d-none">بارگذاری تصاویر و مدارک</span>
@* <div id="progressBar" style="display: none">0</div> *@
</button>
</div>
<div id="upload-container-doc">
@* <div class="col-4">
<div class="upload-box empty inBox1 loadingButton">
<div class="spinner-loading loading" style="display: none">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div> *@
@* <div class="col-4">
<div class="upload-box empty inBox2 loadingButton">
<div class="spinner-loading loading" style="display: none">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
<div class="col-4">
<div class="upload-box empty inBox3 loadingButton">
<div class="spinner-loading loading" style="display: none">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
<div class="col-4">
<div class="upload-box empty inBox4 loadingButton">
<div class="spinner-loading loading" style="display: none">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
<div class="col-4">
<div class="upload-box empty inBox5 loadingButton">
<div class="spinner-loading loading" style="display: none">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
<div class="col-4">
<div class="upload-box empty inBox6 loadingButton">
<div class="spinner-loading loading" style="display: none">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div> *@
</div>
<div id="fileItems" style="display: none"></div>
<div id="voiceItem" style="display: none"></div>
</div>
<input type="file" class="d-none" id="Command_Document1" accept=".pdf,.doc,.docx,.txt, image/*">
<input type="file" class="d-none" id="Command_Document2" accept=".pdf,.doc,.docx,.txt, image/*">
<input type="file" class="d-none" id="Command_Document3" accept=".pdf,.doc,.docx,.txt, image/*">
<input type="file" class="d-none" id="Command_Document4" accept=".pdf,.doc,.docx,.txt, image/*">
<input type="file" class="d-none" id="Command_Document5" accept=".pdf,.doc,.docx,.txt, image/*">
<input type="file" class="d-none" id="Command_Document6" accept=".pdf,.doc,.docx,.txt, image/*">
</div>
</div>
<div class="row my-2">
<div class="col-6 text-center">
@* <a asp-page="/Company/Task/Index" id="cancel" class="btn-tm-cancel m-1 text-white" type="button"> *@
<button class="btn-tm-cancel text-white cancelAndRefresh" type="button">
<span>انصراف</span>
</button>
</div>
<div class="col-6 text-center">
<button type="button" id="save" class="btn-tm-save position-relative">
<span>ارسال</span>
<div class="spinner-loading loading" style="display: none">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</button>
@* <a href="#" id="save" class="btn-tm-save">ارسال</a> *@
</div>
</div>
</form>
</div>
</div>
<!-- مودال -->
@* <div class="modal fade" id="CRUDTaskSubjectModal" tabindex="-1" aria-labelledby="CRUDTaskSubjectModalLabel" data-bs-backdrop="false" aria-hidden="true" > *@
<div id="CRUDTaskSubjectModal" style="display: none">
<div class="modal-dialog modal-dialog-centered TaskSubjectSection">
<div class="w-100" id="ModalCRUDSearchSubject">
<partial name="CreateCRUDTaskSubjectModal" />
</div>
</div>
</div>
<!-- مودال -->
<script src="~/assetsclient/js/site.js?ver=@adminVersion"></script>
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script src="~/AssetsAdminNew/libs/wavesurfer/wavesurfer.min.js"></script>
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var createTaskSaveModalAjax = '@Url.Page("/Company/Task/Create", "CreateSaveTask")';
var createTaskTicketSaveModalAjax = '@Url.Page("/Company/Ticket/Index", "CreateSaveTicketTask")';
var searchContractingPartiesModalAjax = '@Url.Page("./Create", "SearchContractingParties")';
var searchTaskSubjectModal = '@Url.Page("./Create", "SearchTaskSubject")';
var taskSubjectModal = '@Url.Page("/Company/Task/Create", "TaskSubject")';
var checkIsHolidayModalAjax = '@Url.Page("./Create", "CheckHoliday")';
var uploadFileModalAjax = '@Url.Page("/Company/Task/Create", "UploadFile")';
var deleteFileModalAjax = '@Url.Page("./Create", "DeleteFile")';
var deleteAllFilesModalAjax = '@Url.Page("./Create", "RemoveAllTempFiles")';
console.log(uploadFileModalAjax);
</script>
<script src="~/assetsadminnew/tasks/js/Createschedulemodal.js?ver=@adminVersion"></script>

View File

@@ -0,0 +1,255 @@
@model AccountManagement.Application.Contracts.TaskSchedule.TaskScheduleDetailsViewModel
@using System.Security.Claims
@using AccountManagement.Application.Contracts.Media
@using AccountManagement.Application.Contracts.Task
@{
string adminVersion = _0_Framework.Application.Version.AdminVersion;
MediaViewModel voice = null;
string svgName = "unknow";
string[] fileExtensions = new string[]
{
".ai", ".avi", ".bmp", ".crd", ".csv", ".dll", ".doc", ".docx", ".dwg",
".eps", ".exe", ".flv", ".giff", ".html", ".iso", ".java", ".jpg", ".mdb",
".mid", ".mov", ".mp3", ".mp4", ".mpeg", ".pdf", ".png", ".ppt", ".ps",
".psd", ".pub", ".rar", ".raw", ".rss", ".svg", ".tiff", ".txt", ".wav",
".wma", ".xml", ".xsl", ".zip"
};
int i = 1;
<script src="~/AssetsClient/js/jquery-ui.js"></script>
<link href="~/assetsadminnew/tasks/css/task-manager-create.css?ver=@adminVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/select2.css?ver=@adminVersion" rel="stylesheet" />
<link href="~/assetsadminnew/tasks/css/detailmodal.css?ver=@adminVersion" rel="stylesheet" />
<link href="~/assetsadminnew/libs/sweetalert2/sweetalert2.min.css" rel="stylesheet" />
<style>
.modal-xl-taskTime {
max-width: 720px;
}
.title-sub {
font-size: 14px;
color: #838383;
}
</style>
}
<div class="modal-content">
<div class="modal-header d-block header-custom-color">
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
<div class="text-center">جزئیات تسک دوره‌ای</div>
</div>
<div class="modal-body p-0">
<div class="container-fluid">
<div class="row text-start">
<div class="col-12 col-md-6 mt-3">
<div class="title-sub" style="color: #838383">
ارجاع دهنده:
<span class="text-black">@Model.SenderName</span>
</div>
</div>
<div class="col-12 col-md-6 text-md-end mt-3">
<div class="title-sub">
ارجاع گیرنده:
<span class="text-black">@Model.AssignedName?.First()</span>
</div>
</div>
<div class="col-12 col-md-4 mt-3">
<div class="title-sub">
محدودیت:
<span class="text-black">
@(Model.TaskScheduleType == TaskScheduleType.Limited ? "محدود" : "نامحدود")
</span>
</div>
</div>
<div class="col-12 col-md-4 text-md-center mt-3">
<div class="title-sub">
دوره بازه:
<span class="text-black">
@{
var unitTypeText = Model.TaskScheduleUnitType switch
{
TaskScheduleUnitType.Day => "روزه",
TaskScheduleUnitType.Week => "هفته",
TaskScheduleUnitType.Month => "ماهه",
TaskScheduleUnitType.Year => "سال",
_ => "نامشخص"
};
}
@if (Model.UnitNumber == "first")
{
@("اول هفته")
}
else if (Model.UnitNumber == "last")
{
@("آخر هفته")
}
else
{
@Model.UnitNumber @unitTypeText
}
</span>
</div>
</div>
<div class="col-12 col-md-4 text-md-end mt-3">
<div class="title-sub">
تاریخ ایجاد:
<span class="text-black">@Model.CreationDateFa</span>
</div>
</div>
<div class="col-12 mt-3">
<div class="title-sub">
طرف حساب:
<span class="text-black">@Model.ContractingPartyName</span>
</div>
</div>
<div class="col-12 mt-3">
<div class="title-sub">
عنوان وظیفه:
<span class="text-black">@Model.Title</span>
</div>
</div>
<hr class="mt-4"/>
<div class="col-12 mt-2">
<div class="title-sub">
توضیحات:
</div>
<div>
@if (!String.IsNullOrWhiteSpace(Model.Description))
{
<div class="taskDesc">
<div class="taskDescText" id="taskDescText">
@Html.Raw(Model.Description)
</div>
</div>
}
@if (Model.Medias.Count > 0)
{
@foreach (var item in Model.Medias)
{
if (item.Category == "صوت")
{
voice = item;
<div class="audio-player">
<div id="waveform" class="waveform"></div>
<button id="play-pause" class="player-btn play"></button>
</div>
}
}
}
@if (Model.Medias.Count > 0)
{
<div class="d-flex align-items-center justify-content-end mt-2">
@foreach (var item in Model.Medias)
{
if (item.Category == "فایل")
{
string fileName = System.IO.Path.GetFileName(item.Path);
string extension = System.IO.Path.GetExtension(fileName);
string nameWithoutExtension = fileName.Substring(0, fileName.LastIndexOf("."));
int maxLength = 20 - extension.Length;
int sliceLength = Math.Max((maxLength - 3) / 2, 0);
string start = nameWithoutExtension.Substring(0, Math.Min(sliceLength, nameWithoutExtension.Length));
string end = nameWithoutExtension.Substring(Math.Max(nameWithoutExtension.Length - sliceLength, 0));
var inBox = "inBox" + i;
@if (item.Path.EndsWith(".jpg") || item.Path.EndsWith(".jpeg") || item.Path.EndsWith(".png") || item.Path.EndsWith(".gif") || item.Path.EndsWith(".webp"))
{
<div class="upload-box empty inBox@(i)">
<section class="gallery">
<section class="container">
<div class="row p-0">
<div class="lightbox_img_wrap">
<img class="lightbox-enabled min-img" src="@Url.Page("./Index", "ShowPicture", new { filePath = item.Path })" data-imgsrc="@Url.Page("./Index", "ShowPicture", new { filePath = item.Path })" />
</div>
</div>
</section>
</section>
<section class="lightbox-container">
<span class="material-symbols-outlined material-icons lightbox-btn left" id="left">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5" />
</svg>
</span>
<span class="material-symbols-outlined material-icons lightbox-btn right" id="right">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>
</span>
<span id="close" class="close material-icons material-symbols-outlined">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
</svg>
</span>
<div class="lightbox-image-wrapper">
<img alt="lightboximage" class="lightbox-image">
</div>
</section>
</div>
}
else
{
if (fileExtensions.Contains(extension))
{
svgName = extension.TrimStart('.').ToLower();
<a href="@Url.Page("./Index", "GetFile", new { filePath = item.Path, id = 1 })"><img class="uploaded-file" src="/common/filesvg/@(svgName).svg" /></a>
}
else
{
<a href="@Url.Page("./Index", "GetFile", new { filePath = item.Path, id = 1 })"><img class="uploaded-file" src="/common/filesvg/unknow.svg" /></a>
}
}
i++;
}
}
</div>
}
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-center align-items-center p-2">
<div class="row w-100">
<div class="col-12 text-end">
<button type="button" class="btn-cancel2 d-flex align-items-center justify-content-center w-100" data-bs-dismiss="modal">انصراف</button>
</div>
</div>
</div>
</div>
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
<script src="~/assetsclient/js/site.js"></script>
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script src="~/AssetsAdminNew/libs/wavesurfer/wavesurfer.min.js"></script>
<script src="~/assetsadminnew/libs/sweetalert2/sweetalert2.all.min.js"></script>
<script>
var voiceSrc = '@(voice == null ? "" : @Url.Page("./Index", "ShowVoice", new { filePath = voice?.Path }))';
</script>
<script src="~/assetsadminnew/tasks/js/detailsschedulemodal.js?ver=@adminVersion"></script>

View File

@@ -5,6 +5,23 @@
@{
string adminVersion = _0_Framework.Application.Version.AdminVersion;
var index = 1;
<style>
::-webkit-scrollbar {
width: 3px;
height: 6px;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.3);
border-radius: 10px;
}
::-webkit-scrollbar-track {
background-color: #f1f1f1;
border-radius: 10px;
}
</style>
}
@@ -21,8 +38,8 @@
<link href="~/AssetsClient/css/filter-search.css?ver=@adminVersion" rel="stylesheet" />
<!-- sweet alerts -->
@* <link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet"> *@
<link href="~/assetsadminnew/libs/sweetalert2/sweetalert2.min.css" rel="stylesheet" />
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
@* <link href="~/assetsadminnew/libs/sweetalert2/sweetalert2.min.css" rel="stylesheet" /> *@
<link href="~/assetsadminnew/tasks/css/index.css?ver=@adminVersion" rel="stylesheet" />
}
@@ -52,27 +69,32 @@
<!-- List Items -->
<div class="row">
<div class="col-12 mb-2">
<div class="d-flex w-100 section-btns-task justify-content-between">
<div class="d-flex w-100 section-btns-task gap-2 align-items-center pb-1">
@if (Model.UserPositionValue == 1)
{
<div class="d-flex">
<button type="button" class="btnTaskFilter btnTaskListSelfTask me-1 active" id="btnTaskListSelfTask" onclick="loadMore('selfTask');">وظایف شخصی
<span class="badge bg-danger rounded-pill me-1 " id="badgeOverdueCount1"></span>
</button>
<span class="badge bg-danger rounded-pill me-1 " id="badgeOverdueCount1"></span>
</button>
<button type="button" class="btnTaskFilter btnTaskListSent me-1" id="btnTaskListSent" onclick="loadMore('sent');">وظایف ارسالی</button>
@* <button type="button" class="btnTaskTicket me-1 d-flex align-items-center" id="btnTaskTicket" onclick="loadMore('ticket');">لیست پشتیبانی‌ها</button> *@
<button type="button" class="btnTaskFilter btnTaskRequest me-1 d-flex align-items-center" id="btnTaskRequest" permission="9012">
<button type="button" class="btnTaskFilter btnTaskRequest me-1 d-flex align-items-center" id="btnTaskRequest" permission="9012">
لیست درخواست‌ها
<span class="badge bg-danger rounded-pill me-1" id="badgeRequestCount1"></span>
</button>
<button type="button" class="btnTaskFilter btnTicketList me-1" id="btnTicketList">لیست تیکت
<span class="badge bg-danger rounded-pill me-1 " id="badgeTicketCount1"></span>
</button>
<span class="badge bg-danger rounded-pill me-1 " id="badgeTicketCount1"></span>
</button>
<button type="button" class="btnTaskFilter btnTicketRequestList me-1" id="btnTicketRequestList">لیست درخواست های تیکت
<span class="badge bg-danger rounded-pill me-1 " id="badgeTicketRequesttCount1"></span>
</button>
<span class="badge bg-danger rounded-pill me-1 " id="badgeTicketRequesttCount1"></span>
</button>
<button type="button" class="btnTaskFilter btnScheduleTask me-1" id="btnScheduleTask">وظایف دوره ای
<span class="badge bg-danger rounded-pill me-1 " id="badgeScheduleTaskCount1"></span>
</button>
</div>
<div>
<div class="spaceBar"></div>
</div>
<div class="d-flex">
<button type="button" class="btnTaskFilter btnTaskListAllTask me-1" id="btnTaskListAllTask" onclick="loadMore('AllTask');">کل وظایف</button>
@@ -96,7 +118,10 @@
</button>
<button type="button" class="btnTaskFilter btnTicketRequestList me-1" id="btnTicketRequestList">لیست درخواست های تیکت
<span class="badge bg-danger rounded-pill me-1 " id="badgeTicketRequesttCount2"></span>
</button>
</button>
<button type="button" class="btnTaskFilter btnTicketRequestList me-1" id="btnScheduleTask">وظایف دوره ای
<span class="badge bg-danger rounded-pill me-1 " id="badgeScheduleTaskCount2"></span>
</button>
</div>
}
</div>
@@ -401,8 +426,8 @@
@section Script {
<script src="~/assetsclient/js/site.js?ver=@adminVersion"></script>
<script src="~/AssetsClient/js/dropdown.js?ver=@adminVersion"></script>
@* <script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script> *@
<script src="~/assetsadminnew/libs/sweetalert2/sweetalert2.all.min.js"></script>
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
@* <script src="~/assetsadminnew/libs/sweetalert2/sweetalert2.all.min.js"></script> *@
<script>
@@ -412,6 +437,7 @@
var loadMoreAjax = "@Url.Page("./Index", "TaskPagination")";
// var loadRequestCountAjax = "@Url.Page("./Index", "RequestCount")";
var removeAjax = "@Url.Page("./Index", "RemoveTask")";
var removeScheduleAjax = "@Url.Page("./Index", "RemoveScheduleTask")";
var employeeListAjax = "@Url.Page("./Index", "EmployeeList")";
var AssignPermission = "@AuthHelper.GetPermissions().Any(x => x == 90110)";
var timeRequestPermission = "@AuthHelper.GetPermissions().Any(x => x == 90111)";

View File

@@ -6,6 +6,7 @@ using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.Assign;
using AccountManagement.Application.Contracts.Position;
using AccountManagement.Application.Contracts.Task;
using AccountManagement.Application.Contracts.TaskSchedule;
using AccountManagement.Application.Contracts.Ticket;
using AccountManagement.Application.Contracts.TicketAccessAccount;
using AccountManagement.Domain.AssignAgg;
@@ -41,10 +42,11 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
private readonly IYearlySalaryApplication _yearlySalaryApplication;
private readonly ITicketApplication _ticketApplication;
private readonly ITicketAccessAccountApplication _ticketAccessAccountApplication;
private readonly ITaskScheduleApplication _scheduleApplication;
public IndexModel(ITaskApplication taskApplication, IAuthHelper authHelper,
IAccountApplication accountApplication, IPositionApplication positionApplication,
IWebHostEnvironment environment, IYearlySalaryApplication yearlySalaryApplication, ITicketApplication ticketApplication, ITicketAccessAccountApplication ticketAccessAccountApplication)
IWebHostEnvironment environment, IYearlySalaryApplication yearlySalaryApplication, ITicketApplication ticketApplication, ITicketAccessAccountApplication ticketAccessAccountApplication, ITaskScheduleApplication scheduleApplication)
{
_taskApplication = taskApplication;
_authHelper = authHelper;
@@ -54,6 +56,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
_yearlySalaryApplication = yearlySalaryApplication;
_ticketApplication = ticketApplication;
_ticketAccessAccountApplication = ticketAccessAccountApplication;
_scheduleApplication = scheduleApplication;
}
public List<TaskViewModel> TaskViewModels { get; set; }
@@ -74,7 +77,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
base.OnPageHandlerExecuting(context);
}
public IActionResult OnGet(TaskSearchModel searchModel)
public async Task<IActionResult> OnGet(TaskSearchModel searchModel)
{
if (_authHelper.GetPermissions().Any(x => x == 901))
{
@@ -82,7 +85,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
searchModel.PageIndex = 0;
var accountId = _authHelper.CurrentAccountId();
SearchModel = searchModel;
RequestCount = _taskApplication.GetRequestedTasksCount();
RequestCount = await _taskApplication.GetRequestedTasksCount();
LastPositionValue = _positionApplication.GetLastPositionValue();
UserPositionValue = (int)_authHelper.CurrentAccountInfo().PositionValue;
@@ -150,15 +153,16 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
else if (searchModel.TypeOfTask == "TaskHaveTicketRequests")
{
taskList = _taskApplication.GetRequestTaskHasTicket(searchModel);
}
else
}
else if (searchModel.TypeOfTask == "schedule")
{
taskList = _taskApplication.GetTaskScheduleList(searchModel);
}
else
{
return BadRequest();
}
}
else
{
} else {
if (searchModel.TypeOfTask == "request")
{
taskList = _taskApplication.GetRequestedTasks(searchModel);
@@ -179,7 +183,11 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
{
taskList = _taskApplication.GetRequestTaskHasTicket(searchModel);
}
else
else if (searchModel.TypeOfTask == "schedule")
{
taskList = _taskApplication.GetTaskScheduleList(searchModel);
}
else
{
return BadRequest();
}
@@ -195,13 +203,13 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
});
}
public IActionResult OnGetRequestCount()
public async Task<IActionResult> OnGetRequestCount()
{
var accountId = _authHelper.CurrentAccountId();
var requestCount = _taskApplication.GetRequestedTasksCount();
var ticketCount = _taskApplication.TasksHaveTicketCounts(accountId);
var requestTicketCount = _taskApplication.TasksHaveTicketRequestsCount(accountId);
var overdueTasks = _taskApplication.OverdueTasksCount(accountId);
var requestCount = await _taskApplication.GetRequestedTasksCount();
var ticketCount = await _taskApplication.TasksHaveTicketCounts(accountId);
var requestTicketCount = await _taskApplication.TasksHaveTicketRequestsCount(accountId);
var overdueTasks = await _taskApplication.OverdueTasksCount(accountId);
return new JsonResult(new
{
@@ -765,7 +773,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
DateFa = DateTime.Now.ToFarsi(),
Id = _authHelper.CurrentAccountId()
};
return Partial("CreateModal", model);
return Partial("CreateScheduleModal", model);
}
else
{
@@ -799,9 +807,29 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task
}
#region Tickets
#region Schedule Task
public IActionResult OnPostSaveAdminResponseTicket(ResponseTicket command)
public async Task<IActionResult> OnGetDetailsScheduleTaskModal(long taskScheduleId)
{
var command = await _scheduleApplication.GetDetails(taskScheduleId);
return Partial("DetailsScheduleModal", command);
}
public IActionResult OnPostRemoveScheduleTask(long taskScheduleId)
{
var operation = _scheduleApplication.Remove(taskScheduleId);
return new JsonResult(new
{
success = operation.IsSuccedded,
message = operation.Message,
});
}
#endregion
#region Tickets
public IActionResult OnPostSaveAdminResponseTicket(ResponseTicket command)
{
command.AdminId = _authHelper.CurrentAccountId();
command.Response = command.Response?.Replace("\n", "<br>");

View File

@@ -67,7 +67,7 @@ namespace ServiceHost.Areas.AdminNew.Pages
public async Task<IActionResult> OnGetLayoutCountTask()
{
var currentAccountId = _authHelper.CurrentAccountId();
int taskCount = _taskApplication.RequestedAndOverdueTasksCount(currentAccountId);
int taskCount = await _taskApplication.RequestedAndOverdueTasksCount(currentAccountId);
return new JsonResult(new
{

View File

@@ -289,6 +289,11 @@
};
});
$('.btnWorkFlow').filter(function () {
if (this.href === url || this.href === url2) {
$(this).addClass('active');
};
});
activateLink('.clik', '.sdf1');
activateLink('.clik2', '.sdf2');
activateLink('.clik3', '.sdf3');
@@ -330,144 +335,142 @@
});
});
_RefreshTaskCountMenu();
function _RefreshTaskCountMenu() {
$.ajax({
async: true,
dataType: 'json',
url: '/AdminNew?handler=LayoutCountTask',
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET',
success: function (response) {
if (response.success) {
if (response.data === 0) {
$('#_taskCountSection').hide();
$('#_taskCount').hide();
$('#spinnerTask').hide();
} else {
$('#_taskCountSection').show();
$('#spinnerTask').hide();
$('#_taskCount').show();
$('#_taskCount').text(response.data);
}
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
_RefreshTicketCountMenu();
function _RefreshTicketCountMenu() {
$.ajax({
async: true,
dataType: 'json',
url: '/AdminNew?handler=LayoutCountTicket',
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET',
success: function (response) {
if (response.success) {
if (response.data === 0) {
$('#_ticketCountSection').hide();
$('#spinnerTicket').hide();
$('#_ticketCount').hide();
} else {
$('#_ticketCountSection').show();
$('#spinnerTicket').hide();
$('#_ticketCount').show();
$('#_ticketCount').text(response.data);
}
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
_RefreshWorkFlowCountMenu();
function _RefreshWorkFlowCountMenu() {
$.ajax({
async: true,
dataType: 'json',
url: '/AdminNew?handler=LayoutCountWorkFlow',
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET',
success: function (response) {
if (response.success) {
if (response.data === 0) {
$('#_workFlowCountSection').hide();
$('#spinnerWorkFlow').hide();
$('#_workFlowCount').hide();
} else {
$('#_workFlowCountSection').show();
$('#spinnerWorkFlow').hide();
$('#_workFlowCount').show();
$('#_workFlowCount').text(response.data);
}
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
_RefreshCheckerCountMenu();
function _RefreshCheckerCountMenu() {
$.ajax({
//async: true,
dataType: 'json',
url: '/AdminNew?handler=LayoutCountChecker',
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET',
success: function (response) {
console.log(response);
if (response.success) {
if (response.data === 0) {
$('#_checkerCountSection').hide();
$('#_checkerCount').hide();
$('#spinnerChecker').hide();
} else {
$('#_checkerCountSection').show();
$('#spinnerChecker').hide();
$('#_checkerCount').show();
$('#_checkerCount').text(response.data);
}
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
// Override the global fetch function to handle errors
$.ajaxSetup({
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status === 500) {
try {
const errorData = jqXHR.responseJSON;
$('.alert-msg').show();
$('.alert-msg p').text(errorData.message || "خطای سمت سرور");
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
} catch (e) {
$('.alert-msg').show();
$('.alert-msg p').text("خطای سمت سرور");
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
console.error("Error parsing response:", e);
_RefreshTaskCountMenu();
function _RefreshTaskCountMenu() {
$.ajax({
async: true,
dataType: 'json',
url: '/AdminNew?handler=LayoutCountTask',
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET',
success: function (response) {
if (response.success) {
if (response.data === 0) {
$('#_taskCountSection').hide();
$('#_taskCount').hide();
$('#spinnerTask').hide();
} else {
$('#_taskCountSection').show();
$('#spinnerTask').hide();
$('#_taskCount').show();
$('#_taskCount').text(response.data);
}
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
_RefreshTicketCountMenu();
function _RefreshTicketCountMenu() {
$.ajax({
async: true,
dataType: 'json',
url: '/AdminNew?handler=LayoutCountTicket',
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET',
success: function (response) {
if (response.success) {
if (response.data === 0) {
$('#_ticketCountSection').hide();
$('#spinnerTicket').hide();
$('#_ticketCount').hide();
} else {
$('#_ticketCountSection').show();
$('#spinnerTicket').hide();
$('#_ticketCount').show();
$('#_ticketCount').text(response.data);
}
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
_RefreshWorkFlowCountMenu();
function _RefreshWorkFlowCountMenu() {
$.ajax({
async: true,
dataType: 'json',
url: '/AdminNew?handler=LayoutCountWorkFlow',
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET',
success: function (response) {
if (response.success) {
if (response.data === 0) {
$('#_workFlowCountSection').hide();
$('#spinnerWorkFlow').hide();
$('#_workFlowCount').hide();
} else {
$('#_workFlowCountSection').show();
$('#spinnerWorkFlow').hide();
$('#_workFlowCount').show();
$('#_workFlowCount').text(response.data);
}
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
_RefreshCheckerCountMenu();
function _RefreshCheckerCountMenu() {
$.ajax({
//async: true,
dataType: 'json',
url: '/AdminNew?handler=LayoutCountChecker',
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET',
success: function (response) {
if (response.success) {
if (response.data === 0) {
$('#_checkerCountSection').hide();
$('#_checkerCount').hide();
$('#spinnerChecker').hide();
} else {
$('#_checkerCountSection').show();
$('#spinnerChecker').hide();
$('#_checkerCount').show();
$('#_checkerCount').text(response.data);
}
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
// Override the global fetch function to handle errors
$.ajaxSetup({
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status === 500) {
try {
const errorData = jqXHR.responseJSON;
$('.alert-msg').show();
$('.alert-msg p').text(errorData.message || "خطای سمت سرور");
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
} catch (e) {
$('.alert-msg').show();
$('.alert-msg p').text("خطای سمت سرور");
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
console.error("Error parsing response:", e);
}
}
}
});
</script>
@RenderSection("Script", false)

View File

@@ -1,4 +1,96 @@
.errored {
.spaceBar {
width:60px;
border: 1px dashed #3BD1D1;
}
#EndTaskDate {
direction: ltr;
}
.unhighlighted {
background-color: #DDF4F4 !important;
}
.highlighted {
background-color: #ECFFFF !important;
}
.highlighted .btn-taskmanager-more, .unhighlighted .btn-taskmanager-more {
background: rgba(83, 83, 83, 0.5);
border: 0.5px solid #535353;
border-radius: 6px;
position: relative;
overflow: hidden;
color: #ffffff;
text-align: right;
font-size: 11px;
padding: 3px;
font-style: normal;
font-weight: 400;
line-height: normal;
white-space: nowrap;
width: 73px;
}
.widthLastCustom {
width: 12% !important;
}
.highlighted .btn-taskmanager-delete, .unhighlighted .btn-taskmanager-delete {
background: rgba(83, 83, 83, 0.5);
border: 0.5px solid #535353;
border-radius: 6px;
position: relative;
overflow: hidden;
color: #ffffff;
text-align: right;
font-size: 11px;
padding: 3px;
font-style: normal;
font-weight: 400;
line-height: normal;
white-space: nowrap;
margin: 0 0 0 5px;
}
.highlighted .btn-taskmanager-edit, .unhighlighted .btn-taskmanager-edit {
background: rgba(83, 83, 83, 0.5);
border: 0.5px solid #535353;
border-radius: 6px;
position: relative;
overflow: hidden;
color: #ffffff;
text-align: right;
font-size: 11px;
padding: 3px;
font-style: normal;
font-weight: 400;
line-height: normal;
white-space: nowrap;
margin: 0 0 0 5px;
}
.width1Custom {
width: 2.5% !important;
}
.table-task-manager .Rtable .Rtable-row .width20 .color-width2:before {
content: "";
position: absolute;
top: -14px;
right: 0;
width: 100%;
height: 46px;
background-color: #35353540;
z-index: 0;
}
.Rtable-row--head .width20, .Rtable-row .width20 {
width: 30% !important;
}
.errored {
animation: shake 300ms;
color: #eb3434 !important;
background-color: #fef2f2 !important;
@@ -115,7 +207,7 @@
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #c1bbbb;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s;
@@ -138,7 +230,7 @@
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #c1bbbb;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s;
@@ -155,7 +247,7 @@
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #c1bbbb;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s;
@@ -174,7 +266,7 @@
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #c1bbbb;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s
@@ -193,7 +285,7 @@
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #c1bbbb;
color: #3A3A3A;
width: 210px;
text-align: center;
transition: all ease -in -out .3s
@@ -202,7 +294,7 @@
.btnTaskListSent:hover {
border: 1px solid #979797;
background-color: #a8f5f5;
color: #494949;
color: #3A3A3A;
}
.btnTaskListReceived {
@@ -212,7 +304,7 @@
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #c1bbbb;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s
@@ -231,7 +323,7 @@
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #c1bbbb;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s
@@ -251,7 +343,7 @@
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #c1bbbb;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s
@@ -270,7 +362,7 @@
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #c1bbbb;
color: #494949;
width: 210px;
justify-content: center;
gap: 8px;
@@ -290,7 +382,7 @@
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #c1bbbb;
color: #494949;
width: 210px;
justify-content: center;
transition: all ease -in -out .3s
@@ -302,21 +394,41 @@
color: #494949;
}
.btnTaskListSelfTask.active,
.btnTaskListAllTask.active,
.btnTaskListSent.active,
.btnTaskListReceived.active,
.btnTaskList.active,
.btnTaskRequest.active,
.btnTaskTicket.active,
.btnTaskRequestAll.active,
.btnTicketList.active,
.btnTicketRequestList.active {
.btnScheduleTask {
padding: 10px 30px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
background-color: #c0f9f9;
border: 1px solid #c0f9f9;
color: #494949;
width: 210px;
text-align: center;
transition: all ease -in -out .3s;
}
.btnScheduleTask:hover {
border: 1px solid #979797;
background-color: #a8f5f5;
color: #494949;
background-color: #42e5e5;
border: 1px solid #42e5e5;
pointer-events: none;
}
.btnTaskListSelfTask.active,
.btnTaskListAllTask.active,
.btnTaskListSent.active,
.btnTaskListReceived.active,
.btnTaskList.active,
.btnTaskRequest.active,
.btnTaskTicket.active,
.btnTaskRequestAll.active,
.btnTicketList.active,
.btnTicketRequestList.active,
.btnScheduleTask.active{
color: #494949;
background-color: #42e5e5;
border: 1px solid #42e5e5;
pointer-events: none;
}
.form-control {
border-radius: 7px;
@@ -360,6 +472,12 @@
opacity: 0.3;
}
@media(max-width: 1400px) {
.widthLastCustom {
width: 20% !important;
}
}
@media(max-width:992px) {
/* .actionBtnsection {
width: 89% !important;
@@ -434,6 +552,12 @@
font-size: 11px;
}
.btnScheduleTask {
padding: 5px;
width: 150px;
font-size: 11px;
}
.btnTaskListReceived {
padding: 5px;
width: 130px;

View File

@@ -1,6 +1,4 @@
.errored {
animation: shake 300ms;
color: #eb3434 !important;
@@ -57,4 +55,10 @@
.invalidTime {
color: #b91c1c !important;
}
}
.form-check, .form-switch {
overflow: hidden;
padding-right: 0;
border-radius: 10px;
}

View File

@@ -0,0 +1,176 @@
.errored {
animation: shake 300ms;
color: #eb3434 !important;
background-color: #fef2f2 !important;
border: 1px solid #eb3434 !important;
border-radius: 7px;
}
.modal-content {
height: 890px;
}
.modal-body {
padding-top: 10px;
}
.modal-header {
height: 55px;
}
.modal-header .btn-close {
opacity: 1;
}
.modal-title {
font-weight: 400;
color: #000000
}
.select2.select2-container .select2-selection {
background-color: #F6F6F6;
}
.tm-create .tm-textarea {
height: 248px;
}
/* Start Select2 */
.select2.select2-container .select2-selection {
display: flex !important;
/*height: 0 !important;*/
padding: 0;
}
.select2.select2-container .select2-selection--multiple .select2-selection__rendered {
margin: 0;
}
.select2-container--default .select2-search--inline .select2-search__field {
line-height: 32px;
padding: 0 0;
font-family: 'IRANYekanX';
}
/*.select2.select2-container .select2-selection--multiple {
height: 0;
}
.select2.select2-container .select2-selection--multiple .select2-selection__rendered {
margin: 0;
}
.select2.select2-container .select2-selection--multiple .select2-search--inline .select2-search__field {
height: 0;
}
.select2.select2-container .select2-selection--multiple .select2-selection__rendered {
line-height: 0;
}
.select2.select2-container .select2-selection--multiple .select2-selection__choice {
margin: 0 4px 0 0;
}
.select2.select2-container .select2-selection {
padding: 4px 0;
}
*/
/* End Select2 */
.validTime {
color: #4d7c0f !important;
}
.invalidTime {
color: #b91c1c !important;
}
.btn-Holder {
width: 40%;
border-radius:8px;
overflow: hidden;
}
.input-Holder {
width: 20%;
}
.btn-schedule {
width: 100%;
background-color: #DDF4F4;
font-size: 16px;
height: 34px;
color: #0F8080;
border-radius: 8px;
}
.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
border-radius: 8px !important;
}
.input-schedule {
width: 100%;
border: 1px solid #DADADA;
border-radius: 7px;
background-color: #F6F6F6;
height: 34px;
font-size: 13px;
text-align: center;
}
.input-schedule::placeholder {
font-size: 12px;
color: #797979;
}
.btn-schedule.active {
background-image: linear-gradient(to right, #2EBEBE, #1E9D9D, #0B7878);
color: white;
}
.schedulePart {
width: 50%;
}
.schedulePart .select2-selection.select2-selection--multiple {
border-radius: 0;
}
.schedulePart .select2-selection.select2-selection--multiple {
border-radius: 0;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
left: -565% !important;
top: 45% !important;
}
.select2.select2-container .select2-selection .select2-selection__rendered {
line-height: 28px;
}
#scheduleTypeSelector .select2-selection.select2-selection--single {
border-radius: 0 0 8px 0;
}
#scheduleTypeDefault .select2-selection.select2-selection--single, #scheduleTypeDay .select2-selection.select2-selection--single, #scheduleTypeWeek .select2-selection.select2-selection--single, #scheduleTypeMonth .select2-selection.select2-selection--single {
border-radius: 0 0 0 8px;
}
.select2-container .select2-dropdown .select2-search{
display: none !important;
}
#Command_Title {
border-radius: 8px !important;
}
.select2.select2-container.select2-container--open .select2-selection.select2-selection--multiple {
border: 1px solid #1dc9a0;
}
/*.selectRadioBox > label.radio-btn {
font-size: 16px;
}*/
.form-check, .form-switch {
padding-right: 0;
border-radius: 10px;
overflow: hidden;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,158 @@
$(document).ready(function() {
loadGallery();
});
// برای نمایش تصاویر
function loadGallery() {
if ($('.gallery').length) {
// Lightbox Gallery
(function () {
var lightboxEnabled = document.querySelectorAll('.lightbox-enabled');
var lightboxArray = Array.from(lightboxEnabled);
var lastImage = lightboxArray.length - 1;
var lightboxContainer = document.querySelector('.lightbox-container');
var lightboxImage = document.querySelector('.lightbox-image');
var lightboxBtns = document.querySelectorAll('.lightbox-btn');
var lightboxBtnRight = document.querySelector('#right');
var lightboxBtnLeft = document.querySelector('#left');
var close = document.querySelector('#close');
let activeImage;
var showLightBox = () => { lightboxContainer.classList.add('active'); }
var hideLightBox = () => {
lightboxContainer.classList.remove('active');
document.removeEventListener('keydown', handleKeyDown);
}
var setActiveImage = (image) => {
lightboxImage.src = image.dataset.imgsrc;
activeImage = lightboxArray.indexOf(image);
}
var transitionSlidesLeft = () => {
lightboxBtnLeft.focus();
$('.lightbox-image').addClass('slideright');
setTimeout(function () {
activeImage === 0 ? setActiveImage(lightboxArray[lastImage]) : setActiveImage(lightboxArray[activeImage - 1]);
}, 250);
setTimeout(function () {
$('.lightbox-image').removeClass('slideright');
}, 500);
}
var transitionSlidesRight = () => {
lightboxBtnRight.focus();
$('.lightbox-image').addClass('slideleft');
setTimeout(function () {
activeImage === lastImage ? setActiveImage(lightboxArray[0]) : setActiveImage(lightboxArray[activeImage + 1]);
}, 250);
setTimeout(function () {
$('.lightbox-image').removeClass('slideleft');
}, 500);
}
var transitionSlideHandler = (moveItem) => {
moveItem.includes('left') ? transitionSlidesLeft() : transitionSlidesRight();
}
var handleKeyDown = (e) => {
if (e.key === 'ArrowLeft') {
transitionSlidesLeft();
} else if (e.key === 'ArrowRight') {
transitionSlidesRight();
} else if (e.key === 'Escape' || e.key === 'Esc') {
hideLightBox();
}
}
lightboxEnabled.forEach(image => {
image.addEventListener('click', (e) => {
showLightBox();
setActiveImage(image);
document.addEventListener('keydown', handleKeyDown);
});
});
lightboxContainer.addEventListener('click', () => { hideLightBox(); });
close.addEventListener('click', () => { hideLightBox(); });
lightboxBtns.forEach(btn => {
btn.addEventListener('click', (e) => {
e.stopPropagation();
transitionSlideHandler(e.currentTarget.id);
});
});
lightboxImage.addEventListener('click', (e) => {
e.stopPropagation();
});
})();
}
}
// برای نمایش تصاویر
var wavesurfer = null;
if (voiceSrc) {
waveVoice(voiceSrc);
}
function waveVoice(voiceSrc) {
// Ensure identifiers are only declared once
var playPauseButton = $('#play-pause');
var currentTimeEl = $('#current-time');
var durationEl = $('#duration');
var voiceSource = decodeURIComponent(voiceSrc.replace(/&amp;/g, '&'));
// If a wavesurfer instance already exists, destroy it
if (wavesurfer) {
wavesurfer.destroy();
}
// Initialize Wavesurfer
wavesurfer = WaveSurfer.create({
container: '#waveform',
waveColor: '#e0e0e0',
progressColor: '#23a9a9',
cursorWidth: 2,
cursorColor: '#23a9a9',
height: 40,
barWidth: 2,
responsive: true
});
// Load the audio file
wavesurfer.load(`${voiceSource}`);
$("#waveArea").show();
// Play/pause functionality
playPauseButton.off('click'); // Remove previous event handlers
playPauseButton.on('click', function () {
if (wavesurfer.isPlaying()) {
wavesurfer.pause();
playPauseButton.removeClass('pause').addClass('play');
} else {
wavesurfer.play();
playPauseButton.removeClass('play').addClass('pause');
}
});
// Update time and progress
wavesurfer.on('audioprocess', function () {
currentTimeEl.text(formatTime(wavesurfer.getCurrentTime()));
});
// Set duration once ready
wavesurfer.on('ready', function () {
durationEl.text(formatTime(wavesurfer.getDuration()));
});
// Format time function
function formatTime(seconds) {
var minutes = Math.floor(seconds / 60);
seconds = Math.floor(seconds % 60);
return minutes + ':' + (seconds < 10 ? '0' : '') + seconds;
}
}

View File

@@ -546,8 +546,8 @@ function attachFileChangeHandler(fileInput, index) {
$(fileInput).off('change').on('change', function () {
let file = fileInput.files[0];
if (file.size > 50000000) {
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 50 مگابایت را انتخاب کنید.', 3500);
if (file.size > 5000000) {
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را انتخاب کنید.', 3500);
$(`#EditTask_Document${index}`).val('');
return;
}

View File

@@ -59,6 +59,8 @@ $(document).ready(function () {
$('.titleTaskList').html('لیست تیکت ها');
} else if ($('#btnTicketRequestList').hasClass('active')) {
$('.titleTaskList').html('لیست درخواست تیکت ها');
} else if ($('#btnScheduleTask').hasClass('active')) {
$('.titleTaskList').html('لیست وظایف دوره ای');
}
});
@@ -115,6 +117,8 @@ $(document).on('click', '#searchBtn', function () {
loadMore('list');
} else if ($('#btnTaskTicket').hasClass('active')) {
loadMore('ticket');
} else if ($('#btnScheduleTask').hasClass('active')) {
loadMore('schedule');
} else if ($('#btnTaskRequest').hasClass('active')) {
loadMoreRequest('request');
} else if ($('#btnAllTaskRequest').hasClass('active')) {
@@ -160,6 +164,8 @@ $(document).on('click', '#searchBtnMobile', function () {
loadMore('received');
} else if ($('#btnTaskList').hasClass('active')) {
loadMore('list');
} else if ($('#btnScheduleTask').hasClass('active')) {
loadMore('schedule');
} else if ($('#btnTaskRequest').hasClass('active')) {
loadMoreRequest('');
} else if ($('#btnTicketRequestList').hasClass('active')) {
@@ -363,6 +369,29 @@ $(document).on('click', '.btn-clear-filter', function () {
loadMore('TasksHaveTicket');
});
$(document).on('click', "#btnScheduleTask", function () {
$('.titleTaskList').html('لیست وظایف دوره ای');
//$('#btnAllTaskRequest').removeClass('active');
$('.btnTaskFilter').removeClass('active');
$(this).addClass('active');
$('#tasksAjax').html('');
Number($('#pageIndex').val(0));
Number($('#AccountId').val(0));
$('#AccountId').trigger('change');
$('#StartDate').val('');
$('#EndDate').val('');
$('#IsDone').val('');
$('.dropdown-IsDone .item').removeClass("active");
$('.dropdown-IsDone .item:first').addClass("active");
$('.selected-display').text($('.dropdown-IsDone .item:first').text());
$('#GeneralSearch').val('');
$('#divTaskList').show();
$('#divTaskRequest').hide();
loadMore('schedule');
});
$(document).on('click', "#btnTicketRequestList", function () {
$('.titleTaskList').html('لیست درخواست تیکت ها');
$('.btnTaskFilter').removeClass('active');
@@ -476,6 +505,7 @@ function loadMore(type) {
$('#btnTaskList').removeClass('active');
$('#btnTaskTicket').removeClass('active');
$('#btnTaskRequest').removeClass('active');
$('#btnScheduleTask').removeClass('active');
} else if (type == 'AllTask') {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').addClass('active');
@@ -484,6 +514,7 @@ function loadMore(type) {
$('#btnTaskList').removeClass('active');
$('#btnTaskTicket').removeClass('active');
$('#btnTaskRequest').removeClass('active');
$('#btnScheduleTask').removeClass('active');
} else if (type == 'sent') {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').removeClass('active');
@@ -492,6 +523,7 @@ function loadMore(type) {
$('#btnTaskList').removeClass('active');
$('#btnTaskTicket').removeClass('active');
$('#btnTaskRequest').removeClass('active');
$('#btnScheduleTask').removeClass('active');
} else if (type == 'received') {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').removeClass('active');
@@ -500,6 +532,7 @@ function loadMore(type) {
$('#btnTaskList').removeClass('active');
$('#btnTaskTicket').removeClass('active');
$('#btnTaskRequest').removeClass('active');
$('#btnScheduleTask').removeClass('active');
} else if (type == 'ticket') {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').removeClass('active');
@@ -508,6 +541,7 @@ function loadMore(type) {
$('#btnTaskListReceived').removeClass('active');
$('#btnTaskList').removeClass('active');
$('#btnTaskRequest').removeClass('active');
$('#btnScheduleTask').removeClass('active');
} else if (type == 'list') {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').removeClass('active');
@@ -516,6 +550,16 @@ function loadMore(type) {
$('#btnTaskList').addClass('active');
$('#btnTaskTicket').removeClass('active');
$('#btnTaskRequest').removeClass('active');
$('#btnScheduleTask').removeClass('active');
} else if (type == 'schedule') {
$('#btnTaskListSelfTask').removeClass('active');
$('#btnTaskListAllTask').removeClass('active');
$('#btnTaskListSent').removeClass('active');
$('#btnTaskListReceived').removeClass('active');
$('#btnTaskList').removeClass('active');
$('#btnTaskTicket').removeClass('active');
$('#btnTaskRequest').removeClass('active');
$('#btnScheduleTask').addClass('active');
}
@@ -560,38 +604,399 @@ function loadMore(type) {
generalSearch:generalSearch
},
headers: { "RequestVerificationToken": `${antiForgeryToken}` },
success: function (response) {
if (response.pageIndex > 0) {
var n = pageIndex + 1;
var taskList = response.taskList;
if (n == 1) {
if (type === "schedule") {
html += `<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
<div class="Rtable-cell column-heading width1">ردیف</div>
<div class="Rtable-cell column-heading d-md-flex d-none width20">
<div class="w-100 text-center">ارجاع دهنده</div>
<div class="w-100 text-center">خودم</div>
<div class="w-100 text-center">ارجاع گیرنده</div>`;
html += `<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
<div class="Rtable-cell column-heading 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>`;
html += `</div>
<div class="Rtable-cell column-heading d-md-block d-none width4 text-center">تاریخ ایجاد</div>
<div class="Rtable-cell column-heading d-xxl-block d-none width4">تاریخ سررسید</div>
<div class="Rtable-cell column-heading d-md-block d-none width4">طرف حساب</div>
<div class="Rtable-cell column-heading width4">عنوان وظیفه</div>
<div class="Rtable-cell column-heading width1 text-center">محدودیت</div>
<div class="Rtable-cell column-heading width4 text-center">دوره بازه</div>
<div class="Rtable-cell column-heading width4 widthLastCustom text-end">عملیات</div>
</div>`;
} else {
html += `</div>
<div class="Rtable-cell column-heading d-md-block d-none width6">تاریخ ایجاد</div>
<div class="Rtable-cell column-heading d-md-block d-none width3">تاریخ سررسید</div>
<div class="Rtable-cell column-heading d-md-block d-none width4">طرف حساب</div>
<div class="Rtable-cell column-heading width5">عنوان وظیفه</div>
<div class="Rtable-cell column-heading width7 text-end">عملیات</div>
</div>`;
html += `<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
<div class="Rtable-cell column-heading 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>`;
html += `</div>
<div class="Rtable-cell column-heading d-md-block d-none width6">تاریخ ایجاد</div>
<div class="Rtable-cell column-heading d-md-block d-none width3">تاریخ سررسید</div>
<div class="Rtable-cell column-heading d-md-block d-none width4">طرف حساب</div>
<div class="Rtable-cell column-heading width5">عنوان وظیفه</div>
<div class="Rtable-cell column-heading width7 text-end">عملیات</div>
</div>`;
}
}
taskList.forEach(function (item) {
if (type === "schedule") {
var hightlighted = true;
taskList.forEach(function (item) {
hightlighted = !hightlighted
var successSend = item.status == "موفق" ? "successSend" : "";
var successSend = item.status == "موفق" ? "successSend" : "";
html += `<div id="DivRtable_${item.id}" class="Rtable-row align-items-center position-relative openAction ${hightlighted?"highlighted":"unhighlighted"}" style="cursor: pointer;">
<div class="Rtable-cell d-md-block d-flex width1">
<div class="Rtable-cell--content">
<span class="d-flex justify-content-center span-number">
${n}
</span>
</div>
</div>
html += `<div id="DivRtable_${item.id}" class="Rtable-row align-items-center position-relative openAction tm-${item.color}" style="cursor: pointer;">
<div class="Rtable-cell d-md-flex d-none width20">
<div class="Rtable-cell--content w-100 position-relative color-width2 text-center"><div class="position-relative">${item.assigner}</div></div>
<div class="Rtable-cell--content w-100 position-relative color-width2 text-center"><div class="position-relative">${item.selfName}</div></div>
<div class="Rtable-cell--content w-100 position-relative color-width2 text-center"><div class="position-relative">${item.assignedReceiverViewModel.assignedName}</div></div>
`;
html += `</div>`;
html += ` <div class="Rtable-cell d-md-block d-none width4">
<div class="Rtable-cell--content text-center">${item.createDate}</div>
</div>
<div class="Rtable-cell d-xxl-block d-none width4">
<div class="Rtable-cell--content ">${item.endTaskTime} ${item.endTaskDateFA}</div>
</div>
<div class="Rtable-cell d-md-block d-none width4">
<div class="Rtable-cell--content">
<div class="tooltipfull-container">
<p class="m-0 ellipsed">
<span>${item.contractingPartyName}</span>
</p>
<span class="tooltipfull" >
${item.contractingPartyName}
</span>
</div>
</div>
</div>
<div class="d-md-none d-block width4">
<div class="Rtable-cell--content text-center">
<div class="tooltipfull-container">
<p class="m-0 ellipsed">
<span>${item.assigner}</span>
</p>
</div>
<span class="tooltipfull" >
${item.assigner}
</span>
</div>
</div>
<div class="d-md-none d-block width4">
<div class="Rtable-cell--content text-center">
<div class="tooltipfull-container">
<p class="m-0 ellipsed">
<span>${item.assignedReceiverViewModel.assignedName}</span>
</p>
</div>
<span class="tooltipfull" >
${item.assignedReceiverViewModel.assignedName}
</span>
</div>
</div>
<div class="Rtable-cell d-md-block d-flex width4 text-start">
<div class="Rtable-cell--content">
<div class="tooltipfull-container">
<p class="m-0 ellipsed">
<span>${item.name}</span>
</p>
<span class="tooltipfull" >
${item.name}
</span>
</div>
<div class="tooltipfull-container d-md-none d-block">
<p class="m-0 ellipsed">
<span style="font-size: 10px; !important">${item.contractingPartyName}</span>
</p>
<span class="tooltipfull" style="font-size: 10px; !important">
${item.contractingPartyName}
</span>
</div>
</div>
</div>
<div class="Rtable-cell d-md-block d-none width1">
<div class="Rtable-cell--content text-center">${item.scheduleType === 0 ? "محدود" : "نامحدود"}</div>
</div>
<div class="Rtable-cell d-md-block d-none width4">
<div class="Rtable-cell--content text-center">`;
switch (item.scheduleUnitType) {
case 0:
html += `روزانه`;
break;
case 1:
html += `هفتگی`;
break;
case 2:
html += `ماهانه`;
break;
case 3:
html += `سالانه`;
break;
default:
html += ``;
}
html += `</div>
</div>`;
html += `<div class="Rtable-cell width4 widthLastCustom">
<div class="Rtable-cell--content align-items-center d-flex justify-content-end">`;
if (!item.isDone && !item.isCancel) {
html += `
${item.canDelete ?
`<button class="btn-taskmanager-delete d-md-block d-none" onclick="removeScheduleConfirm(${item.taskScheduleId})">
<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-delete d-md-block d-none btn-disable">
<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 d-md-block d-none" onclick="scheduleDetail(${item.taskScheduleId})">
<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>
<button class="btn-taskmanager-more position-relative d-md-none d-block">
<span class="align-items-center d-flex justify-content-center">
<p class="my-0"></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>`;
} else {
html += `
<button class="btn-taskmanager-delete d-md-block d-none btn-disable">
<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" onclick="scheduleDetail(${item.taskScheduleId})">
<span class="mx-1 align-items-center d-flex justify-content-center">
<p class="my-0 d-none d-md-block">جزئیات</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>`;
}
html += `</div>
</div>
</div>`;
if (!item.isDone && !item.isCancel) {
html += `<div id="OperationDiv_${item.id}" class="tm-${item.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">`;
//if (response.positions.length > 0) {
// response.positions.forEach(function (position) {
// 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}
// <span> - </span>
// </div>
//</div> `;
// }
// });
//}
html += `</div>
<div class="d-flex justify-content-between">
<div class="d-md-none d-block">
<div class="Rtable-cell--content text-center">
<div style="color:#313131; font-weight: 800;">ارجاع دهنده</div>
<div style="color:#1F1F1F">${item.assigner}</div>
</div>
</div>
<div class="d-md-none d-block">
<div class="Rtable-cell--content text-center">
<div style="color:#313131; font-weight: 800;">خودم</div>
<div style="color:#1F1F1F">${item.selfName}</div>
</div>
</div>
<div class="d-md-none d-block">
<div class="Rtable-cell--content text-center">
<div style="color:#313131; font-weight: 800;">ارجاع گیرنده</div>
<div style="color:#1F1F1F">${item.assignedReceiverViewModel.assignedName}</div>
</div>
</div>
</div>
<div class="d-flex justify-content-between">
<div class="d-md-none d-block">
<div class="Rtable-cell--content">
<span style="color:#404040">تاریخ سررسید:</span>
</div>
</div>
<div class="d-md-none d-block">
<div class="Rtable-cell--content">
<span style="color:#404040">${item.endTaskTime} ${item.endTaskDateFA}</span>
</div>
</div>
</div>
<div class="d-flex justify-content-between">
<div class="d-md-none d-block">
<div class="Rtable-cell--content">
<span style="color:#404040">محدودیت</span>
</div>
</div>
<div class="d-md-none d-block">
<div class="Rtable-cell--content">
<span style="color:#404040">${item.scheduleType === 0 ? "محدود" : "نامحدود"}</span>
</div>
</div>
</div>
<div class="d-flex justify-content-between">
<div class="d-md-none d-block">
<div class="Rtable-cell--content">
<span style="color:#404040">دوره بازه</span>
</div>
</div>
<div class="d-md-none d-block">
<div class="Rtable-cell--content">
<span style="color:#404040">`;
switch (item.scheduleUnitType) {
case 0:
html += `روزانه`;
break;
case 1:
html += `هفتگی`;
break;
case 2:
html += `ماهانه`;
break;
case 3:
html += `سالانه`;
break;
default:
html += ``;
}
html += `</span>
</div>
</div>
</div>
</div>
<div class="col-md-12 col-6 p-1">
<div class="d-flex justify-content-between">
<button class="btn-taskmanager-detail-mobile w-100 mx-1 d-md-none d-flex align-items-center justify-content-center" onclick="scheduleDetail(${item.taskScheduleId})">
<svg width="18" height="18" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.97119" y="2.69531" width="8.31979" height="10.5928" rx="2" stroke="#64748B"/>
<path d="M5.34863 5.8125H8.91426" stroke="#64748B" stroke-linecap="round"/>
<path d="M5.34863 8.30469H8.91426" stroke="#64748B" stroke-linecap="round"/>
<path d="M5.34863 10.7969H7.72572" stroke="#64748B" stroke-linecap="round"/>
</svg>
<span class="mx-1 d-flex">جزئیات</span>
</button>
</div>
</div>
<div class="col-md-12 col-6 p-1">
<div class="d-flex justify-content-between">
${item.canDelete ?
`<button class="btn-taskmanager-delete w-100 mx-1 d-md-none d-flex align-items-center justify-content-center" onclick="removeScheduleConfirm(${item.taskScheduleId})">
<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>`;
}
html += `</div>`;
n += 1;
});
} else {
taskList.forEach(function (item) {
var successSend = item.status == "موفق" ? "successSend" : "";
html += `<div id="DivRtable_${item.id}" class="Rtable-row align-items-center position-relative openAction tm-${item.color}" style="cursor: pointer;">
<div class="Rtable-cell d-md-block d-flex width1">
<div class="Rtable-cell--content">
<span class="d-flex justify-content-center span-number">
@@ -604,11 +1009,11 @@ function loadMore(type) {
<div class="Rtable-cell--content w-100 position-relative color-width2"><div class="position-relative">${item.assigner}</div></div>
<div class="Rtable-cell--content w-100 position-relative color-width2"><div class="position-relative">${item.selfName}</div></div>
<div class="Rtable-cell--content w-100 position-relative color-width2"><div class="position-relative">${item.assignedReceiverViewModel.assignedName}</div></div>`;
html += `</div>`;
html += `</div>`;
html += `<div class="Rtable-cell d-md-block d-none width6">
html += `<div class="Rtable-cell d-md-block d-none width6">
<div class="Rtable-cell--content ">${item.createDate}</div>
</div>
@@ -679,33 +1084,33 @@ function loadMore(type) {
</div>
</div>`;
html += `<div class="Rtable-cell width7">
html += `<div class="Rtable-cell width7">
<div class="Rtable-cell--content align-items-center d-flex justify-content-end">`;
if (!item.isDone && !item.isCancel) {
html += `
if (!item.isDone && !item.isCancel) {
html += `
${item.canEdit ?
`<button class="btn-taskmanager-edit position-relative d-md-block d-none" onclick="EditTask(${item.id})">
`<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 class="btn-taskmanager-edit position-relative d-md-block d-none btn-disable">
:
`<button class="btn-taskmanager-edit position-relative d-md-block d-none btn-disable">
<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>`
}
}
${item.canDelete ?
`<button class="btn-taskmanager-delete d-md-block d-none" onclick="removeConfirm(${item.id})">
`<button 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"/>
@@ -714,8 +1119,8 @@ function loadMore(type) {
</svg>
<span class="mx-1 d-md-none d-flex">حذف</span>
</button>`
:
`<button class="btn-taskmanager-delete d-md-block d-none btn-disable">
:
`<button class="btn-taskmanager-delete d-md-block d-none btn-disable">
<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"/>
@@ -724,7 +1129,7 @@ function loadMore(type) {
</svg>
<span class="mx-1 d-md-none d-flex">حذف</span>
</button>`
}
}
<button class="btn-taskmanager-delete position-relative d-md-block d-none" onclick="DiagramDetail(${item.id})">
<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -756,8 +1161,8 @@ function loadMore(type) {
</svg>
</span>
</button>`;
} else {
html += `
} else {
html += `
<button class="btn-taskmanager-edit position-relative d-md-block d-none btn-disable">
<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"/>
@@ -794,17 +1199,17 @@ function loadMore(type) {
</svg>
</span>
</button>`;
}
}
html += `</div>
html += `</div>
</div>
</div>`;
if (!item.isDone && !item.isCancel) {
html += `<div id="OperationDiv_${item.id}" class="tm-${item.color}-operation operation-div w-100">
if (!item.isDone && !item.isCancel) {
html += `<div id="OperationDiv_${item.id}" class="tm-${item.color}-operation operation-div w-100">
<div class="operations-btns">
<div class="row p-0">
<div class="col-md-12 col-12 p-1">
@@ -812,20 +1217,20 @@ function loadMore(type) {
<div class="d-flex">`;
//if (response.positions.length > 0) {
// response.positions.forEach(function (position) {
// 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}
// <span> - </span>
// </div>
//</div> `;
// }
// });
//}
//if (response.positions.length > 0) {
// response.positions.forEach(function (position) {
// 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}
// <span> - </span>
// </div>
//</div> `;
// }
// });
//}
html += `</div>
html += `</div>
<div class="d-flex justify-content-between">
<div class="d-md-none d-block">
<div class="Rtable-cell--content text-center">
@@ -886,7 +1291,7 @@ function loadMore(type) {
<div class="col-md-12 col-12 p-1">
<div class="d-flex justify-content-between">
${item.canEdit ?
`<button class="btn-taskmanager-edit position-relative w-100 mx-1 d-md-none d-flex align-items-center justify-content-center" onclick="EditTask(${item.id})">
`<button class="btn-taskmanager-edit position-relative w-100 mx-1 d-md-none d-flex align-items-center 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"/>
@@ -894,7 +1299,7 @@ function loadMore(type) {
<span class="mx-1 d-flex">ویرایش</span>
</button>`: ``}
${item.canDelete ?
`<button class="btn-taskmanager-delete w-100 mx-1 d-md-none d-flex align-items-center justify-content-center" onclick="removeConfirm(${item.id})">
`<button class="btn-taskmanager-delete w-100 mx-1 d-md-none d-flex align-items-center 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"/>
@@ -907,13 +1312,15 @@ function loadMore(type) {
</div>
</div>
</div>`;
}
}
html += `</div>`;
n += 1;
});
html += `</div>`;
n += 1;
});
}
$('#tasksAjax').append(html);
var newPageIndex = pageIndex + response.pageIndex;
@@ -981,7 +1388,7 @@ function loadMore(type) {
function loadTicketAndRequestCount() {
$.ajax({
async: false,
async: true,
dataType: 'json',
type: 'GET',
url: loadTicketCountAjax,
@@ -1329,6 +1736,8 @@ $(window).scroll(function () {
loadMore('TasksHaveTicket');
} else if ($('#btnTicketRequestList').hasClass('active')) {
loadMoreRequest('TaskHaveTicketRequests')
} else if ($('#btnScheduleTask').hasClass('active')) {
loadMoreRequest('schedule')
}
}
});
@@ -1581,6 +1990,57 @@ function remove(id) {
});
}
function removeScheduleConfirm(id) {
swal({
title: "آیا از حذف این وظیفه اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
}, function (isConfirm) {
if (isConfirm) {
removeSchedule(id);
}
});
}
function removeSchedule(id) {
var ID = Number(id);
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: `${removeScheduleAjax}`,
headers: { "RequestVerificationToken": `${antiForgeryToken}` },
data: { taskScheduleId: ID },
success: function (response) {
if (response.success) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
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 Operation(id, type) {
var task_ID = Number(id);
@@ -1604,6 +2064,12 @@ function Detail(id) {
window.location.href = goTo;
}
function scheduleDetail(id) {
var task_ID = Number(id);
var goTo = `#showmodal=/AdminNew/Company/Task/Index?taskScheduleId=${task_ID}&handler=DetailsScheduleTaskModal`;
window.location.href = goTo;
}
function DiagramDetail(id) {
var task_ID = Number(id);
var goTo = `#showmodal=/AdminNew/Company/Task/Index?taskId=${task_ID}&handler=DiagramDetailsTask`;

View File

@@ -626,8 +626,8 @@ function attachFileChangeHandler(fileInput, id, boxClass) {
e.preventDefault();
var fileInputFile = fileInput.files[0];
if (fileInputFile.size > 50000000) {
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 50 مگابایت را انتخاب کنید.', 3500);
if (fileInputFile.size > 5000000) {
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را انتخاب کنید.', 3500);
$(`#Command_Document${id}`).val('');
return;
}
@@ -1003,7 +1003,9 @@ if (navigator.mediaDevices.getUserMedia) {
}
$('.cancelAndRefresh').click(function () {
stop();
});
function play() {
audio.play();
msg_box.innerHTML = '<a href="#" onclick="pause(); return false;" class="txt_btn">' + lang.stop + '</a><br>' +