优化
This commit is contained in:
parent
2d036816bc
commit
cc8d5f74e3
@ -90,18 +90,20 @@
|
||||
<span class="medical-sn">{{ truncateMedicalSn(patient.medicalSn) }}</span>
|
||||
<el-tag
|
||||
size="small"
|
||||
:type="getStatusTagType(patient)"
|
||||
:type="getStatusInfo(patient).color"
|
||||
class="status-tag"
|
||||
>
|
||||
{{ getStatusText(patient) }}
|
||||
{{ getStatusInfo(patient).text }}
|
||||
</el-tag>
|
||||
<el-button
|
||||
v-if="patient.status === '1' || patient.status === 1"
|
||||
v-if="getStatusInfo(patient).showButton"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click.stop="resetPatientStatus(patient)"
|
||||
class="reset-status-btn"
|
||||
>打回</el-button>
|
||||
>
|
||||
打回
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -2845,6 +2847,17 @@ const truncateMedicalSn = (sn) => {
|
||||
onBeforeUnmount(() => {
|
||||
clearPatientCache()
|
||||
})
|
||||
|
||||
// 状态映射配置
|
||||
const STATUS_MAP = {
|
||||
0: { text: '待检查', color: 'info', showButton: false },
|
||||
1: { text: '已检查', color: 'success', showButton: true },
|
||||
}
|
||||
|
||||
// 统一获取状态信息的方法
|
||||
const getStatusInfo = (patient) => {
|
||||
return STATUS_MAP[patient.status] || { text: '未知状态', color: 'info', showButton: false }
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
Loading…
Reference in New Issue
Block a user