mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'add/view_logistica_principal'
Main See merge request jjimenez/safekat!705
This commit is contained in:
@ -18,6 +18,13 @@ class OrdenTrabajo extends BaseConfig
|
||||
"corte_at" => "corte_user_id",
|
||||
"preparacion_interiores_at" => "preparacion_interior_user_id",
|
||||
"entrada_manipulado_at" => "entrada_manipulado_user_id",
|
||||
"cosido_at" => "cosido_user_id",
|
||||
"grapado_at" => "grapado_user_id",
|
||||
"solapa_at" => "solapa_user_id",
|
||||
"retractilado_at" => "retractilado_user_id",
|
||||
"retractilado5_at" => "retractilado5_user_id",
|
||||
"prototipo_at" => "prototipo_user_id",
|
||||
"marcapaginas_at" => "marcapaginas_user_id",
|
||||
//FERRO
|
||||
"pendiente_ferro_at" => "pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_at" => "ferro_en_cliente_user_id",
|
||||
@ -40,6 +47,18 @@ class OrdenTrabajo extends BaseConfig
|
||||
"fecha_encuadernado" => "fecha_encuadernado_change_user_id",
|
||||
"fecha_entrega_externo" => "fecha_entrega_externo_change_user_id",
|
||||
];
|
||||
public array $OT_COLORS = [
|
||||
"sin_imprimir" => "#FF6363",
|
||||
"impreso_int" => "#AFDDFF",
|
||||
"impreso_cub" => "#3A59D1",
|
||||
"plastificado" => "#FFD63A",
|
||||
"preparado" => "#FF0B55",
|
||||
"solapa" => "#4F1C51",
|
||||
"cosido" => "#FF0B55",
|
||||
"grapado" => "#FEBA17",
|
||||
"encuadernado" => "#FEBA17",
|
||||
"corte" => "#67AE6E"
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@ -647,6 +647,8 @@ $routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($route
|
||||
$routes->get('direct/client/users/select/presupuesto/(:num)', 'ChatController::get_presupuesto_client_users/$1/$2', ['as' => 'getPresupuestoClientUsers']);
|
||||
$routes->get('direct/client/users/select/pedido/(:num)', 'ChatController::get_pedido_client_users/$1/$2', ['as' => 'getPedidoClientUsers']);
|
||||
$routes->get('direct/client/users/select/factura/(:num)', 'ChatController::get_factura_client_users/$1/$2', ['as' => 'getFacturaClientUsers']);
|
||||
$routes->get('direct/client/users/select/ot/(:num)', 'ChatController::get_orden_trabajo_client_users/$1/$2', ['as' => 'getOrdenTrabajoClientUsers']);
|
||||
|
||||
|
||||
$routes->get('direct/users/(:num)', 'ChatController::get_chat_direct_users', ['as' => 'getChatDirectUsers']);
|
||||
$routes->post('direct/users/(:num)', 'ChatController::store_chat_direct_users/$1', ['as' => 'storeChatDirectUsers']);
|
||||
@ -663,7 +665,10 @@ $routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($route
|
||||
$routes->get('department/presupuesto/(:num)/(:num)', 'ChatController::get_chat_presupuesto/$1/$2', ['as' => 'getChatPresupuesto']);
|
||||
$routes->get('department/pedido/(:num)/(:num)', 'ChatController::get_chat_pedido/$1/$2', ['as' => 'getChatPedido']);
|
||||
$routes->get('department/factura/(:num)/(:num)', 'ChatController::get_chat_factura/$1/$2', ['as' => 'getChatFactura']);
|
||||
$routes->get('department/ot/(:num)/(:num)', 'ChatController::get_chat_orden_trabajo/$1/$2', ['as' => 'getChatOrdenTrabajo']);
|
||||
$routes->get('department/users/presupuesto/(:num)/(:num)', 'ChatController::get_chat_department_presupuesto_users/$1/$2', ['as' => 'getPresupuestoChatDepartmentUsers']);
|
||||
$routes->get('department/users/ot/(:num)/(:num)', 'ChatController::get_chat_department_orden_trabajo_users/$1/$2', ['as' => 'getOrdenTrabajoChatDepartmentUsers']);
|
||||
|
||||
$routes->get('department/datatable', 'ChatController::chat_department_datatable', ['as' => 'chatDepartmentDatatable']);
|
||||
$routes->get('department/edit/(:num)', 'ChatController::chat_department_edit/$1', ['as' => 'chatDepartmentEditView']);
|
||||
$routes->get('department/users/datatable/(:num)', 'ChatController::chat_department_user_datatable/$1', ['as' => 'chatDepartmentUsersDatatable']);
|
||||
@ -741,6 +746,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$routes->post("update", 'Ordentrabajo::update_orden_trabajo');
|
||||
$routes->post("upload/portada", 'Ordentrabajo::upload_orden_trabajo_portada');
|
||||
$routes->delete("portada/(:num)", 'Ordentrabajo::delete_orden_trabajo_portada/$1');
|
||||
$routes->get("color/(:num)", 'Ordentrabajo::get_orden_trabajo_color_status/$1');
|
||||
|
||||
/**======================
|
||||
* FILES
|
||||
|
||||
@ -11,6 +11,7 @@ use App\Models\ChatNotification;
|
||||
use App\Models\ChatUser;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
use App\Models\Facturas\FacturaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Models\Presupuestos\PresupuestoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
@ -132,6 +133,25 @@ class ChatController extends BaseController
|
||||
$data["chat"] = $chat;
|
||||
return $this->response->setJSON($data);
|
||||
}
|
||||
public function get_chat_orden_trabajo(int $chat_department_id, int $orden_trabajo_id)
|
||||
{
|
||||
|
||||
$data = [
|
||||
"department" => $this->chatDeparmentModel->find($chat_department_id),
|
||||
"chat" => null,
|
||||
"messages" => null,
|
||||
"count" => 0,
|
||||
];
|
||||
$chat = $this->chatModel->getChatOrdenTrabajo($chat_department_id, $orden_trabajo_id);
|
||||
if ($chat) {
|
||||
$data["messages"] = $this->chatMessageModel->get_chat_messages($chat->id);
|
||||
$this->chatMessageModel->set_chat_department_messages_as_read($chat->id);
|
||||
$this->chatModel->setAsViewedChatUserNotifications($chat->id, auth()->user()->id);
|
||||
$data["count"] = count($data["messages"]);
|
||||
}
|
||||
$data["chat"] = $chat;
|
||||
return $this->response->setJSON($data);
|
||||
}
|
||||
public function get_chat_direct_view($chat_id)
|
||||
{
|
||||
$chat = $this->chatModel->find($chat_id);
|
||||
@ -295,6 +315,11 @@ class ChatController extends BaseController
|
||||
$data = $this->chatDeparmentModel->find($chat_department_id)->withUsers($factura_id, 'factura');
|
||||
return $this->response->setJSON($data);
|
||||
}
|
||||
public function get_chat_department_orden_trabajo_users(int $chat_department_id, $orden_trabajo_id)
|
||||
{
|
||||
$data = $this->chatDeparmentModel->find($chat_department_id)->withUsers($orden_trabajo_id, 'ot');
|
||||
return $this->response->setJSON($data);
|
||||
}
|
||||
public function get_chat_users_internal()
|
||||
{
|
||||
$query = $this->userModel->builder()->select(
|
||||
@ -357,6 +382,15 @@ class ChatController extends BaseController
|
||||
$clienteContactos = $cm->querySelectClienteContacto($f->cliente_id,$this->request->getGet('q'));
|
||||
return $this->response->setJSON($clienteContactos);
|
||||
}
|
||||
public function get_orden_trabajo_client_users(int $orden_trabajo_id)
|
||||
{
|
||||
$otm = model(OrdenTrabajoModel::class);
|
||||
$ot = $otm->find($orden_trabajo_id);
|
||||
$cm = model(ClienteModel::class);
|
||||
$cliente = $ot->pedido()->cliente();
|
||||
$clienteContactos = $cm->querySelectClienteContacto($cliente->id,$this->request->getGet('q'));
|
||||
return $this->response->setJSON($clienteContactos);
|
||||
}
|
||||
public function store_hebra(string $model)
|
||||
{
|
||||
$auth_user = auth()->user();
|
||||
|
||||
@ -133,7 +133,7 @@ class Ordentrabajo extends BaseController
|
||||
try {
|
||||
$bodyData = $this->request->getPost();
|
||||
$r = $this->produccionService->init($bodyData["orden_trabajo_id"])->updateOrdenTrabajoPedido($bodyData);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r,"data" => $bodyData]);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $bodyData]);
|
||||
} catch (\Throwable $th) {
|
||||
return $this->response->setJSON(["errors" => $th->getMessage(), "status" => false])->setStatusCode(500);
|
||||
}
|
||||
@ -163,7 +163,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->where("ordenes_trabajo.estado", "F");
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name,"color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
@ -178,7 +178,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->whereIn("ordenes_trabajo.estado", ["I", "PM"]);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name,"color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
@ -193,7 +193,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->where("ferro_ok_at", null);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name,"color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
@ -208,7 +208,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->where("ferro_ok_at is NOT NULL", NULL, FALSE);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name])
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name,"color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
@ -328,26 +328,26 @@ class Ordentrabajo extends BaseController
|
||||
}
|
||||
public function planning_rotativa_datatable()
|
||||
{
|
||||
$q = $this->produccionService->planningRotativaQueryDatatable();
|
||||
return DataTable::of($q)
|
||||
$query = $this->produccionService->planningRotativaQueryDatatable();
|
||||
return DataTable::of($query)
|
||||
->edit("fecha_entrega_real_at", fn($q) => $q->fecha_entrega_real_at ? Time::createFromFormat("Y-m-d", $q->fecha_entrega_real_at)->format("d/m/Y") : "")
|
||||
->add("metros_check", fn($q) => $q->otId)
|
||||
->add("corte", fn($q) => ["otId" => $q->otId, "tipo_corte" => $this->produccionService->ordenTrabajoTareaCorte($q->otId)])
|
||||
->add("action", fn($q) => $q)
|
||||
->add("action", fn($q) => ["data" => $q])
|
||||
->toJson(true);
|
||||
}
|
||||
public function planning_plana_datatable()
|
||||
{
|
||||
$q = $this->produccionService->planningPlanaQueryDatatable();
|
||||
$query = $this->produccionService->planningPlanaQueryDatatable();
|
||||
$padreId = $this->request->getGet('padre_id');
|
||||
if ($padreId) {
|
||||
$q->where('lg_maquinas.padre_id', $padreId);
|
||||
$query->where('lg_maquinas.padre_id', $padreId);
|
||||
}
|
||||
return DataTable::of($q)
|
||||
return DataTable::of($query)
|
||||
->edit("tiempo_real_sum", fn($q) => $q->tiempo_real_sum)
|
||||
->edit("fecha_entrega_real_at", fn($q) => $q->fecha_entrega_real_at ? Time::createFromFormat("Y-m-d", $q->fecha_entrega_real_at)->format("d/m/Y") : "")
|
||||
->add("pliegos_check", fn($q) => $q->otId)
|
||||
->add("action", fn($q) => $q)
|
||||
->add("action", fn($q) => ["data" => $q ])
|
||||
->toJson(true);
|
||||
}
|
||||
public function select_maquina_planning_rot()
|
||||
@ -431,4 +431,9 @@ class Ordentrabajo extends BaseController
|
||||
);
|
||||
}
|
||||
}
|
||||
public function get_orden_trabajo_color_status(int $orden_trabajo_id)
|
||||
{
|
||||
$color = $this->produccionService->init($orden_trabajo_id)->getOtColorStatus();
|
||||
return $this->response->setJSON(["color" => $color]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class UpdateDateFieldsOrdenTrabajoDates extends Migration
|
||||
{
|
||||
protected array $DATES = [
|
||||
"cosido_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"solapa_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"grapado_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"retractilado_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"retractilado5_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"prototipo_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
"marcapaginas_at" => [
|
||||
"type" => "DATE",
|
||||
"null" => true,
|
||||
],
|
||||
];
|
||||
protected array $USERS = [
|
||||
"cosido_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"solapa_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"grapado_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"retractilado_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"retractilado5_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"prototipo_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
"marcapaginas_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 10,
|
||||
"null" => true,
|
||||
],
|
||||
];
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn("orden_trabajo_dates", $this->DATES);
|
||||
$this->forge->addColumn("orden_trabajo_users", $this->USERS);
|
||||
foreach ($this->USERS as $key => $value) {
|
||||
$this->forge->addForeignKey([$key],"users",["id"]);
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn("orden_trabajo_dates", array_keys($this->DATES));
|
||||
$this->forge->dropColumn("orden_trabajo_users", array_keys($this->USERS));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class AddFkOrdenTrabajoChatDepartment extends Migration
|
||||
{
|
||||
protected array $COLUMNS = [
|
||||
"orden_trabajo_id" => [
|
||||
"type" => "INT",
|
||||
"constraint" => 10,
|
||||
"unsigned" => true,
|
||||
"null" => true
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn("chats", $this->COLUMNS);
|
||||
$this->forge->addColumn("chat_department_users", $this->COLUMNS);
|
||||
$this->forge->addForeignKey('orden_trabajo_id', 'ordenes_trabajo', 'id');
|
||||
$this->forge->processIndexes('chats');
|
||||
$this->forge->addForeignKey('orden_trabajo_id', 'ordenes_trabajo', 'id');
|
||||
$this->forge->processIndexes('chat_department_users');
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn("chats", ["orden_trabajo_id"]);
|
||||
$this->forge->dropColumn("chat_department_users", ["orden_trabajo_id"]);
|
||||
|
||||
}
|
||||
}
|
||||
@ -36,7 +36,9 @@ class ChatDepartmentEntity extends Entity
|
||||
$chatDepartmentUsers = $m->where('chat_department_id',$this->attributes['id'])
|
||||
->where('pedido_id',null)
|
||||
->where('factura_id',null)
|
||||
->where('presupuesto_id',null)->findAll();
|
||||
->where('presupuesto_id',null)
|
||||
->where('orden_trabajo_id',null)
|
||||
->findAll();
|
||||
return $chatDepartmentUsers;
|
||||
}
|
||||
/**
|
||||
@ -62,6 +64,9 @@ class ChatDepartmentEntity extends Entity
|
||||
case 'factura':
|
||||
$m->where('pedido_id',$modelFkId);
|
||||
break;
|
||||
case 'ot':
|
||||
$m->where('orden_trabajo_id',$modelFkId);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@ class ChatDepartmentUserEntity extends Entity
|
||||
"pedido_id" => null,
|
||||
"factura_id" => null,
|
||||
"presupuesto_id" => null,
|
||||
"orden_trabajo_id" => null,
|
||||
];
|
||||
|
||||
|
||||
@ -29,6 +30,7 @@ class ChatDepartmentUserEntity extends Entity
|
||||
"pedido_id" => "?integer",
|
||||
"factura_id" => "?integer",
|
||||
"presupuesto_id" => "?integer",
|
||||
"orden_trabajo_id" => "?integer",
|
||||
];
|
||||
|
||||
public function user() : ?UserEntity
|
||||
|
||||
@ -5,11 +5,13 @@ namespace App\Entities\Chat;
|
||||
use App\Entities\Facturas\FacturaEntity;
|
||||
use App\Entities\Pedidos\PedidoEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoEntity;
|
||||
use App\Entities\Produccion\OrdenTrabajoEntity;
|
||||
use App\Entities\Usuarios\UserEntity;
|
||||
use App\Models\Chat\ChatDeparmentModel;
|
||||
use App\Models\Chat\ChatMessageModel;
|
||||
use App\Models\ChatUser;
|
||||
use App\Models\Facturas\FacturaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Models\Presupuestos\PresupuestoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
@ -25,6 +27,7 @@ class ChatEntity extends Entity
|
||||
"pedido_id" => null,
|
||||
"presupuesto_id" => null,
|
||||
"factura_id" => null,
|
||||
"orden_trabajo_id" => null,
|
||||
"title" => null
|
||||
];
|
||||
|
||||
@ -34,6 +37,7 @@ class ChatEntity extends Entity
|
||||
"pedido_id" => "?integer",
|
||||
"presupuesto_id" => "?integer",
|
||||
"factura_id" => "?integer",
|
||||
"orden_trabajo_id" => "?integer",
|
||||
"title" => "string"
|
||||
];
|
||||
|
||||
@ -71,6 +75,11 @@ class ChatEntity extends Entity
|
||||
$m = model(FacturaEntity::class);
|
||||
return $m->find($this->attributes['factura_id']);
|
||||
}
|
||||
public function orden_trabajo(): ?OrdenTrabajoEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoModel::class);
|
||||
return $m->find($this->attributes['orden_trabajo_id']);
|
||||
}
|
||||
public function messages(): ?array
|
||||
{
|
||||
$m = model(ChatMessageModel::class);
|
||||
@ -100,12 +109,14 @@ class ChatEntity extends Entity
|
||||
$models = [
|
||||
"presupuesto_id" => model(PresupuestoModel::class),
|
||||
"pedido_id" => model(PedidoModel::class),
|
||||
"factura_id" => model(FacturaModel::class)
|
||||
"factura_id" => model(FacturaModel::class),
|
||||
"orden_trabajo_id" => model(OrdenTrabajoModel::class),
|
||||
];
|
||||
$fks = [
|
||||
"presupuesto_id" => $this->attributes["presupuesto_id"],
|
||||
"pedido_id" => $this->attributes["pedido_id"],
|
||||
"factura_id" => $this->attributes["factura_id"],
|
||||
"orden_trabajo_id" => $this->attributes["orden_trabajo"],
|
||||
];
|
||||
foreach ($fks as $key => $fk) {
|
||||
if ($fk) {
|
||||
@ -123,6 +134,7 @@ class ChatEntity extends Entity
|
||||
"presupuesto" => $this->attributes["presupuesto_id"],
|
||||
"pedido" => $this->attributes["pedido_id"],
|
||||
"factura" => $this->attributes["factura_id"],
|
||||
"ot" => $this->attributes["orden_trabajo_id"],
|
||||
];
|
||||
foreach ($fks as $key => $fk) {
|
||||
if ($fk) {
|
||||
|
||||
@ -21,6 +21,13 @@ class OrdenTrabajoDateEntity extends Entity
|
||||
"corte_at" => null,
|
||||
"preparacion_interiores_at" => null,
|
||||
"entrada_manipulado_at" => null,
|
||||
"cosido_at" => null,
|
||||
"solapa_at" => null,
|
||||
"cosido_at" => null,
|
||||
"retractilado_at"=> null,
|
||||
"retractilado5_at"=> null,
|
||||
"prototipo_at"=> null,
|
||||
"marcapaginas_at"=> null,
|
||||
//FERRO
|
||||
"pendiente_ferro_at" => null,
|
||||
"ferro_en_cliente_at" => null,
|
||||
@ -43,9 +50,50 @@ class OrdenTrabajoDateEntity extends Entity
|
||||
'deleted_at',
|
||||
|
||||
];
|
||||
protected $casts = [
|
||||
];
|
||||
|
||||
|
||||
protected $casts = [];
|
||||
|
||||
public function sinImprimirStatus(): bool
|
||||
{
|
||||
return !(
|
||||
$this->attributes['interior_bn_at'] == null
|
||||
&& $this->attributes['interior_color_at'] == null
|
||||
&& $this->attributes['cubierta_at'] == null
|
||||
);
|
||||
}
|
||||
public function impresionInteriorStatus():bool
|
||||
{
|
||||
return $this->attributes['interior_bn_at']|| $this->attributes['interior_color_at'];
|
||||
}
|
||||
public function impresionCubiertaStatus():bool
|
||||
{
|
||||
return $this->attributes['cubierta_at'] != null;
|
||||
}
|
||||
public function plastificadoStatus():bool
|
||||
{
|
||||
return $this->attributes['plastificado_at'] != null;
|
||||
}
|
||||
public function encuadernadoStatus():bool
|
||||
{
|
||||
return $this->attributes['encuadernacion_at'] != null;
|
||||
}
|
||||
public function preparacionInterioresStatus():bool
|
||||
{
|
||||
return $this->attributes['preparacion_interiores_at'] != null;
|
||||
}
|
||||
public function corteStatus():bool
|
||||
{
|
||||
return $this->attributes['corte_at'] != null;
|
||||
}
|
||||
public function cosidoStatus():bool
|
||||
{
|
||||
return $this->attributes['cosido_at'] != null;
|
||||
}
|
||||
public function grapadoStatus():bool
|
||||
{
|
||||
return $this->attributes['grapado_at'] != null;
|
||||
}
|
||||
public function solapaStatus():bool
|
||||
{
|
||||
return $this->attributes['solapa_at'] != null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,21 +21,21 @@ class OrdenTrabajoEntity extends Entity
|
||||
"pedido_id" => null,
|
||||
"user_created_id" => null,
|
||||
"user_updated_id" => null,
|
||||
"fecha_entrega_warning" => false,
|
||||
"fecha_entrega_warning_revised" => false,
|
||||
"fecha_entrega_warning" => null,
|
||||
"fecha_entrega_warning_revised" => null,
|
||||
"total_tirada" => null,
|
||||
"total_precio" => null,
|
||||
"tipo_entrada" => "out",
|
||||
"progreso" => 0.00,
|
||||
"estado" => "I",
|
||||
"comentarios" => null,
|
||||
"revisar_formato" => false,
|
||||
"revisar_lomo" => false,
|
||||
"revisar_solapa" => false,
|
||||
"revisar_isbn" => false,
|
||||
"revisar_codigo_barras" => false,
|
||||
"realizar_imposicion" => false,
|
||||
"enviar_impresion" => false,
|
||||
"revisar_formato" => null,
|
||||
"revisar_lomo" => null,
|
||||
"revisar_solapa" => null,
|
||||
"revisar_isbn" => null,
|
||||
"revisar_codigo_barras" => null,
|
||||
"realizar_imposicion" => null,
|
||||
"enviar_impresion" => null,
|
||||
"portada_path" => null,
|
||||
"is_pedido_espera" => null,
|
||||
"pedido_espera_by" => null,
|
||||
@ -87,12 +87,12 @@ class OrdenTrabajoEntity extends Entity
|
||||
public function dates(): ?OrdenTrabajoDateEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoDate::class);
|
||||
return $m->where('orden_trabajo_id',$this->attributes["id"])->first();
|
||||
return $m->where('orden_trabajo_id', $this->attributes["id"])->first();
|
||||
}
|
||||
public function users(): ?OrdenTrabajoUserEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoUser::class);
|
||||
return $m->where('orden_trabajo_id',$this->attributes["id"])->first();
|
||||
return $m->where('orden_trabajo_id', $this->attributes["id"])->first();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,24 +109,24 @@ class OrdenTrabajoEntity extends Entity
|
||||
$this->attributes["dates"] = $ot_dates->fill($data);
|
||||
return $this;
|
||||
}
|
||||
public function getBarCode() : string
|
||||
public function getBarCode(): string
|
||||
{
|
||||
$barcode = new TypeCode128();
|
||||
$renderer = new PngRenderer();
|
||||
$barcodeData = $barcode->getBarcode($this->pedido()->presupuesto()->id);
|
||||
return base64_encode($renderer->render($barcodeData,200, 50));
|
||||
return base64_encode($renderer->render($barcodeData, 200, 50));
|
||||
}
|
||||
public function files() : array
|
||||
public function files(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoFileModel::class);
|
||||
return $m->where('orden_trabajo_id',$this->attributes['id'])->findAll() ?? [];
|
||||
return $m->where('orden_trabajo_id', $this->attributes['id'])->findAll() ?? [];
|
||||
}
|
||||
public function pedidoEsperaBy() : ?UserEntity
|
||||
public function pedidoEsperaBy(): ?UserEntity
|
||||
{
|
||||
$m = model(UserModel::class);
|
||||
if($this->attributes['pedido_espera_by']){
|
||||
if ($this->attributes['pedido_espera_by']) {
|
||||
return $m->findById($this->attributes['pedido_espera_by']);
|
||||
}else{
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -139,10 +139,10 @@ class OrdenTrabajoEntity extends Entity
|
||||
helper('filesystem');
|
||||
$path = WRITEPATH . 'uploads/' . $this->attributes["portada_path"];
|
||||
$portada_path = null;
|
||||
if($path){
|
||||
if(file_exists($path)){
|
||||
if ($path) {
|
||||
if (file_exists($path)) {
|
||||
$portada_path = $path;
|
||||
}else{
|
||||
} else {
|
||||
$portada_path = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,13 @@ class OrdenTrabajoUserEntity extends Entity
|
||||
"corte_user_id" => null,
|
||||
"preparacion_interior_user_id" => null,
|
||||
"entrada_manipulado_user_id" => null,
|
||||
"cosido_user_id" => null,
|
||||
"solapa_user_id" => null,
|
||||
"grapado_user_id" => null,
|
||||
"retractilado_user_id" => null,
|
||||
"retractilado5_user_id" => null,
|
||||
"prototipo_user_id" => null,
|
||||
"marcapaginas_user_id" => null,
|
||||
//FERRO
|
||||
"pendiente_ferro_user_id" => null,
|
||||
"ferro_en_cliente_user_id" => null,
|
||||
@ -39,9 +46,9 @@ class OrdenTrabajoUserEntity extends Entity
|
||||
"pre_codbarras_user_id" => null,
|
||||
"pre_imposicion_user_id" => null,
|
||||
//UNUSED
|
||||
"inaplazable_revised_change_user_id" => null,//!DELETE
|
||||
"ferro_disponible_hecho_user_id" => null,//!DELETE
|
||||
"ferro_entregado_user_id" => null,//!DELETE
|
||||
"inaplazable_revised_change_user_id" => null, //!DELETE
|
||||
"ferro_disponible_hecho_user_id" => null, //!DELETE
|
||||
"ferro_entregado_user_id" => null, //!DELETE
|
||||
"pre_imprimir_user_id" => null, //!DELETE
|
||||
"ferro_disponible_ok_user_id" => null, //!DELETE
|
||||
];
|
||||
@ -85,7 +92,7 @@ class OrdenTrabajoUserEntity extends Entity
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
public function getPlastificadoBy() : ?UserEntity
|
||||
public function getPlastificadoBy(): ?UserEntity
|
||||
{
|
||||
return $this->userBy('plastificado_user_id');
|
||||
}
|
||||
|
||||
@ -87,6 +87,14 @@ return [
|
||||
"ejemplares" => "Ejemplares",
|
||||
"tipo" => "Tipo",
|
||||
"lomo" => "Lomo",
|
||||
|
||||
"cosido" => "Cosido",
|
||||
"grapado" => "Grapado",
|
||||
"solapa" => "Solapas",
|
||||
"retractilado" => "Retractilado",
|
||||
"retractilado5" => "Retractilado 5",
|
||||
"prototipo" => "Prototipo",
|
||||
"marcapaginas" => "Marcapáginas",
|
||||
//IMPRESION
|
||||
"impresion_bn" => "Impresión BN",
|
||||
"cubierta" => "Cubierta/Portada",
|
||||
@ -96,6 +104,7 @@ return [
|
||||
"pre_solapa" => "Revisión solapa",
|
||||
"pre_codbarras" => "Revisión código barras",
|
||||
"pre_imposicion" => "Revisión imposición",
|
||||
|
||||
|
||||
|
||||
"errors" => [
|
||||
|
||||
@ -136,6 +136,7 @@ class ChatDeparmentModel extends Model
|
||||
->where('chat_department_users.presupuesto_id',null)
|
||||
->where('chat_department_users.pedido_id',null)
|
||||
->where('chat_department_users.factura_id',null)
|
||||
->where('chat_department_users.orden_trabajo_id',null)
|
||||
->get();
|
||||
|
||||
return $result->getResultObject() ?: [];
|
||||
@ -161,6 +162,13 @@ class ChatDeparmentModel extends Model
|
||||
->get()->getResultObject();
|
||||
return $result;
|
||||
}
|
||||
public function getChatDeparmentOrdenTrabajoUsers(int $chat_deparment_id, int $orden_trabajo_id)
|
||||
{
|
||||
$result = $this->getChatDeparmentUserQuery($chat_deparment_id)
|
||||
->where('chat_department_users.orden_trabajo_id', $orden_trabajo_id)
|
||||
->get()->getResultObject();
|
||||
return $result;
|
||||
}
|
||||
public function getDisplay(int $chat_deparment_id): string
|
||||
{
|
||||
return $this->find($chat_deparment_id)->display;
|
||||
|
||||
@ -19,7 +19,9 @@ class ChatDeparmentUserModel extends Model
|
||||
"user_id",
|
||||
"pedido_id",
|
||||
"factura_id",
|
||||
"presupuesto_id"
|
||||
"presupuesto_id",
|
||||
"orden_trabajo_id",
|
||||
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
|
||||
@ -6,11 +6,13 @@ use App\Entities\Chat\ChatEntity;
|
||||
use App\Models\ChatNotification;
|
||||
use App\Models\ChatUser;
|
||||
use App\Models\Facturas\FacturaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Models\Presupuestos\PresupuestoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Model;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use Config\OrdenTrabajo;
|
||||
|
||||
class ChatModel extends Model
|
||||
{
|
||||
@ -25,6 +27,7 @@ class ChatModel extends Model
|
||||
"chat_department_id",
|
||||
"presupuesto_id",
|
||||
"factura_id",
|
||||
"orden_trabajo_id",
|
||||
"title"
|
||||
];
|
||||
|
||||
@ -86,6 +89,10 @@ class ChatModel extends Model
|
||||
{
|
||||
return $this->builder()->where("factura_id", $factura_id)->where("chat_department_id", $chat_department_id)->get()->getFirstRow();
|
||||
}
|
||||
public function getChatOrdenTrabajo(int $chat_department_id, int $orden_trabajo_id)
|
||||
{
|
||||
return $this->builder()->where("orden_trabajo_id", $orden_trabajo_id)->where("chat_department_id", $chat_department_id)->get()->getFirstRow();
|
||||
}
|
||||
|
||||
public function createChatPresupuesto(int $chat_department_id, int $presupuesto_id): int
|
||||
{
|
||||
@ -123,6 +130,17 @@ class ChatModel extends Model
|
||||
"chat_department_id" => $chat_department_id
|
||||
]);
|
||||
}
|
||||
public function createChatOrdenTrabajo(int $chat_department_id, int $orden_trabajo_id): int
|
||||
{
|
||||
$model = model(OrdenTrabajoModel::class);
|
||||
$chatDeparmentModel = model(ChatDeparmentModel::class);
|
||||
$ot = $model->find($orden_trabajo_id);
|
||||
return $this->insert([
|
||||
"title" => "[OT]".$ot->id . "[" . $chatDeparmentModel->getDisplay($chat_department_id) . "]",
|
||||
"orden_trabajo_id" => $orden_trabajo_id,
|
||||
"chat_department_id" => $chat_department_id
|
||||
]);
|
||||
}
|
||||
public function createChatSingle(): int
|
||||
{
|
||||
return $this->insert(["chat_department_id" => null]);
|
||||
@ -323,6 +341,7 @@ class ChatModel extends Model
|
||||
"chats.pedido_id as pedidoId",
|
||||
"chats.presupuesto_id as presupuestoId",
|
||||
"chats.factura_id as facturaId",
|
||||
"chats.orden_trabajo_id as ordenTrabajoId",
|
||||
"chats.title as chatDisplay",
|
||||
"COUNT(chat_notifications.id) as unreadMessages"
|
||||
])
|
||||
@ -363,6 +382,13 @@ class ChatModel extends Model
|
||||
$row->title = $row->facturaId;
|
||||
$rows_new[] = $row;
|
||||
}
|
||||
elseif ($row->ordenTrabajoId) {
|
||||
// $row->model = $facturaModel->find($row->facturaId);
|
||||
$row->uri = "/chat/ot/" . $row->ordenTrabajoId . "#accordionChatOrdenTrabajo";
|
||||
$row->avatar = "OT";
|
||||
$row->title = $row->ordenTrabajoId;
|
||||
$rows_new[] = $row;
|
||||
}
|
||||
}
|
||||
return $rows_new;
|
||||
}
|
||||
@ -374,6 +400,7 @@ class ChatModel extends Model
|
||||
"chats.chat_department_id as chatDepartmentId",
|
||||
"chats.pedido_id as pedidoId",
|
||||
"chats.presupuesto_id as presupuestoId",
|
||||
"chats.orden_trabajo_id as ordenTrabajoId",
|
||||
"chats.factura_id as facturaId",
|
||||
"chats.title as chatDisplay",
|
||||
"COUNT(chat_messages.id) as unreadMessages"
|
||||
@ -413,6 +440,13 @@ class ChatModel extends Model
|
||||
$row->title = $row->facturaId;
|
||||
$rows_new[] = $row;
|
||||
}
|
||||
elseif ($row->ordenTrabajoId) {
|
||||
$row->uri = "/produccion/ordentrabajo/edit/" . $row->ordenTrabajoId . "#accordionChatOrdenTrabajo";
|
||||
$row->avatar = "OT";
|
||||
$row->chatDisplay .= "[INTERNAL]";
|
||||
$row->title = $row->ordenTrabajoId;
|
||||
$rows_new[] = $row;
|
||||
}
|
||||
}
|
||||
return $rows_new;
|
||||
}
|
||||
@ -433,6 +467,7 @@ class ChatModel extends Model
|
||||
->where("chats.chat_department_id", null)
|
||||
->where("chats.pedido_id", null)
|
||||
->where("chats.factura_id", null)
|
||||
->where("chats.orden_trabajo_id", null)
|
||||
->where("chat_notifications.viewed", false)
|
||||
->where("chat_notifications.user_id", auth()->user()->id);
|
||||
$rows = $q->get()->getResultObject();
|
||||
@ -513,6 +548,27 @@ class ChatModel extends Model
|
||||
$data["users"] = $this->getChatUsers($chat_id);
|
||||
return $data;
|
||||
}
|
||||
public function getChatInternalHebraOrdenTrabajo($chat_id, $orden_trabajo_id)
|
||||
{
|
||||
$data = [];
|
||||
$query = $this->builder()->select([
|
||||
"chats.id as chatId",
|
||||
"chat_messages.message",
|
||||
"users.username as senderUserName",
|
||||
"chat_messages.created_at",
|
||||
"CONCAT(users.first_name,' ',users.last_name) as senderFullName",
|
||||
])
|
||||
->join("chat_messages", "chat_messages.chat_id = chats.id", "left")
|
||||
->join("users", "users.id = chat_messages.sender_id", "left")
|
||||
->where("chats.id", $chat_id)
|
||||
->where("chats.orden_trabajo_id", $orden_trabajo_id);
|
||||
$data["chatId"] = $chat_id;
|
||||
$data["messages"] = $query->get()->getResultObject();
|
||||
$data["chatTitle"] = "OT" . "[" . $orden_trabajo_id . "] - ";
|
||||
$data["chatTitle"] .= $this->find($chat_id)->title;
|
||||
$data["users"] = $this->getChatUsers($chat_id);
|
||||
return $data;
|
||||
}
|
||||
public function getChatUsers(int $chat_id)
|
||||
{
|
||||
$query = $this->builder()->select([
|
||||
@ -557,6 +613,17 @@ class ChatModel extends Model
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function getOrdenTrabajoHebras($orden_trabajo_id): array
|
||||
{
|
||||
$data = [];
|
||||
$chats = $this->builder()->select("chats.id as chatId")
|
||||
->where("chats.chat_department_id", null)
|
||||
->where("chats.orden_trabajo_id", $orden_trabajo_id)->get()->getResultObject();
|
||||
foreach ($chats as $chat) {
|
||||
$data[$chat->chatId] = $this->getChatInternalHebraOrdenTrabajo($chat->chatId, $orden_trabajo_id);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function countUnreadMessagePresupuesto(int $presupuesto_id): int|string
|
||||
{
|
||||
return $this->builder()->select()
|
||||
@ -586,6 +653,15 @@ class ChatModel extends Model
|
||||
->where("chat_notifications.viewed", false)
|
||||
->where("chat_notifications.user_id", auth()->user()->id)->countAllResults();
|
||||
}
|
||||
public function countUnreadMessageOrdenTrabajo($orden_trabajo_id): int|string
|
||||
{
|
||||
return $this->builder()->select()
|
||||
->join("chat_messages", "chat_messages.chat_id = chats.id", "left")
|
||||
->join("chat_notifications", "chat_notifications.chat_message_id = chat_messages.id", "left")
|
||||
->where("chats.orden_trabajo_id", $orden_trabajo_id)
|
||||
->where("chat_notifications.viewed", false)
|
||||
->where("chat_notifications.user_id", auth()->user()->id)->countAllResults();
|
||||
}
|
||||
public function countUnreadMessageDirectos(int $chat_id): int|string
|
||||
{
|
||||
return $this->builder()->select()
|
||||
@ -606,6 +682,7 @@ class ChatModel extends Model
|
||||
->where("chats.presupuesto_id", null)
|
||||
->where("chats.pedido_id", null)
|
||||
->where("chats.factura_id", null)
|
||||
->where("chats.orden_trabajo_id", null)
|
||||
->where("chats.id", $chat_id)
|
||||
->where("chat_messages.receiver_id", auth()->user()->id)->get()->getFirstRow();
|
||||
$userModel = model(UserModel::class);
|
||||
@ -837,6 +914,36 @@ class ChatModel extends Model
|
||||
}
|
||||
return $query->groupBy('chatMessageId');
|
||||
}
|
||||
public function getQueryDatatableMessageOrdenTrabajo(int $user_id): BaseBuilder
|
||||
{
|
||||
$query = $this->builder()
|
||||
->select([
|
||||
"chats.id",
|
||||
"cm.id as chatMessageId",
|
||||
"u.id as userId",
|
||||
"cm.message",
|
||||
"chats.created_at",
|
||||
"
|
||||
(
|
||||
SELECT cm2.updated_at
|
||||
FROM chat_messages cm2
|
||||
WHERE cm2.chat_id = chats.id
|
||||
ORDER BY cm2.updated_at DESC LIMIT 1
|
||||
) as updated_at",
|
||||
"CONCAT(u.first_name,' ',u.last_name) as creator",
|
||||
"chats.title",
|
||||
])
|
||||
->join("chat_messages cm", "chats.id = cm.chat_id", "left")
|
||||
->join("users u", "u.id = cm.sender_id", 'left')
|
||||
->join("ordenes_trabajo", "ordenes_trabajo.id = chats.orden_trabajo_id", "left")
|
||||
->where("chats.orden_trabajo_id is NOT NULL", NULL, FALSE);
|
||||
|
||||
if (auth()->user()->inGroup("cliente-administrador","cliente")) {
|
||||
$query->where('facturas.cliente_id', auth()->user()->cliente_id)
|
||||
->where("chats.chat_department_id is NOT NULL", NULL, FALSE);
|
||||
}
|
||||
return $query->groupBy('chatMessageId');
|
||||
}
|
||||
public function createNewDirectChat(string $title, string $message, array $users)
|
||||
{
|
||||
$chatMessageModel = model(ChatMessageModel::class);
|
||||
|
||||
@ -28,6 +28,13 @@ class OrdenTrabajoDate extends Model
|
||||
"corte_at",
|
||||
"preparacion_interiores_at",
|
||||
"entrada_manipulado_at",
|
||||
"cosido_at",
|
||||
"solapa_at",
|
||||
"cosido_at",
|
||||
"retractilado_at",
|
||||
"retractilado5_at",
|
||||
"prototipo_at",
|
||||
"marcapaginas_at",
|
||||
//FERRO
|
||||
"pendiente_ferro_at",
|
||||
"ferro_en_cliente_at",
|
||||
|
||||
@ -29,6 +29,13 @@ class OrdenTrabajoUser extends Model
|
||||
"corte_user_id",
|
||||
"preparacion_interior_user_id",
|
||||
"entrada_manipulado_user_id",
|
||||
"cosido_user_id",
|
||||
"solapa_user_id",
|
||||
"grapado_user_id",
|
||||
"retractilado_user_id",
|
||||
"retractilado5_user_id",
|
||||
"prototipo_user_id",
|
||||
"marcapaginas_user_id",
|
||||
//FERRO
|
||||
"pendiente_ferro_user_id",
|
||||
"ferro_en_cliente_user_id",
|
||||
|
||||
@ -40,6 +40,7 @@ class ChatService extends BaseService
|
||||
"presupuesto" => "presupuesto_id",
|
||||
"pedido" => "pedido_id",
|
||||
"factura" => "factura_id",
|
||||
"ot" => "orden_trabajo_id"
|
||||
];
|
||||
protected array $modelClassMap;
|
||||
public function __construct()
|
||||
@ -122,6 +123,9 @@ class ChatService extends BaseService
|
||||
case 'factura':
|
||||
$r = $this->chatModel->createChatFactura($chatDepartmentId, $modelId);
|
||||
break;
|
||||
case 'ot':
|
||||
$r = $this->chatModel->createChatOrdenTrabajo($chatDepartmentId, $modelId);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -50,6 +50,7 @@ class ProductionService extends BaseService
|
||||
protected MaquinaEntity $defaultMaquinaCorte;
|
||||
protected MaquinaModel $maquinaModel;
|
||||
protected OrdenTrabajo $ordenTrabajoConfig;
|
||||
public string $statusColor;
|
||||
|
||||
/**
|
||||
* Pedido Entity
|
||||
@ -74,16 +75,24 @@ class ProductionService extends BaseService
|
||||
$this->otFileModel = model(OrdenTrabajoFileModel::class);
|
||||
$this->pedidoModel = model(PedidoModel::class);
|
||||
$this->ordenTrabajoConfig = config('OrdenTrabajo');
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
|
||||
}
|
||||
public function init(int $orden_trabajo_id): self
|
||||
{
|
||||
$this->maquinaModel = model(MaquinaModel::class);
|
||||
$this->otModel = model(OrdenTrabajoModel::class);
|
||||
$this->ot = $this->otModel->find($orden_trabajo_id);
|
||||
$pedido = $this->ot->pedido();
|
||||
$this->setPedido($pedido);
|
||||
$this->defaultMaquinaCorte = $this->maquinaModel->where('nombre', $this->defaultMaquinaCorteName)->first();
|
||||
return $this;
|
||||
try {
|
||||
//code...
|
||||
$this->maquinaModel = model(MaquinaModel::class);
|
||||
$this->otModel = model(OrdenTrabajoModel::class);
|
||||
$this->ot = $this->otModel->find($orden_trabajo_id);
|
||||
$pedido = $this->ot->pedido();
|
||||
$this->setPedido($pedido);
|
||||
$this->defaultMaquinaCorte = $this->maquinaModel->where('nombre', $this->defaultMaquinaCorteName)->first();
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
|
||||
return $this;
|
||||
} catch (\Throwable $th) {
|
||||
dd($orden_trabajo_id);
|
||||
throw $th;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Establece el pedido sobre el que se va a trabajar
|
||||
@ -631,6 +640,7 @@ class ProductionService extends BaseService
|
||||
"tareas_preimpresion" => $this->tareas_preimpresion(),
|
||||
"tareas_impresion" => $this->tareas_impresion(),
|
||||
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
|
||||
"statusColor" => $this->getOtColorStatus(),
|
||||
];
|
||||
return $summary;
|
||||
}
|
||||
@ -1107,10 +1117,89 @@ class ProductionService extends BaseService
|
||||
}
|
||||
|
||||
$progreso = (float) $fill_dates / $total * 100;
|
||||
$status = $this->otModel->update($this->ot->id, ["progreso" => round($progreso,2)]);
|
||||
}else{
|
||||
$status = $this->otModel->update($this->ot->id, ["progreso" => round($progreso, 2)]);
|
||||
} else {
|
||||
$status = $this->otModel->update($this->ot->id, ["progreso" => 100]);
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
public function getOtColorStatus(): string
|
||||
{
|
||||
if($this->ot->dates()){
|
||||
$this->updateColor();
|
||||
}
|
||||
return $this->statusColor;
|
||||
}
|
||||
protected function otSinImprimirColor()
|
||||
{
|
||||
if ($this->ot->dates()->sinImprimirStatus()) {
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
|
||||
};
|
||||
}
|
||||
protected function otImpresionIntColor()
|
||||
{
|
||||
if ($this->ot->dates()->impresionInteriorStatus()) {
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["impreso_int"];
|
||||
};
|
||||
}
|
||||
protected function otImpresionCubiertaColor()
|
||||
{
|
||||
if ($this->ot->dates()->impresionCubiertaStatus()) {
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["impreso_cub"];
|
||||
};
|
||||
}
|
||||
protected function otPlastificadoColor()
|
||||
{
|
||||
if ($this->ot->dates()->plastificadoStatus()) {
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["plastificado"];
|
||||
};
|
||||
}
|
||||
protected function otSolapaColor()
|
||||
{
|
||||
if ($this->ot->dates()->solapaStatus()) {
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["solapa"];
|
||||
};
|
||||
}
|
||||
protected function otEncuadernadoColor()
|
||||
{
|
||||
if ($this->ot->dates()->encuadernadoStatus()) {
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["encuadernado"];
|
||||
};
|
||||
}
|
||||
protected function otPreparadoColor()
|
||||
{
|
||||
if ($this->ot->dates()->preparacionInterioresStatus()) {
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["preparado"];
|
||||
};
|
||||
}
|
||||
protected function otCorteColor()
|
||||
{
|
||||
if ($this->ot->dates()->corteStatus()) {
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["corte"];
|
||||
};
|
||||
}
|
||||
protected function otCosidoColor()
|
||||
{
|
||||
if ($this->ot->dates()->cosidoStatus()) {
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["cosido"];
|
||||
};
|
||||
}
|
||||
protected function otGrapadoColor()
|
||||
{
|
||||
if ($this->ot->dates()->grapadoStatus()) {
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["grapado"];
|
||||
};
|
||||
}
|
||||
protected function updateColor(){
|
||||
$this->otSinImprimirColor();
|
||||
$this->otImpresionIntColor();
|
||||
$this->otCosidoColor();
|
||||
$this->otImpresionCubiertaColor();
|
||||
$this->otPlastificadoColor();
|
||||
$this->otSolapaColor();
|
||||
$this->otPreparadoColor();
|
||||
$this->otGrapadoColor();
|
||||
$this->otEncuadernadoColor();
|
||||
$this->otCorteColor();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionChatOrdenTrabajo">
|
||||
<div class="card accordion-item">
|
||||
<h2 class="accordion-header" id="headingChatOrdenTrabajo">
|
||||
<button type="button" class="accordion-button collapsed" data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionChatOrdenTrabajoTip" aria-expanded="false"
|
||||
aria-controls="accordionChatOrdenTrabajoTip">
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<span><i class="ti-messages ti-md ti"></i></span>
|
||||
<h4><?= lang("Chat.chat") ?></h4>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="accordionChatOrdenTrabajoTip" class="accordion-collapse collapse"
|
||||
data-bs-parent="#accordionChatOrdenTrabajo">
|
||||
<div class="accordion-body">
|
||||
<div class="nav-align-top">
|
||||
<ul class="nav nav-pills mb-4" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link <?= !auth()->user()->inGroup('cliente-administrador','cliente') ? "" : "active" ?>" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false"><?= lang('Chat.messages_client') ?></button>
|
||||
</li>
|
||||
<?php if (!auth()->user()->inGroup('cliente-administrador','cliente')) { ?>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false"><?= lang('Chat.messages_internal') ?></button>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade <?= !auth()->user()->inGroup('cliente-administrador','cliente') ? "" : "show active" ?>" id="navs-pills-top-chat" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/chat_orden_trabajo", data: ["modelId" => $modelId, "type" => "ot"]) ?>
|
||||
</div>
|
||||
<?php if (!auth()->user()->inGroup('cliente-administrador','cliente')) { ?>
|
||||
<div class="tab-pane fade show active" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "ot"]) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
156
ci4/app/Views/themes/vuexy/components/chat_orden_trabajo.php
Normal file
156
ci4/app/Views/themes/vuexy/components/chat_orden_trabajo.php
Normal file
@ -0,0 +1,156 @@
|
||||
<div class="container-xxl flex-grow-1 container-p-y" id="chat-orden-trabajo" data-id="<?= $modelId ?>">
|
||||
|
||||
<div class="app-chat card overflow-hidden border">
|
||||
<div class="row g-0">
|
||||
<!-- Chat & Contacts -->
|
||||
<div class="col app-chat-contacts app-sidebar flex-grow-0 overflow-hidden border-end"
|
||||
id="app-chat-contacts">
|
||||
<div class="sidebar-header">
|
||||
<div class="d-flex align-items-center me-3 me-lg-0">
|
||||
<div class="flex-shrink-0 avatar me-3">
|
||||
<span class="avatar-initial rounded-circle bg-label-success">U</span>
|
||||
</div>
|
||||
|
||||
<div class="flex-grow-1 input-group input-group-merge rounded-pill">
|
||||
<span class="input-group-text" id="basic-addon-search31">
|
||||
<i class="ti ti-search"></i>
|
||||
</span>
|
||||
<input type="text" class="form-control chat-search-input"
|
||||
placeholder="Buscar..." aria-label="Buscar..."
|
||||
aria-describedby="basic-addon-search31" />
|
||||
</div>
|
||||
</div>
|
||||
<i class="ti ti-x cursor-pointer d-lg-none d-block position-absolute mt-2 me-1 top-0 end-0"
|
||||
data-overlay data-bs-toggle="sidebar" data-target="#app-chat-contacts"></i>
|
||||
</div>
|
||||
<hr class="container-m-nx m-0" />
|
||||
<div class="sidebar-body">
|
||||
<div class="chat-contact-list-item-title">
|
||||
<?php if (!auth()->user()->inGroup('cliente-administrador','cliente')): ?>
|
||||
<div class="mb-0 px-4 pt-3 pb-2">
|
||||
<select class="form-control chat-search-client"></select>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="chat-contact-list-item-title">
|
||||
<h5 class="text-primary mb-0 px-4 pt-3 pb-2">Departamentos</h5>
|
||||
</div>
|
||||
<!-- Chats -->
|
||||
<ul class="list-unstyled chat-contact-list" id="chat-list">
|
||||
|
||||
|
||||
<!-- CHAT LIST -->
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Chat contacts -->
|
||||
|
||||
<!-- Chat History -->
|
||||
<div class="col app-chat-history bg-body">
|
||||
<div class="chat-history-wrapper ">
|
||||
<div class="chat-history-header border-bottom">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex overflow-hidden align-items-center">
|
||||
<i class="ti ti-menu-2 ti-sm cursor-pointer d-lg-none d-block me-2"
|
||||
data-bs-toggle="sidebar" data-overlay
|
||||
data-target="#app-chat-contacts"></i>
|
||||
<div class="avatar d-block flex-shrink-0">
|
||||
<span
|
||||
class="avatar-initial rounded-circle bg-label-primary">P</span>
|
||||
</div>
|
||||
<div class="chat-contact-info flex-grow-1 ms-2">
|
||||
<h6 class="m-0"></h6>
|
||||
<small class="user-status text-muted"></small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center">
|
||||
<?php if (!auth()->user()->inGroup('cliente-administrador','cliente')): ?>
|
||||
|
||||
<div class="ml-2 px-2">
|
||||
<button type="button" class="btn btn-danger btn-sm exit-chat">
|
||||
<i class="ti ti-trash"></i>
|
||||
<?= lang('Chat.exit_chat') ?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="ml-2 px-2">
|
||||
<button type="button" class="btn btn-success btn-sm subscribe-chat">
|
||||
<i class="ti ti-plus"></i>
|
||||
<?= lang('Chat.subscribe_chat') ?>
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="dropdown d-flex align-self-center ml-2 px-2 d-none" id="chat-header-dropdown-users">
|
||||
<button type="button" class="btn btn-primary btn-icon rounded-pill dropdown-toggle hide-arrow" data-bs-toggle="dropdown">
|
||||
<i class="ti ti-users"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-end mb-0 px-2 pt-3 pb-2" id="chat-header-users"
|
||||
aria-labelledby="chat-header-users">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-history-body bg-body">
|
||||
<div class="d-flex justify-content-center chat-loader">
|
||||
<div class="sk-wave sk-primary ">
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="list-unstyled chat-history" id="chat-conversation">
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<!-- Chat message form -->
|
||||
<div class="chat-history-footer shadow-sm">
|
||||
<div
|
||||
class="form-send-message d-flex justify-content-between align-items-center">
|
||||
<input class="form-control message-input border-0 me-3 shadow-none"
|
||||
placeholder="<?= lang('Chat.write_message_placeholder') ?>" />
|
||||
<div class="message-actions d-flex align-items-center">
|
||||
<?php if (!auth()->user()->inGroup('cliente-administrador','cliente')): ?>
|
||||
<button type="button" class="btn btn-primary d-flex send-msg-btn" style="color:white"
|
||||
id="send-msg-btn-deparment" disabled>
|
||||
<i class="ti ti-send me-md-1 me-0"></i>
|
||||
<span class="align-middle d-md-inline-block">Enviar</span>
|
||||
</button>
|
||||
<?php else : ?>
|
||||
<button type="button" class="btn btn-primary d-flex send-msg-btn" style="color:white"
|
||||
id="send-msg-btn-deparment-client">
|
||||
<i class="ti ti-send me-md-1 me-0"></i>
|
||||
<span class="align-middle d-md-inline-block">Enviar</span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Chat History -->
|
||||
|
||||
<div class="app-overlay"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||
<?= $this->endSection() ?>
|
||||
<!------------------------------------------------------->
|
||||
<!-- Código JS logica -->
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script type="module" src="<?= site_url('assets/js/safekat/pages/chatOrdenTrabajo.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,36 @@
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="modalNewTask" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel1"><?= lang('Produccion.task') ?></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="formNewOtTask" method="POST">
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-0">
|
||||
<label for="ot-task-nombre" class="form-label"><?= lang('Produccion.nombre') ?></label>
|
||||
<input type="input" rows="4" cols="10" id="ot-task-nombre" placeholder="Escriba un título" name="nombre" class="form-control" />
|
||||
</div>
|
||||
<div class="col-12 mb-0">
|
||||
<label for="ot-task-nombre" class="form-label"><?= lang('Produccion.tiempo_estimado') ?></label>
|
||||
<input type="input" rows="4" cols="10" id="ot-task-tiempo-estimado" name="tiempo_estimado" class="form-control" />
|
||||
</div>
|
||||
<div class="col-12 mb-0">
|
||||
<label for="ot-task-nombre" class="form-label"><?= lang('Produccion.tiempo_estimado') ?></label>
|
||||
<select type="input" rows="4" cols="10" id="ot-task-tiempo-estimado" name="tiempo_estimado" class="form-control"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.global_come_back') ?></button>
|
||||
<button type="button" id="submit_new_hebra" class="btn btn-primary d-none"><?= lang('Chat.modal.btn_send') ?></button>
|
||||
<button type="button" id="submit_update_hebra" class="btn btn-primary d-none"><?= lang('Chat.modal.btn_send_update') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
||||
<table id="<?= $id ?>" class="table table-hover text-dark" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Produccion.datatable.pedido_id') ?></th>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="text-light small fw-medium mb-4 text-start">Revisión</div>
|
||||
<div class="d-flex flex-column justify-content-start text-start gap-2">
|
||||
<label class="switch switch-md">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="revisar_formato"/>
|
||||
<input type="checkbox" class="switch-input ot-preview" name="revisar_formato" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
@ -14,7 +14,7 @@
|
||||
<span class="switch-label">Revisar formato</span>
|
||||
</label>
|
||||
<label class="switch switch-md">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="revisar_lomo" />
|
||||
<input type="checkbox" class="switch-input ot-preview" name="revisar_lomo" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
@ -26,7 +26,7 @@
|
||||
<span class="switch-label">Revisar lomo</span>
|
||||
</label>
|
||||
<label class="switch switch-md">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="revisar_solapa" />
|
||||
<input type="checkbox" class="switch-input ot-preview" id="revisar-solapa" name="revisar_solapa" />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
|
||||
@ -21,88 +21,89 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<!-- PREIMPRESION -->
|
||||
<!-- Preformato -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-preformato-btn" class="form-label"><?= @lang("Produccion.pre_formato") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_formato_at" id="ot-preformato-date">
|
||||
<div class="form-text"><?=$user_dates["pre_formato_at"]?></div>
|
||||
</div>
|
||||
<!-- Prelomo -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-prelomo-btn" class="form-label"><?= @lang("Produccion.pre_lomo") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_lomo_at" id="ot-prelomo-date">
|
||||
<div class="form-text"><?=$user_dates["pre_lomo_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Presolapa -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-presolapa-btn" class="form-label"><?= @lang("Produccion.pre_solapa") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_solapa_at" id="ot-presolapa-date">
|
||||
<div class="form-text"><?=$user_dates["pre_solapa_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Precodbarras -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-precodbarras-btn" class="form-label"><?= @lang("Produccion.pre_codbarras") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_codbarras_at" id="ot-precodbarras-date">
|
||||
<div class="form-text"><?=$user_dates["pre_codbarras_at"]?></div>
|
||||
|
||||
</div>
|
||||
<!-- Preimposicion -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-preimposicion-btn" class="form-label"><?= @lang("Produccion.pre_imposicion") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_imposicion_at" id="ot-preimposicion-date">
|
||||
<div class="form-text"><?=$user_dates["pre_imposicion_at"]?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_bn") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_bn_at" id="ot-impresion-bn">
|
||||
<div class="form-text"><?=$user_dates["interior_bn_at"]?></div>
|
||||
<div class="form-text"><?= $user_dates["interior_bn_at"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_color") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_color_at" id="ot-impresion-color">
|
||||
<div class="form-text"><?=$user_dates["interior_color_at"]?></div>
|
||||
<div class="form-text"><?= $user_dates["interior_color_at"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-portada" class="form-label"><?= @lang("Produccion.cubierta") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-portada">
|
||||
<div class="form-text"><?=$user_dates["cubierta_at"]?></div>
|
||||
<div class="form-text"><?= $user_dates["cubierta_at"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-plakene-traslucido" class="form-label"><?= @lang("Produccion.plakene_traslucido") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plakene_taslucido_at" id="ot-plakene-traslucido">
|
||||
<div class="form-text"></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-plastificado-mate" class="form-label"><?= @lang("Produccion.plastificado_mate") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado-mate">
|
||||
<div class="form-text"><?=$user_dates["plastificado_at"]?></div>
|
||||
<div class="form-text"><?= $user_dates["plastificado_at"] ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->cosido ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-cosido" class="form-label"><?= @lang("Produccion.cosido") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cosido_at" id="ot-prep-cosido">
|
||||
<div class="form-text"><?= $user_dates["cosido_at"] ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-prep-grapado" class="form-label"><?= @lang("Produccion.grapado") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="grapado_at" id="ot-prep-grapado">
|
||||
<div class="form-text"><?= $user_dates["grapado_at"] ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->solapas ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-solapa" class="form-label"><?= @lang("Produccion.solapa") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="solapa_at" id="ot-prep-solapa">
|
||||
<div class="form-text"><?= $user_dates["solapa_at"] ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->retractilado ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-retractilado" class="form-label"><?= @lang("Produccion.retractilado") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado_at" id="ot-prep-retractilado">
|
||||
<div class="form-text"><?= $user_dates["retractilado_at"] ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->retractilado5 ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-retractilado5" class="form-label"><?= @lang("Produccion.retractilado5") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado5_at" id="ot-prep-retractilado5">
|
||||
<div class="form-text"><?= $user_dates["retractilado5_at"] ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->prototipo ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-prototipo" class="form-label"><?= @lang("Produccion.prototipo") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="prototipo_at" id="ot-prep-prototipo">
|
||||
<div class="form-text"><?= $user_dates["prototipo_at"] ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->marcapaginas ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-marcapaginas" class="form-label"><?= @lang("Produccion.marcapaginas") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="marcapaginas_at" id="ot-prep-marcapaginas">
|
||||
<div class="form-text"><?= $user_dates["marcapaginas_at"] ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-prep-guillotina" class="form-label"><?= @lang("Produccion.guillotina") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="corte_at" id="ot-prep-guillotina">
|
||||
<div class="form-text"><?=$user_dates["corte_at"]?></div>
|
||||
<div class="form-text"><?= $user_dates["corte_at"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
@ -115,43 +116,78 @@
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-pendiente-ferro" class="form-label"><?= @lang("Produccion.pendiente_ferro") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="pendiente_ferro_at" placeholder="DD/MM/YYYY" id="ot-pendiente-ferro">
|
||||
<div class="form-text"><?=$user_dates["pendiente_ferro_at"]?></div>
|
||||
<div class="form-text"><?= $user_dates["pendiente_ferro_at"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-ferro-cliente" class="form-label"><?= @lang("Produccion.ferro_cliente") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="ferro_en_cliente_at" placeholder="DD/MM/YYYY" id="ot-ferro-cliente">
|
||||
<div class="form-text"><?=$user_dates["ferro_en_cliente_at"]?></div>
|
||||
|
||||
<div class="form-text"><?= $user_dates["ferro_en_cliente_at"] ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-ferro-ok" class="form-label"><?= @lang("Produccion.ferro_ok") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="ferro_ok_at" placeholder="DD/MM/YYYY" id="ot-ferro-ok">
|
||||
<div class="form-text"><?=$user_dates["ferro_ok_at"]?></div>
|
||||
<div class="form-text"><?= $user_dates["ferro_ok_at"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-embalaje" class="form-label"><?= @lang("Produccion.embalaje") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="embalaje_at" id="ot-embalaje">
|
||||
<div class="form-text"><?=$user_dates["embalaje_at"]?></div>
|
||||
<div class="form-text"><?= $user_dates["embalaje_at"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-envio" class="form-label"><?= @lang("Produccion.envio") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="envio_at" id="ot-envio">
|
||||
<div class="form-text"><?=$user_dates["envio_at"]?></div>
|
||||
<div class="form-text"><?= $user_dates["envio_at"] ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- PREIMPRESION -->
|
||||
<!-- Preformato -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $ot->revisar_formato ? "" : "d-none" ?>">
|
||||
<label for="ot-preformato-btn" class="form-label"><?= @lang("Produccion.pre_formato") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_formato_at" id="ot-preformato-date">
|
||||
<div class="form-text"><?= $user_dates["pre_formato_at"] ?></div>
|
||||
</div>
|
||||
<!-- Prelomo -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $ot->revisar_lomo ? "" : "d-none" ?>">
|
||||
<label for="ot-prelomo-btn" class="form-label"><?= @lang("Produccion.pre_lomo") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_lomo_at" id="ot-prelomo-date">
|
||||
<div class="form-text"><?= $user_dates["pre_lomo_at"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Presolapa -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $ot->revisar_solapa ? "" : "d-none" ?>">
|
||||
<label for="ot-presolapa-btn" class="form-label"><?= @lang("Produccion.pre_solapa") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_solapa_at" id="ot-presolapa-date">
|
||||
<div class="form-text"><?= $user_dates["pre_solapa_at"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Precodbarras -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $ot->revisar_codigo_barras ? "" : "d-none" ?>">
|
||||
<label for="ot-precodbarras-btn" class="form-label"><?= @lang("Produccion.pre_codbarras") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_codbarras_at" id="ot-precodbarras-date">
|
||||
<div class="form-text"><?= $user_dates["pre_codbarras_at"] ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Preimposicion -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $ot->realizar_imposicion ? "" : "d-none" ?>">
|
||||
<label for="ot-preimposicion-btn" class="form-label"><?= @lang("Produccion.pre_imposicion") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_imposicion_at" id="ot-preimposicion-date">
|
||||
<div class="form-text"><?= $user_dates["pre_imposicion_at"] ?></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtTasksTip" aria-expanded="false" aria-controls="accordionOtTasksTip">
|
||||
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<span><i class="ti-subtask ti-md ti"></i></span>
|
||||
<h4> Tareas </h4>
|
||||
</div>
|
||||
@ -25,9 +25,6 @@
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link d-flex flex-column gap-1" role="tab" data-bs-toggle="tab" data-bs-target="#nav-ot-task-ferro-envio" aria-controls="nav-ot-task-ferro-envio" aria-selected="false">Ferros y envíos</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link d-flex flex-column gap-1" role="tab" data-bs-toggle="tab" data-bs-target="#nav-ot-task-messages" aria-controls="nav-ot-task-messages" aria-selected="false">Mensajes</button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
@ -44,9 +41,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row text-end mt-2">
|
||||
<div class="col-md-12">
|
||||
<button type="button" class="btn btn-danger btn-md" id="btn-reset-tareas"><i class="ti ti-trash ti-xs"></i> Reiniciar tareas</button>
|
||||
<div class="row d-flex flex-row justify-content-between align-items-center mt-2 gap-2">
|
||||
<div class="col-md-3 text-start">
|
||||
<!-- <button type="button" class="btn btn-primary btn-md align-items-center" id="btn-add-tarea"><span class="ti ti-plus ti-sm me-1"></span> Insertar tarea</button> -->
|
||||
</div>
|
||||
<div class="col-md-3 gap-2 text-end">
|
||||
<!-- <button type="button" class="btn btn-warning btn-md" id="btn-reset-tareas-time"><span class="ti ti-clock ti-sm me-1"></span> Actualizar tiempo</button> -->
|
||||
<button type="button" class="btn btn-danger btn-md" id="btn-reset-tareas"><span class="ti ti-trash ti-sm me-1"></span> Reiniciar tareas</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -62,10 +63,6 @@
|
||||
<?= view("themes/vuexy/form/produccion/ot/otFerrosEnvios") ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- MENSAJES -->
|
||||
<div class="tab-pane fade" id="nav-ot-task-messages" role="tabpanel">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<?= view("themes/vuexy/form/produccion/ot/otHeader") ?>
|
||||
|
||||
<div class="row">
|
||||
<idv id="ot-edit-form">
|
||||
<div id="ot-edit-form">
|
||||
<div class="col-md-12 section-block">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otPortada") ?>
|
||||
</div>
|
||||
@ -26,6 +26,10 @@
|
||||
<div class="col-md-12 section-block">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otTask") ?>
|
||||
</div>
|
||||
<div class="col-md-12 section-block">
|
||||
<?= view("themes/vuexy/components/chat_internal_orden_trabajo", data: ["modelId" => $modelId, "type" => "orden_trabajo"]) ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 section-block">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otFiles") ?>
|
||||
</div>
|
||||
@ -35,19 +39,19 @@
|
||||
<div class="col-md-12 section-block">
|
||||
<?= view("themes/vuexy/form/produccion/ot/otComments") ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-3">
|
||||
<div class="d-grip gap-2">
|
||||
<a type="button" class="btn btn-outline-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-eye me-1"></span>
|
||||
<?= @lang("Produccion.preview_pdf") ?></a>
|
||||
<button type="button" class="btn btn-primary btn-block mb-1"><?= @lang("Produccion.imprimir_ferro") ?></button>
|
||||
<button type="button" class="btn btn-secondary btn-block mb-1"><?= @lang("Produccion.imprimir_codigo_safekat") ?></button>
|
||||
</div>
|
||||
<div class="col-md-12 mt-3">
|
||||
<div class="d-grip gap-2">
|
||||
<a type="button" class="btn btn-outline-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||
<span class="ti-sm ti ti-eye me-1"></span>
|
||||
<?= @lang("Produccion.preview_pdf") ?></a>
|
||||
<button type="button" class="btn btn-primary btn-block mb-1"><?= @lang("Produccion.imprimir_ferro") ?></button>
|
||||
<button type="button" class="btn btn-secondary btn-block mb-1"><?= @lang("Produccion.imprimir_codigo_safekat") ?></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="modalCommentTarea" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
|
||||
@ -68,7 +68,6 @@ class Chat {
|
||||
}
|
||||
|
||||
if (this.chatHistoryBody[0]) {
|
||||
//console.log("History body");
|
||||
this.scrollbarChatHistory = new PerfectScrollbar(this.chatHistoryBody[0], {
|
||||
wheelPropagation: false,
|
||||
suppressScrollX: true,
|
||||
@ -126,12 +125,10 @@ class Chat {
|
||||
<span class="item-text">${state.text}</span>
|
||||
<span class="badge text-bg-secondary">${state.desc ?? ''}</span>
|
||||
</div>`)
|
||||
console.log(state)
|
||||
return $state;
|
||||
}
|
||||
this.selectClientUser.init()
|
||||
this.selectItem.on('change', () => {
|
||||
console.log(this.selectClientUser.getVal(),this.selectClientUser.getText())
|
||||
if (this.selectClientUser.getVal()) {
|
||||
this.sendBtnMessageDepartment.attr('disabled', null)
|
||||
} else {
|
||||
@ -181,6 +178,15 @@ class Chat {
|
||||
this.initSelectClient()
|
||||
// setInterval(this._getChatMessage.bind(this), 10000)
|
||||
}
|
||||
initOrdenTrabajo() {
|
||||
this.chatType = "ot"
|
||||
this._handleGetChatList()
|
||||
this.sendBtnMessageDepartment.on("click", this._sendMessage.bind(this))
|
||||
this.sendBtnMessageDepartmentClient.on("click", this._sendMessage.bind(this))
|
||||
this.messageInput.on("keypress", this._sendMessagePressKey.bind(this))
|
||||
this.initSelectClient()
|
||||
// setInterval(this._getChatMessage.bind(this), 10000)
|
||||
}
|
||||
initContacts() {
|
||||
this.chatType = "internal"
|
||||
|
||||
|
||||
@ -55,6 +55,7 @@ class OrdenTrabajoDatatable {
|
||||
},
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
serverSide: true,
|
||||
pageLength: 25,
|
||||
@ -62,7 +63,11 @@ class OrdenTrabajoDatatable {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable'
|
||||
ajax: '/produccion/ordentrabajo/datatable',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`10px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`10px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
initPendientes() {
|
||||
@ -76,6 +81,7 @@ class OrdenTrabajoDatatable {
|
||||
},
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
serverSide: true,
|
||||
pageLength: 25,
|
||||
@ -83,7 +89,12 @@ class OrdenTrabajoDatatable {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_pendientes'
|
||||
ajax: '/produccion/ordentrabajo/datatable_pendientes',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
initFerroPendiente() {
|
||||
@ -97,11 +108,19 @@ class OrdenTrabajoDatatable {
|
||||
},
|
||||
serverSide: true,
|
||||
pageLength: 25,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_ferro_pendiente'
|
||||
ajax: '/produccion/ordentrabajo/datatable_ferro_pendiente',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
initFerroOk() {
|
||||
@ -114,12 +133,20 @@ class OrdenTrabajoDatatable {
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_ferro_ok'
|
||||
ajax: '/produccion/ordentrabajo/datatable_ferro_ok',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
12
httpdocs/assets/js/safekat/pages/chatOrdenTrabajo.js
Normal file
12
httpdocs/assets/js/safekat/pages/chatOrdenTrabajo.js
Normal file
@ -0,0 +1,12 @@
|
||||
import Chat from '../components/chat.js'
|
||||
import InternalMessages from "../components/internalMessagesSection.js"
|
||||
$(function () {
|
||||
let chat = new Chat($("#chat-orden-trabajo"))
|
||||
chat.init()
|
||||
chat.initOrdenTrabajo()
|
||||
if ($("#internal_messages_chat").length > 0) {
|
||||
let internalMessages = new InternalMessages($("#internal_messages_chat"))
|
||||
internalMessages.init()
|
||||
}
|
||||
|
||||
})
|
||||
@ -77,6 +77,10 @@ class OrdenTrabajo {
|
||||
this.portada = new DatePicker(this.otForm.find("#ot-portada"), option)
|
||||
this.plastificadoMate = new DatePicker(this.otForm.find("#ot-plastificado-mate"), option)
|
||||
this.prepGuillotina = new DatePicker(this.otForm.find("#ot-prep-guillotina"), option)
|
||||
this.prepCosido = new DatePicker(this.otForm.find("#ot-prep-cosido"), option)
|
||||
this.prepGrapado = new DatePicker(this.otForm.find("#ot-prep-grapado"), option)
|
||||
this.prepSolapa = new DatePicker(this.otForm.find("#ot-prep-solapa"), option)
|
||||
|
||||
this.espiral = new DatePicker(this.otForm.find("#ot-espiral"), option)
|
||||
this.embalaje = new DatePicker(this.otForm.find("#ot-embalaje"), option)
|
||||
this.envio = new DatePicker(this.otForm.find("#ot-envio"), option)
|
||||
@ -340,7 +344,7 @@ class OrdenTrabajo {
|
||||
this.fillPreimpresionReview()
|
||||
this.datatableTareas.ajax.reload()
|
||||
} catch (error) {
|
||||
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.otForm.on("change", ".ot-date", this.handleDateChange.bind(this))
|
||||
this.otForm.on("change", ".ot-pedido", this.handlePedidoChange.bind(this))
|
||||
@ -389,6 +393,10 @@ class OrdenTrabajo {
|
||||
this.portada.setDate(this.summaryData.dates.cubierta_at)
|
||||
this.plastificadoMate.setDate(this.summaryData.dates.plastificado_at)
|
||||
this.prepGuillotina.setDate(this.summaryData.dates.corte_at)
|
||||
this.prepCosido.setDate(this.summaryData.dates.cosido_at)
|
||||
this.prepSolapa.setDate(this.summaryData.dates.solapa_at)
|
||||
this.prepGrapado.setDate(this.summaryData.dates.grapado_at)
|
||||
|
||||
this.espiral.setDate(this.summaryData.dates.fecha_impresion_at)
|
||||
this.embalaje.setDate(this.summaryData.dates.embalaje_at)
|
||||
this.envio.setDate(this.summaryData.dates.envio_at)
|
||||
|
||||
@ -151,6 +151,9 @@ class PlanningRotativa {
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
this.getColorOtStatus(row,data)
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/planning/rotativa/datatable'
|
||||
});
|
||||
@ -165,7 +168,9 @@ class PlanningRotativa {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatablePlanaColumns,
|
||||
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
this.getColorOtStatus(row,data)
|
||||
},
|
||||
ajax: {
|
||||
url : '/produccion/ordentrabajo/planning/plana/datatable',
|
||||
data : d => {
|
||||
@ -245,7 +250,7 @@ class PlanningRotativa {
|
||||
this.tablePlanningPlana.on('change', ".pliegos-check", this.calcPliegosCheck.bind(this))
|
||||
}
|
||||
_renderBtnAction(d) {
|
||||
return `<a href="/produccion/ordentrabajo/edit/${d.otId}" class="ot-tarea-comment" data-id="${d.otId}"><i class="ti ti-eye"></i></a>`
|
||||
return `<a href="/produccion/ordentrabajo/edit/${d.data.otId}" class="ot-tarea-comment" data-id="${d.data.otId}"><i class="ti ti-eye"></i></a>`
|
||||
}
|
||||
_columnFiltering() {
|
||||
this.api().columns()
|
||||
@ -362,7 +367,15 @@ class PlanningRotativa {
|
||||
}
|
||||
toggleCorteError(){
|
||||
}
|
||||
|
||||
getColorOtStatus(row,data){
|
||||
let ajax = new Ajax("/produccion/ordentrabajo/color/"+data.otId,null,null,
|
||||
(response) => {
|
||||
$(row).css("border-left",`10px solid ${response.color}`)
|
||||
$(row).css("border-right",`10px solid ${response.color}`)
|
||||
},null
|
||||
)
|
||||
ajax.get()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user