<template>
    <hc-new-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" is-new :index-style="{ width: 60 }">
            <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-new-dialog v-model="formModalShow" widths="30rem" title="开工预付款计量单新增" @save="formModalSave" @close="formModalClose">
            <el-form ref="formRef" :model="formModel" :rules="formRules" label-position="top">
                <el-form-item label="计量期：">
                    <el-select v-model="formModel.key1" disabled block>
                        <el-option label="第1期" value="1" />
                        <el-option label="第2期" value="2" />
                    </el-select>
                </el-form-item>
                <el-form-item label="报表名称：">
                    <el-input v-model="formModel.key2" />
                </el-form-item>
                <el-form-item label="报表期：">
                    <el-input v-model="formModel.key3" disabled />
                </el-form-item>
                <el-form-item label="打印日期：">
                    <el-date-picker v-model="formModel.key4" class="block" format="YYYY-MM-DD" type="date" value-format="YYYY-MM-DD" disabled />
                </el-form-item>
            </el-form>
        </hc-new-dialog>
    </hc-new-card>
</template>

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

defineOptions({
    name: 'PeriodsStartWorkBook',
})

//渲染完成
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 formRef = ref(null)
const formModel = ref({})
const formRules = []


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

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

<style scoped lang="scss">

</style>
