From fe10cf437b17a2ea0ef63373cae2e5790ebc3930 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期四, 31 七月 2025 18:22:52 +0800
Subject: [PATCH] action 处理

---
 pages/modal/3037.vue |   54 +++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/pages/modal/3037.vue b/pages/modal/3037.vue
index 8355d50..74b983c 100644
--- a/pages/modal/3037.vue
+++ b/pages/modal/3037.vue
@@ -1,5 +1,5 @@
 <template>
-	<view class="content">
+	<view class="content" :class="largeMode?'large-mode':''">
 		<!-- 涓绘暟鎹�-->
 		<view class="v-area" v-for="(classattr,index) in classAttrList">
 			<div class="class_attr_title" style="display: none;">
@@ -679,6 +679,7 @@
 		},
 		data() {
 			return {
+				largeMode: getApp().globalData.largeMode || false,
 				title: '鏂板',
 				param: {},
 				classAttrList: [],
@@ -1551,18 +1552,18 @@
 			ontap(e) { //鎵爜鍔熻兘
 				//console.log(e.target)
 				getApp().onScan((result) => {
-					//console.log(result.decodedata);
+					//console.log(result);
 					var isVal = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
 						'iindex']].Value;
 					// if(!isVal){
-					// 	this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata;
+					// 	this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result;
 					// 	var isVald =this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value;
 					// 	return;
 					// }
 					//涓绘暟鎹被鎵爜鏌ヨ鏁版嵁
-					if (isVal != result.decodedata) {
+					if (isVal != result) {
 						this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
-							'iindex']].Value = result.decodedata;
+							'iindex']].Value = result;
 						uni.hideKeyboard();
 						//瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈� 						var eventid = this.param.Scan_Code.Input_Change_Event.ID;
@@ -1589,7 +1590,7 @@
 								mast_attr: [],
 								inputParamter: [{
 									attr: 'mast_input_3037',
-									value: result.decodedata
+									value: result
 								}]
 							}
 
@@ -1601,13 +1602,13 @@
 			subontap(e) { //鎵爜鍔熻兘
 				//console.log(e.target)
 				getApp().onScan((result) => {
-					//console.log(result.decodedata);
+					//console.log(result);
 					var isVal = this.subClassAttrList[e.target.dataset['index']].Attr[e
 						.target.dataset['iindex']].Value;
 					//涓绘暟鎹被鎵爜鏌ヨ鏁版嵁
-					if (isVal != result.decodedata) {
+					if (isVal != result) {
 						this.subClassAttrList[e.target.dataset['index']].Attr[e.target
-							.dataset['iindex']].Value = result.decodedata;
+							.dataset['iindex']].Value = result;
 						uni.hideKeyboard();
 						//瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈� 						var eventid = this.param.Scan_Code.Input_Change_Event.ID;
@@ -1634,7 +1635,7 @@
 								mast_attr: [],
 								inputParamter: [{
 									attr: 'mast_input_3037',
-									value: result.decodedata
+									value: result
 								}]
 							}
 
@@ -1646,16 +1647,16 @@
 			scan_ontap(e) { //鎵爜鍖烘壂鐮佸姛鑳� 				//console.log(e.target)
 				getApp().onScan((result) => {
-					console.log(result.decodedata);
+					console.log(result);
 					var isflag = true;
 					for (var i in this.subPanelList) {
-						if (this.subPanelList[i].scanCodeVal == result.decodedata)
+						if (this.subPanelList[i].scanCodeVal == result)
 							isflag = false;
 					}
 					//瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁
 					if (isflag) {
 						uni.hideKeyboard();
-						this.scanCodeVal = result.decodedata;
+						this.scanCodeVal = result;
 						var eventid = this.param.Scan_Code.Input_Change_Event.ID;
 						if (eventid) {
 							var mast_req = [];
@@ -2626,10 +2627,21 @@
 								showCancel: false,
 								confirmText: this.translateSys('close')
 							});
+						if (data.result_type == 2) {
 
-						if (data.action) {
+						} else if (typeof data.result == 'string') {
+							if (data.result) {
+								uni.showModal({
+									title: this.translateSys('tip'),
+									content: data.result,
+									showCancel: false,
+									confirmText: this.translateSys('close')
+								});
+							}
+						}
+						try {
 							var actionlist =
-								data.action;
+								data.action || []
 							if (actionlist) {
 								for (var j =
 										0; j <
@@ -2749,6 +2761,18 @@
 									}
 								}
 							}
+						} catch (ex) {
+							let actionList = (data.action || []).map(a => a.action_type).join(';')
+							let tip = typeof ex == 'string' ? ex : ex.message
+							tip = `鎵ц鑴氭湰杩斿洖鐨�{actionList}鏃跺嚭鐜板紓甯革紝璇锋鏌ヨ剼鏈繑鍥炵殑鏁版嵁鏍煎紡鏄惁姝g‘銆�{tip}`
+							uni.showModal({
+								title: this.translateSys('tip'),
+								content: tip,
+								showCancel: false,
+								confirmText: this.translateSys('close')
+							});
+							console.log(ex)
+							return
 						}
 					}
 

--
Gitblit v1.9.1