This commit is contained in:
lxd 2025-04-07 11:14:15 +08:00
commit f9bf2491db
3 changed files with 181 additions and 27 deletions

View File

@ -85,13 +85,25 @@
:class="{ active: selectedPatient?.id === patient.id }"
>
<div class="patient-info">
<span class="name">{{ patient.pname }}</span>
<span class="medical-sn">{{ patient.medicalSn }}</span>
<el-tag :type="getStatusTagType(patient)" size="small" class="status-tag">
{{ getStatusText(patient) }}
</el-tag>
<div class="info-row">
<span class="name">{{ patient.pname }}</span>
<span class="medical-sn">{{ truncateMedicalSn(patient.medicalSn) }}</span>
<el-tag
size="small"
:type="getStatusTagType(patient)"
class="status-tag"
>
{{ getStatusText(patient) }}
</el-tag>
<el-button
v-if="patient.status === '1' || patient.status === 1"
type="primary"
size="small"
@click.stop="resetPatientStatus(patient)"
class="reset-status-btn"
>打回</el-button>
</div>
</div>
<!--<span class="card-id">{{ patient.cardId }}</span>-->
</div>
</template>
<!-- 将分页组件移到list-content外部底部 -->
@ -2509,6 +2521,73 @@ const handleDateRangeChange = async (val) => {
ElMessage.error('获取患者列表失败')
}
}
//
const resetPatientStatus = async (patient) => {
try {
//
await ElMessageBox.confirm('确定要重置该患者的状态吗?重置后将无法恢复。', '重置状态确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
const loading = ElLoading.service({
lock: true,
text: '处理中...',
background: 'rgba(255, 255, 255, 0.7)'
})
try {
// status0
await PatientApi.updatePatient({
id: patient.id,
status: 0, //
medicalDateTime: Date.now() //
})
//
patient.status = 0
patient.medicalDateTime = Date.now()
//
const patientIndex = patients.value.findIndex((p) => p.id === patient.id)
if (patientIndex !== -1) {
patients.value[patientIndex].status = 0
patients.value[patientIndex].medicalDateTime = Date.now()
}
//
const filteredIndex = filteredPatients.value.findIndex(
(p) => p.id === patient.id
)
if (filteredIndex !== -1) {
filteredPatients.value[filteredIndex].status = 0
filteredPatients.value[filteredIndex].medicalDateTime = Date.now()
}
loading.close()
ElMessage.success('状态重置成功')
//
await refreshExamData()
} catch (error) {
loading.close()
console.error('重置状态失败:', error)
ElMessage.error('重置状态失败,请稍后重试')
}
} catch {
//
ElMessage.info('已取消重置状态')
}
}
//
const truncateMedicalSn = (sn) => {
if (!sn) return '';
// 10
return sn.length > 10 ? sn.substring(0, 8) + '...' : sn;
}
</script>
<style scoped>
@ -2625,9 +2704,40 @@ const handleDateRangeChange = async (val) => {
.patient-item {
display: flex;
justify-content: space-between;
align-items: center;
align-items: flex-start;
padding: 12px 15px;
border-bottom: 1px solid #e6e6e6;
cursor: pointer;
}
.patient-item:hover {
background-color: #f5f7fa;
}
.patient-item.active {
background-color: #ecf5ff;
}
.patient-item .name {
font-weight: bold;
font-size: 14px;
color: #303133;
}
.patient-item .medical-sn {
font-size: 12px;
color: #909399;
}
.patient-item .card-id {
font-size: 12px;
color: #909399;
display: block;
margin-top: 3px;
}
.status-tag {
font-size: 12px;
}
.report-content {
@ -2719,7 +2829,9 @@ const handleDateRangeChange = async (val) => {
.info-row {
display: flex;
margin-bottom: 15px;
justify-content: space-between;
align-items: center;
margin-bottom: 5px;
}
.info-row:last-child {
@ -3004,10 +3116,10 @@ const handleDateRangeChange = async (val) => {
}
.patient-info {
flex: 1;
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
flex-direction: column;
width: 100%;
}
.name {
@ -3086,14 +3198,8 @@ const handleDateRangeChange = async (val) => {
/* 修改分页容器样式 */
.pagination-container {
padding: 8px;
background: #fff;
border-top: 1px solid #e6e6e6;
margin-top: auto; /* 确保分页始终在底部 */
position: sticky; /* 添加粘性定位 */
bottom: 0; /* 固定在底部 */
z-index: 1; /* 确保在内容之上 */
width: 100%; /* 确保宽度填满容器 */
padding: 10px 15px;
text-align: right;
}
/* 自定义分页组件样式 */
@ -3629,4 +3735,58 @@ const handleDateRangeChange = async (val) => {
:deep(.el-input.is-disabled) {
opacity: 0.7;
}
.reset-status-btn {
background-color: #ff7b7b;
color: white;
border: none;
padding: 5px 10px;
border-radius: 3px;
cursor: pointer;
transition: background-color 0.3s;
}
.reset-status-btn:hover {
background-color: #ff5b5b;
}
.patient-info {
width: 100%;
}
.info-row {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: nowrap;
width: 100%;
}
.name {
font-weight: bold;
margin-right: 10px;
white-space: nowrap;
}
.medical-sn {
color: #909399;
font-size: 0.9em;
margin-right: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100px;
}
.status-tag {
margin-right: 10px;
white-space: nowrap;
}
.reset-status-btn {
padding: 2px 8px;
height: 24px;
font-size: 12px;
white-space: nowrap;
}
</style>

View File

@ -335,7 +335,7 @@ const saveSummary = async () => {
//id
const saveData2 = {
medicalSn: props.patient.medicalSn,
chiefinspectorid: selectedDoctor.value.split('|')[0],
chiefinspectorid: parseInt(selectedDoctor.value.split('|')[0]),
chiefinspector: selectedDoctor.value.split('|')[1]
}

View File

@ -271,13 +271,7 @@ onMounted(() => {
/** 打印报告按钮操作 */
const handlePrint = async (row: PatientVO) => {
try {
const data = await PatientApi.getPatientInfo(row.medicalSn)
//尿
if(!data.xcgcode && !data.ncgcode && !data.shqx){
await PatientApi.bindPatientProject(row.medicalSn)
await PatientApi.syncinspectApplyTj(row.medicalSn)
await createPrint(row.medicalSn)
}
await PatientApi.bindPatientProject(row.medicalSn)
await PatientApi.syncinspectApplyTj(row.medicalSn)
await createPrint(row.medicalSn)
//