<picker class="select-box" @change="e => pickerChange(e, 'Is_environmental_completed')" :value="pickerIndex.Is_environmental_completedIndex" :range="pickerList.Is_environmental_completedList" range-key="label" v-model="pickerIndex.Is_environmental_completedIndex">
<view class="uni-input">{{ getLabelByValue(pickerList.Is_environmental_completedList, rc_enterprise_customer.Is_environmental_completed) }}</view>
<uni-icons class="rt" type="arrowdown" color="#bcbcbc"></uni-icons>
</picker>
pickerIndex:{
Is_environmental_completedIndex:-1,
},
pickerList:{
Is_environmental_completedList:[
{label: '是',value: 'Y'},
{label: '否',value: 'N'},
],
},
// 是否选择
pickerChange(e, type) {
const value = e.target.value
this.pickerIndex[type + 'Index'] = value
this.rc_enterprise_customer[type] = this.pickerList[type + 'List'][value].value
},
getLabelByValue(list, value) {
const item = list.find(item => item.value === value);
return item ? item.label : '请选择';
},
// 获取对应编码
getValueByLabel(list,value){
const item = list.find(item => item.label === value);
return item ? item.value : '';
},