BillRoomFormModal.vue 1.7 KB

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