|
@@ -105,6 +105,7 @@ 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');
|
|
const { mapActions: actTags } = createNamespacedHelpers('actTags');
|
|
const { mapActions: actTags } = createNamespacedHelpers('actTags');
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: 'index',
|
|
name: 'index',
|
|
props: {},
|
|
props: {},
|
|
@@ -172,22 +173,28 @@ export default {
|
|
statusList: [],
|
|
statusList: [],
|
|
// 返现金额类型
|
|
// 返现金额类型
|
|
typeList: [{ label: '固定金额' }, { label: '百分比' }],
|
|
typeList: [{ label: '固定金额' }, { label: '百分比' }],
|
|
|
|
+ // 查询条件
|
|
|
|
+ searchQuery: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.searchOthers();
|
|
this.searchOthers();
|
|
- this.search();
|
|
|
|
|
|
+ let route = JSON.parse(sessionStorage.getItem(this.$route.path));
|
|
|
|
+ if (route) this.search(route);
|
|
|
|
+ else this.search();
|
|
},
|
|
},
|
|
|
|
+
|
|
methods: {
|
|
methods: {
|
|
...dictData({ getDict: 'query' }),
|
|
...dictData({ getDict: 'query' }),
|
|
...actTags({ actQuery: 'query' }),
|
|
...actTags({ actQuery: 'query' }),
|
|
...goodsTags(['tree']),
|
|
...goodsTags(['tree']),
|
|
...goods(['copy', 'query', 'delete', 'fetch', 'update', 'create']),
|
|
...goods(['copy', 'query', 'delete', 'fetch', 'update', 'create']),
|
|
...methodsUtil,
|
|
...methodsUtil,
|
|
|
|
+
|
|
toSearch() {
|
|
toSearch() {
|
|
// this.$refs.dataTable.resetPage();
|
|
// this.$refs.dataTable.resetPage();
|
|
const res = this.$refs.dataTable.getPageConfig();
|
|
const res = this.$refs.dataTable.getPageConfig();
|
|
- console.log(res);
|
|
|
|
|
|
+ this.search(res);
|
|
},
|
|
},
|
|
// 查询
|
|
// 查询
|
|
async search({ skip = 0, limit = this.$limit, ...others } = {}) {
|
|
async search({ skip = 0, limit = this.$limit, ...others } = {}) {
|
|
@@ -197,6 +204,8 @@ export default {
|
|
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);
|
|
|
|
+ this.$set(this, `searchQuery`, query);
|
|
|
|
+ sessionStorage.removeItem(this.$route.path);
|
|
}
|
|
}
|
|
this.loadings = false;
|
|
this.loadings = false;
|
|
},
|
|
},
|
|
@@ -231,7 +240,6 @@ export default {
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$message({ type: `success`, message: `复制成功` });
|
|
this.$message({ type: `success`, message: `复制成功` });
|
|
this.toBack();
|
|
this.toBack();
|
|
- this.search();
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -253,13 +261,13 @@ export default {
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$message({ type: `success`, message: `维护信息成功` });
|
|
this.$message({ type: `success`, message: `维护信息成功` });
|
|
this.toBack();
|
|
this.toBack();
|
|
- this.search();
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 执行返回
|
|
// 执行返回
|
|
toBack() {
|
|
toBack() {
|
|
this.form = {};
|
|
this.form = {};
|
|
this.view = 'list';
|
|
this.view = 'list';
|
|
|
|
+ this.search(this.searchQuery);
|
|
},
|
|
},
|
|
// 上架
|
|
// 上架
|
|
async toPuton({ data }) {
|
|
async toPuton({ data }) {
|
|
@@ -273,11 +281,12 @@ export default {
|
|
let res;
|
|
let res;
|
|
if (data._id) res = await this.update(data);
|
|
if (data._id) res = await this.update(data);
|
|
if (this.$checkRes(res)) this.$message({ type: `success`, message: `修改成功` });
|
|
if (this.$checkRes(res)) this.$message({ type: `success`, message: `修改成功` });
|
|
- this.search();
|
|
|
|
|
|
+ this.search(this.searchQuery);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 库存管理
|
|
// 库存管理
|
|
toSpec({ data }) {
|
|
toSpec({ data }) {
|
|
|
|
+ sessionStorage.setItem(this.$route.path, JSON.stringify(this.searchQuery));
|
|
this.$router.push({ path: `/selfShop/spec/${data._id}` });
|
|
this.$router.push({ path: `/selfShop/spec/${data._id}` });
|
|
},
|
|
},
|
|
// 查询其他信息
|
|
// 查询其他信息
|