<template>
    <myTable :baseData="baseData"></myTable>
    <myTable :baseData="baseData1"></myTable>
    <myTable :baseData="baseData2"></myTable>
    <myTable :baseData="baseData3"></myTable>
</template>

<script setup>

import { ref, reactive, defineProps } from "vue"
import myTable from "./myTable.vue"
import { apifinancereceiptLists } from '@/api/receiptrecord'
import { paymentplanLists } from '@/api/paymentplan'
import { paymentapplyLists } from '@/api/paymentrequest'
import { apiFinancerefundLists } from '@/api/refundrecord'

const props = defineProps({
    project_id: Number
})

const baseData = reactive({
    fetchFun: apifinancereceiptLists,
    tit: "收票记录",
    queryParams: { project_id: props.project_id },
    columnList: [
        { label: '开票日期', prop: 'invoicing_date' },
        { label: '提交人', prop: 'commitor' },
        { label: '发票类型', prop: 'invoice_type' },
        { label: '发票编号', prop: 'invoice_no' },
        { label: '发票税率(%)', prop: 'invoice_tax_rate' },
        { label: '发票金额', prop: 'invoice_amount' },
        { label: '不含税金额', prop: 'amount_excluding_tax' },
        { label: '税额', prop: 'tax_amount' },
    ]
})

const baseData1 = reactive({
    fetchFun: paymentplanLists,
    tit: "付款计划",
    queryParams: { project_id: props.project_id },
    columnList: [
        { label: '计划付款日期', prop: 'pay_date' },
        { label: '期次', prop: 'period' },
        { label: '状态', prop: 'status' },
        { label: '金额', prop: 'amount' },
        { label: '已付款', prop: 'has_payment_amount' },
        { label: '未付款', prop: 'not_payment_amoun' },
        { label: '备注', prop: 'amount_excluding_tax' },
        { label: '税额', prop: 'remark' },
    ]
})

const baseData2 = reactive({
    fetchFun: paymentapplyLists,
    tit: "付款记录",
    queryParams: { project_id: props.project_id },
    columnList: [
        { label: '付款单号', prop: 'competitor_name' },
        { label: '合同编号', prop: 'contract_no' },
        { label: '供应商名称', prop: 'supplier_name' },
        { label: '合同类型', prop: 'contract_type' },
        { label: '期次', prop: 'period' },
        { label: '付款日期', prop: 'pay_date' },
        { label: '付款性质', prop: 'payment_natrue' },
        { label: '付款方式', prop: 'pay_type' },
        { label: '付款金额', prop: 'amount' },
    ]
})


const baseData3 = reactive({
    fetchFun: apiFinancerefundLists,
    tit: "退款记录",
    queryParams: { project_id: props.project_id },
    columnList: [
        { label: '合同编号', prop: 'contract_no' },
        { label: '合同名称', prop: 'contract_name' },
        { label: '供应商名称', prop: 'supplier_name' },
        { label: '合同类型', prop: 'contract_type' },
        { label: '期次', prop: 'period' },
        { label: '退款日期', prop: 'refund_date' },
        { label: '退款原因', prop: 'reason' },
        { label: '退款方式', prop: 'refund_type' },
        { label: '退款金额', prop: 'refund_amount' },
    ]
})
</script>