diff --git a/app/components/ComponentItem.vue b/app/components/ComponentItem.vue
index 18e3113..0df6901 100644
--- a/app/components/ComponentItem.vue
+++ b/app/components/ComponentItem.vue
@@ -25,7 +25,6 @@
{{ component.reference }}
{{ component.constructeur?.name }}
-
{{ component.emplacement }}
{{ component.prix }}€
{{ component.reference || 'Non définie' }}
-
diff --git a/app/components/ComponentModelStructureEditor.vue b/app/components/ComponentModelStructureEditor.vue
index 85bf8e9..e9ac3ce 100644
--- a/app/components/ComponentModelStructureEditor.vue
+++ b/app/components/ComponentModelStructureEditor.vue
@@ -34,17 +34,9 @@
-
-
- Emplacement:
-
- {{ pieceData.emplacement || 'Non défini' }}
-
Prix:
-
+
@@ -321,7 +306,6 @@ const emit = defineEmits(['update', 'edit', 'custom-field-update', 'assign-model
const pieceData = reactive({
name: props.piece.name || '',
reference: props.piece.reference || '',
- emplacement: props.piece.emplacement || '',
prix: props.piece.prix || ''
})
@@ -484,11 +468,10 @@ watch(() => props.piece.customFieldValues, () => {
}, { deep: true })
watch(
- () => [props.piece.name, props.piece.reference, props.piece.emplacement, props.piece.prix],
+ () => [props.piece.name, props.piece.reference, props.piece.prix],
() => {
pieceData.name = props.piece.name || ''
pieceData.reference = props.piece.reference || ''
- pieceData.emplacement = props.piece.emplacement || ''
pieceData.prix = props.piece.prix || ''
},
)
@@ -497,7 +480,6 @@ onMounted(() => {
// Initialiser les données avec les props
pieceData.name = props.piece.name || ''
pieceData.reference = props.piece.reference || ''
- pieceData.emplacement = props.piece.emplacement || ''
pieceData.prix = props.piece.prix || ''
// Debug: vérifier si les champs personnalisés sont présents
diff --git a/app/components/PieceModelStructureEditor.vue b/app/components/PieceModelStructureEditor.vue
index 2bc76f8..0ff1b73 100644
--- a/app/components/PieceModelStructureEditor.vue
+++ b/app/components/PieceModelStructureEditor.vue
@@ -37,17 +37,9 @@
-
-
-
-
@@ -463,7 +457,6 @@ const addComponent = () => {
name: '',
reference: '',
constructeur: '',
- emplacement: '',
prix: null,
pieces: [],
customFields: [],
@@ -511,7 +504,6 @@ const addComponentCustomField = (componentIndex) => {
name: '',
type: '',
required: false,
- defaultValue: '',
optionsText: ''
})
ensureComponentState(componentIndex)
@@ -543,7 +535,6 @@ const addComponentPiece = (componentIndex) => {
name: '',
reference: '',
constructeur: '',
- emplacement: '',
prix: null,
customFields: []
})
@@ -572,7 +563,6 @@ const addComponentPieceCustomField = (componentIndex, pieceIndex) => {
name: '',
type: '',
required: false,
- defaultValue: '',
optionsText: ''
})
ensureComponentPieceState(componentIndex, pieceIndex)
@@ -604,7 +594,6 @@ const addSubComponent = (componentIndex) => {
name: '',
reference: '',
constructeur: '',
- emplacement: '',
prix: null,
customFields: [],
pieces: [],
@@ -649,7 +638,6 @@ const addSubComponentCustomField = (componentIndex, subIndex) => {
name: '',
type: '',
required: false,
- defaultValue: '',
optionsText: ''
})
ensureSubComponentState(componentIndex, subIndex)
@@ -674,7 +662,6 @@ const addSubComponentPiece = (componentIndex, subIndex) => {
name: '',
reference: '',
constructeur: '',
- emplacement: '',
prix: null,
customFields: []
})
@@ -714,7 +701,6 @@ const addSubComponentPieceCustomField = (componentIndex, subIndex, pieceIndex) =
name: '',
type: '',
required: false,
- defaultValue: '',
optionsText: ''
})
ensureSubComponentPieceState(componentIndex, subIndex, pieceIndex)
diff --git a/app/components/TypeEditCustomFieldsSection.vue b/app/components/TypeEditCustomFieldsSection.vue
index cc885fb..3871879 100644
--- a/app/components/TypeEditCustomFieldsSection.vue
+++ b/app/components/TypeEditCustomFieldsSection.vue
@@ -92,7 +92,7 @@
-
+
{
name: '',
type: '',
required: false,
- defaultValue: '',
optionsText: '',
},
]
diff --git a/app/pages/generator.vue b/app/pages/generator.vue
index 3a27b8c..02b71ad 100644
--- a/app/pages/generator.vue
+++ b/app/pages/generator.vue
@@ -137,7 +137,6 @@ const normalizeCustomFields = (fields = []) =>
name: field.name,
type: field.type || '',
required: !!field.required,
- defaultValue: field.defaultValue || '',
options: parseOptions(field)
}))
diff --git a/app/pages/index.vue b/app/pages/index.vue
index c8470c3..97faf41 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -160,11 +160,7 @@
{{ machine.reference }}
-
-
-
- {{ machine.emplacement }}
-
+
@@ -355,18 +351,6 @@
-
-
-
-
-
Structure du type sélectionné :
@@ -414,7 +398,6 @@ import IconLucideMapPinned from '~icons/lucide/map-pinned'
import IconLucideChevronDown from '~icons/lucide/chevron-down'
import IconLucideSettings2 from '~icons/lucide/settings-2'
import IconLucideTag from '~icons/lucide/tag'
-import IconLucideBuilding from '~icons/lucide/building'
const { sites, loading, loadSites, createSite } = useSites()
@@ -442,8 +425,7 @@ const newMachine = reactive({
name: '',
siteId: '',
typeMachineId: '',
- reference: '',
- emplacement: ''
+ reference: ''
})
// Computed
@@ -545,8 +527,7 @@ const handleCreateMachine = async () => {
const machineData = {
name: newMachine.name,
siteId: newMachine.siteId,
- reference: newMachine.reference,
- emplacement: newMachine.emplacement
+ reference: newMachine.reference
}
const result = await createMachineFromType(machineData, selectedMachineType.value)
@@ -557,7 +538,6 @@ const handleCreateMachine = async () => {
newMachine.siteId = ''
newMachine.typeMachineId = ''
newMachine.reference = ''
- newMachine.emplacement = ''
showAddMachineModal.value = false
}
}
diff --git a/app/pages/machine/[id].vue b/app/pages/machine/[id].vue
index 53cefd7..e5c2344 100644
--- a/app/pages/machine/[id].vue
+++ b/app/pages/machine/[id].vue
@@ -403,22 +403,6 @@
{{ machineReference || 'Non définie' }}
-
@@ -938,7 +919,6 @@ const { constructeurs, loadConstructeurs } = useConstructeurs()
// Champs de la machine
const machineName = ref('')
const machineReference = ref('')
-const machineEmplacement = ref('')
const machineConstructeurId = ref(null)
const machineConstructeurDisplay = computed(() => {
const id = machineConstructeurId.value || machine.value?.constructeur?.id || machine.value?.constructeurId
@@ -1408,7 +1388,6 @@ const initMachineFields = () => {
if (machine.value) {
machineName.value = machine.value.name || ''
machineReference.value = machine.value.reference || ''
- machineEmplacement.value = machine.value.emplacement || ''
machineConstructeurId.value = machine.value.constructeurId || machine.value.constructeur?.id || null
}
}
@@ -1747,7 +1726,6 @@ const printMachine = (currentSelection = printSelection) => {
machine: machine.value,
machineName: machineName.value,
machineReference: machineReference.value,
- machineEmplacement: machineEmplacement.value,
machinePieces: machinePieces.value,
components: components.value,
selection: currentSelection,
@@ -1811,7 +1789,6 @@ const transformCustomFields = (pieces) => {
name: cfv.customField.name,
type: cfv.customField.type,
required: cfv.customField.required,
- defaultValue: cfv.customField.defaultValue,
options: cfv.customField.options || [],
value: cfv.value
})) || []
@@ -1839,7 +1816,6 @@ const transformComponentCustomFields = (componentsData) => {
name: cfv.customField.name,
type: cfv.customField.type,
required: cfv.customField.required,
- defaultValue: cfv.customField.defaultValue,
options: cfv.customField.options || [],
value: cfv.value
})) || [];
@@ -2242,7 +2218,6 @@ const updateMachineInfo = async () => {
const result = await updateMachineApi(machine.value.id, {
name: machineName.value,
reference: machineReference.value,
- emplacement: machineEmplacement.value,
constructeurId: machineConstructeurId.value || null
})
if (result.success) {
@@ -2261,7 +2236,6 @@ const updateComponent = async (updatedComponent) => {
name: updatedComponent.name,
reference: updatedComponent.reference,
constructeurId: updatedComponent.constructeurId || updatedComponent.constructeur?.id || null,
- emplacement: updatedComponent.emplacement,
prix: prixValue && prixValue !== '' ? parseFloat(prixValue) : null,
composantModelId: updatedComponent.composantModelId || updatedComponent.composantModel?.id || null,
})
@@ -2280,7 +2254,6 @@ const updatePieceFromComponent = async (updatedPiece) => {
name: updatedPiece.name,
reference: updatedPiece.reference,
constructeurId: updatedPiece.constructeurId || updatedPiece.constructeur?.id || null,
- emplacement: updatedPiece.emplacement,
prix: updatedPiece.prix && updatedPiece.prix !== '' ? parseFloat(updatedPiece.prix) : null,
pieceModelId: updatedPiece.pieceModelId || updatedPiece.pieceModel?.id || null,
})
@@ -2312,7 +2285,6 @@ const updatePieceInfo = async (updatedPiece) => {
name: updatedPiece.name,
reference: updatedPiece.reference,
constructeurId: updatedPiece.constructeurId || updatedPiece.constructeur?.id || null,
- emplacement: updatedPiece.emplacement,
prix: updatedPiece.prix && updatedPiece.prix !== '' ? parseFloat(updatedPiece.prix) : null,
pieceModelId: updatedPiece.pieceModelId || updatedPiece.pieceModel?.id || null,
})
diff --git a/app/pages/machines/index.vue b/app/pages/machines/index.vue
index 7c9b6a6..597195e 100644
--- a/app/pages/machines/index.vue
+++ b/app/pages/machines/index.vue
@@ -95,10 +95,6 @@
{{ machine.reference }}
-
-
- {{ machine.emplacement }}
-
@@ -130,7 +126,6 @@ import IconLucideFactory from '~icons/lucide/factory'
import IconLucideMapPin from '~icons/lucide/map-pin'
import IconLucideSettings2 from '~icons/lucide/settings-2'
import IconLucideTag from '~icons/lucide/tag'
-import IconLucideBuilding from '~icons/lucide/building'
const { machines, loading, loadMachines, deleteMachine } = useMachines()
const { sites, loadSites } = useSites()
diff --git a/app/pages/machines/new.vue b/app/pages/machines/new.vue
index a26a7b1..7222cbb 100644
--- a/app/pages/machines/new.vue
+++ b/app/pages/machines/new.vue
@@ -66,18 +66,6 @@
-
-
-
-
-
Structure du type sélectionné :
@@ -670,7 +658,6 @@ const newMachine = reactive({
siteId: '',
typeMachineId: '',
reference: '',
- emplacement: '',
})
const componentRequirementSelections = reactive({})
@@ -727,7 +714,6 @@ const machinePreview = computed(() => {
? sites.value.find((site) => site.id === newMachine.siteId) || null
: null
const trimmedReference = (newMachine.reference || '').trim()
- const trimmedEmplacement = (newMachine.emplacement || '').trim()
const baseFields = [
{
@@ -754,12 +740,6 @@ const machinePreview = computed(() => {
display: trimmedReference || 'Non renseignée',
status: trimmedReference ? 'complete' : 'optional',
},
- {
- key: 'emplacement',
- label: 'Emplacement',
- display: trimmedEmplacement || 'Non renseigné',
- status: trimmedEmplacement ? 'complete' : 'optional',
- },
]
const baseIssues = []
@@ -1307,7 +1287,6 @@ const finalizeMachineCreation = async () => {
name: newMachine.name,
siteId: newMachine.siteId,
reference: newMachine.reference,
- emplacement: newMachine.emplacement,
typeMachineId: type.id,
}
@@ -1345,7 +1324,6 @@ const finalizeMachineCreation = async () => {
newMachine.siteId = ''
newMachine.typeMachineId = ''
newMachine.reference = ''
- newMachine.emplacement = ''
clearRequirementSelections()
await navigateTo('/machines')
} else if (result.error) {
diff --git a/app/pages/type/edit/[id].vue b/app/pages/type/edit/[id].vue
index 52203a9..1667f95 100644
--- a/app/pages/type/edit/[id].vue
+++ b/app/pages/type/edit/[id].vue
@@ -94,7 +94,6 @@ const normalizeCustomFields = (fields = []) =>
name: field.name,
type: field.type || '',
required: !!field.required,
- defaultValue: field.defaultValue || '',
options: parseOptions(field)
}))
diff --git a/app/shared/modelUtils.ts b/app/shared/modelUtils.ts
index 62a8b51..0aaeebd 100644
--- a/app/shared/modelUtils.ts
+++ b/app/shared/modelUtils.ts
@@ -36,9 +36,6 @@ const sanitizeCustomFields = (fields: any[]): any[] => {
const type = typeof field?.type === 'string' && field.type ? field.type : 'text'
const required = !!field?.required
- const defaultValue = typeof field?.defaultValue === 'string' && field.defaultValue.trim().length > 0
- ? field.defaultValue.trim()
- : undefined
let options: string[] | undefined
if (type === 'select') {
@@ -55,9 +52,6 @@ const sanitizeCustomFields = (fields: any[]): any[] => {
}
const result: Record
= { name, type, required }
- if (defaultValue !== undefined) {
- result.defaultValue = defaultValue
- }
if (options) {
result.options = options
}
@@ -178,7 +172,6 @@ const hydrateCustomFields = (fields: any[]): any[] => {
name: field?.name ?? '',
type: field?.type ?? 'text',
required: !!field?.required,
- defaultValue: field?.defaultValue ?? '',
options: Array.isArray(field?.options) ? field.options : [],
optionsText: Array.isArray(field?.options) ? field.options.join('\n') : (field?.optionsText ?? ''),
}))
@@ -240,7 +233,6 @@ const mapComponentCustomFields = (fields: any[]) => {
name: field?.name ?? '',
type: field?.type ?? 'text',
required: !!field?.required,
- defaultValue: field?.defaultValue ?? '',
options: Array.isArray(field?.options) ? field.options : [],
optionsText: toOptionsText(field),
}))
diff --git a/app/utils/printTemplates/machineReport.js b/app/utils/printTemplates/machineReport.js
index 746d297..2e5b3f9 100644
--- a/app/utils/printTemplates/machineReport.js
+++ b/app/utils/printTemplates/machineReport.js
@@ -179,7 +179,7 @@ const normalizeCustomFields = (values = []) => {
return values.map((value) => ({
id: value.id,
label: value.customField?.name || 'Champ',
- value: value.value || value.customField?.defaultValue || '—',
+ value: value.value || '—',
}))
}
@@ -217,7 +217,6 @@ export const buildMachinePrintContext = ({
machine,
machineName,
machineReference,
- machineEmplacement,
machinePieces = [],
components = [],
selection,
@@ -300,7 +299,6 @@ export const buildMachinePrintContext = ({
description: machine?.description || '',
typeDescription: machine?.typeMachine?.description || '',
reference: machineReference,
- emplacement: machineEmplacement,
site: machine?.site?.name || '',
category: machine?.typeMachine?.category || '',
badges: machineBadges,
@@ -348,7 +346,6 @@ export const buildMachinePrintHtml = (context, styles) => {
${renderPrintField('Nom', context.machine.name)}
${renderPrintField('Référence', context.machine.reference, 'Non définie')}
- ${renderPrintField('Emplacement', context.machine.emplacement, 'Non défini')}
${renderPrintField('Site', context.machine.site, 'Non défini')}
${renderPrintField('Constructeur', context.machine.constructeur?.name, 'Non défini')}
${renderPrintField('Contact Constructeur', context.machine.constructeur?.contact, 'Non défini')}
@@ -564,4 +561,4 @@ export const buildMachinePrintHtml = (context, styles) => {