|
|
@@ -1,17 +1,9 @@
|
|
|
<template>
|
|
|
<div class="shop-list">
|
|
|
<x-crud @load="onLoad">
|
|
|
- <template #slot-date-select>
|
|
|
- <el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
|
|
|
- end-placeholder="结束日期" :picker-options="pickerOptions" size="mini"> </el-date-picker>
|
|
|
- </template>
|
|
|
|
|
|
- <template #slot-order-debt="{scope}">
|
|
|
- <el-radio-group v-model="debt" @change="changeDebt" style="margin-right:20px;padding-top:6px;margin-left:20px;">
|
|
|
- <el-radio label="-1">全部</el-radio>
|
|
|
- <el-radio label="1">待结款</el-radio>
|
|
|
- <el-radio label="0">已结款</el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <template #slot-date-select>
|
|
|
+ <el-date-picker v-model="endTime" type="date" placeholder="选择日期" @change="getSearchDate" value-format="yyyy-MM-dd"> </el-date-picker>
|
|
|
</template>
|
|
|
|
|
|
<template #slot-total-amount>
|
|
|
@@ -22,6 +14,10 @@
|
|
|
<el-button type="primary" size="mini" style="margin-left:60px;" @click="exportDue()">导出数据</el-button>
|
|
|
</template>
|
|
|
|
|
|
+ <template #slot-column-option="{scope}">
|
|
|
+ <el-button size="small" type="primary" @click="goChange(scope.row)">查看明细</el-button>
|
|
|
+ </template>
|
|
|
+
|
|
|
</x-crud>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -31,33 +27,6 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
crud: null,
|
|
|
- pickerOptions: {
|
|
|
- shortcuts: [{
|
|
|
- text: '最近一周',
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }, {
|
|
|
- text: '最近一个月',
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }, {
|
|
|
- text: '最近三个月',
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }]
|
|
|
- },
|
|
|
currentDateList:'',
|
|
|
startTime:'',
|
|
|
endTime:'',
|
|
|
@@ -70,8 +39,14 @@ export default {
|
|
|
...mapGetters(['shopInfo']),
|
|
|
},
|
|
|
methods: {
|
|
|
+ goChange(data){
|
|
|
+ let query = {};
|
|
|
+ query.customId = data.id
|
|
|
+ query.endTime = this.endTime
|
|
|
+ this.$router.push({ path: '/custom/pastAccountChange', query });
|
|
|
+ },
|
|
|
exportDue(){
|
|
|
- this.$service.order.getAccountList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt,export:1}).then(res => {
|
|
|
+ this.$service.order.getPastList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,export:1}).then(res => {
|
|
|
if(res.file){
|
|
|
window.location.href = res.file
|
|
|
}
|
|
|
@@ -81,7 +56,7 @@ export default {
|
|
|
this.app = app;
|
|
|
ctx.service({
|
|
|
page: () => {
|
|
|
- return this.$service.order.getAccountList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt}).then((res) => {
|
|
|
+ return this.$service.order.getPastList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime}).then((res) => {
|
|
|
this.totalAmount = res.totalAmount ? res.totalAmount : 0
|
|
|
return {
|
|
|
list: res.list
|
|
|
@@ -102,13 +77,13 @@ export default {
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
- label: '订单数',
|
|
|
- prop: 'num',
|
|
|
+ label: '手机号',
|
|
|
+ prop: 'mobile',
|
|
|
align: 'center',
|
|
|
},
|
|
|
{
|
|
|
- label: '金额',
|
|
|
- prop: 'amount',
|
|
|
+ label: '欠款金额',
|
|
|
+ prop: 'currentDebAmount',
|
|
|
align: 'center',
|
|
|
}
|
|
|
],
|
|
|
@@ -120,12 +95,11 @@ export default {
|
|
|
fixed: 'right',
|
|
|
label: '操作'
|
|
|
},
|
|
|
- layout: []
|
|
|
+ layout: ['slot-column-option']
|
|
|
}
|
|
|
})
|
|
|
.set('layout', [
|
|
|
[ 'slot-date-select',
|
|
|
- 'slot-order-debt',
|
|
|
'flex1',
|
|
|
'slot-export-due',
|
|
|
'refresh-btn',
|
|
|
@@ -138,8 +112,7 @@ export default {
|
|
|
},
|
|
|
getSearchDate(){
|
|
|
this.searchTime = 'custom'
|
|
|
- this.startTime = this.currentDateList[0]
|
|
|
- this.endTime = this.currentDateList[1]
|
|
|
+ this.startTime = this.endTime
|
|
|
this.app.refresh({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt});
|
|
|
},
|
|
|
changeDebt(e){
|