|
@@ -52,7 +52,6 @@
|
|
const _ = require('lodash');
|
|
const _ = require('lodash');
|
|
import methodsUtil from '@/util/opera';
|
|
import methodsUtil from '@/util/opera';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
-const { mapActions: selfShop } = createNamespacedHelpers('selfShop');
|
|
|
|
const { mapActions: goods } = createNamespacedHelpers('goods');
|
|
const { mapActions: goods } = createNamespacedHelpers('goods');
|
|
const { mapActions: goodsTags } = createNamespacedHelpers('goodsTags');
|
|
const { mapActions: goodsTags } = createNamespacedHelpers('goodsTags');
|
|
const { mapActions: dictData } = createNamespacedHelpers('dictData');
|
|
const { mapActions: dictData } = createNamespacedHelpers('dictData');
|
|
@@ -109,9 +108,7 @@ export default {
|
|
props: { multiple: true, label: 'label', value: 'code' },
|
|
props: { multiple: true, label: 'label', value: 'code' },
|
|
// 活动标签
|
|
// 活动标签
|
|
act_tagsList: [],
|
|
act_tagsList: [],
|
|
-
|
|
|
|
goodsStatusList: [],
|
|
goodsStatusList: [],
|
|
- shop: {},
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -122,13 +119,12 @@ export default {
|
|
...dictData({ getDict: 'query' }),
|
|
...dictData({ getDict: 'query' }),
|
|
...actTags({ actQuery: 'query' }),
|
|
...actTags({ actQuery: 'query' }),
|
|
...goodsTags(['tree']),
|
|
...goodsTags(['tree']),
|
|
- ...selfShop(['getInfo', 'getGoods', 'goodsCreate']),
|
|
|
|
- ...goods(['delete', 'fetch', 'update', 'create']),
|
|
|
|
|
|
+ ...goods(['query', 'delete', 'fetch', 'update', 'create']),
|
|
...methodsUtil,
|
|
...methodsUtil,
|
|
async search({ skip = 0, limit = this.limit, ...others } = {}) {
|
|
async search({ skip = 0, limit = this.limit, ...others } = {}) {
|
|
let query = { skip, limit, ...others, shop: this.user.shop.id };
|
|
let query = { skip, limit, ...others, shop: this.user.shop.id };
|
|
if (Object.keys(this.searchInfo).length > 0) query = { ...query, ...this.searchInfo };
|
|
if (Object.keys(this.searchInfo).length > 0) query = { ...query, ...this.searchInfo };
|
|
- const res = await this.getGoods(query);
|
|
|
|
|
|
+ const res = await this.query(query);
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$set(this, `list`, res.data);
|
|
this.$set(this, `list`, res.data);
|
|
this.$set(this, `total`, res.total);
|
|
this.$set(this, `total`, res.total);
|
|
@@ -146,8 +142,6 @@ export default {
|
|
if (this.$checkRes(res)) this.$set(this, `tagsList`, res.data);
|
|
if (this.$checkRes(res)) this.$set(this, `tagsList`, res.data);
|
|
res = await this.getDict({ code: 'goods_status' });
|
|
res = await this.getDict({ code: 'goods_status' });
|
|
if (this.$checkRes(res)) this.$set(this, `goodsStatusList`, res.data);
|
|
if (this.$checkRes(res)) this.$set(this, `goodsStatusList`, res.data);
|
|
- res = await this.getInfo();
|
|
|
|
- if (this.$checkRes(res)) this.$set(this, `shop`, res.data);
|
|
|
|
res = await this.actQuery();
|
|
res = await this.actQuery();
|
|
if (this.$checkRes(res)) this.$set(this, `act_tagsList`, res.data);
|
|
if (this.$checkRes(res)) this.$set(this, `act_tagsList`, res.data);
|
|
},
|
|
},
|