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)