Files
SupplierSystem/miniprogram/components/warehouse-panel/index.wxss
T
雨天 482c7c1e89
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s
feat(小程序): 新增仓库管理内嵌面板与授权
首页 Tab 内嵌仓库管理面板:批次/可用/成本价/报告/入库时间

默认仅看可用,顶部统计库存批次、可用总量、可用货值

批量上传按 Web 流程:上传→识别→候选→人工确认,编辑可直传

新增权限码 warehouse_manage,默认赋予仓管,不映射 Web 菜单

6 条移动端薄路由,全部复用 Web 同一批 service

修复首页未转发 onReachBottom 导致内嵌列表只有第 1 页

修复录单员获授权后点仓库管理回弹(漏传 permissions)
2026-10-25 13:47:33 +08:00

612 lines
9.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
:host {
display: block;
}
.warehouse-panel {
padding: 0;
}
.warehouse-panel.is-embedded {
padding: 0 0 8rpx;
}
/* 搜索 */
.toolbar {
margin-bottom: 16rpx;
}
.search-input {
width: 100%;
height: 76rpx;
padding: 0 24rpx;
border-radius: 16rpx;
border: 1px solid #e2e8f0;
background: #ffffff;
font-size: 28rpx;
box-sizing: border-box;
}
/* 筛选 + 批量上传:同一行(条件在左、总数靠右、操作在最右) */
.filter-row {
display: flex;
align-items: center;
gap: 12rpx;
margin-bottom: 16rpx;
}
.chips {
display: flex;
align-items: center;
gap: 12rpx;
flex: none;
}
/* 方形选择框(不是糖丸):高度固定,圆角 10rpx */
.chip {
flex: none;
height: 60rpx;
line-height: 60rpx;
padding: 0 18rpx;
border-radius: 10rpx;
border: 1px solid #d4d4d8;
background: #ffffff;
color: #475569;
font-size: 22rpx;
box-sizing: border-box;
}
.chip.is-on {
border-color: #10b981;
background: #ecfdf5;
color: #047857;
font-weight: 600;
}
.total {
flex: 0 1 auto;
min-width: 0;
margin-left: auto;
color: #94a3b8;
font-size: 22rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.upload-btn {
flex: none;
margin: 0;
padding: 0 20rpx;
height: 60rpx;
line-height: 60rpx;
border-radius: 10rpx;
background: #059669;
color: #ffffff;
font-size: 22rpx;
font-weight: 500;
box-sizing: border-box;
}
.upload-btn::after {
border: none;
}
.upload-btn.is-disabled {
background: #cbd5e1;
color: #ffffff;
opacity: 1;
}
/* ── 表格 ───────────────────────────────────────────── */
.table {
border: 1px solid #e2e8f0;
border-radius: 16rpx;
background: #ffffff;
overflow: hidden;
}
.tr {
display: flex;
align-items: stretch;
border-bottom: 1px solid #f1f5f9;
}
.tr:last-child {
border-bottom: none;
}
.tr.is-selected {
background: #f6fefb;
}
.thead {
background: #f8fafc;
}
.td {
display: flex;
align-items: center;
padding: 16rpx 12rpx;
font-size: 24rpx;
color: #334155;
box-sizing: border-box;
min-width: 0;
}
.thead .td {
font-size: 22rpx;
font-weight: 600;
color: #64748b;
}
.td-product {
flex: 1;
min-width: 0;
flex-direction: column;
align-items: flex-start;
gap: 4rpx;
}
.td-qty {
width: 96rpx;
flex: none;
justify-content: flex-end;
font-weight: 600;
color: #0f172a;
}
.td-cost {
width: 124rpx;
flex: none;
justify-content: flex-end;
font-weight: 600;
color: #0f172a;
}
.td-report {
width: 104rpx;
flex: none;
justify-content: flex-end;
}
.check {
width: 34rpx;
height: 34rpx;
flex: none;
border-radius: 8rpx;
border: 2rpx solid #cbd5e1;
background: #ffffff;
}
.check.is-on {
border-color: #10b981;
background: #10b981;
}
.name {
max-width: 100%;
font-size: 26rpx;
font-weight: 600;
color: #0f172a;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.name.is-missing {
color: #b91c1c;
}
.sub {
max-width: 100%;
font-size: 20rpx;
color: #94a3b8;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.is-missing {
color: #dc2626;
}
.is-ok {
color: #047857;
}
.table-hint {
padding: 32rpx 0;
text-align: center;
color: #94a3b8;
font-size: 24rpx;
}
.hint {
padding: 20rpx 0;
text-align: center;
color: #94a3b8;
font-size: 20rpx;
}
.link.is-danger {
color: #dc2626;
}
/* 弹层(root-portal 内:固定视口、盖住底部 tab)
四边显式写全,不依赖 inset 简写;z-index 必须高于 .tab-bar(100)。 */
.sheet-mask {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10000;
display: flex;
align-items: flex-end;
justify-content: center;
background: rgba(15, 23, 42, 0.48);
}
/* 头 / 体 / 脚三段:头脚固定,只有 body 内部滚动(长列表不把按钮推出去) */
.sheet {
display: flex;
flex-direction: column;
width: 100%;
max-height: 82vh;
padding: 28rpx 32rpx calc(24rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
border-radius: 28rpx 28rpx 0 0;
background: #ffffff;
box-shadow: 0 -16rpx 48rpx rgba(15, 23, 42, 0.16);
box-sizing: border-box;
overflow: hidden;
}
/* 修改弹窗:居中卡片(与 Web 库存调整弹窗同形),不贴底、不横向满屏 */
.sheet-mask.is-center {
align-items: center;
padding: 0 48rpx;
}
.sheet.is-center {
max-width: 660rpx;
border-radius: 24rpx;
padding: 32rpx;
box-shadow: 0 24rpx 64rpx rgba(15, 23, 42, 0.24);
}
.sheet-head {
flex: none;
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 20rpx;
}
.sheet-head-text {
min-width: 0;
}
.sheet-title {
font-size: 32rpx;
font-weight: 600;
color: #0f172a;
line-height: 1.3;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.sheet-sub {
margin-top: 8rpx;
font-size: 22rpx;
color: #94a3b8;
line-height: 1.4;
}
.sheet-close {
flex: none;
width: 56rpx;
height: 56rpx;
line-height: 52rpx;
text-align: center;
font-size: 40rpx;
color: #94a3b8;
border-radius: 50%;
}
.sheet-body {
flex: 1 1 auto;
min-height: 0;
max-height: 56vh;
margin-top: 24rpx;
overflow-y: auto;
}
.sheet-field + .sheet-field {
margin-top: 24rpx;
}
.sheet-label {
display: block;
margin-bottom: 10rpx;
font-size: 24rpx;
color: #64748b;
}
.sheet-input {
width: 100%;
height: 84rpx;
padding: 0 24rpx;
border-radius: 16rpx;
border: 1px solid #e2e8f0;
background: #f8fafc;
font-size: 30rpx;
font-weight: 600;
color: #0f172a;
box-sizing: border-box;
}
.sheet-link {
display: flex;
align-items: center;
justify-content: space-between;
gap: 20rpx;
margin-top: 24rpx;
padding: 24rpx 0;
border-top: 1px dashed #e2e8f0;
border-bottom: 1px dashed #e2e8f0;
}
.sheet-link-main {
flex: 1;
min-width: 0;
display: flex;
align-items: baseline;
gap: 16rpx;
}
.sheet-link-label {
flex: none;
font-size: 26rpx;
color: #0f172a;
}
.sheet-link-value {
flex: none;
font-size: 26rpx;
font-weight: 600;
}
/* 单批次上传报告(编辑弹窗 / 报告弹窗共用):矩形圆角,与筛选项 / 上传按钮一致 */
.upload-chip {
flex: none;
padding: 12rpx 22rpx;
border-radius: 10rpx;
border: 1px solid #10b981;
background: #ecfdf5;
color: #047857;
font-size: 24rpx;
line-height: 1.5;
}
.upload-chip.is-disabled {
border-color: #cbd5e1;
background: #f1f5f9;
color: #94a3b8;
}
.report-toolbar {
flex: none;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
margin-top: 20rpx;
padding-bottom: 12rpx;
}
.report-toolbar-hint {
font-size: 22rpx;
color: #94a3b8;
}
.sheet-empty {
padding: 24rpx 0;
text-align: center;
font-size: 24rpx;
color: #94a3b8;
}
.sheet-actions {
flex: none;
display: flex;
gap: 20rpx;
margin-top: 24rpx;
}
.btn {
flex: 1;
height: 88rpx;
line-height: 88rpx;
text-align: center;
border-radius: 18rpx;
font-size: 30rpx;
}
.btn.ghost {
background: #f1f5f9;
color: #475569;
}
.btn.primary {
background: #059669;
color: #ffffff;
font-weight: 600;
}
.btn.is-disabled {
opacity: 0.6;
}
.report-list {
margin-top: 4rpx;
}
.report-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
padding: 20rpx 0;
border-bottom: 1px solid #f1f5f9;
}
.report-info {
display: flex;
flex-direction: column;
gap: 6rpx;
min-width: 0;
}
.report-type {
font-size: 26rpx;
color: #0f172a;
}
.report-meta {
font-size: 22rpx;
color: #94a3b8;
}
.report-delete {
flex: none;
font-size: 24rpx;
color: #dc2626;
}
/* ── 批量上传:文件 + 解析匹配 ─────────────────────────── */
.upload-files {
display: flex;
flex-wrap: wrap;
gap: 12rpx;
margin-bottom: 16rpx;
}
.upload-file {
display: flex;
align-items: center;
gap: 10rpx;
max-width: 100%;
padding: 8rpx 14rpx;
border-radius: 12rpx;
background: #f1f5f9;
font-size: 22rpx;
color: #475569;
}
.upload-file-name {
max-width: 380rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.upload-file-del {
flex: none;
color: #94a3b8;
font-size: 26rpx;
}
.upload-primary {
height: 76rpx;
line-height: 76rpx;
text-align: center;
border-radius: 16rpx;
background: #ecfdf5;
border: 1px solid #10b981;
color: #047857;
font-size: 26rpx;
font-weight: 600;
}
.upload-primary.is-disabled {
border-color: #cbd5e1;
background: #f1f5f9;
color: #94a3b8;
}
.match-group {
margin-top: 24rpx;
padding-top: 20rpx;
border-top: 1px dashed #e2e8f0;
}
.match-title {
font-size: 24rpx;
color: #64748b;
}
.match-item {
margin-top: 12rpx;
}
.match-product {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12rpx;
}
.match-name {
font-size: 26rpx;
font-weight: 600;
color: #0f172a;
}
.match-status {
flex: none;
font-size: 22rpx;
color: #047857;
}
.match-status.is-missing {
color: #dc2626;
}
.match-candidate {
display: flex;
align-items: flex-start;
gap: 12rpx;
margin-top: 10rpx;
padding: 14rpx;
border-radius: 12rpx;
border: 1px solid #e2e8f0;
background: #ffffff;
}
.match-candidate.is-on {
border-color: #10b981;
background: #f6fefb;
}
.match-candidate-text {
display: flex;
flex-direction: column;
gap: 4rpx;
min-width: 0;
}
.match-candidate-label {
font-size: 24rpx;
color: #0f172a;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.match-candidate-meta {
font-size: 20rpx;
color: #94a3b8;
}