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