<template>
  <div id="model-2">
    <el-row class="list">
      <el-col :span="24" class="is_cashing">
        <el-col :span="4" class="cashing">
          {{ getCash(data.is_cashing) }}
        </el-col>
      </el-col>
      <el-col :span="24" class="other">
        <el-col :span="24" class="other_info textOver">
          申领类型：<span>{{ data.type || '暂无' }}</span>
        </el-col>
        <el-col :span="24" class="other_info textOver">
          申请企业：<span>{{ data.company || '暂无' }}</span>
        </el-col>
        <el-col :span="24" class="other_info textOver">
          申请人：<span>{{ data.apply_person || '暂无' }}</span>
        </el-col>
        <el-col :span="24" class="other_info textOver">
          联系电话：<span>{{ data.phone || '暂无' }}</span>
        </el-col>
        <el-col :span="24" 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="view">查看详情</el-button>
        <el-button type="primary" size="mini" @click="cash" v-if="data.status == '1' && data.is_cashing == '0'">我要兑付</el-button>
        <el-button type="primary" size="mini" @click="cashview" v-if="data.is_cashing == '1'">兑付详情</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
const { iscashing, rewardStatus } = require('@/plugins/couindex');
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'model-2',
  props: {
    data: { type: Object, default: () => {} },
    router: { type: String },
  },
  components: {},
  data: function () {
    return {
      kjpx: require('@a/kjpx.jpg'),
    };
  },
  created() {},
  methods: {
    // 详情
    view() {
      this.$router.push({ path: '/adminCompany/cashing/invention/info', query: { id: this.data._id } });
    },
    // 兑付
    cash() {
      this.$router.push({ path: '/adminCompany/cashing/invention/cashing', query: { id: this.data._id } });
    },
    // 兑付详情
    cashview() {
      this.$router.push({ path: '/adminCompany/cashing/invention/cashingInfo', query: { id: this.data._id } });
    },
    getCash(i) {
      const r = iscashing.find((f) => f.value === i);
      if (r) return r.label;
      else return '';
    },
    getStu(i) {
      const r = rewardStatus.find((f) => f.value === i);
      if (r) return r.label;
      else return '';
    },
  },
  computed: {
    ...mapState(['user', 'menuParams']),
    pageTitle() {
      return `${this.$route.meta.title}`;
    },
  },
  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: 0 0 8px 0;
  .is_cashing {
    margin: 0 0 5px 0;
    .cashing {
      text-align: center;
      background-color: #409eff;
      color: #fff;
      font-size: 12px;
      padding: 5px 0;
      border-radius: 5px;
    }
  }
  .other {
    padding: 0 10px;
    .other_info {
      font-size: 14px;
      color: #666;
      margin: 0 0 10px 0;
      span {
        color: #000;
      }
    }
  }
  .btn {
    text-align: center;
    margin: 10px 0 0 0;
  }
}
// .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>
