From 1311e87e13c478580dbdf90439524c2c0eb92490 Mon Sep 17 00:00:00 2001 From: qk123 <18211963828@163.com> Date: Sun, 4 Jan 2026 14:24:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AB=E5=8F=B7=E6=98=BE=E7=A4=BA=E5=B1=8F?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91=EF=BC=8C=E8=AF=8A=E7=96=97?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=96=B0=E5=A2=9E=E6=88=96=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=97=B6=E6=B7=BB=E5=8A=A0=E5=8C=BB=E4=BF=9D=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E5=94=AF=E4=B8=80=E6=80=A7=E6=A0=A1=E9=AA=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appservice/IDiagTreatMAppService.java | 7 + .../impl/DiagTreatMAppServiceImpl.java | 12 + .../DiagnosisTreatmentController.java | 10 + .../components/diagnosisTreatmentDialog.vue | 53 +- .../components/diagnosistreatment.js | 10 + .../callnumberdisplay/index.vue | 556 ++++++++++++++++++ 6 files changed, 645 insertions(+), 3 deletions(-) create mode 100644 openhis-ui-vue3/src/views/triageandqueuemanage/callnumberdisplay/index.vue diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java index a01659d2..d743bbfd 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java @@ -24,6 +24,13 @@ public interface IDiagTreatMAppService { */ R getDiseaseTreatmentInit(); + /** + * 根据ybNo查询诊疗目录(用于医保编码唯一性校验) + * + * @return + */ + R getDiseaseTreatmentByYbNo(String ybNo); + /** * 查询诊疗目录分页列表 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java index b4cff934..93ebc78b 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java @@ -157,6 +157,18 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService { return R.ok(diagnosisTreatmentInitDto); } + /** + * 根据ybNo查询诊疗目录(用于医保编码唯一性校验) + * + * @return + */ + @Override + public R getDiseaseTreatmentByYbNo(String ybNo) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().eq(ActivityDefinition::getYbNo, ybNo); + List activityDefinitionList = activityDefinitionService.list(queryWrapper); + return R.ok(activityDefinitionList); + } + /** * 查询诊疗目录分页列表 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java index 79304e4e..89efdfda 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java @@ -40,6 +40,16 @@ public class DiagnosisTreatmentController { return diagTreatMAppService.getDiseaseTreatmentInit(); } + /** + * 根据ybNo查询诊疗目录(用于医保编码唯一性校验) + * + * @return + */ + @GetMapping("/information/{ybNo}") + public R getDiseaseTreatmentByYbNo(@PathVariable String ybNo) { + return diagTreatMAppService.getDiseaseTreatmentByYbNo(ybNo); + } + /** * 查询诊疗目录分页列表 * diff --git a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue index 328e4301..a097a30c 100644 --- a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue +++ b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue @@ -116,7 +116,11 @@ - + @@ -363,6 +367,7 @@ import { deptTreeSelect, editDiagnosisTreatment, getDiagnosisTreatmentList, + getDiseaseTreatmentByYbNo, locationTreeSelect, } from './diagnosistreatment'; import PopoverList from '@/components/OpenHis/popoverList/index.vue'; @@ -454,6 +459,7 @@ const treatmentItems = ref([ const medicineSearchKey = ref(''); const isFirstOpen = ref(true); // 标记是否首次打开弹窗 const totalPrice = ref('0.00'); // 总价 +const isValidatingYbNo = ref(false); // 标记是否正在校验医保编码 // 计算总价 function calculateTotalPrice() { @@ -597,8 +603,31 @@ function reset() { proxy.resetForm('diagnosisTreatmentRef'); } +async function validateYbNoUnique(ybNo, currentId = null) { + if (!ybNo || ybNo.trim() === '') { + return true; // 空值不进行校验 + } + + try { + const response = await getDiseaseTreatmentByYbNo(ybNo); + const data = response.data; + + if (data && data.length > 0) { + // 检查是否存在相同的医保编码,排除当前编辑的记录 + const existingRecord = data.find(item => item.id !== currentId); + if (existingRecord) { + return false; // 医保编码已存在 + } + } + return true; // 医保编码唯一 + } catch (error) { + console.error('医保编码校验失败:', error); + return true; // 校验失败时允许提交,由后端处理 + } +} + /** 提交按钮 */ -function submitForm() { +async function submitForm() { form.value.ybFlag ? (form.value.ybFlag = 1) : (form.value.ybFlag = 0); form.value.ybMatchFlag ? (form.value.ybMatchFlag = 1) : (form.value.ybMatchFlag = 0); form.value.ruleId ? (form.value.ruleId = 1) : (form.value.ruleId = 0); @@ -606,8 +635,26 @@ function submitForm() { treatmentItems.value.length > 0 && treatmentItems.value[0].adviceDefinitionId != '' ? JSON.stringify(treatmentItems.value) : undefined; - proxy.$refs['diagnosisTreatmentRef'].validate((valid) => { + proxy.$refs['diagnosisTreatmentRef'].validate(async (valid) => { if (valid) { + // 医保编码唯一性校验 + if (form.value.ybNo) { + try { + isValidatingYbNo.value = true; + const isUnique = await validateYbNoUnique(form.value.ybNo, form.value.id); + if (!isUnique) { + proxy.$modal.msgWarning('医保编码已存在,请输入其他医保编码'); + return; + } + } catch (error) { + console.error('医保编码校验失败:', error); + proxy.$modal.msgError('医保编码校验失败,请稍后重试'); + return; + } finally { + isValidatingYbNo.value = false; + } + } + if (form.value.id != undefined) { editDiagnosisTreatment(form.value).then((response) => { // 触发自定义事件,并传递数据给父组件 diff --git a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosistreatment.js b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosistreatment.js index 1cb1b700..2ad91097 100644 --- a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosistreatment.js +++ b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosistreatment.js @@ -104,3 +104,13 @@ export function getYbDiagnosisTreatmentList (queryParams) { params: queryParams, }); } + +// 根据医保编码查询诊疗目录(用于医保编码唯一性校验) +export function getDiseaseTreatmentByYbNo (ybNo) { + return request ({ + url: '/data-dictionary/diagnosis-treatment/information/' + ybNo, + method: 'get', + }); +} + + diff --git a/openhis-ui-vue3/src/views/triageandqueuemanage/callnumberdisplay/index.vue b/openhis-ui-vue3/src/views/triageandqueuemanage/callnumberdisplay/index.vue new file mode 100644 index 00000000..3ed4f484 --- /dev/null +++ b/openhis-ui-vue3/src/views/triageandqueuemanage/callnumberdisplay/index.vue @@ -0,0 +1,556 @@ + + + + + \ No newline at end of file