<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="100px">
    </el-form>
    <el-table
      v-loading="loading"
      :data="basicInformationDetailsList"
      @selection-change="handleSelectionChange"
      height="calc(100vh - 300px)"
    >
      <el-table-column type="selection" width="50" align="center" />
      <el-table-column
        label="序号"
        align="center"
        key="no"
        prop="no"
        width="200"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="数据上报日期"
        align="center"
        key="dataReportingDate"
        prop="dataReportingDate"
        width="200"
        :show-overflow-tooltip="true"
      >
        <template #default="scope">
          <span>{{ parseTime(scope.row.occurrenceTime) }}</span>
        </template>
      </el-table-column>
      <!-- itemTable -->
      <el-table-column
        label="省级行政区划代码"
        align="center"
        key="provinceCodes"
        prop="provinceCodes"
        width="200"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="组织机构代码"
        align="center"
        key="organizationCode"
        prop="organizationCode"
        width="200"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="医疗机构代码"
        align="center"
        key="medicalCode"
        prop="medicalCode"
        width="200"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="组织机构名称"
        align="center"
        key="organizationName"
        prop="organizationName"
        width="200"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="年度药品总收入(元)"
        align="center"
        key="yearMedicineTotalRevenue"
        prop="yearMedicineTotalRevenue"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="实有床位数"
        align="center"
        key="actualBedsNo"
        prop="actualBedsNo"
        :show-overflow-tooltip="true"
      />
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      v-model:page="queryParams.pageNo"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script setup name="basicInformationDetails">
import {
  getReportBasicInformationDetails,
} from './statisticalManagent';

const basicInformationDetailsList = ref([]);
const loading = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const approvalTime = ref([]);
const supplierListOptions = ref([]);
const locationIdList = ref([]);

const data = reactive({
  form: {},
  queryParams: {
    pageNo: 1,
    pageSize: 10,
    searchKey: undefined,
    occurrenceTimeSTime: undefined,
    occurrenceTimeETime: undefined,
  },
  rules: {},
});

const { queryParams, form, rules } = toRefs(data);

function getList() {
  loading.value = true;
  getReportBasicInformationDetails(queryParams.value).then((res) => {
    loading.value = false;
    basicInformationDetailsList.value = res.data.records;
    total.value = res.data.total;
  });
}

getList();
</script>
<style scoped>
.custom-tree-node {
  display: flex;
  align-items: center;
}

.title {
  font-weight: bold;
  font-size: large;
  margin-bottom: 10px;
}
</style>
