From 8544ad5024c46f25e25f5426c8f6bf7c2a845836 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期一, 28 十月 2024 09:22:56 +0800
Subject: [PATCH] remove pay-related icons
---
src/views/ecg/doctor/components/DevInstallPanel.vue | 222 +++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 151 insertions(+), 71 deletions(-)
diff --git a/src/views/ecg/doctor/components/DevInstallPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue
index 031373b..729ee2f 100644
--- a/src/views/ecg/doctor/components/DevInstallPanel.vue
+++ b/src/views/ecg/doctor/components/DevInstallPanel.vue
@@ -1,5 +1,4 @@
<template>
- 褰撳墠鎮h��: {{patient?.patId}} {{isStringEmpty(patient?.patName)?'鏃�':patient.patName}}
<el-form
ref="formRef"
:model="formData"
@@ -7,51 +6,77 @@
label-width="100px"
v-loading="formLoading"
>
- <el-form-item label="璁惧缂栧彿" prop="devId">
- <el-input v-model="formData.devId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" />
- </el-form-item>
- <el-form-item label="瑁呮満鏃堕棿" prop="rentTime">
- <el-date-picker
- v-model="formData.rentTime"
- type="date"
- value-format="x"
- placeholder="閫夋嫨瑁呮満鏃堕棿"
- />
- </el-form-item>
- <el-form-item label="澶囨敞" prop="remark">
- <el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" />
- </el-form-item>
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鎮h�呯紪鍙�" prop="patId">
+ <el-input v-model="formData.patId" placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�" @input="getRentInfoByPatId" />
+ </el-form-item>
+ <el-form-item label="鎮h�呭悕绉�" prop="patName">
+ <el-input v-model="formData.patName" placeholder="璇疯緭鍏ユ偅鑰呭悕绉�" />
+ </el-form-item>
+ <el-form-item label="鎮h�呮弿杩�" prop="patDeptDesc">
+ {{formData.patDetails}}
+ </el-form-item>
+ <el-form-item label="瑁呮満鏃堕棿" prop="rentTime">
+ <el-date-picker
+ v-model="formData.rentTime"
+ type="date"
+ value-format="x"
+ placeholder="閫夋嫨瑁呮満鏃堕棿"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="璁惧缂栧彿" prop="devId">
+ <el-input v-model="formData.devId" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" @input="getDevInfo"/>
+ </el-form-item>
+ <el-form-item label="璁惧鎻忚堪" prop="">
+ <span v-if="formData.brand !== null"> {{formData.brand}} </span>
+ {{" "}}
+ <span v-if="formData.model !== null"> {{formData.model}} </span>
+ </el-form-item>
+ <el-form-item label="澶囨敞" prop="remark">
+ <el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" />
+ </el-form-item>
+ </el-col>
+ </el-row>
</el-form>
<el-button @click="submitForm" type="primary" :disabled="formLoading">瑁呮満瀹屾垚</el-button>
- <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button @click="resetForm()">閲� 缃�</el-button>
+ <el-button @click="cancelInstall" :disabled="formLoading">鏀惧純瑁呮満</el-button>
-
- <!-- 鍖荤敓鎷嗘満鍒楄〃 -->
+ <!-- 鍖荤敓瑁呮満鍒楄〃 -->
<ContentWrap>
- <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @current-change="onCurChange" >
+ <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @row-click="onRowClick" >
<el-table-column label="id" align="center" prop="id" />
+ <el-table-column label="瑁呮満鎯呭喌" align="center" prop="lost" >
+ <template #default="scope">
+ <span v-if="scope.row.jobType === 10">"宸茶鏈�"</span>
+ <span v-if="scope.row.jobType === 35">"宸叉斁寮�"</span>
+ </template>
+ </el-table-column>
<!-- <el-table-column label="浣滀笟绫诲瀷" align="center" prop="jobType" />-->
<!-- <el-table-column label="鍖荤敓缂栧彿" align="center" prop="docId" />-->
- <el-table-column label="鍖荤敓鍚嶇О" align="center" width="auto" prop="docName" />
+ <el-table-column label="鍖荤敓鍚嶇О" align="center" prop="docName" />
<el-table-column label="璁惧缂栧彿" align="center" prop="devId" />
-<!-- <el-table-column label="鎮h�呯紪鍙�" align="center" prop="patId" />-->
+ <el-table-column label="鎮h�呯紪鍙�" align="center" prop="patId" />
<el-table-column label="鎮h�呭悕绉�" align="center" prop="patName" />
<el-table-column
label="浣滀笟鏃堕棿"
align="center"
prop="jobTime"
- :formatter="timeFormatter"
+ :formatter="dateFormatter"
+ width="180px"
/>
-<!-- <el-table-column label="浣滀笟姒傝" align="center" prop="summary" />-->
+ <el-table-column label="浣滀笟姒傝" align="center" prop="summary" />
<el-table-column label="澶囨敞" align="center" prop="remark" />
-<!--
<el-table-column
label="鍒涘缓鏃堕棿"
align="center"
prop="createTime"
:formatter="dateFormatter"
+ width="180px"
/>
--->
<el-table-column label="鎿嶄綔" align="center" min-width="120px">
<template #default="scope">
<el-button
@@ -85,17 +110,34 @@
</template>
<script setup lang="ts">
-import {defineComponent, PropType} from "vue";
import { DevRentApi, DevRentVO } from '@/api/ecg/devrent'
-import {QueueVO} from "@/api/ecg/queue";
-import {isStringEmpty} from "@/utils/stringUtil";
-import {dateFormatter, timeFormatter} from "@/utils/formatTime";
+import {dateFormatter} from "@/utils/formatTime";
import {JobRecordApi, JobRecordVO} from "@/api/ecg/jobrecord";
+import {isStringEmpty} from "@/utils/stringUtil";
+import {curDayEnd, curDayStart} from "@/utils/dateUtil";
+import {DeviceApi} from "@/api/ecg/devmanage";
+import {QueueVO} from "@/api/ecg/queue";
+import {RoomBedVO} from "@/api/ecg/doctor";
-/** 瑁呮満鎷嗘満 琛ㄥ崟 */
+/** 璁惧瑁呮満 琛ㄥ崟 */
defineComponent({ name: 'DevInstallPanel' })
-const emit = defineEmits(['success']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋�
+const props = defineProps({
+ room: {
+ type: Object as PropType<RoomBedVO>,
+ required: true
+ }
+})
+
+const emit = defineEmits(['event_dev_install']) // 瀹氫箟 success 浜嬩欢锛岀敤浜庢搷浣滄垚鍔熷悗鐨勫洖璋�
+
+const setPatient = (queueVO: QueueVO | undefined) => {
+ resetForm()
+ formData.value.patId = queueVO?.patId
+ formData.value.patName = queueVO?.patName
+ getReadyRentInfo()
+}
+defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
const { t } = useI18n() // 鍥介檯鍖�
const message = useMessage() // 娑堟伅寮圭獥
@@ -103,30 +145,14 @@
const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀�
const formLoading = ref(false) // 琛ㄥ崟鐨勫姞杞戒腑锛�1锛変慨鏀规椂鐨勬暟鎹姞杞斤紱2锛夋彁浜ょ殑鎸夐挳绂佺敤
-const formType = ref('create') // 琛ㄥ崟鐨勭被鍨嬶細create - 鏂板锛泆pdate - 淇敼
-const patient = ref<QueueVO>({
- patId: '',
- patName: ''
-})
+const formData = ref({})
-const formData = ref({
- id: undefined,
- devId: undefined,
- patId: patient.value.patId,
- patName: patient.value.patName,
- rentTime: new Date().getTime(),
- returnTime: undefined,
- interference: undefined,
- baseline: undefined,
- detachment: undefined,
- remark: undefined
-})
const formRules = reactive({
devId: [{ required: true, message: '璁惧缂栧彿涓嶈兘涓虹┖', trigger: 'blur' }],
rentTime: [{ required: true, message: '璇烽�夋嫨瑁呮満鏃ユ湡', trigger: 'blur' }],
- patId: [{ required: true, message: '鐩墠娌℃湁鎮h��', trigger: 'blur' }],
- patName: [{ required: true, message: '鐩墠娌℃湁鎮h��', trigger: 'blur' }]
+ patId: [{ required: true, message: '鎮h�呬笉鑳戒负绌�', trigger: 'blur' }],
+ patName: [{ required: true, message: '鎮h�呭悕涓嶈兘涓虹┖', trigger: 'blur' }]
})
const formRef = ref() // 琛ㄥ崟 Ref
@@ -137,18 +163,14 @@
// 鎻愪氦璇锋眰
formLoading.value = true
try {
+ formData.value.roomId = props.room.roomId
+ formData.value.bedNo = props.room.bedNo
const data = formData.value as unknown as DevRentVO
- if (formData.value.id === null || formData.value.id === undefined) {
- const result = await DevRentApi.devInstall(data)
- formData.value.id = result
- message.success(t('鏂板缓鎴愬姛'))
- } else {
- await DevRentApi.devInstall(data)
- message.success(t('鏇存柊鎴愬姛'))
- }
+ await DevRentApi.devInstall(data)
+ message.success(t('鎿嶄綔鎴愬姛'))
dialogVisible.value = false
// 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
- emit('success')
+ emit('event_dev_install')
resetForm()
getList()
} finally {
@@ -161,24 +183,64 @@
formData.value = {
id: undefined,
devId: undefined,
- patId: patient.value.patId,
- patName: patient.value.patName,
+ patId: undefined,
+ patName: undefined,
+ patDeptCode: undefined,
+ patDeptDesc: undefined,
+ patWardCode: undefined,
+ patWardDesc: undefined,
+ patBedNo: undefined,
rentTime: new Date().getTime(),
returnTime: undefined,
interference: undefined,
baseline: undefined,
detachment: undefined,
- remark: undefined
+ remark: undefined,
+ category: '',
+ brand: '',
+ model: '',
}
formRef.value?.resetFields()
}
-const setPatient = (queueVO: QueueVO | undefined) => {
- patient.value = queueVO
- resetForm()
-}
-defineExpose({ setPatient }) // 鎻愪緵 setPatient 鏂规硶锛岀敤浜庤缃偅鑰�
+const getDevInfo = async () => {
+ if (isStringEmpty(formData.value.devId)) {
+ formData.value.category = ""
+ formData.value.brand = ""
+ formData.value.model = ""
+ return
+ }
+ const data = await DeviceApi.getDeviceByDevId(formData.value.devId!)
+ console.info( data )
+ formData.value.category = data === null ? "" : data.category
+ formData.value.brand = data === null ? "" : data.brand
+ formData.value.model = data === null ? "" : data.model
+}
+
+const getRentInfoByPatId = () => {
+ const tempPatId = formData.value.patId;
+ resetForm()
+ if (isStringEmpty(tempPatId))
+ return
+
+ formData.value.patId = tempPatId;
+ getReadyRentInfo(formData.value)
+}
+
+const getReadyRentInfo = async (devRentVO) => {
+ const data = await DevRentApi.getReadyRent(devRentVO)
+ if (null === data)
+ return
+
+ // formData.value = data //涓嶈兘鏁翠釜璧嬪�硷紝 榛樿瑁呮満鏃堕棿琚竻绌�
+ formData.value.id = data.id;
+ formData.value.devId = data.devId
+ formData.value.category = data.category
+ formData.value.brand = data.brand
+ formData.value.model = data.model
+ formData.value.patDetails = data.patDetails
+}
const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
const list = ref<JobRecordVO[]>([]) // 鍒楄〃鐨勬暟鎹�
@@ -186,13 +248,13 @@
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
- jobType: 0,
+ jobType: [10, 35],
docId: undefined,
docName: undefined,
devId: undefined,
patId: undefined,
patName: undefined,
- jobTime: [],
+ jobTime: [curDayStart(), curDayEnd()],
summary: undefined,
remark: undefined,
createTime: []
@@ -209,7 +271,7 @@
}
}
-const onCurChange = (cur) => {
+const onRowClick = (cur) => {
if (cur !== null)
getSelectedRent( cur.rentId )
}
@@ -218,10 +280,28 @@
formData.value = await DevRentApi.getDevRent(rentId)
}
+const cancelInstall = async () => {
+ formData.value.roomId = props.room.roomId
+ formData.value.bedNo = props.room.bedNo
+ const data = formData.value as unknown as DevRentVO
+ if (formData.value.id === null || formData.value.id === undefined) {
+ const result = await DevRentApi.devInstallCancel(data)
+ formData.value.id = result
+ message.success(t('鎿嶄綔鎴愬姛'))
+ } else {
+ await DevRentApi.devInstallCancel(data)
+ message.success(t('鎿嶄綔鎴愬姛'))
+ }
+ // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
+ emit('event_dev_install')
+ resetForm()
+ getList()
+}
+
/** 鍒濆鍖� **/
onMounted(() => {
+ resetForm()
getList()
})
</script>
-
--
Gitblit v1.9.3