From a7e913b3eef8cb3d69c257f67956b49909b43140 Mon Sep 17 00:00:00 2001 From: ivanszabo Date: Mon, 31 Mar 2025 15:20:16 +0200 Subject: [PATCH] =?UTF-8?q?CheckStatus=20+=20UI=20fejleszt=C3=A9se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WorkFlowCheck.Common/Enums/CheckStatus.cs | 8 ++- .../CheckPoints/CheckPointsPage.cshtml | 12 ++-- .../CheckListHeaderPage.cshtml | 41 +++++++----- .../RoleCheckListTemplateHeadersPage.cshtml | 8 +-- .../UserAndRole/RoleCheckPointsPage.cshtml | 8 +-- src/WorkFlowCheck.Web/Program.cs | 16 +++++ src/WorkFlowCheck.Web/wwwroot/js/site.js | 66 +++++++++++++++++++ 7 files changed, 117 insertions(+), 42 deletions(-) diff --git a/src/WorkFlowCheck.Common/Enums/CheckStatus.cs b/src/WorkFlowCheck.Common/Enums/CheckStatus.cs index b71699d..655a246 100644 --- a/src/WorkFlowCheck.Common/Enums/CheckStatus.cs +++ b/src/WorkFlowCheck.Common/Enums/CheckStatus.cs @@ -10,8 +10,10 @@ namespace WorkFlowCheck.Common.Enums { Open = 0, InProgress = 1, - Blocked = 3, - Storno = 4, - Sent = 5 + Blocked = 2, + Storno = 3, + Sent = 4, + Signed = 5, + Closed = 6 } } diff --git a/src/WorkFlowCheck.Web/Pages/BaseStock/CheckPoints/CheckPointsPage.cshtml b/src/WorkFlowCheck.Web/Pages/BaseStock/CheckPoints/CheckPointsPage.cshtml index be477d4..00946f3 100644 --- a/src/WorkFlowCheck.Web/Pages/BaseStock/CheckPoints/CheckPointsPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/BaseStock/CheckPoints/CheckPointsPage.cshtml @@ -9,7 +9,9 @@
- +
@@ -48,13 +50,7 @@ sortable: false, className: "text-center", render: function ( data, type, row ) { - if (data === true) { - return ''; - } - if (data === false) { - return ''; - } - return data; + return renderCheckBox(data); } }, diff --git a/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml b/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml index 38f054c..f78ee59 100644 --- a/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/CheckList/CheckListHeader/CheckListHeaderPage.cshtml @@ -15,6 +15,7 @@ + @@ -27,6 +28,7 @@ + @@ -49,21 +51,20 @@ }, columns: [ { data: "id" }, + { data: "checkStatus", + render:function(data, type, row) + { + return renderCheckStatus(data); + } + }, { - data: "isEditable", - searchable: false, - sortable: false, - // visible: (aDurchgang==1 ? true : false), - className: "text-center", - render: function ( data, type, row ) { - if (data === true) { - return ''; - } - if (data === false) { - return ''; - } - return data; - } + data: "isEditable", + searchable: false, + sortable: false, + className: "text-center", + render: function ( data, type, row ) { + return renderCheckBox(data); + } }, { data: "documentNumber"}, @@ -79,8 +80,8 @@ { data: "shortName" }, { data: "description" }, { data: "userDTO.userName" }, - { data: null, render: function (data, type, row) { - return renderActionButtons(row.id); + { data: "checkStatus", render: function (data, type, row) { + return renderActionButtonsforCheckListHeader(data, row.id); }} ], columnDefs: [ @@ -89,7 +90,7 @@ "visible": false }, { - "targets": 3, + "targets": 8, "className": "text-center", "width": "10%" } @@ -111,6 +112,12 @@ window.location.href = `@Url.Page("./CheckListHeaderEditPage")?id=${row.id}`; }); + $('#tbCheckListHeadersPage').on('click', '.pdf-btn', function () + { + const row = table.row($(this).closest('tr')).data(); + window.location.href = `@Url.Page("./CheckListHeaderEditPage")?id=${row.id}`; + }); + $('#tbCheckListHeadersPage').on('click', '.delete-btn', function () { const row = table.row($(this).closest('tr')).data(); diff --git a/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckListTemplateHeadersPage.cshtml b/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckListTemplateHeadersPage.cshtml index 9eb5f98..878e147 100644 --- a/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckListTemplateHeadersPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckListTemplateHeadersPage.cshtml @@ -51,13 +51,7 @@ sortable: false, className: "text-center", render: function ( data, type, row ) { - if (data === true) { - return ''; - } - if (data === false) { - return ''; - } - return data; + return renderCheckBox(data); } }, diff --git a/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckPointsPage.cshtml b/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckPointsPage.cshtml index d7d643d..bc2ae35 100644 --- a/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckPointsPage.cshtml +++ b/src/WorkFlowCheck.Web/Pages/UserAndRole/RoleCheckPointsPage.cshtml @@ -51,13 +51,7 @@ sortable: false, className: "text-center", render: function ( data, type, row ) { - if (data === true) { - return ''; - } - if (data === false) { - return ''; - } - return data; + return renderCheckBox(data); } }, diff --git a/src/WorkFlowCheck.Web/Program.cs b/src/WorkFlowCheck.Web/Program.cs index 6178d24..066bd21 100644 --- a/src/WorkFlowCheck.Web/Program.cs +++ b/src/WorkFlowCheck.Web/Program.cs @@ -55,6 +55,22 @@ builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) builder.Services.AddFluentValidationSetup(); var app = builder.Build(); +string imageDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Images"); + +//----------------- Munkakönyvtárak létrehozása ----------------------------- +if (!Directory.Exists(imageDirectory)) +{ + Directory.CreateDirectory(imageDirectory); +} +string pdfDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Pdf"); + +// Ensure the Images directory exists +if (!Directory.Exists(pdfDirectory)) +{ + Directory.CreateDirectory(pdfDirectory); +} +//--------------------------------------------------------------------------- + app.UseMiddleware(); // Configure the HTTP request pipeline. diff --git a/src/WorkFlowCheck.Web/wwwroot/js/site.js b/src/WorkFlowCheck.Web/wwwroot/js/site.js index 2c363db..a193644 100644 --- a/src/WorkFlowCheck.Web/wwwroot/js/site.js +++ b/src/WorkFlowCheck.Web/wwwroot/js/site.js @@ -105,3 +105,69 @@ function renderActionButtons(rowId) { `; } +function renderActionButtonsforCheckListHeader(data, rowId) { + if (data === 4) { + return ` + + `; + } + else { + + return ` + + `; + } +} + +function renderCheckStatus(data) { + //Open = 0, + //InProgress = 1, + //Blocked = 2, + //Storno = 3, + //Sent = 4, + //Signed = 5, + //Closed = 6 + switch (data) { + case 0: + return 'Nyitott'; + break; + case 1: + return 'Folyamatban'; + break; + case 2: + return 'Blokkolt'; + break; + case 3: + return 'Stornózva'; + break; + case 4: + return 'Beküldve'; + break; + case 5: + return 'Jóváhagyva'; + break; + case 6: + return 'Lezárt'; + break; + default: + return ''; + break; + } +} +function renderCheckBox(data) { + if (data === true) { + return ''; + } + if (data === false) { + return ''; + } + return data; +}
IDStatus IsEditable DocumentNumber DateExecution
IDStatus IsEditable DocumentNumber DateExecution