<template>
    <hc-new-card>
        <template #header>
            <hc-new-switch :datas="tabTab" :keys="tabKey" :round="false" size="default" @change="tabChange" />
            <div v-if="tabKey === 'key2'" class="ml-3 w-40">
                <el-select v-model="searchForm.key1" filterable block placeholder="选择工区">
                    <el-option label="工区1" value="1" />
                    <el-option label="工区2" value="2" />
                    <el-option label="工区3" value="3" />
                </el-select>
            </div>
            <div class="ml-3 w-40">
                <el-date-picker v-model="searchForm.key2" placeholder="截止日期" class="block" format="YYYY-MM-DD" type="date" value-format="YYYY-MM-DD" />
            </div>
        </template>
        <template #extra>
            <el-button hc-btn type="primary">
                <HcIcon name="download-2" />
                <span>导出</span>
            </el-button>
        </template>
        <div class="hc-table-ref-box no-border">
            <el-table class="w-full" :data="tableData" row-key="id" height="100%" border>
                <el-table-column type="index" label="序号" width="60" />
                <el-table-column prop="key1" label="合同段号" />
                <el-table-column prop="key2" label="变更申请资料编号" />
                <el-table-column prop="key3" label="变更令号" />
                <el-table-column prop="key4" label="变更内容(简述)" />
                <el-table-column label="变更增减金额" align="center">
                    <el-table-column prop="key5" label="章节" />
                    <el-table-column prop="key6" label="变更金额" />
                    <el-table-column prop="key7" label="小计" />
                </el-table-column>
                <el-table-column prop="key8" label="变更归类" />
                <el-table-column label="变更手续办理" align="center">
                    <el-table-column prop="key9" label="施工单位申报情况" />
                    <el-table-column prop="key10" label="承包商意见" />
                    <el-table-column prop="key11" label="监理意见" />
                    <el-table-column prop="key12" label="业主意见" />
                </el-table-column>
                <el-table-column prop="key13" label="变更类别" />
                <el-table-column prop="key14" label="备注" />
            </el-table>
        </div>
    </hc-new-card>
</template>

<script setup>
import { onMounted, ref } from 'vue'

defineOptions({
    name: 'AlterLedgersTable',
})

//渲染完成
onMounted(() => {

})

//类型tab数据和相关处理
const tabKey = ref('key1')
const tabTab = ref([
    { key: 'key1', name: '普通变更' },
    { key: 'key2', name: '工区变更' },
])

const tabChange = (item) => {
    tabKey.value = item?.key
    console.log(item)
}

const searchForm = ref({})

const tableData = ref([
    { key1: '1111' },
])
</script>
