From 2a68c9430e16daf0f725ed89479233334ce406d4 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 16 十月 2025 11:09:09 +0800
Subject: [PATCH] 店铺上下级

---
 manager/src/views/seller/shop/shopDetail.vue |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/manager/src/views/seller/shop/shopDetail.vue b/manager/src/views/seller/shop/shopDetail.vue
index 952b59f..85f6fda 100644
--- a/manager/src/views/seller/shop/shopDetail.vue
+++ b/manager/src/views/seller/shop/shopDetail.vue
@@ -140,6 +140,20 @@
             <template v-else>鏆傛棤鏍囩</template>
             </span>
           </p>
+          <p class="item">
+            <span class="label">涓婄骇搴楅摵锛�</span>
+            <span class="info">
+              {{storeRelationship.upStore ? storeRelationship.upStore.storeName:'鏆傛棤'}}
+            </span>
+          </p>
+          <p class="item">
+            <span class="label">涓嬬骇搴楅摵锛�</span>
+            <span class="info">
+              {{ storeRelationship.downStore && storeRelationship.downStore.length
+              ? storeRelationship.downStore.map(store => store.storeName).join('銆�')
+              : '鏆傛棤' }}
+            </span>
+          </p>
           <div style="display: flex;align-items: center;justify-content: center;">
             <Button type="primary"  @click="addStoreTag(storeInfo)">鏂板鏍囩</Button>
           </div>
@@ -605,6 +619,7 @@
 </template>
 
 <script>
+  import { getStoreRelationship} from "@/api/storeRelationship"
   import { getTag,bind,getStoreTagsById,delTagByStoreTagRefId } from "@/api/store-tag"
   import ossManage from "@/views/sys/oss-manage/ossManage";
   import * as RegExp from '@/libs/RegExp.js';
@@ -620,6 +635,7 @@
     },
     data() {
       return {
+        storeRelationship:{},//搴楅摵鍏崇郴瀵硅薄
         tagOptions:[],
         submitLoading:false,
         tagForm:{
@@ -892,7 +908,26 @@
         refundOrderTotal: 0,//鍞悗鍗曟�绘潯鏁�
       };
     },
+    watch: {
+      // 鐩戝惉璺敱瀵硅薄鍙樺寲
+      $route(to, from) {
+        console.log(to.name)
+        if (to.name === 'shop-detail' && to.query.id) {
+          if (to.query.id !== from.query.id) {
+            this.id = to.query.id;
+            this.init();
+          }
+        }
+      }
+    },
     methods: {
+      getStoreRelationship(){
+        getStoreRelationship(this.id).then(res =>{
+            if (res.code === 200){
+              this.$set(this, "storeRelationship", res.data);
+            }
+          })
+      },
       handleDeleteTag(storeTagRefId){
         console.log(storeTagRefId)
         delTagByStoreTagRefId(storeTagRefId).then(res=>{
@@ -954,7 +989,7 @@
       },
       init() {
         this.getStoreTags();
-
+        this.getStoreRelationship();
         this.getStoreTag();
         //鏌ュ簵閾哄熀鏈俊鎭�
         this.getStoreInfo();
@@ -1107,6 +1142,7 @@
     mounted() {
       this.id = this.$route.query.id;
       this.init();
+      console.log("鍔犺浇椤甸潰")
     }
   };
 </script>

--
Gitblit v1.8.0