<template>
    <div>
        <el-table :data="pager.lists">
            <el-table-column label="订单号" prop="order_sn" show-overflow-tooltip />
            <!-- <el-table-column label="金额" prop="number" show-overflow-tooltip /> -->
            <el-table-column label="金额" prop="number">
                <template #default="{ row }">
                    <span class="text-success" v-if="row.type!='out'"> +{{ row.number }}</span>
                    <span class="text-danger" v-else> -{{ row.number }}</span>
                </template>
            </el-table-column>
            <el-table-column label="创建时间" prop="create_time" show-overflow-tooltip />
            <el-table-column label="备注" prop="title" show-overflow-tooltip />
        </el-table>
        <div class="flex mt-4 justify-end">
            <pagination v-model="pager" @change="getLists" />
        </div>
    </div>
</template>

<script lang="ts" setup name="returnMoney">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiUserFoundList } from '@/api/user'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'

const props = defineProps({
    user_id: {
        type: [Number, String],
        required: true
    }
})

// 查询条件
const queryParams = reactive({
    id: props.user_id,
    type: 4
})


// 分页相关
const { pager, getLists, resetParams, resetPage } = usePaging({
    fetchFun: apiUserFoundList,
    params: queryParams
})

const getList = (e: any) => {
    queryParams.id = e.id;
    getLists();
}

defineExpose({
    getLists,
    getList
})
</script>
