From 8a2ca99a372a7b44b990ab161337dfb333767e38 Mon Sep 17 00:00:00 2001
From: jt <jt@activesoft.com.cn>
Date: 星期二, 12 九月 2023 11:13:01 +0800
Subject: [PATCH] 5600码盘功能点确定时获取正在码盘里没有显示的字段传到脚本里改进

---
 pages/modal/5600.vue |  169 ++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 103 insertions(+), 66 deletions(-)

diff --git a/pages/modal/5600.vue b/pages/modal/5600.vue
index 5fbcbd8..7eb6358 100644
--- a/pages/modal/5600.vue
+++ b/pages/modal/5600.vue
@@ -555,40 +555,50 @@
 			  	// console.log(ret);
 			  	if (ret.err_code == 0) {
 					var result = ret.result; 
-			  		if(result.result_type == 0 && result.action){
-			  		    result.action.forEach(item=>{
-			  		        if(item.action_type == "insert_subtable_page_row"){ //鐮佺洏涓�-			  		            var value = item.value;
-			  		            $this.viewAceionRow(value);
-			  		        } else if(item.action_type == "set_subtable_page_content"){  //宸茬爜鐩�-			  		            var value = item.value;
-			  		            if(value.clear == true && $this.$data.detail1StyleDefList.length>0){ //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�-									uni.showModal({
-										title: '鎻愮ず',
-										content: '绯荤粺妫�祴鍒版湁姝e湪鐮佺洏涓殑璐у搧锛岀户缁搷浣滀細娓呯┖锛屾槸鍚︾户缁紵',
-										success: function (res) {
-											if (res.confirm) {
-											  $this.$data.detail1StyleDefList=[];
-											  $this.$data.detail2StyleDefList=[];
-											  $this.viewAceionContent(value);
-											} else if (res.cancel) {
-											  $this.$data.detail2StyleDefList=[];
-											  $this.viewAceionContent(value);
+					if (result.ret != 0) {
+					    var tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info.join('<br/>') : '';
+					    if (result.ret == 801) uni.showModal({title:'鎻愮ず',content:tip,showCancel:false,confirmText:"鍙栨秷"});
+					    else uni.showModal({title:'鎻愮ず',content:tip+',鎻愮ず:'+result.ret,showCancel:false,confirmText:"鍙栨秷"});
+						return false
+					}else{
+						let tip = result.info ? typeof result.info == 'string' ? result.info : result.info.join('<br/>') : '';
+						if (tip) uni.showModal({title:'鎻愮ず',content:tip,showCancel:false,confirmText:"鍙栨秷"});
+					
+						if(result.result_type == 0 && result.action){
+							result.action.forEach(item=>{
+								if(item.action_type == "insert_subtable_page_row"){ //鐮佺洏涓�+									var value = item.value;
+									$this.viewAceionRow(value);
+								} else if(item.action_type == "set_subtable_page_content"){  //宸茬爜鐩�+									var value = item.value;
+									if(value.clear == true && $this.$data.detail1StyleDefList.length>0){ //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�+										uni.showModal({
+											title: '鎻愮ず',
+											content: '绯荤粺妫�祴鍒版湁姝e湪鐮佺洏涓殑璐у搧锛岀户缁搷浣滀細娓呯┖锛屾槸鍚︾户缁紵',
+											success: function (res) {
+												if (res.confirm) {
+												  $this.$data.detail1StyleDefList=[];
+												  $this.$data.detail2StyleDefList=[];
+												  $this.viewAceionContent(value);
+												} else if (res.cancel) {
+												  $this.$data.detail2StyleDefList=[];
+												  $this.viewAceionContent(value);
+												}
 											}
-										}
-									});
-			  		            } else {
-			  		                $this.$data.detail2StyleDefList=[];
-			  		                $this.viewAceionContent(value);
-			  		            }
-			  		        }
-			  		    });
-			  		}else{
-						// this.detail2StyleDefList=[];
-			  		    if(result.info){
-							uni.showModal({title:"閿欒4.3",content:result.info,showCancel:false,confirmText:"鍙栨秷"});
+										});
+									} else {
+										$this.$data.detail2StyleDefList=[];
+										$this.viewAceionContent(value);
+									}
+								}
+							});
+						}else{
+							// this.detail2StyleDefList=[];
+							if(result.info){
+								uni.showModal({title:"閿欒4.3",content:result.info,showCancel:false,confirmText:"鍙栨秷"});
+							}
 						}
-			  		}
+					}
 			  		
 			  	}else{
 			  		uni.showModal({title:"閿欒4",content:ret.err_msg,showCancel:false,confirmText:"鍙栨秷"});
@@ -630,8 +640,9 @@
 		    this.$data.detail2StyleDefList.push(detailStyle);
 		    // console.log(this.$data.detail2StyleDefList);
 		}else{
+			detailStyle.form.attrs = data.row.attrs;
 			this.$data.detail1StyleDefList.push(detailStyle);
-	    // console.log(this.$data.detail1StyleDefList);
+			// console.log(this.$data.detail1StyleDefList);
 		}
 	},
 	//鍔犺浇宸茬爜鐩樺唴瀹�@@ -741,7 +752,23 @@
 	      detailAttrList.push(detail_attr);
 	    });
 	    // console.log(detailAttrList);
-	    
+		//鑾峰彇姝e湪鐮佺洏閲屾病鏈夋樉绀虹殑瀛楁
+		this.$data.detail1StyleDefList.forEach(style=>{
+		  style.form.attrs.forEach(attr => {
+		    for(var key in detailAttrList){
+		      let keys = Object.keys(detailAttrList[key]);
+		      let isflag = true;
+		      keys.forEach((ele) => {
+		        if(ele == attr.attr) isflag = false;
+		      });
+		      if(isflag) {
+		        detailAttrList[attr.attr] = attr.value;
+		      }
+		    } 
+		  });
+		});
+		// console.log(detailAttrList);
+	 //    return;
 		var input_param = Base64.encode(
 		    JSON.stringify(
 		      Object.keys(head_attr).map((a) => ({
@@ -795,41 +822,51 @@
 			console.log(res);
 			if (res.err_code == 0) {
 				var result = res.result; 
-				if(result.result_type == 0){
-				  if(result.action){
-					result.action.forEach(item=>{
-					  if(item.action_type == "insert_subtable_page_row"){ //鐮佺洏涓�-					    var value = item.value;
-					    //鍔犺浇宸茬粡鐮佺洏鏁版嵁
-				        $this.viewAceionRow(value,'add');
-			            //娓呯┖鏉$爜鍐呭
-						$this.$data.head_styledef.form.items.forEach((item,index) => {
-							if(item.fieldId != "S_CNTR_CODE"){
-							  item.value = '';
-						  	  item.oldvalue = '';
-							  $this.$data.head_styledef.form.model[item.fieldId] = '';
-							}
-						});
-						//娓呴櫎姝e湪鐮佺洏涓垚鍔熺殑鏁版嵁
-						$this.$data.detail1StyleDefList.forEach((style,index)=>{
-						  if(style.form.items[0].fieldId == json.attrs[0].attr && style.form.items[0].value == json.attrs[0].value){ 
-							$this.$data.detail1StyleDefList.splice(index,1);
-							return;
+				if (result.ret != 0) {
+				    var tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info.join('<br/>') : '';
+				    if (result.ret == 801) uni.showModal({title:'鎻愮ず',content:tip,showCancel:false,confirmText:"鍙栨秷"});
+				    else uni.showModal({title:'鎻愮ず',content:tip+',鎻愮ず:'+result.ret,showCancel:false,confirmText:"鍙栨秷"});
+					return false
+				}else{
+					let tip = result.info ? typeof result.info == 'string' ? result.info : result.info.join('<br/>') : '';
+					if (tip) uni.showModal({title:'鎻愮ず',content:tip,showCancel:false,confirmText:"鍙栨秷"});
+				
+					if(result.result_type == 0){
+					  if(result.action){
+						result.action.forEach(item=>{
+						  if(item.action_type == "insert_subtable_page_row"){ //鐮佺洏涓�+							var value = item.value;
+							//鍔犺浇宸茬粡鐮佺洏鏁版嵁
+							$this.viewAceionRow(value,'add');
+							//娓呯┖鏉$爜鍐呭
+							$this.$data.head_styledef.form.items.forEach((item,index) => {
+								if(item.fieldId != "S_CNTR_CODE"){
+								  item.value = '';
+								  item.oldvalue = '';
+								  $this.$data.head_styledef.form.model[item.fieldId] = '';
+								}
+							});
+							//娓呴櫎姝e湪鐮佺洏涓垚鍔熺殑鏁版嵁
+							$this.$data.detail1StyleDefList.forEach((style,index)=>{
+							  if(style.form.items[0].fieldId == json.attrs[0].attr && style.form.items[0].value == json.attrs[0].value){ 
+								$this.$data.detail1StyleDefList.splice(index,1);
+								return;
+							  }
+							});
+							// this.detail2StyleDefList=[];
+							uni.showModal({title:"鎻愮ず",content:"鐮佺洏鎴愬姛",showCancel:false,confirmText:"鍙栨秷"});
 						  }
 						});
-					    // this.detail2StyleDefList=[];
-						uni.showModal({title:"鎻愮ず",content:"鐮佺洏鎴愬姛",showCancel:false,confirmText:"鍙栨秷"});
+					  }else{
+						if($this.$data.param.After_OK_Event.ID != event.ID){ //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢
+							$this.sava($this.$data.param.After_OK_Event); //鎵ц纭畾鍚庝簨浠�+						}
 					  }
-					});
-				  }else{
-					if($this.$data.param.After_OK_Event.ID != event.ID){ //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢
-					    $this.sava($this.$data.param.After_OK_Event); //鎵ц纭畾鍚庝簨浠�-					}
-				  }
-				}else{
-					// $this.$data.detail2StyleDefList=[];
-				    if(result.info){
-					  uni.showModal({title:"鎻愮ず",content:result.info,showCancel:false,confirmText:"鍙栨秷"});
+					}else{
+						// $this.$data.detail2StyleDefList=[];
+						if(result.info){
+						  uni.showModal({title:"鎻愮ず",content:result.info,showCancel:false,confirmText:"鍙栨秷"});
+						}
 					}
 				}
 			}else{

--
Gitblit v1.9.1