161 lines
3.5 KiB
Vue
161 lines
3.5 KiB
Vue
<script setup lang="ts">
|
|
import { ElButton } from 'element-plus'
|
|
import type { InvoiceTitle } from '@/types/business/finance'
|
|
|
|
interface Props {
|
|
invoiceTitle: InvoiceTitle
|
|
}
|
|
|
|
defineProps<Props>()
|
|
|
|
const emit = defineEmits<{
|
|
setDefault: [id: string]
|
|
edit: [item: InvoiceTitle]
|
|
delete: [id: string]
|
|
}>()
|
|
</script>
|
|
|
|
<template>
|
|
<div class="invoice-title-card">
|
|
<div class="invoice-title-card__top">
|
|
<span v-if="invoiceTitle.isDefault" class="invoice-title-card__badge">默认抬头</span>
|
|
<span v-else class="invoice-title-card__badge-placeholder" />
|
|
<div class="invoice-title-card__actions">
|
|
<el-button
|
|
v-if="!invoiceTitle.isDefault"
|
|
link
|
|
type="primary"
|
|
class="invoice-title-card__btn"
|
|
@click="emit('setDefault', invoiceTitle.id)"
|
|
>
|
|
设为默认
|
|
</el-button>
|
|
<el-button
|
|
link
|
|
type="primary"
|
|
class="invoice-title-card__btn"
|
|
@click="emit('delete', invoiceTitle.id)"
|
|
>
|
|
删除
|
|
</el-button>
|
|
<el-button
|
|
link
|
|
type="primary"
|
|
class="invoice-title-card__btn"
|
|
@click="emit('edit', invoiceTitle)"
|
|
>
|
|
编辑
|
|
</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="invoice-title-card__cols">
|
|
<div class="invoice-title-card__col">
|
|
<span class="invoice-title-card__label">抬头类型</span>
|
|
<span class="invoice-title-card__value">{{ invoiceTitle.type }}</span>
|
|
</div>
|
|
<div class="invoice-title-card__col">
|
|
<span class="invoice-title-card__label">发票抬头</span>
|
|
<span class="invoice-title-card__value">{{ invoiceTitle.title }}</span>
|
|
</div>
|
|
<div class="invoice-title-card__col">
|
|
<span class="invoice-title-card__label">税号</span>
|
|
<span class="invoice-title-card__value">{{ invoiceTitle.taxNo }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style lang="less" scoped>
|
|
.invoice-title-card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0;
|
|
width: 1780px;
|
|
min-height: 88px;
|
|
padding: 0 33.56px 0 27px;
|
|
border: 1px solid @finance-card-line;
|
|
border-radius: @radius-base;
|
|
background: @white;
|
|
box-sizing: border-box;
|
|
|
|
&__top {
|
|
.flex(row, space-between, center);
|
|
height: 49px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
&__badge {
|
|
.flex(row, center, center);
|
|
height: 22px;
|
|
padding: 0 12px;
|
|
border-radius: 4px;
|
|
background: @primary-strong;
|
|
color: @white;
|
|
font-size: 11px;
|
|
font-weight: 500;
|
|
line-height: 15px;
|
|
}
|
|
|
|
&__badge-placeholder {
|
|
height: 22px;
|
|
}
|
|
|
|
&__actions {
|
|
.flex(row, flex-end, center);
|
|
gap: 24px;
|
|
}
|
|
|
|
&__btn {
|
|
padding: 0;
|
|
border: none;
|
|
background: transparent;
|
|
color: @finance-entry-text;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
line-height: 16px;
|
|
transition: color 0.2s;
|
|
|
|
&:hover {
|
|
color: @primary-strong;
|
|
background: transparent;
|
|
}
|
|
}
|
|
|
|
&__cols {
|
|
.flex(row, flex-start, flex-start);
|
|
gap: 0;
|
|
padding-top: 2px;
|
|
padding-bottom: 30px;
|
|
}
|
|
|
|
&__col {
|
|
.flex(column, flex-start, flex-start);
|
|
gap: 8px;
|
|
width: 482px;
|
|
box-sizing: border-box;
|
|
|
|
&:last-child {
|
|
width: auto;
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
}
|
|
|
|
&__label {
|
|
font-size: 11px;
|
|
font-weight: 400;
|
|
line-height: 15px;
|
|
color: @finance-muted-text;
|
|
}
|
|
|
|
&__value {
|
|
font-size: 14px;
|
|
font-weight: 700;
|
|
line-height: 19px;
|
|
color: @finance-ink;
|
|
word-break: break-all;
|
|
}
|
|
}
|
|
</style>
|