|
@@ -4,8 +4,11 @@
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
<el-dropdown-item icon="el-icon-bank-card" command="sicard">社保卡</el-dropdown-item>
|
|
|
- <el-dropdown-item icon="el-icon-s-grid" command="qrcode">二维码</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-s-grid" command="qrcode">电子凭证</el-dropdown-item>
|
|
|
<el-dropdown-item icon="el-icon-user" command="idcard">身份证</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-bank-card" command="new-sicard" divided>社保卡(新)</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-s-grid" command="new-qrcode">电子凭证(新)</el-dropdown-item>
|
|
|
+ <el-dropdown-item icon="el-icon-user" command="new-idcard">身份证(新)</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
@@ -28,8 +31,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { readCardCallback } from '@/api/medical-insurance/si-inpatient'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+import axios from 'axios'
|
|
|
+import { startLoading, endLoading } from '@/utils/loading'
|
|
|
export default {
|
|
|
props: {
|
|
|
patNo: {
|
|
@@ -80,20 +84,56 @@ export default {
|
|
|
|
|
|
const executeReadCard = (cardtype) => {
|
|
|
const nowbiztype = props.biztype || currentBiztype.value
|
|
|
- const param = `${cardtype}_${props.patNo}_${nowbiztype}`
|
|
|
- window.open(`ReadCard://${param}`, '_self')
|
|
|
- readCardCallback(param).then((res) => {
|
|
|
- const result = {
|
|
|
- mdtrtCertType: cardtype,
|
|
|
- readCardResult: res.data,
|
|
|
- readCardBizType: nowbiztype,
|
|
|
+ if (cardtype.startsWith('new') !== -1) {
|
|
|
+ cardtype = cardtype.split('-')[1]
|
|
|
+ if (cardtype !== 'qrcode') {
|
|
|
+ startLoading()
|
|
|
}
|
|
|
- ctx.emit('success', result)
|
|
|
- ElMessageBox.alert(res.message, '提示', {
|
|
|
- type: 'success',
|
|
|
- showCancelButton: false,
|
|
|
- }).then(() => {})
|
|
|
- })
|
|
|
+ const param = `${cardtype}_${nowbiztype}`
|
|
|
+ axios('http://localhost:8321/readcard/entry?param=' + param)
|
|
|
+ .then((res) => {
|
|
|
+ endLoading()
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ const result = {
|
|
|
+ mdtrtCertType: cardtype,
|
|
|
+ readCardResult: cardtype === 'qrcode' ? JSON.stringify(JSON.parse(res.data.data).data) : res.data.data,
|
|
|
+ readCardBizType: nowbiztype,
|
|
|
+ }
|
|
|
+ ctx.emit('success', result)
|
|
|
+ ElMessageBox.alert(res.data.message, '提示', {
|
|
|
+ type: 'success',
|
|
|
+ showCancelButton: false,
|
|
|
+ }).then(() => {})
|
|
|
+ } else {
|
|
|
+ ElMessageBox.alert(res.data.message.trim(), '错误', {
|
|
|
+ type: 'error',
|
|
|
+ showCancelButton: false,
|
|
|
+ }).then(() => {})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ endLoading()
|
|
|
+ ElMessageBox.alert(e, '错误', {
|
|
|
+ type: 'error',
|
|
|
+ showCancelButton: false,
|
|
|
+ }).then(() => {})
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ const param = `${cardtype}_${props.patNo}_${nowbiztype}`
|
|
|
+ window.open(`ReadCard://${param}`, '_self')
|
|
|
+ readCardCallback(param).then((res) => {
|
|
|
+ const result = {
|
|
|
+ mdtrtCertType: cardtype,
|
|
|
+ readCardResult: cardtype === 'qrcode' ? JSON.stringify(res.data) : res.data,
|
|
|
+ readCardBizType: nowbiztype,
|
|
|
+ }
|
|
|
+ ctx.emit('success', result)
|
|
|
+ ElMessageBox.alert(res.message, '提示', {
|
|
|
+ type: 'success',
|
|
|
+ showCancelButton: false,
|
|
|
+ }).then(() => {})
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return {
|