lrf402788946 4 tahun lalu
induk
melakukan
e89722e0c5
1 mengubah file dengan 4 tambahan dan 1 penghapusan
  1. 4 1
      src/views/superAdminCenter/business/index.vue

+ 4 - 1
src/views/superAdminCenter/business/index.vue

@@ -15,6 +15,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 import dataForm from '@/components/form.vue';
 import dataTable from '@/components/data-table.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
@@ -71,7 +72,9 @@ export default {
     ...users(['query', 'fetch', 'create', 'update', 'delete']),
     ...authUser({ authUserDelete: 'delete', getBusinessUser: 'getBusinessUser' }),
     async search({ skip = 0, limit = 10, ...info } = {}) {
-      const res = await this.getBusinessUser({ skip, limit, pid: this.user.uid, ...info });
+      let query = { skip, limit, ...info };
+      this.user.role == '0' && !_.get(this.user, 'pid') ? '' : (query.pid = this.user.uid);
+      const res = await this.getBusinessUser(query);
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);