<template>
  <div id="model-6">
    <el-row class="list">
      <el-col :span="24" class="name">
        {{ data.coupons ? data.coupons.name : '暂无' }}
      </el-col>
      <el-col :span="24" class="other">
        <el-col :span="12" class="other_info textOver">
          申请人：<span>{{ data.apply_person || '暂无' }}</span>
        </el-col>
        <el-col :span="12" class="other_info textOver">
          联系电话：<span>{{ data.phone || '暂无' }}</span>
        </el-col>
        <el-col :span="12" class="other_info textOver">
          是否使用：<span>{{ getUse(data.is_use) || '暂无' }}</span>
        </el-col>
        <el-col :span="12" class="other_info textOver">
          审核状态：<span>{{ getStu(data.status) || '暂无' }}</span>
        </el-col>
      </el-col>
      <el-col :span="24" class="btn">
        <el-button type="primary" size="mini" @click.native="toDetail">详情</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
const { isuse, couponsapplyStatus } = require('@/plugins/couindex');
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'model-6',
  props: {
    data: { type: Object, default: () => {} },
    router: { type: String },
  },
  components: {},
  data: function () {
    return {
      kjpx: require('@a/kjpx.jpg'),
    };
  },
  created() {},
  methods: {
    toDetail() {
      this.$router.push({ path: this.router ? this.router : this.detailRouter, query: { id: this.data._id } });
    },
    getUse(i) {
      const r = isuse.find((f) => f.value === i);
      if (r) return r.label;
      else return '';
    },
    getStu(i) {
      const r = couponsapplyStatus.find((f) => f.value === i);
      if (r) return r.label;
      else return '';
    },
  },
  computed: {
    ...mapState(['user', 'menuParams']),
    pageTitle() {
      return `${this.$route.meta.title}`;
    },
    detailRouter() {
      const key = this.$route.meta.key;
      return `/adminCompany/${key}/resultInfo`;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
};
</script>

<style lang="less" scoped>
.list {
  background-color: #fff;
  border-radius: 5px;
  margin: 0 0 10px 0;
  padding: 8px;
  .name {
    font-size: 16px;
    margin: 0 0 5px 0;
    font-weight: bold;
  }
  .other {
    .other_info {
      font-size: 14px;
      color: #666;
      margin: 0 0 5px 0;
      span {
        color: #000;
      }
    }
  }
  .btn {
    text-align: center;
    margin: 10px 0 0 0;
  }
}
</style>
