复用行内「拍照」按钮,上传出库照后用第 1 张照片让 AI 只读生产日期(不认商品名),按 production_date 匹配本行候选批次:唯一命中则先取该批次、余量按 FIFO 补,并在同一个「调整批次」弹窗里高亮该行;多命中/无命中/日期为 null 回退 FIFO。无论是否匹配都打开同一弹窗,未配多模态或识别失败静默降级为手动选批次,不阻断分拣。 - 后端: 提示词 picking.batch.production_date、解析纯函数 parseProductionDateJson、服务 pickingBatchDateService、路由 POST /mobile/picking/recognize-production-date - 小程序: request.recognizePickingProductionDate;抽出 buildEditorState 与 openBatchEditor 共用;新增 .batch-row-ai 高亮 - 零新增界面文案;登记 AI-30;补设计文档与契约测试
220 lines
9.7 KiB
Plaintext
220 lines
9.7 KiB
Plaintext
<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="bottom-sub {{saving ? 'is-disabled' : ''}}"
|
||
data-pick="{{activePickCode}}"
|
||
bindtap="confirmAllPicks"
|
||
>一键确认</view>
|
||
<view
|
||
class="btn-primary bottom-main {{saving ? 'is-disabled' : ''}}"
|
||
data-pick="{{activePickCode}}"
|
||
bindtap="submitComplete"
|
||
>分拣完成</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 {{item.ai ? 'batch-row-ai' : ''}}">
|
||
<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>
|
||
|
||
<canvas type="2d" id="printCanvas" class="print-canvas"></canvas>
|
||
<ble-printer-sheet id="blePicker" />
|
||
</view>
|