<template>
  <!-- branch仓库选择 -->

  <p-grid-form ref="grid" :span="span" :label-col="{ span: 9 }" :items="items" @submit="hanlderSubmit"> </p-grid-form>
</template>
<script>
import setBranch from '@/views/example/modules/form/setBranch.js'
export default {
  data() {
    return {
      span: 8,
      items: this.setItems(),
    }
  },
  mounted() {},
  computed: {},
  watch: {},
  methods: {
    setItems(params = {}) {
      // let a = setBranch({
      //   name: 'abc',
      //   label: '入库仓库1',
      //   search: this.search,
      //   ok: this.ok,
      // })
      // let b = setBranch({
      //   name: 'abc2',
      //   label: '入库仓库2',
      //   search: this.search,
      //   ok: this.ok,
      // })
      // a = a[0]

      // b = b[0]

      return [
        ...setBranch({
          label: '入库仓库',
          search: this.search,
          ok: this.ok,
          required: false, //是否必填

          ...params,
        }),
        // {
        //   type: 'input',
        //   on: {
        //     allowClear() {
        //       debugger
        //     },
        //   },
        // },
      ]
    },
    search(value, event, form) {
      console.log(form.getFieldValue())
      //  this.items = this.setItems()
    },
    ok() {},
    hanlderSubmit() {},
  },
}
</script>
<style lang="less"></style>
