Files
gxtyzx-admin/src/views/think/thinkCardsBills/components/search.vue
T
2025-01-08 09:59:37 +08:00

55 lines
1.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- 搜索表单 -->
<template>
<div>
<a-space :size="10" style="flex-wrap: wrap">
<a-range-picker
allow-clear
v-model:value="dateRange"
@change="search"
value-format="YYYY-MM-DD"
class="ele-fluid"
/>
</a-space>
<p class="ele-text-danger font-bold mt-2">总金额:{{ totalAmount }}元</p>
</div>
</template>
<script lang="ts" setup>
import { ref, watch } from "vue";
import { ThinkCardsBillsParam } from "@/api/think/thinkCardsBills/model";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
totalAmount?: number;
}>(),
{}
);
const dateRange = ref<[string, string] | null>();
const emit = defineEmits<{
(e: "search", where?: ThinkCardsBillsParam): void;
(e: "add"): void;
(e: "remove"): void;
(e: "batchMove"): void;
}>();
const search = () => {
let dateStart: string = "", dateEnd: string = "";
if (dateRange.value && dateRange.value?.length > 0 && dateRange.value[0]) {
[dateStart, dateEnd] = dateRange.value;
}
emit("search", {
dateStart,
dateEnd
});
};
watch(
() => props.selection,
() => {
}
);
</script>