capitalpoolinfo.vue 10.1 KB
<template>
    <div >
      <div style="display: flex;margin-bottom: 10px;">
            <!-- <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;">
              <div style="font-size: 14px;color: #a8abb2;">{{item.type}}</div>
              <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{item.num}}</div>
            </div> -->
            <div style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
              <div style="font-size: 14px;color: #a8abb2;">资金池总金额</div>
              <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{Number(info.totalAmount)/100 || 0}}</div>
            </div>
            <div style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
              <div style="font-size: 14px;color: #a8abb2;">资金池可用金额</div>
              <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{Number(info.availableAmount)/100 || 0}}</div>
            </div>
            <div style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
              <div style="font-size: 14px;color: #a8abb2;">资金池剩余金额</div>
              <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{Number(info.remainingAmount)/100 || 0}}</div>
            </div>
            <div style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
              <div style="font-size: 14px;color: #a8abb2;">资金池已核销金额</div>
              <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{ Number(info.verifiedAmount)/100 || 0}}</div>
            </div>
            <div style="width: 30%;margin-right: 3%;text-align: center;padding: 20px 0;border-radius: 3px;border: 2px solid #eee;">
              <div style="font-size: 14px;color: #a8abb2;">资金池待核销金额</div>
              <div style="font-size: 22px;margin-top: 10px;color: rgb(63, 155, 106);">{{Number(info.pendingVerificationAmount)/100 || 0}}</div>
            </div>
          </div>
            <!-- 搜索 -->
          <div class="formSearch">
            <el-form :inline="true" :model="query" class="demo-form-inline">
              <el-form-item label="名称">
                <el-input v-model="query.couponName" placeholder="请输入名称" />
              </el-form-item>
            </el-form>
            <div>
              <el-button style="background-color: #3F9B6A;color: #fff" @click="search">查询</el-button>
              <el-button  class="buttonHover"
                  style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;" @click="clear">重置</el-button>
            </div>
          </div>
          <!-- 表格 -->
          <div class="tableBox">
            <el-table
              ref="multipleTable"
              :data="tableData"
            :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
              tooltip-effect="light"
            >
              <el-table-column label="优惠券名称" >
                <template slot-scope="scope">{{ scope.row.couponName }}</template>
              </el-table-column>
              <el-table-column label="资金池" >
                <template slot-scope="scope">{{ scope.row.cereFundsPool?scope.row.cereFundsPool.poolName:'' }}</template>
              </el-table-column>
              <el-table-column label="类型">
                <template slot-scope="scope">
                  <span v-if="scope.row.couponType == '1'">满减券</span>
                  <span v-else-if="scope.row.couponType == '2'">折扣券</span>
                </template>
              </el-table-column>
              <el-table-column label="优惠内容">
                <template slot-scope="scope">
                  <span v-if="scope.row.couponType == '1'">满{{Number(scope.row.usageThreshold)/100 }}减{{Number(scope.row.discountContent)/100}}</span>
                  <span v-else-if="scope.row.couponType == '2'">{{scope.row.discountContent}}折 最高减{{Number(scope.row.maxDiscountAmount)/100}}</span>
                </template>
              </el-table-column>
              <el-table-column label="金额" >
                <template slot-scope="scope">{{Number(scope.row.totalFunds)/100 }}</template>
              </el-table-column>
              <el-table-column label="数量" >
                <template slot-scope="scope">{{ scope.row.totalCoupons }}</template>
              </el-table-column>
              <el-table-column label="操作" fixed="right">
                <template slot-scope="scope">
                  <div class="btnList">
                    <div class="tableBtn greens" @click="xq(scope.row)">查看详情</div>
                    <!-- <div class="tableBtn greens"  @click="addcoupon(scope.row)">生成优惠券</div> -->
                  </div>
                </template>
              </el-table-column>
            </el-table>
            <div style="display: flex;justify-content: space-between;margin: 20px 0;">
              <div style="font-size: 14px;">共  <span style="color: #3F9B6A;">{{total}}</span>  项数据</div>
              <el-pagination
                :current-page="query.pageNumber+1"
                :page-sizes="[10, 20, 50, 100]"
                :page-size="10"
                background
                small
                layout="prev, pager, next"
                :total="total"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange">
              </el-pagination>
            </div>
          </div>

    </div>
  </template>

  <script>
  import { getcereFundsPoolData,fundPoolStatistics}from '@/api/couponmanagement/couponlist.js'
  import router from '@/router';
  import coupon from './coupon.vue';

  export default {

    components:{
      coupon
    },
    data () {
      return {
       activeName: 'second',
        typelist:[
          {
            num:100,
            type:'资金池总金额',
            color:'#ff5e5e'
          },
          {
            num:100,
            type:'资金池可用金额',
            color:'#ff883a'
          },
          {
            num:100,
            type:'剩余金额',
            color:'#ffc461'
          },
          {
            num:100,
            type:'待核销金额',
            color:'#a467f0'
          },
        ],
        query: {
          couponName: '', //名称
          pageNumber: 0,
          pageSize: 10
        },
        fundPoolId:'',
        total: 0,
        tableData: [],
        info:{}
      }
    },
    created () {
      
      
    },
    methods: {
      handleClick(tab, event) {
        console.log(tab, event);
      },
      xq(e) {
        this.$emit('changecouponid',e)
      },
      int(e) {
        this.fundPoolId = e
        fundPoolStatistics({poolId:this.fundPoolId}).then(res=>{
          console.error(res)
          this.info = res.data
        })
        this.clear()
      },
      async getAll () {
        console.error(this.fundPoolId)
        const res = await getcereFundsPoolData({fundPoolId:this.fundPoolId,...this.query})
        console.error(res.data.content)
        this.tableData = res.data.content
        this.total = res.data.numberOfElements
      },
      handleSizeChange (val) {
        this.query.pageSize = val
        this.getAll()
      },
      handleCurrentChange (val) {
        this.query.pageNumber = val-1
        this.getAll()
      },
      search () {
        this.total = 1
        this.query.pageNumber = 0
        this.getAll()
      },
      // 重置
      clear () {
        this.query = {
          couponName: '', //名称
          pageNumber: 0,
          pageSize: 10
        }
        this.getAll()
      },

    }
  }
  </script>

  <style scoped lang="scss">
  ::v-deep .el-form-item {
    margin-bottom: 0;
  }
  ::v-deep .el-tabs__content {
    display: none;
  }
    ::v-deep .el-tabs__item{
      font-size: 16px;
      font-family: "Alibaba PuHuiTi 2.0-55 Regular";
    }
    ::v-deep .el-dialog__header{
      border-bottom: 2px solid #eee;
      background-color: #fff;
    }
    ::v-deep .el-dialog__title {
      color: #303133;
    }
    .footer{
      font-size: 24px;
      .btn_list {
        display: flex;
        flex-direction: row-reverse;
        span {
          padding: 0;
          margin: 0;
          width: 100px;
          height:32px;
          line-height:32px;
          text-align: center;
          display: inline-block;
          font-size: 16px;
          border-radius: 4px;
          box-sizing: border-box;
          &:hover {
            cursor: pointer;
          }
          &:nth-child(1) {
            background: rgba(255, 255, 255, 1);
            order: 1px solid rgba(224, 229, 235, 1);

            border: 1px solid rgba(224, 229, 235, 1);
          }
          &:nth-child(2) {
            background: #3f9b6a;
            color: #fff;
            margin-right: 20px;
          }
        }
      }
    }
  .couponPage{

     padding: 0  20px 20px 20px;
     min-height: calc(100vh - 50px - 20px);
     background-color: #Fff;


    .tableBox{
      text-align: center;
      .fenye{
        // margin: 20px;
      }
    }
  }
  .couponDialogBox {
    max-height: 600px;
    overflow-y: auto;
  }
  .formSearch{

      display: flex;
      width: 100%;
      font-size: 14px;
      justify-content: space-between;
      // padding-bottom: 10px;
      align-items: center;
      margin: 20px 0;

  }
    .tableBtn {
      display: inline-block;
      margin-right: 10px;
    }

  .greens {
      color: #3F9B6A;
    }
    ::v-deep .buttonHover:hover{
      color:#3f9b6a !important;
      border-color: #c5e1d2 !important;
      background-color: #ecf5f0 !important;
      outline: none;
    }
    ::v-deep .el-pagination__total {
      position: absolute;
      left: 10px;
    }
    ::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active{
      background-color:#3f9b6a;
    }
  </style>