Create.vue 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <script setup>
  2. import { useForm } from '@inertiajs/inertia-vue3'
  3. import TableHeader from './TableHeader'
  4. import AppPagination from '@/components/AppPagination.vue'
  5. import DashboardLayout from '@/layouts/DashboardLayout.vue'
  6. import { onMounted } from 'vue'
  7. defineProps({
  8. entryTransactions: Object,
  9. typeVehicles: Object,
  10. })
  11. const form = useForm({})
  12. const submit = () => {
  13. form.post(route('test-transactions.store'))
  14. }
  15. </script>
  16. <template>
  17. <DashboardLayout>
  18. <div class="grid">
  19. <div class="col-12 md:col-6">
  20. <Card>
  21. <template #title> <h1>Entry</h1> </template>
  22. <template #content>
  23. <DataTable
  24. responsiveLayout="scroll"
  25. columnResizeMode="expand"
  26. :value="entryTransactions.data"
  27. :rowHover="true"
  28. :stripedRows="true"
  29. >
  30. <template #header>
  31. <span style="color: var(--primary-color)">
  32. Maksimal ditampilkan :
  33. </span>
  34. {{ entryTransactions.per_page }}
  35. <br />
  36. <span style="color: var(--primary-color)">Ditampilkan :</span>
  37. {{ Object.keys(entryTransactions.data).length }}
  38. </template>
  39. <Column
  40. v-for="value in TableHeader"
  41. :field="value.field"
  42. :header="value.header"
  43. :key="value.field"
  44. />
  45. </DataTable>
  46. <AppPagination :links="entryTransactions.links" />
  47. </template>
  48. <template #footer>
  49. <div class="flex flex-column md:flex-row justify-content-end">
  50. <Button
  51. label="Car Entry"
  52. icon="pi pi-check"
  53. class="p-button-outlined"
  54. :disabled="form.processing"
  55. @click="submit"
  56. />
  57. </div>
  58. </template>
  59. </Card>
  60. </div>
  61. </div>
  62. </DashboardLayout>
  63. </template>