优化
This commit is contained in:
parent
2d036816bc
commit
cc8d5f74e3
@ -90,18 +90,20 @@
|
|||||||
<span class="medical-sn">{{ truncateMedicalSn(patient.medicalSn) }}</span>
|
<span class="medical-sn">{{ truncateMedicalSn(patient.medicalSn) }}</span>
|
||||||
<el-tag
|
<el-tag
|
||||||
size="small"
|
size="small"
|
||||||
:type="getStatusTagType(patient)"
|
:type="getStatusInfo(patient).color"
|
||||||
class="status-tag"
|
class="status-tag"
|
||||||
>
|
>
|
||||||
{{ getStatusText(patient) }}
|
{{ getStatusInfo(patient).text }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="patient.status === '1' || patient.status === 1"
|
v-if="getStatusInfo(patient).showButton"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
@click.stop="resetPatientStatus(patient)"
|
@click.stop="resetPatientStatus(patient)"
|
||||||
class="reset-status-btn"
|
class="reset-status-btn"
|
||||||
>打回</el-button>
|
>
|
||||||
|
打回
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2845,6 +2847,17 @@ const truncateMedicalSn = (sn) => {
|
|||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
clearPatientCache()
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
Loading…
Reference in New Issue
Block a user