Przeglądaj źródła

Correcciones por revision de workflow:

- Ajustes para que buscador no sea key sensitive
- Pagina de inicio se cambio a investment-proposals
- Se agrego el identificdor "Comentario:" en pop up de cambio de estado
- Se dejo el comentario del cambio de estado como opcional
- Correcciones en mensajes de alertas
Francisco huezo 5 lat temu
rodzic
commit
794a1080e3

+ 2 - 1
src/app/app-routing.module.ts

@@ -13,7 +13,8 @@ import { WorkflowGuard } from "./services/investment-proposal-workflow.guard";
 const routes: Routes = [
   {
     path: "",
-    redirectTo: "dashboard",
+    // redirectTo: "dashboard",
+    redirectTo: "investment-proposals",
     pathMatch: "full"
   },
   {

+ 16 - 14
src/app/components/investment-proposals/approve/approve.component.ts

@@ -327,18 +327,19 @@ export class InvestmentProposalApproveComponent implements OnInit {
       const { value: comentario } = await Swal.fire({
         title: "<h3>Aprobación de propuesta de inversión</h3>",
         icon: "info",
+        html: `<p style="text-align:left;">Comentario:</p>`,
         input: "textarea",
         showCancelButton: true,
         confirmButtonText: "Enviar propuesta",
         cancelButtonText: "Cancelar",
-        inputValidator: value => {
-          if (!value) {
-            return "Debe ingresar un comentario";
-          }
-        }
+        // inputValidator: value => {
+        //   if (!value) {
+        //     return "Debe ingresar un comentario";
+        //   }
+        // }
       });
 
-      if (comentario) {
+      // if (comentario) {
         this.reviewProposal = {
           id_inversion: this.investmentProposalID,
           step: "next",
@@ -370,7 +371,7 @@ export class InvestmentProposalApproveComponent implements OnInit {
               });
             }
           );
-      }
+      // }
     })();
   }
 
@@ -379,19 +380,20 @@ export class InvestmentProposalApproveComponent implements OnInit {
       const { value: comentario } = await Swal.fire({
         title: "<h3>Aprobación de propuesta de inversión</h3>",
         icon: "info",
+        html: `<p style="text-align:left;">Comentario:</p>`,
         input: "textarea",
         showCancelButton: true,
         confirmButtonText: "Rechazar propuesta",
         confirmButtonColor: "#C82333",
         cancelButtonText: "Cancelar",
-        inputValidator: value => {
-          if (!value) {
-            return "Debe ingresar un comentario";
-          }
-        }
+        // inputValidator: value => {
+        //   if (!value) {
+        //     return "Debe ingresar un comentario";
+        //   }
+        // }
       });
 
-      if (comentario) {
+      // if (comentario) {
         this.reviewProposal = {
           id_inversion: this.investmentProposalID,
           step: "previous",
@@ -423,7 +425,7 @@ export class InvestmentProposalApproveComponent implements OnInit {
               });
             }
           );
-      }
+      // }
     })();
   }
 }

+ 16 - 15
src/app/components/investment-proposals/investment-proposals.component.ts

@@ -61,13 +61,13 @@ export class InvestmentProposalsComponent implements OnInit {
 
     this.dataSource.filterPredicate = (data, filter) => {
       const dataStr =
-        data.id_inversion_instrumento.id_tipo_instrumento.nombre +
-        data.id_estado_inversion.nombre +
-        data.codigo_inversion +
-        data.nombre_inversion +
-        data.asunto +
-        data.comentario +
-        data.justificacion;
+        data.id_inversion_instrumento.id_tipo_instrumento.nombre.toLowerCase() +
+        data.id_estado_inversion.nombre.toLowerCase() +
+        data.codigo_inversion.toLowerCase() +
+        data.nombre_inversion.toLowerCase() +
+        data.asunto.toLowerCase() +
+        data.comentario.toLowerCase() +
+        data.justificacion.toLowerCase();
       return dataStr.indexOf(filter) != -1;
     };
 
@@ -104,7 +104,7 @@ export class InvestmentProposalsComponent implements OnInit {
   }
 
   applyFilter(event: Event) {
-    const filterValue = (event.target as HTMLInputElement).value;
+    const filterValue = (event.target as HTMLInputElement).value.toLowerCase();
     this.dataSource.filter = filterValue;
 
     if (this.dataSource.paginator) {
@@ -216,18 +216,19 @@ export class InvestmentProposalsComponent implements OnInit {
       const { value: comentario } = await Swal.fire({
         title: `<h3>Enviar a revisión propuesta de inversión ${investmentCode}</h3>`,
         icon: "info",
+        html: `<p style="text-align:left;">Comentario:</p>`,
         input: "textarea",
         showCancelButton: true,
         confirmButtonText: "Enviar propuesta",
         cancelButtonText: "Cancelar",
-        inputValidator: value => {
-          if (!value) {
-            return "Debe ingresar un comentario";
-          }
-        }
+        // inputValidator: value => {
+        //   if (!value) {
+        //     return "Debe ingresar un comentario";
+        //   }
+        // }
       });
 
-      if (comentario) {
+      //if (comentario) {
         let reviewProposal = {
           id_inversion: investmentProposalID,
           step: "next",
@@ -259,7 +260,7 @@ export class InvestmentProposalsComponent implements OnInit {
               });
             }
           );
-      }
+      //}
     })();
   }
 

+ 1 - 1
src/app/components/investment-proposals/payment-info/payment-info.component.ts

@@ -184,7 +184,7 @@ export class PaymentInfoComponent implements OnInit {
                     icon: "success",
                     showCancelButton: false,
                     title: "Exito",
-                    confirmButtonText: "La propuesta ha sido enviada a revisión"
+                    confirmButtonText: "La requisicion de pago ha sido generada"
                   }).then(result => {
                     Swal.close();
                     window.location.href = "#/investment-proposals";

+ 16 - 14
src/app/components/investment-proposals/result/result.component.ts

@@ -302,18 +302,19 @@ export class ResultComponent implements OnInit {
       const { value: comentario } = await Swal.fire({
         title: "<h3>Enviar a revisión propuesta de inversión</h3>",
         icon: "info",
+        html: `<p style="text-align:left;">Comentario:</p>`,
         input: "textarea",
         showCancelButton: true,
         confirmButtonText: "Enviar propuesta",
         cancelButtonText: "Cancelar",
-        inputValidator: value => {
-          if (!value) {
-            return "Debe ingresar un comentario";
-          }
-        }
+        // inputValidator: value => {
+        //   if (!value) {
+        //     return "Debe ingresar un comentario";
+        //   }
+        // }
       });
 
-      if (comentario) {
+      // if (comentario) {
         this.reviewProposal = {
           id_inversion: this.investmentProposalID,
           step: "next",
@@ -345,7 +346,7 @@ export class ResultComponent implements OnInit {
               });
             }
           );
-      }
+      // }
     })();
   }
 
@@ -394,18 +395,19 @@ export class ResultComponent implements OnInit {
       const { value: comentario } = await Swal.fire({
         title: "<h3>Finalizar propuesta de inversión</h3>",
         icon: "info",
+        html: `<p style="text-align:left;">Comentario:</p>`,
         input: "textarea",
         showCancelButton: true,
         confirmButtonText: "Finalizar",
         cancelButtonText: "Cancelar",
-        inputValidator: value => {
-          if (!value) {
-            return "Debe ingresar un comentario";
-          }
-        }
+        // inputValidator: value => {
+        //   if (!value) {
+        //     return "Debe ingresar un comentario";
+        //   }
+        // }
       });
 
-      if (comentario) {
+      // if (comentario) {
         this.reviewProposal = {
           id_inversion: this.investmentProposalID,
           step: "next",
@@ -437,7 +439,7 @@ export class ResultComponent implements OnInit {
               });
             }
           );
-      }
+      // }
     })();
   }
 

+ 18 - 16
src/app/components/investment-proposals/review/review.component.ts

@@ -327,18 +327,19 @@ export class InvestmentProposalReviewComponent implements OnInit {
       const { value: comentario } = await Swal.fire({
         title: "<h3>Revisión propuesta de inversión</h3>",
         icon: "info",
+        html: `<p style="text-align:left;">Comentario:</p>`,
         input: "textarea",
         showCancelButton: true,
         confirmButtonText: "Enviar propuesta",
         cancelButtonText: "Cancelar",
-        inputValidator: value => {
-          if (!value) {
-            return "Debe ingresar un comentario";
-          }
-        }
+        // inputValidator: value => {
+        //   if (!value) {
+        //     return "Debe ingresar un comentario";
+        //   }
+        // }
       });
 
-      if (comentario) {
+      // if (comentario) {
         this.reviewProposal = {
           id_inversion: this.investmentProposalID,
           step: "next",
@@ -370,7 +371,7 @@ export class InvestmentProposalReviewComponent implements OnInit {
               });
             }
           );
-      }
+      // }
     })();
   }
 
@@ -379,19 +380,20 @@ export class InvestmentProposalReviewComponent implements OnInit {
       const { value: comentario } = await Swal.fire({
         title: "<h3>Revisión propuesta de inversión</h3>",
         icon: "info",
+        html: `<p style="text-align:left;">Comentario:</p>`,
         input: "textarea",
         showCancelButton: true,
         confirmButtonText: "Rechazar propuesta",
         confirmButtonColor: "#C82333",
         cancelButtonText: "Cancelar",
-        inputValidator: value => {
-          if (!value) {
-            return "Debe ingresar un comentario";
-          }
-        }
+        // inputValidator: value => {
+        //   if (!value) {
+        //     return "Debe ingresar un comentario";
+        //   }
+        // }
       });
 
-      if (comentario) {
+      // if (comentario) {
         this.reviewProposal = {
           id_inversion: this.investmentProposalID,
           step: "previous",
@@ -405,10 +407,10 @@ export class InvestmentProposalReviewComponent implements OnInit {
               if (success) {
                 Swal.fire({
                   allowOutsideClick: false,
-                  icon: "success",
+                  icon: "warning",
                   showCancelButton: false,
                   title: "Exito",
-                  confirmButtonText: "La propuesta ha sido aprobada"
+                  confirmButtonText: "La propuesta ha sido rechazada"
                 }).then(result => {
                   Swal.close();
                   window.location.href = "#/investment-proposals";
@@ -423,7 +425,7 @@ export class InvestmentProposalReviewComponent implements OnInit {
               });
             }
           );
-      }
+      // }
     })();
   }
 }