SpotcheckItemModal.vue 1.4 KB

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