|
@@ -22,7 +22,7 @@
|
|
|
>
|
|
|
<el-option v-for="item in goodsList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
|
|
|
</el-select>
|
|
|
- <p style="color: red">只能查询到设置团购金额的商品</p>
|
|
|
+ <!-- <p style="color: red">只能查询到设置团购金额的商品</p> -->
|
|
|
</template>
|
|
|
<template #leader>
|
|
|
<el-select v-model="form.leader" filterable clearable remote :remote-method="leadSearch" placeholder="请输入团长" style="width: 100%">
|
|
@@ -160,13 +160,13 @@ export default {
|
|
|
this.loading = true;
|
|
|
let res = await this.goodsQuery({ name: value });
|
|
|
if (this.$checkRes(res)) {
|
|
|
- let list = [];
|
|
|
- for (const p1 of res.data) {
|
|
|
- let arr = await this.goodsConfigQuery({ goods: p1._id });
|
|
|
- if (this.$checkRes(arr)) if (arr.total > 0) list.push(p1);
|
|
|
- }
|
|
|
- this.$set(this, 'goodsList', list);
|
|
|
- // this.$set(this, 'goodsList', res.data);
|
|
|
+ // let list = [];
|
|
|
+ // for (const p1 of res.data) {
|
|
|
+ // let arr = await this.goodsConfigQuery({ goods: p1._id });
|
|
|
+ // if (this.$checkRes(arr)) if (arr.total > 0) list.push(p1);
|
|
|
+ // }
|
|
|
+ // this.$set(this, 'goodsList', list);
|
|
|
+ this.$set(this, 'goodsList', res.data);
|
|
|
}
|
|
|
this.loading = false;
|
|
|
},
|
|
@@ -190,11 +190,14 @@ export default {
|
|
|
// 保存
|
|
|
async toSave({ data }) {
|
|
|
let res;
|
|
|
- if (this.id) res = await this.update(data);
|
|
|
- else res = await this.create(data);
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$message({ type: `success`, message: `维护信息成功` });
|
|
|
- this.toBack();
|
|
|
+ if (this.form.group_config.length == 0) this.$message({ type: `warning`, message: `该商品没有规格设置团购金额,请在商品管理设置` });
|
|
|
+ else {
|
|
|
+ if (this.id) res = await this.update(data);
|
|
|
+ else res = await this.create(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({ type: `success`, message: `维护信息成功` });
|
|
|
+ this.toBack();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 返回
|