|
|
@ -10,46 +10,55 @@ |
|
|
|
|
|
|
|
.item{ |
|
|
|
margin-top:0; |
|
|
|
.title{ |
|
|
|
display:flex; |
|
|
|
align-items: center; |
|
|
|
font-weight: bold; |
|
|
|
text{ |
|
|
|
margin-left:auto; |
|
|
|
color:#333; |
|
|
|
} |
|
|
|
} |
|
|
|
.adder{ |
|
|
|
color:#999; |
|
|
|
font-size:24rpx; |
|
|
|
margin-top: 16rpx; |
|
|
|
display:flex; |
|
|
|
.u-transition{ |
|
|
|
flex-shrink: 0; |
|
|
|
margin-right:28rpx; |
|
|
|
} |
|
|
|
.data{ |
|
|
|
display:flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
margin-top:16rpx; |
|
|
|
color:#999; |
|
|
|
font-size:24rpx; |
|
|
|
text:nth-child(2){ |
|
|
|
color:#10C176; |
|
|
|
.info{ |
|
|
|
flex-grow: 1; |
|
|
|
width:1rpx; |
|
|
|
.title{ |
|
|
|
display:flex; |
|
|
|
align-items: center; |
|
|
|
font-weight: bold; |
|
|
|
font-size: 32rpx; |
|
|
|
text{ |
|
|
|
margin-left:auto; |
|
|
|
color:#333; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.btns{ |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
border-top:2rpx solid #D8D8D8; |
|
|
|
margin:20rpx 0 -30rpx 0; |
|
|
|
text{ |
|
|
|
padding:16rpx 0 30rpx 0; |
|
|
|
.adder{ |
|
|
|
color:#999; |
|
|
|
font-size:24rpx; |
|
|
|
&:before{ |
|
|
|
margin-top: 16rpx; |
|
|
|
} |
|
|
|
.data{ |
|
|
|
display:flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
margin-top:16rpx; |
|
|
|
color:#999; |
|
|
|
font-size:24rpx; |
|
|
|
text:nth-child(2){ |
|
|
|
color:#10C176; |
|
|
|
margin-right:8rpx; |
|
|
|
font-weight: bold; |
|
|
|
font-size: 32rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
.btns{ |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
border-top:2rpx solid #D8D8D8; |
|
|
|
margin:20rpx 0 -30rpx 0; |
|
|
|
text{ |
|
|
|
padding:16rpx 0 30rpx 0; |
|
|
|
color:#999; |
|
|
|
font-size:24rpx; |
|
|
|
&:before{ |
|
|
|
color:#10C176; |
|
|
|
margin-right:8rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -60,29 +69,35 @@ |
|
|
|
<template> |
|
|
|
<view class="container flex"> |
|
|
|
<d-navbar style="--bg:#10C176;--c:#fff;" text="仓库管理" isBack> |
|
|
|
<text class="plant-xinjian" slot="right" @click="toAdd"/> |
|
|
|
<text class="plant-xinjian" slot="right" @click="toAdd()"/> |
|
|
|
</d-navbar> |
|
|
|
|
|
|
|
<d-search v-model="searchVal.search" style="margin-top:30rpx;" @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}})"> |
|
|
|
<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> |
|
|
|
</view> |
|
|
|
<view class="btns"> |
|
|
|
<text class="plant-xiugai" @click="toAdd(v.warehouseId)">修改</text> |
|
|
|
<text class="plant-shanchu" @click.stop="del(k)">删除</text> |
|
|
|
<text class="plant-chakan" @click.stop="$u.route({url:'pages/warehouse/info'})">查看库存</text> |
|
|
|
<u-image width="164rpx" height="164rpx" radius="16rpx" mode="aspectFill" :src="`${host}/${v.warehousePic[0]}`"> |
|
|
|
<text slot="error" class="plant-xiaopangchetupianjiazaishibai" style="font-size:45rpx"/> |
|
|
|
</u-image> |
|
|
|
<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> |
|
|
|
</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/warehouse/info'})">查看库存</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import request from '@/common/request.js' |
|
|
|
import request,{host} from '@/common/request.js' |
|
|
|
export default { |
|
|
|
data(){ |
|
|
|
return{ |
|
|
@ -94,6 +109,7 @@ import request from '@/common/request.js' |
|
|
|
}, |
|
|
|
list:[], |
|
|
|
total:0, |
|
|
|
host:host('imgUrl'), |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options){ |
|
|
@ -112,8 +128,10 @@ import request from '@/common/request.js' |
|
|
|
body: this.searchVal |
|
|
|
}) |
|
|
|
if(res.statu){ |
|
|
|
this.list=this.list.concat(res.data.warehouseList) |
|
|
|
this.list=this.list.concat(res.data.warehouseList.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"}) |
|
|
|
}else{ |
|
|
|
uni.showModal({ |
|
|
|
title:"提示", |
|
|
@ -155,7 +173,11 @@ import request from '@/common/request.js' |
|
|
|
}, |
|
|
|
toAdd(id){ |
|
|
|
uni.navigateTo({ |
|
|
|
url:`/pages/warehouse/info?id=${id}` |
|
|
|
url:`/pages/warehouse/info?id=${id||''}`, |
|
|
|
events:{update:()=>{ |
|
|
|
this.clean() |
|
|
|
this.search() |
|
|
|
}} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|