|
@@ -12,7 +12,7 @@
|
|
|
<u-search placeholder="搜索设备名称或型号" v-model="queryContent" :show-action="false">
|
|
|
|
|
|
</u-search>
|
|
|
- <view class="search-btn" @click="form.pageIndex=1,getList" >
|
|
|
+ <view class="search-btn" @click="form.pageIndex=1,getList()" >
|
|
|
<view class="text">
|
|
|
搜索
|
|
|
</view>
|
|
@@ -21,8 +21,8 @@
|
|
|
</view>
|
|
|
<view class="main">
|
|
|
<!-- 分类 -->
|
|
|
- <view class="classify">
|
|
|
- <view class="item " v-for="(item,index) in menuList" @click="toggle(index)"
|
|
|
+ <view class="classify" v-if="!queryContentBl">
|
|
|
+ <view class="item " v-for="(item,index) in menuList" :key="index" @click="toggle(index)"
|
|
|
:class="{'checked':index ==checkindex }">
|
|
|
{{item.name}}<br/>
|
|
|
</view>
|
|
@@ -40,7 +40,9 @@
|
|
|
<view class="picture">
|
|
|
<img :src="item.imgUrl" alt="">
|
|
|
</view>
|
|
|
- <view class="infos" >
|
|
|
+ <view class="infos" :class="{
|
|
|
+ infosQuery:queryContentBl
|
|
|
+ }" >
|
|
|
<view class="name">
|
|
|
{{item.title}}
|
|
|
</view>
|
|
@@ -60,7 +62,14 @@
|
|
|
{{item.count}}
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+ <view class="inventory" v-if="queryContentBl">
|
|
|
+ <view class="infos-title">
|
|
|
+ 分类:
|
|
|
+ </view>
|
|
|
+ <view class="value">
|
|
|
+ {{getMenuListName(item.typeId)}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="option" >
|
|
|
<u-button v-if="iscomponents==1" @click="ckItem(item)"
|
|
@@ -124,12 +133,30 @@
|
|
|
//this.getList()
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
- var obj=this.list[this.current]
|
|
|
- if (obj.list.length < obj.recordsTotal) {
|
|
|
- this.myLoadmore();
|
|
|
- }
|
|
|
+ this.myLoadmoreonReachBottom()
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
+ myLoadmoreonReachBottom(){
|
|
|
+ var obj=this.menuList[this.checkindex]
|
|
|
+ if(this.queryContentBl){
|
|
|
+ obj=this.form;
|
|
|
+ }
|
|
|
+ console.log(obj)
|
|
|
+ if (this.indexList < obj.recordsTotal) {
|
|
|
+ this.myLoadmore();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getMenuListName(id){
|
|
|
+ var obj =this.menuList.filter(item=>{
|
|
|
+
|
|
|
+ return id==item.typeId;
|
|
|
+ })
|
|
|
+ if(obj.length){
|
|
|
+ return obj[0].name
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
getDeviceTypeList(){
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
@@ -142,8 +169,8 @@
|
|
|
typeId:item.id,
|
|
|
name:item.name,
|
|
|
list:[],
|
|
|
- pageIndex:0,
|
|
|
- pageSize:20,
|
|
|
+ pageIndex:1,
|
|
|
+ pageSize:10,
|
|
|
recordsTotal:0
|
|
|
}
|
|
|
});
|
|
@@ -172,7 +199,12 @@
|
|
|
|
|
|
},
|
|
|
myLoadmore(){
|
|
|
- this.menuList[this.checkindex].pageIndex += 1;
|
|
|
+ if(this.queryContentBl){
|
|
|
+ this.form.pageIndex += 1;
|
|
|
+ }else{
|
|
|
+ this.menuList[this.checkindex].pageIndex += 1;
|
|
|
+
|
|
|
+ }
|
|
|
this.getList();
|
|
|
},
|
|
|
getList(){
|
|
@@ -185,10 +217,11 @@
|
|
|
var data = this.menuList[this.checkindex];
|
|
|
|
|
|
if(this.queryContent){
|
|
|
- data.queryContent=this.queryContent;
|
|
|
//this.queryContentBl=true
|
|
|
// 删除类型 delete data.list;
|
|
|
data=this.form
|
|
|
+ data.queryContent=this.queryContent;
|
|
|
+
|
|
|
}else{
|
|
|
|
|
|
//this.queryContentBl=false
|
|
@@ -206,6 +239,7 @@
|
|
|
}
|
|
|
if(this.queryContent){
|
|
|
this.queryContentBl=true
|
|
|
+ this.form.recordsTotal = res.data.recordsTotal;
|
|
|
}else{
|
|
|
this.queryContentBl=false
|
|
|
this.menuList[this.checkindex].list=list
|
|
@@ -223,13 +257,13 @@
|
|
|
})
|
|
|
},
|
|
|
datainit(){
|
|
|
- var data = this.menuList[this.checkindex];
|
|
|
- if(!data.pageIndex){
|
|
|
- this.menuList[this.checkindex].pageIndex=1;
|
|
|
- this.menuList[this.checkindex].pageSize=20
|
|
|
- this.menuList[this.checkindex].recordsTotal=0;
|
|
|
- this.menuList[this.checkindex].list=[]
|
|
|
- }
|
|
|
+ // var data = this.menuList[this.checkindex];
|
|
|
+ // if(!data.pageIndex){
|
|
|
+ // this.menuList[this.checkindex].pageIndex=1;
|
|
|
+ // this.menuList[this.checkindex].pageSize=10
|
|
|
+ // this.menuList[this.checkindex].recordsTotal=0;
|
|
|
+ // this.menuList[this.checkindex].list=[]
|
|
|
+ // }
|
|
|
},
|
|
|
toggle(index) {
|
|
|
this.checkindex = index
|
|
@@ -336,9 +370,9 @@
|
|
|
.type{
|
|
|
padding: 24rpx 32rpx;
|
|
|
height: calc(100vh - 88rpx);
|
|
|
- overflow-y: scroll;
|
|
|
+
|
|
|
.type-item{
|
|
|
- margin-bottom: 80rpx;
|
|
|
+ //margin-bottom: 80rpx;
|
|
|
}
|
|
|
.title{
|
|
|
color: rgba(51, 51, 51, 1);
|
|
@@ -348,7 +382,8 @@
|
|
|
.content{
|
|
|
.item{
|
|
|
display: flex;
|
|
|
- margin-bottom: 64rpx;
|
|
|
+ margin-bottom: 34rpx;
|
|
|
+ border-bottom: 1px dashed;
|
|
|
.option{
|
|
|
padding-left: 20rpx;
|
|
|
}
|
|
@@ -363,6 +398,9 @@
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ .infosQuery{
|
|
|
+ width:400rpx !important;
|
|
|
+ }
|
|
|
.infos{
|
|
|
width:200rpx ;
|
|
|
margin-left: 16rpx;
|