You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

140 lines
3.0 KiB

<style lang="scss">
.container{
height: 100%;
background:#f6f6f6;
scroll-view{
flex-grow: 1;
height:1rpx;
.card{
margin-top:0;
&>.info{
display:flex;
align-items: center;
margin-bottom:20rpx;
text{
&:first-child{
font-size:20rpx;
color:#fff;
background:#10C176;
border-radius: 0 20rpx 0 20rpx;
height:40rpx;
width:80rpx;
line-height: 40rpx;
text-align: center;
margin-right:16rpx;
}
&:nth-child(2){
font-weight: bold;
}
&:nth-child(3){
color:#999;
font-size: 20rpx;
margin-left:6rpx;
}
}
}
&>.name{
text{
&:first-child{
color:#FBA83C;
}
&:nth-child(2){
color:#999;
margin-left:22rpx;
}
}
}
&>.data{
display:flex;
align-items: center;
justify-content: space-between;
border-top:2rpx solid #D8D8D8;
margin-top:20rpx;
padding-top:16rpx;
text{
&:first-child{
color:#999;
font-size:24rpx;
}
&:nth-child(2){
font-weight: bold;
&:after{
content:"("attr(data-unit)")";
font-weight: normal;
margin-left:5rpx;
}
}
}
}
}
}
}
</style>
<template>
<view class="container flex">
<d-search v-model="searchVal.search" @search="clean();search()"/>
<scroll-view scroll-y @scrollotower="search">
<view class="card" v-for="(v,k) in list" :key="k">
<view class="info">
<text>{{v.agriculturalGoods}}</text> <text>{{v.substanceName}}</text> <text>({{v.specDescribe}})</text>
</view>
<view class="name">
<text>{{v.detailType}}</text> <text class="over">{{v.supplierName}}</text>
</view>
<view class="data">
<text>领用时间{{new Date(v.collectingTime).format("yyyy-MM-dd")}}</text> <text :data-unit="`共${v.total}kg`">{{v.num}}{{(v.specDescribe.match(/\/(.+)/)||['',''])[1]}}</text>
</view>
</view>
<u-empty v-if="list.length==0" text="为查询到相关信息" width="70%" icon="/static/noData.png"/>
</scroll-view>
</view>
</template>
<script>
import request from '@/common/request.js'
export default {
data(){
return{
searchVal:{
baseId: "1611250480973049857"||this.$store.state.plantBaseInfoId,
search: "",
pageNo:1,
pageSize:6,
},
list:[],
total:0,
}
},
onLoad(options){
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/Inventory/queryCollectingList",{
method:"post",
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.list)
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>