<template>
    <div>
        <el-card class="!border-none mb-4" shadow="never">
            <el-form class="mb-[-16px]" :model="queryParams" inline>

                <el-form-item label="结算日期" prop="date">
                    <el-input class="w-[280px]" v-model="queryParams.date" clearable placeholder="请输入结算日期" />
                </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 :render-header="pager.calcWidth" label="项目名称" prop="project_name"
                        show-overflow-tooltip />
                    <el-table-column :render-header="pager.calcWidth" label="业主单位" prop="project_num"
                        show-overflow-tooltip />
                    <el-table-column :render-header="pager.calcWidth" label="中标日期" prop="contract_name"
                        show-overflow-tooltip />
                    <el-table-column :render-header="pager.calcWidth" label="是否中标" prop="contract_type"
                        show-overflow-tooltip />
                    <el-table-column :render-header="pager.calcWidth" label="中标价" prop="amount" show-overflow-tooltip />
                    <el-table-column :render-header="pager.calcWidth" label="中标通知书编号" prop="part_a"
                        show-overflow-tooltip />
                    <el-table-column :render-header="pager.calcWidth" label="投标负责人" prop="part_b"
                        show-overflow-tooltip />
                    <el-table-column label="工程总投资" prop="sign_money" show-overflow-tooltip />
                    <el-table-column label="中标总监/经理" prop="sign_time" show-overflow-tooltip />
                    <el-table-column :render-header="pager.calcWidth" label="招标方式" prop="date" show-overflow-tooltip />
                    <el-table-column label="行业性质" prop="total_invoice_amount" show-overflow-tooltip />
                    <el-table-column label="项目地点" prop="total_refund_amount" show-overflow-tooltip />
                </el-table>
            </div>
            <div class="flex mt-4 justify-end">
                <pagination v-model="pager" @change="getLists" />
            </div>
        </el-card>

    </div>
</template>

<script lang="ts" setup name="zjzxSettlementLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiwinning_project, } from '@/api/marketing_bid_statistics'
// 查询条件
const queryParams = reactive({
    project_id: '',
    date: ''
})

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

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

// 获取字典数据
const { dictData } = useDictData('')

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




getLists()
</script>
