|
@@ -794,6 +794,7 @@ import HeadPage from '../../../components/inpatient/frontsheet-printpage/HeadPag
|
|
|
import TailPage from '../../../components/inpatient/frontsheet-printpage/TailPage.vue'
|
|
|
import router from '@/router/index'
|
|
|
import Sleep from '@/utils/sleep'
|
|
|
+import { smoothScrollTableColumn } from '@/utils/el-table-scroll'
|
|
|
|
|
|
const userWards = ref([])
|
|
|
const currentWard = ref('')
|
|
@@ -830,24 +831,21 @@ const searchPatient = () => {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- let found = false
|
|
|
- for (let i = 0; i < overview.value.length; i++) {
|
|
|
- const item = overview.value[i]
|
|
|
- if (item.bah === inpatientNo.value.trim()) {
|
|
|
- fetchSheetInfo(item)
|
|
|
- found = true
|
|
|
- asideTable.value.setCurrentRow(item)
|
|
|
- asideTable.value.$refs.bodyWrapper.scrollTop = 36 * i
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if (!found) {
|
|
|
+
|
|
|
+ const patientIndex = overview.value.findIndex((item) => {
|
|
|
+ return item.bah === inpatientNo.value.trim()
|
|
|
+ })
|
|
|
+ if (patientIndex === -1) {
|
|
|
ElMessage({
|
|
|
message: '未找到住院号【' + inpatientNo.value.trim() + '】的患者信息',
|
|
|
type: 'warning',
|
|
|
duration: 2500,
|
|
|
showClose: true,
|
|
|
})
|
|
|
+ } else {
|
|
|
+ const currentPatient = overview.value[patientIndex]
|
|
|
+ fetchSheetInfo(currentPatient)
|
|
|
+ smoothScrollTableColumn(asideTable.value, patientIndex, currentPatient)
|
|
|
}
|
|
|
}
|
|
|
|