feat(components): 添加生产单位选择组件
This commit is contained in:
parent
a7c3eae535
commit
fe91d1913d
39
components/ProductionUnit/ProductionUnit.vue
Normal file
39
components/ProductionUnit/ProductionUnit.vue
Normal file
@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<uni-data-select
|
||||
v-model="modelValue"
|
||||
:localdata="options"
|
||||
placeholder="请选择货主"
|
||||
v-bind="omit($attrs,['change'])"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {defineModel, defineOptions, defineProps, getCurrentInstance, onMounted, ref} from 'vue'
|
||||
import {omit} from "radash";
|
||||
import UniDataSelect from "../../uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue";
|
||||
import {listproductList} from "../../api/orderManager";
|
||||
|
||||
defineOptions({
|
||||
name: "ProductionUnit"
|
||||
})
|
||||
|
||||
const modelValue = defineModel()
|
||||
const props = defineProps([])
|
||||
const {proxy} = getCurrentInstance()
|
||||
|
||||
const options = ref([])
|
||||
|
||||
onMounted(async () => {
|
||||
const {data} = await listproductList()
|
||||
options.value = data.map(item => {
|
||||
return {
|
||||
value: item.deptId,
|
||||
text: item.deptName
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user