From ef8b45aea99e31d95773d82f7508449489b6e278 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 12 九月 2024 17:49:26 +0800
Subject: [PATCH] 放弃装机功能
---
src/views/ecg/room/RoomLoginSelect.vue | 12 ++++++------
src/api/ecg/devrent/index.ts | 8 +++++++-
src/views/ecg/doctor/components/DevInstallPanel.vue | 34 +++++++++++++++++++++++++++++-----
3 files changed, 42 insertions(+), 12 deletions(-)
diff --git a/src/api/ecg/devrent/index.ts b/src/api/ecg/devrent/index.ts
index 893fc0c..2d14f11 100644
--- a/src/api/ecg/devrent/index.ts
+++ b/src/api/ecg/devrent/index.ts
@@ -59,6 +59,12 @@
// 鎷嗘満
devDismantle: async (data: DevRentVO) => {
return await request.post({ url: `/ecg/dev-rent/dev-dismantle`, data })
- }
+ },
+
+ // 鏀惧純瑁呮満
+ devCancel: async (data: DevRentVO) => {
+ return await request.post({ url: `/ecg/dev-rent/dev-cancel`, data })
+ },
+
}
diff --git a/src/views/ecg/doctor/components/DevInstallPanel.vue b/src/views/ecg/doctor/components/DevInstallPanel.vue
index 031373b..7fc88e3 100644
--- a/src/views/ecg/doctor/components/DevInstallPanel.vue
+++ b/src/views/ecg/doctor/components/DevInstallPanel.vue
@@ -23,13 +23,19 @@
</el-form-item>
</el-form>
<el-button @click="submitForm" type="primary" :disabled="formLoading">瑁呮満瀹屾垚</el-button>
- <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button @click="cancelInstall" type="primary" :disabled="formLoading">鏀惧純瑁呮満</el-button>
+ <el-button @click="resetForm()">閲� 缃�</el-button>
<!-- 鍖荤敓鎷嗘満鍒楄〃 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @current-change="onCurChange" >
<el-table-column label="id" align="center" prop="id" />
+ <el-table-column label="--" align="center" prop="cancelled" >
+ <template #default="scope">
+ {{scope.row.cancelled == 1 ? "鏀惧純" : ""}}
+ </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" />
@@ -52,6 +58,7 @@
:formatter="dateFormatter"
/>
-->
+<!--
<el-table-column label="鎿嶄綔" align="center" min-width="120px">
<template #default="scope">
<el-button
@@ -72,6 +79,7 @@
</el-button>
</template>
</el-table-column>
+-->
</el-table>
<!-- 鍒嗛〉 -->
<Pagination
@@ -113,8 +121,8 @@
const formData = ref({
id: undefined,
devId: undefined,
- patId: patient.value.patId,
- patName: patient.value.patName,
+ patId: patient.value?.patId,
+ patName: patient.value?.patName,
rentTime: new Date().getTime(),
returnTime: undefined,
interference: undefined,
@@ -156,13 +164,29 @@
}
}
+const cancelInstall = async () => {
+ const data = formData.value as unknown as DevRentVO
+ if (formData.value.id === null || formData.value.id === undefined) {
+ const result = await DevRentApi.devCancel(data)
+ formData.value.id = result
+ message.success(t('鎿嶄綔鎴愬姛'))
+ } else {
+ await DevRentApi.devCancel(data)
+ message.success(t('鎿嶄綔鎴愬姛'))
+ }
+ // 鍙戦�佹搷浣滄垚鍔熺殑浜嬩欢
+ emit('success')
+ resetForm()
+ getList()
+}
+
/** 閲嶇疆琛ㄥ崟 */
const resetForm = () => {
formData.value = {
id: undefined,
devId: undefined,
- patId: patient.value.patId,
- patName: patient.value.patName,
+ patId: patient.value?.patId,
+ patName: patient.value?.patName,
rentTime: new Date().getTime(),
returnTime: undefined,
interference: undefined,
diff --git a/src/views/ecg/room/RoomLoginSelect.vue b/src/views/ecg/room/RoomLoginSelect.vue
index fa8f72f..5b619d9 100644
--- a/src/views/ecg/room/RoomLoginSelect.vue
+++ b/src/views/ecg/room/RoomLoginSelect.vue
@@ -90,11 +90,11 @@
}
if (isStringEmpty(route.redirectedFrom?.fullPath))
- push({ path: "/"})
+ push({ path: "/ecg/doctor"})
else if(route.redirectedFrom?.fullPath === "/roomselect" )
- push({ path: "/"})
+ push({ path: "/ecg/doctor"})
else if(route.redirectedFrom?.fullPath === "/ecg/roomselect" )
- push({ path: "/"})
+ push({ path: "/ecg/doctor"})
else
push({ path: route.redirectedFrom?.fullPath})
}
@@ -137,13 +137,13 @@
}
if (isStringEmpty(route.redirectedFrom?.fullPath)) {
- push({path: "/"})
+ push({path: "/ecg/doctor"})
}
else if(route.redirectedFrom?.fullPath === "/roomselect" ) {
- push({path: "/"})
+ push({path: "/ecg/doctor"})
}
else if(route.redirectedFrom?.fullPath === "/ecg/roomselect" ) {
- push({path: "/"})
+ push({path: "/ecg/doctor"})
}
else {
push({path: route.redirectedFrom?.fullPath})
--
Gitblit v1.9.3