diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/clientSelect.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/clientSelect.vue index 15ddd2ce..648e194f 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/clientSelect.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/clientSelect.vue @@ -44,7 +44,6 @@ onMounted(async () => { } try { const data = await CustomerApi.getCustomerPage(clientParams) - console.log(data.list) clientList.value = data.list // 设置初始值,如果需要的话 remoteMethod('') diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/compositionSelect.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/compositionSelect.vue index ed1dec82..1a273706 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/compositionSelect.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/compositionSelect.vue @@ -12,7 +12,12 @@ :loading="Loading" @change="onSelectChange" > - + @@ -20,6 +25,8 @@ import { ref, onMounted, toRefs } from 'vue' import * as CompositionApi from '@/api/heli/composition' const valueName: any = ref() //选中的值 +const valueNameObject: any = ref() //选中的值 +const emit = defineEmits(['update:newValue']) const compositionList = ref([]) // 用户列表 const compositionSelectList = ref([]) const Loading = ref(false) @@ -35,7 +42,6 @@ onMounted(async () => { } try { const data = await CompositionApi.getCompositionPage(queryParams) - console.log(data.list) compositionList.value = data.list // 设置初始值,如果需要的话 remoteMethod('') @@ -57,5 +63,8 @@ const remoteMethod = (query: any) => { compositionSelectList.value = compositionList.value.slice(0, 10) } } - +const onSelectChange = (newValue: any) => { + valueNameObject.value = compositionList.value.find( composition => composition.id === newValue); // 更新选中的完整用户对象 + emit('update:newValue', valueNameObject.value) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/indexFrom.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/indexFrom.vue index 87281963..9973bda9 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/indexFrom.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/indexFrom.vue @@ -23,13 +23,13 @@ - + - + - + @@ -20,6 +20,8 @@ import { ref, onMounted, toRefs } from 'vue' import * as MaterialApi from '@/api/heli/material' const valueName: any = ref() //选中的值 +const valueNameObject: any = ref() //选中的值 +const emit = defineEmits(['update:newValue']) const materialList = ref([]) // 用户列表 const materialSelectList = ref([]) const Loading = ref(false) @@ -35,7 +37,6 @@ onMounted(async () => { } try { const data = await MaterialApi.getMaterialPage(queryParams) - console.log(data.list) materialList.value = data.list // 设置初始值,如果需要的话 remoteMethod('') @@ -50,7 +51,11 @@ const remoteMethod = (query: any) => { setTimeout(() => { Loading.value = false materialSelectList.value = materialList.value - .filter((item) => item.name.toLowerCase().includes(query.toLowerCase())) + .filter( + (item) => + item.code.toLowerCase().includes(query.toLowerCase()) || + item.name.toLowerCase().includes(query.toLowerCase()) + ) .slice(0, 10) //只显示前10个 }, 200) } else { @@ -58,4 +63,8 @@ const remoteMethod = (query: any) => { } } +const onSelectChange = (newValue: any) => { + valueNameObject.value = materialList.value.find( material => material.id === newValue); // 更新选中的完整用户对象 + emit('update:newValue', valueNameObject.value) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/supplierSelect.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/supplierSelect.vue index 0b660b10..f7101737 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/supplierSelect.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/hlvuestyle/supplierSelect.vue @@ -12,7 +12,7 @@ :loading="Loading" @change="onSelectChange" > - + @@ -21,6 +21,9 @@ import { ref, onMounted, toRefs } from 'vue' import * as SupplierApi from '@/api/heli/supplier' const valueName: any = ref() //选中的值 +const valueNameObject: any = ref() //选中的值 +const emit = defineEmits(['update:newValue']) + const supplierList = ref([]) // 用户列表 const supplierSelectList = ref([]) const Loading = ref(false) @@ -36,7 +39,6 @@ onMounted(async () => { } try { const data = await SupplierApi.getSupplierPage(queryParams) - console.log(data.list) supplierList.value = data.list // 设置初始值,如果需要的话 remoteMethod('') @@ -51,7 +53,11 @@ const remoteMethod = (query: any) => { setTimeout(() => { Loading.value = false supplierSelectList.value = supplierList.value - .filter((item) => item.name.toLowerCase().includes(query.toLowerCase())) + .filter( + (item) => + item.code.toLowerCase().includes(query.toLowerCase()) || + item.name.toLowerCase().includes(query.toLowerCase()) + ) .slice(0, 10) //只显示前10个 }, 200) } else { @@ -59,9 +65,8 @@ const remoteMethod = (query: any) => { } } -// const onSelectChange = (newValue: number | null) => { -// // console.log(newValue) -// emit('update:valueName', newValue) -// valueName.value = newValue -// } +const onSelectChange = (newValue: any) => { + valueNameObject.value = supplierList.value.find(supplier => supplier.id === newValue); // 更新选中的完整用户对象 + emit('update:newValue', valueNameObject.value) +}