<!--
  @description: 批量审核-弹框
  @Modifier：sxm
  @routerPath:
  @date：  2020-5-25 11:45:19
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogData.dialog"
    :close-on-click-modal="false"
    :lock-scroll="false"
    title="批量审核"
    width="600px"
    custom-class="el-dialog__body-p8 el-dialog_table"
  >
    <el-form ref="formData" :model="formData" :rules="rules" :inline-message="true">
      <el-form-item label="审核意见" prop="auditReason">
        <el-input
          v-model="formData.auditReason"
          :autosize="{ minRows: 4, maxRows: 4 }"
          type="textarea"
          maxlength="1000"
          show-word-limit
          style="width: 85%"
        />
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="auditSignUp('01')">审核通过</el-button>
      <el-button @click="auditSignUp('02')">审核不通过</el-button>
    </span>
  </el-dialog>
</template>

<script>
/* api接口*/
import { auditSignUpList } from '@/api/procurement/procurementSignup'
export default {
  name: 'PatchAuditDialog',
  mixins: [],
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return
      }
    },
    signUpIds: {
      type: String,
      default: function() {
        return ''
      }
    }
  },
  data() {
    return {
      flag: '00', // 根据评审类型不同 来控制页面不同的显示方式 初始化为00
      formData: {
        auditReason: '' // 审核意见
      },
      rules: {
        auditReason: [{ required: true, message: '不能为空', trigger: 'blur' }]// 审核意见
      }
    }
  },
  watch: {
    'dialogData.dialog'(newval, oldval) {

    }
  },
  created() {

  },
  methods: {
    auditSignUp(auditStatus) {
      auditSignUpList(this.signUpIds, auditStatus, this.formData.auditReason).then(res => {
        if (res.header.ret === '0') {
          this.$message({
            type: 'success',
            message: res.header.msg
          })
          this.dialogData.dialog = false
        }
      })
    }
  }
}
</script>

<style scoped lang="less">
</style>

