SupplierStep.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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' canAdd)
  7. transition(name='slide-fade')
  8. supplier-details(v-if='!!supplierSelected')
  9. </template>
  10. <script>
  11. import { mapGetters, mapActions } from 'vuex'
  12. import Searcher from '@/components/common/Searcher'
  13. import CardGrid from '@/components/common/CardGrid'
  14. import SupplierDetails from '@/components/supplier/SupplierDetails'
  15. export default {
  16. components: {
  17. Searcher,
  18. CardGrid,
  19. SupplierDetails,
  20. },
  21. computed: mapGetters([
  22. 'suppliers',
  23. 'visibleSuppliers',
  24. 'supplierSelected'
  25. ]),
  26. methods: mapActions([
  27. 'filterSuppliers'
  28. ])
  29. }
  30. </script>
  31. <style lang="sass">
  32. .purchase-step
  33. .supplier-selection-step
  34. width: 100%
  35. height: 100%
  36. display: flex
  37. .supplier-selector, .supplier-details
  38. height: 100%
  39. .supplier-selector
  40. width: 100%
  41. .supplier-details
  42. width: 360px
  43. margin: 0 15px
  44. .slide-fade-enter-active
  45. transition: all 300ms ease
  46. .slide-fade-leave-active
  47. transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0)
  48. .slide-fade-enter, .slide-fade-leave-to
  49. transform: translateX(10px)
  50. opacity: 0
  51. </style>