Compare commits

...

1 Commits

Author SHA1 Message Date
3b2fd137e4 fix some style bug 2025-06-09 16:37:57 +03:30
4 changed files with 51 additions and 24 deletions

View File

@@ -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; }
/// <summary>وضعیت بدهی</summary>
public bool DebtDone { get; set; }
/// <summary>وضعیت تاییدیه کارفرما</summary>
/// <summary>تاییدیه کارفرما</summary>
public bool EmployerApproved { get; set; }
/// <summary>
/// نوع تاییدیه کارفرما
/// </summary>
public InsuranceListEmployerApprovalStatus EmployerApprovalStatus { get; set; }
}

View File

@@ -415,8 +415,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, 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
{

View File

@@ -1096,13 +1096,9 @@ public class IndexModel : PageModel
});
}
public async Task<IActionResult> OnGetTabCounts(int month, int year)
public async Task<IActionResult> 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

View File

@@ -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)}
</div>
<div class="insurance-table__cell tw-w-[7%] tw-text-center tw-flex tw-justify-center">
${booleanSvgResponse(item.confirmSentlist)}
${booleanSvgResponse(item.confirmSentlist, item.employerApprovalStatus)}
</div>
<div class="insurance-table__cell tw-w-[13%] tw-text-end">
<div class="tw-flex tw-justify-end tw-gap-2">
@@ -412,7 +434,7 @@ function loadSearchNew(status = 0) {
<div class="insurance-table__toggle-item tw-flex tw-items-center tw-w-[50%] tw-gap-2">
<span class="insurance-table__toggle-label">ارسال لیست: </span>
<span class="insurance-table__toggle-value">${booleanSvgResponse(item.confirmSentlist)}</span>
<span class="insurance-table__toggle-value">${booleanSvgResponse(item.confirmSentlist, item.employerApprovalStatus)}</span>
</div>
</div>
@@ -498,7 +520,7 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) {
</button>`;
}
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 = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -610,9 +634,9 @@ function booleanSvgResponse(bool) {
</svg>`;
} else {
svg = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#E0C7D2"/>
<path d="M16 8L8 16" stroke="#E54B4B" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M8 8L16 16" stroke="#E54B4B" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="12" cy="12" r="9" fill="${isWrittenVerbal ? `#B4D8FF` : `#E0C7D2`}"/>
<path d="M16 8L8 16" stroke="${isWrittenVerbal ? `#6D4BE5` : `#E54B4B`}" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M8 8L16 16" stroke="${isWrittenVerbal ? `#6D4BE5` : `#E54B4B`}" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>`;
}
return svg;