<template>
    <el-button @click="historicalAuditClick">历史审核</el-button>

    <el-dialog v-model="dialog" title="历史记录" width="70%">

        <el-scrollbar :height="getWindowSize.h / 1.5">
            <el-timeline>
                <el-timeline-item
                        v-for="(value,key) in historicalInfo"
                        :key="key"
                        placement="top"
                        :timestamp="key">
                    <el-table :data="value">
                        <el-table-column prop="approverName" label="审核人"/>
                        <el-table-column prop="name" label="质控名称"/>
                        <el-table-column prop="scoringCriteriaName" label="评分"/>
                        <el-table-column prop="numberOfDefects" label="缺陷数"/>
                        <el-table-column prop="modifyPersonName" label="修改人"/>
                        <el-table-column prop="modificationTime" label="修改时间"/>
                        <el-table-column prop="remark" label="备注"/>
                        <el-table-column prop="remediationStatusName" label="整改"/>
                    </el-table>
                </el-timeline-item>
            </el-timeline>
        </el-scrollbar>
    </el-dialog>
</template>

<script setup name='EmrAuditDialog'>
import {getHistoricalAudit} from "@/api/zhu-yuan-yi-sheng/emr-audit";
import {getWindowSize} from "@/utils/window-size";

const props = defineProps({
    emrId: {
        type: Number,
    }
})

const dialog = ref(false)

const historicalInfo = ref({})

const historicalAuditClick = () => {
    getHistoricalAudit(props.emrId).then((res) => {
        historicalInfo.value = res
        dialog.value = true
    })
}

</script>

<style scoped lang="scss">

</style>
