Commit 084351b651fd0abbc50ce3a7de82b986d1330b5d

Authored by 李宇
1 parent 43fe14a3

1

admin-web-master/src/api/couponmanagement/capitalpool.js
1 1 import request from '@/utils/request'
2   -
  2 +// 查询剩余金额
  3 +export function totalCapitalBalance(data) {
  4 + return request({
  5 + url: '/cereCouponMainTable/totalCapitalBalance',
  6 + method: 'post',
  7 + data
  8 + })
  9 +}
3 10 export function getcereFundsPoolData(data) {
4 11 return request({
5   - url: '/cereFundsPool',
  12 + url: '/cereFundsPool/queryByPage',
6 13 method: 'post',
7 14 data
8 15 })
... ... @@ -29,4 +36,25 @@ export function addcereFundsPool(data) {
29 36 data
30 37 })
31 38 }
32   -
  39 +export function delPool(data) {
  40 + return request({
  41 + url: '/cereFundsPool/deleteById ',
  42 + method: 'post',
  43 + data
  44 + })
  45 +}
  46 +export function editPool(data) {
  47 + return request({
  48 + url: '/cereFundsPool/edit ',
  49 + method: 'post',
  50 + data
  51 + })
  52 +}
  53 +//添加优惠券
  54 +export function cereCouponMainTable(data) {
  55 + return request({
  56 + url: '/cereCouponMainTable/add ',
  57 + method: 'post',
  58 + data
  59 + })
  60 +}
33 61 \ No newline at end of file
... ...
admin-web-master/src/api/couponmanagement/couponlist.js 0 → 100644
  1 +import request from '@/utils/request'
  2 +// 批量生成优惠券
  3 +export function batchGenerateCoupons(data) {
  4 + return request({
  5 + url: '/cereCouponUsage/batchGenerateCoupons',
  6 + method: 'post',
  7 + data
  8 + })
  9 +}
  10 +export function getcereFundsPoolData(data) {
  11 + return request({
  12 + url: '/cereCouponMainTable/queryByPage',
  13 + method: 'post',
  14 + data
  15 + })
  16 +}
  17 +
  18 +/**
  19 +{
  20 + "activityId": 0
  21 +}
  22 + */
  23 +export function getcereFundsPoolDetail(data) {
  24 + return request({
  25 + url: '/cereCouponMainTable/getById',
  26 + method: 'post',
  27 + data
  28 + })
  29 +}
  30 +
  31 +
  32 +export function addcereFundsPool(data) {
  33 + return request({
  34 + url: '/cereCouponMainTable/add ',
  35 + method: 'post',
  36 + data
  37 + })
  38 +}
  39 +export function delPool(data) {
  40 + return request({
  41 + url: '/cereCouponMainTable/deleteById ',
  42 + method: 'post',
  43 + data
  44 + })
  45 +}
  46 +export function editPool(data) {
  47 + return request({
  48 + url: '/cereCouponMainTable/edit ',
  49 + method: 'post',
  50 + data
  51 + })
  52 +}
  53 +
... ...
admin-web-master/src/api/couponmanagement/marketing.js 0 → 100644
  1 +import request from '@/utils/request'
  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 +// }
... ...
admin-web-master/src/layout/components/Sidebar/index.vue
... ... @@ -61,7 +61,7 @@ export default {
61 61 $route(to, from) {
62 62 // 这里可以添加逻辑来处理路由变化时的行为
63 63 // 例如,更新 activeMenu
64   - this.activeMenu = to.meta.activeMenu || to.path;
  64 + // this.activeMenu = to.meta.activeMenu || to.path;
65 65 }
66 66 // mes(newVal, oldVal) {
67 67 // console.log(this.routers)
... ...
admin-web-master/src/layout/index.vue
... ... @@ -190,13 +190,13 @@
190 190 </div>
191 191 </div> -->
192 192  
193   - <sidebar-item
  193 + <!-- <sidebar-item
194 194 v-for="(route, index) in routers"
195 195 :key="index"
196 196 class="tabLink"
197 197 :item="route"
198 198 :base-path="route.path"
199   - />
  199 + /> -->
200 200 <!-- <sidebar-item
201 201 v-for="(route, index) in routers"
202 202 :key="index"
... ...
admin-web-master/src/router/index.js
... ... @@ -746,7 +746,37 @@ export const mainRoutes = [
746 746 },
747 747  
748 748  
749   -
  749 + {
  750 + path: '/other',
  751 + component: Layout,
  752 + redirect: '/other/coupon',
  753 + hidden: true,
  754 + name: 'setup',
  755 + meta: {
  756 + title: '优惠券管理',
  757 + icon: 'el-icon-s-help'
  758 + },
  759 + children: [
  760 + {
  761 + path: 'coupon',
  762 + name: 'coupon',
  763 + component: () => import('@/views/couponmanagement/couponinfo'),
  764 + meta: {
  765 + title: '优惠券详情',
  766 + icon: 'tree'
  767 + }
  768 + },
  769 + {
  770 + path: 'capitalpoolinfo',
  771 + name: 'capitalpoolinfo',
  772 + component: () => import('@/views/couponmanagement/capitalpoolinfo'),
  773 + meta: {
  774 + title: '资金池详情',
  775 + icon: 'tree'
  776 + }
  777 + }
  778 + ]
  779 + },
750 780 {
751 781 path: '/setup',
752 782 component: Layout,
... ...
admin-web-master/src/utils/request.js
... ... @@ -20,9 +20,11 @@ if (host == &#39;172.16.61.48&#39; || host == &#39;172.16.61.49 :5173&#39; || host ==&#39;172.16.61.
20 20 // PREFIX = 'http://172.16.61.48/meserver/admin-server';
21 21 // PREFIX = 'http://192.168.2.98:9003';
22 22 // PREFIX = 'http://8.130.38.56:8019/admin-server';
23   - PREFIX = 'http://192.168.8.106:9003';
24   - // PREFIX = 'https://jy.scjysm.asia:18086/meserver/admin-server';
  23 +// PREFIX = 'http://192.168.2.213:9003';
  24 + // PREFIX = 'https://jy.scjysm.asia:18086/meserver/admin-server';
25 25 // PREFIX = 'http://172.16.61.126:8080/meserver/admin-server';
  26 + // PREFIX = 'https://wjdc.scjysm.asia:1443/meserver/admin-server'
  27 + PREFIX = 'http://8.130.38.56:9003'
26 28  
27 29 }else{
28 30 PREFIX = '/admin-server';
... ...
admin-web-master/src/views/couponmanagement/capitalpool.vue
1 1 <template>
2 2 <div style="background-color:#f7f7f7;padding:10px 10px;">
3   - <div class="couponPage">
4   - <div style="height:58px;line-height:58px;">
5   - <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span style="color:#000000e6">资金池</span></div>
6   - </div>
7   - <!-- 搜索 -->
8   - <div class="formSearch">
9   - <!-- 搜索条件 -->
10   - <el-form :inline="true" :model="query" class="demo-form-inline">
11   - <el-form-item label="名称">
12   - <el-input v-model="query.activityName" placeholder="请输入名称" />
13   - </el-form-item>
14   - <el-form-item label="状态">
15   - <el-select v-model="query.state" placeholder="请选择状态">
16   - <el-option
17   - v-for="item in activityStatusSelect"
18   - :key="item.index"
19   - :label="item.label"
20   - :value="item.value"
21   - />
22   - </el-select>
23   - </el-form-item>
24   - </el-form>
25   - <div>
26   - <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
27   - <el-button class="buttonHover"
28   - style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="clear">重置</el-button>
  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 style="color:#000000e6">资金池</span></div>
29 7 </div>
30   - </div>
31   - <div style="margin: 0 0 20px 0;">
32   - <el-button icon="el-icon-circle-plus-outline"
33   - style="background-color: #3F9B6A;color: #fff;" @click="addActivity">新建活动</el-button>
34   - </div>
35   - <!-- 表格 -->
36   - <div class="tableBox">
37   - <el-table
38   - ref="multipleTable"
39   - :data="tableData"
40   - :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
41   - tooltip-effect="dark"
42   - >
43   - <el-table-column label="资金池名称" width="220">
44   - <template slot-scope="scope">{{ scope.row.poolName }}</template>
45   - </el-table-column>
46   - <el-table-column label="出资方" width="220">
47   - <template slot-scope="scope">{{ scope.row.contributor }}</template>
48   - </el-table-column>
49   - <el-table-column label="总金额" width="220">
50   - <template slot-scope="scope">{{ scope.row.totalAmount }}</template>
51   - </el-table-column>
52   - <el-table-column label="状态">
53   - <template slot-scope="scope">
54   - <span v-if="scope.row.fundsStatus == '0'">未启用</span>
55   - <span v-if="scope.row.fundsStatus == '1'">启用中</span>
56   - <span v-if="scope.row.fundsStatus == '2'">已关闭</span>
57   - </template>
58   - </el-table-column>
59   - <!-- <el-table-column label="操作" show-overflow-tooltip>
60   - <template slot-scope="scope">
61   - <div class="btnList">
62   - <div class="tableBtn greens" @click="details(scope.row)">详情</div>
63   - <div v-if="scope.row.state != 4" class="tableBtn greens" @click="editActivity(scope.row)">编辑</div>
64   - <div v-if="scope.row.state != 4" class="tableBtn greens" @click="endActivity(scope.row)">结束</div>
65   - <div v-if="scope.row.state == 4" class="tableBtn greens" @click="delActivity(scope.row)">删除</div>
66   - </div>
67   - </template>
68   - </el-table-column> -->
69   - </el-table>
70   - <div class="fenye">
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,total"
78   - :total="total"
79   - @size-change="handleSizeChange"
80   - @current-change="handleCurrentChange"
81   - />
  8 + <!-- 搜索 -->
  9 + <div class="formSearch">
  10 + <!-- 搜索条件 -->
  11 + <el-form :inline="true" :model="query" class="demo-form-inline">
  12 + <el-form-item label="名称">
  13 + <el-input v-model="query.poolName" placeholder="请输入名称" />
  14 + </el-form-item>
  15 + <el-form-item label="状态">
  16 + <el-select v-model="query.fundsStatus" placeholder="请选择状态">
  17 + <el-option
  18 + v-for="item in activityStatusSelect"
  19 + :key="item.index"
  20 + :label="item.label"
  21 + :value="item.value"
  22 + />
  23 + </el-select>
  24 + </el-form-item>
  25 + </el-form>
  26 + <div>
  27 + <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
  28 + <el-button class="buttonHover"
  29 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="clear">重置</el-button>
  30 + </div>
  31 + </div>
  32 + <div style="margin: 0 0 20px 0;">
  33 + <el-button icon="el-icon-circle-plus-outline"
  34 + style="background-color: #3F9B6A;color: #fff;" @click="addActivity">新增</el-button>
  35 + </div>
  36 + <!-- 表格 -->
  37 + <div class="tableBox">
  38 + <el-table
  39 + ref="multipleTable"
  40 + :data="tableData"
  41 + :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}"
  42 + tooltip-effect="light"
  43 + >
  44 + <el-table-column label="编号" >
  45 + <template slot-scope="scope">{{ scope.row.poolId }}</template>
  46 + </el-table-column>
  47 + <el-table-column label="资金池名称" >
  48 + <template slot-scope="scope">{{ scope.row.poolName }}</template>
  49 + </el-table-column>
  50 + <el-table-column label="出资方" >
  51 + <template slot-scope="scope">{{ scope.row.contributor }}</template>
  52 + </el-table-column>
  53 + <el-table-column label="总金额">
  54 + <template slot-scope="scope">{{ scope.row.totalAmount }}</template>
  55 + </el-table-column>
  56 + <el-table-column label="状态">
  57 + <template slot-scope="scope">
  58 + <span v-if="scope.row.fundsStatus == '1'">启用中</span>
  59 + <span v-else-if="scope.row.fundsStatus == '2'">已关闭</span>
  60 + <span v-else>未启用</span>
  61 + </template>
  62 + </el-table-column>
  63 + <el-table-column label="操作" fixed="right">
  64 + <template slot-scope="scope">
  65 + <div class="btnList">
  66 + <!-- <div class="tableBtn greens" @click="editActivity(scope.row)">编辑</div> -->
  67 + <div v-if="scope.row.fundsStatus == '1'" class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
  68 + <div v-if="scope.row.fundsStatus == '1'" class="tableBtn greens" @click="addcoupon(scope.row)">创建优惠券</div>
  69 + <div v-if="scope.row.fundsStatus == '1'" class="tableBtn greens" @click="endActivityeditPool(scope.row,'2')">禁用</div>
  70 + <div v-else-if="scope.row.fundsStatus == '2'" class="tableBtn greens" @click="delActivity(scope.row)">删除</div>
  71 + <div v-else class="tableBtn greens" @click="endActivityeditPool(scope.row,'1')">开启</div>
  72 + <!-- <div class="tableBtn greens" @click="delActivity(scope.row)">删除</div> -->
  73 + </div>
  74 + </template>
  75 + </el-table-column>
  76 + </el-table>
  77 + <div style="display: flex;justify-content: space-between;" class="bom">
  78 + <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
  79 + <el-pagination
  80 + :current-page="query.pageNumber"
  81 + :page-sizes="[10, 20, 50, 100]"
  82 + :page-size="10"
  83 + background
  84 + small
  85 + layout="prev, pager, next"
  86 + :total="total"
  87 + @size-change="handleSizeChange"
  88 + @current-change="handleCurrentChange">
  89 + </el-pagination>
  90 + </div>
82 91 </div>
83   - </div>
84 92  
85   - <el-dialog
86   - :title="editForm ? '修改资金池' : '新增资金池'"
87   - :visible.sync="activityVisible"
88   - width="500px"
89   - center
90   - :close-on-click-modal="false"
91   - @close="closeModal">
92   - <el-form ref="activityForm" :model="activityForm" label-width="100px">
93   - <el-form-item label="资金池名称:">
94   - <el-input v-model="activityForm.poolName" placeholder="请输入资金池名称" />
95   - </el-form-item>
96   - <el-form-item label="出资方:">
97   - <el-input v-model="activityForm.contributor" placeholder="请输入出资方" />
98   - </el-form-item>
99   - <el-form-item label="总金额:">
100   - <el-input v-model="activityForm.activityName" placeholder="请输入总金额" />
101   - </el-form-item>
102   - </el-form>
103   - <div class="footer">
104   - <div class="btn_list">
105   - <span @click="cancel" class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span>
106   - <span @click="save" style="background-color: #3F9B6A;color: #fff">保存</span>
  93 + <el-dialog
  94 + :title="editForm ? '修改资金池' : '新增资金池'"
  95 + :visible.sync="activityVisible"
  96 + width="500px"
  97 + center
  98 + :close-on-click-modal="false"
  99 + @close="activityVisible">
  100 + <el-form ref="form" :model="form" label-width="100px">
  101 + <el-form-item label="资金池名称:">
  102 + <el-input v-model="form.poolName" placeholder="请输入资金池名称" />
  103 + </el-form-item>
  104 + <el-form-item label="出资方:">
  105 + <el-input v-model="form.contributor" placeholder="请输入出资方" />
  106 + </el-form-item>
  107 + <el-form-item label="总金额:">
  108 + <el-input v-model="form.totalAmount" placeholder="请输入总金额" />
  109 + </el-form-item>
  110 + </el-form>
  111 + <div class="footer">
  112 + <div class="btn_list">
  113 + <span @click="cancel" class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span>
  114 + <span @click="save" style="background-color: #3F9B6A;color: #fff">保存</span>
  115 + </div>
107 116 </div>
  117 + </el-dialog>
  118 + </div>
  119 + </div>
  120 + <div class="couponPage" v-show="type == '2'">
  121 + <div style="height:58px;line-height:58px;">
  122 + <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span style="color:#000000e6">创建优惠券</span></div>
  123 + </div>
  124 + <div style="display: flex;margin-bottom: 10px;">
  125 + <div>资金池名称:{{ coupoobj.poolName }}</div>
  126 + <div style="margin-left: 30px;font-weight: bold;">总金额:{{ coupoobj.symon }}</div>
  127 + </div>
  128 + <coupon :couponfrom="couponfrom" :coupoobj="coupoobj"/>
  129 + <div class="footer">
  130 + <div class="btn_list" style="margin-top: 30px;">
  131 + <span @click="qxcoupon" class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span>
  132 + <span @click="savecoupon" style="background-color: #3F9B6A;color: #fff">保存</span>
108 133 </div>
109   - </el-dialog>
  134 + </div>
110 135 </div>
111 136 </div>
112 137 </template>
113 138  
114 139 <script>
115   -import { getcereFundsPoolData,addcereFundsPool,}from '@/api/couponmanagement/capitalpool.js'
116   -export default {
  140 +import { getcereFundsPoolData,addcereFundsPool,delPool,editPool,cereCouponMainTable,totalCapitalBalance}from '@/api/couponmanagement/capitalpool.js'
  141 +import router from '@/router';
  142 +import coupon from './coupon.vue';
117 143  
  144 +export default {
  145 +
  146 + components:{
  147 + coupon
  148 + },
118 149 data () {
119 150 return {
  151 + couponfrom:{
  152 + usedMerchants:'全平台',
  153 + couponName: '',
  154 + remark: '',
  155 + couponType: '1', // 默认值
  156 + useCategory: '全部',
  157 + maxDiscountAmount: null,
  158 + usageThreshold: null,//使用门槛不用
  159 + discountContent: null,
  160 + pointsRequired: 0,
  161 + startTime: '',
  162 + endTime: '',
  163 + totalCoupons: null,
  164 + totalFunds: null,
  165 + },
  166 + coupoobj:{},
  167 + type:'1',
120 168 query: {
121 169 activityName: '', // 活动名称
122 170 // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
... ... @@ -124,7 +172,7 @@ export default {
124 172 pageNumber: 1,
125 173 pageSize: 10
126 174 },
127   - total: 1,
  175 + total: 0,
128 176 tableData: [],
129 177 activityStatusSelect: [
130 178 {
... ... @@ -146,23 +194,181 @@ export default {
146 194 activityVisible: false,
147 195 editForm: false,
148 196 activityDetailVisible: false,
149   - activityForm: {}
  197 + form: {
  198 + poolName:'',
  199 + contributor:'',
  200 + totalAmount:null,
  201 + fundsStatus:'0'
  202 + }
150 203 }
151 204 },
152 205 created () {
153 206 this.getAll()
154 207 },
155 208 methods: {
  209 + xq(e) {
  210 + // 跳转路由
  211 + router.push({
  212 + path: '/other/capitalpoolinfo',
  213 + query: {
  214 + id: e.id
  215 + }
  216 + })
  217 + },
  218 + savecoupon(){
  219 + let that = this
  220 + let c1 = this.changecouponfrom()
  221 + console.error(c1)
  222 + console.error(this.coupoobj)
  223 + let from = this.couponfrom
  224 + from.fundPoolId = this.coupoobj.poolId
  225 + from.totalFunds = c1
  226 + if(c1 > this.coupoobj.symon) {
  227 + that.$message({
  228 + message: '金额不足',
  229 + error: 'error'
  230 + });
  231 + return
  232 + }
  233 + from.maxDiscountAmount = Number(from.maxDiscountAmount)
  234 + from.discountContent = Number(from.discountContent)
  235 + from.pointsRequired = Number(from.pointsRequired)
  236 + from.totalCoupons = Number(from.totalCoupons)
  237 + console.error({...from})
  238 + console.error( JSON.stringify(from))
  239 + cereCouponMainTable(from).then(res=>{
  240 + console.error(res)
  241 + if(res.data) {
  242 + that.$message({
  243 + message: '提交成功',
  244 + type: 'success'
  245 + });
  246 + } else{
  247 + that.$message({
  248 + message: '提交失败',
  249 + error: 'success'
  250 + });
  251 + }
  252 + setTimeout(()=>{
  253 + that.type = '1'
  254 + },2000)
  255 + })
  256 + },
  257 + changecouponfrom() {
  258 + let num = 0
  259 + if(this.couponfrom.couponType == '1') {
  260 + num = (this.couponfrom.discountContent?Number(this.couponfrom.discountContent):0) * (this.couponfrom.totalCoupons?Number(this.couponfrom.totalCoupons):0)
  261 + } else if(this.couponfrom.couponType == '2') {
  262 + num = (this.couponfrom.maxDiscountAmount?Number(this.couponfrom.maxDiscountAmount):0) * (this.couponfrom.totalCoupons?Number(this.couponfrom.totalCoupons):0)
  263 + }
  264 + return num
  265 + },
  266 + qxcoupon() {
  267 + this.type = '1'
  268 + },
  269 + async addcoupon(e) {
  270 + let that = this
  271 +
  272 + let c1 = {
  273 + symon:0,
  274 + ...e
  275 + }
  276 + await totalCapitalBalance({poolId:e.poolId}).then(res=>{
  277 + console.error(res)
  278 + c1.symon = res.data
  279 + })
  280 + this.type = '2'
  281 + this.coupoobj= c1
  282 + console.error(this.coupoobj)
  283 + },
  284 + endActivityeditPool(item,type){
  285 + let that = this
  286 + let form = item
  287 + form.totalAmount = Number(form.totalAmount)
  288 + form.fundsStatus = type
  289 + editPool(form).then(res=>{
  290 + console.error(res)
  291 + if(res.data) {
  292 + that.$message({
  293 + message: '修改成功',
  294 + type: 'success'
  295 + });
  296 + } else{
  297 + that.$message({
  298 + message: '修改失败',
  299 + error: 'success'
  300 + });
  301 + }
  302 + that.search()
  303 + })
  304 + },
156 305 save( ){
  306 + let that = this
  307 + console.error(this.form)
  308 + let form = this.form
  309 + form.totalAmount = Number(form.totalAmount)
  310 + if(this.editForm) {
  311 + editPool(form).then(res=>{
  312 + console.error(res)
  313 + if(res.data) {
  314 + that.$message({
  315 + message: '修改成功',
  316 + type: 'success'
  317 + });
  318 + } else{
  319 + that.$message({
  320 + message: '修改失败',
  321 + error: 'success'
  322 + });
  323 + }
  324 + that.search()
  325 + that.activityVisible =false
  326 + that.form = {
  327 + poolName:'',
  328 + contributor:'',
  329 + totalAmount:null,
  330 + fundsStatus:'0'
  331 + }
  332 + })
  333 + } else {
  334 + addcereFundsPool(form).then(res=>{
  335 + console.error(res)
  336 + if(res.data) {
  337 + that.$message({
  338 + message: '提交成功',
  339 + type: 'success'
  340 + });
  341 + } else{
  342 + that.$message({
  343 + message: '提交失败',
  344 + error: 'success'
  345 + });
  346 + }
  347 + that.search()
  348 + that.activityVisible =false
  349 + that.form = {
  350 + poolName:'',
  351 + contributor:'',
  352 + totalAmount:null,
  353 + fundsStatus:'0'
  354 + }
  355 + })
  356 + }
157 357  
158 358 },
159 359 cancel() {
160   -
  360 + this.activityVisible =false
  361 + this.form = {
  362 + poolName:'',
  363 + contributor:'',
  364 + totalAmount:null,
  365 + fundsStatus:'0'
  366 + }
161 367 },
162 368 async getAll () {
163 369 const res = await getcereFundsPoolData(this.query)
164   - this.tableData = res.data.list
165   - this.total = res.data.total
  370 + this.tableData = res.data.content
  371 + this.total = res.data.numberOfElements
166 372 },
167 373 handleSizeChange (val) {
168 374 this.query.pageSize = val
... ... @@ -189,7 +395,7 @@ export default {
189 395 },
190 396 // 活动详情
191 397 details (row) {
192   - this.activityForm = row
  398 + this.form = row
193 399 this.activityDetailVisible = true
194 400 },
195 401 // 添加活动
... ... @@ -200,7 +406,7 @@ export default {
200 406 // 编辑
201 407 editActivity (row) {
202 408 this.editForm = true
203   - this.activityForm = row
  409 + this.form = row
204 410 this.activityVisible = true
205 411 },
206 412 async endActivity (row) {
... ... @@ -219,19 +425,33 @@ export default {
219 425 this.getAll()
220 426 },
221 427 async delActivity (row) {
222   - const res = await delCoupon({ activityId: row.activityId })
223   - if (res.code === '') {
224   - this.$message({
225   - message: '删除成功',
226   - type: 'success'
227   - })
228   - } else {
229   - this.$message({
230   - message: res.message,
231   - type: 'error'
232   - })
233   - }
234   - this.getAll()
  428 + let that = this
  429 + this.$confirm('此作将永久操删除该文件, 是否继续?', '提示', {
  430 + confirmButtonText: '确定',
  431 + cancelButtonText: '取消',
  432 + type: 'warning'
  433 + }).then(() => {
  434 + delPool({poolId:row.poolId}).then(res=>{
  435 + console.error(res)
  436 + if(res.data) {
  437 + that.$message({
  438 + message: '删除成功',
  439 + type: 'success'
  440 + });
  441 + } else{
  442 + that.$message({
  443 + message: '删除失败',
  444 + error: 'success'
  445 + });
  446 + }
  447 + that.search()
  448 + })
  449 + }).catch(() => {
  450 + this.$message({
  451 + type: 'info',
  452 + message: '已取消删除'
  453 + });
  454 + });
235 455 },
236 456  
237 457 }
... ... @@ -239,6 +459,15 @@ export default {
239 459 </script>
240 460  
241 461 <style scoped lang="scss">
  462 + .el-table{
  463 + height: calc(100vh - 330px);
  464 + }
  465 + .bom {
  466 + margin-top: 40px;
  467 + }
  468 + .el-form-item {
  469 + margin-bottom: 0;
  470 + }
242 471 ::v-deep .el-dialog__header{
243 472 border-bottom: 2px solid #eee;
244 473 background-color: #fff;
... ... @@ -287,8 +516,9 @@ export default {
287 516  
288 517  
289 518 .tableBox{
  519 + text-align: center;
290 520 .fenye{
291   - margin: 20px;
  521 + // margin: 20px;
292 522 }
293 523 }
294 524 }
... ...
admin-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 + border
  36 + >
  37 + <el-table-column label="编号" >
  38 + <template slot-scope="scope">{{ scope.row.id }}</template>
  39 + </el-table-column>
  40 + <el-table-column label="优惠券名称" >
  41 + <template slot-scope="scope">{{ scope.row.couponName }}</template>
  42 + </el-table-column>
  43 + <el-table-column label="类型">
  44 + <template slot-scope="scope">
  45 + <span v-if="scope.row.couponType == '1'">满减券</span>
  46 + <span v-else-if="scope.row.couponType == '2'">折扣券</span>
  47 + </template>
  48 + </el-table-column>
  49 + <el-table-column label="优惠内容">
  50 + <template slot-scope="scope">
  51 + <span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
  52 + <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
  53 + </template>
  54 + </el-table-column>
  55 + <el-table-column label="操作" fixed="right">
  56 + <template slot-scope="scope">
  57 + <div class="btnList">
  58 + <div class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
  59 + <!-- <div class="tableBtn greens" @click="addcoupon(scope.row)">生成优惠券</div> -->
  60 + </div>
  61 + </template>
  62 + </el-table-column>
  63 + </el-table>
  64 + <div style="display: flex;justify-content: space-between;margin: 20px 0;">
  65 + <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
  66 + <el-pagination
  67 + :current-page="query.pageNumber"
  68 + :page-sizes="[10, 20, 50, 100]"
  69 + :page-size="10"
  70 + background
  71 + small
  72 + layout="prev, pager, next"
  73 + :total="total"
  74 + @size-change="handleSizeChange"
  75 + @current-change="handleCurrentChange">
  76 + </el-pagination>
  77 + </div>
  78 + </div>
  79 + </div>
  80 + </div>
  81 +
  82 + </div>
  83 + </template>
  84 +
  85 + <script>
  86 + import { getcereFundsPoolData,addcereFundsPool,delPool,editPool,batchGenerateCoupons}from '@/api/couponmanagement/couponlist.js'
  87 + import router from '@/router';
  88 + import coupon from './coupon.vue';
  89 +
  90 + export default {
  91 +
  92 + components:{
  93 + coupon
  94 + },
  95 + data () {
  96 + return {
  97 + activeName: 'second',
  98 + typelist:[
  99 + {
  100 + num:100,
  101 + type:'资金池总金额',
  102 + color:'#ff5e5e'
  103 + },
  104 + {
  105 + num:100,
  106 + type:'资金池可用金额',
  107 + color:'#ff883a'
  108 + },
  109 + {
  110 + num:100,
  111 + type:'剩余金额',
  112 + color:'#ffc461'
  113 + },
  114 + {
  115 + num:100,
  116 + type:'待核销金额',
  117 + color:'#a467f0'
  118 + },
  119 + ],
  120 + query: {
  121 + activityName: '', // 活动名称
  122 + // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
  123 + state: '',
  124 + pageNumber: 1,
  125 + pageSize: 10
  126 + },
  127 + total: 0,
  128 + tableData: [],
  129 + }
  130 + },
  131 + created () {
  132 + this.getAll()
  133 + },
  134 + methods: {
  135 + handleClick(tab, event) {
  136 + console.log(tab, event);
  137 + },
  138 + xq(e) {
  139 + // 跳转路由
  140 + router.push({
  141 + path: '/other/coupon',
  142 + query: {
  143 + id: e.id
  144 + }
  145 + })
  146 + },
  147 + async getAll () {
  148 + const res = await getcereFundsPoolData(this.query)
  149 + console.error(res.data.content)
  150 + this.tableData = res.data.content
  151 + this.total = res.data.numberOfElements
  152 + },
  153 + handleSizeChange (val) {
  154 + this.query.pageSize = val
  155 + this.getAll()
  156 + },
  157 + handleCurrentChange (val) {
  158 + this.query.pageNumber = val
  159 + this.getAll()
  160 + },
  161 + search () {
  162 + this.total = 1
  163 + this.query.pageNumber = 1
  164 + this.getAll()
  165 + },
  166 + // 重置
  167 + clear () {
  168 + this.query = {
  169 + activityName: '',
  170 + state: '',
  171 + pageNumber: 1,
  172 + pageSize: 10
  173 + }
  174 + this.getAll()
  175 + },
  176 +
  177 + }
  178 + }
  179 + </script>
  180 +
  181 + <style scoped lang="scss">
  182 + ::v-deep .el-form-item {
  183 + margin-bottom: 0;
  184 + }
  185 + ::v-deep .el-tabs__content {
  186 + display: none;
  187 + }
  188 + ::v-deep .el-tabs__item{
  189 + font-size: 16px;
  190 + font-family: "Alibaba PuHuiTi 2.0-55 Regular";
  191 + }
  192 + ::v-deep .el-dialog__header{
  193 + border-bottom: 2px solid #eee;
  194 + background-color: #fff;
  195 + }
  196 + ::v-deep .el-dialog__title {
  197 + color: #303133;
  198 + }
  199 + .footer{
  200 + font-size: 24px;
  201 + .btn_list {
  202 + display: flex;
  203 + flex-direction: row-reverse;
  204 + span {
  205 + padding: 0;
  206 + margin: 0;
  207 + width: 100px;
  208 + height:32px;
  209 + line-height:32px;
  210 + text-align: center;
  211 + display: inline-block;
  212 + font-size: 16px;
  213 + border-radius: 4px;
  214 + box-sizing: border-box;
  215 + &:hover {
  216 + cursor: pointer;
  217 + }
  218 + &:nth-child(1) {
  219 + background: rgba(255, 255, 255, 1);
  220 + order: 1px solid rgba(224, 229, 235, 1);
  221 +
  222 + border: 1px solid rgba(224, 229, 235, 1);
  223 + }
  224 + &:nth-child(2) {
  225 + background: #3f9b6a;
  226 + color: #fff;
  227 + margin-right: 20px;
  228 + }
  229 + }
  230 + }
  231 + }
  232 + .couponPage{
  233 +
  234 + padding: 0 20px 20px 20px;
  235 + min-height: calc(100vh - 50px - 20px);
  236 + background-color: #Fff;
  237 +
  238 +
  239 + .tableBox{
  240 + text-align: center;
  241 + .fenye{
  242 + // margin: 20px;
  243 + }
  244 + }
  245 + }
  246 + .couponDialogBox {
  247 + max-height: 600px;
  248 + overflow-y: auto;
  249 + }
  250 + .formSearch{
  251 +
  252 + display: flex;
  253 + width: 100%;
  254 + font-size: 14px;
  255 + justify-content: space-between;
  256 + // padding-bottom: 10px;
  257 + align-items: center;
  258 + margin: 20px 0;
  259 +
  260 + }
  261 + .tableBtn {
  262 + display: inline-block;
  263 + margin-right: 10px;
  264 + }
  265 +
  266 + .greens {
  267 + color: #3F9B6A;
  268 + }
  269 + ::v-deep .buttonHover:hover{
  270 + color:#3f9b6a !important;
  271 + border-color: #c5e1d2 !important;
  272 + background-color: #ecf5f0 !important;
  273 + outline: none;
  274 + }
  275 + ::v-deep .el-pagination__total {
  276 + position: absolute;
  277 + left: 10px;
  278 + }
  279 + ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{
  280 + background-color:#3f9b6a;
  281 + }
  282 + </style>
... ...
admin-web-master/src/views/couponmanagement/coupon.vue
  1 +<template>
  2 + <div class="addCoupon">
  3 + <!-- 新增优惠券 -->
  4 + <div class="addCouponBox" style="border: 2px solid #eee;padding-right: 30px;padding-top: 30px;padding-bottom: 30px;">
  5 + <div style="padding-bottom: 15px;padding-right: 30px;padding-left: 80px;font-weight: bold;">
  6 + 所需金额:{{ changecouponfrom() }} 元
  7 + </div>
  8 + <el-form ref="ruleForm" class="formBox" :model="couponfrom" label-width="150px" :rules="couponRules">
  9 + <el-form-item label="优惠券名称" prop="couponName">
  10 + <el-input v-model="couponfrom.couponName" placeholder="请输入优惠券名称" onblur="value=value.replace(/(^\s*)|(\s*$)/g, '')" />
  11 + </el-form-item>
  12 + <el-form-item label="优惠券类型">
  13 + <el-radio v-model="couponfrom.couponType" label="1">满减券</el-radio>
  14 + <el-radio v-model="couponfrom.couponType" label="2">折扣券</el-radio>
  15 + </el-form-item>
  16 + <el-form-item v-if="couponfrom.couponType === '1'" class="inputW" label="优惠内容" prop="couponContent">
  17 + 订单满 <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 + </el-form-item>
  19 + <el-form-item v-else class="inputW discount" label="优惠内容" prop="discountContent">
  20 + <span v-if="couponfrom.couponType === '2'" style="margin-right: 10px;">
  21 + 最高优惠金额
  22 + <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
  23 + </span>
  24 + 打 <el-input-number v-model="couponfrom.discountContent" :controls="false" :min="0" :max="9.9" :precision="1" :step="0.1" /> 折
  25 + <label>输入值要大于0 小于10,可保留一位小数</label>
  26 +
  27 + </el-form-item>
  28 + <!-- <el-form-item v-if="couponfrom.couponType === '2'" class="inputW" label="最高优惠金额" prop="maxDiscountAmount">
  29 + <el-input-number v-model="couponfrom.maxDiscountAmount" :controls="false" :min="0" :precision="2" :step="0.01" /> 元
  30 + </el-form-item> -->
  31 + <el-form-item label="可用商品类别:">
  32 + <el-radio-group v-model="useCategory" @change="changeType">
  33 + <el-radio :label="1" >全部</el-radio>
  34 + <el-radio :label="2" >选择类别</el-radio>
  35 + </el-radio-group>
  36 + </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-option
  40 + v-for="item in classList"
  41 + :key="item.classifyId"
  42 + :label="item.classifyName"
  43 + :value="item.classifyId"
  44 + />
  45 + </el-select>
  46 + </el-form-item>
  47 + <el-form-item label="使用范围:">
  48 + <el-radio-group v-model="usedMerchants" >
  49 + <el-radio :label="1" >全平台</el-radio>
  50 + <!-- <el-radio :label="2" >自营</el-radio> -->
  51 + <el-radio :label="3" >部分商家</el-radio>
  52 + </el-radio-group>
  53 + </el-form-item>
  54 + <el-form-item label="选择商家:" v-if="usedMerchants === 3">
  55 + <el-select
  56 + style="width: 100%;"
  57 + multiple
  58 + v-model="couponfrom.usedMerchants"
  59 + placeholder="请选择"
  60 + filterable
  61 + >
  62 + <el-option
  63 + v-for="item in shopList"
  64 + :key="item.shopId"
  65 + :label="item.shopName"
  66 + :value="item.shopId"
  67 + />
  68 + </el-select>
  69 + </el-form-item>
  70 + <div style="display: flex;">
  71 + <el-form-item label="是否开启积分兑换:">
  72 + <el-radio-group v-model="pointsRequired">
  73 + <el-radio :label="1" >是</el-radio>
  74 + <el-radio :label="0" >否</el-radio>
  75 + </el-radio-group>
  76 + </el-form-item>
  77 + <el-form-item v-if="pointsRequired" label="所需积分:">
  78 + <el-input v-model="couponfrom.pointsRequired" type="number" style="width: 150px" /> 分
  79 + </el-form-item>
  80 + </div>
  81 + <el-form-item class="timeDataBox" label="用券时间">
  82 + <el-date-picker
  83 + v-model="dateInfo"
  84 + type="datetimerange"
  85 + range-separator="至"
  86 + start-placeholder="开始日期"
  87 + end-placeholder="结束日期"
  88 + value-format="yyyy-MM-dd HH:mm:ss"
  89 + @change="changeDate"
  90 + />
  91 + </el-form-item>
  92 + <el-form-item class="boxWidth" label="数量" prop="totalCoupons">
  93 + <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 + </el-form-item>
  95 + <el-form-item label="备注">
  96 + <el-input rows="4" v-model="couponfrom.remark" placeholder="请输入备注" type="textarea" />
  97 + </el-form-item>
  98 + </el-form>
  99 + </div>
  100 + </div>
  101 + </template>
  102 +
  103 + <script>
  104 + import { commdityClassGetAll } from '@/api/renovation';
  105 + import {
  106 + businessListGetAll,
  107 +} from '@/api/business'
  108 + export default {
  109 + name: 'AddCoupon',
  110 + props: {
  111 + couponfrom: {
  112 + type: Object,
  113 + default: {},
  114 +
  115 + },
  116 + coupoobj: {
  117 + type: Object,
  118 + default: {
  119 + symon:0
  120 + },
  121 +
  122 + },
  123 + },
  124 + data() {
  125 + return {
  126 + monys:0,
  127 + usedMerchants:1,
  128 + pointsRequired:0,
  129 + dateInfo: null,
  130 + isThreshold: true,
  131 + useCategory:1,
  132 + useCategory2:1,
  133 + classList:[],
  134 + shopList:[],
  135 + couponRules: {
  136 + couponName: [
  137 + { required: true, message: '请输入优惠券名称', trigger: 'blur' }
  138 + ],
  139 + // couponContent: [{ required: true, message: '请输入优惠金额' }],
  140 + dateInfo: [{ type: 'date', required: true, message: '请选择时间' }],
  141 + totalCoupons: [{ required: true, message: '请输入数量', trigger: 'blur' }]
  142 + },
  143 + }
  144 + },
  145 + watch: {
  146 + 'couponfrom.couponType'(val) {
  147 + this.couponfrom.maxDiscountAmount = 0
  148 + this.couponfrom.discountContent = 0
  149 + },
  150 + useCategory(val) {
  151 + if(val == '1') {
  152 + this.couponfrom.useCategory = '全部'
  153 + } else {
  154 + this.couponfrom.useCategory = ''
  155 + }
  156 + },
  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 + }
  166 + },
  167 + pointsRequired(val) {
  168 + if(val == '1') {
  169 + this.couponfrom.pointsRequired = ''
  170 + } else {
  171 + this.couponfrom.pointsRequired = 0
  172 + }
  173 + },
  174 + },
  175 + mounted() {
  176 + this.getAll()
  177 + },
  178 + methods: {
  179 + changeDate(e){
  180 + console.error(e)
  181 + if(e && e.length>0) {
  182 + this.couponfrom.startTime = e[0]
  183 + this.couponfrom.endTime = e[0]
  184 + } else {
  185 + this.couponfrom.startTime = ''
  186 + this.couponfrom.endTime = ''
  187 + }
  188 +
  189 + },
  190 + changecouponfrom() {
  191 + let num = 0
  192 + if(this.couponfrom.couponType == '1') {
  193 + num = (this.couponfrom.discountContent?Number(this.couponfrom.discountContent):0) * (this.couponfrom.totalCoupons?Number(this.couponfrom.totalCoupons):0)
  194 + } else if(this.couponfrom.couponType == '2') {
  195 + num = (this.couponfrom.maxDiscountAmount?Number(this.couponfrom.maxDiscountAmount):0) * (this.couponfrom.totalCoupons?Number(this.couponfrom.totalCoupons):0)
  196 + }
  197 + console.log(num)
  198 + return num
  199 + },
  200 + // 获取类别
  201 + async getAll () {
  202 + const res = await commdityClassGetAll({
  203 + page: 1,
  204 + pageSize: 100
  205 + })
  206 + this.classList = res.data.list
  207 +
  208 + const res1 = await businessListGetAll ({
  209 + page: 1,
  210 + pageSize: 400
  211 + })
  212 + this.shopList = res1.data.list
  213 + },
  214 + changeThreshold(val) { // 输入框值改变
  215 + if (val) {
  216 + this.couponfrom.threshold = 0
  217 + }
  218 + },
  219 + changeType () {
  220 + }
  221 + }
  222 + }
  223 + </script>
  224 + <style lang='scss' scoped>
  225 + //@import url(); 引入公共css类
  226 + @import url("../../styles/elDialog.scss");
  227 + .addCoupon {
  228 + background: #FFFFFF;
  229 + .dialog-footer {
  230 + // margin-left: 300px;
  231 + }
  232 + .formBox {
  233 + .flexBox {
  234 + display: flex;
  235 + }
  236 + .applyType {
  237 + span {
  238 + width: 100px;
  239 + height: 30px;
  240 + line-height: 30px;
  241 + background: #3F9B6A;
  242 + color: #FFFFFF;
  243 + text-align: center;
  244 + display: inline-block;
  245 + font-size: 14px;
  246 + margin-right: 30px;
  247 + border-radius: 4px;
  248 + cursor: pointer;
  249 + position: relative;
  250 + i {
  251 + position: absolute;
  252 + right: -10px;
  253 + top: -10px;
  254 + width: 25px;
  255 + height: 25px;
  256 + line-height: 25px;
  257 + background: #FFFFFF;
  258 + border-radius: 50%;
  259 + border: 1px solid #3F9B6A;
  260 + text-align: center;
  261 + color: #3F9B6A;
  262 + font-style: normal;
  263 + font-size: 12px;
  264 + }
  265 + }
  266 + }
  267 + }
  268 + .footBtnBox {
  269 + width: 100%;
  270 + display: flex;
  271 + justify-content: center;
  272 + margin-top: 50px;
  273 + }
  274 + .dateBox {
  275 + display: flex;
  276 + align-items: center;
  277 + .description {
  278 + width: 59px;
  279 + text-align: center;
  280 + display: block;
  281 + font-size: 14px;
  282 + color: #999999;
  283 + }
  284 + }
  285 + .discount label {
  286 + color: #cccccc;
  287 + font-weight: 500;
  288 + padding-left: 30px;
  289 + }
  290 + }
  291 +
  292 + </style>
  293 + <style scoped>
  294 + .flexBox /deep/ .el-input {
  295 + width: 300px;
  296 + }
  297 + .inputW /deep/ .el-input, .el-input-number {
  298 + width: 100px;
  299 + /* margin: 0 8px; */
  300 + }
  301 + .inputW /deep/ .el-input .el-input__inner {
  302 + text-align: center;
  303 + }
  304 + .inputW /deep/ .el-form-item__error {
  305 + padding-left: 25px;
  306 + }
  307 + .inputW /deep/ .el-checkbox {
  308 + margin-left: 20px;
  309 + }
  310 + .inputW /deep/ .el-radio {
  311 + margin-left: 30px;
  312 + }
  313 + .boxWidth /deep/ .el-input {
  314 + width: 100px;
  315 + margin-right: 15px;
  316 + }
  317 + .boxWidth /deep/ .el-input .el-input__inner {
  318 + text-align: center;
  319 + }
  320 + .addCoupon /deep/ .el-button--primary {
  321 + background: #3F9B6A;
  322 + border-color: #3F9B6A;
  323 + }
  324 + .addCoupon /deep/ .el-dialog__header {
  325 + background-color: #3F9B6A;
  326 + }
  327 + .addCoupon /deep/ .el-dialog__headerbtn .el-dialog__close {
  328 + color: #FFFFFF;
  329 + }
  330 + .addCoupon .timeDataBox /deep/ .el-form-item__content {
  331 + display: flex;
  332 + align-items: center;
  333 + }
  334 + .addCoupon .timeDataBox /deep/ .el-form-item__label {}
  335 + input::-webkit-outer-spin-button,
  336 + input::-webkit-inner-spin-button {
  337 + -webkit-appearance: none;
  338 + }
  339 + input[type="number"]{
  340 + -moz-appearance: textfield;
  341 + }
  342 +
  343 + </style>
  344 +
0 345 \ No newline at end of file
... ...
admin-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 + border
  42 + >
  43 + <el-table-column label="编号" >
  44 + <template slot-scope="scope">{{ scope.row.id }}</template>
  45 + </el-table-column>
  46 + <el-table-column label="优惠券名称" >
  47 + <template slot-scope="scope">{{ scope.row.couponName }}</template>
  48 + </el-table-column>
  49 + <el-table-column label="类型">
  50 + <template slot-scope="scope">
  51 + <span v-if="scope.row.couponType == '1'">满减券</span>
  52 + <span v-else-if="scope.row.couponType == '2'">折扣券</span>
  53 + </template>
  54 + </el-table-column>
  55 + <el-table-column label="优惠内容">
  56 + <template slot-scope="scope">
  57 + <span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
  58 + <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
  59 + </template>
  60 + </el-table-column>
  61 + <el-table-column label="操作" fixed="right">
  62 + <template slot-scope="scope">
  63 + <div class="btnList">
  64 + <div class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
  65 + <!-- <div class="tableBtn greens" @click="addcoupon(scope.row)">生成优惠券</div> -->
  66 + </div>
  67 + </template>
  68 + </el-table-column>
  69 + </el-table>
  70 + <div style="display: flex;justify-content: space-between;margin: 20px 0;">
  71 + <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
  72 + <el-pagination
  73 + :current-page="query.pageNumber"
  74 + :page-sizes="[10, 20, 50, 100]"
  75 + :page-size="10"
  76 + background
  77 + small
  78 + layout="prev, pager, next"
  79 + :total="total"
  80 + @size-change="handleSizeChange"
  81 + @current-change="handleCurrentChange">
  82 + </el-pagination>
  83 + </div>
  84 + </div>
  85 + </div>
  86 + </div>
  87 +
  88 + </div>
  89 + </template>
  90 +
  91 + <script>
  92 + import { getcereFundsPoolData,addcereFundsPool,delPool,editPool,batchGenerateCoupons}from '@/api/couponmanagement/couponlist.js'
  93 + import router from '@/router';
  94 + import coupon from './coupon.vue';
  95 +
  96 + export default {
  97 +
  98 + components:{
  99 + coupon
  100 + },
  101 + data () {
  102 + return {
  103 + activeName: 'second',
  104 + typelist:[
  105 + {
  106 + num:100,
  107 + type:'渠道领用',
  108 + color:'#ff5e5e'
  109 + },
  110 + {
  111 + num:100,
  112 + type:'用户领取',
  113 + color:'#ff883a'
  114 + },
  115 + {
  116 + num:100,
  117 + type:'用户使用',
  118 + color:'#ffc461'
  119 + },
  120 + {
  121 + num:100,
  122 + type:'商家补贴',
  123 + color:'#a467f0'
  124 + },
  125 + ],
  126 + query: {
  127 + activityName: '', // 活动名称
  128 + // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
  129 + state: '',
  130 + pageNumber: 1,
  131 + pageSize: 10
  132 + },
  133 + total: 0,
  134 + tableData: [],
  135 + }
  136 + },
  137 + created () {
  138 + this.getAll()
  139 + },
  140 + methods: {
  141 + handleClick(tab, event) {
  142 + console.log(tab, event);
  143 + },
  144 + xq(e) {
  145 + // 跳转路由
  146 + router.push({
  147 + path: '/other/coupon',
  148 + query: {
  149 + id: e.id
  150 + }
  151 + })
  152 + },
  153 + async getAll () {
  154 + const res = await getcereFundsPoolData(this.query)
  155 + console.error(res.data.content)
  156 + this.tableData = res.data.content
  157 + this.total = res.data.numberOfElements
  158 + },
  159 + handleSizeChange (val) {
  160 + this.query.pageSize = val
  161 + this.getAll()
  162 + },
  163 + handleCurrentChange (val) {
  164 + this.query.pageNumber = val
  165 + this.getAll()
  166 + },
  167 + search () {
  168 + this.total = 1
  169 + this.query.pageNumber = 1
  170 + this.getAll()
  171 + },
  172 + // 重置
  173 + clear () {
  174 + this.query = {
  175 + activityName: '',
  176 + state: '',
  177 + pageNumber: 1,
  178 + pageSize: 10
  179 + }
  180 + this.getAll()
  181 + },
  182 +
  183 + }
  184 + }
  185 + </script>
  186 +
  187 + <style scoped lang="scss">
  188 + ::v-deep .el-form-item {
  189 + margin-bottom: 0;
  190 + }
  191 + ::v-deep .el-tabs__content {
  192 + display: none;
  193 + }
  194 + ::v-deep .el-tabs__item{
  195 + font-size: 16px;
  196 + font-family: "Alibaba PuHuiTi 2.0-55 Regular";
  197 + }
  198 + ::v-deep .el-dialog__header{
  199 + border-bottom: 2px solid #eee;
  200 + background-color: #fff;
  201 + }
  202 + ::v-deep .el-dialog__title {
  203 + color: #303133;
  204 + }
  205 + .footer{
  206 + font-size: 24px;
  207 + .btn_list {
  208 + display: flex;
  209 + flex-direction: row-reverse;
  210 + span {
  211 + padding: 0;
  212 + margin: 0;
  213 + width: 100px;
  214 + height:32px;
  215 + line-height:32px;
  216 + text-align: center;
  217 + display: inline-block;
  218 + font-size: 16px;
  219 + border-radius: 4px;
  220 + box-sizing: border-box;
  221 + &:hover {
  222 + cursor: pointer;
  223 + }
  224 + &:nth-child(1) {
  225 + background: rgba(255, 255, 255, 1);
  226 + order: 1px solid rgba(224, 229, 235, 1);
  227 +
  228 + border: 1px solid rgba(224, 229, 235, 1);
  229 + }
  230 + &:nth-child(2) {
  231 + background: #3f9b6a;
  232 + color: #fff;
  233 + margin-right: 20px;
  234 + }
  235 + }
  236 + }
  237 + }
  238 + .couponPage{
  239 +
  240 + padding: 0 20px 20px 20px;
  241 + min-height: calc(100vh - 50px - 20px);
  242 + background-color: #Fff;
  243 +
  244 +
  245 + .tableBox{
  246 + text-align: center;
  247 + .fenye{
  248 + // margin: 20px;
  249 + }
  250 + }
  251 + }
  252 + .couponDialogBox {
  253 + max-height: 600px;
  254 + overflow-y: auto;
  255 + }
  256 + .formSearch{
  257 +
  258 + display: flex;
  259 + width: 100%;
  260 + font-size: 14px;
  261 + justify-content: space-between;
  262 + // padding-bottom: 10px;
  263 + align-items: center;
  264 + margin: 20px 0;
  265 +
  266 + }
  267 + .tableBtn {
  268 + display: inline-block;
  269 + margin-right: 10px;
  270 + }
  271 +
  272 + .greens {
  273 + color: #3F9B6A;
  274 + }
  275 + ::v-deep .buttonHover:hover{
  276 + color:#3f9b6a !important;
  277 + border-color: #c5e1d2 !important;
  278 + background-color: #ecf5f0 !important;
  279 + outline: none;
  280 + }
  281 + ::v-deep .el-pagination__total {
  282 + position: absolute;
  283 + left: 10px;
  284 + }
  285 + ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{
  286 + background-color:#3f9b6a;
  287 + }
  288 + </style>
... ...
admin-web-master/src/views/couponmanagement/couponlist.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 style="color:#000000e6">优惠券列表</span></div>
  7 + </div>
  8 + <!-- 搜索 -->
  9 + <div class="formSearch">
  10 + <!-- 搜索条件 -->
  11 + <el-form :inline="true" :model="query" class="demo-form-inline">
  12 + <el-form-item label="名称">
  13 + <el-input v-model="query.couponName" placeholder="请输入名称" />
  14 + </el-form-item>
  15 + </el-form>
  16 + <div>
  17 + <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
  18 + <el-button class="buttonHover"
  19 + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="clear">重置</el-button>
  20 + </div>
  21 + </div>
  22 + <!-- 表格 -->
  23 + <div class="tableBox">
  24 + <el-table
  25 + ref="multipleTable"
  26 + :data="tableData"
  27 + :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}"
  28 + tooltip-effect="light"
  29 +
  30 + >
  31 + <el-table-column label="编号" >
  32 + <template slot-scope="scope">{{ scope.row.id }}</template>
  33 + </el-table-column>
  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">
  39 + <span v-if="scope.row.couponType == '1'">满减券</span>
  40 + <span v-else-if="scope.row.couponType == '2'">折扣券</span>
  41 + </template>
  42 + </el-table-column>
  43 + <el-table-column label="优惠内容">
  44 + <template slot-scope="scope">
  45 + <span v-if="scope.row.couponType == '1'">满{{ scope.row.maxDiscountAmount }}减{{ scope.row.discountContent }}</span>
  46 + <span v-else-if="scope.row.couponType == '2'">{{ scope.row.discountContent }}折 最高减{{ scope.row.maxDiscountAmount }}</span>
  47 + </template>
  48 + </el-table-column>
  49 + <el-table-column label="操作" fixed="right">
  50 + <template slot-scope="scope">
  51 + <div class="btnList">
  52 + <div class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
  53 + <!-- <div class="tableBtn greens" @click="addcoupon(scope.row)">生成优惠券</div> -->
  54 + </div>
  55 + </template>
  56 + </el-table-column>
  57 + </el-table>
  58 + <div style="display: flex;justify-content: space-between;" class="bom">
  59 + <div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
  60 + <el-pagination
  61 + :current-page="query.pageNumber"
  62 + :page-sizes="[10, 20, 50, 100]"
  63 + :page-size="10"
  64 + background
  65 + small
  66 + layout="prev, pager, next"
  67 + :total="total"
  68 + @size-change="handleSizeChange"
  69 + @current-change="handleCurrentChange">
  70 + </el-pagination>
  71 + </div>
  72 + </div>
  73 + </div>
  74 + </div>
  75 +
  76 + </div>
  77 + </template>
  78 +
  79 + <script>
  80 + import { getcereFundsPoolData,addcereFundsPool,delPool,editPool,batchGenerateCoupons}from '@/api/couponmanagement/couponlist.js'
  81 + import router from '@/router';
  82 + import coupon from './coupon.vue';
  83 +
  84 + export default {
  85 +
  86 + components:{
  87 + coupon
  88 + },
  89 + data () {
  90 + return {
  91 + couponfrom:{
  92 + usedMerchants:'1',
  93 + couponName: '',
  94 + remark: '',
  95 + couponType: '1', // 默认值
  96 + useCategory: '',
  97 + maxDiscountAmount: null,
  98 + usageThreshold: null,
  99 + discountContent: null,
  100 + isPointsRequired: '否', // 默认值
  101 + pointsRequired: null,
  102 + startTime: '',
  103 + endTime: '',
  104 + totalCoupons: null,
  105 + totalFunds: null,
  106 + createTime: ''
  107 + },
  108 + coupoobj:{},
  109 + type:'1',
  110 + query: {
  111 + activityName: '', // 活动名称
  112 + // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束
  113 + state: '',
  114 + pageNumber: 1,
  115 + pageSize: 10
  116 + },
  117 + total: 0,
  118 + tableData: [],
  119 + activityStatusSelect: [
  120 + {
  121 + index: 0,
  122 + label: '未启用',
  123 + value: 0
  124 + },
  125 + {
  126 + index: 1,
  127 + label: '启用中',
  128 + value: 1
  129 + },
  130 + {
  131 + index: 2,
  132 + label: '已关闭',
  133 + value: 2
  134 + },
  135 + ],
  136 + activityVisible: false,
  137 + editForm: false,
  138 + activityDetailVisible: false,
  139 + form: {
  140 + couponName:'',
  141 + contributor:'',
  142 + totalAmount:null,
  143 + }
  144 + }
  145 + },
  146 + created () {
  147 + this.getAll()
  148 + },
  149 + methods: {
  150 + xq(e) {
  151 + // 跳转路由
  152 + router.push({
  153 + path: '/other/coupon',
  154 + query: {
  155 + id: e.id
  156 + }
  157 + })
  158 + },
  159 + addcoupon(e) {
  160 + let that = this
  161 + console.error(e)
  162 + let from = {
  163 + "totalCoupons":e.totalCoupons, //共多少张优惠券
  164 + "id":e.id, //优惠券id
  165 + "fundPoolId":e.fundPoolId //资金池id
  166 + }
  167 + // return
  168 + batchGenerateCoupons(from).then(res=>{
  169 + console.error(res)
  170 + if(res.code == '200') {
  171 + that.$message({
  172 + message: '生成成功',
  173 + type: 'success'
  174 + });
  175 + that.search()
  176 + } else {
  177 + that.$message({
  178 + message: res.message,
  179 + type: 'error'
  180 + });
  181 + }
  182 + })
  183 + },
  184 + async getAll () {
  185 + const res = await getcereFundsPoolData(this.query)
  186 + console.error(res.data.content)
  187 + this.tableData = res.data.content
  188 + this.total = res.data.numberOfElements
  189 + },
  190 + handleSizeChange (val) {
  191 + this.query.pageSize = val
  192 + this.getAll()
  193 + },
  194 + handleCurrentChange (val) {
  195 + this.query.pageNumber = val
  196 + this.getAll()
  197 + },
  198 + search () {
  199 + this.total = 1
  200 + this.query.pageNumber = 1
  201 + this.getAll()
  202 + },
  203 + // 重置
  204 + clear () {
  205 + this.query = {
  206 + activityName: '',
  207 + state: '',
  208 + pageNumber: 1,
  209 + pageSize: 10
  210 + }
  211 + this.getAll()
  212 + },
  213 +
  214 + }
  215 + }
  216 + </script>
  217 +
  218 + <style scoped lang="scss">
  219 + .el-table{
  220 + height: calc(100vh - 280px);
  221 + }
  222 + .bom {
  223 + margin-top: 40px;
  224 + }
  225 + .el-form-item {
  226 + margin-bottom: 0;
  227 + }
  228 + ::v-deep .el-dialog__header{
  229 + border-bottom: 2px solid #eee;
  230 + background-color: #fff;
  231 + }
  232 + ::v-deep .el-dialog__title {
  233 + color: #303133;
  234 + }
  235 + .footer{
  236 + font-size: 24px;
  237 + .btn_list {
  238 + display: flex;
  239 + flex-direction: row-reverse;
  240 + span {
  241 + padding: 0;
  242 + margin: 0;
  243 + width: 100px;
  244 + height:32px;
  245 + line-height:32px;
  246 + text-align: center;
  247 + display: inline-block;
  248 + font-size: 16px;
  249 + border-radius: 4px;
  250 + box-sizing: border-box;
  251 + &:hover {
  252 + cursor: pointer;
  253 + }
  254 + &:nth-child(1) {
  255 + background: rgba(255, 255, 255, 1);
  256 + order: 1px solid rgba(224, 229, 235, 1);
  257 +
  258 + border: 1px solid rgba(224, 229, 235, 1);
  259 + }
  260 + &:nth-child(2) {
  261 + background: #3f9b6a;
  262 + color: #fff;
  263 + margin-right: 20px;
  264 + }
  265 + }
  266 + }
  267 + }
  268 + .couponPage{
  269 +
  270 + padding: 0 20px 20px 20px;
  271 + min-height: calc(100vh - 50px - 20px);
  272 + background-color: #Fff;
  273 +
  274 +
  275 + .tableBox{
  276 + text-align: center;
  277 +
  278 + .fenye{
  279 + // margin: 20px;
  280 + }
  281 + }
  282 + }
  283 + .couponDialogBox {
  284 + max-height: 600px;
  285 + overflow-y: auto;
  286 + }
  287 + .formSearch{
  288 +
  289 + display: flex;
  290 + width: 100%;
  291 + font-size: 14px;
  292 + justify-content: space-between;
  293 + padding-bottom: 10px;
  294 + align-items: center;
  295 +
  296 + }
  297 + .tableBtn {
  298 + display: inline-block;
  299 + margin-right: 10px;
  300 + }
  301 +
  302 + .greens {
  303 + color: #3F9B6A;
  304 + }
  305 + ::v-deep .buttonHover:hover{
  306 + color:#3f9b6a !important;
  307 + border-color: #c5e1d2 !important;
  308 + background-color: #ecf5f0 !important;
  309 + outline: none;
  310 + }
  311 + ::v-deep .el-pagination__total {
  312 + position: absolute;
  313 + left: 10px;
  314 + }
  315 + ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{
  316 + background-color:#3f9b6a;
  317 + }
  318 + </style>
  319 +
0 320 \ No newline at end of file
... ...