<template>
  <div>
    <!-- pubConsignor货主弹出查询配置 -->
    <p-grid-form ref="grid" :span="span" :label-col="{ span: 9 }" :items="items" @submit="hanlderSubmit" />
  </div>
</template>
<script>
import setPubConsignor from '@/views/example/modules/form/pubConsignor.js'

export default {
  data() {
    return {
      span: 8,
      items: [
        // {
        //   name: 'name',
        //   label: '自定义验证',
        //   type: 'input',
        //   visible: false,
        //   disabled: this.disabled,
        //   rules: [
        //     {
        //       type: 'string',
        //       required: true,
        //       message: '输入错误',
        //       validator: function (rule, value, callback) {
        //         if (value == '') {
        //           return false
        //         } else {
        //           callback()
        //         }
        //       },
        //     },
        //   ],
        // },

        ...setPubConsignor({
          label: '货主选择',
          //  search: this.search,
          required: true, //是否必填
          ok: this.ok,
        }),
      ],
    }
  },
  mounted() {
    setTimeout(() => {})
  },
  methods: {
    disClick() {
      this.disabled = !this.disabled
      this.$refs.grid.form.visibleItem('name')
      //  console.log(1, this.disabled)
      //     console.log(2, this.items[0].disabled)
    },
    ok(event, valueRowKey, rowData, form) {
      console.log(form)
    },

    hanlderSubmit() {},
  },
}
</script>
<style lang="less"></style>
