219 lines
6.9 KiB
Plaintext
219 lines
6.9 KiB
Plaintext
|
<!-- 仓库管理页面 -->
|
|||
|
<view class="warehouse-container">
|
|||
|
<!-- 顶部导航栏 -->
|
|||
|
<view class="page-header">
|
|||
|
<view class="header-content">
|
|||
|
<view class="header-left">
|
|||
|
<!-- 微信风格返回按钮 -->
|
|||
|
<view class="back-icon" bindtap="goBack">
|
|||
|
<text class="back-arrow">‹</text>
|
|||
|
</view>
|
|||
|
<text class="header-title">仓库管理</text>
|
|||
|
</view>
|
|||
|
<view class="header-actions">
|
|||
|
<button class="refresh-btn" bindtap="loadWarehouses">刷新</button>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
|
|||
|
<!-- 消息提示 -->
|
|||
|
<view wx:if="{{errorMessage}}" class="error-message">
|
|||
|
<text>{{errorMessage}}</text>
|
|||
|
<text class="close-btn" bindtap="clearError">×</text>
|
|||
|
</view>
|
|||
|
|
|||
|
<view wx:if="{{successMessage}}" class="success-message">
|
|||
|
<text>{{successMessage}}</text>
|
|||
|
<text class="close-btn" bindtap="clearSuccess">×</text>
|
|||
|
</view>
|
|||
|
|
|||
|
<!-- 加载状态 -->
|
|||
|
<view wx:if="{{loading}}" class="loading-container">
|
|||
|
<view class="loading-spinner"></view>
|
|||
|
<text class="loading-text">加载中...</text>
|
|||
|
</view>
|
|||
|
|
|||
|
<!-- 页面标签 -->
|
|||
|
<view class="tab-container">
|
|||
|
<view
|
|||
|
class="tab-item {{currentTab === 'list' ? 'active' : ''}}"
|
|||
|
data-tab="list"
|
|||
|
bindtap="switchTab"
|
|||
|
>
|
|||
|
<text>仓库列表</text>
|
|||
|
</view>
|
|||
|
<view
|
|||
|
class="tab-item {{currentTab === 'add' ? 'active' : ''}}"
|
|||
|
data-tab="add"
|
|||
|
bindtap="switchTab"
|
|||
|
>
|
|||
|
<text>添加仓库</text>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
|
|||
|
<!-- 仓库列表页面 -->
|
|||
|
<view wx:if="{{currentTab === 'list'}}" class="list-page">
|
|||
|
<!-- 搜索框 -->
|
|||
|
<view class="search-container">
|
|||
|
<view class="search-input-wrapper">
|
|||
|
<input
|
|||
|
class="search-input"
|
|||
|
placeholder="搜索仓库名称、地址、联系人..."
|
|||
|
bindinput="onSearchInput"
|
|||
|
value="{{searchKeyword}}"
|
|||
|
/>
|
|||
|
<text class="search-icon">🔍</text>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
|
|||
|
<!-- 仓库列表 -->
|
|||
|
<scroll-view class="warehouse-list" scroll-y>
|
|||
|
<view wx:if="{{filteredWarehouses.length === 0}}" class="empty-state">
|
|||
|
<text class="empty-icon">🏭</text>
|
|||
|
<text class="empty-text">
|
|||
|
{{searchKeyword ? '未找到相关仓库' : '暂无仓库数据'}}
|
|||
|
</text>
|
|||
|
</view>
|
|||
|
|
|||
|
<view wx:for="{{filteredWarehouses}}" wx:key="id" class="warehouse-item">
|
|||
|
<view class="warehouse-header">
|
|||
|
<view class="warehouse-info">
|
|||
|
<text class="warehouse-name">{{item.name}}</text>
|
|||
|
<view class="warehouse-status">
|
|||
|
<text class="status-badge {{item.status}}">
|
|||
|
{{getWarehouseStatusText(item.status)}}
|
|||
|
</text>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
<view class="warehouse-actions">
|
|||
|
<button
|
|||
|
class="delete-btn"
|
|||
|
data-id="{{item.id}}"
|
|||
|
data-name="{{item.name}}"
|
|||
|
bindtap="deleteWarehouse"
|
|||
|
>删除</button>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="warehouse-details">
|
|||
|
<view class="detail-row">
|
|||
|
<text class="detail-label">地址:</text>
|
|||
|
<text class="detail-value">{{item.address}}</text>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="detail-row">
|
|||
|
<text class="detail-label">联系人:</text>
|
|||
|
<text class="detail-value">{{item.contact || '未设置'}}</text>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="detail-row">
|
|||
|
<text class="detail-label">电话:</text>
|
|||
|
<text class="detail-value">{{item.phone || '未设置'}}</text>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="detail-row">
|
|||
|
<text class="detail-label">库存状态:</text>
|
|||
|
<text
|
|||
|
class="detail-value inventory-status"
|
|||
|
style="color: {{getInventoryStatusColor(item)}}"
|
|||
|
>
|
|||
|
{{getWarehouseInventoryStatus(item)}}
|
|||
|
</text>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="detail-row">
|
|||
|
<text class="detail-label">容量:</text>
|
|||
|
<text class="detail-value">{{item.capacity || 0}} 件</text>
|
|||
|
</view>
|
|||
|
|
|||
|
<view wx:if="{{item.description}}" class="detail-row">
|
|||
|
<text class="detail-label">描述:</text>
|
|||
|
<text class="detail-value description">{{item.description}}</text>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
</scroll-view>
|
|||
|
</view>
|
|||
|
|
|||
|
<!-- 添加仓库页面 -->
|
|||
|
<view wx:if="{{currentTab === 'add'}}" class="add-page">
|
|||
|
<scroll-view class="form-container" scroll-y>
|
|||
|
<view class="form-section">
|
|||
|
<text class="section-title">基本信息</text>
|
|||
|
|
|||
|
<view class="form-group">
|
|||
|
<text class="form-label">仓库名称 *</text>
|
|||
|
<input
|
|||
|
class="form-input"
|
|||
|
placeholder="请输入仓库名称"
|
|||
|
bindinput="onNameInput"
|
|||
|
value="{{addForm.name}}"
|
|||
|
/>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="form-group">
|
|||
|
<text class="form-label">仓库地址 *</text>
|
|||
|
<input
|
|||
|
class="form-input"
|
|||
|
placeholder="请输入仓库地址"
|
|||
|
bindinput="onAddressInput"
|
|||
|
value="{{addForm.address}}"
|
|||
|
/>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="form-group">
|
|||
|
<text class="form-label">联系人 *</text>
|
|||
|
<input
|
|||
|
class="form-input"
|
|||
|
placeholder="请输入联系人姓名"
|
|||
|
bindinput="onContactInput"
|
|||
|
value="{{addForm.contact}}"
|
|||
|
/>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="form-group">
|
|||
|
<text class="form-label">联系电话 *</text>
|
|||
|
<input
|
|||
|
class="form-input"
|
|||
|
placeholder="请输入联系电话"
|
|||
|
bindinput="onPhoneInput"
|
|||
|
value="{{addForm.phone}}"
|
|||
|
type="number"
|
|||
|
/>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="form-group">
|
|||
|
<text class="form-label">仓库容量</text>
|
|||
|
<input
|
|||
|
class="form-input"
|
|||
|
placeholder="请输入仓库容量(件数)"
|
|||
|
bindinput="onCapacityInput"
|
|||
|
value="{{addForm.capacity}}"
|
|||
|
type="number"
|
|||
|
/>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="form-section">
|
|||
|
<text class="section-title">其他信息</text>
|
|||
|
|
|||
|
<view class="form-group">
|
|||
|
<text class="form-label">仓库描述</text>
|
|||
|
<textarea
|
|||
|
class="form-textarea"
|
|||
|
placeholder="请输入仓库描述信息(可选)"
|
|||
|
bindinput="onDescriptionInput"
|
|||
|
value="{{addForm.description}}"
|
|||
|
maxlength="200"
|
|||
|
/>
|
|||
|
<text class="textarea-counter">{{addForm.description ? addForm.description.length : 0}}/200</text>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
|
|||
|
<view class="form-actions">
|
|||
|
<button class="submit-btn" bindtap="submitAddForm">添加仓库</button>
|
|||
|
<button class="reset-btn" bindtap="resetForm">重置表单</button>
|
|||
|
</view>
|
|||
|
</scroll-view>
|
|||
|
</view>
|
|||
|
</view>
|