Просмотр исходного кода

修复用户修改时报错的问题

vothin 3 лет назад
Родитель
Сommit
2bafd9e60d

+ 16 - 0
src/views/customer/components/customerManager.vue

@@ -671,6 +671,7 @@ export default {
       },
       /** 空床位 **/
       emptyBeds: [],
+      partFrames: [],
       /** frame 是否为空床位 */
       isEmptyFrame: true,
       rules: {
@@ -1504,8 +1505,23 @@ export default {
       shop_API.getShop(shopId).then(res => {
         this.shop = res;
         this.getEmptyBeds()
+        this.getPartFrame(shopId)
       })
     },
+    getFrame(frame_id) {
+      return this.partFrames.filter(item => item.id === frame_id)
+    },
+    getPartFrame(partId) {
+      if (this.shop.shop_type === "0" && this.shop.parent_id === -1) {
+        API_Frame.getAllFrames(partId).then(res => {
+          this.partFrames = [...res]
+        })
+      } else {
+        API_Frame.getFramesPartId(partId).then(res => {
+          this.partFrames = [...res]
+        })
+      }
+    }
   }
 }
 </script>

+ 22 - 2
src/views/customer/components/patientManager.vue

@@ -509,6 +509,7 @@
     import avator from "@/assets/avatar.jpeg";
     import {FRAME_TYPE} from "@/utils/enum/FrameTypeEnum";
     import * as API_SystemConfig from "@/api/ncs_systemconfig";
+    import * as shop_API from "@/api/ncs_shop";
     const serverUrl = domain.serverUrl
     export default {
         name: 'PatientManager',
@@ -622,6 +623,7 @@
                 },
                 /** 空床位 **/
                 emptyBeds: [],
+                partFrames: [],
                 /** frame 是否为空床位 */
                 isEmptyFrame: true,
                 rules: {
@@ -926,7 +928,7 @@
                     }
                 ]
             })
-            this.getEmptyBeds()
+          this.getShop(this.$store.getters.partId)
 
             this.getCloud()
 
@@ -1582,8 +1584,26 @@
             })
           },
           getFrame(frame_id) {
-            return this.emptyBeds.filter(item => item.id === frame_id)
+            return this.partFrames.filter(item => item.id === frame_id)
           },
+          getShop(shopId) {
+            shop_API.getShop(shopId).then(res => {
+              this.shop = res;
+              this.getEmptyBeds()
+              this.getPartFrame(shopId)
+            })
+          },
+          getPartFrame(partId) {
+            if (this.shop.shop_type === "0" && this.shop.parent_id === -1) {
+              API_Frame.getAllFrames(partId).then(res => {
+                this.partFrames = [...res]
+              })
+            } else {
+              API_Frame.getFramesPartId(partId).then(res => {
+                this.partFrames = [...res]
+              })
+            }
+          }
         }
     }
 </script>