<template>
  <div>
    <div class="normal-margin">
      <el-descriptions :column="2" labelClassName="my-label" contentClassName="my-content" border>
        <div slot="title" class="my-label__title">基本信息</div>
        <el-descriptions-item  label="单号">{{ data.billno?data.billno:"--" }}</el-descriptions-item>
        <el-descriptions-item label="单据日期">{{ data.billdate?data.billdate:"--" }}</el-descriptions-item>
        <el-descriptions-item label="企业名称">{{ data.enterprisename?data.enterprisename:"--"}}</el-descriptions-item>
        <el-descriptions-item label="返利代金券">{{ data.rebate_billno?data.rebate_billno:"--" }}</el-descriptions-item>
        <el-descriptions-item label="返利金有效期">{{ data.rebate_enddate?data.rebate_enddate:"--" }}</el-descriptions-item>
        <el-descriptions-item label="支出金额">{{ data.amount?tool.formatAmount(data.amount,2):"--" }}</el-descriptions-item>
        <el-descriptions-item label="备注">{{ data.remarks?data.remarks:"--" }}</el-descriptions-item>
        <el-descriptions-item :style="style(data.status)" label="状态">
          <span :style="colorStyle">{{ data.status?data.status:"--" }}</span>
        </el-descriptions-item>
      </el-descriptions>
    </div>

    <div>
      <el-descriptions :column="2" labelClassName="my-label" contentClassName="my-content" border>
        <div slot="title" class="my-label__title">系统信息</div>
        <el-descriptions-item label="创建人">{{ data.createby?data.createby:"--" }}</el-descriptions-item>
        <el-descriptions-item label="创建时间">{{ data.createdate?data.createdate:"--" }}</el-descriptions-item>
        <el-descriptions-item label="审核人">{{ data.checkby?data.checkby:"--" }}</el-descriptions-item>
        <el-descriptions-item label="审核时间">{{ data.checkdate?data.checkdate:"--" }}</el-descriptions-item>
      </el-descriptions>
    </div>
  </div>
</template>

<script>
export default {
  name: "detailed",
  props:["data"],
  data(){
    return {
      colorStyle:{
        color:''
      }
    }
  },
  methods:{
    style(val) {
      let style = {}
      console.log(val,'执行了')
      switch (val) {
        case '新建':
          style = {color:"#000000"}
          break;
        case '审核':
          style = {color:"#52C41A"}
          break;
        default:
          break;
      }
      console.log(style)
      this.colorStyle.color = style.color
      console.log(this.colorStyle,"1111")
      return style

    }
  }
}
</script>

<style scoped>

</style>