App.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template lang="pug">
  2. .statement
  3. form-wizard(
  4. title=''
  5. subtitle=''
  6. color='#7c7bad'
  7. ref='wizard'
  8. )
  9. //- @on-change="(prev, next) => stepChange(prev, next)"
  10. // Step Initial
  11. template
  12. tab-content( title='Seleccione la caja' :beforeChange='checkStatement' )
  13. statement-step(@actionSelected='actionSelected')
  14. // Step Transfer
  15. template(v-if='!!isTransfer')
  16. // Step Transfer 2
  17. tab-content( title="A que caja vas a transferir" :beforeChange='checkStatementDest')
  18. statement-dest-step
  19. // Step Transfer 3
  20. tab-content( title="Que valor vas a transferir")
  21. statement-operation-step
  22. // step Imput
  23. template( v-if='!!isInputCashbox')
  24. // step Imput 2
  25. tab-content( title="Que valor vas a colocar")
  26. statement-operation-step
  27. // Step Output
  28. template(v-if='!!isOutputCashbox')
  29. // Step Output 2
  30. tab-content( title="Que valor vas a sacar")
  31. statement-operation-step
  32. // step confirm
  33. template(v-if='!!isStatmentConfirm')
  34. // step confirm 2
  35. tab-content(title='Que ajuste deseas hacer')
  36. statement-confirm-step
  37. // STEP MODIFY STATMENT
  38. template
  39. tab-content(title="Que vas a modificar")
  40. statement-modify
  41. // Footer
  42. template(
  43. slot='footer'
  44. slot-scope='props'
  45. )
  46. .wizard-footer-left
  47. wizard-button(
  48. v-if='props.activeTabIndex > 0'
  49. @click.native='goBack'
  50. :style='props.fillButtonStyle'
  51. ) Volver
  52. .wizard-footer-right
  53. wizard-button(
  54. v-if='!props.isLastStep'
  55. class='wizard-footer-right'
  56. :style='props.fillButtonStyle'
  57. @click.native='goNext'
  58. ) Continuar
  59. wizard-button(
  60. v-else-if='props.activeTabIndex > 0'
  61. class='wizard-footer-right finish-button'
  62. :style='props.fillButtonStyle'
  63. @click.native='endProcess'
  64. ) {{ props.isLastStep ? 'Finalizar' : 'Continuar' }}
  65. </template>
  66. <script>
  67. import { mapGetters, mapActions } from 'vuex'
  68. import { FormWizard, TabContent, WizardButton } from 'vue-form-wizard'
  69. import 'vue-form-wizard/dist/vue-form-wizard.min.css'
  70. /* steps */
  71. import StatementStep from '@/components/steps/StatementStep'
  72. import StatementDestStep from '@/components/steps/StatementDestStep'
  73. import StatementOperationStep from '@/components/steps/StatementOperationStep'
  74. import StatementConfirmStep from '@/components/steps/StatementConfirmStep'
  75. import StatementModify from '@/components/steps/StatementModify'
  76. // import DetailsStep from '@/components/steps/DetailsStep'
  77. // import { LoadingOverlay } from '@/components/common'
  78. export default {
  79. components: {
  80. FormWizard,
  81. TabContent,
  82. WizardButton,
  83. StatementStep,
  84. StatementDestStep,
  85. StatementOperationStep,
  86. StatementConfirmStep,
  87. StatementModify,
  88. },
  89. computed: mapGetters([
  90. 'isTransfer', // Transfer
  91. 'isInputCashbox', // Input
  92. 'isOutputCashbox', // Output
  93. 'isStatmentConfirm', // codnfirm
  94. 'selectedActions',
  95. 'selectedStatement',
  96. 'selectedStatementDest',
  97. ]),
  98. methods: {
  99. goNext() {
  100. this.$refs.wizard.nextTab()
  101. // if (this.$refs.wizard.activeTabIndex >= 1) {
  102. // this.changeInitialPayment(this.initialPayment)
  103. // }
  104. },
  105. goBack() {
  106. // if (this.$refs.wizard.activeTabIndex === 1 ) {
  107. // this.resetStoreModules(this.$refs.wizard.activeTabIndex)
  108. // }
  109. this.$refs.wizard.prevTab()
  110. },
  111. // actionSelected() {
  112. // this.stepChange(0, 1)
  113. // },
  114. /*
  115. stepChange(prev, next) {
  116. console.log(prev);
  117. console.log(next);
  118. // if ((this.$refs.wizard.maxStep === 0) && (this.$refs.wizard.maxStep === this.$refs.wizard.activeTabIndex)){
  119. // this.goNext()
  120. // return false
  121. //}
  122. },
  123. */
  124. ...mapActions([
  125. 'initProcessBank',
  126. 'endProcess',
  127. 'checkStatement',
  128. 'checkStatementDest',
  129. 'resetStoreModules',
  130. ])
  131. },
  132. watch: {
  133. isCompleted(value) {
  134. if (!value) {
  135. return
  136. }
  137. this.$refs.wizard.changeTab(2, 0, false)
  138. // this.resetPurchase()
  139. }
  140. },
  141. mounted() {
  142. this.initProcessBank(this.$root.mode)
  143. }
  144. }
  145. </script>
  146. <style lang="sass">
  147. @import './assets/variables'
  148. .statement
  149. width: 100%
  150. height: 100%
  151. position: absolute
  152. .vue-form-wizard
  153. width: 100%
  154. height: 100%
  155. padding-bottom: 0
  156. .wizard-header
  157. display: none
  158. .wizard-navigation
  159. width: 100%
  160. height: 100%
  161. .wizard-progress-with-circle
  162. top: 35px
  163. .wizard-icon-circle
  164. width: 60px
  165. height: 60px
  166. .wizard-tab-content
  167. width: 100%
  168. height: calc(100% - 82px)
  169. padding: 0
  170. overflow: hidden
  171. .wizard-tab-container
  172. width: calc(100% - 20px)
  173. height: calc(100% - 20px)
  174. margin: 10px
  175. .statement-step
  176. width: 100%
  177. height: 100%
  178. background: $app-bg-color
  179. .wizard-card-footer
  180. width: 100%
  181. height: 50px
  182. position: absolute
  183. bottom: 0
  184. text-align: center
  185. box-shadow: 2px 0px 5px rgba(0, 0, 0, 0.26)
  186. .wizard-footer-left, .wizard-footer-right
  187. margin-top: 3px
  188. .wizard-btn
  189. width: 160px
  190. height: 40px
  191. border-radius: 0
  192. box-shadow: none
  193. border: none
  194. &:hover, &:focus
  195. background: $app-main-color
  196. </style>