邓宏
2 years ago
16 changed files with 340 additions and 65 deletions
@ -0,0 +1,139 @@ |
|||
<style lang="scss"> |
|||
.container{ |
|||
min-height: 100%; |
|||
background:#f6f6f6; |
|||
// padding:30rpx 0; |
|||
|
|||
scroll-view{ |
|||
flex-grow: 1; |
|||
height:1rpx; |
|||
border:1rpx solid transparent; |
|||
.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.baseName" @search="clean();search()"/> |
|||
|
|||
<scroll-view scroll-y > |
|||
<view class="card" v-for="(v,k) in list" :key="k"> |
|||
<view class="info"> |
|||
<text>化肥</text> <text>中量元素水溶肥</text> <text>(100kg/袋)</text> |
|||
</view> |
|||
<view class="name"> |
|||
<text>微量元素肥</text> <text>云南云天化股份有限公司</text> |
|||
</view> |
|||
<view class="data"> |
|||
<text>采购时间:{{v.applicantTime}}</text> <text data-unit="共200kg">2袋</text> |
|||
</view> |
|||
</view> |
|||
<u-empty v-if="list.length==0" icon="http://cdn.uviewui.com/uview/empty/data.png"/> |
|||
</scroll-view> |
|||
</view> |
|||
</template> |
|||
<script> |
|||
import request from '@/common/request' |
|||
export default { |
|||
data(){ |
|||
return{ |
|||
searchVal:{ |
|||
pageNo:1, |
|||
pageSize:5, |
|||
companyId: this.$store.getters['userInfo'].companyId |
|||
}, |
|||
list:[], |
|||
total:0, |
|||
} |
|||
}, |
|||
onLoad(){ |
|||
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/purchase/purchaseList",{ |
|||
methods:"post", |
|||
body: this.searchVal |
|||
}) |
|||
if(res.statu){ |
|||
this.list=this.list.concat(res.data.records) |
|||
this.total=res.data.total |
|||
}else{ |
|||
uni.showModal({ |
|||
title:"提示", |
|||
content:res.msg||"获取采购列表失败!", |
|||
showCancel:false, |
|||
}) |
|||
} |
|||
} |
|||
}, |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue