CmmsInspectContentModal.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <u-modal
  3. :title="title"
  4. :visible.sync="visible"
  5. contentFull
  6. @ok="handleOk"
  7. @cancel="handleCancel">
  8. <cmms-inspect-content-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cmms-inspect-content-form>
  9. </u-modal>
  10. </template>
  11. <script>
  12. import CmmsInspectContentForm from './CmmsInspectContentForm'
  13. export default {
  14. name: 'CmmsInspectContentModal',
  15. components: {
  16. CmmsInspectContentForm
  17. },
  18. data () {
  19. return {
  20. title:'',
  21. visible: false,
  22. disableSubmit: false
  23. }
  24. },
  25. methods: {
  26. add () {
  27. this.visible=true
  28. this.$nextTick(()=>{
  29. this.$refs.realForm.add();
  30. })
  31. },
  32. edit (record) {
  33. this.visible=true
  34. this.$nextTick(()=>{
  35. this.$refs.realForm.edit(record);
  36. })
  37. },
  38. close () {
  39. this.$emit('close');
  40. this.visible = false;
  41. },
  42. handleOk () {
  43. this.$refs.realForm.submitForm();
  44. },
  45. submitCallback(){
  46. this.$emit('ok');
  47. this.visible = false;
  48. },
  49. handleCancel () {
  50. this.close()
  51. }
  52. }
  53. }
  54. </script>