<template>
    <div>
        <el-card class="!border-none mb-4" shadow="never">
            <el-form class="mb-[-16px]" :model="queryParams" inline>
                <el-form-item label="所属项目" prop="project_id">
                    <selectRemote :formData="queryParams" model="project_id" :api="apiProjectSearch" />
                </el-form-item>
                <!-- <el-form-item label="标书编号" prop="bid_document_no">
                    <el-input class="w-[250px]" v-model="queryParams.bid_document_no" clearable placeholder="请输入标书编号" />
                </el-form-item>
                <el-form-item label="审查编号" prop="code">
                    <el-input class="w-[250px]" v-model="queryParams.code" clearable placeholder="请输入审查编号" />
                </el-form-item>
                <el-form-item label="是否需要保证金" prop="is_need_deposit">
                    <el-select v-model="queryParams.is_need_deposit" clearable placeholder="请选择是否需要保证金">
                        <el-option v-for="(item, index) in dictData.whether_status" :key="index" :label="item.name"
                            :value="parseInt(item.value)" />
                    </el-select>
                </el-form-item> -->
                <el-form-item>
                    <el-button type="primary" @click="resetPage">查询</el-button>
                    <el-button @click="resetParams">重置</el-button>
                </el-form-item>
            </el-form>
        </el-card>
        <el-card class="!border-none" v-loading="pager.loading" shadow="never">
            <div class="mt-4">
                <el-table border :data="pager.lists" @selection-change="handleSelectionChange">
                    <el-table-column type="selection" width="55" />
                    <el-table-column label="序号" type="index" width="55" />
                    <el-table-column label="项目名称" prop="project_name" />
                    <el-table-column label="投标保证金" prop="bid_margin" />
                    <el-table-column label="建设单位" prop="construct_company" />
                    <el-table-column label="缴纳截止日期" prop="margin_end_date" show-overflow-tooltip />
                    <el-table-column label="预计归还日期" prop="expected_return_date" show-overflow-tooltip />
                    <el-table-column label="申请状态" prop="apply_status" show-overflow-tooltip />
                    <el-table-column label="支付状态" prop="payment_status" show-overflow-tooltip />
                    <el-table-column label="回收状态" prop="recovery_status" show-overflow-tooltip />
                </el-table>
            </div>
            <div class="flex justify-end mt-4">
                <pagination v-model="pager" @change="getLists" />
            </div>
        </el-card>

    </div>
</template>

<script lang="ts" setup name="bidDocumentExaminationLists">
import { usePaging } from '@/hooks/usePaging'
import { apibid_margin_list } from '@/api/financial_bid_statistics'
import feedback from '@/utils/feedback'




// 查询条件
const queryParams = reactive({
    bid_document_no: '',
    code: '',
    is_need_deposit: ''
})

// 选中数据
const selectData = ref<any[]>([])

// 表格选择后回调事件
const handleSelectionChange = (val: any[]) => {
    selectData.value = val.map(({ id }) => id)
}


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







getLists()
</script>
