|
@@ -4,7 +4,6 @@
|
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
|
<el-col :span="24" class="one"> <span>平台活动商品添加</span> </el-col>
|
|
|
<el-col :span="4" class="two">
|
|
|
- <!-- <el-autocomplete v-model="goods" :fetch-suggestions="querySearchAsync" placeholder="请输入商品名称" @select="handleSelect"></el-autocomplete> -->
|
|
|
<el-input placeholder="请输入商品名称" v-model="goods">
|
|
|
<el-button slot="append" icon="el-icon-search" @click="search"></el-button>
|
|
|
</el-input>
|
|
@@ -53,30 +52,17 @@ export default {
|
|
|
total: 0,
|
|
|
// 商品搜索
|
|
|
goods: '',
|
|
|
- // goodsList: [],
|
|
|
- // timeout: null,
|
|
|
// 商品状态
|
|
|
statusList: [],
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
await this.searchOther();
|
|
|
- // await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
...dictData({ dictQuery: 'query' }),
|
|
|
...goods({ gQuery: 'query' }),
|
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
- // 查询
|
|
|
- // async search() {
|
|
|
- // let res = await this.gQuery();
|
|
|
- // if (this.$checkRes(res)) {
|
|
|
- // for (const val of res.data) {
|
|
|
- // val.value = val.name;
|
|
|
- // }
|
|
|
- // this.$set(this, 'goodsList', res.data);
|
|
|
- // }
|
|
|
- // },
|
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
if (this.goods) info.name = this.goods;
|
|
|
let res = await this.gQuery({ skip, limit, ...info });
|
|
@@ -85,25 +71,6 @@ export default {
|
|
|
this.$set(this, 'total', res.total);
|
|
|
}
|
|
|
},
|
|
|
- // 点击选中
|
|
|
- // handleSelect(item) {
|
|
|
- // this.list.push(item);
|
|
|
- // this.$set(this, 'total', 1);
|
|
|
- // },
|
|
|
- //获取搜索商品信息
|
|
|
- // querySearchAsync(queryString, cb) {
|
|
|
- // var goodsList = this.goodsList;
|
|
|
- // var results = queryString ? goodsList.filter(this.createStateFilter(queryString)) : goodsList;
|
|
|
- // clearTimeout(this.timeout);
|
|
|
- // this.timeout = setTimeout(() => {
|
|
|
- // cb(results);
|
|
|
- // }, 3000 * Math.random());
|
|
|
- // },
|
|
|
- // createStateFilter(queryString) {
|
|
|
- // return (state) => {
|
|
|
- // return state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0;
|
|
|
- // };
|
|
|
- // },
|
|
|
// 新增
|
|
|
async toAdd({ data }) {
|
|
|
let form = { platformAct: this.id, shop: data.shop._id, goods: data._id };
|