开发者:「区域这块要做得像一个选择框,当前还以为是纯文字」。.rate-pick 此前无边框/背景(与旁边实收 .r2-field 的灰底框不一致)⇒ 补 边框+圆角+灰底+width:100%,并在 区域/产月 后加 ▾ 箭头。
228 lines
9.8 KiB
Plaintext
228 lines
9.8 KiB
Plaintext
<template name="inboundCard">
|
||
<view class="xd-row-card {{item.input_rating === '不合格' ? 'xd-row-card--danger' : ''}}">
|
||
<view class="card-r1">
|
||
<view class="card-title-wrap">
|
||
<text class="task-title">{{item.item_name || '未知商品'}}</text>
|
||
<text class="photo-hint {{item.photoRequired ? 'need' : 'skip'}}">{{item.photoRequired ? '须拍照' : '免拍照'}}</text>
|
||
<text wx:if="{{item.independent_inbound}}" class="photo-hint independent">独立入库</text>
|
||
<text class="task-meta">{{item.prepare_qty || 0}}{{item.unit || ''}}</text>
|
||
</view>
|
||
<view
|
||
class="btn-return {{submittingId === item.id ? 'is-disabled' : ''}}"
|
||
data-id="{{item.id}}"
|
||
bindtap="markFailThenSubmit"
|
||
>退回</view>
|
||
<view
|
||
class="btn-pass {{submittingId === item.id ? 'is-disabled' : ''}}"
|
||
data-id="{{item.id}}"
|
||
bindtap="submitPassInspection"
|
||
>确认入库</view>
|
||
</view>
|
||
<view class="card-r2">
|
||
<view class="r2-photo">
|
||
<view wx:if="{{item.photoUrls.length}}" class="photo-grid">
|
||
<view
|
||
wx:for="{{item.photoUrls}}"
|
||
wx:for-item="photoUrl"
|
||
wx:for-index="photoIndex"
|
||
wx:key="*this"
|
||
class="photo-thumb-wrap"
|
||
>
|
||
<image
|
||
class="photo-thumb"
|
||
src="{{photoUrl}}"
|
||
mode="aspectFit"
|
||
data-url="{{photoUrl}}"
|
||
bindtap="previewPhoto"
|
||
/>
|
||
<view
|
||
class="photo-del"
|
||
catchtap="deletePhoto"
|
||
data-id="{{item.id}}"
|
||
data-index="{{photoIndex}}"
|
||
>×</view>
|
||
</view>
|
||
</view>
|
||
<view class="btn-photo" data-id="{{item.id}}" bindtap="choosePhoto">拍照</view>
|
||
</view>
|
||
<view class="r2-field">
|
||
<input
|
||
class="qty-input"
|
||
type="digit"
|
||
value="{{item.input_qty}}"
|
||
data-id="{{item.id}}"
|
||
bindinput="onQtyInput"
|
||
placeholder="实收"
|
||
/>
|
||
</view>
|
||
<picker
|
||
wx:if="{{item.requires_prepackaged_check}}"
|
||
class="r2-picker"
|
||
mode="date"
|
||
fields="month"
|
||
value="{{item.production_month}}"
|
||
data-id="{{item.id}}"
|
||
bindchange="onProductionMonthChange"
|
||
>
|
||
<view class="rate-pick">{{item.production_month || '产月'}} ▾</view>
|
||
</picker>
|
||
<picker
|
||
class="r2-picker"
|
||
mode="selector"
|
||
range="{{zoneRange}}"
|
||
value="{{item.zoneIndex}}"
|
||
data-id="{{item.id}}"
|
||
bindchange="onZoneChange"
|
||
>
|
||
<view class="rate-pick {{item.storage_zone ? '' : 'is-empty'}}">{{item.storage_zone || '区域'}} ▾</view>
|
||
</picker>
|
||
</view>
|
||
<view class="card-r3">
|
||
<input class="r3-input" type="text" value="{{item.input_spec}}" data-id="{{item.id}}" bindinput="onSpecInput" placeholder="规格" />
|
||
<picker class="r3-picker" mode="date" value="{{item.production_date}}" data-id="{{item.id}}" bindchange="onProductionDateChange">
|
||
<view class="r3-pick {{item.production_date ? '' : 'is-empty'}}">{{item.production_date || '生产日期'}}</view>
|
||
</picker>
|
||
<view class="r3-shelf">
|
||
<input class="r3-input r3-input--num" type="digit" value="{{item.input_shelf_life_value}}" data-id="{{item.id}}" bindinput="onShelfValueInput" placeholder="保质期" />
|
||
<picker class="r3-unit" mode="selector" range="{{shelfLifeUnits}}" value="{{item.input_shelf_life_unit_index}}" data-id="{{item.id}}" bindchange="onShelfUnitChange">
|
||
<view class="r3-unit-pick {{item.input_shelf_life_unit ? '' : 'is-empty'}}">{{item.input_shelf_life_unit || '单位'}} ▾</view>
|
||
</picker>
|
||
</view>
|
||
<input class="r3-input" type="text" value="{{item.input_origin}}" data-id="{{item.id}}" bindinput="onOriginInput" placeholder="产地" />
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<view class="page inspection-page {{embedded ? 'is-embedded' : ''}}">
|
||
<view wx:if="{{!hideProgress}}" class="kpi-card">
|
||
<view class="kpi-cell">
|
||
<view class="kpi-num xd-num">{{pendingCount}}</view>
|
||
<view class="kpi-label">待入库</view>
|
||
</view>
|
||
<view class="kpi-divider"></view>
|
||
<view class="kpi-cell">
|
||
<view class="kpi-num xd-num">{{doneCount}}</view>
|
||
<view class="kpi-label">本批条数</view>
|
||
</view>
|
||
<view class="kpi-divider"></view>
|
||
<view class="kpi-cell">
|
||
<view class="kpi-num xd-num">{{photoRequiredCount}}</view>
|
||
<view class="kpi-label">须拍照</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view wx:if="{{!embedded}}" class="filter-pills">
|
||
<view
|
||
wx:for="{{sourceOptions}}"
|
||
wx:key="*this"
|
||
class="filter-pill {{sourceIndex === index ? 'on' : ''}}"
|
||
data-index="{{index}}"
|
||
bindtap="onSourcePillTap"
|
||
>{{item}}</view>
|
||
</view>
|
||
|
||
<view class="list-sheet">
|
||
<view class="batch-row">
|
||
<view class="batch-btn-wrap">
|
||
<button class="xd-btn-primary batch-btn" size="mini" bindtap="submitAllEligible" loading="{{batchSubmitting}}" disabled="{{batchSubmitting}}">
|
||
一键全部合格入库
|
||
</button>
|
||
<button class="batch-btn batch-btn--report" size="mini" bindtap="onUploadBatchReports" loading="{{reportBusy}}" disabled="{{reportBusy}}">
|
||
一键上传批次报告
|
||
</button>
|
||
</view>
|
||
<view wx:if="{{categoryChips.length}}" class="cat-grid">
|
||
<view
|
||
wx:for="{{categoryChips}}"
|
||
wx:key="name"
|
||
class="cat-cell {{categoryFilter === item.name ? 'is-active' : ''}}"
|
||
data-name="{{item.name}}"
|
||
bindtap="onCategoryTap"
|
||
>
|
||
<view class="cat-cell-name">{{item.name}}</view>
|
||
<view class="cat-cell-count">{{item.count}}</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<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="text-error">{{error}}</view>
|
||
<view wx:if="{{loading}}" class="text-muted">加载中...</view>
|
||
<view wx:if="{{!loading && visibleRows.length === 0}}" class="text-muted empty">{{categoryFilter ? '该分类暂无待入库任务' : '当前类型暂无待入库任务'}}</view>
|
||
|
||
<block wx:if="{{!loading && visibleRows.length && foldSameSku}}">
|
||
<block wx:for="{{dayCategoryGroups}}" wx:key="groupKey" wx:for-item="group">
|
||
<view wx:if="{{group.showDayHeader}}" class="today-day-head">{{group.dayLabel}}</view>
|
||
<view wx:for="{{group.skuGroups}}" wx:key="key" wx:for-item="skuGroup" class="sku-group">
|
||
<view
|
||
wx:if="{{skuGroup.multi}}"
|
||
class="sku-group-head {{skuGroup.collapsed ? 'is-collapsed' : ''}}"
|
||
data-key="{{skuGroup.key}}"
|
||
bindtap="toggleSkuGroup"
|
||
>
|
||
<view class="sku-group-main">
|
||
<view class="sku-group-title">{{skuGroup.name}}</view>
|
||
<view class="sku-group-meta">
|
||
{{skuGroup.count}}单 · 应收 {{skuGroup.prepareSumText}}{{skuGroup.unit}} · 已填 {{skuGroup.actualSumText}}{{skuGroup.unit}}
|
||
</view>
|
||
</view>
|
||
<view class="sku-group-chevron">{{skuGroup.collapsed ? '展开' : '收起'}}</view>
|
||
</view>
|
||
<block wx:if="{{!skuGroup.multi || !skuGroup.collapsed}}">
|
||
<block wx:for="{{skuGroup.items}}" wx:for-item="item" wx:key="id">
|
||
<template is="inboundCard" data="{{item, submittingId, analyzingId, resultOptions, zoneRange, shelfLifeUnits}}" />
|
||
</block>
|
||
</block>
|
||
</view>
|
||
</block>
|
||
</block>
|
||
<block wx:elif="{{!loading && visibleRows.length}}">
|
||
<block wx:for="{{dayCategoryGroups}}" wx:key="groupKey" wx:for-item="group">
|
||
<view wx:if="{{group.showDayHeader}}" class="today-day-head">{{group.dayLabel}}</view>
|
||
<block wx:for="{{group.items}}" wx:key="id" wx:for-item="item">
|
||
<template is="inboundCard" data="{{item, submittingId, analyzingId, resultOptions, zoneRange, shelfLifeUnits}}" />
|
||
</block>
|
||
</block>
|
||
</block>
|
||
</view>
|
||
|
||
<root-portal enable="{{true}}">
|
||
<view wx:if="{{reportReview}}" class="report-mask" bindtap="onReportCancel"></view>
|
||
<view wx:if="{{reportReview}}" class="report-sheet" catchtap="noop">
|
||
<view class="report-sheet-head">批次报告识别结果</view>
|
||
<scroll-view scroll-y class="report-sheet-body">
|
||
<view wx:for="{{reportReview}}" wx:key="key" class="report-row">
|
||
<view class="report-row-info">
|
||
<text class="report-row-name">{{item.product_name || '未识别品名'}}</text>
|
||
<text class="report-row-match {{item.row_id ? 'is-hit' : 'is-miss'}}">{{item.match_label}}</text>
|
||
</view>
|
||
<picker mode="date" value="{{item.production_date}}" data-index="{{index}}" bindchange="onReportDateChange">
|
||
<view class="report-row-date {{item.production_date ? '' : 'is-empty'}}">{{item.production_date || '选择生产日期'}} ▾</view>
|
||
</picker>
|
||
</view>
|
||
</scroll-view>
|
||
<view class="report-sheet-foot">
|
||
<view class="report-btn ghost" catchtap="onReportCancel">取消</view>
|
||
<view class="report-btn primary" catchtap="onReportConfirm">确定</view>
|
||
</view>
|
||
</view>
|
||
</root-portal>
|
||
</view>
|