ContractorSelect.vue 1.84 KB
<template>	
    <el-select v-model="contractor" @change="contractorChange"  :disabled="disabled" placeholder="请选择" size="small" style="width:100px;">
	    <el-option
	      v-for="item in contractors"
	      :key="item.value"
	      :label="item.label"
	      :value="item.value"
	    >
	    </el-option>
	</el-select>
</template>
<script>
export default{
	props:['label', 'prop', 'notPrepend', 'defaultValue', 'disabled'],
	data(){
		return {
			contractor: this.defaultValue,
			contractors: [
				{
		          value: '康凯斯',
		          label: '康凯斯'
		        }, 
				{
		          value: '博实结',
		          label: '博实结'
		        }, {
		          value: '华宝',
		          label: '华宝'
		        }, {
		          value: '有方',
		          label: '有方'
		        }, {
		          value: '睿讯通',
		          label: '睿讯通'
		        }, {
		          value: '恒泰',
		          label: '恒泰'
		        }, {
		          value: '好的货',
		          label: '好的货'
		        }, {
		        	value: '富创',
		        	label: '富创'
		        }, {
		        	value: '广益汇佳',
		        	label: '广益汇佳'
		        },{
		        	value: '易图',
		        	label: '易图'
				},{
		        	value: '鲁诺',
		        	label: '鲁诺'
		        },{
		        	value: '零零智能',
		        	label: '零零智能'
		        },{
		        	value: '移柯',
		        	label: '移柯'
		        },{
		        	value: '沃达孚',
		        	label: '沃达孚'
		        },
		    ]
		}
	},
	mounted(){
		if(!this.notPrepend){
			this.contractors.unshift({
				value: '',
		        label: '全部'
			})
		}
	},
	watch: {
		defaultValue(newVal){
			this.contractor = newVal
		}
	},
	methods: {
		contractorChange(){
			this.$emit('contractorChange', this.contractor)
		}
	}
}
</script>

<style scoped>

</style>