@@ -1,12 +1,12 @@
|
||||
import request from '@/utils/request';
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取住院信息初期数据列表
|
||||
export function getInit(query) {
|
||||
return request({
|
||||
url: '/inpatient-manage/init',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取住院信息 分页显示
|
||||
@@ -22,8 +22,8 @@ export function getAdmissionPage(query) {
|
||||
return request({
|
||||
url: '/inhospital-charge/register/register-info',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 住院无档登记
|
||||
@@ -31,8 +31,8 @@ export function addAdmissionInfo(data) {
|
||||
return request({
|
||||
url: '/inpatient-manage/admission-information',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 住院登记
|
||||
@@ -40,8 +40,8 @@ export function admissionInfo(data) {
|
||||
return request({
|
||||
url: '/inpatient-manage/admission-information',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,18 +51,17 @@ export function getOrgList() {
|
||||
return request({
|
||||
url: '/base-data-manage/organization/organization',
|
||||
method: 'get',
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询病区下拉列表
|
||||
*/
|
||||
export function wardList({ orgId } = {}) {
|
||||
export function wardList() {
|
||||
return request({
|
||||
url: '/inhospital-charge/register/ward-list',
|
||||
method: 'get',
|
||||
params: { orgId },
|
||||
});
|
||||
url: '/app-common/ward-list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,55 +71,56 @@ export function diagnosisInit() {
|
||||
return request({
|
||||
url: '/doctor-station/diagnosis/init',
|
||||
method: 'get',
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// 查询患者相关
|
||||
export function patientlLists() {
|
||||
return request({
|
||||
url: '/patient-manage/information/init',
|
||||
method: 'get',
|
||||
});
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询患者相关
|
||||
export function doctorList(id) {
|
||||
return request({
|
||||
url: '/inpatient-manage/doctor-list?orgId=' + id,
|
||||
method: 'get',
|
||||
});
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询患者相关
|
||||
export function getPatientInfo(id, statusEnum) {
|
||||
return request({
|
||||
url: `/inpatient-manage/admission-one?id=${id}&statusEnum=${statusEnum}`,
|
||||
method: 'get',
|
||||
});
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获取患者基础信息
|
||||
export function getPatientBasicInfo(patientId) {
|
||||
return request({
|
||||
url: `/inhospital-charge/register/patient-info?patientId=${patientId}`,
|
||||
method: 'get',
|
||||
});
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取患者入院信息
|
||||
export function getInHospitalInfo(encounterId) {
|
||||
return request({
|
||||
url: `/inhospital-charge/register/in-hospital-info?encounterId=${encounterId}`,
|
||||
method: 'get',
|
||||
});
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取病区床位信息
|
||||
export function getBedInfo(wardBusNo) {
|
||||
return request({
|
||||
url: `/inhospital-charge/register/beds-num?wardBusNo=${wardBusNo}`,
|
||||
method: 'get',
|
||||
});
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 住院登记
|
||||
@@ -128,8 +128,8 @@ export function registerInHospital(data) {
|
||||
return request({
|
||||
url: '/inhospital-charge/register/by-cashier',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 无档登记
|
||||
@@ -137,16 +137,16 @@ export function noFilesRegister(data) {
|
||||
return request({
|
||||
url: '/inhospital-charge/register/no-files',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 表单初始化
|
||||
export function patientFormInit() {
|
||||
return request({
|
||||
url: '/patient-manage/information/init',
|
||||
method: 'get',
|
||||
});
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 合同
|
||||
@@ -154,7 +154,7 @@ export function getContractList() {
|
||||
return request({
|
||||
url: '/app-common/contract-list',
|
||||
method: 'get',
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,31 +164,6 @@ export function getDiagnosisDefinitionList(queryParams) {
|
||||
return request({
|
||||
url: '/doctor-station/diagnosis/condition-definition-metadata',
|
||||
method: 'get',
|
||||
params: queryParams,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取患者医保信息
|
||||
export function gerPreInfo(userMaessage) {
|
||||
return request({
|
||||
url: '/yb-inpatient-request/inpatient-per-info',
|
||||
method: 'post',
|
||||
data: userMaessage,
|
||||
});
|
||||
}
|
||||
|
||||
// export function gerPreInfo(userMaessage) {
|
||||
// return request({
|
||||
// url: '/yb-request/per-info',
|
||||
// method: 'post',
|
||||
// params: userMaessage,
|
||||
// });
|
||||
// }
|
||||
|
||||
//获取省市医保字符串
|
||||
export function getProvincesAndCities(encounterId) {
|
||||
return request({
|
||||
url: `/payment/bill/get-encounter-type?encounterId=${encounterId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
@@ -56,7 +56,6 @@
|
||||
:inHospitalInfo="inHospitalInfo"
|
||||
title="登记"
|
||||
:registrationType="registrationType"
|
||||
:is-registered="false"
|
||||
@okAct="patientRegisterOK"
|
||||
@cancelAct="cancelAct"
|
||||
:noFile="noFile"
|
||||
@@ -128,12 +127,10 @@ const patientYbRegisterVisible = ref(false);
|
||||
const patientRegisterOK = () => {
|
||||
patientRegisterVisible.value = false;
|
||||
queryParams.value.searchKey = '';
|
||||
getList();
|
||||
emits('okList');
|
||||
};
|
||||
|
||||
const cancelAct = () => {
|
||||
getList();
|
||||
patientRegisterVisible.value = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -210,9 +210,9 @@
|
||||
v-model="form.deceasedDate"
|
||||
type="datetime"
|
||||
placeholder="请选择时间"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
:disabled="isViewMode"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY/MM/DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -266,7 +266,6 @@ const data = reactive({
|
||||
isViewMode: false,
|
||||
form: {
|
||||
typeCode: '01',
|
||||
genderEnum: 0,
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: '姓名不能为空', trigger: 'change' }],
|
||||
|
||||
@@ -12,14 +12,11 @@
|
||||
<el-scrollbar height="650px">
|
||||
<PatientInfoComp
|
||||
:patientInfo="props.patientInfo"
|
||||
:inHospitalInfo="props.inHospitalInfo"
|
||||
:registrationType="props.registrationType"
|
||||
:initOptions="initOptions"
|
||||
:noFile="noFile"
|
||||
ref="patientInfoRef"
|
||||
:is-registered="props.isRegistered"
|
||||
@onChangFeeType="onChangFeeType"
|
||||
@carReading="onCarRead"
|
||||
/>
|
||||
<!-- <PatientRelationList
|
||||
class="relationList"
|
||||
@@ -35,24 +32,10 @@
|
||||
:alreadyEdit="alreadyEdit"
|
||||
:inHospitalInfo="inHospitalInfo"
|
||||
:noFile="noFile"
|
||||
:is-registered="props.isRegistered"
|
||||
/>
|
||||
</el-scrollbar>
|
||||
<template v-slot:footer>
|
||||
<div class="advance-container">
|
||||
<div v-if="currentFeeType !== 'hipCash'" class="payment-item">
|
||||
<span>{{ payType() }}支付:</span>
|
||||
<el-input
|
||||
ref="txtCodeRef"
|
||||
v-model="txtCode"
|
||||
style="width: 300px; margin-left: 10px"
|
||||
:placeholder="payType() + '支付码'"
|
||||
/>
|
||||
<el-button link type="primary" @click="handleWxPay()" style="margin-left: 10px"
|
||||
>扫码支付</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="getWxPayResult()">查看结果</el-button>
|
||||
</div>
|
||||
<el-space>
|
||||
<div>缴费预交金</div>
|
||||
<el-input
|
||||
@@ -62,20 +45,13 @@
|
||||
@input="handleAdvanceInput"
|
||||
:formatter="handleAdvanceFormatter"
|
||||
:parser="handleAdvanceParser"
|
||||
:disabled="alreadyEdit"
|
||||
></el-input>
|
||||
<div
|
||||
class="feeType"
|
||||
:class="currentFeeType == typeitem.type ? 'activeFeeType' : ''"
|
||||
v-for="typeitem in feeTypeOptions"
|
||||
:key="typeitem.type"
|
||||
@click="
|
||||
() => {
|
||||
!alreadyEdit && (currentFeeType = typeitem.type);
|
||||
payEnum = typeitem.payEnum;
|
||||
}
|
||||
"
|
||||
:style="{ cursor: alreadyEdit ? 'not-allowed' : 'pointer' }"
|
||||
@click="currentFeeType = typeitem.type"
|
||||
>
|
||||
<svg-icon
|
||||
:icon-class="typeitem.type"
|
||||
@@ -89,9 +65,13 @@
|
||||
</el-space>
|
||||
</div>
|
||||
<el-button size="fixed" class="margin-left-auto" @click="cancelAct">取消 </el-button>
|
||||
<el-button v-if="!props.isRegistered" size="fixed" type="primary" @click="handleSubmit">
|
||||
登记
|
||||
</el-button>
|
||||
<el-button size="fixed" type="primary" @click="handleSubmit">登记</el-button>
|
||||
<!-- <hip-button size="fixed" type="primary" @click="supplementMi">医保登记</hip-button> -->
|
||||
<!-- <AdvancePayment
|
||||
v-model="advancePaymentVisible"
|
||||
@submitOk="advancePaymentSubmitOk"
|
||||
:money="advance"3
|
||||
/> -->
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -100,13 +80,7 @@ const { proxy } = getCurrentInstance();
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import PatientInfoComp from './patientInfo.vue';
|
||||
import RegisterForm from './registerForm.vue';
|
||||
import { noFilesRegister, registerInHospital, getProvincesAndCities } from './api';
|
||||
import { getInit } from '../../../../doctorstation/components/api';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { wxPay, WxPayResult } from '../../../../charge/cliniccharge/components/api';
|
||||
import printUtils from '@/utils/printUtils';
|
||||
const txtCode = ref('');
|
||||
const router = useRouter();
|
||||
import { noFilesRegister, registerInHospital, getInit } from './api';
|
||||
const emits = defineEmits(['okAct', 'cancelAct']);
|
||||
|
||||
const props = defineProps({
|
||||
@@ -129,10 +103,6 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isRegistered: {
|
||||
type: Boolean,
|
||||
default: false, // false 表示待登记,true 表示已登记
|
||||
},
|
||||
});
|
||||
|
||||
watch(
|
||||
@@ -152,7 +122,6 @@ import { ElMessage } from 'element-plus';
|
||||
const width = '1128px';
|
||||
const patientApiInfo = ref({});
|
||||
const initOptions = ref({});
|
||||
const payEnum = ref(220400);
|
||||
|
||||
/* 取消 */
|
||||
const cancelAct = () => {
|
||||
@@ -162,78 +131,13 @@ const patientInfoRef = ref();
|
||||
|
||||
/* 预交金 */
|
||||
const advancePaymentVisible = ref(false);
|
||||
const jumpToYbRegisterEdit = () => {
|
||||
router
|
||||
.push({
|
||||
path: '/ybmanagement/ybInhospital/ybregisterEdit',
|
||||
query: {
|
||||
encounterId: '1993854019030441985',
|
||||
},
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('跳转医保登记页面失败:', error);
|
||||
});
|
||||
};
|
||||
/* 登记 */
|
||||
/* 保存 */
|
||||
const handleSubmit = () => {
|
||||
let params = {
|
||||
inHospitalInfo: {},
|
||||
payEnum: 0,
|
||||
};
|
||||
params.inHospitalInfo.payEnum = payEnum.value;
|
||||
params.payEnum = payEnum.value;
|
||||
console.log('params==========>', JSON.stringify(patientInfoRef?.value.getPatientForm()));
|
||||
let params = {};
|
||||
if (props.noFile) {
|
||||
const paramsDic = patientInfoRef?.value.getPatientForm();
|
||||
const paramsDic1 = RegisterFormRef.value.submitForm;
|
||||
if (!paramsDic?.name) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '请输入患者姓名',
|
||||
});
|
||||
return;
|
||||
} else if (!paramsDic?.phone) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '请输入联系方式',
|
||||
});
|
||||
return;
|
||||
} else if (!paramsDic?.age) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '请输入年龄',
|
||||
});
|
||||
return;
|
||||
} else if (!paramsDic1?.inHospitalOrgId) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '请选择入院科室',
|
||||
});
|
||||
return;
|
||||
} else if (!paramsDic1?.wardLocationId) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '请选择入院病区',
|
||||
});
|
||||
return;
|
||||
} else if (!paramsDic1?.diagnosisDefinitionId) {
|
||||
ElMessage({
|
||||
type: 'error',
|
||||
message: '请选择入院诊断',
|
||||
});
|
||||
return;
|
||||
}
|
||||
// else if (!paramsDic1?.diagnosisDesc) {
|
||||
// ElMessage({
|
||||
// type: 'error',
|
||||
// message: '请输入诊断描述',
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
RegisterFormRef.value.validateData(async () => {
|
||||
params.inHospitalInfo = RegisterFormRef.value.submitForm;
|
||||
params.inHospitalInfo.payEnum = payEnum.value;
|
||||
params.patientInformation = patientInfoRef?.value.getPatientForm();
|
||||
params.patientInformation = patientInfoRef.value.getPatientForm();
|
||||
if (params.patientInformation.idCard) {
|
||||
// 验证身份证号长度是否为18位
|
||||
const idCard = params.patientInformation.idCard.toString();
|
||||
@@ -251,53 +155,9 @@ const handleSubmit = () => {
|
||||
const performRegistration = () => {
|
||||
noFilesRegister(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
emits('okAct');
|
||||
ElMessage.success(res.msg);
|
||||
advancePaymentVisible.value = true;
|
||||
ElMessage.success(res.msg);
|
||||
// 打印预交金收据
|
||||
printDepositReceipt(props.patientInfo, params.inHospitalInfo);
|
||||
cancelAct();
|
||||
// 询问是否需要医保登记
|
||||
// ElMessageBox.confirm('是否需要进行医保登记?', '医保登记确认', {
|
||||
// confirmButtonText: '确认',
|
||||
// cancelButtonText: '取消',
|
||||
// type: 'info',
|
||||
// })
|
||||
// .then(() => {
|
||||
// // 准备传递的数据
|
||||
// const cardData = {
|
||||
// patientInfo: params.patientInformation,
|
||||
// inHospitalInfo: params.inHospitalInfo,
|
||||
// encounterId: params.inHospitalInfo.encounterId,
|
||||
// };
|
||||
|
||||
// // 跳转到医保登记页面
|
||||
// try {
|
||||
// router
|
||||
// .push({
|
||||
// path: '/ybmanagement/ybInhospital/ybregisterEdit',
|
||||
// query: {
|
||||
// encounterId: props.patientInfo.encounterId,
|
||||
// cardData: encodeURIComponent(JSON.stringify(cardData)),
|
||||
// cardType: 'inHospital',
|
||||
// operationType: 'HospitalizationRegistration',
|
||||
// },
|
||||
// })
|
||||
// .then(() => {
|
||||
// console.log('路由跳转成功');
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// console.error('路由跳转失败:', error);
|
||||
// ElMessage.error('跳转到医保登记页面失败');
|
||||
// });
|
||||
// } catch (error) {
|
||||
// console.error('跳转异常:', error);
|
||||
// }
|
||||
// })
|
||||
// .catch(() => {
|
||||
// // 用户取消医保登记,关闭当前弹窗
|
||||
// emits('okAct');
|
||||
// });
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
@@ -322,64 +182,13 @@ const handleSubmit = () => {
|
||||
params.patientId = props.patientInfo.patientId;
|
||||
RegisterFormRef.value.validateData(async () => {
|
||||
params = { ...params, ...RegisterFormRef.value.submitForm };
|
||||
console.log('params', params);
|
||||
const performRegistration = () => {
|
||||
console.log('params', params);
|
||||
registerInHospital(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
emits('okAct');
|
||||
ElMessage.success(res.msg);
|
||||
advancePaymentVisible.value = true;
|
||||
|
||||
// 打印预交金收据
|
||||
printDepositReceipt(
|
||||
props.patientInfo,
|
||||
params,
|
||||
RegisterFormRef.value.medicalInsuranceTitle
|
||||
);
|
||||
// 自费不需要弹医保
|
||||
if (params.contractNo != '0000') {
|
||||
// 询问是否需要医保登记
|
||||
ElMessageBox.confirm('是否需要进行医保登记?', '医保登记确认', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info',
|
||||
})
|
||||
.then(() => {
|
||||
// 准备传递的数据
|
||||
const cardData = {
|
||||
patientInfo: props.patientInfo,
|
||||
inHospitalInfo: params,
|
||||
};
|
||||
|
||||
// 跳转到医保登记页面
|
||||
try {
|
||||
router
|
||||
.push({
|
||||
path: '/ybmanagement/ybInhospital/ybregisterEdit',
|
||||
query: {
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
cardData: encodeURIComponent(JSON.stringify(cardData)),
|
||||
cardType: 'inHospital',
|
||||
operationType: 'HospitalizationRegistration',
|
||||
certType: props.patientInfo.certType,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
console.log('路由跳转成功');
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('路由跳转失败:', error);
|
||||
ElMessage.error('跳转到医保登记页面失败');
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('跳转异常:', error);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// 用户取消医保登记,关闭当前弹窗
|
||||
emits('okAct');
|
||||
});
|
||||
}
|
||||
cancelAct();
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
@@ -420,8 +229,6 @@ const closedAct = () => {
|
||||
|
||||
onMounted(() => {
|
||||
getInit().then((res) => {
|
||||
console.log('getInit=========>', JSON.stringify(res.data));
|
||||
|
||||
initOptions.value = res.data;
|
||||
});
|
||||
});
|
||||
@@ -432,22 +239,18 @@ const RegisterFormRef = ref();
|
||||
const feeTypeOptions = reactive([
|
||||
{
|
||||
type: 'hipCash',
|
||||
payEnum: 220400,
|
||||
label: '现金',
|
||||
},
|
||||
{
|
||||
type: 'hipAlipay',
|
||||
payEnum: 220200,
|
||||
label: '支付宝',
|
||||
},
|
||||
{
|
||||
type: 'wechat',
|
||||
payEnum: 220100,
|
||||
label: '微信',
|
||||
},
|
||||
{
|
||||
type: 'hipPayCard',
|
||||
payEnum: 220300,
|
||||
label: '银行卡',
|
||||
},
|
||||
]);
|
||||
@@ -476,168 +279,7 @@ const onChangFeeType = () => {
|
||||
medicalInsuranceVisible.value = true;
|
||||
};
|
||||
|
||||
/* 打印预交金收据 */
|
||||
const printDepositReceipt = async (patientInfo, inHospitalInfo, medicalInsuranceTitle) => {
|
||||
try {
|
||||
// 构造支付方式详情文本
|
||||
const paymentDetails = `现金 ${
|
||||
currentFeeType.value === 'hipCash' ? advance.value || '0.00' : '0.00'
|
||||
} 微信 ${currentFeeType.value === 'wechat' ? advance.value || '0.00' : '0.00'} 支付宝 ${
|
||||
currentFeeType.value === 'hipAlipay' ? advance.value || '0.00' : '0.00'
|
||||
} 银行 ${currentFeeType.value === 'hipPayCard' ? advance.value || '0.00' : '0.00'}`;
|
||||
|
||||
// 构造打印数据
|
||||
const printData = {
|
||||
// 患者基本信息
|
||||
patientName: patientInfo.patientName || '', // 姓名
|
||||
patientId: patientInfo.idCard || patientInfo.patientCode || '', // ID号
|
||||
contractName: patientInfo.contractName || '自费', // 医保类别
|
||||
|
||||
// 住院信息
|
||||
encounterNo: inHospitalInfo.encounterNo || '', // 住院号
|
||||
inHospitalOrgName: inHospitalInfo.inHospitalOrgName || '', // 机构名称
|
||||
|
||||
// 费用信息
|
||||
balanceAmount: advance.value || '0.00', // 金额
|
||||
amountInWords: convertToChineseNumber(advance.value || '0.00'), // 人民币大写
|
||||
|
||||
// 支付方式详情
|
||||
paymentDetails: paymentDetails,
|
||||
|
||||
// 时间信息
|
||||
currentTime: new Date().toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
}),
|
||||
|
||||
// 其他信息
|
||||
cashier: userStore?.nickName || '', // 收款人(收费员)
|
||||
medicalInsuranceTitle: medicalInsuranceTitle || '', // 医保标题信息
|
||||
};
|
||||
|
||||
console.log(printData, 'dayin 预交金printData');
|
||||
|
||||
// 直接导入并使用指定的预交金打印模板
|
||||
const templateModule = await import('@/components/Print/AdvancePayment.json');
|
||||
let template = templateModule.default || templateModule;
|
||||
|
||||
// 使用printUtils执行打印
|
||||
await printUtils.executePrint(printData, template);
|
||||
console.log('预交金收据打印成功');
|
||||
} catch (error) {
|
||||
console.error('打印失败:', error);
|
||||
ElMessage.error('打印失败: ' + error.message);
|
||||
}
|
||||
};
|
||||
|
||||
/* 将数字转换为人民币大写 */
|
||||
const convertToChineseNumber = (amount) => {
|
||||
// 数字转大写
|
||||
const digits = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
|
||||
const units = ['', '拾', '佰', '仟', '万', '拾', '佰', '仟', '亿'];
|
||||
const decimalUnits = ['角', '分'];
|
||||
|
||||
let [integer, decimal] = amount.toString().split('.');
|
||||
decimal = decimal || '00';
|
||||
decimal = decimal.padEnd(2, '0').substring(0, 2);
|
||||
|
||||
let result = '';
|
||||
|
||||
// 处理整数部分
|
||||
if (parseInt(integer) === 0) {
|
||||
result += '零元';
|
||||
} else {
|
||||
for (let i = 0; i < integer.length; i++) {
|
||||
const digit = parseInt(integer[i]);
|
||||
const position = integer.length - i - 1;
|
||||
|
||||
if (digit !== 0) {
|
||||
result += digits[digit] + units[position];
|
||||
} else {
|
||||
// 避免连续的零
|
||||
if (i > 0 && parseInt(integer[i - 1]) !== 0) {
|
||||
result += digits[digit];
|
||||
}
|
||||
// 但需要保留万、亿等单位
|
||||
if (position % 4 === 0 && position > 0) {
|
||||
result += units[position];
|
||||
}
|
||||
}
|
||||
}
|
||||
result += '元';
|
||||
}
|
||||
|
||||
// 处理小数部分
|
||||
if (parseInt(decimal) === 0) {
|
||||
result += '整';
|
||||
} else {
|
||||
if (parseInt(decimal[0]) > 0) {
|
||||
result += digits[parseInt(decimal[0])] + decimalUnits[0];
|
||||
}
|
||||
if (parseInt(decimal[1]) > 0) {
|
||||
result += digits[parseInt(decimal[1])] + decimalUnits[1];
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
/* 导入用户信息 */
|
||||
import useUserStore from '@/store/modules/user';
|
||||
const userStore = useUserStore();
|
||||
function handleWxPay() {
|
||||
wxPay({
|
||||
// 支付码
|
||||
txtCode: txtCode.value,
|
||||
// 收费项id 住院怎么给
|
||||
chargeItemIds: props.chargeItemIds,
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
// 支付id 住院怎么给
|
||||
id: props.paymentId,
|
||||
// 支付详情 住院怎么给 格式[{ payEnum: 220100, amount: 0.0, payLevelEnum: 2 }]
|
||||
paymentDetails: formData.selfPay,
|
||||
// 读卡的时候获取的
|
||||
ybMdtrtCertType: props.userCardInfo.psnCertType,
|
||||
// 读卡获取
|
||||
busiCardInfo: props.userCardInfo.busiCardInfo,
|
||||
});
|
||||
}
|
||||
|
||||
function getWxPayResult() {
|
||||
WxPayResult({
|
||||
txtCode: txtCode.value,
|
||||
chargeItemIds: props.chargeItemIds,
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
id: props.paymentId,
|
||||
paymentDetails: formData.selfPay,
|
||||
ybMdtrtCertType: props.userCardInfo.psnCertType,
|
||||
busiCardInfo: props.userCardInfo.busiCardInfo,
|
||||
});
|
||||
}
|
||||
|
||||
// 根据不同支付方式,显示不同的支付方式详情
|
||||
const payType = () => {
|
||||
switch (currentFeeType.value) {
|
||||
case 'hipCash':
|
||||
return '现金';
|
||||
case 'hipAlipay':
|
||||
return '支付宝';
|
||||
case 'wechat':
|
||||
return '微信卡';
|
||||
case 'hipPayCard':
|
||||
return '银行卡';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
};
|
||||
// 读卡操作
|
||||
const onCarRead = (a) => {
|
||||
console.log('读卡操作:', a);
|
||||
};
|
||||
/* */
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.patientRegister-container {
|
||||
@@ -648,12 +290,7 @@ const onCarRead = (a) => {
|
||||
.advance-container {
|
||||
width: 660px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.payment-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.feeType {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
ref="registerRef"
|
||||
label-width="80px"
|
||||
:rules="rules"
|
||||
:disabled="props.isRegistered"
|
||||
>
|
||||
<el-row :gutter="8">
|
||||
<el-col :span="6">
|
||||
@@ -29,7 +28,6 @@
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="submitForm.inHospitalOrgId"
|
||||
:disabled="props.isRegistered"
|
||||
filterable
|
||||
:data="organization"
|
||||
:props="{
|
||||
@@ -49,11 +47,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="入院病区" prop="wardLocationId">
|
||||
<el-select
|
||||
:disabled="props.isRegistered || !submitForm.inHospitalOrgId"
|
||||
v-model="submitForm.wardLocationId"
|
||||
placeholder="请先选择入院科室"
|
||||
>
|
||||
<el-select :disabled="props.alreadyEdit" v-model="submitForm.wardLocationId">
|
||||
<el-option
|
||||
v-for="item in wardListOptions"
|
||||
:key="item.id"
|
||||
@@ -80,7 +74,6 @@
|
||||
<el-form-item label="诊断类别" prop="medTypeCode">
|
||||
<el-select
|
||||
v-model="submitForm.medTypeCode"
|
||||
:disabled="props.isRegistered"
|
||||
placeholder="诊断类别"
|
||||
clearable
|
||||
filterable
|
||||
@@ -108,7 +101,6 @@
|
||||
<el-form-item label="入院诊断" prop="diagnosisDefinitionId">
|
||||
<el-select
|
||||
v-model="submitForm.diagnosisDefinitionId"
|
||||
:disabled="props.isRegistered"
|
||||
placeholder="入院诊断"
|
||||
clearable
|
||||
filterable
|
||||
@@ -132,11 +124,11 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="患者病情">
|
||||
<el-select v-model="submitForm.priorityEnum" :disabled="props.isRegistered">
|
||||
<el-select v-model="submitForm.priorityEnum">
|
||||
<el-option
|
||||
v-for="item in props.initOptions.priorityLevelOptionOptions"
|
||||
v-for="item in props.initOptions.priorityEnumList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:label="item.info"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
@@ -144,7 +136,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="入院类型" prop="admitSourceCode">
|
||||
<el-select v-model="submitForm.admitSourceCode" :disabled="props.isRegistered">
|
||||
<el-select v-model="submitForm.admitSourceCode">
|
||||
<el-option
|
||||
v-for="item in admit_source_code"
|
||||
:key="item.value"
|
||||
@@ -156,7 +148,7 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="入院方式" prop="inWayCode">
|
||||
<el-select v-model="submitForm.inWayCode" :disabled="props.isRegistered">
|
||||
<el-select v-model="submitForm.inWayCode">
|
||||
<el-option
|
||||
v-for="item in in_way_code"
|
||||
:key="item.value"
|
||||
@@ -172,7 +164,6 @@
|
||||
v-model="submitForm.contractNo"
|
||||
placeholder="费用性质"
|
||||
clearable
|
||||
:disabled="props.isRegistered"
|
||||
@change="getValue"
|
||||
>
|
||||
<el-option
|
||||
@@ -188,7 +179,6 @@
|
||||
<el-form-item label="入院日期" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="submitForm.startTime"
|
||||
:disabled="props.isRegistered"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="date"
|
||||
placeholder="请选择日期"
|
||||
@@ -208,7 +198,6 @@ import {
|
||||
getBedInfo,
|
||||
getContractList,
|
||||
getDiagnosisDefinitionList,
|
||||
getProvincesAndCities,
|
||||
} from './api';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { in_way_code, admit_source_code, med_type } = proxy.useDict(
|
||||
@@ -235,7 +224,7 @@ const props = defineProps({
|
||||
require: true,
|
||||
default: () => ({}),
|
||||
},
|
||||
isRegistered: {
|
||||
alreadyEdit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
@@ -250,7 +239,6 @@ const wardListOptions = ref([]);
|
||||
const contractList = ref([]);
|
||||
const verificationStatusOptions = ref([]);
|
||||
const diagnosisDefinitionList = ref([]);
|
||||
const wardLoading = ref(false);
|
||||
const rules = reactive({
|
||||
inHospitalOrgId: [
|
||||
{
|
||||
@@ -280,52 +268,15 @@ const rules = reactive({
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
// diagnosisDesc: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: '诊断描述未填写',
|
||||
// trigger: ['blur', 'change'],
|
||||
// },
|
||||
// ],
|
||||
diagnosisDesc: [
|
||||
{
|
||||
required: true,
|
||||
message: '诊断描述未填写',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
//获取省市医保字符串
|
||||
const medicalInsuranceTitle = ref('');
|
||||
|
||||
// 暴露给父组件使用
|
||||
// defineExpose({
|
||||
// medicalInsuranceTitle,
|
||||
// });
|
||||
const getProvincesAndCitiesInfo = async () => {
|
||||
try {
|
||||
if (inHospitalInfo.encounterId) {
|
||||
const res = await getProvincesAndCities(props.inHospitalInfo.encounterId);
|
||||
// console.log('获取省市医保字符串', res);
|
||||
if (res && res.code == 200) {
|
||||
// 确保有数据时才更新
|
||||
medicalInsuranceTitle.value = res.data?.insutype || res.data || '';
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
// 静默处理错误,确保页面不会显示错误信息
|
||||
console.error('获取医保省市信息失败:', error);
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
getProvincesAndCitiesInfo();
|
||||
});
|
||||
|
||||
// 监听inHospitalInfo.encounterId的变化,在弹窗打开时重新调用接口
|
||||
watch(
|
||||
() => props.inHospitalInfo.encounterId,
|
||||
(newEncounterId) => {
|
||||
if (newEncounterId) {
|
||||
getProvincesAndCitiesInfo();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
/* 提交表单 */
|
||||
const submitForm = reactive({
|
||||
inHospitalOrgId: props.inHospitalInfo.inHospitalOrgId,
|
||||
@@ -338,50 +289,25 @@ const submitForm = reactive({
|
||||
ambDiagnosisName: props.inHospitalInfo.ambDiagnosisName,
|
||||
medTypeCode: '21',
|
||||
});
|
||||
// /* 科室 病区 */
|
||||
// watch(
|
||||
// () => submitForm.inDocterWorkGroupCode,
|
||||
// (newValue) => {
|
||||
// if (newValue) {
|
||||
// if (newValue == '') {
|
||||
// submitForm.wardLocationId = '';
|
||||
// }
|
||||
// } else {
|
||||
// submitForm.wardLocationId = '';
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
|
||||
// watch(
|
||||
// () => submitForm.inNurseDeptCode,
|
||||
// (newValue) => {
|
||||
// if (newValue) {
|
||||
// getBedInfo(newValue);
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
/* 科室 病区 */
|
||||
watch(
|
||||
() => submitForm.wardLocationId,
|
||||
(newWardId) => {
|
||||
if (newWardId && wardListOptions.value.length > 0) {
|
||||
const selectedWard = wardListOptions.value.find((item) => item.id === newWardId);
|
||||
if (selectedWard) {
|
||||
handleWardClick(selectedWard);
|
||||
() => submitForm.inDocterWorkGroupCode,
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
if (newValue == '') {
|
||||
submitForm.wardLocationId = '';
|
||||
}
|
||||
} else {
|
||||
submitForm.totalBedsNum = undefined;
|
||||
submitForm.idleBedsNum = undefined;
|
||||
submitForm.wardLocationId = '';
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.isRegistered,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
// 已登记状态可以做一些数据锁定操作
|
||||
} else {
|
||||
init();
|
||||
() => submitForm.inNurseDeptCode,
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
getBedInfo(newValue);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -389,51 +315,25 @@ watch(
|
||||
onMounted(() => {
|
||||
getInitOptions();
|
||||
setValue();
|
||||
setDefaultAdmitSource();
|
||||
if (submitForm.inHospitalOrgId) {
|
||||
handleNodeClick({ id: submitForm.inHospitalOrgId });
|
||||
}
|
||||
});
|
||||
const setDefaultAdmitSource = () => {
|
||||
if (props.noFile) return;
|
||||
const defaultItem = admit_source_code.value.find((item) => item.value === '1');
|
||||
if (defaultItem) {
|
||||
submitForm.admitSourceCode = props.inHospitalInfo?.admitSourceCode || defaultItem.value;
|
||||
}
|
||||
};
|
||||
|
||||
function handleWardClick(item) {
|
||||
submitForm.wardBusNo = item.busNo;
|
||||
submitForm.totalBedsNum = undefined;
|
||||
submitForm.idleBedsNum = undefined;
|
||||
getBedInfo(submitForm.wardBusNo)
|
||||
.then((res) => {
|
||||
if (res.data) {
|
||||
submitForm.totalBedsNum = res.data.totalBedsNum;
|
||||
submitForm.idleBedsNum = res.data.idleBedsNum;
|
||||
} else {
|
||||
submitForm.totalBedsNum = 0;
|
||||
submitForm.idleBedsNum = 0;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('查询病床失败:', err);
|
||||
submitForm.totalBedsNum = undefined;
|
||||
submitForm.idleBedsNum = undefined;
|
||||
});
|
||||
getBedInfo(submitForm.wardBusNo).then((res) => {
|
||||
submitForm.totalBedsNum = res.data.totalBedsNum;
|
||||
submitForm.idleBedsNum = res.data.idleBedsNum;
|
||||
});
|
||||
}
|
||||
|
||||
function getInitOptions() {
|
||||
getOrgList().then((res) => {
|
||||
// organization.value = res.data.records
|
||||
organization.value = res.data.records[0].children.filter(
|
||||
(record) => record.typeEnum === 2 && record.classEnum === 2
|
||||
);
|
||||
organization.value = res.data.records;
|
||||
});
|
||||
// if (!props.noFile) {
|
||||
// wardList().then((res) => {
|
||||
// wardListOptions.value = res.data;
|
||||
// });
|
||||
// }
|
||||
if (!props.noFile) {
|
||||
wardList().then((res) => {
|
||||
wardListOptions.value = res.data;
|
||||
});
|
||||
}
|
||||
diagnosisInit().then((res) => {
|
||||
verificationStatusOptions.value = res.data.verificationStatusOptions;
|
||||
});
|
||||
@@ -450,40 +350,15 @@ function getDiagnosisInfo(value) {
|
||||
}
|
||||
|
||||
function handleNodeClick(orgInfo) {
|
||||
submitForm.wardLocationId = undefined; // 切换科室时,先清空原有病区
|
||||
submitForm.totalBedsNum = undefined;
|
||||
submitForm.idleBedsNum = undefined;
|
||||
wardListOptions.value = []; // 先清空列表,避免旧数据残留
|
||||
wardLoading.value = true;
|
||||
wardList({ orgId: orgInfo.id })
|
||||
.then((res) => {
|
||||
wardListOptions.value = res.data || [];
|
||||
if (wardListOptions.value.length > 0 && !props.inHospitalInfo.wardLocationId) {
|
||||
submitForm.wardLocationId = wardListOptions.value[0].id;
|
||||
const defaultWard = wardListOptions.value.find(
|
||||
(item) => item.id === submitForm.wardLocationId
|
||||
);
|
||||
if (defaultWard) {
|
||||
handleWardClick(defaultWard);
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('加载病区失败:', err);
|
||||
wardListOptions.value = [];
|
||||
})
|
||||
.finally(() => {
|
||||
wardLoading.value = false;
|
||||
});
|
||||
wardList({ orgId: orgInfo.id }).then((res) => {
|
||||
wardListOptions.value = res.data;
|
||||
});
|
||||
}
|
||||
|
||||
function handleChange(value) {
|
||||
if (!value) {
|
||||
wardListOptions.value = [];
|
||||
submitForm.wardLocationId = undefined;
|
||||
submitForm.totalBedsNum = undefined;
|
||||
submitForm.idleBedsNum = undefined;
|
||||
wardLoading.value = false; // 同步停止加载
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,7 +385,7 @@ function setValue() {
|
||||
submitForm.ambDiagnosisName = props.inHospitalInfo?.ambDiagnosisName;
|
||||
submitForm.priorityEnum = props.inHospitalInfo?.priorityEnum;
|
||||
submitForm.priorityEnum_enumText = props.inHospitalInfo?.priorityEnum_enumText;
|
||||
// submitForm.admitSourceCode = props.inHospitalInfo?.admitSourceCode;
|
||||
submitForm.admitSourceCode = props.inHospitalInfo?.admitSourceCode;
|
||||
submitForm.admitSourceCode_dictText = props.inHospitalInfo?.admitSourceCode_dictText;
|
||||
submitForm.inWayCode = props.inHospitalInfo?.inWayCode;
|
||||
submitForm.inWayCode_dictText = props.inHospitalInfo?.inWayCode_dictText;
|
||||
@@ -531,13 +406,10 @@ const validateData = async (callback) => {
|
||||
};
|
||||
|
||||
const init = () => {
|
||||
if (!props.isRegistered) {
|
||||
// 只有待登记状态才重置
|
||||
submitForm.inDocterWorkGroupCode = '';
|
||||
submitForm.wardLocationId = '';
|
||||
}
|
||||
submitForm.inDocterWorkGroupCode = '';
|
||||
submitForm.wardLocationId = '';
|
||||
};
|
||||
defineExpose({ validateData, submitForm, init, medicalInsuranceTitle });
|
||||
defineExpose({ validateData, submitForm, init });
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.registerForm-container {
|
||||
|
||||
Reference in New Issue
Block a user