Browse Source

联调库存列表

master
邓宏 2 years ago
parent
commit
d0aec2bb75
  1. 233
      pages/stock/mana.vue
  2. 2
      pages/warehouse/mana.vue

233
pages/stock/mana.vue

@ -10,6 +10,7 @@
} }
} }
&>.btns{ &>.btns{
flex-shrink: 0;
margin:28rpx 30rpx 0; margin:28rpx 30rpx 0;
display:flex; display:flex;
border-radius: 30rpx; border-radius: 30rpx;
@ -28,83 +29,88 @@
} }
} }
} }
&>.item{ scroll-view{
&>.info{ flex-grow: 1;
display:flex; height:1rpx;
align-items: center; .item{
margin-bottom:20rpx; &>.info{
text{ display:flex;
&:first-child{ align-items: center;
color:#fff; margin-bottom:20rpx;
background:#10C176; text{
height:40rpx; &:first-child{
width:80rpx; color:#fff;
text-align: center; background:#10C176;
line-height: 40rpx; height:40rpx;
border-radius: 0 20rpx 0 20rpx; min-width:80rpx;
margin-right:10rpx; text-align: center;
}
&:nth-child(2){
&:after{
content:"("attr(data-unit)")";
color:#999;
font-size:20rpx;
line-height: 40rpx; line-height: 40rpx;
margin-left:6rpx; border-radius: 0 20rpx 0 20rpx;
margin-right:10rpx;
padding:0 6rpx;
}
&:nth-child(2){
&:after{
content:"("attr(data-unit)")";
color:#999;
font-size:20rpx;
line-height: 40rpx;
margin-left:6rpx;
}
}
&:nth-child(3){
margin-left:auto;
color:#F34848;
font-size:24rpx;
} }
} }
&:nth-child(3){
margin-left:auto;
color:#F34848;
font-size:24rpx;
}
}
}
&>.company{
font-size:24rpx;
margin-bottom:14rpx;
text{
color:var(--c);
} }
} &>.company{
&>.num{
display:flex;
align-items: center;
&>text{
font-size:24rpx; font-size:24rpx;
color:#999; margin-bottom:14rpx;
text{
color:var(--c);
}
} }
&>.btns{ &>.num{
margin-left:auto; display:flex;
button{ align-items: center;
padding:0; &>text{
height:48rpx;
width: 96rpx;
font-size:24rpx; font-size:24rpx;
&:first-child{ color:#999;
color:#10C176; }
background:rgba(16, 193, 119, 0.1); &>.btns{
} margin-left:auto;
&:nth-child(2){ button{
margin-left:20rpx; padding:0;
color:#fff; height:48rpx;
background:#10C176; width: 96rpx;
font-size:24rpx;
&:first-child{
color:#10C176;
background:rgba(16, 193, 119, 0.1);
}
&:nth-child(2){
margin-left:20rpx;
color:#fff;
background:#10C176;
}
// background:transparent;
// border:2rpx solid transparent;
// color:var(--c);
// font-weight: bold;
// font-size:30rpx;
// height:50rpx;
// width:50rpx;
// &:first-child{
// border-radius: 30rpx 0 0 30rpx;
// border-color:var(--c);
// }
// &:nth-child(2){
// border-radius: 0 30rpx 30rpx 0;
// border-color:var(--c);
// }
} }
// background:transparent;
// border:2rpx solid transparent;
// color:var(--c);
// font-weight: bold;
// font-size:30rpx;
// height:50rpx;
// width:50rpx;
// &:first-child{
// border-radius: 30rpx 0 0 30rpx;
// border-color:var(--c);
// }
// &:nth-child(2){
// border-radius: 0 30rpx 30rpx 0;
// border-color:var(--c);
// }
} }
} }
} }
@ -112,7 +118,7 @@
} }
</style> </style>
<template> <template>
<view class="container"> <view class="container flex">
<d-navbar style="--bg:#10C176;--c:#fff;" isBack text="库存管理"> <d-navbar style="--bg:#10C176;--c:#fff;" isBack text="库存管理">
<view slot="right" class="head_btns"> <view slot="right" class="head_btns">
<image @click="$u.route({url:'pages/stock/already'})" mode="aspectFit" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAAXNSR0IArs4c6QAAAh9JREFUOE+N0++rz2ccx/HH+5z5EZ1QZ+aGJEsStjgKIxrJIkUxRqa1pIlsmrM7ItzbuSN/gJw782Oo5dcN3BFlOYrdIto525EkzhlKjWNvu04fOr7ODe/61Oe6rvf1vN4/Xu/Qj2XmRGzHLNSjB+fQEhF3a69E7UZmrsFufI8/MQ2d+Bh7sDYiLva99xYkM2fgAGZHxD+Z+TnmV6BRWI+zmBcR5YFeewPJzDrcwCpccC3GYAvmqHPQ5O6/DBj+W7W3LiK+7A8yHodxzMvnna4P2qxhwQwxgPoGun/doCln4gT2Y2pEPK2NpBRxB4a5FEsN+aDLyK0MnsTgCdya3aMpi8+Kki6+iYg7tZDp2IcHOpo36Wq556Pm0POIhoW0r/5bU27DuAq0KiI6aiEf4hpWYqe2OKJOq/oR5H88ezzWZ3kaX5WUI2LCOzUpG5n5M27iu/JFRFu2aYzpHlbn6yOiNbM3rUvoxpPaFhdhLcInGIEuHMe/1atFaEPQXvlsKme9kMwsB40oIjqEU9Wlofgag6r13Aq4BPdxBZMiM0stfsdoLIuIM69zzcxPUfTy2n6sOngZV8t/RJwtkNv4CUUnJbwpEfGkinB5DaR043xVjzJHv/R2JzOLQssLpTP38G1fUN8ZycyBld/eiDj6VncqUDMWYzJKSn/0M+Cl8Lsi4mS/A1iBfkBriSYiivjey2pbXIZqI76IiBfvRfjf6RX9Zrpq7UEdfAAAAABJRU5ErkJggg=="/> <image @click="$u.route({url:'pages/stock/already'})" mode="aspectFit" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAAXNSR0IArs4c6QAAAh9JREFUOE+N0++rz2ccx/HH+5z5EZ1QZ+aGJEsStjgKIxrJIkUxRqa1pIlsmrM7ItzbuSN/gJw782Oo5dcN3BFlOYrdIto525EkzhlKjWNvu04fOr7ODe/61Oe6rvf1vN4/Xu/Qj2XmRGzHLNSjB+fQEhF3a69E7UZmrsFufI8/MQ2d+Bh7sDYiLva99xYkM2fgAGZHxD+Z+TnmV6BRWI+zmBcR5YFeewPJzDrcwCpccC3GYAvmqHPQ5O6/DBj+W7W3LiK+7A8yHodxzMvnna4P2qxhwQwxgPoGun/doCln4gT2Y2pEPK2NpBRxB4a5FEsN+aDLyK0MnsTgCdya3aMpi8+Kki6+iYg7tZDp2IcHOpo36Wq556Pm0POIhoW0r/5bU27DuAq0KiI6aiEf4hpWYqe2OKJOq/oR5H88ezzWZ3kaX5WUI2LCOzUpG5n5M27iu/JFRFu2aYzpHlbn6yOiNbM3rUvoxpPaFhdhLcInGIEuHMe/1atFaEPQXvlsKme9kMwsB40oIjqEU9Wlofgag6r13Aq4BPdxBZMiM0stfsdoLIuIM69zzcxPUfTy2n6sOngZV8t/RJwtkNv4CUUnJbwpEfGkinB5DaR043xVjzJHv/R2JzOLQssLpTP38G1fUN8ZycyBld/eiDj6VncqUDMWYzJKSn/0M+Cl8Lsi4mS/A1iBfkBriSYiivjey2pbXIZqI76IiBfvRfjf6RX9Zrpq7UEdfAAAAABJRU5ErkJggg=="/>
@ -120,35 +126,82 @@
</view> </view>
</d-navbar> </d-navbar>
<d-search /> <d-search v-model="searchVal.search" @search="clean();search()"/>
<view class="btns shadow bg-white"> <view class="btns shadow bg-white">
<button class="cu-btn bg-white active">农资</button> <button class="cu-btn bg-white" :class="{active:searchVal.substanceType=='nz'}" @click="searchVal.substanceType='nz';clean();search()">农资</button>
<button class="cu-btn bg-white">农产品</button> <button class="cu-btn bg-white" :class="{active:searchVal.substanceType=='ncp'}" @click="searchVal.substanceType='ncp';clean();search()">农产品</button>
</view> </view>
<view class="card item"> <scroll-view scroll-y @scrolltowoer="search">
<view class="info"> <view class="card item" v-for="(v,k) in list" :key="k">
<text>化肥</text> <view class="info">
<text data-unit="100kg/">中量元素水溶肥</text> <text>{{v.agriculturalGoods}}</text>
<text>补货量300kg</text> <text :data-unit="v.specDescribe">{{v.substanceName}}</text>
</view> <text>补货量{{v.replenishment||0}}kg</text>
<view class="company"> </view>
<text style="--c:#FBA83C;margin-right:14rpx;">微量元素肥</text> <view class="company">
<text style="--c:#999;">云南云天化股份有限公司</text> <text style="--c:#FBA83C;margin-right:14rpx;">{{v.detailType}}</text>
</view> <text style="--c:#999;">{{v.supplierName}}</text>
<view class="num"> </view>
<text>库存量200kg</text> <view class="num">
<view class="btns" @click="$u.route({url:'pages/stock/list'})"> <text>库存量{{v.equivalentInventory||0}}kg</text>
<button class="cu-btn">出库</button> <view class="btns" @click="$u.route({url:'pages/stock/list'})">
<button class="cu-btn">入库</button> <button class="cu-btn">出库</button>
<button class="cu-btn">入库</button>
</view>
</view> </view>
</view> </view>
</view> <u-empty v-if="list.length<=0" width="70%" icon="/static/noData.png"/>
</scroll-view>
</view> </view>
</template> </template>
<script> <script>
import request from '@/common/request.js'
export default { export default {
data(){
return{
searchVal:{
baseId:"1610890499027365889"||this.$store.state.plantBaseInfoId,
search:"",
substanceType:"nz",
pageNo:1,
pageSize:5,
},
total:0,
list:[],
}
},
onLoad(options){
// this.searchVal
this.search()
},
methods:{
clean(){
this.list=[]
this.total=0
this.searchVal.pageNo=1
},
async search(){
if(this.total==0 || this.list.length<this.total){
var res=await request("/api/InventoryManageApi/queryInventoryList",{
method:"post",
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.nz)
this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取库存列表失败!",
showCancel:false,
})
}
}
},
}
} }
</script> </script>

2
pages/warehouse/mana.vue

@ -88,7 +88,7 @@
<view class="btns"> <view class="btns">
<text class="plant-xiugai" @click.stop="toAdd(v.warehouseId)">修改</text> <text class="plant-xiugai" @click.stop="toAdd(v.warehouseId)">修改</text>
<text class="plant-shanchu" @click.stop="del(k)">删除</text> <text class="plant-shanchu" @click.stop="del(k)">删除</text>
<text class="plant-chakan" @click.stop="$u.route({url:'pages/warehouse/info'})">查看库存</text> <text class="plant-chakan" @click.stop="$u.route({url:'pages/stock/mana',params:{id:v.warehouseId}})">查看库存</text>
</view> </view>
</view> </view>
</view> </view>

Loading…
Cancel
Save