zxl
2025-10-16 2a68c9430e16daf0f725ed89479233334ce406d4
店铺上下级
1个文件已修改
1个文件已添加
46 ■■■■■ 已修改文件
manager/src/api/storeRelationship.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manager/src/views/seller/shop/shopDetail.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manager/src/api/storeRelationship.js
New file
@@ -0,0 +1,8 @@
import service from "@/libs/axios";
export const getStoreRelationship = (param) =>{
  return service({
    url:"/lmk/storeRelationship/" + param,
    method:"GET"
  })
}
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>