SupplierStep.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template lang="pug">
  2. .purchase-step
  3. .supplier-selection-step
  4. .supplier-selector
  5. searcher(:items='suppliers' :keys="['name', 'displayName']" @onSearch='filterSuppliers')
  6. card-grid(:items='visibleSuppliers' @onAdd='showSupplierForm' @onSelect='selectSupplier')
  7. supplier-form
  8. transition(name='slide-fade')
  9. supplier-details(v-if='!!supplierSelected')
  10. </template>
  11. <script>
  12. import { mapGetters, mapActions } from 'vuex'
  13. import Searcher from '@/components/common/Searcher'
  14. import CardGrid from '@/components/common/CardGrid'
  15. import SupplierForm from '@/components/supplier/SupplierForm'
  16. import SupplierDetails from '@/components/supplier/SupplierDetails'
  17. export default {
  18. components: {
  19. Searcher,
  20. CardGrid,
  21. SupplierForm,
  22. SupplierDetails,
  23. },
  24. computed: mapGetters([
  25. 'suppliers',
  26. 'visibleSuppliers'
  27. ]),
  28. methods: mapActions([
  29. 'filterSuppliers',
  30. 'showSupplierForm',
  31. 'selectSupplier'
  32. ])
  33. }
  34. </script>
  35. <style lang="sass">
  36. .purchase-step
  37. .supplier-selection-step
  38. width: 100%
  39. height: 100%
  40. display: flex
  41. .supplier-selector, .supplier-details
  42. height: 100%
  43. .supplier-selector
  44. width: 100%
  45. .supplier-details
  46. width: 360px
  47. margin: 0 15px
  48. .slide-fade-enter-active
  49. transition: all 300ms ease
  50. .slide-fade-leave-active
  51. transition: all 800ms cubic-bezier(1.0, 0.5, 0.8, 1.0)
  52. .slide-fade-enter, .slide-fade-leave-to
  53. transform: translateX(10px)
  54. opacity: 0
  55. </style>