feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)
This commit is contained in:
113
.idea/workspace.xml
generated
113
.idea/workspace.xml
generated
@@ -4,18 +4,16 @@
|
|||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : mise à jour du bon de réception">
|
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)">
|
||||||
<change afterPath="$PROJECT_DIR$/frontend/components/reception/reception-bovine-received.vue" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/frontend/services/dto/reception-bovine-data.ts" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/frontend/components/ui/UiNumberInput.vue" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/frontend/services/reception-bovine.ts" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/frontend/services/bovine-type.ts" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/frontend/services/dto/bovine-type-data.ts" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/dataSources.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.xml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/config/reference.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/reference.php" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/config/reference.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/reference.php" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/frontend/components/reception/reception-bovine-received.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/components/reception/reception-bovine-received.vue" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/frontend/components/reception/reception-product-received.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/components/reception/reception-product-received.vue" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/frontend/components/reception/reception-product-received.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/components/reception/reception-product-received.vue" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/frontend/components/ui/UiTextInput.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/components/ui/UiTextInput.vue" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/frontend/components/ui/UiNumberInput.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/components/ui/UiNumberInput.vue" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/frontend/i18n/locales/fr.json" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/i18n/locales/fr.json" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/frontend/pages/reception/[[id]].vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/pages/reception/[[id]].vue" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/frontend/utils/constants.ts" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/utils/constants.ts" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/frontend/services/dto/reception-data.ts" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/services/dto/reception-data.ts" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Entity/Reception.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Entity/Reception.php" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Entity/Reception.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Entity/Reception.php" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
@@ -27,6 +25,11 @@
|
|||||||
<pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath>
|
<pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath>
|
||||||
<execution />
|
<execution />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="CopilotPersistence">
|
||||||
|
<persistenceIdMap>
|
||||||
|
<entry key="_//wsl.localhost/Ubuntu-24.04/home/kevin/Stage/Ferme" value="381AhnCm9yPeOiWgMObKHhtgv2C" />
|
||||||
|
</persistenceIdMap>
|
||||||
|
</component>
|
||||||
<component name="EmbeddingIndexingInfo">
|
<component name="EmbeddingIndexingInfo">
|
||||||
<option name="cachedIndexableFilesCount" value="151" />
|
<option name="cachedIndexableFilesCount" value="151" />
|
||||||
<option name="fileBasedEmbeddingIndicesEnabled" value="true" />
|
<option name="fileBasedEmbeddingIndicesEnabled" value="true" />
|
||||||
@@ -60,7 +63,7 @@
|
|||||||
</server>
|
</server>
|
||||||
</servers>
|
</servers>
|
||||||
</component>
|
</component>
|
||||||
<component name="PhpWorkspaceProjectConfiguration" interpreter_name="/bin/php">
|
<component name="PhpWorkspaceProjectConfiguration" interpreter_name="C:/php-8.4.3/php.exe">
|
||||||
<include_path>
|
<include_path>
|
||||||
<path value="$PROJECT_DIR$/vendor/psr/log" />
|
<path value="$PROJECT_DIR$/vendor/psr/log" />
|
||||||
<path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
|
<path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" />
|
||||||
@@ -223,36 +226,36 @@
|
|||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"RunOnceActivity.MCP Project settings loaded": "true",
|
"RunOnceActivity.MCP Project settings loaded": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
||||||
"git-widget-placeholder": "feat/256-reception-etape-3-bovin",
|
"git-widget-placeholder": "feat/256-reception-etape-3-bovin",
|
||||||
"last_opened_file_path": "/home/sroy/Documents/test/Ferme",
|
"last_opened_file_path": "/home/sroy/Documents/test/Ferme",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"node.js.selected.package.tslint": "(autodetect)",
|
"node.js.selected.package.tslint": "(autodetect)",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"settings.editor.selected.configurable": "configurable.group.appearance",
|
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||||
"ts.external.directory.path": "/opt/phpstorm/plugins/javascript-plugin/jsLanguageServicesImpl/external",
|
"ts.external.directory.path": "/opt/phpstorm/plugins/javascript-plugin/jsLanguageServicesImpl/external",
|
||||||
"vue.rearranger.settings.migration": "true"
|
"vue.rearranger.settings.migration": "true"
|
||||||
},
|
},
|
||||||
"keyToStringList": {
|
"keyToStringList": {
|
||||||
"DatabaseDriversLRU": [
|
"DatabaseDriversLRU": [
|
||||||
"postgresql"
|
"postgresql"
|
||||||
],
|
],
|
||||||
"com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File": [
|
"com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File": [
|
||||||
"TEXT"
|
"TEXT"
|
||||||
],
|
],
|
||||||
"vue.recent.templates": [
|
"vue.recent.templates": [
|
||||||
"Vue Composition API Component"
|
"Vue Composition API Component"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
<recent name="\\wsl.localhost\Ubuntu-24.04\home\m-tristan\workspace\Ferme" />
|
<recent name="\\wsl.localhost\Ubuntu-24.04\home\m-tristan\workspace\Ferme" />
|
||||||
@@ -265,7 +268,6 @@
|
|||||||
<component name="SharedIndexes">
|
<component name="SharedIndexes">
|
||||||
<attachedChunks>
|
<attachedChunks>
|
||||||
<set>
|
<set>
|
||||||
<option value="bundled-js-predefined-d6986cc7102b-9b0f141eb926-JavaScript-PS-253.30387.85" />
|
|
||||||
<option value="bundled-php-predefined-a98d8de5180a-0e0d91225499-com.jetbrains.php.sharedIndexes-PS-253.30387.85" />
|
<option value="bundled-php-predefined-a98d8de5180a-0e0d91225499-com.jetbrains.php.sharedIndexes-PS-253.30387.85" />
|
||||||
</set>
|
</set>
|
||||||
</attachedChunks>
|
</attachedChunks>
|
||||||
@@ -296,6 +298,9 @@
|
|||||||
<workItem from="1770055690365" duration="370000" />
|
<workItem from="1770055690365" duration="370000" />
|
||||||
<workItem from="1770056515646" duration="21000" />
|
<workItem from="1770056515646" duration="21000" />
|
||||||
<workItem from="1770102495553" duration="2280000" />
|
<workItem from="1770102495553" duration="2280000" />
|
||||||
|
<workItem from="1770195604082" duration="90000" />
|
||||||
|
<workItem from="1770195718952" duration="215000" />
|
||||||
|
<workItem from="1770195959162" duration="8094000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="feat : Ajout de pinia, création de la table weight et reception mise en place du système de step pour les receptions (WIP)">
|
<task id="LOCAL-00001" summary="feat : Ajout de pinia, création de la table weight et reception mise en place du système de step pour les receptions (WIP)">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
@@ -665,7 +670,15 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1769782099473</updated>
|
<updated>1769782099473</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="47" />
|
<task id="LOCAL-00047" summary="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1770131226364</created>
|
||||||
|
<option name="number" value="00047" />
|
||||||
|
<option name="presentableId" value="LOCAL-00047" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1770131226364</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="48" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
@@ -715,7 +728,6 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="ci : ajout du script et de la doc déploiement" />
|
|
||||||
<MESSAGE value="fix : correction du path URI pour la création d'un poids dans une réception" />
|
<MESSAGE value="fix : correction du path URI pour la création d'un poids dans une réception" />
|
||||||
<MESSAGE value="feat : Ajout du bundle Monolog pour la gestion des logs" />
|
<MESSAGE value="feat : Ajout du bundle Monolog pour la gestion des logs" />
|
||||||
<MESSAGE value="fix : affiche plus détail dans les logs en recette/prod" />
|
<MESSAGE value="fix : affiche plus détail dans les logs en recette/prod" />
|
||||||
@@ -740,7 +752,8 @@
|
|||||||
<MESSAGE value="feat : ajout de colonne pour les Supplier, Address et modification du numéro de réception" />
|
<MESSAGE value="feat : ajout de colonne pour les Supplier, Address et modification du numéro de réception" />
|
||||||
<MESSAGE value="feat : ajout de colonne pour les Supplier, Address. Modification du numéro de réception et ajout de fixtures" />
|
<MESSAGE value="feat : ajout de colonne pour les Supplier, Address. Modification du numéro de réception et ajout de fixtures" />
|
||||||
<MESSAGE value="feat : mise à jour du bon de réception" />
|
<MESSAGE value="feat : mise à jour du bon de réception" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="feat : mise à jour du bon de réception" />
|
<MESSAGE value="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XDebuggerManager">
|
<component name="XDebuggerManager">
|
||||||
<breakpoint-manager>
|
<breakpoint-manager>
|
||||||
@@ -750,10 +763,16 @@
|
|||||||
<line>6</line>
|
<line>6</line>
|
||||||
<option name="timeStamp" value="3" />
|
<option name="timeStamp" value="3" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
<line-breakpoint enabled="true" type="php">
|
<line-breakpoint enabled="true" type="javascript">
|
||||||
<url>file://$PROJECT_DIR$/src/Entity/Reception.php</url>
|
<url>file://$PROJECT_DIR$/frontend/components/reception/reception-product-received.vue</url>
|
||||||
<line>6</line>
|
<properties lambdaOrdinal="-1" />
|
||||||
<option name="timeStamp" value="5" />
|
<option name="timeStamp" value="7" />
|
||||||
|
</line-breakpoint>
|
||||||
|
<line-breakpoint enabled="true" type="javascript">
|
||||||
|
<url>file://$PROJECT_DIR$/frontend/components/reception/reception-product-received.vue</url>
|
||||||
|
<line>103</line>
|
||||||
|
<properties lambdaOrdinal="-1" />
|
||||||
|
<option name="timeStamp" value="9" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
</breakpoints>
|
</breakpoints>
|
||||||
</breakpoint-manager>
|
</breakpoint-manager>
|
||||||
@@ -762,4 +781,12 @@
|
|||||||
<expand />
|
<expand />
|
||||||
<select />
|
<select />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="github-copilot-workspace">
|
||||||
|
<instructionFileLocations>
|
||||||
|
<option value=".github/instructions" />
|
||||||
|
</instructionFileLocations>
|
||||||
|
<promptFileLocations>
|
||||||
|
<option value=".github/prompts" />
|
||||||
|
</promptFileLocations>
|
||||||
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-row gap-16 items-center w-full">
|
<div
|
||||||
|
v-if="receptionStore.current?.receptionType?.code === RECEPTION_TYPE_CODES.BOVINS"
|
||||||
|
class="flex flex-col items-center gap-16">
|
||||||
|
<h1 class="text-4xl uppercase font-bold">Sélection des marchandises réceptionnnées</h1>
|
||||||
|
<div
|
||||||
|
class="flex flex-row gap-16 items-center w-full">
|
||||||
<div
|
<div
|
||||||
v-for="type in bovineType"
|
v-for="type in bovineType"
|
||||||
:key="type.id"
|
:key="type.id"
|
||||||
@@ -7,6 +12,8 @@
|
|||||||
<UiNumberInput
|
<UiNumberInput
|
||||||
:label="type.label"
|
:label="type.label"
|
||||||
:code="type.code"
|
:code="type.code"
|
||||||
|
v-model="selectedBovineTypeIds[type.id]"
|
||||||
|
:value="String(type.id)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -16,17 +23,29 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<button
|
||||||
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
||||||
|
@click="goNext"
|
||||||
|
>Peser
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import {getTruckList} from "~/services/truck";
|
|
||||||
import type {BovineTypeData} from "~/services/dto/bovine-type-data";
|
import type {BovineTypeData} from "~/services/dto/bovine-type-data";
|
||||||
import {getBovineTypeList} from "~/services/bovine-type";
|
import {getBovineTypeList} from "~/services/bovine-type";
|
||||||
|
import {RECEPTION_TYPE_CODES} from "~/utils/constants";
|
||||||
|
import {useReceptionStore} from '~/stores/reception'
|
||||||
|
import {
|
||||||
|
createReceptionBovine,
|
||||||
|
deleteReceptionBovine,
|
||||||
|
getReceptionBovineList
|
||||||
|
} from "~/services/reception-bovine";
|
||||||
|
import {ref} from "vue";
|
||||||
|
|
||||||
const isLoadingBovineType = ref(false)
|
const isLoadingBovineType = ref(false)
|
||||||
const bovineType = ref<BovineTypeData[]>([])
|
const bovineType = ref<BovineTypeData[]>([])
|
||||||
|
const receptionStore = useReceptionStore()
|
||||||
|
const selectedBovineTypeIds = ref<string[]>
|
||||||
const loadBovineType = async () => {
|
const loadBovineType = async () => {
|
||||||
isLoadingBovineType.value = true
|
isLoadingBovineType.value = true
|
||||||
try {
|
try {
|
||||||
@@ -35,7 +54,29 @@ const loadBovineType = async () => {
|
|||||||
isLoadingBovineType.value = false
|
isLoadingBovineType.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
||||||
await loadBovineType()
|
await loadBovineType()
|
||||||
|
selectedBovineTypeIds.value=bovineType.value.map((type) => String(type.id))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
async function goNext() {
|
||||||
|
if (!receptionStore.current) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const nextStep = receptionStore.current.currentStep + 1
|
||||||
|
const receptionIri = `/api/receptions/${receptionStore.current.id}`
|
||||||
|
console.log(selectedBovineTypeIds.value)
|
||||||
|
await receptionStore.updateReception(receptionStore.current.id, {
|
||||||
|
merchandiseType: null,
|
||||||
|
merchandiseDetail: null,
|
||||||
|
buildings: null,
|
||||||
|
bovinesTypes : selectedBovineTypeIds.value.map((id) => `/api/bovines_types/${id}`),
|
||||||
|
currentStep: nextStep
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
v-if="receptionStore.current?.receptionType?.code === RECEPTION_TYPE_CODES.MERCHANDISES"
|
v-if="receptionStore.current?.receptionType?.code === RECEPTION_TYPE_CODES.MERCHANDISES"
|
||||||
class="flex flex-col gap-16 items-center w-full">
|
class="flex flex-col gap-16 items-center w-full">
|
||||||
<h1 class="text-4xl uppercase font-bold">Sélection des marchandises réceptionnnées</h1>
|
<h1 class="text-4xl uppercase font-bold">Sélection des marchandises réceptionnnées</h1>
|
||||||
<!-- ICI UNE ERREUR DE RESPECT MAQUETTE -->
|
|
||||||
<UiSelect
|
<UiSelect
|
||||||
id="merchandise-type"
|
id="merchandise-type"
|
||||||
v-model="selectedMerchandiseTypeId"
|
v-model="selectedMerchandiseTypeId"
|
||||||
@@ -13,7 +12,6 @@
|
|||||||
:options="merchandiseTypes.map((type) => ({ value: String(type.id), label: type.label }))"
|
:options="merchandiseTypes.map((type) => ({ value: String(type.id), label: type.label }))"
|
||||||
wrapper-class="w-[550px]"
|
wrapper-class="w-[550px]"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="selectedMerchandiseTypeId && isAutres"
|
v-if="selectedMerchandiseTypeId && isAutres"
|
||||||
class="flex flex-col w-full max-w-[550px]"
|
class="flex flex-col w-full max-w-[550px]"
|
||||||
@@ -67,12 +65,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="receptionStore.current?.receptionType?.code === RECEPTION_TYPE_CODES.BOVINS"
|
|
||||||
>
|
|
||||||
<h1 class="text-4xl uppercase font-bold">Sélection des races réceptionnnées</h1>
|
|
||||||
<ReceptionBovineReceived />
|
|
||||||
</div>
|
|
||||||
<button
|
<button
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
||||||
@click="goNext"
|
@click="goNext"
|
||||||
|
|||||||
@@ -1,34 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="['flex flex-row items-center gap-2', wrapperClass]">
|
<div :class="['flex items-center gap-4', wrapperClass]">
|
||||||
<label
|
<label
|
||||||
v-if="label && label !== 'Autres'"
|
v-if="label"
|
||||||
:for="id"
|
:for="id"
|
||||||
class="font-bold text-xl"
|
class="font-bold uppercase text-xl"
|
||||||
:class="labelClass"
|
:class="labelClass"
|
||||||
>
|
>
|
||||||
{{ label }} <span v-if="code">({{ code }})</span>
|
{{ label }}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<!-- Champ texte si Autres -->
|
|
||||||
<input
|
|
||||||
v-else-if="label === 'Autres'"
|
|
||||||
type="text"
|
|
||||||
:placeholder="'Autres'"
|
|
||||||
class="border-b border-black text-xl bg-transparent- w-48"
|
|
||||||
/>
|
|
||||||
<input
|
<input
|
||||||
:id="id"
|
:id="id"
|
||||||
type="number"
|
type="number"
|
||||||
:value="modelValue ?? 0"
|
:value="modelValue ?? ''"
|
||||||
:placeholder="placeholder"
|
|
||||||
:min="min"
|
:min="min"
|
||||||
:max="max"
|
:max="max"
|
||||||
:step="step"
|
:step="step"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
v-bind="attrs"
|
v-bind="attrs"
|
||||||
class="border-2 border-black text-xl pb-[6px] w-12 bg-transparent ma"
|
class="border-b border-black text-xl pb-[6px] bg-transparent text-right"
|
||||||
:class="[
|
:class="[
|
||||||
disabled ? 'cursor-not-allowed text-neutral-400' : 'cursor-text text-black',
|
isEmpty ? 'text-neutral-400' : 'text-black',
|
||||||
|
disabled ? 'cursor-not-allowed' : 'cursor-text',
|
||||||
inputClass
|
inputClass
|
||||||
]"
|
]"
|
||||||
@input="onInput"
|
@input="onInput"
|
||||||
@@ -37,43 +29,48 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {useAttrs} from 'vue'
|
import { computed, useAttrs } from 'vue'
|
||||||
|
|
||||||
defineOptions({inheritAttrs: false})
|
defineOptions({ inheritAttrs: false })
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
id?: string
|
id?: string
|
||||||
label?: string
|
label?: string
|
||||||
code?: string
|
modelValue: number | string | null | undefined
|
||||||
modelValue: number | null | undefined
|
min?: number | string
|
||||||
placeholder?: string
|
max?: number | string
|
||||||
min?: number
|
step?: number | string
|
||||||
max?: number
|
|
||||||
step?: number
|
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
wrapperClass?: string
|
wrapperClass?: string
|
||||||
labelClass?: string
|
labelClass?: string
|
||||||
inputClass?: string
|
inputClass?: string
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
placeholder: '',
|
min: undefined,
|
||||||
min: 0,
|
max: undefined,
|
||||||
step: 1,
|
step: undefined,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
wrapperClass: '',
|
wrapperClass: '',
|
||||||
labelClass: '',
|
labelClass: '',
|
||||||
inputClass: ''
|
inputClass: ''
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'update:modelValue', value: number): void
|
(event: 'update:modelValue', value: number | null): void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const attrs = useAttrs()
|
const attrs = useAttrs()
|
||||||
|
const isEmpty = computed(() => props.modelValue === null || props.modelValue === undefined || props.modelValue === '')
|
||||||
|
|
||||||
const onInput = (event: Event) => {
|
const onInput = (event: Event) => {
|
||||||
const target = event.target as HTMLInputElement
|
const target = event.target as HTMLInputElement
|
||||||
emit('update:modelValue', Number(target.value))
|
if (target.value === '') {
|
||||||
|
emit('update:modelValue', null)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const numeric = Number(target.value)
|
||||||
|
emit('update:modelValue', Number.isNaN(numeric) ? null : numeric)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<ReceptionForm v-if="!storeReception || storeReception.currentStep === 0"/>
|
<ReceptionForm v-if="!storeReception || storeReception.currentStep === 0"/>
|
||||||
<ReceptionWeight v-if="storeReception?.currentStep === 1" mode="gross"/>
|
<ReceptionWeight v-if="storeReception?.currentStep === 1" mode="gross"/>
|
||||||
<ReceptionProductReceived v-if="storeReception?.currentStep === 2"/>
|
<ReceptionProductReceived v-if="storeReception?.currentStep === 2 && receptionStore.current?.receptionType?.code === RECEPTION_TYPE_CODES.MERCHANDISES"/>
|
||||||
|
<ReceptionBovineReceived v-if="storeReception?.currentStep === 2 && receptionStore.current?.receptionType?.code === RECEPTION_TYPE_CODES.BOVINS"/>
|
||||||
<ReceptionWeight v-if="storeReception?.currentStep !== null && storeReception?.currentStep >= 3" mode="tare"/>
|
<ReceptionWeight v-if="storeReception?.currentStep !== null && storeReception?.currentStep >= 3" mode="tare"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
import {useReceptionStore} from '~/stores/reception'
|
import {useReceptionStore} from '~/stores/reception'
|
||||||
import {storeToRefs} from 'pinia'
|
import {storeToRefs} from 'pinia'
|
||||||
import {RECEPTION_STEP_LABELS} from '~/constants/steps'
|
import {RECEPTION_STEP_LABELS} from '~/constants/steps'
|
||||||
|
import {RECEPTION_TYPE_CODES} from "~/utils/constants";
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|||||||
8
frontend/services/dto/reception-bovine-data.ts
Normal file
8
frontend/services/dto/reception-bovine-data.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import type {BovineTypeData} from "~/services/dto/bovine-type-data";
|
||||||
|
|
||||||
|
export interface ReceptionBovineTypeData{
|
||||||
|
id: number
|
||||||
|
quantity : number
|
||||||
|
reception?: string
|
||||||
|
bovineType: BovineTypeData
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import type { AddressData } from '~/services/dto/address-data'
|
|||||||
import type { TruckData } from '~/services/dto/truck-data'
|
import type { TruckData } from '~/services/dto/truck-data'
|
||||||
import type { CarrierData } from '~/services/dto/carrier-data'
|
import type { CarrierData } from '~/services/dto/carrier-data'
|
||||||
import type { DriverData } from '~/services/dto/driver-data'
|
import type { DriverData } from '~/services/dto/driver-data'
|
||||||
|
import type {BovineTypeData} from "~/services/dto/bovine-type-data";
|
||||||
|
|
||||||
export interface ReceptionData {
|
export interface ReceptionData {
|
||||||
id: number
|
id: number
|
||||||
@@ -21,6 +22,7 @@ export interface ReceptionData {
|
|||||||
merchandiseType?: MerchandiseTypeData | null
|
merchandiseType?: MerchandiseTypeData | null
|
||||||
merchandiseDetail?: string | null
|
merchandiseDetail?: string | null
|
||||||
buildings?: BuildingData[] | null
|
buildings?: BuildingData[] | null
|
||||||
|
bovinesTypes?: BovineTypeData[] | null
|
||||||
pelletBuildings?: ReceptionPelletBuildingData[] | null
|
pelletBuildings?: ReceptionPelletBuildingData[] | null
|
||||||
user?: UserData | null
|
user?: UserData | null
|
||||||
supplier?: SupplierData | null
|
supplier?: SupplierData | null
|
||||||
@@ -47,6 +49,7 @@ export type ReceptionPayload = {
|
|||||||
merchandiseType?: string | null
|
merchandiseType?: string | null
|
||||||
merchandiseDetail?: string | null
|
merchandiseDetail?: string | null
|
||||||
buildings?: string[] | null
|
buildings?: string[] | null
|
||||||
|
bovinesTypes?: string[] | null
|
||||||
user?: string | null
|
user?: string | null
|
||||||
supplier?: string | null
|
supplier?: string | null
|
||||||
address?: string | null
|
address?: string | null
|
||||||
|
|||||||
49
frontend/services/reception-bovine.ts
Normal file
49
frontend/services/reception-bovine.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import { useApi } from '~/composables/useApi'
|
||||||
|
import type { ReceptionBovineTypeData } from '~/services/dto/reception-bovine-data'
|
||||||
|
|
||||||
|
export type ReceptionBovineListResponse =
|
||||||
|
| ReceptionBovineTypeData[]
|
||||||
|
| { 'hydra:member'?: ReceptionBovineTypeData[] }
|
||||||
|
|
||||||
|
export type ReceptionBovinePayload = {
|
||||||
|
quantity: number
|
||||||
|
reception: string
|
||||||
|
bovineType: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getReceptionBovineList(
|
||||||
|
receptionIri: string
|
||||||
|
): Promise<ReceptionBovineTypeData[]> {
|
||||||
|
const api = useApi()
|
||||||
|
const response = await api.get<ReceptionBovineListResponse>(
|
||||||
|
'reception_bovines',
|
||||||
|
{ reception: receptionIri },
|
||||||
|
{
|
||||||
|
toastErrorKey: 'errors.receptionBovine.list'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (Array.isArray(response)) {
|
||||||
|
return response
|
||||||
|
}
|
||||||
|
if (response && typeof response === 'object' && Array.isArray(response['hydra:member'])) {
|
||||||
|
return response['hydra:member']
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function createReceptionBovine(
|
||||||
|
payload: ReceptionBovinePayload
|
||||||
|
): Promise<ReceptionBovineTypeData> {
|
||||||
|
const api = useApi()
|
||||||
|
return api.post<ReceptionBovineTypeData>('reception_bovines', payload, {
|
||||||
|
toastErrorKey: 'errors.receptionBovine.create'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deleteReceptionBovine(id: number): Promise<void> {
|
||||||
|
const api = useApi()
|
||||||
|
await api.delete<void>(`reception_bovines/${id}`, {}, {
|
||||||
|
toastErrorKey: 'errors.receptionBovine.delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user