|
@@ -6,23 +6,22 @@
|
|
|
</view>
|
|
|
<view class="st-detailList-info">
|
|
|
<view class="st-detailList-tit">
|
|
|
- <view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{stockInfo&&stockInfo.productName ? stockInfo.productName : '--'}}
|
|
|
+ <view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{stockInfo&&stockInfo.productName || '--'}}
|
|
|
</view>
|
|
|
<view class="st-detailList-info-con flex align_center">
|
|
|
<view class="pimgs">
|
|
|
- <u-image :src="stockInfo&&stockInfo.product&&stockInfo&&stockInfo.product.productMsg?stockInfo&&stockInfo.product.productMsg:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
|
|
|
+ <u-image :src="stockInfo&&stockInfo.productMsg||`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
|
|
|
</view>
|
|
|
<view class="flex_1">
|
|
|
- <view>产品编码:{{stockInfo&&stockInfo.productCode ? stockInfo.productCode : '--'}}</view>
|
|
|
- <view class="padding_3">原厂编码:{{stockInfo&&stockInfo.productOrigCode ? stockInfo.productOrigCode : '--'}}</view>
|
|
|
+ <view>产品编码:{{stockInfo&&stockInfo.productCode || '--'}}</view>
|
|
|
+ <view class="padding_3">原厂编码:{{stockInfo&&stockInfo.productOrigCode || '--'}}</view>
|
|
|
<view class="flex align_center justify_between">
|
|
|
<view class="font_13">
|
|
|
- 可用数量:
|
|
|
- <u-count-to :end-val="stockInfo&&stockInfo.currentStockQty ? stockInfo&&stockInfo.currentStockQty : 0" separator="," font-size="26"></u-count-to>个
|
|
|
+ 可用数量:{{toThousands(stockInfo&&stockInfo.currentStockQty||0)}}{{stockInfo&&stockInfo.productUnit||''}}
|
|
|
</view>
|
|
|
<view class="font_13">
|
|
|
库存成本:
|
|
|
- ¥<u-count-to :end-val="stockInfo&&stockInfo.currentStockCost ? stockInfo&&stockInfo.currentStockCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
|
|
|
+ ¥{{toThousands(stockInfo&&stockInfo.currentStockCost||0, 2)}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -36,23 +35,26 @@
|
|
|
<view v-if="curNow==0" class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
|
|
|
<view class="flex align_center justify_between margin-b20">
|
|
|
<view :style="{color: $config('infoColor')}">{{item.putTime || '--'}}</view>
|
|
|
- <u-tag :text="item.putBizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
|
|
|
+ <u-tag v-if="item.putBizTypeDictValue" :text="item.putBizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
|
|
|
</view>
|
|
|
<view class="flex align_center justify_between">
|
|
|
<view v-if="item.warehouseName || item.warehouseLocationName">{{item.warehouseName}} > {{item.warehouseLocationName}}</view>
|
|
|
<view v-else>--</view>
|
|
|
- <view>¥{{item.putCost}} * {{item.currentQty}}{{item.productUnit}}</view>
|
|
|
+ <view>¥{{toThousands(item.putCost||0, 2)}} * {{toThousands(item.currentQty||0)}}{{item.unit}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 出入库明细 -->
|
|
|
<view v-if="curNow==1" class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
|
|
|
<view class="flex align_center justify_between margin-b20">
|
|
|
<view :style="{color: $config('infoColor')}">{{item.auditTime || '--'}}</view>
|
|
|
- <u-tag :text="item.bizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
|
|
|
+ <u-tag v-if="item.bizTypeDictValue" :text="item.bizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
|
|
|
</view>
|
|
|
<view class="flex align_center justify_between">
|
|
|
<view>{{item.unitName || '--'}}</view>
|
|
|
- <view :style="{color: item.flowType=='PUT' ? 'green':'red'}"><text v-if="item.qty!=0">{{ item.flowType=='PUT' ? '+':'-' }}</text>{{ item.qty }}{{item.productUnit}}</view>
|
|
|
+ <view>
|
|
|
+ <view :style="{color: item.qty && item.qty!=0 ? (item.flowType=='PUT' ? 'green':'red'):'', display:'inline-block'}"><text v-if="item.qty && item.qty!=0">{{ item.flowType=='PUT' ? '+':'-' }}</text>{{ toThousands(item.qty||0) }}</view>
|
|
|
+ {{item.product && item.product.unit}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-if="listData && listData.length == 0">
|
|
@@ -64,6 +66,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import { toThousands } from '@/libs/tools'
|
|
|
import { stockDetailList, stockFlowList } from '@/api/stock'
|
|
|
export default{
|
|
|
data(){
|
|
@@ -80,7 +83,8 @@
|
|
|
stockInfo: null,
|
|
|
noDataText: '暂无数据',
|
|
|
curNow: 0,
|
|
|
- theme: ''
|
|
|
+ theme: '',
|
|
|
+ toThousands
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
@@ -95,20 +99,45 @@
|
|
|
if (pageNo) {
|
|
|
this.pageNo = pageNo
|
|
|
}
|
|
|
+ let params = {}
|
|
|
let url = stockDetailList
|
|
|
if(this.curNow == 0){ // 库存详情
|
|
|
url = stockDetailList
|
|
|
+ params = {
|
|
|
+ pageNo: this.pageNo,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ stockSn: this.stockInfo && this.stockInfo.stockSn || '',
|
|
|
+ isSellOut: '0'
|
|
|
+ }
|
|
|
}else if(this.curNow == 1){ // 出入库明细
|
|
|
url = stockFlowList
|
|
|
+ params = {
|
|
|
+ pageNo: this.pageNo,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ productSn: this.stockInfo && this.stockInfo.productSn || ''
|
|
|
+ }
|
|
|
}
|
|
|
- url({ pageNo: this.pageNo, pageSize: this.pageSize }).then(res => {
|
|
|
+ url(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- if(this.pageNo>1){
|
|
|
- this.listData = this.listData.concat(res.data.list || [])
|
|
|
+ if(res.data && res.data.list){
|
|
|
+ if(this.curNow == 1){ // 出入库明细
|
|
|
+ res.data.list.map(item => {
|
|
|
+ if(item.flowType == 'PUT'){
|
|
|
+ item.qty = item.putQty || 0
|
|
|
+ }else if(item.flowType == 'OUT'){
|
|
|
+ item.qty = item.outQty || 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.pageNo>1){
|
|
|
+ this.listData = this.listData.concat(res.data && res.data.list || [])
|
|
|
+ }else{
|
|
|
+ this.listData = res.data.list || []
|
|
|
+ }
|
|
|
}else{
|
|
|
- this.listData = res.data.list || []
|
|
|
+ this.listData = []
|
|
|
}
|
|
|
- this.totalNum = res.data.count || 0
|
|
|
+ this.totalNum = res.data && res.data.count || 0
|
|
|
} else {
|
|
|
this.listData = []
|
|
|
this.totalNum = 0
|