<template>
	<div>
		<el-select v-model="value" placeholder="请选择物料品牌" style="width: 100%;" @change="change">
			<el-option v-for="(item,index) in options" :key="index" :value="item.id" :label="item.name">
			</el-option>
		</el-select>
	</div>
</template>

<script lang="ts">
	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
	import api from "@/api/currency";
	@Component
	export default class BrandType extends Vue {
		@Prop()
		propValue : any;
		value : any = '';
		options : any = []
		@Watch('propValue')
		propValueChange(v : any) {
			this.value = v;
		};
		created() {
			api.pageList({
				pageNo: 1, pageSize: 999
			}, 'maindataMaterialBrand').then((res : any) => {
				if (res.code === 200) {
					this.options = res.data.records;
				}
			}).catch(() => {});
		}
		change(e : any) {
			this.$emit('onChange', e)
		}
	}
</script>