<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>
|