<!-- @desc:资金日记账  @auth:常皓宁  @time:2024/4/26 15:15 -->
<template>
  <div class="main-div">
    <BaseIndexButtonGroup id="BaseIndexButtonGroup">
      <template #left>
        <BaseIndexButton ref="search" name="search"></BaseIndexButton>
        <BaseIndexButton ref="clear" name="clear"></BaseIndexButton>
      </template>
    </BaseIndexButtonGroup>

    <!--  卡片区  -->
    <div class="index-card">
      <!--  查询条件区域  -->
      <div id="search-cond-div" ref="search-cond-div" class="search-cond-class">
        <SearchCond ref="searchCond" v-model="searchCond"
                    @collapse-change="collapseChange" :setFlag="false"
                    :searchContent="searchContent"></SearchCond>
      </div>
      <!--  表格部分  -->
      <div slot="top">
        <!--  表格部分  -->
        <DkTable :data="tableData"
                 :page-flag="false"
                 :page-total-flag="false"
                 :height="tableHeight-30"
                 primaryKey="itemId"
                 :pageFlag="true"
                 @pageChange="pageSizeChange"
                 :page-total="pageInfo.total"
                 :current-page="pageInfo.currentPage"
                 ref="table-select"
                 :sortable="false"
                 :showCheckboxHeader="false"
                 :choose-flag="false">
          <DkTableColumn field="macname"></DkTableColumn>
          <DkTableColumn field="accdate" :title="$t('accDate')"/>
          <DkTableColumn field="amtinflow" data-type="number"/>
          <DkTableColumn field="balance" data-type="number"></DkTableColumn>
        </DkTable>
      </div>
    </div>
  </div>
</template>

<script>
import {indexMixin} from "@/mixins";

export default {
  name: 'supplier-account-report',
  mixins: [indexMixin],
  data() {
    let self = this
    return {
      searchContent: [
        {
          itemCode: '账务日期-时间',
          itemName: 'accDate',
          valueFormat: {
            code: 'accDate',
            default: [new Date().addMonths(-1).format('yyyy-MM-dd'), new Date().format('yyyy-MM-dd')]
          },
          valueKind: 'DATE_RANGE'
        },
      ],
    }
  },
  methods: {
    /**
     * @desc   : 查询数据
     * @author : 常皓宁
     * @date   : 2024/4/25 13:09
     */
    getData(params) {
      params.cpId = this.$store.state.user.cpId
      return this.excute(this.$service.detailReportService, this.$service.detailReportService.getFundReport, params)
    },
  },
  created() {
    this.primaryKey = 'itemId'  // 设置主键Id
    this.routeObjName = 'detailReport'  // 设置路由名称
  }
}
</script>

<style scoped>

</style>
