123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <template lang="pug">
- .pos
- form-wizard(title="" subtitle="" finishButtonText="Finalizar" color="#7c7bad" nextButtonText="Continuar" backButtonText="Volver" @on-complete="completeSale()")
- tab-content(title="Agregue productos al carrito" :before-change="checkCart")
- .products
- .products-container
- products-searcher
- products-grid(:symbol="currency.symbol")
- .cart-container
- cart-total(:total="total" :symbol="currency.symbol")
- cart-items(:symbol="currency.symbol")
- tab-content(title="Seleccione un cliente" :before-change="checkCustomer")
- customer-searcher
- customers-grid
- tab-content(title="Vea un resumen de su operación")
- payment
- loader
- </template>
- <script>
- import { FormWizard, TabContent } from 'vue-form-wizard'
- import 'vue-form-wizard/dist/vue-form-wizard.min.css'
- import Loader from '@/components/Loader'
- import ProductsSearcher from '@/components/ProductsSearcher'
- import ProductsGrid from '@/components/ProductsGrid'
- import CartTotal from '@/components/CartTotal'
- import CartItems from '@/components/CartItems'
- import CartItem from '@/components/CartItem'
- import CustomerSearcher from '@/components/CustomerSearcher'
- import CustomersGrid from '@/components/CustomersGrid'
- import Payment from '@/components/Payment'
- import { mapActions, mapGetters } from 'vuex'
- import Vuex from 'vuex'
- export default {
- components: {
- 'form-wizard': FormWizard,
- 'tab-content': TabContent,
- 'loader': Loader,
- 'products-searcher': ProductsSearcher,
- 'products-grid': ProductsGrid,
- 'cart-total': CartTotal,
- 'cart-items': CartItems,
- 'cart-item': CartItem,
- 'customer-searcher': CustomerSearcher,
- 'customers-grid': CustomersGrid,
- 'payment': Payment
- },
- computed: mapGetters({
- total: 'getTotal',
- currency: 'getCurrency',
- cartIsEmpty: 'cartIsEmpty',
- hasSelectedCustomer: 'hasSelectedCustomer'
- }),
- methods: {
- checkCart() {
- if (!this.cartIsEmpty) {
- this.notify('Necesitas agregar productos al carrito para continuar')
- }
- return this.cartIsEmpty
- },
- checkCustomer() {
- if (!this.hasSelectedCustomer) {
- this.notify('Necesitas seleccionar un cliente para continuar')
- }
- return this.hasSelectedCustomer
- },
- ...mapActions([
- 'initSale',
- 'notify',
- 'completeSale'
- ])
- },
- mounted() {
- this.initSale(this.$root.pos_instance)
- }
- }
- </script>
- <style lang="sass">
- .pos
- width: 100%
- height: 100%
- position: absolute
- .vue-form-wizard
- width: 100%
- height: 100%
- padding-bottom: 0
-
- .wizard-header
- display: none
- .wizard-navigation
- width: 100%
- height: 100%
- .wizard-progress-with-circle
- top: 35px
- .wizard-icon-circle
- width: 60px
- height: 60px
- .wizard-tab-content
- width: 100%
- height: calc(100% - 82px)
- padding: 0
- overflow: hidden
- .wizard-tab-container
- width: calc(100% - 20px)
- height: calc(100% - 20px)
- margin: 10px
- .products
- width: 100%
- height: 100%
- display: block
- background: #fff
- .products-container
- width: calc(100% - 300px)
- height: 100%
- padding-right: 5px
- display: inline-block
- .cart-container
- width: 300px
- height: 100%
- border-left: 1px solid #d3d3d3
- padding-left: 10px
- display: inline-block
- vertical-align: top
- .wizard-card-footer
- width: 100%
- height: 50px
- position: absolute
- bottom: 0
- .wizard-btn
- width: 160px
- height: 40px
- border-radius: 0
- box-shadow: none
- border: none
- &:hover, &:focus
- background: #7c7bad
- </style>
|