<template>
  <div>
    <p-card title="数据查询">
      <p-grid-form :label-col="{ span: 8 }" :span="8" :items="config.items" @submit="hanlderSubmit" />
      <p-table ref="table" row-key="id" bordered :columns="config.columns" :remoteParams="remoteParams"/>
      </p-card>
  </div>
  </template>

<script>
  import config from './config.js'
  
  export default {
    data(){
      return{
        remoteParams: {
          barCode: ''
        },
        config
      }
    },
    methods: {
      hanlderSubmit(e, form) {
        e.preventDefault()
        form.validateFields((error, values) => {
          if (!error) {
            this.remoteParams = {
              ...this.remoteParams,
              ...values
            }
          }
        })
      },
    }
  }
</script>

<style>
</style>
