Przeglądaj źródła

自营店添加店铺id

YY 2 lat temu
rodzic
commit
0f61135afa

+ 2 - 10
src/views/selfShop/bill/index.vue

@@ -32,7 +32,6 @@ import FileSaver from 'file-saver';
 const ExcelJS = require('exceljs');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('getBill');
-const { mapActions: selfShop } = createNamespacedHelpers('selfShop');
 const { mapActions: outBill } = createNamespacedHelpers('outBill');
 export default {
   name: 'card-1',
@@ -64,8 +63,6 @@ export default {
       ],
       // 多选值
       selected: [],
-      // 自营店铺信息
-      shop: {},
     };
   },
   async created() {
@@ -73,7 +70,6 @@ export default {
     await this.searchOther();
   },
   methods: {
-    ...selfShop(['getInfo']),
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     ...outBill({ outQuery: 'query', outCreate: 'create' }),
     // 查询
@@ -83,7 +79,7 @@ export default {
         condition[`start`] = _.head(condition.buy_time);
         condition[`end`] = _.last(condition.buy_time);
         delete condition.buy_time;
-        let res = await this.query({ skip, limit, ...condition, ...info, shop: _.get(this.shop, '_id') });
+        let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
         if (this.$checkRes(res)) {
           this.$set(this, 'info', res.data);
           this.$set(this, 'afterSaleList', res.data.afterSaleList);
@@ -153,11 +149,7 @@ export default {
       });
     },
     // 查询其他信息
-    async searchOther() {
-      let res;
-      res = await this.getInfo();
-      if (this.$checkRes(res)) this.$set(this, `shop`, res.data);
-    },
+    async searchOther() {},
   },
   computed: {
     ...mapState(['user']),

+ 1 - 2
src/views/selfShop/goods/index.vue

@@ -125,8 +125,7 @@ export default {
     ...goods(['delete', 'fetch', 'update', 'create']),
     ...methodsUtil,
     async search({ skip = 0, limit = this.limit, ...others } = {}) {
-      console.log(this.user);
-      let query = { skip, limit, ...others };
+      let query = { skip, limit, ...others, shop: this.user.shop.id };
       if (Object.keys(this.searchInfo).length > 0) query = { ...query, ...this.searchInfo };
       const res = await this.getGoods(query);
       if (this.$checkRes(res)) {

+ 1 - 4
src/views/selfShop/goodsRate/index.vue

@@ -28,7 +28,6 @@
 <script>
 const _ = require('lodash');
 import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
-const { mapActions: selfShop } = createNamespacedHelpers('selfShop');
 const { mapActions: goods } = createNamespacedHelpers('goods');
 const { mapActions: dictData } = createNamespacedHelpers('dictData');
 export default {
@@ -52,7 +51,6 @@ export default {
       searchForm: {},
       // 多选值
       selected: [],
-      shop: {},
     };
   },
   async created() {
@@ -61,11 +59,10 @@ export default {
   },
   methods: {
     ...dictData({ getDict: 'query' }),
-    ...selfShop(['getInfo', 'getGoods', 'goodsCreate']),
     ...goods(['delete', 'fetch', 'update', 'create']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
-      let res = await this.getGoods({ skip, limit, ...condition, ...info, shop: _.get(this.shop, '_id') });
+      let res = await this.getGoods({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);

+ 5 - 12
src/views/selfShop/order/index.vue

@@ -4,18 +4,18 @@
       <el-col :span="24" class="main animate__animated animate__backInRight">
         <el-col :span="24" class="one"> <span>订单管理</span> </el-col>
         <el-col :span="24" class="four">
-          <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick" v-if="shop && shop._id">
+          <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
             <el-tab-pane label="待付款" name="1">
-              <card-1 :shop="shop" :statusList="statusList"></card-1>
+              <card-1 :statusList="statusList"></card-1>
             </el-tab-pane>
             <el-tab-pane label="待发货" name="2">
-              <card-2 :shop="shop" :statusList="statusList"></card-2>
+              <card-2 :statusList="statusList"></card-2>
             </el-tab-pane>
             <el-tab-pane label="待收货" name="3">
-              <card-3 :shop="shop" :statusList="statusList"></card-3>
+              <card-3 :statusList="statusList"></card-3>
             </el-tab-pane>
             <el-tab-pane label="已收货" name="4">
-              <card-4 :shop="shop" :statusList="statusList"></card-4>
+              <card-4 :statusList="statusList"></card-4>
             </el-tab-pane>
           </el-tabs>
         </el-col>
@@ -28,8 +28,6 @@
 const _ = require('lodash');
 import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
 const { mapActions: dictData } = createNamespacedHelpers('dictData');
-const { mapActions: selfShop } = createNamespacedHelpers('selfShop');
-
 export default {
   name: 'index',
   props: {},
@@ -45,8 +43,6 @@ export default {
       activeName: '2',
       // 类型列表
       statusList: [],
-      // 自营店铺信息
-      shop: {},
     };
   },
   async created() {
@@ -54,7 +50,6 @@ export default {
   },
   methods: {
     ...dictData({ dictQuery: 'query' }),
-    ...selfShop(['getInfo']),
     handleClick(tab, event) {},
     // 查询其他信息
     async searchOther() {
@@ -64,8 +59,6 @@ export default {
       if (this.$checkRes(res)) {
         this.$set(this, `statusList`, res.data);
       }
-      res = await this.getInfo();
-      if (this.$checkRes(res)) this.$set(this, `shop`, res.data);
     },
   },
   computed: {

+ 2 - 2
src/views/selfShop/order/parts/card-1.vue

@@ -28,7 +28,7 @@ import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions } = createNamespacedHelpers('order');
 export default {
   name: 'card-1',
-  props: { statusList: { type: Array }, shop: { type: Object } },
+  props: { statusList: { type: Array } },
   components: { search1: () => import('./search-1.vue') },
   data: function () {
     return {
@@ -60,7 +60,7 @@ export default {
         delete condition.buy_time;
       }
       info.status = '0';
-      let res = await this.query({ skip, limit, ...condition, ...info, shop: _.get(this.shop, '_id') });
+      let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);

+ 2 - 2
src/views/selfShop/order/parts/card-2.vue

@@ -2,7 +2,7 @@
   <div id="card-1">
     <el-row>
       <el-col :span="24" class="main">
-        <detail-1 v-if="num == '1'" @toDeliver="toDeliver" :statusList="statusList" :shop="shop"></detail-1>
+        <detail-1 v-if="num == '1'" @toDeliver="toDeliver" :statusList="statusList"></detail-1>
         <detail-2 v-else-if="num == '2'" :deliverList="list" @toBack="toBack"></detail-2>
       </el-col>
     </el-row>
@@ -14,7 +14,7 @@ const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'card-1',
-  props: { statusList: { type: Array }, shop: { type: Object } },
+  props: { statusList: { type: Array } },
   components: { detail1: () => import('./parts/detail-1.vue'), detail2: () => import('./parts/detail-2.vue') },
   data: function () {
     return {

+ 2 - 2
src/views/selfShop/order/parts/card-3.vue

@@ -30,7 +30,7 @@ const { mapActions } = createNamespacedHelpers('orderDetail');
 
 export default {
   name: 'card-1',
-  props: { statusList: { type: Array }, shop: { type: Object } },
+  props: { statusList: { type: Array } },
   components: { search1: () => import('./search-1.vue') },
   data: function () {
     return {
@@ -63,7 +63,7 @@ export default {
         delete condition.buy_time;
       }
       info.status = '2';
-      let res = await this.query({ skip, limit, ...condition, ...info, shop: _.get(this.shop, '_id') });
+      let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);

+ 2 - 2
src/views/selfShop/order/parts/card-4.vue

@@ -30,7 +30,7 @@ const { mapActions } = createNamespacedHelpers('orderDetail');
 
 export default {
   name: 'card-1',
-  props: { statusList: { type: Array }, shop: { type: Object } },
+  props: { statusList: { type: Array } },
   components: { search1: () => import('./search-1.vue') },
   data: function () {
     return {
@@ -64,7 +64,7 @@ export default {
         delete condition.buy_time;
       }
       info.status = '3';
-      let res = await this.query({ skip, limit, ...condition, ...info, shop: _.get(this.shop, '_id') });
+      let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);

+ 2 - 2
src/views/selfShop/order/parts/parts/detail-1.vue

@@ -36,7 +36,7 @@ const { mapActions } = createNamespacedHelpers('orderDetail');
 const { mapActions: shop } = createNamespacedHelpers('shop');
 export default {
   name: 'card-1',
-  props: { statusList: { type: Array }, shop: { type: Object } },
+  props: { statusList: { type: Array } },
   components: { search1: () => import('../search-1.vue') },
   data: function () {
     return {
@@ -76,7 +76,7 @@ export default {
         delete condition.buy_time;
       }
       info.status = '1';
-      let res = await this.query({ skip, limit, ...condition, ...info, shop: _.get(this.shop, '_id') });
+      let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);

+ 1 - 1
src/views/selfShop/sales/index.vue

@@ -82,7 +82,7 @@ export default {
     // 查询
     async search({ skip = 0, limit = 10, ...info } = {}) {
       let condition = _.cloneDeep(this.searchForm);
-      let res = await this.query({ skip, limit, ...condition, ...info, shop: _.get(this.shop, '_id') });
+      let res = await this.query({ skip, limit, ...condition, ...info, shop: this.user.shop.id });
       if (this.$checkRes(res)) {
         this.$set(this, 'list', res.data);
         this.$set(this, 'total', res.total);