Changes
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user