|
@@ -94,6 +94,8 @@ export default {
|
|
// 查询
|
|
// 查询
|
|
async search({ skip = 0, limit = this.$limit, ...info } = {}) {
|
|
async search({ skip = 0, limit = this.$limit, ...info } = {}) {
|
|
let condition = _.cloneDeep(this.searchForm);
|
|
let condition = _.cloneDeep(this.searchForm);
|
|
|
|
+ // 判断是否是个人店铺查询
|
|
|
|
+ if (this.user.role.code == 'shopAdmin') info.shop = this.user.shop._id || this.user.shop.id;
|
|
let res = await this.query({ skip, limit, ...condition, ...info });
|
|
let res = await this.query({ skip, limit, ...condition, ...info });
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$set(this, 'list', res.data);
|
|
this.$set(this, 'list', res.data);
|
|
@@ -116,6 +118,8 @@ export default {
|
|
// 保存
|
|
// 保存
|
|
async onSubmit({ data }) {
|
|
async onSubmit({ data }) {
|
|
data.exam_time = moment().format('YYYY-MM-DD HH:mm:ss');
|
|
data.exam_time = moment().format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
+ // 判断是否是个人店铺查询
|
|
|
|
+ if (this.user.role.code == 'shopAdmin' && !data.shop) data.shop = this.user.shop._id || this.user.shop.id;
|
|
let res;
|
|
let res;
|
|
if (data.id) res = await this.update(data);
|
|
if (data.id) res = await this.update(data);
|
|
else res = await this.create(data);
|
|
else res = await this.create(data);
|