diff --git a/src/components/Search/src/Search.vue b/src/components/Search/src/Search.vue index 81f58b97d..1fbda34ed 100644 --- a/src/components/Search/src/Search.vue +++ b/src/components/Search/src/Search.vue @@ -273,6 +273,14 @@ const reset = async () => { emit('reset', model) } +const getSearchFormData = async () => { + await unref(elFormRef)?.validate() + const { getFormData } = methods + const model = await getFormData() + console.log(model) + return model +} + const bottonButtonStyle = computed(() => { return { textAlign: props.buttomPosition as unknown as 'left' | 'center' | 'right' @@ -293,7 +301,7 @@ const onBlur = async (field, e) => { } const Search = ref() onMounted(() => {}) -defineExpose({setFormValues,search}) // 提供 open 方法,用于打开弹窗 +defineExpose({setFormValues,search,getSearchFormData}) // 提供 open 方法,用于打开弹窗 @@ -319,6 +327,7 @@ defineExpose({setFormValues,search}) // 提供 open 方法,用于打开弹窗 > + @@ -347,7 +354,27 @@ const getMonthDay = async ()=>{ console.log('monthList',monthList.value) } } +// 询证回调 +const confirmationHandle = async ()=>{ + let searchData = await searchRef.value.getSearchFormData() + if((year.value||month.value||day.value)&&(!year.value||!month.value||!day.value)){ + message.error('请选择年月日') + return + } + if(month.value.length==1){ + month.value = '0'+month.value + } + if((''+day.value).length==1){ + day.value = '0' + day.value + } + if(year.value&&month.value&&day.value){ + // 年-月-日 `${year.value}-${month.value}-${day.value}` + } + //供应商代码 searchData.ttSupplier + + +} const searchRef = ref() // 日期 const dayList = ref([])