Browse Source

修改仓库列表页面显示

master
邓宏 2 years ago
parent
commit
f9179190e4
  1. 2
      pages/home/index.vue
  2. 1
      pages/stock/mana.vue
  3. 7
      pages/warehouse/info.vue
  4. 33
      pages/warehouse/mana.vue
  5. 2
      uni.scss

2
pages/home/index.vue

@ -305,7 +305,7 @@
<view style="display:flex;">
<view class="card mana">
<view class="title">
<text class="plant-dikuaimianji"/> 地块管理 <text class="more" @click="$u.route({type:'switchTab',url:'pages/massif/index'})">更多>></text>
<text class="plant-dikuaimianji"/> 地块管理 <text class="more" @click="toMassif">更多>></text>
</view>
<view class="item" v-for="(v,k) in massif.plotList||[]" :key="k">
<text class="over">{{v.plotName}}</text> <text>{{v.realityArea}}</text>

1
pages/stock/mana.vue

@ -171,6 +171,7 @@ export default {
},
onLoad(options){
this.searchVal.warehouseId=options.id
this.searchVal.substanceType=options.goodsType||"nz"
this.search()
},
methods:{

7
pages/warehouse/info.vue

@ -33,8 +33,8 @@ import request from '@/common/request.js'
warehouseVolume:{label:"仓库容量(㎡)", type:"digit",placeholder:"请输入仓库容量"},
goodsType:{label:"存储物品类型",type:"select",columns:[],value:[]},
warehouseType:{label:"仓库类型",type:"select",columns:[],value:[]},
contactPeople:{label:"基地管理员"},
contactNumber:{label:"管理员联系方式"},
contactPeople:{label:"基地管理员", disabled:this.$store.getters['userInfo'].roleCode=="baseAdmin"},
contactNumber:{label:"管理员联系方式", disabled:this.$store.getters['userInfo'].roleCode=="baseAdmin"},
warehousePic:{label:"仓库图片",type:"upImg",num:3},
},
formData:{
@ -75,6 +75,9 @@ import request from '@/common/request.js'
this.init()
if(options.id){
this.getDetail(options.id)
}else if(this.$store.getters['userInfo'].roleCode=="baseAdmin"){
this.formData.contactPeople=this.$store.getters['userInfo'].realname
this.formData.contactNumber=this.$store.getters['userInfo'].phone
}
},
methods:{

33
pages/warehouse/mana.vue

@ -11,9 +11,26 @@
.item{
margin-top:0;
display:flex;
&>.img{
display:flex;
flex-direction: column;
justify-content: space-between;
margin-right:28rpx;
width:164rpx;
.u-transition{
flex-shrink: 0;
margin-right:28rpx;
}
&>text{
color:rgba(var(--c),1);
background:rgba(var(--c),0.1);
font-size:24rpx;
padding:10rpx;
text-align: center;
margin-bottom:-10rpx;
&:before{
margin-right:6rpx;
}
}
}
.info{
flex-grow: 1;
@ -72,23 +89,27 @@
<text class="plant-xinjian" slot="right" @click="toAdd()"/>
</d-navbar>
<d-search v-model="searchVal.search" style="margin-top:30rpx;" @search="clean();search()"/>
<d-search v-model="searchVal.search" @search="clean();search()"/>
<scroll-view scroll-y @scrolltolower="search">
<view class="card item" v-for="(v,k) in list" :key="k" @click="$u.route({url:'pages/warehouse/detail',params:{id:v.warehouseId}})">
<u-image width="164rpx" height="164rpx" radius="16rpx" mode="aspectFill" :src="`${host}/${v.warehousePic[0]}`">
<view class="img">
<u-image width="100%" height="144rpx" radius="16rpx" mode="aspectFill" :src="`${host}/${v.warehousePic[0]}`">
<text slot="error" class="plant-xiaopangchetupianjiazaishibai" style="font-size:45rpx"/>
</u-image>
<text v-if="v.goodsType==2" class="plant-zhongzhi" style="--c:16, 193, 118;">农产品</text>
<text v-else class="plant-nongziguanli" style="--c:248, 203, 54;">农资</text>
</view>
<view class="info">
<view class="title">{{v.warehouseName}} <text class="plant-youbian"/></view>
<view class="adder">{{v.warehouseAddress}}</view>
<view class="data">
<text>库存种类{{v.inventoryType||0}}</text> <text>{{v.capacity||0}}</text>
<text>库存种类{{v.inventoryCount||0}}</text> <text>{{v.capacity||0}}</text>
</view>
<view class="btns">
<text class="plant-xiugai" @click.stop="toAdd(v.warehouseId)">修改</text>
<text class="plant-shanchu" @click.stop="del(k)">删除</text>
<text class="plant-chakan" @click.stop="$u.route({url:'pages/stock/mana',params:{id:v.warehouseId}})">查看库存</text>
<text class="plant-chakan" @click.stop="$u.route({url:'pages/stock/mana',params:{id:v.id, goodsType:({1:'nz',2:'ncp'})[v.goodsType]}})">查看库存</text>
</view>
</view>
</view>
@ -128,7 +149,7 @@ import request,{host} from '@/common/request.js'
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.warehouseList.map(v=>({...v,warehousePic:(v.warehousePic||'').split(",").filter(v=>v)})))
this.list=this.list.concat(res.data.records.map(v=>({...v,warehousePic:(v.warehousePic||'').split(",").filter(v=>v)})))
this.total=res.data.total
this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})

2
uni.scss

@ -77,7 +77,7 @@ $uni-font-size-paragraph:15px;
@import '@/common/main.css';
@import 'uview-ui/theme.scss';
@import url('https://at.alicdn.com/t/c/font_3852037_dzizkbp2jzo.css');
@import url('https://at.alicdn.com/t/c/font_3852037_xnap1h9v4h.css');
[class*=plant-]{
font-family: "plantMana" !important;
font-size: 16px;

Loading…
Cancel
Save