|
@@ -38,6 +38,20 @@
|
|
|
<template #brief>
|
|
|
<editor v-model="form.brief" url="/files/point/goods/upload" />
|
|
|
</template>
|
|
|
+ <template #shop>
|
|
|
+ <el-select
|
|
|
+ v-model="form.shop"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ reserve-keyword
|
|
|
+ placeholder="请输入商铺名称"
|
|
|
+ :remote-method="searchShop"
|
|
|
+ :loading="loading"
|
|
|
+ @change="selectShop"
|
|
|
+ >
|
|
|
+ <el-option v-for="item in shopList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
</data-form>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -79,17 +93,18 @@ export default {
|
|
|
{ label: '删除', method: 'delete', confirm: true, type: 'danger' },
|
|
|
],
|
|
|
btnList: [{ label: '添加', method: 'add' }],
|
|
|
- searchFields: [
|
|
|
- { label: '商品名称', model: 'name' },
|
|
|
- { label: '商品状态', model: 'status', type: 'select' },
|
|
|
- { label: '店铺名称', model: 'shop', custom: true },
|
|
|
- ],
|
|
|
+ // searchFields: [
|
|
|
+ // { label: '商品名称', model: 'name' },
|
|
|
+ // { label: '商品状态', model: 'status', type: 'select' },
|
|
|
+
|
|
|
+ // ],
|
|
|
searchInfo: {},
|
|
|
list: [],
|
|
|
total: 0,
|
|
|
limit: 10,
|
|
|
// info部分
|
|
|
infoFields: [
|
|
|
+ { label: '店铺名称', model: 'shop', custom: true },
|
|
|
{ label: '商品名称', model: 'name' },
|
|
|
{ label: '商品分类', model: 'tags', custom: true },
|
|
|
{ label: '活动标签', model: 'act_tags', type: 'selectMany' },
|
|
@@ -145,6 +160,15 @@ export default {
|
|
|
},
|
|
|
// 店铺名称远程查询
|
|
|
async querySearch(value) {
|
|
|
+ this.loading = true;
|
|
|
+ let res = await this.shopQuery({ name: value });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, 'shopList', res.data);
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ selectShop(data) {},
|
|
|
+ async searchShop(value) {
|
|
|
let res = await this.shopQuery({ name: value });
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, 'shopList', res.data);
|
|
@@ -221,7 +245,6 @@ export default {
|
|
|
},
|
|
|
// 保存
|
|
|
async toSave({ data }) {
|
|
|
- data.shop = this.user.shop.id;
|
|
|
let res;
|
|
|
if (data.id) res = await this.update(data);
|
|
|
else res = await this.create(data);
|