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

<script setup>

import { ref, reactive, defineProps } from "vue"
import myTable from "./myTable.vue"
import { apiProjectCostBudgetLists } from '@/api/project_cost_budget'
import { MaterialbudgetDetailLists } from '@/api/project_material_budget_detail.ts'
import { subpackagdetailLists } from '@/api/project_subpackage_budget_detail.ts'
import { apiProjectEquipmentBudgetDetailLists } from '@/api/project_equipment_budget_detail.ts'
import { apiProjectLaborBudgetDetailLists } from '@/api/project_labor_budget_detail.ts'

const props = defineProps({
    project_id: Number
})

const baseData = reactive({
    fetchFun: apiProjectCostBudgetLists,
    tit: "费用预算",
    queryParams: { project_id: props.project_id },
    columnList: [
        { label: '一级科目', prop: 'first_level_subject' },
        { label: '差?科目', prop: 'second_level_subject' },
        { label: '单位', prop: 'unit' },
        { label: '首次预算', prop: 'unit' },
        { label: '预算调整', prop: 'num' },
        { label: '预算金额', prop: 'amount' },
        { label: '已支出', prop: 'amount' },
        { label: '剩余预算', prop: 'has_subcontract_num' },
        { label: '编制标准', prop: 'standard' },
        { label: '备注', prop: 'remark' },
    ]
})


const baseData1 = reactive({
    fetchFun: MaterialbudgetDetailLists,
    tit: "材料预算",
    queryParams: { project_id: props.project_id },
    columnList: [
        { label: '材料名称', prop: 'material_name' },
        { label: '材料编码', prop: 'material_code' },
        { label: '规格单号', prop: 'material_budget_code' },
        { label: '品牌', prop: 'material_brand' },
        { label: '参数说明', prop: 'material_parameter_description' },
        { label: '单位', prop: 'material_unit' },
        { label: '预算数量', prop: 'num' },
        { label: '单价', prop: 'price' },
        { label: '金额', prop: 'amount' },
        { label: '已申购量', prop: 'apply_num' },
        { label: '剩余数量', prop: 'residual_num' },
    ]
})


const baseData2 = reactive({
    fetchFun: subpackagdetailLists,
    tit: "分包预算",
    queryParams: { project_id: props.project_id },
    columnList: [
        { label: '工作类型', prop: 'work_type' },
        { label: '工作内容', prop: 'work_content' },
        { label: '项目特征', prop: 'project_features' },
        { label: '单位', prop: 'unit' },
        { label: '首次预算量', prop: 'num' },
        { label: '预算调正量', prop: 'price' },
        { label: '预算工作量', prop: 'amount' },
        { label: '单价', prop: 'price' },
        { label: '金额', prop: 'amount' },
        { label: '已分包量', prop: 'has_subcontract_num' },
        { label: '剩余工作量', prop: 'residue_num' },
    ]
})

const baseData3 = reactive({
    fetchFun: apiProjectEquipmentBudgetDetailLists,
    tit: "机具预算",
    queryParams: { project_id: props.project_id },
    columnList: [
        { label: '机具类别', prop: 'type' },
        { label: '机具名称', prop: 'name' },
        { label: '规格型号', prop: 'spec' },
        { label: '单位', prop: 'unit' },
        { label: '首次预算量', prop: '' },
        { label: '预算调整量', prop: '' },
        { label: '预算总量', prop: '' },
        { label: '单价', prop: 'price' },
        { label: '金额', prop: 'amount' },
        { label: '备注', prop: 'remark' },
    ]
})

const baseData4 = reactive({
    fetchFun: apiProjectLaborBudgetDetailLists,
    tit: "人工预算",
    queryParams: { project_id: props.project_id },
    columnList: [
        { label: '工种名称', prop: 'job_type_name' },
        { label: '人工说明', prop: 'desc' },
        { label: '单位', prop: 'unit' },
        { label: '首次预算量', prop: '' },
        { label: '预算调整量', prop: '' },
        { label: '预算总量', prop: '' },
        { label: '单价', prop: 'price' },
        { label: '金额', prop: 'amount' },
        { label: '备注', prop: 'remark' },
    ]
})


</script>