ScheduleRoomModal.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. <schedule-room-form
  13. ref="realForm"
  14. @ok="submitCallback"
  15. :disabled="disableSubmit"
  16. :bookingOrdersId="bookingOrdersId"
  17. ></schedule-room-form>
  18. </j-modal>
  19. </template>
  20. <script>
  21. import ScheduleRoomForm from "./ScheduleRoomForm";
  22. export default {
  23. name: "ScheduleRoomModal",
  24. components: {
  25. ScheduleRoomForm,
  26. },
  27. props: {
  28. bookingOrdersId: {
  29. type: String,
  30. default: "",
  31. },
  32. },
  33. data() {
  34. return {
  35. title: "",
  36. width: 1300,
  37. visible: false,
  38. disableSubmit: false,
  39. };
  40. },
  41. methods: {
  42. add() {
  43. this.visible = true;
  44. this.$nextTick(() => {
  45. this.$refs.realForm.add();
  46. });
  47. },
  48. addList(record) {
  49. this.visible = true;
  50. this.$nextTick(() => {
  51. this.$refs.realForm.addList(record);
  52. });
  53. },
  54. edit(record) {
  55. this.visible = true;
  56. this.$nextTick(() => {
  57. this.$refs.realForm.edit(record);
  58. });
  59. },
  60. close() {
  61. this.$emit("close");
  62. this.visible = false;
  63. },
  64. handleOk() {
  65. this.$refs.realForm.submitForm();
  66. },
  67. submitCallback(e) {
  68. this.$emit("ok", e);
  69. this.visible = false;
  70. },
  71. handleCancel() {
  72. this.close();
  73. },
  74. },
  75. };
  76. </script>
  77. <style scoped>
  78. /deep/.ant-modal-body {
  79. padding: 12px;
  80. max-height: calc(80vh - 150px);
  81. overflow-y: auto;
  82. &::-webkit-scrollbar {
  83. width: 6px;
  84. /*高宽分别对应横竖滚动条的尺寸*/
  85. height: 1px;
  86. }
  87. &::-webkit-scrollbar-thumb {
  88. background: #e3e3e6;
  89. border-radius: 6px;
  90. }
  91. &::-webkit-scrollbar-track {
  92. background: transparent;
  93. border-radius: 5px;
  94. }
  95. }
  96. </style>