mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'fix/cambio_cubierta_guardar_valores' of https://git.imnavajas.es/jjimenez/safekat into fix/cambio_cubierta_guardar_valores
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
export function getToken()
|
||||
{
|
||||
export function getToken() {
|
||||
const scriptUrl = new URL(import.meta.url);
|
||||
const params = new URLSearchParams(scriptUrl.search);
|
||||
|
||||
@ -10,3 +9,67 @@ export function getToken()
|
||||
export function capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
|
||||
export const initAutonumeric = () => {
|
||||
$(document).on('draw.dt', (event) => {
|
||||
$("span.autonumeric").each(function () {
|
||||
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||
if (!autoNumericInstance) {
|
||||
new AutoNumeric(this, {
|
||||
digitGroupSeparator: ".",
|
||||
decimalCharacter: ",",
|
||||
allowDecimalPadding : 'floats',
|
||||
decimalPlaces: 2,
|
||||
unformatOnSubmit: true,
|
||||
|
||||
});
|
||||
}
|
||||
})
|
||||
// $(':input[type="number"]').each(function(){
|
||||
// $(this).attr('type','text')
|
||||
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||
// if (!autoNumericInstance) {
|
||||
// new AutoNumeric(this, {
|
||||
// digitGroupSeparator: ".",
|
||||
// decimalCharacter: ",",
|
||||
// allowDecimalPadding : 'floats',
|
||||
// decimalPlaces: 2,
|
||||
// unformatOnSubmit: true,
|
||||
|
||||
// });
|
||||
// }
|
||||
// })
|
||||
})
|
||||
// editor.on('open', (event) => {
|
||||
// $("input.autonumeric").each(function () {
|
||||
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||
// if (autoNumericInstance) {
|
||||
// autoNumericInstance.remove()
|
||||
|
||||
// }
|
||||
// new AutoNumeric(this, {
|
||||
// decimalCharacter: ",",
|
||||
// digitGroupSeparator: ".",
|
||||
// allowDecimalPadding : 'floats',
|
||||
// decimalPlaces: 2,
|
||||
// unformatOnSubmit: true,
|
||||
// });
|
||||
// })
|
||||
// })
|
||||
// editor.on('preSubmit', (e, d, type) => {
|
||||
// if (d.data) {
|
||||
// Object.keys(d.data).forEach(function (key) {
|
||||
// // Find all elements with class .autonumeric
|
||||
// $("input.autonumeric").each(function () {
|
||||
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||
// if (autoNumericInstance) {
|
||||
// // Get raw value and update the corresponding field
|
||||
// let rawValue = autoNumericInstance.getNumericString();
|
||||
// d.data[key][this.name] = rawValue; // Ensure the correct name attribute is used
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
// })
|
||||
}
|
||||
@ -14,7 +14,7 @@ class OrdenTrabajoDatatable {
|
||||
{ data: 'cliente_nombre', searchable: false, sortable: false },
|
||||
{ data: 'presupuesto_titulo', searchable: false, sortable: false },
|
||||
{ data: 'ubicacion_nombre', searchable: false, sortable: false },
|
||||
{ data: 'total_tirada', searchable: false, sortable: false },
|
||||
{ data: 'total_tirada', searchable: false, sortable: false ,render : (d) => `<span class="autonumeric">${d}</span>`},
|
||||
{ data: 'tipo_presupuesto_impresion', searchable: false, sortable: false },
|
||||
{
|
||||
data: 'logo', searchable: false, sortable: false, render: (d, t) => {
|
||||
|
||||
4
httpdocs/assets/js/safekat/pages/layout.js
Normal file
4
httpdocs/assets/js/safekat/pages/layout.js
Normal file
@ -0,0 +1,4 @@
|
||||
import { initAutonumeric } from "../common/common.js";
|
||||
|
||||
|
||||
initAutonumeric()
|
||||
@ -91,10 +91,10 @@ class MaquinasList {
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'tipo' },
|
||||
{ 'data': 'ancho_impresion' },
|
||||
{ 'data': 'alto_impresion' },
|
||||
{ 'data': 'min' },
|
||||
{ 'data': 'max' }
|
||||
{ 'data': 'ancho_impresion',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||
{ 'data': 'alto_impresion',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||
{ 'data': 'min',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||
{ 'data': 'max',render : (d) => `<span class="autonumeric">${d}</span>` }
|
||||
];
|
||||
|
||||
const actions = ['edit', 'delete'];
|
||||
|
||||
9
httpdocs/themes/vuexy/vendor/libs/autoNumeric/autoNumeric.min.js
vendored
Normal file
9
httpdocs/themes/vuexy/vendor/libs/autoNumeric/autoNumeric.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user