<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="100px">
    </el-form>
    <el-table
      v-loading="loading"
      :data="medicationStockOutDetailsList"
      @selection-change="handleSelectionChange"
      height="calc(100vh - 300px)"
    >
      <el-table-column type="selection" width="50" align="center" />
      <el-table-column
        label="医疗机构代码"
        align="center"
        key="medicalInstitutionCode"
        prop="medicalInstitutionCode"
        width="220"
        :show-overflow-tooltip="true"
      />
      <!-- itemTable -->
      <el-table-column
        label="组织机构名称"
        align="center"
        key="organizationName"
        prop="organizationName"
        width="220"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="国家药品编码(YPID)"
        align="center"
        key="nationalMedicineCode"
        prop="nationalMedicineCode"
        width="220"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="院内药品唯一码"
        align="center"
        key="busNo"
        prop="busNo"
        width="220"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="省级药品集中采购平台药品编码"
        align="center"
        key="provincialMedicineConcentratedCode"
        prop="provincialMedicineConcentratedCode"
        width="220"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="产品名称"
        align="center"
        key="lotName"
        prop="lotName"
        width="220"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="出库数量(最小销售包装单位)"
        align="center"
        key="quantitySales"
        prop="quantitySales"
        :show-overflow-tooltip="true"
        width="220"
      />
      <el-table-column
        label="出库数量(最小制剂单位)"
        align="center"
        key="quantityPreparation"
        prop="quantityPreparation"
        :show-overflow-tooltip="true"
        width="220"
      />
    </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="medicationStockOutDetails">
import {
  getReportMedicationStockOutDetails,
} from './statisticalManagent';


const medicationStockOutDetailsList = 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;
  getReportMedicationStockOutDetails(queryParams.value).then((res) => {
    loading.value = false;
    medicationStockOutDetailsList.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>
