From d7928198ad4f63e57d3e3506edbc4681dcc489b6 Mon Sep 17 00:00:00 2001
From: gaofy <1014893517@qq.com>
Date: Thu, 28 Dec 2023 14:27:47 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96=EF=BC=8C?=
=?UTF-8?q?=E5=8C=BB=E7=94=9F=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=E5=AE=8C?=
=?UTF-8?q?=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/index.vue | 6 +++++-
src/views/patients-manage/surgery-info.vue | 11 +++++++----
.../permissions-manage/doctor-manage.vue | 19 +++++++++++++++++--
.../permissions-manage/form/doctor-form.vue | 3 ++-
4 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/src/views/index.vue b/src/views/index.vue
index 18b0759..ae17f51 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -70,7 +70,11 @@ const router = useRouter()
const route = useRoute()
const userInfo = useLoginStore().getlogin()
-const hospitals: any = getHospitalsData()
+let hospitals: any
+getHospitalsData().then((res: any) => {
+ hospitals = res
+ console.log(res)
+})
const menus = [] as any
switch (userInfo.permissions) {
diff --git a/src/views/patients-manage/surgery-info.vue b/src/views/patients-manage/surgery-info.vue
index 19d4483..6be9034 100644
--- a/src/views/patients-manage/surgery-info.vue
+++ b/src/views/patients-manage/surgery-info.vue
@@ -3,12 +3,11 @@
-
+
姓名
(0)
const customFormTypes = ref([] as any)
@@ -191,6 +191,8 @@ const addFormType = (e: any) => {
.surgery-info-page {
width: 100%;
height: 100%;
+ display: flex;
+ flex-direction: column;
.header-box {
width: 100%;
@@ -230,6 +232,7 @@ const addFormType = (e: any) => {
}
.content-box {
+ flex-grow: 1;
width: 100%;
height: calc(100% - 100px);
margin-top: 10px;
diff --git a/src/views/permissions-manage/doctor-manage.vue b/src/views/permissions-manage/doctor-manage.vue
index f760dc7..e37f24a 100644
--- a/src/views/permissions-manage/doctor-manage.vue
+++ b/src/views/permissions-manage/doctor-manage.vue
@@ -52,7 +52,7 @@
-
+
@@ -85,6 +85,7 @@ function queryData(e: any) {
setTimeout(() => {
while (tableData.value.length < 10) {
tableData.value.push({
+ id: tableData.value.length + 1,
userName: 'cscs',
name: e.userName || '测试',
phone: '12312345678',
@@ -111,7 +112,9 @@ const removeData = (e?: any) => {
const selectRow = e || tableRef.value.getSelectionRows()
tableRemoveRow({ data: selectRow }, (res: boolean) => {
if (res) {
- console.log('调用删除', selectRow)
+ const index = tableData.value.findIndex((item: any) => item === selectRow)
+ tableData.value.splice(index, 1)
+ console.log('调用删除', selectRow, index)
}
})
}
@@ -134,6 +137,18 @@ const editData = (e: any) => {
const tableRowClick = (row: any) => {
tableRef.value.toggleRowSelection(row)
}
+const doctorFormSave = (data: any, type: string) => {
+ if(type === 'add') {
+ tableData.value.unshift(Object.assign({}, data))
+ }else {
+ tableData.value.forEach((item: any) => {
+ if(item.id === data.id) {
+ Object.assign(item, data)
+ }
+ })
+ }
+ console.log(data, type)
+}
const paginationChange = (page: number, size: number) => {
}
diff --git a/src/views/permissions-manage/form/doctor-form.vue b/src/views/permissions-manage/form/doctor-form.vue
index a832728..99f90f0 100644
--- a/src/views/permissions-manage/form/doctor-form.vue
+++ b/src/views/permissions-manage/form/doctor-form.vue
@@ -53,7 +53,7 @@
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
-const emit = defineEmits(['close'])
+const emit = defineEmits(['close', 'save'])
const props = defineProps({
type: String
@@ -118,6 +118,7 @@ const saveData = async () => {
await formRef.value.validate((valid: any, fields: any) => {
if (valid) {
ElMessage.success('保存成功!')
+ emit('save', formData.value, props.type)
close()
} else {
console.log('error submit!', fields)