血站配型
This commit is contained in:
parent
e3d63ed917
commit
39881f3e3d
638
src/views/blood/matching/index.vue
Normal file
638
src/views/blood/matching/index.vue
Normal file
@ -0,0 +1,638 @@
|
||||
/**
|
||||
* @file index.vue
|
||||
* @description: 血站配型
|
||||
* @author: w
|
||||
* @since: 2026-09-18
|
||||
*/
|
||||
<template>
|
||||
<div class="box-container">
|
||||
<!-- 顶部操作按钮栏 -->
|
||||
<div class="card-box">
|
||||
<el-button type="primary" plain @click="openJsHandle">检索</el-button>
|
||||
<el-button type="primary" plain @click="addDetail">增加明细</el-button>
|
||||
<el-button type="danger" plain @click="deleteDetail">删除明细</el-button>
|
||||
<el-button type="success" plain :loading="saveLoading" @click="saveData">保存</el-button>
|
||||
<el-button type="warning" plain>打印</el-button>
|
||||
</div>
|
||||
|
||||
<el-form :model="formData" label-width="auto" class="form_box">
|
||||
<!-- 申请单信息 -->
|
||||
<div class="card-box">
|
||||
<div class="section-title">申请单信息</div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="配型单号">
|
||||
<el-input v-model="formData.match_no" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="输血申请单号">
|
||||
<DropdownTableSelect v-model="formData.bill_no" :column-list="applyColumns" tableWidth="800px"
|
||||
:showSearch="false" labelField="bill_no" :table-data="applyTableData" @open="loadApplyData"
|
||||
@search="searchApply" @change="searchApply">
|
||||
<template #dept_id="{ row }">
|
||||
{{ formatDict(row.dept_id, 'ks') }}
|
||||
</template>
|
||||
<template #blood_breed="{ row }">
|
||||
{{ formatBreed(row.blood_breed) }}
|
||||
</template>
|
||||
</DropdownTableSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓 名">
|
||||
<el-input v-model="formData.patient_name" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-form-item label="血型">
|
||||
<div class="blood-type-group">
|
||||
<div class="blood-type-tag ab"><span class="x_type">{{ formData.abo_type || '-' }}</span> 型</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="性 别">
|
||||
<el-input v-model="formData.patient_sex" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="住院号/ID号">
|
||||
<el-input v-model="formData.beinhos_id" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="年 龄">
|
||||
<el-input v-model="formData.age" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-form-item label="Rh(D)">
|
||||
<div class="blood-type-group">
|
||||
<div :class="['blood-type-tag', 'rh',]">
|
||||
<span :class="[formData.rh_type == '+' ? '' : formData.rh_type == '-' ? 'red' : '']">
|
||||
{{ formData.rh_type == '+' ? '阳性' : formData.rh_type == '-' ? '阴性' : '未知' }}</span> RH
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="科 室">
|
||||
<SelectTable v-model:data="formData.dept_id" :tableData="dictData.ks" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="床位号">
|
||||
<el-input v-model="formData.patient_bed" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="申请日期">
|
||||
<el-date-picker v-model="formData.apply_date" type="datetime" format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" placeholder="" disabled style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="临床诊断">
|
||||
<el-input v-model="formData.diagnoses" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="输血目的">
|
||||
<SelectTable v-model:data="formData.intent" :tableData="dictData.sxmd" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div class="checkbox-row">
|
||||
<el-checkbox :model-value="formData.transfuse_history == 'Y'">输血史</el-checkbox>
|
||||
<el-checkbox :model-value="formData.reaction_history == 'Y'">输血反应史</el-checkbox>
|
||||
<el-checkbox :model-value="formData.parturition_history == 'Y'">分娩史</el-checkbox>
|
||||
<el-checkbox :model-value="formData.gestation_history == 'Y'">妊娠史</el-checkbox>
|
||||
<el-checkbox :model-value="formData.match_history == 'Y'">配型史</el-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 血站实验信息 -->
|
||||
<div class="card-box">
|
||||
<div class="section-title">血站实验信息</div>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="ABO复核">
|
||||
<el-input v-model="formData.affirm_abo" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="Rh(D)复核">
|
||||
<el-input v-model="formData.check_rh" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="抗体筛选">
|
||||
<el-input v-model="formData.affirm_antibody" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="实验人">
|
||||
<SelectTable v-model:data="formData.test_person" :tableData="userList" placeholder=""
|
||||
:clearable="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="实验日期">
|
||||
<el-date-picker v-model="formData.test_date" type="datetime" format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" placeholder="" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="抗体检测结果">
|
||||
<el-select v-model="formData.antibody_result" placeholder="" style="width: 100%">
|
||||
<el-option v-for="item in dictData.ktsx" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="备 注">
|
||||
<el-input v-model="formData.remark" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 配型血液 -->
|
||||
<div class="card-box pxBox" style="margin-bottom: 0px;">
|
||||
<div class="section-title">配型血液</div>
|
||||
<div class="match-blood-bar">
|
||||
<el-input v-model="bloodNo" placeholder="" @keyup.enter="bloodEnter" style="width: 250px;" />
|
||||
<el-radio-group v-model="matchType" class="radio-group">
|
||||
<el-radio value="add">配型血液</el-radio>
|
||||
<el-radio value="del">取消血液</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class="table-box">
|
||||
<el-table :data="matchTable" border height="100%" highlight-current-row show-overflow-tooltip>
|
||||
<el-table-column label="序号" type="index" align="center" width="60" />
|
||||
<el-table-column label="血液流水号" prop="blood_no" align="center" />
|
||||
<el-table-column label="配血方法" prop="match_method" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.match_method" placeholder="" class="full-width-input">
|
||||
<el-option v-for="option in dictData.pxff" :key="option.value" :label="option.label"
|
||||
:value="option.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="复核配血方法" prop="check_method" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.check_method" placeholder="" class="full-width-input">
|
||||
<el-option v-for="option in dictData.pxff" :key="option.value" :label="option.label"
|
||||
:value="option.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结果" prop="result" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.result" placeholder="" class="full-width-input">
|
||||
<el-option v-for="option in dictData.pxjg" :key="option.value" :label="option.label"
|
||||
:value="option.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="配血日期" prop="match_date" align="center" width="160">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker v-model="row.match_date" type="datetime" format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" placeholder="" class="full-width-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="配血医师" prop="match_medic" align="center">
|
||||
<template #default="{ row }">
|
||||
<SelectTable v-model:data="row.match_medic" :tableData="userList" placeholder=""
|
||||
class="full-width-input" :clearable="false" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="复核医师" prop="second_match_medic" align="center">
|
||||
<template #default="{ row }">
|
||||
<SelectTable v-model:data="row.second_match_medic" :tableData="userList" placeholder=""
|
||||
class="full-width-input" :clearable="false" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<!-- 检索弹窗 -->
|
||||
<el-dialog title="血站配型单检索" v-model="visible" width="1200px" :close-on-click-modal="false" @closed="handleClose">
|
||||
<div class="mb10">
|
||||
<el-button type="primary" @click="handleSearch">检索</el-button>
|
||||
<el-button type="success" @click="handleConfirm">确认</el-button>
|
||||
</div>
|
||||
<el-form :model="searchForm" label-width="auto" class="search-form">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="9">
|
||||
<el-form-item label="检索时间">
|
||||
<div class="date-range">
|
||||
<el-date-picker v-model="searchForm.stime" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
style="width: 47%" />
|
||||
<span class="separator">-</span>
|
||||
<el-date-picker v-model="searchForm.etime" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
style="width: 47%" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="配型单号">
|
||||
<el-input v-model="searchForm.billNo" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="科室">
|
||||
<SelectTable v-model:data="searchForm.dept" :tableData="dictData.ks" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="9">
|
||||
<el-form-item label="申请单号">
|
||||
<el-input v-model="searchForm.applyNo" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="住院号/ID号">
|
||||
<el-input v-model="searchForm.beinhos_id" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-table :data="tableData" border height="450" @row-click="jsRowclick" @row-dblclick="dblClickRow"
|
||||
highlight-current-row show-overflow-tooltip>
|
||||
<el-table-column prop="patient_name" label="患者姓名" align="center" />
|
||||
<el-table-column prop="bill_status" label="单据状态" align="center">
|
||||
<template #default="{ row }">
|
||||
{{billStatus.find(v => v.value == row.bill_status)?.label || row.bill_status}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bill_no" label="配型单号" align="center" width="150" />
|
||||
<el-table-column prop="apply_no" label="申请单号" align="center" width="150" />
|
||||
<el-table-column prop="dept_id" label="科室" align="center">
|
||||
<template #default="scope">
|
||||
{{ formatDict(scope.row.dept_id, 'ks') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="test_date" label="实验日期" width="150" align="center" />
|
||||
<el-table-column prop="affirm_abo" label="ABO复核" align="center" />
|
||||
<el-table-column prop="check_rh" label="Rh(D)复核" align="center" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<BloodMask ref="maskRef" :bloodBreed="bloodBreed" @selectRow="selectBlood" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="StationMatching">
|
||||
import DropdownTableSelect, { type TableColumnItem, type TableRowItem } from '@/components/DropdownTableSelect/index.vue'
|
||||
import dayjs from 'dayjs'
|
||||
import { getDictData, formatDict, dictData, useCommonDict } from '@/hooks'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import BloodMask from '../component/bloodMask.vue'
|
||||
import { queryBloodInfoByBloodNo } from '@/api/common'
|
||||
|
||||
const userInfo = useUserStore()
|
||||
const { userList, getUserData, getServerTime, bloodBreed, getBloodList, } = useCommonDict()
|
||||
|
||||
const maskRef = useTemplateRef('maskRef')
|
||||
const visible = ref(false)
|
||||
const saveLoading = ref(false)
|
||||
|
||||
const billStatus = ref([
|
||||
{ label: '未发血', value: 'A' },
|
||||
{ label: '已发血', value: 'B' },
|
||||
{ label: '已作废', value: 'ZF' },
|
||||
])
|
||||
|
||||
// 主表单数据
|
||||
const formData = ref({
|
||||
test_person: '',
|
||||
test_date: '',
|
||||
})
|
||||
|
||||
const bloodNo = ref('')
|
||||
const matchType = ref('add')
|
||||
|
||||
// 配型血液表格
|
||||
const matchTable = ref<any[]>([])
|
||||
|
||||
// 检索弹窗
|
||||
const searchForm = ref({
|
||||
stime: dayjs().format('YYYY-MM-DD'),
|
||||
etime: dayjs().format('YYYY-MM-DD'),
|
||||
})
|
||||
const tableData = ref([])
|
||||
const selectRow = ref({})
|
||||
|
||||
// 申请单下拉配置
|
||||
const applyColumns = ref<TableColumnItem[]>([
|
||||
{ label: '申请单号', prop: 'bill_no' },
|
||||
{ label: '患者姓名', prop: 'patient_name' },
|
||||
{ label: '科室', prop: 'dept_id', slotName: 'dept_id' },
|
||||
{ label: '申请时间', prop: 'apply_date' },
|
||||
{ label: '申请品种', prop: 'blood_breed', slotName: 'blood_breed' }
|
||||
])
|
||||
const applyTableData = ref<TableRowItem[]>([])
|
||||
|
||||
// 加载申请单数据
|
||||
const loadApplyData = () => {
|
||||
// TODO: 对接接口获取待配型申请单列表
|
||||
applyTableData.value = []
|
||||
}
|
||||
|
||||
// 选择申请单后查询详情
|
||||
const searchApply = () => {
|
||||
// TODO: 对接接口查询申请单详情
|
||||
if (formData.value.rh_type == '-') {
|
||||
ElMessageBox.alert(`患者为Rh(D)阴性血型,请注意!`, '提示', { type: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
// 血液流水号回车处理
|
||||
const bloodEnter = () => {
|
||||
if (!bloodNo.value) return
|
||||
const index = matchTable.value.findIndex(item => item.blood_no == bloodNo.value)
|
||||
|
||||
if (matchType.value == 'del') {
|
||||
if (index > -1) {
|
||||
ElMessageBox.confirm(`确定取消血液${matchTable.value[index].blood_no}吗?`, '提示', { type: 'warning' }).then(() => {
|
||||
matchTable.value.splice(index, 1)
|
||||
})
|
||||
} else {
|
||||
ElMessage.warning('该血液流水号不存在,请检查!')
|
||||
}
|
||||
} else {
|
||||
if (index > -1) return ElMessage.warning('该血液流水号已存在,请检查!')
|
||||
queryBloodInfoByBloodNo({ bloodNo: bloodNo.value }).then(res => {
|
||||
if (res.data.length == 1) {
|
||||
addMatchRow(res.data[0])
|
||||
} else if (res.data.length > 1) {
|
||||
maskRef.value.open(res.data)
|
||||
} else {
|
||||
ElMessage.warning('未找到该血液流水号信息!')
|
||||
}
|
||||
}).finally(() => {
|
||||
bloodNo.value = ''
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const selectBlood = (row) => {
|
||||
addMatchRow(row)
|
||||
}
|
||||
|
||||
const addMatchRow = (row: any) => {
|
||||
matchTable.value.push({
|
||||
blood_no: row.blood_no || '',
|
||||
product_no: row.product_no || '',
|
||||
blood_breed: row.blood_breed || '',
|
||||
blood_type: row.blood_type || '',
|
||||
rh_blood_type: row.rh_blood_type || '',
|
||||
match_method: '',
|
||||
check_method: '',
|
||||
result: '',
|
||||
match_date: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
match_medic: userInfo.name,
|
||||
second_match_medic: '',
|
||||
})
|
||||
bloodNo.value = ''
|
||||
}
|
||||
|
||||
// 增加明细
|
||||
const addDetail = () => {
|
||||
ElMessage.info('请在输入框中输入血液流水号后按回车添加明细')
|
||||
}
|
||||
|
||||
// 删除明细
|
||||
const deleteDetail = () => {
|
||||
if (matchTable.value.length == 0) return ElMessage.warning('暂无明细数据')
|
||||
ElMessageBox.confirm(`确定删除选中的明细吗?`, '提示', { type: 'warning' }).then(() => {
|
||||
// TODO: 支持选中多行删除,此处简化为删除最后一行
|
||||
matchTable.value.pop()
|
||||
ElMessage.success('删除成功')
|
||||
})
|
||||
}
|
||||
|
||||
// 保存
|
||||
const saveData = () => {
|
||||
if (!formData.value.bill_no) return ElMessage.warning('请选择输血申请单!')
|
||||
if (matchTable.value.length == 0) return ElMessage.warning('请添加配型血液明细!')
|
||||
const allValid = matchTable.value.every(item => item.second_match_medic?.trim())
|
||||
if (!allValid) return ElMessage.warning('请填写复核医师!')
|
||||
|
||||
saveLoading.value = true
|
||||
// TODO: 对接保存接口
|
||||
setTimeout(() => {
|
||||
saveLoading.value = false
|
||||
ElMessage.success('保存成功')
|
||||
}, 500)
|
||||
}
|
||||
|
||||
// 关闭
|
||||
const closeHandle = () => {
|
||||
ElMessageBox.confirm('确定关闭当前页面吗?未保存的数据将丢失!', '提示', { type: 'warning' }).then(() => {
|
||||
formData.value = {
|
||||
test_person: '',
|
||||
test_date: '',
|
||||
}
|
||||
matchTable.value = []
|
||||
})
|
||||
}
|
||||
|
||||
// 检索相关
|
||||
const openJsHandle = () => {
|
||||
visible.value = true
|
||||
handleSearch()
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
visible.value = false
|
||||
searchForm.value = {
|
||||
stime: dayjs().format('YYYY-MM-DD'),
|
||||
etime: dayjs().format('YYYY-MM-DD'),
|
||||
}
|
||||
selectRow.value = {}
|
||||
}
|
||||
|
||||
const handleConfirm = () => {
|
||||
if (!selectRow.value.bill_no) return ElMessage.warning('请选择血站配型单!')
|
||||
// TODO: 加载选中配型单详情
|
||||
visible.value = false
|
||||
}
|
||||
|
||||
const jsRowclick = (row) => {
|
||||
selectRow.value = row
|
||||
}
|
||||
|
||||
const dblClickRow = (row) => {
|
||||
selectRow.value = row
|
||||
handleConfirm()
|
||||
}
|
||||
|
||||
const handleSearch = () => {
|
||||
searchForm.value.stime = dayjs(searchForm.value.stime).format('YYYY-MM-DD') + ' 00:00:00'
|
||||
searchForm.value.etime = dayjs(searchForm.value.etime).format('YYYY-MM-DD') + ' 23:59:59'
|
||||
// TODO: 对接检索接口
|
||||
tableData.value = []
|
||||
}
|
||||
|
||||
const formatBreed = (breeds: Array<string>) => {
|
||||
if (!breeds) return ''
|
||||
return breeds.map(item => {
|
||||
const match = bloodBreed.value.find(v => v.value === item)
|
||||
return match ? match.label : item
|
||||
}).join('、')
|
||||
}
|
||||
|
||||
const getTime = () => {
|
||||
getServerTime().then(time => {
|
||||
formData.value.test_date = time
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDictData('ks', 'bq', 'sxmd', 'billApplyStatus', 'ktsx', 'abotype', 'subgroup', 'sxzz', 'rhtype', 'pxff', 'pxjg', 'zccc')
|
||||
getBloodList()
|
||||
getUserData()
|
||||
getTime()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.box-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
|
||||
.form_box {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card-box {
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.space-item {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.pxBox {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 0 !important;
|
||||
|
||||
.table-box {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.checkbox-row {
|
||||
display: flex;
|
||||
gap: 40px;
|
||||
padding-left: 10px;
|
||||
|
||||
:deep(.el-checkbox) {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.match-blood-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.radio-group {
|
||||
:deep(.el-radio) {
|
||||
margin-right: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.full-width-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.blood-type-group {
|
||||
display: flex;
|
||||
|
||||
.blood-type-tag {
|
||||
width: 150px;
|
||||
border-radius: 4px;
|
||||
color: #fff;
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
padding-left: 20px;
|
||||
|
||||
&.ab {
|
||||
background: url('@/assets/images/blood_zero.png');
|
||||
background-size: 100% 100%;
|
||||
color: #3594c7;
|
||||
|
||||
.x_type {
|
||||
color: #ff3b62;
|
||||
}
|
||||
}
|
||||
|
||||
&.rh {
|
||||
background-color: #e8f7ff;
|
||||
color: #3594c7;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #f00 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mb10 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.date-range {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
|
||||
.separator {
|
||||
width: 6%;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -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<boolean>((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) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user