Selaa lähdekoodia

Merge branch 'liuqiang'

liuQiang 1 vuosi sitten
vanhempi
commit
99ec71ab68

+ 8 - 4
pagesA/fire/fpd_detection/add_detection/add_detection.vue

@@ -14,7 +14,7 @@
 
 					<u-form-item label="预计检测时间" prop="detdate">
 						<uni-datetime-picker :show="unitTime" v-model="formData.detdate" type="datetime"
-							closeOnClickOverlay @confirm="ActiveUnitTime" @cancel="unitTime = false" 
+							closeOnClickOverlay @confirm="ActiveUnitTime" @cancel="unitTime = false"
 							@change="changetime" @close="unitTime = false"></uni-datetime-picker>
 					</u-form-item>
 					<u-form-item label="检测维保结果" prop="detresult" @click="
@@ -198,8 +198,8 @@
 		// 在 vue页面,向起始页通过事件传递数据
 		// 在 vue页面,向起始页通过事件传递数据
 		onLoad: function(option) {
-			this.formData.orgName = option.orgName ? option.orgName : ''
-			this.formData.orgId = option.orgId ? option.orgId : ''
+			// this.formData.orgName = option.orgName ? option.orgName : ''
+			// this.formData.orgId = option.orgId ? option.orgId : ''
 			this.actions2.map(i => {
 				i.name = i.label;
 				i.id = i.value;
@@ -353,17 +353,21 @@
 				this.checkArr = [...arr]
 
 			},
+			//多选确定事件
 			checkboxConfirm2() {
 				this.showInspOption = false
 				this.formData.detinspect = this.checkArr.join(',')
 				// console.log('detinspect',this.formData.detinspect);
 			},
+			//多选取消事件
 			checkboxCancel2() {
 				this.showInspOption = false
+				// console.log('this.formData.detinspect',this.formData.detinspect);
 				if (this.formData.detinspect) {
-
 					const nowArr = this.formData.detinspect.split(',')
 					this.checkArr = [...nowArr]
+				}else{
+					this.checkArr = []
 				}
 
 			},

+ 34 - 12
pagesA/fire/fpd_detection/fpd_detection.vue

@@ -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: {