优惠券商品列表分页

main
liudan 11 months ago
parent 5347670843
commit 1a68697aaa
  1. 75
      view/admin/src/views/marketing/platformCoupon/couponList/index.vue

@ -469,9 +469,9 @@
/>
</div>
</el-dialog>
<el-dialog title="提示" :visible.sync="shopDialog" width="80%">
<el-table :data="shopList" style="width: 100%" @selection-change="handleSelectionChange" >
<el-table-column type="selection" width="55"></el-table-column>
<el-dialog title="商品列表" :visible.sync="shopDialog" width="80%">
<el-table :data="shopList" height="calc(60vh)" style="width: 100%" @selection-change="handleSelectionChange" >
<el-table-column type="selection" v-if="handleName=='allshop'" width="55"></el-table-column>
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="store_name" align="center" label="商品名称"></el-table-column>
<el-table-column prop="price" align="center" label="商品价格"></el-table-column>
@ -483,9 +483,20 @@
<el-table-column prop="stock" align="center" label="库存"></el-table-column>
</el-table>
<div style="text-align: right;">
<el-pagination
@size-change="shopHandleSizeChange"
@current-change="shopHandleCurrentChange"
:current-page="shopPageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="shopPageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="shopTotal">
</el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="shopDialog = false"> </el-button>
<el-button type="primary" @click="setCouponShoppingHandle"> </el-button>
<el-button type="primary" v-if="handleName=='allshop'" @click="setCouponShoppingHandle"> </el-button>
</span>
</el-dialog>
</div>
@ -568,7 +579,11 @@ export default {
shopDialog:false,
shopList:[],
multipleSelection: [],
selectedCoupon:{}
selectedCoupon:{},
handleName:'allshop',
shopPageIndex:1,
shopPageSize:10,
shopTotal:0
};
},
mounted() {
@ -592,9 +607,10 @@ export default {
});
this.multipleSelection
},
//
getCurrentProduct(row){
this.selectedCoupon = row;
this.handleName="curshop"
couponShopping(row.coupon_id).then(res=>{
@ -613,13 +629,22 @@ export default {
this.shopDialog = true;
})
},
shopHandleSizeChange(val) {
this.shopPageSize = val;
this.getShopListHandle()
},
shopHandleCurrentChange(val) {
this.shopPageIndex = val;
this.getShopListHandle()
},
//
getCouponShopping(row){
this.selectedCoupon = row;
this.handleName="allshop"
var getData = {
page:1,
limit:100,
page:this.shopPageIndex,
limit:this.shopPageSize,
type:1
}
@ -643,10 +668,42 @@ export default {
shopList.push(obj)
})
this.shopTotal = res.data.count
this.shopList = shopList;
this.shopDialog = true;
})
},
getShopListHandle(){
var getData = {
page:this.shopPageIndex,
limit:this.shopPageSize,
type:1
}
couponProductList(getData).then(res=>{
let shopList = []
res.data.list.forEach(item=>{
let obj = {
store_name:item.store_name,
image:item.image,
price:item.price,
stock:item.stock,
product_id:item.product_id,
}
// if(item.product){
// Object.keys(item.product).forEach(p=>{
// this.$set(obj,p,item.product[p])
// })
// shopList.push(obj)
// }
shopList.push(obj)
})
this.shopTotal = res.data.count
this.shopList = shopList;
})
},
//
handleDelete(id, idx) {
this.$modalSureDelete(`删除优惠券将无法恢复,请谨慎操作!`).then(() => {

Loading…
Cancel
Save