remarkDialog.vue 2.56 KB
<!-- 备注 -->
<template>
  <GLDialog bigTitle="备注"
            :visible.sync="dialogShow"
            class="accountDailog"
            width="600px"
            mode="big"
            :close-on-click-modal="false"
            :before-close="handleClose"
            @onOk="handleAddConfirm"
            @onCancel="dialogShow = false">
    <el-form label-width="120px"
             :model="infoForm"
             ref="formRef"
             :rules="formRules"
             :inline="true">
      <el-form-item label="备注:"
                    prop="yqMerchantId">
        <el-input type="textarea"
                  class="default-width"
                  placeholder="请输入内容"
                  v-model="infoForm.remark"
                  maxlength="15"
                  :rows="4"
                  show-word-limit></el-input>
      </el-form-item>
    </el-form>
  </GLDialog>
</template>

<script>
export default {
  name: 'RemarkDialog',
  data() {
    return {
      infoForm: {
        remark: ''
      },
      dialogConfig: {
        title: '备注',
        width: '600px'
      },
      rejectRef: 'rejectRef',
      formRules: {
        // remark: [{ required: true, message: '请输入驳回原因', trigger: 'blur' }]
      },
      editFormData: [
        {
          label: '备注',
          name: 'remark',
          type: 'input',
          maxlength: 15,
          inputType: 'textarea',
          showLimit: true,
          rows: 4
        }
      ],
      baseData: {}
    }
  },

  props: {
    visible: {
      type: Boolean,
      default: false
    },
    paramsObj: {
      type: Object,
      default: null
    }
  },
  computed: {
    dialogShow: {
      get() {
        return this.visible
      },
      set(newVal) {
        this.$emit('dialogClose', { flag: newVal })
      }
    }
  },

  mounted() {
    console.log('paramsObj', this.paramsObj)
    this.infoForm.remark = this.$common.utils.deepClone(this.paramsObj.remark)
  },

  methods: {
    handleAddConfirm() {
      this.$refs.formRef.validate(valid => {
        if (valid) {
          var params = {}
          params.remark = this.infoForm.remark
          params.inviteFollowRecordId = this.paramsObj.inviteFollowRecordId

          this.$apis.invitation.followRecordUpdate(params).then(res => {
            this.$notify({
              type: 'success',
              title: '操作成功'
            })
            this.dialogShow = true
          })
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.reject-dialog {
  margin-top: 20px;
}
.default-width {
  width: 400px;
}
</style>