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
<template>
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<p style="font-size: 18px">结算流水</p>
</div>
<el-table v-loading="loading" :height="tableHeight" :data="assetList">
<el-table-column label="ID" align="center" prop="Id"/>
<el-table-column label="流水订单号" align="center" prop="BalanceSn"/>
<el-table-column label="变动金额" align="center" prop="ChangeMoney"/>
<el-table-column label="变动类型" align="center" :formatter="formatType" prop="ChangeType"/>
<el-table-column label="时间" align="center" :formatter="formatTime" prop="AddTime"/>
<el-table-column label="描述" align="center" prop="Des"/>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
</el-card>
</div>
</template>
<script>
import {
listAsset,
getAsset,
delAsset,
addAsset,
updateAsset
} from '@/api/module/asset'
import {
dateFormat
} from '@/utils'
export default {
name: "asset",
data() {
return {
fullHeight: 0,
tableHeight: 0,
loading: true, // 遮罩层
ids: [], // 选中数组
total: 0, // 总条数
assetList: [], // 商户余额变动日志表格数据
title: "", // 弹出层标题
open: false, // 是否显示弹出层
queryParams: { // 查询参数
pageNum: 1,
pageSize: 10,
sellerId: 0
},
form: {}, // 表单参数
rules: {} // 表单校验
};
},
created() {
this.queryParams.sellerId = this.$store.state.user.sellerid
this.getList();
this.$nextTick(() => {
this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight
})
},
watch: {
fullHeight(val) {
let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight
this.tableHeight = val - formHeight - 120;
}
},
methods: {
formatType(row) {
var types = row.ChangeType
var optDes = ''
if (types == 1) {
optDes = "增加"
} else if (types == 2) {
optDes = "减少"
}
return optDes
},
//格式化时间
formatTime(row) {
let Time = row.AddTime;
let newtime = "";
if (Time > 0) {
newtime = dateFormat(Time * 1000, "Y-m-d H:i:s");
}
return newtime
},
//格式化价格
formatMoney(row) {
var nm = 0;
var money = row.ChangeMoney;
if (money > 0) {
nm = money / 1000
}
return nm
},
/** 查询商户余额变动日志列表 */
getList() {
this.loading = true;
//console.log("重点注意shopid", this.queryParams)
listAsset(this.queryParams).then(response => {
this.assetList = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
} //methods结束
};
</script>
<style scoped>
</style>