<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="单号">{{ detailData.billno?detailData.billno:"--" }}</el-descriptions-item>
        <el-descriptions-item label="单据日期">{{ detailData.changedate?detailData.changedate:"--" }}</el-descriptions-item>
        <el-descriptions-item label="经销商">{{ detailData.enterprisename?detailData.enterprisename:"--"}}</el-descriptions-item>
        <el-descriptions-item label="账户类型">{{ detailData.accountname?detailData.accountname:"--" }}</el-descriptions-item>
        <el-descriptions-item label="金额">{{ detailData.amount?tool.formatAmount(detailData.amount,2):"--" }}</el-descriptions-item>
        <el-descriptions-item label="分类">{{ detailData.class?detailData.class:"--" }}</el-descriptions-item>
        <el-descriptions-item label="分类明细">{{ detailData.subclass?detailData.subclass:"--" }}</el-descriptions-item>
        <el-descriptions-item :style="style(detailData.status)" label="状态">
          <span :style="colorStyle">{{ detailData.status?detailData.status:"--" }}</span>
        </el-descriptions-item>
        <el-descriptions-item label="已核销金额">{{ "--" }}</el-descriptions-item>
        <el-descriptions-item label="凭证来源">{{ detailData.source?detailData.source:"--" }}</el-descriptions-item>
        <el-descriptions-item label="凭证来源说明">{{ detailData.sourcenote?detailData.sourcenote:"--" }}</el-descriptions-item>
        <el-descriptions-item label="备注">{{ detailData.remarks?detailData.remarks:"--" }}</el-descriptions-item>
<!--        <el-descriptions-item label="创建人">{{ detailData.changeby?detailData.changeby:"&#45;&#45;" }}</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="创建人">{{ detailData.changeby?detailData.changeby:"--" }}</el-descriptions-item>
        <el-descriptions-item label="创建时间">{{ detailData.changedate?detailData.changedate:"--" }}</el-descriptions-item>
        <el-descriptions-item label="审核人">{{ detailData.checkby?detailData.checkby:"--" }}</el-descriptions-item>
        <el-descriptions-item label="审核日期">{{ detailData.checkdate?detailData.checkdate:"--" }}</el-descriptions-item>
      </el-descriptions>
    </div>
  </div>
</template>

<script>
export default {
  name: "detailed",
  props:["detailData"],
  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>