123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <script setup>
  2. import { Head } from '@inertiajs/inertia-vue3'
  3. import AppTable from '@/components/AppTable.vue'
  4. import AppButtonMove from '@/components/AppButtonMove.vue'
  5. import AppButtonDetail from '@/components/AppButtonDetail.vue'
  6. import AppPagination from '@/components/AppPagination.vue'
  7. import DefaultLayout from '@/layouts/DefaultLayout.vue'
  8. defineProps({
  9. customers: Object,
  10. })
  11. </script>
  12. <template>
  13. <Head title="Daftar Customer" />
  14. <DefaultLayout>
  15. <CRow class="mb-4">
  16. <CCol></CCol>
  17. <CCol xs="auto">
  18. <AppButtonMove :href="route('customers.create')">Tambah Customer</AppButtonMove>
  19. </CCol>
  20. </CRow>
  21. <CRow>
  22. <CCol>
  23. <AppTable>
  24. <template #table-head>
  25. <CTableRow>
  26. <CTableHeaderCell>Id Customer</CTableHeaderCell>
  27. <CTableHeaderCell>Nama</CTableHeaderCell>
  28. <CTableHeaderCell>HP</CTableHeaderCell>
  29. <CTableHeaderCell>Alamat</CTableHeaderCell>
  30. <CTableHeaderCell>Jenis Kelamin</CTableHeaderCell>
  31. </CTableRow>
  32. </template>
  33. <template #table-body>
  34. <CTableRow v-for="customer in customers.data" :key="customer.id">
  35. <CTableDataCell>{{ customer.customer_number }}</CTableDataCell>
  36. <CTableDataCell>{{ customer.name }}</CTableDataCell>
  37. <CTableDataCell>{{ customer.phone }}</CTableDataCell>
  38. <CTableDataCell>{{ customer.address }}</CTableDataCell>
  39. <CTableDataCell>{{ customer.gender }}</CTableDataCell>
  40. <CTableDataCell>
  41. <AppButtonDetail :href="route('customers.edit', customer.id)" />
  42. </CTableDataCell>
  43. </CTableRow>
  44. </template>
  45. </AppTable>
  46. </CCol>
  47. </CRow>
  48. <CRow>
  49. <AppPagination :links="customers.links" />
  50. </CRow>
  51. </DefaultLayout>
  52. </template>