Commit e72f5b2f953f6515c76f0ff1ac4938a060e69866
1 parent
4606dba5
1
Showing
4 changed files
with
424 additions
and
349 deletions
admin-web-master/src/App.vue
admin-web-master/src/views/couponmanagement/capitalpool.vue
| ... | ... | @@ -3,9 +3,10 @@ |
| 3 | 3 | <div class="couponPage" v-show="type == '1'"> |
| 4 | 4 | <div> |
| 5 | 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> | |
| 6 | + <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span | |
| 7 | + style="color:#000000e6">资金池</span></div> | |
| 7 | 8 | </div> |
| 8 | - <!-- 搜索 --> | |
| 9 | + <!-- 搜索 --> | |
| 9 | 10 | <div class="formSearch"> |
| 10 | 11 | <!-- 搜索条件 --> |
| 11 | 12 | <el-form :inline="true" :model="query" class="demo-form-inline"> |
| ... | ... | @@ -14,45 +15,49 @@ |
| 14 | 15 | </el-form-item> |
| 15 | 16 | <el-form-item label="状态"> |
| 16 | 17 | <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 | - /> | |
| 18 | + <el-option v-for="item in activityStatusSelect" :key="item.index" :label="item.label" | |
| 19 | + :value="item.value" /> | |
| 23 | 20 | </el-select> |
| 24 | 21 | </el-form-item> |
| 25 | 22 | </el-form> |
| 26 | 23 | <div> |
| 27 | 24 | <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> | |
| 25 | + <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" | |
| 26 | + @click="clear">重置</el-button> | |
| 30 | 27 | </div> |
| 31 | 28 | </div> |
| 32 | 29 | <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> | |
| 30 | + <el-button icon="el-icon-circle-plus-outline" style="background-color: #3F9B6A;color: #fff;" | |
| 31 | + @click="addActivity">新增</el-button> | |
| 35 | 32 | </div> |
| 36 | 33 | <!-- 表格 --> |
| 37 | 34 | <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="编号" > | |
| 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="编号"> | |
| 45 | 39 | <template slot-scope="scope">{{ scope.row.poolId }}</template> |
| 46 | - </el-table-column> | |
| 47 | - <el-table-column label="资金池名称" > | |
| 40 | + </el-table-column> --> | |
| 41 | + <el-table-column label="资金池名称"> | |
| 48 | 42 | <template slot-scope="scope">{{ scope.row.poolName }}</template> |
| 49 | 43 | </el-table-column> |
| 50 | - <el-table-column label="出资方" > | |
| 44 | + <!-- <el-table-column label="出资方"> | |
| 51 | 45 | <template slot-scope="scope">{{ scope.row.contributor }}</template> |
| 52 | - </el-table-column> | |
| 46 | + </el-table-column> --> | |
| 53 | 47 | <el-table-column label="总金额"> |
| 54 | 48 | <template slot-scope="scope">{{ scope.row.totalAmount }}</template> |
| 55 | 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> | |
| 56 | 61 | <el-table-column label="状态"> |
| 57 | 62 | <template slot-scope="scope"> |
| 58 | 63 | <span v-if="scope.row.fundsStatus == '1'">启用中</span> |
| ... | ... | @@ -65,9 +70,12 @@ |
| 65 | 70 | <div class="btnList"> |
| 66 | 71 | <!-- <div class="tableBtn greens" @click="editActivity(scope.row)">编辑</div> --> |
| 67 | 72 | <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> | |
| 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> | |
| 71 | 79 | <div v-else class="tableBtn greens" @click="endActivityeditPool(scope.row,'1')">开启</div> |
| 72 | 80 | <!-- <div class="tableBtn greens" @click="delActivity(scope.row)">删除</div> --> |
| 73 | 81 | </div> |
| ... | ... | @@ -75,42 +83,32 @@ |
| 75 | 83 | </el-table-column> |
| 76 | 84 | </el-table> |
| 77 | 85 | <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" | |
| 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" | |
| 88 | 89 | @current-change="handleCurrentChange"> |
| 89 | 90 | </el-pagination> |
| 90 | 91 | </div> |
| 91 | 92 | </div> |
| 92 | 93 | |
| 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="资金池名称:"> | |
| 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"> | |
| 102 | 98 | <el-input v-model="form.poolName" placeholder="请输入资金池名称" /> |
| 103 | 99 | </el-form-item> |
| 104 | - <el-form-item label="出资方:"> | |
| 105 | - <el-input v-model="form.contributor" placeholder="请输入出资方" /> | |
| 100 | + <el-form-item label="总金额:" style="margin: 20px 0;" prop="totalAmount"> | |
| 101 | + <el-input v-model.number="form.totalAmount" placeholder="请输入总金额" /> | |
| 106 | 102 | </el-form-item> |
| 107 | - <el-form-item label="总金额:"> | |
| 108 | - <el-input v-model="form.totalAmount" placeholder="请输入总金额" /> | |
| 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="请输入出资方" /> | |
| 109 | 106 | </el-form-item> |
| 110 | 107 | </el-form> |
| 111 | - <div class="footer"> | |
| 108 | + <div class="footer" style="margin-top: 25px;"> | |
| 112 | 109 | <div class="btn_list"> |
| 113 | - <span @click="cancel" class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span> | |
| 110 | + <span @click="cancel" class="buttonHover" | |
| 111 | + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span> | |
| 114 | 112 | <span @click="save" style="background-color: #3F9B6A;color: #fff">保存</span> |
| 115 | 113 | </div> |
| 116 | 114 | </div> |
| ... | ... | @@ -119,16 +117,18 @@ |
| 119 | 117 | </div> |
| 120 | 118 | <div class="couponPage" v-show="type == '2'"> |
| 121 | 119 | <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> | |
| 120 | + <div style="color:#0006"> <span>优惠券管理</span> <span style="padding:0 5px;">></span> <span | |
| 121 | + style="color:#000000e6">创建优惠券</span></div> | |
| 123 | 122 | </div> |
| 124 | 123 | <div style="display: flex;margin-bottom: 10px;"> |
| 125 | 124 | <div>资金池名称:{{ coupoobj.poolName }}</div> |
| 126 | 125 | <div style="margin-left: 30px;font-weight: bold;">总金额:{{ coupoobj.symon }}</div> |
| 127 | 126 | </div> |
| 128 | - <coupon :couponfrom="couponfrom" :coupoobj="coupoobj"/> | |
| 127 | + <coupon :couponfrom="couponfrom" :coupoobj="coupoobj" /> | |
| 129 | 128 | <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> | |
| 129 | + <div class="btn_list" style="margin-top: 30px;"> | |
| 130 | + <span @click="qxcoupon" class="buttonHover" | |
| 131 | + style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</span> | |
| 132 | 132 | <span @click="savecoupon" style="background-color: #3F9B6A;color: #fff">保存</span> |
| 133 | 133 | </div> |
| 134 | 134 | </div> |
| ... | ... | @@ -137,76 +137,106 @@ |
| 137 | 137 | </template> |
| 138 | 138 | |
| 139 | 139 | <script> |
| 140 | -import { getcereFundsPoolData,addcereFundsPool,delPool,editPool,cereCouponMainTable,totalCapitalBalance}from '@/api/couponmanagement/capitalpool.js' | |
| 141 | -import router from '@/router'; | |
| 142 | -import coupon from './coupon.vue'; | |
| 143 | - | |
| 144 | -export default { | |
| 145 | - | |
| 146 | - components:{ | |
| 147 | - coupon | |
| 148 | - }, | |
| 149 | - data () { | |
| 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', | |
| 168 | - query: { | |
| 169 | - activityName: '', // 活动名称 | |
| 170 | - // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束 | |
| 171 | - state: '', | |
| 172 | - pageNumber: 1, | |
| 173 | - pageSize: 10 | |
| 174 | - }, | |
| 175 | - total: 0, | |
| 176 | - tableData: [], | |
| 177 | - activityStatusSelect: [ | |
| 178 | - { | |
| 179 | - index: 0, | |
| 180 | - label: '未启用', | |
| 181 | - value: 0 | |
| 140 | + import { | |
| 141 | + getcereFundsPoolData, | |
| 142 | + addcereFundsPool, | |
| 143 | + delPool, | |
| 144 | + editPool, | |
| 145 | + cereCouponMainTable, | |
| 146 | + totalCapitalBalance | |
| 147 | + } from '@/api/couponmanagement/capitalpool.js' | |
| 148 | + import router from '@/router'; | |
| 149 | + import coupon from './coupon.vue'; | |
| 150 | + | |
| 151 | + export default { | |
| 152 | + | |
| 153 | + components: { | |
| 154 | + coupon | |
| 155 | + }, | |
| 156 | + data() { | |
| 157 | + return { | |
| 158 | + couponRules: { | |
| 159 | + poolName: [{ | |
| 160 | + required: true, | |
| 161 | + message: '请输入资金池名称', | |
| 162 | + trigger: 'blur' | |
| 163 | + }, | |
| 164 | + { | |
| 165 | + min: 0, | |
| 166 | + max: 20, | |
| 167 | + message: '长度不超过20个字符', | |
| 168 | + trigger: 'blur' | |
| 169 | + } | |
| 170 | + ], | |
| 171 | + totalAmount: [{ | |
| 172 | + required: true, | |
| 173 | + message: '请输入总金额', | |
| 174 | + trigger: 'blur' | |
| 175 | + }, ], | |
| 176 | + contributor: [{ | |
| 177 | + required: true, | |
| 178 | + message: '请输入出资方', | |
| 179 | + trigger: 'blur' | |
| 180 | + }, ], | |
| 182 | 181 | }, |
| 183 | - { | |
| 184 | - index: 1, | |
| 185 | - label: '启用中', | |
| 186 | - value: 1 | |
| 182 | + couponfrom: { | |
| 183 | + usedMerchants: '全平台', | |
| 184 | + couponName: '', | |
| 185 | + remark: '', | |
| 186 | + couponType: '1', // 默认值 | |
| 187 | + useCategory: '全部', | |
| 188 | + maxDiscountAmount: null, | |
| 189 | + usageThreshold: null, //使用门槛不用 | |
| 190 | + discountContent: null, | |
| 191 | + pointsRequired: 0, | |
| 192 | + startTime: '', | |
| 193 | + endTime: '', | |
| 194 | + totalCoupons: null, | |
| 195 | + totalFunds: null, | |
| 187 | 196 | }, |
| 188 | - { | |
| 189 | - index: 2, | |
| 190 | - label: '已关闭', | |
| 191 | - value: 2 | |
| 197 | + coupoobj: {}, | |
| 198 | + type: '1', | |
| 199 | + query: { | |
| 200 | + activityName: '', // 活动名称 | |
| 201 | + // 活动状态 0-报名未开始 1-报名进行中 2-活动待开始 3-活动进行中 4-活动已结束 | |
| 202 | + state: '', | |
| 203 | + pageNumber: 1, | |
| 204 | + pageSize: 10 | |
| 192 | 205 | }, |
| 193 | - ], | |
| 194 | - activityVisible: false, | |
| 195 | - editForm: false, | |
| 196 | - activityDetailVisible: false, | |
| 197 | - form: { | |
| 198 | - poolName:'', | |
| 199 | - contributor:'', | |
| 200 | - totalAmount:null, | |
| 201 | - fundsStatus:'0' | |
| 206 | + total: 0, | |
| 207 | + tableData: [], | |
| 208 | + activityStatusSelect: [{ | |
| 209 | + index: 0, | |
| 210 | + label: '未启用', | |
| 211 | + value: 0 | |
| 212 | + }, | |
| 213 | + { | |
| 214 | + index: 1, | |
| 215 | + label: '启用中', | |
| 216 | + value: 1 | |
| 217 | + }, | |
| 218 | + { | |
| 219 | + index: 2, | |
| 220 | + label: '已关闭', | |
| 221 | + value: 2 | |
| 222 | + }, | |
| 223 | + ], | |
| 224 | + activityVisible: false, | |
| 225 | + editForm: false, | |
| 226 | + activityDetailVisible: false, | |
| 227 | + form: { | |
| 228 | + poolName: '', | |
| 229 | + contributor: '', | |
| 230 | + totalAmount: null, | |
| 231 | + fundsStatus: '0' | |
| 232 | + } | |
| 202 | 233 | } |
| 203 | - } | |
| 204 | - }, | |
| 205 | - created () { | |
| 206 | - this.getAll() | |
| 207 | - }, | |
| 208 | - methods: { | |
| 209 | - xq(e) { | |
| 234 | + }, | |
| 235 | + created() { | |
| 236 | + this.getAll() | |
| 237 | + }, | |
| 238 | + methods: { | |
| 239 | + xq(e) { | |
| 210 | 240 | // 跳转路由 |
| 211 | 241 | router.push({ |
| 212 | 242 | path: '/other/capitalpoolinfo', |
| ... | ... | @@ -214,231 +244,249 @@ export default { |
| 214 | 244 | id: e.id |
| 215 | 245 | } |
| 216 | 246 | }) |
| 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=>{ | |
| 247 | + }, | |
| 248 | + savecoupon() { | |
| 249 | + let that = this | |
| 250 | + let c1 = this.changecouponfrom() | |
| 251 | + console.error(c1) | |
| 252 | + console.error(this.coupoobj) | |
| 253 | + let from = this.couponfrom | |
| 254 | + from.fundPoolId = this.coupoobj.poolId | |
| 255 | + from.totalFunds = c1 | |
| 256 | + if (c1 > this.coupoobj.symon) { | |
| 257 | + that.$message({ | |
| 258 | + message: '金额不足', | |
| 259 | + error: 'error' | |
| 260 | + }); | |
| 261 | + return | |
| 262 | + } | |
| 263 | + from.maxDiscountAmount = Number(from.maxDiscountAmount) | |
| 264 | + from.discountContent = Number(from.discountContent) | |
| 265 | + from.pointsRequired = Number(from.pointsRequired) | |
| 266 | + from.totalCoupons = Number(from.totalCoupons) | |
| 267 | + console.error({ | |
| 268 | + ...from | |
| 269 | + }) | |
| 270 | + console.error(JSON.stringify(from)) | |
| 271 | + cereCouponMainTable(from).then(res => { | |
| 240 | 272 | console.error(res) |
| 241 | - if(res.data) { | |
| 273 | + if (res.data) { | |
| 242 | 274 | that.$message({ |
| 243 | 275 | message: '提交成功', |
| 244 | 276 | type: 'success' |
| 245 | 277 | }); |
| 246 | - } else{ | |
| 278 | + } else { | |
| 247 | 279 | that.$message({ |
| 248 | 280 | message: '提交失败', |
| 249 | 281 | error: 'success' |
| 250 | 282 | }); |
| 251 | 283 | } |
| 252 | - setTimeout(()=>{ | |
| 284 | + setTimeout(() => { | |
| 253 | 285 | that.type = '1' |
| 254 | - },2000) | |
| 286 | + }, 2000) | |
| 255 | 287 | }) |
| 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=>{ | |
| 288 | + }, | |
| 289 | + changecouponfrom() { | |
| 290 | + let num = 0 | |
| 291 | + if (this.couponfrom.couponType == '1') { | |
| 292 | + num = (this.couponfrom.discountContent ? Number(this.couponfrom.discountContent) : 0) * (this.couponfrom | |
| 293 | + .totalCoupons ? Number(this.couponfrom.totalCoupons) : 0) | |
| 294 | + } else if (this.couponfrom.couponType == '2') { | |
| 295 | + num = (this.couponfrom.maxDiscountAmount ? Number(this.couponfrom.maxDiscountAmount) : 0) * (this.couponfrom | |
| 296 | + .totalCoupons ? Number(this.couponfrom.totalCoupons) : 0) | |
| 297 | + } | |
| 298 | + return num | |
| 299 | + }, | |
| 300 | + qxcoupon() { | |
| 301 | + this.type = '1' | |
| 302 | + }, | |
| 303 | + async addcoupon(e) { | |
| 304 | + let that = this | |
| 305 | + | |
| 306 | + let c1 = { | |
| 307 | + symon: 0, | |
| 308 | + ...e | |
| 309 | + } | |
| 310 | + await totalCapitalBalance({ | |
| 311 | + poolId: e.poolId | |
| 312 | + }).then(res => { | |
| 290 | 313 | 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 | - }, | |
| 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=>{ | |
| 314 | + c1.symon = res.data | |
| 315 | + }) | |
| 316 | + this.type = '2' | |
| 317 | + this.coupoobj = c1 | |
| 318 | + console.error(this.coupoobj) | |
| 319 | + }, | |
| 320 | + endActivityeditPool(item, type) { | |
| 321 | + let that = this | |
| 322 | + let form = item | |
| 323 | + form.totalAmount = Number(form.totalAmount) | |
| 324 | + form.fundsStatus = type | |
| 325 | + editPool(form).then(res => { | |
| 312 | 326 | console.error(res) |
| 313 | - if(res.data) { | |
| 327 | + if (res.data) { | |
| 314 | 328 | that.$message({ |
| 315 | 329 | message: '修改成功', |
| 316 | 330 | type: 'success' |
| 317 | 331 | }); |
| 318 | - } else{ | |
| 332 | + } else { | |
| 319 | 333 | that.$message({ |
| 320 | 334 | message: '修改失败', |
| 321 | 335 | error: 'success' |
| 322 | 336 | }); |
| 323 | 337 | } |
| 324 | 338 | that.search() |
| 325 | - that.activityVisible =false | |
| 326 | - that.form = { | |
| 327 | - poolName:'', | |
| 328 | - contributor:'', | |
| 329 | - totalAmount:null, | |
| 330 | - fundsStatus:'0' | |
| 331 | - } | |
| 332 | 339 | }) |
| 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' | |
| 340 | + }, | |
| 341 | + save() { | |
| 342 | + let that = this | |
| 343 | + console.error(this.form) | |
| 344 | + let form = this.form | |
| 345 | + that.$refs.form.validate((valid) => { | |
| 346 | + if (valid) { | |
| 347 | + form.totalAmount = Number(form.totalAmount) | |
| 348 | + if (that.editForm) { | |
| 349 | + editPool(form).then(res => { | |
| 350 | + // console.error(res) | |
| 351 | + if (res.data) { | |
| 352 | + that.$message({ | |
| 353 | + message: '修改成功', | |
| 354 | + type: 'success' | |
| 355 | + }); | |
| 356 | + } else { | |
| 357 | + that.$message({ | |
| 358 | + message: '修改失败', | |
| 359 | + error: 'success' | |
| 360 | + }); | |
| 361 | + } | |
| 362 | + that.search() | |
| 363 | + that.activityVisible = false | |
| 364 | + that.form = { | |
| 365 | + poolName: '', | |
| 366 | + contributor: '', | |
| 367 | + totalAmount: null, | |
| 368 | + fundsStatus: '0' | |
| 369 | + } | |
| 370 | + }) | |
| 371 | + } else { | |
| 372 | + addcereFundsPool(form).then(res => { | |
| 373 | + // console.error(res) | |
| 374 | + if (res.data) { | |
| 375 | + that.$message({ | |
| 376 | + message: '提交成功', | |
| 377 | + type: 'success' | |
| 378 | + }); | |
| 379 | + } else { | |
| 380 | + that.$message({ | |
| 381 | + message: '提交失败', | |
| 382 | + error: 'success' | |
| 383 | + }); | |
| 384 | + } | |
| 385 | + that.search() | |
| 386 | + that.activityVisible = false | |
| 387 | + that.form = { | |
| 388 | + poolName: '', | |
| 389 | + contributor: '', | |
| 390 | + totalAmount: null, | |
| 391 | + fundsStatus: '0' | |
| 392 | + } | |
| 393 | + }) | |
| 394 | + } | |
| 395 | + } else { | |
| 396 | + console.log('error submit!!'); | |
| 397 | + return false; | |
| 354 | 398 | } |
| 355 | - }) | |
| 356 | - } | |
| 399 | + }); | |
| 357 | 400 | |
| 358 | - }, | |
| 359 | - cancel() { | |
| 360 | - this.activityVisible =false | |
| 361 | - this.form = { | |
| 362 | - poolName:'', | |
| 363 | - contributor:'', | |
| 364 | - totalAmount:null, | |
| 365 | - fundsStatus:'0' | |
| 366 | - } | |
| 367 | - }, | |
| 368 | - async getAll () { | |
| 369 | - const res = await getcereFundsPoolData(this.query) | |
| 370 | - this.tableData = res.data.content | |
| 371 | - this.total = res.data.numberOfElements | |
| 372 | - }, | |
| 373 | - handleSizeChange (val) { | |
| 374 | - this.query.pageSize = val | |
| 375 | - this.getAll() | |
| 376 | - }, | |
| 377 | - handleCurrentChange (val) { | |
| 378 | - this.query.pageNumber = val | |
| 379 | - this.getAll() | |
| 380 | - }, | |
| 381 | - search () { | |
| 382 | - this.total = 1 | |
| 383 | - this.query.pageNumber = 1 | |
| 384 | - this.getAll() | |
| 385 | - }, | |
| 386 | - // 重置 | |
| 387 | - clear () { | |
| 388 | - this.query = { | |
| 389 | - activityName: '', | |
| 390 | - state: '', | |
| 391 | - pageNumber: 1, | |
| 392 | - pageSize: 10 | |
| 393 | - } | |
| 394 | - this.getAll() | |
| 395 | - }, | |
| 396 | - // 活动详情 | |
| 397 | - details (row) { | |
| 398 | - this.form = row | |
| 399 | - this.activityDetailVisible = true | |
| 400 | - }, | |
| 401 | - // 添加活动 | |
| 402 | - addActivity () { | |
| 403 | - this.editForm = false | |
| 404 | - this.activityVisible = true | |
| 405 | - }, | |
| 406 | - // 编辑 | |
| 407 | - editActivity (row) { | |
| 408 | - this.editForm = true | |
| 409 | - this.form = row | |
| 410 | - this.activityVisible = true | |
| 411 | - }, | |
| 412 | - async endActivity (row) { | |
| 413 | - const res = await endCoupon({ activityId: row.activityId }) | |
| 414 | - if (res.code === '') { | |
| 415 | - this.$message({ | |
| 416 | - message: '结束成功', | |
| 417 | - type: 'success' | |
| 418 | - }) | |
| 419 | - } else { | |
| 420 | - this.$message({ | |
| 421 | - message: res.message, | |
| 422 | - type: 'error' | |
| 401 | + | |
| 402 | + }, | |
| 403 | + cancel() { | |
| 404 | + this.activityVisible = false | |
| 405 | + this.form = { | |
| 406 | + poolName: '', | |
| 407 | + contributor: '', | |
| 408 | + totalAmount: null, | |
| 409 | + fundsStatus: '0' | |
| 410 | + } | |
| 411 | + }, | |
| 412 | + async getAll() { | |
| 413 | + const res = await getcereFundsPoolData(this.query) | |
| 414 | + this.tableData = res.data.content | |
| 415 | + this.total = res.data.numberOfElements | |
| 416 | + }, | |
| 417 | + handleSizeChange(val) { | |
| 418 | + this.query.pageSize = val | |
| 419 | + this.getAll() | |
| 420 | + }, | |
| 421 | + handleCurrentChange(val) { | |
| 422 | + this.query.pageNumber = val | |
| 423 | + this.getAll() | |
| 424 | + }, | |
| 425 | + search() { | |
| 426 | + this.total = 1 | |
| 427 | + this.query.pageNumber = 1 | |
| 428 | + this.getAll() | |
| 429 | + }, | |
| 430 | + // 重置 | |
| 431 | + clear() { | |
| 432 | + this.query = { | |
| 433 | + activityName: '', | |
| 434 | + state: '', | |
| 435 | + pageNumber: 1, | |
| 436 | + pageSize: 10 | |
| 437 | + } | |
| 438 | + this.getAll() | |
| 439 | + }, | |
| 440 | + // 活动详情 | |
| 441 | + details(row) { | |
| 442 | + this.form = row | |
| 443 | + this.activityDetailVisible = true | |
| 444 | + }, | |
| 445 | + // 添加活动 | |
| 446 | + addActivity() { | |
| 447 | + this.editForm = false | |
| 448 | + this.activityVisible = true | |
| 449 | + }, | |
| 450 | + // 编辑 | |
| 451 | + editActivity(row) { | |
| 452 | + this.editForm = true | |
| 453 | + this.form = row | |
| 454 | + this.activityVisible = true | |
| 455 | + }, | |
| 456 | + async endActivity(row) { | |
| 457 | + const res = await endCoupon({ | |
| 458 | + activityId: row.activityId | |
| 423 | 459 | }) |
| 424 | - } | |
| 425 | - this.getAll() | |
| 426 | - }, | |
| 427 | - async delActivity (row) { | |
| 428 | - let that = this | |
| 429 | - this.$confirm('此作将永久操删除该文件, 是否继续?', '提示', { | |
| 460 | + if (res.code === '') { | |
| 461 | + this.$message({ | |
| 462 | + message: '结束成功', | |
| 463 | + type: 'success' | |
| 464 | + }) | |
| 465 | + } else { | |
| 466 | + this.$message({ | |
| 467 | + message: res.message, | |
| 468 | + type: 'error' | |
| 469 | + }) | |
| 470 | + } | |
| 471 | + this.getAll() | |
| 472 | + }, | |
| 473 | + async delActivity(row) { | |
| 474 | + let that = this | |
| 475 | + this.$confirm('此作将永久操删除该文件, 是否继续?', '提示', { | |
| 430 | 476 | confirmButtonText: '确定', |
| 431 | 477 | cancelButtonText: '取消', |
| 432 | 478 | type: 'warning' |
| 433 | 479 | }).then(() => { |
| 434 | - delPool({poolId:row.poolId}).then(res=>{ | |
| 480 | + delPool({ | |
| 481 | + poolId: row.poolId | |
| 482 | + }).then(res => { | |
| 435 | 483 | console.error(res) |
| 436 | - if(res.data) { | |
| 484 | + if (res.data) { | |
| 437 | 485 | that.$message({ |
| 438 | 486 | message: '删除成功', |
| 439 | 487 | type: 'success' |
| 440 | 488 | }); |
| 441 | - } else{ | |
| 489 | + } else { | |
| 442 | 490 | that.$message({ |
| 443 | 491 | message: '删除失败', |
| 444 | 492 | error: 'success' |
| ... | ... | @@ -450,56 +498,67 @@ export default { |
| 450 | 498 | this.$message({ |
| 451 | 499 | type: 'info', |
| 452 | 500 | message: '已取消删除' |
| 453 | - }); | |
| 501 | + }); | |
| 454 | 502 | }); |
| 455 | - }, | |
| 503 | + }, | |
| 456 | 504 | |
| 505 | + } | |
| 457 | 506 | } |
| 458 | -} | |
| 459 | 507 | </script> |
| 460 | 508 | |
| 461 | 509 | <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 | - } | |
| 471 | - ::v-deep .el-dialog__header{ | |
| 510 | + | |
| 511 | + .el-table { | |
| 512 | + height: calc(100vh - 330px); | |
| 513 | + } | |
| 514 | + | |
| 515 | + .bom { | |
| 516 | + margin-top: 40px; | |
| 517 | + } | |
| 518 | + | |
| 519 | + .el-form-item { | |
| 520 | + margin-bottom: 0; | |
| 521 | + } | |
| 522 | + | |
| 523 | + ::v-deep .el-dialog__header { | |
| 472 | 524 | border-bottom: 2px solid #eee; |
| 473 | 525 | background-color: #fff; |
| 474 | 526 | } |
| 527 | + | |
| 475 | 528 | ::v-deep .el-dialog__title { |
| 476 | 529 | color: #303133; |
| 477 | 530 | } |
| 478 | - .footer{ | |
| 531 | + | |
| 532 | + .footer { | |
| 479 | 533 | font-size: 24px; |
| 534 | + | |
| 480 | 535 | .btn_list { |
| 481 | 536 | display: flex; |
| 482 | 537 | flex-direction: row-reverse; |
| 538 | + | |
| 483 | 539 | span { |
| 484 | 540 | padding: 0; |
| 485 | 541 | margin: 0; |
| 486 | 542 | width: 100px; |
| 487 | - height:32px; | |
| 488 | - line-height:32px; | |
| 543 | + height: 32px; | |
| 544 | + line-height: 32px; | |
| 489 | 545 | text-align: center; |
| 490 | 546 | display: inline-block; |
| 491 | 547 | font-size: 16px; |
| 492 | 548 | border-radius: 4px; |
| 493 | 549 | box-sizing: border-box; |
| 550 | + | |
| 494 | 551 | &:hover { |
| 495 | 552 | cursor: pointer; |
| 496 | 553 | } |
| 554 | + | |
| 497 | 555 | &:nth-child(1) { |
| 498 | 556 | background: rgba(255, 255, 255, 1); |
| 499 | 557 | order: 1px solid rgba(224, 229, 235, 1); |
| 500 | - | |
| 558 | + | |
| 501 | 559 | border: 1px solid rgba(224, 229, 235, 1); |
| 502 | 560 | } |
| 561 | + | |
| 503 | 562 | &:nth-child(2) { |
| 504 | 563 | background: #3f9b6a; |
| 505 | 564 | color: #fff; |
| ... | ... | @@ -508,25 +567,29 @@ export default { |
| 508 | 567 | } |
| 509 | 568 | } |
| 510 | 569 | } |
| 511 | -.couponPage{ | |
| 512 | 570 | |
| 513 | - padding: 0 20px 20px 20px; | |
| 514 | - min-height: calc(100vh - 50px - 20px); | |
| 515 | - background-color: #Fff; | |
| 571 | + .couponPage { | |
| 572 | + | |
| 573 | + padding: 0 20px 20px 20px; | |
| 574 | + min-height: calc(100vh - 50px - 20px); | |
| 575 | + background-color: #Fff; | |
| 516 | 576 | |
| 517 | 577 | |
| 518 | - .tableBox{ | |
| 519 | - text-align: center; | |
| 520 | - .fenye{ | |
| 521 | - // margin: 20px; | |
| 578 | + .tableBox { | |
| 579 | + text-align: center; | |
| 580 | + | |
| 581 | + .fenye { | |
| 582 | + // margin: 20px; | |
| 583 | + } | |
| 522 | 584 | } |
| 523 | 585 | } |
| 524 | -} | |
| 525 | -.couponDialogBox { | |
| 526 | - max-height: 600px; | |
| 527 | - overflow-y: auto; | |
| 528 | -} | |
| 529 | -.formSearch{ | |
| 586 | + | |
| 587 | + .couponDialogBox { | |
| 588 | + max-height: 600px; | |
| 589 | + overflow-y: auto; | |
| 590 | + } | |
| 591 | + | |
| 592 | + .formSearch { | |
| 530 | 593 | |
| 531 | 594 | display: flex; |
| 532 | 595 | width: 100%; |
| ... | ... | @@ -535,26 +598,30 @@ export default { |
| 535 | 598 | padding-bottom: 10px; |
| 536 | 599 | align-items: center; |
| 537 | 600 | |
| 538 | -} | |
| 601 | + } | |
| 602 | + | |
| 539 | 603 | .tableBtn { |
| 540 | 604 | display: inline-block; |
| 541 | 605 | margin-right: 10px; |
| 542 | 606 | } |
| 543 | 607 | |
| 544 | -.greens { | |
| 608 | + .greens { | |
| 545 | 609 | color: #3F9B6A; |
| 546 | 610 | } |
| 547 | - ::v-deep .buttonHover:hover{ | |
| 548 | - color:#3f9b6a !important; | |
| 611 | + | |
| 612 | + ::v-deep .buttonHover:hover { | |
| 613 | + color: #3f9b6a !important; | |
| 549 | 614 | border-color: #c5e1d2 !important; |
| 550 | 615 | background-color: #ecf5f0 !important; |
| 551 | 616 | outline: none; |
| 552 | 617 | } |
| 618 | + | |
| 553 | 619 | ::v-deep .el-pagination__total { |
| 554 | 620 | position: absolute; |
| 555 | 621 | left: 10px; |
| 556 | 622 | } |
| 557 | - ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{ | |
| 558 | - background-color:#3f9b6a; | |
| 623 | + | |
| 624 | + ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active { | |
| 625 | + background-color: #3f9b6a; | |
| 559 | 626 | } |
| 560 | 627 | </style> | ... | ... |
admin-web-master/src/views/couponmanagement/capitalpoolinfo.vue
| ... | ... | @@ -32,7 +32,6 @@ |
| 32 | 32 | :data="tableData" |
| 33 | 33 | :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}" |
| 34 | 34 | tooltip-effect="light" |
| 35 | - border | |
| 36 | 35 | > |
| 37 | 36 | <el-table-column label="编号" > |
| 38 | 37 | <template slot-scope="scope">{{ scope.row.id }}</template> |
| ... | ... | @@ -75,6 +74,9 @@ |
| 75 | 74 | @current-change="handleCurrentChange"> |
| 76 | 75 | </el-pagination> |
| 77 | 76 | </div> |
| 77 | + <div style="display: flex;"> | |
| 78 | + <router-link to="/other/capitalpoolinfo"> <el-button class="buttonHover" style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" >返回</el-button></router-link> | |
| 79 | + </div> | |
| 78 | 80 | </div> |
| 79 | 81 | </div> |
| 80 | 82 | </div> | ... | ... |
admin-web-master/src/views/couponmanagement/couponinfo.vue
| ... | ... | @@ -38,7 +38,6 @@ |
| 38 | 38 | :data="tableData" |
| 39 | 39 | :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#f5f8f9'}" |
| 40 | 40 | tooltip-effect="light" |
| 41 | - border | |
| 42 | 41 | > |
| 43 | 42 | <el-table-column label="编号" > |
| 44 | 43 | <template slot-scope="scope">{{ scope.row.id }}</template> |
| ... | ... | @@ -81,10 +80,13 @@ |
| 81 | 80 | @current-change="handleCurrentChange"> |
| 82 | 81 | </el-pagination> |
| 83 | 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> | |
| 84 | 86 | </div> |
| 85 | 87 | </div> |
| 86 | 88 | </div> |
| 87 | - | |
| 89 | + | |
| 88 | 90 | </div> |
| 89 | 91 | </template> |
| 90 | 92 | ... | ... |