<template>
    <div>

        <el-card class="!border-none" v-loading="pager.loading" shadow="never">

            <div class="mt-4">
                <el-table :data="pager.lists" @selection-change="handleSelectionChange">
                    <el-table-column type="index" label="序号" width="55" />
                    <el-table-column label="施工汇报单号" prop="zy_code" show-overflow-tooltip />
                    <el-table-column label="作业编码" prop="zy_code" show-overflow-tooltip />
                    <el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
                    <el-table-column label="分项工程" prop="subentry_engineering" show-overflow-tooltip />
                    <el-table-column label="工序步骤" prop="process_step" show-overflow-tooltip />
                    <!-- <el-table-column label="日期" prop="sort" show-overflow-tooltip /> -->
                    <el-table-column label="姓名" prop="user_name" show-overflow-tooltip />
                    <el-table-column label="身份证号" prop="user_idcard" show-overflow-tooltip />
                    <el-table-column label="工种" prop="user_work_type" show-overflow-tooltip />
                    <el-table-column label="今日完工量" prop="work_num" show-overflow-tooltip />
                    <el-table-column label="单价" prop="price" show-overflow-tooltip />
                    <el-table-column label="金额" prop="amount" show-overflow-tooltip />
                    <el-table-column label="备注" prop="remark" show-overflow-tooltip />


                </el-table>
            </div>
            <div class="flex justify-end mt-4">
                <pagination v-model="pager" @change="getLists" />
            </div>
        </el-card>
        <edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
        <detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
    </div>
</template>

<script lang="ts" setup name="projectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { buildreportDetaillists } from '@/api/build/build_report_detail'
import { timeFormat } from '@/utils/util'
import { getAllProjectTypes } from '@/api/projecttype'
const protype = reactive([])
import feedback from '@/utils/feedback'

// 查询条件
const queryParams = reactive({
    deliver_time: '',
    start_time: '',
    declare_time: ''
})
//查询
const dateclick = (e: any) => {
    queryParams.start_time = e[0]
    queryParams.deliver_time = e[1]
}

//重置
const reset = () => {
    Object.assign(queryParams, {
        project_approval_date: '',
        start_date: '',
        delivery_date: '',
    })

    getLists()
}
// 选中数据
const selectData = ref<any[]>([])

// 表格选择后回调事件
const handleSelectionChange = (val: any[]) => {
    selectData.value = val.map(({ id }) => id)
}

// 获取字典数据
const { dictData } = useDictData('')
// 分页相关
const { pager, getLists, resetParams, resetPage } = usePaging({
    fetchFun: buildreportDetaillists,
    params: queryParams
})








getLists()
</script>

