瀏覽代碼

误报非误报方法封装再次

ming 3 年之前
父節點
當前提交
329c0fd25f
共有 2 個文件被更改,包括 9 次插入56 次删除
  1. 2 2
      common/common.js
  2. 7 54
      pages/unprocessDetail/unprocessDetail.vue

+ 2 - 2
common/common.js

@@ -1,11 +1,11 @@
 // 处理多次点击
-function noMultipleClicks(methods) {
+function noMultipleClicks(methods,params) {
     let that = this;
     
     if (that.noClick) {
 		console.log(1)
         that.noClick= false;
-        methods();
+        methods(params);
         setTimeout(function () {
             that.noClick= true;
         }, 2000)

+ 7 - 54
pages/unprocessDetail/unprocessDetail.vue

@@ -51,9 +51,9 @@
 
 						</view>
 						<view class="btn-area">
-							<button class="bg-orange round missReport margin-top" @click="$noMultipleClicks(alarmSubmit1)">误 报
+							<button class="bg-orange round missReport margin-top" @click="$noMultipleClicks(alarmSubmit,1)" >误 报
 							</button>
-							<button class="bg-blue round  missReport margin-top " @click="$noMultipleClicks(alarmSubmit0)">非 误 报
+							<button class="bg-blue round  missReport margin-top " @click="$noMultipleClicks(alarmSubmit,0)">非 误 报
 							</button>
 						</view>
 					</form>
@@ -77,6 +77,7 @@
 				textareaMsg: '',
 				getData: {},
 				radioOne: 0,
+				clzt:0
 			}
 		},
 		onLoad: function(option) {
@@ -159,8 +160,8 @@
 			},
 
 
-			//误报
-			alarmSubmit1() {
+			//误报 非误报
+			alarmSubmit(params) {
 				if (!this.textareaMsg.replace(/^\s*/g,'')) {
 					uni.showToast({
 						title: "请输入处理内容",
@@ -173,56 +174,7 @@
 					queryParam.type = this.getData.dwtype;
 					queryParam.device_code = this.getData.device_code;
 					queryParam.if_batch = this.radioOne;
-					queryParam.clwb = 1;
-					queryParam.ncmd = this.getData.ncmd;
-					queryParam.clnr = this.textareaMsg;
-					
-					if (this.getData.dwtype == 1) {
-						queryParam.data3 = this.getData.data3;
-						queryParam.data5 = this.getData.data5;
-						this.powerSubmitRes(queryParam);
-						return;
-					}
-					if (this.getData.dwtype == 2) {
-						queryParam.data1 = this.getData.data1;
-						this.powerSubmitRes(queryParam);
-						return;
-					}
-					if (this.getData.dwtype == 7) {
-						queryParam.data1 = this.getData.data1;
-						this.powerSubmitRes(queryParam);
-						return;
-					}
-					if (this.getData.dwtype == 3) {
-						queryParam.data2=this.getData.data2;
-						this.powerSubmitRes(queryParam);
-						return;
-					}
-					if (this.getData.dwtype == 6) {
-						queryParam.data2=this.getData.data2;
-						queryParam.data4=this.getData.data4;
-						this.powerSubmitRes(queryParam);
-						return;
-					}
-					this.powerSubmitRes(queryParam)
-				}
-			},
-			//非误报
-			//误报
-			alarmSubmit0() {
-				if (!this.textareaMsg.replace(/^\s*/g,'')) {
-					uni.showToast({
-						title: "请输入处理内容",
-						icon: "none"
-					});
-				} else {
-					
-					let queryParam = {};
-					queryParam.id = this.getData.id;
-					queryParam.type = this.getData.dwtype;
-					queryParam.device_code = this.getData.device_code;
-					queryParam.if_batch = this.radioOne;
-					queryParam.clwb = 0;
+					queryParam.clwb = params;
 					queryParam.ncmd = this.getData.ncmd;
 					queryParam.clnr = this.textareaMsg;
 					
@@ -256,6 +208,7 @@
 					this.powerSubmitRes(queryParam)
 				}
 			},
+			
 
 			RadioChange(e) {
 				this.radioOne = e.detail.value;