zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<template>
  <div class="product" ref="product">
    <el-tabs v-model="activeName" type="card">
      <el-tab-pane label="店铺情况" name="first">
        <TableList
          :pageInfo="pageInfo"
          @handleCurrentChange="handleCurrentChange"
          @handleSizeChange="handleSizeChange"
          ref="tableRef"
          :list="records"
          :header="tableHeader"
          :height="tableHeight"
          :loading="loading"
        ></TableList>
      </el-tab-pane>
      <el-tab-pane label="订单明细" name="second">
        <TableList
          :pageInfo="ordPageInfo"
          @handleCurrentChange="handleOrdCurrentChange"
          @handleSizeChange="handleOrdSizeChange"
          ref="ordTableRef"
          :list="ordRecords"
          :header="ordTableHeader"
          :height="tableHeight"
          :loading="loading"
        ></TableList>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import {
  qryMallInfoList,
  qryMallOrderGoodsList,
} from "@comprehensive/serve/public";
import {
  qryMallInfoListHeader,
  qryMallOrderGoodsListHeader,
} from "@comprehensive/utils/tableHeaders";
import TableList from "../../components/TableList.vue";
export default {
  props: {
    // 申请编号
    serialNo: {
      type: String,
      required: false,
    },
  },
  components: {
    TableList,
  },
  data() {
    return {
      applyserialno: '',
      activeName: "first",
      //页码
      pageInfo: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
      },
      ordPageInfo: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
      },
      records: [],
      ordRecords: [],
      tableHeader: [...qryMallInfoListHeader],
      ordTableHeader: [...qryMallOrderGoodsListHeader],
      tableHeight: "560px",
      loading: false,
    };
  },
  created() {
    this.init();
  },
  methods: {
    init() {
      if (this.$store.state.product.applyInfo) {
        if (this.$store.state.product.applyInfo.serialNo) {
          console.log('this.$store.state',this.$store.state.product.applyInfo.serialNo)
          this.applyserialno = this.$store.state.product.applyInfo.serialNo
        }
      }
      if (this.serialNo) {
        console.log('serialNo',this.serialNo)
        this.applyserialno = this.serialNo
      }
      
      this.qryMallInfoList();
      this.qryMallOrderGoodsList();
    },
    //获取
    async qryMallInfoList() {
      const { applyserialno, pageInfo } = this;
      this.loading = true;
      const res = await qryMallInfoList({
        applyserialno: applyserialno,
        ...pageInfo,
      });
      const { records = [], total } = res.result;
      this.loading = false;
      this.records = records.reduce((pre, curr) => {
        const {
          afterPrRefusalRateL12m, //近12个月提现后的拒付率
          afterPrRefusalRateL1m, //近1个月提现后的拒付率
          afterPrRefundRateL12m, //近12个月提现后的退款率
          afterPrRefundRateL1m, //近1个月提现后的退款率
        } = curr;
        pre.push({
          ...curr,
          afterPrRefusalRateL12m: this.valueToPercent(afterPrRefusalRateL12m),
          afterPrRefusalRateL1m: this.valueToPercent(afterPrRefusalRateL1m),
          afterPrRefundRateL12m: this.valueToPercent(afterPrRefundRateL12m),
          afterPrRefundRateL1m: this.valueToPercent(afterPrRefundRateL1m),
        });
        return pre;
      }, []);
      this.pageInfo = {
        ...pageInfo,
        total: total,
      };
    },
    async qryMallOrderGoodsList() {
      const { applyserialno, ordPageInfo } = this;
      this.loading = true;
      const res = await qryMallOrderGoodsList({
        applyserialno: applyserialno,
        ...ordPageInfo,
      });
      const { records = [], total } = res.result;
      this.loading = false;
      this.ordRecords = records
      this.ordPageInfo = {
        ...ordPageInfo,
        total: total,
      };
    },
    //修改翻页数
    handleCurrentChange(val) {
      this.pageInfo.currentPage = val;
      this.qryMallInfoList();
    },
    // 修改翻页条数
    handleSizeChange(val) {
      this.pageInfo.pageSize = val;
      this.qryMallInfoList();
    },
 
    //订单修改翻页数
    handleOrdCurrentChange(val) {
      this.ordPageInfo.currentPage = val;
      this.qryMallOrderGoodsList();
    },
    //订单修改翻页条数
    handleOrdSizeChange(val) {
      this.ordPageInfo.pageSize = val;
      this.qryMallOrderGoodsList();
    },
    //数字转百分比,如果为null,则返回空串,如果为0 则返回0
    valueToPercent(val) {
      let tempVal = "";
      if (val == 0) {
        return (val * 100).toFixed(2) + "%";
      }
      if (val) {
        tempVal = (val * 100).toFixed(2) + "%";
      }
      return tempVal;
    },
  },
};
</script>
 
<style lang="postcss" scoped>
.product .form .el-form-item.isLong {
  width: 100% !important;
}
</style>