import { dealerProductBrandQuery } from '@/api/dealerProductBrand' const ProductBrand = { template: ` {{ item.brandName }} `, props: { value: { type: String, defatut: '' }, id: { type: String, default: '' }, sysFlag: { type: [String,Number], default: '' }, tenantId: { type: String, default: '' } }, data() { return { defaultVal: this.value, productBrandList: [] }; }, mounted() { this.getProductBrand() }, watch: { value(newValue, oldValue) { this.defaultVal = newValue }, tenantId(newValue, oldValue){ console.log(newValue) } }, methods: { filterOption (input, option) { console.log(input, option.data.attrs.pinyin) return ( option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 || option.data.attrs.pinyin && option.data.attrs.pinyin.toLowerCase().indexOf(input.toLowerCase()) >= 0 ) }, handleChange(value) { this.defaultVal = value; this.$emit('change', value); this.$emit('input', value); }, // 产品品牌列表, sysFlag: 1 箭冠 0 自建 getProductBrand () { const params = {'sysFlag': this.sysFlag} if(this.tenantId!="NONE"){ params.tenantId = this.tenantId } if(this.tenantId=="NONE"){ params.sysFlag = '1' } dealerProductBrandQuery(params).then(res => { if (res.status == 200) { this.productBrandList = res.data } else { this.productBrandList = [] } }) }, }, }; export default ProductBrand