From 866e8c40b90966b076d42b3ca1b7bbb99863284f Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Wed, 13 Oct 2021 21:13:08 -0500 Subject: [PATCH] Add UI for warehouse movement --- source/static/js/controller/products.js | 10 +++++++++- source/static/js/ui/products.js | 23 +++++++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/source/static/js/controller/products.js b/source/static/js/controller/products.js index 3d22569..ab8526d 100644 --- a/source/static/js/controller/products.js +++ b/source/static/js/controller/products.js @@ -32,7 +32,7 @@ function products_default_config(){ var values = data.json() if(values.is_admin){ $$('cmd_add_inventory').show() - $$('cmd_products_add').show() + //~ $$('cmd_products_add').show() } } }) @@ -477,6 +477,7 @@ function cmd_show_exists_click(id, e, node){ return } win_show_exists.init() + $$('txt_id_product').setValue(row.id) $$('grid_warehouse_exists').load('warehouseproduct?opt=by_product&id='+row.id) $$('win_show_exists').show() } @@ -817,3 +818,10 @@ function _add_entries_inventory_manual(row_id, data){ } + +function cmd_warehouse_move_click(id, e, node){ + var id_product = $$('txt_id_product').getValue() + msg_ok(id_product) +} + + diff --git a/source/static/js/ui/products.js b/source/static/js/ui/products.js index d9436e7..38b5887 100644 --- a/source/static/js/ui/products.js +++ b/source/static/js/ui/products.js @@ -474,7 +474,9 @@ var grid_warehouse_exists = { view: 'datatable', id: 'grid_warehouse_exists', adjust: true, - //~ footer: true, + autoheight: true, + select: 'row', + footer: true, columns: grid_warehouse_exists_cols, } @@ -482,13 +484,25 @@ var grid_warehouse_exists = { var body_win_show_exists = {rows: [{maxHeight: 10}, {cols: [ {maxWidth: 10}, + {view: 'text', id: 'txt_id_product', readonly: true, hidden: true}, grid_warehouse_exists, {maxWidth: 10} ]}, + {maxHeight: 10}, + {cols: [{maxWidth: 10}, + {view: 'label', label: 'Primero, selecciona el almacen origen en la tabla superior.'}, + {maxWidth: 10}]}, + {cols: [{maxWidth: 10}, + {view: 'counter', id: 'txt_cant_to_move', label: 'Cantidad a mover:', + labelPosition: 'top', step: 1, value: 0, min: 0.01}, + {view: 'richselect', id: 'lst_warehouse_target', label: 'Almacen destino: ', + labelPosition: 'top', required: false, options: []}, {maxWidth: 10}, + {view: 'button', id: 'cmd_warehouse_move', label: 'Mover', maxWidth: 100}, + {maxWidth: 10}]}, {maxHeight: 20}, {cols: [{}, - {view: 'button', id: 'cmd_win_show_exists_close', label: 'Cerrar', type: 'danger'}, {} - ]}, + {view: 'button', id: 'cmd_win_show_exists_close', label: 'Cerrar', type: 'danger'}, + {}]}, {maxHeight: 20}, ]} @@ -498,12 +512,13 @@ var win_show_exists = { webix.ui({ view: 'window', id: 'win_show_exists', - width: 400, + width: 500, modal: true, position: 'center', head: 'Existencia por Almacen', body: body_win_show_exists, }) $$('cmd_win_show_exists_close').attachEvent('onItemClick', cmd_win_show_exists_close_click) + $$('cmd_warehouse_move').attachEvent('onItemClick', cmd_warehouse_move_click) } }