Revert "```"

This reverts commit abc0674531.
This commit is contained in:
2025-12-26 22:21:21 +08:00
parent ae6c486114
commit 3115e38cc4
920 changed files with 14452 additions and 107025 deletions

View File

@@ -11,7 +11,7 @@
{{ isEditing ? '取消' : '编辑' }}
</div> -->
<div>
<el-radio-group v-model="typeCode" :disabled="props.isRegistered">
<el-radio-group v-model="typeCode">
<el-radio label="电子凭证" value="01"></el-radio>
<el-radio label="医保卡" value="03"></el-radio>
<el-radio label="身份证" value="02"></el-radio>
@@ -19,7 +19,6 @@
<span
@click="handleReadCard(typeCode)"
style="cursor: pointer; margin: 0 12px 0 30px; color: #409eff"
v-if="!props.isRegistered"
>
{{ '读卡' }}
</span>
@@ -39,22 +38,16 @@
<el-text truncated>患者姓名</el-text>
</el-col>
<el-col :span="4" class="patInfo-value">
<el-text truncated>{{ patientInfo?.patientName || '-' }}</el-text>
<el-text truncated>{{ patientInfo?.name || '-' }}</el-text>
</el-col>
<!-- <el-col :span="2" class="patInfo-label">
<el-col :span="2" class="patInfo-label">
<el-text truncated>费别类型</el-text>
</el-col>
<el-col :span="4" class="patInfo-value">
<el-text truncated>{{ patientInfo?.ybClassEnum_enumText || '-' }}</el-text> -->
<!-- TODO -->
<!-- <svg-icon
size="20"
icon-class="hipEdit"
style="cursor: pointer"
@click="changFeeType"
v-if="!props.isRegistered"
/>
</el-col> -->
<el-text truncated>{{ patientInfo?.ybClassEnum_enumText || '-' }}</el-text>
<!-- TODO -->
<svg-icon size="20" icon-class="hipEdit" style="cursor: pointer" @click="changFeeType" />
</el-col>
</el-row>
<el-row class="patientInfos">
<el-col :span="2" class="patInfo-label">
@@ -80,7 +73,7 @@
<el-text truncated>年龄</el-text>
</el-col>
<el-col :span="4" class="patInfo-value">
<el-text truncated>{{ patientInfo?.age || '-' }}</el-text>
<el-text truncated>{{ patientInfo?.ageString || '-' }}</el-text>
</el-col>
</el-row>
<el-row class="patientInfos">
@@ -94,7 +87,7 @@
<el-text truncated>民族</el-text>
</el-col>
<el-col :span="4" class="patInfo-value">
<div>{{ getDictLabel(nationality_code, patientInfo?.nationalityCode) || '-' }}</div>
<div>{{ patientInfo?.nationalityCode || '-' }}</div>
</el-col>
<el-col :span="2" class="patInfo-label">
<el-text truncated>国籍</el-text>
@@ -146,7 +139,7 @@
<el-text truncated>病人来源</el-text>
</el-col>
<el-col :span="4" class="patInfo-value">
<div>{{ props.inHospitalInfo?.inHospitalOrgName || '-' }}</div>
<div>{{ patientInfo?.organizationId_dictText || '-' }}</div>
</el-col>
<el-col :span="2" class="patInfo-label">
<el-text truncated>单位名称</el-text>
@@ -157,37 +150,24 @@
</el-row>
</div>
<div v-else>
<PatientInfoForm ref="patientInfoFormRef" :is-view-mode="props.isRegistered" />
<PatientInfoForm ref="patientInfoFormRef" />
</div>
</div>
</template>
<script setup>
import { ref, reactive, watch, onMounted } from 'vue';
import { ref, reactive, watch } from 'vue';
import PatientInfoForm from './patientInfoForm.vue';
import { patientlLists, getOrgList, gerPreInfo } from './api';
import { invokeYbPlugin5001 } from '@/api/public';
import useUserStore from '@/store/modules/user';
import { useRouter } from 'vue-router';
import { patientlLists, getOrgList } from './api';
const { proxy } = getCurrentInstance();
const typeList = ref({});
const patientInfoFormRef = ref();
let userCardInfo = ref({});
const BusiCardInfo = ref('');
const userStore = useUserStore();
const router = useRouter();
const props = defineProps({
patientInfo: {
type: Object,
require: true,
default: () => ({}),
},
inHospitalInfo: {
type: Object,
default: () => ({}),
},
registrationType: {
type: [String, Boolean, Number], // 根据实际类型调整
default: null, // 或者 false、'' 等
@@ -201,25 +181,11 @@ const props = defineProps({
type: Boolean,
default: false,
},
//待入院,已入院区分
isRegistered: {
type: Boolean,
default: false,
},
inHospitalInfo: {
type: Object,
default: () => ({}),
required: false,
},
});
const emits = defineEmits(['onChangFeeType', 'carReading']);
const emits = defineEmits(['onChangFeeType']);
const registerRef = ref();
const typeCode = ref('01');
const organization = ref([]);
const { nationality_code } = proxy.useDict('nationality_code');
const readCardLoading = ref(false);
const loadingText = ref('正在读取...');
onMounted(() => {
getInitOptions();
@@ -276,185 +242,136 @@ const submitForm = async (callback) => {
}
});
};
const getDictLabel = (dictList, value) => {
if (!dictList || !value) return '';
const item = dictList.find((item) => item.value === value);
return item ? item.label : value;
};
async function handleReadCard(value) {
try {
// await CefSharp.BindObjectAsync('boundAsync');
// string url,
// string fixmedins_code,
// string businessType,
// string operatorCode,
// string operatorName,
// string officeId,
// string officeName
if (window.CefSharp === undefined) {
alert('请在医保版本中调用读卡功能!');
} else {
try {
await CefSharp.BindObjectAsync('boundAsync');
// string url,
// string fixmedins_code,
// string businessType,
// string operatorCode,
// string operatorName,
// string officeId,
// string officeName
// readCardLoading.value = true;
// let jsonResult = null;
let jsonResult;
let cardInfo;
let userMessage = undefined;
// 调试日志检查patientInfo中的值
console.log('patientInfo:', props.patientInfo);
console.log('patientInfo中的id:', props.patientInfo?.id);
console.log('patientInfo中的encounterId:', props.patientInfo?.encounterId);
switch (value) {
case '01': // 电子凭证
// readCardLoading.value = true;
// await boundAsync
// .getInfoByQrCodeAsync(
// )
await invokeYbPlugin5001({
FunctionId: 3,
url: 'http://10.47.0.67:8089/localcfc/api/hsecfc/localQrCodeQuery',
orgId: 'H22010200672',
businessType: '01101',
operatorId: userStore.id.toString(),
operatorName: userStore.name,
officeId: 'D83',
officeName: '财务科',
})
// readCardLoading.value = true;
let jsonResult;
let cardInfo;
let userMessage = undefined;
switch (value) {
case '01': // 电子凭证
// readCardLoading.value = true;
await boundAsync
.getInfoByQrCodeAsync(
'http://10.47.0.67:8089/localcfc/api/hsecfc/localQrCodeQuery',
'H22010200672',
'01101',
userStore.id,
userStore.name,
'D83',
'财务科'
)
.then((res) => {
readCardLoading.value = true;
loadingText.value = '正在读取...';
jsonResult = res;
})
.catch(() => {
readCardLoading.value = false;
});
cardInfo = JSON.parse(jsonResult);
let message = JSON.parse(cardInfo.message);
userMessage = {
certType: '02', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '02', // 居民身份证
};
break;
case '02':
break;
case '03': // 社保卡
readCardLoading.value = true;
loadingText.value = '正在读取...';
await boundAsync
.readHeaSecCardAsync(
JSON.stringify({
IP: 'ddjk.jlhs.gov.cn',
PORT: 20215,
TIMEOUT: 60,
SFZ_DRIVER_TYPE: 1,
})
)
.then((res) => {
jsonResult = res;
})
.finally(() => {
readCardLoading.value = false;
});
// console.log(
// 'jsonResult',
// JSON.parse({
// IssuingAreaCode: '310000',
// SocialSecurityNumber: '371324198810224515',
// CardNumber: 'M501A1A78',
// CardIdentificationCode: '310000D15600000535925154E880AB97',
// Name: '\u5218\u5CF0',
// CardResetInfo: '00814A444686603100333E4FA9',
// SpecificationVersion: '3.00',
// IssuingDate: '20190313',
// ExpirationDate: '20290313',
// TerminalNumber: '000000000000',
// TerminalDeviceNumber: '00041161201901000005',
// Code: 0,
// ErrorMessage: null,
// })
// );
let message1 = JSON.parse(jsonResult);
userMessage = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
};
break;
case '99':
break;
}
readCardLoading.value = true;
if (userMessage.certNo) {
gerPreInfo(userMessage)
.then((res) => {
readCardLoading.value = true;
loadingText.value = '正在读取...';
console.log(res);
jsonResult = res.data;
cardInfo = JSON.parse(JSON.stringify(jsonResult));
let message = JSON.parse(cardInfo.message);
console.log('patientInfo中的encounterId:', props.patientInfo);
const encounterId = props.inHospitalInfo.encounterId || '1993854019030441985';
console.log('1111111111111111111准备使用的encounterId:', encounterId);
userMessage = {
certType: '02', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '02', // 居民身份证
encounterId: encounterId || '1993854019030441985',
};
userCardInfo = {
certType: '01', // 证件类型
certNo: message.data.idNo, // 身份证号
psnCertType: '01', // 居民身份证
busiCardInfo: message.data.ecToken, // 令牌
encounterId: encounterId || '1993854019030441985',
};
BusiCardInfo.value = message.data.ecToken;
console.log(BusiCardInfo.value);
emits('carReading', jsonResult);
})
.catch(() => {
readCardLoading.value = false;
});
break;
case '02':
break;
case '03': // 社保卡
readCardLoading.value = true;
loadingText.value = '正在读取...';
await invokeYbPlugin5001(
JSON.stringify({
FunctionId: 1,
IP: 'ddjk.jlhs.gov.cn',
PORT: 20215,
TIMEOUT: 60,
SFZ_DRIVER_TYPE: 1,
})
)
.then((res) => {
jsonResult = JSON.stringify(res.data);
let message1 = JSON.parse(jsonResult);
// 从patientInfo中获取encounterId如果没有则尝试从住院号中获取
// const encounterId =
// props.patientInfo?.encounterId || props.patientInfo?.visitNo || props.patientInfo?.busNo;
// console.log('准备使用的encounterId:', encounterId);
userMessage = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
encounterId: encounterId || '1993854019030441985',
};
userCardInfo = {
certType: '02', // 证件类型
certNo: message1.SocialSecurityNumber, // 身份证号
psnCertType: '02', // 居民身份证
busiCardInfo: message1.BusiCardInfo, //卡号
encounterId: encounterId || '1993854019030441985',
};
BusiCardInfo.value = message1.BusiCardInfo;
console.log(message1.BusiCardInfo);
emits('carReading', res.data);
if (res.code == 200) {
form.value.patientId = res.data.id;
form.value.name = res.data.name;
form.value.age = res.data.age;
form.value.idCard = res.data.idCard;
form.value.card = res.data.id;
form.value.contractNo = res.data.contractBusNo;
form.value.genderEnum = res.data.genderEnum;
form.value.ybAreaNo = res.data.contractName;
}
})
.finally(() => {
readCardLoading.value = false;
});
break;
case '99':
break;
}
} catch (error) {
console.error('调用失败:', error);
readCardLoading.value = false;
}
readCardLoading.value = true;
// 调试日志检查发送给gerPreInfo的参数
console.log('发送给gerPreInfo的参数:', userMessage);
if (userMessage && userMessage.certNo) {
gerPreInfo(userMessage)
.then((res) => {
console.log('gerPreInfo返回结果:', res);
if (res && res.code == 200 && res.data) {
form.patientId = res.data.id;
form.name = res.data.name;
form.age = res.data.age;
form.idCard = res.data.idCard;
form.card = res.data.id;
form.contractNo = res.data.contractBusNo;
form.genderEnum = res.data.genderEnum;
form.ybAreaNo = res.data.contractName;
form.encounterId = res.data.encounterId;
// 成功获取数据后跳转到 registerEdit 页面,并传递数据
// router.push({
// name: '/ybmanagement/inhospital/register/edit', // 需要根据实际路由名称调整
// params: {
// cardData: JSON.stringify(res.data), // 将完整数据作为参数传递
// cardType: value, // 卡类型
// },
// });
} else {
// 处理无有效数据的情况
ElMessage.error('未获取到有效的患者信息');
}
})
.catch((error) => {
console.error('gerPreInfo调用失败:', error);
})
.finally(() => {
readCardLoading.value = false;
});
}
} catch (error) {
console.error('调用失败:', error);
readCardLoading.value = false;
}
// }
}
function getPatientForm() {
console.log(patientInfoFormRef.value.form);
return patientInfoFormRef.value.form;
}
// 患者费别变更
const changFeeType = () => {
emits('onChangFeeType');
};
// 无档登记收集信息
const getPatientForm = () => {
return patientInfoFormRef?.value?.form;
};
defineExpose({ submitForm, form, isEditing, getPatientForm });
</script>
@@ -487,4 +404,4 @@ defineExpose({ submitForm, form, isEditing, getPatientForm });
font-weight: 700 !important;
margin-bottom: 10px;
}
</style>
</style>