employeeDocument Refactor
@@ -245,21 +245,24 @@ public class AuthHelper : IAuthHelper
|
||||
|
||||
#region Pooya
|
||||
|
||||
public (long Id, UserType userType) GetUserTypeWithId()
|
||||
public (long Id, UserType userType, long roleId) GetUserTypeWithId()
|
||||
{
|
||||
if (!IsAuthenticated())
|
||||
return (0, UserType.Anonymous);
|
||||
return (0, UserType.Anonymous, 0);
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
|
||||
var subAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId")?.Value ?? "0");
|
||||
if (subAccountId > 0)
|
||||
return (subAccountId, UserType.SubAccount);
|
||||
return (subAccountId, UserType.SubAccount, 0);
|
||||
|
||||
var id = long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value);
|
||||
if (claims.FirstOrDefault(x => x.Type == "AdminAreaPermission")?.Value == "true")
|
||||
return (id, UserType.Admin);
|
||||
{
|
||||
var roleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value ?? "0");
|
||||
return (id, UserType.Admin, roleId);
|
||||
}
|
||||
|
||||
return (id, UserType.Client);
|
||||
return (id, UserType.Client, 0);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -23,5 +23,5 @@ public interface IAuthHelper
|
||||
long CurrentSubAccountId();
|
||||
string GetWorkshopSlug();
|
||||
string GetWorkshopName();
|
||||
(long Id, UserType userType) GetUserTypeWithId();
|
||||
(long Id, UserType userType, long roleId) GetUserTypeWithId();
|
||||
}
|
||||
@@ -7,100 +7,105 @@ using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using Microsoft.AspNetCore.JsonPatch.Operations;
|
||||
|
||||
namespace Company.Domain.EmployeeDocumentItemAgg
|
||||
namespace Company.Domain.EmployeeDocumentItemAgg;
|
||||
|
||||
public class EmployeeDocumentItem : EntityBase
|
||||
{
|
||||
public class EmployeeDocumentItem : EntityBase
|
||||
private EmployeeDocumentItem() { }
|
||||
public long WorkshopId { get; private set; }
|
||||
public long EmployeeId { get; private set; }
|
||||
|
||||
public long UploaderId { get; private set; }
|
||||
public UserType UploaderType { get; private set; }
|
||||
public long UploaderRoleId { get; set; }
|
||||
|
||||
|
||||
public long ReviewedById { get; private set; }
|
||||
public string RejectionReason { get; private set; }
|
||||
public DocumentStatus DocumentStatus { get; private set; }
|
||||
public long MediaId { get; private set; }
|
||||
|
||||
public DateTime? ConfirmationDateTime { get; private set; }
|
||||
public DocumentItemLabel DocumentLabel { get; private set; }
|
||||
|
||||
public long EmployeeDocumentId { get; private set; }
|
||||
public virtual EmployeeDocuments EmployeeDocuments { get; private set; }
|
||||
|
||||
public long? EmployeeDocumentsAdminViewId { get; private set; }
|
||||
public EmployeeDocumentsAdminSelection EmployeeDocumentsAdminSelection { get; private set; }
|
||||
|
||||
public List<EmployeeDocumentItemLog> ItemLogs { get; private set; }
|
||||
|
||||
|
||||
public EmployeeDocumentItem(long workshopId, long employeeId, long mediaId, long employeeDocumentId, DocumentItemLabel documentLabel, long uploaderId,
|
||||
UserType uploaderType, long roleId, DocumentStatus documentStatus = DocumentStatus.Unsubmitted)
|
||||
{
|
||||
|
||||
public long WorkshopId { get; private set; }
|
||||
public long EmployeeId { get; private set; }
|
||||
|
||||
public long UploaderId { get; private set; }
|
||||
public UserType UploaderType { get; private set; }
|
||||
|
||||
|
||||
public long ReviewedById { get; private set; }
|
||||
public string RejectionReason { get; private set; }
|
||||
public DocumentStatus DocumentStatus { get; private set; }
|
||||
public long MediaId { get; private set; }
|
||||
|
||||
public DateTime? ConfirmationDateTime { get; private set; }
|
||||
public DocumentItemLabel DocumentLabel { get; private set; }
|
||||
|
||||
public long EmployeeDocumentId { get; private set; }
|
||||
public virtual EmployeeDocuments EmployeeDocuments { get; private set; }
|
||||
|
||||
public long? EmployeeDocumentsAdminViewId { get; private set; }
|
||||
public EmployeeDocumentsAdminSelection EmployeeDocumentsAdminSelection { get; private set; }
|
||||
|
||||
public List<EmployeeDocumentItemLog> ItemLogs { get; private set; }
|
||||
|
||||
|
||||
public EmployeeDocumentItem(long workshopId,long employeeId, long mediaId, long employeeDocumentId, DocumentItemLabel documentLabel, long uploaderId,
|
||||
UserType uploaderType, DocumentStatus documentStatus = DocumentStatus.Unsubmitted)
|
||||
{
|
||||
MediaId = mediaId;
|
||||
UploaderId = uploaderId;
|
||||
UploaderType = uploaderType;
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
DocumentStatus = documentStatus;
|
||||
if (documentStatus == DocumentStatus.Confirmed)
|
||||
ConfirmationDateTime = DateTime.Now;
|
||||
DocumentLabel = documentLabel;
|
||||
EmployeeDocumentId = employeeDocumentId;
|
||||
ItemLogs =
|
||||
[
|
||||
new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.CreatedNewItem, uploaderId, uploaderType)
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public void Confirm(long operatorId, UserType userType)
|
||||
{
|
||||
ReviewedById = operatorId;
|
||||
DocumentStatus = DocumentStatus.Confirmed;
|
||||
MediaId = mediaId;
|
||||
UploaderId = uploaderId;
|
||||
UploaderType = uploaderType;
|
||||
UploaderRoleId = uploaderType == UserType.Admin ? roleId : -1;
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
DocumentStatus = documentStatus;
|
||||
if (documentStatus == DocumentStatus.Confirmed)
|
||||
ConfirmationDateTime = DateTime.Now;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.ConfirmedItem, operatorId, userType));
|
||||
}
|
||||
|
||||
public void Reject(long operatorId, string rejectionReason, UserType userType)
|
||||
{
|
||||
RejectionReason = rejectionReason;
|
||||
DocumentStatus = DocumentStatus.Rejected;
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
ReviewedById = operatorId;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.RejectedItem, operatorId, userType, rejectionReason));
|
||||
}
|
||||
|
||||
public void Delete(long operatorId, UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.Deleted;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.DeletedItem, operatorId, operatorType));
|
||||
}
|
||||
|
||||
public void AdminSelect(long adminViewId)
|
||||
{
|
||||
EmployeeDocumentsAdminViewId = adminViewId;
|
||||
}
|
||||
|
||||
public void AdminDeselect()
|
||||
{
|
||||
EmployeeDocumentsAdminViewId = 0;
|
||||
}
|
||||
public void SubmitByClient(long operatorId,UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.SubmittedByClient;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.SubmittedItems, operatorId, operatorType));
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
}
|
||||
|
||||
public void SubmitByAdmin(long operatorId, UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.SubmittedByAdmin;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.SubmittedItems, operatorId, operatorType));
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
}
|
||||
DocumentLabel = documentLabel;
|
||||
EmployeeDocumentId = employeeDocumentId;
|
||||
ItemLogs =
|
||||
[
|
||||
new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.CreatedNewItem, uploaderId, uploaderType)
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Confirm(long operatorId, UserType userType)
|
||||
{
|
||||
ReviewedById = operatorId;
|
||||
DocumentStatus = DocumentStatus.Confirmed;
|
||||
ConfirmationDateTime = DateTime.Now;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.ConfirmedItem, operatorId, userType));
|
||||
}
|
||||
|
||||
public void Reject(long operatorId, string rejectionReason, UserType userType)
|
||||
{
|
||||
RejectionReason = rejectionReason;
|
||||
DocumentStatus = DocumentStatus.Rejected;
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
ReviewedById = operatorId;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.RejectedItem, operatorId, userType, rejectionReason));
|
||||
}
|
||||
|
||||
public void Delete(long operatorId, UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.Deleted;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.DeletedItem, operatorId, operatorType));
|
||||
}
|
||||
|
||||
public void AdminSelect(long adminViewId)
|
||||
{
|
||||
EmployeeDocumentsAdminViewId = adminViewId;
|
||||
}
|
||||
|
||||
public void AdminDeselect()
|
||||
{
|
||||
EmployeeDocumentsAdminViewId = 0;
|
||||
}
|
||||
public void SubmitByClient(long operatorId, UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.SubmittedByClient;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.SubmittedItems, operatorId, operatorType));
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
}
|
||||
|
||||
public void SubmitByAdmin(long operatorId, UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.SubmittedByAdmin;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.SubmittedItems, operatorId, operatorType));
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
}
|
||||
|
||||
public void SetRoleId(long roleId)
|
||||
{
|
||||
UploaderRoleId = roleId;
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,12 @@ namespace Company.Domain.EmployeeDocumentsAgg
|
||||
{
|
||||
List<DocumentItemLabel> requiredDocuments =
|
||||
[
|
||||
DocumentItemLabel.IdCardPage1, DocumentItemLabel.IdCardPage2, DocumentItemLabel.IdCardPage3, DocumentItemLabel.NationalCardRear,
|
||||
DocumentItemLabel.NationalCardFront,DocumentItemLabel.EmployeePicture
|
||||
DocumentItemLabel.IdCardPage1,/* DocumentItemLabel.IdCardPage2, DocumentItemLabel.IdCardPage3, DocumentItemLabel.NationalCardRear,*/
|
||||
DocumentItemLabel.NationalCardFront,/*DocumentItemLabel.EmployeePicture*/
|
||||
];
|
||||
|
||||
if (gender == "مرد")
|
||||
requiredDocuments.Add(DocumentItemLabel.MilitaryServiceCard);
|
||||
//if (gender == "مرد")
|
||||
// requiredDocuments.Add(DocumentItemLabel.MilitaryServiceCard);
|
||||
|
||||
return requiredDocuments;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ using CompanyManagment.App.Contracts.Workshop;
|
||||
namespace Company.Domain.EmployeeDocumentsAgg
|
||||
{
|
||||
public interface IEmployeeDocumentsRepository : IRepository<long, EmployeeDocuments>
|
||||
{
|
||||
{
|
||||
EmployeeDocuments GetByEmployeeIdWorkshopId(long employeeId, long workshopId);
|
||||
EmployeeDocumentsViewModel GetViewModelByEmployeeIdWorkshopId(long employeeId, long workshopId);
|
||||
List<EmployeeDocumentsViewModel> SearchForClient(SearchEmployeeDocuments cmd);
|
||||
@@ -30,5 +30,76 @@ namespace Company.Domain.EmployeeDocumentsAgg
|
||||
Task<int> GetAdminWorkFlowCountForNewEmployees(List<long> workshopIds);
|
||||
Task<int> GetAdminWorkFlowCountForSubmittedAndRejectedDocuments(List<long> workshopIds);
|
||||
List<EmployeeDocumentsViewModel> GetDocumentsAwaitingReviewByWorkshopIdForCheckerWorkFlow(long workshopId);
|
||||
|
||||
#region Mahan
|
||||
/// <summary>
|
||||
/// کارگاهی که افزودن پرسنل کرده اند. بر اساس نقش فیلتر میشوند
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentCreatedEmployeeForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
///کارگاه های مدارک های برگشت خورده براساس دسترسی افراد و نقششان. یک مدرک برگشت خورده به تمامی کسانی که به آن کارگاه دسترسی دارند و تمامی کسانی که هم نقش آپلود کننده بوده اند نمایش داده میشود
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentRejectedForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های برگشت خورده براساس دسترسی افراد و نقششان. یک مدرک برگشت خورده به تمامی کسانی که به آن کارگاه دسترسی دارند و تمامی کسانی که هم نقش آپلود کننده بوده اند نمایش داده میشود
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(long workshopId,
|
||||
long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// کارگاه هایی که افزودن پرسنل کرده اند و مدارک آنها ناقص است
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetCreatedEmployeesWorkshopDocumentForAdmin(
|
||||
List<long> workshops,long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// پرسنلی که افزوده شده اند در کارگاه و آپلود مدارک آنها ناقص است
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetCreatedEmployeesDocumentByWorkshopIdForAdmin(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارگاه هایی که مدارک آپلود شده توسط کلاینت برگشت خورده است در کارپوشه ادمین
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetClientRejectedDocumentWorkshopsForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های آپلود شده توسط کلاینت در کارگاه که برگشت خورده اند در کارپوشه ادمین
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentByWorkshopIdForAdmin(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های برگشت خورده برای کلاینت
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentForClient(long workshopId, long accountId);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.Employee;
|
||||
using AccountManagement.Application.Contracts.Media;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employee;
|
||||
|
||||
public class GetEditEmployeeInEmployeeDocumentViewModel
|
||||
{
|
||||
@@ -14,4 +16,5 @@ public class GetEditEmployeeInEmployeeDocumentViewModel
|
||||
public string Nationality { get; set; } = string.Empty;
|
||||
public string Gender { get; set; } = string.Empty;
|
||||
public bool IsAuthorized { get; set; }
|
||||
public MediaViewModel Media { get; set; }
|
||||
}
|
||||
@@ -59,6 +59,77 @@ namespace CompanyManagment.App.Contracts.EmployeeDocuments
|
||||
/// </summary>
|
||||
OperationResult AddRangeEmployeeDocumentItemsByAdmin(long workshopId, long employeeId,
|
||||
List<AddEmployeeDocumentItem> command);
|
||||
|
||||
#region Mahan
|
||||
/// <summary>
|
||||
/// کارگاهی که افزودن پرسنل کرده اند. بر اساس نقش فیلتر میشوند
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentCreatedEmployeeForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های برگشت خورده براساس دسترسی افراد و نقششان. یک مدرک برگشت خورده به تمامی کسانی که به آن کارگاه دسترسی دارند و تمامی کسانی که هم نقش آپلود کننده بوده اند نمایش داده میشود
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentRejectedForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های برگشت خورده براساس دسترسی افراد و نقششان. یک مدرک برگشت خورده به تمامی کسانی که به آن کارگاه دسترسی دارند و تمامی کسانی که هم نقش آپلود کننده بوده اند نمایش داده میشود
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(long workshopId,
|
||||
long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// کارگاه هایی که افزودن پرسنل کرده اند و مدارک آنها ناقص است
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetCreatedEmployeesWorkshopDocumentForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// پرسنلی که افزوده شده اند در کارگاه و آپلود مدارک آنها ناقص است
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetCreatedEmployeesDocumentByWorkshopIdForAdmin(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارگاه هایی که مدارک آپلود شده توسط کلاینت برگشت خورده است در کارپوشه ادمین
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetClientRejectedDocumentWorkshopsForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های آپلود شده توسط کلاینت در کارگاه که برگشت خورده اند در کارپوشه ادمین
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentByWorkshopIdForAdmin(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های برگشت خورده برای کلاینت
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentForClient(long workshopId, long accountId);
|
||||
|
||||
#endregion
|
||||
EmployeeDocumentItemViewModel GetOneDocumentItemDetailsForAdmin(long employeeId, long workshopId,long documentItemId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType,roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == employeeId))
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace CompanyManagment.Application
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaOpResult.SendId, entity.id, item.Label, uploaderId, uploaderType);
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaOpResult.SendId, entity.id, item.Label, uploaderId, uploaderType,roleId);
|
||||
newEntities.Add(newEntity);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace CompanyManagment.Application
|
||||
public OperationResult DeleteUnsubmittedItems(long workshopId, long employeeId)
|
||||
{
|
||||
OperationResult op = new();
|
||||
(_, UserType userType) = _authHelper.GetUserTypeWithId();
|
||||
(_, UserType userType,_) = _authHelper.GetUserTypeWithId();
|
||||
var entity = _employeeDocumentsRepository.GetByEmployeeIdWorkshopIdWithItems(employeeId, workshopId);
|
||||
var items =
|
||||
entity.EmployeeDocumentItemCollection.Where(x =>
|
||||
@@ -244,7 +244,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType, roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == command.EmployeeId))
|
||||
return op.Failed("پرسنل یافت نشد");
|
||||
@@ -289,7 +289,7 @@ namespace CompanyManagment.Application
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(command.WorkshopId, command.EmployeeId, mediaOpResult.SendId, entity.id, command.Label, uploaderId, uploaderType);
|
||||
var newEntity = new EmployeeDocumentItem(command.WorkshopId, command.EmployeeId, mediaOpResult.SendId, entity.id, command.Label, uploaderId, uploaderType, roleId);
|
||||
|
||||
_employeeDocumentItemRepository.Create(newEntity);
|
||||
_employeeDocumentItemRepository.SaveChanges();
|
||||
@@ -311,7 +311,7 @@ namespace CompanyManagment.Application
|
||||
.ToList();
|
||||
|
||||
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType,_) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
var unsubmittedDocs = currentDocs.Where(x => x.DocumentStatus == DocumentStatus.Unsubmitted &&
|
||||
x.UploaderType == UserType.Client).ToList();
|
||||
@@ -356,7 +356,7 @@ namespace CompanyManagment.Application
|
||||
if (!HasRequiredDocuments(notRejectedDocs, entity.Gender))
|
||||
return op.Failed("مدارک الزامی بارگذاری نشده اند");
|
||||
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
var unsubmittedDocs = notRejectedDocs.Where(x => x.DocumentStatus == DocumentStatus.Unsubmitted).ToList();
|
||||
|
||||
@@ -386,10 +386,9 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType,roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == employeeId))
|
||||
|
||||
return op.Failed("پرسنل یافت نشد");
|
||||
|
||||
|
||||
@@ -430,11 +429,12 @@ namespace CompanyManagment.Application
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaOpResult.SendId, entity.id, item.Label, uploaderId, uploaderType, DocumentStatus.SubmittedByClient);
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaOpResult.SendId, entity.id, item.Label, uploaderId, uploaderType, roleId,DocumentStatus.SubmittedByClient);
|
||||
newEntities.Add(newEntity);
|
||||
}
|
||||
|
||||
var currentItems = entity.EmployeeDocumentItemCollection.GroupBy(x => x.DocumentLabel)
|
||||
.Where(x => command.Any(a => a.Label == x.Key))
|
||||
.Select(x => x.MaxBy(y => y.CreationDate));
|
||||
|
||||
//This can bite!
|
||||
@@ -660,6 +660,12 @@ namespace CompanyManagment.Application
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentForClient(long workshopId, long accountId)
|
||||
{
|
||||
return _employeeDocumentsRepository.GetClientRejectedDocumentForClient(workshopId, accountId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Admin Only Methods
|
||||
@@ -670,7 +676,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType, roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == employeeId))
|
||||
@@ -725,7 +731,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType,roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == employeeId))
|
||||
@@ -778,7 +784,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType, roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
//ToDo: add check for leftwork
|
||||
if (!_employeeRepository.Exists(x => x.id == command.EmployeeId))
|
||||
@@ -834,7 +840,7 @@ namespace CompanyManagment.Application
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(command.WorkshopId, command.EmployeeId, mediaOpResult.SendId, entity.id, command.Label, uploaderId, uploaderType);
|
||||
var newEntity = new EmployeeDocumentItem(command.WorkshopId, command.EmployeeId, mediaOpResult.SendId, entity.id, command.Label, uploaderId, uploaderType, roleId);
|
||||
|
||||
_employeeDocumentItemRepository.Create(newEntity);
|
||||
_employeeDocumentItemRepository.SaveChanges();
|
||||
@@ -856,7 +862,7 @@ namespace CompanyManagment.Application
|
||||
//if (!HasRequiredDocuments(notRejectedDocs, entity.Gender))
|
||||
// return op.Failed("مدارک الزامی بارگذاری نشده اند");
|
||||
|
||||
var (userId, operatorType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, operatorType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
var adminUnsubmittedDocs = currentDocs.Where(x => x.DocumentStatus == DocumentStatus.SubmittedByClient ||
|
||||
(x.DocumentStatus == DocumentStatus.Unsubmitted && x.UploaderType == UserType.Admin)).ToList();
|
||||
@@ -895,7 +901,7 @@ namespace CompanyManagment.Application
|
||||
//if (!HasRequiredDocuments(notRejectedDocs, entity.Gender))
|
||||
// return op.Failed("مدارک الزامی بارگذاری نشده اند");
|
||||
|
||||
var (userId, operatorType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, operatorType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
var adminUnsubmittedDocs = currentDocs.Where(x => x.DocumentStatus == DocumentStatus.SubmittedByClient ||
|
||||
(x.DocumentStatus == DocumentStatus.Unsubmitted && x.UploaderType == UserType.Admin)).ToList();
|
||||
@@ -1131,7 +1137,7 @@ namespace CompanyManagment.Application
|
||||
OperationResult op = new();
|
||||
var entity = _employeeDocumentItemRepository.Get(documentItemId);
|
||||
|
||||
(long operatorId, _) = _authHelper.GetUserTypeWithId();
|
||||
(long operatorId, _,_) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (entity == null)
|
||||
return op.Failed(ApplicationMessages.RecordNotFound);
|
||||
@@ -1165,6 +1171,45 @@ namespace CompanyManagment.Application
|
||||
return await _employeeDocumentsRepository.GetAdminWorkFlowCountForNewEmployees(workshopIds);
|
||||
}
|
||||
|
||||
public async Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentCreatedEmployeeForAdmin(List<long> workshops, long roleId)
|
||||
{
|
||||
return await _employeeDocumentsRepository.GetWorkshopDocumentCreatedEmployeeForAdmin(workshops, roleId);
|
||||
}
|
||||
|
||||
public async Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentRejectedForAdmin(List<long> workshops, long roleId)
|
||||
{
|
||||
return await _employeeDocumentsRepository.GetWorkshopDocumentRejectedForAdmin(workshops, roleId);
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeDocumentsViewModel>> GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(long workshopId, long roleId)
|
||||
{
|
||||
return await _employeeDocumentsRepository.GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(workshopId,
|
||||
roleId);
|
||||
}
|
||||
|
||||
public Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetCreatedEmployeesWorkshopDocumentForAdmin(
|
||||
List<long> workshops, long roleId)
|
||||
{
|
||||
return _employeeDocumentsRepository.GetCreatedEmployeesWorkshopDocumentForAdmin(workshops, roleId);
|
||||
}
|
||||
|
||||
public Task<List<EmployeeDocumentsViewModel>> GetCreatedEmployeesDocumentByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
return _employeeDocumentsRepository.GetCreatedEmployeesDocumentByWorkshopIdForAdmin(workshopId);
|
||||
}
|
||||
|
||||
public Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetClientRejectedDocumentWorkshopsForAdmin(
|
||||
List<long> workshops, long roleId)
|
||||
{
|
||||
return _employeeDocumentsRepository.GetClientRejectedDocumentWorkshopsForAdmin(workshops,roleId);
|
||||
}
|
||||
|
||||
public Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
return _employeeDocumentsRepository.GetClientRejectedDocumentByWorkshopIdForAdmin(workshopId);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Checker Only Methods
|
||||
@@ -1189,7 +1234,7 @@ namespace CompanyManagment.Application
|
||||
return op.Failed("رکورد مورد نظر یافت نشد");
|
||||
}
|
||||
|
||||
(long operatorId, UserType userType) = _authHelper.GetUserTypeWithId();
|
||||
(long operatorId, UserType userType,long roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if ((item.DocumentStatus is DocumentStatus.SubmittedByAdmin or DocumentStatus.SubmittedByClient) == false)
|
||||
return op.Failed("امکان بررسی رکورد مورد نظر وجود ندارد");
|
||||
@@ -1390,7 +1435,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType,roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == employeeId))
|
||||
|
||||
@@ -1449,7 +1494,7 @@ namespace CompanyManagment.Application
|
||||
mediaId = mediaOpResult.SendId;
|
||||
}
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaId, entity.id, item.Label, uploaderId, uploaderType, DocumentStatus.SubmittedByAdmin);
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaId, entity.id, item.Label, uploaderId, uploaderType,roleId ,DocumentStatus.SubmittedByAdmin);
|
||||
newEntities.Add(newEntity);
|
||||
}
|
||||
|
||||
@@ -1474,6 +1519,24 @@ namespace CompanyManagment.Application
|
||||
return op.Succcedded(entity.id);
|
||||
}
|
||||
|
||||
public EmployeeDocumentItemViewModel GetOneDocumentItemDetailsForAdmin(long employeeId, long workshopId,long documentItemId)
|
||||
{
|
||||
var documentItem = _employeeDocumentItemRepository.GetWithEmployeeDocumentsByItemId(documentItemId);
|
||||
var viewModel = new EmployeeDocumentItemViewModel()
|
||||
{
|
||||
CreationDateTime = documentItem.CreationDate,
|
||||
DocumentItemLabel = documentItem.DocumentLabel,
|
||||
EmployeeDocumentsId = documentItem.EmployeeDocumentId,
|
||||
Gender = documentItem.EmployeeDocuments.Gender,
|
||||
Id = documentItem.id,
|
||||
Status = documentItem.DocumentStatus,
|
||||
MediaId = documentItem.MediaId,
|
||||
RejectionMessage = documentItem.RejectionReason,
|
||||
UploaderType = documentItem.UploaderType
|
||||
};
|
||||
return viewModel;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1800,8 +1863,9 @@ namespace CompanyManagment.Application
|
||||
StatusString = item.DocumentStatus.ToString().ToLower(),
|
||||
PicturePath = medias.FirstOrDefault(x => x.Id == item.MediaId)?.Path ?? "",
|
||||
RejectionMessage = item.RejectionReason,
|
||||
UploaderType = item.UploaderType
|
||||
};
|
||||
UploaderType = item.UploaderType,
|
||||
MediaId = medias.FirstOrDefault(x => x.Id == item.MediaId)?.Id ?? 0,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ public class FineApplication : IFineApplication
|
||||
#endregion
|
||||
|
||||
DateTime date = command.FineDate.ToGeorgianDateTime();
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType,_) = _authHelper.GetUserTypeWithId();
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
Fine entity = new Fine(employeeId, command.WorkshopId, command.Title, command.Amount.MoneyToDouble(), date,
|
||||
@@ -218,7 +218,7 @@ public class FineApplication : IFineApplication
|
||||
}
|
||||
|
||||
DateTime date = command.FineDate.ToGeorgianDateTime();
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType,_) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
|
||||
entity.Edit(command.EmployeeId, command.WorkshopId, command.Title, command.Amount.MoneyToDouble(), date,
|
||||
|
||||
@@ -91,7 +91,7 @@ public class LoanApplication : ILoanApplication
|
||||
|
||||
#endregion
|
||||
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
|
||||
@@ -120,7 +120,7 @@ public class RewardApplication : IRewardApplication
|
||||
|
||||
|
||||
#endregion
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
@@ -164,7 +164,7 @@ public class RewardApplication : IRewardApplication
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است پاداشی دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == command.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= grantDate && x.ContractEnd >= grantDate))
|
||||
|
||||
@@ -76,7 +76,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی موقت صادر شده است مساعده ای دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
@@ -122,7 +122,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی موقت صادر شده است مساعده ای دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
entity.Edit(Tools.MoneyToDouble(command.Amount),startDate,userId,userType);
|
||||
_salaryAidRepository.SaveChanges();
|
||||
@@ -193,7 +193,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است مساعده ای دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
var id = employeeId;
|
||||
|
||||
9474
CompanyManagment.EFCore/Migrations/20250505140611_add uploaderRoleId to EmployeeDocumentItems.Designer.cs
generated
Normal file
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class adduploaderRoleIdtoEmployeeDocumentItems : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "UploaderRoleId",
|
||||
table: "EmployeeDocumentItems",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UploaderRoleId",
|
||||
table: "EmployeeDocumentItems");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1843,6 +1843,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("UploaderId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("UploaderRoleId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("UploaderType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AccountManagement.Domain.AccountLeftWorkAgg;
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Domain.AccountLeftWorkAgg;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.RewardAgg;
|
||||
using Company.Domain.RollCallAgg.DomainService;
|
||||
@@ -71,21 +72,36 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
return Page();
|
||||
}
|
||||
|
||||
public IActionResult OnPostShiftDateNew2()
|
||||
public async Task<IActionResult> OnPostShiftDateNew2()
|
||||
{
|
||||
var startRollCall = new DateTime(2025, 3, 21);
|
||||
var rollCalls = _context.RollCalls.Where(x => x.StartDate >= startRollCall && x.EndDate != null ).ToList();
|
||||
var r1 = rollCalls.Skip(10000).Take(10000).ToList();
|
||||
//var startRollCall = new DateTime(2025, 3, 21);
|
||||
//var rollCalls = _context.RollCalls.Where(x => x.StartDate >= startRollCall && x.EndDate != null ).ToList();
|
||||
//var r1 = rollCalls.Skip(10000).Take(10000).ToList();
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.DarkRed;
|
||||
Console.WriteLine("endStep 1 ============");
|
||||
SetRollCall(r1);
|
||||
//Console.ForegroundColor = ConsoleColor.DarkRed;
|
||||
//Console.WriteLine("endStep 1 ============");
|
||||
//SetRollCall(r1);
|
||||
|
||||
await RefactorEmployeeDocumentItem();
|
||||
|
||||
ViewData["message"] = "تومام دو";
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async System.Threading.Tasks.Task RefactorEmployeeDocumentItem()
|
||||
{
|
||||
var employeeDocumentItems = await _context.EmployeeDocumentItems.Where(x => x.UploaderType == UserType.Admin).ToListAsync();
|
||||
foreach (var employeeDocumentItem in employeeDocumentItems)
|
||||
{
|
||||
var roleId = _accountContext.Accounts.FirstOrDefault(x => x.id == employeeDocumentItem.UploaderId)?.RoleId ?? 0;
|
||||
employeeDocumentItem.SetRoleId(roleId);
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region Create reward for kebab mahdi
|
||||
|
||||
|
||||
@@ -3,10 +3,9 @@ using CompanyManagment.App.Contracts.Error;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System.Security.Claims;
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application.Contracts.Media;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
|
||||
namespace ServiceHost.Areas.AdminNew.Pages.Company.EmployeesDocuments
|
||||
{
|
||||
@@ -18,10 +17,12 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.EmployeesDocuments
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
private readonly IMediaApplication _mediaApplication;
|
||||
|
||||
public long WorkshopId { get; set; }
|
||||
public string WorkshopFullName;
|
||||
|
||||
public EmployeeListModel(IWorkshopApplication workshopApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeApplication employeeApplication, IAuthHelper authHelper, IPasswordHasher passwordHasher, IWebHostEnvironment webHostEnvironment)
|
||||
public EmployeeListModel(IWorkshopApplication workshopApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeApplication employeeApplication, IAuthHelper authHelper, IPasswordHasher passwordHasher, IWebHostEnvironment webHostEnvironment, IMediaApplication mediaApplication)
|
||||
{
|
||||
_workshopApplication = workshopApplication;
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
@@ -29,6 +30,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.EmployeesDocuments
|
||||
_authHelper = authHelper;
|
||||
_passwordHasher = passwordHasher;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_mediaApplication = mediaApplication;
|
||||
}
|
||||
|
||||
public IActionResult OnGet(long workshopId)
|
||||
@@ -88,8 +90,6 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.EmployeesDocuments
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IActionResult OnGetCreateUploadDocument(long workshopId,long employeeId)
|
||||
{
|
||||
if (workshopId <= 0)
|
||||
@@ -127,6 +127,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.EmployeesDocuments
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostRemoveClientEmployeeDocumentItemsByLabels(long workshopId, long employeeId, List<DocumentItemLabel> labels)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.RemoveClientDocumentItemsByAdmin(workshopId, employeeId, labels);
|
||||
@@ -136,6 +137,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.EmployeesDocuments
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostCancelOperation(long workshopId, long employeeId)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.DeleteUnsubmittedItems(workshopId, employeeId);
|
||||
@@ -169,6 +171,59 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.EmployeesDocuments
|
||||
|
||||
var contentType = Tools.GetContentTypeImage(Path.GetExtension(filePath));
|
||||
return PhysicalFile(filePath, contentType);
|
||||
}
|
||||
|
||||
#region Print
|
||||
|
||||
public IActionResult OnGetPrintSelectionUploadDocument(long workshopId, long employeeId)
|
||||
{
|
||||
if (workshopId <= 0)
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
Message = "کارگاه شما یافت نشد"
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
var employeeDocument = _employeeDocumentsApplication.GetDetailsForAdmin(employeeId, workshopId);
|
||||
|
||||
return Partial("ModalPrintSelectionUploadDocument", employeeDocument);
|
||||
}
|
||||
|
||||
public IActionResult OnGetPrintSingleUploadDocument(long workshopId, long employeeId, long mediaId)
|
||||
{
|
||||
// Todo: Mahan, please review this method that displays an employee's documents.
|
||||
//var employeeDocument = _employeeDocumentsApplication.GetDetailsForAdmin(employeeId, workshopId);
|
||||
var command = _mediaApplication.Get(mediaId);
|
||||
|
||||
return Partial("ModalPrintSingleUploadDocument", command);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public IActionResult OnPostGroupSave(long workshopId, long employeeId, List<AddEmployeeDocumentItem> command)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.AddRangeEmployeeDocumentItemsByAdmin(workshopId, employeeId, command);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetPrintSelectionUD(List<long> ids)
|
||||
{
|
||||
var command = _mediaApplication.GetRange(ids);
|
||||
|
||||
return Partial("PrintSelectionUD", command);
|
||||
}
|
||||
|
||||
public IActionResult OnGetPrintSingleUD(long id)
|
||||
{
|
||||
var command = _mediaApplication.Get(id);
|
||||
|
||||
return Partial("PrintSingleUD", command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model CompanyManagment.App.Contracts.EmployeeDocuments.EmployeeDocumentsViewModel
|
||||
|
||||
@{
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
<link href="~/AssetsAdminNew/employeesdocument/css/ModalPrintSelectionUploadDocument.css?ver=@adminVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header pb-0 d-flex align-items-center justify-content-center text-center">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<div>
|
||||
<p class="m-0 pdHeaderTitle1"><span class="">انتخاب مدارک پرسنل </span> @Model.EmployeeFullName</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="pdBoxGrid">
|
||||
<input type="hidden" id="employeeIdForList" value="@Model.EmployeeId" asp-for="@Model.EmployeeId"/>
|
||||
<div class="pdBox selectable-document disable"
|
||||
data-id="@Model.EmployeePicture.MediaId"
|
||||
onclick="toggleDocumentBox(this)"
|
||||
data-name="EmployeePicture">
|
||||
|
||||
<input type="checkbox" class="hidden-checkbox" />
|
||||
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (Model.EmployeePicture.PicturePath != null && !string.IsNullOrWhiteSpace(Model.EmployeePicture.PicturePath))
|
||||
{
|
||||
<img id="EmployeePicture" src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = @Model.EmployeePicture.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="EmployeePicture" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>عکس پرسنل </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="custom-checkmark"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pdBox selectable-document @(string.IsNullOrWhiteSpace(Model.NationalCardFront.PicturePath) ? "disable" : "")"
|
||||
data-id="@Model.NationalCardFront.MediaId"
|
||||
onclick="toggleDocumentBox(this)"
|
||||
data-name="NationalCardFront">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.NationalCardFront.PicturePath))
|
||||
{
|
||||
<img id="NationalCardFront" src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = @Model.NationalCardFront.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="NationalCardFront" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>کارت ملی رو </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="custom-checkmark"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pdBox selectable-document @(string.IsNullOrWhiteSpace(Model.NationalCardRear.PicturePath) ? "disable" : "")"
|
||||
data-id="@Model.NationalCardRear.MediaId"
|
||||
onclick="toggleDocumentBox(this)"
|
||||
data-name="NationalCardRear">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.NationalCardRear.PicturePath))
|
||||
{
|
||||
<img id="NationalCardRear" src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = @Model.NationalCardRear.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="NationalCardRear" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>کارت ملی پشت </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="custom-checkmark"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pdBox selectable-document @(string.IsNullOrWhiteSpace(Model.MilitaryServiceCard.PicturePath) || Model.Gender == "زن" ? "disable" : "")"
|
||||
data-id="@Model.MilitaryServiceCard.MediaId"
|
||||
onclick="toggleDocumentBox(this)"
|
||||
data-name="MilitaryServiceCard">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.MilitaryServiceCard.PicturePath))
|
||||
{
|
||||
<img id="militaryServiceCardModal" src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = @Model.MilitaryServiceCard.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="militaryServiceCardModal" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>کارت پایان خدمت </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="custom-checkmark"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pdBox selectable-document @(string.IsNullOrWhiteSpace(Model.IdCardPage1.PicturePath) ? "disable" : "")"
|
||||
data-id="@Model.IdCardPage1.MediaId"
|
||||
onclick="toggleDocumentBox(this)"
|
||||
data-name="IdCardPage1">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.IdCardPage1.PicturePath))
|
||||
{
|
||||
<img id="IdCardPage1" src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = @Model.IdCardPage1.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="IdCardPage1" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>شناسنامه صفحه اول </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="custom-checkmark"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pdBox selectable-document @(string.IsNullOrWhiteSpace(Model.IdCardPage2.PicturePath) ? "disable" : "")"
|
||||
data-id="@Model.IdCardPage2.MediaId"
|
||||
onclick="toggleDocumentBox(this)"
|
||||
data-name="IdCardPage2">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.IdCardPage2.PicturePath))
|
||||
{
|
||||
<img id="IdCardPage2" src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = @Model.IdCardPage2.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="IdCardPage2" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>شناسنامه صفحه دوم </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="custom-checkmark"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pdBox selectable-document @(string.IsNullOrWhiteSpace(Model.IdCardPage3.PicturePath) ? "disable" : "")"
|
||||
data-id="@Model.IdCardPage3.MediaId"
|
||||
onclick="toggleDocumentBox(this)"
|
||||
data-name="IdCardPage3">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.IdCardPage3.PicturePath))
|
||||
{
|
||||
<img id="IdCardPage3" src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = @Model.IdCardPage3.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="IdCardPage3" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>شناسنامه صفحه سوم </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="custom-checkmark"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pdBox selectable-document @(string.IsNullOrWhiteSpace(Model.IdCardPage4.PicturePath) ? "disable" : "")"
|
||||
data-id="@Model.IdCardPage4.MediaId"
|
||||
onclick="toggleDocumentBox(this)"
|
||||
data-name="IdCardPage4">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.IdCardPage4.PicturePath))
|
||||
{
|
||||
<img id="IdCardPage4" src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = @Model.IdCardPage4.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="IdCardPage4" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>شناسنامه صفحه چهارم </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<div class="custom-checkmark"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer d-block">
|
||||
<div class="container m-auto">
|
||||
<div class="row width-btn">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 d-flex justify-content-center w-100" data-bs-dismiss="modal">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" class="btn-register d-flex justify-content-center w-100 position-relative" onclick="openModalPrint()">
|
||||
پرینت
|
||||
<div class="spinner-loading loading" style="display: none">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script src="~/assetsclient/js/site.js?ver=@adminVersion"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var employeeId = Number(@Model.EmployeeId);
|
||||
var workshopId = Number(@Model.WorkshopId);
|
||||
</script>
|
||||
<script src="~/AssetsAdminNew/employeesdocument/js/modalprintselectionuploaddocument.js?ver=@adminVersion"></script>
|
||||
@@ -0,0 +1,53 @@
|
||||
@model AccountManagement.Application.Contracts.Media.MediaViewModel
|
||||
|
||||
@{
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
<link href="~/AssetsAdminNew/employeesdocument/css/ModalPrintSingleUploadDocument.css?ver=@adminVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header pb-0 d-flex align-items-center justify-content-center text-center">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<div>
|
||||
<p class="m-0 pdHeaderTitle1"><span class="">مدارک پرسنل </span> <span id="EmployeeFullNameModalSinglePrint"></span></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="image-show">
|
||||
@if (Model.Path != null && !string.IsNullOrWhiteSpace(Model.Path))
|
||||
{
|
||||
<img id="EmployeePicture" src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = @Model.Path })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="EmployeePicture" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer d-block">
|
||||
<div class="container m-auto">
|
||||
<div class="row width-btn">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 d-flex justify-content-center w-100" data-bs-dismiss="modal">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" class="btn-register d-flex justify-content-center w-100 position-relative" onclick="openModalPrint(@Model.Id)">
|
||||
پرینت
|
||||
<div class="spinner-loading loading" style="display: none">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="~/assetsclient/js/site.js?ver=@adminVersion"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
</script>
|
||||
<script src="~/AssetsAdminNew/employeesdocument/js/ModalPrintSingleUploadDocument.js?ver=@adminVersion"></script>
|
||||
@@ -446,6 +446,7 @@
|
||||
<script>
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = '/assetsclient/libs/pdf/pdf.worker.js';
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var saveGroupSubmitAjax = `@Url.Page("./EmployeeList", "GroupSave")`;
|
||||
var saveUploadFileModalAjax = `@Url.Page("./EmployeeList", "CreateUploadDocument")`;
|
||||
var saveSubmitAjax = `@Url.Page("./EmployeeList", "SaveSubmit")`;
|
||||
var deleteFileAjaxUrl = `@Url.Page("./EmployeeList", "RemoveEmployeeDocumentByLabel")`;
|
||||
|
||||
@@ -0,0 +1,375 @@
|
||||
@model List<AccountManagement.Application.Contracts.Media.MediaViewModel>
|
||||
|
||||
@{
|
||||
<style>
|
||||
.modal .modal-dialog .modal-content {
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
max-width: 100%;
|
||||
width: 22.4cm;
|
||||
}
|
||||
|
||||
@@page {
|
||||
size: A4;
|
||||
margin: 0mm;
|
||||
page-break-after: auto;
|
||||
}
|
||||
|
||||
@@media screen {
|
||||
#printSection {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.print:last-child {
|
||||
page-break-after: auto !important;
|
||||
}
|
||||
|
||||
@@media print {
|
||||
body * {
|
||||
visibility: hidden;
|
||||
page-break-after: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: clip;
|
||||
}
|
||||
|
||||
#printSection, #printSection * {
|
||||
visibility: visible;
|
||||
page-break-after: auto;
|
||||
}
|
||||
|
||||
#printThis {
|
||||
width: 100%;
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
|
||||
#printThis .section-leave {
|
||||
/* margin: 9mm 0 0 0; */
|
||||
page-break-inside: avoid !important;
|
||||
}
|
||||
|
||||
footer {
|
||||
page-break-after: auto;
|
||||
display: none;
|
||||
}
|
||||
|
||||
header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#printSection {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
page-break-after: auto;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.head {
|
||||
background-color: #cdcdcd !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.week {
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.radio-info input[type="radio"]:checked + label::after {
|
||||
background-color: black !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
}
|
||||
|
||||
.col-4, .col-3, .col-9,
|
||||
.col-2, .col-10, .col-6,
|
||||
.col-8, .col-5, .col-7,
|
||||
.col-offset-1 {
|
||||
float: right !important;
|
||||
}
|
||||
|
||||
label .modal {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.fontBold {
|
||||
font-family: IranYekanEXBold !important;
|
||||
}
|
||||
|
||||
.fontNumber {
|
||||
font-family: IranText !important;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
height: 99%;
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-right: -10px !important;
|
||||
margin-left: -10px !important;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 4px 0 0 0;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.paragraph {
|
||||
margin: 8px 0 0 0;
|
||||
font-size: 14px;
|
||||
text-align: justify;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.print-card {
|
||||
position: fixed;
|
||||
top: 130px;
|
||||
width: auto;
|
||||
z-index: 20;
|
||||
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
||||
}
|
||||
|
||||
@@media screen and (max-width: 992px) {
|
||||
.wrapper {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.print-card {
|
||||
position: relative;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 20;
|
||||
}
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
/*border-radius: 10px;*/
|
||||
border: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 8px;
|
||||
/*border-radius: 10px;*/
|
||||
border: none;
|
||||
}
|
||||
|
||||
.half {
|
||||
width: 50%;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<div class="modal-header d-block text-center position-relative">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<form asp-page="./Leave" asp-page-handler="Details"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="Refresh"
|
||||
enctype="multipart/form-data">
|
||||
|
||||
<div class="modal-body print" id="printThis">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="section-leave">
|
||||
|
||||
@* <table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
<tr>
|
||||
@for (int i = 0; i < 2; i++)
|
||||
{
|
||||
<td style="width: 50%;">
|
||||
<img src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = Model[i].Path })" style="width: 100%;" />
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="text-align: center;">
|
||||
<img src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = Model[2].Path })" style="width: 50%;" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@for (int i = 3; i < Model.Count; i++)
|
||||
{
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<img src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = Model[i].Path })" style="width: 100%;" />
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table> *@
|
||||
|
||||
|
||||
|
||||
<div id="tableContainer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<div class="d-flex justify-content-start">
|
||||
<button type="button" class="btn btn-rounded waves-effect waves-light text-white me-2" data-bs-dismiss="modal" aria-label="Close" style="background-color: #454D5C;">بستن فرم</button>
|
||||
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light px-4">پرینت</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
var tableArray = [];
|
||||
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<text>
|
||||
tableArray.push({
|
||||
mediaId: @item.Id,
|
||||
path: "@item.Path.Replace("\\", "/")"
|
||||
});
|
||||
</text>
|
||||
}
|
||||
|
||||
function getImagePathByMediaId(id) {
|
||||
var filtered = tableArray.filter(item => item.mediaId === id);
|
||||
return filtered.length > 0 ? filtered[0].path : '';
|
||||
}
|
||||
|
||||
function createTable() {
|
||||
var baseUrl = "/AdminNew/Company/EmployeesDocuments/EmployeeList?handler=ShowPicture&filePath=";
|
||||
|
||||
let $table = $('<table>').css({
|
||||
width: '100%',
|
||||
borderCollapse: 'collapse',
|
||||
textAlign: 'center'
|
||||
});
|
||||
|
||||
|
||||
let documentList = selectedDocumentIds.map(doc => ({
|
||||
name: doc.name,
|
||||
path: getImagePathByMediaId(doc.mediaId)
|
||||
}));
|
||||
|
||||
const nationalCards = documentList.filter(doc =>
|
||||
doc.name === "NationalCardFront" || doc.name === "NationalCardRear"
|
||||
);
|
||||
|
||||
if (nationalCards.length === 1 || nationalCards.length === 2) {
|
||||
let $row = $('<tr>');
|
||||
nationalCards.forEach(doc => {
|
||||
let $td = $('<td>')
|
||||
.css({
|
||||
width: '50%',
|
||||
textAlign: 'center'
|
||||
})
|
||||
.attr('colspan', nationalCards.length === 1 ? 2 : 1);
|
||||
|
||||
let $img = $('<img>')
|
||||
.attr('src', baseUrl + doc.path)
|
||||
.css({
|
||||
width: nationalCards.length === 2 ? '100%' : '50%',
|
||||
height: '14cm',
|
||||
objectFit: 'contain',
|
||||
objectPosition: 'center'
|
||||
});
|
||||
$td.append($img);
|
||||
$row.append($td);
|
||||
});
|
||||
$table.append($row);
|
||||
}
|
||||
|
||||
const militaryServiceCard = documentList.find(doc => doc.name === "MilitaryServiceCard");
|
||||
if (militaryServiceCard) {
|
||||
let $row = $('<tr>');
|
||||
let $td = $('<td>')
|
||||
.attr('colspan', 2)
|
||||
.css('textAlign', 'center');
|
||||
let $img = $('<img>')
|
||||
.attr('src', baseUrl + militaryServiceCard.path)
|
||||
.css({
|
||||
width: '50%',
|
||||
height: '14cm',
|
||||
objectFit: 'contain',
|
||||
objectPosition: 'center'
|
||||
});
|
||||
$td.append($img);
|
||||
$row.append($td);
|
||||
$table.append($row);
|
||||
}
|
||||
|
||||
const otherDocs = documentList.filter(doc =>
|
||||
doc.name !== "NationalCardFront" &&
|
||||
doc.name !== "NationalCardRear" &&
|
||||
doc.name !== "MilitaryServiceCard"
|
||||
);
|
||||
|
||||
otherDocs.forEach(doc => {
|
||||
let $row = $('<tr>');
|
||||
let $td = $('<td>').attr('colspan', 2);
|
||||
let $img = $('<img>')
|
||||
.attr('src', baseUrl + doc.path)
|
||||
.css({
|
||||
width: '100%',
|
||||
height: '14cm',
|
||||
objectFit: 'contain',
|
||||
objectPosition: 'center'
|
||||
});
|
||||
$td.append($img);
|
||||
$row.append($td);
|
||||
$table.append($row);
|
||||
});
|
||||
|
||||
$('#tableContainer').html($table);
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
createTable();
|
||||
|
||||
window.onbeforeprint = (event) => {
|
||||
$("#MainModal").modal("hide");
|
||||
}
|
||||
document.getElementById("MainModal").style.visibility = "hidden";
|
||||
setTimeout(function () {
|
||||
printElement(document.getElementById("printThis"));
|
||||
}, 500);
|
||||
});
|
||||
|
||||
var close = document.getElementById("closingOnePrint");
|
||||
function printElement(elem) {
|
||||
var domClone = elem.cloneNode(true);
|
||||
|
||||
var $printSection = document.getElementById("printSection");
|
||||
|
||||
if (!$printSection) {
|
||||
$printSection = document.createElement("div");
|
||||
$printSection.id = "printSection";
|
||||
document.body.appendChild($printSection);
|
||||
}
|
||||
|
||||
$printSection.innerHTML = "";
|
||||
$printSection.appendChild(domClone);
|
||||
window.print();
|
||||
document.getElementById("MainModal").style.visibility = "visible";
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,251 @@
|
||||
@model AccountManagement.Application.Contracts.Media.MediaViewModel
|
||||
@{
|
||||
<style>
|
||||
.modal .modal-dialog .modal-content {
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
max-width: 100%;
|
||||
width: 22.4cm;
|
||||
}
|
||||
|
||||
@@page {
|
||||
size: A4;
|
||||
margin: 0mm;
|
||||
page-break-after: auto;
|
||||
}
|
||||
|
||||
@@media screen {
|
||||
#printSection {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.print:last-child {
|
||||
page-break-after: auto !important;
|
||||
}
|
||||
|
||||
@@media print {
|
||||
body * {
|
||||
visibility: hidden;
|
||||
page-break-after: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: clip;
|
||||
}
|
||||
|
||||
#printSection, #printSection * {
|
||||
visibility: visible;
|
||||
page-break-after: auto;
|
||||
}
|
||||
|
||||
#printThis {
|
||||
width: 100%;
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
|
||||
#printThis .section-leave {
|
||||
/* margin: 9mm 0 0 0; */
|
||||
page-break-inside: avoid !important;
|
||||
}
|
||||
|
||||
footer {
|
||||
page-break-after: auto;
|
||||
display: none;
|
||||
}
|
||||
|
||||
header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#printSection {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
page-break-after: auto;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.head {
|
||||
background-color: #cdcdcd !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.week {
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
|
||||
.radio-info input[type="radio"]:checked + label::after {
|
||||
background-color: black !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
}
|
||||
}
|
||||
|
||||
.col-4, .col-3, .col-9,
|
||||
.col-2, .col-10, .col-6,
|
||||
.col-8, .col-5, .col-7,
|
||||
.col-offset-1 {
|
||||
float: right !important;
|
||||
}
|
||||
|
||||
label .modal {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.fontBold {
|
||||
font-family: IranYekanEXBold !important;
|
||||
}
|
||||
|
||||
.fontNumber {
|
||||
font-family: IranText !important;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
height: 99%;
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-right: -10px !important;
|
||||
margin-left: -10px !important;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 4px 0 0 0;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.paragraph {
|
||||
margin: 8px 0 0 0;
|
||||
font-size: 14px;
|
||||
text-align: justify;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.print-card {
|
||||
position: fixed;
|
||||
top: 130px;
|
||||
width: auto;
|
||||
z-index: 20;
|
||||
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
||||
}
|
||||
|
||||
@@media screen and (max-width: 992px) {
|
||||
.wrapper {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.print-card {
|
||||
position: relative;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 20;
|
||||
}
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
/*border-radius: 10px;*/
|
||||
border: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 8px;
|
||||
/*border-radius: 10px;*/
|
||||
border: none;
|
||||
}
|
||||
|
||||
.half {
|
||||
width: 50%;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<div class="modal-header d-block text-center position-relative">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<form asp-page="./Leave" asp-page-handler="Details"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="Refresh"
|
||||
enctype="multipart/form-data">
|
||||
|
||||
<div class="modal-body print" id="printThis">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="section-leave">
|
||||
<table class="w-100">
|
||||
<tr>
|
||||
@if (Model.Path != null && !string.IsNullOrWhiteSpace(Model.Path))
|
||||
{
|
||||
<img src="@Url.Page("./EmployeeList", "ShowPicture", new { filePath = @Model.Path })" class="w-100 isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img src="~/assetsclient/images/pd-image.png" class="w-100"/>
|
||||
}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<div class="d-flex justify-content-start">
|
||||
<button type="button" class="btn btn-rounded waves-effect waves-light text-white me-2" data-bs-dismiss="modal" aria-label="Close" style="background-color: #454D5C;">بستن فرم</button>
|
||||
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light px-4">پرینت</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
window.onbeforeprint = (event) => {
|
||||
$("#MainModal").modal("hide");
|
||||
}
|
||||
document.getElementById("MainModal").style.visibility = "hidden";
|
||||
setTimeout(function () {
|
||||
printElement(document.getElementById("printThis"));
|
||||
}, 500);
|
||||
});
|
||||
|
||||
var close = document.getElementById("closingOnePrint");
|
||||
function printElement(elem) {
|
||||
var domClone = elem.cloneNode(true);
|
||||
|
||||
var $printSection = document.getElementById("printSection");
|
||||
|
||||
if (!$printSection) {
|
||||
$printSection = document.createElement("div");
|
||||
$printSection.id = "printSection";
|
||||
document.body.appendChild($printSection);
|
||||
}
|
||||
|
||||
$printSection.innerHTML = "";
|
||||
$printSection.appendChild(domClone);
|
||||
window.print();
|
||||
document.getElementById("MainModal").style.visibility = "visible";
|
||||
}
|
||||
</script>
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
@@ -13,16 +14,18 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
|
||||
private readonly IGetWorkshopWithRollCallHandler _workshopWithRollCallHandler;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IWorkFlowApplication _workflowApplication;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
public List<WorkshopWithRollCallServiceQueryModel> Items { get; set; }
|
||||
public List<WorkshopWithRollCallServiceQueryModel> WorkshopSearchItems { get; set; }
|
||||
public WorkshopWithRollCallServiceQueryParameters SearchModel;
|
||||
|
||||
public FilterMode FilterMode { get; set; }
|
||||
public IndexModel(IGetWorkshopWithRollCallHandler workshopWithRollCallHandler, IWorkshopApplication workshopApplication, IWorkFlowApplication workflowApplication)
|
||||
public IndexModel(IGetWorkshopWithRollCallHandler workshopWithRollCallHandler, IWorkshopApplication workshopApplication, IWorkFlowApplication workflowApplication, IAuthHelper authHelper)
|
||||
{
|
||||
_workshopWithRollCallHandler = workshopWithRollCallHandler;
|
||||
_workshopApplication = workshopApplication;
|
||||
_workflowApplication = workflowApplication;
|
||||
_authHelper = authHelper;
|
||||
}
|
||||
|
||||
public void OnGet(WorkshopWithRollCallServiceQueryParameters searchModel)
|
||||
@@ -45,7 +48,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
|
||||
|
||||
public async Task<IActionResult> OnPostWorkFlowCountByWorkshopId(long workshopId)
|
||||
{
|
||||
var result = await System.Threading.Tasks.Task.Run(() => _workflowApplication.GetAllWorkFlowCount(workshopId));
|
||||
var currentAccountId = _authHelper.CurrentAccountId();
|
||||
var result = await System.Threading.Tasks.Task.Run(() => _workflowApplication.GetAllWorkFlowCount(workshopId, currentAccountId));
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = result
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
@page
|
||||
@model ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow.EmployeesDocumentsModel
|
||||
@inject _0_Framework.Application.IAuthHelper AuthHelper;
|
||||
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
Layout = "Shared/_Layout";
|
||||
ViewData["title"] = " - بارگذاری مدارک توسط کارفرما";
|
||||
var currentAccount = AuthHelper.CurrentAccountInfo();
|
||||
|
||||
int index = 1;
|
||||
}
|
||||
|
||||
@@ -16,8 +19,14 @@
|
||||
<link href="~/AssetsClient/css/card.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/datetimepicker.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
|
||||
<link href="~/assetsclient/libs/fancybox/fancybox_2.css" rel="stylesheet" />
|
||||
|
||||
<link href="~/assetsadminnew/workflow/css/employeesdocuments.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<style>
|
||||
.fancybox__container {
|
||||
z-index: 9999999999999;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<div class="container-fluid">
|
||||
@@ -70,14 +79,45 @@
|
||||
<div class="bottom"></div>
|
||||
</div>
|
||||
|
||||
<li class="active" data-menu="DocumentsAwaitingUpload">
|
||||
<div class="d-flex align-items-center justify-content-between" id="clickDocumentsAwaitingUploadTab">
|
||||
<a href="javascript:void(0);">بارگزاری مدارک</a>
|
||||
<li class="active" data-menu="WorkshopDocumentRejectedForAdmin">
|
||||
<div class="d-flex align-items-center justify-content-between" id="clickWorkshopDocumentRejectedForAdminTab">
|
||||
<a href="javascript:void(0);">
|
||||
@(currentAccount.RoleId == 1 ? "تمامی برگشت خورده ها" : "برگشت خورده")
|
||||
</a>
|
||||
<div>
|
||||
<div id="CountDocumentsAwaitingUploadLoading" class="spinner-grow text-danger d-none" role="status" style="align-items: center;justify-content: center;display: flex;margin: 0 0 0 9px;">
|
||||
<div id="CountWorkshopDocumentRejectedForAdminLoading" class="spinner-grow text-danger d-none" role="status" style="align-items: center; justify-content: center; display: flex; margin: 0 0 0 9px;">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<span id="CountDocumentsAwaitingUpload">@Model.EmployeeDocumentsAwaitingSubmitCount</span>
|
||||
<span id="CountWorkshopDocumentRejectedForAdmin"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="" permission="1" data-menu="CreatedEmployeesWorkshopDocumentForAdmin">
|
||||
<div class="d-flex align-items-center justify-content-between" id="clickCreatedEmployeesWorkshopDocumentForAdminTab">
|
||||
<a href="javascript:void(0);">
|
||||
@(currentAccount.RoleId == 1 ? "تمامی مدارک پرسنل افزوده شده" : "آپلود مدارک پرسنل افزوده شده")
|
||||
</a>
|
||||
<div>
|
||||
<div id="CountCreatedEmployeesWorkshopDocumentForAdminLoading" class="spinner-grow text-danger d-none" role="status" style="align-items: center; justify-content: center; display: flex; margin: 0 0 0 9px;">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<span id="CountCreatedEmployeesWorkshopDocumentForAdmin"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="" permission="2" data-menu="ClientRejectedDocumentWorkshopsForAdmin">
|
||||
<div class="d-flex align-items-center justify-content-between" id="clickClientRejectedDocumentWorkshopsForAdminTab">
|
||||
<a href="javascript:void(0);">
|
||||
@* تمامی برگشت خورده آپلود مدارک پرسنل افزوده شده از سمت مشتری *@
|
||||
@* برگشت خورده آپلود مدارک پرسنل افزوده شده از سمت مشتری *@
|
||||
@(currentAccount.RoleId == 1 ? "تمامی مدارک برگشتی پرسنل افزودهشده" : "مدارک برگشتی پرسنل افزودهشده")
|
||||
</a>
|
||||
<div>
|
||||
<div id="CountClientRejectedDocumentWorkshopsForAdminLoading" class="spinner-grow text-danger d-none" role="status" style="align-items: center; justify-content: center; display: flex; margin: 0 0 0 9px;">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<span id="CountClientRejectedDocumentWorkshopsForAdmin" style="background-color: #158d8d;"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@@ -92,14 +132,36 @@
|
||||
</div>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="Rtable Rtable--collapse DocumentsAwaitingUploadWorkFlowLists">
|
||||
<div id="loadingSkeletonDocumentsAwaitingUpload" style="display: contents;">
|
||||
<div class="Rtable Rtable--collapse workshopDocumentRejectedForAdminWorkFlowLists">
|
||||
<div id="loadingSkeletonWorkshopDocumentRejectedForAdmin" style="display: contents;">
|
||||
@for (int j = 0; j < 30; j++)
|
||||
{
|
||||
<div class="skeleton-loader" style="margin: 3px 0 !important;height: 39px;"></div>
|
||||
}
|
||||
</div>
|
||||
<div class="w-100" id="loadDocumentsAwaitingUploadWorkFlow">
|
||||
<div class="w-100" id="loadWorkshopDocumentRejectedForAdminWorkFlowLists">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable Rtable--collapse createdEmployeesWorkshopDocumentForAdminWorkFlowLists" style="display: none">
|
||||
<div id="loadingSkeletonCreatedEmployeesWorkshopDocumentForAdmin" style="display: contents;">
|
||||
@for (int j = 0; j < 30; j++)
|
||||
{
|
||||
<div class="skeleton-loader" style="margin: 3px 0 !important;height: 39px;"></div>
|
||||
}
|
||||
</div>
|
||||
<div class="w-100" id="loadCreatedEmployeesWorkshopDocumentForAdminWorkFlowLists">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable Rtable--collapse clientRejectedDocumentWorkshopsForAdminWorkFlowLists" style="display: none">
|
||||
<div id="loadingSkeletonClientRejectedDocumentWorkshopsForAdmin" style="display: contents;">
|
||||
@for (int j = 0; j < 30; j++)
|
||||
{
|
||||
<div class="skeleton-loader" style="margin: 3px 0 !important;height: 39px;"></div>
|
||||
}
|
||||
</div>
|
||||
<div class="w-100" id="loadClientRejectedDocumentWorkshopsForAdminWorkFlowLists">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -120,13 +182,26 @@
|
||||
|
||||
|
||||
@section Script {
|
||||
<script src="~/assetsclient/libs/fancybox/fancybox.umd_2.js"></script>
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var showPictureUrl = `@Url.Page("./EmployeesDocuments", "ShowPicture")`;
|
||||
var loadWorkshopsWithDocumentsAwaitingUploadUrl = `@Url.Page("./EmployeesDocuments", "WorkshopsWithDocumentsAwaitingUploadAjax")`;
|
||||
var loadByWorkshopIdWithItemsForAdminWorkFlowUrl = `@Url.Page("./EmployeesDocuments", "ByWorkshopIdWithItemsForAdminWorkFlow")`;
|
||||
|
||||
// var loadWorkshopsWithDocumentsAwaitingUploadUrl = `@Url.Page("./EmployeesDocuments", "WorkshopsWithDocumentsAwaitingUploadAjax")`;
|
||||
// var loadByWorkshopIdWithItemsForAdminWorkFlowUrl = `@Url.Page("./EmployeesDocuments", "ByWorkshopIdWithItemsForAdminWorkFlow")`;
|
||||
|
||||
var loadCountWorkFlowUploadDocumentUrl = `@Url.Page("./EmployeesDocuments", "CountWorkFlowUploadDocument")`;
|
||||
|
||||
var loadWorkshopDocumentRejectedForAdminUrl = `@Url.Page("./EmployeesDocuments", "WorkshopDocumentRejectedForAdmin")`;
|
||||
var loadGetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlowUrl = `@Url.Page("./EmployeesDocuments", "GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow")`;
|
||||
|
||||
var loadClientRejectedDocumentWorkshopsForAdminUrl = `@Url.Page("./EmployeesDocuments", "ClientRejectedDocumentWorkshopsForAdmin")`;
|
||||
var loadClientRejectedDocumentByWorkshopIdForAdminUrl = `@Url.Page("./EmployeesDocuments", "ClientRejectedDocumentByWorkshopIdForAdmin")`;
|
||||
|
||||
var loadCreatedEmployeesWorkshopDocumentForAdminUrl = `@Url.Page("./EmployeesDocuments", "CreatedEmployeesWorkshopDocumentForAdmin")`;
|
||||
var loadCreatedEmployeesDocumentByWorkshopIdForAdminUrl = `@Url.Page("./EmployeesDocuments", "CreatedEmployeesDocumentByWorkshopIdForAdmin")`;
|
||||
</script>
|
||||
<script src="~/assetsadminnew/workflow/js/employeesdocuments.js?ver=@clientVersion"></script>
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Runtime.InteropServices.JavaScript;
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application.Contracts.Media;
|
||||
using Company.Domain.WorkshopAccountAgg;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.EmployeeDocuments;
|
||||
@@ -11,152 +13,254 @@ using WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
|
||||
namespace ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow
|
||||
{
|
||||
[Authorize]
|
||||
public class EmployeesDocumentsModel : PageModel
|
||||
{
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
private readonly IAdminWorkFlowApplication _adminWorkFlowApplication;
|
||||
private readonly IWorkshopAccountRepository _workshopAccountRepository;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
public int EmployeeDocumentsAwaitingSubmitCount;
|
||||
[Authorize]
|
||||
public class EmployeesDocumentsModel : PageModel
|
||||
{
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
private readonly IAdminWorkFlowApplication _adminWorkFlowApplication;
|
||||
private readonly IWorkshopAccountRepository _workshopAccountRepository;
|
||||
private readonly IMediaApplication _mediaApplication;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private long _roleId;
|
||||
|
||||
public EmployeesDocumentsModel(IAdminWorkFlowApplication adminWorkFlowApplication, IWorkshopApplication workshopApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IWorkshopAccountRepository workshopAccountRepository, IAuthHelper authHelper)
|
||||
{
|
||||
_adminWorkFlowApplication = adminWorkFlowApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
_workshopAccountRepository = workshopAccountRepository;
|
||||
_authHelper = authHelper;
|
||||
public EmployeesDocumentsModel(IAdminWorkFlowApplication adminWorkFlowApplication,
|
||||
IWorkshopApplication workshopApplication, IEmployeeDocumentsApplication employeeDocumentsApplication,
|
||||
IWorkshopAccountRepository workshopAccountRepository, IAuthHelper authHelper,
|
||||
IMediaApplication mediaApplication)
|
||||
{
|
||||
_adminWorkFlowApplication = adminWorkFlowApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
_workshopAccountRepository = workshopAccountRepository;
|
||||
_authHelper = authHelper;
|
||||
_mediaApplication = mediaApplication;
|
||||
_roleId = authHelper.CurrentAccountInfo().RoleId;
|
||||
}
|
||||
|
||||
public async System.Threading.Tasks.Task OnGet()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
EmployeeDocumentsAwaitingSubmitCount = await _adminWorkFlowApplication.GetEmployeeDocumentWorkFlowCountsForAdmin(accountWorkshops);
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
|
||||
public IActionResult OnGetWorkshopsWithDocumentsAwaitingUploadAjax()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops= _workshopAccountRepository.GetList(accountId).Select(x=>x.WorkshopId).ToList();
|
||||
public IActionResult OnGetWorkshopsWithDocumentsAwaitingUploadAjax()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
var resultData = _adminWorkFlowApplication.GetWorkshopsWithDocumentsAwaitingUploadForAdmin(accountWorkshops);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetByWorkshopIdWithItemsForAdminWorkFlow(long workshopId)
|
||||
{
|
||||
var resultData = _employeeDocumentsApplication.GetByWorkshopIdWithItemsForAdminWorkFlow(workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetByWorkshopIdWithItemsForAdminWorkFlow(long workshopId)
|
||||
{
|
||||
var resultData = _employeeDocumentsApplication.GetByWorkshopIdWithItemsForAdminWorkFlow(workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public async Task<IActionResult> OnGetClientRejectedDocumentWorkshopsForAdmin()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
var resultData = await _employeeDocumentsApplication.GetClientRejectedDocumentWorkshopsForAdmin(accountWorkshops,_roleId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetClientRejectedDocumentByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
var resultData = await _employeeDocumentsApplication.GetClientRejectedDocumentByWorkshopIdForAdmin(workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public async Task<IActionResult> OnGetCreatedEmployeesWorkshopDocumentForAdmin()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
var resultData = await _employeeDocumentsApplication.GetCreatedEmployeesWorkshopDocumentForAdmin(accountWorkshops, _roleId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetCreatedEmployeesDocumentByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
var resultData = await _employeeDocumentsApplication.GetCreatedEmployeesDocumentByWorkshopIdForAdmin(workshopId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetWorkshopDocumentRejectedForAdmin()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
var resultData =
|
||||
await _employeeDocumentsApplication.GetWorkshopDocumentRejectedForAdmin(accountWorkshops,
|
||||
_roleId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetGetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(long workshopId)
|
||||
{
|
||||
var resultData =
|
||||
await _employeeDocumentsApplication
|
||||
.GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(workshopId, _roleId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetCountWorkFlowUploadDocument()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
|
||||
var resultDataWorkshopDocumentRejectedForAdmin = await _employeeDocumentsApplication.GetWorkshopDocumentRejectedForAdmin(accountWorkshops, _roleId);
|
||||
var resultDataCreatedEmployeesWorkshopDocumentForAdmin = await _employeeDocumentsApplication.GetCreatedEmployeesWorkshopDocumentForAdmin(accountWorkshops, _roleId);
|
||||
var resultCountClientRejectedDocumentWorkshopsForAdmin = await _employeeDocumentsApplication.GetClientRejectedDocumentWorkshopsForAdmin(accountWorkshops,_roleId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
WorkshopDocumentRejectedForAdmin = resultDataWorkshopDocumentRejectedForAdmin.Count,
|
||||
CreatedEmployeesWorkshopDocumentForAdmin = resultDataCreatedEmployeesWorkshopDocumentForAdmin.Count,
|
||||
ClientRejectedDocumentWorkshopsForAdmin = resultCountClientRejectedDocumentWorkshopsForAdmin.Count
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public IActionResult OnGetCreateUploadDocument(long workshopId, long employeeId)
|
||||
{
|
||||
var employeeDocument = _employeeDocumentsApplication.GetDetailsForAdmin(employeeId, workshopId);
|
||||
return Partial("_ModalEmployeeDocuments/ModalUploadDocument", employeeDocument);
|
||||
}
|
||||
|
||||
public IActionResult OnPostCreateUploadDocument(AddEmployeeDocumentItem command)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.AddEmployeeDocumentItemForClient(command);
|
||||
var employeeDocument = _employeeDocumentsApplication.GetDetailsForAdmin(command.EmployeeId, command.WorkshopId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
imageSrc = employeeDocument
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostRemoveEmployeeDocumentByLabel(long workshopId, long employeeId, DocumentItemLabel label)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.RemoveClientDocumentItemsByAdminTemp(workshopId, employeeId, label);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
public IActionResult OnPostRemoveClientEmployeeDocumentItemsByLabels(long workshopId, long employeeId, List<DocumentItemLabel> labels)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.RemoveClientDocumentItemsByAdmin(workshopId, employeeId, labels);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostSaveSubmit(SubmitEmployeeDocuments cmd)
|
||||
{
|
||||
|
||||
var result = _employeeDocumentsApplication.SubmitDocumentItemsByAdminInWorkFlow(cmd);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetShowPicture(string filePath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath))
|
||||
return NotFound();
|
||||
|
||||
|
||||
if (!System.IO.File.Exists(filePath))
|
||||
return NotFound();
|
||||
|
||||
var contentType = Tools.GetContentTypeImage(Path.GetExtension(filePath));
|
||||
return PhysicalFile(filePath, contentType);
|
||||
}
|
||||
|
||||
public IActionResult OnPostCancelOperation(long workshopId, long employeeId)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.DeleteUnsubmittedItems(workshopId, employeeId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEditEmployeeModal(long employeeId, long workshopId)
|
||||
{
|
||||
var command = await _adminWorkFlowApplication.GetEmployeeEditInEmployeeDocumentWorkFlow(employeeId, workshopId);
|
||||
return Partial("_ModalEmployeeDocuments/ModalEmployeeEdit", command);
|
||||
{
|
||||
var employeeDocument = _employeeDocumentsApplication.GetDetailsForAdmin(employeeId, workshopId);
|
||||
return Partial("_ModalEmployeeDocuments/ModalUploadDocument", employeeDocument);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostEditEmployeeModal(EditEmployeeInEmployeeDocument command)
|
||||
{
|
||||
public IActionResult OnPostCreateUploadDocument(AddEmployeeDocumentItem command)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.AddEmployeeDocumentItemForClient(command);
|
||||
var employeeDocument = _employeeDocumentsApplication.GetDetailsForAdmin(command.EmployeeId, command.WorkshopId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
imageSrc = employeeDocument
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostRemoveEmployeeDocumentByLabel(long workshopId, long employeeId, DocumentItemLabel label)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.RemoveClientDocumentItemsByAdminTemp(workshopId, employeeId, label);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
public IActionResult OnPostRemoveClientEmployeeDocumentItemsByLabels(long workshopId, long employeeId, List<DocumentItemLabel> labels)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.RemoveClientDocumentItemsByAdmin(workshopId, employeeId, labels);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostSaveSubmit(SubmitEmployeeDocuments cmd)
|
||||
{
|
||||
|
||||
var result = _employeeDocumentsApplication.SubmitDocumentItemsByAdminInWorkFlow(cmd);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetShowPicture(string filePath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath))
|
||||
return NotFound();
|
||||
|
||||
|
||||
if (!System.IO.File.Exists(filePath))
|
||||
return NotFound();
|
||||
|
||||
var contentType = Tools.GetContentTypeImage(Path.GetExtension(filePath));
|
||||
return PhysicalFile(filePath, contentType);
|
||||
}
|
||||
|
||||
public IActionResult OnPostCancelOperation(long workshopId, long employeeId)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.DeleteUnsubmittedItems(workshopId, employeeId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEditEmployeeModal(long employeeId, long workshopId, long mediaId)
|
||||
{
|
||||
var media = _mediaApplication.Get(mediaId);
|
||||
var command = await _adminWorkFlowApplication.GetEmployeeEditInEmployeeDocumentWorkFlow(employeeId, workshopId);
|
||||
command.Media = media;
|
||||
return Partial("_ModalEmployeeDocuments/ModalEmployeeEdit", command);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostEditEmployeeModal(EditEmployeeInEmployeeDocument command)
|
||||
{
|
||||
var result = await _adminWorkFlowApplication.EditEmployeeInEmployeeDocumentWorkFlow(command);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostGroupSave(long workshopId, long employeeId, List<AddEmployeeDocumentItem> command)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.AddRangeEmployeeDocumentItemsByAdmin(workshopId, employeeId, command);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public IActionResult OnPostGroupSave(long workshopId, long employeeId, List<AddEmployeeDocumentItem> command)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.AddRangeEmployeeDocumentItemsByAdmin(workshopId, employeeId, command);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,19 +18,22 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IWorkshopAccountRepository _workshopAccountRepository;
|
||||
public int EmployeeDocumentsAwaitingSubmitCount;
|
||||
private readonly long _roleId;
|
||||
|
||||
public IndexModel(IAdminWorkFlowApplication adminWorkFlowApplication, IAuthHelper authHelper, IWorkshopAccountRepository workshopAccountRepository)
|
||||
public IndexModel(IAdminWorkFlowApplication adminWorkFlowApplication, IAuthHelper authHelper, IWorkshopAccountRepository workshopAccountRepository)
|
||||
{
|
||||
_adminWorkFlowApplication = adminWorkFlowApplication;
|
||||
_authHelper = authHelper;
|
||||
_workshopAccountRepository = workshopAccountRepository;
|
||||
_roleId = authHelper.CurrentAccountInfo().RoleId;
|
||||
|
||||
}
|
||||
|
||||
public async System.Threading.Tasks.Task OnGet()
|
||||
|
||||
public async System.Threading.Tasks.Task OnGet()
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(accountId).Select(x => x.WorkshopId).ToList();
|
||||
EmployeeDocumentsAwaitingSubmitCount = await _adminWorkFlowApplication.GetEmployeeDocumentWorkFlowCountsForAdmin(accountWorkshops);
|
||||
EmployeeDocumentsAwaitingSubmitCount = await _adminWorkFlowApplication.GetEmployeeDocumentWorkFlowCountsForAdmin(accountWorkshops,_roleId );
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetStartAndLeftWorkCount()
|
||||
|
||||
@@ -17,6 +17,16 @@
|
||||
.pdTitle2 {
|
||||
height: 42px;
|
||||
}
|
||||
|
||||
@@media (max-width: 768px) {
|
||||
.modal-body {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.btnUploadingPD, .btnDeletingPD {
|
||||
width: 80px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
@@ -67,7 +77,7 @@
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>عکس پرسنل <span> *</span></div>
|
||||
<div>عکس پرسنل @* <span> *</span> *@</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.EmployeePicture.RejectionMessage) ? "رد شد" : "")</div>
|
||||
@* <span class="pdTitle2 d-none d-md-block">در صورت آپلود نکردن عکس پرسنلی، عکس از حضور و غیاب تنظیم میشود.</span> *@
|
||||
@@ -80,7 +90,7 @@
|
||||
<div class="pdButtons">
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="0">آپلود عکس</button>
|
||||
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="0">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="0" data-media-id="@Model.EmployeePicture.MediaId">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnSendToChecker d-block mb-1 disable" data-index="0">ارسال به ناظر</button>
|
||||
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.EmployeePicture.PicturePath) ? Model.EmployeePicture.Status.ToString() : "") @(string.IsNullOrWhiteSpace(Model.EmployeePicture.PicturePath) ? "disable" : "")" data-index="0">حذف</button>
|
||||
@@ -134,7 +144,7 @@
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="1">آپلود عکس</button>
|
||||
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="1">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="1" data-media-id="@Model.NationalCardFront.MediaId">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnSendToChecker d-block mb-1 disable" data-index="1">ارسال به ناظر</button>
|
||||
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.NationalCardFront.PicturePath) ? Model.NationalCardFront.Status.ToString():"") @(!string.IsNullOrWhiteSpace(Model.NationalCardFront?.PicturePath) ? "" : "disable")" data-index="1">حذف</button>
|
||||
@@ -174,7 +184,7 @@
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>کارت ملی پشت <span> *</span></div>
|
||||
<div>کارت ملی پشت @* <span> *</span> *@</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.NationalCardRear.RejectionMessage) ? "رد شد" : "")</div>
|
||||
</div>
|
||||
@@ -186,7 +196,7 @@
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="2">آپلود عکس</button>
|
||||
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="2">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="2" data-media-id="@Model.NationalCardRear.MediaId">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnSendToChecker d-block mb-1 disable" data-index="2">ارسال به ناظر</button>
|
||||
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.NationalCardRear.PicturePath) ? Model.NationalCardRear.Status.ToString():"") @(!string.IsNullOrWhiteSpace(Model.NationalCardRear.PicturePath) ? "" : "disable")" data-index="2">حذف</button>
|
||||
@@ -238,7 +248,7 @@
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="3">آپلود عکس</button>
|
||||
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="3">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="3" data-media-id="@Model.MilitaryServiceCard.MediaId">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnSendToChecker d-block mb-1 disable" data-index="3">ارسال به ناظر</button>
|
||||
|
||||
<button type="button" class="btnDeletingPD d-block @(Model.Gender == "مرد" && !string.IsNullOrWhiteSpace(Model.MilitaryServiceCard.PicturePath)? Model.MilitaryServiceCard.Status.ToString():"") @(!string.IsNullOrWhiteSpace(Model.MilitaryServiceCard.PicturePath) ? "" : "disable")" data-index="3">حذف</button>
|
||||
@@ -291,7 +301,7 @@
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="4">آپلود عکس</button>
|
||||
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="4">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="4" data-media-id="@Model.IdCardPage1.MediaId">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnSendToChecker d-block mb-1 disable" data-index="4">ارسال به ناظر</button>
|
||||
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.IdCardPage1.PicturePath) ? Model.IdCardPage1.Status.ToString():"") @(!string.IsNullOrWhiteSpace(Model.IdCardPage1.PicturePath) ? "" : "disable")" data-index="4">حذف</button>
|
||||
@@ -332,7 +342,7 @@
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>شناسنامه صفحه دوم <span> *</span></div>
|
||||
<div>شناسنامه صفحه دوم @* <span> *</span> *@</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.IdCardPage2.RejectionMessage) ? "رد شد" : "")</div>
|
||||
</div>
|
||||
@@ -344,7 +354,7 @@
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="5">آپلود عکس</button>
|
||||
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="5">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="5" data-media-id="@Model.IdCardPage2.MediaId">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnSendToChecker d-block mb-1 disable" data-index="5">ارسال به ناظر</button>
|
||||
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.IdCardPage2.PicturePath) ? Model.IdCardPage2.Status.ToString():"") @(!string.IsNullOrWhiteSpace(Model.IdCardPage2.PicturePath) ? "" : "disable")" data-index="5">حذف</button>
|
||||
@@ -384,7 +394,7 @@
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>شناسنامه صفحه سوم <span> *</span></div>
|
||||
<div>شناسنامه صفحه سوم @* <span> *</span> *@</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.IdCardPage3.RejectionMessage) ? "رد شد" : "")</div>
|
||||
</div>
|
||||
@@ -396,7 +406,7 @@
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="6">آپلود عکس</button>
|
||||
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="6">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="6" data-media-id="@Model.IdCardPage3.MediaId">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnSendToChecker d-block mb-1 disable" data-index="6">ارسال به ناظر</button>
|
||||
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.IdCardPage3.PicturePath) ? Model.IdCardPage3.Status.ToString():"") @(!string.IsNullOrWhiteSpace(Model.IdCardPage3.PicturePath) ? "" : "disable")" data-index="6">حذف</button>
|
||||
@@ -448,7 +458,7 @@
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="7">آپلود عکس</button>
|
||||
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="7">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnEditEmployee d-block mb-1 disable" data-index="7" data-media-id="@Model.IdCardPage4.MediaId">ویرایش پرسنل</button>
|
||||
<button type="button" class="btnSendToChecker d-block mb-1 disable" data-index="7">ارسال به ناظر</button>
|
||||
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.IdCardPage4.PicturePath) ? Model.IdCardPage4.Status.ToString():"") @(!string.IsNullOrWhiteSpace(Model.IdCardPage4.PicturePath) ? "" : "disable")" data-index="7">حذف</button>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application;
|
||||
using AccountManagement.Application.Contracts.Task;
|
||||
using AccountManagement.Application.Contracts.Ticket;
|
||||
using backService;
|
||||
using Company.Domain.WorkshopAccountAgg;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
@@ -17,7 +19,10 @@ namespace ServiceHost.Areas.AdminNew.Pages
|
||||
private readonly IAdminWorkFlowApplication _adminWorkFlowApplication;
|
||||
private readonly ITicketApplication _ticketApplication;
|
||||
private readonly ITaskApplication _taskApplication;
|
||||
public List<BackupViewModel> DbBackupList { get; set; }
|
||||
private long _roleId;
|
||||
|
||||
|
||||
public List<BackupViewModel> DbBackupList { get; set; }
|
||||
public List<BackupViewModel> InsuranceBackupList { get; set; }
|
||||
|
||||
public IndexModel(IWebHostEnvironment webHostEnvironment, IConfiguration configuration, IAuthHelper authHelper, IWorkshopAccountRepository workshopAccountRepository, IAdminWorkFlowApplication adminWorkFlowApplication, ITicketApplication ticketApplication, ITaskApplication taskApplication)
|
||||
@@ -25,10 +30,13 @@ namespace ServiceHost.Areas.AdminNew.Pages
|
||||
_configuration = configuration;
|
||||
_authHelper = authHelper;
|
||||
_workshopAccountRepository = workshopAccountRepository;
|
||||
_adminWorkFlowApplication = adminWorkFlowApplication;
|
||||
_ticketApplication = ticketApplication;
|
||||
_taskApplication = taskApplication;
|
||||
_adminWorkFlowApplication = adminWorkFlowApplication;
|
||||
_roleId = authHelper.CurrentAccountInfo().RoleId;
|
||||
|
||||
}
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
#region DbBackupLoad
|
||||
@@ -67,18 +75,18 @@ namespace ServiceHost.Areas.AdminNew.Pages
|
||||
public async Task<IActionResult> OnGetLayoutCountTask()
|
||||
{
|
||||
var currentAccountId = _authHelper.CurrentAccountId();
|
||||
int taskCount = await _taskApplication.RequestedAndOverdueTasksCount(currentAccountId);
|
||||
int taskCount = await _taskApplication.RequestedAndOverdueTasksCount(currentAccountId);
|
||||
|
||||
return new JsonResult(new
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = taskCount
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetLayoutCountTicket()
|
||||
public IActionResult OnGetLayoutCountTicket()
|
||||
{
|
||||
int ticketCount = _ticketApplication.GetAdminTicketsCount();
|
||||
int ticketCount = _ticketApplication.GetAdminTicketsCount();
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
@@ -91,7 +99,8 @@ namespace ServiceHost.Areas.AdminNew.Pages
|
||||
{
|
||||
var currentAccountId = _authHelper.CurrentAccountId();
|
||||
var accountWorkshops = _workshopAccountRepository.GetList(currentAccountId).Select(x => x.WorkshopId).ToList();
|
||||
int workFlowCount = await _adminWorkFlowApplication.GetWorkFlowCountsForAdmin(accountWorkshops,currentAccountId);
|
||||
int workFlowCount = await _adminWorkFlowApplication.GetWorkFlowCountsForAdmin(accountWorkshops,currentAccountId, _roleId);
|
||||
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
|
||||
@@ -146,5 +146,16 @@ namespace ServiceHost.Areas.Client.Pages.Company.EmployeesDocuments
|
||||
var contentType = Tools.GetContentTypeImage(Path.GetExtension(filePath));
|
||||
return PhysicalFile(filePath, contentType);
|
||||
}
|
||||
|
||||
public IActionResult OnPostGroupSave(long employeeId, List<AddEmployeeDocumentItem> command)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.AddRangeEmployeeDocumentItemsByClient(_workshopId, employeeId, command);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,6 +338,7 @@
|
||||
<script src="~/assetsclient/libs/pdf/pdf.js"></script>
|
||||
<script>
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = '/assetsclient/libs/pdf/pdf.worker.js';
|
||||
var saveGroupSubmitAjax = `@Url.Page("./Index", "GroupSave")`;
|
||||
var saveUploadFileModalAjax = `@Url.Page("./Index", "CreateUploadDocument")`;
|
||||
var saveSubmitAjax = `@Url.Page("./Index", "SaveSubmit")`;
|
||||
var deleteFileAjaxUrl = `@Url.Page("./Index", "RemoveEmployeeDocumentByLabel")`;
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
@page
|
||||
@model ServiceHost.Areas.Client.Pages.Company.WorkFlow.EmployeeDocuments.IndexModel
|
||||
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
Layout = "Shared/_ClientLayout";
|
||||
ViewData["title"] = " - کارپوشه مدارک پرسنل";
|
||||
int index = 1;
|
||||
}
|
||||
|
||||
@section Styles {
|
||||
<link href="~/AssetsClient/css/table-style.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/table-responsive.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/assetsclient/css/operation-button.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/filter-search.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/card.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/datetimepicker.css?ver=@clientVersion" rel="stylesheet" />
|
||||
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
|
||||
|
||||
<link href="~/assetsclient/pages/workflow/employeedocuments/css/index.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<div class="content-container">
|
||||
<div class="container-fluid">
|
||||
<div class="row p-2">
|
||||
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
|
||||
<div class="col d-flex align-items-center justify-content-start">
|
||||
<img src="~/AssetsClient/images/icons/face-scan.png" alt="" class="img-fluid me-2" style="width: 45px;" />
|
||||
<div>
|
||||
<h4 class="title d-flex align-items-center">کارپوشه مدارک پرسنل</h4>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-page="/Index" class="back-btn" type="button">
|
||||
<span>بازگشت</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row p-lg-2">
|
||||
|
||||
<div class="wrapper p-0">
|
||||
<div class="subAccountHeaderList Rtable Rtable--collapse">
|
||||
<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
|
||||
<div class="rightHeaderMenu px-3">
|
||||
<div class="Rtable-cell column-heading width1">نام نقش</div>
|
||||
</div>
|
||||
<div class="leftHeaderMenu px-4">
|
||||
<div class="Rtable-cell column-heading width1">ردیف</div>
|
||||
<div class="Rtable-cell column-heading width2">نام کابران</div>
|
||||
<div class="Rtable-cell column-heading text-center width3">عکس پرسنلی</div>
|
||||
<div class="Rtable-cell column-heading text-center width4">کارت ملی</div>
|
||||
<div class="Rtable-cell column-heading text-center width5">کارت پایان خدمت</div>
|
||||
<div class="Rtable-cell column-heading text-center width6">شناسنامه</div>
|
||||
<div class="Rtable-cell column-heading text-end pe-2 width7">عملیات</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-0 d-block d-md-flex overflow-hidden rounded-3 my-2">
|
||||
|
||||
<div id="navbar-animmenu">
|
||||
<ul class="show-dropdown main-navbar">
|
||||
<div class="verti-selector">
|
||||
<div class="top"></div>
|
||||
<div class="bottom"></div>
|
||||
</div>
|
||||
|
||||
<li class="active" data-menu="absent">
|
||||
<div class="d-flex align-items-center justify-content-between" id="clickAbsentTab">
|
||||
<a href="javascript:void(0);">اصلاح اطلاعات و بارگزاری مدارک</a>
|
||||
<div class="">
|
||||
<div id="CountRejectedDocumentLoading" class="spinner-grow text-danger" role="status" style="align-items: center;justify-content: center;display: flex;margin: 0 0 0 9px;">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<span id="CountRejectedDocument" style="display: none"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
@* <li class="lastRole" data-menu="overlappingLeave">
|
||||
<div class="d-flex align-items-center justify-content-between" id="clickOverlappingLeavesTab">
|
||||
<a href="javascript:void(0);">رفع تداخل مرخصی و تردد پرسنل</a>
|
||||
<div>
|
||||
<div id="CountOverlappingLeaveLoading" class="spinner-grow text-danger" role="status" style="align-items: center;justify-content: center;display: flex;margin: 0 0 0 9px;">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<span id="CountOverlappingLeave" style="display: none"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li> *@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="" id="accountList">
|
||||
<div class="card p-2">
|
||||
<div class="row align-items-center mb-1">
|
||||
<div class="col-12 col-md-8 col-lg-8">
|
||||
<div class="d-flex align-items-center">
|
||||
@* <div class="position-relative ms-2">
|
||||
<input type="text" class="form-control" id="search" placeholder="جستجو ...">
|
||||
<button type="button" id="clear-search" class="close-btn-search d-none">
|
||||
<svg width="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div> *@
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-none col-12 col-md-4 col-lg-4"></div>
|
||||
<div class="col-1 col-lg-4 text-end"></div>
|
||||
</div>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="Rtable Rtable--collapse rejectedDocumentWorkFlowLists">
|
||||
<div id="loadingSkeletonRejectedDocument" style="display: contents;">
|
||||
@for (int j = 0; j < 30; j++)
|
||||
{
|
||||
<div class="skeleton-loader" style="margin: 3px 0 !important;height: 39px;"></div>
|
||||
}
|
||||
</div>
|
||||
<div class="w-100" id="loadRejectedDocumentWorkFlow">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="MainModal" class="modal fade " aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||||
<div class="modal-dialog modal-xl modal-dialog-centered modalRollCallWidth modal-dialog-scrollable">
|
||||
<div class="modal-content" id="ModalContent">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@section Script {
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var clientRejectedDocumentForClientUrl = `@Url.Page("./Index", "ClientRejectedDocumentForClient")`;
|
||||
var showPictureUrl = `@Url.Page("./Index", "ShowPicture")`;
|
||||
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/WorkFlow/EmployeeDocuments/js/Index.js?ver=@clientVersion"></script>
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Claims;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.EmployeeDocuments;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using WorkFlow.Infrastructure.ACL.EmployeeDocuments;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow.EmployeeDocuments
|
||||
{
|
||||
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
private readonly long _workshopId;
|
||||
|
||||
public IndexModel(IHttpContextAccessor contextAccessor, IPasswordHasher passwordHasher, IEmployeeDocumentsApplication employeeDocumentsApplication, IAuthHelper authHelper)
|
||||
{
|
||||
_contextAccessor = contextAccessor;
|
||||
_passwordHasher = passwordHasher;
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
_authHelper = authHelper;
|
||||
|
||||
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (_workshopId < 1)
|
||||
throw new InvalidDataException("اختلال در کارگاه");
|
||||
}
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetClientRejectedDocumentForClient()
|
||||
{
|
||||
var currentAccountId = _authHelper.CurrentAccountId();
|
||||
var resultData = await _employeeDocumentsApplication.GetClientRejectedDocumentForClient(_workshopId, currentAccountId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetCreateUploadDocument(long employeeId)
|
||||
{
|
||||
var employeeDocument = _employeeDocumentsApplication.GetDetailsForClient(employeeId, _workshopId);
|
||||
|
||||
return Partial("./ModalUploadDocument", employeeDocument);
|
||||
}
|
||||
|
||||
public IActionResult OnPostCreateUploadDocument(AddEmployeeDocumentItem command)
|
||||
{
|
||||
command.WorkshopId = _workshopId;
|
||||
|
||||
var result = _employeeDocumentsApplication.AddEmployeeDocumentItemForClient(command);
|
||||
var employeeDocument = _employeeDocumentsApplication.GetDetailsForClient(command.EmployeeId, _workshopId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
imageSrc = employeeDocument
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostRemoveEmployeeDocumentByLabel(long employeeId, DocumentItemLabel label)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.DeleteEmployeeMultipleUnsubmittedDocumentsByLabel(_workshopId, employeeId,
|
||||
label);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostSaveSubmit(SubmitEmployeeDocuments cmd)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.SubmitDocumentItemsByClient(cmd);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostCancelOperation(long employeeId)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.DeleteUnsubmittedItems(_workshopId, employeeId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetShowPicture(string filePath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath))
|
||||
return NotFound();
|
||||
|
||||
|
||||
if (!System.IO.File.Exists(filePath))
|
||||
return NotFound();
|
||||
|
||||
var contentType = Tools.GetContentTypeImage(Path.GetExtension(filePath));
|
||||
return PhysicalFile(filePath, contentType);
|
||||
}
|
||||
|
||||
public IActionResult OnPostGroupSave(long employeeId, List<AddEmployeeDocumentItem> command)
|
||||
{
|
||||
var result = _employeeDocumentsApplication.AddRangeEmployeeDocumentItemsByClient(_workshopId, employeeId, command);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,349 @@
|
||||
@using System.Reflection
|
||||
@using CompanyManagment.App.Contracts.EmployeeDocuments
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model CompanyManagment.App.Contracts.EmployeeDocuments.EmployeeDocumentsViewModel
|
||||
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link href="~/assetsclient/pages/employeesdocument/css/ModalUploadDocument.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header pb-0 d-flex align-items-center justify-content-center text-center">
|
||||
<button type="button" class="btn-close position-absolute text-start exitModal" aria-label="Close"></button>
|
||||
<div>
|
||||
<p class="m-0 pdHeaderTitle1">آپلود مدارک @Model.EmployeeFullName</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="pdBoxGrid">
|
||||
<div class="pdBox">
|
||||
<input type="hidden" id="employeeIdForList" value="@Model.EmployeeId" asp-for="@Model.EmployeeId"/>
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
|
||||
@if (Model.EmployeePicture.PicturePath != null && !string.IsNullOrWhiteSpace(Model.EmployeePicture.PicturePath))
|
||||
{
|
||||
<img id="EmployeePicture" src="@Url.Page("./Index", "ShowPicture", new { filePath = @Model.EmployeePicture.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="EmployeePicture" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
<input type="hidden" value="@Model.EmployeePicture.Id" asp-for="@Model.EmployeePicture.Id"/>
|
||||
<div class="sign ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>عکس پرسنل @* <span> *</span> *@</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.EmployeePicture.RejectionMessage) ? "رد شد" : "")</div>
|
||||
@* <span class="pdTitle2 d-none d-md-block">در صورت آپلود نکردن عکس پرسنلی، عکس از حضور و غیاب تنظیم میشود.</span> *@
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdTitle2 reasonReject">@(!string.IsNullOrWhiteSpace(Model.EmployeePicture.RejectionMessage) ? Model.EmployeePicture.RejectionMessage : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="label_0" value="EmployeePicture"/>
|
||||
<div class="pdButtons">
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="0">آپلود عکس</button>
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.EmployeePicture.PicturePath) ? Model.EmployeePicture.Status.ToString() : "") @(string.IsNullOrWhiteSpace(Model.EmployeePicture.PicturePath) ? "disable" : "")" data-index="0">حذف</button>
|
||||
</div>
|
||||
<input type="file" class="file-input" data-index="0" accept=".jpg,.jpeg,.png,.pdf" style="display: none;">
|
||||
<div class="spinner-loading-progress loading" style="display: none">
|
||||
<span class="text-white percentageText"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdBox">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.NationalCardFront.PicturePath))
|
||||
{
|
||||
<img id="NationalCardFront" src="@Url.Page("./Index", "ShowPicture", new { filePath = @Model.NationalCardFront.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="NationalCardFront" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
<input type="hidden" value="@Model.NationalCardFront?.Id ?? 0" asp-for="@Model.NationalCardFront.Id"/>
|
||||
<div class="sign ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>کارت ملی رو @* <span> *</span> *@</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.NationalCardFront.RejectionMessage) ? "رد شد" : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdTitle2 reasonReject ">@(!string.IsNullOrWhiteSpace(Model.NationalCardFront.RejectionMessage) ? Model.NationalCardFront.RejectionMessage : "")</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<input type="hidden" id="label_1" value="NationalCardFront"/>
|
||||
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="1">آپلود عکس</button>
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.NationalCardFront.PicturePath) ? Model.NationalCardFront.Status.ToString() : "") @(!string.IsNullOrWhiteSpace(Model.NationalCardFront?.PicturePath) ? "" : "disable")" data-index="1">حذف</button>
|
||||
</div>
|
||||
<input type="file" class="file-input" data-index="1" accept=".jpg,.jpeg,.png,.pdf" style="display: none;">
|
||||
<div class="spinner-loading-progress loading" style="display: none">
|
||||
<span class="text-white percentageText"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdBox">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.NationalCardRear.PicturePath))
|
||||
{
|
||||
<img id="NationalCardRear" src="@Url.Page("./Index", "ShowPicture", new { filePath = @Model.NationalCardRear.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="NationalCardRear" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
<input type="hidden" value="@Model.NationalCardRear.Id" asp-for="@Model.NationalCardRear.Id"/>
|
||||
<div class="sign">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>کارت ملی پشت @* <span> *</span> *@</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.NationalCardRear.RejectionMessage) ? "رد شد" : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdTitle2 reasonReject ">@(!string.IsNullOrWhiteSpace(Model.NationalCardRear.RejectionMessage) ? Model.NationalCardRear.RejectionMessage : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="label_2" value="NationalCardRear"/>
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="2">آپلود عکس</button>
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.NationalCardRear.PicturePath) ? Model.NationalCardRear.Status.ToString() : "") @(!string.IsNullOrWhiteSpace(Model.NationalCardRear.PicturePath) ? "" : "disable")" data-index="2">حذف</button>
|
||||
</div>
|
||||
<input type="file" class="file-input" data-index="2" accept=".jpg,.jpeg,.png,.pdf" style="display: none;">
|
||||
<div class="spinner-loading-progress loading" style="display: none">
|
||||
<span class="text-white percentageText"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdBox @(Model.Gender == "زن" ? "disable" : "") ">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.MilitaryServiceCard.PicturePath))
|
||||
{
|
||||
<img id="militaryServiceCardModal" src="@Url.Page("./Index", "ShowPicture", new { filePath = @Model.MilitaryServiceCard.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="militaryServiceCardModal" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
<input type="hidden" value="@Model.MilitaryServiceCard.Id" asp-for="@Model.MilitaryServiceCard.Id"/>
|
||||
<div class="sign">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>کارت پایان خدمت @* <span> *</span> *@</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.MilitaryServiceCard.RejectionMessage) ? "رد شد" : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdTitle2 reasonReject ">@(!string.IsNullOrWhiteSpace(Model.MilitaryServiceCard.RejectionMessage) ? Model.MilitaryServiceCard.RejectionMessage : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="label_3" value="MilitaryServiceCard"/>
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="3">آپلود عکس</button>
|
||||
<button type="button" class="btnDeletingPD d-block @(Model.Gender == "مرد" && !string.IsNullOrWhiteSpace(Model.MilitaryServiceCard.PicturePath) ? Model.MilitaryServiceCard.Status.ToString() : "") @(!string.IsNullOrWhiteSpace(Model.MilitaryServiceCard.PicturePath) ? "" : "disable")" data-index="3">حذف</button>
|
||||
</div>
|
||||
<input type="file" class="file-input" data-index="3" accept=".jpg,.jpeg,.png,.pdf" style="display: none;">
|
||||
<div class="spinner-loading-progress loading" style="display: none">
|
||||
<span class="text-white percentageText"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdBox">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.IdCardPage1.PicturePath))
|
||||
{
|
||||
<img id="IdCardPage1" src="@Url.Page("./Index", "ShowPicture", new { filePath = @Model.IdCardPage1.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="IdCardPage1" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
<input type="hidden" value="@Model.IdCardPage1.Id" asp-for="@Model.IdCardPage1.Id"/>
|
||||
<div class="sign">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>شناسنامه صفحه اول @*<span>*</span> *@</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.IdCardPage1.RejectionMessage) ? "رد شد" : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdTitle2 reasonReject ">@(!string.IsNullOrWhiteSpace(Model.IdCardPage1.RejectionMessage) ? Model.IdCardPage1.RejectionMessage : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="label_4" value="IdCardPage1"/>
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="4">آپلود عکس</button>
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.IdCardPage1.PicturePath) ? Model.IdCardPage1.Status.ToString() : "") @(!string.IsNullOrWhiteSpace(Model.IdCardPage1.PicturePath) ? "" : "disable")" data-index="4">حذف</button>
|
||||
</div>
|
||||
<input type="file" class="file-input" data-index="4" accept=".jpg,.jpeg,.png,.pdf" style="display: none;">
|
||||
<div class="spinner-loading-progress loading" style="display: none">
|
||||
<span class="text-white percentageText"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdBox">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.IdCardPage2.PicturePath))
|
||||
{
|
||||
<img id="IdCardPage2" src="@Url.Page("./Index", "ShowPicture", new { filePath = @Model.IdCardPage2.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="IdCardPage2" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
<input type="hidden" value="@Model.IdCardPage2.Id" asp-for="@Model.IdCardPage2.Id"/>
|
||||
<div class="sign ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>شناسنامه صفحه دوم</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.IdCardPage2.RejectionMessage) ? "رد شد" : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdTitle2 reasonReject ">@(!string.IsNullOrWhiteSpace(Model.IdCardPage2.RejectionMessage) ? Model.IdCardPage2.RejectionMessage : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="label_5" value="IdCardPage2"/>
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="5">آپلود عکس</button>
|
||||
@* status change first status *@
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.IdCardPage2.PicturePath) ? Model.IdCardPage2.Status.ToString() : "") @(!string.IsNullOrWhiteSpace(Model.IdCardPage2.PicturePath) ? "" : "disable")" data-index="5">حذف</button>
|
||||
</div>
|
||||
<input type="file" class="file-input" data-index="5" accept=".jpg,.jpeg,.png,.pdf" style="display: none;">
|
||||
<div class="spinner-loading-progress loading" style="display: none">
|
||||
<span class="text-white percentageText"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdBox">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.IdCardPage3.PicturePath))
|
||||
{
|
||||
<img id="IdCardPage3" src="@Url.Page("./Index", "ShowPicture", new { filePath = @Model.IdCardPage3.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="IdCardPage3" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
<input type="hidden" value="@Model.IdCardPage3.Id" asp-for="@Model.IdCardPage3.Id"/>
|
||||
<div class="sign ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>شناسنامه صفحه سوم</div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.IdCardPage3.RejectionMessage) ? "رد شد" : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdTitle2 reasonReject ">@(!string.IsNullOrWhiteSpace(Model.IdCardPage3.RejectionMessage) ? Model.IdCardPage3.RejectionMessage : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="label_6" value="IdCardPage3"/>
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="6">آپلود عکس</button>
|
||||
@* status change first status *@
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.IdCardPage3.PicturePath) ? Model.IdCardPage3.Status.ToString() : "") @(!string.IsNullOrWhiteSpace(Model.IdCardPage3.PicturePath) ? "" : "disable")" data-index="6">حذف</button>
|
||||
</div>
|
||||
<input type="file" class="file-input" data-index="6" accept=".jpg,.jpeg,.png,.pdf" style="display: none;">
|
||||
<div class="spinner-loading-progress loading" style="display: none">
|
||||
<span class="text-white percentageText"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdBox">
|
||||
<div class="d-flex align-items-center justify-content-start w90">
|
||||
<div class="pdImageBox">
|
||||
@if (!string.IsNullOrWhiteSpace(Model.IdCardPage4.PicturePath))
|
||||
{
|
||||
<img id="IdCardPage4" src="@Url.Page("./Index", "ShowPicture", new { filePath = @Model.IdCardPage4.PicturePath })" class="preview-image isTrue"/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img id="IdCardPage4" src="~/assetsclient/images/pd-image.png" class="preview-image"/>
|
||||
}
|
||||
<input type="hidden" value="@Model.IdCardPage4.Id" asp-for="@Model.IdCardPage4.Id"/>
|
||||
<div class="sign ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-start mx-1 pdTitle">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div>شناسنامه صفحه چهارم </div>
|
||||
<div class="resultMessage">
|
||||
<div>@(!string.IsNullOrWhiteSpace(Model.IdCardPage4.RejectionMessage) ? "رد شد" : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdTitle2 reasonReject ">@(!string.IsNullOrWhiteSpace(Model.IdCardPage4.RejectionMessage) ? Model.IdCardPage4.RejectionMessage : "")</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="label_7" value="IdCardPage4"/>
|
||||
<div>
|
||||
<button type="button" class="btnUploadingPD d-block mb-1" data-index="7">آپلود عکس</button>
|
||||
<button type="button" class="btnDeletingPD d-block @(!string.IsNullOrWhiteSpace(Model.IdCardPage4.PicturePath) ? Model.IdCardPage4.Status.ToString() : "") @(!string.IsNullOrWhiteSpace(Model.IdCardPage4.PicturePath) ? "" : "disable")" data-index="7">حذف</button>
|
||||
</div>
|
||||
<input type="file" class="file-input" data-index="7" accept=".jpg,.jpeg,.png,.pdf" style="display: none;">
|
||||
<div class="spinner-loading-progress loading" style="display: none">
|
||||
<span class="text-white percentageText"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer d-block">
|
||||
<div class="container m-auto">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="exitModal btn-cancel2 justify-content-center">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" class="btnCreateNew loadingButton disable position-relative" id="createUploadingFiles" onclick="saveSubmit(Number(@Model.Id))">
|
||||
ثبت
|
||||
<div class="spinner-loading loading" style="display: none">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
<script src="~/assetsadminnew/libs/sweetalert2/sweetalert2.all.min.js"></script>
|
||||
<script src="~/assetsclient/libs/pdf/pdf.js"></script>
|
||||
<script>
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = '/assetsclient/libs/pdf/pdf.worker.js';
|
||||
var saveGroupSubmitAjax = `@Url.Page("./Index", "GroupSave")`;
|
||||
var saveUploadFileModalAjax = `@Url.Page("./Index", "CreateUploadDocument")`;
|
||||
var saveSubmitAjax = `@Url.Page("./Index", "SaveSubmit")`;
|
||||
var deleteFileAjaxUrl = `@Url.Page("./Index", "RemoveEmployeeDocumentByLabel")`;
|
||||
var cancelOperationUrl = `@Url.Page("./Index", "CancelOperation")`;
|
||||
var employeeId = Number(@Model.EmployeeId);
|
||||
var UploadedCount = Number(@Model.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(y => y.PropertyType == typeof(EmployeeDocumentItemViewModel)).Select(y => y.GetValue(@Model) as EmployeeDocumentItemViewModel).Count(x=>x.Status == DocumentStatus.Unsubmitted && !string.IsNullOrWhiteSpace(x.PicturePath)));
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/WorkFlow/EmployeeDocuments/js/ModalUploadDocument.js?ver=@clientVersion"></script>
|
||||
@@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System.Security.Claims;
|
||||
using _0_Framework.Infrastructure;
|
||||
using CompanyManagment.App.Contracts.EmployeeDocuments;
|
||||
using WorkFlow.Application.Contracts.WorkFlow;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow
|
||||
@@ -18,6 +19,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow
|
||||
private readonly IPasswordHasher _passwordHasher;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IWorkFlowApplication _workFlowApplication;
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
private readonly IRollCallServiceApplication _rollCallServiceApplication;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly long _workshopId;
|
||||
@@ -26,7 +28,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow
|
||||
public int CountRollCall;
|
||||
public bool HasRollCallService;
|
||||
|
||||
public IndexModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, IWorkFlowApplication workFlowApplication, IAuthHelper authHelper, IRollCallServiceApplication rollCallServiceApplication, IHttpContextAccessor contextAccessor)
|
||||
public IndexModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, IWorkFlowApplication workFlowApplication, IAuthHelper authHelper, IRollCallServiceApplication rollCallServiceApplication, IHttpContextAccessor contextAccessor, IEmployeeDocumentsApplication employeeDocumentsApplication)
|
||||
{
|
||||
_passwordHasher = passwordHasher;
|
||||
_workshopApplication = workshopApplication;
|
||||
@@ -34,6 +36,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow
|
||||
_authHelper = authHelper;
|
||||
_rollCallServiceApplication = rollCallServiceApplication;
|
||||
_contextAccessor = contextAccessor;
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
|
||||
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
@@ -52,25 +55,37 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow
|
||||
return Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetCountRollCall()
|
||||
public async Task<IActionResult> OnGetCountWorkFlowLayout(long accountId)
|
||||
{
|
||||
var currentAccountId = _authHelper.CurrentAccountId();
|
||||
int countWorkFlowResult = await _workFlowApplication.GetCountAllWorkFlows(_workshopId, currentAccountId);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
countWorkFlow = countWorkFlowResult,
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetCountRollCall()
|
||||
{
|
||||
var allWorkFlowCount = await _workFlowApplication.GetAllWorkFlowCount(_workshopId);
|
||||
var allWorkFlowCount = await _workFlowApplication.GetAllRollCallCount(_workshopId);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
countWorkFlow = allWorkFlowCount,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public async Task<IActionResult> OnGetCountWorkFlowLayout()
|
||||
|
||||
public async Task<IActionResult> OnGetCountEmployeeDocuments()
|
||||
{
|
||||
int countWorkFlowResult = await _workFlowApplication.GetCountAllWorkFlows(_workshopId);
|
||||
var currentAccountId = _authHelper.CurrentAccountId();
|
||||
var allWorkFlowCount = await _workFlowApplication.GetAllEmployeeDocuments(_workshopId, currentAccountId);
|
||||
|
||||
return new JsonResult(new
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
countWorkFlow = countWorkFlowResult,
|
||||
countWorkFlow = allWorkFlowCount,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,6 +358,8 @@
|
||||
|
||||
$(document).ready(function () {
|
||||
_RefreshCountMenu();
|
||||
_RefreshCountRollCallMenu();
|
||||
_RefreshCountEmployeeDocumentsMenu();
|
||||
$('input[type="text"], input[type="number"], textarea').each(function () {
|
||||
$(this).on('input', function () {
|
||||
var enteredValue = $(this).val();
|
||||
@@ -388,17 +390,16 @@
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
if (response.countWorkFlow === 0) {
|
||||
$('#_countWorkFlowMenu, #_countRollCallMenuSubmenu').hide();
|
||||
$('#spinnerWorkFlow, #spinnerRollCall').hide();
|
||||
$('#_countWorkFlowMenu').hide();
|
||||
$('#spinnerWorkFlow').hide();
|
||||
$('#_countWorkFlowMenuMobile').hide();
|
||||
$('#spinnerWorkFlowMobile').hide();
|
||||
} else {
|
||||
$('#_countWorkFlowMenu, #_countRollCallMenuSubmenu').css('display', 'flex');
|
||||
$('#spinnerWorkFlow, #spinnerRollCall').hide();
|
||||
$('#_countWorkFlowMenu').css('display', 'flex');
|
||||
$('#spinnerWorkFlow').hide();
|
||||
$('#_countWorkFlowMenuMobile').show();
|
||||
// $('#spinnerWorkFlowMobile').hide();
|
||||
$('#_countWorkFlowMenu').text(response.countWorkFlow);
|
||||
$('#_countRollCallMenuSubmenu').text(response.countWorkFlow);
|
||||
$('#_countWorkFlowMenuMobile').text(response.countWorkFlow);
|
||||
}
|
||||
}
|
||||
@@ -409,7 +410,53 @@
|
||||
});
|
||||
}
|
||||
|
||||
function _RefreshCountRollCallMenu() {
|
||||
$.ajax({
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
url: '/Client/Company/WorkFlow?handler=CountRollCall',
|
||||
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.success) {
|
||||
$('#spinnerRollCall').hide();
|
||||
if (response.countWorkFlow === 0) {
|
||||
$('#_countRollCallMenuSubmenu').hide();
|
||||
} else {
|
||||
$('#_countRollCallMenuSubmenu').css('display', 'flex').text(response.countWorkFlow);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function _RefreshCountEmployeeDocumentsMenu() {
|
||||
$.ajax({
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
url: '/Client/Company/WorkFlow?handler=CountEmployeeDocuments',
|
||||
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.success) {
|
||||
$('#spinnerEmployeeDocuments').hide();
|
||||
if (response.countWorkFlow === 0) {
|
||||
$('#_countEmployeeDocumentsMenuSubmenu').hide();
|
||||
} else {
|
||||
$('#_countEmployeeDocumentsMenuSubmenu').css('display', 'flex').text(response.countWorkFlow);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Override the global fetch function to handle errors
|
||||
// const originalErrorHandler = $.ajaxSetup().error;
|
||||
|
||||
@@ -229,11 +229,24 @@
|
||||
<div id="spinnerRollCall" class="spinner-border spinner-border-sm text-light" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<span id="_countRollCallMenuSubmenu" class="alert-number-default" style="display:none"></span>
|
||||
<span id="_countRollCallMenuSubmenu" class="alert-number-default" style="display:none"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@* <li Permission="@SubAccountPermissionHelper.WorkFlowContractsAndCheckoutsPermissionCode"><a class="selectLi" asp-page=""><span>قرارداد و فیش حقوقی</span></a></li>
|
||||
|
||||
<li Permission="@SubAccountPermissionHelper.WorkFlowRollCallsPermissionCode">
|
||||
<a class="selectLi d-flex align-items-center justify-content-between" asp-page="/Company/WorkFlow/EmployeeDocuments/Index">
|
||||
<span>بارگزاری مدارک پرسنل</span>
|
||||
|
||||
<div>
|
||||
<div id="spinnerEmployeeDocuments" class="spinner-border spinner-border-sm text-light" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<span id="_countEmployeeDocumentsMenuSubmenu" class="alert-number-default" style="display:none"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
@* <li Permission="@SubAccountPermissionHelper.WorkFlowContractsAndCheckoutsPermissionCode"><a class="selectLi" asp-page=""><span>قرارداد و فیش حقوقی</span></a></li>
|
||||
<li Permission="@SubAccountPermissionHelper.WorkFlowInsurancesPermissionCode"><a class="selectLi" asp-page=""><span>بیمه</span></a></li> *@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 387 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 387 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 387 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 387 KiB |
@@ -0,0 +1,156 @@
|
||||
.errored {
|
||||
animation: shake 300ms;
|
||||
color: #eb3434 !important;
|
||||
background-color: #fef2f2 !important;
|
||||
border: 1px solid #eb3434 !important;
|
||||
}
|
||||
|
||||
.pdBoxGrid {
|
||||
user-select: none;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
grid-template-rows: repeat(4, minmax(0, 1fr));
|
||||
grid-auto-flow: column;
|
||||
gap: 9px;
|
||||
}
|
||||
|
||||
.width-btn {
|
||||
width: 550px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.btn-register {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 70px;
|
||||
}
|
||||
|
||||
.btn-cancel2 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #454D5C;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 70px;
|
||||
}
|
||||
|
||||
.btn-register:hover, btn-cancel2:hover {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.pdBox {
|
||||
background-color: #F8F8F8;
|
||||
border-radius: 15px;
|
||||
border: 1px solid #E7E7E7;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.preview-image {
|
||||
object-fit: cover;
|
||||
object-position: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.pdImageBox {
|
||||
background-color: #E6E6E6;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #D3D3D3;
|
||||
width: 100px;
|
||||
height: 60px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.selectable-document {
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.selectable-document.selected {
|
||||
border-color: #2BBABA;
|
||||
background-color: #D0FFF7;
|
||||
}
|
||||
|
||||
.hidden-checkbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.custom-checkmark {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 2px solid #ccc;
|
||||
border-radius: 50%;
|
||||
background-color: white;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.selectable-document.selected .custom-checkmark {
|
||||
background-color: #4CAF50;
|
||||
border-color: #4CAF50;
|
||||
}
|
||||
|
||||
.selectable-document.selected .custom-checkmark::after {
|
||||
content: "";
|
||||
display: flex;
|
||||
width: 5px;
|
||||
height: 10px;
|
||||
border: solid white;
|
||||
border-top-width: medium;
|
||||
border-right-width: medium;
|
||||
border-bottom-width: medium;
|
||||
border-left-width: medium;
|
||||
border-width: 0 2px 2px 0;
|
||||
transform: rotate(45deg);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 2px 5px 0 0;
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.width-btn {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.pdBoxGrid {
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
grid-template-rows: none;
|
||||
grid-auto-flow: unset;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.modal-body {
|
||||
height: 75vh;
|
||||
}
|
||||
|
||||
.pdBox {
|
||||
padding: 9px;
|
||||
}
|
||||
|
||||
.pdImageBox {
|
||||
width: 70px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.pdImageBox img {
|
||||
width: 70px;
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
.errored {
|
||||
animation: shake 300ms;
|
||||
color: #eb3434 !important;
|
||||
background-color: #fef2f2 !important;
|
||||
border: 1px solid #eb3434 !important;
|
||||
}
|
||||
|
||||
.image-show {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.image-show img {
|
||||
width: 100%;
|
||||
object-fit: contain;
|
||||
height: 350px;
|
||||
background-color: #D9D9D9;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.width-btn {
|
||||
width: 550px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.btn-register {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 70px;
|
||||
}
|
||||
|
||||
.btn-cancel2 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #454D5C;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 70px;
|
||||
}
|
||||
|
||||
.btn-register:hover, btn-cancel2:hover {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.width-btn {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
||||
}
|
||||
@@ -130,7 +130,7 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
html += `<img id="employeePicture_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="text-start">${item.employeeFullName}</div>
|
||||
<div class="text-start" id="EmployeeFullName">${item.employeeFullName}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="Rtable-cell d-md-block d-none width3">
|
||||
@@ -148,49 +148,48 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
<div class="Rtable-cell d-md-block d-none width4">
|
||||
<div class="Rtable-cell--content d-flex align-items-center justify-content-center">`;
|
||||
if (item.nationalCardFront.picturePath && (item.nationalCardFront.statusString !== "unsubmitted" && item.nationalCardFront.statusString !== "rejected")) {
|
||||
html += `<div class="documentFileBox" data-indexList="1"><img id="nationalCardFront_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardFront.picturePath ? item.nationalCardFront.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
html += `<div class="documentFileBox" data-indexList="1" onclick="openSinglePrint(${item.employeeId},${item.nationalCardFront.mediaId})" style="cursor: pointer;"><img id="nationalCardFront_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardFront.picturePath ? item.nationalCardFront.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox" data-indexList="1"><img id="nationalCardFront_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
|
||||
if (item.nationalCardRear.picturePath) {
|
||||
html += `<div class="documentFileBox" data-indexList="2"><img id="nationalCardRear_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardRear.picturePath ? item.nationalCardRear.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
html += `<div class="documentFileBox" data-indexList="2" onclick="openSinglePrint(${item.employeeId},${item.nationalCardRear.mediaId})" style="cursor: pointer;"><img id="nationalCardRear_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardRear.picturePath ? item.nationalCardRear.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox" data-indexList="2"><img id="nationalCardRear_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
</div>
|
||||
<div class="Rtable-cell d-md-block d-none width5">
|
||||
<div class="Rtable-cell--content d-flex align-items-center justify-content-center">
|
||||
<div class="documentFileBox" data-indexList="3">`;
|
||||
<div class="Rtable-cell--content d-flex align-items-center justify-content-center">`;
|
||||
if (item.militaryServiceCard.picturePath && (item.militaryServiceCard.statusString !== "unsubmitted" && item.militaryServiceCard.statusString !== "rejected")) {
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.militaryServiceCard.picturePath ? item.militaryServiceCard.picturePath : "")}" class="preview-image uploaded">`;
|
||||
html += `<div class="documentFileBox" data-indexList="3" onclick="openSinglePrint(${item.employeeId},${item.militaryServiceCard.mediaId})" style="cursor: pointer;"><img id="militaryServiceCard_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.militaryServiceCard.picturePath ? item.militaryServiceCard.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
} else {
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
html += `<div class="documentFileBox" data-indexList="3"><img id="militaryServiceCard_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
html += `
|
||||
</div>
|
||||
</div>
|
||||
<div class="Rtable-cell d-md-block d-none width6">
|
||||
<div class="Rtable-cell--content d-flex align-items-center justify-content-center">`;
|
||||
|
||||
if (item.idCardPage1.picturePath && (item.idCardPage1.statusString !== "unsubmitted" && item.idCardPage1.statusString !== "rejected")) {
|
||||
html += `<div class="documentFileBox" data-indexList="4"><img id="idCardPage1_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage1.picturePath ? item.idCardPage1.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
html += `<div class="documentFileBox" data-indexList="4" onclick="openSinglePrint(${item.employeeId},${item.idCardPage1.mediaId})" style="cursor: pointer;"><img id="idCardPage1_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage1.picturePath ? item.idCardPage1.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox" data-indexList="4"><img id="idCardPage1_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
if (item.idCardPage2.picturePath && (item.idCardPage2.statusString !== "unsubmitted" && item.idCardPage2.statusString !== "rejected")) {
|
||||
html += `<div class="documentFileBox" data-indexList="5"><img id="idCardPage2_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage2.picturePath ? item.idCardPage2.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
html += `<div class="documentFileBox" data-indexList="5" onclick="openSinglePrint(${item.employeeId},${item.idCardPage2.mediaId})" style="cursor: pointer;"><img id="idCardPage2_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage2.picturePath ? item.idCardPage2.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox" data-indexList="5"><img id="idCardPage2_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
if (item.idCardPage3.picturePath && (item.idCardPage3.statusString !== "unsubmitted" && item.idCardPage3.statusString !== "rejected")) {
|
||||
html += `<div class="documentFileBox" data-indexList="6"><img id="idCardPage3_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage3.picturePath ? item.idCardPage3.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
html += `<div class="documentFileBox" data-indexList="6" onclick="openSinglePrint(${item.employeeId},${item.idCardPage3.mediaId})" style="cursor: pointer;"><img id="idCardPage3_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage3.picturePath ? item.idCardPage3.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox" data-indexList="6"><img id="idCardPage3_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
if (item.idCardPage4.picturePath && (item.idCardPage4.statusString !== "unsubmitted" && item.idCardPage4.statusString !== "rejected")) {
|
||||
html += `<div class="documentFileBox" data-indexList="7"><img id="idCardPage4_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage4.picturePath ? item.idCardPage4.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
html += `<div class="documentFileBox" data-indexList="7" onclick="openSinglePrint(${item.employeeId},${item.idCardPage4.mediaId})" style="cursor: pointer;"><img id="idCardPage4_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage4.picturePath ? item.idCardPage4.picturePath : "")}" class="preview-image uploaded"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox" data-indexList="7"><img id="idCardPage4_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
@@ -199,9 +198,17 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell d-md-block d-none width7">
|
||||
<div class="Rtable-cell--content text-end">
|
||||
<button id="editPD_${item.employeeId
|
||||
}_desktop" class="btn-uploadingPD position-relative">
|
||||
<div class="Rtable-cell--content text-end d-flex justify-content-end">
|
||||
<button class="btn-print position-relative" onclick="displayPrintSelectionModal(${item.employeeId})">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path stroke-width="1.2" d="M18 13.5H18.5C19.4428 13.5 19.9142 13.5 20.2071 13.2071C20.5 12.9142 20.5 12.4428 20.5 11.5V10.5C20.5 8.61438 20.5 7.67157 19.9142 7.08579C19.3284 6.5 18.3856 6.5 16.5 6.5H7.5C5.61438 6.5 4.67157 6.5 4.08579 7.08579C3.5 7.67157 3.5 8.61438 3.5 10.5V12.5C3.5 12.9714 3.5 13.2071 3.64645 13.3536C3.79289 13.5 4.0286 13.5 4.5 13.5H6" stroke="#222222"/>
|
||||
<path stroke-width="1.2" d="M6.5 19.8063L6.5 11.5C6.5 10.5572 6.5 10.0858 6.79289 9.79289C7.08579 9.5 7.55719 9.5 8.5 9.5L15.5 9.5C16.4428 9.5 16.9142 9.5 17.2071 9.79289C17.5 10.0858 17.5 10.5572 17.5 11.5L17.5 19.8063C17.5 20.1228 17.5 20.2811 17.3962 20.356C17.2924 20.4308 17.1422 20.3807 16.8419 20.2806L14.6738 19.5579C14.5878 19.5293 14.5448 19.5149 14.5005 19.5162C14.4561 19.5175 14.4141 19.5344 14.3299 19.568L12.1857 20.4257C12.094 20.4624 12.0481 20.4807 12 20.4807C11.9519 20.4807 11.906 20.4624 11.8143 20.4257L9.67005 19.568C9.58592 19.5344 9.54385 19.5175 9.49952 19.5162C9.45519 19.5149 9.41221 19.5293 9.32625 19.5579L7.15811 20.2806C6.8578 20.3807 6.70764 20.4308 6.60382 20.356C6.5 20.2811 6.5 20.1228 6.5 19.8063Z" stroke="#222222"/>
|
||||
<path stroke-width="1.2" d="M9.5 13.5L13.5 13.5" stroke="#222222" stroke-linecap="round"/>
|
||||
<path stroke-width="1.2" d="M9.5 16.5L14.5 16.5" stroke="#222222" stroke-linecap="round"/>
|
||||
<path stroke-width="1.2" d="M17.5 6.5V6.1C17.5 4.40294 17.5 3.55442 16.9728 3.02721C16.4456 2.5 15.5971 2.5 13.9 2.5H10.1C8.40294 2.5 7.55442 2.5 7.02721 3.02721C6.5 3.55442 6.5 4.40294 6.5 6.1V6.5" stroke="#222222"/>
|
||||
</svg>
|
||||
</button>
|
||||
<button id="editPD_${item.employeeId}_desktop" class="btn-uploadingPD position-relative">
|
||||
<span class="mx-1">بارگزاری مدارک</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -247,7 +254,7 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.nationalCardFront.picturePath && (item.nationalCardFront.statusString !== "unsubmitted" && item.nationalCardFront.statusString !== "rejected")) {
|
||||
html += `<img id="nationalCardFront_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardFront.picturePath ? item.nationalCardFront.picturePath : "")}" class="preview-image uploaded">`;
|
||||
html += `<img id="nationalCardFront_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardFront.picturePath ? item.nationalCardFront.picturePath : "")}" class="preview-image uploaded" onclick="openSinglePrint(${item.employeeId},${item.nationalCardFront.mediaId})" style="cursor: pointer;">`;
|
||||
} else {
|
||||
html += `<img id="nationalCardFront_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
@@ -259,7 +266,7 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.nationalCardRear.picturePath && (item.nationalCardRear.statusString !== "unsubmitted" && item.nationalCardRear.statusString !== "rejected")) {
|
||||
html += `<img id="nationalCardRear_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardRear.picturePath ? item.nationalCardRear.picturePath : "")}" class="preview-image uploaded">`;
|
||||
html += `<img id="nationalCardRear_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardRear.picturePath ? item.nationalCardRear.picturePath : "")}" class="preview-image uploaded" onclick="openSinglePrint(${item.employeeId},${item.nationalCardRear.mediaId})" style="cursor: pointer;">`;
|
||||
} else {
|
||||
html += `<img id="nationalCardRear_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
@@ -271,7 +278,7 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.militaryServiceCard.picturePath && (item.militaryServiceCard.statusString !== "unsubmitted" && item.militaryServiceCard.statusString !== "rejected")) {
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.militaryServiceCard.picturePath ? item.militaryServiceCard.picturePath : "")}" class="preview-image uploaded">`;
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.militaryServiceCard.picturePath ? item.militaryServiceCard.picturePath : "")}" class="preview-image uploaded" onclick="openSinglePrint(${item.employeeId},${item.militaryServiceCard.mediaId})" style="cursor: pointer;">`;
|
||||
} else {
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
@@ -283,7 +290,7 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage1.picturePath && (item.idCardPage1.statusString !== "unsubmitted" && item.idCardPage1.statusString !== "rejected")) {
|
||||
html += `<img id="idCardPage1_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage1.picturePath ? item.idCardPage1.picturePath : "")}" class="preview-image uploaded">`;
|
||||
html += `<img id="idCardPage1_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage1.picturePath ? item.idCardPage1.picturePath : "")}" class="preview-image uploaded" onclick="openSinglePrint(${item.employeeId},${item.idCardPage1.mediaId})" style="cursor: pointer;">`;
|
||||
} else {
|
||||
html += `<img id="idCardPage1_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
@@ -295,7 +302,7 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage2.picturePath && (item.idCardPage2.statusString !== "unsubmitted" && item.idCardPage2.statusString !== "rejected")) {
|
||||
html += `<img id="idCardPage2_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage2.picturePath ? item.idCardPage2.picturePath : "")}" class="preview-image uploaded">`;
|
||||
html += `<img id="idCardPage2_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage2.picturePath ? item.idCardPage2.picturePath : "")}" class="preview-image uploaded" onclick="openSinglePrint(${item.employeeId},${item.idCardPage2.mediaId})" style="cursor: pointer;">`;
|
||||
} else {
|
||||
html += `<img id="idCardPage2_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
@@ -307,7 +314,7 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage3.picturePath && (item.idCardPage3.statusString !== "unsubmitted" && item.idCardPage3.statusString !== "rejected")) {
|
||||
html += `<img id="idCardPage3_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage3.picturePath ? item.idCardPage3.picturePath : "")}" class="preview-image uploaded">`;
|
||||
html += `<img id="idCardPage3_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage3.picturePath ? item.idCardPage3.picturePath : "")}" class="preview-image uploaded" onclick="openSinglePrint(${item.employeeId},${item.idCardPage3.mediaId})" style="cursor: pointer;">`;
|
||||
} else {
|
||||
html += `<img id="idCardPage3_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
@@ -319,7 +326,7 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage4.picturePath && (item.idCardPage4.statusString !== "unsubmitted" && item.idCardPage4.statusString !== "rejected")) {
|
||||
html += `<img id="idCardPage4_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage4.picturePath ? item.idCardPage4.picturePath : "")}" class="preview-image uploaded">`;
|
||||
html += `<img id="idCardPage4_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage4.picturePath ? item.idCardPage4.picturePath : "")}" class="preview-image uploaded" onclick="openSinglePrint(${item.employeeId},${item.idCardPage4.mediaId})" style="cursor: pointer;">`;
|
||||
} else {
|
||||
html += `<img id="idCardPage4_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
@@ -328,15 +335,29 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12 text-center">
|
||||
|
||||
<div class="col-6 text-center">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<button onclick="displayPrintSelectionModal(${item.employeeId})" class="btn-uploadingPD-mobile position-relative" style="background-color: #E4E4E4;color: #2B2B2B;border: 1px solid #8c8c8c;">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path stroke-width="1.2" d="M18 13.5H18.5C19.4428 13.5 19.9142 13.5 20.2071 13.2071C20.5 12.9142 20.5 12.4428 20.5 11.5V10.5C20.5 8.61438 20.5 7.67157 19.9142 7.08579C19.3284 6.5 18.3856 6.5 16.5 6.5H7.5C5.61438 6.5 4.67157 6.5 4.08579 7.08579C3.5 7.67157 3.5 8.61438 3.5 10.5V12.5C3.5 12.9714 3.5 13.2071 3.64645 13.3536C3.79289 13.5 4.0286 13.5 4.5 13.5H6" stroke="#222222"/>
|
||||
<path stroke-width="1.2" d="M6.5 19.8063L6.5 11.5C6.5 10.5572 6.5 10.0858 6.79289 9.79289C7.08579 9.5 7.55719 9.5 8.5 9.5L15.5 9.5C16.4428 9.5 16.9142 9.5 17.2071 9.79289C17.5 10.0858 17.5 10.5572 17.5 11.5L17.5 19.8063C17.5 20.1228 17.5 20.2811 17.3962 20.356C17.2924 20.4308 17.1422 20.3807 16.8419 20.2806L14.6738 19.5579C14.5878 19.5293 14.5448 19.5149 14.5005 19.5162C14.4561 19.5175 14.4141 19.5344 14.3299 19.568L12.1857 20.4257C12.094 20.4624 12.0481 20.4807 12 20.4807C11.9519 20.4807 11.906 20.4624 11.8143 20.4257L9.67005 19.568C9.58592 19.5344 9.54385 19.5175 9.49952 19.5162C9.45519 19.5149 9.41221 19.5293 9.32625 19.5579L7.15811 20.2806C6.8578 20.3807 6.70764 20.4308 6.60382 20.356C6.5 20.2811 6.5 20.1228 6.5 19.8063Z" stroke="#222222"/>
|
||||
<path stroke-width="1.2" d="M9.5 13.5L13.5 13.5" stroke="#222222" stroke-linecap="round"/>
|
||||
<path stroke-width="1.2" d="M9.5 16.5L14.5 16.5" stroke="#222222" stroke-linecap="round"/>
|
||||
<path stroke-width="1.2" d="M17.5 6.5V6.1C17.5 4.40294 17.5 3.55442 16.9728 3.02721C16.4456 2.5 15.5971 2.5 13.9 2.5H10.1C8.40294 2.5 7.55442 2.5 7.02721 3.02721C6.5 3.55442 6.5 4.40294 6.5 6.1V6.5" stroke="#222222"/>
|
||||
</svg>
|
||||
<span class="mx-1">پرینت گروهی</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-center">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<button id="editPD_${item.employeeId}_mobile" class="btn-uploadingPD-mobile position-relative">
|
||||
<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">ویرایش</span>
|
||||
<span class="mx-1">بارگزاری مدارک</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -368,7 +389,6 @@ function loadPersonnelDocuments(mode, searchName) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function openPersonnelDocsUploadModal(id) {
|
||||
var goTo = `#showmodal=/AdminNew/Company/EmployeesDocuments/EmployeeList?workshopId=${workshopId}&employeeId=${id}&handler=CreateUploadDocument`;
|
||||
window.location.href = goTo;
|
||||
@@ -381,4 +401,14 @@ function checkImage() {
|
||||
$(this).addClass('highlighted-border');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function displayPrintSelectionModal(employeeId) {
|
||||
var goTo = `#showmodal=/AdminNew/Company/EmployeesDocuments/EmployeeList?workshopId=${workshopId}&employeeId=${employeeId}&handler=PrintSelectionUploadDocument`;
|
||||
window.location.href = goTo;
|
||||
}
|
||||
|
||||
function openSinglePrint(employeeId, mediaId) {
|
||||
var goTo = `/AdminNew/Company/EmployeesDocuments/EmployeeList?workshopId=${workshopId}&employeeId=${employeeId}&mediaId=${mediaId}&handler=PrintSingleUploadDocument`;
|
||||
AjaxUrlContentModal(goTo);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
var selectedDocumentIds = [];
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
});
|
||||
|
||||
function toggleDocumentBox(el) {
|
||||
const docId = Number(el.dataset.id);
|
||||
const docName = el.dataset.name;
|
||||
const isSelected = el.classList.toggle('selected');
|
||||
|
||||
if (isSelected) {
|
||||
if (!selectedDocumentIds.includes(docId)) {
|
||||
selectedDocumentIds.push({ mediaId: docId, name: docName });
|
||||
}
|
||||
} else {
|
||||
selectedDocumentIds = selectedDocumentIds.filter(id => id.mediaId !== docId);
|
||||
}
|
||||
|
||||
//console.log("Selected IDs:", selectedDocumentIds);
|
||||
}
|
||||
|
||||
function openModalPrint() {
|
||||
//let selectedArray = [];
|
||||
//$('.pdBox.selected').each(function () {
|
||||
// var id = $(this).data("id");
|
||||
// selectedArray.push(id);
|
||||
//});
|
||||
|
||||
var goTo = `/AdminNew/Company/EmployeesDocuments/EmployeeList?handler=PrintSelectionUD`;
|
||||
selectedDocumentIds.forEach(function(item) {
|
||||
goTo += `&ids=${item.mediaId}`;
|
||||
});
|
||||
AjaxUrlContentModal(goTo);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
$(document).ready(function () {
|
||||
$("#EmployeeFullNameModalSinglePrint").text($("#EmployeeFullName").text());
|
||||
|
||||
});
|
||||
|
||||
function openModalPrint(id) {
|
||||
var goTo = `/AdminNew/Company/EmployeesDocuments/EmployeeList?id=${id}&handler=PrintSingleUD`;
|
||||
AjaxUrlContentModal(goTo);
|
||||
}
|
||||
@@ -7,25 +7,14 @@ var idCardPage2;
|
||||
var idCardPage3;
|
||||
var idCardPage4;
|
||||
var uploadFileCount = UploadedCount;
|
||||
var command = [];
|
||||
|
||||
var pendingMessage = `<div class="pendingMessage">بررسی</div>`;
|
||||
var pendingIcon = `<svg width="24" height="24" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11 19.25C15.5563 19.25 19.25 15.5563 19.25 11C19.25 6.44365 15.5563 2.75 11 2.75C6.44365 2.75 2.75 6.44365 2.75 11C2.75 15.5563 6.44365 19.25 11 19.25Z" fill="#FDBA74"/>
|
||||
<path d="M11.4168 14.6667C11.4168 14.8968 11.2303 15.0833 11.0002 15.0833C10.77 15.0833 10.5835 14.8968 10.5835 14.6667C10.5835 14.4365 10.77 14.25 11.0002 14.25C11.2303 14.25 11.4168 14.4365 11.4168 14.6667Z" fill="white" stroke="white"/>
|
||||
<path d="M11 11.916V6.41602V11.916Z" fill="white"/>
|
||||
<path d="M11 11.916V6.41602" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
|
||||
</svg>`;
|
||||
var pendingIcon = `<svg width="24" height="24" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11 19.25C15.5563 19.25 19.25 15.5563 19.25 11C19.25 6.44365 15.5563 2.75 11 2.75C6.44365 2.75 2.75 6.44365 2.75 11C2.75 15.5563 6.44365 19.25 11 19.25Z" fill="#FDBA74"/><path d="M11.4168 14.6667C11.4168 14.8968 11.2303 15.0833 11.0002 15.0833C10.77 15.0833 10.5835 14.8968 10.5835 14.6667C10.5835 14.4365 10.77 14.25 11.0002 14.25C11.2303 14.25 11.4168 14.4365 11.4168 14.6667Z" fill="white" stroke="white"/><path d="M11 11.916V6.41602V11.916Z" fill="white"/><path d="M11 11.916V6.41602" stroke="white" stroke-width="1.5" stroke-linecap="round"/></svg>`;
|
||||
var confirmMessage = `<div class="confirmedMessage">تایید</div>`;
|
||||
var confirmIcon = `<svg width="24" height="24" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="7" cy="7" r="5.25" fill="#00C04D"/>
|
||||
<path d="M4.66659 7L6.41659 8.75L9.33325 5.25" stroke="white" stroke-linecap="round"/>
|
||||
</svg>`;
|
||||
var confirmIcon = `<svg width="24" height="24" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="7" cy="7" r="5.25" fill="#00C04D"/><path d="M4.66659 7L6.41659 8.75L9.33325 5.25" stroke="white" stroke-linecap="round"/></svg>`;
|
||||
var rejectMessage = `<div class="rejectMessage">رد شده</div>`;
|
||||
var rejectIcon = `<svg width="24" height="24" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="7" cy="7" r="5.25" fill="#FF5D5D"/>
|
||||
<path d="M9.33341 4.66602L4.66675 9.33268" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M4.66659 4.66602L9.33325 9.33268" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>`;
|
||||
var rejectIcon = `<svg width="24" height="24" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="7" cy="7" r="5.25" fill="#FF5D5D"/><path d="M9.33341 4.66602L4.66675 9.33268" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.66659 4.66602L9.33325 9.33268" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
@@ -45,6 +34,7 @@ $(document).ready(function () {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
$(document).off('click', '.btnUploadingPD').on('click', '.btnUploadingPD', function (event) {
|
||||
event.preventDefault();
|
||||
const index = $(this).data('index');
|
||||
@@ -89,20 +79,57 @@ $(document).ready(function () {
|
||||
const validPdfExtensions = ['pdf'];
|
||||
|
||||
const label = $(`#label_${indexFileValue}`).val();
|
||||
const pdBox = $(this).closest('.pdBox');
|
||||
const img = pdBox.find('.preview-image');
|
||||
var deleteButton = pdBox.find('.btnDeletingPD');
|
||||
|
||||
if (fileInputFile) {
|
||||
const fileName = fileInputFile.name.toLowerCase();
|
||||
const extension = fileName.split('.').pop();
|
||||
|
||||
// بررسی فرمتهای تصویر (jpeg, jpg, png)
|
||||
if (validExtensions.includes(extension)) {
|
||||
if (fileInputFile.size > 5000000) {
|
||||
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را آپلود کنید.', 3500);
|
||||
$(this).val('');
|
||||
return;
|
||||
}
|
||||
uploadFile(fileInputFile, indexFileValue, label);
|
||||
} else if (validPdfExtensions.includes(extension)) {
|
||||
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (event) {
|
||||
img.attr('src', event.target.result);
|
||||
|
||||
const base64String = event.target.result.split(',')[1];
|
||||
const byteCharacters = atob(base64String);
|
||||
const byteNumbers = new Array(byteCharacters.length);
|
||||
for (let i = 0; i < byteCharacters.length; i++) {
|
||||
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
}
|
||||
const byteArray = new Uint8Array(byteNumbers);
|
||||
const blob = new Blob([byteArray], { type: fileInputFile.type });
|
||||
const newFile = new File([blob], fileInputFile.name, { type: fileInputFile.type });
|
||||
|
||||
let existingIndex = command.findIndex(item => item.Label === label);
|
||||
if (existingIndex !== -1) {
|
||||
command[existingIndex].PictureFile = newFile;
|
||||
} else {
|
||||
let picturesPart = {
|
||||
Label: label,
|
||||
PictureFile: newFile
|
||||
};
|
||||
command.push(picturesPart);
|
||||
}
|
||||
};
|
||||
|
||||
reader.readAsDataURL(fileInputFile);
|
||||
$('#createUploadingFiles').prop('disabled', false).removeClass('disable');
|
||||
|
||||
pdBox.removeClass();
|
||||
pdBox.addClass('pdBox');
|
||||
|
||||
showLoadingAnimation(indexFileValue);
|
||||
}
|
||||
else if (validPdfExtensions.includes(extension)) {
|
||||
var fileReader = new FileReader();
|
||||
|
||||
fileReader.onload = function () {
|
||||
@@ -115,7 +142,7 @@ $(document).ready(function () {
|
||||
return;
|
||||
}
|
||||
|
||||
pdf.getPage(1).then(function (page) { // فقط صفحه اول پردازش میشود
|
||||
pdf.getPage(1).then(function (page) {
|
||||
var scale = 2.0;
|
||||
var viewport = page.getViewport({ scale: scale });
|
||||
|
||||
@@ -130,13 +157,13 @@ $(document).ready(function () {
|
||||
page.render({
|
||||
canvasContext: context,
|
||||
viewport: viewport
|
||||
})
|
||||
.promise.then(function () {
|
||||
uploadCanvasAsFile(canvas, `${label}_${indexFileValue}.jpg`, indexFileValue, label);
|
||||
})
|
||||
.catch(function (error) {
|
||||
showAlertMessage('.alert-msg', 'مشکلی در پردازش PDF رخ داده است!', 3500);
|
||||
});
|
||||
}).promise.then(function () {
|
||||
pdBox.removeClass();
|
||||
pdBox.addClass('pdBox');
|
||||
uploadCanvasAsFile(canvas, `${label}_${indexFileValue}.jpg`, indexFileValue, label);
|
||||
}).catch(function (error) {
|
||||
showAlertMessage('.alert-msg', 'مشکلی در پردازش PDF رخ داده است!', 3500);
|
||||
});
|
||||
}).catch(function (error) {
|
||||
showAlertMessage('.alert-msg', 'خطا در دریافت صفحه PDF!', 3500);
|
||||
});
|
||||
@@ -148,12 +175,152 @@ $(document).ready(function () {
|
||||
|
||||
fileReader.readAsArrayBuffer(fileInputFile);
|
||||
|
||||
} else {
|
||||
showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg یا png باشد.', 3500);
|
||||
}
|
||||
else {
|
||||
showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg, png یا pdf باشد.', 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
deleteButton.removeClass('disable');
|
||||
if (pdBox.find('button.Rejected').length > 0) {
|
||||
pdBox.find(".btnSendToChecker").removeClass("disable");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//$(document).off('change', '.file-input').on('change', '.file-input', function (e) {
|
||||
// e.preventDefault();
|
||||
|
||||
// const fileInputFile = this.files[0];
|
||||
// const indexFileValue = $(this).data('index');
|
||||
// const validExtensions = ['jpg', 'jpeg', 'png'];
|
||||
|
||||
// const label = $(`#label_${indexFileValue}`).val();
|
||||
// const pdBox = $(this).closest('.pdBox');
|
||||
// const img = pdBox.find('.preview-image');
|
||||
|
||||
// if (fileInputFile) {
|
||||
// const fileName = fileInputFile.name.toLowerCase();
|
||||
// const extension = fileName.split('.').pop();
|
||||
|
||||
// if (validExtensions.includes(extension)) {
|
||||
// if (fileInputFile.size > 5000000) {
|
||||
// showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را آپلود کنید.', 3500);
|
||||
// $(this).val('');
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // خواندن فایل و نمایش آن
|
||||
// const reader = new FileReader();
|
||||
// reader.onload = function (event) {
|
||||
// img.attr('src', event.target.result);
|
||||
|
||||
// const base64String = event.target.result.split(',')[1];
|
||||
// const byteCharacters = atob(base64String);
|
||||
// const byteNumbers = new Array(byteCharacters.length);
|
||||
// for (let i = 0; i < byteCharacters.length; i++) {
|
||||
// byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
// }
|
||||
// const byteArray = new Uint8Array(byteNumbers);
|
||||
// const blob = new Blob([byteArray], { type: fileInputFile.type });
|
||||
// const newFile = new File([blob], fileInputFile.name, { type: fileInputFile.type });
|
||||
|
||||
// let picturesPart = {
|
||||
// Label: label,
|
||||
// PictureFile: newFile
|
||||
// };
|
||||
// pictures.push(picturesPart);
|
||||
// };
|
||||
|
||||
// reader.readAsDataURL(fileInputFile);
|
||||
|
||||
// //uploadFile(fileInputFile, indexFileValue, label);
|
||||
// } else {
|
||||
// showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg یا png باشد.', 3500);
|
||||
// }
|
||||
// }
|
||||
|
||||
// console.log(pictures);
|
||||
//});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//$(document).off('change', '.file-input').on('change', '.file-input', function (e) {
|
||||
// e.preventDefault();
|
||||
|
||||
// const fileInputFile = this.files[0];
|
||||
// const indexFileValue = $(this).data('index');
|
||||
// const validExtensions = ['jpg', 'jpeg', 'png'];
|
||||
// const validPdfExtensions = ['pdf'];
|
||||
|
||||
// const label = $(`#label_${indexFileValue}`).val();
|
||||
|
||||
// if (fileInputFile) {
|
||||
// const fileName = fileInputFile.name.toLowerCase();
|
||||
// const extension = fileName.split('.').pop();
|
||||
|
||||
// if (validExtensions.includes(extension)) {
|
||||
// if (fileInputFile.size > 5000000) {
|
||||
// showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را آپلود کنید.', 3500);
|
||||
// $(this).val('');
|
||||
// return;
|
||||
// }
|
||||
// uploadFile(fileInputFile, indexFileValue, label);
|
||||
// } else if (validPdfExtensions.includes(extension)) {
|
||||
|
||||
// var fileReader = new FileReader();
|
||||
|
||||
// fileReader.onload = function () {
|
||||
// var typedarray = new Uint8Array(this.result);
|
||||
// pdfjsLib.getDocument(typedarray).promise.then(function (pdf) {
|
||||
// totalPageCount = pdf.numPages;
|
||||
|
||||
// if (totalPageCount > 1) {
|
||||
// showAlertMessage('.alert-msg', 'آپلود مجاز نیست! تعداد صفحات نباید بیشتر از ۱ باشد.', 3500);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// pdf.getPage(1).then(function (page) { // فقط صفحه اول پردازش میشود
|
||||
// var scale = 2.0;
|
||||
// var viewport = page.getViewport({ scale: scale });
|
||||
|
||||
// var canvas = document.createElement("canvas");
|
||||
// canvas.className = "page";
|
||||
// canvas.title = "Page 1";
|
||||
// canvas.height = viewport.height;
|
||||
// canvas.width = viewport.width;
|
||||
|
||||
// var context = canvas.getContext("2d");
|
||||
|
||||
// page.render({
|
||||
// canvasContext: context,
|
||||
// viewport: viewport
|
||||
// })
|
||||
// .promise.then(function () {
|
||||
// uploadCanvasAsFile(canvas, `${label}_${indexFileValue}.jpg`, indexFileValue, label);
|
||||
// })
|
||||
// .catch(function (error) {
|
||||
// showAlertMessage('.alert-msg', 'مشکلی در پردازش PDF رخ داده است!', 3500);
|
||||
// });
|
||||
// }).catch(function (error) {
|
||||
// showAlertMessage('.alert-msg', 'خطا در دریافت صفحه PDF!', 3500);
|
||||
// });
|
||||
|
||||
// }).catch(function (error) {
|
||||
// showAlertMessage('.alert-msg', 'خطا در بارگذاری فایل PDF!', 3500);
|
||||
// });
|
||||
// };
|
||||
|
||||
// fileReader.readAsArrayBuffer(fileInputFile);
|
||||
|
||||
// } else {
|
||||
// showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg یا png باشد.', 3500);
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
|
||||
$(document).off('click', '.btnDeletingPD').on('click', '.btnDeletingPD', function (event) {
|
||||
event.preventDefault();
|
||||
const indexId = $(this).data('index');
|
||||
@@ -222,6 +389,57 @@ function cancelOperation() {
|
||||
});
|
||||
}
|
||||
|
||||
var indexCount = 0;
|
||||
var activeUploads = 0;
|
||||
function showLoadingAnimation(indexId) {
|
||||
uploadFileCount = uploadFileCount + 1;
|
||||
|
||||
//const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
//const spinner = pdBox.find('.spinner-loading-progress');
|
||||
//const percentageText = pdBox.find('.percentageText');
|
||||
|
||||
//spinner.show();
|
||||
//activeUploads++;
|
||||
//$('#createUploadingFiles').prop('disabled', true).addClass('disable');
|
||||
|
||||
//let simulatedProgress = 0;
|
||||
//const progressInterval = setInterval(function () {
|
||||
// if (simulatedProgress < 100) {
|
||||
// simulatedProgress += 2;
|
||||
// spinner.css('width', `${simulatedProgress}%`);
|
||||
// percentageText.text(`${simulatedProgress}%`);
|
||||
// }
|
||||
|
||||
// if (simulatedProgress >= 100) {
|
||||
// clearInterval(progressInterval);
|
||||
// }
|
||||
//}, 30);
|
||||
|
||||
//setTimeout(function () {
|
||||
// clearInterval(progressInterval);
|
||||
// spinner.css('width', '100%');
|
||||
// percentageText.text('100%');
|
||||
|
||||
// spinner.hide();
|
||||
// spinner.css('width', '0%');
|
||||
// handleActiveUploads();
|
||||
//}, 2300);
|
||||
}
|
||||
|
||||
//function uploadCanvasAsFile(canvas, fileName, indexFileValue, label) {
|
||||
// canvas.toBlob(function (blob) {
|
||||
// if (!blob) {
|
||||
// showAlertMessage('.alert-msg', 'مشکلی در تبدیل تصویر رخ داده است!', 3500);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// let file = new File([blob], fileName, { type: 'image/png' });
|
||||
|
||||
// uploadFile(file, indexFileValue, label);
|
||||
|
||||
// }, "image/png");
|
||||
//}
|
||||
|
||||
function uploadCanvasAsFile(canvas, fileName, indexFileValue, label) {
|
||||
canvas.toBlob(function (blob) {
|
||||
if (!blob) {
|
||||
@@ -230,145 +448,161 @@ function uploadCanvasAsFile(canvas, fileName, indexFileValue, label) {
|
||||
}
|
||||
|
||||
let file = new File([blob], fileName, { type: 'image/png' });
|
||||
const imageUrl = URL.createObjectURL(blob);
|
||||
|
||||
uploadFile(file, indexFileValue, label);
|
||||
const img = $(`#${label}`);
|
||||
img.attr('src', imageUrl);
|
||||
|
||||
let existingIndex = command.findIndex(item => item.Label === label);
|
||||
if (existingIndex !== -1) {
|
||||
command[existingIndex].PictureFile = file;
|
||||
} else {
|
||||
let picturesPart = {
|
||||
Label: label,
|
||||
PictureFile: file
|
||||
};
|
||||
command.push(picturesPart);
|
||||
}
|
||||
|
||||
$('#createUploadingFiles').prop('disabled', false).removeClass('disable');
|
||||
showLoadingAnimation(indexFileValue);
|
||||
|
||||
}, "image/png");
|
||||
}
|
||||
|
||||
var indexCount = 0;
|
||||
var activeUploads = 0;
|
||||
function uploadFile(file, indexId, label) {
|
||||
const formData = new FormData();
|
||||
formData.append('command.EmployeeId', employeeId);
|
||||
formData.append('command.WorkshopId', workshopId);
|
||||
formData.append('command.Label', label);
|
||||
formData.append('command.PictureFile', file);
|
||||
//var indexCount = 0;
|
||||
//var activeUploads = 0;
|
||||
//function uploadFile(file, indexId, label) {
|
||||
// const formData = new FormData();
|
||||
// formData.append('command.EmployeeId', employeeId);
|
||||
// formData.append('command.WorkshopId', workshopId);
|
||||
// formData.append('command.Label', label);
|
||||
// formData.append('command.PictureFile', file);
|
||||
|
||||
const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
const spinner = pdBox.find('.spinner-loading-progress');
|
||||
// const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
// const spinner = pdBox.find('.spinner-loading-progress');
|
||||
|
||||
const percentageText = pdBox.find('.percentageText');
|
||||
// const percentageText = pdBox.find('.percentageText');
|
||||
|
||||
spinner.show();
|
||||
activeUploads++;
|
||||
$('#createUploadingFiles').prop('disabled', true).addClass('disable');
|
||||
// spinner.show();
|
||||
// activeUploads++;
|
||||
// $('#createUploadingFiles').prop('disabled', true).addClass('disable');
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', saveUploadFileModalAjax, true);
|
||||
xhr.setRequestHeader('RequestVerificationToken', antiForgeryToken);
|
||||
// const xhr = new XMLHttpRequest();
|
||||
// xhr.open('POST', saveUploadFileModalAjax, true);
|
||||
// xhr.setRequestHeader('RequestVerificationToken', antiForgeryToken);
|
||||
|
||||
const uploadStartTime = new Date().getTime();
|
||||
let simulatedProgress = 0;
|
||||
let actualProgress = 0;
|
||||
let isUploadComplete = false;
|
||||
// const uploadStartTime = new Date().getTime();
|
||||
// let simulatedProgress = 0;
|
||||
// let actualProgress = 0;
|
||||
// let isUploadComplete = false;
|
||||
|
||||
// Simulate progress every 20ms, gradually increasing the bar until the actual progress is reached
|
||||
const progressInterval = setInterval(function () {
|
||||
if (simulatedProgress < actualProgress && !isUploadComplete) {
|
||||
simulatedProgress += 1; // Gradually increase simulated progress
|
||||
spinner.css('width', `${simulatedProgress}%`);
|
||||
percentageText.text(`${simulatedProgress}%`);
|
||||
}
|
||||
// // Simulate progress every 20ms, gradually increasing the bar until the actual progress is reached
|
||||
// const progressInterval = setInterval(function () {
|
||||
// if (simulatedProgress < actualProgress && !isUploadComplete) {
|
||||
// simulatedProgress += 1; // Gradually increase simulated progress
|
||||
// spinner.css('width', `${simulatedProgress}%`);
|
||||
// percentageText.text(`${simulatedProgress}%`);
|
||||
// }
|
||||
|
||||
if (simulatedProgress >= 100) {
|
||||
clearInterval(progressInterval); // Stop once the progress hits 100%
|
||||
}
|
||||
}, 30); // Increases by 1% every 20ms, making it smooth
|
||||
// if (simulatedProgress >= 100) {
|
||||
// clearInterval(progressInterval); // Stop once the progress hits 100%
|
||||
// }
|
||||
// }, 30); // Increases by 1% every 20ms, making it smooth
|
||||
|
||||
// Actual upload progress listener
|
||||
xhr.upload.addEventListener('progress', function (e) {
|
||||
if (e.lengthComputable) {
|
||||
actualProgress = Math.round((e.loaded / e.total) * 100);
|
||||
// // Actual upload progress listener
|
||||
// xhr.upload.addEventListener('progress', function (e) {
|
||||
// if (e.lengthComputable) {
|
||||
// actualProgress = Math.round((e.loaded / e.total) * 100);
|
||||
|
||||
// If the actual progress is slow, allow the simulated progress to match it naturally
|
||||
if (actualProgress >= simulatedProgress) {
|
||||
simulatedProgress = actualProgress;
|
||||
spinner.css('width', `${simulatedProgress}%`);
|
||||
percentageText.text(`${simulatedProgress}%`);
|
||||
}
|
||||
}
|
||||
});
|
||||
// // If the actual progress is slow, allow the simulated progress to match it naturally
|
||||
// if (actualProgress >= simulatedProgress) {
|
||||
// simulatedProgress = actualProgress;
|
||||
// spinner.css('width', `${simulatedProgress}%`);
|
||||
// percentageText.text(`${simulatedProgress}%`);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// On upload completion
|
||||
xhr.onload = function () {
|
||||
spinner.css('transition', 'all 2s ease-in');
|
||||
const uploadEndTime = new Date().getTime();
|
||||
const timeDiff = uploadEndTime - uploadStartTime;
|
||||
const minUploadTime = 2500; // Minimum of 2 seconds for the whole process
|
||||
// // On upload completion
|
||||
// xhr.onload = function () {
|
||||
// spinner.css('transition', 'all 2s ease-in');
|
||||
// const uploadEndTime = new Date().getTime();
|
||||
// const timeDiff = uploadEndTime - uploadStartTime;
|
||||
// const minUploadTime = 2500; // Minimum of 2 seconds for the whole process
|
||||
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
isUploadComplete = true; // Mark the upload as complete
|
||||
const delayTime = Math.max(minUploadTime - timeDiff, 0);
|
||||
// const response = JSON.parse(xhr.responseText);
|
||||
// isUploadComplete = true; // Mark the upload as complete
|
||||
// const delayTime = Math.max(minUploadTime - timeDiff, 0);
|
||||
|
||||
setTimeout(function () {
|
||||
clearInterval(progressInterval); // Clear the interval when done
|
||||
simulatedProgress = 100;
|
||||
spinner.css('width', '100%');
|
||||
percentageText.text('100%');
|
||||
// setTimeout(function () {
|
||||
// clearInterval(progressInterval); // Clear the interval when done
|
||||
// simulatedProgress = 100;
|
||||
// spinner.css('width', '100%');
|
||||
// percentageText.text('100%');
|
||||
|
||||
var id2 = $("#employeeIdForList").val();
|
||||
// var id2 = $("#employeeIdForList").val();
|
||||
|
||||
if (xhr.status === 200 && response.isSuccedded) {
|
||||
indexCount++;
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (e) {
|
||||
// if (xhr.status === 200 && response.isSuccedded) {
|
||||
// indexCount++;
|
||||
// const reader = new FileReader();
|
||||
// reader.onload = function (e) {
|
||||
|
||||
uploadFileCount = uploadFileCount + 1;
|
||||
// uploadFileCount = uploadFileCount + 1;
|
||||
|
||||
const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
const img = pdBox.find('.preview-image');
|
||||
img.attr('src', e.target.result);
|
||||
// const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
// const img = pdBox.find('.preview-image');
|
||||
// img.attr('src', e.target.result);
|
||||
|
||||
//employeePicture = $('#EmployeePicture').attr('src');
|
||||
//nationalCardFront = $('#NationalCardFront').attr('src');
|
||||
//nationalCardRear = $('#NationalCardRear').attr('src');
|
||||
//militaryServiceCard = $('#MilitaryServiceCard').attr('src');
|
||||
//idCardPage1 = $('#IdCardPage1').attr('src');
|
||||
//idCardPage2 = $('#IdCardPage2').attr('src');
|
||||
//idCardPage3 = $('#IdCardPage3').attr('src');
|
||||
//idCardPage4 = $('#IdCardPage4').attr('src');
|
||||
//console.log(idCardPage2);
|
||||
// //employeePicture = $('#EmployeePicture').attr('src');
|
||||
// //nationalCardFront = $('#NationalCardFront').attr('src');
|
||||
// //nationalCardRear = $('#NationalCardRear').attr('src');
|
||||
// //militaryServiceCard = $('#MilitaryServiceCard').attr('src');
|
||||
// //idCardPage1 = $('#IdCardPage1').attr('src');
|
||||
// //idCardPage2 = $('#IdCardPage2').attr('src');
|
||||
// //idCardPage3 = $('#IdCardPage3').attr('src');
|
||||
// //idCardPage4 = $('#IdCardPage4').attr('src');
|
||||
// //console.log(idCardPage2);
|
||||
|
||||
// updatePreviewImage(indexId, id2, e.target.result);
|
||||
// // updatePreviewImage(indexId, id2, e.target.result);
|
||||
|
||||
};
|
||||
// };
|
||||
|
||||
if (pdBox.hasClass("complete") || pdBox.hasClass("discomplete")) {
|
||||
// if (pdBox.hasClass("complete") || pdBox.hasClass("discomplete")) {
|
||||
|
||||
pdBox.removeClass("discomplete complete");
|
||||
pdBox.find(".sign").removeClass("discompleteSign completeSign");
|
||||
pdBox.find(".sign").empty();
|
||||
pdBox.find(".btnDeletingPD").removeClass("Rejected Confirmed");
|
||||
pdBox.find("confirmedMessage ").remove();
|
||||
pdBox.find(".resultMessage").empty();
|
||||
}
|
||||
// pdBox.removeClass("discomplete complete");
|
||||
// pdBox.find(".sign").removeClass("discompleteSign completeSign");
|
||||
// pdBox.find(".sign").empty();
|
||||
// pdBox.find(".btnDeletingPD").removeClass("Rejected Confirmed");
|
||||
// pdBox.find("confirmedMessage ").remove();
|
||||
// pdBox.find(".resultMessage").empty();
|
||||
// }
|
||||
|
||||
pdBox.find('.btnDeletingPD').removeClass('disable').addClass("Unsubmitted");
|
||||
// pdBox.find('.btnDeletingPD').removeClass('disable').addClass("Unsubmitted");
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
} else {
|
||||
showAlertMessage('.alert-msg', response.message || 'Error uploading file', 3500);
|
||||
$('input[type="file"][data-index="' + indexId + '"]').val('');
|
||||
}
|
||||
spinner.css('width', '0%'); // Reset the progress bar
|
||||
spinner.hide();
|
||||
handleActiveUploads();
|
||||
}, delayTime); // Ensure a minimum of 2 seconds for the full process
|
||||
};
|
||||
// reader.readAsDataURL(file);
|
||||
// } else {
|
||||
// showAlertMessage('.alert-msg', response.message || 'Error uploading file', 3500);
|
||||
// $('input[type="file"][data-index="' + indexId + '"]').val('');
|
||||
// }
|
||||
// spinner.css('width', '0%'); // Reset the progress bar
|
||||
// spinner.hide();
|
||||
// handleActiveUploads();
|
||||
// }, delayTime); // Ensure a minimum of 2 seconds for the full process
|
||||
// };
|
||||
|
||||
// Handle upload error
|
||||
xhr.onerror = function () {
|
||||
clearInterval(progressInterval); // Stop progress on error
|
||||
showAlertMessage('.alert-msg', 'مشکلی در آپلود فایل به وجود آمد.', 3500);
|
||||
$('input[type="file"][data-index="' + indexId + '"]').val('');
|
||||
spinner.css('width', '0%');
|
||||
spinner.hide();
|
||||
handleActiveUploads();
|
||||
};
|
||||
// // Handle upload error
|
||||
// xhr.onerror = function () {
|
||||
// clearInterval(progressInterval); // Stop progress on error
|
||||
// showAlertMessage('.alert-msg', 'مشکلی در آپلود فایل به وجود آمد.', 3500);
|
||||
// $('input[type="file"][data-index="' + indexId + '"]').val('');
|
||||
// spinner.css('width', '0%');
|
||||
// spinner.hide();
|
||||
// handleActiveUploads();
|
||||
// };
|
||||
|
||||
xhr.send(formData);
|
||||
}
|
||||
// xhr.send(formData);
|
||||
//}
|
||||
|
||||
function handleActiveUploads() {
|
||||
activeUploads--;
|
||||
@@ -452,18 +686,30 @@ function saveSubmit(id) {
|
||||
|
||||
loading.show();
|
||||
|
||||
var data = {
|
||||
'cmd.EmployeeDocumentsId': id
|
||||
}
|
||||
//var data = {
|
||||
// 'cmd.EmployeeDocumentsId': id
|
||||
//}
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('workshopId', workshopId);
|
||||
formData.append('employeeId', employeeId);
|
||||
|
||||
command.forEach((item, index) => {
|
||||
formData.append(`command[${index}].Label`, item.Label);
|
||||
formData.append(`command[${index}].PictureFile`, item.PictureFile);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: saveSubmitAjax,
|
||||
url: saveGroupSubmitAjax,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: { 'RequestVerificationToken': antiForgeryToken },
|
||||
success: function (response) {
|
||||
loading.hide();
|
||||
|
||||
if (response.isSuccedded) {
|
||||
if (response.success) {
|
||||
|
||||
var id2 = $("#employeeIdForList").val();
|
||||
$(".pdBox").each(function () {
|
||||
|
||||
@@ -540,6 +540,22 @@ input:checked + .sliderEUP {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.employee-workshop-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: start;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.employee-workshop-header > div {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
width: 200px;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@media (max-width: 1366px) {
|
||||
#navbar-animmenu ul li a {
|
||||
font-size: 13px;
|
||||
@@ -559,6 +575,10 @@ input:checked + .sliderEUP {
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.employee-workshop-header {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.Rtable--collapse .Rtable-row {
|
||||
outline: 1.8px solid #ddd !important;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,40 @@
|
||||
var lengthMenu = 0;
|
||||
var loadFunctionDocumentsAwaitingUpload = true;
|
||||
var loadFunctionCut = true;
|
||||
var loadFunctionLunchBreak = true;
|
||||
var loadFunctionUndefined = true;
|
||||
var loadFunctionOverlappingLeaves = true;
|
||||
var loadFunctionWorkshopDocumentRejectedForAdmin = true;
|
||||
var loadFunctionCreatedEmployeesWorkshopDocumentForAdmin = true;
|
||||
var loadFunctionClientRejectedDocumentWorkshopsForAdmin = true;
|
||||
|
||||
loadMenuAnime();
|
||||
$(document).ready(function () {
|
||||
//CountWorkFlowOfAbsentAndCut();
|
||||
loadWorkshopsWithDocumentsAwaitingUpload();
|
||||
CountWorkFlowUploadDocument();
|
||||
loadWorkshopDocumentRejectedForAdmin();
|
||||
loadClientRejectedDocumentWorkshopsForAdmin();
|
||||
loadCreatedEmployeesWorkshopDocumentForAdmin();
|
||||
|
||||
$("#clickDocumentsAwaitingUploadTab").click(function () {
|
||||
//$('.cutWorkFlowLists, .lunchBreakWorkFlowLists, .undefinedWorkFlowLists, .overlappingLeavesLists').fadeOut(200, function () {
|
||||
// $('.DocumentsAwaitingUploadWorkFlowLists').fadeIn(200);
|
||||
//});
|
||||
if (loadFunctionDocumentsAwaitingUpload) {
|
||||
loadWorkshopsWithDocumentsAwaitingUpload();
|
||||
$("#clickWorkshopDocumentRejectedForAdminTab").click(function () {
|
||||
$('.clientRejectedDocumentWorkshopsForAdminWorkFlowLists, .createdEmployeesWorkshopDocumentForAdminWorkFlowLists').fadeOut(200, function () {
|
||||
$('.workshopDocumentRejectedForAdminWorkFlowLists').fadeIn(200);
|
||||
});
|
||||
|
||||
if (loadFunctionWorkshopDocumentRejectedForAdmin) {
|
||||
loadWorkshopDocumentRejectedForAdmin();
|
||||
}
|
||||
});
|
||||
|
||||
$("#clickCreatedEmployeesWorkshopDocumentForAdminTab").click(function () {
|
||||
$('.workshopDocumentRejectedForAdminWorkFlowLists, .clientRejectedDocumentWorkshopsForAdminWorkFlowLists').fadeOut(200, function () {
|
||||
$('.createdEmployeesWorkshopDocumentForAdminWorkFlowLists').fadeIn(200);
|
||||
});
|
||||
if (loadFunctionClientRejectedDocumentWorkshopsForAdmin) {
|
||||
loadCreatedEmployeesWorkshopDocumentForAdmin();
|
||||
}
|
||||
});
|
||||
|
||||
$("#clickClientRejectedDocumentWorkshopsForAdminTab").click(function () {
|
||||
$('.workshopDocumentRejectedForAdminWorkFlowLists, .createdEmployeesWorkshopDocumentForAdminWorkFlowLists').fadeOut(200, function () {
|
||||
$('.clientRejectedDocumentWorkshopsForAdminWorkFlowLists').fadeIn(200);
|
||||
});
|
||||
if (loadFunctionCreatedEmployeesWorkshopDocumentForAdmin) {
|
||||
loadClientRejectedDocumentWorkshopsForAdmin();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -105,8 +124,10 @@ $(document).on('click', ".openAction", function () {
|
||||
}
|
||||
});
|
||||
|
||||
async function loadWorkshopsWithDocumentsAwaitingUpload() {
|
||||
$('#CountDocumentsAwaitingUploadLoading').show();
|
||||
|
||||
//1
|
||||
async function loadWorkshopDocumentRejectedForAdmin() {
|
||||
//$('#CountDocumentsAwaitingUploadLoading').show();
|
||||
var mainIndexNum = 1;
|
||||
|
||||
var html = ``;
|
||||
@@ -115,17 +136,17 @@ async function loadWorkshopsWithDocumentsAwaitingUpload() {
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: loadWorkshopsWithDocumentsAwaitingUploadUrl,
|
||||
url: loadWorkshopDocumentRejectedForAdminUrl,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
success: function (response) {
|
||||
var data = response.data;
|
||||
$('#loadingSkeletonDocumentsAwaitingUpload').hide();
|
||||
|
||||
$('#loadingSkeletonWorkshopDocumentRejectedForAdmin').hide();
|
||||
|
||||
if (response.success) {
|
||||
if (data.length > 0) {
|
||||
data.forEach(function (item) {
|
||||
html += `
|
||||
<div id="Main_${item.workshopId}" class="Rtable-row Rtable-row--head align-items-center d-flex sticky openActionMain" onclick="loadByWorkshopIdWithItemsForAdminWorkFlow('${item.workshopId}')" style="background: #58B3B3;border: none !important; cursor: pointer; ">
|
||||
<div id="Main_${item.workshopId}" class="Rtable-row Rtable-row--head align-items-center d-flex sticky openActionMain" onclick="loadGetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow('${item.workshopId}')" style="background: #58B3B3;border: none !important; cursor: pointer; ">
|
||||
<div class="col-2 col-md-2 text-start">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--content">
|
||||
@@ -133,25 +154,15 @@ async function loadWorkshopsWithDocumentsAwaitingUpload() {
|
||||
${mainIndexNum++}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 col-md-8 text-center d-flex">
|
||||
<div class="row w-100">
|
||||
<div class="col-12 col-md-5 text-center">
|
||||
<div class="Rtable-cell column-heading justify-content-start my-0">
|
||||
<span>${item.workshopName}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-11 col-md-5 text-start pe-0">
|
||||
<div class="Rtable-cell column-heading justify-content-start my-0">
|
||||
<span>${item.employerName}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1 text-center px-0">
|
||||
<div class="Rtable-cell column-heading text-center justify-content-center my-0">
|
||||
<span id="EmployeeCountOfWorkshop_${item.workshopId}" class="number-of-count">${item.uploadItemsCount}</span>
|
||||
</div>
|
||||
<div class="w-100 d-flex align-items-center justify-content-between">
|
||||
<div class="employee-workshop-header">
|
||||
<div>${item.workshopFullName}</div>
|
||||
<div>${item.employerName}</div>
|
||||
</div>
|
||||
<div id="WorkshopDocumentRejected_EmployeeCountOfWorkshop_${item.workshopId}" class="number-of-count">${item.employeesWithoutDocumentCount}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 col-md-2 text-end">
|
||||
@@ -181,8 +192,8 @@ async function loadWorkshopsWithDocumentsAwaitingUpload() {
|
||||
</div>`;
|
||||
}
|
||||
|
||||
$('#loadDocumentsAwaitingUploadWorkFlow').html(html);
|
||||
loadFunctionDocumentsAwaitingUpload = false;
|
||||
$('#loadWorkshopDocumentRejectedForAdminWorkFlowLists').html(html);
|
||||
loadFunctionWorkshopDocumentRejectedForAdmin = false;
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
@@ -191,14 +202,14 @@ async function loadWorkshopsWithDocumentsAwaitingUpload() {
|
||||
});
|
||||
}
|
||||
|
||||
function loadByWorkshopIdWithItemsForAdminWorkFlow(id) {
|
||||
function loadGetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(id) {
|
||||
var html = ``;
|
||||
$.ajax({
|
||||
async: false,
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: loadByWorkshopIdWithItemsForAdminWorkFlowUrl,
|
||||
url: loadGetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlowUrl,
|
||||
data: { 'workshopId': id },
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
success: function (response) {
|
||||
@@ -232,7 +243,7 @@ function loadByWorkshopIdWithItemsForAdminWorkFlow(id) {
|
||||
<div class="Rtable-cell width3 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center ms-1">
|
||||
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
@@ -253,7 +264,7 @@ function loadByWorkshopIdWithItemsForAdminWorkFlow(id) {
|
||||
<div class="Rtable-cell width4 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center gap-1 ms-1">
|
||||
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
@@ -287,7 +298,7 @@ function loadByWorkshopIdWithItemsForAdminWorkFlow(id) {
|
||||
<div class="Rtable-cell width5 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center ms-1">
|
||||
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
@@ -309,7 +320,7 @@ function loadByWorkshopIdWithItemsForAdminWorkFlow(id) {
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">پیغام: </div>
|
||||
<div class="d-flex justify-content-center gap-1 ms-1">
|
||||
|
||||
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
@@ -363,6 +374,291 @@ function loadByWorkshopIdWithItemsForAdminWorkFlow(id) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="Rtable-cell position-relative width7 bg-filter d-flex justify-content-end">
|
||||
<div class="Rtable-cell--content text-center d-block d-md-flex align-items-center gap-1 h-100">
|
||||
|
||||
<button class="btn-workflow-rollcall-edit position-relative" onclick="showModalEmployeeDocuments(${item.employeeId}, '${id}')">
|
||||
<span class="mx-1">عملیات</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
});
|
||||
|
||||
} else {
|
||||
html += `<div class="container-fluid">
|
||||
<div class="row p-lg-2 p-auto">
|
||||
<div class="text-center bg-white d-flex align-items-center justify-content-center w-100">
|
||||
<div class="">
|
||||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
$(`.workshopID_${id}`).html(html);
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//2
|
||||
async function loadCreatedEmployeesWorkshopDocumentForAdmin() {
|
||||
//$('#CountAbortedAddDocPersonnelLoading').show();
|
||||
var mainIndexNum = 1;
|
||||
|
||||
var html = ``;
|
||||
$.ajax({
|
||||
async: true,
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: loadCreatedEmployeesWorkshopDocumentForAdminUrl,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
success: function (response) {
|
||||
var data = response.data;
|
||||
$('#loadingSkeletonCreatedEmployeesWorkshopDocumentForAdmin').hide();
|
||||
|
||||
if (response.success) {
|
||||
if (data.length > 0) {
|
||||
data.forEach(function (item) {
|
||||
html += `
|
||||
<div id="Main_${item.workshopId}" class="Rtable-row Rtable-row--head align-items-center d-flex sticky openActionMain" onclick="loadCreatedEmployeesDocumentByWorkshopIdForAdmin('${item.workshopId}')" style="background: #58B3B3;border: none !important; cursor: pointer; ">
|
||||
<div class="col-2 col-md-2 text-start">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--content">
|
||||
<span class="d-flex justify-content-center align-items-center justify-content-center table-number" style="background: #deffff;margin: 0 10px 0 0;">
|
||||
${mainIndexNum++}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 col-md-8 text-center d-flex">
|
||||
<div class="w-100 d-flex align-items-center justify-content-between">
|
||||
<div class="employee-workshop-header">
|
||||
<div>${item.workshopFullName}</div>
|
||||
<div>${item.employerName}</div>
|
||||
</div>
|
||||
<div id="CreatedEmployeesWorkshop_EmployeeCountOfWorkshop_${item.workshopId}" class="number-of-count">${item.employeesWithoutDocumentCount}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 col-md-2 text-end">
|
||||
<span class="toggle">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15 18L9 12L15 6" stroke-width="2" stroke-linecap="round" />
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
html += `<div class="w-100 operation-div">
|
||||
<div id="DocumentsAwaitingUpload_${item.workshopId}" class="operations-btns-main workshopID_${item.workshopId}" style="padding: 1px 10px 0 10px; background: rgb(255, 255, 255); box-shadow: none;width: 100%;">
|
||||
</div></div>`;
|
||||
});
|
||||
|
||||
} else {
|
||||
html += `<div class="container-fluid">
|
||||
<div class="row p-lg-2 p-auto">
|
||||
<div class="text-center bg-white d-flex align-items-center justify-content-center w-100">
|
||||
<div class="">
|
||||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
$('#loadCreatedEmployeesWorkshopDocumentForAdminWorkFlowLists').html(html);
|
||||
loadFunctionCreatedEmployeesWorkshopDocumentForAdmin = false;
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadCreatedEmployeesDocumentByWorkshopIdForAdmin(id) {
|
||||
var html = ``;
|
||||
$.ajax({
|
||||
async: false,
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: loadCreatedEmployeesDocumentByWorkshopIdForAdminUrl,
|
||||
data: { 'workshopId': id },
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
success: function (response) {
|
||||
var data = response.data;
|
||||
|
||||
if (response.success) {
|
||||
if (data.length > 0) {
|
||||
|
||||
data.forEach(function (item, i) {
|
||||
html += `<div></div>
|
||||
<div class="Rtable-row align-items-center position-relative workflow-list employee-row" data-employee-id="${item.employeeId}">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<span class="d-flex justify-content-center align-items-center justify-content-center table-number">
|
||||
${i + 1}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
${item.employeeFullName}
|
||||
<p class="m-0 mt-2 d-block d-md-none"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width3 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center ms-1">
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.employeePicture.picturePath) {
|
||||
html += `<img id="employeePicture_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.employeePicture.picturePath ? item.employeePicture.picturePath : "")}" class="preview-image">`;
|
||||
} else {
|
||||
html += `<img id="employeePicture_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/ >`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">عکس پرسنلی</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width4 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center gap-1 ms-1">
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.nationalCardFront.picturePath) {
|
||||
html += `<img id="nationalCardFront_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardFront.picturePath ? item.nationalCardFront.picturePath : "")}" class="preview-image">`;
|
||||
} else {
|
||||
html += `<img id="nationalCardFront_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">کارت ملی رو</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.nationalCardRear.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="nationalCardRear_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardRear.picturePath ? item.nationalCardRear.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="nationalCardRear_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">کارت ملی پشت</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width5 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center ms-1">
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.militaryServiceCard.picturePath) {
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.militaryServiceCard.picturePath ? item.militaryServiceCard.picturePath : "")}" class="preview-image">`;
|
||||
} else {
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">کارت پایان خدمت</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width6 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">پیغام: </div>
|
||||
<div class="d-flex justify-content-center gap-1 ms-1">
|
||||
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage1.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage1_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage1.picturePath ? item.idCardPage1.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage1_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه اول</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage2.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage2_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage2.picturePath ? item.idCardPage2.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage2_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه دوم</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage3.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage3_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage3.picturePath ? item.idCardPage3.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage3_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه سوم</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage4.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage4_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage4.picturePath ? item.idCardPage4.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage4_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه چهارم</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="Rtable-cell position-relative width7 bg-filter d-flex justify-content-end">
|
||||
<div class="Rtable-cell--content text-center d-block d-md-flex align-items-center gap-1 h-100">
|
||||
@@ -388,7 +684,7 @@ function loadByWorkshopIdWithItemsForAdminWorkFlow(id) {
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
|
||||
$(`.workshopID_${id}`).html(html);
|
||||
}
|
||||
},
|
||||
@@ -398,78 +694,326 @@ function loadByWorkshopIdWithItemsForAdminWorkFlow(id) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//3
|
||||
async function loadClientRejectedDocumentWorkshopsForAdmin() {
|
||||
//$('#CountDocumentsAwaitingUploadLoading').show();
|
||||
var mainIndexNum = 1;
|
||||
|
||||
var html = ``;
|
||||
$.ajax({
|
||||
//async: false,
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: loadClientRejectedDocumentWorkshopsForAdminUrl,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
success: function (response) {
|
||||
var data = response.data;
|
||||
|
||||
$('#loadingSkeletonClientRejectedDocumentWorkshopsForAdmin').hide();
|
||||
if (response.success) {
|
||||
if (data.length > 0) {
|
||||
data.forEach(function (item) {
|
||||
html += `
|
||||
<div id="Main_${item.workshopId}" class="Rtable-row Rtable-row--head align-items-center d-flex sticky openActionMain" onclick="loadClientRejectedDocumentByWorkshopIdForAdmin('${item.workshopId}')" style="background: #58B3B3;border: none !important; cursor: pointer; ">
|
||||
<div class="col-2 col-md-2 text-start">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--content">
|
||||
<span class="d-flex justify-content-center align-items-center justify-content-center table-number" style="background: #deffff;margin: 0 10px 0 0;">
|
||||
${mainIndexNum++}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 col-md-8 text-center d-flex">
|
||||
<div class="w-100 d-flex align-items-center justify-content-between">
|
||||
<div class="employee-workshop-header">
|
||||
<div>${item.workshopFullName}</div>
|
||||
<div>${item.employerName}</div>
|
||||
</div>
|
||||
<div id="ClientRejectedDocument_EmployeeCountOfWorkshop_${item.workshopId}" class="number-of-count">${item.employeesWithoutDocumentCount}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 col-md-2 text-end">
|
||||
<span class="toggle">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15 18L9 12L15 6" stroke-width="2" stroke-linecap="round" />
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
html += `<div class="w-100 operation-div">
|
||||
<div id="DocumentsAwaitingUpload_${item.workshopId}" class="operations-btns-main workshopID_${item.workshopId}" style="padding: 1px 10px 0 10px; background: rgb(255, 255, 255); box-shadow: none;width: 100%;">
|
||||
</div></div>`;
|
||||
});
|
||||
|
||||
} else {
|
||||
html += `<div class="container-fluid">
|
||||
<div class="row p-lg-2 p-auto">
|
||||
<div class="text-center bg-white d-flex align-items-center justify-content-center w-100">
|
||||
<div class="">
|
||||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
$('#loadClientRejectedDocumentWorkshopsForAdminWorkFlowLists').html(html);
|
||||
loadFunctionClientRejectedDocumentWorkshopsForAdmin = false;
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadClientRejectedDocumentByWorkshopIdForAdmin(id) {
|
||||
var html = ``;
|
||||
$.ajax({
|
||||
async: false,
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: loadClientRejectedDocumentByWorkshopIdForAdminUrl,
|
||||
data: { 'workshopId': id },
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
success: function (response) {
|
||||
var data = response.data;
|
||||
|
||||
if (response.success) {
|
||||
if (data.length > 0) {
|
||||
|
||||
data.forEach(function (item, i) {
|
||||
html += `<div></div>
|
||||
<div class="Rtable-row align-items-center position-relative workflow-list employee-row" data-employee-id="${item.employeeId}">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<span class="d-flex justify-content-center align-items-center justify-content-center table-number">
|
||||
${i + 1}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
${item.employeeFullName}
|
||||
<p class="m-0 mt-2 d-block d-md-none"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width3 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center ms-1">
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.employeePicture.picturePath) {
|
||||
html += `<img id="employeePicture_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.employeePicture.picturePath ? item.employeePicture.picturePath : "")}" class="preview-image">`;
|
||||
} else {
|
||||
html += `<img id="employeePicture_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/ >`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">عکس پرسنلی</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width4 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center gap-1 ms-1">
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.nationalCardFront.picturePath) {
|
||||
html += `<img id="nationalCardFront_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardFront.picturePath ? item.nationalCardFront.picturePath : "")}" class="preview-image">`;
|
||||
} else {
|
||||
html += `<img id="nationalCardFront_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">کارت ملی رو</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.nationalCardRear.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="nationalCardRear_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardRear.picturePath ? item.nationalCardRear.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="nationalCardRear_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">کارت ملی پشت</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width5 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center ms-1">
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.militaryServiceCard.picturePath) {
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.militaryServiceCard.picturePath ? item.militaryServiceCard.picturePath : "")}" class="preview-image">`;
|
||||
} else {
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">کارت پایان خدمت</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width6 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">پیغام: </div>
|
||||
<div class="d-flex justify-content-center gap-1 ms-1">
|
||||
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage1.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage1_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage1.picturePath ? item.idCardPage1.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage1_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه اول</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage2.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage2_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage2.picturePath ? item.idCardPage2.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage2_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه دوم</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage3.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage3_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage3.picturePath ? item.idCardPage3.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage3_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه سوم</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage4.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage4_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage4.picturePath ? item.idCardPage4.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage4_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه چهارم</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="Rtable-cell position-relative width7 bg-filter d-flex justify-content-end">
|
||||
<div class="Rtable-cell--content text-center d-block d-md-flex align-items-center gap-1 h-100">
|
||||
|
||||
<button class="btn-workflow-rollcall-edit position-relative" onclick="showModalEmployeeDocuments(${item.employeeId}, '${id}')">
|
||||
<span class="mx-1">عملیات</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
});
|
||||
|
||||
} else {
|
||||
html += `<div class="container-fluid">
|
||||
<div class="row p-lg-2 p-auto">
|
||||
<div class="text-center bg-white d-flex align-items-center justify-content-center w-100">
|
||||
<div class="">
|
||||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
$(`.workshopID_${id}`).html(html);
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showModalEmployeeDocuments(employeeId, workshopId) {
|
||||
var goTo = `#showmodal=/AdminNew/Company/WorkFlow/EmployeesDocuments?handler=CreateUploadDocument&workshopId=${workshopId}&employeeId=${employeeId}`;
|
||||
window.location.href = goTo;
|
||||
}
|
||||
|
||||
async function CountWorkFlow() {
|
||||
async function CountWorkFlowUploadDocument() {
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
type: 'Get',
|
||||
url: loadCountWorkFlowOfAbsentAndCut,
|
||||
url: loadCountWorkFlowUploadDocumentUrl,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
$('.spinner-grow').hide();
|
||||
|
||||
if (response.dataAbsent === 0) {
|
||||
$('#CountAbsent').hide();
|
||||
$('#CountAbsentMobile').hide();
|
||||
} else {
|
||||
$('#CountAbsent').show();
|
||||
$('#CountAbsentMobile').show();
|
||||
$('#CountAbsent').text(response.dataAbsent);
|
||||
$('#CountAbsentMobile').text(response.dataAbsent);
|
||||
}
|
||||
|
||||
if (response.dataCut === 0) {
|
||||
$('#CountCut').hide();
|
||||
$('#CountCutMobile').hide();
|
||||
} else {
|
||||
$('#CountCut').show();
|
||||
$('#CountCutMobile').show();
|
||||
$('#CountCut').text(response.dataCut);
|
||||
$('#CountCutMobile').text(response.dataCut);
|
||||
}
|
||||
|
||||
if (response.dataLunchBreak === 0) {
|
||||
$('#CountLunchBreak').hide();
|
||||
$('#CountLunchBreakMobile').hide();
|
||||
} else {
|
||||
$('#CountLunchBreak').show();
|
||||
$('#CountLunchBreakMobile').show();
|
||||
$('#CountLunchBreak').text(response.dataLunchBreak);
|
||||
$('#CountLunchBreakMobile').text(response.dataLunchBreak);
|
||||
}
|
||||
|
||||
if (response.dataUndefined === 0) {
|
||||
$('#CountUndefined').hide();
|
||||
$('#CountUndefinedMobile').hide();
|
||||
} else {
|
||||
$('#CountUndefined').show();
|
||||
$('#CountUndefinedMobile').show();
|
||||
$('#CountUndefined').text(response.dataUndefined);
|
||||
$('#CountUndefinedMobile').text(response.dataUndefined);
|
||||
}
|
||||
|
||||
if (response.dataOverlappingLeave === 0) {
|
||||
$('#CountOverlappingLeave').hide();
|
||||
$('#CountOverlappingLeaveMobile').hide();
|
||||
} else {
|
||||
$('#CountOverlappingLeave').show();
|
||||
$('#CountOverlappingLeaveMobile').show();
|
||||
$('#CountOverlappingLeave').text(response.dataOverlappingLeave);
|
||||
$('#CountOverlappingLeaveMobile').text(response.dataOverlappingLeave);
|
||||
}
|
||||
|
||||
$('.spinner-grow').hide();
|
||||
|
||||
if (response.workshopDocumentRejectedForAdmin === 0) {
|
||||
$('#CountWorkshopDocumentRejectedForAdmin').hide();
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
$('#CountWorkshopDocumentRejectedForAdmin').show();
|
||||
$('#CountWorkshopDocumentRejectedForAdmin').text(response.workshopDocumentRejectedForAdmin);
|
||||
}
|
||||
|
||||
if (response.clientRejectedDocumentWorkshopsForAdmin === 0) {
|
||||
$('#CountClientRejectedDocumentWorkshopsForAdmin').hide();
|
||||
} else {
|
||||
$('#CountClientRejectedDocumentWorkshopsForAdmin').show();
|
||||
$('#CountClientRejectedDocumentWorkshopsForAdmin').text(response.clientRejectedDocumentWorkshopsForAdmin);
|
||||
}
|
||||
|
||||
if (response.createdEmployeesWorkshopDocumentForAdmin === 0) {
|
||||
$('#CountCreatedEmployeesWorkshopDocumentForAdmin').hide();
|
||||
} else {
|
||||
$('#CountCreatedEmployeesWorkshopDocumentForAdmin').show();
|
||||
$('#CountCreatedEmployeesWorkshopDocumentForAdmin').text(response.createdEmployeesWorkshopDocumentForAdmin);
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
@@ -492,4 +1036,4 @@ function updateMainWorkFlow() {
|
||||
$(`#loadDocumentsAwaitingUploadWorkFlow .Rtable-cell.width1 .table-number`).each(function () {
|
||||
$(this).text(index++);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ var allPicture = [
|
||||
{
|
||||
'label': 7,
|
||||
'changeImage': false
|
||||
},
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
var pendingMessage = `<div class="pendingMessage">بررسی</div>`;
|
||||
var pendingIcon = `<svg width="24" height="24" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11 19.25C15.5563 19.25 19.25 15.5563 19.25 11C19.25 6.44365 15.5563 2.75 11 2.75C6.44365 2.75 2.75 6.44365 2.75 11C2.75 15.5563 6.44365 19.25 11 19.25Z" fill="#FDBA74"/><path d="M11.4168 14.6667C11.4168 14.8968 11.2303 15.0833 11.0002 15.0833C10.77 15.0833 10.5835 14.8968 10.5835 14.6667C10.5835 14.4365 10.77 14.25 11.0002 14.25C11.2303 14.25 11.4168 14.4365 11.4168 14.6667Z" fill="white" stroke="white"/><path d="M11 11.916V6.41602V11.916Z" fill="white"/><path d="M11 11.916V6.41602" stroke="white" stroke-width="1.5" stroke-linecap="round"/></svg>`;
|
||||
@@ -429,7 +429,8 @@ $(document).ready(function () {
|
||||
|
||||
$(document).off('click', '.btnEditEmployee').on('click', '.btnEditEmployee', function (event) {
|
||||
getIndexForEmployeeEdit = $(this).data('index');
|
||||
LoadCustomPartial(loadModalEmployeeEdit + `&employeeId=${employeeId}&workshopId=${workshopId}`);
|
||||
getMediaIdForEmployeeEdit = $(this).data('media-id');
|
||||
LoadCustomPartial(loadModalEmployeeEdit + `&employeeId=${employeeId}&workshopId=${workshopId}&mediaId=${getMediaIdForEmployeeEdit}`);
|
||||
});
|
||||
|
||||
$(".exitModal").click(function () {
|
||||
@@ -704,6 +705,7 @@ function uploadCanvasAsFile(canvas, fileName, indexFileValue, label) {
|
||||
var getChangeIndex = allPicture.findIndex(item => item.label === indexFileValue);
|
||||
allPicture[getChangeIndex].changeImage = true;
|
||||
|
||||
$('#createUploadingFiles').prop('disabled', false).removeClass('disable');
|
||||
showLoadingAnimation(indexFileValue);
|
||||
|
||||
}, "image/png");
|
||||
@@ -780,14 +782,12 @@ function updatePreviewImage(indexId, id2, result) {
|
||||
}
|
||||
|
||||
function saveSubmit(id) {
|
||||
var menuValue = $('.main-navbar .active').data('menu');
|
||||
|
||||
var loading = $(".spinner-loading");
|
||||
|
||||
loading.show();
|
||||
|
||||
//var data = {
|
||||
// 'cmd.EmployeeDocumentsId': id
|
||||
//}
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('workshopId', workshopId);
|
||||
formData.append('employeeId', employeeId);
|
||||
@@ -810,18 +810,46 @@ function saveSubmit(id) {
|
||||
|
||||
if (response.success) {
|
||||
|
||||
//var employeeSectionDiv = $(`[data-employee-id="${employeeId}"]`);
|
||||
//employeeSectionDiv.remove();
|
||||
|
||||
//var employeeCountElement = $(`#EmployeeCountOfWorkshop_${workshopId}`);
|
||||
//var employeeNumberOfWorkshop = Number(employeeCountElement.text().trim());
|
||||
//employeeNumberOfWorkshop -= 1;
|
||||
//employeeCountElement.text(employeeNumberOfWorkshop);
|
||||
|
||||
//if (employeeNumberOfWorkshop === 0) {
|
||||
// var mainElement = $(`#Main_${workshopId}`);
|
||||
// mainElement.next(".operation-div").remove();
|
||||
// mainElement.remove();
|
||||
|
||||
var employeeSectionDiv = $(`[data-employee-id="${employeeId}"]`);
|
||||
employeeSectionDiv.remove();
|
||||
|
||||
var employeeCountElement = '';
|
||||
switch (menuValue) {
|
||||
case "WorkshopDocumentRejectedForAdmin":
|
||||
//employeeCountElement = $(`#WorkshopDocumentRejected_EmployeeCountOfWorkshop_${workshopId}`);
|
||||
$('#loadWorkshopDocumentRejectedForAdminWorkFlowLists').html('');
|
||||
$('#loadingSkeletonWorkshopDocumentRejectedForAdmin').show();
|
||||
loadWorkshopDocumentRejectedForAdmin();
|
||||
break;
|
||||
case "CreatedEmployeesWorkshopDocumentForAdmin":
|
||||
//employeeCountElement = $(`#CreatedEmployeesWorkshop_EmployeeCountOfWorkshop_${workshopId}`);
|
||||
$('#loadCreatedEmployeesWorkshopDocumentForAdminWorkFlowLists').html('');
|
||||
$('#loadingSkeletonCreatedEmployeesWorkshopDocumentForAdmin').show();
|
||||
loadCreatedEmployeesWorkshopDocumentForAdmin();
|
||||
break;
|
||||
case "ClientRejectedDocumentWorkshopsForAdmin":
|
||||
//employeeCountElement = $(`#ClientRejectedDocument_EmployeeCountOfWorkshop_${workshopId}`);
|
||||
$('#loadClientRejectedDocumentWorkshopsForAdminWorkFlowLists').html('');
|
||||
$('#loadingSkeletonClientRejectedDocumentWorkshopsForAdmin').hide();
|
||||
loadClientRejectedDocumentWorkshopsForAdmin();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
//if (employeeCountElement !== '') {
|
||||
// var employeeNumberOfWorkshop = Number(employeeCountElement.text().trim());
|
||||
// employeeNumberOfWorkshop -= 1;
|
||||
// employeeCountElement.text(employeeNumberOfWorkshop);
|
||||
|
||||
// if (employeeNumberOfWorkshop === 0) {
|
||||
// var mainElement = $(`#Main_${workshopId}`);
|
||||
// mainElement.next(".operation-div").remove();
|
||||
// mainElement.remove();
|
||||
// }
|
||||
//}
|
||||
|
||||
//var countDocumentsElement = $(`#CountDocumentsAwaitingUpload`);
|
||||
@@ -829,15 +857,17 @@ function saveSubmit(id) {
|
||||
//countDocumentsAwaitingUpload -= 1;
|
||||
//countDocumentsElement.text(countDocumentsAwaitingUpload);
|
||||
|
||||
//updateMainWorkFlow();
|
||||
//updateIndexesWorkFlow(`DocumentsAwaitingUpload_${workshopId}`);
|
||||
updateMainWorkFlow();
|
||||
updateIndexesWorkFlow(`DocumentsAwaitingUpload_${workshopId}`);
|
||||
|
||||
$(`.workshopID_${workshopId}`).html('');
|
||||
loadByWorkshopIdWithItemsForAdminWorkFlow(workshopId);
|
||||
//$(`.workshopID_${workshopId}`).html('');
|
||||
//loadByWorkshopIdWithItemsForAdminWorkFlow(workshopId);
|
||||
|
||||
_RefreshWorkFlowCountMenu();
|
||||
_RefreshCheckerCountMenu();
|
||||
|
||||
CountWorkFlowUploadDocument();
|
||||
|
||||
$('#MainModal').modal('hide');
|
||||
showAlertMessage('.alert-success-msg', 'تصویر موجود با موفقیت ارسال شد.', 3500);
|
||||
} else {
|
||||
|
||||
@@ -7,52 +7,42 @@ var idCardPage2;
|
||||
var idCardPage3;
|
||||
var idCardPage4;
|
||||
var uploadFileCount = UploadedCount;
|
||||
var command = [];
|
||||
|
||||
var pendingMessage = `<div class="pendingMessage">بررسی</div>`;
|
||||
var pendingIcon = `<svg width="24" height="24" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11 19.25C15.5563 19.25 19.25 15.5563 19.25 11C19.25 6.44365 15.5563 2.75 11 2.75C6.44365 2.75 2.75 6.44365 2.75 11C2.75 15.5563 6.44365 19.25 11 19.25Z" fill="#FDBA74"/>
|
||||
<path d="M11.4168 14.6667C11.4168 14.8968 11.2303 15.0833 11.0002 15.0833C10.77 15.0833 10.5835 14.8968 10.5835 14.6667C10.5835 14.4365 10.77 14.25 11.0002 14.25C11.2303 14.25 11.4168 14.4365 11.4168 14.6667Z" fill="white" stroke="white"/>
|
||||
<path d="M11 11.916V6.41602V11.916Z" fill="white"/>
|
||||
<path d="M11 11.916V6.41602" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
|
||||
</svg>`;
|
||||
var pendingIcon = `<svg width="24" height="24" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11 19.25C15.5563 19.25 19.25 15.5563 19.25 11C19.25 6.44365 15.5563 2.75 11 2.75C6.44365 2.75 2.75 6.44365 2.75 11C2.75 15.5563 6.44365 19.25 11 19.25Z" fill="#FDBA74"/><path d="M11.4168 14.6667C11.4168 14.8968 11.2303 15.0833 11.0002 15.0833C10.77 15.0833 10.5835 14.8968 10.5835 14.6667C10.5835 14.4365 10.77 14.25 11.0002 14.25C11.2303 14.25 11.4168 14.4365 11.4168 14.6667Z" fill="white" stroke="white"/><path d="M11 11.916V6.41602V11.916Z" fill="white"/><path d="M11 11.916V6.41602" stroke="white" stroke-width="1.5" stroke-linecap="round"/></svg>`;
|
||||
var confirmMessage = `<div class="confirmedMessage">تایید</div>`;
|
||||
var confirmIcon = `<svg width="24" height="24" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="7" cy="7" r="5.25" fill="#00C04D"/>
|
||||
<path d="M4.66659 7L6.41659 8.75L9.33325 5.25" stroke="white" stroke-linecap="round"/>
|
||||
</svg>`;
|
||||
var confirmIcon = `<svg width="24" height="24" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="7" cy="7" r="5.25" fill="#00C04D"/><path d="M4.66659 7L6.41659 8.75L9.33325 5.25" stroke="white" stroke-linecap="round"/></svg>`;
|
||||
var rejectMessage = `<div class="rejectMessage">رد شده</div>`;
|
||||
var rejectIcon = `<svg width="24" height="24" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="7" cy="7" r="5.25" fill="#FF5D5D"/>
|
||||
<path d="M9.33341 4.66602L4.66675 9.33268" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M4.66659 4.66602L9.33325 9.33268" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>`;
|
||||
var rejectIcon = `<svg width="24" height="24" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="7" cy="7" r="5.25" fill="#FF5D5D"/><path d="M9.33341 4.66602L4.66675 9.33268" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.66659 4.66602L9.33325 9.33268" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
var employeeId = $("#employeeIdForList").val();
|
||||
|
||||
|
||||
//$('.btnDeletingPD').each(function () {
|
||||
// if ($(this).hasClass('Unsubmitted')) { // Remove the extra class selector '.btnDeletingPD'
|
||||
// $(this).closest('.pdBox').addClass('justUploaded'); // Add 'justUploaded' to the closest parent .pdBox
|
||||
// }
|
||||
//});
|
||||
|
||||
|
||||
$(".btnDeletingPD ").each(function () {
|
||||
if ($(this).hasClass("SubmittedByAdmin") || $(this).hasClass("Rejected") || $(this).hasClass("Confirmed")) {
|
||||
$(this).addClass("disable");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
$(document).off('click', '.btnUploadingPD').on('click', '.btnUploadingPD', function (event) {
|
||||
event.preventDefault();
|
||||
const index = $(this).data('index');
|
||||
$('input[type="file"][data-index="' + index + '"]').click();
|
||||
});
|
||||
|
||||
|
||||
$(".btnDeletingPD ").each(function () {
|
||||
if ($(this).hasClass("SubmittedByAdmin") || $(this).hasClass("SubmittedByClient") || $(this).hasClass("Rejected") || $(this).hasClass("Confirmed")) {
|
||||
$(this).addClass("disable");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
$('.pdBox').each(function () {
|
||||
if ($(".isTrue").hasClass("isTrue") && $(".Unsubmitted").hasClass("Unsubmitted")) {
|
||||
if ($(".isTrue").hasClass("isTrue") && $(".Unsubmitted").hasClass("Unsubmitted") || $(".SubmittedByClient").hasClass("SubmittedByClient")) {
|
||||
$(".btnCreateNew").prop("disabled", false);
|
||||
$(".btnCreateNew ").removeClass("disable");
|
||||
} else {
|
||||
@@ -62,7 +52,7 @@ $(document).ready(function () {
|
||||
|
||||
$('.pdBox').each(function () {
|
||||
// Check if there's a button with the 'submitted' class inside the pdBox
|
||||
if ($(this).find('button.SubmittedByAdmin').length > 0 || $(this).find('button.SubmittedByClient').length > 0 ) {
|
||||
if ($(this).find('button.SubmittedByAdmin').length > 0) {
|
||||
$(this).addClass('pending');
|
||||
$(this).find(".pdImageBox .sign").addClass("pendingSign").html(pendingIcon);
|
||||
$(this).find(".btnUploadingPD").addClass("disable");
|
||||
@@ -80,7 +70,6 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).off('change', '.file-input').on('change', '.file-input', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -90,20 +79,57 @@ $(document).ready(function () {
|
||||
const validPdfExtensions = ['pdf'];
|
||||
|
||||
const label = $(`#label_${indexFileValue}`).val();
|
||||
const pdBox = $(this).closest('.pdBox');
|
||||
const img = pdBox.find('.preview-image');
|
||||
var deleteButton = pdBox.find('.btnDeletingPD');
|
||||
|
||||
if (fileInputFile) {
|
||||
const fileName = fileInputFile.name.toLowerCase();
|
||||
const extension = fileName.split('.').pop();
|
||||
|
||||
// بررسی فرمتهای تصویر (jpeg, jpg, png)
|
||||
if (validExtensions.includes(extension)) {
|
||||
if (fileInputFile.size > 5000000) {
|
||||
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را آپلود کنید.', 3500);
|
||||
$(this).val('');
|
||||
return;
|
||||
}
|
||||
uploadFile(fileInputFile, indexFileValue, label);
|
||||
} else if (validPdfExtensions.includes(extension)) {
|
||||
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (event) {
|
||||
img.attr('src', event.target.result);
|
||||
|
||||
const base64String = event.target.result.split(',')[1];
|
||||
const byteCharacters = atob(base64String);
|
||||
const byteNumbers = new Array(byteCharacters.length);
|
||||
for (let i = 0; i < byteCharacters.length; i++) {
|
||||
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
}
|
||||
const byteArray = new Uint8Array(byteNumbers);
|
||||
const blob = new Blob([byteArray], { type: fileInputFile.type });
|
||||
const newFile = new File([blob], fileInputFile.name, { type: fileInputFile.type });
|
||||
|
||||
let existingIndex = command.findIndex(item => item.Label === label);
|
||||
if (existingIndex !== -1) {
|
||||
command[existingIndex].PictureFile = newFile;
|
||||
} else {
|
||||
let picturesPart = {
|
||||
Label: label,
|
||||
PictureFile: newFile
|
||||
};
|
||||
command.push(picturesPart);
|
||||
}
|
||||
};
|
||||
|
||||
reader.readAsDataURL(fileInputFile);
|
||||
$('#createUploadingFiles').prop('disabled', false).removeClass('disable');
|
||||
|
||||
pdBox.removeClass();
|
||||
pdBox.addClass('pdBox');
|
||||
|
||||
showLoadingAnimation(indexFileValue);
|
||||
}
|
||||
else if (validPdfExtensions.includes(extension)) {
|
||||
var fileReader = new FileReader();
|
||||
|
||||
fileReader.onload = function () {
|
||||
@@ -116,7 +142,7 @@ $(document).ready(function () {
|
||||
return;
|
||||
}
|
||||
|
||||
pdf.getPage(1).then(function (page) { // فقط صفحه اول پردازش میشود
|
||||
pdf.getPage(1).then(function (page) {
|
||||
var scale = 2.0;
|
||||
var viewport = page.getViewport({ scale: scale });
|
||||
|
||||
@@ -129,15 +155,15 @@ $(document).ready(function () {
|
||||
var context = canvas.getContext("2d");
|
||||
|
||||
page.render({
|
||||
canvasContext: context,
|
||||
viewport: viewport
|
||||
})
|
||||
.promise.then(function () {
|
||||
uploadCanvasAsFile(canvas, `${label}_${indexFileValue}.jpg`, indexFileValue, label);
|
||||
})
|
||||
.catch(function (error) {
|
||||
showAlertMessage('.alert-msg', 'مشکلی در پردازش PDF رخ داده است!', 3500);
|
||||
});
|
||||
canvasContext: context,
|
||||
viewport: viewport
|
||||
}).promise.then(function () {
|
||||
pdBox.removeClass();
|
||||
pdBox.addClass('pdBox');
|
||||
uploadCanvasAsFile(canvas, `${label}_${indexFileValue}.jpg`, indexFileValue, label);
|
||||
}).catch(function (error) {
|
||||
showAlertMessage('.alert-msg', 'مشکلی در پردازش PDF رخ داده است!', 3500);
|
||||
});
|
||||
}).catch(function (error) {
|
||||
showAlertMessage('.alert-msg', 'خطا در دریافت صفحه PDF!', 3500);
|
||||
});
|
||||
@@ -149,12 +175,152 @@ $(document).ready(function () {
|
||||
|
||||
fileReader.readAsArrayBuffer(fileInputFile);
|
||||
|
||||
} else {
|
||||
showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg یا png باشد.', 3500);
|
||||
}
|
||||
else {
|
||||
showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg, png یا pdf باشد.', 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
deleteButton.removeClass('disable');
|
||||
if (pdBox.find('button.Rejected').length > 0) {
|
||||
pdBox.find(".btnSendToChecker").removeClass("disable");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//$(document).off('change', '.file-input').on('change', '.file-input', function (e) {
|
||||
// e.preventDefault();
|
||||
|
||||
// const fileInputFile = this.files[0];
|
||||
// const indexFileValue = $(this).data('index');
|
||||
// const validExtensions = ['jpg', 'jpeg', 'png'];
|
||||
|
||||
// const label = $(`#label_${indexFileValue}`).val();
|
||||
// const pdBox = $(this).closest('.pdBox');
|
||||
// const img = pdBox.find('.preview-image');
|
||||
|
||||
// if (fileInputFile) {
|
||||
// const fileName = fileInputFile.name.toLowerCase();
|
||||
// const extension = fileName.split('.').pop();
|
||||
|
||||
// if (validExtensions.includes(extension)) {
|
||||
// if (fileInputFile.size > 5000000) {
|
||||
// showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را آپلود کنید.', 3500);
|
||||
// $(this).val('');
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // خواندن فایل و نمایش آن
|
||||
// const reader = new FileReader();
|
||||
// reader.onload = function (event) {
|
||||
// img.attr('src', event.target.result);
|
||||
|
||||
// const base64String = event.target.result.split(',')[1];
|
||||
// const byteCharacters = atob(base64String);
|
||||
// const byteNumbers = new Array(byteCharacters.length);
|
||||
// for (let i = 0; i < byteCharacters.length; i++) {
|
||||
// byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
// }
|
||||
// const byteArray = new Uint8Array(byteNumbers);
|
||||
// const blob = new Blob([byteArray], { type: fileInputFile.type });
|
||||
// const newFile = new File([blob], fileInputFile.name, { type: fileInputFile.type });
|
||||
|
||||
// let picturesPart = {
|
||||
// Label: label,
|
||||
// PictureFile: newFile
|
||||
// };
|
||||
// pictures.push(picturesPart);
|
||||
// };
|
||||
|
||||
// reader.readAsDataURL(fileInputFile);
|
||||
|
||||
// //uploadFile(fileInputFile, indexFileValue, label);
|
||||
// } else {
|
||||
// showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg یا png باشد.', 3500);
|
||||
// }
|
||||
// }
|
||||
|
||||
// console.log(pictures);
|
||||
//});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//$(document).off('change', '.file-input').on('change', '.file-input', function (e) {
|
||||
// e.preventDefault();
|
||||
|
||||
// const fileInputFile = this.files[0];
|
||||
// const indexFileValue = $(this).data('index');
|
||||
// const validExtensions = ['jpg', 'jpeg', 'png'];
|
||||
// const validPdfExtensions = ['pdf'];
|
||||
|
||||
// const label = $(`#label_${indexFileValue}`).val();
|
||||
|
||||
// if (fileInputFile) {
|
||||
// const fileName = fileInputFile.name.toLowerCase();
|
||||
// const extension = fileName.split('.').pop();
|
||||
|
||||
// if (validExtensions.includes(extension)) {
|
||||
// if (fileInputFile.size > 5000000) {
|
||||
// showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را آپلود کنید.', 3500);
|
||||
// $(this).val('');
|
||||
// return;
|
||||
// }
|
||||
// uploadFile(fileInputFile, indexFileValue, label);
|
||||
// } else if (validPdfExtensions.includes(extension)) {
|
||||
|
||||
// var fileReader = new FileReader();
|
||||
|
||||
// fileReader.onload = function () {
|
||||
// var typedarray = new Uint8Array(this.result);
|
||||
// pdfjsLib.getDocument(typedarray).promise.then(function (pdf) {
|
||||
// totalPageCount = pdf.numPages;
|
||||
|
||||
// if (totalPageCount > 1) {
|
||||
// showAlertMessage('.alert-msg', 'آپلود مجاز نیست! تعداد صفحات نباید بیشتر از ۱ باشد.', 3500);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// pdf.getPage(1).then(function (page) { // فقط صفحه اول پردازش میشود
|
||||
// var scale = 2.0;
|
||||
// var viewport = page.getViewport({ scale: scale });
|
||||
|
||||
// var canvas = document.createElement("canvas");
|
||||
// canvas.className = "page";
|
||||
// canvas.title = "Page 1";
|
||||
// canvas.height = viewport.height;
|
||||
// canvas.width = viewport.width;
|
||||
|
||||
// var context = canvas.getContext("2d");
|
||||
|
||||
// page.render({
|
||||
// canvasContext: context,
|
||||
// viewport: viewport
|
||||
// })
|
||||
// .promise.then(function () {
|
||||
// uploadCanvasAsFile(canvas, `${label}_${indexFileValue}.jpg`, indexFileValue, label);
|
||||
// })
|
||||
// .catch(function (error) {
|
||||
// showAlertMessage('.alert-msg', 'مشکلی در پردازش PDF رخ داده است!', 3500);
|
||||
// });
|
||||
// }).catch(function (error) {
|
||||
// showAlertMessage('.alert-msg', 'خطا در دریافت صفحه PDF!', 3500);
|
||||
// });
|
||||
|
||||
// }).catch(function (error) {
|
||||
// showAlertMessage('.alert-msg', 'خطا در بارگذاری فایل PDF!', 3500);
|
||||
// });
|
||||
// };
|
||||
|
||||
// fileReader.readAsArrayBuffer(fileInputFile);
|
||||
|
||||
// } else {
|
||||
// showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg یا png باشد.', 3500);
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
|
||||
$(document).off('click', '.btnDeletingPD').on('click', '.btnDeletingPD', function (event) {
|
||||
event.preventDefault();
|
||||
const indexId = $(this).data('index');
|
||||
@@ -223,6 +389,57 @@ function cancelOperation() {
|
||||
});
|
||||
}
|
||||
|
||||
var indexCount = 0;
|
||||
var activeUploads = 0;
|
||||
function showLoadingAnimation(indexId) {
|
||||
uploadFileCount = uploadFileCount + 1;
|
||||
|
||||
//const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
//const spinner = pdBox.find('.spinner-loading-progress');
|
||||
//const percentageText = pdBox.find('.percentageText');
|
||||
|
||||
//spinner.show();
|
||||
//activeUploads++;
|
||||
//$('#createUploadingFiles').prop('disabled', true).addClass('disable');
|
||||
|
||||
//let simulatedProgress = 0;
|
||||
//const progressInterval = setInterval(function () {
|
||||
// if (simulatedProgress < 100) {
|
||||
// simulatedProgress += 2;
|
||||
// spinner.css('width', `${simulatedProgress}%`);
|
||||
// percentageText.text(`${simulatedProgress}%`);
|
||||
// }
|
||||
|
||||
// if (simulatedProgress >= 100) {
|
||||
// clearInterval(progressInterval);
|
||||
// }
|
||||
//}, 30);
|
||||
|
||||
//setTimeout(function () {
|
||||
// clearInterval(progressInterval);
|
||||
// spinner.css('width', '100%');
|
||||
// percentageText.text('100%');
|
||||
|
||||
// spinner.hide();
|
||||
// spinner.css('width', '0%');
|
||||
// handleActiveUploads();
|
||||
//}, 2300);
|
||||
}
|
||||
|
||||
//function uploadCanvasAsFile(canvas, fileName, indexFileValue, label) {
|
||||
// canvas.toBlob(function (blob) {
|
||||
// if (!blob) {
|
||||
// showAlertMessage('.alert-msg', 'مشکلی در تبدیل تصویر رخ داده است!', 3500);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// let file = new File([blob], fileName, { type: 'image/png' });
|
||||
|
||||
// uploadFile(file, indexFileValue, label);
|
||||
|
||||
// }, "image/png");
|
||||
//}
|
||||
|
||||
function uploadCanvasAsFile(canvas, fileName, indexFileValue, label) {
|
||||
canvas.toBlob(function (blob) {
|
||||
if (!blob) {
|
||||
@@ -231,137 +448,160 @@ function uploadCanvasAsFile(canvas, fileName, indexFileValue, label) {
|
||||
}
|
||||
|
||||
let file = new File([blob], fileName, { type: 'image/png' });
|
||||
const imageUrl = URL.createObjectURL(blob);
|
||||
|
||||
uploadFile(file, indexFileValue, label);
|
||||
const img = $(`#${label}`);
|
||||
img.attr('src', imageUrl);
|
||||
|
||||
let existingIndex = command.findIndex(item => item.Label === label);
|
||||
if (existingIndex !== -1) {
|
||||
command[existingIndex].PictureFile = file;
|
||||
} else {
|
||||
let picturesPart = {
|
||||
Label: label,
|
||||
PictureFile: file
|
||||
};
|
||||
command.push(picturesPart);
|
||||
}
|
||||
|
||||
showLoadingAnimation(indexFileValue);
|
||||
|
||||
}, "image/png");
|
||||
}
|
||||
|
||||
var indexCount = 0;
|
||||
var activeUploads = 0;
|
||||
function uploadFile(file, indexId, label) {
|
||||
const formData = new FormData();
|
||||
formData.append('command.EmployeeId', employeeId);
|
||||
formData.append('command.Label', label);
|
||||
formData.append('command.PictureFile', file);
|
||||
//var indexCount = 0;
|
||||
//var activeUploads = 0;
|
||||
//function uploadFile(file, indexId, label) {
|
||||
// const formData = new FormData();
|
||||
// formData.append('command.EmployeeId', employeeId);
|
||||
// formData.append('command.WorkshopId', workshopId);
|
||||
// formData.append('command.Label', label);
|
||||
// formData.append('command.PictureFile', file);
|
||||
|
||||
const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
const spinner = pdBox.find('.spinner-loading-progress');
|
||||
// const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
// const spinner = pdBox.find('.spinner-loading-progress');
|
||||
|
||||
const percentageText = pdBox.find('.percentageText');
|
||||
// const percentageText = pdBox.find('.percentageText');
|
||||
|
||||
spinner.show();
|
||||
activeUploads++;
|
||||
$('#createUploadingFiles').prop('disabled', true).addClass('disable');
|
||||
// spinner.show();
|
||||
// activeUploads++;
|
||||
// $('#createUploadingFiles').prop('disabled', true).addClass('disable');
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', saveUploadFileModalAjax, true);
|
||||
xhr.setRequestHeader('RequestVerificationToken', antiForgeryToken);
|
||||
// const xhr = new XMLHttpRequest();
|
||||
// xhr.open('POST', saveUploadFileModalAjax, true);
|
||||
// xhr.setRequestHeader('RequestVerificationToken', antiForgeryToken);
|
||||
|
||||
const uploadStartTime = new Date().getTime();
|
||||
let simulatedProgress = 0;
|
||||
let actualProgress = 0;
|
||||
let isUploadComplete = false;
|
||||
// const uploadStartTime = new Date().getTime();
|
||||
// let simulatedProgress = 0;
|
||||
// let actualProgress = 0;
|
||||
// let isUploadComplete = false;
|
||||
|
||||
// Simulate progress every 20ms, gradually increasing the bar until the actual progress is reached
|
||||
const progressInterval = setInterval(function () {
|
||||
if (simulatedProgress < actualProgress && !isUploadComplete) {
|
||||
simulatedProgress += 1; // Gradually increase simulated progress
|
||||
spinner.css('width', `${simulatedProgress}%`);
|
||||
percentageText.text(`${simulatedProgress}%`);
|
||||
}
|
||||
// // Simulate progress every 20ms, gradually increasing the bar until the actual progress is reached
|
||||
// const progressInterval = setInterval(function () {
|
||||
// if (simulatedProgress < actualProgress && !isUploadComplete) {
|
||||
// simulatedProgress += 1; // Gradually increase simulated progress
|
||||
// spinner.css('width', `${simulatedProgress}%`);
|
||||
// percentageText.text(`${simulatedProgress}%`);
|
||||
// }
|
||||
|
||||
if (simulatedProgress >= 100) {
|
||||
clearInterval(progressInterval); // Stop once the progress hits 100%
|
||||
}
|
||||
}, 30); // Increases by 1% every 20ms, making it smooth
|
||||
// if (simulatedProgress >= 100) {
|
||||
// clearInterval(progressInterval); // Stop once the progress hits 100%
|
||||
// }
|
||||
// }, 30); // Increases by 1% every 20ms, making it smooth
|
||||
|
||||
// Actual upload progress listener
|
||||
xhr.upload.addEventListener('progress', function (e) {
|
||||
if (e.lengthComputable) {
|
||||
actualProgress = Math.round((e.loaded / e.total) * 100);
|
||||
// // Actual upload progress listener
|
||||
// xhr.upload.addEventListener('progress', function (e) {
|
||||
// if (e.lengthComputable) {
|
||||
// actualProgress = Math.round((e.loaded / e.total) * 100);
|
||||
|
||||
// If the actual progress is slow, allow the simulated progress to match it naturally
|
||||
if (actualProgress >= simulatedProgress) {
|
||||
simulatedProgress = actualProgress;
|
||||
spinner.css('width', `${simulatedProgress}%`);
|
||||
percentageText.text(`${simulatedProgress}%`);
|
||||
}
|
||||
}
|
||||
});
|
||||
// // If the actual progress is slow, allow the simulated progress to match it naturally
|
||||
// if (actualProgress >= simulatedProgress) {
|
||||
// simulatedProgress = actualProgress;
|
||||
// spinner.css('width', `${simulatedProgress}%`);
|
||||
// percentageText.text(`${simulatedProgress}%`);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// On upload completion
|
||||
xhr.onload = function () {
|
||||
spinner.css('transition', 'all 2s ease-in');
|
||||
// // On upload completion
|
||||
// xhr.onload = function () {
|
||||
// spinner.css('transition', 'all 2s ease-in');
|
||||
// const uploadEndTime = new Date().getTime();
|
||||
// const timeDiff = uploadEndTime - uploadStartTime;
|
||||
// const minUploadTime = 2500; // Minimum of 2 seconds for the whole process
|
||||
|
||||
const uploadEndTime = new Date().getTime();
|
||||
const timeDiff = uploadEndTime - uploadStartTime;
|
||||
const minUploadTime = 2500; // Minimum of 2 seconds for the whole process
|
||||
// const response = JSON.parse(xhr.responseText);
|
||||
// isUploadComplete = true; // Mark the upload as complete
|
||||
// const delayTime = Math.max(minUploadTime - timeDiff, 0);
|
||||
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
isUploadComplete = true; // Mark the upload as complete
|
||||
// setTimeout(function () {
|
||||
// clearInterval(progressInterval); // Clear the interval when done
|
||||
// simulatedProgress = 100;
|
||||
// spinner.css('width', '100%');
|
||||
// percentageText.text('100%');
|
||||
|
||||
const delayTime = Math.max(minUploadTime - timeDiff, 0);
|
||||
// var id2 = $("#employeeIdForList").val();
|
||||
|
||||
setTimeout(function () {
|
||||
clearInterval(progressInterval); // Clear the interval when done
|
||||
simulatedProgress = 100;
|
||||
spinner.css('width', '100%');
|
||||
percentageText.text('100%');
|
||||
// if (xhr.status === 200 && response.isSuccedded) {
|
||||
// indexCount++;
|
||||
// const reader = new FileReader();
|
||||
// reader.onload = function (e) {
|
||||
|
||||
var id2 = $("#employeeIdForList").val();
|
||||
// uploadFileCount = uploadFileCount + 1;
|
||||
|
||||
if (xhr.status === 200 && response.isSuccedded) {
|
||||
indexCount++;
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (e) {
|
||||
// const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
// const img = pdBox.find('.preview-image');
|
||||
// img.attr('src', e.target.result);
|
||||
|
||||
uploadFileCount = uploadFileCount + 1;
|
||||
// //employeePicture = $('#EmployeePicture').attr('src');
|
||||
// //nationalCardFront = $('#NationalCardFront').attr('src');
|
||||
// //nationalCardRear = $('#NationalCardRear').attr('src');
|
||||
// //militaryServiceCard = $('#MilitaryServiceCard').attr('src');
|
||||
// //idCardPage1 = $('#IdCardPage1').attr('src');
|
||||
// //idCardPage2 = $('#IdCardPage2').attr('src');
|
||||
// //idCardPage3 = $('#IdCardPage3').attr('src');
|
||||
// //idCardPage4 = $('#IdCardPage4').attr('src');
|
||||
// //console.log(idCardPage2);
|
||||
|
||||
const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
const img = pdBox.find('.preview-image');
|
||||
img.attr('src', e.target.result);
|
||||
// // updatePreviewImage(indexId, id2, e.target.result);
|
||||
|
||||
//updatePreviewImage(indexId, id2, e.target.result);
|
||||
// };
|
||||
|
||||
// if (pdBox.hasClass("complete") || pdBox.hasClass("discomplete")) {
|
||||
|
||||
};
|
||||
if (pdBox.hasClass("complete") || pdBox.hasClass("discomplete")) {
|
||||
// pdBox.removeClass("discomplete complete");
|
||||
// pdBox.find(".sign").removeClass("discompleteSign completeSign");
|
||||
// pdBox.find(".sign").empty();
|
||||
// pdBox.find(".btnDeletingPD").removeClass("Rejected Confirmed");
|
||||
// pdBox.find("confirmedMessage ").remove();
|
||||
// pdBox.find(".resultMessage").empty();
|
||||
// }
|
||||
|
||||
pdBox.removeClass("discomplete complete");
|
||||
pdBox.find(".sign").removeClass("discompleteSign completeSign");
|
||||
pdBox.find(".sign").empty();
|
||||
pdBox.find(".btnDeletingPD").removeClass("Rejected Confirmed");
|
||||
pdBox.find("confirmedMessage ").remove();
|
||||
pdBox.find(".resultMessage").empty();
|
||||
}
|
||||
// pdBox.find('.btnDeletingPD').removeClass('disable').addClass("Unsubmitted");
|
||||
|
||||
pdBox.find('.btnDeletingPD').removeClass('disable').addClass("Unsubmitted");
|
||||
// reader.readAsDataURL(file);
|
||||
// } else {
|
||||
// showAlertMessage('.alert-msg', response.message || 'Error uploading file', 3500);
|
||||
// $('input[type="file"][data-index="' + indexId + '"]').val('');
|
||||
// }
|
||||
// spinner.css('width', '0%'); // Reset the progress bar
|
||||
// spinner.hide();
|
||||
// handleActiveUploads();
|
||||
// }, delayTime); // Ensure a minimum of 2 seconds for the full process
|
||||
// };
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
} else {
|
||||
showAlertMessage('.alert-msg', response.message || 'Error uploading file', 3500);
|
||||
$('input[type="file"][data-index="' + indexId + '"]').val('');
|
||||
}
|
||||
// // Handle upload error
|
||||
// xhr.onerror = function () {
|
||||
// clearInterval(progressInterval); // Stop progress on error
|
||||
// showAlertMessage('.alert-msg', 'مشکلی در آپلود فایل به وجود آمد.', 3500);
|
||||
// $('input[type="file"][data-index="' + indexId + '"]').val('');
|
||||
// spinner.css('width', '0%');
|
||||
// spinner.hide();
|
||||
// handleActiveUploads();
|
||||
// };
|
||||
|
||||
spinner.css('width', '0%'); // Reset the progress bar
|
||||
spinner.hide();
|
||||
handleActiveUploads();
|
||||
}, delayTime); // Ensure a minimum of 2 seconds for the full process
|
||||
};
|
||||
|
||||
// Handle upload error
|
||||
xhr.onerror = function () {
|
||||
clearInterval(progressInterval); // Stop progress on error
|
||||
showAlertMessage('.alert-msg', 'مشکلی در آپلود فایل به وجود آمد.', 3500);
|
||||
$('input[type="file"][data-index="' + indexId + '"]').val('');
|
||||
spinner.css('width', '0%');
|
||||
spinner.hide();
|
||||
handleActiveUploads();
|
||||
};
|
||||
|
||||
xhr.send(formData);
|
||||
}
|
||||
// xhr.send(formData);
|
||||
//}
|
||||
|
||||
function handleActiveUploads() {
|
||||
activeUploads--;
|
||||
@@ -386,17 +626,19 @@ function removeEmployeeDocumentByLabel(indexId, employeeId) {
|
||||
$.ajax({
|
||||
url: deleteFileAjaxUrl,
|
||||
method: 'POST',
|
||||
data: { label: label, employeeId: employeeId},
|
||||
data: { label: label, employeeId: employeeId, workshopId: workshopId },
|
||||
headers: { 'RequestVerificationToken': antiForgeryToken },
|
||||
success: function (response) {
|
||||
if (response.isSuccedded) {
|
||||
uploadFileCount = uploadFileCount - 1;
|
||||
|
||||
showAlertMessage('.alert-success-msg', 'تصویر موجود با موفقیت حذف شد.', 3500);
|
||||
$(`#label_${indexId}`).val('');
|
||||
/* $(`#label_${indexId}`).val('');*/
|
||||
pdBox.find('.btnDeletingPD').removeClass("Unsubmitted");
|
||||
pdBox.find('.uploaderSign').hide();
|
||||
updatePreviewImage(Number(indexId), Number(employeeId), "/assetsclient/images/pd-image.png");
|
||||
|
||||
|
||||
} else {
|
||||
showAlertMessage('.alert-success-msg', response.message, 3500);
|
||||
}
|
||||
@@ -409,48 +651,58 @@ function removeEmployeeDocumentByLabel(indexId, employeeId) {
|
||||
|
||||
function updatePreviewImage(indexId, id2, result) {
|
||||
switch (indexId) {
|
||||
case 0:
|
||||
$(`#employeePicture_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 1:
|
||||
$(`#nationalCardFront_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 2:
|
||||
$(`#nationalCardRear_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 3:
|
||||
$(`#militaryServiceCard_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 4:
|
||||
$(`#idCardPage1_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 5:
|
||||
$(`#idCardPage2_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 6:
|
||||
$(`#idCardPage3_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 7:
|
||||
$(`#idCardPage4_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
default:
|
||||
console.warn('Unexpected indexId:', indexId);
|
||||
case 0:
|
||||
$(`#employeePicture_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 1:
|
||||
$(`#nationalCardFront_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 2:
|
||||
$(`#nationalCardRear_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 3:
|
||||
$(`#militaryServiceCard_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 4:
|
||||
$(`#idCardPage1_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 5:
|
||||
$(`#idCardPage2_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 6:
|
||||
$(`#idCardPage3_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 7:
|
||||
$(`#idCardPage4_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
default:
|
||||
console.warn('Unexpected indexId:', indexId);
|
||||
}
|
||||
}
|
||||
|
||||
function saveSubmit(id) {
|
||||
var loading = $(".spinner-loading");
|
||||
|
||||
|
||||
loading.show();
|
||||
|
||||
var data = {
|
||||
'cmd.EmployeeDocumentsId': id
|
||||
}
|
||||
//var data = {
|
||||
// 'cmd.EmployeeDocumentsId': id
|
||||
//}
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('employeeId', employeeId);
|
||||
|
||||
command.forEach((item, index) => {
|
||||
formData.append(`command[${index}].Label`, item.Label);
|
||||
formData.append(`command[${index}].PictureFile`, item.PictureFile);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: saveSubmitAjax,
|
||||
url: saveGroupSubmitAjax,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: { 'RequestVerificationToken': antiForgeryToken },
|
||||
success: function (response) {
|
||||
loading.hide();
|
||||
@@ -476,21 +728,15 @@ function saveSubmit(id) {
|
||||
showAlertMessage('.alert-msg', 'مشکلی در ارسال تصویر به وجود آمد.', 3500);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function cancelOP() {
|
||||
|
||||
|
||||
var data = {
|
||||
'cmd.EmployeeDocumentsId': id
|
||||
}
|
||||
$.ajax({
|
||||
url: saveSubmitAjax,
|
||||
method: 'POST',
|
||||
data: {employeeId:employeeId,},
|
||||
data: { employeeId: employeeId, },
|
||||
headers: { 'RequestVerificationToken': antiForgeryToken },
|
||||
success: function (response) {
|
||||
loading.hide();
|
||||
@@ -510,4 +756,4 @@ function cancelOP() {
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,635 @@
|
||||
#navbar-animmenu {
|
||||
width: 20%;
|
||||
padding: 0 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#navbar-animmenu ul {
|
||||
background: #CAF5F5;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
height: 700px;
|
||||
}
|
||||
|
||||
#navbar-animmenu ul li a i {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#navbar-animmenu ul li span {
|
||||
background-color: #dd2a2a;
|
||||
width: 26px;
|
||||
display: flex;
|
||||
height: 26px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 24px;
|
||||
margin: 0 0 0 12px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
#navbar-animmenu li {
|
||||
list-style-type: none;
|
||||
z-index: 4;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#navbar-animmenu ul li a {
|
||||
color: #484848;
|
||||
text-decoration: none;
|
||||
font-size: 15px;
|
||||
line-height: 60px;
|
||||
display: block;
|
||||
padding: 0px 30px 0 20px;
|
||||
transition-duration: 0.6s;
|
||||
transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#navbar-animmenu > ul > li.active > a {
|
||||
color: #000000;
|
||||
background-color: transparent;
|
||||
transition: all 0.7s;
|
||||
}
|
||||
|
||||
.countNumber {
|
||||
margin: 0 0 0 12px;
|
||||
font-size: 12px;
|
||||
background-color: #dd2a2a;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 40px;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
padding: 2px 0 0 0;
|
||||
}
|
||||
|
||||
/* Vertical selector styling */
|
||||
.verti-selector {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
width: 97%;
|
||||
left: 0px;
|
||||
transition-duration: 0.6s;
|
||||
transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
||||
background-color: #fff;
|
||||
border-radius: 0 50px 50px 0;
|
||||
/* border-top-right-radius: 15px;
|
||||
border-bottom-right-radius: 15px;*/
|
||||
height: 45px;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.verti-selector .top,
|
||||
.verti-selector .bottom {
|
||||
position: absolute;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.verti-selector .top {
|
||||
bottom: -25px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.verti-selector .bottom {
|
||||
top: -25px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.verti-selector .top:before,
|
||||
.verti-selector .bottom:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
background-color: #CAF5F5;
|
||||
}
|
||||
|
||||
.verti-selector .top.last-role::before {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.verti-selector .top:before {
|
||||
top: 0;
|
||||
right: -25px;
|
||||
}
|
||||
|
||||
.verti-selector .bottom:before {
|
||||
bottom: 0;
|
||||
right: -25px;
|
||||
}
|
||||
|
||||
#accountList {
|
||||
width: 80%;
|
||||
background-color: #ffffff;
|
||||
height: 700px;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.createRoleBox {
|
||||
width: 100%;
|
||||
background-color: #ffffff;
|
||||
z-index: 6;
|
||||
display: block !important;
|
||||
position: relative;
|
||||
padding: 11px 6px;
|
||||
border-bottom: 2px solid transparent;
|
||||
border-image: linear-gradient(to left, #B1B1B1, #FFFFFF);
|
||||
border-image-slice: 1;
|
||||
}
|
||||
|
||||
.sweet-alert button {
|
||||
font-family: 'IRANYekanX';
|
||||
}
|
||||
|
||||
.btn-create {
|
||||
background: #84CC16;
|
||||
border-radius: 7px;
|
||||
padding: 4px 10px;
|
||||
font-size: 13px;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.btn-create:hover {
|
||||
background: #71b112;
|
||||
}
|
||||
|
||||
#hideCircle {
|
||||
transition: border-radius 0.5s ease;
|
||||
height: 80px;
|
||||
background-color: #f5f5f5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.isActiveTxt {
|
||||
background-color: #ECFCCB;
|
||||
border: 1px solid #B3EB52;
|
||||
border-radius: 50px;
|
||||
padding: 3px 9px;
|
||||
color: #0B5959;
|
||||
font-size: 11px;
|
||||
width: 70px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-edit-role {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #009EE2;
|
||||
margin: auto 0 auto 1px;
|
||||
/* background-color: #ffffff; */
|
||||
background-color: rgba(52, 209, 209, 0.20);
|
||||
box-shadow: 0;
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-edit-role:hover {
|
||||
color: #ffffff;
|
||||
/* background-color: #009EE2; */
|
||||
background-color: rgba(52, 209, 209, 0.40);
|
||||
}
|
||||
|
||||
.btn-delete-role {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #FF5151;
|
||||
margin: auto 1px auto 0;
|
||||
background: rgba(209, 50, 50, 0.15);
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-delete-role:hover {
|
||||
background-color: rgba(209, 50, 50, 0.25);
|
||||
}
|
||||
|
||||
.btn-info {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #009EE2;
|
||||
margin: auto 0 auto 1px;
|
||||
/* background-color: #ffffff; */
|
||||
background-color: #B4DBFD;
|
||||
box-shadow: 0;
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-info:hover {
|
||||
background-color: #a2c8e9
|
||||
}
|
||||
|
||||
.btn-info svg {
|
||||
color: #3B82F6;
|
||||
}
|
||||
|
||||
.close-btn-search {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 4px;
|
||||
transform: translateY(-50%);
|
||||
color: #fff;
|
||||
background-color: #f87171;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.Rtable--collapse .Rtable-row {
|
||||
flex-wrap: nowrap;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.Rtable--collapse .Rtable-row.SubAccountRowMobile {
|
||||
flex-wrap: nowrap;
|
||||
padding: 1px;
|
||||
outline: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.roleTitle {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.roleName {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
/********************************** Sub Account Table **********************************/
|
||||
.rightHeaderMenu {
|
||||
width: 20%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.leftHeaderMenu {
|
||||
width: 80%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.subAccountHeaderList {
|
||||
}
|
||||
|
||||
|
||||
.roleSubaccountListMobile .width1 {
|
||||
width: 10% !important;
|
||||
}
|
||||
|
||||
.roleSubaccountListMobile .width2 {
|
||||
width: 10% !important;
|
||||
}
|
||||
|
||||
.roleSubaccountListMobile .width3 {
|
||||
width: 10% !important;
|
||||
}
|
||||
|
||||
.roleSubaccountListMobile .width4 {
|
||||
width: 20% !important;
|
||||
}
|
||||
|
||||
.roleSubaccountListMobile .width5 {
|
||||
width: 20% !important;
|
||||
}
|
||||
|
||||
.roleSubaccountListMobile .width6 {
|
||||
width: 20% !important;
|
||||
}
|
||||
|
||||
.roleSubaccountListMobile .width7 {
|
||||
width: 10% !important;
|
||||
}
|
||||
|
||||
.bgSubRow {
|
||||
outline: transparent !important;
|
||||
background-color: #CEF4F4 !important;
|
||||
}
|
||||
/********************************** Sub Account Table **********************************/
|
||||
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
/* Hide default HTML checkbox */
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* The slider */
|
||||
.sliderEUP {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
transition: 0.4s;
|
||||
border-radius: 24px;
|
||||
}
|
||||
|
||||
/* Rounded slider */
|
||||
.sliderEUP:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
left: 2px;
|
||||
bottom: 2px;
|
||||
background-color: white;
|
||||
transition: 0.4s;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/* Checked state */
|
||||
input:checked + .sliderEUP {
|
||||
background-color: #2FBFBF;
|
||||
}
|
||||
|
||||
/* Move the slider to the right when checked */
|
||||
input:checked + .sliderEUP:before {
|
||||
transform: translateX(16px);
|
||||
}
|
||||
|
||||
/* Disable state */
|
||||
.disable + .sliderEUP {
|
||||
background-color: #ccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.disable + .sliderEUP:before {
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.leftHeaderMenu .Rtable-cell.width1 {
|
||||
width: 7%
|
||||
}
|
||||
|
||||
.leftHeaderMenu .Rtable-cell.width2 {
|
||||
width: 13%
|
||||
}
|
||||
|
||||
.leftHeaderMenu .Rtable-cell.width3 {
|
||||
width: 10%
|
||||
}
|
||||
|
||||
.leftHeaderMenu .Rtable-cell.width4 {
|
||||
width: 20%
|
||||
}
|
||||
|
||||
.leftHeaderMenu .Rtable-cell.width5 {
|
||||
width: 20%
|
||||
}
|
||||
|
||||
.leftHeaderMenu .Rtable-cell.width6 {
|
||||
width: 20%
|
||||
}
|
||||
|
||||
.leftHeaderMenu .Rtable-cell.width7 {
|
||||
width: 10%
|
||||
}
|
||||
|
||||
.Rtable .workflow-list .width1 {
|
||||
width: 7%
|
||||
}
|
||||
|
||||
.Rtable .workflow-list .width2 {
|
||||
width: 13%
|
||||
}
|
||||
|
||||
.Rtable .workflow-list .width3 {
|
||||
width: 10%
|
||||
}
|
||||
|
||||
.Rtable .workflow-list .width4 {
|
||||
width: 20%
|
||||
}
|
||||
|
||||
.Rtable .workflow-list .width5 {
|
||||
width: 20%
|
||||
}
|
||||
|
||||
.Rtable .workflow-list .width6 {
|
||||
width: 20%
|
||||
}
|
||||
|
||||
.Rtable .workflow-list .width7 {
|
||||
width: 10%
|
||||
}
|
||||
|
||||
.btn-workflow-absent {
|
||||
border: 1px solid transparent;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #FF5151;
|
||||
margin: auto 1px auto 0;
|
||||
background-color: #ffffff;
|
||||
background: rgba(209, 50, 50, 0.15);
|
||||
transition: ease .2s;
|
||||
width: 55px;
|
||||
}
|
||||
|
||||
.btn-workflow-rollcall-edit {
|
||||
border: 1px solid transparent;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #009EE2;
|
||||
margin: auto 0 auto 1px;
|
||||
background-color: #ffffff;
|
||||
background-color: rgba(52, 209, 209, 0.20);
|
||||
transition: ease .2s;
|
||||
width: 55px;
|
||||
}
|
||||
|
||||
.btn-workflow-leave {
|
||||
border: 1px solid transparent;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #d97706;
|
||||
margin: auto 1px auto 0;
|
||||
background-color: #ffffff;
|
||||
background: rgba(217, 119, 6, 0.18);
|
||||
transition: ease .2s;
|
||||
width: 55px;
|
||||
}
|
||||
|
||||
.btn-workflow-accept {
|
||||
border: 1px solid transparent;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #65a30d;
|
||||
margin: auto 1px auto 0;
|
||||
background-color: #ffffff;
|
||||
background: rgba(101, 163, 13, 0.15);
|
||||
transition: ease .2s;
|
||||
width: 55px;
|
||||
}
|
||||
|
||||
.operations-btns-main {
|
||||
padding: 15px;
|
||||
width: 97%;
|
||||
margin: 0 auto 10px;
|
||||
display: none;
|
||||
border-radius: 0px 0px 8px 8px;
|
||||
background: #F1F5F9;
|
||||
box-shadow: 0px 4px 5px 0px rgba(0, 0, 0, 0.03) inset;
|
||||
}
|
||||
|
||||
.number-of-count {
|
||||
background-color: #caf5f5;
|
||||
margin: 0 10px 0 0;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
padding: 0 5px;
|
||||
color: #368686;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.toggle {
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.toggle svg {
|
||||
stroke: #ffffff;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.toggle.open svg {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
@media (max-width: 1366px) {
|
||||
#navbar-animmenu ul li a {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#accountList {
|
||||
height: 440px;
|
||||
}
|
||||
|
||||
#navbar-animmenu ul {
|
||||
height: 440px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.Rtable--collapse .Rtable-row {
|
||||
outline: 1.8px solid #ddd !important;
|
||||
}
|
||||
|
||||
.Rtable .workflow-list .width1 {
|
||||
width: 5% !important;
|
||||
}
|
||||
|
||||
.Rtable .workflow-list .width2 {
|
||||
width: 50% !important;
|
||||
}
|
||||
|
||||
.Rtable .workflow-list .width4 {
|
||||
width: 20% !important;
|
||||
}
|
||||
|
||||
.Rtable--collapse .Rtable-row .Rtable-cell .Rtable-cell--content {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.btn-workflow-accept,
|
||||
.btn-workflow-leave,
|
||||
.btn-workflow-absent,
|
||||
.btn-workflow-rollcall-edit {
|
||||
width: 100%;
|
||||
margin: 1px 0;
|
||||
}
|
||||
|
||||
.employee-name {
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* responsive Mobile */
|
||||
#navbar-animmenu {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#navbar-animmenu ul {
|
||||
display: flex;
|
||||
height: auto;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.verti-selector {
|
||||
display: none
|
||||
}
|
||||
|
||||
#navbar-animmenu li.active {
|
||||
background-color: #fff;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#accountList {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.preview-image {
|
||||
width: 50px;
|
||||
height: 35px;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.txtMonilePD {
|
||||
display: none
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
var ajaxService = new AjaxService(antiForgeryToken);
|
||||
|
||||
var lengthMenu = 0;
|
||||
var loadFunctionClientRejectedDocument = true;
|
||||
|
||||
loadMenuAnime();
|
||||
$(document).ready(function () {
|
||||
//CountWorkFlowOfAbsentAndCut();
|
||||
loadClientRejectedDocument();
|
||||
|
||||
$("#clickAbsentTab").click(function () {
|
||||
//$('.rejectedDocumentWorkFlowLists').fadeOut(200, function () {
|
||||
// $('.rejectedDocumentWorkFlowLists').fadeIn(200);
|
||||
//});
|
||||
if (loadFunctionClientRejectedDocument) {
|
||||
loadWorkFlowsAbsentsList();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function loadMenuAnime() {
|
||||
var tabsNewAnim = $('#navbar-animmenu');
|
||||
var selectorNewAnim = $('#navbar-animmenu').find('li').length;
|
||||
var activeItemNewAnim = tabsNewAnim.find('.active');
|
||||
var activeHeightNewAnimHeight = activeItemNewAnim.innerHeight();
|
||||
var itemPosNewAnimTop = activeItemNewAnim.position();
|
||||
$(".verti-selector").css({
|
||||
"top": itemPosNewAnimTop.top + "px",
|
||||
"height": activeHeightNewAnimHeight + "px"
|
||||
});
|
||||
|
||||
$('.active').each(function () {
|
||||
var targetForm = $(this).data('target');
|
||||
$('#' + targetForm).show();
|
||||
});
|
||||
|
||||
if (lengthMenu === 1) {
|
||||
if ($('.main-navbar li').hasClass('lastRole')) {
|
||||
$('.verti-selector .top').addClass('last-role');
|
||||
$('#hideCircle').css('border-radius', '25px 0 0 0');
|
||||
} else {
|
||||
$('.verti-selector .top').removeClass('last-role');
|
||||
$('#hideCircle').css('border-radius', '0 0 0 0');
|
||||
}
|
||||
}
|
||||
|
||||
$("#navbar-animmenu").on("click", "li", function (e) {
|
||||
if ($(this).hasClass('lastRole')) {
|
||||
//$('.verti-selector .top').addClass('last-role');
|
||||
$('#hideCircle').css('border-radius', '25px 0 0 0');
|
||||
} else {
|
||||
//$('.verti-selector .top').removeClass('last-role');
|
||||
$('#hideCircle').css('border-radius', '0 0 0 0');
|
||||
}
|
||||
|
||||
$('#navbar-animmenu ul li').removeClass("active");
|
||||
$(this).addClass('active');
|
||||
|
||||
var activeHeightNewAnimHeight = $(this).innerHeight();
|
||||
var itemPosNewAnimTop = $(this).position();
|
||||
$(".verti-selector").css({
|
||||
"top": itemPosNewAnimTop.top + "px",
|
||||
"height": activeHeightNewAnimHeight + "px"
|
||||
});
|
||||
|
||||
$('.form-section').hide();
|
||||
$('.accountListHead').text($(this).find('a').text());
|
||||
var targetForm = $(this).data('target');
|
||||
$('#' + targetForm).show();
|
||||
});
|
||||
|
||||
//$("#navbar-animmenu").on("click", "li", function (e) {
|
||||
// var targetForm = $(this).data('target');
|
||||
// $('#navbar-animmenu ul li').removeClass("active");
|
||||
// $(this).addClass('active');
|
||||
|
||||
// var activeHeightNewAnimHeight = $(this).innerHeight();
|
||||
// var itemPosNewAnimTop = $(this).position();
|
||||
|
||||
// $(".verti-selector").stop(true, true).animate({
|
||||
// "top": itemPosNewAnimTop.top + "px",
|
||||
// "height": activeHeightNewAnimHeight + "px"
|
||||
// }, 300); // انیمیشن با مدت زمان 300 میلیثانیه
|
||||
|
||||
// $('.form-section').fadeOut(200);
|
||||
// $('#' + targetForm).fadeIn(300); // انیمیشن تغییر صفحه
|
||||
//});
|
||||
}
|
||||
|
||||
$(document).on('click', ".openActionMain", function () {
|
||||
$('.toggle').not($(this).find('.toggle')).removeClass('open');
|
||||
|
||||
$(this).next().find(".operations-btns-main").slideToggle(500);
|
||||
$(".operations-btns-main").not($(this).next().find(".operations-btns-main")).slideUp(500);
|
||||
|
||||
$(this).find('.toggle').toggleClass('open');
|
||||
});
|
||||
|
||||
$(document).on('click', ".openAction", function () {
|
||||
if (window.matchMedia('(max-width: 768px)').matches) {
|
||||
$(this).next().find(".operations-btns").slideToggle(500);
|
||||
$(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500);
|
||||
}
|
||||
});
|
||||
|
||||
function loadClientRejectedDocument() {
|
||||
var html = ``;
|
||||
ajaxService.get(clientRejectedDocumentForClientUrl)
|
||||
.then(response => {
|
||||
|
||||
var data = response.data;
|
||||
|
||||
if (response.success) {
|
||||
CountWorkFlowOfTabs(data.length);
|
||||
if (data.length > 0) {
|
||||
|
||||
data.forEach(function (item, i) {
|
||||
html += `<div></div>
|
||||
<div class="Rtable-row align-items-center position-relative workflow-list employee-row" data-employee-id="${item.employeeId}">
|
||||
<div class="Rtable-cell width1">
|
||||
<div class="Rtable-cell--heading d-none">
|
||||
ردیف
|
||||
</div>
|
||||
<div class="Rtable-cell--content">
|
||||
<span class="d-flex justify-content-center align-items-center justify-content-center table-number">
|
||||
${i + 1}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width2">
|
||||
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
|
||||
<div class="Rtable-cell--content employee-name">
|
||||
${item.employeeFullName}
|
||||
<p class="m-0 mt-2 d-block d-md-none"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width3 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center ms-1">
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.employeePicture.picturePath) {
|
||||
html += `<img id="employeePicture_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.employeePicture.picturePath ? item.employeePicture.picturePath : "")}" class="preview-image">`;
|
||||
} else {
|
||||
html += `<img id="employeePicture_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/ >`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">عکس پرسنلی</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width4 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center gap-1 ms-1">
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.nationalCardFront.picturePath) {
|
||||
html += `<img id="nationalCardFront_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardFront.picturePath ? item.nationalCardFront.picturePath : "")}" class="preview-image">`;
|
||||
} else {
|
||||
html += `<img id="nationalCardFront_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">کارت ملی رو</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.nationalCardRear.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="nationalCardRear_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.nationalCardRear.picturePath ? item.nationalCardRear.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="nationalCardRear_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">کارت ملی پشت</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width5 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-flex justify-content-center ms-1">
|
||||
|
||||
<div>
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.militaryServiceCard.picturePath) {
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.militaryServiceCard.picturePath ? item.militaryServiceCard.picturePath : "")}" class="preview-image">`;
|
||||
} else {
|
||||
html += `<img id="militaryServiceCard_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">کارت پایان خدمت</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="Rtable-cell width6 d-none d-md-block">
|
||||
<div class="Rtable-cell--content text-center">
|
||||
<div class="d-md-none d-none">پیغام: </div>
|
||||
<div class="d-flex justify-content-center gap-1 ms-1">
|
||||
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage1.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage1_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage1.picturePath ? item.idCardPage1.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage1_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه اول</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage2.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage2_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage2.picturePath ? item.idCardPage2.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage2_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه دوم</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage3.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage3_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage3.picturePath ? item.idCardPage3.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage3_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه سوم</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="d-flex align-items-center justify-content-start">
|
||||
<div class="documentFileBox">`;
|
||||
if (item.idCardPage4.picturePath) {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage4_${item.employeeId}" src="${showPictureUrl + `&filePath=` + (item.idCardPage4.picturePath ? item.idCardPage4.picturePath : "")}" class="preview-image"></div>`;
|
||||
} else {
|
||||
html += `<div class="documentFileBox"><img id="idCardPage4_${item.employeeId}" src="/assetsclient/images/pd-image.png" class="preview-image"/></div>`;
|
||||
}
|
||||
html += `</div>
|
||||
<div class="txtMonilePD">شناسنامه صفحه چهارم</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="Rtable-cell position-relative width7 bg-filter d-flex justify-content-end">
|
||||
<div class="Rtable-cell--content text-center d-block d-md-flex align-items-center gap-1 h-100">
|
||||
|
||||
<button class="btn-workflow-rollcall-edit position-relative" onclick="showModalEmployeeDocuments(${item.employeeId})">
|
||||
<span class="mx-1">عملیات</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
});
|
||||
|
||||
} else {
|
||||
html += `<div class="container-fluid">
|
||||
<div class="row p-lg-2 p-auto">
|
||||
<div class="text-center bg-white d-flex align-items-center justify-content-center w-100">
|
||||
<div class="">
|
||||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
|
||||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
$(`#loadRejectedDocumentWorkFlow`).html(html);
|
||||
$(`#loadingSkeletonRejectedDocument`).hide();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
var countGlobal = 0;
|
||||
function CountWorkFlowOfTabs(dataCount) {
|
||||
countGlobal = dataCount;
|
||||
$('.spinner-grow').hide();
|
||||
|
||||
if (countGlobal === 0) {
|
||||
$('#CountRejectedDocument').hide();
|
||||
} else {
|
||||
$('#CountRejectedDocument').show();
|
||||
$('#CountRejectedDocument').text(dataCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showModalLeave(employeeId, dateFa, employeeName) {
|
||||
var goTo = `#showmodal=/Client/Company/WorkFlow/RollCall?handler=LeaveCreate&Command.StartLeave=${dateFa}&Command.EmployeeId=${employeeId}&Command.EmployeeFullName=${employeeName}`;
|
||||
window.location.href = goTo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function updateIndexesWorkFlow(dateDiv) {
|
||||
let index = 1;
|
||||
|
||||
$(`#${dateDiv} .employee-row:visible .table-number`).each(function () {
|
||||
$(this).text(index++);
|
||||
});
|
||||
}
|
||||
|
||||
function updateMainWorkFlow(dateDiv) {
|
||||
let indexMain = 1;
|
||||
|
||||
$(`#${dateDiv} .number-of-count`).each(function () {
|
||||
var text = Number($(this).text());
|
||||
$(this).text(text - 1);
|
||||
|
||||
if (text - 1 === 0) {
|
||||
$(`#${dateDiv}`).next().remove();
|
||||
$(`#${dateDiv}`).remove();
|
||||
|
||||
$(`.Rtable-cell.width1 .Rtable-cell--content span`).each(function () {
|
||||
$(this).text(indexMain++);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showModalEmployeeDocuments(id) {
|
||||
var goTo = `#showmodal=/Client/Company/WorkFlow/EmployeeDocuments/Index?employeeId=${id}&handler=CreateUploadDocument`;
|
||||
window.location.href = goTo;
|
||||
}
|
||||
|
||||
function checkImage() {
|
||||
$('.documentFileBox').each(function () {
|
||||
if ($(this).find('img.uploaded').length > 0) {
|
||||
// Add the highlighted-border class to the documentFileBox
|
||||
$(this).addClass('highlighted-border');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,775 @@
|
||||
var employeePicture;
|
||||
var nationalCardFront;
|
||||
var nationalCardRear;
|
||||
var militaryServiceCard;
|
||||
var idCardPage1;
|
||||
var idCardPage2;
|
||||
var idCardPage3;
|
||||
var idCardPage4;
|
||||
var uploadFileCount = UploadedCount;
|
||||
var command = [];
|
||||
|
||||
var pendingMessage = `<div class="pendingMessage">بررسی</div>`;
|
||||
var pendingIcon = `<svg width="24" height="24" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11 19.25C15.5563 19.25 19.25 15.5563 19.25 11C19.25 6.44365 15.5563 2.75 11 2.75C6.44365 2.75 2.75 6.44365 2.75 11C2.75 15.5563 6.44365 19.25 11 19.25Z" fill="#FDBA74"/><path d="M11.4168 14.6667C11.4168 14.8968 11.2303 15.0833 11.0002 15.0833C10.77 15.0833 10.5835 14.8968 10.5835 14.6667C10.5835 14.4365 10.77 14.25 11.0002 14.25C11.2303 14.25 11.4168 14.4365 11.4168 14.6667Z" fill="white" stroke="white"/><path d="M11 11.916V6.41602V11.916Z" fill="white"/><path d="M11 11.916V6.41602" stroke="white" stroke-width="1.5" stroke-linecap="round"/></svg>`;
|
||||
var confirmMessage = `<div class="confirmedMessage">تایید</div>`;
|
||||
var confirmIcon = `<svg width="24" height="24" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="7" cy="7" r="5.25" fill="#00C04D"/><path d="M4.66659 7L6.41659 8.75L9.33325 5.25" stroke="white" stroke-linecap="round"/></svg>`;
|
||||
var rejectMessage = `<div class="rejectMessage">رد شده</div>`;
|
||||
var rejectIcon = `<svg width="24" height="24" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="7" cy="7" r="5.25" fill="#FF5D5D"/><path d="M9.33341 4.66602L4.66675 9.33268" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4.66659 4.66602L9.33325 9.33268" stroke="white" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
|
||||
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
var employeeId = $("#employeeIdForList").val();
|
||||
|
||||
//$('.btnDeletingPD').each(function () {
|
||||
// if ($(this).hasClass('Unsubmitted')) { // Remove the extra class selector '.btnDeletingPD'
|
||||
// $(this).closest('.pdBox').addClass('justUploaded'); // Add 'justUploaded' to the closest parent .pdBox
|
||||
// }
|
||||
//});
|
||||
|
||||
|
||||
$(".btnDeletingPD ").each(function () {
|
||||
if ($(this).hasClass("SubmittedByAdmin") || $(this).hasClass("Rejected") || $(this).hasClass("Confirmed")) {
|
||||
$(this).addClass("disable");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
$(document).off('click', '.btnUploadingPD').on('click', '.btnUploadingPD', function (event) {
|
||||
event.preventDefault();
|
||||
const index = $(this).data('index');
|
||||
$('input[type="file"][data-index="' + index + '"]').click();
|
||||
});
|
||||
|
||||
$('.pdBox').each(function () {
|
||||
if ($(".isTrue").hasClass("isTrue") && $(".Unsubmitted").hasClass("Unsubmitted") || $(".SubmittedByClient").hasClass("SubmittedByClient")) {
|
||||
$(".btnCreateNew").prop("disabled", false);
|
||||
$(".btnCreateNew ").removeClass("disable");
|
||||
} else {
|
||||
$(".btnCreateNew ").addClass("disable");
|
||||
}
|
||||
});
|
||||
|
||||
$('.pdBox').each(function () {
|
||||
// Check if there's a button with the 'submitted' class inside the pdBox
|
||||
if ($(this).find('button.SubmittedByAdmin').length > 0) {
|
||||
$(this).addClass('pending');
|
||||
$(this).find(".pdImageBox .sign").addClass("pendingSign").html(pendingIcon);
|
||||
$(this).find(".btnUploadingPD").addClass("disable");
|
||||
$(this).find(".resultMessage").html(pendingMessage);
|
||||
}
|
||||
if ($(this).find('button.Confirmed').length > 0) {
|
||||
$(this).addClass('complete');
|
||||
$(this).find(".pdImageBox .sign").addClass("completeSign").html(confirmIcon);
|
||||
$(this).find(".resultMessage").html(confirmMessage);
|
||||
}
|
||||
if ($(this).find('button.Rejected').length > 0) {
|
||||
$(this).addClass('discomplete');
|
||||
$(this).find(".pdImageBox .sign").addClass("discompleteSign").html(rejectIcon);
|
||||
$(this).find(".resultMessage").html(rejectMessage);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).off('change', '.file-input').on('change', '.file-input', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
const fileInputFile = this.files[0];
|
||||
const indexFileValue = $(this).data('index');
|
||||
const validExtensions = ['jpg', 'jpeg', 'png'];
|
||||
const validPdfExtensions = ['pdf'];
|
||||
|
||||
const label = $(`#label_${indexFileValue}`).val();
|
||||
const pdBox = $(this).closest('.pdBox');
|
||||
const img = pdBox.find('.preview-image');
|
||||
var deleteButton = pdBox.find('.btnDeletingPD');
|
||||
|
||||
if (fileInputFile) {
|
||||
const fileName = fileInputFile.name.toLowerCase();
|
||||
const extension = fileName.split('.').pop();
|
||||
|
||||
// بررسی فرمتهای تصویر (jpeg, jpg, png)
|
||||
if (validExtensions.includes(extension)) {
|
||||
if (fileInputFile.size > 5000000) {
|
||||
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را آپلود کنید.', 3500);
|
||||
$(this).val('');
|
||||
return;
|
||||
}
|
||||
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (event) {
|
||||
img.attr('src', event.target.result);
|
||||
|
||||
const base64String = event.target.result.split(',')[1];
|
||||
const byteCharacters = atob(base64String);
|
||||
const byteNumbers = new Array(byteCharacters.length);
|
||||
for (let i = 0; i < byteCharacters.length; i++) {
|
||||
byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
}
|
||||
const byteArray = new Uint8Array(byteNumbers);
|
||||
const blob = new Blob([byteArray], { type: fileInputFile.type });
|
||||
const newFile = new File([blob], fileInputFile.name, { type: fileInputFile.type });
|
||||
|
||||
let existingIndex = command.findIndex(item => item.Label === label);
|
||||
if (existingIndex !== -1) {
|
||||
command[existingIndex].PictureFile = newFile;
|
||||
} else {
|
||||
let picturesPart = {
|
||||
Label: label,
|
||||
PictureFile: newFile
|
||||
};
|
||||
command.push(picturesPart);
|
||||
}
|
||||
};
|
||||
|
||||
reader.readAsDataURL(fileInputFile);
|
||||
$('#createUploadingFiles').prop('disabled', false).removeClass('disable');
|
||||
|
||||
pdBox.removeClass();
|
||||
pdBox.addClass('pdBox');
|
||||
|
||||
showLoadingAnimation(indexFileValue);
|
||||
}
|
||||
else if (validPdfExtensions.includes(extension)) {
|
||||
var fileReader = new FileReader();
|
||||
|
||||
fileReader.onload = function () {
|
||||
var typedarray = new Uint8Array(this.result);
|
||||
pdfjsLib.getDocument(typedarray).promise.then(function (pdf) {
|
||||
totalPageCount = pdf.numPages;
|
||||
|
||||
if (totalPageCount > 1) {
|
||||
showAlertMessage('.alert-msg', 'آپلود مجاز نیست! تعداد صفحات نباید بیشتر از ۱ باشد.', 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
pdf.getPage(1).then(function (page) {
|
||||
var scale = 2.0;
|
||||
var viewport = page.getViewport({ scale: scale });
|
||||
|
||||
var canvas = document.createElement("canvas");
|
||||
canvas.className = "page";
|
||||
canvas.title = "Page 1";
|
||||
canvas.height = viewport.height;
|
||||
canvas.width = viewport.width;
|
||||
|
||||
var context = canvas.getContext("2d");
|
||||
|
||||
page.render({
|
||||
canvasContext: context,
|
||||
viewport: viewport
|
||||
}).promise.then(function () {
|
||||
pdBox.removeClass();
|
||||
pdBox.addClass('pdBox');
|
||||
uploadCanvasAsFile(canvas, `${label}_${indexFileValue}.jpg`, indexFileValue, label);
|
||||
}).catch(function (error) {
|
||||
showAlertMessage('.alert-msg', 'مشکلی در پردازش PDF رخ داده است!', 3500);
|
||||
});
|
||||
}).catch(function (error) {
|
||||
showAlertMessage('.alert-msg', 'خطا در دریافت صفحه PDF!', 3500);
|
||||
});
|
||||
|
||||
}).catch(function (error) {
|
||||
showAlertMessage('.alert-msg', 'خطا در بارگذاری فایل PDF!', 3500);
|
||||
});
|
||||
};
|
||||
|
||||
fileReader.readAsArrayBuffer(fileInputFile);
|
||||
|
||||
}
|
||||
else {
|
||||
showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg, png یا pdf باشد.', 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
deleteButton.removeClass('disable');
|
||||
if (pdBox.find('button.Rejected').length > 0) {
|
||||
pdBox.find(".btnSendToChecker").removeClass("disable");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//$(document).off('change', '.file-input').on('change', '.file-input', function (e) {
|
||||
// e.preventDefault();
|
||||
|
||||
// const fileInputFile = this.files[0];
|
||||
// const indexFileValue = $(this).data('index');
|
||||
// const validExtensions = ['jpg', 'jpeg', 'png'];
|
||||
|
||||
// const label = $(`#label_${indexFileValue}`).val();
|
||||
// const pdBox = $(this).closest('.pdBox');
|
||||
// const img = pdBox.find('.preview-image');
|
||||
|
||||
// if (fileInputFile) {
|
||||
// const fileName = fileInputFile.name.toLowerCase();
|
||||
// const extension = fileName.split('.').pop();
|
||||
|
||||
// if (validExtensions.includes(extension)) {
|
||||
// if (fileInputFile.size > 5000000) {
|
||||
// showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را آپلود کنید.', 3500);
|
||||
// $(this).val('');
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // خواندن فایل و نمایش آن
|
||||
// const reader = new FileReader();
|
||||
// reader.onload = function (event) {
|
||||
// img.attr('src', event.target.result);
|
||||
|
||||
// const base64String = event.target.result.split(',')[1];
|
||||
// const byteCharacters = atob(base64String);
|
||||
// const byteNumbers = new Array(byteCharacters.length);
|
||||
// for (let i = 0; i < byteCharacters.length; i++) {
|
||||
// byteNumbers[i] = byteCharacters.charCodeAt(i);
|
||||
// }
|
||||
// const byteArray = new Uint8Array(byteNumbers);
|
||||
// const blob = new Blob([byteArray], { type: fileInputFile.type });
|
||||
// const newFile = new File([blob], fileInputFile.name, { type: fileInputFile.type });
|
||||
|
||||
// let picturesPart = {
|
||||
// Label: label,
|
||||
// PictureFile: newFile
|
||||
// };
|
||||
// pictures.push(picturesPart);
|
||||
// };
|
||||
|
||||
// reader.readAsDataURL(fileInputFile);
|
||||
|
||||
// //uploadFile(fileInputFile, indexFileValue, label);
|
||||
// } else {
|
||||
// showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg یا png باشد.', 3500);
|
||||
// }
|
||||
// }
|
||||
|
||||
// console.log(pictures);
|
||||
//});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//$(document).off('change', '.file-input').on('change', '.file-input', function (e) {
|
||||
// e.preventDefault();
|
||||
|
||||
// const fileInputFile = this.files[0];
|
||||
// const indexFileValue = $(this).data('index');
|
||||
// const validExtensions = ['jpg', 'jpeg', 'png'];
|
||||
// const validPdfExtensions = ['pdf'];
|
||||
|
||||
// const label = $(`#label_${indexFileValue}`).val();
|
||||
|
||||
// if (fileInputFile) {
|
||||
// const fileName = fileInputFile.name.toLowerCase();
|
||||
// const extension = fileName.split('.').pop();
|
||||
|
||||
// if (validExtensions.includes(extension)) {
|
||||
// if (fileInputFile.size > 5000000) {
|
||||
// showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را آپلود کنید.', 3500);
|
||||
// $(this).val('');
|
||||
// return;
|
||||
// }
|
||||
// uploadFile(fileInputFile, indexFileValue, label);
|
||||
// } else if (validPdfExtensions.includes(extension)) {
|
||||
|
||||
// var fileReader = new FileReader();
|
||||
|
||||
// fileReader.onload = function () {
|
||||
// var typedarray = new Uint8Array(this.result);
|
||||
// pdfjsLib.getDocument(typedarray).promise.then(function (pdf) {
|
||||
// totalPageCount = pdf.numPages;
|
||||
|
||||
// if (totalPageCount > 1) {
|
||||
// showAlertMessage('.alert-msg', 'آپلود مجاز نیست! تعداد صفحات نباید بیشتر از ۱ باشد.', 3500);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// pdf.getPage(1).then(function (page) { // فقط صفحه اول پردازش میشود
|
||||
// var scale = 2.0;
|
||||
// var viewport = page.getViewport({ scale: scale });
|
||||
|
||||
// var canvas = document.createElement("canvas");
|
||||
// canvas.className = "page";
|
||||
// canvas.title = "Page 1";
|
||||
// canvas.height = viewport.height;
|
||||
// canvas.width = viewport.width;
|
||||
|
||||
// var context = canvas.getContext("2d");
|
||||
|
||||
// page.render({
|
||||
// canvasContext: context,
|
||||
// viewport: viewport
|
||||
// })
|
||||
// .promise.then(function () {
|
||||
// uploadCanvasAsFile(canvas, `${label}_${indexFileValue}.jpg`, indexFileValue, label);
|
||||
// })
|
||||
// .catch(function (error) {
|
||||
// showAlertMessage('.alert-msg', 'مشکلی در پردازش PDF رخ داده است!', 3500);
|
||||
// });
|
||||
// }).catch(function (error) {
|
||||
// showAlertMessage('.alert-msg', 'خطا در دریافت صفحه PDF!', 3500);
|
||||
// });
|
||||
|
||||
// }).catch(function (error) {
|
||||
// showAlertMessage('.alert-msg', 'خطا در بارگذاری فایل PDF!', 3500);
|
||||
// });
|
||||
// };
|
||||
|
||||
// fileReader.readAsArrayBuffer(fileInputFile);
|
||||
|
||||
// } else {
|
||||
// showAlertMessage('.alert-msg', 'فرمت فایل باید یکی از موارد jpeg, jpg یا png باشد.', 3500);
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
|
||||
$(document).off('click', '.btnDeletingPD').on('click', '.btnDeletingPD', function (event) {
|
||||
event.preventDefault();
|
||||
const indexId = $(this).data('index');
|
||||
|
||||
swal.fire({
|
||||
title: "اخطار",
|
||||
text: "آیا میخواهید تصویر موجود را حذف کنید؟",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
confirmButtonColor: '#84cc16',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
removeEmployeeDocumentByLabel(indexId, employeeId);
|
||||
const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
const img = pdBox.find('.preview-image');
|
||||
img.attr('src', '/assetsclient/images/pd-image.png');
|
||||
$(this).addClass('disable');
|
||||
} else {
|
||||
$(this).removeClass('disable');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".exitModal").click(function () {
|
||||
if (uploadFileCount > 0) {
|
||||
swal.fire({
|
||||
title: "اخطار",
|
||||
text: "در صورت انصراف عملیات ثبت نخواهد شد!",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
confirmButtonColor: '#84cc16',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
cancelOperation();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#MainModal').modal('hide');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function cancelOperation() {
|
||||
$.ajax({
|
||||
url: cancelOperationUrl,
|
||||
method: 'POST',
|
||||
data: { employeeId: employeeId },
|
||||
headers: { 'RequestVerificationToken': antiForgeryToken },
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
$('#MainModal').modal('hide');
|
||||
} else {
|
||||
showAlertMessage('.alert-success-msg', response.message, 3500);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
showAlertMessage('.alert-msg', response.message, 3500);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var indexCount = 0;
|
||||
var activeUploads = 0;
|
||||
function showLoadingAnimation(indexId) {
|
||||
uploadFileCount = uploadFileCount + 1;
|
||||
|
||||
//const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
//const spinner = pdBox.find('.spinner-loading-progress');
|
||||
//const percentageText = pdBox.find('.percentageText');
|
||||
|
||||
//spinner.show();
|
||||
//activeUploads++;
|
||||
//$('#createUploadingFiles').prop('disabled', true).addClass('disable');
|
||||
|
||||
//let simulatedProgress = 0;
|
||||
//const progressInterval = setInterval(function () {
|
||||
// if (simulatedProgress < 100) {
|
||||
// simulatedProgress += 2;
|
||||
// spinner.css('width', `${simulatedProgress}%`);
|
||||
// percentageText.text(`${simulatedProgress}%`);
|
||||
// }
|
||||
|
||||
// if (simulatedProgress >= 100) {
|
||||
// clearInterval(progressInterval);
|
||||
// }
|
||||
//}, 30);
|
||||
|
||||
//setTimeout(function () {
|
||||
// clearInterval(progressInterval);
|
||||
// spinner.css('width', '100%');
|
||||
// percentageText.text('100%');
|
||||
|
||||
// spinner.hide();
|
||||
// spinner.css('width', '0%');
|
||||
// handleActiveUploads();
|
||||
//}, 2300);
|
||||
}
|
||||
|
||||
//function uploadCanvasAsFile(canvas, fileName, indexFileValue, label) {
|
||||
// canvas.toBlob(function (blob) {
|
||||
// if (!blob) {
|
||||
// showAlertMessage('.alert-msg', 'مشکلی در تبدیل تصویر رخ داده است!', 3500);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// let file = new File([blob], fileName, { type: 'image/png' });
|
||||
|
||||
// uploadFile(file, indexFileValue, label);
|
||||
|
||||
// }, "image/png");
|
||||
//}
|
||||
|
||||
function uploadCanvasAsFile(canvas, fileName, indexFileValue, label) {
|
||||
canvas.toBlob(function (blob) {
|
||||
if (!blob) {
|
||||
showAlertMessage('.alert-msg', 'مشکلی در تبدیل تصویر رخ داده است!', 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
let file = new File([blob], fileName, { type: 'image/png' });
|
||||
const imageUrl = URL.createObjectURL(blob);
|
||||
|
||||
const img = $(`#${label}`);
|
||||
img.attr('src', imageUrl);
|
||||
|
||||
let existingIndex = command.findIndex(item => item.Label === label);
|
||||
if (existingIndex !== -1) {
|
||||
command[existingIndex].PictureFile = file;
|
||||
} else {
|
||||
let picturesPart = {
|
||||
Label: label,
|
||||
PictureFile: file
|
||||
};
|
||||
command.push(picturesPart);
|
||||
}
|
||||
|
||||
$('#createUploadingFiles').prop('disabled', false).removeClass('disable');
|
||||
showLoadingAnimation(indexFileValue);
|
||||
|
||||
}, "image/png");
|
||||
}
|
||||
|
||||
//var indexCount = 0;
|
||||
//var activeUploads = 0;
|
||||
//function uploadFile(file, indexId, label) {
|
||||
// const formData = new FormData();
|
||||
// formData.append('command.EmployeeId', employeeId);
|
||||
// formData.append('command.WorkshopId', workshopId);
|
||||
// formData.append('command.Label', label);
|
||||
// formData.append('command.PictureFile', file);
|
||||
|
||||
// const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
// const spinner = pdBox.find('.spinner-loading-progress');
|
||||
|
||||
// const percentageText = pdBox.find('.percentageText');
|
||||
|
||||
// spinner.show();
|
||||
// activeUploads++;
|
||||
// $('#createUploadingFiles').prop('disabled', true).addClass('disable');
|
||||
|
||||
// const xhr = new XMLHttpRequest();
|
||||
// xhr.open('POST', saveUploadFileModalAjax, true);
|
||||
// xhr.setRequestHeader('RequestVerificationToken', antiForgeryToken);
|
||||
|
||||
// const uploadStartTime = new Date().getTime();
|
||||
// let simulatedProgress = 0;
|
||||
// let actualProgress = 0;
|
||||
// let isUploadComplete = false;
|
||||
|
||||
// // Simulate progress every 20ms, gradually increasing the bar until the actual progress is reached
|
||||
// const progressInterval = setInterval(function () {
|
||||
// if (simulatedProgress < actualProgress && !isUploadComplete) {
|
||||
// simulatedProgress += 1; // Gradually increase simulated progress
|
||||
// spinner.css('width', `${simulatedProgress}%`);
|
||||
// percentageText.text(`${simulatedProgress}%`);
|
||||
// }
|
||||
|
||||
// if (simulatedProgress >= 100) {
|
||||
// clearInterval(progressInterval); // Stop once the progress hits 100%
|
||||
// }
|
||||
// }, 30); // Increases by 1% every 20ms, making it smooth
|
||||
|
||||
// // Actual upload progress listener
|
||||
// xhr.upload.addEventListener('progress', function (e) {
|
||||
// if (e.lengthComputable) {
|
||||
// actualProgress = Math.round((e.loaded / e.total) * 100);
|
||||
|
||||
// // If the actual progress is slow, allow the simulated progress to match it naturally
|
||||
// if (actualProgress >= simulatedProgress) {
|
||||
// simulatedProgress = actualProgress;
|
||||
// spinner.css('width', `${simulatedProgress}%`);
|
||||
// percentageText.text(`${simulatedProgress}%`);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// // On upload completion
|
||||
// xhr.onload = function () {
|
||||
// spinner.css('transition', 'all 2s ease-in');
|
||||
// const uploadEndTime = new Date().getTime();
|
||||
// const timeDiff = uploadEndTime - uploadStartTime;
|
||||
// const minUploadTime = 2500; // Minimum of 2 seconds for the whole process
|
||||
|
||||
// const response = JSON.parse(xhr.responseText);
|
||||
// isUploadComplete = true; // Mark the upload as complete
|
||||
// const delayTime = Math.max(minUploadTime - timeDiff, 0);
|
||||
|
||||
// setTimeout(function () {
|
||||
// clearInterval(progressInterval); // Clear the interval when done
|
||||
// simulatedProgress = 100;
|
||||
// spinner.css('width', '100%');
|
||||
// percentageText.text('100%');
|
||||
|
||||
// var id2 = $("#employeeIdForList").val();
|
||||
|
||||
// if (xhr.status === 200 && response.isSuccedded) {
|
||||
// indexCount++;
|
||||
// const reader = new FileReader();
|
||||
// reader.onload = function (e) {
|
||||
|
||||
// uploadFileCount = uploadFileCount + 1;
|
||||
|
||||
// const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
// const img = pdBox.find('.preview-image');
|
||||
// img.attr('src', e.target.result);
|
||||
|
||||
// //employeePicture = $('#EmployeePicture').attr('src');
|
||||
// //nationalCardFront = $('#NationalCardFront').attr('src');
|
||||
// //nationalCardRear = $('#NationalCardRear').attr('src');
|
||||
// //militaryServiceCard = $('#MilitaryServiceCard').attr('src');
|
||||
// //idCardPage1 = $('#IdCardPage1').attr('src');
|
||||
// //idCardPage2 = $('#IdCardPage2').attr('src');
|
||||
// //idCardPage3 = $('#IdCardPage3').attr('src');
|
||||
// //idCardPage4 = $('#IdCardPage4').attr('src');
|
||||
// //console.log(idCardPage2);
|
||||
|
||||
// // updatePreviewImage(indexId, id2, e.target.result);
|
||||
|
||||
// };
|
||||
|
||||
// if (pdBox.hasClass("complete") || pdBox.hasClass("discomplete")) {
|
||||
|
||||
// pdBox.removeClass("discomplete complete");
|
||||
// pdBox.find(".sign").removeClass("discompleteSign completeSign");
|
||||
// pdBox.find(".sign").empty();
|
||||
// pdBox.find(".btnDeletingPD").removeClass("Rejected Confirmed");
|
||||
// pdBox.find("confirmedMessage ").remove();
|
||||
// pdBox.find(".resultMessage").empty();
|
||||
// }
|
||||
|
||||
// pdBox.find('.btnDeletingPD').removeClass('disable').addClass("Unsubmitted");
|
||||
|
||||
// reader.readAsDataURL(file);
|
||||
// } else {
|
||||
// showAlertMessage('.alert-msg', response.message || 'Error uploading file', 3500);
|
||||
// $('input[type="file"][data-index="' + indexId + '"]').val('');
|
||||
// }
|
||||
// spinner.css('width', '0%'); // Reset the progress bar
|
||||
// spinner.hide();
|
||||
// handleActiveUploads();
|
||||
// }, delayTime); // Ensure a minimum of 2 seconds for the full process
|
||||
// };
|
||||
|
||||
// // Handle upload error
|
||||
// xhr.onerror = function () {
|
||||
// clearInterval(progressInterval); // Stop progress on error
|
||||
// showAlertMessage('.alert-msg', 'مشکلی در آپلود فایل به وجود آمد.', 3500);
|
||||
// $('input[type="file"][data-index="' + indexId + '"]').val('');
|
||||
// spinner.css('width', '0%');
|
||||
// spinner.hide();
|
||||
// handleActiveUploads();
|
||||
// };
|
||||
|
||||
// xhr.send(formData);
|
||||
//}
|
||||
|
||||
function handleActiveUploads() {
|
||||
activeUploads--;
|
||||
if (activeUploads === 0) {
|
||||
$('#createUploadingFiles').prop('disabled', false).removeClass('disable');
|
||||
}
|
||||
}
|
||||
|
||||
function showAlertMessage(selector, message, timeout) {
|
||||
$(selector).show();
|
||||
$(selector + ' p').text(message);
|
||||
setTimeout(function () {
|
||||
$(selector).hide();
|
||||
$(selector + ' p').text('');
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
function removeEmployeeDocumentByLabel(indexId, employeeId) {
|
||||
const label = $(`#label_${indexId}`).val();
|
||||
const pdBox = $('input[data-index="' + indexId + '"]').closest('.pdBox');
|
||||
|
||||
$.ajax({
|
||||
url: deleteFileAjaxUrl,
|
||||
method: 'POST',
|
||||
data: { label: label, employeeId: employeeId },
|
||||
headers: { 'RequestVerificationToken': antiForgeryToken },
|
||||
success: function (response) {
|
||||
if (response.isSuccedded) {
|
||||
uploadFileCount = uploadFileCount - 1;
|
||||
|
||||
showAlertMessage('.alert-success-msg', 'تصویر موجود با موفقیت حذف شد.', 3500);
|
||||
/* $(`#label_${indexId}`).val('');*/
|
||||
pdBox.find('.btnDeletingPD').removeClass("Unsubmitted");
|
||||
pdBox.find('.uploaderSign').hide();
|
||||
updatePreviewImage(Number(indexId), Number(employeeId), "/assetsclient/images/pd-image.png");
|
||||
|
||||
|
||||
} else {
|
||||
showAlertMessage('.alert-success-msg', response.message, 3500);
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
showAlertMessage('.alert-msg', response.message, 3500);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updatePreviewImage(indexId, id2, result) {
|
||||
switch (indexId) {
|
||||
case 0:
|
||||
$(`#employeePicture_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 1:
|
||||
$(`#nationalCardFront_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 2:
|
||||
$(`#nationalCardRear_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 3:
|
||||
$(`#militaryServiceCard_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 4:
|
||||
$(`#idCardPage1_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 5:
|
||||
$(`#idCardPage2_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 6:
|
||||
$(`#idCardPage3_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
case 7:
|
||||
$(`#idCardPage4_${id2}.preview-image`).attr('src', result);
|
||||
break;
|
||||
default:
|
||||
console.warn('Unexpected indexId:', indexId);
|
||||
}
|
||||
}
|
||||
|
||||
function saveSubmit(id) {
|
||||
var loading = $(".spinner-loading");
|
||||
|
||||
loading.show();
|
||||
|
||||
//var data = {
|
||||
// 'cmd.EmployeeDocumentsId': id
|
||||
//}
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('employeeId', employeeId);
|
||||
|
||||
command.forEach((item, index) => {
|
||||
formData.append(`command[${index}].Label`, item.Label);
|
||||
formData.append(`command[${index}].PictureFile`, item.PictureFile);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: saveGroupSubmitAjax,
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: { 'RequestVerificationToken': antiForgeryToken },
|
||||
success: function (response) {
|
||||
loading.hide();
|
||||
if (response.isSuccedded) {
|
||||
|
||||
|
||||
$(`#loadRejectedDocumentWorkFlow`).html('');
|
||||
loadClientRejectedDocument();
|
||||
$('#MainModal').modal('hide');
|
||||
_RefreshCountMenu();
|
||||
_RefreshCountEmployeeDocumentsMenu();
|
||||
|
||||
//window.location.reload();
|
||||
|
||||
//var id2 = $("#employeeIdForList").val();
|
||||
|
||||
//$(".pdBox").each(function () {
|
||||
// var indexId = $(this).find('.btnUploadingPD').data('index');
|
||||
// var imgSrc = $(this).find('.preview-image').attr("src");
|
||||
// updatePreviewImage(indexId, id2, imgSrc);
|
||||
//});
|
||||
|
||||
|
||||
//showAlertMessage('.alert-success-msg', 'تصویر موجود با موفقیت ارسال شد.', 3500);
|
||||
//$('#MainModal').modal('hide');
|
||||
|
||||
//if (rejectCount === 0) {
|
||||
// // remove item of list
|
||||
//}
|
||||
} else {
|
||||
showAlertMessage('.alert-msg', response.message, 3500);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
loading.hide();
|
||||
showAlertMessage('.alert-msg', 'مشکلی در ارسال تصویر به وجود آمد.', 3500);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cancelOP() {
|
||||
|
||||
$.ajax({
|
||||
url: saveSubmitAjax,
|
||||
method: 'POST',
|
||||
data: { employeeId: employeeId, },
|
||||
headers: { 'RequestVerificationToken': antiForgeryToken },
|
||||
success: function (response) {
|
||||
loading.hide();
|
||||
$('#MainModal').modal('hide');
|
||||
|
||||
if (response.isSuccedded) {
|
||||
showAlertMessage('.alert-success-msg', 'تصویر موجود با موفقیت ارسال شد.', 3500);
|
||||
|
||||
} else {
|
||||
showAlertMessage('.alert-msg', response.message, 3500);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
loading.hide();
|
||||
showAlertMessage('.alert-msg', 'مشکلی در ارسال تصویر به وجود آمد.', 3500);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
@@ -56,10 +57,17 @@ public interface IAdminWorkFlowApplication
|
||||
|
||||
Task<OperationResult> EditEmployeeInEmployeeDocumentWorkFlow(EditEmployeeInEmployeeDocument command);
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارگاه هایی که از کلاینت، پرسنلی را شروع به کار زدند و مدارک آنها کامل آپلود نشده است
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<WorkshopWithDocumentsViewModelForWorkFlow>> GetWorkshopDocumentCreatedEmployeeForAdmin(List<long> workshops, long roleId);
|
||||
#endregion
|
||||
|
||||
Task<int> GetEmployeeDocumentWorkFlowCountsForAdmin(List<long> workshopIds);
|
||||
Task<int> GetWorkFlowCountsForAdmin(List<long> workshopIds, long accountId);
|
||||
Task<int> GetEmployeeDocumentWorkFlowCountsForAdmin(List<long> workshopIds, long roleId);
|
||||
Task<int> GetWorkFlowCountsForAdmin(List<long> workshopIds, long accountId, long roleId);
|
||||
Task<int> GetWorkFlowCountForChecker();
|
||||
|
||||
|
||||
@@ -85,6 +93,7 @@ public interface IAdminWorkFlowApplication
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -112,7 +121,7 @@ public class ClientLeftWorkEmployeesWorkFlowViewModel
|
||||
/// </summary>
|
||||
public string LeftWorkDate { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,13 +11,17 @@ public interface IWorkFlowApplication
|
||||
Task<OperationResult> CreateRollCallConfirmedWithoutLunchBreak(CreateRollCallConfirmedWithoutLunchBreak command);
|
||||
|
||||
|
||||
Task<int> GetCountAllWorkFlows(long workshopId);
|
||||
Task<int> GetCountAllWorkFlows(long workshopId, long accountId);
|
||||
Task<int> GetRollCallAbsentsWorkFlows(long workshopId);
|
||||
Task<int> GetCountCutRollCallByBgService(long workshopId);
|
||||
Task<int> GetAllWorkFlowCount(long workshopId);
|
||||
Task<int> GetAllWorkFlowCount(long workshopId , long accountId);
|
||||
Task<int> GetAllWorkFlowCountAsync(long workshopId);
|
||||
|
||||
Task<DailyRollCallWorkFlowViewModel> GetAbsentRollCallWorkFlowsByDate(long workshopId, DateTime date);
|
||||
Task<int> GetAllRollCallCount(long workshopId);
|
||||
Task<int> GetAllEmployeeDocuments(long workshopId, long accountId);
|
||||
|
||||
|
||||
Task<DailyRollCallWorkFlowViewModel> GetAbsentRollCallWorkFlowsByDate(long workshopId, DateTime date);
|
||||
Task<DailyRollCallConfirmedWithoutLunchBreakViewModel> GetEmployeesWithoutLunchBreakByDate(long workshopId, DateTime date);
|
||||
Task<DailyRollCallWorkFlowViewModel> GetRollCallWorkFlowsCutByBgServiceByDate(long workshopId, DateTime date);
|
||||
Task<DailyRollCallWorkFlowViewModel> GetUndefinedRollCallsByDate(long workshopId, DateTime date);
|
||||
|
||||
@@ -5,21 +5,20 @@ using WorkFlow.Infrastructure.ACL.Employee;
|
||||
using WorkFlow.Infrastructure.ACL.EmployeeDocuments;
|
||||
using WorkFlow.Infrastructure.ACL.Workshop;
|
||||
|
||||
|
||||
namespace WorkFlow.Application
|
||||
{
|
||||
public class AdminWorkFlowApplication : IAdminWorkFlowApplication
|
||||
{
|
||||
private readonly IWorkFlowEmployeeDocumentsACL _workFlowEmployeeDocumentsACL;
|
||||
public class AdminWorkFlowApplication : IAdminWorkFlowApplication
|
||||
{
|
||||
private readonly IWorkFlowEmployeeDocumentsACL _workFlowEmployeeDocumentsACL;
|
||||
private readonly IWorkFlowWorkshopACL _workFlowWorkshopACL;
|
||||
private readonly IWorkFlowEmployeeACL _workFlowEmployeeACL;
|
||||
|
||||
|
||||
public AdminWorkFlowApplication(IWorkFlowEmployeeDocumentsACL workFlowEmployeeDocumentsACL, IWorkFlowWorkshopACL workFlowWorkshopAcl, IWorkFlowEmployeeACL workFlowEmployeeAcl)
|
||||
public AdminWorkFlowApplication(IWorkFlowEmployeeDocumentsACL workFlowEmployeeDocumentsACL, IWorkFlowWorkshopACL workFlowWorkshopACL, IWorkFlowEmployeeACL workFlowEmployeeACL)
|
||||
{
|
||||
_workFlowEmployeeDocumentsACL = workFlowEmployeeDocumentsACL;
|
||||
_workFlowWorkshopACL = workFlowWorkshopAcl;
|
||||
_workFlowEmployeeACL = workFlowEmployeeAcl;
|
||||
_workFlowWorkshopACL = workFlowWorkshopACL;
|
||||
_workFlowEmployeeACL = workFlowEmployeeACL;
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
@@ -29,28 +28,29 @@ namespace WorkFlow.Application
|
||||
return _workFlowEmployeeDocumentsACL.GetWorkshopDocumentsAwaitingReviewForChecker(workshops);
|
||||
}
|
||||
|
||||
public async Task<int> GetEmployeeDocumentWorkFlowCountsForAdmin(List<long> workshopIds)
|
||||
|
||||
|
||||
public async Task<int> GetEmployeeDocumentWorkFlowCountsForAdmin(List<long> workshopIds,long roleId)
|
||||
{
|
||||
var submittedDocumentsByClient = await _workFlowEmployeeDocumentsACL.GetAdminWorkFlowCountForSubmittedDocuments(workshopIds);
|
||||
var count = 0;
|
||||
count += await _workFlowEmployeeDocumentsACL.GetWorkshopDocumentRejectedForAdmin(workshopIds,roleId);
|
||||
|
||||
var newEmployees = await _workFlowEmployeeDocumentsACL.GetAdminWorkFlowCountForNewEmployees(workshopIds);
|
||||
count+= await _workFlowEmployeeDocumentsACL.GetCreatedEmployeesWorkshopDocumentForAdmin(workshopIds,roleId);
|
||||
|
||||
//count+= await _workFlowEmployeeDocumentsACL.GetClientRejectedDocumentWorkshopsForAdmin(workshopIds, roleId);
|
||||
|
||||
return submittedDocumentsByClient + newEmployees;
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<int> GetWorkFlowCountsForAdmin(List<long> workshopIds, long accountId)
|
||||
public async Task<int> GetWorkFlowCountsForAdmin(List<long> workshopIds, long accountId,long roleId)
|
||||
{
|
||||
var employeeDocumentWorkFlowCounts = await GetEmployeeDocumentWorkFlowCountsForAdmin(workshopIds);
|
||||
var employeeDocumentWorkFlowCounts = await GetEmployeeDocumentWorkFlowCountsForAdmin(workshopIds, roleId);
|
||||
var startWork = await GetWorkshopsForEmployeeStartWorkCount(accountId);
|
||||
var leftWork = await GetWorkshopsForLeftWorkTempCount(accountId);
|
||||
|
||||
return employeeDocumentWorkFlowCounts + startWork + leftWork;
|
||||
}
|
||||
|
||||
|
||||
public async Task<int> GetWorkFlowCountForChecker()
|
||||
{
|
||||
return await _workFlowEmployeeDocumentsACL.GetCheckerWorkFlowCount();
|
||||
@@ -64,6 +64,7 @@ namespace WorkFlow.Application
|
||||
return _workFlowEmployeeDocumentsACL.GetWorkshopsWithDocumentsAwaitingUploadForAdmin(workshops);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mahan
|
||||
@@ -118,6 +119,15 @@ namespace WorkFlow.Application
|
||||
|
||||
#endregion
|
||||
|
||||
#region آپلود مدارک پرسنل
|
||||
|
||||
public async Task<ICollection<WorkshopWithDocumentsViewModelForWorkFlow>> GetWorkshopDocumentCreatedEmployeeForAdmin(List<long> workshops, long roleId)
|
||||
{
|
||||
return await _workFlowEmployeeDocumentsACL.GetWorkshopDocumentCreatedEmployeeForAdmin(workshops, roleId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using Company.Domain.RollCallAgg.DomainService;
|
||||
using CompanyManagment.App.Contracts.EmployeeDocuments;
|
||||
using WorkFlow.Application.Contracts.RollCallConfirmedAbsence;
|
||||
using WorkFlow.Application.Contracts.RollCallConfirmedWithoutLunchBreak;
|
||||
using WorkFlow.Application.Contracts.Shared;
|
||||
@@ -21,8 +22,8 @@ public class WorkFlowApplication : IWorkFlowApplication
|
||||
private readonly IWorkFlowCustomizedWorkshopSettingsACL _customizedWorkshopSettingsACL;
|
||||
private readonly IRollCallDomainService _rollCallDomainService;
|
||||
private readonly IRollCallConfirmedWithoutLunchBreakRepository _rollCallConfirmedWithoutLunchBreakRepository;
|
||||
|
||||
public WorkFlowApplication(IRollCallConfirmedAbsenceRepository absenceRepository, IWorkFlowRollCallACL rollCallACL, IWorkFlowCheckoutACL checkoutACL, IWorkFlowCustomizedWorkshopSettingsACL customizedWorkshopSettingsACL, IRollCallConfirmedWithoutLunchBreakRepository rollCallConfirmedWithoutLunchBreakRepository, IRollCallDomainService rollCallDomainService)
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
public WorkFlowApplication(IRollCallConfirmedAbsenceRepository absenceRepository, IWorkFlowRollCallACL rollCallACL, IWorkFlowCheckoutACL checkoutACL, IWorkFlowCustomizedWorkshopSettingsACL customizedWorkshopSettingsACL, IRollCallConfirmedWithoutLunchBreakRepository rollCallConfirmedWithoutLunchBreakRepository, IRollCallDomainService rollCallDomainService, IEmployeeDocumentsApplication employeeDocumentsApplication)
|
||||
{
|
||||
_absenceRepository = absenceRepository;
|
||||
_rollCallACL = rollCallACL;
|
||||
@@ -30,6 +31,7 @@ public class WorkFlowApplication : IWorkFlowApplication
|
||||
_customizedWorkshopSettingsACL = customizedWorkshopSettingsACL;
|
||||
_rollCallConfirmedWithoutLunchBreakRepository = rollCallConfirmedWithoutLunchBreakRepository;
|
||||
_rollCallDomainService = rollCallDomainService;
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
}
|
||||
|
||||
public async Task<OperationResult> CreateRollCallConfirmedAbsence(CreateRollCallConfirmedAbsence command)
|
||||
@@ -57,16 +59,16 @@ public class WorkFlowApplication : IWorkFlowApplication
|
||||
|
||||
var newEntity = new RollCallConfirmedWithoutLunchBreak(command.RollCallId, entity.EmployeeId, entity.WorkshopId, entity.RollCallDate);
|
||||
|
||||
_rollCallConfirmedWithoutLunchBreakRepository.Create(newEntity);
|
||||
await _rollCallConfirmedWithoutLunchBreakRepository.CreateAsync(newEntity);
|
||||
await _rollCallConfirmedWithoutLunchBreakRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<int> GetCountAllWorkFlows(long workshopId)
|
||||
public async Task<int> GetCountAllWorkFlows(long workshopId,long accountId)
|
||||
{
|
||||
int count = 0;
|
||||
count += await GetAllWorkFlowCount(workshopId);
|
||||
count += await GetAllWorkFlowCount(workshopId,accountId);
|
||||
return count;
|
||||
}
|
||||
public Task<int> GetRollCallAbsentsWorkFlows(long workshopId)
|
||||
@@ -81,29 +83,53 @@ public class WorkFlowApplication : IWorkFlowApplication
|
||||
{
|
||||
return (await GetRollCallWorkFlowsCutByBgService(workshopId)).Count;
|
||||
}
|
||||
public async Task<int> GetAllWorkFlowCount(long workshopId)
|
||||
{
|
||||
var count = 0;
|
||||
var activeServiceByWorkshopId = _rollCallACL.GetActiveServiceByWorkshopId(workshopId);
|
||||
if (activeServiceByWorkshopId == null)
|
||||
{
|
||||
return count;
|
||||
}
|
||||
//count += _rollCallACL.GetRollCallAbsentsWorkFlows(accId, workshopId);
|
||||
count += (await GetAbsentRollCallWorkFlows(workshopId))?.Count ?? 0;
|
||||
count += (await GetRollCallWorkFlowsCutByBgService(workshopId))?.Count ?? 0;
|
||||
count += (await GetEmployeesWithoutLunchBreak(workshopId))?.Count ?? 0;
|
||||
//count += (await GetRollCallsOverlappingLeaves(workshopId))?.Count ?? 0;
|
||||
count += (await GetUndefinedRollCalls(workshopId))?.Count ?? 0;
|
||||
|
||||
|
||||
|
||||
public async Task<int> GetAllWorkFlowCount(long workshopId,long accountId)
|
||||
{
|
||||
var count = 0;
|
||||
// RollCall
|
||||
|
||||
count += await GetAllRollCallCount(workshopId);
|
||||
|
||||
count += await GetAllEmployeeDocuments(workshopId,accountId );
|
||||
|
||||
// Employee Documents
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
public async Task<int> GetAllEmployeeDocuments(long workshopId, long accountId)
|
||||
{
|
||||
int count = 0;
|
||||
count += (await _employeeDocumentsApplication.GetClientRejectedDocumentForClient(workshopId, accountId)).Count;
|
||||
return count;
|
||||
}
|
||||
|
||||
public Task<int> GetAllWorkFlowCountAsync(long workshopId)
|
||||
{
|
||||
return Task.FromResult(20);
|
||||
}
|
||||
|
||||
public async Task<int> GetAllRollCallCount(long workshopId)
|
||||
{
|
||||
int count = 0;
|
||||
var activeServiceByWorkshopId = _rollCallACL.GetActiveServiceByWorkshopId(workshopId);
|
||||
if (activeServiceByWorkshopId == null)
|
||||
{
|
||||
return count;
|
||||
}
|
||||
//count += _rollCallACL.GetRollCallAbsentsWorkFlows(accId, workshopId);
|
||||
count += (await GetAbsentRollCallWorkFlows(workshopId))?.Count ?? 0;
|
||||
count += (await GetRollCallWorkFlowsCutByBgService(workshopId))?.Count ?? 0;
|
||||
count += (await GetEmployeesWithoutLunchBreak(workshopId))?.Count ?? 0;
|
||||
//count += (await GetRollCallsOverlappingLeaves(workshopId))?.Count ?? 0;
|
||||
count += (await GetUndefinedRollCalls(workshopId))?.Count ?? 0;
|
||||
return count;
|
||||
}
|
||||
|
||||
#region Methods For Ajax
|
||||
|
||||
/// <summary>
|
||||
@@ -342,8 +368,6 @@ public class WorkFlowApplication : IWorkFlowApplication
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#region Methods For OnGet
|
||||
|
||||
|
||||
|
||||
@@ -3,25 +3,37 @@ using WorkFlow.Application.Contracts.AdminWorkFlow;
|
||||
|
||||
namespace WorkFlow.Infrastructure.ACL.EmployeeDocuments
|
||||
{
|
||||
public interface IWorkFlowEmployeeDocumentsACL
|
||||
{
|
||||
List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopDocumentsAwaitingReviewForChecker(List<long> workshops);
|
||||
public interface IWorkFlowEmployeeDocumentsACL
|
||||
{
|
||||
List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopDocumentsAwaitingReviewForChecker(List<long> workshops);
|
||||
List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopsWithDocumentsAwaitingUploadForAdmin(List<long> workshops);
|
||||
|
||||
|
||||
Task<int> GetAdminWorkFlowCountForSubmittedDocuments(List<long> workshopIds);
|
||||
Task<int> GetAdminWorkFlowCountForNewEmployees(List<long> workshopIds);
|
||||
Task<int> GetCheckerWorkFlowCount();
|
||||
Task<int> GetWorkshopDocumentRejectedForAdmin(List<long> workshops, long roleId);
|
||||
Task<int> GetCreatedEmployeesWorkshopDocumentForAdmin(List<long> workshops, long roleId);
|
||||
Task<int> GetClientRejectedDocumentWorkshopsForAdmin(List<long> workshops, long roleId);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارگاه هایی که از کلاینت، پرسنلی را شروع به کار زدند و مدارک آنها کامل آپلود نشده است
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<WorkshopWithDocumentsViewModelForWorkFlow>> GetWorkshopDocumentCreatedEmployeeForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
}
|
||||
|
||||
public class WorkFlowEmployeeDocumentsACL : IWorkFlowEmployeeDocumentsACL
|
||||
{
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
public class WorkFlowEmployeeDocumentsACL : IWorkFlowEmployeeDocumentsACL
|
||||
{
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
|
||||
public WorkFlowEmployeeDocumentsACL(IEmployeeDocumentsApplication employeeDocumentsApplication)
|
||||
{
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
}
|
||||
public WorkFlowEmployeeDocumentsACL(IEmployeeDocumentsApplication employeeDocumentsApplication)
|
||||
{
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
}
|
||||
|
||||
|
||||
public List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopsWithDocumentsAwaitingUploadForAdmin(List<long> workshops)
|
||||
@@ -30,8 +42,8 @@ namespace WorkFlow.Infrastructure.ACL.EmployeeDocuments
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
UploadItemsCount = x.EmployeesWithoutDocumentCount,
|
||||
WorkshopName = x.WorkshopFullName,
|
||||
EmployerName = x.EmployerName,
|
||||
WorkshopName = x.WorkshopFullName,
|
||||
EmployerName = x.EmployerName,
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
@@ -48,15 +60,44 @@ namespace WorkFlow.Infrastructure.ACL.EmployeeDocuments
|
||||
return await _employeeDocumentsApplication.GetCheckerWorkFlowCount();
|
||||
}
|
||||
|
||||
public async Task<int> GetWorkshopDocumentRejectedForAdmin(List<long> workshops, long roleId)
|
||||
{
|
||||
return (await _employeeDocumentsApplication.GetWorkshopDocumentRejectedForAdmin(workshops, roleId)).Count;
|
||||
}
|
||||
|
||||
public async Task<int> GetCreatedEmployeesWorkshopDocumentForAdmin(List<long> workshops, long roleId)
|
||||
{
|
||||
return (await _employeeDocumentsApplication.GetCreatedEmployeesWorkshopDocumentForAdmin(workshops, roleId))
|
||||
.Count;
|
||||
}
|
||||
|
||||
public async Task<int> GetClientRejectedDocumentWorkshopsForAdmin(List<long> workshops, long roleId)
|
||||
{
|
||||
return (await _employeeDocumentsApplication.GetClientRejectedDocumentWorkshopsForAdmin(workshops, roleId))
|
||||
.Count;
|
||||
}
|
||||
|
||||
public async Task<ICollection<WorkshopWithDocumentsViewModelForWorkFlow>> GetWorkshopDocumentCreatedEmployeeForAdmin(List<long> workshops, long roleId)
|
||||
{
|
||||
return (await _employeeDocumentsApplication.GetWorkshopDocumentCreatedEmployeeForAdmin(workshops, roleId)).Select(x => new WorkshopWithDocumentsViewModelForWorkFlow()
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
UploadItemsCount = x.EmployeesWithoutDocumentCount,
|
||||
WorkshopName = x.WorkshopFullName,
|
||||
EmployerName = x.EmployerName,
|
||||
}).ToList();
|
||||
|
||||
}
|
||||
|
||||
public List<WorkshopWithDocumentsViewModelForWorkFlow> GetWorkshopDocumentsAwaitingReviewForChecker(List<long> workshops)
|
||||
{
|
||||
return _employeeDocumentsApplication.GetWorkshopsWithDocumentsAwaitingReviewForCheckerWorkFlow().Select(x=> new WorkshopWithDocumentsViewModelForWorkFlow()
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
UploadItemsCount = x.SubmittedItemsCount
|
||||
}).ToList();
|
||||
}
|
||||
{
|
||||
return _employeeDocumentsApplication.GetWorkshopsWithDocumentsAwaitingReviewForCheckerWorkFlow().Select(x => new WorkshopWithDocumentsViewModelForWorkFlow()
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
UploadItemsCount = x.SubmittedItemsCount
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||