Dynamic control of information to make cleaner supplier and manufacturer tables

This commit is contained in:
eeintech 2021-04-07 09:54:20 -04:00
parent 734985faa9
commit b2264940a3
4 changed files with 12 additions and 6 deletions

View File

@ -77,9 +77,9 @@ loadSupplierPartTable(
params: { params: {
part: {{ part.part.id }}, part: {{ part.part.id }},
manufacturer_part: {{ part.id }}, manufacturer_part: {{ part.id }},
part_detail: true, part_detail: false,
supplier_detail: true, supplier_detail: true,
manufacturer_detail: true, manufacturer_detail: false,
}, },
} }
); );

View File

@ -81,7 +81,7 @@
{ {
params: { params: {
part: {{ part.id }}, part: {{ part.id }},
part_detail: true, part_detail: false,
manufacturer_detail: true, manufacturer_detail: true,
}, },
} }

View File

@ -85,7 +85,7 @@
{ {
params: { params: {
part: {{ part.id }}, part: {{ part.id }},
part_detail: true, part_detail: false,
supplier_detail: true, supplier_detail: true,
manufacturer_detail: true, manufacturer_detail: true,
}, },

View File

@ -133,10 +133,11 @@ function loadManufacturerPartTable(table, url, options) {
switchable: false, switchable: false,
}, },
{ {
visible: params['part_detail'],
switchable: params['part_detail'],
sortable: true, sortable: true,
field: 'part_detail.full_name', field: 'part_detail.full_name',
title: '{% trans "Part" %}', title: '{% trans "Part" %}',
switchable: false,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var url = `/part/${row.part}/`; var url = `/part/${row.part}/`;
@ -230,10 +231,11 @@ function loadSupplierPartTable(table, url, options) {
switchable: false, switchable: false,
}, },
{ {
visible: params['part_detail'],
switchable: params['part_detail'],
sortable: true, sortable: true,
field: 'part_detail.full_name', field: 'part_detail.full_name',
title: '{% trans "Part" %}', title: '{% trans "Part" %}',
switchable: false,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var url = `/part/${row.part}/`; var url = `/part/${row.part}/`;
@ -280,6 +282,8 @@ function loadSupplierPartTable(table, url, options) {
} }
}, },
{ {
visible: params['manufacturer_detail'],
switchable: params['manufacturer_detail'],
sortable: true, sortable: true,
field: 'manufacturer', field: 'manufacturer',
title: '{% trans "Manufacturer" %}', title: '{% trans "Manufacturer" %}',
@ -296,6 +300,8 @@ function loadSupplierPartTable(table, url, options) {
} }
}, },
{ {
visible: params['manufacturer_detail'],
switchable: params['manufacturer_detail'],
sortable: true, sortable: true,
field: 'MPN', field: 'MPN',
title: '{% trans "MPN" %}', title: '{% trans "MPN" %}',