import { ElMessageBox } from 'element-plus'
import { readCardCallback } from '../api/medical-insurance/si-inpatient'

export function prepareReadCard(type, inpatientNo, bizType) {
  const param = type + '_' + inpatientNo + '_' + bizType
  startReadCard(param)
}

const startReadCard = (param) => {
  window.open('ReadCard://' + param, '_self')
  readCardCallback(param).then((res) => {
    ElMessageBox.alert(res.message, '提示', {
      type: 'success',
      showCancelButton: false,
    }).then(() => {})
  })
}
