SupplierStep.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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' :loading='loadingSuppliers' canAdd @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. 'loadingSuppliers',
  28. 'supplierSelected'
  29. ]),
  30. methods: mapActions([
  31. 'filterSuppliers',
  32. 'showSupplierForm',
  33. 'selectSupplier'
  34. ])
  35. }
  36. </script>
  37. <style lang="sass">
  38. .purchase-step
  39. .supplier-selection-step
  40. width: 100%
  41. height: 100%
  42. display: flex
  43. .supplier-selector, .supplier-details
  44. height: 100%
  45. .supplier-selector
  46. width: 100%
  47. .supplier-details
  48. width: 360px
  49. margin: 0 15px
  50. .slide-fade-enter-active
  51. transition: all 300ms ease
  52. .slide-fade-leave-active
  53. transition: all 800ms cubic-bezier(1.0, 0.5, 0.8, 1.0)
  54. .slide-fade-enter, .slide-fade-leave-to
  55. transform: translateX(10px)
  56. opacity: 0
  57. </style>