Parcourir la source

增加红包列表弹窗

liyuan il y a 3 jours
Parent
commit
694cce400e

+ 8 - 0
src/api/redPacket/index.js

@@ -7,3 +7,11 @@ export const getCouponReportList = (params) => {
         params: params
     })
 }
+
+export const getCouponReportOrderList = (params) => {
+    return request({
+        url: '/api/blade-sales-part/tire/coupon/getCouponReportOrderList',
+        method: 'get',
+        params: params
+    })
+}

+ 76 - 0
src/views/tirePartsMall/statisticAnalysis/red-packet/customer-order.vue

@@ -0,0 +1,76 @@
+<template>
+    <el-dialog
+        title="列表"
+        :visible.sync="centerDialogVisible"
+        width="60%"
+        append-to-body
+        center>
+
+        <el-table :data="orderData" border style="width: 100%; font-size: 14px;">
+            <el-table-column prop="customerName" label="客户名称"/>
+            <el-table-column prop="orderNo" label="订单编号">
+            </el-table-column>
+            <el-table-column prop="numberRows" label="行数"/>
+            <el-table-column prop="goodsTotalNum" label="数量">
+                <template slot-scope="scope">
+                    {{ formatDecimal(scope.row.goodsTotalNum) }}
+                </template>
+            </el-table-column>
+
+            <el-table-column prop="totalMoney" label="总金额(元)">
+                <template slot-scope="scope">
+                    ¥{{ formatDecimal(scope.row.totalMoney) }}
+                </template>
+            </el-table-column>
+
+            <el-table-column prop="redPacketAmount" label="红包金额(元)">
+                <template slot-scope="scope">
+                    ¥{{ formatDecimal(scope.row.redPacketAmount) }}
+                </template>
+            </el-table-column>
+
+            <el-table-column prop="businessDate" label="业务日期">
+                <template slot-scope="scope">
+                    {{ scope.row.businessDate }}
+                </template>
+            </el-table-column>
+        </el-table>
+
+<!--        <span slot="footer" class="dialog-footer">
+    <el-button @click="centerDialogVisible = false">取 消</el-button>
+    <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
+  </span>-->
+    </el-dialog>
+</template>
+
+<script>
+import { getCouponReportOrderList } from "@/api/redPacket/index";
+
+export default {
+    name: "CouponStatistics",
+    data() {
+        return {
+            centerDialogVisible: false,
+            orderData: []
+        };
+    },
+    created() {
+    },
+    methods: {
+        formatDecimal(value) {
+            if (value == null || value === '') return '0.00'
+            return parseFloat(value).toFixed(2)
+        },
+        getOrderDataList(customerId,checkType){
+            getCouponReportOrderList({customerId: customerId, checkType: checkType}).then(res => {
+                console.info('res---', res);
+                this.orderData = res.data.data;
+            })
+        }
+    }
+};
+</script>
+
+<style scoped>
+
+</style>

+ 20 - 3
src/views/tirePartsMall/statisticAnalysis/red-packet/index.vue

@@ -38,9 +38,17 @@
                         {{ scope.row.amount | currency }}
                     </template>
                 </el-table-column>
-                <el-table-column prop="claimedCount" label="已领取优惠券" width="130" align="center" />
-                <el-table-column prop="usedCount" label="已使用优惠券" width="120" align="center" />
-                <el-table-column prop="returnedCouponCount" label="已退货优惠券" width="120" align="center" />
+                <el-table-column prop="claimedCount" label="已领取优惠券" width="130" align="center"/>
+                <el-table-column prop="usedCount" label="已使用优惠券" width="120" align="center">
+                    <template slot-scope="scope">
+                        <span style="color: blue" @click="openOrderData(scope.row.storeId, 1)">{{scope.row.usedCount}}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="returnedCouponCount" label="已退货优惠券" width="120" align="center">
+                    <template slot-scope="scope">
+                        <span style="color: blue" @click="openOrderData(scope.row.storeId, 0)">{{scope.row.returnedCouponCount}}</span>
+                    </template>
+                </el-table-column>
             </el-table>
 
             <!-- Pagination -->
@@ -56,13 +64,18 @@
                 />
             </div>
         </el-card>
+        <customer-order ref="customerOrderRef" />
     </div>
 </template>
 
 <script>
 import { getCouponReportList } from "@/api/redPacket/index";
+import customerOrder from "@/views/tirePartsMall/statisticAnalysis/red-packet/customer-order.vue";
 export default {
     name: 'CouponStatistics',
+    components: {
+        customerOrder
+    },
     filters: {
         currency(val) {
             if (val == null) return '0.00';
@@ -88,6 +101,10 @@ export default {
         this.fetchData();
     },
     methods: {
+        openOrderData(customerId, checkType){
+            this.$refs.customerOrderRef.getOrderDataList(customerId, checkType)
+            this.$refs.customerOrderRef.centerDialogVisible = true
+        },
         async fetchData() {
             this.loading = true;
             try {