<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_no">
                    <el-input class="w-[280px]" v-model="queryParams.contract_no" 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="合同编号" prop="contract_no" show-overflow-tooltip />
                    <el-table-column label="供应商编号" :width="250" prop="supplier_code" show-overflow-tooltip />
                    <el-table-column label="供应商名称" prop="supplier_name" show-overflow-tooltip />
                    <el-table-column label="项目名称" prop="project_name" align="center" show-overflow-tooltip />
                    <el-table-column label="项目编号" prop="project_code" align="center" show-overflow-tooltip />
                    <el-table-column label="签订日期" prop="signing_date" align="center" show-overflow-tooltip />
                    <el-table-column label="合同金额" prop="contract_amount" align="center" show-overflow-tooltip />
                    <el-table-column label="已付款金额" prop="has_payment_amount" align="center" show-overflow-tooltip />
                    <el-table-column label="已收票金额" prop="has_receipt_amount" align="center" show-overflow-tooltip />
                    <el-table-column label="已收票未付款金额" prop="has_receipt_not_payment_amount" align="center"
                        show-overflow-tooltip />
                    <el-table-column label="已付款未收票金额" prop="has_payment_not_receipt_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_payment_receipt_difference } from "@/api/contract_ticket_difference";

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

getLists()
</script>
