|
@@ -112,7 +112,7 @@
|
|
|
// 存放orgid,orgname
|
|
|
formData: {
|
|
|
orgName: '',
|
|
|
- orgId:''
|
|
|
+ orgId: ''
|
|
|
},
|
|
|
show: false,
|
|
|
showtimeStart: false,
|
|
@@ -125,7 +125,7 @@
|
|
|
detinspect: null,
|
|
|
detresult: null,
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -141,10 +141,13 @@
|
|
|
const reArr = getDictDatas(DICT_TYPE.BACKEND_DET_RESULT)
|
|
|
// console.log('reArr',reArr);
|
|
|
this.tableData = res.data.list.map(item => {
|
|
|
- const thisItem = reArr.find(par=>par.value === item.detresult)
|
|
|
+ const thisItem = reArr.find(par => par.value === item.detresult)
|
|
|
// console.log('thisItem',thisItem);
|
|
|
- if(thisItem){
|
|
|
- item.detresult = {id:thisItem.value,name:thisItem.label}
|
|
|
+ if (thisItem) {
|
|
|
+ item.detresult = {
|
|
|
+ id: thisItem.value,
|
|
|
+ name: thisItem.label
|
|
|
+ }
|
|
|
}
|
|
|
return item
|
|
|
})
|
|
@@ -157,7 +160,7 @@
|
|
|
addClick() {
|
|
|
this.isLoaded = false
|
|
|
uni.navigateTo({
|
|
|
- url:`/pagesA/fire/fpd_detection/add_detection/add_detection?&orgName=${this.formData.orgName}&orgId=${this.formData.orgId}`,
|
|
|
+ url: `/pagesA/fire/fpd_detection/add_detection/add_detection?&orgName=${this.formData.orgName}&orgId=${this.formData.orgId}`,
|
|
|
});
|
|
|
},
|
|
|
// 模态框内容
|
|
@@ -205,17 +208,23 @@
|
|
|
getData() {
|
|
|
this.loading = true;
|
|
|
getFpdDetectionPage(this.queryParams).then(response => {
|
|
|
- // console.log('res',response );
|
|
|
+ console.log('res', response);
|
|
|
+ this.total = response.data.total
|
|
|
+
|
|
|
+ this.tableData = [...this.tableData,...response.data.list]
|
|
|
if (response.data) {
|
|
|
-
|
|
|
+
|
|
|
//对检测结果进行初始化
|
|
|
const reArr = getDictDatas(DICT_TYPE.BACKEND_DET_RESULT)
|
|
|
// console.log('reArr',reArr);
|
|
|
- this.tableData = response.data.list.map(item => {
|
|
|
- const thisItem = reArr.find(par=>par.value === item.detresult)
|
|
|
+ this.tableData = this.tableData.map(item => {
|
|
|
+ const thisItem = reArr.find(par => par.value === item.detresult)
|
|
|
// console.log('thisItem',thisItem);
|
|
|
- if(thisItem){
|
|
|
- item.detresult = {id:thisItem.value,name:thisItem.label}
|
|
|
+ if (thisItem) {
|
|
|
+ item.detresult = {
|
|
|
+ id: thisItem.value,
|
|
|
+ name: thisItem.label
|
|
|
+ }
|
|
|
}
|
|
|
return item
|
|
|
})
|
|
@@ -245,6 +254,19 @@
|
|
|
url: '/pagesA/fire/fpd_detection/detection_details/detection_details?id=' + val.id
|
|
|
});
|
|
|
},
|
|
|
+ // 触底的事件
|
|
|
+ onReachBottom() {
|
|
|
+ // 判断是否还有下一页数据
|
|
|
+ if (this.queryParams.pageNo * this.queryParams.pageSize >= this.total)
|
|
|
+ return uni.showToast({
|
|
|
+ title: `数据加载完毕`
|
|
|
+ });
|
|
|
+ // 判断是否正在请求其它数据,如果是,则不发起额外的请求
|
|
|
+ if (this.loading) return;
|
|
|
+ // this.pageNo += 1;
|
|
|
+ this.queryParams.pageNo += 1
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
loading: {
|