<template>
    <el-dialog v-model="props.dialogTjjltab" :title="'体检记录表'" :close-on-click-modal="false" width="850px"
        :before-close="handleClose">
        <el-table ref="multipleTableRef" stripe :data="tjjlList" style="width: 100%" border>
            <el-table-column label="体检名称" prop="title" />
            <el-table-column label="体检类型" prop="type">
                <template #default="{ row }">
                    <dict-tag :options="D_BZ_ZYJKTJLB" :value="row.type" :tag="false" />
                </template>
            </el-table-column>
            <el-table-column label="发起单位" prop="ssdwmc" />
            <el-table-column label="体检时间" prop="addtime" />

            <!-- <el-table-column label="操作" width="250">
                <template #default="scope">
                    <span class="operate" style="color: yellowgreen" @click="onloadflie(scope.row)">详情</span>
                </template>
            </el-table-column> -->
        </el-table>
        <div class="fenye">
            <MOSTY.Pages :pageConfiger="params" @changeNo="changeNo" @changeSize="changeSize">
            </MOSTY.Pages>
        </div>
        <template #footer>
            <span class="dialog-footer">
                <el-button @click="handleClose"> <el-icon>
                        <DocumentDelete />
                    </el-icon>
                    <span>关闭</span></el-button>
            </span>
        </template>
    </el-dialog>

</template>

<script setup>
import {
    reactive,
    ref,
    getCurrentInstance,
    onMounted
} from "vue";
import { ElMessage } from "element-plus";
import { getApi, deleteApi, putApi, postApi } from "@/api/tobAcco_api.js";
const { proxy } = getCurrentInstance();
const { D_BZ_ZYJKTJLB } = proxy.$dict(
    "D_BZ_ZYJKTJLB"
);
const params = ref({
    pageSize: 5,
    pageCurrent: 1,
    total: 0,
    userId: ''
})
const props = defineProps({
    title: String,
    dialogTjjltab: Boolean,
    userId: String,

});
const tjjlList = ref([])
const emits = defineEmits(["changeclosetj"]);

onMounted(() => {
    params.value.userId = props.userId
    gtdataxq()

})

//获取详情
function gtdataxq() {
    getApi(params.value, `/mosty-jcgl/health/getRecordsByUserId`).then(
        (res) => {
            if (res.records) {
                tjjlList.value = res.records;
            }
            params.value.total = res.total

        }
    );
}
//分页
const changeNo = (val) => {
    params.value.pageCurrent = val;
    gtdataxq();
};
const changeSize = (val) => {
    params.value.pageSize = val;
    gtdataxq();
};

const handleClose = () => {
    emits("changeclosetj", false);
};
</script>

<style lang="scss" scoped>
::-webkit-scrollbar {
    width: 0 !important;
    height: 0;
}



.fromBox {
    width: 552px;
    margin: 20px auto;
    padding: 15px 15px 0 15px;
    border-radius: 1px;
}

.ld_box {
    display: flex;
    margin-right: 20px;
}

.el-form {
    width: 100%;
    align-items: center;
    display: flex;
    justify-content: start;
    flex-wrap: wrap;
}

.el-form-item {
    display: flex;
    margin-right: 20px;
}

.addbtn {
    margin-bottom: 10px;
}



.tabbox {
    max-height: 300px;
    overflow-y: scroll;

    .input {
        width: 100%;
        height: 100%;
    }
}

::v-deep .el-table .cell {
    padding: 0 0 !important;
}

::v-deep .el-table--border .el-table__cell .cell {
    padding-left: 0px !important;

    >input {
        width: 100%;
        height: 33px;
    }
}

::v-deep .el-upload-list {
    width: 50%;
}
</style>