diff --git a/CompanyManagment.App.Contracts/InsuranceList/InsuranceListViewModel.cs b/CompanyManagment.App.Contracts/InsuranceList/InsuranceListViewModel.cs index 0d562f76..4a31820e 100644 --- a/CompanyManagment.App.Contracts/InsuranceList/InsuranceListViewModel.cs +++ b/CompanyManagment.App.Contracts/InsuranceList/InsuranceListViewModel.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using CompanyManagment.App.Contracts.InsuranceList.Enums; namespace CompanyManagment.App.Contracts.InsuranceList; @@ -32,6 +33,11 @@ public class InsuranceListViewModel public bool InspectionDone { get; set; } /// وضعیت بدهی public bool DebtDone { get; set; } - /// وضعیت تاییدیه کارفرما + /// تاییدیه کارفرما public bool EmployerApproved { get; set; } + + /// + /// نوع تاییدیه کارفرما + /// + public InsuranceListEmployerApprovalStatus EmployerApprovalStatus { get; set; } } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Repository/InsuranceListRepository.cs b/CompanyManagment.EFCore/Repository/InsuranceListRepository.cs index 5abd22c0..a92e51f7 100644 --- a/CompanyManagment.EFCore/Repository/InsuranceListRepository.cs +++ b/CompanyManagment.EFCore/Repository/InsuranceListRepository.cs @@ -415,8 +415,9 @@ public class InsuranceListRepository : RepositoryBase, IIns EmployerId = result.employer.First().EmployerId, DebtDone = result.insurance.Debt.IsDone, EmployerApproved = result.insurance.EmployerApproval.IsDone, - InspectionDone = result.insurance.Inspection.IsDone - }); + InspectionDone = result.insurance.Inspection.IsDone, + EmployerApprovalStatus = result.insurance.EmployerApproval.Status + }); query = searchModel.Status switch { diff --git a/ServiceHost/Areas/Admin/Pages/Company/InsuranceList/Index.cshtml.cs b/ServiceHost/Areas/Admin/Pages/Company/InsuranceList/Index.cshtml.cs index 9675e98a..76053240 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/InsuranceList/Index.cshtml.cs +++ b/ServiceHost/Areas/Admin/Pages/Company/InsuranceList/Index.cshtml.cs @@ -1107,13 +1107,9 @@ public class IndexModel : PageModel }); } - public async Task OnGetTabCounts(int month, int year) + public async Task OnGetTabCounts(InsuranceListSearchModel searchModel) { - var searchModel = new InsuranceListSearchModel() - { - Year = year.ToString("0000"), - Month = month.ToString("00") - }; + var resultData = await _insuranceListApplication.GetTabCounts(searchModel); return new JsonResult(new diff --git a/ServiceHost/wwwroot/AssetsAdmin/page/InsuranceList/js/Index.js b/ServiceHost/wwwroot/AssetsAdmin/page/InsuranceList/js/Index.js index 3a16fbaa..7b1c59ed 100644 --- a/ServiceHost/wwwroot/AssetsAdmin/page/InsuranceList/js/Index.js +++ b/ServiceHost/wwwroot/AssetsAdmin/page/InsuranceList/js/Index.js @@ -69,7 +69,7 @@ $(document).ready(function () { var isDefaultMonthYear = (paramsUrl["year"] === year && paramsUrl["month"] === month); - if (isAnyNotEmpty && !isDefaultMonthYear) { + if (isAnyNotEmpty) { $('.btn-clear-filter').removeClass('disable'); } else { $('.btn-clear-filter').addClass('disable'); @@ -177,13 +177,35 @@ function removeSearch() { } async function loadGetTabCounts() { - var paramsUrl = UrlParamsBuilder.readParams(["year", "month"]); + var paramsUrl = UrlParamsBuilder.readParams([ + "year", + "month", + "workshop-code", + "employee-id", + "workshop-id", + "type-of-insurance", + //"branch", + //"city", + "fixed-salary" + ]); - var yearSelect = Number(paramsUrl['month']) !== 0 ? Number(paramsUrl['year']) : year; - var monthSelect = Number(paramsUrl['month']) !== 0 ? Number(paramsUrl['month']) : month; + var searchModel = { + Year: paramsUrl['year'] !== "" ? paramsUrl['year'] : year, + Month: paramsUrl['month'] !== "" ? paramsUrl['month'] : month, + WorkShopCode: paramsUrl['workshop-code'], + EmployerId: paramsUrl['employee-id'], + WorkshopId: paramsUrl['workshop-id'], + TypeOfInsuranceSend: paramsUrl['type-of-insurance'], + //Branch: paramsUrl['branch'], + //City: paramsUrl['city'], + FixedSalary: paramsUrl['fixed-salary'] + }; + //var paramsUrl = UrlParamsBuilder.readParams(["year", "month"]); + //var yearSelect = Number(paramsUrl['month']) !== 0 ? Number(paramsUrl['year']) : year; + //var monthSelect = Number(paramsUrl['month']) !== 0 ? Number(paramsUrl['month']) : month; try { - var response = await ajaxService.get(ajaxGetTabCountsUrl, { month: monthSelect, year: yearSelect }, true); + var response = await ajaxService.get(ajaxGetTabCountsUrl, searchModel, true); updateStatus('notStarted', response.notStarted); updateStatus('inProgress', response.inProgress); @@ -259,8 +281,8 @@ function loadSearchNew(status = 0) { if (b === 0 && hasMoreData) { ajaxService.get(ajaxSearchNewUrl, searchModel, false) .then(response => { - var responseData = response.data; + if (responseData.length > 0) { responseData.forEach(function (item) { var n = pageIndexJs + 1; @@ -313,7 +335,7 @@ function loadSearchNew(status = 0) { ${booleanSvgResponse(item.employerApproved)}
- ${booleanSvgResponse(item.confirmSentlist)} + ${booleanSvgResponse(item.confirmSentlist, item.employerApprovalStatus)}
@@ -412,7 +434,7 @@ function loadSearchNew(status = 0) {
ارسال لیست: - ${booleanSvgResponse(item.confirmSentlist)} + ${booleanSvgResponse(item.confirmSentlist, item.employerApprovalStatus)}
@@ -498,7 +520,7 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) { `; } - if (item.inspectionDone && item.debtDone && item.employerApproved) { + if (item.inspectionDone && item.debtDone && item.employerApproved || item.confirmSentlist) { // Download Button if (hasPermission_80216) { html += ` @@ -525,7 +547,7 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) { } //if (item.inspectionDone && item.debtDone && item.employerApproved && item.confirmSentlist) { - if (item.inspectionDone || item.debtDone || item.employerApproved) { + if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) { // Confirm List and Print Button if (hasPermission_80215) { html += ` @@ -543,7 +565,7 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) { } } - if (item.inspectionDone || item.debtDone || item.employerApproved) { + if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) { // Summary List and Print Button if (hasPermission_80214) { html += ` @@ -600,7 +622,9 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) { return isMobile ? htmlMobile : html; } -function booleanSvgResponse(bool) { +function booleanSvgResponse(bool, employerApprovalStatus) { + var isWrittenVerbal = employerApprovalStatus === 1; + var svg = ``; if (bool) { svg = ` @@ -610,9 +634,9 @@ function booleanSvgResponse(bool) { `; } else { svg = ` - - - + + + `; } return svg;