Files
SupplierSystem/miniprogram/components/purchaser-order-dialog/index.wxml
T
Ubuntu deb3e72750
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
chore: 以 AI 生鲜配送系统 当前版本作为 SupplierSystem 起点
来源仓库:jxc/ai-fresh-delivery
来源提交:f0b1a180e2deb7e4673b9d1c8542619f7bc0f73d
快照树:  09f679334ff38f0ff25e907961c94a8223bcaedd(与来源 HEAD 工作树逐字节一致,3801 个文件)

按约定本仓库不带任何历史提交:来源仓库的历史中含真实凭据
(生产 SSH 私钥 deploy/id_rsa_tencent、server/.env、.env.tencent/.env.production/.env.gitea、
deploy/小程序AppSecret.txt,其中 MP_APPSECRET / S3 AccessKey 经哈希比对与线上同值),
整包推送会把这些凭据永久带入本仓库,故只取「当前版本」的单提交快照。
供应商系统后续开发自本提交开始。
2026-10-08 17:35:43 +08:00

194 lines
8.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.
<root-portal enable="{{true}}">
<view wx:if="{{visible}}" class="pod-mask" catchtouchmove="stopTap" bindtap="close">
<view class="pod-sheet" catchtap="stopTap">
<view class="pod-head">
<view>
<view class="pod-title">{{title}}</view>
<view class="pod-subtitle">{{mode === 'add' ? '只添加新商品,不展示或修改原商品' : '可改名称、数量、单位、销售价、采购成本,也可删行'}}</view>
</view>
<view class="pod-close" bindtap="close">×</view>
</view>
<scroll-view scroll-y class="pod-body">
<view class="pod-picker-row">
<picker mode="selector" range="{{customerLabels}}" value="{{customerIndex}}" bindchange="onCustomerPick">
<view class="pod-picker">
<text class="pod-label">客户</text>
<text class="pod-value">{{customerLabels[customerIndex] || '请选择客户'}} ▾</text>
</view>
</picker>
<picker mode="selector" range="{{orderLabels}}" value="{{orderIndex}}" bindchange="onOrderPick">
<view class="pod-picker">
<text class="pod-label">订单</text>
<text class="pod-value">{{orderLabels[orderIndex] || '请选择订单'}} ▾</text>
</view>
</picker>
</view>
<view wx:if="{{loading}}" class="pod-state">
<van-loading size="22px" color="#059669">加载中...</van-loading>
</view>
<view wx:if="{{error}}" class="pod-error">{{error}}</view>
<block wx:if="{{detail && mode === 'add'}}">
<view class="pod-section-title">新增商品</view>
<view class="pod-sku-search">
<input
class="pod-input pod-input-wide"
placeholder="输入商品名称或编码搜索"
value="{{draft.item_name}}"
bindfocus="onSkuFocus"
bindinput="onSkuInput"
bindblur="onSkuBlur"
/>
<view wx:if="{{skuFocused}}" class="pod-suggestions pod-sku-suggestions">
<view wx:if="{{skuSearching}}" class="pod-suggestion pod-suggestion-muted">搜索中...</view>
<view
wx:for="{{skuSuggestions}}"
wx:key="sku_code"
class="pod-suggestion"
data-index="{{index}}"
catchtap="pickSku"
>
<view class="pod-sku-name">{{item.sku_name}}</view>
<view class="pod-sku-meta">
{{item.sku_code}} · {{item.unit || '斤'}}
<text wx:if="{{item.from_quote}}"> · 客户报价 ¥{{item.sale_price}}</text>
</view>
</view>
<view wx:if="{{skuCanCreate}}" class="pod-suggestion pod-suggestion-add" catchtap="chooseCreateSku">
新建商品「{{skuQuery}}」
</view>
<view wx:if="{{!skuSearching && !skuSuggestions.length && !skuCanCreate}}" class="pod-suggestion pod-suggestion-muted">
暂无可选商品
</view>
</view>
</view>
<view wx:if="{{draft.sku_code || draft.create_product}}" class="pod-sku-selected">
<text wx:if="{{draft.sku_code}}">已选商品:{{draft.sku_code}}</text>
<text wx:else>待新建商品:确认加单后自动生成编码</text>
</view>
<view class="pod-grid">
<view class="pod-field">
<text class="pod-label">数量</text>
<input class="pod-input" type="digit" placeholder="0" value="{{draft.quantity}}" data-field="quantity" bindinput="onDraftInput" />
</view>
<view class="pod-field">
<text class="pod-label">单位</text>
<input class="pod-input" placeholder="斤" value="{{draft.unit}}" data-field="unit" bindinput="onDraftInput" />
</view>
<view class="pod-field">
<text class="pod-label">销售价</text>
<input class="pod-input" type="digit" placeholder="0" value="{{draft.price}}" data-field="price" bindinput="onDraftInput" />
</view>
<view class="pod-field">
<text class="pod-label">采购成本</text>
<input class="pod-input" type="digit" placeholder="0" value="{{draft.cost_price}}" data-field="cost_price" bindinput="onDraftInput" />
</view>
</view>
<view class="pod-field pod-category">
<text class="pod-label">分类</text>
<input
class="pod-input"
placeholder="输入搜索分类,找不到可新增"
value="{{draft.category_input}}"
bindfocus="onCategoryFocus"
bindinput="onCategoryInput"
bindblur="onCategoryBlur"
/>
<view wx:if="{{categoryFocused && (categorySuggestions.length || categoryCanCreate)}}" class="pod-suggestions">
<view
wx:for="{{categorySuggestions}}"
wx:key="category_code"
class="pod-suggestion"
data-index="{{index}}"
catchtap="pickCategory"
>{{item.label || item.category_name}}</view>
<view wx:if="{{categoryCanCreate}}" class="pod-suggestion pod-suggestion-add" catchtap="createCategory">
新增「{{categoryQuery}}」
</view>
</view>
</view>
<view class="pod-grid">
<view class="pod-field">
<text class="pod-label">供应商</text>
<picker mode="selector" range="{{supplierLabels}}" value="{{supplierIndex}}" bindchange="onSupplierPick">
<view class="pod-select">{{supplierLabels[supplierIndex] || '未分配(自采)'}} ▾</view>
</picker>
</view>
<view class="pod-field">
<text class="pod-label">加工</text>
<picker mode="selector" range="{{processingMethods}}" value="{{processingIndex}}" bindchange="onProcessingPick">
<view class="pod-select">{{draft.processing_method || '原材料'}} ▾</view>
</picker>
</view>
</view>
<view wx:if="{{draft.processing_method && draft.processing_method !== '原材料'}}" class="pod-owner-row">
<view
class="pod-owner-chip {{draft.processing_owner === 'warehouse' ? 'on' : ''}}"
data-owner="warehouse"
bindtap="onProcessingOwnerTap"
>仓内加工</view>
<view
class="pod-owner-chip {{draft.processing_owner === 'supplier' ? 'on' : ''}}"
data-owner="supplier"
bindtap="onProcessingOwnerTap"
>供应商已加工</view>
</view>
</block>
<block wx:if="{{detail && mode === 'edit'}}">
<view class="pod-section-title">订单商品</view>
<view wx:if="{{!editItems.length}}" class="pod-state">订单暂无商品</view>
<view wx:for="{{editItems}}" wx:key="id" class="pod-item {{item.pending_remove ? 'is-remove' : ''}}">
<view class="pod-item-main">
<input
class="pod-input pod-input-wide"
disabled="{{item.pending_remove}}"
placeholder="商品名称"
value="{{item.item_name}}"
data-index="{{index}}"
data-field="item_name"
bindinput="onEditItemInput"
/>
<view class="pod-grid">
<view class="pod-field">
<text class="pod-label">数量</text>
<input class="pod-input" type="digit" disabled="{{item.pending_remove}}" value="{{item.quantity}}" data-index="{{index}}" data-field="quantity" bindinput="onEditItemInput" />
</view>
<view class="pod-field">
<text class="pod-label">单位</text>
<input class="pod-input" disabled="{{item.pending_remove}}" value="{{item.unit}}" data-index="{{index}}" data-field="unit" bindinput="onEditItemInput" />
</view>
<view class="pod-field">
<text class="pod-label">单价</text>
<input class="pod-input" type="digit" disabled="{{item.pending_remove}}" value="{{item.price}}" data-index="{{index}}" data-field="price" bindinput="onEditItemInput" />
</view>
<view class="pod-field">
<text class="pod-label">成本</text>
<input class="pod-input" type="digit" disabled="{{item.pending_remove}}" value="{{item.cost_price}}" data-index="{{index}}" data-field="cost_price" bindinput="onEditItemInput" />
</view>
</view>
</view>
<view class="pod-remove-btn" data-index="{{index}}" bindtap="toggleRemoveItem">
{{item.pending_remove ? '取消删除' : '删除'}}
</view>
</view>
</block>
</scroll-view>
<view class="pod-footer">
<button class="pod-btn pod-btn-cancel" bindtap="close">取消</button>
<button
class="pod-btn pod-btn-primary"
loading="{{saving}}"
disabled="{{saving || !detail}}"
bindtap="save"
>确认{{title}}</button>
</view>
</view>
</view>
</root-portal>