<template>
  <div>
    <el-form :inline="true" :model="query" class="query-form" size="mini">
      <el-form-item class="query-form-item">
        <el-input
          v-model="query.key"
          placeholder="搜索"
          style="width: 350px"
        ></el-input>
      </el-form-item>

      <el-form-item style="display: flex">
        <el-button type="primary" icon="search" @click="getList"
          >查询</el-button
        >
      </el-form-item>
    </el-form>

    <el-table :data="udidlList" style="width: 100%" @row-click="intentDetail">
      <el-table-column label="产品标识" prop="zxxsdycpbs"></el-table-column>
      <el-table-column label="产品名称" prop="cpmctymc"></el-table-column>
      <el-table-column label="规格型号" prop="ggxh"></el-table-column>
      <el-table-column
        label="医疗器械注册人"
        prop="ylqxzcrbarmc"
      ></el-table-column>
      <el-table-column
        label="注册证编号"
        prop="zczbhhzbapzbh"
      ></el-table-column>
      <el-table-column label="发布日期" prop="cpbsfbrq"></el-table-column>
    </el-table>
  </div>
</template>

  <script>
import { udidList } from "../../api/udid/udid";

export default {


  name: "closeDialog",
  props: {
    closeDialog: {
      type: Function,
      required: true,
    },
  },

  data() {
    return {
      query: {
        key: "",
        page: 1,
        limit: 10,
      },
      udidlList: [],
    };
  },
  methods: {
    getList() {
      this.loading = true;
      udidList(this.query)
        .then((response) => {
          this.loading = false;
          this.udidlList = response.data.list || [];
          this.total = response.data.total || 0;
        })
        .catch(() => {
          this.loading = false;
          this.udidlList = [];
          this.total = 0;
        });
    },

    intentDetail(row) {
      this.$emit('productInfo',row)
      this.closeDialog();
    },
  },
};
</script>