<template>
  <el-dialog :model-value="visible" :width="width" title="医保审核提示" @close="close()">
    <el-scrollbar v-if="visible" wrap-class="el-dialog-body-full-scroll">
      <div class="px-15px py-12px">
        <div class="text-16px">
          当前处方存在以下问题，请确认:
        </div>
        <div v-for="(item, idx) in advices" :key="idx"
          class="mt-12px p-12px rounded bg-gray-100 text-15px text-dark-500 ">
          <div class="text-16px font-bold text-dark-500 leading-24px">{{ idx + 1 }}、{{ item.name }}</div>
          <div class="mt-4px text-15px text-dark-500 leading-24px">{{ item.text }}</div>
        </div>
      </div>
    </el-scrollbar>
    <template #footer>
      <div text-center>
        <el-button size="large" plain class="w-140px" type="primary" @click="close()">返回修改</el-button>
        <el-button size="large" class="w-140px" type="primary" @click="confirm()">忽略并继续提交</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
import { computed, ref, watch } from 'vue';
import dayjs from 'dayjs'

const emits = defineEmits(['close', 'confirm'])
const props = defineProps({
  width: {
    type: Number,
    default: 640
  },
  advices: {
    type: Array,
    default: () => []
  },
  visible: {
    type: Boolean,
    default: false
  }
})


function close() {
  emits('close')
}

function confirm() {
  close()
  emits('confirm')
}
</script>
