<template>
    <hc-card title="材料预付款报表手册">
        <template #extra>
            <el-button hc-btn type="primary" @click="addModalClick">
                <HcIcon name="add" />
                <span>新增</span>
            </el-button>
        </template>
        <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading">
            <template #action="{ row }">
                <el-link type="primary">查看报表</el-link>
                <el-link type="success">修改</el-link>
                <el-link type="danger">删除</el-link>
                <el-link>重新计算</el-link>
            </template>
        </hc-table>
        <template #action>
            <hc-pages :pages="searchForm" @change="pageChange" />
        </template>
        <!-- 新增/修改 -->
        <hc-dialog v-model="formModalShow" is-to-body widths="30rem" title="材料计量单新增" @save="formModalSave" @close="formModalClose">
            1111
        </hc-dialog>
    </hc-card>
</template>

<script setup>
import { onMounted, ref } from 'vue'
defineOptions({
    name: 'DebitPayMaterialBook',
})

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

})

//搜索表单
const searchForm = ref({
    current: 1, size: 10, total: 0,
})

//分页
const pageChange = ({ current, size }) => {
    searchForm.value.current = current
    searchForm.value.size = size
}

//表格数据
const tableLoading = ref(false)
const tableColumn = ref([
    { key: 'key1', name: '计量期' },
    { key: 'key2', name: '报表名称' },
    { key: 'key3', name: '打印日期' },
    { key: 'key4', name: '重新计算时间' },
    { key: 'action', name: '操作', width: 230 },
])
const tableData = ref([
    { key1: '1111' },
])

//新增
const formModalShow = ref(false)
const addModalClick = () => {
    formModalShow.value = true
}

const formModalSave = () => {
    formModalClose()
}

const formModalClose = () => {
    formModalShow.value = false
}
</script>

<style scoped lang="scss">

</style>
