main.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <el-dialog
  3. title="审批申请"
  4. :visible.sync="visible"
  5. width="60%"
  6. :before-close="onClose"
  7. append-to-body
  8. class="el-dialogDeep"
  9. :close-on-click-modal="false"
  10. v-dialog-drag
  11. >
  12. <slot name='content'></slot>
  13. <avue-form :option="option" v-model="query"></avue-form>
  14. <span slot="footer" class="dialog-footer">
  15. <el-button @click="onClose()">取 消</el-button>
  16. <el-button @click="onClose()" type="primary">提交审核</el-button>
  17. </span>
  18. </el-dialog>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. visible: false,
  25. query: {},
  26. option: {
  27. menuBtn:false,
  28. column: [
  29. {
  30. label: "理由",
  31. prop: "reason",
  32. type:'textarea',
  33. span:24,
  34. rules: [
  35. {
  36. required: true,
  37. message: "请输入理由",
  38. trigger: "blur"
  39. }
  40. ]
  41. }
  42. ]
  43. }
  44. };
  45. },
  46. props: {
  47. switchDialog: {
  48. type: Boolean,
  49. default: false
  50. }
  51. },
  52. methods: {
  53. onClose() {
  54. this.visible = false;
  55. Object.assign(this.$data, this.$options.data());
  56. this.$emit("onClose", false);
  57. }
  58. },
  59. watch: {
  60. switchDialog: function(i) {
  61. this.visible = i;
  62. }
  63. }
  64. };
  65. </script>
  66. <style lang="scss" scoped></style>