Filtro en excel
This commit is contained in:
@ -59,23 +59,21 @@
|
|||||||
extend: 'excelHtml5',
|
extend: 'excelHtml5',
|
||||||
className: 'green',
|
className: 'green',
|
||||||
text: 'Exportar a Excel <i class="file excel icon"></i>',
|
text: 'Exportar a Excel <i class="file excel icon"></i>',
|
||||||
title: 'Lista de Precios {{ $contract->broker->name }} {{ $contract->project->descripcion }} {{ (new DateTime())->format('Y-m-d') }}',
|
title: 'Lista de Precios - {{ $contract->broker->name }} - {{ $contract->project->descripcion }} - {{ (new DateTime())->format('Y-m-d') }}',
|
||||||
download: 'open',
|
download: 'open',
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: [0, 2, 4, 5, 6, 7],
|
columns: [0, 2, 5, 6, 7],
|
||||||
/*format: {
|
rows: (idx, data, node) => {
|
||||||
|
return data[4] === 'Disponible'
|
||||||
|
},
|
||||||
|
format: {
|
||||||
body: (data, row, columnIdx, node) => {
|
body: (data, row, columnIdx, node) => {
|
||||||
const formats = this.columns.filter(columnDef => columnDef.format)
|
if (typeof data === 'string' && data.includes('<span')) {
|
||||||
const match = formats.map(({title}) => title).indexOf(this.columns[columnIdx].title)
|
return data.replace(/<span.*>(.*)<\/span>/, '$1')
|
||||||
if (match > -1) {
|
|
||||||
return formats[match].format(data)
|
|
||||||
}
|
|
||||||
if (typeof data === 'string' && data.includes('<span data-tooltip')) {
|
|
||||||
return data.replace(/<span data-tooltip="(.*)">(.*)<\/span>/, '$2')
|
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
},
|
},
|
||||||
customize: xlsx => {
|
customize: xlsx => {
|
||||||
const sheet = xlsx.xl.worksheets['sheet1.xml']
|
const sheet = xlsx.xl.worksheets['sheet1.xml']
|
||||||
@ -108,7 +106,7 @@
|
|||||||
unidad.proyecto_tipo_unidad.tipo_unidad.orden,
|
unidad.proyecto_tipo_unidad.tipo_unidad.orden,
|
||||||
unidad.descripcion,
|
unidad.descripcion,
|
||||||
unidad.descripcion.padStart(4, '0'),
|
unidad.descripcion.padStart(4, '0'),
|
||||||
unidad.sold ? 'Vendida' : 'Disponible',
|
unidad.sold ? '<span class="ui yellow text">Vendida</span>' : 'Disponible',
|
||||||
'UF ' + formatters.ufs.format(price.base ?? 0),
|
'UF ' + formatters.ufs.format(price.base ?? 0),
|
||||||
formatters.percent.format(price.amount ?? 0),
|
formatters.percent.format(price.amount ?? 0),
|
||||||
'UF ' + formatters.ufs.format(price.final ?? 0),
|
'UF ' + formatters.ufs.format(price.final ?? 0),
|
||||||
|
Reference in New Issue
Block a user