ApproveViewNotice.vue
5.17 KB
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
<template>
<a-card title="待办事项" size="default" class="approve-view-notice">
<template #extra><span style="color: #777485">{{ approveCount }}项</span></template>
<a-calendar v-model:value="filterDate" :fullscreen="false" @panelChange="onPanelChange" @select="changeDate">
<template #dateCellRender="{ current }">
<div class="ant-fullcalendar-date">
<div v-if="isSpecialDate(current)" class="calender_icon">{{ isSpecialDate(current) }}</div>
</div>
</template>
</a-calendar>
<a-list :data-source="approveViews" size="small" :bordered="false">
<template #renderItem="{ item }">
<a-list-item>
<template #actions>
<a-button type="link" size="small" @click="goToDetail(item)">跟进</a-button>
</template>
<a-list-item-meta>
<template #title>
<approve-type-tag :approve-type="item.approveType"></approve-type-tag>
<span style="font-weight: 400">{{ item.name }}</span>
</template>
<template #description>
<span style="min-width: 140px;display: inline-block;margin-right: 16px">创建人 {{ item.createBy }}</span>
时间 {{ item.createTime }}
</template>
</a-list-item-meta>
</a-list-item>
</template>
</a-list>
</a-card>
</template>
<script lang="ts">
import {Component, Vue} from 'vue-facing-decorator';
import {ApproveView} from "lib/src/entity/track/entity/ApproveView";
import {ApproveController} from "@/api/ApproveController";
import ApproveTypeTag from "@/views/common/ApproveTypeTag.vue";
import dayjs, {Dayjs} from "dayjs";
import {NotificationOutlined} from "@ant-design/icons-vue";
import {DateCount} from "lib/src/entity/analysis/domain/DateCount";
@Component({
components: {ApproveTypeTag, NotificationOutlined}
})
export default class ApproveViewNotice extends Vue {
approveCount = 0;
approveViews: ApproveView[] = [];
filterDate = null;
dateCounts: DateCount [] = [];
isSpecialDate(current: any) {
const dateStr = current.format('YYYY-MM-DD')
const filtered = this.dateCounts.find((item) => item.date === dateStr);
if (filtered) {
return filtered.count;
} else {
return null;
}
}
created(): void {
this.filterDate = dayjs();
ApproveController.getLastApproveViews(this.axios, null).then(res => {
this.approveViews = res.data;
});
ApproveController.getApproveViewCount(this.axios).then(res => {
this.approveCount = res.data;
});
this.loadData(this.filterDate);
}
onPanelChange(value: Dayjs, mode: string) {
this.loadData(value);
}
loadData(date: Dayjs): void {
ApproveController.getApproveViewsCountByDate(this.axios, date).then(res => {
this.dateCounts = res.data;
});
}
changeDate(): void {
ApproveController.getLastApproveViews(this.axios, this.filterDate).then(res => {
this.approveViews = res.data;
});
}
goToDetail(approveView: ApproveView): void {
switch (approveView.approveType) {
case "ACCOUNT":
this.$router.push({path: '/account/accounts'});
break;
case "APPRAISE_PRICE":
this.$router.push({path: '/vehicle/appraise'});
break;
case "AUCTION":
this.$router.push({path: '/auction/approve'});
break;
case "AUCTION_VEHICLE":
this.$router.push({path: '/auction/approve'});
break;
case "AUCTION_CHANGE":
this.$router.push({path: '/auction/change'});
break;
case "AUCTION_VEHICLE_CHANGE":
this.$router.push({path: '/auction/change', query: {type: 'vehicle'}});
break;
case "PAYMENT":
this.$router.push({path: '/finance/order-transaction-audit'});
break;
case "TRANSFER":
this.$router.push({path: '/auction/order'});
break;
case "WITHDRAW":
this.$router.push({path: '/finance/withdraw'});
break;
}
}
}
</script>
<style scoped lang="less">
::v-deep(.ant-list-item .ant-list-item-action) {
padding-right: 0 !important;
padding-left: 2px !important;
> li {
padding-right: 0;
button {
padding-right: 0;
}
}
}
.approve-view-notice ::v-deep(.ant-card-body) {
padding: 0 18px 12px 18px;
}
.ant-fullcalendar-date {
.calender_icon {
position: absolute;
top: -8px;
right: -8px;
width: 12px;
//height: 12px;
z-index: 100;
border-radius: 6px;
background-color: red;
color: white;
font-size: 10px;
line-height: 12px;
}
}
</style>