|
@@ -8,13 +8,9 @@
|
|
|
<!-- <view v-if="TabCur==index" class="cu-tag badge">
|
|
|
<block class="cu-tag badge">{{TabCur? porcessedList.length:alarm_count}} </block>
|
|
|
</view> -->
|
|
|
-
|
|
|
-
|
|
|
<view v-if="TabCur==index&&!TabCur" class="cu-tag badge">
|
|
|
<block class="cu-tag badge">{{alarm_count}} </block>
|
|
|
</view>
|
|
|
-
|
|
|
-
|
|
|
{{item}}
|
|
|
</view>
|
|
|
</scroll-view>
|
|
@@ -23,7 +19,6 @@
|
|
|
<block v-if="TabCur==0">
|
|
|
<view class="processList">
|
|
|
<view class="cu-list menu-avatar">
|
|
|
-
|
|
|
<view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
|
|
|
<view class="cu-avatar lg">
|
|
|
<image class="image-bg" src="/static/process-icon.png" />
|
|
@@ -87,7 +82,6 @@
|
|
|
return {
|
|
|
unporcessList: [],
|
|
|
porcessedList: [],
|
|
|
-
|
|
|
type: '0',
|
|
|
modalName: null,
|
|
|
listTouchStart: 0,
|
|
@@ -102,43 +96,34 @@
|
|
|
pageSize: 10,
|
|
|
loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
|
|
isLoadMore: false, //是否加载中
|
|
|
-
|
|
|
-
|
|
|
};
|
|
|
},
|
|
|
|
|
|
- onPullDownRefresh() {
|
|
|
- console.log('refresh--上拉刷新');
|
|
|
- this.getProcessData(0);
|
|
|
- this.page=1
|
|
|
-
|
|
|
- setTimeout(function() {
|
|
|
- uni.stopPullDownRefresh();
|
|
|
- }, 100);
|
|
|
- },
|
|
|
-
|
|
|
onReachBottom() { //上拉触底函数
|
|
|
if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
|
|
|
this.isLoadMore = true
|
|
|
this.page += 1
|
|
|
- this.getProcessData(0);
|
|
|
+ this.getProcessData({
|
|
|
+ "company_code": uni.getStorageSync('selectedCode'),
|
|
|
+ "type": this.type,
|
|
|
+ "processing_status": this.TabCur,
|
|
|
+ "page": this.page,
|
|
|
+ "pageSize": this.pageSize,
|
|
|
+ }, this.TabCur);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
-
|
|
|
onLoad: function(option) {
|
|
|
-
|
|
|
- setTimeout(function() {
|
|
|
- console.log('start pulldown');
|
|
|
- }, 1000);
|
|
|
- uni.startPullDownRefresh();
|
|
|
-
|
|
|
- this.getProcessData(0);
|
|
|
-
|
|
|
+ this.getProcessData({
|
|
|
+ "company_code": uni.getStorageSync('selectedCode'),
|
|
|
+ "type": option.type,
|
|
|
+ "processing_status": 0,
|
|
|
+ "page": this.page,
|
|
|
+ "pageSize": this.pageSize,
|
|
|
+ }, 0);
|
|
|
|
|
|
this.companyCode = option.companyCode;
|
|
|
this.processingStatus = 1
|
|
|
-
|
|
|
this.type = option.type;
|
|
|
|
|
|
let url = "";
|
|
@@ -182,8 +167,6 @@
|
|
|
uni.setNavigationBarTitle({
|
|
|
title: url
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
|
|
|
onNavigationBarButtonTap(e) {
|
|
@@ -197,33 +180,22 @@
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
- async getProcessData(whichTab) {
|
|
|
+ async getProcessData(params, whichTab) {
|
|
|
const res = await this.$myRequest({
|
|
|
url: 'ComprehensiveAlarm/getIntegratedAlarmList',
|
|
|
- data: {
|
|
|
- "company_code": uni.getStorageSync('selectedCode'),
|
|
|
- "type": 1, //aa写活
|
|
|
- "processing_status": 0,
|
|
|
- "page": this.page,
|
|
|
- "pageSize": this.pageSize,
|
|
|
- },
|
|
|
+ data: params,
|
|
|
showLoading: true
|
|
|
})
|
|
|
-
|
|
|
if (res.data.alarm_count) {
|
|
|
-
|
|
|
- this.unporcessList = res.data.data;
|
|
|
-
|
|
|
if (whichTab == 0) {
|
|
|
- this.unporcessList = res.data.data;
|
|
|
+ this.unporcessList = this.unporcessList.concat(res.data.data)
|
|
|
this.alarm_count = parseInt(res.data.alarm_count)
|
|
|
|
|
|
} else {
|
|
|
- this.porcessedList = res.data.data;
|
|
|
+ this.porcessedList = this.porcessedList.concat(res.data.data);
|
|
|
this.alarm_count1 = parseInt(res.data.alarm_count)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (res.data.data.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
|
|
this.isLoadMore = true
|
|
|
this.loadStatus = 'nomore'
|
|
@@ -234,24 +206,23 @@
|
|
|
this.isLoadMore = true
|
|
|
this.loadStatus = 'nomore'
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
|
|
|
tabSelect(e) {
|
|
|
this.unporcessList = [],
|
|
|
this.porcessedList = [],
|
|
|
+ this.page = 1
|
|
|
|
|
|
- console.log(e.currentTarget);
|
|
|
+ console.log(e.currentTarget);
|
|
|
this.TabCur = e.currentTarget.dataset.id;
|
|
|
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
|
|
|
|
|
|
this.getProcessData({
|
|
|
"company_code": uni.getStorageSync('selectedCode'),
|
|
|
"type": this.type,
|
|
|
- "processing_status": e.currentTarget.dataset.id
|
|
|
+ "processing_status": e.currentTarget.dataset.id,
|
|
|
+ "page": this.page,
|
|
|
+ "pageSize": this.pageSize
|
|
|
}, this.TabCur);
|
|
|
},
|
|
|
|
|
@@ -271,8 +242,6 @@
|
|
|
complete: () => {}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|