<template>
  <xc-dialog-v2 v-model="dialog" title="病历质控" width="80%" maximize>
    <el-tabs>
      <el-tab-pane label="时间质控">
        <RuleSift :data="patientList" default-expand-all/>
      </el-tab-pane>

      <el-tab-pane label="质控建议">
        <div v-for="(value,key) in suggestion">
          <div>
            {{ key }}
          </div>
          <el-table :data="value">
            <el-table-column prop="name" label="项目" width="180"/>
            <el-table-column prop="scoringCriteriaName" label="等级" width="40"/>
            <el-table-column prop="remark" label="备注" show-overflow-tooltip/>
            <el-table-column prop="numberOfDefects" label="缺陷数"/>
          </el-table>
        </div>
      </el-tab-pane>
    </el-tabs>
  </xc-dialog-v2>
</template>

<script setup name='EmrControlRuleDialog'>
import XcDialogV2 from "@/components/xiao-chan/dialog/XcDialogV2.vue";
import {myPatientQualityControl} from "@/api/zhu-yuan-yi-sheng/emr-control-rule";
import RuleSift
  from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr_control_rule/RuleSift.vue";
import {isDev} from "@/utils/public";


const patientList = ref([])
const suggestion = ref({})

const dialog = ref(false)

onMounted(() => {

  myPatientQualityControl().then((res) => {

    patientList.value = res.timeQualityControl.details
    suggestion.value = res.emrSuggestion

    if (patientList.value.length > 0) {
      dialog.value = true
    }

  });

})


</script>

<style scoped lang="scss">

</style>
