<view class="purchase-item" v-for="(item,index) in orderList" :key="index">
<picker
@change="bindPickerChange(index,$event)"
range-key="name" /*显示supplierList列表中哪个属性*/
:value="supplierList[supplierIndex].name"
:range="supplierList">
<view class="uni-input">{{item.supplier_name}}</view>
</picker>
</view>
orderList:[], //总列表
supplierList:[], //下拉列表
supplierIndex:0 //下拉下标
bindPickerChange(i,e) {
this.orderList[i].supplier_id = this.supplierList[e.detail.value].id
this.orderList[i].supplier_name = this.supplierList[e.detail.value].name
},
loadData() {
this.orderList.map(x => {
this.$set(x, 'amountBefore', 0)
this.$set(x, 'supplier_name', '请选择')
})
}