SelectGoodsModal.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. <stock-type-form
  13. ref="realForm"
  14. @ok="submitCallback"
  15. :disabled="disableSubmit"
  16. ></stock-type-form>
  17. </j-modal>
  18. </template>
  19. <script>
  20. import stockTypeForm from "./SelectGoods.vue";
  21. export default {
  22. name: "stockTypeModel",
  23. components: {
  24. stockTypeForm,
  25. },
  26. data() {
  27. return {
  28. title: "",
  29. width: 1200,
  30. visible: false,
  31. disableSubmit: false,
  32. };
  33. },
  34. methods: {
  35. add() {
  36. this.visible = true;
  37. this.$nextTick(() => {
  38. this.$refs.realForm.add();
  39. });
  40. },
  41. edit(record) {
  42. this.visible = true;
  43. this.$nextTick(() => {
  44. this.$refs.realForm.edit(record);
  45. });
  46. },
  47. close() {
  48. this.$emit("close");
  49. this.visible = false;
  50. },
  51. handleOk() {
  52. this.$refs.realForm.submitForm();
  53. },
  54. submitCallback(e) {
  55. this.$emit("ok", e);
  56. this.visible = false;
  57. },
  58. handleCancel() {
  59. this.close();
  60. },
  61. },
  62. };
  63. </script>