mps-platform/cds-fontend-2025.V1/src/views/mps/batch/modules/batch-search.vue

79 lines
2.5 KiB
Vue
Raw Normal View History

<script setup lang="ts">
import { ref } from 'vue';
import { useNaiveForm } from '@/hooks/common/form';
import { $t } from '@/locales';
import { useDict } from '@/hooks/business/dict';
defineOptions({
name: 'BatchSearch'
});
interface Emits {
(e: 'reset'): void;
(e: 'search'): void;
}
const emit = defineEmits<Emits>();
const { formRef, validate, restoreValidation } = useNaiveForm();
const model = defineModel<Api.Mps.BatchSearchParams>('model', { required: true });
const { options: preBatchStatusOptions } = useDict('pre_batch_status');
const { options: afterBatchStatusOptions } = useDict('after_batch_status');
const { options: mpsCheckStatusOptions } = useDict('mps_check_status');
async function reset() {
Object.assign(model.value.params!, {});
await restoreValidation();
emit('reset');
}
async function search() {
await validate();
emit('search');
}
</script>
<template>
<NCard :bordered="false" size="small" class="card-wrapper">
<NCollapse>
<NCollapseItem :title="$t('common.search')" name="user-search">
<NForm ref="formRef" :model="model" label-placement="left" :label-width="80">
<NGrid responsive="screen" item-responsive>
<NFormItemGi span="24 s:12 m:6" label="批次月份" path="batchMonth" class="pr-24px">
<NDatePicker
v-model:formatted-value="model.batchMonth"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
clearable
/>
</NFormItemGi>
<NFormItemGi span="24 s:12 m:6" label="核对备注" path="checkRemark" class="pr-24px">
<NInput v-model:value="model.checkRemark" placeholder="请输入核对备注" />
</NFormItemGi>
<NFormItemGi span="24" class="pr-24px">
<NSpace class="w-full" justify="end">
<NButton @click="reset">
<template #icon>
<icon-ic-round-refresh class="text-icon" />
</template>
{{ $t('common.reset') }}
</NButton>
<NButton type="primary" ghost @click="search">
<template #icon>
<icon-ic-round-search class="text-icon" />
</template>
{{ $t('common.search') }}
</NButton>
</NSpace>
</NFormItemGi>
</NGrid>
</NForm>
</NCollapseItem>
</NCollapse>
</NCard>
</template>
<style scoped></style>