|
@@ -6,8 +6,8 @@
|
|
|
<u-navbar title="出库申请" v-show="false" ref="navbar" ></u-navbar>
|
|
|
|
|
|
<!-- 搜索 -->
|
|
|
- <view class="search">
|
|
|
- <u-icon name="arrow-left" @click="back()" v-if="iscomponents!=1" size="36"></u-icon>
|
|
|
+ <view class="search" v-if="iscomponents!=1" >
|
|
|
+ <u-icon name="arrow-left" @click="back()" size="36"></u-icon>
|
|
|
<view class="search-box">
|
|
|
<u-search placeholder="搜索设备名称或型号" :show-action="false">
|
|
|
|
|
@@ -30,12 +30,12 @@
|
|
|
</view>
|
|
|
<!-- 类型 -->
|
|
|
<view class="type" >
|
|
|
- <view class="type-item" v-for="item in 4">
|
|
|
- <view class="title">
|
|
|
+ <view class="type-item">
|
|
|
+ <!-- <view class="title" v-for="item in 4">
|
|
|
设备类型一
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<view class="content">
|
|
|
- <view class="item" v-for="item in 4">
|
|
|
+ <view class="item" v-for="(item,i) in menuList[checkindex].list" :key="i">
|
|
|
<view class="picture">
|
|
|
<img src="@/assets/img/typePic.png" alt="">
|
|
|
</view>
|
|
@@ -135,15 +135,86 @@
|
|
|
|
|
|
}
|
|
|
},
|
|
|
+ computed:{
|
|
|
+ listcurrentlist(){
|
|
|
+ var list=this.menuList[this.checkindex].list
|
|
|
+
|
|
|
+ if(list){
|
|
|
+ return list
|
|
|
+ }else{
|
|
|
+ return []
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ onReady() {
|
|
|
+ //this.getList()
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ var obj=this.list[this.current]
|
|
|
+ if (obj.list.length < obj.recordsTotal) {
|
|
|
+ this.myLoadmore();
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ myLoadmore(){
|
|
|
+ this.menuList[this.checkindex].pageIndex += 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ getList(){
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ this.datainit()
|
|
|
+ var data = this.menuList[this.checkindex];
|
|
|
+ delete data.list;
|
|
|
+ var list=this.menuList[this.checkindex].list
|
|
|
+
|
|
|
+ API.deviceList(data).then((res) => {
|
|
|
+ if(data.pageIndex==1){
|
|
|
+ list = res.data.data;
|
|
|
+ }else{
|
|
|
+ list = [
|
|
|
+ ...list,
|
|
|
+ ...res.data.data
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ debugger
|
|
|
+ this.menuList[this.checkindex].list=list
|
|
|
+
|
|
|
+ this.menuList[this.checkindex].recordsTotal = res.data.recordsTotal;
|
|
|
+ console.log(this.menuList[this.checkindex])
|
|
|
+ uni.hideLoading();
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ 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=[]
|
|
|
+ }
|
|
|
+ },
|
|
|
toggle(index) {
|
|
|
this.checkindex = index
|
|
|
+
|
|
|
+ this.datainit()
|
|
|
},
|
|
|
back(){
|
|
|
this.$refs.navbar.goBack()
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
}
|
|
|
</script>
|
|
|
|