Commit c453398a by lixiaomin

修改优惠券

parent 4df4f5b6
import request from "@/utils/request";
// 查询列表
export function listCoupon(data) {
export function listCoupon(pageNum,pageSize,data) {
return request({
url: "/coupon/list",
url: "/coupon/list?pageNum=" + pageNum+ "&pageSize="+pageSize,
method: "post",
data: data,
});
......@@ -53,9 +53,9 @@ export function onlineCoupon(id) {
}
// 用户领取优惠券列表
export function getCouponInfoList(data) {
export function getCouponInfoList(pageNum,pageSize,data) {
return request({
url: "/coupon-user/list",
url: "/coupon-user/list?pageNum=" + pageNum+ "&pageSize="+pageSize,
method: "post",
data: data,
});
......@@ -94,4 +94,13 @@ export function giveCoupon(data) {
});
}
// 优惠券修改前校验
export function updateCheck(id) {
return request({
url: "/coupon/update/check/"+id,
method: "post",
});
}
import request from "@/utils/request";
// 查询列表
export function getCouCategoryList(data) {
export function getCouCategoryList(pageNum,pageSize,data) {
return request({
url: "/coupon-category",
url: "/coupon-category?pageNum=" + pageNum+ "&pageSize="+pageSize,
method: "post",
data: data,
});
......
......@@ -73,7 +73,7 @@
</el-form-item>
</el-col>
</el-row>
<el-table :data="goodsList">
<el-table :data="goodsList" @selection-change="handleSelectionChange">
<el-table-column label="商品名称" align="center" prop="goodsName" />
<el-table-column label="缩略图" align="center">
<template slot-scope="scope">
......@@ -88,13 +88,14 @@
<el-table-column label="原售价" align="center" prop="amount" />
<el-table-column label="折扣价" align="center" prop="realAmount" />
<el-table-column label="实付" align="center" prop="realAmount" />
<el-table-column label="数量" align="center" prop="num" />
<el-table-column label="数量" align="center" prop="num" />
<el-table-column type="selection" width="55"/>
</el-table>
</el-form>
<div v-show="refundTag" style="margin-top: 20px;" >
<el-form ref="refundForm" :rules="rules" :model="refundForm" label-width="80px">
<el-form-item label="退款金额" prop="refundAmount">
<el-input v-model="refundForm.refundAmount" style="width:200px;" placeholder="请输入退款金额"/>
<el-input v-model="refundForm.refundAmount" style="width:200px;" placeholder="请输入退款金额" disabled/>
</el-form-item>
<el-form-item label="处理备注" prop="desc">
<el-input v-model="refundForm.desc" type="textarea" placeholder="请输入处理备注"/>
......@@ -321,7 +322,16 @@ export default {
let picObj = JSON.parse(str);
list.push(picObj.thumbnail)
return list;
},
},
handleSelectionChange(selectList){
let sum=null;
if(selectList.length>0){
for(let i=0;i<selectList.length;i++){
sum+=selectList[i].realAmount;
}
}
this.refundForm.refundAmount=sum;
}
}
};
</script>
......@@ -94,7 +94,7 @@ export default {
},
/** 查询优惠券列表 */
getCouponList() {
listCoupon({pageNum: 1,pageSize: 100000,state:1}).then((response) => {
listCoupon(1,10000,{state:1}).then((response) => {
if(response.code==200){
this.couponList = response.rows;
}
......
......@@ -15,7 +15,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" v-hasPermi="['coupon:category:query']">搜索</el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" v-hasPermi="['coupon:category:list']">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
......@@ -142,7 +142,7 @@ export default {
/** 查询列表 */
getList() {
this.loading = true;
getCouCategoryList(this.queryParams).then((response) => {
getCouCategoryList(this.queryParams.pageNum,this.queryParams.pageSize,{name:this.queryParams.name,state:this.queryParams.state}).then((response) => {
this.couponTypeList = response.rows;
this.total = response.total;
this.loading = false;
......
......@@ -25,7 +25,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" v-hasPermi="['coupon:category:query']">搜索</el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" v-hasPermi="['coupon:user:list']">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
......@@ -113,6 +113,9 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
source:"",
state:null,
couponId:null
},
options: [{
value: null,
......@@ -155,7 +158,8 @@ export default {
/** 查询列表 */
getList() {
this.loading = true;
getCouponInfoList(this.queryParams).then((response) => {
getCouponInfoList(this.queryParams.pageNum,this.queryParams.pageSize,
{source:this.queryParams.source,state:this.queryParams.state,couponId:this.queryParams.couponId}).then((response) => {
this.couponInfoList = response.rows;
this.total = response.total;
this.loading = false;
......@@ -213,7 +217,7 @@ export default {
},
/** 查询优惠券列表 */
getCouponList() {
listCoupon({pageNum: 1,pageSize: 1000,state: 1}).then((response) => {
listCoupon(1,10000,{state: 1}).then((response) => {
if(response.code==200){
this.couponList = response.rows;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment