提交 fcfa9067 authored 作者: 潘鹏's avatar 潘鹏

activity

上级 17a93261
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
</i-option> </i-option>
</i-select> </i-select>
</Form-item> </Form-item>
<Form-item label="特定商品" prop="itemIds" v-if="activity.useType==3"> <Form-item label="特定商品搜索" prop="itemIds" v-if="activity.useType==3">
<div class="search"> <div class="search">
<i-Input v-model="search" <i-Input v-model="search"
placeholder="请输入搜索内容(可选)" style="width:300px"></i-Input> placeholder="请输入搜索内容(可选)" style="width:300px"></i-Input>
...@@ -223,8 +223,56 @@ ...@@ -223,8 +223,56 @@
<section id="showItems"> <section id="showItems">
<table id="searchjqGrid"></table> <table id="searchjqGrid"></table>
</section> </section>
</Form-item>
<Form-item label="已选商品" v-if="activity.useType==3">
<section> <section>
<table id="adItemjqGrid"></table> <el-table
:data="tableData"
border
style="width: 100%;">
<el-table-column label="商品图片">
<template slot-scope="scope">
<img :src="scope.row.itemImg" alt="" width="50px" height="50px">
</template>
</el-table-column>
<el-table-column prop="itemCode" label="商品编号">
</el-table-column>
<el-table-column prop="itemBrief" label="商品名称">
</el-table-column>
<el-table-column prop="itemPrice" label="商品原价">
</el-table-column>
<el-table-column prop="discountPrice" label="商品现价">
</el-table-column>
<el-table-column prop="itemCount" label="库存">
</el-table-column>
<el-table-column prop="itemNum" label="点击量">
</el-table-column>
<el-table-column prop="supplier" label="供应商">
</el-table-column>
<el-table-column prop="dname" label="商品品名">
</el-table-column>
<el-table-column prop="enableFlag" label="状态">
</el-table-column>
<el-table-column prop="createTime" label="创建日期">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.row.itemId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[5,10,15,20]"
:page-size="5"
layout="total, sizes, prev, pager, next, jumper"
:total="AllpageNum">
</el-pagination>
</section> </section>
</Form-item> </Form-item>
<Form-item label="活动状态" prop="status"> <Form-item label="活动状态" prop="status">
......
...@@ -91,7 +91,12 @@ let vm = new Vue({ ...@@ -91,7 +91,12 @@ let vm = new Vue({
GoodstypeThree:null, GoodstypeThree:null,
categoryIdThree:null, categoryIdThree:null,
search:null, search:null,
Allitemids:[] Allitemids:[],
tableData:[],
currentPage:1,
AllpageNum:0,
Nowpagesize:5,
NowpageNum:1
}, },
methods: { methods: {
query: function () { query: function () {
...@@ -179,7 +184,7 @@ let vm = new Vue({ ...@@ -179,7 +184,7 @@ let vm = new Vue({
vm.changeGoodstype(); vm.changeGoodstype();
vm.changeGoodstype2(); vm.changeGoodstype2();
vm.clearItemids(1); vm.clearItemids(1);
// vm.AllItems(); vm.AllItems();
} }
}); });
}, },
...@@ -383,6 +388,8 @@ let vm = new Vue({ ...@@ -383,6 +388,8 @@ let vm = new Vue({
this.categoryIdThree=null this.categoryIdThree=null
// categoryId // categoryId
vm.activity.categoryId = null vm.activity.categoryId = null
vm.activity.itemIds = []
vm.tableData = null
}, },
handleSearch(e) { handleSearch(e) {
1==1 ? (()=>{ 1==1 ? (()=>{
...@@ -416,9 +423,6 @@ let vm = new Vue({ ...@@ -416,9 +423,6 @@ let vm = new Vue({
{label: '状态', name: 'enableFlag', index: 'enable_flag', width: 120, formatter: itemStatusFormat}, {label: '状态', name: 'enableFlag', index: 'enable_flag', width: 120, formatter: itemStatusFormat},
{label: '创建日期', name: 'createTime', index: 'create_time', width: 160} {label: '创建日期', name: 'createTime', index: 'create_time', width: 160}
], ],
multiselect: true,
multiboxonly:true,
beforeSelectRow: beforeSelectRow,
}); });
}); });
...@@ -436,6 +440,7 @@ let vm = new Vue({ ...@@ -436,6 +440,7 @@ let vm = new Vue({
vm.activity.itemIds.push(item) vm.activity.itemIds.push(item)
}) })
// vm.Allitemids.push() // vm.Allitemids.push()
vm.activity.itemIds=Array.from(new Set(vm.activity.itemIds))
console.log(vm.Allitemids) console.log(vm.Allitemids)
vm.AllItems() vm.AllItems()
// let id = vm.advertisement.id; // let id = vm.advertisement.id;
...@@ -460,17 +465,27 @@ let vm = new Vue({ ...@@ -460,17 +465,27 @@ let vm = new Vue({
// }); // });
}, },
AllItems(){ AllItems(){
// console.log(vm.activity.itemIds) console.log(vm.activity.itemIds)
if(vm.activity.itemIds.length){
Ajax.request({ Ajax.request({
url: "../tbcfstationitem/queryItemByIds?page=1&limit=10&sidx=&order=", url: `../tbcfstationitem/queryItemByIds?page=${vm.NowpageNum}&limit=${vm.Nowpagesize}&sidx=&order=`,
// url: "../tbcfstationitem/queryItemByIds",
async: true, async: true,
type: "POST", type: "POST",
params: JSON.stringify(vm.activity.itemIds), params: JSON.stringify(vm.activity.itemIds),
contentType: "application/json", contentType: "application/json",
successCallback: function (r) { successCallback: function (r) {
console.log(r) console.log(r)
r.page.list.forEach(item=>{
item.itemImg = item.itemImg.split(";")[0]
})
vm.tableData = r.page.list
vm.AllpageNum = r.page.totalCount
} }
}); });
}else {
vm.tableData = null
}
// $("#adItemjqGrid").Grid({ // $("#adItemjqGrid").Grid({
// url: '../tbcfstationitem/queryItemByIds', // url: '../tbcfstationitem/queryItemByIds',
// colModel: [ // colModel: [
...@@ -504,6 +519,22 @@ let vm = new Vue({ ...@@ -504,6 +519,22 @@ let vm = new Vue({
// datatype:'json', // datatype:'json',
// // beforeSelectRow: beforeSelectRow, // // beforeSelectRow: beforeSelectRow,
// }); // });
},
handleDelete(id){
console.log(id)
vm.activity.itemIds=vm.activity.itemIds.filter(item=>{return item!=id})
vm.AllItems();
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
vm.NowpageNum = 1;
vm.Nowpagesize = val;
vm.AllItems();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
vm.NowpageNum = val;
vm.AllItems();
} }
}, },
created(){ created(){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论