|
@@ -123,7 +123,7 @@ export default {
|
|
...dictData({ getDict: 'query' }),
|
|
...dictData({ getDict: 'query' }),
|
|
...actTags({ actQuery: 'query' }),
|
|
...actTags({ actQuery: 'query' }),
|
|
...goodsTags(['tree']),
|
|
...goodsTags(['tree']),
|
|
- ...goods(['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 };
|
|
@@ -141,19 +141,15 @@ export default {
|
|
};
|
|
};
|
|
this.$set(this, 'form', obj);
|
|
this.$set(this, 'form', obj);
|
|
},
|
|
},
|
|
|
|
+ // 复制
|
|
async toCopy({ data }) {
|
|
async toCopy({ data }) {
|
|
this.$confirm('是否确认复制该商品?', '提示', {
|
|
this.$confirm('是否确认复制该商品?', '提示', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
type: 'warning',
|
|
type: 'warning',
|
|
}).then(async () => {
|
|
}).then(async () => {
|
|
- delete data.id;
|
|
|
|
- delete data._id;
|
|
|
|
- delete data.meta;
|
|
|
|
- delete data.view_num;
|
|
|
|
- delete data.__v;
|
|
|
|
let res;
|
|
let res;
|
|
- res = await this.create(data);
|
|
|
|
|
|
+ res = await this.copy(data.id);
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$message({ type: `success`, message: `复制成功` });
|
|
this.$message({ type: `success`, message: `复制成功` });
|
|
this.toBack();
|
|
this.toBack();
|
|
@@ -161,6 +157,7 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 查询其他信息
|
|
async searchOthers() {
|
|
async searchOthers() {
|
|
let res = await this.tree();
|
|
let res = await this.tree();
|
|
if (this.$checkRes(res)) this.$set(this, `tagsList`, res.data);
|
|
if (this.$checkRes(res)) this.$set(this, `tagsList`, res.data);
|