rejectDialog.vue 2.94 KB
<!-- 驳回 -->
<template>
  <baseDialog
    :dialog-config="dialogConfig"
    :is-show.sync="visible"
    class="accountDailog"
    @handleClick="confirm"
    :btnLoding="btnLoding"
  >
    <div class="reject-dialog">
      <glsx-combi-form
        class="edit-form-container"
        ref="formRef"
        label-width="120px"
        default-width="400px"
        :form-ref="rejectRef"
        :form-obj="infoForm"
        :form-data="editFormData"
        :form-rules="formRules"
      ></glsx-combi-form>
    </div>
  </baseDialog>
</template>

<script>
export default {
  name: "RejectDialog",
  data() {
    return {
      btnLoding: false,
      infoForm: {
        rejectReason: "",
        rejectSuggestion: ""
      },
      dialogConfig: {
        title: "驳回",
        width: "560px"
      },
      rejectRef: "rejectRef",
      formRules: {
        rejectReason: [
          { required: true, message: "请输入驳回原因", trigger: "blur" }
        ],
        rejectSuggestion: [
          { required: true, message: "请输入", trigger: "blur" }
        ]
      },
      editFormData: [
        {
          label: "驳回原因",
          name: "rejectReason",
          type: "input",
          placeholder: "请输入驳回原因",
          maxlength: 50
        },
        {
          label: "驳回意见",
          name: "rejectSuggestion",
          type: "input",
          placeholder: "请输入",
          maxlength: 200,
          inputType: "textarea",
          showLimit: true,
          rows: 4
        }
      ],
      baseData: {}
    }
  },

  props: {
    rejectVisible: {
      type: Boolean,
      default: false
    },
    paramsObj: {
      type: Object,
      default: {}
    }
  },
  computed: {
    visible: {
      get() {
        return this.rejectVisible
      },

      set(newVal) {
        console.log(newVal, "999")
        this.$emit("dialogClose", { flag: newVal, attrName: "rejectVisible" })
      }
    }
  },

  mounted() {
    console.log("paramsObj", this.paramsObj)
  },

  methods: {
    async confirm() {
      const isValid = await this.$refs.formRef.$refs[this.rejectRef].validate()
      console.log(isValid)
      if (isValid) {
        this.$emit("handleAddConfirm")
      }
    },
    handleLoading() {
      this.btnLoding = !this.btnLoding
    },
    handleClose() {
      console.log("handleClose")
      // this.visible = false
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep .el-dialog__header {
  padding: 16px 20px !important;
  color: #333333;
  font-size: 20px;
  font-weight: bold;
}
::v-deep .el-dialog__footer {
  border-top: 1px solid #e5e5e5;
  padding: 14px 20px !important;
}
::v-deep .el-dialog__body {
  padding: 32px 20px !important;
}
.reject-dialog {
  ::v-deep .el-form-item--small.el-form-item {
    margin: 0 0 20px !important;
  }
  ::v-deep .el-textarea .el-input__count {
    right: 16px;
    bottom: 3px;
    font-size: 12px;
    color: #999999;
  }

  .tips {
    color: #999999;
  }
}
</style>