增加模块、餐前餐后状态输入框
This commit is contained in:
parent
2bb287dda9
commit
a5ffa9d636
@ -18,6 +18,9 @@ export interface itemsVO {
|
|||||||
moduleID: number // 模块ID:体检单元ID 模块名称ID
|
moduleID: number // 模块ID:体检单元ID 模块名称ID
|
||||||
moduleName: string // 模块名称:体检单元
|
moduleName: string // 模块名称:体检单元
|
||||||
sectionID: string // 科室ID
|
sectionID: string // 科室ID
|
||||||
|
groupname: string // 模块名称
|
||||||
|
groupcode: string // 模块ID
|
||||||
|
mealfrontorafter: string // 餐前餐后
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查项目 API
|
// 检查项目 API
|
||||||
|
@ -29,6 +29,7 @@ export interface ProfileVO {
|
|||||||
loginIp: string
|
loginIp: string
|
||||||
loginDate: Date
|
loginDate: Date
|
||||||
createTime: Date
|
createTime: Date
|
||||||
|
deptId: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UserProfileUpdateReqVO {
|
export interface UserProfileUpdateReqVO {
|
||||||
|
@ -3,62 +3,16 @@
|
|||||||
<!-- 左侧人员列表 -->
|
<!-- 左侧人员列表 -->
|
||||||
<div class="patient-list">
|
<div class="patient-list">
|
||||||
<div class="list-header">
|
<div class="list-header">
|
||||||
|
|
||||||
<div class="filter-options">
|
<div class="filter-options">
|
||||||
<div class="header-title">人员列表</div>
|
<div class="header-title">人员列表</div>
|
||||||
<!-- <label class="radio-label">
|
<!-- 简化体检编号搜索框 -->
|
||||||
<input type="radio" name="status" checked/>
|
<div class="search-box medical-sn-search">
|
||||||
<span>未检</span>
|
<input
|
||||||
</label>
|
v-model="medicalSnQuery"
|
||||||
<label class="radio-label">
|
placeholder="请输入体检编号"
|
||||||
<input type="radio" name="status"/>
|
@keyup.enter="handleMedicalSnSearch"
|
||||||
<span>已检</span>
|
/>
|
||||||
</label> -->
|
|
||||||
</div>
|
|
||||||
<div class="view-options">
|
|
||||||
<div class="view-buttons">
|
|
||||||
<button
|
|
||||||
v-for="period in timePeriods"
|
|
||||||
:key="period.value"
|
|
||||||
class="view-btn"
|
|
||||||
:class="{ active: selectedPeriod === period.value }"
|
|
||||||
@click="handlePeriodChange(period.value)"
|
|
||||||
>
|
|
||||||
{{ period.label }}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 添加日期选择器组件和搜索按钮 -->
|
|
||||||
<div v-if="showDatePicker" class="date-picker-container">
|
|
||||||
<div class="date-picker-wrapper">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="customDateRange"
|
|
||||||
type="daterange"
|
|
||||||
unlink-panels
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
:shortcuts="shortcuts"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
@click="handleDateSearch"
|
|
||||||
class="search-button"
|
|
||||||
>搜索</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="search-box">
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
v-model="searchQuery"
|
|
||||||
placeholder="请输入姓名"
|
|
||||||
@input="handleSearch"
|
|
||||||
/>
|
|
||||||
<i class="el-icon-search search-icon"></i>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="list-content">
|
<div class="list-content">
|
||||||
@ -72,6 +26,13 @@
|
|||||||
<div class="patient-info">
|
<div class="patient-info">
|
||||||
<span class="name">{{ patient.pname }}</span>
|
<span class="name">{{ patient.pname }}</span>
|
||||||
<span class="medical-sn">{{ patient.medicalSn }}</span>
|
<span class="medical-sn">{{ patient.medicalSn }}</span>
|
||||||
|
<el-tag
|
||||||
|
:type="getStatusTagType(patient.status)"
|
||||||
|
size="small"
|
||||||
|
class="status-tag"
|
||||||
|
>
|
||||||
|
{{ getStatusText(patient.status) }}
|
||||||
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 将分页组件移到list-content内部底部 -->
|
<!-- 将分页组件移到list-content内部底部 -->
|
||||||
@ -113,12 +74,13 @@
|
|||||||
<label>姓名:</label>
|
<label>姓名:</label>
|
||||||
<span>{{ reportData.pname }}</span>
|
<span>{{ reportData.pname }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="info-row">
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<label>性别:</label>
|
<label>性别:</label>
|
||||||
<span>{{ reportData.gender }}</span>
|
<span>{{ reportData.gender }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<label>年龄:</label>
|
<label>年龄:</label>
|
||||||
<span>{{ age }}岁</span>
|
<span>{{ age }}岁</span>
|
||||||
@ -127,14 +89,6 @@
|
|||||||
<label>电话:</label>
|
<label>电话:</label>
|
||||||
<span>{{ reportData.phoneNum }}</span>
|
<span>{{ reportData.phoneNum }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-item">
|
|
||||||
<label>国籍:</label>
|
|
||||||
<span>{{ reportData.nationality }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-item">
|
|
||||||
<label>民族:</label>
|
|
||||||
<span>{{ reportData.nation }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -190,12 +144,15 @@
|
|||||||
type="text"
|
type="text"
|
||||||
v-model="item.value"
|
v-model="item.value"
|
||||||
@change="handleResultChange(item)"
|
@change="handleResultChange(item)"
|
||||||
|
@click="checkEditPermission"
|
||||||
class="cell-input"
|
class="cell-input"
|
||||||
:disabled="isItemDisabled(item)"
|
:readonly="isReadOnly"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-cell" style="width: 10%">{{ item.unit }}</div>
|
<div class="table-cell" style="width: 10%">{{ item.unit }}</div>
|
||||||
<div class="table-cell" style="width: 15%">{{ item.reference }}</div>
|
<div class="table-cell" style="width: 15%">
|
||||||
|
{{ formatReference(item.reference) }}
|
||||||
|
</div>
|
||||||
<div class="table-cell" style="width: 10%">{{ item.note }}</div>
|
<div class="table-cell" style="width: 10%">{{ item.note }}</div>
|
||||||
<div class="table-cell" style="width: 15%">{{ item.risk }}</div>
|
<div class="table-cell" style="width: 15%">{{ item.risk }}</div>
|
||||||
<div class="table-cell" style="width: 10%">
|
<div class="table-cell" style="width: 10%">
|
||||||
@ -212,7 +169,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="table-cell" style="width: 10%">
|
<div class="table-cell" style="width: 10%">
|
||||||
<el-dropdown @command="handleOperation">
|
<el-dropdown @command="handleOperation">
|
||||||
<el-button size="small">
|
<el-button size="small" :class="{ 'view-only': isReadOnly }">
|
||||||
更多操作
|
更多操作
|
||||||
<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -253,6 +210,7 @@
|
|||||||
v-model="examConclusion"
|
v-model="examConclusion"
|
||||||
placeholder="输入多个以分号隔开"
|
placeholder="输入多个以分号隔开"
|
||||||
class="summary-textarea"
|
class="summary-textarea"
|
||||||
|
:readonly="isReadOnly"
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -266,11 +224,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="right-section">
|
<div class="right-section">
|
||||||
<div class="action-buttons">
|
<div class="action-buttons">
|
||||||
<button class="action-btn">同步结果</button>
|
<button class="action-btn" @click="checkEditPermission">同步结果</button>
|
||||||
<button class="action-btn">报告预览</button>
|
<button class="action-btn">报告预览</button>
|
||||||
<button class="action-btn">复检</button>
|
<button class="action-btn" @click="checkEditPermission">弃检</button>
|
||||||
<button class="action-btn">弃检</button>
|
<button
|
||||||
<button class="action-btn primary" @click="handleSaveResults">保存结果</button>
|
v-if="!isReadOnly"
|
||||||
|
class="action-btn primary"
|
||||||
|
@click="handleSaveResults"
|
||||||
|
>
|
||||||
|
保存结果
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -425,6 +388,41 @@ const originalPatients = ref([]) // 保存原始患者列表
|
|||||||
// 添加数据缓存
|
// 添加数据缓存
|
||||||
const patientDataCache = ref(new Map())
|
const patientDataCache = ref(new Map())
|
||||||
|
|
||||||
|
// 添加体检编号搜索相关
|
||||||
|
const medicalSnQuery = ref('')
|
||||||
|
|
||||||
|
// 添加体检编号搜索处理函数
|
||||||
|
const handleMedicalSnSearch = async () => {
|
||||||
|
if (!medicalSnQuery.value) {
|
||||||
|
ElMessage.warning('请输入体检编号')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
medicalSn: medicalSnQuery.value,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await PatientApi.getPatientPage(params)
|
||||||
|
if (res.list && res.list.length > 0) {
|
||||||
|
patients.value = res.list
|
||||||
|
total.value = res.total
|
||||||
|
// 自动选中第一个查询结果
|
||||||
|
handlePatientSelect(res.list[0])
|
||||||
|
} else {
|
||||||
|
ElMessage.warning('未找到相关患者')
|
||||||
|
patients.value = []
|
||||||
|
total.value = 0
|
||||||
|
selectedPatient.value = null
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('查询失败:', error)
|
||||||
|
ElMessage.error('查询失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 修改获取患者列表数据的函数
|
// 修改获取患者列表数据的函数
|
||||||
const getPatientList = async () => {
|
const getPatientList = async () => {
|
||||||
try {
|
try {
|
||||||
@ -458,6 +456,7 @@ const getpatientitemData = async (medicalSn) => {
|
|||||||
try {
|
try {
|
||||||
const userProfile = await getUserProfile()
|
const userProfile = await getUserProfile()
|
||||||
user.value = userProfile
|
user.value = userProfile
|
||||||
|
console.log('当前登录用户信息:', userProfile)
|
||||||
} catch (userError) {
|
} catch (userError) {
|
||||||
console.error('获取用户信息失败:', userError)
|
console.error('获取用户信息失败:', userError)
|
||||||
}
|
}
|
||||||
@ -489,7 +488,8 @@ const loadPatientData = async (patient) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const [userData, patientData, itemsRes] = await Promise.all([
|
// 获取用户信息和部门ID
|
||||||
|
const [userProfile, patientData, itemsRes] = await Promise.all([
|
||||||
getUserProfile(),
|
getUserProfile(),
|
||||||
PatientApi.getPatient(patient.id),
|
PatientApi.getPatient(patient.id),
|
||||||
PatientitemsApi.getPatientitemsPage({
|
PatientitemsApi.getPatientitemsPage({
|
||||||
@ -499,14 +499,18 @@ const loadPatientData = async (patient) => {
|
|||||||
})
|
})
|
||||||
])
|
])
|
||||||
|
|
||||||
user.value = userData
|
user.value = userProfile
|
||||||
|
const userDeptId = userProfile // 获取用户部门ID
|
||||||
reportData.value = patientData
|
reportData.value = patientData
|
||||||
|
|
||||||
if (itemsRes.list && itemsRes.list.length > 0) {
|
if (itemsRes.list && itemsRes.list.length > 0) {
|
||||||
examConclusion.value = itemsRes.list[0].analyse || ''
|
examConclusion.value = itemsRes.list[0].analyse || ''
|
||||||
|
|
||||||
const itemsBySection = {}
|
const itemsBySection = {}
|
||||||
itemsRes.list.forEach(item => {
|
// 筛选属于当前用户部门的项目
|
||||||
|
const filteredItems = itemsRes.list.filter(item => item.sectionID == userProfile.deptId)
|
||||||
|
console.log('当前登录用户信息:',filteredItems )
|
||||||
|
filteredItems.forEach(item => {
|
||||||
const sectionType = '一般检查'
|
const sectionType = '一般检查'
|
||||||
if (!itemsBySection[sectionType]) {
|
if (!itemsBySection[sectionType]) {
|
||||||
itemsBySection[sectionType] = []
|
itemsBySection[sectionType] = []
|
||||||
@ -558,37 +562,59 @@ const loadPatientData = async (patient) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加辅助函数
|
// 修改获取状态提示的函数
|
||||||
const getStatusNote = (item) => {
|
const getStatusNote = (item) => {
|
||||||
|
if (!item.reference || item.reference === 'null-null') {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
const value = parseFloat(item.itemResult)
|
const value = parseFloat(item.itemResult)
|
||||||
const low = item.lowValue
|
const [low, high] = item.reference.split('-').map(val => val === 'null' ? null : Number(val))
|
||||||
const high = item.highValue
|
|
||||||
|
if (low === null || high === null) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
if (value < low) return '↓'
|
if (value < low) return '↓'
|
||||||
if (value > high) return '↑'
|
if (value > high) return '↑'
|
||||||
return '-'
|
return '-'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改获取风险等级的函数
|
||||||
const getRiskLevel = (item) => {
|
const getRiskLevel = (item) => {
|
||||||
|
if (!item.reference || item.reference === 'null-null') {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
const value = parseFloat(item.itemResult)
|
const value = parseFloat(item.itemResult)
|
||||||
const low = item.lowValue
|
const [low, high] = item.reference.split('-').map(val => val === 'null' ? null : Number(val))
|
||||||
const high = item.highValue
|
|
||||||
|
if (low === null || high === null) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
if (value < low) return '低于正常值'
|
if (value < low) return '低于正常值'
|
||||||
if (value > high) return '高于正常值'
|
if (value > high) return '高于正常值'
|
||||||
return '正常'
|
return '正常'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改获取行状态的函数
|
||||||
const getRowStatus = (item) => {
|
const getRowStatus = (item) => {
|
||||||
const value = parseFloat(item.itemResult)
|
if (!item.reference || item.reference === 'null-null') {
|
||||||
const low = item.lowValue
|
|
||||||
const high = item.highValue
|
|
||||||
if (value > high) {
|
|
||||||
return 'danger'
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const value = parseFloat(item.itemResult)
|
||||||
|
const [low, high] = item.reference.split('-').map(val => val === 'null' ? null : Number(val))
|
||||||
|
|
||||||
|
if (low === null || high === null) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value > high) {
|
||||||
|
return 'danger'
|
||||||
|
}
|
||||||
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改科室名称映射函数
|
// 修改科室名称映射函数
|
||||||
@ -694,16 +720,6 @@ onMounted(() => {
|
|||||||
inspecttime: ''
|
inspecttime: ''
|
||||||
}
|
}
|
||||||
customDateRange.value = []
|
customDateRange.value = []
|
||||||
|
|
||||||
// 设置默认为今日
|
|
||||||
const today = new Date()
|
|
||||||
selectedPeriod.value = 'today'
|
|
||||||
const todayStart = new Date(today.setHours(0, 0, 0, 0))
|
|
||||||
const todayEnd = new Date(today.setHours(23, 59, 59, 999))
|
|
||||||
customDateRange.value = [todayStart, todayEnd]
|
|
||||||
|
|
||||||
// 获取今日数据
|
|
||||||
fetchPatientsByDate()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 当前选中的时间周期
|
// 当前选中的时间周期
|
||||||
@ -929,95 +945,169 @@ const handleSearch = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改判断项目是否禁用的方法
|
// 添加是否只读的计算属性
|
||||||
const isItemDisabled = (item) => {
|
const isReadOnly = computed(() => {
|
||||||
// 使用 itemStatus 判断:2 表示放弃
|
return selectedPatient.value?.status === 1
|
||||||
return item.itemStatus === '2'
|
})
|
||||||
|
|
||||||
|
// 检查编辑权限的方法
|
||||||
|
const checkEditPermission = () => {
|
||||||
|
if (isReadOnly.value) {
|
||||||
|
ElMessage.warning('检查结果已保存,不可进行编辑')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改操作处理函数
|
// 修改操作处理函数
|
||||||
const handleOperation = async ({ type, item }) => {
|
const handleOperation = ({ type, item }) => {
|
||||||
|
if (!checkEditPermission()) return
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'positive':
|
case 'positive':
|
||||||
if (isItemDisabled(item)) {
|
|
||||||
ElMessage.warning('已弃检的项目不能修改')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
item.positive = '阳性'
|
item.positive = '阳性'
|
||||||
break
|
break
|
||||||
case 'negative':
|
case 'negative':
|
||||||
if (isItemDisabled(item)) {
|
|
||||||
ElMessage.warning('已弃检的项目不能修改')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
item.positive = '阴性'
|
item.positive = '阴性'
|
||||||
break
|
break
|
||||||
case 'abandon':
|
case 'abandon':
|
||||||
// 如果当前是弃检状态,则恢复为正常状态
|
|
||||||
if (item.itemStatus === '2') {
|
if (item.itemStatus === '2') {
|
||||||
item.itemStatus = '0' // 恢复为未检状态
|
item.itemStatus = '0'
|
||||||
ElMessage.success('已恢复正常状态')
|
ElMessage.success('已恢复正常状态')
|
||||||
return
|
} else {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
'确定要弃检该项目吗?弃检后将无法编辑该项目。',
|
||||||
|
'警告',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
item.itemStatus = '2'
|
||||||
|
ElMessage.success('已设置为弃检')
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage.info('已取消弃检')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果是正常状态,则确认是否弃检
|
|
||||||
ElMessageBox.confirm(
|
|
||||||
'确定要弃检该项目吗?弃检后将无法编辑该项目。',
|
|
||||||
'警告',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
item.itemStatus = '2' // 设置弃检状态
|
|
||||||
ElMessage.success('已设置为弃检')
|
|
||||||
}).catch(() => {
|
|
||||||
ElMessage.info('已取消弃检')
|
|
||||||
})
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改结果变化处理函数
|
// 修改结果变化处理函数
|
||||||
const handleResultChange = (item) => {
|
const handleResultChange = (item) => {
|
||||||
if (isItemDisabled(item)) {
|
if (!checkEditPermission()) {
|
||||||
ElMessage.warning('已弃检的项目不能修改')
|
item.value = item.originalValue || ''
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
item.itemStatus = '1' // 设置为已检状态
|
item.itemStatus = '1' // 设置为已检状态
|
||||||
|
|
||||||
|
// 如果没有有效的参考值,所有相关字段都设为空
|
||||||
|
if (!item.reference || item.reference === 'null-null') {
|
||||||
|
item.note = ''
|
||||||
|
item.risk = ''
|
||||||
|
item.status = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const value = parseFloat(item.value)
|
const value = parseFloat(item.value)
|
||||||
const [low, high] = item.reference.split('-').map(Number)
|
const [low, high] = item.reference.split('-').map(val => val === 'null' ? null : Number(val))
|
||||||
|
|
||||||
|
if (low === null || high === null) {
|
||||||
|
item.note = ''
|
||||||
|
item.risk = ''
|
||||||
|
item.status = ''
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
item.note = getStatusNote({ itemResult: value, lowValue: low, highValue: high })
|
item.note = getStatusNote({ itemResult: value, lowValue: low, highValue: high })
|
||||||
item.risk = getRiskLevel({ itemResult: value, lowValue: low, highValue: high })
|
item.risk = getRiskLevel({ itemResult: value, lowValue: low, highValue: high })
|
||||||
item.status = getRowStatus({ itemResult: value, lowValue: low, highValue: high })
|
item.status = getRowStatus({ itemResult: value, lowValue: low, highValue: high })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改保存结果方法
|
// 添加状态映射函数
|
||||||
|
const getItemStatusText = (status) => {
|
||||||
|
const statusMap = {
|
||||||
|
'0': '未检查',
|
||||||
|
'1': '已检查',
|
||||||
|
'2': '已弃检',
|
||||||
|
'3': '待查'
|
||||||
|
}
|
||||||
|
return statusMap[status] || status
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改保存结果方法中的相关逻辑
|
||||||
const handleSaveResults = async () => {
|
const handleSaveResults = async () => {
|
||||||
try {
|
try {
|
||||||
// 先获取用户信息
|
|
||||||
const userProfile = await getUserProfile()
|
const userProfile = await getUserProfile()
|
||||||
user.value = userProfile
|
user.value = userProfile
|
||||||
|
|
||||||
|
// 获取当前时间戳
|
||||||
|
const currentTime = new Date().getTime()
|
||||||
|
|
||||||
|
// 1. 更新检查项目结果
|
||||||
const updatedItems = Object.values(examItems.value).flatMap(sectionItems =>
|
const updatedItems = Object.values(examItems.value).flatMap(sectionItems =>
|
||||||
sectionItems.map(item => ({
|
sectionItems.map(item => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
|
status: item.status,
|
||||||
itemResult: item.value || '',
|
itemResult: item.value || '',
|
||||||
positive: item.positive === '阳性' ? '1' : '0',
|
positive: item.positive === '阳性' ? '1' : '0',
|
||||||
analyse: examConclusion.value,
|
analyse: examConclusion.value,
|
||||||
inspectdoctor: user.value?.nickname || '',
|
inspectdoctor: user.value?.nickname || '',
|
||||||
itemStatus: item.itemStatus || '1', // 包含弃检状态
|
itemStatus: item.itemStatus,
|
||||||
inspecttime: new Date().toISOString()
|
inspecttime: currentTime
|
||||||
}))
|
}))
|
||||||
)
|
)
|
||||||
|
|
||||||
console.log('发送的数据:', updatedItems)
|
|
||||||
await PatientitemsApi.updatePatientitemsBatch(updatedItems)
|
await PatientitemsApi.updatePatientitemsBatch(updatedItems)
|
||||||
|
|
||||||
|
// 2. 更新患者状态为已检查
|
||||||
|
if (selectedPatient.value) {
|
||||||
|
const patientData = {
|
||||||
|
...selectedPatient.value,
|
||||||
|
status: 1,
|
||||||
|
medicalDateTime: currentTime
|
||||||
|
}
|
||||||
|
await PatientApi.updatePatient(patientData)
|
||||||
|
|
||||||
|
// 3. 刷新患者列表
|
||||||
|
await getPatientList()
|
||||||
|
}
|
||||||
|
|
||||||
message.success('保存成功')
|
message.success('保存成功')
|
||||||
|
|
||||||
|
// 4. 清空所有相关数据
|
||||||
|
selectedPatient.value = null
|
||||||
|
examItems.value = {}
|
||||||
|
examTabs.value = []
|
||||||
|
currentTab.value = ''
|
||||||
|
examConclusion.value = ''
|
||||||
|
patients.value = []
|
||||||
|
originalPatients.value = []
|
||||||
|
medicalSnQuery.value = '' // 清空体检编号搜索框
|
||||||
|
searchQuery.value = '' // 清空搜索框
|
||||||
|
reportData.value = {
|
||||||
|
medicalSn: '',
|
||||||
|
cardId: '',
|
||||||
|
pName: '',
|
||||||
|
gender: '',
|
||||||
|
birthday: '',
|
||||||
|
nationality: '',
|
||||||
|
nation: '',
|
||||||
|
race: '',
|
||||||
|
phoneNum: '',
|
||||||
|
status: 0,
|
||||||
|
reportType: '',
|
||||||
|
medicalDateTime: '',
|
||||||
|
chargeType: '',
|
||||||
|
totalPrice: 0,
|
||||||
|
headPicUrl: '',
|
||||||
|
summaryResult: '',
|
||||||
|
auditor: '',
|
||||||
|
auditorTime: ''
|
||||||
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('保存失败:', error)
|
console.error('保存失败:', error)
|
||||||
message.error(`保存失败: ${error.message}`)
|
message.error(`保存失败: ${error.message}`)
|
||||||
@ -1068,6 +1158,38 @@ const isImageExam = computed(() => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 添加状态文本映射函数
|
||||||
|
const getStatusText = (status) => {
|
||||||
|
const statusMap = {
|
||||||
|
'0': '待检查',
|
||||||
|
'1': '已检查',
|
||||||
|
'2': '已弃检'
|
||||||
|
}
|
||||||
|
return statusMap[status] || '未知'
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加状态标签类型映射函数
|
||||||
|
const getStatusTagType = (status) => {
|
||||||
|
const typeMap = {
|
||||||
|
'0': 'info', // 灰蓝色
|
||||||
|
'1': 'success', // 绿色
|
||||||
|
'2': 'danger' // 红色
|
||||||
|
}
|
||||||
|
return typeMap[status] || ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加参考值格式化函数
|
||||||
|
const formatReference = (reference) => {
|
||||||
|
if (!reference || reference === 'null-null') {
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
|
const [low, high] = reference.split('-')
|
||||||
|
if (!low || !high || low === 'null' || high === 'null') {
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
|
return `${low}-${high}`
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -1308,8 +1430,6 @@ const isImageExam = computed(() => {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.exam-tabs {
|
.exam-tabs {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
@ -1448,6 +1568,10 @@ const isImageExam = computed(() => {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
&:disabled {
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary-textarea:focus {
|
.summary-textarea:focus {
|
||||||
@ -1634,7 +1758,6 @@ const isImageExam = computed(() => {
|
|||||||
.no-signature {
|
.no-signature {
|
||||||
color: #909399;
|
color: #909399;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin: 0 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 添加图片展示区域样式 */
|
/* 添加图片展示区域样式 */
|
||||||
@ -1740,9 +1863,10 @@ const isImageExam = computed(() => {
|
|||||||
|
|
||||||
/* 添加禁用状态的样式 */
|
/* 添加禁用状态的样式 */
|
||||||
.cell-input:disabled {
|
.cell-input:disabled {
|
||||||
background-color: #ebeef5;
|
background-color: #f5f7fa;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
color: #606266;
|
color: #606266;
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 修改弃检行的样式判断 */
|
/* 修改弃检行的样式判断 */
|
||||||
@ -1771,4 +1895,103 @@ const isImageExam = computed(() => {
|
|||||||
left: 5%;
|
left: 5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 更新搜索框样式 */
|
||||||
|
.medical-sn-search {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.medical-sn-search input {
|
||||||
|
width: 100%;
|
||||||
|
padding: 6px 12px;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.medical-sn-search input:focus {
|
||||||
|
border-color: #409EFF;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-tag {
|
||||||
|
margin-left: 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.patient-info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.medical-sn {
|
||||||
|
color: #909399;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn:disabled {
|
||||||
|
background-color: #a0cfff;
|
||||||
|
cursor: not-allowed;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-dropdown.is-disabled) {
|
||||||
|
opacity: 0.7;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-button.is-disabled) {
|
||||||
|
background-color: #a0cfff;
|
||||||
|
cursor: not-allowed;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 修改只读输入框样式 */
|
||||||
|
.cell-input[readonly] {
|
||||||
|
background-color: transparent;
|
||||||
|
cursor: not-allowed;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 保持按钮样式正常 */
|
||||||
|
.action-btn {
|
||||||
|
padding: 6px 16px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #40B6FF;
|
||||||
|
color: white;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 14px;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn:hover {
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn.primary {
|
||||||
|
background: #40B6FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 只读状态的输入框样式 */
|
||||||
|
.cell-input[readonly] {
|
||||||
|
background-color: transparent;
|
||||||
|
cursor: not-allowed;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 只读状态的文本框样式 */
|
||||||
|
.summary-textarea[readonly] {
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 只读状态下的按钮样式 */
|
||||||
|
.view-only {
|
||||||
|
opacity: 0.7;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
@ -107,6 +107,21 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="模块名称" prop="groupname">
|
||||||
|
<el-input v-model="formData.groupname" placeholder="请输入模块名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="餐前餐后" prop="mealfrontorafter">
|
||||||
|
<el-select v-model="formData.mealfrontorafter" placeholder="请选择状态" clearable>
|
||||||
|
<el-option label="餐前" value="餐前" />
|
||||||
|
<el-option label="餐后" value="餐后" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -141,7 +156,10 @@ const formData = ref<Partial<itemsVO>>({
|
|||||||
highValue: undefined,
|
highValue: undefined,
|
||||||
lowValue: undefined,
|
lowValue: undefined,
|
||||||
moduleID: undefined,
|
moduleID: undefined,
|
||||||
sectionID: ''
|
sectionID: '',
|
||||||
|
groupname: '',
|
||||||
|
mealfrontorafter: '',
|
||||||
|
groupcode: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
@ -186,9 +204,10 @@ const handleSubmit = async () => {
|
|||||||
formData.value.sectionID = section.split('|')[0]
|
formData.value.sectionID = section.split('|')[0]
|
||||||
formData.value.section = section.split('|')[1]
|
formData.value.section = section.split('|')[1]
|
||||||
}
|
}
|
||||||
|
formData.value.groupcode = Date.now().toString()
|
||||||
|
|
||||||
await itemsApi.createitems(formData.value as itemsVO)
|
await itemsApi.createitems(formData.value as itemsVO)
|
||||||
ElMessage.success('添加成功')
|
ElMessage.success('添加成功')
|
||||||
// 触发success事件
|
|
||||||
emit('success')
|
emit('success')
|
||||||
handleClose()
|
handleClose()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -212,7 +231,11 @@ const handleClose = () => {
|
|||||||
moduleName: '',
|
moduleName: '',
|
||||||
highValue: undefined,
|
highValue: undefined,
|
||||||
lowValue: undefined,
|
lowValue: undefined,
|
||||||
moduleID: undefined
|
moduleID: undefined,
|
||||||
|
sectionID: '',
|
||||||
|
groupname: '',
|
||||||
|
mealfrontorafter: '',
|
||||||
|
groupcode: ''
|
||||||
}
|
}
|
||||||
visible.value = false
|
visible.value = false
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,22 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="模块名称" prop="groupname">
|
||||||
|
<el-input v-model="formData.groupname" placeholder="请输入模块名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="餐前餐后" prop="mealfrontorafter">
|
||||||
|
<el-select v-model="formData.mealfrontorafter" placeholder="请选择状态" clearable>
|
||||||
|
<el-option label="餐前" value="餐前" />
|
||||||
|
<el-option label="餐后" value="餐后" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@ -123,7 +139,22 @@ const visible = ref(false)
|
|||||||
|
|
||||||
const formRef = ref<FormInstance>()
|
const formRef = ref<FormInstance>()
|
||||||
const departmentOptions = ref<{ value: string; label: string }[]>([])
|
const departmentOptions = ref<{ value: string; label: string }[]>([])
|
||||||
const formData = ref<Partial<itemsVO>>({})
|
const formData = ref<Partial<itemsVO>>({
|
||||||
|
itemName: '',
|
||||||
|
itemCode: '',
|
||||||
|
price: undefined,
|
||||||
|
discounted: undefined,
|
||||||
|
section: '',
|
||||||
|
unit: '',
|
||||||
|
moduleName: '',
|
||||||
|
highValue: undefined,
|
||||||
|
lowValue: undefined,
|
||||||
|
moduleID: undefined,
|
||||||
|
sectionID: '',
|
||||||
|
groupname: '',
|
||||||
|
mealfrontorafter: '',
|
||||||
|
groupcode: ''
|
||||||
|
})
|
||||||
|
|
||||||
const formRules = {
|
const formRules = {
|
||||||
section: [{ required: true, message: '请选择所属科室', trigger: 'change' }],
|
section: [{ required: true, message: '请选择所属科室', trigger: 'change' }],
|
||||||
@ -151,7 +182,6 @@ const handleSubmit = async () => {
|
|||||||
|
|
||||||
await formRef.value.validate(async (valid) => {
|
await formRef.value.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (formData.value.moduleName) {
|
if (formData.value.moduleName) {
|
||||||
const moduleName = formData.value.moduleName
|
const moduleName = formData.value.moduleName
|
||||||
@ -159,11 +189,13 @@ const handleSubmit = async () => {
|
|||||||
formData.value.moduleID = parseInt(moduleName.split('|')[1])
|
formData.value.moduleID = parseInt(moduleName.split('|')[1])
|
||||||
}
|
}
|
||||||
if (formData.value.section) {
|
if (formData.value.section) {
|
||||||
|
|
||||||
const section = formData.value.section
|
const section = formData.value.section
|
||||||
formData.value.section = section.split('|')[0]
|
formData.value.section = section.split('|')[0]
|
||||||
formData.value.sectionID = section.split('|')[1]
|
formData.value.sectionID = section.split('|')[1]
|
||||||
}
|
}
|
||||||
|
// 添加时间戳作为 groupcode
|
||||||
|
formData.value.groupcode = Date.now().toString()
|
||||||
|
|
||||||
console.log('section', formData.value.sectionID)
|
console.log('section', formData.value.sectionID)
|
||||||
await itemsApi.updateitems(formData.value as itemsVO)
|
await itemsApi.updateitems(formData.value as itemsVO)
|
||||||
ElMessage.success('修改成功')
|
ElMessage.success('修改成功')
|
||||||
@ -179,7 +211,22 @@ const handleSubmit = async () => {
|
|||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
formData.value = {}
|
formData.value = {
|
||||||
|
itemName: '',
|
||||||
|
itemCode: '',
|
||||||
|
price: undefined,
|
||||||
|
discounted: undefined,
|
||||||
|
section: '',
|
||||||
|
unit: '',
|
||||||
|
moduleName: '',
|
||||||
|
highValue: undefined,
|
||||||
|
lowValue: undefined,
|
||||||
|
moduleID: undefined,
|
||||||
|
sectionID: '',
|
||||||
|
groupname: '',
|
||||||
|
mealfrontorafter: '',
|
||||||
|
groupcode: ''
|
||||||
|
}
|
||||||
visible.value = false
|
visible.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user