Skip to content

Commit

Permalink
Use InputSupplier instead of custom input
Browse files Browse the repository at this point in the history
  • Loading branch information
seballot committed Feb 5, 2024
1 parent ac75a39 commit 1d75ee3
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/views/sessions/OrderNewDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
<Dialog v-model:visible="visible" :style="{ width: '600px' }" :modal="true" class="p-fluid"
header="New Order">

<div class="p-field" v-if="suppliers.length > 0">
<Dropdown v-model="order.supplier_id" :options="suppliers" placeholder="Supplier"
optionLabel="name" optionValue="id" />
<div class="p-field" v-if="$root.suppliersArray.length > 0">
<InputSupplier v-model="order.supplier_id" />
</div>

<!-- Date -->
Expand All @@ -27,23 +26,18 @@
</template>

<script>
import Dropdown from 'primevue/dropdown'
import InputDay from '@/components/InputDay.vue'
import InputSupplier from '../../components/InputSupplier.vue'
export default {
inject: ['sessionDays', 'stockDays'],
components: { Dropdown, InputDay },
components: { InputDay, InputSupplier },
data() {
return {
visible: false,
order: {},
}
},
computed: {
suppliers() {
return this.$root.suppliersArray
},
},
methods: {
show(data) {
this.order = {
Expand All @@ -56,7 +50,6 @@ export default {
},
...data,
}
if (this.suppliers.length === 1) this.order.supplier_id = this.suppliers.at(0).id
this.visible = true
},
async createOrder() {
Expand Down

0 comments on commit 1d75ee3

Please sign in to comment.