From 090819b136cc0903bf2ac25845c9b275ddbcba89 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 01 八月 2025 17:32:29 +0800
Subject: [PATCH] dataobjcreat而返回处理

---
 pages/modal/3037_2.vue |  855 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 477 insertions(+), 378 deletions(-)

diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue
index e0896b0..3f49521 100644
--- a/pages/modal/3037_2.vue
+++ b/pages/modal/3037_2.vue
@@ -1,7 +1,8 @@
 <template>
 	<view class="uni-page-modal-3017-2" :class="largeMode?'large-mode':''">
 		<!-- 琛ㄥご鏍峰紡 -->
-		<OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form" :hiddenIds="head_styledef.hiddenIds ?head_styledef.hiddenIds :[] " @on-focus="ontap"
+		<OIForm ref="refBaseForm" class="v-headStyle" :form="head_styledef.form"
+			:hiddenIds="head_styledef.hiddenIds ?head_styledef.hiddenIds :[] " @on-focus="ontap"
 			@on-change="onEnterChange" @on-click-prefix="classAttr_extButton" @on-click-suffix="classAttr_extButton">
 		</OIForm>
 		<!-- 浠庢暟鎹�-->
@@ -123,7 +124,7 @@
 	import {
 		getUIStyleInfo,
 		runCustomEvent,
-		dataObjCreate,
+
 		dataObjDel
 	} from "@/api/data.js"
 	import dayjs from "dayjs";
@@ -463,146 +464,175 @@
 					} else {
 						var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
 							'<br/>') : '';
+						tip = tip || data.err_info
 						if (tip) uni.showModal({
 							title: this.translateSys("tip"),
 							content: tip,
 							showCancel: false,
 							confirmText: this.translateSys('close')
 						});
+						if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+							if (data.result_type == 2) {
 
-						var actionlist = data.action;
-						if (actionlist) {
-							console.log(actionlist);
-							for (var i = 0; i < actionlist.length; i++) {
-								var action = actionlist[i];
-								if (action.action_type == 'set_dlg_attr') {
-									var result = action.value;
-									for (var i = 0; i < result.length; i++) {
-										if (result[i].choice_list) {
+							} 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 || []
+								for (var i = 0; i < actionlist.length; i++) {
+									var action = actionlist[i];
+									if (action.action_type == 'set_dlg_attr') {
+										var result = action.value;
+										for (var i = 0; i < result.length; i++) {
+											if (result[i].choice_list) {
+												for (var c = 0; c < styledef.form.items.length; c++) {
+													var attr = styledef.form.items[c];
+													if (attr.name != 'Layout') {
+														if (attr.fieldId == result[i].attr) {
+															var dictItemList = [];
+															for (var d in result[i].choice_list) {
+																var val = result[i].choice_list[d];
+																dictItemList.push({
+																	"CN_S_NAME": val,
+																	"CN_S_VALUE": val,
+																	"text": val,
+																	"value": val
+																});
+															}
+															attr.dict = dictItemList;
+														}
+													} else if (attr.name == 'Layout') {
+														attr.setting.colList.forEach(col => {
+															if (col) {
+																if (col.fieldId == result[i].attr) {
+																	var dictItemList = [];
+																	for (var d in result[i]
+																			.choice_list) {
+																		var val = result[i]
+																			.choice_list[d];
+																		dictItemList.push({
+																			"CN_S_NAME": val,
+																			"CN_S_VALUE": val,
+																			"text": val,
+																			"value": val
+																		});
+																	}
+																	col.dict = dictItemList;
+																}
+															}
+														});
+													}
+
+												}
+											}
 											for (var c = 0; c < styledef.form.items.length; c++) {
 												var attr = styledef.form.items[c];
+												// console.log(attr[j].Name+'=='+result[i].attr);
+												//鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�+												if ($this.head_styledef.form.model[result[i].attr] ==
+													undefined) {
+													$this.head_styledef.form.model[result[i].attr] = result[i]
+														.value;
+												}
+												//鍒ゆ柇鏄惁鏄爡鏍艰〃鍗� 												if (attr.name != 'Layout') {
 													if (attr.fieldId == result[i].attr) {
-														var dictItemList = [];
-														for (var d in result[i].choice_list) {
-															var val = result[i].choice_list[d];
-															dictItemList.push({
-																"CN_S_NAME": val,
-																"CN_S_VALUE": val,
-																"text": val,
-																"value": val
-															});
-														}
-														attr.dict = dictItemList;
+														attr.value = '';
+														attr.oldvalue = '';
+														attr.value = result[i].value;
+														attr.oldvalue = result[i].value;
+														$this.head_styledef.form.model[attr.fieldId] = result[
+															i].value;
 													}
 												} else if (attr.name == 'Layout') {
 													attr.setting.colList.forEach(col => {
 														if (col) {
 															if (col.fieldId == result[i].attr) {
-																var dictItemList = [];
-																for (var d in result[i]
-																		.choice_list) {
-																	var val = result[i]
-																		.choice_list[d];
-																	dictItemList.push({
-																		"CN_S_NAME": val,
-																		"CN_S_VALUE": val,
-																		"text": val,
-																		"value": val
-																	});
-																}
-																col.dict = dictItemList;
+																col.value = '';
+																col.oldvalue = '';
+																col.value = result[i].value;
+																col.oldvalue = result[i].value;
+																$this.head_styledef.form.model[col
+																	.fieldId] = result[i].value;
 															}
 														}
 													});
 												}
+											}
 
-											}
 										}
-										for (var c = 0; c < styledef.form.items.length; c++) {
-											var attr = styledef.form.items[c];
-											// console.log(attr[j].Name+'=='+result[i].attr);
-											//鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�-											if ($this.head_styledef.form.model[result[i].attr] ==
-												undefined) {
-												$this.head_styledef.form.model[result[i].attr] = result[i]
-													.value;
-											}
-											//鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�-											if (attr.name != 'Layout') {
-												if (attr.fieldId == result[i].attr) {
-													attr.value = '';
-													attr.oldvalue = '';
-													attr.value = result[i].value;
-													attr.oldvalue = result[i].value;
-													$this.head_styledef.form.model[attr.fieldId] = result[
-														i].value;
-												}
-											} else if (attr.name == 'Layout') {
-												attr.setting.colList.forEach(col => {
-													if (col) {
-														if (col.fieldId == result[i].attr) {
-															col.value = '';
-															col.oldvalue = '';
-															col.value = result[i].value;
-															col.oldvalue = result[i].value;
-															$this.head_styledef.form.model[col
-																.fieldId] = result[i].value;
+									} else if (data.action[i].action_type == 'set_dlg_attr_show') {
+										var result = action.value;
+										if (type == 'head') {
+											$this.setFormItemVisible(result)
+											// console.log($this.head_styledef);
+										} else {
+											result.forEach(async (attr, key) => {
+												styledef.form.items.forEach(async (ele, index) => {
+													//鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�+													if (ele.name != 'Layout') {
+														if (ele.fieldId == attr.attr) {
+															ele.show = attr.show;
 														}
+													} else if (ele.name == 'Layout') {
+														ele.setting.colList.forEach(
+															col => {
+																if (col) {
+																	if (col
+																		.fieldId ==
+																		attr.attr
+																	) {
+																		col.show =
+																			attr
+																			.show;
+																	}
+																}
+															});
 													}
 												});
-											}
-										}
-
-									}
-								} else if (data.action[i].action_type == 'set_dlg_attr_show') {
-									var result = action.value;
-									if (type == 'head') {
-										$this.setFormItemVisible(result)
-										// console.log($this.head_styledef);
-									} else {
-										result.forEach(async (attr, key) => {
-											styledef.form.items.forEach(async (ele, index) => {
-												//鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�-												if (ele.name != 'Layout') {
-													if (ele.fieldId == attr.attr) {
-														ele.show = attr.show;
-													}
-												} else if (ele.name == 'Layout') {
-													ele.setting.colList.forEach(
-														col => {
-															if (col) {
-																if (col.fieldId ==
-																	attr.attr) {
-																	col.show = attr
-																		.show;
-																}
-															}
-														});
-												}
 											});
+											var style_def = JSON.parse(JSON.stringify(styledef));
+
+
+											$this.detail1_styledef = [];
+											$this.detail1_styledef = style_def;
+											// console.log($this.detail1_styledef);
+										}
+									} else {
+										uni.showModal({
+											title: this.translateSys("tip"),
+											content: this.translate('execute_init_event_failed') +
+												this.translateSys("full_stop") +
+												this.translate('reason') + this.translateSys("colon") +
+												this.translateSys("quotation_mark_left") + action
+												.action_type + this.translateSys(
+													"quotation_mark_right") + this
+												.translate('tip_action_unprocessed'),
+											showCancel: false,
+											confirmText: this.translateSys('close')
 										});
-										var style_def = JSON.parse(JSON.stringify(styledef));
-
-
-										$this.detail1_styledef = [];
-										$this.detail1_styledef = style_def;
-										// console.log($this.detail1_styledef);
 									}
-								} else {
-									uni.showModal({
-										title: this.translateSys("tip"),
-										content: this.translate('execute_init_event_failed') +
-											this.translateSys("full_stop") +
-											this.translate('reason') + this.translateSys("colon") +
-											this.translateSys("quotation_mark_left") + action
-											.action_type + this.translateSys(
-												"quotation_mark_right") + this
-											.translate('tip_action_unprocessed'),
-										showCancel: false,
-										confirmText: this.translateSys('close')
-									});
 								}
+
+							} 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
 							}
 						}
 					}
@@ -853,16 +883,28 @@
 							.info
 							.join(
 								'<br/>') : '';
+						tip = tip || data.err_info
 						if (tip) uni.showModal({
 							title: $this.translateSys("tip"),
 							content: tip,
 							showCancel: false,
 							confirmText: $this.translateSys('close')
 						});
+						if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+							if (data.result_type == 2) {
 
-						if (data != "") {
-							var actions = data.action;
-							if (actions) {
+							} 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 actions = data.action || []
 								for (var i = 0; i < actions.length; i++) {
 									var action = actions[i];
 									console.log(action)
@@ -1036,18 +1078,22 @@
 										});
 									}
 								}
+
+							} 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
 							}
-						} else {
-							uni.showModal({
-								title: $this.translateSys('tip') + "5.2",
-								content: $this.translateSys("quotation_mark_left") +
-									"before_click_button" + $this.translateSys(
-										"quotation_mark_right") + $this.translateSys(
-										"comma") + 'event_id' + eventid,
-								showCancel: false,
-								confirmText: $this.translateSys('close')
-							});
 						}
+
 					}
 
 				}).catch(ex => {
@@ -1529,144 +1575,169 @@
 					} else {
 						var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
 							'<br/>') : '';
+						tip = tip || data.err_info
 						if (tip) uni.showModal({
 							title: this.translateSys("tip"),
 							content: tip,
 							showCancel: false,
 							confirmText: this.translateSys('close')
 						});
+						if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+							if (data.result_type == 2) {
+								var result = data.result || []
 
-						var actionlist = data.action;
-						if (actionlist) {
-							console.log(actionlist);
-							for (var i = 0; i < actionlist.length; i++) {
-								var action = actionlist[i];
-								if (action.action_type == 'set_dlg_attr') {
-									var result = action.value;
-									for (var i = 0; i < result.length; i++) {
-										if (result[i].choice_list) {
+								for (var i = 0; i < result.length; i++) {
+									for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
+										var attr = $this.head_styledef.form.items[c];
+										if (attr.name != 'Layout') {
+											if (attr.fieldId == result[i].attr) {
+												attr.value = '';
+												attr.oldvalue = '';
+												attr.value = result[i].value;
+												attr.oldvalue = result[i].value;
+												$this.head_styledef.form.model[attr.fieldId] = result[i].value;
+											}
+										} else if (attr.name == 'Layout') {
+											attr.setting.colList.forEach(col => {
+												if (col) {
+													if (col.fieldId == result[i].attr) {
+														col.value = '';
+														col.oldvalue = '';
+														col.value = result[i].value;
+														col.oldvalue = result[i].value;
+														$this.head_styledef.form.model[col.fieldId] =
+															result[i].value;
+													}
+												}
+											});
+										}
+
+									}
+
+									var length = 0;
+									if (!$this.refdatastore.filter(function(s) {
+											return result[i].attr == s.attr
+										}).length) {
+										length = 1;
+										$this.refdatastore.push(result[i]);
+									}
+									if (length == 0) {
+										for (var j = 0; j < $this.refdatastore.length; j++) {
+											if ($this.refdatastore[j].attr == result[i].attr) {
+												$this.refdatastore[j].value = result[i].value;
+											}
+										}
+									}
+								}
+
+
+							} 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 || []
+								for (var i = 0; i < actionlist.length; i++) {
+									var action = actionlist[i];
+									if (action.action_type == 'set_dlg_attr') {
+										var result = action.value;
+										for (var i = 0; i < result.length; i++) {
+											if (result[i].choice_list) {
+												for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
+													var attr = $this.head_styledef.form.items[c];
+													if (attr.name != 'Layout') {
+														if (attr.fieldId == result[i].attr) {
+															var dictItemList = [];
+															for (var d in result[i].choice_list) {
+																var val = result[i].choice_list[d];
+																dictItemList.push({
+																	"CN_S_NAME": val,
+																	"CN_S_VALUE": val,
+																	"text": val,
+																	"value": val
+																});
+															}
+															attr.dict = dictItemList;
+														}
+													} else if (attr.name == 'Layout') {
+														attr.setting.colList.forEach(col => {
+															if (col) {
+																if (col.fieldId == result[i].attr) {
+																	var dictItemList = [];
+																	for (var d in result[i].choice_list) {
+																		var val = result[i].choice_list[d];
+																		dictItemList.push({
+																			"CN_S_NAME": val,
+																			"CN_S_VALUE": val,
+																			"text": val,
+																			"value": val
+																		});
+																	}
+																	col.dict = dictItemList;
+																}
+															}
+														});
+													}
+												}
+											}
 											for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
 												var attr = $this.head_styledef.form.items[c];
+												// console.log(attr[j].Name+'=='+result[i].attr);
 												if (attr.name != 'Layout') {
 													if (attr.fieldId == result[i].attr) {
-														var dictItemList = [];
-														for (var d in result[i].choice_list) {
-															var val = result[i].choice_list[d];
-															dictItemList.push({
-																"CN_S_NAME": val,
-																"CN_S_VALUE": val,
-																"text": val,
-																"value": val
-															});
-														}
-														attr.dict = dictItemList;
+														attr.value = '';
+														attr.oldvalue = '';
+														attr.value = result[i].value;
+														attr.oldvalue = result[i].value;
+														$this.head_styledef.form.model[attr.fieldId] = result[i]
+															.value;
 													}
 												} else if (attr.name == 'Layout') {
 													attr.setting.colList.forEach(col => {
 														if (col) {
 															if (col.fieldId == result[i].attr) {
-																var dictItemList = [];
-																for (var d in result[i].choice_list) {
-																	var val = result[i].choice_list[d];
-																	dictItemList.push({
-																		"CN_S_NAME": val,
-																		"CN_S_VALUE": val,
-																		"text": val,
-																		"value": val
-																	});
-																}
-																col.dict = dictItemList;
+																col.value = '';
+																col.oldvalue = '';
+																col.value = result[i].value;
+																col.oldvalue = result[i].value;
+																$this.head_styledef.form.model[col
+																	.fieldId] = result[i].value;
 															}
 														}
 													});
 												}
-											}
-										}
-										for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
-											var attr = $this.head_styledef.form.items[c];
-											// console.log(attr[j].Name+'=='+result[i].attr);
-											if (attr.name != 'Layout') {
-												if (attr.fieldId == result[i].attr) {
-													attr.value = '';
-													attr.oldvalue = '';
-													attr.value = result[i].value;
-													attr.oldvalue = result[i].value;
-													$this.head_styledef.form.model[attr.fieldId] = result[i]
-														.value;
-												}
-											} else if (attr.name == 'Layout') {
-												attr.setting.colList.forEach(col => {
-													if (col) {
-														if (col.fieldId == result[i].attr) {
-															col.value = '';
-															col.oldvalue = '';
-															col.value = result[i].value;
-															col.oldvalue = result[i].value;
-															$this.head_styledef.form.model[col
-																.fieldId] = result[i].value;
-														}
-													}
-												});
+
 											}
 
 										}
-
-									}
-								} else if (action.action_type == 'set_dlg_attr_show') {
-									var data = action.value;
-									$this.setFormItemVisible(data)
-									// console.log($this.head_styledef);
-								} else if (action.action_type == 'set_global_attr') {
-									$this.global_attr = action.value || [];
-								}
-
-							}
-						}
-
-						if (data.result) {
-							var result = data.result;
-							for (var i = 0; i < result.length; i++) {
-								for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
-									var attr = $this.head_styledef.form.items[c];
-									if (attr.name != 'Layout') {
-										if (attr.fieldId == result[i].attr) {
-											attr.value = '';
-											attr.oldvalue = '';
-											attr.value = result[i].value;
-											attr.oldvalue = result[i].value;
-											$this.head_styledef.form.model[attr.fieldId] = result[i].value;
-										}
-									} else if (attr.name == 'Layout') {
-										attr.setting.colList.forEach(col => {
-											if (col) {
-												if (col.fieldId == result[i].attr) {
-													col.value = '';
-													col.oldvalue = '';
-													col.value = result[i].value;
-													col.oldvalue = result[i].value;
-													$this.head_styledef.form.model[col.fieldId] =
-														result[i].value;
-												}
-											}
-										});
+									} else if (action.action_type == 'set_dlg_attr_show') {
+										var data = action.value;
+										$this.setFormItemVisible(data)
+										// console.log($this.head_styledef);
+									} else if (action.action_type == 'set_global_attr') {
+										$this.global_attr = action.value || [];
 									}
 
 								}
 
-								var length = 0;
-								if (!$this.refdatastore.filter(function(s) {
-										return result[i].attr == s.attr
-									}).length) {
-									length = 1;
-									$this.refdatastore.push(result[i]);
-								}
-								if (length == 0) {
-									for (var j = 0; j < $this.refdatastore.length; j++) {
-										if ($this.refdatastore[j].attr == result[i].attr) {
-											$this.refdatastore[j].value = result[i].value;
-										}
-									}
-								}
+							} 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
 							}
 						}
 					}
@@ -1791,86 +1862,17 @@
 					} else {
 						var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
 							'<br/>') : '';
+						tip = tip || data.err_info
 						if (tip) uni.showModal({
 							title: this.translateSys("tip"),
 							content: tip,
 							showCancel: false,
 							confirmText: this.translateSys('close')
 						});
+						if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+							if (data.result_type == 2) {
+								if (data.result) {
 
-						var actionlist = data.action;
-						if (actionlist) {
-							console.log(actionlist);
-							for (var ii = 0; ii < actionlist.length; ii++) {
-								var action = actionlist[ii];
-								if (action.action_type == 'set_dlg_attr') {
-									var result = action.value;
-									for (var i = 0; i < result.length; i++) {
-										if (result[i].choice_list) {
-											for (var s = 0; s < $this.subPanelList.length; s++) {
-												for (var c = 0; c < $this.subPanelList[s]
-													.subClassAttrList.length; c++) {
-													var attr = $this.subPanelList[s].subClassAttrList[c]
-														.Attr;
-													for (var j = 0; j < attr.length; j++) {
-														if (attr[j].Name == result[i].attr) {
-															if (utils.classUtils.attrTypeIsDict(attr[j]
-																	.Type)) {
-																var dictItemList = [];
-																for (var d in result[i].choice_list) {
-																	var val = result[i].choice_list[d];
-																	dictItemList.push({
-																		"CN_S_NAME": val,
-																		"CN_S_VALUE": val,
-																		"Name": val,
-																		"label": val,
-																		"value": val
-																	});
-																}
-																attr[j].dictitem = dictItemList;
-																// attr[j].dictitem = result[i].choice_list;
-															}
-														}
-													}
-												}
-											}
-										}
-										for (var s = 0; s < $this.subPanelList.length; s++) {
-											for (var c = 0; c < $this.subPanelList[s].subClassAttrList
-												.length; c++) {
-												var attr = $this.subPanelList[s].subClassAttrList[c]
-													.Attr;
-												for (var j = 0; j < attr.length; j++) {
-													console.log(attr[j].Name + '==' + result[i].attr);
-													if (attr[j].Name == result[i].attr) {
-														attr[j].Value = result[i].value;
-														// attr.value = '';
-														// attr.oldvalue = '';
-														// attr.value = result[i].value;
-														// attr.oldvalue = result[i].value;
-													}
-												}
-											}
-										}
-										var length = 0;
-
-									}
-								} else if (action.action_type == 'set_global_attr') {
-									$this.$actiontr = action.value || [];
-								} else if (action.action_type == 'open_common_dlg') { //鎵撳紑渚ф粦寮规
-									var $this = this;
-									if (action.value.common_dlg_id == 'check_list') {
-										$this.check_list = action.value.config;
-										if (action.value.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�-											$this.popupType = 'right';
-										else
-											$this.popupType = 'center'
-										// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
-										$this.$refs.popup.open($this.popupType);
-									}
-								} else if (action.action_type == 'add_subcls_panel') { //涓讳粠鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�-									var result = action.value;
-									var $this = this;
 									var list_1 = JSON.parse(JSON.stringify(this.detail1_styledef));
 									var scanCodeVal = $this.scanCodeVal;
 									var rand = '';
@@ -1889,16 +1891,14 @@
 										scanCodeVal: scanCodeVal,
 										subClassAttr: list_1
 									});
-									$this.activelist.push({
-										active: false
-									});
+									var result = data.result || []
 									for (var i = 0; i < result.length; i++) {
 										for (var s = 0; s < $this.subPanelList.length; s++) {
 											if ($this.subPanelList[s].scanCodeVal == scanCodeVal) {
 												if (result[i].attr == "S_ID")
 													$this.subPanelList[s].ObjID = result[i].value;
-												var _subClassAttr = $this.subPanelList[s].subClassAttr
-													.form.items;
+												var _subClassAttr = $this.subPanelList[s].subClassAttr.form
+													.items;
 												for (var c = 0; c < _subClassAttr.length; c++) {
 													if (_subClassAttr[c].name != 'Layout') {
 														if (_subClassAttr[c].fieldId == result[i].attr)
@@ -1912,11 +1912,9 @@
 														});
 													}
 												}
-
-												// $this.subPanelList[s].subClassAttr=list_1;
 											}
 										}
-										// console.log($this.subPanelList);
+
 										var length = 0;
 										if (!$this.refdatastore.filter(function(s) {
 												return result[i].attr == s.attr
@@ -1932,77 +1930,177 @@
 											}
 										}
 									}
-								} else {
+								}
+
+							} else if (typeof data.result == 'string') {
+								if (data.result) {
 									uni.showModal({
-										title: this.translateSys("tip"),
-										content: this.translateSys("quotation_mark_left") + action
-											.action_type + this.translateSys(
-												"quotation_mark_right") + this.translate(
-												"tip_action_unprocessed"),
+										title: this.translateSys('tip'),
+										content: data.result,
 										showCancel: false,
 										confirmText: this.translateSys('close')
 									});
 								}
 							}
-						}
-
-						if (data.result) {
-							var list_1 = JSON.parse(JSON.stringify(this.detail1_styledef));
-							var scanCodeVal = $this.scanCodeVal;
-							var rand = '';
-							for (var i = 0; i < 5; i++) { //鐢熸垚5浣嶉殢鏈烘暟
-								rand += Math.floor(Math.random() * 10);
-							}
-							if (inputParamter[0].attr) {
-								if (inputParamter[0].attr == "mast_input_3037") //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�-									scanCodeVal = "mast_input_3037-" + rand;
-							}
-							if (info.attr[0].attr) {
-								if (info.attr[0].attr == "mast_input_3037") //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�-									scanCodeVal = "mast_input_3037-" + rand;
-							}
-							$this.subPanelList.push({
-								scanCodeVal: scanCodeVal,
-								subClassAttr: list_1
-							});
-							var result = data.result;
-							for (var i = 0; i < result.length; i++) {
-								for (var s = 0; s < $this.subPanelList.length; s++) {
-									if ($this.subPanelList[s].scanCodeVal == scanCodeVal) {
-										if (result[i].attr == "S_ID")
-											$this.subPanelList[s].ObjID = result[i].value;
-										var _subClassAttr = $this.subPanelList[s].subClassAttr.form
-											.items;
-										for (var c = 0; c < _subClassAttr.length; c++) {
-											if (_subClassAttr[c].name != 'Layout') {
-												if (_subClassAttr[c].fieldId == result[i].attr)
-													_subClassAttr[c].value = result[i].value;
-											} else if (_subClassAttr[c].name == 'Layout') {
-												_subClassAttr[c].setting.colList.forEach(col => {
-													if (col) {
-														if (col.fieldId == result[i].attr)
-															col.value = result[i].value;
+							try {
+								var actionlist = data.action || []
+								for (var ii = 0; ii < actionlist.length; ii++) {
+									var action = actionlist[ii];
+									if (action.action_type == 'set_dlg_attr') {
+										var result = action.value;
+										for (var i = 0; i < result.length; i++) {
+											if (result[i].choice_list) {
+												for (var s = 0; s < $this.subPanelList.length; s++) {
+													for (var c = 0; c < $this.subPanelList[s]
+														.subClassAttrList.length; c++) {
+														var attr = $this.subPanelList[s].subClassAttrList[c]
+															.Attr;
+														for (var j = 0; j < attr.length; j++) {
+															if (attr[j].Name == result[i].attr) {
+																if (utils.classUtils.attrTypeIsDict(attr[j]
+																		.Type)) {
+																	var dictItemList = [];
+																	for (var d in result[i].choice_list) {
+																		var val = result[i].choice_list[d];
+																		dictItemList.push({
+																			"CN_S_NAME": val,
+																			"CN_S_VALUE": val,
+																			"Name": val,
+																			"label": val,
+																			"value": val
+																		});
+																	}
+																	attr[j].dictitem = dictItemList;
+																	// attr[j].dictitem = result[i].choice_list;
+																}
+															}
+														}
 													}
-												});
+												}
+											}
+											for (var s = 0; s < $this.subPanelList.length; s++) {
+												for (var c = 0; c < $this.subPanelList[s].subClassAttrList
+													.length; c++) {
+													var attr = $this.subPanelList[s].subClassAttrList[c]
+														.Attr;
+													for (var j = 0; j < attr.length; j++) {
+														console.log(attr[j].Name + '==' + result[i].attr);
+														if (attr[j].Name == result[i].attr) {
+															attr[j].Value = result[i].value;
+															// attr.value = '';
+															// attr.oldvalue = '';
+															// attr.value = result[i].value;
+															// attr.oldvalue = result[i].value;
+														}
+													}
+												}
+											}
+											var length = 0;
+
+										}
+									} else if (action.action_type == 'set_global_attr') {
+										$this.$actiontr = action.value || [];
+									} else if (action.action_type == 'open_common_dlg') { //鎵撳紑渚ф粦寮规
+										var $this = this;
+										if (action.value.common_dlg_id == 'check_list') {
+											$this.check_list = action.value.config;
+											if (action.value.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+												$this.popupType = 'right';
+											else
+												$this.popupType = 'center'
+											// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
+											$this.$refs.popup.open($this.popupType);
+										}
+									} else if (action.action_type == 'add_subcls_panel') { //涓讳粠鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�+										var result = action.value;
+										var $this = this;
+										var list_1 = JSON.parse(JSON.stringify(this.detail1_styledef));
+										var scanCodeVal = $this.scanCodeVal;
+										var rand = '';
+										for (var i = 0; i < 5; i++) { //鐢熸垚5浣嶉殢鏈烘暟
+											rand += Math.floor(Math.random() * 10);
+										}
+										if (inputParamter[0].attr) {
+											if (inputParamter[0].attr == "mast_input_3037") //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�+												scanCodeVal = "mast_input_3037-" + rand;
+										}
+										if (info.attr[0].attr) {
+											if (info.attr[0].attr == "mast_input_3037") //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�+												scanCodeVal = "mast_input_3037-" + rand;
+										}
+										$this.subPanelList.push({
+											scanCodeVal: scanCodeVal,
+											subClassAttr: list_1
+										});
+										$this.activelist.push({
+											active: false
+										});
+										for (var i = 0; i < result.length; i++) {
+											for (var s = 0; s < $this.subPanelList.length; s++) {
+												if ($this.subPanelList[s].scanCodeVal == scanCodeVal) {
+													if (result[i].attr == "S_ID")
+														$this.subPanelList[s].ObjID = result[i].value;
+													var _subClassAttr = $this.subPanelList[s].subClassAttr
+														.form.items;
+													for (var c = 0; c < _subClassAttr.length; c++) {
+														if (_subClassAttr[c].name != 'Layout') {
+															if (_subClassAttr[c].fieldId == result[i].attr)
+																_subClassAttr[c].value = result[i].value;
+														} else if (_subClassAttr[c].name == 'Layout') {
+															_subClassAttr[c].setting.colList.forEach(col => {
+																if (col) {
+																	if (col.fieldId == result[i].attr)
+																		col.value = result[i].value;
+																}
+															});
+														}
+													}
+
+													// $this.subPanelList[s].subClassAttr=list_1;
+												}
+											}
+											// console.log($this.subPanelList);
+											var length = 0;
+											if (!$this.refdatastore.filter(function(s) {
+													return result[i].attr == s.attr
+												}).length) {
+												length = 1;
+												$this.refdatastore.push(result[i]);
+											}
+											if (length == 0) {
+												for (var j = 0; j < $this.refdatastore.length; j++) {
+													if ($this.refdatastore[j].attr == result[i].attr) {
+														$this.refdatastore[j].value = result[i].value;
+													}
+												}
 											}
 										}
+									} else {
+										uni.showModal({
+											title: this.translateSys("tip"),
+											content: this.translateSys("quotation_mark_left") + action
+												.action_type + this.translateSys(
+													"quotation_mark_right") + this.translate(
+													"tip_action_unprocessed"),
+											showCancel: false,
+											confirmText: this.translateSys('close')
+										});
 									}
 								}
 
-								var length = 0;
-								if (!$this.refdatastore.filter(function(s) {
-										return result[i].attr == s.attr
-									}).length) {
-									length = 1;
-									$this.refdatastore.push(result[i]);
-								}
-								if (length == 0) {
-									for (var j = 0; j < $this.refdatastore.length; j++) {
-										if ($this.refdatastore[j].attr == result[i].attr) {
-											$this.refdatastore[j].value = result[i].value;
-										}
-									}
-								}
+
+							} 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
 							}
 						}
 					}
@@ -2139,6 +2237,7 @@
 					} else {
 						var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
 							'<br/>') : '';
+						tip = tip || data.err_info
 						if (tip) uni.showModal({
 							title: this.translateSys("tip"),
 							content: tip,
@@ -2146,7 +2245,7 @@
 							confirmText: this.translateSys('close')
 						});
 
-						var result = data.result;
+						// var result = data.result;
 						if (eventID != $this.param.After_OK_Event.ID)
 							$this.scan_OKDataObjRunCustomEvent($this.param.After_OK_Event.ID);
 						else {

--
Gitblit v1.9.1