PaymentModal.vue 1.2 KB

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