<template>
  <div>
    <el-table v-loading="loading" :data="list" border highlight-current-row style="width: 100%">
      <el-table-column label="序号" type="index"></el-table-column>
      <el-table-column label="产品DI" prop="nameCode" width="260"></el-table-column>
      <el-table-column label="产品编码" prop="thirdId" width="260"></el-table-column>
      <el-table-column label="产品名称" prop="cpmctymc" width="260"></el-table-column>
      <el-table-column label="规格型号" prop="ggxh"></el-table-column>
      <el-table-column label="计量单位" prop="measname"></el-table-column>
      <el-table-column label="单据数量" prop="count"></el-table-column>
      <el-table-column label="扫码数量" prop="reCount"></el-table-column>
      <el-table-column label="生产企业" prop="ylqxzcrbarmc"></el-table-column>
      <el-table-column label="注册/备案号" prop="zczbhhzbapzbh"></el-table-column>
    </el-table>

  </div>
</template>

<script>

import addDestinyProcess from "@/views/basic/destiny/addDestinyProcess";
import {filterDestinyDelect} from "@/api/inout/ioDestinyProcess";


export default {
  name: "destinyProcessDelect",
  props: {
    billNo: {
      type: Object,
      required: true
    },
    destinyProcessCodeShow: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      filterQuery: {
        name: "",
        code: "",
        type: 2,
        page: 1,
        limit: 20
      },
      loading: false,
      list: [],
      total: 0
    };
  },
  methods: {
    onReset() {
      this.$router.push({
        path: ""
      });
      this.filterQuery = {
        page: 1,
        limit: 20
      };
      this.getList();
    },
    onSubmit() {
      this.$router.push({
        path: "",
      });
      this.filterQuery.page = 1;
      this.getList();
    },
    getList() {
      this.loading = true;
      this.filterQuery.billNo = this.billNo
      filterDestinyDelect(this.filterQuery).then(response => {
        this.loading = false;
        this.list = response.data || [];
      }).catch(() => {
        this.loading = false;
        this.list = [];
      });
    },
  }
  ,
  mounted() {
  }
  ,

  components: {
    addDestinyProcess
  }
  ,
  created() {
    if(this.destinyProcessCodeShow==true){
      this.getList();
    }
  }
}
;
</script>
