From 6c1b6427b8c4ca2063551b4e2dc05700dffa4f3b Mon Sep 17 00:00:00 2001
From: miaojiale <1123971748@qq.com>
Date: Tue, 27 Dec 2022 16:45:41 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9A=84=E5=8C=BB=E8=81=94?=
 =?UTF-8?q?=E4=BD=93=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/api/medicalunion-management.js            |  7 ++++
 .../systems/medicalunion-management/index.vue | 36 ++++++++++++++-----
 2 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/src/api/medicalunion-management.js b/src/api/medicalunion-management.js
index 96963aa..a89bf03 100644
--- a/src/api/medicalunion-management.js
+++ b/src/api/medicalunion-management.js
@@ -9,3 +9,10 @@ export function addMedicalunion(data = {}) {
     data,
   })
 }
+export function medicalunionList(params = {}) {
+  return request({
+    url: "/cloud-upms/sys/union/list",
+    method: "get",
+    params,
+  })
+}
diff --git a/src/views/systems/medicalunion-management/index.vue b/src/views/systems/medicalunion-management/index.vue
index 21244bb..52162b2 100644
--- a/src/views/systems/medicalunion-management/index.vue
+++ b/src/views/systems/medicalunion-management/index.vue
@@ -18,7 +18,12 @@
         @currentPageChange="handleCurrentChange"
       />
     </div>
-    <el-dialog :visible.sync="addVisible" width="520px" :show-close="true">
+    <el-dialog
+      :visible.sync="addVisible"
+      width="520px"
+      :show-close="true"
+      @closed="clearForm"
+    >
       <div class="title">添加医联体</div>
       <el-form
         ref="form"
@@ -63,7 +68,10 @@
 <script>
 import CustomsTable from "@/components/CustomsTable"
 import paginationMixin from "@/components/TabComponents/mixin"
-import { addMedicalunion } from "@/api/medicalunion-management"
+import {
+  addMedicalunion,
+  medicalunionList,
+} from "@/api/medicalunion-management"
 
 export default {
   components: {
@@ -129,6 +137,7 @@ export default {
       tableData: [
         {
           unionName: "第一个",
+          id: 123,
         },
       ],
       formList: [
@@ -159,8 +168,17 @@ export default {
     }
   },
   watch: {},
-  mounted() {},
+  mounted() {
+    this.getMedicalunionList()
+  },
   methods: {
+    // 获取list
+    getMedicalunionList() {
+      medicalunionList({
+        size: this.pageSize,
+        current: this.pageIndex,
+      }).then((res) => {})
+    },
     // 添加医联体
     addMedical() {
       this.addVisible = true
@@ -168,12 +186,7 @@ export default {
     // 编辑医联体
     editMedical(data) {
       console.log(data)
-      this.form = {
-        medicalName: "黑乎乎",
-        medicalId: "123",
-        province: "001",
-        city: "001",
-      }
+      this.form = data
       this.addVisible = true
     },
     submit() {
@@ -182,6 +195,7 @@ export default {
           addMedicalunion(this.form).then((res) => {
             if (res.code == 1) {
               this.$message.success("添加成功")
+              this.addVisible = false
             }
           })
         } else {
@@ -190,6 +204,10 @@ export default {
         }
       })
     },
+    clearForm() {
+      this.form = {}
+      this.$refs["form"].resetFields()
+    },
   },
 }
 </script>
-- 
2.22.0