zs 1 سال پیش
والد
کامیت
5ecb7bec42
2فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 4 1
      src/views/platGroup/group/detail.vue
  2. 2 0
      src/views/platGroup/group/index.vue

+ 4 - 1
src/views/platGroup/group/detail.vue

@@ -167,7 +167,10 @@ export default {
     // 远程查询
     async querySearch(value) {
       this.loading = true;
-      let res = await this.goodsQuery({ name: value });
+      let data = { name: value };
+      // 判断是否是个人店铺查询
+      if (this.user.role.code == 'shopAdmin' && !data.shop) data.shop = this.user.shop._id || this.user.shop.id;
+      let res = await this.goodsQuery(data);
       if (this.$checkRes(res)) {
         // let list = [];
         // for (const p1 of res.data) {

+ 2 - 0
src/views/platGroup/group/index.vue

@@ -112,6 +112,8 @@ export default {
     async search({ skip = 0, limit = this.$limit, ...others } = {}) {
       let query = { skip, limit, ...others };
       if (Object.keys(this.searchInfo).length > 0) query = { ...query, ...this.searchInfo };
+      // 判断是否是个人店铺查询
+      if (this.user.role.code == 'shopAdmin') query.shop = this.user.shop._id || this.user.shop.id;
       const res = await this.query(query);
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);