Customer.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template lang="pug">
  2. .pos-step
  3. .customer-selection-step
  4. .customer-selector
  5. searcher(:items='customers' :keys="['name', 'displayName']")
  6. card-grid(:items='customers' :loading='loadingCustomers' canAdd @onAdd='showCustomerForm')
  7. customer-modal(:show='showingCustomerForm' @onAccept='submitCustomer')
  8. </template>
  9. <script>
  10. import { mapGetters, mapActions } from 'vuex'
  11. import { Searcher, CardGrid } from '@/components/common'
  12. import CustomerModal from '@/components/modals/CustomerModal'
  13. import { SHOW_CUSTOMER_FORM, SUBMIT_CUSTOMER } from '@/constants/actionTypes'
  14. export default {
  15. components: {
  16. Searcher,
  17. CardGrid
  18. },
  19. computed: mapGetters([
  20. 'customers',
  21. 'loadingCustomers',
  22. 'showingCustomerForm'
  23. ]),
  24. methods: mapActions([
  25. SHOW_CUSTOMER_FORM,
  26. SUBMIT_CUSTOMER
  27. ])
  28. }
  29. </script>
  30. <style lang="sass">
  31. .pos-step
  32. .customer-selection-step
  33. width: 100%
  34. height: 100%
  35. display: flex
  36. </style>