persian type bug fixed by Safa
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Company.Domain.LoanAgg;
|
||||
|
||||
public interface ILoanRepository:IRepository<long,Loan>
|
||||
{
|
||||
List<LoanSearchViewModel> GetSearchList(LoanSearchViewModel searchViewModel);
|
||||
List<LoanViewModel> GetSearchList(LoanSearchViewModel searchViewModel);
|
||||
LoanViewModel GetDetails(long id);
|
||||
void Remove(Loan entity);
|
||||
List<Loan> GetBy(IEnumerable<long> ids);
|
||||
|
||||
@@ -4,15 +4,9 @@ using System;
|
||||
namespace CompanyManagment.App.Contracts.Fine;
|
||||
public class FineSearchViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public IsActive IsActive { get; set; }
|
||||
public string FineDate { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
public int PageIndex { get; set; }
|
||||
public string StartDate { get; set; }
|
||||
public string EndDate { get; set; }
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CompanyManagment.App.Contracts.Loan;
|
||||
|
||||
public interface ILoanApplication
|
||||
{
|
||||
List<LoanSearchViewModel> GetSearchList(LoanSearchViewModel searchViewModel);
|
||||
List<LoanViewModel> GetSearchList(LoanSearchViewModel searchViewModel);
|
||||
LoanViewModel GetDetails(long id);
|
||||
OperationResult Create(CreateLoanViewModel command);
|
||||
List<LoanInstallmentViewModel> CalculateLoanInstallment(string amount , int installmentCount,string loanStartDate,bool getRounded);
|
||||
|
||||
@@ -8,12 +8,8 @@ public class LoanSearchViewModel
|
||||
public long Id { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string StartDateTime { get; set; }
|
||||
public string Count { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public string AmountPerMonth { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
public string StartDate { get; set; }
|
||||
public string EndDate { get; set; }
|
||||
|
||||
public int PageIndex { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
namespace CompanyManagment.App.Contracts.Loan;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Loan;
|
||||
public class LoanViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
@@ -9,4 +12,7 @@ public class LoanViewModel
|
||||
public string Count { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public string AmountPerMonth { get; set; }
|
||||
public List<LoanInstallmentViewModel> Installment { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
}
|
||||
|
||||
@@ -4,5 +4,7 @@ public class RewardSearchModel
|
||||
public long EmployeeId { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string StartDate { get; set; }
|
||||
public string EndDate { get; set; }
|
||||
public int PageIndex { get; set; }
|
||||
}
|
||||
@@ -3,13 +3,9 @@
|
||||
namespace CompanyManagment.App.Contracts.SalaryAid;
|
||||
public class SalaryAidSearchViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string StartDate { get; set; }
|
||||
public string EndDate { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public string SalaryDateTime { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
public int PageIndex { get; set; }
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public class LoanApplication : ILoanApplication
|
||||
_customizeCheckoutRepository = customizeCheckoutRepository;
|
||||
}
|
||||
|
||||
public List<LoanSearchViewModel> GetSearchList(LoanSearchViewModel searchModel)
|
||||
public List<LoanViewModel> GetSearchList(LoanSearchViewModel searchModel)
|
||||
{
|
||||
return _loanRepository.GetSearchList(searchModel);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,13 @@ public class FineRepository : RepositoryBase<long, Fine>, IFineRepository
|
||||
|
||||
if (searchModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartDate) && !string.IsNullOrWhiteSpace(searchModel.EndDate))
|
||||
{
|
||||
var startDate = searchModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.FineDate >= startDate && x.FineDate <= endDate);
|
||||
}
|
||||
var result = query.OrderByDescending(x => x.CreationDate).Skip(searchModel.PageIndex).Take(30).Select(x => new FineViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
|
||||
@@ -37,32 +37,41 @@ public class LoanRepository:RepositoryBase<long,Loan>,ILoanRepository
|
||||
return _companyContext.Loans.Where(x => ids.Contains(x.id)).ToList();
|
||||
}
|
||||
|
||||
public List<LoanSearchViewModel> GetSearchList(LoanSearchViewModel searchViewModel)
|
||||
public List<LoanViewModel> GetSearchList(LoanSearchViewModel searchViewModel)
|
||||
{
|
||||
var query = _companyContext.Loans.Where(x => x.WorkshopId == searchViewModel.WorkshopId);
|
||||
|
||||
if (searchViewModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchViewModel.EmployeeId);
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchViewModel.StartDate) && !string.IsNullOrWhiteSpace(searchViewModel.EndDate))
|
||||
{
|
||||
var startDate = searchViewModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchViewModel.EndDate.ToGeorgianDateTime();
|
||||
|
||||
query = query.Where(x => x.LoanGrantDate <= endDate && x.LoanGrantDate >= startDate);
|
||||
}
|
||||
|
||||
|
||||
var employeeIds = query.Select(x => x.EmployeeId);
|
||||
|
||||
var personnelCodes = _companyContext.PersonnelCodeSet.Where(x => x.WorkshopId == searchViewModel.WorkshopId && employeeIds.Contains(x.EmployeeId));
|
||||
|
||||
|
||||
|
||||
var employees = _companyContext.Employees.Where(x => employeeIds.Contains(x.id)).AsSplitQuery();
|
||||
|
||||
return query.Select(x => new LoanSearchViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName =employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
return query.Select(x => new LoanViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(e => e.EmployeeId == x.EmployeeId && e.WorkshopId == searchViewModel.WorkshopId).PersonnelCode.ToString(),
|
||||
StartDateTime = x.StartInstallmentPayment.ToFarsi(),
|
||||
Count = x.Count,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountPerMonth = x.AmountPerMonth.ToMoney(),
|
||||
CreationDate = x.CreationDate
|
||||
StartDateTime = x.StartInstallmentPayment.ToFarsi(),
|
||||
Count = x.Count,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountPerMonth = x.AmountPerMonth.ToMoney(),
|
||||
CreationDate = x.CreationDate
|
||||
}).OrderByDescending(x => x.CreationDate).Skip(searchViewModel.PageIndex).AsSplitQuery().Take(30).ToList();
|
||||
}
|
||||
}
|
||||
@@ -21,8 +21,14 @@ public class RewardRepository : RepositoryBase<long, Reward>, IRewardRepository
|
||||
|
||||
if (searchViewModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchViewModel.EmployeeId);
|
||||
var enumQuery = query;
|
||||
var result = enumQuery.OrderByDescending(x=>x.CreationDate).Select(x => new RewardViewModel()
|
||||
if (!string.IsNullOrWhiteSpace(searchViewModel.StartDate) && !string.IsNullOrWhiteSpace(searchViewModel.EndDate))
|
||||
{
|
||||
var startDate = searchViewModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchViewModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.GrantDate >= startDate && x.GrantDate <= endDate);
|
||||
}
|
||||
|
||||
var result = query.OrderByDescending(x => x.CreationDate).Select(x => new RewardViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
EmployeeId = x.EmployeeId,
|
||||
@@ -42,14 +48,14 @@ public class RewardRepository : RepositoryBase<long, Reward>, IRewardRepository
|
||||
CreationDate = x.CreationDate,
|
||||
Description = x.Description,
|
||||
GrantDate = x.GrantDate,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName ,
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
Id = x.Id,
|
||||
PersonnelCode = personnelCodes
|
||||
.FirstOrDefault(a => a.WorkshopId == x.WorkshopId && a.EmployeeId == x.EmployeeId).PersonnelCode
|
||||
.ToString(),
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId
|
||||
}).ToList();
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public EditRewardViewModel GetDetails(long id)
|
||||
|
||||
@@ -22,6 +22,16 @@ public class SalaryAidRepository:RepositoryBase<long,SalaryAid>,ISalaryAidReposi
|
||||
|
||||
if (searchViewModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.EmployeeId == searchViewModel.EmployeeId);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchViewModel.StartDate) && !string.IsNullOrWhiteSpace(searchViewModel.EndDate))
|
||||
{
|
||||
var startDate = searchViewModel.StartDate.ToGeorgianDateTime();
|
||||
var endDate = searchViewModel.EndDate.ToGeorgianDateTime();
|
||||
query = query.Where(x => x.SalaryAidDateTime >= startDate && x.SalaryAidDateTime <= endDate);
|
||||
}
|
||||
|
||||
|
||||
|
||||
var result = query.OrderByDescending(x => x.CreationDate).Skip(searchViewModel.PageIndex).Take(30).AsEnumerable();
|
||||
|
||||
var employees = _companyContext.Employees.Where(x => result.Any(a => a.EmployeeId == x.id)).ToList();
|
||||
@@ -38,15 +48,15 @@ public class SalaryAidRepository:RepositoryBase<long,SalaryAid>,ISalaryAidReposi
|
||||
PersonnelCode = personnelCodes
|
||||
.FirstOrDefault(a => a.WorkshopId == x.WorkshopId && a.EmployeeId == x.EmployeeId)?.PersonnelCode
|
||||
.ToString(),
|
||||
EmployeeId = x.EmployeeId,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
WorkshopId = x.WorkshopId
|
||||
EmployeeId = x.EmployeeId,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
WorkshopId = x.WorkshopId
|
||||
}).ToList();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public EditSalaryAidViewModel GetDetails(long id)
|
||||
public EditSalaryAidViewModel GetDetails(long id)
|
||||
{
|
||||
var entity = _companyContext.SalaryAids.FirstOrDefault(x => x.id == id);
|
||||
if (entity == null)
|
||||
|
||||
@@ -649,6 +649,12 @@
|
||||
|
||||
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
|
||||
@@ -45,6 +45,10 @@
|
||||
} */
|
||||
|
||||
@@media print {
|
||||
body {
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
body * {
|
||||
visibility: hidden;
|
||||
page-break-after: auto;
|
||||
@@ -172,7 +176,7 @@
|
||||
}
|
||||
|
||||
.titleH1 {
|
||||
font-size: 24px;
|
||||
font-size: 20px;
|
||||
margin: 0 !important;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -368,23 +372,23 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row summary d-flex">
|
||||
<div class="col-12 no-print">
|
||||
<div class="modal-footer" style="border-top: unset; padding: 1px 15px 10px;">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 text-start">
|
||||
<button type="button" class="btn btn-rounded waves-effect waves-light m-b-10 text-white" data-bs-dismiss="modal" id="btnClose" aria-label="Close" style="background-color: #454D5C;">بستن فرم</button>
|
||||
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light">پرینت</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row summary d-flex">
|
||||
<div class="col-12 no-print">
|
||||
<div class="modal-footer" style="border-top: unset; padding: 1px 15px 10px;">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 text-start">
|
||||
<button type="button" class="btn btn-rounded waves-effect waves-light m-b-10 text-white" data-bs-dismiss="modal" id="btnClose" aria-label="Close" style="background-color: #454D5C;">بستن فرم</button>
|
||||
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light">پرینت</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
window.PagedConfig = {
|
||||
before: () => {
|
||||
|
||||
@@ -56,13 +56,22 @@
|
||||
<div class="search-box card">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row search-personal-section gap-2">
|
||||
<div class="row search-personal-section">
|
||||
|
||||
<div class="col-3">
|
||||
<div class="col-3 col-xxl-2">
|
||||
<select class="form-select employeeName select2OptionIndex" id="employeeSelectIndex" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
|
||||
|
||||
<div class="col-2 col-xxl-1 p-0">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-2 col-xxl-1">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center me-2" id="searchBtn" type="submit">
|
||||
<span>جستجو</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="6" stroke="white" />
|
||||
@@ -201,6 +210,15 @@
|
||||
<select class="form-select employeeName select2OptionIndexMobile" id="employeeSelectIndexMobile" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date-mobile" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="btn-clear-filter disable py-2 text-center d-block w-100 mt-2">
|
||||
<span class="w-100">حذف جستجو</span>
|
||||
@@ -218,7 +236,7 @@
|
||||
<button type="button" class="btn-cancel w-100" data-bs-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="submit" class="btn-search btn-search-click w-100">جستجو</button>
|
||||
<button type="submit" class="btn-search btn-search-click-mobile w-100">جستجو</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -57,16 +57,22 @@
|
||||
<div class="search-box card">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row search-personal-section gap-1">
|
||||
<div class="row search-personal-section">
|
||||
|
||||
<div class="col-3">
|
||||
<div class="col-3 col-xxl-2">
|
||||
<select class="form-select employeeName select2OptionIndex" id="employeeSelectIndex" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
@* <div class="col-3">
|
||||
<input type="text" name="startDateTime" class="form-control form-control-date startDateTime" placeholder="تاریخ شروع وام ...">
|
||||
</div> *@
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
|
||||
|
||||
<div class="col-2 col-xxl-1 p-0">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-2 col-xxl-1">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center me-2" id="searchBtn" type="submit">
|
||||
<span>جستجو</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="6" stroke="white" />
|
||||
@@ -206,6 +212,15 @@
|
||||
<select class="form-select employeeName select2OptionIndexMobile" id="employeeSelectIndexMobile" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date-mobile" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="btn-clear-filter disable py-2 text-center d-block w-100 mt-2">
|
||||
<span class="w-100">حذف جستجو</span>
|
||||
@@ -223,7 +238,7 @@
|
||||
<button type="button" class="btn-cancel w-100" data-bs-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="submit" class="btn-search btn-search-click w-100">جستجو</button>
|
||||
<button type="submit" class="btn-search btn-search-click-mobile w-100">جستجو</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,13 +56,23 @@
|
||||
<div class="search-box card">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row search-personal-section gap-2">
|
||||
|
||||
<div class="row search-personal-section">
|
||||
|
||||
<div class="col-3">
|
||||
<div class="col-3 col-xxl-2">
|
||||
<select class="form-select employeeName select2OptionIndex" id="employeeSelectIndex" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
|
||||
|
||||
<div class="col-2 col-xxl-1 p-0">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-2 col-xxl-1">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center me-2" id="searchBtn" type="submit">
|
||||
<span>جستجو</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="6" stroke="white" />
|
||||
@@ -195,12 +205,21 @@
|
||||
<div class="container-fluid search-box">
|
||||
|
||||
<div id="overlaySearchAdvance" class=""></div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 text-start mb-4">
|
||||
<select class="form-select employeeName select2OptionIndexMobile" id="employeeSelectIndexMobile" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date-mobile" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="btn-clear-filter disable py-2 text-center d-block w-100 mt-2">
|
||||
<span class="w-100">حذف جستجو</span>
|
||||
@@ -218,7 +237,7 @@
|
||||
<button type="button" class="btn-cancel w-100" data-bs-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="submit" class="btn-search btn-search-click w-100">جستجو</button>
|
||||
<button type="submit" class="btn-search btn-search-click-mobile w-100">جستجو</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -55,13 +55,22 @@
|
||||
<div class="search-box card">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row search-personal-section gap-2">
|
||||
<div class="row search-personal-section">
|
||||
|
||||
<div class="col-3">
|
||||
<div class="col-3 col-xxl-2">
|
||||
<select class="form-select employeeName select2OptionIndex" id="employeeSelectIndex" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center" id="searchBtn" type="submit">
|
||||
|
||||
<div class="col-2 col-xxl-1 p-0">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-2 col-xxl-1">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center me-2" id="searchBtn" type="submit">
|
||||
<span>جستجو</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="6" stroke="white" />
|
||||
@@ -199,6 +208,15 @@
|
||||
<select class="form-select employeeName select2OptionIndexMobile" id="employeeSelectIndexMobile" aria-label="انتخاب پرسنل ...">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date-mobile" placeholder="تاریخ شروع" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="btn-clear-filter disable py-2 text-center d-block w-100 mt-2">
|
||||
<span class="w-100">حذف جستجو</span>
|
||||
@@ -216,7 +234,7 @@
|
||||
<button type="button" class="btn-cancel w-100" data-bs-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="submit" class="btn-search btn-search-click w-100">جستجو</button>
|
||||
<button type="submit" class="btn-search btn-search-click-mobile w-100">جستجو</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -239,6 +257,8 @@
|
||||
@section Script {
|
||||
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
|
||||
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
|
||||
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var salaryaidListLoadDataAjax = `@Url.Page("./Index", "LoadDataAjax")`;
|
||||
|
||||
@@ -46,13 +46,6 @@
|
||||
<None Remove="wwwroot\webcamjs\flash\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="Areas\Client\Pages\Company\Fine\CRUDFineSubjectModal.cshtml" />
|
||||
<Content Remove="Areas\Client\Pages\Company\Fine\Index.cshtml" />
|
||||
<Content Remove="Areas\Client\Pages\Company\Fine\ModalCreateNewFine.cshtml" />
|
||||
<Content Remove="Areas\Client\Pages\Company\Fine\ModalEditFine.cshtml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AccountManagement.Configuration\AccountManagement.Configuration.csproj" />
|
||||
<ProjectReference Include="..\backService\backService.csproj" />
|
||||
|
||||
@@ -182,16 +182,41 @@ $(document).ready(function () {
|
||||
|
||||
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
|
||||
|
||||
new Cleave(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`, {
|
||||
|
||||
|
||||
const newStartTimeInput = $(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`);
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newEndTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`, {
|
||||
new Cleave(newEndTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
//new Cleave(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
//new Cleave(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
updateAddButtonText(currentCount + 1);
|
||||
|
||||
if (currentCount + 1 === 3) {
|
||||
|
||||
@@ -182,16 +182,40 @@ $(document).ready(function () {
|
||||
|
||||
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
|
||||
|
||||
new Cleave(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`, {
|
||||
|
||||
const newStartTimeInput = $(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`);
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newEndTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`, {
|
||||
new Cleave(newEndTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
//new Cleave(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
//new Cleave(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
updateAddButtonText(currentCount + 1);
|
||||
|
||||
if (currentCount + 1 === 3) {
|
||||
|
||||
@@ -182,16 +182,42 @@ $(document).ready(function () {
|
||||
|
||||
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
|
||||
|
||||
new Cleave(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`, {
|
||||
|
||||
|
||||
const newStartTimeInput = $(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`);
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newEndTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`, {
|
||||
new Cleave(newEndTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
|
||||
//new Cleave(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
//new Cleave(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
updateAddButtonText(currentCount + 1);
|
||||
|
||||
if (currentCount + 1 === 3) {
|
||||
|
||||
@@ -181,32 +181,84 @@
|
||||
});
|
||||
/////////////////Time Input Validatet/////////////////
|
||||
|
||||
$('#StartHoures').on("keyup", function () {
|
||||
var isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
if (isValid) {
|
||||
$(this).addClass("validTime");
|
||||
$(this).removeClass("invalidTime");
|
||||
if ($('#EndHours').hasClass('validTime') && $('#EndHours').val() != null) {
|
||||
computeHourse();
|
||||
}
|
||||
} else {
|
||||
$(this).removeClass("validTime");
|
||||
$(this).addClass("invalidTime");
|
||||
}
|
||||
});
|
||||
$('#EndHours').on("keyup", function () {
|
||||
var isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
if (isValid) {
|
||||
$(this).addClass("validTime");
|
||||
$(this).removeClass("invalidTime");
|
||||
if ($('#StartHoures').hasClass('validTime') && $('#StartHoures').val() != null) {
|
||||
computeHourse();
|
||||
}
|
||||
} else {
|
||||
$(this).removeClass("validTime");
|
||||
$(this).addClass("invalidTime");
|
||||
}
|
||||
});
|
||||
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
});
|
||||
|
||||
$("#StartHoures, #EndHours").on("keyup", validateTimeOrder);
|
||||
function parseTimeToMinutes(time) {
|
||||
const [hours, minutes] = time.split(':').map(Number);
|
||||
return hours * 60 + minutes;
|
||||
}
|
||||
|
||||
function validateTimeOrder() {
|
||||
const startTime = $("#StartHoures").val();
|
||||
const endTime = $("#EndHours").val();
|
||||
|
||||
if (startTime && endTime) {
|
||||
const startMinutes = parseTimeToMinutes(startTime);
|
||||
const endMinutes = parseTimeToMinutes(endTime);
|
||||
|
||||
if (startMinutes >= endMinutes) {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('ساعت شروع و پایان نامعتبر است');
|
||||
|
||||
$("#StartHoures, #EndHours").addClass("invalidTime").removeClass("validTime");
|
||||
|
||||
return false;
|
||||
} else {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
|
||||
$("#StartHoures, #EndHours").addClass("validTime").removeClass("invalidTime");
|
||||
}
|
||||
|
||||
if ($("#StartHoures").val().length === 5 && $("#EndHours").val().length === 5) {
|
||||
computeHourse();
|
||||
}
|
||||
} else {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//$('#StartHoures').on("keyup", function () {
|
||||
// var isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
// if (isValid) {
|
||||
// $(this).addClass("validTime");
|
||||
// $(this).removeClass("invalidTime");
|
||||
// if ($('#EndHours').hasClass('validTime') && $('#EndHours').val() != null) {
|
||||
// computeHourse();
|
||||
// }
|
||||
// } else {
|
||||
// $(this).removeClass("validTime");
|
||||
// $(this).addClass("invalidTime");
|
||||
// }
|
||||
// });
|
||||
//$('#EndHours').on("keyup", function () {
|
||||
// var isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
// if (isValid) {
|
||||
// $(this).addClass("validTime");
|
||||
// $(this).removeClass("invalidTime");
|
||||
// if ($('#StartHoures').hasClass('validTime') && $('#StartHoures').val() != null) {
|
||||
// computeHourse();
|
||||
// }
|
||||
// } else {
|
||||
// $(this).removeClass("validTime");
|
||||
// $(this).addClass("invalidTime");
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
$('#employeeSelect').change(function () {
|
||||
|
||||
@@ -270,6 +270,14 @@ function editOperation(id) {
|
||||
subjectTitle.css('display', 'block');
|
||||
subjectTitle.focus();
|
||||
|
||||
|
||||
let element = $(`#editAmountSubject_${id}`);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
|
||||
new Cleave(`#editAmountSubject_${id}`, {
|
||||
numeral: true,
|
||||
numeralThousandsGroupStyle: 'thousand'
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
var pageIndexJs = 0;
|
||||
var searchName = '';
|
||||
var searchStartDateTime = '';
|
||||
var searchEndDateTime = '';
|
||||
|
||||
$(document).ready(function () {
|
||||
loadFineList();
|
||||
@@ -23,6 +24,19 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
});
|
||||
//******************** انتخاب همه ی چک باکس ها ********************
|
||||
$(".checkAll").change(function () {
|
||||
//let dataValYear = $('#year').val();
|
||||
@@ -61,38 +75,82 @@ $(document).on('click', ".openAction", function () {
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-search-click, .btn-search-click-mobile', function () {
|
||||
$('.btn-clear-filter').removeClass('disable');
|
||||
searchName = $('.employeeName');
|
||||
//searchStartDateTime = $('.startDateTime').val();
|
||||
let isMobile = $(this).hasClass('btn-search-click-mobile');
|
||||
|
||||
if (searchName.val() === "0") {
|
||||
searchStartDateTime = isMobile ? $('#start-date-mobile').val() : $('#start-date').val();
|
||||
searchEndDateTime = isMobile ? $('#end-date-mobile').val() : $('#end-date').val();
|
||||
searchName = isMobile ? $('#employeeSelectIndexMobile') : $('#employeeSelectIndex');
|
||||
|
||||
if ((searchStartDateTime === '' && searchEndDateTime !== '') || (searchStartDateTime !== '' && searchEndDateTime === '')) {
|
||||
if (isMobile) {
|
||||
$('#start-date-mobile').addClass("errored");
|
||||
$('#end-date-mobile').addClass("errored");
|
||||
} else {
|
||||
$('#start-date').addClass("errored");
|
||||
$('#end-date').addClass("errored");
|
||||
}
|
||||
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('برای جستجوی تاریخ، می بایست تاریخ شروع و پایان را مشخص نمایید');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
$('#start-date, #end-date, #start-date-mobile, #end-date-mobile').removeClass("errored");
|
||||
|
||||
}, 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
$('.btn-clear-filter').removeClass('disable');
|
||||
if (searchName.val() === "0" && searchStartDateTime === "" && searchEndDateTime === "") {
|
||||
$('.btn-clear-filter').addClass('disable');
|
||||
}
|
||||
$('#searchModal').modal('hide');
|
||||
|
||||
if (isMobile) {
|
||||
$('#searchModal').modal('hide');
|
||||
}
|
||||
|
||||
pageIndexJs = 0;
|
||||
$('#fineListAjax').html('');
|
||||
$('#PageIndex').val(0);
|
||||
pageIndexJs = 0;
|
||||
loadFineList();
|
||||
});
|
||||
$(document).on('click', '.btn-clear-filter', function () {
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
|
||||
// When typing in the desktop search
|
||||
// همگامسازی متن ورودی برای موبایل و دسکتاپ
|
||||
$('.d-none.d-md-block .employeeName').on('input', function () {
|
||||
var desktopInput = $(this).val();
|
||||
$('#searchModal .employeeName').val(desktopInput);
|
||||
});
|
||||
|
||||
// When typing in the mobile search
|
||||
$('#searchModal .employeeName').on('input', function () {
|
||||
var mobileInput = $(this).val();
|
||||
$('.d-none.d-md-block .employeeName').val(mobileInput);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.d-none.d-md-block #start-date').on('input change', function () {
|
||||
var desktopStartDate = $(this).val();
|
||||
$('#searchModal #start-date-mobile').val(desktopStartDate);
|
||||
});
|
||||
$('#searchModal #start-date-mobile').on('input change', function () {
|
||||
var mobileStartDate = $(this).val();
|
||||
$('.d-none.d-md-block #start-date').val(mobileStartDate);
|
||||
});
|
||||
|
||||
|
||||
$('.d-none.d-md-block #end-date').on('input change', function () {
|
||||
var desktopEndDate = $(this).val();
|
||||
$('#searchModal #end-date-mobile').val(desktopEndDate);
|
||||
});
|
||||
$('#searchModal #end-date-mobile').on('input change', function () {
|
||||
var mobileEndDate = $(this).val();
|
||||
$('.d-none.d-md-block #end-date').val(mobileEndDate);
|
||||
});
|
||||
// همگامسازی متن ورودی برای موبایل و دسکتاپ
|
||||
|
||||
$('.goToTop').on('click', function () {
|
||||
$('html, body').animate({ scrollTop: 0 }, 360);
|
||||
return false;
|
||||
@@ -144,7 +202,9 @@ function loadFineList() {
|
||||
|
||||
var searchViewModel = {
|
||||
'PageIndex': pageIndex,
|
||||
'EmployeeId': $('#employeeSelectIndex').val()
|
||||
'EmployeeId': $('#employeeSelectIndex').val(),
|
||||
'StartDate': $('#start-date').val(),
|
||||
'EndDate': $('#end-date').val()
|
||||
}
|
||||
|
||||
var b = pageIndexJs % 30;
|
||||
|
||||
@@ -37,6 +37,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-currency").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
numeral: true,
|
||||
numeralThousandsGroupStyle: 'thousand'
|
||||
@@ -44,6 +50,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
|
||||
@@ -15,6 +15,12 @@
|
||||
});
|
||||
|
||||
$(".form-control-currency").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
numeral: true,
|
||||
numeralThousandsGroupStyle: 'thousand'
|
||||
@@ -22,6 +28,12 @@
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
|
||||
@@ -463,6 +463,12 @@
|
||||
/////////////////Time Input Validatet/////////////////
|
||||
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
var pageIndexJs = 0;
|
||||
var searchName = '';
|
||||
var searchStartDateTime = '';
|
||||
var searchEndDateTime = '';
|
||||
|
||||
$(document).ready(function () {
|
||||
loadLoanList();
|
||||
@@ -24,6 +25,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
@@ -67,41 +74,85 @@ $(document).on('click', ".openAction", function () {
|
||||
$(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-search-click, .btn-search-click-mobile', function () {
|
||||
pageIndexJs = 0;
|
||||
$('#loanListAjax').html('');
|
||||
$('.btn-clear-filter').removeClass('disable');
|
||||
searchName = $('.employeeName');
|
||||
//searchStartDateTime = $('.startDateTime').val();
|
||||
let isMobile = $(this).hasClass('btn-search-click-mobile');
|
||||
|
||||
if (searchName.val() === "0") {
|
||||
searchStartDateTime = isMobile ? $('#start-date-mobile').val() : $('#start-date').val();
|
||||
searchEndDateTime = isMobile ? $('#end-date-mobile').val() : $('#end-date').val();
|
||||
searchName = isMobile ? $('#employeeSelectIndexMobile') : $('#employeeSelectIndex');
|
||||
|
||||
if ((searchStartDateTime === '' && searchEndDateTime !== '') || (searchStartDateTime !== '' && searchEndDateTime === '')) {
|
||||
if (isMobile) {
|
||||
$('#start-date-mobile').addClass("errored");
|
||||
$('#end-date-mobile').addClass("errored");
|
||||
} else {
|
||||
$('#start-date').addClass("errored");
|
||||
$('#end-date').addClass("errored");
|
||||
}
|
||||
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('برای جستجوی تاریخ، می بایست تاریخ شروع و پایان را مشخص نمایید');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
$('#start-date, #end-date, #start-date-mobile, #end-date-mobile').removeClass("errored");
|
||||
|
||||
}, 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
$('.btn-clear-filter').removeClass('disable');
|
||||
if (searchName.val() === "0" && searchStartDateTime === "" && searchEndDateTime === "") {
|
||||
$('.btn-clear-filter').addClass('disable');
|
||||
}
|
||||
$('#searchModal').modal('hide');
|
||||
|
||||
if (isMobile) {
|
||||
$('#searchModal').modal('hide');
|
||||
}
|
||||
|
||||
pageIndexJs = 0;
|
||||
$('#loanListAjax').html('');
|
||||
$('#PageIndex').val(0);
|
||||
pageIndexJs = 0;
|
||||
loadLoanList();
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-clear-filter', function () {
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
|
||||
// When typing in the desktop search
|
||||
// همگامسازی متن ورودی برای موبایل و دسکتاپ
|
||||
$('.d-none.d-md-block .employeeName').on('input', function () {
|
||||
var desktopInput = $(this).val();
|
||||
$('#searchModal .employeeName').val(desktopInput);
|
||||
});
|
||||
|
||||
// When typing in the mobile search
|
||||
$('#searchModal .employeeName').on('input', function () {
|
||||
var mobileInput = $(this).val();
|
||||
$('.d-none.d-md-block .employeeName').val(mobileInput);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.d-none.d-md-block #start-date').on('input change', function () {
|
||||
var desktopStartDate = $(this).val();
|
||||
$('#searchModal #start-date-mobile').val(desktopStartDate);
|
||||
});
|
||||
$('#searchModal #start-date-mobile').on('input change', function () {
|
||||
var mobileStartDate = $(this).val();
|
||||
$('.d-none.d-md-block #start-date').val(mobileStartDate);
|
||||
});
|
||||
|
||||
|
||||
$('.d-none.d-md-block #end-date').on('input change', function () {
|
||||
var desktopEndDate = $(this).val();
|
||||
$('#searchModal #end-date-mobile').val(desktopEndDate);
|
||||
});
|
||||
$('#searchModal #end-date-mobile').on('input change', function () {
|
||||
var mobileEndDate = $(this).val();
|
||||
$('.d-none.d-md-block #end-date').val(mobileEndDate);
|
||||
});
|
||||
// همگامسازی متن ورودی برای موبایل و دسکتاپ
|
||||
|
||||
|
||||
$('.goToTop').on('click', function () {
|
||||
$('html, body').animate({ scrollTop: 0 }, 360);
|
||||
return false;
|
||||
@@ -152,7 +203,9 @@ function loadLoanList() {
|
||||
|
||||
var searchViewModel = {
|
||||
'PageIndex': pageIndex,
|
||||
'EmployeeId': $('#employeeSelectIndex').val()
|
||||
'EmployeeId': $('#employeeSelectIndex').val(),
|
||||
'StartDate': $('#start-date').val(),
|
||||
'EndDate': $('#end-date').val()
|
||||
}
|
||||
|
||||
var b = pageIndexJs % 30;
|
||||
|
||||
@@ -39,6 +39,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-currency").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
numeral: true,
|
||||
numeralThousandsGroupStyle: 'thousand'
|
||||
@@ -46,6 +52,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
var pageIndexJs = 0;
|
||||
var searchName = '';
|
||||
var searchStartDateTime = '';
|
||||
var searchEndDateTime = '';
|
||||
|
||||
$(document).ready(function () {
|
||||
loadRewardList();
|
||||
@@ -24,6 +25,19 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
});
|
||||
|
||||
//******************** انتخاب همه ی چک باکس ها ********************
|
||||
$(".checkAll").change(function () {
|
||||
@@ -63,19 +77,44 @@ $(document).on('click', ".openAction", function () {
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-search-click, .btn-search-click-mobile', function () {
|
||||
$('.btn-clear-filter').removeClass('disable');
|
||||
searchName = $('.employeeName');
|
||||
//searchStartDateTime = $('.startDateTime').val();
|
||||
let isMobile = $(this).hasClass('btn-search-click-mobile');
|
||||
|
||||
if (searchName.val() === "0") {
|
||||
searchStartDateTime = isMobile ? $('#start-date-mobile').val() : $('#start-date').val();
|
||||
searchEndDateTime = isMobile ? $('#end-date-mobile').val() : $('#end-date').val();
|
||||
searchName = isMobile ? $('#employeeSelectIndexMobile') : $('#employeeSelectIndex');
|
||||
|
||||
if ((searchStartDateTime === '' && searchEndDateTime !== '') || (searchStartDateTime !== '' && searchEndDateTime === '')) {
|
||||
if (isMobile) {
|
||||
$('#start-date-mobile').addClass("errored");
|
||||
$('#end-date-mobile').addClass("errored");
|
||||
} else {
|
||||
$('#start-date').addClass("errored");
|
||||
$('#end-date').addClass("errored");
|
||||
}
|
||||
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('برای جستجوی تاریخ، می بایست تاریخ شروع و پایان را مشخص نمایید');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
$('#start-date, #end-date, #start-date-mobile, #end-date-mobile').removeClass("errored");
|
||||
|
||||
}, 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
$('.btn-clear-filter').removeClass('disable');
|
||||
if (searchName.val() === "0" && searchStartDateTime === "" && searchEndDateTime === "") {
|
||||
$('.btn-clear-filter').addClass('disable');
|
||||
}
|
||||
$('#searchModal').modal('hide');
|
||||
|
||||
if (isMobile) {
|
||||
$('#searchModal').modal('hide');
|
||||
}
|
||||
|
||||
pageIndexJs = 0;
|
||||
$('#rewardListAjax').html('');
|
||||
$('#PageIndex').val(0);
|
||||
pageIndexJs = 0;
|
||||
loadRewardList();
|
||||
});
|
||||
|
||||
@@ -83,18 +122,39 @@ $(document).on('click', '.btn-clear-filter', function () {
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
// When typing in the desktop search
|
||||
// همگامسازی متن ورودی برای موبایل و دسکتاپ
|
||||
$('.d-none.d-md-block .employeeName').on('input', function () {
|
||||
var desktopInput = $(this).val();
|
||||
$('#searchModal .employeeName').val(desktopInput);
|
||||
});
|
||||
|
||||
// When typing in the mobile search
|
||||
$('#searchModal .employeeName').on('input', function () {
|
||||
var mobileInput = $(this).val();
|
||||
$('.d-none.d-md-block .employeeName').val(mobileInput);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.d-none.d-md-block #start-date').on('input change', function () {
|
||||
var desktopStartDate = $(this).val();
|
||||
$('#searchModal #start-date-mobile').val(desktopStartDate);
|
||||
});
|
||||
$('#searchModal #start-date-mobile').on('input change', function () {
|
||||
var mobileStartDate = $(this).val();
|
||||
$('.d-none.d-md-block #start-date').val(mobileStartDate);
|
||||
});
|
||||
|
||||
|
||||
$('.d-none.d-md-block #end-date').on('input change', function () {
|
||||
var desktopEndDate = $(this).val();
|
||||
$('#searchModal #end-date-mobile').val(desktopEndDate);
|
||||
});
|
||||
$('#searchModal #end-date-mobile').on('input change', function () {
|
||||
var mobileEndDate = $(this).val();
|
||||
$('.d-none.d-md-block #end-date').val(mobileEndDate);
|
||||
});
|
||||
// همگامسازی متن ورودی برای موبایل و دسکتاپ
|
||||
|
||||
|
||||
$('.goToTop').on('click', function () {
|
||||
$('html, body').animate({ scrollTop: 0 }, 360);
|
||||
return false;
|
||||
@@ -145,7 +205,9 @@ function loadRewardList() {
|
||||
|
||||
var searchViewModel = {
|
||||
'PageIndex': pageIndex,
|
||||
'EmployeeId': $('#employeeSelectIndex').val()
|
||||
'EmployeeId': $('#employeeSelectIndex').val(),
|
||||
'StartDate': $('#start-date').val(),
|
||||
'EndDate': $('#end-date').val()
|
||||
}
|
||||
|
||||
var b = pageIndexJs % 30;
|
||||
|
||||
@@ -33,6 +33,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-currency").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
numeral: true,
|
||||
numeralThousandsGroupStyle: 'thousand'
|
||||
@@ -40,6 +46,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
|
||||
@@ -16,6 +16,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-currency").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
numeral: true,
|
||||
numeralThousandsGroupStyle: 'thousand'
|
||||
@@ -23,6 +29,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
}
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
@@ -25,6 +31,12 @@
|
||||
});
|
||||
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
@@ -98,16 +110,41 @@
|
||||
|
||||
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
|
||||
|
||||
new Cleave(`input[name="Command.RollCallRecords[${currentCount}].StartTime"]`, {
|
||||
|
||||
|
||||
const newStartTimeInput = $(`input[name="Command.RollCallRecords[${currentCount}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.RollCallRecords[${currentCount}].EndTime"]`);
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newEndTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(`input[name="Command.RollCallRecords[${currentCount}].EndTime"]`, {
|
||||
new Cleave(newEndTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${currentCount}].StartTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${currentCount}].EndTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
updateAddButtonText(currentCount + 1);
|
||||
|
||||
if (currentCount + 1 === 5) {
|
||||
@@ -400,7 +437,7 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
|
||||
if (response.hasLeave) {
|
||||
htmlElement = `
|
||||
<div class="text-center">این پرسنل مرخصی ثبت شده است.</div>
|
||||
<div class="text-center">برای این پرسنل مرخصی ثبت شده است.</div>
|
||||
`;
|
||||
$('#appendChildTimeWorkHtml').html(htmlElement);
|
||||
$('.btn-register').addClass('disable');
|
||||
@@ -476,18 +513,44 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
|
||||
$('#appendChildTimeWorkHtml').html(htmlElement);
|
||||
|
||||
// Apply time formatting with Cleave.js
|
||||
new Cleave(`input[name="Command.RollCallRecords[${indexRollCallTime}].StartTime"]`,
|
||||
{
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(`input[name="Command.RollCallRecords[${indexRollCallTime}].EndTime"]`,
|
||||
{
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
const newStartTimeInput = $(`input[name="Command.RollCallRecords[${indexRollCallTime}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.RollCallRecords[${indexRollCallTime}].EndTime"]`);
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newEndTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(newEndTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
|
||||
// Apply time formatting with Cleave.js
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${indexRollCallTime}].StartTime"]`,
|
||||
// {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
// });
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${indexRollCallTime}].EndTime"]`,
|
||||
// {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
// });
|
||||
|
||||
// Update add button text
|
||||
updateAddButtonText(indexRollCallTime + 1);
|
||||
@@ -525,18 +588,41 @@ function fetchAndDisplayRollCallData(employeeId, dateFa) {
|
||||
|
||||
$('#appendChildTimeWorkHtml').html(htmlElement);
|
||||
|
||||
// Apply time formatting with Cleave.js
|
||||
new Cleave(`input[name="Command.RollCallRecords[0].StartTime"]`,
|
||||
{
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
const newStartTimeInput = $(`input[name="Command.RollCallRecords[0].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.RollCallRecords[0].EndTime"]`);
|
||||
|
||||
new Cleave(`input[name="Command.RollCallRecords[0].EndTime"]`,
|
||||
{
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newEndTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(newEndTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
//// Apply time formatting with Cleave.js
|
||||
//new Cleave(`input[name="Command.RollCallRecords[0].StartTime"]`,
|
||||
// {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
// });
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[0].EndTime"]`,
|
||||
// {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,12 @@ $(document).ready(function () {
|
||||
$('.btn-register').addClass('disable');
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
@@ -14,6 +20,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
@@ -86,16 +98,40 @@ $(document).ready(function () {
|
||||
|
||||
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
|
||||
|
||||
new Cleave(`input[name="Command.RollCallRecords[${currentCount}].StartTime"]`, {
|
||||
const newStartTimeInput = $(`input[name="Command.RollCallRecords[${currentCount}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.RollCallRecords[${currentCount}].EndTime"]`);
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newEndTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(`input[name="Command.RollCallRecords[${currentCount}].EndTime"]`, {
|
||||
new Cleave(newEndTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${currentCount}].StartTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
//new Cleave(`input[name="Command.RollCallRecords[${currentCount}].EndTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
updateAddButtonText(currentCount + 1);
|
||||
|
||||
if (currentCount + 1 === 5) {
|
||||
|
||||
@@ -15,6 +15,12 @@
|
||||
});
|
||||
|
||||
$(".form-control-currency").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
numeral: true,
|
||||
numeralThousandsGroupStyle: 'thousand'
|
||||
@@ -22,6 +28,12 @@
|
||||
});
|
||||
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
@@ -157,16 +169,39 @@ $(document).ready(function () {
|
||||
|
||||
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
|
||||
|
||||
new Cleave(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`, {
|
||||
const newStartTimeInput = $(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`);
|
||||
const newEndTimeInput = $(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`);
|
||||
|
||||
newStartTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
newEndTimeInput.on('input', function () {
|
||||
const value = convertPersianNumbersToEnglish($(this).val());
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
new Cleave(newStartTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
new Cleave(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`, {
|
||||
new Cleave(newEndTimeInput[0], {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
});
|
||||
|
||||
//new Cleave(`input[name="Command.ShiftsList[${currentCount}].StartTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
//new Cleave(`input[name="Command.ShiftsList[${currentCount}].EndTime"]`, {
|
||||
// time: true,
|
||||
// timePattern: ['h', 'm']
|
||||
//});
|
||||
|
||||
updateAddButtonText(currentCount + 1);
|
||||
|
||||
if (currentCount + 1 === 3) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
var pageIndexJs = 0;
|
||||
var searchName = '';
|
||||
var searchStartDateTime = '';
|
||||
var searchEndDateTime = '';
|
||||
|
||||
$(document).ready(function () {
|
||||
loadSalaryAidList();
|
||||
@@ -24,6 +25,19 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
});
|
||||
|
||||
//******************** انتخاب همه ی چک باکس ها ********************
|
||||
$(".checkAll").change(function () {
|
||||
@@ -63,37 +77,83 @@ $(document).on('click', ".openAction", function () {
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-search-click, .btn-search-click-mobile', function () {
|
||||
$('.btn-clear-filter').removeClass('disable');
|
||||
searchName = $('.employeeName');
|
||||
//searchStartDateTime = $('.startDateTime').val();
|
||||
let isMobile = $(this).hasClass('btn-search-click-mobile');
|
||||
|
||||
if (searchName.val() === "0") {
|
||||
searchStartDateTime = isMobile ? $('#start-date-mobile').val() : $('#start-date').val();
|
||||
searchEndDateTime = isMobile ? $('#end-date-mobile').val() : $('#end-date').val();
|
||||
searchName = isMobile ? $('#employeeSelectIndexMobile') : $('#employeeSelectIndex');
|
||||
|
||||
if ((searchStartDateTime === '' && searchEndDateTime !== '') || (searchStartDateTime !== '' && searchEndDateTime === '')) {
|
||||
if (isMobile) {
|
||||
$('#start-date-mobile').addClass("errored");
|
||||
$('#end-date-mobile').addClass("errored");
|
||||
} else {
|
||||
$('#start-date').addClass("errored");
|
||||
$('#end-date').addClass("errored");
|
||||
}
|
||||
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('برای جستجوی تاریخ، می بایست تاریخ شروع و پایان را مشخص نمایید');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
$('#start-date, #end-date, #start-date-mobile, #end-date-mobile').removeClass("errored");
|
||||
|
||||
}, 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
$('.btn-clear-filter').removeClass('disable');
|
||||
if (searchName.val() === "0" && searchStartDateTime === "" && searchEndDateTime === "") {
|
||||
$('.btn-clear-filter').addClass('disable');
|
||||
}
|
||||
$('#searchModal').modal('hide');
|
||||
|
||||
if (isMobile) {
|
||||
$('#searchModal').modal('hide');
|
||||
}
|
||||
|
||||
pageIndexJs = 0;
|
||||
$('#salaryaidListAjax').html('');
|
||||
$('#PageIndex').val(0);
|
||||
pageIndexJs = 0;
|
||||
loadSalaryAidList();
|
||||
});
|
||||
$(document).on('click', '.btn-clear-filter', function () {
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
// When typing in the desktop search
|
||||
// همگامسازی متن ورودی برای موبایل و دسکتاپ
|
||||
$('.d-none.d-md-block .employeeName').on('input', function () {
|
||||
var desktopInput = $(this).val();
|
||||
$('#searchModal .employeeName').val(desktopInput);
|
||||
});
|
||||
|
||||
// When typing in the mobile search
|
||||
$('#searchModal .employeeName').on('input', function () {
|
||||
var mobileInput = $(this).val();
|
||||
$('.d-none.d-md-block .employeeName').val(mobileInput);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.d-none.d-md-block #start-date').on('input change', function () {
|
||||
var desktopStartDate = $(this).val();
|
||||
$('#searchModal #start-date-mobile').val(desktopStartDate);
|
||||
});
|
||||
$('#searchModal #start-date-mobile').on('input change', function () {
|
||||
var mobileStartDate = $(this).val();
|
||||
$('.d-none.d-md-block #start-date').val(mobileStartDate);
|
||||
});
|
||||
|
||||
|
||||
$('.d-none.d-md-block #end-date').on('input change', function () {
|
||||
var desktopEndDate = $(this).val();
|
||||
$('#searchModal #end-date-mobile').val(desktopEndDate);
|
||||
});
|
||||
$('#searchModal #end-date-mobile').on('input change', function () {
|
||||
var mobileEndDate = $(this).val();
|
||||
$('.d-none.d-md-block #end-date').val(mobileEndDate);
|
||||
});
|
||||
// همگامسازی متن ورودی برای موبایل و دسکتاپ
|
||||
|
||||
|
||||
$('.goToTop').on('click', function () {
|
||||
$('html, body').animate({ scrollTop: 0 }, 360);
|
||||
return false;
|
||||
@@ -145,7 +205,9 @@ function loadSalaryAidList() {
|
||||
|
||||
var searchViewModel = {
|
||||
'PageIndex': pageIndex,
|
||||
'EmployeeId': $('#employeeSelectIndex').val()
|
||||
'EmployeeId': $('#employeeSelectIndex').val(),
|
||||
'StartDate': $('#start-date').val(),
|
||||
'EndDate': $('#end-date').val()
|
||||
}
|
||||
|
||||
var b = pageIndexJs % 30;
|
||||
|
||||
@@ -33,6 +33,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-currency").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
numeral: true,
|
||||
numeralThousandsGroupStyle: 'thousand'
|
||||
@@ -40,6 +46,12 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(".form-control-date").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
delimiter: '/',
|
||||
|
||||
@@ -449,6 +449,12 @@
|
||||
/////////////////Time Input Validatet/////////////////
|
||||
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
element.val(value);
|
||||
});
|
||||
|
||||
new Cleave(this, {
|
||||
time: true,
|
||||
timePattern: ['h', 'm']
|
||||
|
||||
Reference in New Issue
Block a user