去掉采购单处的选择按钮、补正第一次进入采购时不显示问题

This commit is contained in:
xiaofajia 2024-11-21 11:10:35 +08:00
parent bdd4df2890
commit 30a896274a

View File

@ -39,7 +39,7 @@
<uni-card v-for="(item, index) in value" :key="index"> <uni-card v-for="(item, index) in value" :key="index">
<template> <template>
<view class="card-header"> <view class="card-header">
<radio :checked="item.isSelected" @click="chooseItem(item)"/> <radio v-if="isInput" :checked="item.isSelected" @click="chooseItem(item)"/>
<text class="card-title">{{ item.wares.name }}</text> <text class="card-title">{{ item.wares.name }}</text>
</view> </view>
</template> </template>
@ -192,10 +192,17 @@ export default {
this.getSoiId() this.getSoiId()
}, },
getUnitName(id) { getUnitName(id) {
const index = this.unitList.findIndex(item => item.value === id) if (this.unitList && this.unitList.length > 0) {
if (index !== -1) { console.log("我第一次就拿到了")
return this.unitList[index].label const index = this.unitList.findIndex(item => item.value === id)
if (index !== -1) {
return this.unitList[index].label
}else {
return "请选择"
}
} }
console.log("我是重新去拿的")
this.listUnit()
return "请选择" return "请选择"
}, },
bindUnitChange(e, row) { bindUnitChange(e, row) {