Commit b1d468f9e197e4ebece074705228d378acbcbcc0

Authored by 李宇
1 parent a41d31ee

1

admin-web-master/src/api/couponmanagement/capitalpool.js
1 1 import request from '@/utils/request'
  2 +
  3 +export function addcereCouponCategory(data) {
  4 + return request({
  5 + url: '/cereCouponCategory/add',
  6 + method: 'post',
  7 + data
  8 + })
  9 +}
  10 +
2 11 // 查询剩余金额
3 12 export function totalCapitalBalance(data) {
4 13 return request({
... ...
admin-web-master/src/api/couponmanagement/couponlist.js
1 1 import request from '@/utils/request'
  2 +// 获取优惠券
  3 +export function myCoupons(data) {
  4 + return request({
  5 + url: '/coupon/myCoupons',
  6 + method: 'post',
  7 + data
  8 + })
  9 +}
2 10 // 批量生成优惠券
3 11 export function batchGenerateCoupons(data) {
4 12 return request({
... ...
admin-web-master/src/components/top/index.vue 0 → 100644
  1 +/<template>
  2 + <div class="title-with-circle">
  3 + <div class="circle"></div>
  4 + <div class="title">{{ title }}</div>
  5 + </div>
  6 +</template>
  7 +
  8 +<script>
  9 +export default {
  10 + name: 'TitleWithCircle',
  11 + props: {
  12 + title: {
  13 + type: String,
  14 + required: true
  15 + }
  16 + }
  17 +}
  18 +</script>
  19 +
  20 +<style scoped>
  21 +.title-with-circle {
  22 + display: flex;
  23 + align-items: center;
  24 +}
  25 +
  26 +.circle {
  27 + margin-right: 9px;
  28 + content: " ";
  29 + display: inline-block;
  30 + height: 18px;
  31 + width: 4px;
  32 + background-color: #3f9b6a;
  33 + border-radius: 5px;
  34 + vertical-align: bottom;
  35 +}
  36 +
  37 +.title {
  38 + line-height: 18px;
  39 + color: #000000e6;
  40 + font-size: 18px;
  41 + font-weight: bold;
  42 + font-family: "Alibaba PuHuiTi 2.0-85 Bold";
  43 +}
  44 +</style>
... ...
admin-web-master/src/views/couponmanagement/capitalpool.vue
... ... @@ -120,11 +120,12 @@
120 120 <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span
121 121 style="color:#000000e6">创建优惠券</span></div>
122 122 </div>
123   - <div style="display: flex;margin-bottom: 10px;">
  123 + <TitleWithCircle title="资金池" style="margin-bottom: 15px;"/>
  124 + <div style="display: flex;margin-bottom: 20px;padding-left: 30px;">
124 125 <div>资金池名称:{{ coupoobj.poolName }}</div>
125   - <div style="margin-left: 30px;font-weight: bold;">总金额:{{ coupoobj.symon }}</div>
  126 + <div style="margin-left: 30px;">资金池可用金额:<span style="font-weight: bold;">{{ coupoobj.symon }}</span></div>
126 127 </div>
127   - <coupon :couponfrom="couponfrom" :coupoobj="coupoobj" />
  128 + <coupon :couponfrom="couponfrom" :coupoobj="coupoobj" @changevalue="changevalue"/>
128 129 <div class="footer">
129 130 <div class="btn_list" style="margin-top: 30px;">
130 131 <span @click="qxcoupon" class="buttonHover"
... ... @@ -143,15 +144,16 @@
143 144 delPool,
144 145 editPool,
145 146 cereCouponMainTable,
146   - totalCapitalBalance
  147 + totalCapitalBalance,
  148 + addcereCouponCategory
147 149 } from '@/api/couponmanagement/capitalpool.js'
148 150 import router from '@/router';
149 151 import coupon from './coupon.vue';
150   -
  152 + import TitleWithCircle from '@/components/top/index';
151 153 export default {
152 154  
153 155 components: {
154   - coupon
  156 + coupon,TitleWithCircle
155 157 },
156 158 data() {
157 159 return {
... ... @@ -179,12 +181,14 @@
179 181 trigger: 'blur'
180 182 }, ],
181 183 },
  184 + useCategorylist:'',
  185 + usedMerchantslist:'',
182 186 couponfrom: {
183   - usedMerchants: '全平台',
  187 + usedMerchants: 1,
184 188 couponName: '',
185 189 remark: '',
186 190 couponType: '1', // 默认值
187   - useCategory: '全部',
  191 + useCategory: 1,
188 192 maxDiscountAmount: null,
189 193 usageThreshold: null, //使用门槛不用
190 194 discountContent: null,
... ... @@ -236,19 +240,46 @@
236 240 this.getAll()
237 241 },
238 242 methods: {
  243 + changevalue(e,list) {
  244 + console.error(e,list )
  245 + this[e] = list
  246 + },
239 247 xq(e) {
  248 + console.log(e )
240 249 // 跳转路由
241 250 router.push({
242 251 path: '/other/capitalpoolinfo',
243 252 query: {
244   - id: e.id
  253 + id: e.poolId
245 254 }
246 255 })
247 256 },
248 257 savecoupon() {
249 258 let that = this
  259 + if(!this.couponfrom.couponName) {
  260 + return
  261 + }
  262 + if(!this.couponfrom.startTime) {
  263 + return
  264 + }
  265 + if(!this.couponfrom.totalCoupons) {
  266 + return
  267 + }
  268 + if(!this.couponfrom.maxDiscountAmount) {
  269 + return
  270 + }
  271 + if(!this.couponfrom.discountContent) {
  272 + return
  273 + }
  274 + if(this.couponfrom.couponType == '1') {
  275 + if(Number(this.couponfrom.discountContent) >= Number(this.couponfrom.maxDiscountAmount)) {
  276 + return
  277 + }
  278 + }
250 279 let c1 = this.changecouponfrom()
251 280 console.error(c1)
  281 + console.error(this.useCategorylist)
  282 + console.error(this.usedMerchantslist)
252 283 console.error(this.coupoobj)
253 284 let from = this.couponfrom
254 285 from.fundPoolId = this.coupoobj.poolId
... ... @@ -267,10 +298,30 @@
267 298 console.error({
268 299 ...from
269 300 })
270   - console.error(JSON.stringify(from))
  301 + // return
271 302 cereCouponMainTable(from).then(res => {
272 303 console.error(res)
273 304 if (res.data) {
  305 + if(res.data.useCategory == '2') {
  306 + let info1 = {
  307 + couponId:res.data.id,
  308 + usedMerchants:1,
  309 + categoryIds:that.useCategorylist
  310 + }
  311 + addcereCouponCategory(info1).then(res1 => {
  312 + console.error(res1)
  313 + })
  314 + }
  315 + if(res.data.usedMerchants == '3') {
  316 + let info2 = {
  317 + couponId:res.data.id,
  318 + usedMerchants:3,
  319 + categoryIds:that.usedMerchantslist
  320 + }
  321 + addcereCouponCategory(info2).then(res2 => {
  322 + console.error(res2)
  323 + })
  324 + }
274 325 that.$message({
275 326 message: '提交成功',
276 327 type: 'success'
... ... @@ -493,6 +544,7 @@
493 544 });
494 545 }
495 546 that.search()
  547 + }).catch(error => {
496 548 })
497 549 }).catch(() => {
498 550 this.$message({
... ...
admin-web-master/src/views/couponmanagement/capitalpoolinfo.vue
... ... @@ -33,12 +33,12 @@
33 33 :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}"
34 34 tooltip-effect="light"
35 35 >
36   - <el-table-column label="编号" >
37   - <template slot-scope="scope">{{ scope.row.id }}</template>
38   - </el-table-column>
39 36 <el-table-column label="优惠券名称" >
40 37 <template slot-scope="scope">{{ scope.row.couponName }}</template>
41 38 </el-table-column>
  39 + <el-table-column label="资金池" >
  40 + <template slot-scope="scope">{{ scope.row.cereFundsPool?scope.row.cereFundsPool.poolName:'' }}</template>
  41 + </el-table-column>
42 42 <el-table-column label="类型">
43 43 <template slot-scope="scope">
44 44 <span v-if="scope.row.couponType == '1'">满减券</span>
... ... @@ -51,6 +51,12 @@
51 51 <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
52 52 </template>
53 53 </el-table-column>
  54 + <el-table-column label="金额" >
  55 + <template slot-scope="scope">{{ scope.row.totalFunds }}</template>
  56 + </el-table-column>
  57 + <el-table-column label="数量" >
  58 + <template slot-scope="scope">{{ scope.row.totalCoupons }}</template>
  59 + </el-table-column>
54 60 <el-table-column label="操作" fixed="right">
55 61 <template slot-scope="scope">
56 62 <div class="btnList">
... ... @@ -120,9 +126,8 @@
120 126 },
121 127 ],
122 128 query: {
123   - activityName: '', // 活动名称
124   - // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
125   - state: '',
  129 + fundPoolId:'',
  130 + couponName: '', //名称
126 131 pageNumber: 1,
127 132 pageSize: 10
128 133 },
... ... @@ -132,6 +137,8 @@
132 137 },
133 138 created () {
134 139 this.getAll()
  140 + console.log(this.$route.query.id)
  141 + this.query.fundPoolId = this.$route.query.id
135 142 },
136 143 methods: {
137 144 handleClick(tab, event) {
... ... @@ -167,12 +174,8 @@
167 174 },
168 175 // 重置
169 176 clear () {
170   - this.query = {
171   - activityName: '',
172   - state: '',
173   - pageNumber: 1,
174   - pageSize: 10
175   - }
  177 + this.query.couponName = ''
  178 + this.query.pageNumber = 1
176 179 this.getAll()
177 180 },
178 181  
... ...
admin-web-master/src/views/couponmanagement/coupon.vue
1 1 <template>
2 2 <div class="addCoupon">
3 3 <!-- 新增优惠券 -->
4   - <div class="addCouponBox" style="border: 2px solid #eee;padding-right: 30px;padding-top: 30px;padding-bottom: 30px;">
  4 + <div class="addCouponBox" style="padding-right: 30px;">
  5 + <TitleWithCircle title="基本信息" style="margin-bottom: 20px;"/>
5 6 <div style="padding-bottom: 15px;padding-right: 30px;padding-left: 80px;font-weight: bold;">
6 7 所需金额:{{ changecouponfrom() }} 元
7 8 </div>
  9 +
8 10 <el-form ref="ruleForm" class="formBox" :model="couponfrom" label-width="150px" :rules="couponRules">
9 11 <el-form-item label="优惠券名称" prop="couponName">
10 12 <el-input v-model="couponfrom.couponName" placeholder="请输入优惠券名称" onblur="value=value.replace(/(^\s*)|(\s*$)/g, '')" />
... ... @@ -13,7 +15,7 @@
13 15 <el-radio v-model="couponfrom.couponType" label="1">满减券</el-radio>
14 16 <el-radio v-model="couponfrom.couponType" label="2">折扣券</el-radio>
15 17 </el-form-item>
16   - <el-form-item v-if="couponfrom.couponType === '1'" class="inputW" label="优惠内容" prop="couponContent">
  18 + <el-form-item v-if="couponfrom.couponType === '1'" class="inputW" label="优惠内容" prop="maxDiscountAmount">
17 19 订单满 <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元 减 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
18 20 </el-form-item>
19 21 <el-form-item v-else class="inputW discount" label="优惠内容" prop="discountContent">
... ... @@ -29,13 +31,13 @@
29 31 <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
30 32 </el-form-item> -->
31 33 <el-form-item label="可用商品类别:">
32   - <el-radio-group v-model="useCategory" @change="changeType">
  34 + <el-radio-group v-model="couponfrom.useCategory" @change="changeType">
33 35 <el-radio :label="1" >全部</el-radio>
34 36 <el-radio :label="2" >选择类别</el-radio>
35 37 </el-radio-group>
36 38 </el-form-item>
37   - <el-form-item label="选择商品类别:" v-if="useCategory === 2">
38   - <el-select style="width: 100%;" multiple v-model="couponfrom.useCategory" placeholder="请选择">
  39 + <el-form-item label="选择商品类别:" v-if="couponfrom.useCategory === 2">
  40 + <el-select style="width: 100%;" multiple v-model="useCategory" placeholder="请选择" filterable @change="changeuseCategory">
39 41 <el-option
40 42 v-for="item in classList"
41 43 :key="item.classifyId"
... ... @@ -45,19 +47,20 @@
45 47 </el-select>
46 48 </el-form-item>
47 49 <el-form-item label="使用范围:">
48   - <el-radio-group v-model="usedMerchants" >
  50 + <el-radio-group v-model="couponfrom.usedMerchants" >
49 51 <el-radio :label="1" >全平台</el-radio>
50 52 <!-- <el-radio :label="2" >自营</el-radio> -->
51 53 <el-radio :label="3" >部分商家</el-radio>
52 54 </el-radio-group>
53 55 </el-form-item>
54   - <el-form-item label="选择商家:" v-if="usedMerchants === 3">
  56 + <el-form-item label="选择商家:" v-if="couponfrom.usedMerchants === 3">
55 57 <el-select
56 58 style="width: 100%;"
57 59 multiple
58   - v-model="couponfrom.usedMerchants"
  60 + v-model="usedMerchants"
59 61 placeholder="请选择"
60 62 filterable
  63 + @change="changeusedMerchants"
61 64 >
62 65 <el-option
63 66 v-for="item in shopList"
... ... @@ -78,7 +81,7 @@
78 81 <el-input v-model="couponfrom.pointsRequired" type="number" style="width: 150px" /> 分
79 82 </el-form-item>
80 83 </div>
81   - <el-form-item class="timeDataBox" label="用券时间">
  84 + <el-form-item class="timeDataBox" label="用券时间" prop="startTime">
82 85 <el-date-picker
83 86 v-model="dateInfo"
84 87 type="datetimerange"
... ... @@ -93,7 +96,7 @@
93 96 <el-input v-model="couponfrom.totalCoupons" type="number" oninput="value=value.replace(/[^\d]/g,'')" />张 <span v-if="coupoobj.symon && changecouponfrom()!=0">(最大:{{ (coupoobj.symon/changecouponfrom()).toFixed(0) }} 张)</span>
94 97 </el-form-item>
95 98 <el-form-item label="备注">
96   - <el-input rows="4" v-model="couponfrom.remark" placeholder="请输入备注" type="textarea" />
  99 + <el-input maxlength="200" show-word-limit rows="4" v-model="couponfrom.remark" placeholder="请输入备注" type="textarea" />
97 100 </el-form-item>
98 101 </el-form>
99 102 </div>
... ... @@ -102,10 +105,14 @@
102 105  
103 106 <script>
104 107 import { commdityClassGetAll } from '@/api/renovation';
  108 + import TitleWithCircle from '@/components/top/index';
105 109 import {
106 110 businessListGetAll,
107 111 } from '@/api/business'
108 112 export default {
  113 + components: {
  114 + TitleWithCircle
  115 + },
109 116 name: 'AddCoupon',
110 117 props: {
111 118 couponfrom: {
... ... @@ -118,17 +125,30 @@
118 125 default: {
119 126 symon:0
120 127 },
121   -
122 128 },
123 129 },
124 130 data() {
  131 + var moneyContent = (rule, value, callback) => {
  132 + if(!this.couponfrom.maxDiscountAmount) {
  133 + return callback(new Error('请输入优惠内容'));
  134 + }
  135 + if(!this.couponfrom.discountContent) {
  136 + return callback(new Error('请输入优惠内容'));
  137 + }
  138 + if(this.couponfrom.couponType == '1') {
  139 + if(Number(this.couponfrom.discountContent) >= Number(this.couponfrom.maxDiscountAmount)) {
  140 + return callback(new Error('请满减金额大于优惠金额'));
  141 + }
  142 + }
  143 + callback();
  144 + }
125 145 return {
126 146 monys:0,
127   - usedMerchants:1,
  147 + usedMerchants:null,
128 148 pointsRequired:0,
129 149 dateInfo: null,
130 150 isThreshold: true,
131   - useCategory:1,
  151 + useCategory:null,
132 152 useCategory2:1,
133 153 classList:[],
134 154 shopList:[],
... ... @@ -136,8 +156,8 @@
136 156 couponName: [
137 157 { required: true, message: '请输入优惠券名称', trigger: 'blur' }
138 158 ],
139   - // couponContent: [{ required: true, message: '请输入优惠金额' }],
140   - dateInfo: [{ type: 'date', required: true, message: '请选择时间' }],
  159 + maxDiscountAmount: [ { validator: moneyContent, trigger: 'blur' }],
  160 + startTime: [{required: true, message: '请选择时间', trigger: 'blur'}],
141 161 totalCoupons: [{ required: true, message: '请输入数量', trigger: 'blur' }]
142 162 },
143 163 }
... ... @@ -147,35 +167,29 @@
147 167 this.couponfrom.maxDiscountAmount = 0
148 168 this.couponfrom.discountContent = 0
149 169 },
150   - useCategory(val) {
  170 + 'couponfrom.useCategory'(val) {
151 171 if(val == '1') {
152   - this.couponfrom.useCategory = '全部'
  172 + this.useCategory = null
153 173 } else {
154   - this.couponfrom.useCategory = ''
155 174 }
156 175 },
157   - usedMerchants(val) {
158   - this.couponfrom.usedMerchants = ''
159   - if(val == '1') {
160   - this.couponfrom.useCategory = '全平台'
161   - } else if(val == '2') {
162   - this.couponfrom.useCategory = '自营'
163   - } else {
164   - this.couponfrom.useCategory = ''
165   - }
  176 + 'couponfrom.usedMerchants'(val) {
  177 + this.usedMerchants = null
166 178 },
167 179 pointsRequired(val) {
168   - if(val == '1') {
169   - this.couponfrom.pointsRequired = ''
170   - } else {
171   - this.couponfrom.pointsRequired = 0
172   - }
  180 + this.couponfrom.pointsRequired = 0
173 181 },
174 182 },
175 183 mounted() {
176 184 this.getAll()
177 185 },
178 186 methods: {
  187 + changeuseCategory(e){
  188 + this.$emit('changevalue','useCategorylist',e)
  189 + },
  190 + changeusedMerchants(e){
  191 + this.$emit('changevalue','usedMerchantslist',e)
  192 + },
179 193 changeDate(e){
180 194 console.error(e)
181 195 if(e && e.length>0) {
... ...
admin-web-master/src/views/couponmanagement/couponinfo.vue
... ... @@ -91,7 +91,7 @@
91 91 </template>
92 92  
93 93 <script>
94   - import { getcereFundsPoolData,addcereFundsPool,delPool,editPool,batchGenerateCoupons}from '@/api/couponmanagement/couponlist.js'
  94 + import { myCoupons}from '@/api/couponmanagement/couponlist.js'
95 95 import router from '@/router';
96 96 import coupon from './coupon.vue';
97 97  
... ... @@ -153,7 +153,7 @@
153 153 })
154 154 },
155 155 async getAll () {
156   - const res = await getcereFundsPoolData(this.query)
  156 + const res = await myCoupons(this.query)
157 157 console.error(res.data.content)
158 158 this.tableData = res.data.content
159 159 this.total = res.data.numberOfElements
... ...
admin-web-master/src/views/couponmanagement/couponlist.vue
... ... @@ -28,12 +28,12 @@
28 28 tooltip-effect="light"
29 29  
30 30 >
31   - <el-table-column label="编号" >
32   - <template slot-scope="scope">{{ scope.row.id }}</template>
33   - </el-table-column>
34   - <el-table-column label="优惠券名称" >
  31 + <el-table-column label="优惠券名称" >
35 32 <template slot-scope="scope">{{ scope.row.couponName }}</template>
36 33 </el-table-column>
  34 + <el-table-column label="资金池">
  35 + <template slot-scope="scope">{{ scope.row.cereFundsPool?scope.row.cereFundsPool.poolName:'' }}</template>
  36 + </el-table-column>
37 37 <el-table-column label="类型">
38 38 <template slot-scope="scope">
39 39 <span v-if="scope.row.couponType == '1'">满减券</span>
... ... @@ -46,6 +46,12 @@
46 46 <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
47 47 </template>
48 48 </el-table-column>
  49 + <el-table-column label="金额" >
  50 + <template slot-scope="scope">{{ scope.row.totalFunds }}</template>
  51 + </el-table-column>
  52 + <el-table-column label="数量" >
  53 + <template slot-scope="scope">{{ scope.row.totalCoupons }}</template>
  54 + </el-table-column>
49 55 <el-table-column label="操作" fixed="right">
50 56 <template slot-scope="scope">
51 57 <div class="btnList">
... ...
ceres-uniapp-master/config/api.js
... ... @@ -313,4 +313,6 @@ module.exports = {
313 313 wenjuanList: WX_API_BASEPING + '/cereQuestionnaireTable/queryById',
314 314 //问卷提交接口
315 315 wenjuanUp: WX_API_BASE + '/cereQuestionnaireAnswering/add',
  316 + //新优惠券
  317 + couponnew: 'http://8.130.38.56:9007/coupon/myCoupons',
316 318 }
... ...
ceres-uniapp-master/pages_category_page1/coupon/list - 副本.vue 0 → 100644
  1 +<template>
  2 + <view class="couponList u-skeleton">
  3 + <Skeleton
  4 + el-color="#efefef"
  5 + bg-color="#fff"
  6 + :loading="loading && isFirstComeIn"
  7 + :animation="true"
  8 + />
  9 + <template v-if="couponList.length>0">
  10 + <view
  11 + class="couponItem u-skeleton-fillet flex-items"
  12 + v-for="item of couponList"
  13 + :key="item.couponId"
  14 + >
  15 + <view
  16 + class="itemLeft u-skeleton-fillet"
  17 + @click="goProductList(item)"
  18 + >
  19 + <view class="topIcon"></view>
  20 + <view class="bottomIcon"></view>
  21 + <view class="price flex-items">
  22 + <view
  23 + class="flex-column flex-end unitBox"
  24 + v-if="item.discountMode === 1"
  25 + >
  26 + <view class="unit">¥</view>
  27 + </view>
  28 + <view class="priceValue">{{ item.reduceMoney }}{{ item.discountMode === 1 ? '' : '折' }}</view>
  29 + </view>
  30 + <text class="fs24 font-color-999">满{{ item.fullMoney }}元可用</text>
  31 + </view>
  32 + <view class="itemRight u-skeleton-fillet">
  33 + <view class="topInfo flex-items flex-sp-between">
  34 + <view @click="goProductList(item)">
  35 + <view class="couponTit fs32 font-color-FFF">{{ item.activityName }}</view>
  36 + <view class="couponDate fs24 font-color-999">{{ item.endTime }}到期</view>
  37 + </view>
  38 + <view class="exchangeBtnBox flex-column flex-end">
  39 + <view
  40 + class="exchangeBtn fs24 font-color-FFF"
  41 + v-if="item.state === 0"
  42 + >已领取
  43 + </view>
  44 + <wx-send-coupon
  45 + v-else
  46 + @success="success"
  47 + :couponList="[item]"
  48 + >
  49 + <view class="exchangeBtn fs24 font-color-FFF">{{ item.ifCredit ? '立即兑换' : '立即领取' }}</view>
  50 + </wx-send-coupon>
  51 + </view>
  52 + </view>
  53 + <view
  54 + @click="goProductList(item)"
  55 + class="couponType fs28 font-color-FFF"
  56 + >{{ item.discountMode === 1 ? '满减券' : '折扣券' }}
  57 + </view>
  58 + </view>
  59 + </view>
  60 + <!-- 触底 -->
  61 + <view
  62 + class="reachBottom"
  63 + v-if="topLeft > 400 && couponList.length>0"
  64 + >
  65 + <image
  66 + class="reach-icon"
  67 + src="https://jy.scjysm.asia:18086/mefile/file/static/img//reachBottom.png"
  68 + mode="widthFix"
  69 + ></image>
  70 + <text class="reach-text">这里到底了哦~~</text>
  71 + </view>
  72 + </template>
  73 + <Empty :show="couponList.length<=0" />
  74 + </view>
  75 +</template>
  76 +
  77 +<script>
  78 +import Skeleton from "../../components/Skeleton";
  79 +import Empty from "../../components/Empty";
  80 +import WxSendCoupon from "../../components/wx/wxSendCoupon";
  81 +
  82 +const NET = require('../../utils/request')
  83 +const API = require('../../config/api')
  84 +export default {
  85 + name: "list",
  86 + components: {WxSendCoupon, Empty, Skeleton},
  87 + data() {
  88 + return {
  89 + loading: false,
  90 + isFirstComeIn: true,
  91 + couponList: [{}, {}, {}, {}, {}, {}], // 优惠券列表getCoupons
  92 + page: 1,
  93 + pageSize: 10,
  94 + loadingType: 0,
  95 + topLeft: 0
  96 + }
  97 + },
  98 + onLoad() {
  99 + this.getCouponList()
  100 + },
  101 + onReachBottom() {
  102 + if (this.loadingType == 1) {
  103 + uni.stopPullDownRefresh()
  104 + } else {
  105 + this.page = this.page + 1
  106 + this.getCouponList()
  107 + }
  108 + },
  109 + onPageScroll(e) {
  110 + this.topLeft = e.scrollTop
  111 + },
  112 + methods: {
  113 + getCouponList() {
  114 + // uni.showLoading({
  115 + // mask: true,
  116 + // title: '加载中...'
  117 + // })
  118 + this.loading = true
  119 + NET.request(API.youhuiquan, {
  120 + page: this.page,
  121 + pageSize: this.pageSize,
  122 + shopId:154
  123 + }, 'GET').then(res => {
  124 + uni.hideLoading()
  125 + if (res.data.length === 0) {
  126 + this.loadingType = 1
  127 + } else {
  128 + this.couponList = this.couponList.concat(res.data)
  129 + this.$forceUpdate()
  130 + }
  131 + this.couponList = this.couponList.filter(item => JSON.stringify(item) !== '{}')
  132 + this.loading = false
  133 + this.isFirstComeIn = false
  134 + }).catch(res => {
  135 + uni.hideLoading()
  136 + })
  137 + // NET.request(API.getCoupons, {
  138 + // page: this.page,
  139 + // pageSize: this.pageSize
  140 + // }, 'GET').then(res => {
  141 + // uni.hideLoading()
  142 + // if (res.data.list.length === 0) {
  143 + // this.loadingType = 1
  144 + // } else {
  145 + // this.couponList = this.couponList.concat(res.data.list)
  146 + // this.$forceUpdate()
  147 + // }
  148 + // this.couponList = this.couponList.filter(item => JSON.stringify(item) !== '{}')
  149 + // this.loading = false
  150 + // this.isFirstComeIn = false
  151 + // }).catch(res => {
  152 + // uni.hideLoading()
  153 + // })
  154 + },
  155 + // 跳转到可用商品列表
  156 + goProductList(item) {
  157 + console.log(item, 'test')
  158 + uni.navigateTo({
  159 + url: `../coupon/product?id=${ item.couponId }&actId=${item.activityId}`
  160 + })
  161 + },
  162 + success() {
  163 + this.page = 1
  164 + this.couponList = []
  165 + this.getCouponList()
  166 + }
  167 + }
  168 +}
  169 +</script>
  170 +
  171 +<style
  172 + lang="scss"
  173 + scoped
  174 +>
  175 +page {
  176 + background: #F8F8F8;
  177 +
  178 + .couponList {
  179 + padding: 0 20rpx 40upx;
  180 + margin-top: 30rpx;
  181 +
  182 + .couponItem {
  183 + background: #333333;
  184 + margin-top: 40rpx;
  185 + padding: 25rpx 35rpx;
  186 + overflow: hidden;
  187 + background-image: url("https://jy.scjysm.asia:18086/mefile/file/static/images/borderIcon.png");
  188 + background-repeat: no-repeat;
  189 + background-size: contain;
  190 + background-position: right top;
  191 +
  192 + .itemLeft {
  193 + padding-right: 10rpx;
  194 + position: relative;
  195 + border-right: 2rpx dashed #666666;
  196 + width: 170rpx;
  197 +
  198 + .topIcon {
  199 + position: absolute;
  200 + right: -16rpx;
  201 + top: -50rpx;
  202 + width: 32rpx;
  203 + height: 32rpx;
  204 + background: #FFFFFF;
  205 + border-radius: 50%;
  206 + }
  207 +
  208 + .bottomIcon {
  209 + position: absolute;
  210 + right: -16rpx;
  211 + bottom: -50rpx;
  212 + width: 32rpx;
  213 + height: 32rpx;
  214 + background: #FFFFFF;
  215 + border-radius: 50%;
  216 + }
  217 +
  218 + //.price {
  219 + // width: 100rpx;
  220 + //}
  221 + .unitBox {
  222 + height: 70rpx;
  223 + }
  224 +
  225 + .unit {
  226 + color: #FFEBC4;
  227 + font-size: 36rpx;
  228 + }
  229 +
  230 + .priceValue {
  231 + font-size: 52rpx;
  232 + color: #FFEBC4;
  233 + }
  234 + }
  235 +
  236 + .itemRight {
  237 + padding-left: 45rpx;
  238 + flex: 1;
  239 +
  240 + .topInfo {
  241 + padding-bottom: 10rpx;
  242 + border-bottom: 2rpx solid #444444;
  243 + margin-bottom: 10rpx;
  244 +
  245 + .couponDate {
  246 + width: 300rpx;
  247 + }
  248 +
  249 + .exchangeBtnBox {
  250 + width: 110rpx;
  251 + height: 70rpx;
  252 + text-align: center;
  253 +
  254 + .exchangeBtn {
  255 + padding: 5rpx;
  256 + border: 2rpx solid #999999;
  257 + }
  258 + }
  259 + }
  260 + }
  261 + }
  262 + }
  263 +
  264 + .Put-box1 {
  265 + .btn {
  266 + text-align: center;
  267 + margin-top: 40rpx;
  268 + border: 2rpx solid #333333;
  269 + height: 80upx;
  270 + line-height: 80upx;
  271 + width: 100%;
  272 + color: #333333;
  273 + }
  274 +
  275 + .submit {
  276 + background-color: #333333;
  277 + color: #FFEBC4;
  278 + margin-left: 20rpx;
  279 + }
  280 + }
  281 +}
  282 +
  283 +// 触底样式
  284 +.reachBottom {
  285 + margin-top: 30rpx;
  286 + display: flex;
  287 + flex-direction: column;
  288 + align-items: center;
  289 +
  290 + .reach-icon {
  291 + width: 150rpx;
  292 + height: 150rpx;
  293 + }
  294 +
  295 + .reach-text {
  296 + margin: 20rpx 0;
  297 + color: #CCCCCC;
  298 + }
  299 +}
  300 +</style>
... ...
ceres-uniapp-master/pages_category_page1/coupon/list.vue
... ... @@ -116,11 +116,11 @@ export default {
116 116 // title: '加载中...'
117 117 // })
118 118 this.loading = true
119   - NET.request(API.youhuiquan, {
  119 + NET.request(API.couponnew, {
120 120 page: this.page,
121 121 pageSize: this.pageSize,
122 122 shopId:154
123   - }, 'GET').then(res => {
  123 + }, 'POST').then(res => {
124 124 uni.hideLoading()
125 125 if (res.data.length === 0) {
126 126 this.loadingType = 1
... ...
merchant-web-master/src/api/couponmanagement/capitalpool.js 0 → 100644
  1 +import request from '@/utils/requestnew'
  2 +
  3 +export function addcereCouponCategory(data) {
  4 + return request({
  5 + url: '/cereCouponCategory/add',
  6 + method: 'post',
  7 + data
  8 + })
  9 +}
  10 +
  11 +// 查询剩余金额
  12 +export function totalCapitalBalance(data) {
  13 + return request({
  14 + url: '/cereCouponMainTable/totalCapitalBalance',
  15 + method: 'post',
  16 + data
  17 + })
  18 +}
  19 +export function getcereFundsPoolData(data) {
  20 + return request({
  21 + url: '/cereFundsPool/queryByPage',
  22 + method: 'post',
  23 + data
  24 + })
  25 +}
  26 +
  27 +/**
  28 +{
  29 + "activityId": 0
  30 +}
  31 + */
  32 +export function getcereFundsPoolDetail(data) {
  33 + return request({
  34 + url: '/cereFundsPool/getById',
  35 + method: 'post',
  36 + data
  37 + })
  38 +}
  39 +
  40 +
  41 +export function addcereFundsPool(data) {
  42 + return request({
  43 + url: '/cereFundsPool/add ',
  44 + method: 'post',
  45 + data
  46 + })
  47 +}
  48 +export function delPool(data) {
  49 + return request({
  50 + url: '/cereFundsPool/deleteById ',
  51 + method: 'post',
  52 + data
  53 + })
  54 +}
  55 +export function editPool(data) {
  56 + return request({
  57 + url: '/cereFundsPool/edit ',
  58 + method: 'post',
  59 + data
  60 + })
  61 +}
  62 +//添加优惠券
  63 +export function cereCouponMainTable(data) {
  64 + return request({
  65 + url: '/cereCouponMainTable/add ',
  66 + method: 'post',
  67 + data
  68 + })
  69 +}
0 70 \ No newline at end of file
... ...
merchant-web-master/src/api/couponmanagement/couponlist.js 0 → 100644
  1 +import request from '@/utils/requestnew'
  2 +// 获取优惠券
  3 +export function myCoupons(data) {
  4 + return request({
  5 + url: '/coupon/myCoupons',
  6 + method: 'post',
  7 + data
  8 + })
  9 +}
  10 +// 批量生成优惠券
  11 +export function batchGenerateCoupons(data) {
  12 + return request({
  13 + url: '/cereCouponUsage/batchGenerateCoupons',
  14 + method: 'post',
  15 + data
  16 + })
  17 +}
  18 +export function getcereFundsPoolData(data) {
  19 + return request({
  20 + url: '/cereCouponMainTable/queryByPage',
  21 + method: 'post',
  22 + data
  23 + })
  24 +}
  25 +
  26 +/**
  27 +{
  28 + "activityId": 0
  29 +}
  30 + */
  31 +export function getcereFundsPoolDetail(data) {
  32 + return request({
  33 + url: '/cereCouponMainTable/getById',
  34 + method: 'post',
  35 + data
  36 + })
  37 +}
  38 +
  39 +
  40 +export function addcereFundsPool(data) {
  41 + return request({
  42 + url: '/cereCouponMainTable/add ',
  43 + method: 'post',
  44 + data
  45 + })
  46 +}
  47 +export function delPool(data) {
  48 + return request({
  49 + url: '/cereCouponMainTable/deleteById ',
  50 + method: 'post',
  51 + data
  52 + })
  53 +}
  54 +export function editPool(data) {
  55 + return request({
  56 + url: '/cereCouponMainTable/edit ',
  57 + method: 'post',
  58 + data
  59 + })
  60 +}
  61 +
... ...
merchant-web-master/src/api/couponmanagement/marketing.js 0 → 100644
  1 +import request from '@/utils/requestnew'
  2 +
  3 +//* ******************** 待处理订单 *********************
  4 +// 订单管理查询
  5 +export function getCoupon(data) {
  6 + return request({
  7 + url: '/coupon/getAll',
  8 + method: 'post',
  9 + data
  10 + })
  11 +}
  12 +// 新增优惠券
  13 +export function addCoupon(data) {
  14 + return request({
  15 + url: '/coupon/save',
  16 + method: 'post',
  17 + data
  18 + })
  19 +}
  20 +// 优惠券数据效果查询
  21 +export function getCouponData(data) {
  22 + return request({
  23 + url: '/coupon/getData',
  24 + method: 'post',
  25 + data
  26 + })
  27 +}
  28 +// 获取可选中商品
  29 +export function getProducts(data) {
  30 + return request({
  31 + url: '/coupon/getProducts',
  32 + method: 'post',
  33 + data
  34 + })
  35 +}
  36 +// 删除满减券
  37 +export function delCoupon(data) {
  38 + return request({
  39 + url: '/coupon/delete',
  40 + method: 'post',
  41 + data
  42 + })
  43 +}
  44 +// 修改满减券/折扣券
  45 +export function updateCoupon(data) {
  46 + return request({
  47 + url: '/coupon/update',
  48 + method: 'post',
  49 + data
  50 + })
  51 +}
  52 +// 获取优惠券详情
  53 +export function couponDetail(data) {
  54 + return request({
  55 + url: '/coupon/getById',
  56 + method: 'post',
  57 + data
  58 + })
  59 +}
  60 +// 停止优惠券
  61 +export function stopCoupon(data) {
  62 + return request({
  63 + url: '/coupon/stop',
  64 + method: 'post',
  65 + data
  66 + })
  67 +}
  68 +// 拼团数据查询
  69 +export function groupBuyList(data) {
  70 + return request({
  71 + url: '/work/getAll',
  72 + method: 'post',
  73 + data
  74 + })
  75 +}
  76 +// 拼团数据删除
  77 +export function deleteGroup(data) {
  78 + return request({
  79 + url: '/work/delete',
  80 + method: 'post',
  81 + data
  82 + })
  83 +}
  84 +// 拼团活动详情查询
  85 +export function groupDetail(data) {
  86 + return request({
  87 + url: '/work/getById',
  88 + method: 'post',
  89 + data
  90 + })
  91 +}
  92 +// 拼团数据效果查询
  93 +export function getGroupData(data) {
  94 + return request({
  95 + url: '/work/getData',
  96 + method: 'post',
  97 + data
  98 + })
  99 +}
  100 +// 拼团选择商品查询
  101 +export function getGroupButPro(data) {
  102 + return request({
  103 + url: '/work/getProducts',
  104 + method: 'post',
  105 + data
  106 + })
  107 +}
  108 +// 新增拼团活动
  109 +export function addGroupBuy(data) {
  110 + return request({
  111 + url: '/work/save',
  112 + method: 'post',
  113 + data
  114 + })
  115 +}
  116 +// 停止拼团活动
  117 +export function stopGroupBuy(data) {
  118 + return request({
  119 + url: '/work/stop',
  120 + method: 'post',
  121 + data
  122 + })
  123 +}
  124 +// 修改拼团活动
  125 +export function groupUpdate(data) {
  126 + return request({
  127 + url: '/work/update',
  128 + method: 'post',
  129 + data
  130 + })
  131 +}
  132 +// 秒杀活动管理查询
  133 +export function getSeckillList(data) {
  134 + return request({
  135 + url: '/seckill/getAll',
  136 + method: 'post',
  137 + data
  138 + })
  139 +}
  140 +// 新增秒杀活动
  141 +export function addSeckill(data) {
  142 + return request({
  143 + url: '/seckill/save',
  144 + method: 'post',
  145 + data
  146 + })
  147 +}
  148 +// 修改秒杀活动
  149 +export function seckillUpdate(data) {
  150 + return request({
  151 + url: '/seckill/update',
  152 + method: 'post',
  153 + data
  154 + })
  155 +}
  156 +// 删除秒杀活动
  157 +export function deleteSeckill(data) {
  158 + return request({
  159 + url: '/seckill/delete',
  160 + method: 'post',
  161 + data
  162 + })
  163 +}
  164 +// 秒杀数据效果查询
  165 +export function getSeckillData(data) {
  166 + return request({
  167 + url: '/seckill/getData',
  168 + method: 'post',
  169 + data
  170 + })
  171 +}
  172 +// 秒杀选择商品查询
  173 +export function getSpikeList(data) {
  174 + return request({
  175 + url: '/seckill/getProducts',
  176 + method: 'post',
  177 + data
  178 + })
  179 +}
  180 +// 秒杀商品详情
  181 +export function seckillDetail(data) {
  182 + return request({
  183 + url: '/seckill/getById',
  184 + method: 'post',
  185 + data
  186 + })
  187 +}
  188 +// 秒杀商品停止活动
  189 +export function seckillStop(data) {
  190 + return request({
  191 + url: '/seckill/stop',
  192 + method: 'post',
  193 + data
  194 + })
  195 +}
  196 +// 限时折扣活动详情查询
  197 +export function getSeckillDetail(data) {
  198 + return request({
  199 + url: '/seckill/getById',
  200 + method: 'post',
  201 + data
  202 + })
  203 +}
  204 +// 限时折扣活动管理查询
  205 +export function getDiscountData(data) {
  206 + return request({
  207 + url: '/discount/getAll',
  208 + method: 'post',
  209 + data
  210 + })
  211 +}
  212 +// 删除限时折扣活动
  213 +export function deleteDiscount(data) {
  214 + return request({
  215 + url: '/discount/delete',
  216 + method: 'post',
  217 + data
  218 + })
  219 +}
  220 +// 限时折扣活动详情查询
  221 +export function getDiscountDetail(data) {
  222 + return request({
  223 + url: '/discount/getById',
  224 + method: 'post',
  225 + data
  226 + })
  227 +}
  228 +// 限时折扣效果数据查询
  229 +export function getDiscountInfo(data) {
  230 + return request({
  231 + url: '/discount/getData',
  232 + method: 'post',
  233 + data
  234 + })
  235 +}
  236 +// 选择商品查询
  237 +export function getDisProList(data) {
  238 + return request({
  239 + url: '/discount/getProducts',
  240 + method: 'post',
  241 + data
  242 + })
  243 +}
  244 +// 新增限时折扣活动
  245 +export function addDiscount(data) {
  246 + return request({
  247 + url: '/discount/save',
  248 + method: 'post',
  249 + data
  250 + })
  251 +}
  252 +// 停止限时折扣活动
  253 +export function stopDiscount(data) {
  254 + return request({
  255 + url: '/discount/stop',
  256 + method: 'post',
  257 + data
  258 + })
  259 +}
  260 +// 修改限时折扣活动
  261 +export function discountUpdate(data) {
  262 + return request({
  263 + url: '/discount/update',
  264 + method: 'post',
  265 + data
  266 + })
  267 +}
  268 +
  269 +// 场景营销列表查询
  270 +export function getSceneInfo(data) {
  271 + return request({
  272 + url: '/scene/getAll',
  273 + method: 'post',
  274 + data
  275 + })
  276 +}
  277 +// 添加场景营销
  278 +export function sceneAdd(data) {
  279 + return request({
  280 + url: '/scene/save',
  281 + method: 'post',
  282 + data
  283 + })
  284 +}
  285 +// 启动场景营销
  286 +export function sceneStart(data) {
  287 + return request({
  288 + url: '/scene/start',
  289 + method: 'post',
  290 + data
  291 + })
  292 +}
  293 +// 停止场景营销
  294 +export function sceneStop(data) {
  295 + return request({
  296 + url: '/scene/stop',
  297 + method: 'post',
  298 + data
  299 + })
  300 +}
  301 +// 删除场景营销
  302 +export function sceneDelete(data) {
  303 + return request({
  304 + url: '/scene/delete',
  305 + method: 'post',
  306 + data
  307 + })
  308 +}
  309 +// 编辑场景营销
  310 +export function sceneUpate(data) {
  311 + return request({
  312 + url: '/scene/update',
  313 + method: 'post',
  314 + data
  315 + })
  316 +}
  317 +// 场景营销详情查询
  318 +export function getSceneDetail(data) {
  319 + return request({
  320 + url: '/scene/getById',
  321 + method: 'post',
  322 + data
  323 + })
  324 +}
  325 +// 查询会员等级数据
  326 +export function getMemberLevels(data) {
  327 + return request({
  328 + url: '/scene/getMemberLevels',
  329 + method: 'post',
  330 + data
  331 + })
  332 +}
  333 +
  334 +// 定价捆绑列表查询
  335 +export function getPriceList(data) {
  336 + return request({
  337 + url: '/price/getAll',
  338 + method: 'post',
  339 + data
  340 + })
  341 +}
  342 +// 添加定价捆绑
  343 +export function priceAdd(data) {
  344 + return request({
  345 + url: '/price/save',
  346 + method: 'post',
  347 + data
  348 + })
  349 +}
  350 +// 启停用定价捆绑
  351 +export function priceStart(data) {
  352 + return request({
  353 + url: '/price/start',
  354 + method: 'post',
  355 + data
  356 + })
  357 +}
  358 +// 删除定价捆绑
  359 +export function priceDelete(data) {
  360 + return request({
  361 + url: '/price/delete',
  362 + method: 'post',
  363 + data
  364 + })
  365 +}
  366 +// 编辑定价捆绑
  367 +export function priceUpate(data) {
  368 + return request({
  369 + url: '/price/update',
  370 + method: 'post',
  371 + data
  372 + })
  373 +}
  374 +// 定价捆绑详情查询
  375 +export function getPriceDetail(data) {
  376 + return request({
  377 + url: '/price/getById',
  378 + method: 'post',
  379 + data
  380 + })
  381 +}
  382 +
  383 +// 组合捆绑列表查询
  384 +export function getComposeList(data) {
  385 + return request({
  386 + url: '/compose/getAll',
  387 + method: 'post',
  388 + data
  389 + })
  390 +}
  391 +// 添加组合捆绑
  392 +export function composeAdd(data) {
  393 + return request({
  394 + url: '/compose/save',
  395 + method: 'post',
  396 + data
  397 + })
  398 +}
  399 +// 启停用组合捆绑
  400 +export function composeStart(data) {
  401 + return request({
  402 + url: '/compose/start',
  403 + method: 'post',
  404 + data
  405 + })
  406 +}
  407 +// 删除组合捆绑
  408 +export function composeDelete(data) {
  409 + return request({
  410 + url: '/compose/delete',
  411 + method: 'post',
  412 + data
  413 + })
  414 +}
  415 +// 编辑组合捆绑
  416 +export function composeUpate(data) {
  417 + return request({
  418 + url: '/compose/update',
  419 + method: 'post',
  420 + data
  421 + })
  422 +}
  423 +// 组合捆绑详情查询
  424 +export function getComposeDetail(data) {
  425 + return request({
  426 + url: '/compose/getById',
  427 + method: 'post',
  428 + data
  429 + })
  430 +}
  431 +// 定价捆绑和组合捆绑选择商品查询
  432 +export function getComposeSelectProduct(data) {
  433 + return request({
  434 + url: '/compose/selectProduct',
  435 + method: 'post',
  436 + data
  437 + })
  438 +}
  439 +
  440 +
  441 +// //* ******************** 售后订单 *********************
  442 +// // 售后管理查询
  443 +// export function aftersaleGetAll(data) {
  444 +// return request({
  445 +// url: '/after/getAll',
  446 +// method: 'post',
  447 +// data
  448 +// })
  449 +// }
... ...
merchant-web-master/src/components/top/index.vue 0 → 100644
  1 +/<template>
  2 + <div class="title-with-circle">
  3 + <div class="circle"></div>
  4 + <div class="title">{{ title }}</div>
  5 + </div>
  6 +</template>
  7 +
  8 +<script>
  9 +export default {
  10 + name: 'TitleWithCircle',
  11 + props: {
  12 + title: {
  13 + type: String,
  14 + required: true
  15 + }
  16 + }
  17 +}
  18 +</script>
  19 +
  20 +<style scoped>
  21 +.title-with-circle {
  22 + display: flex;
  23 + align-items: center;
  24 +}
  25 +
  26 +.circle {
  27 + margin-right: 9px;
  28 + content: " ";
  29 + display: inline-block;
  30 + height: 18px;
  31 + width: 4px;
  32 + background-color: #3f9b6a;
  33 + border-radius: 5px;
  34 + vertical-align: bottom;
  35 +}
  36 +
  37 +.title {
  38 + line-height: 18px;
  39 + color: #000000e6;
  40 + font-size: 18px;
  41 + font-weight: bold;
  42 + font-family: "Alibaba PuHuiTi 2.0-85 Bold";
  43 +}
  44 +</style>
... ...
merchant-web-master/src/utils/requestnew.js 0 → 100644
  1 +import axios from 'axios'
  2 +import {
  3 + MessageBox,
  4 + Message
  5 +} from 'element-ui'
  6 +import store from '@/store'
  7 +import router from '@/router'
  8 +import {
  9 + getToken,
  10 + getShopId,
  11 + removeToken
  12 +} from '@/utils/auth'
  13 +
  14 +//
  15 +// const baseURL = process.env.VUE_APP_DOMAIN_PREFIX
  16 +const host = window.location.host;
  17 +let PREFIX;
  18 +if (host == '172.16.61.48' || host == '172.16.61.49:5173') {
  19 + PREFIX = 'https://jy.scjysm.asia:18086/merchant-business';
  20 +}else if( host == 'localhost:9528' || host == '8.130.38.56:8027' || host == 'localhost:9529'){
  21 + // 其他情况的默认值
  22 + // PREFIX = 'http://8.130.38.56:8027/business-server';
  23 + // PREFIX = 'https://jy.scjysm.asia:18086/merchant-business';
  24 + PREFIX = 'http://8.130.38.56:9003'
  25 +}else{
  26 + PREFIX = '/merchant-business';
  27 +}
  28 +const baseURL = PREFIX
  29 +// const baseURL = 'http://10.0.0.14:9004'
  30 +// create an axios instance
  31 +const service = axios.create({
  32 + baseURL,
  33 + // withCredentials: true, // send cookies when cross-domain requests
  34 + timeout: 300000 // request timeout
  35 +})
  36 +
  37 +// export const uploadUrl = 'http://192.168.1.102:8005/file/upload'
  38 +export const uploadUrl = `${baseURL}/file/upload`
  39 +export const WXuploadUrl = `${baseURL}/file/uploadWxMedia` // 直播上传专用
  40 +//export const QYuploadUrl = `${baseURL}/file/uploadQyMedia` // 微信客服上传专用
  41 +export const QYuploadUrl = `${baseURL}/file/upload` // 微信客服上传专用
  42 +
  43 +// request interceptor
  44 +service.interceptors.request.use(
  45 + config => {
  46 + if (store.getters.token) {
  47 + config.headers['Authorization-business'] = getToken()
  48 + config.headers['shopId'] = getShopId()
  49 + config.headers['Content-Type'] = 'application/json; charset=UTF-8'
  50 + // config.headers['type'] = ' business'
  51 + }
  52 + return config
  53 + },
  54 + error => {
  55 + console.log(error)
  56 + return Promise.reject(error)
  57 + }
  58 +)
  59 +
  60 +// response interceptor
  61 +service.interceptors.response.use(
  62 + response => {
  63 + const res = response.data
  64 + if (response.config.responseType === 'blob') {
  65 + return response.data
  66 + }
  67 + if (res.code !== '') {
  68 + Message({
  69 + message: res.message || 'Error',
  70 + type: 'error',
  71 + duration: 5 * 1000
  72 + })
  73 + // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
  74 + const tokenerr = [20003, '20003', 20004, '20004', 20005, '20005']
  75 + // if (tokenerr.includes(res.code)) {
  76 + // localStorage.clear()
  77 + // removeToken()
  78 + // router.push({ path: '/login' })
  79 + // location.reload()
  80 + // }
  81 + if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
  82 + MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
  83 + confirmButtonText: 'Re-Login',
  84 + cancelButtonText: 'Cancel',
  85 + type: 'warning'
  86 + }).then(() => {
  87 + store.dispatch('user/resetToken').then(() => {
  88 + location.reload()
  89 + })
  90 + })
  91 + }
  92 + return Promise.reject(new Error(res.message || 'Error'))
  93 + } else {
  94 + return res
  95 + }
  96 + },
  97 + error => {
  98 + console.log(error)
  99 + Message({
  100 + message: '服务器暂无响应,请稍后重试',
  101 + type: 'error',
  102 + duration: 5 * 1000
  103 + })
  104 + return Promise.reject(error)
  105 + }
  106 +)
  107 +export default service
... ...
merchant-web-master/src/views/couponmanagement/capitalpool.vue 0 → 100644
  1 +<template>
  2 + <div style="background-color:#f7f7f7;padding:10px 10px;">
  3 + <div class="couponPage" v-show="type == '1'">
  4 + <div>
  5 + <div style="height:58px;line-height:58px;">
  6 + <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span
  7 + style="color:#000000e6">资金池</span></div>
  8 + </div>
  9 + <!-- 搜索 -->
  10 + <div class="formSearch">
  11 + <!-- 搜索条件 -->
  12 + <el-form :inline="true" :model="query" class="demo-form-inline">
  13 + <el-form-item label="名称">
  14 + <el-input v-model="query.poolName" placeholder="请输入名称" />
  15 + </el-form-item>
  16 + <el-form-item label="状态">
  17 + <el-select v-model="query.fundsStatus" placeholder="请选择状态">
  18 + <el-option v-for="item in activityStatusSelect" :key="item.index" :label="item.label"
  19 + :value="item.value" />
  20 + </el-select>
  21 + </el-form-item>
  22 + </el-form>
  23 + <div>
  24 + <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
  25 + <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;"
  26 + @click="clear">重置</el-button>
  27 + </div>
  28 + </div>
  29 + <div style="margin: 0 0 20px 0;">
  30 + <el-button icon="el-icon-circle-plus-outline" style="background-color: #3F9B6A;color: #fff;"
  31 + @click="addActivity">新增</el-button>
  32 + </div>
  33 + <!-- 表格 -->
  34 + <div class="tableBox">
  35 + <el-table ref="multipleTable" :data="tableData"
  36 + :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}"
  37 + tooltip-effect="light">
  38 + <!-- <el-table-column label="编号">
  39 + <template slot-scope="scope">{{ scope.row.poolId }}</template>
  40 + </el-table-column> -->
  41 + <el-table-column label="资金池名称">
  42 + <template slot-scope="scope">{{ scope.row.poolName }}</template>
  43 + </el-table-column>
  44 + <!-- <el-table-column label="出资方">
  45 + <template slot-scope="scope">{{ scope.row.contributor }}</template>
  46 + </el-table-column> -->
  47 + <el-table-column label="总金额">
  48 + <template slot-scope="scope">{{ scope.row.totalAmount }}</template>
  49 + </el-table-column>
  50 + <el-table-column
  51 + label="出资方">
  52 + <template slot-scope="scope">
  53 + <el-popover trigger="hover" placement="top">
  54 + <p style="max-width: 300px;">{{ scope.row.contributor }}</p>
  55 + <div slot="reference" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width: 100%;" >
  56 + {{ scope.row.contributor }}
  57 + </div>
  58 + </el-popover>
  59 + </template>
  60 + </el-table-column>
  61 + <el-table-column label="状态">
  62 + <template slot-scope="scope">
  63 + <span v-if="scope.row.fundsStatus == '1'">启用中</span>
  64 + <span v-else-if="scope.row.fundsStatus == '2'">已关闭</span>
  65 + <span v-else>未启用</span>
  66 + </template>
  67 + </el-table-column>
  68 + <el-table-column label="操作" fixed="right">
  69 + <template slot-scope="scope">
  70 + <div class="btnList">
  71 + <!-- <div class="tableBtn greens" @click="editActivity(scope.row)">编辑</div> -->
  72 + <div v-if="scope.row.fundsStatus == '1'" class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
  73 + <div v-if="scope.row.fundsStatus == '1'" class="tableBtn greens" @click="addcoupon(scope.row)">创建优惠券
  74 + </div>
  75 + <div v-if="scope.row.fundsStatus == '1'" class="tableBtn greens"
  76 + @click="endActivityeditPool(scope.row,'2')">禁用</div>
  77 + <div v-else-if="scope.row.fundsStatus == '2'" class="tableBtn greens" @click="delActivity(scope.row)">
  78 + 删除</div>
  79 + <div v-else class="tableBtn greens" @click="endActivityeditPool(scope.row,'1')">开启</div>
  80 + <!-- <div class="tableBtn greens" @click="delActivity(scope.row)">删除</div> -->
  81 + </div>
  82 + </template>
  83 + </el-table-column>
  84 + </el-table>
  85 + <div style="display: flex;justify-content: space-between;" class="bom">
  86 + <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
  87 + <el-pagination :current-page="query.pageNumber" :page-sizes="[10, 20, 50, 100]" :page-size="10" background
  88 + small layout="prev, pager, next" :total="total" @size-change="handleSizeChange"
  89 + @current-change="handleCurrentChange">
  90 + </el-pagination>
  91 + </div>
  92 + </div>
  93 +
  94 + <el-dialog :title="editForm ? '修改资金池' : '新增资金池'" :visible.sync="activityVisible" width="500px" center
  95 + :close-on-click-modal="false" @close="activityVisible">
  96 + <el-form ref="form" :model="form" label-width="100px" :rules="couponRules">
  97 + <el-form-item label="资金池名称:" prop="poolName">
  98 + <el-input v-model="form.poolName" placeholder="请输入资金池名称" />
  99 + </el-form-item>
  100 + <el-form-item label="总金额:" style="margin: 20px 0;" prop="totalAmount">
  101 + <el-input v-model.number="form.totalAmount" placeholder="请输入总金额" />
  102 + </el-form-item>
  103 + <el-form-item label="出资方:" prop="contributor">
  104 + <el-input maxlength="200" show-word-limit rows="4" type="textarea" v-model="form.contributor"
  105 + placeholder="请输入出资方" />
  106 + </el-form-item>
  107 + </el-form>
  108 + <div class="footer" style="margin-top: 25px;">
  109 + <div class="btn_list">
  110 + <span @click="cancel" class="buttonHover"
  111 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span>
  112 + <span @click="save" style="background-color: #3F9B6A;color: #fff">保存</span>
  113 + </div>
  114 + </div>
  115 + </el-dialog>
  116 + </div>
  117 + </div>
  118 + <div class="couponPage" v-show="type == '2'">
  119 + <div style="height:58px;line-height:58px;">
  120 + <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span
  121 + style="color:#000000e6">创建优惠券</span></div>
  122 + </div>
  123 + <TitleWithCircle title="资金池" style="margin-bottom: 15px;"/>
  124 + <div style="display: flex;margin-bottom: 20px;padding-left: 30px;">
  125 + <div>资金池名称:{{ coupoobj.poolName }}</div>
  126 + <div style="margin-left: 30px;">资金池可用金额:<span style="font-weight: bold;">{{ coupoobj.symon }}</span></div>
  127 + </div>
  128 + <coupon :couponfrom="couponfrom" :coupoobj="coupoobj" @changevalue="changevalue"/>
  129 + <div class="footer">
  130 + <div class="btn_list" style="margin-top: 30px;">
  131 + <span @click="qxcoupon" class="buttonHover"
  132 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span>
  133 + <span @click="savecoupon" style="background-color: #3F9B6A;color: #fff">保存</span>
  134 + </div>
  135 + </div>
  136 + </div>
  137 + </div>
  138 +</template>
  139 +
  140 +<script>
  141 + import {
  142 + getcereFundsPoolData,
  143 + addcereFundsPool,
  144 + delPool,
  145 + editPool,
  146 + cereCouponMainTable,
  147 + totalCapitalBalance,
  148 + addcereCouponCategory
  149 + } from '@/api/couponmanagement/capitalpool.js'
  150 + import router from '@/router';
  151 + import coupon from './coupon.vue';
  152 + import TitleWithCircle from '@/components/top/index';
  153 + export default {
  154 +
  155 + components: {
  156 + coupon,TitleWithCircle
  157 + },
  158 + data() {
  159 + return {
  160 + couponRules: {
  161 + poolName: [{
  162 + required: true,
  163 + message: '请输入资金池名称',
  164 + trigger: 'blur'
  165 + },
  166 + {
  167 + min: 0,
  168 + max: 20,
  169 + message: '长度不超过20个字符',
  170 + trigger: 'blur'
  171 + }
  172 + ],
  173 + totalAmount: [{
  174 + required: true,
  175 + message: '请输入总金额',
  176 + trigger: 'blur'
  177 + }, ],
  178 + contributor: [{
  179 + required: true,
  180 + message: '请输入出资方',
  181 + trigger: 'blur'
  182 + }, ],
  183 + },
  184 + useCategorylist:'',
  185 + usedMerchantslist:'',
  186 + couponfrom: {
  187 + usedMerchants: 1,
  188 + couponName: '',
  189 + remark: '',
  190 + couponType: '1', // 默认值
  191 + useCategory: 1,
  192 + maxDiscountAmount: null,
  193 + usageThreshold: null, //使用门槛不用
  194 + discountContent: null,
  195 + pointsRequired: 0,
  196 + startTime: '',
  197 + endTime: '',
  198 + totalCoupons: null,
  199 + totalFunds: null,
  200 + },
  201 + coupoobj: {},
  202 + type: '1',
  203 + query: {
  204 + activityName: '', // 活动名称
  205 + // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
  206 + state: '',
  207 + pageNumber: 1,
  208 + pageSize: 10
  209 + },
  210 + total: 0,
  211 + tableData: [],
  212 + activityStatusSelect: [{
  213 + index: 0,
  214 + label: '未启用',
  215 + value: 0
  216 + },
  217 + {
  218 + index: 1,
  219 + label: '启用中',
  220 + value: 1
  221 + },
  222 + {
  223 + index: 2,
  224 + label: '已关闭',
  225 + value: 2
  226 + },
  227 + ],
  228 + activityVisible: false,
  229 + editForm: false,
  230 + activityDetailVisible: false,
  231 + form: {
  232 + poolName: '',
  233 + contributor: '',
  234 + totalAmount: null,
  235 + fundsStatus: '0'
  236 + }
  237 + }
  238 + },
  239 + created() {
  240 + this.getAll()
  241 + },
  242 + methods: {
  243 + changevalue(e,list) {
  244 + console.error(e,list )
  245 + this[e] = list
  246 + },
  247 + xq(e) {
  248 + console.log(e )
  249 + // 跳转路由
  250 + router.push({
  251 + path: '/other/capitalpoolinfo',
  252 + query: {
  253 + id: e.poolId
  254 + }
  255 + })
  256 + },
  257 + savecoupon() {
  258 + let that = this
  259 + if(!this.couponfrom.couponName) {
  260 + return
  261 + }
  262 + if(!this.couponfrom.startTime) {
  263 + return
  264 + }
  265 + if(!this.couponfrom.totalCoupons) {
  266 + return
  267 + }
  268 + if(!this.couponfrom.maxDiscountAmount) {
  269 + return
  270 + }
  271 + if(!this.couponfrom.discountContent) {
  272 + return
  273 + }
  274 + if(this.couponfrom.couponType == '1') {
  275 + if(Number(this.couponfrom.discountContent) >= Number(this.couponfrom.maxDiscountAmount)) {
  276 + return
  277 + }
  278 + }
  279 + let c1 = this.changecouponfrom()
  280 + console.error(c1)
  281 + console.error(this.useCategorylist)
  282 + console.error(this.usedMerchantslist)
  283 + console.error(this.coupoobj)
  284 + let from = this.couponfrom
  285 + from.fundPoolId = this.coupoobj.poolId
  286 + from.totalFunds = c1
  287 + if (c1 > this.coupoobj.symon) {
  288 + that.$message({
  289 + message: '金额不足',
  290 + error: 'error'
  291 + });
  292 + return
  293 + }
  294 + from.maxDiscountAmount = Number(from.maxDiscountAmount)
  295 + from.discountContent = Number(from.discountContent)
  296 + from.pointsRequired = Number(from.pointsRequired)
  297 + from.totalCoupons = Number(from.totalCoupons)
  298 + console.error({
  299 + ...from
  300 + })
  301 + // return
  302 + cereCouponMainTable(from).then(res => {
  303 + console.error(res)
  304 + if (res.data) {
  305 + if(res.data.useCategory == '2') {
  306 + let info1 = {
  307 + couponId:res.data.id,
  308 + usedMerchants:1,
  309 + categoryIds:that.useCategorylist
  310 + }
  311 + addcereCouponCategory(info1).then(res1 => {
  312 + console.error(res1)
  313 + })
  314 + }
  315 + if(res.data.usedMerchants == '3') {
  316 + let info2 = {
  317 + couponId:res.data.id,
  318 + usedMerchants:3,
  319 + categoryIds:that.usedMerchantslist
  320 + }
  321 + addcereCouponCategory(info2).then(res2 => {
  322 + console.error(res2)
  323 + })
  324 + }
  325 + that.$message({
  326 + message: '提交成功',
  327 + type: 'success'
  328 + });
  329 + } else {
  330 + that.$message({
  331 + message: '提交失败',
  332 + error: 'success'
  333 + });
  334 + }
  335 + setTimeout(() => {
  336 + that.type = '1'
  337 + }, 2000)
  338 + })
  339 + },
  340 + changecouponfrom() {
  341 + let num = 0
  342 + if (this.couponfrom.couponType == '1') {
  343 + num = (this.couponfrom.discountContent ? Number(this.couponfrom.discountContent) : 0) * (this.couponfrom
  344 + .totalCoupons ? Number(this.couponfrom.totalCoupons) : 0)
  345 + } else if (this.couponfrom.couponType == '2') {
  346 + num = (this.couponfrom.maxDiscountAmount ? Number(this.couponfrom.maxDiscountAmount) : 0) * (this.couponfrom
  347 + .totalCoupons ? Number(this.couponfrom.totalCoupons) : 0)
  348 + }
  349 + return num
  350 + },
  351 + qxcoupon() {
  352 + this.type = '1'
  353 + },
  354 + async addcoupon(e) {
  355 + let that = this
  356 +
  357 + let c1 = {
  358 + symon: 0,
  359 + ...e
  360 + }
  361 + await totalCapitalBalance({
  362 + poolId: e.poolId
  363 + }).then(res => {
  364 + console.error(res)
  365 + c1.symon = res.data
  366 + })
  367 + this.type = '2'
  368 + this.coupoobj = c1
  369 + console.error(this.coupoobj)
  370 + },
  371 + endActivityeditPool(item, type) {
  372 + let that = this
  373 + let form = item
  374 + form.totalAmount = Number(form.totalAmount)
  375 + form.fundsStatus = type
  376 + editPool(form).then(res => {
  377 + console.error(res)
  378 + if (res.data) {
  379 + that.$message({
  380 + message: '修改成功',
  381 + type: 'success'
  382 + });
  383 + } else {
  384 + that.$message({
  385 + message: '修改失败',
  386 + error: 'success'
  387 + });
  388 + }
  389 + that.search()
  390 + })
  391 + },
  392 + save() {
  393 + let that = this
  394 + console.error(this.form)
  395 + let form = this.form
  396 + that.$refs.form.validate((valid) => {
  397 + if (valid) {
  398 + form.totalAmount = Number(form.totalAmount)
  399 + if (that.editForm) {
  400 + editPool(form).then(res => {
  401 + // console.error(res)
  402 + if (res.data) {
  403 + that.$message({
  404 + message: '修改成功',
  405 + type: 'success'
  406 + });
  407 + } else {
  408 + that.$message({
  409 + message: '修改失败',
  410 + error: 'success'
  411 + });
  412 + }
  413 + that.search()
  414 + that.activityVisible = false
  415 + that.form = {
  416 + poolName: '',
  417 + contributor: '',
  418 + totalAmount: null,
  419 + fundsStatus: '0'
  420 + }
  421 + })
  422 + } else {
  423 + addcereFundsPool(form).then(res => {
  424 + // console.error(res)
  425 + if (res.data) {
  426 + that.$message({
  427 + message: '提交成功',
  428 + type: 'success'
  429 + });
  430 + } else {
  431 + that.$message({
  432 + message: '提交失败',
  433 + error: 'success'
  434 + });
  435 + }
  436 + that.search()
  437 + that.activityVisible = false
  438 + that.form = {
  439 + poolName: '',
  440 + contributor: '',
  441 + totalAmount: null,
  442 + fundsStatus: '0'
  443 + }
  444 + })
  445 + }
  446 + } else {
  447 + console.log('error submit!!');
  448 + return false;
  449 + }
  450 + });
  451 +
  452 +
  453 + },
  454 + cancel() {
  455 + this.activityVisible = false
  456 + this.form = {
  457 + poolName: '',
  458 + contributor: '',
  459 + totalAmount: null,
  460 + fundsStatus: '0'
  461 + }
  462 + },
  463 + async getAll() {
  464 + const res = await getcereFundsPoolData(this.query)
  465 + this.tableData = res.data.content
  466 + this.total = res.data.numberOfElements
  467 + },
  468 + handleSizeChange(val) {
  469 + this.query.pageSize = val
  470 + this.getAll()
  471 + },
  472 + handleCurrentChange(val) {
  473 + this.query.pageNumber = val
  474 + this.getAll()
  475 + },
  476 + search() {
  477 + this.total = 1
  478 + this.query.pageNumber = 1
  479 + this.getAll()
  480 + },
  481 + // 重置
  482 + clear() {
  483 + this.query = {
  484 + activityName: '',
  485 + state: '',
  486 + pageNumber: 1,
  487 + pageSize: 10
  488 + }
  489 + this.getAll()
  490 + },
  491 + // 活动详情
  492 + details(row) {
  493 + this.form = row
  494 + this.activityDetailVisible = true
  495 + },
  496 + // 添加活动
  497 + addActivity() {
  498 + this.editForm = false
  499 + this.activityVisible = true
  500 + },
  501 + // 编辑
  502 + editActivity(row) {
  503 + this.editForm = true
  504 + this.form = row
  505 + this.activityVisible = true
  506 + },
  507 + async endActivity(row) {
  508 + const res = await endCoupon({
  509 + activityId: row.activityId
  510 + })
  511 + if (res.code === '') {
  512 + this.$message({
  513 + message: '结束成功',
  514 + type: 'success'
  515 + })
  516 + } else {
  517 + this.$message({
  518 + message: res.message,
  519 + type: 'error'
  520 + })
  521 + }
  522 + this.getAll()
  523 + },
  524 + async delActivity(row) {
  525 + let that = this
  526 + this.$confirm('此作将永久操删除该文件, 是否继续?', '提示', {
  527 + confirmButtonText: '确定',
  528 + cancelButtonText: '取消',
  529 + type: 'warning'
  530 + }).then(() => {
  531 + delPool({
  532 + poolId: row.poolId
  533 + }).then(res => {
  534 + console.error(res)
  535 + if (res.data) {
  536 + that.$message({
  537 + message: '删除成功',
  538 + type: 'success'
  539 + });
  540 + } else {
  541 + that.$message({
  542 + message: '删除失败',
  543 + error: 'success'
  544 + });
  545 + }
  546 + that.search()
  547 + }).catch(error => {
  548 + })
  549 + }).catch(() => {
  550 + this.$message({
  551 + type: 'info',
  552 + message: '已取消删除'
  553 + });
  554 + });
  555 + },
  556 +
  557 + }
  558 + }
  559 +</script>
  560 +
  561 +<style scoped lang="scss">
  562 +
  563 + .el-table {
  564 + height: calc(100vh - 330px);
  565 + }
  566 +
  567 + .bom {
  568 + margin-top: 40px;
  569 + }
  570 +
  571 + .el-form-item {
  572 + margin-bottom: 0;
  573 + }
  574 +
  575 + ::v-deep .el-dialog__header {
  576 + border-bottom: 2px solid #eee;
  577 + background-color: #fff;
  578 + }
  579 +
  580 + ::v-deep .el-dialog__title {
  581 + color: #303133;
  582 + }
  583 +
  584 + .footer {
  585 + font-size: 24px;
  586 +
  587 + .btn_list {
  588 + display: flex;
  589 + flex-direction: row-reverse;
  590 +
  591 + span {
  592 + padding: 0;
  593 + margin: 0;
  594 + width: 100px;
  595 + height: 32px;
  596 + line-height: 32px;
  597 + text-align: center;
  598 + display: inline-block;
  599 + font-size: 16px;
  600 + border-radius: 4px;
  601 + box-sizing: border-box;
  602 +
  603 + &:hover {
  604 + cursor: pointer;
  605 + }
  606 +
  607 + &:nth-child(1) {
  608 + background: rgba(255, 255, 255, 1);
  609 + order: 1px solid rgba(224, 229, 235, 1);
  610 +
  611 + border: 1px solid rgba(224, 229, 235, 1);
  612 + }
  613 +
  614 + &:nth-child(2) {
  615 + background: #3f9b6a;
  616 + color: #fff;
  617 + margin-right: 20px;
  618 + }
  619 + }
  620 + }
  621 + }
  622 +
  623 + .couponPage {
  624 +
  625 + padding: 0 20px 20px 20px;
  626 + min-height: calc(100vh - 50px - 20px);
  627 + background-color: #Fff;
  628 +
  629 +
  630 + .tableBox {
  631 + text-align: center;
  632 +
  633 + .fenye {
  634 + // margin: 20px;
  635 + }
  636 + }
  637 + }
  638 +
  639 + .couponDialogBox {
  640 + max-height: 600px;
  641 + overflow-y: auto;
  642 + }
  643 +
  644 + .formSearch {
  645 +
  646 + display: flex;
  647 + width: 100%;
  648 + font-size: 14px;
  649 + justify-content: space-between;
  650 + padding-bottom: 10px;
  651 + align-items: center;
  652 +
  653 + }
  654 +
  655 + .tableBtn {
  656 + display: inline-block;
  657 + margin-right: 10px;
  658 + }
  659 +
  660 + .greens {
  661 + color: #3F9B6A;
  662 + }
  663 +
  664 + ::v-deep .buttonHover:hover {
  665 + color: #3f9b6a !important;
  666 + border-color: #c5e1d2 !important;
  667 + background-color: #ecf5f0 !important;
  668 + outline: none;
  669 + }
  670 +
  671 + ::v-deep .el-pagination__total {
  672 + position: absolute;
  673 + left: 10px;
  674 + }
  675 +
  676 + ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
  677 + background-color: #3f9b6a;
  678 + }
  679 +</style>
... ...
merchant-web-master/src/views/couponmanagement/capitalpoolinfo.vue 0 → 100644
  1 +<template>
  2 + <div style="background-color:#f7f7f7;padding:10px 10px;">
  3 + <div class="couponPage" >
  4 + <div>
  5 + <div style="height:58px;line-height:58px;">
  6 + <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span>资金池</span> <span style="padding:0 5px;">></span><span style="color:#000000e6">详情</span></div>
  7 + </div>
  8 + <div style="display: flex;margin-bottom: 10px;">
  9 + <div v-for="item in typelist" style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
  10 + <div style="font-size: 14px;color: #a8abb2;">{{item.type}}</div>
  11 + <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{item.num}}</div>
  12 + </div>
  13 + </div>
  14 + <!-- 搜索 -->
  15 + <div class="formSearch">
  16 + <!-- 搜索条件 -->
  17 + <el-form :inline="true" :model="query" class="demo-form-inline">
  18 + <el-form-item label="名称">
  19 + <el-input v-model="query.couponName" placeholder="请输入名称" />
  20 + </el-form-item>
  21 + </el-form>
  22 + <div>
  23 + <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
  24 + <el-button class="buttonHover"
  25 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="clear">重置</el-button>
  26 + </div>
  27 + </div>
  28 + <!-- 表格 -->
  29 + <div class="tableBox">
  30 + <el-table
  31 + ref="multipleTable"
  32 + :data="tableData"
  33 + :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}"
  34 + tooltip-effect="light"
  35 + >
  36 + <el-table-column label="优惠券名称" >
  37 + <template slot-scope="scope">{{ scope.row.couponName }}</template>
  38 + </el-table-column>
  39 + <el-table-column label="资金池" >
  40 + <template slot-scope="scope">{{ scope.row.cereFundsPool?scope.row.cereFundsPool.poolName:'' }}</template>
  41 + </el-table-column>
  42 + <el-table-column label="类型">
  43 + <template slot-scope="scope">
  44 + <span v-if="scope.row.couponType == '1'">满减券</span>
  45 + <span v-else-if="scope.row.couponType == '2'">折扣券</span>
  46 + </template>
  47 + </el-table-column>
  48 + <el-table-column label="优惠内容">
  49 + <template slot-scope="scope">
  50 + <span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
  51 + <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
  52 + </template>
  53 + </el-table-column>
  54 + <el-table-column label="金额" >
  55 + <template slot-scope="scope">{{ scope.row.totalFunds }}</template>
  56 + </el-table-column>
  57 + <el-table-column label="数量" >
  58 + <template slot-scope="scope">{{ scope.row.totalCoupons }}</template>
  59 + </el-table-column>
  60 + <el-table-column label="操作" fixed="right">
  61 + <template slot-scope="scope">
  62 + <div class="btnList">
  63 + <div class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
  64 + <!-- <div class="tableBtn greens" @click="addcoupon(scope.row)">生成优惠券</div> -->
  65 + </div>
  66 + </template>
  67 + </el-table-column>
  68 + </el-table>
  69 + <div style="display: flex;justify-content: space-between;margin: 20px 0;">
  70 + <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
  71 + <el-pagination
  72 + :current-page="query.pageNumber"
  73 + :page-sizes="[10, 20, 50, 100]"
  74 + :page-size="10"
  75 + background
  76 + small
  77 + layout="prev, pager, next"
  78 + :total="total"
  79 + @size-change="handleSizeChange"
  80 + @current-change="handleCurrentChange">
  81 + </el-pagination>
  82 + </div>
  83 + <div style="display: flex;">
  84 + <router-link to="/other/capitalpoolinfo"> <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >返回</el-button></router-link>
  85 + </div>
  86 + </div>
  87 + </div>
  88 + </div>
  89 +
  90 + </div>
  91 + </template>
  92 +
  93 + <script>
  94 + import { getcereFundsPoolData,addcereFundsPool,delPool,editPool,batchGenerateCoupons}from '@/api/couponmanagement/couponlist.js'
  95 + import router from '@/router';
  96 + import coupon from './coupon.vue';
  97 +
  98 + export default {
  99 +
  100 + components:{
  101 + coupon
  102 + },
  103 + data () {
  104 + return {
  105 + activeName: 'second',
  106 + typelist:[
  107 + {
  108 + num:100,
  109 + type:'资金池总金额',
  110 + color:'#ff5e5e'
  111 + },
  112 + {
  113 + num:100,
  114 + type:'资金池可用金额',
  115 + color:'#ff883a'
  116 + },
  117 + {
  118 + num:100,
  119 + type:'剩余金额',
  120 + color:'#ffc461'
  121 + },
  122 + {
  123 + num:100,
  124 + type:'待核销金额',
  125 + color:'#a467f0'
  126 + },
  127 + ],
  128 + query: {
  129 + fundPoolId:'',
  130 + couponName: '', //名称
  131 + pageNumber: 1,
  132 + pageSize: 10
  133 + },
  134 + total: 0,
  135 + tableData: [],
  136 + }
  137 + },
  138 + created () {
  139 + this.getAll()
  140 + console.log(this.$route.query.id)
  141 + this.query.fundPoolId = this.$route.query.id
  142 + },
  143 + methods: {
  144 + handleClick(tab, event) {
  145 + console.log(tab, event);
  146 + },
  147 + xq(e) {
  148 + // 跳转路由
  149 + router.push({
  150 + path: '/other/coupon',
  151 + query: {
  152 + id: e.id
  153 + }
  154 + })
  155 + },
  156 + async getAll () {
  157 + const res = await getcereFundsPoolData(this.query)
  158 + console.error(res.data.content)
  159 + this.tableData = res.data.content
  160 + this.total = res.data.numberOfElements
  161 + },
  162 + handleSizeChange (val) {
  163 + this.query.pageSize = val
  164 + this.getAll()
  165 + },
  166 + handleCurrentChange (val) {
  167 + this.query.pageNumber = val
  168 + this.getAll()
  169 + },
  170 + search () {
  171 + this.total = 1
  172 + this.query.pageNumber = 1
  173 + this.getAll()
  174 + },
  175 + // 重置
  176 + clear () {
  177 + this.query.couponName = ''
  178 + this.query.pageNumber = 1
  179 + this.getAll()
  180 + },
  181 +
  182 + }
  183 + }
  184 + </script>
  185 +
  186 + <style scoped lang="scss">
  187 + ::v-deep .el-form-item {
  188 + margin-bottom: 0;
  189 + }
  190 + ::v-deep .el-tabs__content {
  191 + display: none;
  192 + }
  193 + ::v-deep .el-tabs__item{
  194 + font-size: 16px;
  195 + font-family: "Alibaba PuHuiTi 2.0-55 Regular";
  196 + }
  197 + ::v-deep .el-dialog__header{
  198 + border-bottom: 2px solid #eee;
  199 + background-color: #fff;
  200 + }
  201 + ::v-deep .el-dialog__title {
  202 + color: #303133;
  203 + }
  204 + .footer{
  205 + font-size: 24px;
  206 + .btn_list {
  207 + display: flex;
  208 + flex-direction: row-reverse;
  209 + span {
  210 + padding: 0;
  211 + margin: 0;
  212 + width: 100px;
  213 + height:32px;
  214 + line-height:32px;
  215 + text-align: center;
  216 + display: inline-block;
  217 + font-size: 16px;
  218 + border-radius: 4px;
  219 + box-sizing: border-box;
  220 + &:hover {
  221 + cursor: pointer;
  222 + }
  223 + &:nth-child(1) {
  224 + background: rgba(255, 255, 255, 1);
  225 + order: 1px solid rgba(224, 229, 235, 1);
  226 +
  227 + border: 1px solid rgba(224, 229, 235, 1);
  228 + }
  229 + &:nth-child(2) {
  230 + background: #3f9b6a;
  231 + color: #fff;
  232 + margin-right: 20px;
  233 + }
  234 + }
  235 + }
  236 + }
  237 + .couponPage{
  238 +
  239 + padding: 0 20px 20px 20px;
  240 + min-height: calc(100vh - 50px - 20px);
  241 + background-color: #Fff;
  242 +
  243 +
  244 + .tableBox{
  245 + text-align: center;
  246 + .fenye{
  247 + // margin: 20px;
  248 + }
  249 + }
  250 + }
  251 + .couponDialogBox {
  252 + max-height: 600px;
  253 + overflow-y: auto;
  254 + }
  255 + .formSearch{
  256 +
  257 + display: flex;
  258 + width: 100%;
  259 + font-size: 14px;
  260 + justify-content: space-between;
  261 + // padding-bottom: 10px;
  262 + align-items: center;
  263 + margin: 20px 0;
  264 +
  265 + }
  266 + .tableBtn {
  267 + display: inline-block;
  268 + margin-right: 10px;
  269 + }
  270 +
  271 + .greens {
  272 + color: #3F9B6A;
  273 + }
  274 + ::v-deep .buttonHover:hover{
  275 + color:#3f9b6a !important;
  276 + border-color: #c5e1d2 !important;
  277 + background-color: #ecf5f0 !important;
  278 + outline: none;
  279 + }
  280 + ::v-deep .el-pagination__total {
  281 + position: absolute;
  282 + left: 10px;
  283 + }
  284 + ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{
  285 + background-color:#3f9b6a;
  286 + }
  287 + </style>
... ...
merchant-web-master/src/views/couponmanagement/coupon.vue 0 → 100644
  1 +<template>
  2 + <div class="addCoupon">
  3 + <!-- 新增优惠券 -->
  4 + <div class="addCouponBox" style="padding-right: 30px;">
  5 + <TitleWithCircle title="基本信息" style="margin-bottom: 20px;"/>
  6 + <div style="padding-bottom: 15px;padding-right: 30px;padding-left: 80px;font-weight: bold;">
  7 + 所需金额:{{ changecouponfrom() }} 元
  8 + </div>
  9 +
  10 + <el-form ref="ruleForm" class="formBox" :model="couponfrom" label-width="150px" :rules="couponRules">
  11 + <el-form-item label="优惠券名称" prop="couponName">
  12 + <el-input v-model="couponfrom.couponName" placeholder="请输入优惠券名称" onblur="value=value.replace(/(^\s*)|(\s*$)/g, '')" />
  13 + </el-form-item>
  14 + <el-form-item label="优惠券类型">
  15 + <el-radio v-model="couponfrom.couponType" label="1">满减券</el-radio>
  16 + <el-radio v-model="couponfrom.couponType" label="2">折扣券</el-radio>
  17 + </el-form-item>
  18 + <el-form-item v-if="couponfrom.couponType === '1'" class="inputW" label="优惠内容" prop="maxDiscountAmount">
  19 + 订单满 <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元 减 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
  20 + </el-form-item>
  21 + <el-form-item v-else class="inputW discount" label="优惠内容" prop="discountContent">
  22 + <span v-if="couponfrom.couponType === '2'" style="margin-right: 10px;">
  23 + 最高优惠金额
  24 + <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
  25 + </span>
  26 + 打 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :max="9.9" :precision="1" :step="0.1" /> 折
  27 + <label>输入值要大于0 小于10,可保留一位小数</label>
  28 +
  29 + </el-form-item>
  30 + <!-- <el-form-item v-if="couponfrom.couponType === '2'" class="inputW" label="最高优惠金额" prop="maxDiscountAmount">
  31 + <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
  32 + </el-form-item> -->
  33 + <!-- <el-form-item label="可用商品类别:">
  34 + <el-radio-group v-model="couponfrom.useCategory" @change="changeType">
  35 + <el-radio :label="1" >全部</el-radio>
  36 + <el-radio :label="2" >选择类别</el-radio>
  37 + </el-radio-group>
  38 + </el-form-item>
  39 + <el-form-item label="选择商品类别:" v-if="couponfrom.useCategory === 2">
  40 + <el-select style="width: 100%;" multiple v-model="useCategory" placeholder="请选择" filterable @change="changeuseCategory">
  41 + <el-option
  42 + v-for="item in classList"
  43 + :key="item.classifyId"
  44 + :label="item.classifyName"
  45 + :value="item.classifyId"
  46 + />
  47 + </el-select>
  48 + </el-form-item> -->
  49 + <!-- <el-form-item label="使用范围:">
  50 + <el-radio-group v-model="couponfrom.usedMerchants" >
  51 + <el-radio :label="1" >全平台</el-radio>
  52 + <el-radio :label="3" >部分商家</el-radio>
  53 + </el-radio-group>
  54 + </el-form-item> -->
  55 + <el-form-item label="选择商品:" >
  56 + <el-select
  57 + style="width: 100%;"
  58 + multiple
  59 + v-model="usedMerchants"
  60 + placeholder="请选择"
  61 + filterable
  62 + @change="changeusedMerchants"
  63 + >
  64 + <el-option
  65 + v-for="item in shopList"
  66 + :key="item.productId"
  67 + :label="item.productName"
  68 + :value="item.productId"
  69 + />
  70 + </el-select>
  71 + </el-form-item>
  72 + <div style="display: flex;">
  73 + <el-form-item label="是否开启积分兑换:">
  74 + <el-radio-group v-model="pointsRequired">
  75 + <el-radio :label="1" >是</el-radio>
  76 + <el-radio :label="0" >否</el-radio>
  77 + </el-radio-group>
  78 + </el-form-item>
  79 + <el-form-item v-if="pointsRequired" label="所需积分:">
  80 + <el-input v-model="couponfrom.pointsRequired" type="number" style="width: 150px" /> 分
  81 + </el-form-item>
  82 + </div>
  83 + <el-form-item class="timeDataBox" label="用券时间" prop="startTime">
  84 + <el-date-picker
  85 + v-model="dateInfo"
  86 + type="datetimerange"
  87 + range-separator="至"
  88 + start-placeholder="开始日期"
  89 + end-placeholder="结束日期"
  90 + value-format="yyyy-MM-dd HH:mm:ss"
  91 + @change="changeDate"
  92 + />
  93 + </el-form-item>
  94 + <el-form-item class="boxWidth" label="数量" prop="totalCoupons">
  95 + <el-input v-model="couponfrom.totalCoupons" type="number" oninput="value=value.replace(/[^\d]/g,'')" />张 <span v-if="coupoobj.symon && changecouponfrom()!=0">(最大:{{ (coupoobj.symon/changecouponfrom()).toFixed(0) }} 张)</span>
  96 + </el-form-item>
  97 + <el-form-item label="备注">
  98 + <el-input maxlength="200" show-word-limit rows="4" v-model="couponfrom.remark" placeholder="请输入备注" type="textarea" />
  99 + </el-form-item>
  100 + </el-form>
  101 + </div>
  102 + </div>
  103 + </template>
  104 +
  105 + <script>
  106 + // import { commdityClassGetAll } from '@/api/renovation';
  107 + import TitleWithCircle from '@/components/top/index';
  108 +// import {
  109 +// businessListGetAll,
  110 +// } from '@/api/business'
  111 +import {
  112 + getClassifyGetAll,
  113 +} from '@/api/commodity'
  114 + export default {
  115 + components: {
  116 + TitleWithCircle
  117 + },
  118 + name: 'AddCoupon',
  119 + props: {
  120 + couponfrom: {
  121 + type: Object,
  122 + default: {},
  123 +
  124 + },
  125 + coupoobj: {
  126 + type: Object,
  127 + default: {
  128 + symon:0
  129 + },
  130 + },
  131 + },
  132 + data() {
  133 + var moneyContent = (rule, value, callback) => {
  134 + if(!this.couponfrom.maxDiscountAmount) {
  135 + return callback(new Error('请输入优惠内容'));
  136 + }
  137 + if(!this.couponfrom.discountContent) {
  138 + return callback(new Error('请输入优惠内容'));
  139 + }
  140 + if(this.couponfrom.couponType == '1') {
  141 + if(Number(this.couponfrom.discountContent) >= Number(this.couponfrom.maxDiscountAmount)) {
  142 + return callback(new Error('请满减金额大于优惠金额'));
  143 + }
  144 + }
  145 + callback();
  146 + }
  147 + return {
  148 + monys:0,
  149 + usedMerchants:null,
  150 + pointsRequired:0,
  151 + dateInfo: null,
  152 + isThreshold: true,
  153 + useCategory:null,
  154 + useCategory2:1,
  155 + classList:[],
  156 + shopList:[],
  157 + couponRules: {
  158 + couponName: [
  159 + { required: true, message: '请输入优惠券名称', trigger: 'blur' }
  160 + ],
  161 + maxDiscountAmount: [ { validator: moneyContent, trigger: 'blur' }],
  162 + startTime: [{required: true, message: '请选择时间', trigger: 'blur'}],
  163 + totalCoupons: [{ required: true, message: '请输入数量', trigger: 'blur' }]
  164 + },
  165 + }
  166 + },
  167 + watch: {
  168 + 'couponfrom.couponType'(val) {
  169 + this.couponfrom.maxDiscountAmount = 0
  170 + this.couponfrom.discountContent = 0
  171 + },
  172 + 'couponfrom.useCategory'(val) {
  173 + if(val == '1') {
  174 + this.useCategory = null
  175 + } else {
  176 + }
  177 + },
  178 + 'couponfrom.usedMerchants'(val) {
  179 + this.usedMerchants = null
  180 + },
  181 + pointsRequired(val) {
  182 + this.couponfrom.pointsRequired = 0
  183 + },
  184 + },
  185 + mounted() {
  186 + this.getAll()
  187 + },
  188 + methods: {
  189 + changeuseCategory(e){
  190 + this.$emit('changevalue','useCategorylist',e)
  191 + },
  192 + changeusedMerchants(e){
  193 + this.$emit('changevalue','usedMerchantslist',e)
  194 + },
  195 + changeDate(e){
  196 + console.error(e)
  197 + if(e && e.length>0) {
  198 + this.couponfrom.startTime = e[0]
  199 + this.couponfrom.endTime = e[0]
  200 + } else {
  201 + this.couponfrom.startTime = ''
  202 + this.couponfrom.endTime = ''
  203 + }
  204 +
  205 + },
  206 + changecouponfrom() {
  207 + let num = 0
  208 + if(this.couponfrom.couponType == '1') {
  209 + num = (this.couponfrom.discountContent?Number(this.couponfrom.discountContent):0) * (this.couponfrom.totalCoupons?Number(this.couponfrom.totalCoupons):0)
  210 + } else if(this.couponfrom.couponType == '2') {
  211 + num = (this.couponfrom.maxDiscountAmount?Number(this.couponfrom.maxDiscountAmount):0) * (this.couponfrom.totalCoupons?Number(this.couponfrom.totalCoupons):0)
  212 + }
  213 + console.log(num)
  214 + return num
  215 + },
  216 + // 获取类别
  217 + async getAll () {
  218 + // const res = await commdityClassGetAll({
  219 + // page: 1,
  220 + // pageSize: 100
  221 + // })
  222 + // this.classList = res.data.list
  223 +
  224 + const res1 = await getClassifyGetAll ({
  225 + page: 1,
  226 + pageSize: 400
  227 + })
  228 + this.shopList = res1.data.list
  229 + },
  230 + changeThreshold(val) { // 输入框值改变
  231 + if (val) {
  232 + this.couponfrom.threshold = 0
  233 + }
  234 + },
  235 + changeType () {
  236 + }
  237 + }
  238 + }
  239 + </script>
  240 + <style lang='scss' scoped>
  241 + //@import url(); 引入公共css类
  242 + @import url("../../styles/elDialog.scss");
  243 + .addCoupon {
  244 + background: #FFFFFF;
  245 + .dialog-footer {
  246 + // margin-left: 300px;
  247 + }
  248 + .formBox {
  249 + .flexBox {
  250 + display: flex;
  251 + }
  252 + .applyType {
  253 + span {
  254 + width: 100px;
  255 + height: 30px;
  256 + line-height: 30px;
  257 + background: #3F9B6A;
  258 + color: #FFFFFF;
  259 + text-align: center;
  260 + display: inline-block;
  261 + font-size: 14px;
  262 + margin-right: 30px;
  263 + border-radius: 4px;
  264 + cursor: pointer;
  265 + position: relative;
  266 + i {
  267 + position: absolute;
  268 + right: -10px;
  269 + top: -10px;
  270 + width: 25px;
  271 + height: 25px;
  272 + line-height: 25px;
  273 + background: #FFFFFF;
  274 + border-radius: 50%;
  275 + border: 1px solid #3F9B6A;
  276 + text-align: center;
  277 + color: #3F9B6A;
  278 + font-style: normal;
  279 + font-size: 12px;
  280 + }
  281 + }
  282 + }
  283 + }
  284 + .footBtnBox {
  285 + width: 100%;
  286 + display: flex;
  287 + justify-content: center;
  288 + margin-top: 50px;
  289 + }
  290 + .dateBox {
  291 + display: flex;
  292 + align-items: center;
  293 + .description {
  294 + width: 59px;
  295 + text-align: center;
  296 + display: block;
  297 + font-size: 14px;
  298 + color: #999999;
  299 + }
  300 + }
  301 + .discount label {
  302 + color: #cccccc;
  303 + font-weight: 500;
  304 + padding-left: 30px;
  305 + }
  306 + }
  307 +
  308 + </style>
  309 + <style scoped>
  310 + .flexBox /deep/ .el-input {
  311 + width: 300px;
  312 + }
  313 + .inputW /deep/ .el-input, .el-input-number {
  314 + width: 100px;
  315 + /* margin: 0 8px; */
  316 + }
  317 + .inputW /deep/ .el-input .el-input__inner {
  318 + text-align: center;
  319 + }
  320 + .inputW /deep/ .el-form-item__error {
  321 + padding-left: 25px;
  322 + }
  323 + .inputW /deep/ .el-checkbox {
  324 + margin-left: 20px;
  325 + }
  326 + .inputW /deep/ .el-radio {
  327 + margin-left: 30px;
  328 + }
  329 + .boxWidth /deep/ .el-input {
  330 + width: 100px;
  331 + margin-right: 15px;
  332 + }
  333 + .boxWidth /deep/ .el-input .el-input__inner {
  334 + text-align: center;
  335 + }
  336 + .addCoupon /deep/ .el-button--primary {
  337 + background: #3F9B6A;
  338 + border-color: #3F9B6A;
  339 + }
  340 + .addCoupon /deep/ .el-dialog__header {
  341 + background-color: #3F9B6A;
  342 + }
  343 + .addCoupon /deep/ .el-dialog__headerbtn .el-dialog__close {
  344 + color: #FFFFFF;
  345 + }
  346 + .addCoupon .timeDataBox /deep/ .el-form-item__content {
  347 + display: flex;
  348 + align-items: center;
  349 + }
  350 + .addCoupon .timeDataBox /deep/ .el-form-item__label {}
  351 + input::-webkit-outer-spin-button,
  352 + input::-webkit-inner-spin-button {
  353 + -webkit-appearance: none;
  354 + }
  355 + input[type="number"]{
  356 + -moz-appearance: textfield;
  357 + }
  358 +
  359 + </style>
  360 +
0 361 \ No newline at end of file
... ...
merchant-web-master/src/views/couponmanagement/couponinfo.vue 0 → 100644
  1 +<template>
  2 + <div style="background-color:#f7f7f7;padding:10px 10px;">
  3 + <div class="couponPage" >
  4 + <div>
  5 + <div style="height:58px;line-height:58px;">
  6 + <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span>优惠券列表</span> <span style="padding:0 5px;">></span><span style="color:#000000e6">详情</span></div>
  7 + </div>
  8 + <div style="display: flex;margin-bottom: 10px;">
  9 + <div v-for="item in typelist" style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
  10 + <div style="font-size: 14px;color: #a8abb2;">{{item.type}}</div>
  11 + <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{item.num}}</div>
  12 + </div>
  13 + </div>
  14 + <el-tabs v-model="activeName" @tab-click="handleClick">
  15 + <el-tab-pane label="渠道领用" name="first">渠道领用</el-tab-pane>
  16 + <el-tab-pane label="用户领取" name="second">用户领取</el-tab-pane>
  17 + <el-tab-pane label="用户使用" name="third">用户使用</el-tab-pane>
  18 + <el-tab-pane label="商家补贴" name="fourth">商家补贴</el-tab-pane>
  19 + </el-tabs>
  20 + <!-- 搜索 -->
  21 + <div class="formSearch">
  22 + <!-- 搜索条件 -->
  23 + <el-form :inline="true" :model="query" class="demo-form-inline">
  24 + <el-form-item label="名称">
  25 + <el-input v-model="query.couponName" placeholder="请输入名称" />
  26 + </el-form-item>
  27 + </el-form>
  28 + <div>
  29 + <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
  30 + <el-button class="buttonHover"
  31 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="clear">重置</el-button>
  32 + </div>
  33 + </div>
  34 + <!-- 表格 -->
  35 + <div class="tableBox">
  36 + <el-table
  37 + ref="multipleTable"
  38 + :data="tableData"
  39 + :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}"
  40 + tooltip-effect="light"
  41 + >
  42 + <el-table-column label="编号" >
  43 + <template slot-scope="scope">{{ scope.row.id }}</template>
  44 + </el-table-column>
  45 + <el-table-column label="优惠券名称" >
  46 + <template slot-scope="scope">{{ scope.row.couponName }}</template>
  47 + </el-table-column>
  48 + <el-table-column label="类型">
  49 + <template slot-scope="scope">
  50 + <span v-if="scope.row.couponType == '1'">满减券</span>
  51 + <span v-else-if="scope.row.couponType == '2'">折扣券</span>
  52 + </template>
  53 + </el-table-column>
  54 + <el-table-column label="优惠内容">
  55 + <template slot-scope="scope">
  56 + <span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
  57 + <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
  58 + </template>
  59 + </el-table-column>
  60 + <el-table-column label="操作" fixed="right">
  61 + <template slot-scope="scope">
  62 + <div class="btnList">
  63 + <div class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
  64 + <!-- <div class="tableBtn greens" @click="addcoupon(scope.row)">生成优惠券</div> -->
  65 + </div>
  66 + </template>
  67 + </el-table-column>
  68 + </el-table>
  69 + <div style="display: flex;justify-content: space-between;margin: 20px 0;">
  70 + <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
  71 + <el-pagination
  72 + :current-page="query.pageNumber"
  73 + :page-sizes="[10, 20, 50, 100]"
  74 + :page-size="10"
  75 + background
  76 + small
  77 + layout="prev, pager, next"
  78 + :total="total"
  79 + @size-change="handleSizeChange"
  80 + @current-change="handleCurrentChange">
  81 + </el-pagination>
  82 + </div>
  83 + <div style="display: flex;">
  84 + <router-link to="/other/capitalpoolinfo"> <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >返回</el-button></router-link>
  85 + </div>
  86 + </div>
  87 + </div>
  88 + </div>
  89 +
  90 + </div>
  91 + </template>
  92 +
  93 + <script>
  94 + import { myCoupons}from '@/api/couponmanagement/couponlist.js'
  95 + import router from '@/router';
  96 + import coupon from './coupon.vue';
  97 +
  98 + export default {
  99 +
  100 + components:{
  101 + coupon
  102 + },
  103 + data () {
  104 + return {
  105 + activeName: 'second',
  106 + typelist:[
  107 + {
  108 + num:100,
  109 + type:'渠道领用',
  110 + color:'#ff5e5e'
  111 + },
  112 + {
  113 + num:100,
  114 + type:'用户领取',
  115 + color:'#ff883a'
  116 + },
  117 + {
  118 + num:100,
  119 + type:'用户使用',
  120 + color:'#ffc461'
  121 + },
  122 + {
  123 + num:100,
  124 + type:'商家补贴',
  125 + color:'#a467f0'
  126 + },
  127 + ],
  128 + query: {
  129 + activityName: '', // 活动名称
  130 + // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
  131 + state: '',
  132 + pageNumber: 1,
  133 + pageSize: 10
  134 + },
  135 + total: 0,
  136 + tableData: [],
  137 + }
  138 + },
  139 + created () {
  140 + this.getAll()
  141 + },
  142 + methods: {
  143 + handleClick(tab, event) {
  144 + console.log(tab, event);
  145 + },
  146 + xq(e) {
  147 + // 跳转路由
  148 + router.push({
  149 + path: '/other/coupon',
  150 + query: {
  151 + id: e.id
  152 + }
  153 + })
  154 + },
  155 + async getAll () {
  156 + const res = await myCoupons(this.query)
  157 + console.error(res.data.content)
  158 + this.tableData = res.data.content
  159 + this.total = res.data.numberOfElements
  160 + },
  161 + handleSizeChange (val) {
  162 + this.query.pageSize = val
  163 + this.getAll()
  164 + },
  165 + handleCurrentChange (val) {
  166 + this.query.pageNumber = val
  167 + this.getAll()
  168 + },
  169 + search () {
  170 + this.total = 1
  171 + this.query.pageNumber = 1
  172 + this.getAll()
  173 + },
  174 + // 重置
  175 + clear () {
  176 + this.query = {
  177 + activityName: '',
  178 + state: '',
  179 + pageNumber: 1,
  180 + pageSize: 10
  181 + }
  182 + this.getAll()
  183 + },
  184 +
  185 + }
  186 + }
  187 + </script>
  188 +
  189 + <style scoped lang="scss">
  190 + ::v-deep .el-form-item {
  191 + margin-bottom: 0;
  192 + }
  193 + ::v-deep .el-tabs__content {
  194 + display: none;
  195 + }
  196 + ::v-deep .el-tabs__item{
  197 + font-size: 16px;
  198 + font-family: "Alibaba PuHuiTi 2.0-55 Regular";
  199 + }
  200 + ::v-deep .el-dialog__header{
  201 + border-bottom: 2px solid #eee;
  202 + background-color: #fff;
  203 + }
  204 + ::v-deep .el-dialog__title {
  205 + color: #303133;
  206 + }
  207 + .footer{
  208 + font-size: 24px;
  209 + .btn_list {
  210 + display: flex;
  211 + flex-direction: row-reverse;
  212 + span {
  213 + padding: 0;
  214 + margin: 0;
  215 + width: 100px;
  216 + height:32px;
  217 + line-height:32px;
  218 + text-align: center;
  219 + display: inline-block;
  220 + font-size: 16px;
  221 + border-radius: 4px;
  222 + box-sizing: border-box;
  223 + &:hover {
  224 + cursor: pointer;
  225 + }
  226 + &:nth-child(1) {
  227 + background: rgba(255, 255, 255, 1);
  228 + order: 1px solid rgba(224, 229, 235, 1);
  229 +
  230 + border: 1px solid rgba(224, 229, 235, 1);
  231 + }
  232 + &:nth-child(2) {
  233 + background: #3f9b6a;
  234 + color: #fff;
  235 + margin-right: 20px;
  236 + }
  237 + }
  238 + }
  239 + }
  240 + .couponPage{
  241 +
  242 + padding: 0 20px 20px 20px;
  243 + min-height: calc(100vh - 50px - 20px);
  244 + background-color: #Fff;
  245 +
  246 +
  247 + .tableBox{
  248 + text-align: center;
  249 + .fenye{
  250 + // margin: 20px;
  251 + }
  252 + }
  253 + }
  254 + .couponDialogBox {
  255 + max-height: 600px;
  256 + overflow-y: auto;
  257 + }
  258 + .formSearch{
  259 +
  260 + display: flex;
  261 + width: 100%;
  262 + font-size: 14px;
  263 + justify-content: space-between;
  264 + // padding-bottom: 10px;
  265 + align-items: center;
  266 + margin: 20px 0;
  267 +
  268 + }
  269 + .tableBtn {
  270 + display: inline-block;
  271 + margin-right: 10px;
  272 + }
  273 +
  274 + .greens {
  275 + color: #3F9B6A;
  276 + }
  277 + ::v-deep .buttonHover:hover{
  278 + color:#3f9b6a !important;
  279 + border-color: #c5e1d2 !important;
  280 + background-color: #ecf5f0 !important;
  281 + outline: none;
  282 + }
  283 + ::v-deep .el-pagination__total {
  284 + position: absolute;
  285 + left: 10px;
  286 + }
  287 + ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{
  288 + background-color:#3f9b6a;
  289 + }
  290 + </style>
... ...
merchant-web-master/src/views/couponmanagement/couponlist.vue 0 → 100644
  1 +<template>
  2 + <div style="background-color:#f7f7f7;padding:0 10px;">
  3 + <div class="couponPage" v-show="type == '1'">
  4 + <div>
  5 + <!-- 搜索 -->
  6 + <div class="formSearch">
  7 + <!-- 搜索条件 -->
  8 + <el-form :inline="true" :model="query" class="demo-form-inline">
  9 + <el-form-item label="名称">
  10 + <el-input v-model="query.poolName" placeholder="请输入名称" />
  11 + </el-form-item>
  12 + <el-form-item label="状态">
  13 + <el-select v-model="query.fundsStatus" placeholder="请选择状态">
  14 + <el-option v-for="item in activityStatusSelect" :key="item.index" :label="item.label"
  15 + :value="item.value" />
  16 + </el-select>
  17 + </el-form-item>
  18 + </el-form>
  19 + <div>
  20 + <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
  21 + <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;"
  22 + @click="clear">重置</el-button>
  23 + </div>
  24 + </div>
  25 + <div style="margin: 0 0 20px 0;">
  26 + <el-button icon="el-icon-circle-plus-outline" style="background-color: #3F9B6A;color: #fff;"
  27 + @click="addcoupon">新增</el-button>
  28 + </div>
  29 + <!-- 表格 -->
  30 + <div class="tableBox">
  31 + <el-table ref="multipleTable" :data="tableData"
  32 + :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}"
  33 + tooltip-effect="light">
  34 + <el-table-column label="优惠券名称" >
  35 + <template slot-scope="scope">{{ scope.row.couponName }}</template>
  36 + </el-table-column>
  37 + <el-table-column label="资金池">
  38 + <template slot-scope="scope">{{ scope.row.cereFundsPool?scope.row.cereFundsPool.poolName:'' }}</template>
  39 + </el-table-column>
  40 + <el-table-column label="类型">
  41 + <template slot-scope="scope">
  42 + <span v-if="scope.row.couponType == '1'">满减券</span>
  43 + <span v-else-if="scope.row.couponType == '2'">折扣券</span>
  44 + </template>
  45 + </el-table-column>
  46 + <el-table-column label="优惠内容">
  47 + <template slot-scope="scope">
  48 + <span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
  49 + <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
  50 + </template>
  51 + </el-table-column>
  52 + <el-table-column label="金额" >
  53 + <template slot-scope="scope">{{ scope.row.totalFunds }}</template>
  54 + </el-table-column>
  55 + <el-table-column label="数量" >
  56 + <template slot-scope="scope">{{ scope.row.totalCoupons }}</template>
  57 + </el-table-column>
  58 + <el-table-column label="操作" fixed="right">
  59 + <template slot-scope="scope">
  60 + <div class="btnList">
  61 + <div class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
  62 +
  63 + </div>
  64 + </template>
  65 + </el-table-column>
  66 + </el-table>
  67 + <div style="display: flex;justify-content: space-between;" class="bom">
  68 + <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
  69 + <el-pagination :current-page="query.pageNumber" :page-sizes="[10, 20, 50, 100]" :page-size="10" background
  70 + small layout="prev, pager, next" :total="total" @size-change="handleSizeChange"
  71 + @current-change="handleCurrentChange">
  72 + </el-pagination>
  73 + </div>
  74 + </div>
  75 +
  76 + <el-dialog :title="editForm ? '修改资金池' : '新增资金池'" :visible.sync="activityVisible" width="500px" center
  77 + :close-on-click-modal="false" @close="activityVisible">
  78 + <el-form ref="form" :model="form" label-width="100px" :rules="couponRules">
  79 + <el-form-item label="资金池名称:" prop="poolName">
  80 + <el-input v-model="form.poolName" placeholder="请输入资金池名称" />
  81 + </el-form-item>
  82 + <el-form-item label="总金额:" style="margin: 20px 0;" prop="totalAmount">
  83 + <el-input v-model.number="form.totalAmount" placeholder="请输入总金额" />
  84 + </el-form-item>
  85 + <el-form-item label="出资方:" prop="contributor">
  86 + <el-input maxlength="200" show-word-limit rows="4" type="textarea" v-model="form.contributor"
  87 + placeholder="请输入出资方" />
  88 + </el-form-item>
  89 + </el-form>
  90 + <div class="footer" style="margin-top: 25px;">
  91 + <div class="btn_list">
  92 + <span @click="cancel" class="buttonHover"
  93 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span>
  94 + <span @click="save" style="background-color: #3F9B6A;color: #fff">保存</span>
  95 + </div>
  96 + </div>
  97 + </el-dialog>
  98 + </div>
  99 + </div>
  100 + <div class="couponPage" v-show="type == '2'">
  101 + <coupon :couponfrom="couponfrom" :coupoobj="coupoobj" @changevalue="changevalue"/>
  102 + <div class="footer">
  103 + <div class="btn_list" style="margin-top: 30px;">
  104 + <span @click="qxcoupon" class="buttonHover"
  105 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span>
  106 + <span @click="savecoupon" style="background-color: #3F9B6A;color: #fff">保存</span>
  107 + </div>
  108 + </div>
  109 + </div>
  110 + </div>
  111 +</template>
  112 +
  113 +<script>
  114 + import {
  115 + addcereFundsPool,
  116 + delPool,
  117 + editPool,
  118 + cereCouponMainTable,
  119 + totalCapitalBalance,
  120 + addcereCouponCategory
  121 + } from '@/api/couponmanagement/capitalpool.js'
  122 + import { getcereFundsPoolData}from '@/api/couponmanagement/couponlist.js'
  123 + import router from '@/router';
  124 + import coupon from './coupon.vue';
  125 + import TitleWithCircle from '@/components/top/index';
  126 + export default {
  127 +
  128 + components: {
  129 + coupon,TitleWithCircle
  130 + },
  131 + data() {
  132 + return {
  133 + couponRules: {
  134 + poolName: [{
  135 + required: true,
  136 + message: '请输入资金池名称',
  137 + trigger: 'blur'
  138 + },
  139 + {
  140 + min: 0,
  141 + max: 20,
  142 + message: '长度不超过20个字符',
  143 + trigger: 'blur'
  144 + }
  145 + ],
  146 + totalAmount: [{
  147 + required: true,
  148 + message: '请输入总金额',
  149 + trigger: 'blur'
  150 + }, ],
  151 + contributor: [{
  152 + required: true,
  153 + message: '请输入出资方',
  154 + trigger: 'blur'
  155 + }, ],
  156 + },
  157 + useCategorylist:'',
  158 + usedMerchantslist:'',
  159 + couponfrom: {
  160 + usedMerchants: 2,
  161 + couponName: '',
  162 + remark: '',
  163 + couponType: '1', // 默认值
  164 + useCategory: 1,
  165 + maxDiscountAmount: null,
  166 + usageThreshold: null, //使用门槛不用
  167 + discountContent: null,
  168 + pointsRequired: 0,
  169 + startTime: '',
  170 + endTime: '',
  171 + totalCoupons: null,
  172 + totalFunds: null,
  173 + },
  174 + coupoobj: {},
  175 + type: '1',
  176 + query: {
  177 + activityName: '', // 活动名称
  178 + // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
  179 + state: '',
  180 + pageNumber: 1,
  181 + pageSize: 10
  182 + },
  183 + total: 0,
  184 + tableData: [],
  185 + activityStatusSelect: [{
  186 + index: 0,
  187 + label: '未启用',
  188 + value: 0
  189 + },
  190 + {
  191 + index: 1,
  192 + label: '启用中',
  193 + value: 1
  194 + },
  195 + {
  196 + index: 2,
  197 + label: '已关闭',
  198 + value: 2
  199 + },
  200 + ],
  201 + activityVisible: false,
  202 + editForm: false,
  203 + activityDetailVisible: false,
  204 + form: {
  205 + poolName: '',
  206 + contributor: '',
  207 + totalAmount: null,
  208 + fundsStatus: '0'
  209 + }
  210 + }
  211 + },
  212 + created() {
  213 + this.getAll()
  214 + },
  215 + methods: {
  216 + changevalue(e,list) {
  217 + console.error(e,list )
  218 + this[e] = list
  219 + },
  220 + xq(e) {
  221 + console.log(e )
  222 + // 跳转路由
  223 + router.push({
  224 + path: '/other/coupon',
  225 + query: {
  226 + id: e.poolId
  227 + }
  228 + })
  229 + },
  230 + savecoupon() {
  231 + let that = this
  232 + if(!this.couponfrom.couponName) {
  233 + return
  234 + }
  235 + if(!this.couponfrom.startTime) {
  236 + return
  237 + }
  238 + if(!this.couponfrom.totalCoupons) {
  239 + return
  240 + }
  241 + if(!this.couponfrom.maxDiscountAmount) {
  242 + return
  243 + }
  244 + if(!this.couponfrom.discountContent) {
  245 + return
  246 + }
  247 + if(this.couponfrom.couponType == '1') {
  248 + if(Number(this.couponfrom.discountContent) >= Number(this.couponfrom.maxDiscountAmount)) {
  249 + return
  250 + }
  251 + }
  252 + let c1 = this.changecouponfrom()
  253 + console.error(c1)
  254 + console.error(this.useCategorylist)
  255 + console.error(this.usedMerchantslist)
  256 + console.error(this.coupoobj)
  257 + let from = this.couponfrom
  258 + from.fundPoolId = this.coupoobj.poolId
  259 + from.totalFunds = c1
  260 + if (c1 > this.coupoobj.symon) {
  261 + that.$message({
  262 + message: '金额不足',
  263 + error: 'error'
  264 + });
  265 + return
  266 + }
  267 + from.maxDiscountAmount = Number(from.maxDiscountAmount)
  268 + from.discountContent = Number(from.discountContent)
  269 + from.pointsRequired = Number(from.pointsRequired)
  270 + from.totalCoupons = Number(from.totalCoupons)
  271 + console.error({
  272 + ...from
  273 + })
  274 + console.error(JSON.stringify(from))
  275 + // return
  276 + cereCouponMainTable(from).then(res => {
  277 + console.error(res)
  278 + if (res.data) {
  279 + if(res.data.usedMerchants == '2') {
  280 + let info2 = {
  281 + couponId:res.data.id,
  282 + usedMerchants:2,
  283 + categoryIds:that.usedMerchantslist
  284 + }
  285 + addcereCouponCategory(info2).then(res2 => {
  286 + console.error(res2)
  287 + })
  288 + }
  289 + that.$message({
  290 + message: '提交成功',
  291 + type: 'success'
  292 + });
  293 + } else {
  294 + that.$message({
  295 + message: '提交失败',
  296 + error: 'success'
  297 + });
  298 + }
  299 + setTimeout(() => {
  300 + that.type = '1'
  301 + }, 2000)
  302 + })
  303 + },
  304 + changecouponfrom() {
  305 + let num = 0
  306 + if (this.couponfrom.couponType == '1') {
  307 + num = (this.couponfrom.discountContent ? Number(this.couponfrom.discountContent) : 0) * (this.couponfrom
  308 + .totalCoupons ? Number(this.couponfrom.totalCoupons) : 0)
  309 + } else if (this.couponfrom.couponType == '2') {
  310 + num = (this.couponfrom.maxDiscountAmount ? Number(this.couponfrom.maxDiscountAmount) : 0) * (this.couponfrom
  311 + .totalCoupons ? Number(this.couponfrom.totalCoupons) : 0)
  312 + }
  313 + return num
  314 + },
  315 + qxcoupon() {
  316 + this.type = '1'
  317 + },
  318 + async addcoupon(e) {
  319 + let that = this
  320 + this.type = '2'
  321 +
  322 + },
  323 + endActivityeditPool(item, type) {
  324 + let that = this
  325 + let form = item
  326 + form.totalAmount = Number(form.totalAmount)
  327 + form.fundsStatus = type
  328 + editPool(form).then(res => {
  329 + console.error(res)
  330 + if (res.data) {
  331 + that.$message({
  332 + message: '修改成功',
  333 + type: 'success'
  334 + });
  335 + } else {
  336 + that.$message({
  337 + message: '修改失败',
  338 + error: 'success'
  339 + });
  340 + }
  341 + that.search()
  342 + })
  343 + },
  344 + save() {
  345 + let that = this
  346 + console.error(this.form)
  347 + let form = this.form
  348 + that.$refs.form.validate((valid) => {
  349 + if (valid) {
  350 + form.totalAmount = Number(form.totalAmount)
  351 + if (that.editForm) {
  352 + editPool(form).then(res => {
  353 + // console.error(res)
  354 + if (res.data) {
  355 + that.$message({
  356 + message: '修改成功',
  357 + type: 'success'
  358 + });
  359 + } else {
  360 + that.$message({
  361 + message: '修改失败',
  362 + error: 'success'
  363 + });
  364 + }
  365 + that.search()
  366 + that.activityVisible = false
  367 + that.form = {
  368 + poolName: '',
  369 + contributor: '',
  370 + totalAmount: null,
  371 + fundsStatus: '0'
  372 + }
  373 + })
  374 + } else {
  375 + addcereFundsPool(form).then(res => {
  376 + // console.error(res)
  377 + if (res.data) {
  378 + that.$message({
  379 + message: '提交成功',
  380 + type: 'success'
  381 + });
  382 + } else {
  383 + that.$message({
  384 + message: '提交失败',
  385 + error: 'success'
  386 + });
  387 + }
  388 + that.search()
  389 + that.activityVisible = false
  390 + that.form = {
  391 + poolName: '',
  392 + contributor: '',
  393 + totalAmount: null,
  394 + fundsStatus: '0'
  395 + }
  396 + })
  397 + }
  398 + } else {
  399 + console.log('error submit!!');
  400 + return false;
  401 + }
  402 + });
  403 +
  404 +
  405 + },
  406 + cancel() {
  407 + this.activityVisible = false
  408 + this.form = {
  409 + poolName: '',
  410 + contributor: '',
  411 + totalAmount: null,
  412 + fundsStatus: '0'
  413 + }
  414 + },
  415 + async getAll() {
  416 + const res = await getcereFundsPoolData(this.query)
  417 + this.tableData = res.data.content
  418 + this.total = res.data.numberOfElements
  419 + },
  420 + handleSizeChange(val) {
  421 + this.query.pageSize = val
  422 + this.getAll()
  423 + },
  424 + handleCurrentChange(val) {
  425 + this.query.pageNumber = val
  426 + this.getAll()
  427 + },
  428 + search() {
  429 + this.total = 1
  430 + this.query.pageNumber = 1
  431 + this.getAll()
  432 + },
  433 + // 重置
  434 + clear() {
  435 + this.query = {
  436 + activityName: '',
  437 + state: '',
  438 + pageNumber: 1,
  439 + pageSize: 10
  440 + }
  441 + this.getAll()
  442 + },
  443 + // 活动详情
  444 + details(row) {
  445 + this.form = row
  446 + this.activityDetailVisible = true
  447 + },
  448 + // 添加活动
  449 + addActivity() {
  450 + this.editForm = false
  451 + this.activityVisible = true
  452 + },
  453 + // 编辑
  454 + editActivity(row) {
  455 + this.editForm = true
  456 + this.form = row
  457 + this.activityVisible = true
  458 + },
  459 + async endActivity(row) {
  460 + const res = await endCoupon({
  461 + activityId: row.activityId
  462 + })
  463 + if (res.code === '') {
  464 + this.$message({
  465 + message: '结束成功',
  466 + type: 'success'
  467 + })
  468 + } else {
  469 + this.$message({
  470 + message: res.message,
  471 + type: 'error'
  472 + })
  473 + }
  474 + this.getAll()
  475 + },
  476 + async delActivity(row) {
  477 + let that = this
  478 + this.$confirm('此作将永久操删除该文件, 是否继续?', '提示', {
  479 + confirmButtonText: '确定',
  480 + cancelButtonText: '取消',
  481 + type: 'warning'
  482 + }).then(() => {
  483 + delPool({
  484 + poolId: row.poolId
  485 + }).then(res => {
  486 + console.error(res)
  487 + if (res.data) {
  488 + that.$message({
  489 + message: '删除成功',
  490 + type: 'success'
  491 + });
  492 + } else {
  493 + that.$message({
  494 + message: '删除失败',
  495 + error: 'success'
  496 + });
  497 + }
  498 + that.search()
  499 + }).catch(error => {
  500 + })
  501 + }).catch(() => {
  502 + this.$message({
  503 + type: 'info',
  504 + message: '已取消删除'
  505 + });
  506 + });
  507 + },
  508 +
  509 + }
  510 + }
  511 +</script>
  512 +
  513 +<style scoped lang="scss">
  514 +
  515 + .el-table {
  516 + height: calc(100vh - 330px);
  517 + }
  518 +
  519 + .bom {
  520 + margin-top: 40px;
  521 + }
  522 +
  523 + .el-form-item {
  524 + margin-bottom: 0;
  525 + }
  526 +
  527 + ::v-deep .el-dialog__header {
  528 + border-bottom: 2px solid #eee;
  529 + background-color: #fff;
  530 + }
  531 +
  532 + ::v-deep .el-dialog__title {
  533 + color: #303133;
  534 + }
  535 +
  536 + .footer {
  537 + font-size: 24px;
  538 +
  539 + .btn_list {
  540 + display: flex;
  541 + flex-direction: row-reverse;
  542 +
  543 + span {
  544 + padding: 0;
  545 + margin: 0;
  546 + width: 100px;
  547 + height: 32px;
  548 + line-height: 32px;
  549 + text-align: center;
  550 + display: inline-block;
  551 + font-size: 16px;
  552 + border-radius: 4px;
  553 + box-sizing: border-box;
  554 +
  555 + &:hover {
  556 + cursor: pointer;
  557 + }
  558 +
  559 + &:nth-child(1) {
  560 + background: rgba(255, 255, 255, 1);
  561 + order: 1px solid rgba(224, 229, 235, 1);
  562 +
  563 + border: 1px solid rgba(224, 229, 235, 1);
  564 + }
  565 +
  566 + &:nth-child(2) {
  567 + background: #3f9b6a;
  568 + color: #fff;
  569 + margin-right: 20px;
  570 + }
  571 + }
  572 + }
  573 + }
  574 +
  575 + .couponPage {
  576 +
  577 + padding: 0 20px 20px 20px;
  578 + min-height: calc(100vh - 50px - 20px);
  579 + background-color: #Fff;
  580 +
  581 +
  582 + .tableBox {
  583 + text-align: center;
  584 +
  585 + .fenye {
  586 + // margin: 20px;
  587 + }
  588 + }
  589 + }
  590 +
  591 + .couponDialogBox {
  592 + max-height: 600px;
  593 + overflow-y: auto;
  594 + }
  595 +
  596 + .formSearch {
  597 +
  598 + display: flex;
  599 + width: 100%;
  600 + font-size: 14px;
  601 + justify-content: space-between;
  602 + padding-bottom: 10px;
  603 + align-items: center;
  604 +
  605 + }
  606 +
  607 + .tableBtn {
  608 + display: inline-block;
  609 + margin-right: 10px;
  610 + }
  611 +
  612 + .greens {
  613 + color: #3F9B6A;
  614 + }
  615 +
  616 + ::v-deep .buttonHover:hover {
  617 + color: #3f9b6a !important;
  618 + border-color: #c5e1d2 !important;
  619 + background-color: #ecf5f0 !important;
  620 + outline: none;
  621 + }
  622 +
  623 + ::v-deep .el-pagination__total {
  624 + position: absolute;
  625 + left: 10px;
  626 + }
  627 +
  628 + ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
  629 + background-color: #3f9b6a;
  630 + }
  631 +</style>
... ...