searchMixin.js 683 Bytes

export default {
  data() {
    return {
      date: '',
      brandList: [],
      searchObj: {},
    }
  },
  mounted() {
    this.getGoodsBrandList()
    let that = this
    document.onkeydown = () => {
      let key = window.event.keyCode
      if (key == 13) {
        that.search()
      }
    }
  },
  methods: {
    getGoodsBrandList() {
      this.$apis.orderApi.getAllBrandList({}).then(({ data }) => {
        this.brandList = data
      })
    },
    search(callBack) {
      this.$refs.table.refreshTable(true, false, callBack)
    },
    reset() {
      this.date = ''
      this.searchObj = {}
      this.$nextTick(() => {
        this.search()
      })
    },
  },
}