Files
SupplierSystem/miniprogram/components/picking-panel/index.wxml
T
雨天 15682b859c
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
小程序分拣: 出库照可点击预览大图
分拣行内出库照缩略图此前没有点击事件(只其它面板有预览),只能看 88rpx 小图。

给 .row-photo-item 加 bindtap → wx.previewImage 看大图(用会话内 tempFilePath —— photo.path 是对象存储 key,不能直接预览);删除按钮仍 catchtap,点「×」只删除、不误触预览。不改拍照/上传/落库链路,零新增文案。
2026-10-16 14:21:08 +08:00

228 lines
9.9 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"
data-id="{{item.id}}"
data-index="{{index}}"
bindtap="previewItemPhoto"
>
<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>