<!-- 出库交接-->
<template>
  <div>
    <p-card title="出库交接">
      <template slot="extra">
        <!--<p-button type="primary" icon="check" @click="">提升优先级</p-button>
			 <p-button type="primary" icon="redo" @click="">重置</p-button> -->
      </template>
      <div class="plg-inner-form-mb">
        <p-grid-form ref="search" :items="items" @submit="hanlderSubmit" />
      </div>
      <!-- hasRowSelectCheck -->
      <p-table
        ref="table"
        dragle
        auto-width
        :columns="columns"
        :data-source.sync="data"
        rowKey="id"
        :remoteUrl="remoteUrl"
        :remoteParams="remoteUrl.params"
        :autoLoad="false"
        :rowSelectType="false"
        bordered
      >
      </p-table>
    </p-card>
  </div>
</template>

<script>
// 设置默认仓库
import { setwarehouse } from '@/views/kzyWMS/SearchModal/mixins_warehouse.js'
import { items, columns } from './api/index.js'
import { upcloud_base_wh_outbound } from "@/config/serviceSettings";

export default {
  mixins: [setwarehouse],
  data() {
    return {
      items,
      columns,
      data: [],
      loading: false,
      remoteUrl: {
        url: upcloud_base_wh_outbound+'/outbound-handover/page',
        method: 'get',
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded'
        },
        params: {}
      }
    }
  },
  methods: {
    hanlderSubmit(event, form) {
      event.preventDefault()
      let _this = this
      this.$refs.search.form.validateFields((err, values) => {
        if (!err) {
          console.log('验证通过: ', values)
          _this.remoteUrl.params = { ...values }
        }
      })
    },
    // 重置
    hanlderRest(event, form) {
      this.$refs.search.form.resetFields()
    }
  }, // methods
  created() {},
  mounted() {}
}
</script>

<style scoped lang="less"></style>
