This commit is contained in:
Simon Pocrnjič
2025-09-28 00:30:18 +02:00
parent 7227c888d4
commit a913cfc381
44 changed files with 2123 additions and 587 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ async function uploadAndPreview() {
processResult.value = null;
const fd = new window.FormData();
fd.append('file', form.file);
if (Number.isFinite(form.import_template_id)) {
if (form.import_template_id !== null && form.import_template_id !== undefined && String(form.import_template_id).trim() !== '') {
fd.append('import_template_id', String(form.import_template_id));
}
if (form.client_uuid) {
+5 -4
View File
@@ -8,6 +8,7 @@ const props = defineProps({
import: Object,
templates: Array,
clients: Array,
client: Object
});
const importId = ref(props.import?.id || null);
@@ -227,13 +228,13 @@ const fieldOptionsByEntity = {
// Local state for selects
const form = ref({
client_uuid: null,
client_uuid: props.client.uuid,
import_template_id: props.import?.import_template_id || null,
});
// Initialize client_uuid from numeric client_id using provided clients list
if (props.import?.client_id) {
const found = (props.clients || []).find(c => c.id === props.import.client_id);
// Initialize client_uuid from import.client_uuid (preferred) using provided clients list
if (props.import?.client_uuid) {
const found = (props.clients || []).find(c => c.uuid === props.import.client_uuid);
form.value.client_uuid = found ? found.uuid : null;
}
+1 -1
View File
@@ -47,7 +47,7 @@ function statusBadge(status) {
<td class="p-2 whitespace-nowrap">{{ new Date(imp.created_at).toLocaleString() }}</td>
<td class="p-2">{{ imp.original_name }}</td>
<td class="p-2"><span :class="['px-2 py-0.5 rounded text-xs', statusBadge(imp.status)]">{{ imp.status }}</span></td>
<td class="p-2">{{ imp.client?.uuid ?? '—' }}</td>
<td class="p-2">{{ imp.client?.person?.full_name ?? '—' }}</td>
<td class="p-2">{{ imp.template?.name ?? '—' }}</td>
<td class="p-2 space-x-2">
<Link :href="route('imports.continue', { import: imp.uuid })" class="px-2 py-1 rounded bg-gray-200 text-gray-800 text-xs">Poglej</Link>