import pick from 'lodash.pick'
export const setwarehouse = {
  mounted() {
    this.SetWarehouse()
  },
  methods: {
    SetWarehouse() {
      let warehouse = this.$store.state.user.warehouse
      if (Object.keys(warehouse).length > 0) {
        if (this.$refs.gridform) {
          this.$refs.gridform.form.setFieldsValue(
            pick(warehouse, 'warehouseId', 'warehouseCode', 'warehouseName')
          )
        } else if(this.$refs.detial)  {
          console.log(this.$refs.detial,'this.$refs.detialthis.$refs.detial')
          this.$refs.detial.$refs.gridform.form.setFieldsValue(
            pick(warehouse, 'warehouseId', 'warehouseCode', 'warehouseName')
          )
        }
      }
    }
  }
}
