Browse Source

联调接口

master
邓宏 2 years ago
parent
commit
d66ad3d121
  1. 182
      pages/stock/already.vue
  2. 4
      pages/stock/mana.vue
  3. 3
      pages/stock/record.vue

182
pages/stock/already.vue

@ -1,66 +1,69 @@
<style lang="scss"> <style lang="scss">
.container{ .container{
min-height: 100%; height: 100%;
background:#f6f6f6; background:#f6f6f6;
padding:30rpx 0;
.card{ scroll-view{
margin-bottom:0; flex-grow: 1;
&>.info{ height:1rpx;
display:flex; .card{
align-items: center; margin-top:0;
margin-bottom:20rpx; &>.info{
text{ display:flex;
&:first-child{ align-items: center;
font-size:20rpx; margin-bottom:20rpx;
color:#fff; text{
background:#10C176; &:first-child{
border-radius: 0 20rpx 0 20rpx; font-size:20rpx;
height:40rpx; color:#fff;
width:80rpx; background:#10C176;
line-height: 40rpx; border-radius: 0 20rpx 0 20rpx;
text-align: center; height:40rpx;
margin-right:16rpx; width:80rpx;
} line-height: 40rpx;
&:nth-child(2){ text-align: center;
font-weight: bold; margin-right:16rpx;
} }
&:nth-child(3){ &:nth-child(2){
color:#999; font-weight: bold;
font-size: 20rpx; }
margin-left:6rpx; &:nth-child(3){
color:#999;
font-size: 20rpx;
margin-left:6rpx;
}
} }
} }
} &>.name{
&>.name{ text{
text{ &:first-child{
&:first-child{ color:#FBA83C;
color:#FBA83C; }
} &:nth-child(2){
&:nth-child(2){ color:#999;
color:#999; margin-left:22rpx;
margin-left:22rpx; }
} }
} }
} &>.data{
&>.data{ display:flex;
display:flex; align-items: center;
align-items: center; justify-content: space-between;
justify-content: space-between; border-top:2rpx solid #D8D8D8;
border-top:2rpx solid #D8D8D8; margin-top:20rpx;
margin-top:20rpx; padding-top:16rpx;
padding-top:16rpx; text{
text{ &:first-child{
&:first-child{ color:#999;
color:#999; font-size:24rpx;
font-size:24rpx; }
} &:nth-child(2){
&:nth-child(2){ font-weight: bold;
font-weight: bold; &:after{
&:after{ content:"("attr(data-unit)")";
content:"("attr(data-unit)")"; font-weight: normal;
font-weight: normal; margin-left:5rpx;
margin-left:5rpx; }
} }
} }
} }
@ -69,28 +72,71 @@
} }
</style> </style>
<template> <template>
<view class="container"> <view class="container flex">
<d-search/> <d-search v-model="searchVal.search" @search="clean();search()"/>
<view class="card"> <scroll-view scroll-y @scrollotower="search">
<view class="info"> <view class="card" v-for="(v,k) in list" :key="k">
<text>化肥</text> <text>中量元素水溶肥</text> <text>(100kg/)</text> <view class="info">
</view> <text>{{v.agriculturalGoods}}</text> <text>{{v.substanceName}}</text> <text>({{v.specDescribe}})</text>
<view class="name"> </view>
<text>微量元素肥</text> <text>云南云天化股份有限公司</text> <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> </view>
<view class="data"> <u-empty v-if="list.length==0" width="70%" icon="/static/noData.png"/>
<text>领用时间2022-12-29</text> <text data-unit="共200kg">2</text> </scroll-view>
</view>
</view>
</view> </view>
</template> </template>
<script> <script>
import request from '@/common/request.js'
export default { export default {
data(){ data(){
return{ return{
searchVal:{
baseId: "1611250480973049857"||this.$store.state.plantBaseInfoId,
search: "",
pageNo:1,
pageSize:6,
},
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/OutInManageApi/queryCollectingList",{
method:"post",
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.list)
this.list=this.list.concat(res.data.list)
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> </script>

4
pages/stock/mana.vue

@ -1,6 +1,6 @@
<style lang="scss"> <style lang="scss">
.container{ .container{
min-height:100%; height:100%;
background:#F6F6F6; background:#F6F6F6;
.head_btns{ .head_btns{
width:90rpx; width:90rpx;
@ -166,7 +166,7 @@ export default {
data(){ data(){
return{ return{
searchVal:{ searchVal:{
baseId:"1610890499027365889"||this.$store.state.plantBaseInfoId, baseId: this.$store.state.plantBaseInfoId,
search:"", search:"",
substanceType:"nz", substanceType:"nz",
pageNo:1, pageNo:1,

3
pages/stock/record.vue

@ -75,6 +75,7 @@
<text>{{v.supplierName}}</text> <text>{{v.number}}({{v.equivalentAmount}}{{v.unit}})</text> <text>{{v.supplierName}}</text> <text>{{v.number}}({{v.equivalentAmount}}{{v.unit}})</text>
</view> </view>
</view> </view>
<u-empty v-if="list.length<=0" width="70%" icon="/static/noData.png"/>
</view> </view>
</template> </template>
<script> <script>
@ -83,7 +84,7 @@ export default {
data(){ data(){
return{ return{
searchVal:{ searchVal:{
baseId: "1611250480973049857"||this.$store.state.plantBaseInfoId, baseId: this.$store.state.plantBaseInfoId,
pageNo:1, pageNo:1,
pageSize:6, pageSize:6,
}, },

Loading…
Cancel
Save