main.vue 1.3 KB

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