ClassificationSalariestab and create front completed
This commit is contained in:
@@ -10,14 +10,17 @@ public class ClassificationGroupJob : EntityBaseWithoutCreationDate
|
||||
/// </summary>
|
||||
/// <param name="jobId"></param>
|
||||
/// <param name="jobName"></param>
|
||||
/// <param name="jobCode"></param>
|
||||
/// <param name="classificationGroupId"></param>
|
||||
/// <param name="groupNo"></param>
|
||||
public ClassificationGroupJob(long jobId, string jobName, long classificationGroupId, string groupNo)
|
||||
public ClassificationGroupJob(long jobId, string jobName, string jobCode, long classificationGroupId, string groupNo)
|
||||
{
|
||||
JobId = jobId;
|
||||
JobName = jobName;
|
||||
JobCode = jobCode;
|
||||
ClassificationGroupId = classificationGroupId;
|
||||
GroupNo = groupNo;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Company.Domain.ClassificationSchemeAgg;
|
||||
public class ClassificationGroupSalary : EntityBase
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد دستمزد برای گروه
|
||||
/// </summary>
|
||||
|
||||
@@ -22,6 +22,29 @@ public interface IClassificationGroupRepository : IRepository<long, Classificati
|
||||
/// <returns></returns>
|
||||
Task<List<EditClassificationGroupJob>> GetGroupJobs(long groupId);
|
||||
|
||||
/// <summary>
|
||||
/// چک میکند که آی پرسنلی وجود دارد که این شغل به او نسبت داده شده
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="groupId"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> CheckEmployeeHasThisJob(long id, long groupId);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد مشاغل
|
||||
/// </summary>
|
||||
/// <param name="createClassificationGroupJob"></param>
|
||||
/// <param name="deleteJobList"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> CreateJobs(List<ClassificationGroupJob> createClassificationGroupJob, List<long> deleteJobList);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// در یافت اطلاعات گروه برای لود مودال ایجاد دستمزد های
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<SalaryAndRialCoefficientModel> GetGroupToCreateSalariesModal(long schemeId);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد گروه های بیست گانه
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.ClassificationScheme;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Company.Domain.ClassificationSchemeAgg;
|
||||
|
||||
public interface IClassificationGroupSalariesRepository : IRepository<long, ClassificationGroupSalary>
|
||||
{
|
||||
/// <summary>
|
||||
/// ایجاد دستمزدهای گروه ها
|
||||
/// </summary>
|
||||
/// <param name="createClassificationGroupSalary"></param>
|
||||
/// <returns></returns>
|
||||
Task CreateSalaries(List<ClassificationGroupSalary> createClassificationGroupSalary);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// لیست دستمزدها بر اساس تاریخ و سال برای تب دستمزدها
|
||||
/// </summary>
|
||||
/// <param name="schemeId"></param>
|
||||
/// <returns></returns>
|
||||
Task<SalaryAndRialCoefficientTab> GetSalariesTabData(long schemeId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.ClassificationSchemeAgg;
|
||||
|
||||
public interface IClassificationRialCoefficientRepository : IRepository<long, ClassificationRialCoefficient>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using _0_Framework.Application.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -44,8 +45,141 @@ public class CreateClassificationGroupSalaryAndRialCoefficient
|
||||
public int Year { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش دستمزد
|
||||
/// </summary>
|
||||
public class EditClassificationGroupSalaryAndRialCoefficient : CreateClassificationGroupSalaryAndRialCoefficient
|
||||
{
|
||||
/// <summary>
|
||||
/// آی دی
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string StartDateFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string EndDateFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دستمزد گروه
|
||||
/// </summary>
|
||||
public string GroupSalaryStr { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// لیست دستمزدها و ضرایب ریالی
|
||||
/// </summary>
|
||||
public class SalaryAndRialCoefficientModel
|
||||
{
|
||||
/// <summary>
|
||||
/// تاریخ شروع
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime StartDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string StartDateFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime EndDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string EndDateFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سال
|
||||
/// </summary>
|
||||
public int Year { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ضریب ریالی
|
||||
/// string
|
||||
/// </summary>
|
||||
public double RialCoefficient { get; private set; }
|
||||
public string RialCoefficientStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ضریب ریالی
|
||||
/// double
|
||||
/// </summary>
|
||||
public double RialCoefficient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی طرح
|
||||
/// </summary>
|
||||
public long SchemeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع ضریب
|
||||
/// </summary>
|
||||
public TypeOfCoefficient TypeOfCoefficient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست دستمزدها و ضرایب بر اساس سال
|
||||
/// </summary>
|
||||
public List<EditClassificationGroupSalaryAndRialCoefficient> SalariesAndCoefficientList { get; set; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// تب دستمزد ها و ضرایب ریالی
|
||||
/// </summary>
|
||||
public class SalaryAndRialCoefficientTab
|
||||
{
|
||||
/// <summary>
|
||||
/// آی دی طرح
|
||||
/// </summary>
|
||||
public long SchemeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا دستمزدی قبلا ایجاد شده است؟
|
||||
/// </summary>
|
||||
public bool HasAnySalaries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست دستمزدها و ضرایب
|
||||
/// </summary>
|
||||
public List<SalaryAndRialCoefficientTabDataList> SalaryAndRialCoefficientTabDataList { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// لیست دستمزدها
|
||||
/// </summary>
|
||||
public class SalaryAndRialCoefficientTabDataList
|
||||
{
|
||||
/// <summary>
|
||||
/// تاریخ شروع
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string StartDateFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string EndDateFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سال
|
||||
/// </summary>
|
||||
public int Year { get; set; }
|
||||
}
|
||||
@@ -55,19 +55,42 @@ public interface IClassificationSchemeApplication
|
||||
/// <returns></returns>
|
||||
Task<List<EditClassificationGroupJob>> GetGroupJobs(long groupId);
|
||||
|
||||
/// <summary>
|
||||
/// چک میکند که آی پرسنلی وجود دارد که این شغل به او نسبت داده شده
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="groupId"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> CheckEmployeeHasThisJob(long id, long groupId);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد مشاغل گروه
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <param name="createClassificationGroupJob"></param>
|
||||
/// <param name="deleteJobList"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateGroupJobs(ClassificationGroupAndJobModel command);
|
||||
Task<bool> CreateGroupJobs(List<CreateClassificationGroupJob> createClassificationGroupJob, List<long> deleteJobList);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// چک میکند که آیا برای این طرح تابحال دستمزدی ایجاد شده یا نه
|
||||
/// </summary>
|
||||
/// <param name="schemeId"></param>
|
||||
/// <returns></returns>
|
||||
Task<SalaryAndRialCoefficientTab> GetSalariesTabData(long schemeId);
|
||||
|
||||
/// <summary>
|
||||
/// در یافت اطلاعات گروه برای لود مودال ایجاد دستمزد های
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<SalaryAndRialCoefficientModel> GetGroupToCreateSalariesModal(long schemeId);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد دستمزدها و ضرایب ریالی هر گروه در هر سال
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateGroupSalaryAndCoefficient(CreateClassificationGroupSalaryAndRialCoefficient command);
|
||||
Task<OperationResult> CreateGroupSalaryAndCoefficient(SalaryAndRialCoefficientModel command);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using Company.Domain.ClassificationSchemeAgg;
|
||||
using CompanyManagment.App.Contracts.ClassificationScheme;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -11,11 +14,15 @@ public class ClassificationSchemeApplication : IClassificationSchemeApplication
|
||||
{
|
||||
private readonly IClassificationSchemeRepository _classificationSchemeRepository;
|
||||
private readonly IClassificationGroupRepository _classificationGroupRepository;
|
||||
private readonly IClassificationGroupSalariesRepository _classificationGroupSalariesRepository;
|
||||
private readonly IClassificationRialCoefficientRepository _classificationRialCoefficientRepository;
|
||||
|
||||
public ClassificationSchemeApplication(IClassificationSchemeRepository classificationSchemeRepository, IClassificationGroupRepository classificationGroupRepository)
|
||||
public ClassificationSchemeApplication(IClassificationSchemeRepository classificationSchemeRepository, IClassificationGroupRepository classificationGroupRepository, IClassificationGroupSalariesRepository classificationGroupSalariesRepository, IClassificationRialCoefficientRepository classificationRialCoefficientRepository)
|
||||
{
|
||||
_classificationSchemeRepository = classificationSchemeRepository;
|
||||
_classificationGroupRepository = classificationGroupRepository;
|
||||
_classificationGroupSalariesRepository = classificationGroupSalariesRepository;
|
||||
_classificationRialCoefficientRepository = classificationRialCoefficientRepository;
|
||||
}
|
||||
|
||||
public Task<ClassificationSchemePartialModel> ClassificationSchemePartialModel(long workshopId)
|
||||
@@ -120,13 +127,99 @@ public class ClassificationSchemeApplication : IClassificationSchemeApplication
|
||||
return await _classificationGroupRepository.GetGroupJobs(groupId);
|
||||
}
|
||||
|
||||
public Task<OperationResult> CreateGroupJobs(ClassificationGroupAndJobModel command)
|
||||
public async Task<bool> CheckEmployeeHasThisJob(long id, long groupId)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
return await _classificationGroupRepository.CheckEmployeeHasThisJob(id, groupId);
|
||||
}
|
||||
|
||||
public Task<OperationResult> CreateGroupSalaryAndCoefficient(CreateClassificationGroupSalaryAndRialCoefficient command)
|
||||
public async Task<bool> CreateGroupJobs(List<CreateClassificationGroupJob> createClassificationGroupJob, List<long> deleteJobList)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
var newJoblist = new List<ClassificationGroupJob>();
|
||||
if (createClassificationGroupJob.Count > 0)
|
||||
{
|
||||
foreach (var item in createClassificationGroupJob)
|
||||
{
|
||||
var newJob = new ClassificationGroupJob(item.JobId, item.JobName, item.JobCode, item.ClassificationGroupId,
|
||||
item.GroupNo);
|
||||
newJoblist.Add(newJob);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return await _classificationGroupRepository.CreateJobs(newJoblist, deleteJobList);
|
||||
}
|
||||
|
||||
public async Task<SalaryAndRialCoefficientTab> GetSalariesTabData(long schemeId)
|
||||
{
|
||||
return await _classificationGroupSalariesRepository.GetSalariesTabData(schemeId);
|
||||
}
|
||||
|
||||
public async Task<SalaryAndRialCoefficientModel> GetGroupToCreateSalariesModal(long schemeId)
|
||||
{
|
||||
return await _classificationGroupRepository.GetGroupToCreateSalariesModal(schemeId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<OperationResult> CreateGroupSalaryAndCoefficient(SalaryAndRialCoefficientModel command)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
#region Validation
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.StartDateFa) || string.IsNullOrWhiteSpace(command.StartDateFa))
|
||||
return op.Failed("تاریخ شروع و پایان نمی توانند خالی باشند");
|
||||
if (command.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient && string.IsNullOrWhiteSpace(command.RialCoefficientStr))
|
||||
return op.Failed("ضریب ریالی وارد نشده است");
|
||||
|
||||
|
||||
if (command.SalariesAndCoefficientList.Any(x=> string.IsNullOrWhiteSpace(x.GroupSalaryStr)))
|
||||
return op.Failed("دستمزد تمامی گروه ها می بایست تعیین شود");
|
||||
|
||||
#endregion
|
||||
|
||||
try
|
||||
{
|
||||
command.StartDate = command.StartDateFa.ToGeorgianDateTime();
|
||||
command.EndDate = command.EndDateFa.ToGeorgianDateTime();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return op.Failed("فرمت تاریخ اشتباه است");
|
||||
}
|
||||
|
||||
|
||||
var year = Convert.ToInt32(command.StartDateFa.Substring(0, 4));
|
||||
|
||||
var createSalaries = new List<ClassificationGroupSalary>();
|
||||
|
||||
foreach (var item in command.SalariesAndCoefficientList)
|
||||
{
|
||||
item.GroupSalary = item.GroupSalaryStr.MoneyToDouble();
|
||||
var create = new ClassificationGroupSalary(item.ClassificationGroupId,item.GroupNo,item.GroupSalary,command.StartDate,command.EndDate, year);
|
||||
createSalaries.Add(create);
|
||||
}
|
||||
|
||||
await _classificationGroupSalariesRepository.CreateSalaries(createSalaries);
|
||||
|
||||
if (command.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient)
|
||||
{
|
||||
try
|
||||
{
|
||||
command.RialCoefficient = command.RialCoefficientStr.MoneyToDouble();
|
||||
|
||||
await _classificationRialCoefficientRepository.CreateAsync(new ClassificationRialCoefficient(command.SchemeId,
|
||||
command.RialCoefficient, command.StartDate, command.EndDate, year));
|
||||
await _classificationRialCoefficientRepository.SaveChangesAsync();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return op.Failed("فرمت مبلغ ضریب ریالی اشتباه است");
|
||||
}
|
||||
}
|
||||
|
||||
op.SendId = command.SchemeId;
|
||||
return op.Succcedded();
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class ClassificationGroupRepository : RepositoryBase<long, Classification
|
||||
{
|
||||
|
||||
return await _context.ClassificationGroupJobs
|
||||
.Where(x => x.id == groupId).Select(jobs => new EditClassificationGroupJob()
|
||||
.Where(x => x.ClassificationGroupId == groupId).Select(jobs => new EditClassificationGroupJob()
|
||||
{
|
||||
Id = jobs.id,
|
||||
JobId = jobs.JobId,
|
||||
@@ -69,6 +69,71 @@ public class ClassificationGroupRepository : RepositoryBase<long, Classification
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// چک میکند که آی پرسنلی وجود دارد که این شغل به او نسبت داده شده
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="groupId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> CheckEmployeeHasThisJob(long id, long groupId)
|
||||
{
|
||||
return await _context.ClassificationEmployees.AnyAsync(x =>
|
||||
x.ClassificationGroupJobId == id && x.ClassificationGroupId == groupId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد مشاغل
|
||||
/// </summary>
|
||||
/// <param name="createClassificationGroupJob"></param>
|
||||
/// <param name="deleteJobList"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> CreateJobs(List<ClassificationGroupJob> createClassificationGroupJob, List<long> deleteJobList)
|
||||
{
|
||||
if (createClassificationGroupJob.Count > 0)
|
||||
{
|
||||
await _context.ClassificationGroupJobs.AddRangeAsync(createClassificationGroupJob);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
if (deleteJobList.Count > 0)
|
||||
{
|
||||
var deleteItems = _context.ClassificationGroupJobs.Where(x => deleteJobList.Contains(x.id));
|
||||
_context.ClassificationGroupJobs.RemoveRange(deleteItems);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// در یافت اطلاعات گروه برای لود مودال ایجاد دستمزد های
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<SalaryAndRialCoefficientModel> GetGroupToCreateSalariesModal(long schemeId)
|
||||
{
|
||||
var result = new SalaryAndRialCoefficientModel();
|
||||
var scheme =await _context.ClassificationSchemes.FirstOrDefaultAsync(x => x.id == schemeId);
|
||||
var groups =await _context.ClassificationGroups.Where(x => x.ClassificationSchemeId == schemeId).ToListAsync();
|
||||
|
||||
if (scheme != null)
|
||||
{
|
||||
result.TypeOfCoefficient = scheme.TypeOfCoefficient;
|
||||
result.SchemeId = schemeId;
|
||||
|
||||
result.SalariesAndCoefficientList = groups.Select(x => new EditClassificationGroupSalaryAndRialCoefficient
|
||||
{
|
||||
ClassificationGroupId = x.id,
|
||||
GroupNo = x.GroupNo,
|
||||
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد گروه های بیست گانه
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.ClassificationSchemeAgg;
|
||||
using CompanyManagment.App.Contracts.ClassificationScheme;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class ClassificationGroupSalariesRepository : RepositoryBase<long, ClassificationGroupSalary>, IClassificationGroupSalariesRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public ClassificationGroupSalariesRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
|
||||
public async Task CreateSalaries(List<ClassificationGroupSalary> createClassificationGroupSalary)
|
||||
{
|
||||
if (createClassificationGroupSalary.Count > 0)
|
||||
{
|
||||
await _context.ClassificationGroupSalaries.AddRangeAsync(createClassificationGroupSalary);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<SalaryAndRialCoefficientTab> GetSalariesTabData(long schemeId)
|
||||
{
|
||||
var scheme = await _context.ClassificationSchemes
|
||||
.Include(xg => xg.ClassificationGroups)
|
||||
.ThenInclude(xs => xs.ClassificationGroupSalaries)
|
||||
.FirstOrDefaultAsync(x => x.id == schemeId);
|
||||
|
||||
if (scheme == null)
|
||||
return null;
|
||||
|
||||
// جمعآوری همهی حقوقها از تمام گروهها
|
||||
var allSalaries = scheme.ClassificationGroups
|
||||
.SelectMany(g => g.ClassificationGroupSalaries)
|
||||
.ToList();
|
||||
|
||||
// اگر هیچ حقوقی وجود ندارد
|
||||
if (!allSalaries.Any())
|
||||
{
|
||||
return new SalaryAndRialCoefficientTab
|
||||
{
|
||||
SchemeId = scheme.id,
|
||||
HasAnySalaries = false,
|
||||
SalaryAndRialCoefficientTabDataList = new List<SalaryAndRialCoefficientTabDataList>()
|
||||
};
|
||||
}
|
||||
|
||||
// ✅ گروهبندی بر اساس StartDate و EndDate برای حذف موارد تکراری
|
||||
var distinctPeriods = allSalaries
|
||||
.GroupBy(s => new { s.StartDate, s.EndDate })
|
||||
.Select(g => g.First()) // فقط یکی از هر بازه تاریخ
|
||||
.OrderByDescending(x => x.StartDate)
|
||||
.ToList();
|
||||
|
||||
// ✅ تبدیل به مدل خروجی
|
||||
var dataList = distinctPeriods
|
||||
.Select(s => new SalaryAndRialCoefficientTabDataList
|
||||
{
|
||||
StartDateFa = s.StartDate.ToFarsi(),
|
||||
EndDateFa = s.EndDate.ToFarsi(),
|
||||
Year = s.Year// یا هر روش سال شمسی که داری
|
||||
})
|
||||
.ToList();
|
||||
|
||||
var result = new SalaryAndRialCoefficientTab
|
||||
{
|
||||
SchemeId = scheme.id,
|
||||
HasAnySalaries = allSalaries.Any(),
|
||||
SalaryAndRialCoefficientTabDataList = dataList
|
||||
};
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.ClassificationSchemeAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class ClassificationRialCoefficientRepository : RepositoryBase<long, ClassificationRialCoefficient>, IClassificationRialCoefficientRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public ClassificationRialCoefficientRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
}
|
||||
@@ -504,6 +504,8 @@ public class PersonalBootstrapper
|
||||
|
||||
|
||||
services.AddTransient<IClassificationGroupRepository, ClassificationGroupRepository>();
|
||||
services.AddTransient<IClassificationGroupSalariesRepository, ClassificationGroupSalariesRepository>();
|
||||
services.AddTransient<IClassificationRialCoefficientRepository, ClassificationRialCoefficientRepository>();
|
||||
|
||||
#endregion
|
||||
//=========End Of Main====================================
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<div style="max-width: 88%;margin: 0 auto;">
|
||||
<div class="col-xs-12" style="float: unset;">
|
||||
<div class="handle-title">
|
||||
<h3 id="titleHead">تنظیمات طرح طبقه بندی مشاغل</h3>
|
||||
<h3 id="titleHead">تنظیمات طرح طبقه بندی مشاغل <span style="color:#9f4d19"> > @Model.WorkshopName</span></h3>
|
||||
<a asp-page="./index" class="btn btn-rounded" type="button">
|
||||
<span>بازگشت</span>
|
||||
</a>
|
||||
@@ -53,7 +53,7 @@
|
||||
<span>تعیین مشاغل گروه ها</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="li-wizard step" id="salaiesTab" data-url="/Admin/Company/Workshops/ClassificationScheme?handler=CreateSalaries">
|
||||
<li class="li-wizard step" id="salariesTab" data-url="/Admin/Company/Workshops/ClassificationScheme?handler=SalariesTab">
|
||||
<a class="nav-link">
|
||||
<div class="success-icon" id="success-icon2" style="display:none;">
|
||||
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
@@ -104,7 +104,7 @@
|
||||
$("#schemeTab").addClass("active");
|
||||
|
||||
// کلیک روی تبها
|
||||
$("#schemeTab, #jobsTab, #salaiesTab, #addEmployeesTab").click(function (e) {
|
||||
$("#schemeTab, #jobsTab, #salariesTab, #addEmployeesTab").click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
@@ -118,24 +118,32 @@
|
||||
url += "&workshopId=" + workshopId;
|
||||
loadPartial(url);
|
||||
|
||||
$("#schemeTab, #jobsTab, #salaiesTab, #addEmployeesTab").removeClass("active");
|
||||
$("#schemeTab, #jobsTab, #salariesTab, #addEmployeesTab").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
break;
|
||||
case "jobsTab" :
|
||||
if(hasScheme === "true" && schemeId > 0){
|
||||
url += "&schemeId=" + schemeId;
|
||||
loadPartial(url);
|
||||
$("#schemeTab, #jobsTab, #salaiesTab, #addEmployeesTab").removeClass("active");
|
||||
$("#schemeTab, #jobsTab, #salariesTab, #addEmployeesTab").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
}else{
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', 'ابتدا باید طرح ایجاد کنید');
|
||||
}
|
||||
break;
|
||||
case "salaiesTab" :
|
||||
case "salariesTab" :
|
||||
if(hasScheme === "true"){
|
||||
checkEmptyGroup(function (result) {
|
||||
if (result) {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', 'لطفا ابتدا مشاغل تمامی گروه ها را تعیین نمایید');
|
||||
} else {
|
||||
url += "&schemeId=" + schemeId;
|
||||
loadPartial(url);
|
||||
$("#schemeTab, #jobsTab, #salaiesTab, #addEmployeesTab").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
$("#schemeTab, #jobsTab, #salariesTab, #addEmployeesTab").removeClass("active");
|
||||
$('#salariesTab').addClass("active");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}else{
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', 'ابتدا باید طرح ایجاد کنید');
|
||||
@@ -144,7 +152,7 @@
|
||||
case "addEmployeesTab" :
|
||||
if(hasScheme === "true"){
|
||||
loadPartial(url);
|
||||
$("#schemeTab, #jobsTab, #salaiesTab, #addEmployeesTab").removeClass("active");
|
||||
$("#schemeTab, #jobsTab, #salariesTab, #addEmployeesTab").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
|
||||
}else{
|
||||
@@ -161,6 +169,13 @@
|
||||
$("#partialContainer").html(data);
|
||||
});
|
||||
}
|
||||
|
||||
function checkEmptyGroup(callback) {
|
||||
var url = `/Admin/Company/Workshops/ClassificationScheme?handler=CheckEmptyGroup&schemeId=${schemeId}`;
|
||||
$.get(url, function (data) {
|
||||
callback(data.hasEmptyGroup);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CompanyManagment.App.Contracts.ClassificationScheme;
|
||||
using Company.Domain.ClassificationSchemeAgg;
|
||||
using CompanyManagment.App.Contracts.ClassificationScheme;
|
||||
using CompanyManagment.App.Contracts.Job;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
@@ -24,6 +25,11 @@ public class ClassificationSchemeModel : PageModel
|
||||
/// </summary>
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا طرح ایجاد شده
|
||||
/// </summary>
|
||||
@@ -33,9 +39,10 @@ public class ClassificationSchemeModel : PageModel
|
||||
/// آی دی طرح
|
||||
/// </summary>
|
||||
public long SchemeId { get; set; }
|
||||
public void OnGet(long workshopId)
|
||||
public void OnGet(long workshopId, string workshopName)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
WorkshopName = workshopName;
|
||||
var scheme = _classificationSchemeApplication.ClassificationSchemePartialModel(workshopId).GetAwaiter().GetResult();
|
||||
HasScheme = scheme.HasScheme;
|
||||
SchemeId = scheme.HasScheme ? scheme.ClassificationSchemesList.FirstOrDefault()!.Id : 0;
|
||||
@@ -156,13 +163,106 @@ public class ClassificationSchemeModel : PageModel
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// بررسی امکان حذف شغل
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnGetCheckDeleteJob(long id,long groupId)
|
||||
{
|
||||
var checkExist = _classificationSchemeApplication.CheckEmployeeHasThisJob(id, groupId).GetAwaiter().GetResult();
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
existEmployeHasThisJob = checkExist,
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ذخیره مشاغل
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnPostCreateJob(List<CreateClassificationGroupJob> createJobList, List<long> deleteJobList)
|
||||
{
|
||||
var result = _classificationSchemeApplication.CreateGroupJobs(createJobList, deleteJobList).GetAwaiter().GetResult();
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = result,
|
||||
message = result == true ? "عملیات با موفقیت انجام شد" : "خطا در ذخیره اطلاعات",
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public IActionResult OnGetCreateSalaries()
|
||||
|
||||
|
||||
#region SalariesTab
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// چک میکند که آیا گروه بدون شغل وجود دارد یا نه
|
||||
/// </summary>
|
||||
/// <param name="schemeId"></param>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnGetCheckEmptyGroup(long schemeId)
|
||||
{
|
||||
return Partial("_ClassificationPartials/CreateClassificationGroupSalary");
|
||||
var groupAndJobs = _classificationSchemeApplication.GetGroupAndJobs(schemeId).GetAwaiter().GetResult();
|
||||
|
||||
|
||||
// خروجی: لیست بولین که برای هر گروه مشخص میکند آیا Job دارد یا نه
|
||||
var hasJobsList = groupAndJobs
|
||||
.Select(g => g.EditClassificationGroupJob != null && g.EditClassificationGroupJob.Count > 0)
|
||||
.ToList();
|
||||
|
||||
// حالا میتونی بررسی کنی آیا گروهی بدون Job وجود دارد یا نه:
|
||||
bool hasEmptyGroup = hasJobsList.Contains(false);
|
||||
|
||||
// bool hasEmptyGroup = groupAndJobs.Any(g => g.EditClassificationGroupJob == null || g.EditClassificationGroupJob.Count == 0);
|
||||
return new JsonResult(new
|
||||
{
|
||||
hasEmptyGroup = hasEmptyGroup,
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// تب لیست دستمزد ها
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnGetSalariesTab(long schemeId)
|
||||
{
|
||||
|
||||
var salariesList = _classificationSchemeApplication.GetSalariesTabData(schemeId).GetAwaiter().GetResult();
|
||||
return Partial("_ClassificationPartials/ClassificationGroupSalariesTab", salariesList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///لود مودال ایجاد دستمزدها
|
||||
/// </summary>
|
||||
/// <param name="schemeId"></param>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnGetCreateSalaries(long schemeId)
|
||||
{
|
||||
var groupList = _classificationSchemeApplication.GetGroupToCreateSalariesModal(schemeId).GetAwaiter().GetResult();
|
||||
groupList.SchemeId = schemeId;
|
||||
return Partial("_ClassificationPartials/CreateSalariesAndCoefficient", groupList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ذخیره دستمزدها
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
public IActionResult OnPostCreateSalaries(SalaryAndRialCoefficientModel command)
|
||||
{
|
||||
var result = _classificationSchemeApplication.CreateGroupSalaryAndCoefficient(command).GetAwaiter().GetResult();
|
||||
return new JsonResult(result);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
public IActionResult OnGetAddEmployees()
|
||||
{
|
||||
return Partial("_ClassificationPartials/AddClassificationEmployees");
|
||||
|
||||
@@ -764,7 +764,7 @@
|
||||
<div class="buttons-container">
|
||||
@if (item.IsClassified)
|
||||
{
|
||||
<a permission="10317" asp-page="./ClassificationScheme" asp-route-workshopId="@item.Id" class="btn btn-success rad btn-rounded @(item.HasBlockContractingParty ? "disabled" : "")" style="background-color: #ec407a; border:#ec407a;">
|
||||
<a permission="10317" asp-page="./ClassificationScheme" asp-route-workshopId="@item.Id" asp-route-workshopName="@item.WorkshopFullName" class="btn btn-success rad btn-rounded @(item.HasBlockContractingParty ? "disabled" : "")" style="background-color: #ec407a; border:#ec407a;">
|
||||
<i class="fa fa-user"></i>
|
||||
<p>
|
||||
طرح طبقه بندی
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<div class="col-12 col-md-6">
|
||||
@foreach (var itemRight in Model.Take(10))
|
||||
{
|
||||
<div class="row align-items-center mb-2 p-2 @(itemRight.EditClassificationGroupJob.Count < 1 ? "tr-table-add" : "tr-table-edit")">
|
||||
<div class="row align-items-center mb-2 p-2 @(itemRight.EditClassificationGroupJob.Count < 1 ? "tr-table-add" : "tr-table-edit")" data-groupid="@itemRight.GroupId">
|
||||
|
||||
<div class="col-3 col-md-3">
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
<div class="col-12 col-md-6">
|
||||
@foreach (var itemLeft in Model.Skip(10))
|
||||
{
|
||||
<div class="row align-items-center mb-2 p-2 @(itemLeft.EditClassificationGroupJob.Count < 1 ? "tr-table-add" : "tr-table-edit")">
|
||||
<div class="row align-items-center mb-2 p-2 @(itemLeft.EditClassificationGroupJob.Count < 1 ? "tr-table-add" : "tr-table-edit")" data-groupid="@itemLeft.GroupId">
|
||||
|
||||
<div class="col-3 col-md-3">
|
||||
|
||||
@@ -132,22 +132,26 @@
|
||||
<span class="icon-span @(itemLeft.EditClassificationGroupJob.Count < 1 ? "add-jobs" : "edit-jobs")" style="padding: 4px;font-size: 11px;">
|
||||
@if (itemLeft.EditClassificationGroupJob.Count < 1)
|
||||
{
|
||||
<span>افزودن شغل</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>ویرایش شغل</span>
|
||||
}
|
||||
|
||||
<span class="job-btn-text">افزودن شغل</span>
|
||||
<svg width="19" height="18" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white" />
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="job-btn-text">ویرایش شغل</span>
|
||||
<svg width="19" height="18" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="18.5047" height="18.5047" transform="translate(0.074707 0.679688)" fill="#ADE7F2"></rect>
|
||||
<path d="M11.3213 5.25293C11.5664 5.19964 11.8217 5.20913 12.0635 5.28027L12.2178 5.33691C12.3659 5.40344 12.4945 5.49613 12.6152 5.59766C12.7711 5.72874 12.9467 5.90375 13.1504 6.10742L13.4326 6.39258C13.5184 6.48132 13.5946 6.56459 13.6602 6.64258C13.7953 6.80336 13.914 6.97832 13.9775 7.19434L14.0049 7.29883C14.0506 7.50888 14.0506 7.72647 14.0049 7.93652L13.9775 8.04102C13.914 8.25701 13.7953 8.43201 13.6602 8.59277C13.5946 8.67073 13.5184 8.75407 13.4326 8.84277L13.1504 9.12793L7.75879 14.5186C7.62672 14.6506 7.50929 14.7722 7.37793 14.8701L7.24121 14.959C7.14574 15.013 7.04539 15.0527 6.93848 15.0859L6.59766 15.1768L4.85938 15.6113C4.69519 15.6524 4.51668 15.6984 4.36816 15.7129C4.23271 15.7261 4.01567 15.7249 3.82324 15.584L3.74316 15.5146C3.53379 15.3053 3.52979 15.0444 3.54492 14.8896C3.55945 14.7411 3.60544 14.5626 3.64648 14.3984L4.08105 12.6602L4.17188 12.3193C4.20508 12.2124 4.24479 12.1121 4.29883 12.0166L4.3877 11.8799C4.48563 11.7485 4.60719 11.6311 4.73926 11.499L10.1299 6.10742L10.415 5.8252C10.5036 5.7396 10.5862 5.66312 10.6641 5.59766C10.8249 5.46245 11.0007 5.34385 11.2168 5.28027L11.3213 5.25293Z" stroke="#009EE2"></path>
|
||||
<path d="M9.7124 6.46393L12.0255 4.92188L14.3386 7.23496L12.7965 9.54804L9.7124 6.46393Z" fill="#009EE2"></path>
|
||||
</svg>
|
||||
}
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
@model CompanyManagment.App.Contracts.ClassificationScheme.SalaryAndRialCoefficientTab
|
||||
@{
|
||||
|
||||
<style>
|
||||
.card-scroll {
|
||||
/* ارتفاع از بالا تا پایین صفحه، با در نظر گرفتن فاصله از پایین */
|
||||
height: calc(100vh - 270px); /* فاصله از بالا یا هدر */
|
||||
margin-bottom: 10px; /* فاصله از پایین صفحه */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card-scroll .card-content {
|
||||
flex: 1; /* پر کردن فضای باقیمانده */
|
||||
overflow-y: auto; /* فقط وقتی نیاز شد اسکرول بده */
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.head-table {
|
||||
font-size: 14px;
|
||||
background-color: #2dbcbc;
|
||||
padding: 4px 1px;
|
||||
border-radius: 5px;
|
||||
color: aliceblue;
|
||||
margin-bottom: 9px;
|
||||
}
|
||||
|
||||
.tr-table {
|
||||
background-color: #ddf4f4;
|
||||
border-radius: 5px;
|
||||
padding: 4px 1px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.row-number {
|
||||
background-color: rgb(187, 240, 240);
|
||||
color: #0B5959;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.icon-span {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
line-height: 14px;
|
||||
border-radius: 5px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.icon-span svg {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.addSalaries{
|
||||
|
||||
font-size: 16px;
|
||||
align-self: center;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
int rowIndex = 1;
|
||||
}
|
||||
<div class="card card-pattern m-t-10 card-scroll">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="card-content">
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row" style="margin-bottom: 10px">
|
||||
<a class="btn btn-success addSalaries" href="#showmodal=@Url.Page("./ClassificationScheme", "CreateSalaries" ,new {schemeId = @Model.SchemeId})">
|
||||
افزودن دستمزدها
|
||||
</a>
|
||||
</div>
|
||||
<!-- هدر -->
|
||||
<div class="row fw-bold mb-2 head-table">
|
||||
<div class="col-2 col-md-1">ردیف</div>
|
||||
<div class="col-10 col-md-3">سال</div>
|
||||
<div class="col-6 col-md-2">تاریخ شروع</div>
|
||||
<div class="col-6 col-md-3">تاریخ پایان</div>
|
||||
<div class="col-12 col-md-3" style="float:left; direction:ltr">عملیات</div>
|
||||
</div>
|
||||
|
||||
@if (!Model.HasAnySalaries)
|
||||
{
|
||||
<h2 style="color: #c2b8b4;text-align: center;margin-top: 55px;">
|
||||
هنوز هیچ دستمزدی افزده نشده است
|
||||
</h2>
|
||||
}
|
||||
else
|
||||
{
|
||||
<!-- لیست -->
|
||||
@foreach (var item in Model.SalaryAndRialCoefficientTabDataList)
|
||||
{
|
||||
<div class="row align-items-center p-2 tr-table">
|
||||
|
||||
<div class="col-2 col-md-1"><div class="row-number">@rowIndex</div></div>
|
||||
<div class="col-10 col-md-3">@item.Year</div>
|
||||
<div class="col-6 col-md-2">@item.StartDateFa</div>
|
||||
<div class="col-6 col-md-3">@item.EndDateFa</div>
|
||||
@{
|
||||
rowIndex++;
|
||||
}
|
||||
<div class="col-12 col-md-3 align-items-center" style="float:left; direction:ltr">
|
||||
|
||||
|
||||
|
||||
<a href="#showmodal=@Url.Page("./ClassificationScheme", "EditScheme" ,new {startDate = item.StartDateFa})">
|
||||
<span class="icon-span" style="background-color:#ade7f2">
|
||||
<svg width="19" height="18" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="18.5047" height="18.5047" transform="translate(0.074707 0.679688)" fill="#ADE7F2"></rect>
|
||||
<path d="M11.3213 5.25293C11.5664 5.19964 11.8217 5.20913 12.0635 5.28027L12.2178 5.33691C12.3659 5.40344 12.4945 5.49613 12.6152 5.59766C12.7711 5.72874 12.9467 5.90375 13.1504 6.10742L13.4326 6.39258C13.5184 6.48132 13.5946 6.56459 13.6602 6.64258C13.7953 6.80336 13.914 6.97832 13.9775 7.19434L14.0049 7.29883C14.0506 7.50888 14.0506 7.72647 14.0049 7.93652L13.9775 8.04102C13.914 8.25701 13.7953 8.43201 13.6602 8.59277C13.5946 8.67073 13.5184 8.75407 13.4326 8.84277L13.1504 9.12793L7.75879 14.5186C7.62672 14.6506 7.50929 14.7722 7.37793 14.8701L7.24121 14.959C7.14574 15.013 7.04539 15.0527 6.93848 15.0859L6.59766 15.1768L4.85938 15.6113C4.69519 15.6524 4.51668 15.6984 4.36816 15.7129C4.23271 15.7261 4.01567 15.7249 3.82324 15.584L3.74316 15.5146C3.53379 15.3053 3.52979 15.0444 3.54492 14.8896C3.55945 14.7411 3.60544 14.5626 3.64648 14.3984L4.08105 12.6602L4.17188 12.3193C4.20508 12.2124 4.24479 12.1121 4.29883 12.0166L4.3877 11.8799C4.48563 11.7485 4.60719 11.6311 4.73926 11.499L10.1299 6.10742L10.415 5.8252C10.5036 5.7396 10.5862 5.66312 10.6641 5.59766C10.8249 5.46245 11.0007 5.34385 11.2168 5.28027L11.3213 5.25293Z" stroke="#009EE2"></path>
|
||||
<path d="M9.7124 6.46393L12.0255 4.92188L14.3386 7.23496L12.7965 9.54804L9.7124 6.46393Z" fill="#009EE2"></path>
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
<a href="#">
|
||||
<span class="icon-span" style="background-color: #ade7f2;padding: 4px;font-size: 11px;color: #009ee2;">
|
||||
جزئیات
|
||||
</span>
|
||||
|
||||
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
@*
|
||||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
@{
|
||||
}
|
||||
<div class="card card-pattern m-t-10">
|
||||
<button class="btn btn-success"> ایجاد دستمزدها</button>
|
||||
</div>
|
||||
@@ -7,6 +7,10 @@
|
||||
<link href="@Href("~/DadmehrSelect/dad-mehr-select.css")" rel="stylesheet" />
|
||||
|
||||
<style>
|
||||
|
||||
.modal .modal-dialog .modal-content{
|
||||
padding-bottom: 10px !important;
|
||||
}
|
||||
.name-right{
|
||||
position:inherit !important;
|
||||
}
|
||||
@@ -123,7 +127,20 @@
|
||||
<span>-</span>
|
||||
<span> </span>
|
||||
<span>@item.JobCode</span>
|
||||
<input type="hidden" job-id="@item.JobId" job-code="@item.JobCode" job-name="@item.JobName" name="job-data"/>
|
||||
<input type="hidden" data-id="@item.Id" job-id="@item.JobId" job-code="@item.JobCode" job-name="@item.JobName" name="job-data"/>
|
||||
|
||||
<a href="#" class="delete-job-already-added" style="float: left;">
|
||||
<span class="icon-span" style="background-color:#ddd3e0">
|
||||
<svg width="19" height="18" fill="none" xmlns="http://www.w3.org/2000/svg" >
|
||||
<rect width="18.5047" height="18.5047" transform="translate(0.523438 0.523438)" fill="#DDD3E0"></rect>
|
||||
<path d="M7.84814 11.7031L7.84814 9.39004" stroke="#BF3737" stroke-linecap="round"></path>
|
||||
<path d="M11.7031 11.7031L11.7031 9.39004" stroke="#BF3737" stroke-linecap="round"></path>
|
||||
<path d="M2.83643 5.53125H16.7149V5.53125C16.0652 5.53125 15.7403 5.53125 15.4745 5.60604C14.8039 5.79477 14.2799 6.31884 14.0911 6.98943C14.0163 7.25518 14.0163 7.58007 14.0163 8.22985V11.5546C14.0163 13.4402 14.0163 14.383 13.4305 14.9688C12.8448 15.5546 11.902 15.5546 10.0163 15.5546H9.53502C7.64941 15.5546 6.7066 15.5546 6.12081 14.9688C5.53502 14.383 5.53502 13.4402 5.53502 11.5546V8.22985C5.53502 7.58007 5.53502 7.25518 5.46023 6.98943C5.27151 6.31884 4.74744 5.79477 4.07685 5.60604C3.8111 5.53125 3.48621 5.53125 2.83643 5.53125V5.53125Z" stroke="#BF3737" stroke-linecap="round"></path>
|
||||
<path d="M7.84799 3.22434C7.84799 3.22434 8.2335 2.45312 9.77556 2.45312C11.3176 2.45312 11.7031 3.22415 11.7031 3.22415" stroke="#BF3737" stroke-linecap="round"></path>
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -144,13 +161,160 @@
|
||||
</div>
|
||||
@* <input type="hidden" asp-for="WorkshopId" value="@Model.GroupId" /> *@
|
||||
<div class="modal-footer border-0">
|
||||
<button type="submit" class="btn btn-success px-4 rounded-pill">ذخیره</button>
|
||||
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill" data-dismiss="modal">بستن</button>
|
||||
<button type="button" onclick="saveBtn()" class="btn btn-success px-4 rounded-pill">ذخیره</button>
|
||||
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill closeModal" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
//ذخیره لیست مشاغل
|
||||
function saveBtn(){
|
||||
var createJobList = [];
|
||||
var deleteJobList =[];
|
||||
let jobItems = document.querySelectorAll(".job-item-data");
|
||||
let deletedJobItems = document.querySelectorAll(".deleted-job");
|
||||
let groupNo = '@Model.GroupNo';
|
||||
let groupId = '@Model.GroupId';
|
||||
//افزودن مشاغل جدید به مدل
|
||||
jobItems.forEach((jobItem) => {
|
||||
|
||||
const createClassificationGroupJob = {};
|
||||
|
||||
createClassificationGroupJob.JobId = Number($(jobItem).attr("job-id"));
|
||||
createClassificationGroupJob.JobName = $(jobItem).attr("job-name");
|
||||
createClassificationGroupJob.JobCode = $(jobItem).attr("job-code");
|
||||
createClassificationGroupJob.ClassificationGroupId = Number(groupId);
|
||||
createClassificationGroupJob.GroupNo = groupNo;
|
||||
console.log(createClassificationGroupJob);
|
||||
createJobList.push(createClassificationGroupJob);
|
||||
});
|
||||
|
||||
deletedJobItems.forEach((deletedItem) => {
|
||||
let deletItemId = Number($(deletedItem).val());
|
||||
deleteJobList.push(deletItemId);
|
||||
});
|
||||
let alreadyCreated = document.querySelectorAll(".job-item");
|
||||
let createNewCount = Number(createJobList.length);
|
||||
let deleteCount = Number(deleteJobList);
|
||||
let alreadyCreatedCount = Number(alreadyCreated.length);
|
||||
|
||||
if(createNewCount == 0 && deleteCount == 0 && alreadyCreatedCount == 0){
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "هیچ شغلی اضافه نشده است");
|
||||
}else{
|
||||
var createJobUrlAjax = '@Url.Page("/Company/Workshops/ClassificationScheme", "CreateJob")';
|
||||
let targetDiv = $(`div[data-groupid='${groupId}']`);
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: createJobUrlAjax,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { createJobList , deleteJobList},
|
||||
success: function (response) {
|
||||
if(response.isSuccess){
|
||||
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
|
||||
|
||||
if (targetDiv.hasClass('tr-table-add')) {
|
||||
targetDiv.removeClass('tr-table-add').addClass('tr-table-edit');
|
||||
|
||||
// پیدا کردن span با کلاس add-jobs درون همون div
|
||||
let spanAdd = targetDiv.find('span.add-jobs');
|
||||
spanAdd.find('svg').remove();
|
||||
spanAdd.append(`<svg width="19" height="18" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="18.5047" height="18.5047" transform="translate(0.074707 0.679688)" fill="#ADE7F2"></rect>
|
||||
<path d="M11.3213 5.25293C11.5664 5.19964 11.8217 5.20913 12.0635 5.28027L12.2178 5.33691C12.3659 5.40344 12.4945 5.49613 12.6152 5.59766C12.7711 5.72874 12.9467 5.90375 13.1504 6.10742L13.4326 6.39258C13.5184 6.48132 13.5946 6.56459 13.6602 6.64258C13.7953 6.80336 13.914 6.97832 13.9775 7.19434L14.0049 7.29883C14.0506 7.50888 14.0506 7.72647 14.0049 7.93652L13.9775 8.04102C13.914 8.25701 13.7953 8.43201 13.6602 8.59277C13.5946 8.67073 13.5184 8.75407 13.4326 8.84277L13.1504 9.12793L7.75879 14.5186C7.62672 14.6506 7.50929 14.7722 7.37793 14.8701L7.24121 14.959C7.14574 15.013 7.04539 15.0527 6.93848 15.0859L6.59766 15.1768L4.85938 15.6113C4.69519 15.6524 4.51668 15.6984 4.36816 15.7129C4.23271 15.7261 4.01567 15.7249 3.82324 15.584L3.74316 15.5146C3.53379 15.3053 3.52979 15.0444 3.54492 14.8896C3.55945 14.7411 3.60544 14.5626 3.64648 14.3984L4.08105 12.6602L4.17188 12.3193C4.20508 12.2124 4.24479 12.1121 4.29883 12.0166L4.3877 11.8799C4.48563 11.7485 4.60719 11.6311 4.73926 11.499L10.1299 6.10742L10.415 5.8252C10.5036 5.7396 10.5862 5.66312 10.6641 5.59766C10.8249 5.46245 11.0007 5.34385 11.2168 5.28027L11.3213 5.25293Z" stroke="#009EE2"></path>
|
||||
<path d="M9.7124 6.46393L12.0255 4.92188L14.3386 7.23496L12.7965 9.54804L9.7124 6.46393Z" fill="#009EE2"></path>
|
||||
</svg>`)
|
||||
|
||||
// اگر span مورد نظر وجود داشت، کلاس و متنش رو تغییر بده
|
||||
if (spanAdd.length) {
|
||||
spanAdd.removeClass('add-jobs').addClass('edit-jobs');
|
||||
|
||||
// تغییر متن داخل span فرزند (که نوشته "افزودن شغل" است)
|
||||
spanAdd.find('span').text('ویرایش شغل');
|
||||
}
|
||||
}
|
||||
|
||||
if(createNewCount == 0 && alreadyCreatedCount == 0){
|
||||
if (targetDiv.hasClass('tr-table-edit')) {
|
||||
targetDiv.removeClass('tr-table-edit').addClass('tr-table-add');
|
||||
|
||||
// پیدا کردن span با کلاس add-jobs درون همون div
|
||||
let spanAdd = targetDiv.find('span.edit-jobs');
|
||||
|
||||
spanAdd.find('svg').remove();
|
||||
spanAdd.append(`<svg width="19" height="18" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white" />
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
|
||||
</svg>`)
|
||||
|
||||
// اگر span مورد نظر وجود داشت، کلاس و متنش رو تغییر بده
|
||||
if (spanAdd.length) {
|
||||
spanAdd.removeClass('edit-jobs').addClass('add-jobs');
|
||||
|
||||
// تغییر متن داخل span فرزند (که نوشته "ویرایش شغل" است)
|
||||
spanAdd.find('span').text('افزودن شغل');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$('.closeModal').click();
|
||||
}else{
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
|
||||
}
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
//console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//حذف شغل اضافه شده جدید
|
||||
$(document).on('click', '.delete-job-new-added', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).closest('.job-item').remove();
|
||||
});
|
||||
|
||||
//حذف شغلی که قبلا در دیتابیس ذخیره شده بود
|
||||
$(document).on('click', '.delete-job-already-added', function (e) {
|
||||
e.preventDefault();
|
||||
let current = $(e.currentTarget);
|
||||
var checkDeleteUrlAjax = '@Url.Page("/Company/Workshops/ClassificationScheme", "CheckDeleteJob")';
|
||||
let id = Number($(this).siblings('input[name="job-data"]').attr('data-id'));
|
||||
let groupId = Number('@Model.GroupId');
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: checkDeleteUrlAjax,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": id , "groupId" : groupId},
|
||||
success: function (response) {
|
||||
if (response.checkExist) {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',
|
||||
'پرسنل یا پرسنلهایی در این گروه وجود دارند که این سمت به آنها اختصاص داده شده');
|
||||
} else {
|
||||
if ($(`input.deleted-job[value='${id}']`).length === 0){
|
||||
$('.tr-job').append(`<input type="hidden" class="deleted-job" name="deletedjob" value="${id}" />`);
|
||||
}
|
||||
|
||||
|
||||
current.closest('.job-item').remove();
|
||||
}
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
//console.log(5, response);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//افزودن شغل
|
||||
function addJobs() {
|
||||
|
||||
let jobHiddenInput = $('.span-input').find('.selectedJob');
|
||||
@@ -188,6 +352,19 @@
|
||||
job-code="${jobCode}"
|
||||
job-name="${jobName}"
|
||||
name="job-data"/>
|
||||
<a href="#" class="delete-job-new-added" style="float: left;">
|
||||
<span class="icon-span" style="background-color:#ddd3e0">
|
||||
<svg width="19" height="18" fill="none" xmlns="http://www.w3.org/2000/svg" >
|
||||
<rect width="18.5047" height="18.5047" transform="translate(0.523438 0.523438)" fill="#DDD3E0"></rect>
|
||||
<path d="M7.84814 11.7031L7.84814 9.39004" stroke="#BF3737" stroke-linecap="round"></path>
|
||||
<path d="M11.7031 11.7031L11.7031 9.39004" stroke="#BF3737" stroke-linecap="round"></path>
|
||||
<path d="M2.83643 5.53125H16.7149V5.53125C16.0652 5.53125 15.7403 5.53125 15.4745 5.60604C14.8039 5.79477 14.2799 6.31884 14.0911 6.98943C14.0163 7.25518 14.0163 7.58007 14.0163 8.22985V11.5546C14.0163 13.4402 14.0163 14.383 13.4305 14.9688C12.8448 15.5546 11.902 15.5546 10.0163 15.5546H9.53502C7.64941 15.5546 6.7066 15.5546 6.12081 14.9688C5.53502 14.383 5.53502 13.4402 5.53502 11.5546V8.22985C5.53502 7.58007 5.53502 7.25518 5.46023 6.98943C5.27151 6.31884 4.74744 5.79477 4.07685 5.60604C3.8111 5.53125 3.48621 5.53125 2.83643 5.53125V5.53125Z" stroke="#BF3737" stroke-linecap="round"></path>
|
||||
<path d="M7.84799 3.22434C7.84799 3.22434 8.2335 2.45312 9.77556 2.45312C11.3176 2.45312 11.7031 3.22415 11.7031 3.22415" stroke="#BF3737" stroke-linecap="round"></path>
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
</a>
|
||||
|
||||
</div>`;
|
||||
|
||||
// افزودن به div مقصد
|
||||
@@ -201,6 +378,7 @@
|
||||
function inputFocus(element) {
|
||||
$(element).find('ul.ul-search').find('.input-text').focus();
|
||||
}
|
||||
//جستوی مشاغل
|
||||
function searchText(e,element, urlPost, hasCode) {
|
||||
|
||||
var code = e.code;
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
@using _0_Framework.Application.Enums
|
||||
@using CompanyManagment.App.Contracts.ClassificationScheme
|
||||
@model CompanyManagment.App.Contracts.ClassificationScheme.SalaryAndRialCoefficientModel
|
||||
@{
|
||||
<style>
|
||||
|
||||
|
||||
.modal .modal-dialog .modal-content {
|
||||
padding-bottom: 10px !important;
|
||||
}
|
||||
.row-number {
|
||||
background-color: rgb(187, 240, 240);
|
||||
color: #0B5959;
|
||||
width: 82px;
|
||||
height: 31px;
|
||||
line-height: 33px;
|
||||
text-align: center;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
|
||||
.tr-table {
|
||||
background-color: #ddf4f4;
|
||||
border-radius: 5px;
|
||||
padding: 7px 1px;
|
||||
margin: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
var groupIndex = 0;
|
||||
}
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">ایجاد دستمزدها</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="بستن">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
<form asp-page="./ClassificationScheme" asp-page-handler="CreateSalaries" method="post" autocomplete="off"
|
||||
data-ajax="true" data-action="newSave" enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 mb-3">
|
||||
<label asp-for="StartDateFa" class="form-label">تاریخ شروع</label>
|
||||
<input asp-for="StartDateFa" class="form-control" />
|
||||
<span asp-validation-for="StartDateFa" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 mb-3">
|
||||
<label asp-for="EndDateFa" class="form-label">تاریخ پایان</label>
|
||||
<input asp-for="EndDateFa" class="form-control" />
|
||||
<span asp-validation-for="EndDateFa" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
@if (Model.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient)
|
||||
{
|
||||
<div class="lineDiv"></div>
|
||||
<div class="row m-t-10">
|
||||
<div class="col-xs-12 col-md-6 mb-3">
|
||||
<div class="form-control" style="border-color:#fff !important;">
|
||||
<label asp-for="RialCoefficientStr" class="form-label" style="float: left;"> ضریب ریالی</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
|
||||
<input asp-for="RialCoefficientStr" class="form-control" />
|
||||
<span asp-validation-for="RialCoefficientStr" class="text-danger"></span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="lineDiv"></div>
|
||||
|
||||
|
||||
|
||||
<div class="row m-t-10">
|
||||
|
||||
<!-- گروه 1 تا 10 -->
|
||||
<div class="col-12 col-md-6">
|
||||
@foreach (var itemRight in Model.SalariesAndCoefficientList.Take(10))
|
||||
{
|
||||
<div class="row align-items-center mb-2 p-2 tr-table" data-groupid="@itemRight.ClassificationGroupId">
|
||||
|
||||
|
||||
<div class="col-xs-6 align-items-center" style="float:left; direction:ltr">
|
||||
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].GroupNo" value="@itemRight.GroupNo" />
|
||||
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].ClassificationGroupId" value="@itemRight.ClassificationGroupId" />
|
||||
<input type="text" class="form-control" name="SalariesAndCoefficientList[@groupIndex].GroupSalaryStr" value="@itemRight.GroupSalaryStr" />
|
||||
</div>
|
||||
<div class="col-xs-3"></div>
|
||||
<div class="col-xs-3">
|
||||
|
||||
<div class="row-number">
|
||||
<span>گروه</span>
|
||||
<span> </span>
|
||||
<span>@itemRight.GroupNo</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
groupIndex++;
|
||||
}
|
||||
</div>
|
||||
<!-- گروه 11 تا 20 -->
|
||||
<div class="col-12 col-md-6">
|
||||
@foreach (var itemLeft in Model.SalariesAndCoefficientList.Skip(10))
|
||||
{
|
||||
<div class="row align-items-center mb-2 p-2 tr-table" data-groupid="@itemLeft.ClassificationGroupId">
|
||||
|
||||
|
||||
<div class="col-xs-6 align-items-center" style="float:left; direction:ltr">
|
||||
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].GroupNo" value="@itemLeft.GroupNo"/>
|
||||
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].ClassificationGroupId" value="@itemLeft.ClassificationGroupId" />
|
||||
<input type="text" class="form-control" name="SalariesAndCoefficientList[@groupIndex].GroupSalaryStr" value="@itemLeft.GroupSalaryStr" />
|
||||
</div>
|
||||
<div class="col-xs-3"></div>
|
||||
|
||||
<div class="col-xs-3">
|
||||
|
||||
<div class="row-number">
|
||||
<span>گروه</span>
|
||||
<span> </span>
|
||||
<span>@itemLeft.GroupNo</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
groupIndex++;
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<input type="hidden" id="schemeId" asp-for="@Model.SchemeId" value="@Model.SchemeId" />
|
||||
<input type="hidden" asp-for="TypeOfCoefficient" value="TypeOfCoefficient" />
|
||||
<div class="modal-footer border-0">
|
||||
<button type="submit" class="btn btn-success px-4 rounded-pill">ذخیره</button>
|
||||
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -297,6 +297,27 @@ function CallBackHandler(data, action, form) {
|
||||
|
||||
|
||||
|
||||
}, 1000);
|
||||
|
||||
} else {
|
||||
/*alert(data.message);*/
|
||||
console.log(data.message)
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', data.message);
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case "newSave":
|
||||
if (data.isSuccedded) {
|
||||
|
||||
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', data.message);
|
||||
$('.close').click();
|
||||
|
||||
setTimeout(function () {
|
||||
$('#salariesTab').click();
|
||||
|
||||
|
||||
|
||||
}, 1000);
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user