gaoluyang
2025-03-15 21e7326b415597938fba463ebb8b3507b7fdbdfd
src/views/CNAS/externalService/serviceAndSupplyPro/component/ConsumableList.vue
@@ -10,7 +10,7 @@
    </div>
    <limsTable :column="columns" :currentChange="rowClick" :height="'25vh'" :highlightCurrentRow="true"
               :isSelection="false" :rowStyle="tableRowStyle" :table-data="tableData" rowKey="id"
               style="margin-top: 18px;">
               @pagination="pagination" :page="page" style="margin-top: 18px;">
      <template v-slot:consumablesTypeSlot="{ row }">
        {{ findType(row.consumablesType) }}
      </template>
@@ -19,13 +19,6 @@
        <el-button size="small" style="color: #f56c6c" type="text" @click="handleDelete(scope.row)">删除</el-button>
      </template>
    </limsTable>
    <div class="pagination">
      <div></div>
      <el-pagination :page-size="pagination.pageSize" :page-sizes="[10, 20, 30, 40]" :total="pagination.total"
                     background
                     layout="total, sizes, prev, pager, next, jumper" @current-change="handleCurrent" @size-change="handleSize">
      </el-pagination>
    </div>
    <el-divider></el-divider>
    <div>
      <ConsumableProject ref="consumableProject"></ConsumableProject>
@@ -122,9 +115,9 @@
        }
      ],
      tableData: [],
      pagination: {
      page: {
        current: 1,
        pageSize: 20,
        size: 20,
        total: 0
      },
      options: [],
@@ -136,9 +129,10 @@
  },
  methods: {
    async fetchData() {
      procurementSuppliesList({ contentId: this.contentsId }).then(res => {
      procurementSuppliesList({ contentId: this.contentsId, ...this.page }).then(res => {
        if (res.code === 200) {
          this.tableData = res.data.records
          this.page.total = res.data.total
          if (this.tableData.length > 0) {
            this.rowClick(this.tableData[0])
          }
@@ -165,9 +159,9 @@
        this.$download.saveAs(blob, '耗材列表.xlsx')
      })
    },
    handleCurrent() {
    },
    handleSize() {
    pagination(page) {
      this.page.size = page.limit
      this.fetchData()
    },
    handleDelete(row) {
      deleteProcurementSuppliesList({ id: row.id }).then(res => {
@@ -195,12 +189,5 @@
<style scoped>
.flex {
  text-align: right;
}
.pagination {
  padding-top: 15px;
  padding-right: 10px;
  display: flex;
  justify-content: space-between
}
</style>