Files
desktop_task_schedule/code/web/task_schedule/src/components/CallerArchievementComponent.vue

167 lines
3.4 KiB
Vue
Raw Normal View History

2023-08-30 20:15:31 +08:00
<!--
* @Author: Kane
* @Date: 2023-08-30 14:08:57
* @LastEditors: Kane
* @FilePath: /task_schedule/src/components/CallerArchievementComponent.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
2023-08-31 20:34:36 +08:00
<div class="caller-archievment-wrapper">
2023-09-05 18:37:41 +08:00
<h1>{{ CallerName }}</h1>
2023-08-30 20:15:31 +08:00
<table>
2023-08-31 20:34:36 +08:00
<tr>
2023-09-05 18:37:41 +08:00
<th>当月保费</th><td>{{ PresentMonthPremium }}&nbsp;万元</td>
2023-08-31 20:34:36 +08:00
</tr>
<tr>
2023-09-05 18:37:41 +08:00
<th>车非渗透率</th><td>{{ props.attachingRate }}%</td>
2023-08-31 20:34:36 +08:00
</tr>
<tr>
2023-09-05 18:37:41 +08:00
<th>续保率</th><td>{{ props.renewalRate }}%</td>
2023-08-31 20:34:36 +08:00
</tr>
2023-08-30 20:15:31 +08:00
</table>
</div>
</template>
<script lang="ts">
2023-09-01 19:05:30 +08:00
import { computed } from "vue";
interface CallerArchievementComponentUI
2023-08-30 20:15:31 +08:00
{
callerName: string,
thisMonthPremium: number,
attachingRate: string,
renewalRate: string,
}
export default {
2023-08-31 20:34:36 +08:00
name: "CallerArchievementComponent",
2023-09-01 19:05:30 +08:00
props: {
callerName: {
type: String,
require: true,
default: (): string => "",
},
2023-08-30 20:15:31 +08:00
thisMonthPremium: {
type: Number,
require: true,
2023-09-01 19:05:30 +08:00
default: (): number => 0,
2023-08-30 20:15:31 +08:00
},
2023-09-05 18:37:41 +08:00
attachingRate: {
type: String,
require: true,
default: (): string => "0.0",
},
renewalRate: {
type: String,
require: true,
default: (): string => "0.0",
},
2023-08-30 20:15:31 +08:00
},
2023-09-01 19:05:30 +08:00
setup( props )
2023-08-30 20:15:31 +08:00
{
2023-09-01 19:05:30 +08:00
const ui: CallerArchievementComponentUI = {
2023-08-30 20:15:31 +08:00
callerName: "",
thisMonthPremium: 0,
attachingRate: "0.0",
renewalRate: "0.0",
};
2023-09-01 19:05:30 +08:00
const PresentMonthPremium = computed((): string =>
{
return ( props.thisMonthPremium / 10000 ).toFixed( 2 );
});
const CallerName = computed((): string =>
{
return props.callerName;
});
2023-09-04 19:01:52 +08:00
2023-09-01 19:05:30 +08:00
return {
CallerName,
PresentMonthPremium,
ui,
2023-09-05 18:37:41 +08:00
props,
2023-09-01 19:05:30 +08:00
};
2023-08-30 20:15:31 +08:00
},
};
</script>
<style scoped lang="scss">
2023-09-04 19:01:52 +08:00
.caller-archievment-wrapper
{
2023-09-05 18:37:41 +08:00
width: 300px;
height: 120px;
border-radius: 5px;
margin-bottom: 30px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
background-color: #fff;
color: #4f4f4f;
font-size: 15px;
h1 {
background-color: #fecb96;
width: 100%;
text-align: center;
border-radius: 5px 5px 0px 0px;
margin: 0px;
padding: 5px 0px;
color: #da3703;
font: {
size: 1.2rem;
weight: 100;
family: "FZ-ZHUOHEI";
}
}
table {
border-collapse: collapse;
border-radius: 0px 0px 5px 5px;
width: 100%;
margin-top: 5px;
background-color: #ffffff;
font: {
size: 14px;
}
th,td {
padding: 9px;
border-bottom: 1.5px solid #ebeef5;
}
th {
width: 5.2rem;
text-align: right;
}
th.caller-name {
text-align: center;
background-color: yellow;
}
td {
text-align: left;
}
tr:nth-child(even) {
background-color: #f5f6f7;
}
tr:last-child td,th {
border-bottom: none;
}
}
2023-09-04 19:01:52 +08:00
}
2023-09-05 18:37:41 +08:00
2023-09-01 19:05:30 +08:00
</style>