style(product): popup style for stock calendar
This commit is contained in:
@@ -4,20 +4,28 @@
|
||||
:title="`${selectedDate} 库存流水`"
|
||||
height="80vh"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
@left-button-click="visible = false"
|
||||
>
|
||||
<div class="records">
|
||||
<template v-if="canReadRecords">
|
||||
<div class="directions">
|
||||
<t-segmented :value="direction" :options="directionOptions" @change="changeDirection" />
|
||||
<div v-if="canReadRecords" class="records">
|
||||
<div class="filters glass-header">
|
||||
<div v-if="selection" class="summary">
|
||||
<span v-if="summaryLoading">汇总加载中</span>
|
||||
<span v-else :class="direction === 'IN' ? 'in' : 'out'"
|
||||
v-text="`合计 ${formatQuantity(direction === 'IN' ? summary?.inQuantity : summary?.outQuantity)} ${currentUnit?.name || ''}`" />
|
||||
<t-button v-if="1 < units.length" size="extra-small" variant="outline" :content="`单位:${currentUnit?.name}`" @click="nextUnit" />
|
||||
<span
|
||||
v-else
|
||||
:class="direction === 'IN' ? 'in' : 'out'"
|
||||
v-text="`合计 ${formatQuantity(direction === 'IN' ? summary?.inQuantity : summary?.outQuantity)} ${currentUnit?.name || ''}`"
|
||||
/>
|
||||
<t-button
|
||||
v-if="1 < units.length"
|
||||
size="extra-small"
|
||||
variant="outline"
|
||||
:content="`单位:${currentUnit?.name}`"
|
||||
@click="nextUnit"
|
||||
/>
|
||||
</div>
|
||||
<t-segmented :value="direction" :options="directionOptions" @change="changeDirection" />
|
||||
</div>
|
||||
<div class="record-list">
|
||||
<t-cell-group v-if="records.length" class="list empty-cell-title-margin" theme="card">
|
||||
<t-cell v-for="record in records" :key="record.id" class="item">
|
||||
<template #leftIcon>
|
||||
@@ -49,28 +57,41 @@
|
||||
</span>
|
||||
</template>
|
||||
<template #title>
|
||||
<div class="record-title">
|
||||
<div class="title">
|
||||
<span v-if="record.customer" class="actor" v-text="getCustomerText(record)" />
|
||||
<span v-else-if="record.operator" class="actor"
|
||||
v-text="getOperatorText(record)" />
|
||||
<strong class="operation" :class="getOperationClass(record.operationType)"
|
||||
v-text="getStockOperationText(record.operationType)" />
|
||||
<strong class="product-name"
|
||||
v-text="record.productNameSnapshot || '未命名产品'" />
|
||||
<span
|
||||
v-else-if="record.operator"
|
||||
class="actor"
|
||||
v-text="getOperatorText(record)"
|
||||
/>
|
||||
<strong
|
||||
class="operation"
|
||||
:class="getOperationClass(record.operationType)"
|
||||
v-text="getStockOperationText(record.operationType)"
|
||||
/>
|
||||
<strong class="product-name" v-text="record.productNameSnapshot || '未命名产品'" />
|
||||
<t-tag
|
||||
v-if="record.skuNameSnapshot && record.productNameSnapshot !== record.skuNameSnapshot"
|
||||
size="small" :content="record.skuNameSnapshot" />
|
||||
size="small"
|
||||
:content="record.skuNameSnapshot"
|
||||
/>
|
||||
<span
|
||||
v-if="record.quantity !== undefined && record.quantity !== null && record.quantity !== ''"
|
||||
class="record-quantity"
|
||||
v-text="`${getProductQuantityText(record.quantity)} ${record.unitSnapshot || ''}`" />
|
||||
v-text="`${getProductQuantityText(record.quantity)} ${record.unitSnapshot || ''}`"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template #description>
|
||||
<div class="description">
|
||||
<time-label :timestamp="record.occurredAt" underline />
|
||||
<div><span class="delta" :class="getDeltaClass(record.onHandDelta)"
|
||||
v-text="getDeltaText(record.onHandDelta)" /></div>
|
||||
<div>
|
||||
<span
|
||||
class="delta"
|
||||
:class="getDeltaClass(record.onHandDelta)"
|
||||
v-text="getDeltaText(record.onHandDelta)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
@@ -80,9 +101,7 @@
|
||||
加载更多
|
||||
</t-button>
|
||||
</div>
|
||||
</template>
|
||||
<t-empty v-else description="暂无库存流水查看权限" />
|
||||
</div>
|
||||
</bottom-popup>
|
||||
</template>
|
||||
|
||||
@@ -236,20 +255,20 @@ defineExpose({ openDay });
|
||||
|
||||
<style scoped lang="less">
|
||||
.records {
|
||||
height: 60vh;
|
||||
display: flex;
|
||||
min-height: 0;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
|
||||
.directions {
|
||||
.filters {
|
||||
gap: .5rem;
|
||||
top: 0;
|
||||
display: flex;
|
||||
padding: .75rem;
|
||||
z-index: 1;
|
||||
position: sticky;
|
||||
min-width: 0;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
justify-content: end;
|
||||
|
||||
.summary {
|
||||
gap: .75rem;
|
||||
@@ -259,30 +278,26 @@ defineExpose({ openDay });
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
|
||||
.in { color: var(--td-success-color); }
|
||||
.out { color: var(--td-error-color); }
|
||||
.in {
|
||||
color: var(--td-success-color);
|
||||
}
|
||||
|
||||
.record-list {
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
flex: 1;
|
||||
.out {
|
||||
color: var(--td-error-color);
|
||||
}
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 3.5rem;
|
||||
height: 3.5rem;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: .625rem;
|
||||
min-width: 0;
|
||||
|
||||
.avatar {
|
||||
width: 3.5rem;
|
||||
height: 3.5rem;
|
||||
}
|
||||
|
||||
.icon {
|
||||
@@ -295,7 +310,7 @@ defineExpose({ openDay });
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.record-title {
|
||||
.title {
|
||||
gap: .25rem;
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
@@ -392,6 +407,8 @@ defineExpose({ openDay });
|
||||
color: var(--td-error-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:global(html.theme-dark) .records .operation {
|
||||
&.initial-in {
|
||||
|
||||
Reference in New Issue
Block a user