|
@@ -124,8 +124,8 @@ export default {
|
|
|
fieldsForm: [
|
|
|
{ label: '名称', model: 'name' },
|
|
|
{ label: '跳转路径', model: 'route' },
|
|
|
- { label: '未选中', model: 'normal', type: 'upload', limit: 1, url: '/files/point/config/upload' },
|
|
|
- { label: '选中', model: 'active', type: 'upload', limit: 1, url: '/files/point/config/upload' },
|
|
|
+ { label: '未选中', model: 'normal', type: 'upload', limit: 1, url: '/files/point/shopOne/config/upload' },
|
|
|
+ { label: '选中', model: 'active', type: 'upload', limit: 1, url: '/files/point/shopOne/config/upload' },
|
|
|
{ label: '跳转类型', model: 'type', type: 'select' },
|
|
|
{ label: '是否使用', model: 'is_use', type: 'select' },
|
|
|
{ label: '排序', model: 'sort', type: 'number' },
|
|
@@ -149,11 +149,14 @@ export default {
|
|
|
await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...config(['query', 'fetch', 'update']),
|
|
|
+ ...config(['query', 'fetch', 'create', 'update']),
|
|
|
...dictData({ dictQuery: 'query' }),
|
|
|
//执行查询
|
|
|
async search() {
|
|
|
- const res = await this.fetch();
|
|
|
+ // 判断是否是个人店铺查询
|
|
|
+ const info = {};
|
|
|
+ if (this.user.role.code == 'shopAdmin') info.shop = this.user.shop._id || this.user.shop.id;
|
|
|
+ const res = await this.fetch(info);
|
|
|
if (this.$checkRes(res)) {
|
|
|
let data = res.data;
|
|
|
if (data.config) {
|
|
@@ -207,9 +210,14 @@ export default {
|
|
|
async toSave({ data }) {
|
|
|
data.bottom_menu.list = this.list;
|
|
|
let config = { logo: data.logo, buyPoint: Number(data.buyPoint), pointPlan: data.pointPlan, share: data.share, autoCloseOrder: data.autoCloseOrder };
|
|
|
+ // 判断是否是个人店铺查询
|
|
|
+ if (this.user.role.code == 'shopAdmin' && !data.shop) data.shop = this.user.shop._id || this.user.shop.id;
|
|
|
data.config = config;
|
|
|
- const res = await this.update(data);
|
|
|
+ let res;
|
|
|
+ if (data._id) await this.update(data);
|
|
|
+ else await this.create(data);
|
|
|
this.$checkRes(res, '操作成功', '操作失败');
|
|
|
+ this.search();
|
|
|
},
|
|
|
// 查询其他信息
|
|
|
async searchOther() {
|