- 升级应用版本号至 1.0.140(package.json、manifest.json) - 盘点列表工具栏:状态筛选激活态按状态色调显示(待盘点=蓝/盘点中=橙/已完成=绿),并与卡片状态色保持一致 - 盘点列表工具栏:搜索框、筛选按钮字号调整(30→34rpx) - 盘点汇总面板:分组标题字号调整(30→32rpx) - 盘点详情页:tabs 文字字号调整为 34rpx - 补货短少页:列表文字字号调整(34→36rpx)
224 lines
4.4 KiB
Vue
224 lines
4.4 KiB
Vue
<template>
|
||
<view class="search-panel">
|
||
<view class="search-input-wrap">
|
||
<u-search
|
||
:value="keyword"
|
||
:placeholder="placeholder"
|
||
:bg-color="'#f5f5f5'"
|
||
shape="round"
|
||
:show-action="false"
|
||
@input="$emit('input', $event)"
|
||
@search="$emit('search')"
|
||
@clear="$emit('clear')"
|
||
></u-search>
|
||
<view class="search-actions">
|
||
<view class="scan-btn" @click="$emit('scan')">
|
||
<u-icon name="scan" size="38rpx" color="#2979ff"></u-icon>
|
||
</view>
|
||
<view class="search-divider"></view>
|
||
<view class="search-btn" @click="$emit('search')">
|
||
<text class="search-btn__text">搜索</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="filter-row">
|
||
<view class="filter-group">
|
||
<view
|
||
v-for="opt in statusOptions"
|
||
:key="opt.value"
|
||
class="filter-group__item"
|
||
:class="filterItemClass(opt)"
|
||
@click="$emit('status-change', opt.value)"
|
||
>
|
||
<text class="filter-group__item-text">{{ opt.label }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import { statusTone } from './countModel.js';
|
||
|
||
/** 盘点列表顶部工具栏:关键字搜索/扫码 + 状态筛选(支持 v-model 绑定关键字) */
|
||
export default {
|
||
name: 'CountListToolbar',
|
||
// 让父级 v-model 绑定到 keyword(默认会绑定 value)
|
||
model: {
|
||
prop: 'keyword',
|
||
event: 'input'
|
||
},
|
||
props: {
|
||
keyword: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
placeholder: {
|
||
type: String,
|
||
default: '请输入/扫描盘点单号或标题'
|
||
},
|
||
statusOptions: {
|
||
type: Array,
|
||
default: () => []
|
||
},
|
||
statusFilter: {
|
||
type: String,
|
||
default: ''
|
||
}
|
||
},
|
||
methods: {
|
||
// 状态筛选按钮的样式:激活时按状态色调与卡片状态保持统一
|
||
filterItemClass(opt) {
|
||
const classes = { 'filter-group__item--active': this.statusFilter === opt.value };
|
||
if (this.statusFilter === opt.value) {
|
||
const tone = statusTone(opt.value);
|
||
if (tone) classes[`filter-group__item--tone-${tone}`] = true;
|
||
}
|
||
return classes;
|
||
}
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.search-panel {
|
||
background: #ffffff;
|
||
border-bottom: 1rpx solid #f2f2f2;
|
||
padding: 16rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.search-input-wrap {
|
||
position: relative;
|
||
|
||
::v-deep .u-search {
|
||
width: 100%;
|
||
}
|
||
|
||
::v-deep .u-search__content {
|
||
padding-right: 200rpx;
|
||
}
|
||
|
||
::v-deep .u-search__content__input {
|
||
font-size: 34rpx;
|
||
}
|
||
|
||
::v-deep .u-search__content__close {
|
||
margin-right: 12rpx;
|
||
}
|
||
}
|
||
|
||
.search-actions {
|
||
position: absolute;
|
||
right: 24rpx;
|
||
top: 50%;
|
||
transform: translateY(-50%);
|
||
height: 68rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.scan-btn {
|
||
height: 68rpx;
|
||
padding: 0 8rpx 0 4rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
&:active {
|
||
opacity: 0.88;
|
||
}
|
||
}
|
||
|
||
.search-divider {
|
||
width: 1rpx;
|
||
height: 28rpx;
|
||
background: #dcdfe6;
|
||
margin: 0 16rpx 0 10rpx;
|
||
}
|
||
|
||
.search-btn {
|
||
height: 68rpx;
|
||
padding: 0 8rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
|
||
&__text {
|
||
font-size: 34rpx;
|
||
font-weight: 500;
|
||
color: #2979ff;
|
||
line-height: 1;
|
||
}
|
||
|
||
&:active {
|
||
opacity: 0.88;
|
||
}
|
||
}
|
||
|
||
/* 状态筛选行(等宽分布,铺满整行) */
|
||
.filter-row {
|
||
margin-top: 16rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.filter-group {
|
||
flex: 1;
|
||
display: flex;
|
||
}
|
||
|
||
.filter-group__item {
|
||
flex: 1;
|
||
height: 56rpx;
|
||
padding: 0 12rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: #f5f7fa;
|
||
border: 1rpx solid #ebeef5;
|
||
border-radius: 28rpx;
|
||
}
|
||
|
||
.filter-group__item + .filter-group__item {
|
||
margin-left: 16rpx;
|
||
}
|
||
|
||
.filter-group__item--active {
|
||
background: #2979ff;
|
||
border-color: #2979ff;
|
||
box-shadow: 0 4rpx 12rpx rgba(41, 121, 255, 0.28);
|
||
}
|
||
|
||
/* 激活态色调与卡片状态一致:待盘点=蓝 / 盘点中=橙 / 已完成=绿 */
|
||
.filter-group__item--active.filter-group__item--tone-strong {
|
||
background: #2979ff;
|
||
border-color: #2979ff;
|
||
box-shadow: 0 4rpx 12rpx rgba(41, 121, 255, 0.28);
|
||
}
|
||
|
||
.filter-group__item--active.filter-group__item--tone-warning {
|
||
background: #ff9800;
|
||
border-color: #ff9800;
|
||
box-shadow: 0 4rpx 12rpx rgba(255, 152, 0, 0.28);
|
||
}
|
||
|
||
.filter-group__item--active.filter-group__item--tone-success {
|
||
background: #18a058;
|
||
border-color: #18a058;
|
||
box-shadow: 0 4rpx 12rpx rgba(24, 160, 88, 0.28);
|
||
}
|
||
|
||
.filter-group__item-text {
|
||
font-size: 34rpx;
|
||
color: #606266;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.filter-group__item--active .filter-group__item-text {
|
||
color: #ffffff;
|
||
font-weight: 600;
|
||
}
|
||
</style>
|