<template>
    <div>
        <el-card class="!border-none" v-loading="pager.loading" shadow="never">
            <el-form class="mb-[-16px]" inline>
                <el-form-item label="合同编码" prop="contract_code">
                    <el-input class="w-[280px]" v-model="queryParams.contract_code" 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>
            <div class="mt-4">
                <el-table :data="pager.lists" :default-sort="{ prop: 'create_time', order: 'descending' }">
                    <el-table-column label="合同编号" :width="250" prop="contract_code" show-overflow-tooltip />
                    <el-table-column label="合同名称" prop="contract_name" show-overflow-tooltip />
                    <el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
                    <el-table-column label="项目编号" prop="project_code" align="center" show-overflow-tooltip />
                    <el-table-column label="客户名称" prop="custom_name" align="center" show-overflow-tooltip />
                    <el-table-column label="签订日期" prop="contract_date" align="center" show-overflow-tooltip />
                    <el-table-column label="合同金额" prop="contract_amount" align="center" show-overflow-tooltip />
                    <el-table-column label="已回款金额" prop="has_refund_amount" align="center" show-overflow-tooltip />
                    <el-table-column label="已开票金额" prop="has_invoice_amount" align="center" show-overflow-tooltip />
                    <el-table-column label="开票未回款金额" prop="has_invoice_not_refund_amount" align="center"
                        show-overflow-tooltip />
                    <el-table-column label="回款未开票金额" prop="has_refund_not_invoice_amount" align="center"
                        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  setup name="flowTypeLists">
import { reactive } from "vue";
import { usePaging } from "@/hooks/usePaging";
import { finance_refund_invoice_difference } from "@/api/contract_ticket_difference";

// 查询条件
const queryParams = reactive({
    contract_code: "",
});
// 分页相关
const { pager, getLists, resetParams, resetPage } = usePaging({
    fetchFun: finance_refund_invoice_difference,
    params: queryParams,
});

getLists()
</script>
