batchCardModal.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. @ok="handleOk"
  7. :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  8. @cancel="handleOk"
  9. cancelText="关闭">
  10. <pos-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></pos-type-form>
  11. </j-modal>
  12. </template>
  13. <script>
  14. import PosTypeForm from './batchCardDetail.vue'
  15. export default {
  16. name: 'PosTypeModal',
  17. components: {
  18. PosTypeForm
  19. },
  20. data () {
  21. return {
  22. title:'',
  23. width:500,
  24. visible: false,
  25. disableSubmit: false
  26. }
  27. },
  28. methods: {
  29. add () {
  30. this.visible=true
  31. this.$nextTick(()=>{
  32. this.$refs.realForm.add();
  33. })
  34. },
  35. edit (record) {
  36. this.visible=true
  37. this.$nextTick(()=>{
  38. this.$refs.realForm.edit(record);
  39. })
  40. },
  41. close () {
  42. this.$emit('close');
  43. this.visible = false;
  44. },
  45. handleOk () {
  46. this.$refs.realForm.submitForm();
  47. },
  48. submitCallback(){
  49. this.$emit('ok');
  50. this.visible = false;
  51. },
  52. handleCancel () {
  53. this.close()
  54. }
  55. }
  56. }
  57. </script>