diff --git a/src/views/blood/matching/index.vue b/src/views/blood/matching/index.vue new file mode 100644 index 0000000..e6d37c9 --- /dev/null +++ b/src/views/blood/matching/index.vue @@ -0,0 +1,638 @@ +/** +* @file index.vue +* @description: 血站配型 +* @author: w +* @since: 2026-09-18 +*/ + + + + + 检索 + 增加明细 + 删除明细 + 保存 + 打印 + + + + + + 申请单信息 + + + + + + + + + + + {{ formatDict(row.dept_id, 'ks') }} + + + {{ formatBreed(row.blood_breed) }} + + + + + + + + + + + + + {{ formData.abo_type || '-' }} 型 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ formData.rh_type == '+' ? '阳性' : formData.rh_type == '-' ? '阴性' : '未知' }} RH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 输血史 + 输血反应史 + 分娩史 + 妊娠史 + 配型史 + + + + + + 血站实验信息 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 配型血液 + + + + 配型血液 + 取消血液 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 检索 + 确认 + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{billStatus.find(v => v.value == row.bill_status)?.label || row.bill_status}} + + + + + + + {{ formatDict(scope.row.dept_id, 'ks') }} + + + + + + + + + + + + + + + diff --git a/src/views/doctor/application/index.vue b/src/views/doctor/application/index.vue index 8fd5c58..5bfa6cf 100644 --- a/src/views/doctor/application/index.vue +++ b/src/views/doctor/application/index.vue @@ -1124,91 +1124,101 @@ const blHandle = () => { } }) } +/** 保存锁:防止连续点击重复提交 */ +const saveLock = ref(false) + //保存申请单 const handleSubmit = async () => { - formRef.value.validate((valid) => { - if (valid) { - if (!bloodList.value.length) return ElMessage.error('请添加血液品种') - // 申请类型 003 || 002 手术信息必填校验 - if (xkTransfuseApply.value.apply_type === '003' || xkTransfuseApply.value.apply_type === '002') { - if (!xkTransfuseApply.value.operation_name || !xkTransfuseApply.value.operation_level) { - return ElMessage.error('请完善手术名称、级别信息') - } - } - saveLoading.value = true - const tempPatient = { ...xkPatientInfo.value, beinhos_id: xkTransfuseApply.value.beinhos_id } - const data = { - transfuseApplyInfoOne: { - xkPatientInfo: tempPatient, - xkTransfuseApply: xkTransfuseApply.value - }, - xkTransfuseApplyBloodbreedList: bloodList.value.map(item => { - return { - ...item, - bill_no: xkTransfuseApply.value.bill_no - } - }), - xkTransfuseApplyTestitemList: lisProject.value, - } - // 自体血校验 - checkSelfBlood({ beinhos_id: xkTransfuseApply.value.beinhos_id }).then((res) => { - if (res.code == 0) { - // 校验是否符合输血指征的规则 - checkCausalis(data).then((res1) => { - if (res1.code == 0) { - // 保存前校验 - savePreApplyInfo(data).then((res2) => { - if (res2.code == 0) { - // 保存申请单 - saveApplyInfo(data).then((res3) => { - if (res3.code == 0 && res3.data) { - getQueryOneInfo(res3.data) - getSqdList() - ElMessage.success('保存成功') - sendMsg(res3.data) - } - }) - } else if (res2.code == 1) { - getSqdList() - ElMessage.success(res2.msg) - } else if (res2.code == 2) { - //2 弹窗提示 - ElMessageBox.confirm(res2.msg, '提示', - { - confirmButtonText: '是', - cancelButtonText: '否', - type: 'warning', - showClose: false, - closeOnClickModal: false, - closeOnPressEscape: false, - } - ).then(() => { - getQueryOneInfo(res2.data) - }).catch(() => { - // 保存申请单 - saveApplyInfo(data).then((res3) => { - if (res3.code == 0 && res3.data) { - getQueryOneInfo(res3.data) - getSqdList() - ElMessage.success('保存成功') - sendMsg(res3.data) - } - }) - }) - } - }) - } else if (res1.code == 1) { - indicationRef.value.openDialog(res1.data, xkTransfuseApply.value.bill_no) - } - }) - } - }).finally(() => { - saveLoading.value = false - }) - } else { + // 防止重复提交 + if (saveLock.value) return + saveLock.value = true + saveLoading.value = true + + try { + const valid = await new Promise((resolve) => { + formRef.value.validate((valid: boolean) => resolve(valid)) + }) + if (!valid) { ElMessage.error('请完善必填信息') + return } - }) + if (!bloodList.value.length) { + ElMessage.error('请添加血液品种') + return + } + // 申请类型 003 || 002 手术信息必填校验 + if (xkTransfuseApply.value.apply_type === '003' || xkTransfuseApply.value.apply_type === '002') { + if (!xkTransfuseApply.value.operation_name || !xkTransfuseApply.value.operation_level) { + ElMessage.error('请完善手术名称、级别信息') + return + } + } + + const tempPatient = { ...xkPatientInfo.value, beinhos_id: xkTransfuseApply.value.beinhos_id } + const data = { + transfuseApplyInfoOne: { + xkPatientInfo: tempPatient, + xkTransfuseApply: xkTransfuseApply.value + }, + xkTransfuseApplyBloodbreedList: bloodList.value.map(item => { + return { + ...item, + bill_no: xkTransfuseApply.value.bill_no + } + }), + xkTransfuseApplyTestitemList: lisProject.value, + } + + // 1. 自体血校验 + const selfRes = await checkSelfBlood({ beinhos_id: xkTransfuseApply.value.beinhos_id }) + if (selfRes.code != 0) return + + // 2. 输血指征收敛 + const causalisRes = await checkCausalis(data) + if (causalisRes.code == 1) { + indicationRef.value.openDialog(causalisRes.data, xkTransfuseApply.value.bill_no) + return + } + if (causalisRes.code != 0) return + + // 3. 保存前校验 + const preRes = await savePreApplyInfo(data) + if (preRes.code == 1) { + getSqdList() + ElMessage.success(preRes.msg) + return + } + if (preRes.code == 2) { + // 弹窗提示:是 → 直接查看单据(不保存),否 → 继续保存 + try { + await ElMessageBox.confirm(preRes.msg, '提示', { + confirmButtonText: '是', + cancelButtonText: '否', + type: 'warning', + showClose: false, + closeOnClickModal: false, + closeOnPressEscape: false, + }) + getQueryOneInfo(preRes.data) + return + } catch { + // 用户点"否",继续走保存 + } + } + if (preRes.code != 0 && preRes.code != 2) return + + // 4. 保存申请单 + const saveRes = await saveApplyInfo(data) + if (saveRes.code == 0 && saveRes.data) { + getQueryOneInfo(saveRes.data) + getSqdList() + ElMessage.success('保存成功') + sendMsg(saveRes.data) + } + } finally { + saveLoading.value = false + saveLock.value = false + } } //输血指征校验弹窗确定 const indicationComfirm = (arr) => {