|
@@ -125,6 +125,7 @@ export default {
|
|
...goodsTags(['tree']),
|
|
...goodsTags(['tree']),
|
|
...goods(['copy', 'query', 'delete', 'fetch', 'update', 'create']),
|
|
...goods(['copy', '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 };
|
|
@@ -134,6 +135,7 @@ export default {
|
|
this.$set(this, `total`, res.total);
|
|
this.$set(this, `total`, res.total);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 添加自定义
|
|
initAddData() {
|
|
initAddData() {
|
|
const obj = {
|
|
const obj = {
|
|
status: '1',
|
|
status: '1',
|
|
@@ -166,11 +168,13 @@ export default {
|
|
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);
|
|
},
|
|
},
|
|
|
|
+ // 商品状态
|
|
getStatus(data) {
|
|
getStatus(data) {
|
|
const res = this.goodsStatusList.find((f) => f.value === data);
|
|
const res = this.goodsStatusList.find((f) => f.value === data);
|
|
if (res) return res.label;
|
|
if (res) return res.label;
|
|
return '';
|
|
return '';
|
|
},
|
|
},
|
|
|
|
+ // 活动标签
|
|
getAct_tags(data) {
|
|
getAct_tags(data) {
|
|
const arr = [];
|
|
const arr = [];
|
|
for (const val of data) {
|
|
for (const val of data) {
|
|
@@ -179,6 +183,7 @@ export default {
|
|
}
|
|
}
|
|
return arr.join(';');
|
|
return arr.join(';');
|
|
},
|
|
},
|
|
|
|
+ // 商品分类
|
|
getTags(data) {
|
|
getTags(data) {
|
|
let list = this.tagsList;
|
|
let list = this.tagsList;
|
|
const getChildren = (list) =>
|
|
const getChildren = (list) =>
|
|
@@ -245,6 +250,7 @@ export default {
|
|
this.search();
|
|
this.search();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 库存管理
|
|
toSpec({ data }) {
|
|
toSpec({ data }) {
|
|
this.$router.push({ path: `/selfShop/spec/${data._id}` });
|
|
this.$router.push({ path: `/selfShop/spec/${data._id}` });
|
|
},
|
|
},
|