<template>
    <myTable :baseData="baseData" :project="project" editPath="contract"></myTable>
    <myTable :baseData="baseData1" :project="project" editPath="contract_negotiation"></myTable>
</template>
<script setup>

import { ref, reactive, defineProps } from "vue"
import { apiContractLists } from '@/api/contract'
import { apiContractNegotiationLists } from '@/api/contract_negotiation'
import myTable from "./myTable.vue"

const props = defineProps({
    project: Object
})

const baseData = reactive({
    fetchFun: apiContractLists,
    tit: "主合同",
    queryParams: { project_id: props.project.id },
    columnList: [
        { label: '合同编号', prop: 'contract_name' },
        { label: '合同名称', prop: 'contract_code' },
        { label: '合同类型', prop: 'contract_type_text' },
        { label: '负责人', prop: 'business_director_name' },
        { label: '签约日期', prop: 'contract_date' },
        { label: '合同金额', prop: 'amount' },
        { label: '洽商金额', prop: 'negotiation_amount' },
        { label: '实际合同金额', prop: 'reality_contract_amount' },
        { label: '已回款', prop: 'returned_amount' },
        { label: '未回款', prop: 'not_returned_amount' },
        { label: '已开票', prop: 'invoicing_amount' },
        { label: '未开票', prop: 'not_invoicing_amount' },
    ]
})

const baseData1 = reactive({
    fetchFun: apiContractNegotiationLists,
    tit: "合同洽商",
    queryParams: { project_id: props.project.id },
    columnList: [
        { label: '洽商编号', prop: 'negotiation_no' },
        { label: '洽商单名称', prop: 'negotiation_name' },
        { label: '合同编号', prop: 'contract_code' },
        { label: '洽商类别', prop: 'negotiation_type' },
        { label: '签约日期', prop: 'contract_date' },
        { label: '业务负责人', prop: 'business_director' },
        { label: '洽商金额', prop: 'negotiation_amount' },
    ]
})

</script>