Files
SupplierSystem/miniprogram/components/picking-panel/index.wxml
T
雨天 7a280409d1
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 改先入库先出
出库拍照:单据级改商品级(picking_items.outbound_photos)。完成分拣时逐行提交,Web/小程序在商品行「调整」旁加「拍照」;分拣出库界面读回展示,已完成(pick_status>=30)单只读、可点开大图。

FIFO:四处取批次由「效期优先 expiry ASC NULLS LAST」改为「先入库先出 created_at ASC, expiry ASC NULLS FIRST」(入库时刻相同才比效期、且空效期优先)。开发者 2026-10-12 定(读法 A)。

迁移 20261039:加 picking_items.outbound_photos,并 DROP 作废的 picking_tasks.outbound_photos(从未写入)。

联动同步:inventory-freeze 规则 / AGENTS.md / 三篇设计文 / V3 / 全景图 data.js 与产物;契约测试 stockCoverBatchPlan 更新。

验证:两端 tsc;门禁 8/8(check-ai-cost 按例保持红);服务端 33 文件/40 例、前端 3 文件/4 例 = 基线。
2026-10-12 16:50:07 +08:00

212 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="{{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
wx:if="{{activeTask.pick_status < 30}}"
class="btn-batch btn-batch-photo {{photoUploadingId === item.id ? 'is-disabled' : ''}}"
data-id="{{item.id}}"
catchtap="pickItemPhotos"
>{{photoUploadingId === item.id ? '上传中…' : '拍照'}}</view>
</view>
<view wx:if="{{rowPhotos[item.id].length}}" class="row-photo-line">
<view wx:for="{{rowPhotos[item.id]}}" wx:for-item="photo" wx:key="path" class="row-photo-item">
<image class="row-photo-img" src="{{photo.tempFilePath}}" mode="aspectFill" />
<view class="row-photo-del" data-id="{{item.id}}" data-index="{{index}}" catchtap="removeItemPhoto">×</view>
</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>