feat:errores presupuesto

This commit is contained in:
amazuecos
2024-10-19 07:29:47 +00:00
parent f1df4559f7
commit f9b12cbcdd
4 changed files with 36 additions and 22 deletions

View File

@ -23,8 +23,6 @@ class ConfigErrores extends BaseResourceController
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->errorPresupuestoModel = model(ErrorPresupuestoModel::class);
}
@ -32,11 +30,13 @@ class ConfigErrores extends BaseResourceController
public function index()
{
return view(static::$viewPath . $this->indexRoute, $this->viewData);
}
public function viewForm(int $error_presupuesto_id)
{
$this->errorPresupuestoModel->update($error_presupuesto_id, [
"last_user_id" => auth()->user()->id
]);
return view(static::$viewPath . 'viewErrorPresupuestoForm', ["error_presupuesto_id" => $error_presupuesto_id]);
}
public function store()
@ -60,10 +60,9 @@ class ConfigErrores extends BaseResourceController
public function datatable()
{
$query = $this->errorPresupuestoModel->getQueryDatatable();
return DataTable::of($query)
->add("action", fn($q) => $q->id)
->toJson(true);
}
}
}

View File

@ -62,7 +62,7 @@ class ErrorPresupuesto extends Model
"presupuesto_id" => $presupuesto_id,
"presupuesto_user_id" => $presupuesto_user_id,
"error" => $error,
"datos" => json_encode($datos)
"datos_presupuesto" => json_encode($datos)
]);
}
public function updateComment(int $error_presupuesto_id, string $comment): bool
@ -81,7 +81,8 @@ class ErrorPresupuesto extends Model
"CONCAT(t1.first_name,' ',t1.last_name) as presupuestoUser",
"CONCAT(t2.first_name,' ',t2.last_name) as lastUser",
"presupuesto_errores.created_at",
"presupuesto_errores.datos",
"presupuesto_errores.datos_presupuesto",
"presupuesto_errores.error",
"presupuesto_errores.visto",
"presupuesto_errores.comment",

View File

@ -25,7 +25,7 @@
</div>
<div class="col-md-2 overflow-hidden w-20">
<label class="switch switch-square switch-lg">
<input type="checkbox" class="switch-input" disabled>
<input type="checkbox" class="switch-input" id="error-presupuesto-visto" name="visto" disabled>
<span class="switch-toggle-slider">
<span class="switch-on">
<i class="ti ti-eye"></i>
@ -44,15 +44,22 @@
<textarea rows="10" class="form-control" id="datos-presupuesto"
placeholder="Datos presupuesto" disabled></textarea>
</div>
<div class="col-md-6 mb-3 overflow-hidden">
<label for="error-presupuesto">Error</label>
<textarea rows="10" class="form-control" id="error-presupuesto"
placeholder="Error" disabled></textarea>
</div>
<div class="col-md-12 mb-3 overflow-hidden">
<label for="comments-presupuesto">Comentarios</label>
<div class="input-group mb-3">
<textarea rows="10" class="form-control" id="comments-presupuesto"
placeholder="Comentarios"></textarea>
<button class="btn btn-primary button-update-comment" type="button"><span
class="ti ti-md ti-send" id="update-button-icon"></span></button>
</div>
<textarea rows="10" class="form-control" id="comments-presupuesto"
placeholder="Comentarios"></textarea>
</div>
<div class="col-md-12">
<button class="btn btn-primary button-update-comment w-100" type="button">
<span class="ti ti-sm ti-send me-1" id="update-button-icon"></span>
<span class="spinner-border me-1" role="status" aria-hidden="true" id="update-button-loader" hidden></span>
<?= lang("App.global_save") ?></button>
</div>
</div>
</form>