refactor: rename prestataire to constructeur
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<h3 class="text-lg font-semibold">{{ component.name }}</h3>
|
||||
<div class="flex flex-wrap gap-2 mt-2">
|
||||
<span v-if="component.reference" class="badge badge-outline badge-sm">{{ component.reference }}</span>
|
||||
<span v-if="component.prestataire" class="badge badge-outline badge-sm">{{ component.prestataire }}</span>
|
||||
<span v-if="component.constructeur" class="badge badge-outline badge-sm">{{ component.constructeur }}</span>
|
||||
<span v-if="component.emplacement" class="badge badge-outline badge-sm">{{ component.emplacement }}</span>
|
||||
<span v-if="component.prix" class="badge badge-primary badge-sm">{{ component.prix }}€</span>
|
||||
</div>
|
||||
@@ -55,15 +55,15 @@
|
||||
<div v-else class="input input-bordered input-sm bg-base-200">{{ component.reference || 'Non définie' }}</div>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text font-medium">Prestataire</span></label>
|
||||
<label class="label"><span class="label-text font-medium">Constructeur</span></label>
|
||||
<input
|
||||
v-if="isEditMode"
|
||||
v-model="component.prestataire"
|
||||
v-model="component.constructeur"
|
||||
type="text"
|
||||
class="input input-bordered input-sm"
|
||||
@blur="updateComponent"
|
||||
/>
|
||||
<div v-else class="input input-bordered input-sm bg-base-200">{{ component.prestataire || 'Non défini' }}</div>
|
||||
<div v-else class="input input-bordered input-sm bg-base-200">{{ component.constructeur || 'Non défini' }}</div>
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text font-medium">Emplacement</span></label>
|
||||
|
||||
@@ -33,16 +33,16 @@
|
||||
<span v-else class="ml-2">{{ pieceData.reference || 'Non définie' }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="font-medium">Prestataire:</span>
|
||||
<span class="font-medium">Constructeur:</span>
|
||||
<input
|
||||
v-if="isEditMode"
|
||||
:id="`piece-prestataire-${piece.id}`"
|
||||
v-model="pieceData.prestataire"
|
||||
:id="`piece-constructeur-${piece.id}`"
|
||||
v-model="pieceData.constructeur"
|
||||
type="text"
|
||||
class="input input-sm input-bordered ml-2"
|
||||
@blur="updatePiece"
|
||||
/>
|
||||
<span v-else class="ml-2">{{ pieceData.prestataire || 'Non défini' }}</span>
|
||||
<span v-else class="ml-2">{{ pieceData.constructeur || 'Non défini' }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="font-medium">Emplacement:</span>
|
||||
@@ -190,7 +190,7 @@ const emit = defineEmits(['update', 'edit', 'custom-field-update'])
|
||||
const pieceData = reactive({
|
||||
name: props.piece.name || '',
|
||||
reference: props.piece.reference || '',
|
||||
prestataire: props.piece.prestataire || '',
|
||||
constructeur: props.piece.constructeur || '',
|
||||
emplacement: props.piece.emplacement || '',
|
||||
prix: props.piece.prix || ''
|
||||
})
|
||||
@@ -236,7 +236,7 @@ onMounted(() => {
|
||||
// Initialiser les données avec les props
|
||||
pieceData.name = props.piece.name || ''
|
||||
pieceData.reference = props.piece.reference || ''
|
||||
pieceData.prestataire = props.piece.prestataire || ''
|
||||
pieceData.constructeur = props.piece.constructeur || ''
|
||||
pieceData.emplacement = props.piece.emplacement || ''
|
||||
pieceData.prix = props.piece.prix || ''
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
|
||||
<template v-if="expanded">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
||||
<div v-if="component.prestataire" class="text-sm">
|
||||
<span class="font-medium">Prestataire:</span> {{ component.prestataire }}
|
||||
<div v-if="component.constructeur" class="text-sm">
|
||||
<span class="font-medium">Constructeur:</span> {{ component.constructeur }}
|
||||
</div>
|
||||
<div v-if="component.emplacement" class="text-sm">
|
||||
<span class="font-medium">Emplacement:</span> {{ component.emplacement }}
|
||||
@@ -126,8 +126,8 @@
|
||||
|
||||
<div v-if="isPieceExpanded(pieceIndex)">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-2 mb-2">
|
||||
<div v-if="piece.prestataire" class="text-xs">
|
||||
<span class="font-medium">Prestataire:</span> {{ piece.prestataire }}
|
||||
<div v-if="piece.constructeur" class="text-xs">
|
||||
<span class="font-medium">Constructeur:</span> {{ piece.constructeur }}
|
||||
</div>
|
||||
<div v-if="piece.emplacement" class="text-xs">
|
||||
<span class="font-medium">Emplacement:</span> {{ piece.emplacement }}
|
||||
@@ -225,8 +225,8 @@
|
||||
|
||||
<div v-if="isSubComponentExpanded(subIndex)" class="space-y-3">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-2">
|
||||
<div v-if="subComponent.prestataire" class="text-xs">
|
||||
<span class="font-medium">Prestataire:</span> {{ subComponent.prestataire }}
|
||||
<div v-if="subComponent.constructeur" class="text-xs">
|
||||
<span class="font-medium">Constructeur:</span> {{ subComponent.constructeur }}
|
||||
</div>
|
||||
<div v-if="subComponent.emplacement" class="text-xs">
|
||||
<span class="font-medium">Emplacement:</span> {{ subComponent.emplacement }}
|
||||
@@ -320,8 +320,8 @@
|
||||
|
||||
<div v-if="isSubPieceExpanded(subIndex, pieceIndex)">
|
||||
<div class="grid grid-cols-2 gap-1 text-[11px] mb-1">
|
||||
<div v-if="piece.prestataire">
|
||||
<span class="font-medium">Prestataire:</span> {{ piece.prestataire }}
|
||||
<div v-if="piece.constructeur">
|
||||
<span class="font-medium">Constructeur:</span> {{ piece.constructeur }}
|
||||
</div>
|
||||
<div v-if="piece.emplacement">
|
||||
<span class="font-medium">Emplacement:</span> {{ piece.emplacement }}
|
||||
@@ -401,8 +401,8 @@ const expandedSubComponentPieceCustomFields = reactive({})
|
||||
|
||||
const compactInfo = computed(() => {
|
||||
const infos = []
|
||||
if (props.component?.prestataire) {
|
||||
infos.push(props.component.prestataire)
|
||||
if (props.component?.constructeur) {
|
||||
infos.push(props.component.constructeur)
|
||||
}
|
||||
if (props.component?.emplacement) {
|
||||
infos.push(props.component.emplacement)
|
||||
@@ -412,14 +412,14 @@ const compactInfo = computed(() => {
|
||||
|
||||
const quickPieceSummary = (piece) => {
|
||||
const infos = []
|
||||
if (piece?.prestataire) infos.push(piece.prestataire)
|
||||
if (piece?.constructeur) infos.push(piece.constructeur)
|
||||
if (piece?.emplacement) infos.push(piece.emplacement)
|
||||
return infos.join(' • ')
|
||||
}
|
||||
|
||||
const quickSubSummary = (subComponent) => {
|
||||
const infos = []
|
||||
if (subComponent?.prestataire) infos.push(subComponent.prestataire)
|
||||
if (subComponent?.constructeur) infos.push(subComponent.constructeur)
|
||||
if (subComponent?.emplacement) infos.push(subComponent.emplacement)
|
||||
return infos.join(' • ')
|
||||
}
|
||||
|
||||
@@ -91,12 +91,12 @@
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<label class="label">
|
||||
<span class="label-text">Prestataire</span>
|
||||
<span class="label-text">Constructeur</span>
|
||||
</label>
|
||||
<input
|
||||
v-model="component.prestataire"
|
||||
v-model="component.constructeur"
|
||||
type="text"
|
||||
placeholder="Prestataire"
|
||||
placeholder="Constructeur"
|
||||
class="input input-bordered input-sm"
|
||||
/>
|
||||
</div>
|
||||
@@ -1015,7 +1015,7 @@ const addComponent = () => {
|
||||
components.value.push({
|
||||
name: '',
|
||||
reference: '',
|
||||
prestataire: '',
|
||||
constructeur: '',
|
||||
emplacement: '',
|
||||
prix: null,
|
||||
pieces: [],
|
||||
@@ -1095,7 +1095,7 @@ const addComponentPiece = (componentIndex) => {
|
||||
component.pieces.push({
|
||||
name: '',
|
||||
reference: '',
|
||||
prestataire: '',
|
||||
constructeur: '',
|
||||
emplacement: '',
|
||||
prix: null,
|
||||
customFields: []
|
||||
@@ -1156,7 +1156,7 @@ const addSubComponent = (componentIndex) => {
|
||||
component.subComponents.push({
|
||||
name: '',
|
||||
reference: '',
|
||||
prestataire: '',
|
||||
constructeur: '',
|
||||
emplacement: '',
|
||||
prix: null,
|
||||
customFields: [],
|
||||
@@ -1226,7 +1226,7 @@ const addSubComponentPiece = (componentIndex, subIndex) => {
|
||||
subComponent.pieces.push({
|
||||
name: '',
|
||||
reference: '',
|
||||
prestataire: '',
|
||||
constructeur: '',
|
||||
emplacement: '',
|
||||
prix: null,
|
||||
customFields: []
|
||||
|
||||
@@ -348,12 +348,12 @@
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label">
|
||||
<span class="label-text">Prestataire</span>
|
||||
<span class="label-text">Constructeur</span>
|
||||
</label>
|
||||
<input
|
||||
v-model="piece.prestataire"
|
||||
v-model="piece.constructeur"
|
||||
type="text"
|
||||
placeholder="Prestataire"
|
||||
placeholder="Constructeur"
|
||||
class="input input-bordered input-sm"
|
||||
/>
|
||||
</div>
|
||||
@@ -586,12 +586,12 @@
|
||||
|
||||
<div class="form-control">
|
||||
<label class="label">
|
||||
<span class="label-text">Prestataire</span>
|
||||
<span class="label-text">Constructeur</span>
|
||||
</label>
|
||||
<input
|
||||
v-model="component.prestataire"
|
||||
v-model="component.constructeur"
|
||||
type="text"
|
||||
placeholder="Prestataire"
|
||||
placeholder="Constructeur"
|
||||
class="input input-bordered input-sm"
|
||||
/>
|
||||
</div>
|
||||
@@ -1176,7 +1176,7 @@ const addMachinePiece = () => {
|
||||
formData.machinePieces.push({
|
||||
name: '',
|
||||
reference: '',
|
||||
prestataire: '',
|
||||
constructeur: '',
|
||||
emplacement: '',
|
||||
prix: null,
|
||||
customFields: []
|
||||
@@ -1237,7 +1237,7 @@ const addComponent = () => {
|
||||
formData.components.push({
|
||||
name: '',
|
||||
reference: '',
|
||||
prestataire: '',
|
||||
constructeur: '',
|
||||
emplacement: '',
|
||||
prix: null,
|
||||
customFields: [],
|
||||
@@ -1310,7 +1310,7 @@ const addComponentPiece = (componentIndex) => {
|
||||
formData.components[componentIndex].pieces.push({
|
||||
name: '',
|
||||
reference: '',
|
||||
prestataire: '',
|
||||
constructeur: '',
|
||||
emplacement: '',
|
||||
prix: null,
|
||||
customFields: []
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
<div v-if="piece.reference" class="text-sm">
|
||||
<span class="font-medium">Référence:</span> {{ piece.reference }}
|
||||
</div>
|
||||
<div v-if="piece.prestataire" class="text-sm">
|
||||
<span class="font-medium">Prestataire:</span> {{ piece.prestataire }}
|
||||
<div v-if="piece.constructeur" class="text-sm">
|
||||
<span class="font-medium">Constructeur:</span> {{ piece.constructeur }}
|
||||
</div>
|
||||
<div v-if="piece.emplacement" class="text-sm">
|
||||
<span class="font-medium">Emplacement:</span> {{ piece.emplacement }}
|
||||
@@ -78,8 +78,8 @@ const expanded = ref(true)
|
||||
|
||||
const quickSummary = computed(() => {
|
||||
const infos = []
|
||||
if (props.piece?.prestataire) {
|
||||
infos.push(props.piece.prestataire)
|
||||
if (props.piece?.constructeur) {
|
||||
infos.push(props.piece.constructeur)
|
||||
}
|
||||
if (props.piece?.emplacement) {
|
||||
infos.push(props.piece.emplacement)
|
||||
|
||||
@@ -87,12 +87,12 @@
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<label class="label">
|
||||
<span class="label-text">Prestataire</span>
|
||||
<span class="label-text">Constructeur</span>
|
||||
</label>
|
||||
<input
|
||||
v-model="piece.prestataire"
|
||||
v-model="piece.constructeur"
|
||||
type="text"
|
||||
placeholder="Prestataire"
|
||||
placeholder="Constructeur"
|
||||
class="input input-bordered input-sm"
|
||||
/>
|
||||
</div>
|
||||
@@ -326,7 +326,7 @@ const addPiece = () => {
|
||||
pieces.value.push({
|
||||
name: '',
|
||||
reference: '',
|
||||
prestataire: '',
|
||||
constructeur: '',
|
||||
emplacement: '',
|
||||
prix: null,
|
||||
customFields: []
|
||||
|
||||
@@ -103,18 +103,18 @@
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<label class="label">
|
||||
<span class="label-text">Prestataire</span>
|
||||
<span class="label-text">Constructeur</span>
|
||||
</label>
|
||||
<input
|
||||
v-if="isEditMode"
|
||||
:id="getMachineFieldId('prestataire')"
|
||||
v-model="machinePrestataire"
|
||||
:id="getMachineFieldId('constructeur')"
|
||||
v-model="machineConstructeur"
|
||||
type="text"
|
||||
class="input input-bordered"
|
||||
@blur="updateMachineInfo"
|
||||
/>
|
||||
<div v-else class="input input-bordered bg-base-200">
|
||||
{{ machinePrestataire || 'Non défini' }}
|
||||
{{ machineConstructeur || 'Non défini' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -334,7 +334,7 @@ const pieces = ref([])
|
||||
const machineName = ref('')
|
||||
const machineReference = ref('')
|
||||
const machineEmplacement = ref('')
|
||||
const machinePrestataire = ref('')
|
||||
const machineConstructeur = ref('')
|
||||
|
||||
// Valeurs des champs personnalisés de la machine
|
||||
const machineCustomFieldValues = reactive({})
|
||||
@@ -363,7 +363,7 @@ const initMachineFields = () => {
|
||||
machineName.value = machine.value.name || ''
|
||||
machineReference.value = machine.value.reference || ''
|
||||
machineEmplacement.value = machine.value.emplacement || ''
|
||||
machinePrestataire.value = machine.value.prestataire || ''
|
||||
machineConstructeur.value = machine.value.constructeur || ''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ const updateMachineInfo = async () => {
|
||||
name: machineName.value,
|
||||
reference: machineReference.value,
|
||||
emplacement: machineEmplacement.value,
|
||||
prestataire: machinePrestataire.value
|
||||
constructeur: machineConstructeur.value
|
||||
})
|
||||
if (result.success) {
|
||||
// Machine updated successfully
|
||||
@@ -549,7 +549,7 @@ const updateComponent = async (updatedComponent) => {
|
||||
const result = await updateComposantApi(updatedComponent.id, {
|
||||
name: updatedComponent.name,
|
||||
reference: updatedComponent.reference,
|
||||
prestataire: updatedComponent.prestataire,
|
||||
constructeur: updatedComponent.constructeur,
|
||||
emplacement: updatedComponent.emplacement,
|
||||
prix: prixValue && prixValue !== '' ? parseFloat(prixValue) : null
|
||||
})
|
||||
@@ -566,7 +566,7 @@ const updatePieceFromComponent = async (updatedPiece) => {
|
||||
const result = await updatePieceApi(updatedPiece.id, {
|
||||
name: updatedPiece.name,
|
||||
reference: updatedPiece.reference,
|
||||
prestataire: updatedPiece.prestataire,
|
||||
constructeur: updatedPiece.constructeur,
|
||||
emplacement: updatedPiece.emplacement,
|
||||
prix: updatedPiece.prix && updatedPiece.prix !== '' ? parseFloat(updatedPiece.prix) : null
|
||||
})
|
||||
@@ -597,7 +597,7 @@ const updatePieceInfo = async (updatedPiece) => {
|
||||
const result = await updatePieceApi(updatedPiece.id, {
|
||||
name: updatedPiece.name,
|
||||
reference: updatedPiece.reference,
|
||||
prestataire: updatedPiece.prestataire,
|
||||
constructeur: updatedPiece.constructeur,
|
||||
emplacement: updatedPiece.emplacement,
|
||||
prix: updatedPiece.prix && updatedPiece.prix !== '' ? parseFloat(updatedPiece.prix) : null
|
||||
})
|
||||
|
||||
@@ -108,7 +108,7 @@ const saveChanges = async () => {
|
||||
.map(piece => ({
|
||||
name: piece.name,
|
||||
reference: piece.reference || '',
|
||||
prestataire: piece.prestataire || '',
|
||||
constructeur: piece.constructeur || '',
|
||||
emplacement: piece.emplacement || '',
|
||||
prix: piece.prix || null,
|
||||
customFields: (piece.customFields || [])
|
||||
@@ -129,7 +129,7 @@ const saveChanges = async () => {
|
||||
.map(comp => ({
|
||||
name: comp.name,
|
||||
reference: comp.reference || '',
|
||||
prestataire: comp.prestataire || '',
|
||||
constructeur: comp.constructeur || '',
|
||||
emplacement: comp.emplacement || '',
|
||||
prix: comp.prix || null,
|
||||
customFields: (comp.customFields || [])
|
||||
@@ -148,7 +148,7 @@ const saveChanges = async () => {
|
||||
.map(piece => ({
|
||||
name: piece.name,
|
||||
reference: piece.reference || '',
|
||||
prestataire: piece.prestataire || '',
|
||||
constructeur: piece.constructeur || '',
|
||||
emplacement: piece.emplacement || '',
|
||||
prix: piece.prix || null,
|
||||
customFields: (piece.customFields || [])
|
||||
|
||||
Reference in New Issue
Block a user