<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="8">
        <borderTemp>
          <template #content>
            <el-row>
              <el-col :span="10" :offset="6">
                <el-divider>
                  <span class="title-font">本周</span>
                </el-divider>
              </el-col>
            </el-row>
            <el-row :gutter="20" class="content-title">
              <el-col :span="6">
                <span >销售金额</span>
              </el-col>
              <el-col :span="6">
                <span>出货金额</span>
              </el-col>
              <el-col :span="6">
                <span>收款金额</span>
              </el-col>
              <el-col :span="6">
                <span>开票金额</span>
              </el-col>
            </el-row>
            <el-row :gutter="20" class="content-title">
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                  <span v-if="list.bzxsje > 10000">
                    {{tool.formatAmount(list.bzxsje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.bzxsje,2)}}
                  </span>
                </span>
              </el-col>
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                  <span v-if="list.bzchje > 10000">
                    {{tool.formatAmount(list.bzchje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.bzchje,2)}}
                  </span>
                </span>
              </el-col>
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                   <span v-if="list.bzskje > 10000">
                    {{tool.formatAmount(list.bzskje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.bzskje,2)}}
                  </span>
                </span>
              </el-col>
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                  <span v-if="list.bzkpje > 10000">
                    {{tool.formatAmount(list.bzkpje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.bzkpje,2)}}
                  </span>
                </span>
              </el-col>
            </el-row>
          </template>
        </borderTemp>
      </el-col>
      <el-col :span="8">
        <borderTemp>
          <template #content>
            <el-row>
              <el-col :span="10" :offset="6">
                <el-divider>
                  <span class="title-font">本月</span>
                </el-divider>
              </el-col>
            </el-row>
            <el-row :gutter="20" class="content-title">
              <el-col :span="6">
                <span >销售金额</span>
              </el-col>
              <el-col :span="6">
                <span>出货金额</span>
              </el-col>
              <el-col :span="6">
                <span>收款金额</span>
              </el-col>
              <el-col :span="6">
                <span>开票金额</span>
              </el-col>
            </el-row>
            <el-row :gutter="20" class="content-title">
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                  <span v-if="list.byxsje > 10000">
                    {{tool.formatAmount(list.byxsje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.byxsje,2)}}
                  </span>
                </span>
              </el-col>
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                  <span v-if="list.bychje > 10000">
                    {{tool.formatAmount(list.bychje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.bychje,2)}}
                  </span>
                </span>
              </el-col>
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                  <span v-if="list.byskje > 10000">
                    {{tool.formatAmount(list.byskje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.byskje,2)}}
                  </span>
                </span>
              </el-col>
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                  <span v-if="list.bykpje > 10000">
                    {{tool.formatAmount(list.bykpje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.bykpje,2)}}
                  </span>
                </span>
              </el-col>
            </el-row>
          </template>
        </borderTemp>
      </el-col>
      <el-col :span="8">
        <borderTemp>
          <template #content>
            <el-row>
              <el-col :span="10" :offset="6">
                <el-divider>
                  <span class="title-font">本年</span>
                </el-divider>
              </el-col>
            </el-row>
            <el-row :gutter="20" class="content-title">
              <el-col :span="6">
                <span >销售金额</span>
              </el-col>
              <el-col :span="6">
                <span>出货金额</span>
              </el-col>
              <el-col :span="6">
                <span>收款金额</span>
              </el-col>
              <el-col :span="6">
                <span>开票金额</span>
              </el-col>
            </el-row>
            <el-row :gutter="20" class="content-title">
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                  <span v-if="list.bnxsje > 10000">
                    {{tool.formatAmount(list.bnxsje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.bnxsje,2)}}
                  </span>
                </span>
              </el-col>
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                   <span v-if="list.bnchje > 10000">
                    {{tool.formatAmount(list.bnchje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.bnchje,2)}}
                  </span>
                </span>
              </el-col>
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                   <span v-if="list.bnskje > 10000">
                    {{tool.formatAmount(list.bnskje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.bnskje,2)}}
                  </span>
                </span>
              </el-col>
              <el-col :span="6">
                <span class="title-font" style="color: #333"><span style="font-size: 12px">¥</span>
                   <span v-if="list.bnkpje > 10000">
                    {{tool.formatAmount(list.bnkpje / 10000,2) + '万'}}
                  </span>
                  <span v-else>
                    {{tool.formatAmount(list.bnkpje,2)}}
                  </span>
                </span>
              </el-col>
            </el-row>
          </template>
        </borderTemp>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import borderTemp from '../components/border'
export default {
  name: "salesData",
  components:{borderTemp},
  props:['param','isDep','dataid','isPerson'],
  data() {
    return {
      list:'',
    }
  },
  methods:{
    async queryList(){
      /*this.isDep ? this.param.content.type = 1: this.isPerson ? this.param.content.type = 0 : this.param.content.type = ''*/
      this.param.content.dataType = 2
     /* this.param.content.dataid = this.dataid*/
      const res = await this.$api.requested(this.param)
      this.list = res.data
      console.log(this.list,'销售数据')
    }
  }
}
</script>

<style scoped>

</style>
