<template>
  <div class="table-box">
    <div class="waring-text">
      依据《大同市医保定点公立医疗机构集中带量采购药品货款医保基金与医药企业直接结算实施方案（
      试行）
      》（同医保发【2025】14号）文件，自4月1日起结算协议期内国家和省级集中带量采购中选药品。本页面为协议期内药品目录，每月结算前会动态更新，请各医疗机构、供货企业仔细核对，如有问题请及时反馈给相关工作人员。
    </div>
    <el-table
      ref="multipleTable"
      v-loading="loding"
      :data="tableData"
      element-loading-text="加载中..."
      border
      fit
      highlight-current-row
      max-height="400"
      @row-dblclick="rowClick"
    >
      <template slot="empty">
        <img src="" alt />
        <p>暂无数据</p>
      </template>
      <el-table-column fixed="left" align="center" type="index" label="序号" />
      <el-table-column align="center" label="药品名称" prop="genname">
      </el-table-column>
      <el-table-column align="center" label="药品编码" prop="drugCode">
      </el-table-column>
      <el-table-column align="center" label="目录类型" prop="listType">
      </el-table-column>
      <el-table-column align="center" label="集采批次" prop="fasBtch">
      </el-table-column>
      <el-table-column align="center" label="周期名称" prop="projTurnName">
      </el-table-column>
      <el-table-column align="center" label="开始时间" prop="startTime">
      </el-table-column>
      <el-table-column align="center" label="结束时间" prop="endTime">
      </el-table-column>
      <el-table-column align="center" label="剂型" prop="dosformName">
      </el-table-column>
      <el-table-column align="center" label="规格" prop="specName">
      </el-table-column>
      <el-table-column align="center" label="转换比" prop="convrat">
      </el-table-column>
      <el-table-column align="center" label="制剂单位" prop="minuntName">
      </el-table-column>
      <el-table-column align="center" label="包装单位" prop="bigPacUnt">
      </el-table-column>
      <el-table-column align="center" label="生产企业" prop="prodEntpName">
      </el-table-column>
      <el-table-column align="center" label="挂网价" prop="pubonlnPric">
      </el-table-column>
      <el-table-column align="center" label="挂网类型" prop="pubonlyType">
      </el-table-column>
    </el-table>
    <div class="block">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="crutPage"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
import { clumnData, tableData } from "./clumnData";
import { updateStatusPushJSXY, downLoadZjjsFile } from "@/api/signList/index";
import { exportSaveData, statusData } from "./const";
import { supData, hosData } from "../const";
import { hos } from "../../summary/const";
import moment from "moment";
export default {
  name: "tableView",
  components: {},
  data() {
    return {
      loding: false, // 表格数据加载loding
      tableData: [], // 表格数据
      clumnData: clumnData, // 表格头数据
      total: 0,
      pageSize: 100,
      crutPage: 1,
      pamData: {},
      statusData: statusData,
      orgType: "",
    };
  },
  props: {
    getTableData: {
      type: Object,
      default: {},
    },
  },
  created() {
    let { orgType } = this.$store.state.user;
    this.orgType = orgType;
  },
  mounted() {},
  methods: {
    //每页几条数据
    handleSizeChange(val) {
      this.pageSize = val;
      this.crutPage = 1;
      let tablePam = { size: val, current: 1 };
      this.$emit("pageTruning", tablePam);
    },
    // 当前在第几页
    handleCurrentChange(val) {
      this.crutPage = val;
      let tablePam = { size: this.pageSize, current: val };
      this.$emit("pageTruning", tablePam);
    },
  },
  watch: {
    //表格数据发生改变时重新渲染
    getTableData(newData, oldData) {
      let data = newData.records ? newData.records : [];
      this.tableData = data;
      this.total = newData.total ? newData.total : 0;
      this.pageSize = newData.size ? newData.size : 100;
    },
  },
};
</script>
<style scoped lang="scss">
.table-box {
  padding: 1px;
  position: relative;
  padding-bottom: 50px;

  .block {
    position: absolute;
    right: 10px;
    bottom: 10px;
  }
}
.waring-text {
  color: red;
  margin-bottom: 10px;
  font-weight: bold;
}
</style>
