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

<script>
import {
  reject
} from "@api/shelfManage.js"
export default {
  name: 'RejectDialog',
  data() {
    return {
      userInfo: this.$store.state.d2admin.user.info,
      infoForm: {
        remark: ''
      },
      dialogConfig: {
        title: '驳回',
        width: '600px'
      },
      rejectRef: 'rejectRef',
      formRules: {
        remark: [{ required: true, message: '请输入驳回原因', trigger: 'blur' }]
      },
      editFormData: [{
        label: '驳回原因',
        name: 'remark',
        type: 'input',
        maxlength: 50,
        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) {
        this.$emit('dialogClose', { flag: newVal, attrName: 'rejectVisible' })
      }
    }
  },

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

  methods: {

    handleAddConfirm() {
      this.$refs.formRef.$refs[this.rejectRef].validate(valid => {
        if (valid) {
          var params = {}
          params.rejectedReason = this.infoForm.remark
          params.id = this.paramsObj.id

          reject(params).then(res => {
            this.notice.okTips('操作成功')
            this.visible = true
          })
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.reject-dialog {
  margin: 65px 0;

  .reject-input {
    ::v-deep .el-textarea__inner {
      height: 70px;
    }
  }

  .el-textarea .el-input__count {
    right: 90px;
    bottom: -10px;
    font-size: 12px;
    color: #999999;
  }

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