eight
2024-10-31 812ffe6f989303514b45f8106f09ff902bbe0d8a
src/views/ecg/appointment/AppointmentConfirm.vue
@@ -24,7 +24,7 @@
          <el-radio
            v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_USER_SEX)"
            :key="dict.value"
            :label="dict.value"
            :value="dict.value"
          >
            {{ dict.label }}
          </el-radio>
@@ -120,12 +120,7 @@
const message = useMessage() // 消息弹窗
const loading = ref(true) // 列表的加载中
const list = ref<AppointmentVO[]>([]) // 列表的数据
const total = ref(0) // 列表的总页数
const queryParams = reactive({
    pageNo: 1,
    pageSize: 10,
    patId: undefined
})
@@ -154,27 +149,22 @@
const searchBookInfo = async () => {
  resetForm()
  total.value = 0
  list.value = []
  await getList()
  if (total.value === 1) {
    formData.value = list.value[0]
  if (null === queryParams.patId || "" === queryParams.patId)
    return
  const data = await AppointmentApi.queryAndCreateAppointmentByPatId(queryParams.patId) // 对应数据库中 pat_id
  console.info( data )
  if (null !== data) {
    formData.value = data
    return
  }
  message.notify("请先预约!")
}
/** 查询列表 */
const getList = async () => {
    loading.value = true
    try {
        const data = await AppointmentApi.getAppointmentPage(queryParams)
        list.value = data.list
        total.value = data.total
    } finally {
        loading.value = false
    }
  ElNotification({
    title: '温馨提示',
    message: "请先预约",
    type: 'warning'
  })
}
const _confirmAppointment = async () => {