This commit is contained in:
quantulr
2023-09-01 17:14:27 +08:00
parent a09291a1c8
commit cf3e2db09d
27 changed files with 308 additions and 330 deletions

View File

@ -3,144 +3,105 @@
<t-message id="t-message" />
<wxs module="times" src="../../utils/time.wxs" />
<wxs module="utils" src="../../utils/utils.wxs" />
<view class="block">
<t-navbar title="库存管理" t-class="nav" t-class-title="nav-title" />
</view>
<statistics-card statistics-data="{{statisticsData}}" />
<t-sticky class="stock-stick">
<view class="stock-tabs">
<t-tabs defaultValue="{{0}}" value="{{stockType}}" bind:change="onTabsChange" theme="tag">
<t-tab-panel label="库" value="{{0}}" />
<t-tab-panel label="库" value="{{1}}" />
<t-tab-panel label="出库" value="{{2}}" />
</t-tabs>
</view>
</t-sticky>
<view class="stock-tabs">
<t-tabs defaultValue="{{0}}" value="{{stockType}}" bind:change="onTabsChange" theme="tag">
<t-tab-panel label="库存" value="{{0}}" />
<t-tab-panel label="库" value="{{1}}" />
<t-tab-panel label="库" value="{{2}}" />
</t-tabs>
</view>
<view class="stock-list">
<t-fab wx:if="{{stockType > 0 && utils.hasPermission('product:product:add', permissions)}}" class="float-button" icon="add" aria-label="增加" bind:click="handleAddStock"></t-fab>
<view hidden="{{stockType!=0}}" class="scroll-container">
<view class="grid">
<view wx:for="{{storageList}}" wx:key="specId" class="card">
<view class="fields">
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">产品</text>
<text class="value">{{item.productName}}</text>
<t-cell-group theme="card">
<t-swipe-cell wx:for="{{storageList}}" wx:key="specId">
<t-cell data-spec-id="{{item.specId}}" hover>
<view class="left-icon" slot="left-icon">
<t-image src="{{item.specPics[0]}}" shape="round" error="slot" width="120rpx" height="120rpx">
<t-icon name="image-error" slot="error" />
</t-image>
</view>
<view slot="title" class="title">
<view>{{item.productName}}</view>
</view>
<view slot="description" class="description">
<view class="spec">
<text>{{item.modelName}}</text>
<view class="divider">|</view>
<text>{{item.specName}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">型号</text>
<text class="value">{{item.modelName}}</text>
</view>
<view slot="note" class="note storage">
{{item.stock}}
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">规格</text>
<text class="value">{{item.specName}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">库存</text>
<text class="value">{{item.stock}}</text>
</view>
</view>
</view>
</view>
</view>
</t-cell>
</t-swipe-cell>
</t-cell-group>
<load-more status="{{storageLoadingStatus}}" />
</view>
<view hidden="{{stockType!=1}}" class="scroll-container">
<view class="grid">
<view wx:for="{{inStockList}}" wx:key="logId" class="card">
<t-image class="prove-pic" mode="aspectFill" error="slot" src="{{item.provePic[0]}}">
<t-icon name="image-error" slot="error" />
</t-image>
<view class="fields">
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">产品</text>
<text class="value">{{item.productName}}</text>
<t-cell-group theme="card">
<t-swipe-cell wx:for="{{inStockList}}" wx:key="logId">
<t-cell data-spec-id="{{item.specId}}" hover>
<view class="left-icon" slot="left-icon">
<t-image src="{{item.provePic[0]}}" shape="round" error="slot" width="120rpx" height="120rpx">
<t-icon name="image-error" slot="error" />
</t-image>
</view>
<view slot="title" class="title">
<view>{{item.productName}}</view>
</view>
<view slot="description" class="description">
<view class="spec">
<text>{{item.modelName}}</text>
<view class="divider">|</view>
<text>{{item.specName}}</text>
</view>
<view class="date">
<t-tag theme="success" size="small">入库</t-tag> <text>{{times.formatDate(item.date) || ''}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">型号</text>
<text class="value">{{item.modelName}}</text>
</view>
<view slot="note" class="note in">
{{item.total}}
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">规格</text>
<text class="value">{{item.specName}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">数量</text>
<text class="value">{{item.total}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">日期</text>
<text class="value">{{times.formatDate(item.date) || "-"}}</text>
</view>
</view>
</view>
</view>
</view>
</t-cell>
</t-swipe-cell>
</t-cell-group>
<load-more status="{{inLoadingStatus}}" />
</view>
<view hidden="{{stockType!=2}}" class="scroll-container">
<view class="grid">
<view wx:for="{{outStockList}}" wx:key="logId" class="card">
<t-image class="prove-pic" mode="aspectFill" error="slot" src="{{item.provePic[0]}}">
<t-icon name="image-error" slot="error" width="100rpx" height="100rpx" />
</t-image>
<view class="fields">
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">产品</text>
<text class="value">{{item.productName}}</text>
<t-cell-group theme="card">
<t-swipe-cell wx:for="{{outStockList}}" wx:key="logId">
<t-cell data-spec-id="{{item.specId}}" hover>
<view class="left-icon" slot="left-icon">
<t-image src="{{item.provePic[0]}}" shape="round" error="slot" width="120rpx" height="120rpx">
<t-icon name="image-error" slot="error" />
</t-image>
</view>
<view slot="title" class="title">
<view>{{item.productName}}</view>
</view>
<view slot="description" class="description">
<view class="spec">
<text>{{item.modelName}}</text>
<view class="divider">|</view>
<text>{{item.specName}}</text>
</view>
<view class="date">
<t-tag theme="warning" size="small">出库</t-tag> <text>{{times.formatDate(item.date) || ''}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">型号</text>
<text class="value">{{item.modelName}}</text>
</view>
<view slot="note" class="note out">
{{item.total}}
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">规格</text>
<text class="value">{{item.specName}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">数量</text>
<text class="value">{{item.total}}</text>
</view>
</view>
<view class="field">
<view class="indicator"></view>
<view class="content">
<text class="title">日期</text>
<text class="value">{{times.formatDate(item.date) || "-"}}</text>
</view>
</view>
</view>
</view>
</view>
</t-cell>
</t-swipe-cell>
</t-cell-group>
<load-more status="{{outLoadingStatus}}" />
</view>
</view>