门诊医生站-》开立诊断 页面调整

This commit is contained in:
itcast
2026-01-16 15:46:43 +08:00
parent 2b3add4808
commit be0514bc08
86 changed files with 2224 additions and 3929 deletions

View File

@@ -17,7 +17,7 @@
</el-button>
</div>
</div>
<!--检验信息-->
<el-table
ref="inspectionTableRef"
:data="inspectionList"
@@ -79,7 +79,7 @@
</div>
</div>
<!-- 下方申请单和检验项目选择器 -->
<!-- 下方申请单和检验项目选择器 -->
<div style="display: flex; gap: 20px">
<!-- 左侧申请单和检验信息 -->
<div style="width: 55%">
@@ -88,18 +88,18 @@
<div class="application-form" style="padding: 20px; height: 700px; overflow-y: auto; border: 1px solid #e4e7ed; border-radius: 4px; margin: 10px;">
<div style="margin-bottom: 20px">
<label style="display: block; margin-bottom: 5px; font-weight: bold">申请单号</label>
<el-input v-model="formData.applicationNo" readonly size="small" />
<el-input v-model="formData.applicationNo" disabled size="small" />
</div>
<!-- 患者信息行 -->
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; margin-bottom: 20px">
<div>
<label style="display: block; margin-bottom: 5px; font-weight: bold">姓名</label>
<el-input v-model="formData.patientName" readonly size="small" />
<el-input v-model="formData.patientName" disabled size="small" />
</div>
<div>
<label style="display: block; margin-bottom: 5px; font-weight: bold">就诊卡号</label>
<el-input v-model="formData.identifierNo" readonly size="small" />
<el-input v-model="formData.cardNo" disabled size="small" />
</div>
<div>
<label style="display: block; margin-bottom: 5px; font-weight: bold">费用性质</label>
@@ -115,7 +115,6 @@
<!-- 申请信息行 -->
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; margin-bottom: 20px">
<!--申请日期-->
<div>
<label style="display: block; margin-bottom: 5px; font-weight: bold">申请日期</label>
<el-date-picker
@@ -128,7 +127,6 @@
style="width: 100%"
/>
</div>
<!--申请科室-->
<div>
<label style="display: block; margin-bottom: 5px; font-weight: bold">申请科室</label>
<el-select v-model="formData.departmentName" placeholder="请选择申请科室" size="small" style="width: 100%" disabled>
@@ -137,11 +135,9 @@
<el-option label="儿科" value="pediatrics" />
</el-select>
</div>
<!--申请医生-->
<div>
<label style="display: block; margin-bottom: 5px; font-weight: bold">申请医生</label>
<el-select v-model="formData.doctorName" placeholder="请选择申请医生" size="small" style="width: 100%">
<el-select v-model="formData.doctorName" placeholder="请选择申请医生" size="small" style="width: 100%" disabled>
<el-option label="张医生" value="doctor_zhang" />
<el-option label="李医生" value="doctor_li" />
<el-option label="王医生" value="doctor_wang" />
@@ -168,7 +164,7 @@
<div v-if="validationErrors.executeDepartment" class="error-message">请选择执行科室</div>
</div>
<!-- 诊断描述 -->
<!-- 诊断相关字段 -->
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px">
<div :class="{ 'form-item-error': validationErrors.diagnosisDesc }">
<label style="display: block; margin-bottom: 5px; font-weight: bold">诊断描述 <span style="color: #f56c6c">*</span></label>
@@ -252,6 +248,7 @@
</div>
</div>
</el-tab-pane>
<el-tab-pane label="检验信息" name="inspectionInfo">
<div style="padding: 20px; height: 700px; overflow-y: auto; border: 1px solid #e4e7ed; border-radius: 4px; margin: 10px;">
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px">
@@ -461,7 +458,7 @@ const formData = reactive({
applicationId: null,
applicationNo: '202511210001',
patientName: '',
identifierNo: '',
cardNo: '',
feeType: 'self',
applicationDate: new Date(),
departmentName: '',
@@ -582,11 +579,11 @@ const getFilteredItems = (categoryKey) => {
// 初始化数据
function initData() {
// console.log('检验组件初始化patientInfo:', props.patientInfo)
console.log('检验组件初始化patientInfo:', props.patientInfo)
if (props.patientInfo) {
queryParams.encounterId = props.patientInfo.encounterId
formData.patientName = props.patientInfo.patientName || ''
formData.identifierNo = props.patientInfo.identifierNo || ''
formData.cardNo = props.patientInfo.cardNo || ''
formData.departmentName = props.patientInfo.departmentName || ''
formData.doctorName = props.patientInfo.doctorName || ''
}
@@ -598,28 +595,20 @@ function initData() {
// 获取检验申请单列表
function getInspectionList() {
// 如果没有encounterId,不调用接口
if (!queryParams.encounterId) {
// console.warn('【检验】encounterId为空,不调用接口')
return
}
loading.value = true
// 调用真实的API只传递 encounterId 参数
// console.log('【检验】调用API,encounterId:', queryParams.encounterId)
getInspectionApplicationList({ encounterId: queryParams.encounterId }).then((res) => {
if (res.code === 200) {
inspectionList.value = res.data || []
total.value = res.data?.length || 0
// console.log('【检验】获取数据成功,数量:', inspectionList.value.length)
} else {
inspectionList.value = []
total.value = 0
ElMessage.error('获取检验申请单列表失败')
}
}).catch((error) => {
// console.error('获取检验申请单列表异常:', error)
console.error('获取检验申请单列表异常:', error)
inspectionList.value = []
total.value = 0
ElMessage.error('获取检验申请单列表异常')
@@ -630,7 +619,7 @@ function getInspectionList() {
// 新增申请单
function handleNewApplication() {
// console.log('点击新增按钮')
console.log('点击新增按钮')
resetForm()
// 生成申请单号
formData.applicationNo = generateApplicationNo()
@@ -740,7 +729,7 @@ function handleSave() {
totalAmount: selectedInspectionItems.value.reduce((sum, item) => sum + item.price + (item.serviceFee || 0), 0)
}
// console.log('保存检验申请单数据:', saveData)
console.log('保存检验申请单数据:', saveData)
// 调用真实的API保存
saveInspectionApplication(saveData).then((res) => {
@@ -754,7 +743,7 @@ function handleSave() {
ElMessage.error(res.message || '保存失败')
}
}).catch((error) => {
// console.error('保存检验申请单异常:', error)
console.error('保存检验申请单异常:', error)
ElMessage.error('保存异常')
})
}
@@ -764,7 +753,7 @@ function handleFormSave() {
formRef.value?.validate((valid) => {
if (valid) {
formData.inspectionItems = selectedInspectionItems.value.map(item => item.id)
// console.log('保存检验申请单表单数据:', formData)
console.log('保存检验申请单表单数据:', formData)
ElMessage.success('保存成功')
showForm.value = false
getInspectionList()
@@ -774,7 +763,7 @@ function handleFormSave() {
// 查看详情
function handleView(row) {
// console.log('点击查看按钮,数据:', row)
console.log('点击查看按钮,数据:', row)
// 加载表单数据
Object.assign(formData, row)
@@ -814,7 +803,7 @@ function switchCategory(category) {
// 处理搜索
function handleSearch() {
// 搜索逻辑已在getFilteredItems中实现这里可以添加额外的搜索逻辑
// console.log('搜索关键词:', searchKeyword.value)
console.log('搜索关键词:', searchKeyword.value)
}
// 处理项目项点击(排除勾选框点击)
@@ -869,7 +858,7 @@ function handleSelectionChange(selection) {
// 打印申请单
function handlePrint(row) {
// console.log('打印申请单:', row)
console.log('打印申请单:', row)
// 切换到申请单TAB
leftActiveTab.value = 'application'
@@ -952,7 +941,7 @@ function handleDelete(row) {
confirmButtonClass: 'el-button--danger'
}
).then(() => {
// console.log('删除申请单:', row)
console.log('删除申请单:', row)
// 调用真实的API删除
deleteInspectionApplication(row.applicationId).then((res) => {
if (res.code === 200) {
@@ -963,7 +952,7 @@ function handleDelete(row) {
ElMessage.error(res.message || '删除失败')
}
}).catch((error) => {
// console.error('删除检验申请单异常:', error)
console.error('删除检验申请单异常:', error)
ElMessage.error('删除异常')
})
}).catch(() => {
@@ -988,16 +977,6 @@ watch(() => props.activeTab, (newVal) => {
}
})
// 监听patientInfo变化,确保encounterId及时更新
watch(() => props.patientInfo, (newVal) => {
// console.log('【检验】patientInfo变化:', newVal)
console.log('【检验】接收到的完整patientInfo:', JSON.stringify(newVal, null, 2))
if (newVal && newVal.encounterId) {
queryParams.encounterId = newVal.encounterId
// console.log('【检验】更新encounterId:', queryParams.encounterId)
}
}, { deep: true, immediate: true })
// 初始化
onMounted(() => {
initData()