① 规格从商品名列(被单位/数量/单价挤到极窄、规格与商品名都折行)移到卡片行下方独占一行; ② 单价输入预填去 0:0 视为未定价 ⇒ 留空(点击即可直接填,无需先删 0),>0 才预填;pickCostPriceHint 的「0 合法」语义不变。 均只改自采列表卡片,新增两条契约测试。
550 lines
27 KiB
Plaintext
550 lines
27 KiB
Plaintext
<view class="purchase-today-panel {{embedded ? 'is-embedded' : ''}}">
|
|
<view wx:if="{{!hideProgress}}" class="kpi-card anim-rise">
|
|
<view class="kpi-left">
|
|
<text class="kpi-label">采购进度</text>
|
|
<text class="kpi-date">{{heroDate || '今天'}}</text>
|
|
</view>
|
|
<view class="kpi-right">
|
|
<text class="kpi-label">已完成</text>
|
|
<text class="kpi-progress xd-num">{{completedCount}} / {{totalCount}}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="main-panel anim-rise {{tab === 'today' ? 'anim-rise--delay' : ''}}">
|
|
<view class="panel-head">
|
|
<view class="panel-head-left">
|
|
<view wx:if="{{tab === 'today'}}" class="today-toolbar-row">
|
|
<view class="aggregate-toggle aggregate-toggle--compact">
|
|
<view class="aggregate-switch-wrap">
|
|
<switch
|
|
class="aggregate-switch"
|
|
checked="{{aggregateSameProducts}}"
|
|
disabled="{{aggregateSaving}}"
|
|
bindchange="onToggleAggregate"
|
|
color="#059669"
|
|
/>
|
|
</view>
|
|
<view class="aggregate-text">
|
|
<text class="aggregate-label">合计相同商品</text>
|
|
</view>
|
|
</view>
|
|
<view wx:if="{{canOrderItems}}" class="order-item-tools">
|
|
<view class="order-item-tool order-item-tool--add" data-mode="add" bindtap="openOrderItemsDialog">加单</view>
|
|
<view class="order-item-tool order-item-tool--remove" data-mode="edit" bindtap="openOrderItemsDialog">改单</view>
|
|
</view>
|
|
</view>
|
|
<view class="seg-tabs">
|
|
<view class="seg-tab ptp-seg-tab {{tab === 'today' ? 'active' : ''}}" data-tab="today" bindtap="switchTab">今日待采</view>
|
|
<view class="seg-tab ptp-seg-tab {{tab === 'history' ? 'active' : ''}}" data-tab="history" bindtap="switchTab">历史自采</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<block wx:if="{{tab === 'today'}}">
|
|
<view class="filter-row today-date-axis">
|
|
<picker
|
|
mode="selector"
|
|
range="{{todayDateFieldLabels}}"
|
|
value="{{todayDateFieldIndex}}"
|
|
bindchange="onTodayDateFieldChange"
|
|
>
|
|
<view class="filter-chip axis-pick">{{todayDateFieldLabel}} ▾</view>
|
|
</picker>
|
|
<view class="filter-chip {{!todayQueryDate ? 'active' : ''}}" bindtap="onTodayQueryAll">全部</view>
|
|
<picker mode="date" value="{{todayQueryDate}}" bindchange="onTodayQueryDateChange">
|
|
<view class="filter-chip {{todayQueryDate ? 'active' : ''}}">{{todayQueryDate ? todayDateChipLabel : '选择日期'}} ▾</view>
|
|
</picker>
|
|
</view>
|
|
<scroll-view wx:if="{{categoryOptions.length}}" scroll-x class="category-scroll" show-scrollbar="{{false}}">
|
|
<view
|
|
class="category-chip {{selectedCategory === '' ? 'active' : ''}}"
|
|
bindtap="onCategoryFilter"
|
|
data-code=""
|
|
>全部</view>
|
|
<view
|
|
wx:for="{{categoryOptions}}"
|
|
wx:key="category_code"
|
|
class="category-chip {{selectedCategory === item.category_code ? 'active' : ''}}"
|
|
bindtap="onCategoryFilter"
|
|
data-code="{{item.category_code}}"
|
|
>{{item.category_name || '未分类'}}{{item.count ? ' (' + item.count + ')' : ''}}</view>
|
|
</scroll-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 && categoryGroups.length === 0}}" class="state-box">
|
|
<van-empty description="{{todayQueryDate ? '该日暂无待采购商品' : '暂无待采购商品'}}" />
|
|
</view>
|
|
|
|
<view class="today-product-list">
|
|
<block wx:for="{{categoryGroups}}" wx:key="categoryKey" wx:for-item="group">
|
|
<view wx:if="{{group.showDayHeader}}" class="today-day-head">{{group.dayLabel}}</view>
|
|
<view
|
|
wx:for="{{group.productGroups}}"
|
|
wx:key="productKey"
|
|
wx:for-item="product"
|
|
class="product-row-card {{group.isEarliestDay ? 'is-earliest' : ''}}"
|
|
>
|
|
<view class="product-row">
|
|
<view
|
|
wx:if="{{product.warehouseDemandRecord}}"
|
|
class="btn-done ptp-row-btn is-disabled"
|
|
>无需操作</view>
|
|
<view
|
|
wx:elif="{{product.pendingCount > 0 && !product.needs_product_setup}}"
|
|
class="btn-done ptp-row-btn {{batchSubmitting ? 'is-disabled' : ''}}"
|
|
data-product-key="{{product.productKey}}"
|
|
bindtap="completeProductGroup"
|
|
>完成</view>
|
|
<view
|
|
wx:if="{{product.direct_delivery && product.pendingCount > 0 && !product.needs_product_setup && !product.warehouseDemandRecord}}"
|
|
class="btn-photo ptp-row-btn {{batchSubmitting ? 'is-disabled' : ''}}"
|
|
data-product-key="{{product.productKey}}"
|
|
bindtap="chooseDirectPhoto"
|
|
>{{product.photoCount > 0 ? '已拍' + product.photoCount : (product.photoRequired ? '拍照' : '拍照')}}</view>
|
|
<view class="product-row-name">
|
|
<text class="task-title ptp-row-title">{{product.productName}}</text>
|
|
<text wx:if="{{product.remarkText}}" class="product-row-remark">{{product.remarkText}}</text>
|
|
<text wx:if="{{product.warehouseDemandRecord}}" class="task-sub">仓内加工 · 只读记录</text>
|
|
</view>
|
|
<view wx:if="{{product.warehouseDemandRecord}}" class="product-row-demand">
|
|
<text class="demand-label">需求</text>
|
|
<text class="demand-qty ptp-row-title">{{product.planQtyText}}{{product.unit}}</text>
|
|
<text wx:if="{{product.items.length > 1}}" class="demand-extra">{{product.items.length}}单</text>
|
|
</view>
|
|
<block wx:if="{{product.pendingCount > 0 && !product.needs_product_setup && !product.warehouseDemandRecord}}">
|
|
<picker
|
|
mode="selector"
|
|
range="{{product.unitOptions}}"
|
|
value="{{product.unitIndex}}"
|
|
data-product-key="{{product.productKey}}"
|
|
bindchange="onProductUnitChange"
|
|
>
|
|
<view class="unit-picker unit-picker--row ptp-row-unit">{{product.unit || '个'}} ▾</view>
|
|
</picker>
|
|
<view class="input-with-unit product-row-num">
|
|
<input
|
|
class="input ptp-row-input"
|
|
type="digit"
|
|
placeholder="{{product.planQtyText}}"
|
|
value="{{product.actual_qty_input}}"
|
|
data-product-key="{{product.productKey}}"
|
|
data-field="actual_qty_input"
|
|
bindinput="onProductActualInput"
|
|
/>
|
|
<text class="unit-tag ptp-row-unit-tag">{{product.unit}}</text>
|
|
</view>
|
|
<view class="input-with-unit product-row-num">
|
|
<input
|
|
class="input ptp-row-input"
|
|
type="digit"
|
|
placeholder="单价"
|
|
value="{{product.actual_price_input}}"
|
|
data-product-key="{{product.productKey}}"
|
|
data-field="actual_price_input"
|
|
bindinput="onProductActualInput"
|
|
/>
|
|
<text class="unit-tag ptp-row-unit-tag">元</text>
|
|
</view>
|
|
</block>
|
|
<view
|
|
wx:if="{{product.pendingCount > 0 && !product.needs_product_setup && product.canAssignAny}}"
|
|
class="btn-stockout ptp-row-btn {{batchSubmitting ? 'is-disabled' : ''}}"
|
|
data-code="{{product.assignPurchaseCode}}"
|
|
bindtap="assignToSupplier"
|
|
>转供应商</view>
|
|
</view>
|
|
|
|
<view wx:if="{{product.specText}}" class="product-row-spec">规格:{{product.specText}}</view>
|
|
|
|
<view wx:if="{{product.needs_product_setup}}" class="setup-hint">未匹配商品库,请在下方逐单确认名称和分类</view>
|
|
|
|
<view wx:if="{{product.needs_product_setup}}" class="product-children">
|
|
<view wx:for="{{product.items}}" wx:key="purchase_code" wx:for-item="item" class="child-item">
|
|
<view wx:if="{{item.can_assign_supplier && item.order_supplier_name}}" class="supplier-hint">
|
|
订单供应商:{{item.order_supplier_name}}
|
|
</view>
|
|
|
|
<view wx:if="{{item.needs_product_setup && (item.purchase_status < 30 || item.purchase_status == 32)}}" class="product-setup">
|
|
<view class="field-block">
|
|
<view class="field-label">商品名称</view>
|
|
<input
|
|
class="input setup-input"
|
|
value="{{item.item_name_input}}"
|
|
placeholder="填写标准商品名称"
|
|
data-code="{{item.purchase_code}}"
|
|
bindinput="onItemNameInput"
|
|
/>
|
|
</view>
|
|
<view class="field-block field-block-cat">
|
|
<view class="field-label">商品分类</view>
|
|
<view class="cat-field-row">
|
|
<view class="cat-picker-wrap">
|
|
<view
|
|
class="item-control item-control-cat {{item.category_has_value ? 'cat-filled' : 'cat-empty'}}"
|
|
data-code="{{item.purchase_code}}"
|
|
catchtap="toggleCategoryDropdown"
|
|
>
|
|
<text class="cat-label">{{item.category_display}}</text>
|
|
<text class="cat-arrow">▾</text>
|
|
</view>
|
|
<view
|
|
wx:if="{{activeCategoryPurchaseCode === item.purchase_code}}"
|
|
class="cat-dropdown-panel"
|
|
catchtap=""
|
|
>
|
|
<view class="cat-dropdown-search-wrap">
|
|
<input
|
|
class="cat-dropdown-search"
|
|
placeholder="输入关键字搜索分类"
|
|
value="{{categoryDropdownQuery}}"
|
|
focus="{{categorySearchFocus}}"
|
|
adjust-position="{{false}}"
|
|
hold-keyboard
|
|
confirm-type="search"
|
|
bindfocus="onCategorySearchFocus"
|
|
bindinput="onCategoryDropdownSearch"
|
|
/>
|
|
</view>
|
|
<scroll-view scroll-y class="cat-dropdown-list">
|
|
<view
|
|
wx:for="{{categoryDropdownOptions}}"
|
|
wx:for-item="opt"
|
|
wx:for-index="sidx"
|
|
wx:key="category_code"
|
|
class="cat-dropdown-item {{opt.category_code === categoryDropdownCurrentCode ? 'selected' : ''}}"
|
|
data-sidx="{{sidx}}"
|
|
catchtap="pickCategoryFromDropdown"
|
|
>{{opt.label || opt.category_name}}</view>
|
|
<view wx:if="{{!categoryDropdownOptions.length}}" class="cat-dropdown-empty">无匹配分类</view>
|
|
</scroll-view>
|
|
<view class="cat-dropdown-footer" catchtap="openQuickCategoryFromDropdown">+ 新建分类</view>
|
|
</view>
|
|
</view>
|
|
<view class="cat-add-btn" data-code="{{item.purchase_code}}" catchtap="openQuickCategory">+</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="actions" wx:if="{{item.needs_product_setup && (item.purchase_status === 10 || item.purchase_status == 32)}}">
|
|
<button
|
|
wx:if="{{item.can_assign_supplier}}"
|
|
size="mini"
|
|
class="btn-secondary action-btn"
|
|
data-code="{{item.purchase_code}}"
|
|
bindtap="assignToSupplier"
|
|
>转供应商</button>
|
|
<button
|
|
wx:if="{{item.direct_delivery && (item.purchase_status == 32 || item.purchase_status === 10)}}"
|
|
size="mini"
|
|
class="btn-secondary action-btn"
|
|
data-code="{{item.purchase_code}}"
|
|
bindtap="chooseDirectPhotoRow"
|
|
>{{item.photoCount > 0 ? '已拍照' : '拍照'}}</button>
|
|
<button
|
|
wx:if="{{item.purchase_status == 32 || item.purchase_status === 10}}"
|
|
size="mini"
|
|
class="btn-primary action-btn"
|
|
data-code="{{item.purchase_code}}"
|
|
data-status="20"
|
|
bindtap="updateStatus"
|
|
>{{item.purchase_status == 32 ? '重新采购' : '完成'}}</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
</block>
|
|
|
|
<block wx:if="{{tab === 'history'}}">
|
|
<view class="toolbar-card">
|
|
<view class="filter-row history-toolbar">
|
|
<view
|
|
wx:for="{{periodOptions}}"
|
|
wx:key="key"
|
|
class="filter-chip period-chip {{historyPeriod === item.key ? 'active' : ''}}"
|
|
data-period="{{item.key}}"
|
|
bindtap="onHistoryPeriodTap"
|
|
>{{item.label}}</view>
|
|
</view>
|
|
<view class="filter-row history-range">
|
|
<picker
|
|
mode="selector"
|
|
range="{{historyDateFieldLabels}}"
|
|
value="{{historyDateFieldIndex}}"
|
|
bindchange="onHistoryDateFieldChange"
|
|
>
|
|
<view class="range-chip date-field-chip">{{historyDateFieldLabel}} ▾</view>
|
|
</picker>
|
|
<picker mode="date" value="{{historyFrom}}" end="{{historyTo}}" bindchange="onHistoryFromChange">
|
|
<view class="range-chip">起 <text class="range-value">{{historyFrom || '请选择'}}</text></view>
|
|
</picker>
|
|
<picker mode="date" value="{{historyTo}}" start="{{historyFrom}}" bindchange="onHistoryToChange">
|
|
<view class="range-chip">止 <text class="range-value">{{historyTo || '请选择'}}</text></view>
|
|
</picker>
|
|
</view>
|
|
<view class="history-export-row">
|
|
<view wx:if="{{historyPeriodLabel}}" class="period-summary">
|
|
当前周期:{{historyPeriodLabel}} · {{historyDateFieldLabel}}<text wx:if="{{historySummary}}"> · {{historySummary}}</text>
|
|
</view>
|
|
<view class="export-actions">
|
|
<view
|
|
class="export-btn export-btn--ghost {{historyPrinting ? 'is-disabled' : ''}}"
|
|
bindtap="printHistoryList"
|
|
>{{historyPrinting ? '打印中' : '打印'}}</view>
|
|
<view
|
|
class="export-btn {{historyExporting ? 'is-disabled' : ''}}"
|
|
bindtap="exportHistoryExcel"
|
|
>{{historyExporting ? '导出中' : '导出 Excel'}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{historyError}}" class="error-box">{{historyError}}</view>
|
|
<view wx:if="{{historyLoading}}" class="state-box">
|
|
<van-loading size="24px" color="#059669">加载中...</van-loading>
|
|
</view>
|
|
<view wx:elif="{{!historyLoading && !historyError && historyDayGroups.length === 0}}" class="state-box">
|
|
<van-empty description="该周期暂无历史采购记录" />
|
|
</view>
|
|
|
|
<view wx:for="{{historyDayGroups}}" wx:key="dayKey" wx:for-item="group" class="order-group">
|
|
<view class="order-header" bindtap="toggleHistoryDayGroup" data-day="{{group.dayKey}}">
|
|
<view class="order-header-main">
|
|
<van-icon
|
|
name="{{group.collapsed ? 'arrow' : 'arrow-down'}}"
|
|
size="14px"
|
|
color="#a1a1aa"
|
|
/>
|
|
<view class="order-title">{{group.dayLabel}}</view>
|
|
</view>
|
|
<view class="day-header-side">
|
|
<text wx:if="{{group.totalAmountText}}" class="day-total-amount">合计 ¥{{group.totalAmountText}}</text>
|
|
<view class="order-badge">{{group.items.length}} 项</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{!group.collapsed}}" class="archive-table">
|
|
<view class="archive-tr archive-tr--head">
|
|
<text class="archive-td archive-td--name ptp-archive-cell">商品名</text>
|
|
<text class="archive-td archive-td--qty ptp-archive-cell">数量</text>
|
|
<text class="archive-td archive-td--price ptp-archive-cell">单价</text>
|
|
<text class="archive-td archive-td--total ptp-archive-cell">合计</text>
|
|
</view>
|
|
<view wx:for="{{group.items}}" wx:for-item="item" wx:key="purchase_code" class="archive-tr">
|
|
<view class="archive-td archive-td--name ptp-archive-cell">
|
|
<text user-select>{{item.item_name || '未知商品'}}</text>
|
|
<text wx:if="{{item.spi_pending}}" class="archive-tag">待入库</text>
|
|
</view>
|
|
<text class="archive-td archive-td--qty ptp-archive-cell">{{item.display_qty}} {{item.unit || '个'}}</text>
|
|
<text class="archive-td archive-td--price ptp-archive-cell">¥{{item.display_price}}</text>
|
|
<text class="archive-td archive-td--total ptp-archive-cell">¥{{item.total_price_text}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
|
|
<view
|
|
wx:if="{{tab === 'today' && totalCount > 0}}"
|
|
class="bottom-bar-slot {{embedded ? 'bottom-bar-slot--embedded' : ''}}"
|
|
/>
|
|
<root-portal enable="{{true}}">
|
|
<view wx:if="{{tab === 'today' && totalCount > 0}}" class="bottom-bar {{embedded ? 'bottom-bar--embedded' : ''}}">
|
|
<view class="bottom-left">
|
|
<view class="bottom-total-label">今日待采金额</view>
|
|
<view class="bottom-total-value xd-num">¥{{todayTotalText}}</view>
|
|
<view class="bottom-done-hint">{{completedCount}} 项已完成</view>
|
|
</view>
|
|
<view
|
|
class="bottom-submit {{batchSubmitting || pendingCount === 0 ? 'is-disabled' : ''}}"
|
|
bindtap="completeAllPending"
|
|
>一键全部完成</view>
|
|
</view>
|
|
</root-portal>
|
|
|
|
<root-portal enable="{{true}}">
|
|
<view wx:if="{{showQuickCategoryModal}}" class="modal-mask {{showSpiModal ? 'modal-mask--over-spi' : ''}}" bindtap="closeQuickCategoryModal">
|
|
<view class="modal-card" catchtap="">
|
|
<view class="modal-title">新建分类</view>
|
|
<input class="modal-input" placeholder="分类名称" value="{{quickCategoryName}}" bindinput="onQuickCategoryNameInput" />
|
|
<view class="modal-actions">
|
|
<button class="btn-secondary modal-btn" bindtap="closeQuickCategoryModal">取消</button>
|
|
<button class="btn-primary modal-btn" loading="{{creatingCategory}}" bindtap="submitQuickCategory">创建</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</root-portal>
|
|
|
|
<root-portal enable="{{true}}">
|
|
<view wx:if="{{showSpiModal}}" class="spi-mask" catchtouchmove="stopSpiTap" bindtap="closeSpiModal">
|
|
<view class="spi-modal-card {{(activeCategoryPurchaseCode === spiCategoryTarget || spiUnitDropdownOpen || spiSkuListOpen) ? 'spi-modal-card--dropdown-open' : ''}}" catchtap="stopSpiTap" catchtouchmove="stopSpiTap">
|
|
<view class="spi-title">新增自采商品</view>
|
|
<view class="spi-mode-row">
|
|
<view class="spi-mode {{spiMode === 'select' ? 'active' : ''}}" data-mode="select" bindtap="setSpiMode">选择商品</view>
|
|
<view class="spi-mode {{spiMode === 'create' ? 'active' : ''}}" data-mode="create" bindtap="setSpiMode">新建商品</view>
|
|
</view>
|
|
<block wx:if="{{spiMode === 'select'}}">
|
|
<view class="spi-field">
|
|
<view class="spi-field-label">商品</view>
|
|
<view class="spi-sku-search">
|
|
<input
|
|
class="spi-control"
|
|
placeholder-class="spi-placeholder"
|
|
placeholder="输入名称或编码搜索"
|
|
value="{{spiSkuQuery}}"
|
|
confirm-type="search"
|
|
adjust-position="{{false}}"
|
|
hold-keyboard
|
|
bindfocus="onSpiSkuFocus"
|
|
bindinput="onSpiSkuInput"
|
|
/>
|
|
<scroll-view
|
|
wx:if="{{spiSkuListOpen}}"
|
|
scroll-y
|
|
class="spi-suggestions"
|
|
catchtouchmove="stopSpiTap"
|
|
>
|
|
<view wx:if="{{spiSkuSearching}}" class="spi-suggestion spi-suggestion-muted">搜索中...</view>
|
|
<view
|
|
wx:for="{{spiSkuSuggestions}}"
|
|
wx:key="sku_code"
|
|
class="spi-suggestion"
|
|
data-index="{{index}}"
|
|
catchtap="pickSpiSku"
|
|
>
|
|
<view class="spi-sku-name">{{item.sku_name}}</view>
|
|
<view class="spi-sku-meta">{{item.sku_code}} · {{item.unit || '斤'}}</view>
|
|
</view>
|
|
<view wx:if="{{!spiSkuSearching && !spiSkuSuggestions.length}}" class="spi-suggestion spi-suggestion-muted">暂无可选商品</view>
|
|
</scroll-view>
|
|
</view>
|
|
<view wx:if="{{spiForm.sku_code}}" class="spi-selected">已选 {{spiForm.sku_name}} · {{spiForm.sku_code}}</view>
|
|
</view>
|
|
</block>
|
|
<block wx:else>
|
|
<view class="spi-field">
|
|
<view class="spi-field-label">商品名称</view>
|
|
<input class="spi-control" placeholder-class="spi-placeholder" placeholder="输入商品名称" value="{{spiForm.sku_name}}" data-field="sku_name" bindinput="onSpiFormInput" />
|
|
</view>
|
|
<view class="spi-grid">
|
|
<view class="spi-field">
|
|
<view class="spi-field-label">分类</view>
|
|
<view class="spi-select-row">
|
|
<view class="cat-picker-wrap">
|
|
<view
|
|
class="spi-control spi-control--select {{spiForm.category_label ? '' : 'is-placeholder'}}"
|
|
data-code="{{spiCategoryTarget}}"
|
|
catchtap="toggleCategoryDropdown"
|
|
>
|
|
<text class="cat-label">{{spiForm.category_label || '选择分类'}}</text>
|
|
<text class="cat-arrow">▾</text>
|
|
</view>
|
|
<view
|
|
wx:if="{{activeCategoryPurchaseCode === spiCategoryTarget}}"
|
|
class="cat-dropdown-panel spi-dropdown-panel"
|
|
catchtap=""
|
|
>
|
|
<view class="cat-dropdown-search-wrap">
|
|
<input
|
|
class="cat-dropdown-search"
|
|
placeholder="输入关键字搜索分类"
|
|
value="{{categoryDropdownQuery}}"
|
|
focus="{{categorySearchFocus}}"
|
|
adjust-position="{{false}}"
|
|
hold-keyboard
|
|
confirm-type="search"
|
|
bindfocus="onCategorySearchFocus"
|
|
bindinput="onCategoryDropdownSearch"
|
|
/>
|
|
</view>
|
|
<scroll-view scroll-y class="cat-dropdown-list">
|
|
<view
|
|
wx:for="{{categoryDropdownOptions}}"
|
|
wx:for-item="opt"
|
|
wx:for-index="sidx"
|
|
wx:key="category_code"
|
|
class="cat-dropdown-item {{opt.category_code === categoryDropdownCurrentCode ? 'selected' : ''}}"
|
|
data-sidx="{{sidx}}"
|
|
catchtap="pickCategoryFromDropdown"
|
|
>{{opt.label || opt.category_name}}</view>
|
|
<view wx:if="{{!categoryDropdownOptions.length}}" class="cat-dropdown-empty">无匹配分类</view>
|
|
</scroll-view>
|
|
<view class="cat-dropdown-footer" catchtap="openQuickCategoryFromDropdown">+ 新建分类</view>
|
|
</view>
|
|
</view>
|
|
<view class="cat-add-btn" data-code="{{spiCategoryTarget}}" catchtap="openQuickCategory">+</view>
|
|
</view>
|
|
</view>
|
|
<view class="spi-field">
|
|
<view class="spi-field-label">单位</view>
|
|
<view class="cat-picker-wrap">
|
|
<view class="spi-control spi-control--select" catchtap="toggleSpiUnitDropdown">
|
|
<text class="cat-label">{{spiForm.unit || '斤'}}</text>
|
|
<text class="cat-arrow">▾</text>
|
|
</view>
|
|
<view wx:if="{{spiUnitDropdownOpen}}" class="cat-dropdown-panel spi-dropdown-panel" catchtap="">
|
|
<view class="cat-dropdown-search-wrap">
|
|
<input
|
|
class="cat-dropdown-search"
|
|
placeholder="输入关键字搜索单位"
|
|
value="{{spiUnitQuery}}"
|
|
focus="{{spiUnitSearchFocus}}"
|
|
adjust-position="{{false}}"
|
|
hold-keyboard
|
|
confirm-type="search"
|
|
bindfocus="onSpiUnitSearchFocus"
|
|
bindinput="onSpiUnitDropdownSearch"
|
|
/>
|
|
</view>
|
|
<scroll-view scroll-y class="cat-dropdown-list">
|
|
<view
|
|
wx:for="{{spiUnitOptions}}"
|
|
wx:for-item="unitOpt"
|
|
wx:key="*this"
|
|
class="cat-dropdown-item {{unitOpt === spiForm.unit ? 'selected' : ''}}"
|
|
data-unit="{{unitOpt}}"
|
|
catchtap="pickSpiUnit"
|
|
>{{unitOpt}}</view>
|
|
<view wx:if="{{!spiUnitOptions.length}}" class="cat-dropdown-empty">无匹配单位</view>
|
|
</scroll-view>
|
|
<view wx:if="{{spiUnitCanUseQuery}}" class="cat-dropdown-footer" catchtap="useSpiUnitQuery">使用「{{spiUnitQuery}}」</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
<view class="spi-grid">
|
|
<view class="spi-field">
|
|
<view class="spi-field-label">数量</view>
|
|
<input class="spi-control" placeholder-class="spi-placeholder" type="digit" placeholder="0" value="{{spiForm.qty}}" data-field="qty" bindinput="onSpiFormInput" />
|
|
</view>
|
|
<view class="spi-field">
|
|
<view class="spi-field-label">成本价</view>
|
|
<input class="spi-control" placeholder-class="spi-placeholder" type="digit" placeholder="0" value="{{spiForm.unit_cost}}" data-field="unit_cost" bindinput="onSpiFormInput" />
|
|
</view>
|
|
</view>
|
|
<view class="spi-field">
|
|
<view class="spi-field-label">备注</view>
|
|
<textarea class="spi-control spi-control--area" placeholder-class="spi-placeholder" placeholder="选填" value="{{spiForm.remark}}" data-field="remark" bindinput="onSpiFormInput" />
|
|
</view>
|
|
<view class="spi-actions">
|
|
<button class="spi-btn spi-btn--ghost" bindtap="closeSpiModal">取消</button>
|
|
<button class="spi-btn spi-btn--primary" loading="{{spiSubmitting}}" bindtap="submitSpiInbound">确认入库</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</root-portal>
|
|
|
|
<canvas type="2d" id="printCanvas" class="print-canvas"></canvas>
|
|
<ble-printer-sheet id="blePicker" />
|
|
<purchaser-order-dialog
|
|
id="purchaserOrderDialog"
|
|
bind:saved="onOrderItemsSaved"
|
|
bind:independentinbound="openSpiModal"
|
|
/>
|
|
</view>
|