Commit d4179fa0 authored by yaya's avatar yaya

feat: 优化传值

parent 4c086a6d
...@@ -44,15 +44,15 @@ ...@@ -44,15 +44,15 @@
<el-card class="box-card"> <el-card class="box-card">
<div class="income_item"> <div class="income_item">
<div class="income_item_title">平台利润</div> <div class="income_item_title">平台利润</div>
<div class="income_item_money">{{ `¥${incomeData.amount}` }}</div> <div class="income_item_money">{{ `¥${incomeData.amount || '-'}` }}</div>
<div class="income_item_detail">{{ `入账金额 ¥ ${incomeData.entryAmount}|待入账金额 ¥${incomeData.waitEntryAmount}` }}</div> <div class="income_item_detail">{{ `入账金额 ¥ ${incomeData.entryAmount || '-'}|待入账金额 ¥${incomeData.waitEntryAmount || '-'}` }}</div>
</div> </div>
</el-card> </el-card>
<el-card class="box-card"> <el-card class="box-card">
<div class="income_item"> <div class="income_item">
<div class="income_item_title">平台累计利润</div> <div class="income_item_title">平台累计利润</div>
<div class="income_item_money">{{ `¥${incomeData.totalAmount}` }}</div> <div class="income_item_money">{{ `¥${incomeData.totalAmount || '-'}` }}</div>
<div class="income_item_detail">{{ `入账金额 ¥ ${incomeData.totalEntryAmount}|待入账金额 ¥${incomeData.totalWaitEntryAmount}` }}</div> <div class="income_item_detail">{{ `入账金额 ¥ ${incomeData.totalEntryAmount || '-'}|待入账金额 ¥${incomeData.totalWaitEntryAmount || '-'}` }}</div>
</div> </div>
</el-card> </el-card>
</div> </div>
...@@ -128,9 +128,6 @@ export default { ...@@ -128,9 +128,6 @@ export default {
activeIndex: '1', activeIndex: '1',
itemKey: 0, itemKey: 0,
options: [{ options: [{
value: 1,
label: '待付款'
}, {
value: 10, value: 10,
label: '待发货' label: '待发货'
}, { }, {
...@@ -153,9 +150,6 @@ export default { ...@@ -153,9 +150,6 @@ export default {
label: '已取消' label: '已取消'
}], }],
incomeOptions: [{ incomeOptions: [{
value: 1,
label: '订单收入'
}, {
value: 2, value: 2,
label: '平台佣金' label: '平台佣金'
}, { }, {
...@@ -190,10 +184,40 @@ export default { ...@@ -190,10 +184,40 @@ export default {
} }
}, },
created() { created() {
this.getList() this.timeValue = this.getLastMonthDate()
this.handleFilter()
}, },
methods: { methods: {
getLastMonthDate() {
var tomorrow = new Date()
tomorrow.setTime(tomorrow.getTime() + 24 * 60 * 60 * 1000)
var end = tomorrow
var year = end.getFullYear()
var month = end.getMonth() + 1 // 0-11表示 1-12月
var day = end.getDate()
var dateObj = {}
dateObj.start = null
dateObj.end = year + '-' + month + '-' + day
var endMonthDay = new Date(year, month, 0).getDate() // 当前月的总天数
if (month - 1 <= 0) { // 如果是1月,年数往前推一年<br>
dateObj.start = (year - 1) + '-' + 12 + '-' + day
} else {
const startMonthDay = new Date(year, (parseInt(month) - 1), 0).getDate()
if (startMonthDay < day) { // 1个月前所在月的总天数小于现在的天日期
if (day < endMonthDay) { // 当前天日期小于当前月总天数
dateObj.start = year + '-' + (month - 1) + '-' + (startMonthDay - (endMonthDay - day))
} else {
dateObj.start = year + '-' + (month - 1) + '-' + startMonthDay
}
} else {
dateObj.start = year + '-' + (month - 1) + '-' + day
}
}
const newMonthDate = [dateObj.start + ' ' + '00:00:00', dateObj.end + ' ' + '00:00:00']
console.log('newMonthDate', newMonthDate)
return newMonthDate
},
resetSearchForm() { resetSearchForm() {
this.timeValue = '' this.timeValue = ''
this.listQuery = { this.listQuery = {
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<div class="filter-container"> <div class="filter-container">
<div class="button_left"> <div class="button_left">
<el-input <el-input
v-model="listQuery.sellerId" v-model="listQuery.userId"
clearable clearable
class="filter-item" class="filter-item"
style="width: 200px;" style="width: 200px;"
placeholder="请输入藏家ID" /> placeholder="请输入藏家ID" />
<el-date-picker <el-date-picker
v-model="listQuery.time" v-model="listQuery.accountPeriod"
class="filter-item" class="filter-item"
type="month" type="month"
style="width: 200px;" style="width: 200px;"
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="是否结款" prop="state" > <el-table-column align="center" label="是否结款" prop="state" >
<template slot-scope="scope"> <template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.state === 1 ? `` : scope.row.state === 1 ? '否' : '-'}` }}</span> <span class="tooltip-span">{{ `${scope.row.state === 1 ? `` : scope.row.state === 0 ? '否' : '-'}` }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="银行卡账号" width="200" prop="bankCardId" /> <el-table-column align="center" label="银行卡账号" width="200" prop="bankCardId" />
...@@ -170,7 +170,7 @@ export default { ...@@ -170,7 +170,7 @@ export default {
value: 1, value: 1,
label: '' label: ''
}, { }, {
value: 2, value: 0,
label: '' label: ''
}], }],
listLoading: true, listLoading: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment