examineDialog.vue 3.02 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="examineRef"
                       :form-obj="infoForm"
                       :form-data="editFormData"
                       :form-rules="formRules"></glsx-combi-form>
      <span :style="{ 'margin-left': '150px' }">{{ txtObj[examineType] }}</span>
    </div>
  </baseDialog>
</template>

<script>
import { updateBatch } from '@api/refundExamine'
// import { deepClone } from '@/common/util'
export default {
  name: 'ExamineDialog',
  data() {
    return {
      userInfo: this.$store.state.d2admin.user.info,
      txtObj: {
        运营审核: '审核通过后,退款单据自动流转至商务审核。',
        商务审核: '审核通过后,退款单据自动流转至财务复核。',
        财务复核: '审核通过后,退款单据自动流转至财务结算。'
      },
      infoForm: {
        remark: ''
      },
      dialogConfig: {
        title: '',
        width: '600px'
      },
      examineRef: 'examineRef',
      formRules: {

      },
      editFormData: [{
        label: '备注',
        name: 'remark',
        type: 'input',
        maxlength: 50,
        inputType: 'textarea',
        showLimit: true,
        rows: 4
      }],
      baseData: {

      }
    }
  },

  props: {
    examineType: {
      type: String,
      default: ''
    },
    examineVisible: {
      type: Boolean,
      default: false
    },
    infoList: {
      type: Array,
      default: () => { }
    }
  },
  computed: {
    visible: {
      get() {
        return this.examineVisible
      },
      set(newVal) {
        this.$emit('dialogClose', { flag: newVal, attrName: 'examineVisible' })
      }
    }
  },

  mounted() {
    this.dialogConfig.title = this.examineType
  },

  methods: {

    handleAddConfirm() {
      var params = {
        status: 1
      }
      params.remark = this.infoForm.remark
      const obj = {
        '运营审核': 1,
        '商务审核': 2,
        '财务复核': 3,
      }
      params.status = obj[this.examineType]
      if (this.infoList.length > 1) {
        params.idList = this.infoList.map((item) => {
          return item.id
        })
      } else {
        params.idList = [this.infoList[0].id]
      }
      console.log(params)

      updateBatch(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>