Files
SupplierSystem/miniprogram/components/picking-panel/index.wxml
T
雨天 b59443539a
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(分拣批次卡): 补显效期,解释「为何先出这批」
- 背景:本系统 FIFO = **效期优先**(ORDER BY expiry_date ASC NULLS LAST, created_at ASC),不是先入库先出;界面原先不显示效期,用户无法理解排序
- 后端 listPickingOutboundBatches 增返 expiry_date
- Web 批次编辑行 + 小程序批次卡补显「效期 {expiry}」;rowMeta 三语同步
- 不改排序口径(库存冻结面);只多显示一个字段
- 验证:两端 tsc + 小程序 node --check 通过;前端全量仍基线(3 文件/4 例)
2026-10-12 16:28:12 +08:00

214 lines
9.4 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.
<view class="pick-page {{embedded ? 'is-embedded' : ''}} {{activeTask.pick_status == 30 ? 'pick-page--outbound' : (activeTask.pick_status < 30 ? 'pick-page--picking' : '')}}">
<view class="page-atmosphere" aria-hidden="true"></view>
<view wx:if="{{!hideProgress}}" class="kpi-card">
<view class="kpi-cell">
<view class="kpi-num xd-num">{{tasks.length}}</view>
<view class="kpi-label">我的任务</view>
</view>
<view class="kpi-divider"></view>
<view class="kpi-cell">
<view class="kpi-num xd-num">{{taskSummary.pickedCount || 0}}</view>
<view class="kpi-label">已确认</view>
</view>
<view class="kpi-divider"></view>
<view class="kpi-cell">
<view class="kpi-num xd-num">{{pendingCount || 0}}</view>
<view class="kpi-label">待分拣</view>
</view>
</view>
<view class="list-sheet">
<view class="date-axis">
<picker
mode="selector"
range="{{dateFieldOptions}}"
range-key="label"
value="{{dateFieldIndex}}"
bindchange="onDateFieldPick"
>
<view class="date-chip axis-pick">{{dateFieldLabel}} ▾</view>
</picker>
<picker mode="date" value="{{dateFrom || todayValue}}" bindchange="onCustomFromChange">
<view class="date-chip date-pick {{dateFrom ? 'on' : ''}}">{{dateFrom || '起始日'}} ▾</view>
</picker>
<picker mode="date" value="{{dateTo || dateFrom || todayValue}}" bindchange="onCustomToChange">
<view class="date-chip date-pick {{dateTo ? 'on' : ''}}">{{dateTo || '结束日'}} ▾</view>
</picker>
</view>
<view wx:if="{{error}}" class="error-box">{{error}}</view>
<view wx:if="{{loading}}" class="state-box">
<van-loading size="24px" color="#059669">加载中...</van-loading>
</view>
<view wx:elif="{{!loading && tasks.length === 0}}" class="state-box">
<van-empty description="暂无分配给您的拣货单,请联系仓管在 Web「分拣出库」中分配" />
</view>
<view wx:if="{{scopeGroups.length}}" class="scope-wrap">
<view class="scope-select {{scopeMenuOpen ? 'is-open' : ''}}" bindtap="toggleScopeMenu">
<text class="scope-select-val">{{scopePickerLabels[scopePickerIndex]}}</text>
<text class="scope-select-arrow">▾</text>
</view>
<view wx:if="{{scopeMenuOpen}}" class="scope-menu">
<view
wx:for="{{scopeGroups}}"
wx:key="key"
class="scope-option {{item.key === activeGroupKey ? 'is-active' : ''}}"
data-key="{{item.key}}"
catchtap="onScopeOptionTap"
>{{item.label}}</view>
</view>
</view>
<block wx:if="{{activeTask}}">
<view wx:if="{{hasOpenPicks}}" class="outbound-photo">
<view class="outbound-photo-head">
<text class="outbound-photo-title">出库拍照(可选)</text>
<text class="outbound-photo-hint">不拍也能完成</text>
</view>
<view class="outbound-photo-list">
<view class="outbound-photo-add" bindtap="pickOutboundPhotos">{{photoUploading ? '上传中…' : '拍照/选图'}}</view>
<view wx:for="{{outboundPhotos}}" wx:key="path" class="outbound-photo-item">
<image class="outbound-photo-img" src="{{item.tempFilePath}}" mode="aspectFill" />
<view class="outbound-photo-del" data-index="{{index}}" catchtap="removeOutboundPhoto">×</view>
</view>
</view>
</view>
<view wx:if="{{taskSummary}}" class="progress-line">
<text>已确认 {{taskSummary.pickedCount}}/{{taskSummary.total}}</text>
<view class="progress-bar">
<view
class="progress-fill"
style="width: {{taskSummary.total ? (taskSummary.pickedCount / taskSummary.total * 100) : 0}}%;"
></view>
</view>
<text class="items-meta">待 {{pendingCount}}</text>
</view>
<block wx:for="{{activePendingItems}}" wx:key="rowKey">
<view wx:if="{{item._zone}}" class="zone-head">{{item.zone_label}}</view>
<view
wx:else
class="detail-row {{item.picked_done ? 'is-done' : 'is-pending'}}"
>
<view class="line-one">
<view
wx:if="{{activeTask.pick_status < 30 || item.can_pick}}"
class="btn-pick {{saving ? 'is-disabled' : ''}}"
data-pick="{{item.pick_code || activePickCode}}"
data-id="{{item.id}}"
catchtap="confirmItemPick"
>确认</view>
<text class="line-product">{{item.display_name}}</text>
<text class="qty-meta">需求 {{item.required_qty}}{{item.unit || ''}}</text>
<block wx:if="{{activeTask.pick_status < 30 || item.can_pick}}">
<view class="qty-chip">
<text class="qty-chip-lab">{{item.qty_chip_label}}</text>
<input
class="qty-input {{pickingScaleRequired && item.pick_by_weight && !(item.input_weight > 0) ? 'qty-input--warn' : ''}}"
type="digit"
value="{{item.pick_by_weight ? item.input_weight : item.input_qty}}"
data-pick="{{item.pick_code || activePickCode}}"
data-id="{{item.id}}"
data-field="{{item.pick_by_weight ? 'input_weight' : 'input_qty'}}"
bindinput="onFieldInput"
/>
</view>
<view wx:if="{{item.need_extra_weight}}" class="qty-chip qty-chip--extra">
<text class="qty-chip-lab">重量</text>
<input
class="qty-input"
type="digit"
value="{{item.input_weight}}"
data-pick="{{item.pick_code || activePickCode}}"
data-id="{{item.id}}"
data-field="input_weight"
bindinput="onFieldInput"
/>
</view>
</block>
<block wx:elif="{{item.line_pick_status >= 30 && !item.can_pick}}">
<text class="qty-meta">已拣 {{item.picked_qty_num || 0}}{{item.unit || ''}}</text>
</block>
</view>
<view wx:if="{{batchesMap[item.id]}}" class="batch-line">
<text class="batch-lab">批次</text>
<block wx:if="{{batchesMap[item.id].loading}}">
<text class="batch-muted">加载中</text>
</block>
<block wx:elif="{{batchesMap[item.id].plan_text}}">
<text class="batch-sum">{{batchesMap[item.id].plan_text}}</text>
<text wx:if="{{batchesMap[item.id].shortfall}}" class="batch-warn">缺 {{batchesMap[item.id].shortfall}}</text>
</block>
<block wx:elif="{{batchesMap[item.id].error}}">
<text class="batch-muted">{{batchesMap[item.id].error}}</text>
</block>
<block wx:else>
<text class="batch-muted">无可扣批次</text>
</block>
<view class="btn-batch" data-id="{{item.id}}" catchtap="openBatchEditor">调整</view>
</view>
</view>
</block>
</block>
</view>
<view
wx:if="{{hasOpenPicks}}"
class="bottom-bar-slot {{embedded ? 'bottom-bar-slot--embedded' : ''}}"
/>
<view
wx:if="{{activeTask && !hasOpenPicks && activeTask.pick_status == 30}}"
class="bottom-bar-slot bottom-bar-slot--stack {{embedded ? 'bottom-bar-slot--embedded' : ''}}"
/>
<root-portal enable="{{true}}">
<view wx:if="{{hasOpenPicks}}" class="bottom-bar bottom-bar--row {{embedded ? 'bottom-bar--embedded' : ''}}">
<view
class="btn-primary bottom-main {{saving ? 'is-disabled' : ''}}"
data-pick="{{activePickCode}}"
bindtap="confirmAllPicks"
>一键确认</view>
</view>
<view wx:if="{{activeTask && !hasOpenPicks && activeTask.pick_status == 30}}" class="bottom-bar bottom-bar--stack {{embedded ? 'bottom-bar--embedded' : ''}}">
<view class="flow-tip">分拣已完成,订单进入待配送,等待司机装车核货</view>
</view>
<view wx:if="{{editor}}" class="batch-mask" bindtap="closeBatchEditor"></view>
<view wx:if="{{editor}}" class="batch-sheet" catchtap="noop">
<view class="batch-sheet-head">
<text class="batch-sheet-title">{{editor.name}}</text>
<text class="batch-sheet-sub">需 {{editor.need}}{{editor.unit}} · 可扣 {{editor.claimable}}</text>
</view>
<view class="batch-sheet-body">
<view wx:for="{{editor.rows}}" wx:key="batch_id" class="batch-row">
<view class="batch-row-info">
<text class="batch-row-no">{{item.batch_no}}</text>
<text class="batch-row-meta">{{item.storage_zone || '未设区域'}} · 入库 {{item.inbound_date || '—'}} · 效期 {{item.expiry_date || '—'}} · 可用 {{item.available_qty}}</text>
</view>
<input
class="batch-input"
type="digit"
value="{{item.qty}}"
data-index="{{index}}"
bindinput="onBatchQtyInput"
/>
</view>
</view>
<view class="batch-sheet-total">
<text>合计 {{editor.total}} / 需 {{editor.need}}</text>
<text wx:if="{{editor.shortfall}}" class="batch-warn">库存不足,还缺 {{editor.shortfall}}</text>
</view>
<view class="batch-sheet-foot">
<view class="batch-btn ghost" catchtap="resetBatchEditorFifo">按先进先出</view>
<view class="batch-btn primary" catchtap="applyBatchEditor">确定</view>
</view>
</view>
</root-portal>
</view>