diff --git a/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue b/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue index f715fcd6..bec462f5 100644 --- a/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue +++ b/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue @@ -657,6 +657,12 @@ function submitForm() { { required: true, message: "描述不能为空", trigger: "blur" }, ]; } + + // const nameData = name || chargeName; + // 服务名称 + form.value.name = getName(); + // 收费名称 + form.value.chargeName = getName(); proxy.$refs["registrationfeeRef"].validate((valid) => { if (valid) { if (form.value.id != undefined) { @@ -685,6 +691,39 @@ function submitForm() { }); } +// 获取完整地址字符串 +function getName() { + console.log(service_type_code.value, "service_type_code.value"); + // 服务类型 + const serviceTypeText = proxy.selectDictLabel(service_type_code.value, form.value.fwTypeCode); + // 服务分类 + const categoryCodeText = proxy.selectDictLabel(category_code.value, form.value.categoryCode); + // 服务专业 + const specialtyCodeText = proxy.selectDictLabel(specialty_code.value, form.value.specialtyCode); + console.log( + serviceTypeText, + "serviceTypeText", + categoryCodeText, + specialtyCodeText + ); + const nameParts = [ + serviceTypeText, + form.value.addressCity, + categoryCodeText, + specialtyCodeText, + ]; + + // 使用 reduce 方法拼接地址,非空字段之间用 '-' 连接 + return nameParts.reduce((acc, part) => { + if (part) { + if (acc) { + acc += ' - '; // 在非空字段之间添加 '-' + } + acc += part; + } + return acc; + }, ""); +} /** 详细按钮操作 */ function handleView(row) { reset(); diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/outpatientregistration.js b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/outpatientregistration.js index 33e0cadc..3222fd71 100644 --- a/openhis-ui-vue3/src/views/charge/outpatientregistration/components/outpatientregistration.js +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/components/outpatientregistration.js @@ -63,7 +63,7 @@ export function getHealthcareMetadata(query) { }) } -// // 门诊挂号目录分类查询 +// // 门诊挂号查询 // export function getOutpatientRegistrationCategory() { // return request({ // url: '/outpatient-service/registerinformation-init', @@ -71,6 +71,15 @@ export function getHealthcareMetadata(query) { // }) // } +// 新增门诊挂号信息 +export function addOutpatientRegistration(data) { + return request({ + url: '/outpatient-service/register/save', + method: 'post', + data: data + }) +} + // 新增病人信息 export function addPatient(data) { return request({ diff --git a/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue b/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue index 4d426a72..b9ea39d8 100644 --- a/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue +++ b/openhis-ui-vue3/src/views/charge/outpatientregistration/index.vue @@ -9,7 +9,7 @@ @@ -59,7 +59,7 @@ - + @@ -162,15 +162,61 @@ + + + + + + + + + + + + + + + + + + + --> - + - + + + + 清空 + 添加 + + @@ -459,6 +526,7 @@ import { getLocationTree, getPractitionerMetadata, getHealthcareMetadata, + addOutpatientRegistration } from "./components/outpatientregistration"; import patientInfoDialog from "./components/patientInfoDialog"; import PatientAddDialog from "./components/patientAddDialog"; @@ -555,29 +623,41 @@ function handleAddPatient() { function setForm(formData) { console.log(formData, "formData"); form.value = { ...form.value, ...formData }; + form.value.patientId = formData.id; } // 设定表单 function setInfo() { const doctorData = doctorList.value.filter( - (doctor) => doctor.id === form.value.doctorId + (doctor) => doctor.id === form.value.practitionerId ); form.value.doctorName = doctorData.length > 0 ? doctorData[0].name : ""; console.log(doctorData, "datayisheng"); const healthcareData = healthcareList.value.filter( - (healthcare) => healthcare.id === form.value.healthcareType + (healthcare) => healthcare.id === form.value.serviceTypeId ); form.value.locationId_dictText = healthcareData.length > 0 ? healthcareData[0].name : ""; form.value.price = healthcareData.length > 0 ? healthcareData[0].price : ""; } -/** 查询病种目录列表 */ + +// 设定费用项管理表单 +function setchargeItem() { + const healthcareData = healthcareList.value.filter( + (healthcare) => healthcare.id === form.value.serviceTypeId + ); + form.value.definitionId = + healthcareData.length > 0 ? healthcareData[0].definitionId : ""; + form.value.totalPrice = + healthcareData.length > 0 ? healthcareData[0].price : ""; +} +/** 查询患者信息 */ function getList() { - loading.value = true; - getOutpatientRegistrationList(queryParams.value).then((res) => { - loading.value = false; - outpatientRegistrationList.value = res.data.records; - total.value = res.data.total; - }); + // loading.value = true; + // getOutpatientRegistrationList(queryParams.value).then((res) => { + // loading.value = false; + // outpatientRegistrationList.value = res.data.records; + // total.value = res.data.total; + // }); } /** 查询费用性质 */ @@ -631,12 +711,20 @@ function getHealthcare(data) { const param = { organizationId: data.organizationId, }; + // 设定表单中的机构ID + form.value.organizationId = data.organizationId; + getHealthcareMetadata(param).then((response) => { healthcareList.value = response.data.records; console.log("getHealthcareMetadata", "response", response.data); }); } +/** 清空条件按钮操作 */ +function handleClear() { + reset(); +} + /** 搜索按钮操作 */ function handleQuery() { queryParams.value.pageNo = 1; @@ -658,14 +746,23 @@ function reset() { busNo: undefined, ybType: undefined, phone: undefined, - allergenFlag: undefined, locationId: undefined, - healthcareType: undefined, - doctorId: undefined, + serviceTypeId: undefined, + practitionerId: undefined, locationId_dictText: undefined, doctorName: undefined, price: undefined, - priorityLevel: undefined, + priorityEnum: undefined, + patientId: undefined, + organizationId: undefined, + contractNo: undefined, + typeCode: 1, // 个人现金账户 目前固定传1 + ybName: undefined, + ybAreaNo: undefined, + limitAccount: undefined, + definitionId: undefined, + serviceId: undefined, + totalPrice: undefined, }; proxy.resetForm("outpatientRegistrationRef"); } @@ -677,9 +774,46 @@ function cancel() { /** 新增按钮操作 */ function handleAdd() { - reset(); - open.value = true; - title.value = "新增"; + const transformedData = transformFormData(form.value); + console.log(transformedData, "transformedData门诊挂号"); + addOutpatientRegistration(transformedData).then((response) => { + reset(); + proxy.$modal.msgSuccess("新增成功"); + getList(); + }); +} + +// 设置新增参数 +function transformFormData(form) { + return { + encounterFormData: { + patientId: form.patientId, + priorityEnum: form.priorityEnum, + serviceTypeId: form.serviceTypeId, + organizationId: form.organizationId, + }, + encounterLocationFormData: { + locationId: form.locationId, + }, + encounterParticipantFormData: { + practitionerId: form.practitionerId, + }, + accountFormData: { + patientId: form.patientId, + typeCode: 1, // 默认值为 "1" + name: form.ybName, + balanceAmount: form.balanceAmount, + ybAreaNo: form.ybAreaNo, + contractNo: form.contractNo, + limitAccount: form.limitAccount, + }, + chargeItemFormData: { + patientId: form.patientId, + definitionId: form.definitionId, + serviceId: form.serviceTypeId, + totalPrice: form.totalPrice, // 默认值为 99.99 + }, + }; } getInitData();