fix: 优化商业公司下拉组件的选择
This commit is contained in:
parent
561c9f551b
commit
2b512d0960
@ -8,7 +8,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {defineModel, defineOptions, defineProps, getCurrentInstance, ref,onMounted} from 'vue'
|
||||
import {defineModel, defineOptions, defineProps, getCurrentInstance, nextTick, onMounted, ref, withDefaults} from 'vue'
|
||||
import {omit} from "radash";
|
||||
import {getBusinessCompanyList} from "../api/orderManager";
|
||||
|
||||
@ -18,12 +18,24 @@ defineOptions({
|
||||
})
|
||||
|
||||
const modelValue = defineModel()
|
||||
const props = defineProps([])
|
||||
// default: type = all_name
|
||||
/**
|
||||
* type:
|
||||
* all_name = 显示所有名称
|
||||
* id = value 值是 ID
|
||||
*/
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String,
|
||||
default: 'all_name'
|
||||
}
|
||||
})
|
||||
const {proxy} = getCurrentInstance()
|
||||
|
||||
const options = ref([])
|
||||
|
||||
onMounted(async () => {
|
||||
await nextTick()
|
||||
const {data} = await getBusinessCompanyList({
|
||||
isUnit: 0,
|
||||
queryParam: {
|
||||
@ -32,7 +44,7 @@ onMounted(async () => {
|
||||
})
|
||||
options.value = data.map(item => {
|
||||
return {
|
||||
value: item.businessname,
|
||||
value: props.type === 'id' ? item.userid : item.businessname,
|
||||
text: item.businessname
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user