From 07925905f1a596e20e980de6d42db217abb753b0 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 十二月 2025 18:06:11 +0800
Subject: [PATCH] plugin

---
 pages/modal/3037_2.vue | 1365 +++++++++++++++++++++++++++-------------------------------
 1 files changed, 643 insertions(+), 722 deletions(-)

diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue
index 8b4cd76..66e1f3e 100644
--- a/pages/modal/3037_2.vue
+++ b/pages/modal/3037_2.vue
@@ -2,8 +2,9 @@
 	<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"
-			@on-change="onEnterChange" @on-click-prefix="classAttr_extButton" @on-click-suffix="classAttr_extButton">
+			:hiddenIds="head_styledef.hiddenIds ?head_styledef.hiddenIds :[] " @on-focus="ontap" :focusId="focusFieldId"
+			@on-change="onEnterChange" @on-click-prefix="classAttr_extButton" @on-click-suffix="classAttr_extButton"
+			@on-click="onClick">
 		</OIForm>
 		<!-- 浠庢暟鎹�-->
 		<view class="v-panel">
@@ -118,6 +119,12 @@
 	} from '@/js/Base64.js';
 	import utils from "@/js/utils.js"
 	import {
+		showInfo,
+		showError,
+		showLoading,
+		hideLoading
+	} from "@/js/Page.js"
+	import {
 		appGetInfo,
 		dictGetInfo
 	} from "@/api/mobox.js"
@@ -153,8 +160,8 @@
 				subClassGridStyle: [],
 				popupType: "center",
 				check_list: {},
-
-				focusMateria: false,
+				focusFieldId: "",
+				focusOldFieldId: "",
 				head_styledef: {
 					form: {
 						items: []
@@ -166,18 +173,25 @@
 				saving: false,
 			};
 		},
+		onReady() {
+			uni.setNavigationBarTitle({
+				title: this.title 
+			}); //璁剧疆椤堕儴鏍囬 
+		},
 		onLoad(options) {
 			// console.log(options);
-			uni.setNavigationBarTitle({
-				title: options.titlename
-			}); //璁剧疆椤堕儴鏍囬 
+
 			this.title = options.titlename;
 			this.param = JSON.parse(options.param);
-			const  paramValue = options.paramValue ?JSON.parse(options.paramValue) :undefined
+			const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
 			this.loadData(paramValue)
-
-			//椤甸潰鍒濆鍖栬幏鍙栫劍鐐�-			// this.focusMateria=true; 
+		},
+		initialEvent() {
+			let event = (this.head_styledef.event || []).find((e) => e.event_id == "initial");
+			return {
+				id: event?.scrip_id || "",
+				name: event?.scrip_name || "",
+			};
 		},
 		methods: {
 			setData: function(obj) {
@@ -202,36 +216,56 @@
 				});
 			},
 			async loadData(paramValue) {
-				console.log(this.param);
-				//鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�-				await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
-				//浼犲叆鍙傛暟鍊�-				if (paramValue) {
-					const attrs = paramValue.attrs || [];
-
-					(this.head_styledef?.form?.items || []).forEach(async (ele, index) => {
-						if (ele.name != "Layout") {
-							attrs.forEach(async (ele2, index2) => {
-								if (ele.fieldId == ele2.name) {
-									ele.value = ele2.value;
-								}
-							});
-						} else {
-							ele.setting.colList.forEach(async (col) => {
-								if (col) {
-									attrs.forEach(async (ele2,
-										index2) => {
-										if (col.fieldId == ele2.name) {
-											col.value = ele2.value;
-										}
-									});
-								}
-							});
-						}
-					})
+				try {
+					showLoading("loading...")
+					console.log(this.param);
+					//鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁�+					await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
+					//浼犲叆鍙傛暟鍊�+					if (paramValue) {
+						this.setFormValues(this.head_styledef, paramValue)
+					}
+					await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.param.Sub_Cls?.UI_Style?.ID);
+					await this.loadInitialEvent();
+					hideLoading()
+				} catch (ex) {
+					hideLoading()
+					showError(ex, this.translateSys("error"));
 				}
+			},
+			async loadInitialEvent() {
+				try {
+					var eventid = this.initialEvent?.id; //鍐呭鍙樺寲鍚庝簨浠�+					if (eventid) {
+						// self.event_no_sub = 1;
+						var obj_attr = this.head_styledef.form.model;
+						// console.log(obj_attr);
+						let req = {
+							id: "",
+							attrs: Object.keys(obj_attr).map((a) => ({
+								attr: a,
+								value: obj_attr[a] || "",
+							}))
+						}
+						var info = {
+							eventid: eventid,
+							edtype: "0",
+							projectid: '',
+							rclsid: '',
+							robjid: '',
+							userlogin: '',
+							clsid: this.head_styledef.form.clsId,
+							objid: "",
+							attr: req,
+						}
+						this.DataObjRunCustomEvent(info);
+					}
 
-				await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.param.Sub_Cls?.UI_Style?.ID);
+				} catch (ex) {
+					showError(ex, this.translateSys('error'))
+
+
+				}
 			},
 			async Head_UIStyleGetInfo(class_id, style_id) { //鑾峰彇鑷畾涔夎〃鍗曟牱寮� 				var $this = this;
@@ -250,29 +284,82 @@
 						if (!result.style_def.includes('"')) styledef = Base64.decode(result
 							.style_def);
 					}
-					$this.head_styledef = result.style_def ? JSON.parse(styledef) : {};
+
+					const styledefHead = styledef ? JSON.parse(styledef) : {};
+
 					// console.log($this.head_styledef);
-					if ($this.head_styledef.form?.items) {
-						$this.head_styledef.form.items.forEach(async (ele, index) => {
-							ele.show = true;
-							if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀
-								await this.DictGetInfo(ele.bind.dict, index, 'mast');
-							} else {
-								if (ele?.name === "Select") {
-									const selections = ele?.selections || []
-									//鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ�
-									let itemName = ele.value || "";
-									if (itemName) {
-										$this.head_styledef.form
-											.model[ele.fieldId] = itemName;
-									}
-									$this.head_styledef.form.items[index].selections = selections.map((
-										a) => {
-										return {
-											value: a.value,
-											text: a.label
+					if (styledefHead.form?.items) {
+						styledefHead.form.items.forEach(async (ele, index) => {
+							if (ele.name != "Layout") {
+								ele.show = true;
+								if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀
+									await this.DictGetInfo(ele.bind.dict, index, 'mast');
+								} else {
+									if (ele?.name === "Select") {
+										const selections = ele?.selections || []
+										//鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ�
+										let itemName = ele.value || "";
+										if (itemName) {
+											styledefHead.form
+												.model[ele.fieldId] = itemName;
 										}
-									})
+										styledefHead.form.items[index].selections = selections.map((
+											a) => {
+											return {
+												value: a.value,
+												text: a.label
+											}
+										})
+									}
+
+								}
+								if ($this.focusFieldId == "") {
+									if (ele.name == 'Input' || ele.name ==
+										'InputNumber') {
+										$this.setData({
+											focusFieldId: ele.fieldId
+										})
+									}
+								}
+							} else {
+								for (let j in ele.setting.colList) {
+									const col = ele.setting.colList[j]
+									if (col) {
+										col.show = true
+										if (col?.useDict) {
+											//鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀
+											await $this.DictGetInfo(col.bind
+												.dict,
+												styledefHead.form
+												.model, col);
+										} else {
+											if (col?.name === "Select") {
+												const selections = col?.selections || []
+												//鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ�
+												let itemName = col.value || "";
+												if (itemName) {
+													styledefHead.form
+														.model[col.fieldId] = itemName;
+												}
+												col.selections = selections.map((a) => {
+													return {
+														value: a.value,
+														text: a.label
+													}
+												})
+											}
+										}
+										if ($this.focusFieldId == "") {
+											if (col.name == 'Input' || col
+												.name ==
+												'InputNumber') {
+												$this.setData({
+													focusFieldId: col
+														.fieldId
+												})
+											}
+										}
+									}
 								}
 
 							}
@@ -297,6 +384,9 @@
 							$this.head_styledef.form.model["S_CLASSES"] = app.globalData.classes
 						}
 					}
+					$this.setData({
+						head_styledef: styledefHead
+					})
 					if ($this.head_styledef.event?.length > 0) {
 						$this.head_styledef.event.forEach(async (a) => { //鍒ゆ柇鏄惁鏄垵濮嬪寲浜嬩欢
 							if (a.event_id == "initial") {
@@ -306,13 +396,7 @@
 					}
 				} catch (ex) {
 					// console.log(ex);
-					let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
-					uni.showModal({
-						title: this.translateSys("error") + "1.1",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + " 1.1")
 				}
 
 			},
@@ -367,12 +451,7 @@
 				} catch (ex) {
 					// console.log(ex);
 					let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
-					uni.showModal({
-						title: this.translateSys("error") + "2.1",
-						content: tip,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + " 2.1")
 				}
 
 
@@ -417,12 +496,7 @@
 
 				} catch (ex) {
 					// console.log(ex);
-					uni.showModal({
-						title: this.translateSys("error") + "1.3",
-						content: ex.errMsg,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + " 1.3")
 				}
 
 			},
@@ -441,49 +515,37 @@
 				runCustomEvent(dataInfo).then(data => {
 					console.log(data);
 
-					if (data.ret != 0&& data.ret != 1) {
-						var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
-							.err_info.join('<br/>') : '';
+					if (data.ret != 0 && data.ret != 1) {
+						let cls_name = data.event_info?.cls_name
+						let event_name = data.event_info?.event_name
+						tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+							.join('\n') : ''
 						if (data.ret == 801) {
 							if (this.param.Only_Script_Error) {
 								let pos = tip.indexOf("锛�);
 								if (pos > -1) tip = tip.substring(pos + 1);
 							}
-							uni.showModal({
-								title: this.translateSys("tip"),
-								content: tip,
-								showCancel: false,
-								confirmText: this.translateSys('close')
-							});
-						} else uni.showModal({
-							title: this.translateSys("tip"),
-							content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						}
+						if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+						if (data.ret == 801) showInfo(tip)
+						else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+						this.saving = false
 						return false
 					} else {
-						var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
-							'<br/>') : '';
+						var tip = data.info ? typeof data.info == 'string' ? data.info :
+							data.info.join('\n') : '';
 						tip = tip || data.err_info
-						if (tip) uni.showModal({
-							title: this.translateSys("tip"),
-							content: tip,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						let time = data.info_time || 0
+						if (time)
+							showError(tip, this.translateSys('tip'))
+						else
+							showInfo(tip)
 						if ([0, 2, 3, 4, -1].includes(data.result_type)) {
 							if (data.result_type == 2) {
 
 							} else if (typeof data.result == 'string') {
-								if (data.result) {
-									uni.showModal({
-										title: this.translateSys('tip'),
-										content: data.result,
-										showCancel: false,
-										confirmText: this.translateSys('close')
-									});
-								}
+								showInfo(data.result)
+
 							}
 							try {
 								var actionlist = data.action || []
@@ -491,84 +553,8 @@
 									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;
-																}
-															}
-														});
-													}
+										$this.setFormValues(styledef, result)
 
-												}
-											}
-											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') {
@@ -607,18 +593,14 @@
 											// 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')
-										});
+										showInfo(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'))
+
 									}
 								}
 
@@ -626,13 +608,7 @@
 								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)
+								showError(tip, this.translateSys('tip'))
 								return
 							}
 						}
@@ -640,14 +616,7 @@
 
 				}).catch(ex => {
 					// console.log(ex);
-					uni.showModal({
-						title: this.translateSys("error") + "3.1",
-						content: this.translate('execute_init_event_failed') +
-							this.translateSys("full_stop") +
-							this.translate('reason') + this.translateSys("colon") + ex.errMsg,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showError(ex, this.translateSys('error') + "3.1")
 				});
 			},
 
@@ -656,51 +625,108 @@
 				getApp().onScan((result) => {
 					//console.log(result);
 					uni.hideKeyboard();
-					var $this = this;
-					console.log(item);
-					item.value = result
-					let newVal = item.value.trim()
-					if (newVal) {
-						item.oldvalue = newVal;
-						var attr = item.fieldId;
-						$this.head_styledef.form.model[attr] = newVal;
-						$this.focusMateria = true; //鍒濆鍖栵紝绗簩涓緭鍏ユfocus灞炴�
-						// setTimeout(function(){
-						// 	$this.focusMateria=true; //绗簩涓緭鍏ユ鑾峰彇鐒︾偣
-						setTimeout(function() {
-							uni.hideKeyboard();
-						}, 1000);
-						// },500);
-						//瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈�-						var eventid = this.param.Scan_Code.Input_Change_Event.ID;
-						if (eventid) {
-							var obj_attr = this.head_styledef.form.model;
-							// console.log(obj_attr);
-							var req = Object.keys(obj_attr).map((a) => ({
-								attr: a,
-								value: obj_attr[a] || "",
-							}));
-							var info = {
-								eventid: eventid,
-								edtype: "7", //"0",
-								projectid: '',
-								rclsid: '',
-								robjid: '',
-								userlogin: '',
-								clsid: 'MBOX', //this.param.Sub_Cls.ID,
-								objid: "",
-								attr: req,
-								mast_attr: [],
-								inputParamter: [{
-									attr: 'mast_input_3037',
-									value: newVal
-								}]
+					this.onScanValue(item, result)
+				})
+			},
+			onScanValue(item, value) {
+				const $this = this;
+				//console.log("onScanValue", item);
+				item.value = value
+				let newVal = item.value
+				if (typeof item.value == "string") {
+					newVal = item.value.trim()
+				}
+				if (newVal) {
+					item.oldvalue = newVal;
+					var attr = item.fieldId;
+					$this.head_styledef.form.model[attr] = newVal;
+					setTimeout(function() {
+						uni.hideKeyboard();
+					}, 1000);
+					var eventid = this.param.Scan_Code.Input_Change_Event.ID;
+					if (eventid) {
+						var obj_attr = this.head_styledef.form.model;
+						// console.log(obj_attr);
+						var req = Object.keys(obj_attr).map((a) => ({
+							attr: a,
+							value: obj_attr[a] || "",
+						}));
+						var info = {
+							eventid: eventid,
+							edtype: "7", //"0",
+							projectid: '',
+							rclsid: '',
+							robjid: '',
+							userlogin: '',
+							clsid: 'MBOX', //this.param.Sub_Cls.ID,
+							objid: "",
+							attr: req,
+							mast_attr: [],
+							inputParamter: [{
+								attr: 'mast_input_3037',
+								value: newVal
+							}]
+						}
+
+						this.scan_DataObjRunCustomEvent(info, "");
+					}
+					var findd = false
+					for (let i in $this.head_styledef.form.items) {
+						const ele = $this.head_styledef.form.items[i]
+
+						if (ele.name != "Layout") {
+							if (ele.name == 'Input' || ele.name == 'InputNumber') {
+								if (attr == ele.fieldId) {
+									findd = true
+								} else {
+									if (findd) {
+										$this.setData({
+											focusFieldId: ele.fieldId
+										})
+										break
+									}
+
+								}
+
+							}
+						} else {
+							if (findd) {
+								let curIndex = ele.setting.colList.findIndex((col, index2, arr) => {
+									return (col.name == 'Input' || col.name == 'InputNumber');
+								})
+								if (curIndex > -1) {
+									$this.setData({
+										focusFieldId: ele.setting.colList[curIndex]
+											.fieldId
+									})
+									break
+								}
+
+							} else {
+								let curIndex = ele.setting.colList.findIndex((col, index2, arr) => {
+									return attr == col.fieldId;
+								})
+								if (curIndex > -1) {
+									findd = true
+									let curIndex2 = ele.setting.colList.findIndex((col, index2, arr) => {
+										return (col.name == 'Input' || col.name ==
+												'InputNumber') &&
+											index2 >
+											curIndex;
+									})
+									if (curIndex2 > -1) {
+										$this.setData({
+											focusFieldId: ele.setting.colList[curIndex].fieldId
+										})
+										break
+									}
+								}
 							}
 
-							this.scan_DataObjRunCustomEvent(info, "");
 						}
 					}
-				})
+
+				}
 			},
 			onevent(item) {
 				// console.log(e.target);
@@ -752,47 +778,43 @@
 				}
 
 			},
+			onClick(item) {
+				if (item.name == "Input" || item.name == "InputNumber" || item.name == "Textarea") {
+					this.focusFieldId = item.fieldId
+				} else if (item.name == "ImageButton") {
+					var onClickEvent = item.bind.onClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋�+
+					if (!onClickEvent.id) {
+						showInfo(this.translate('icon_click_event_empty'))
+						return;
+					}
+					this.onChange(onClickEvent);
+				}
+			},
 			classAttr_extButton(item) {
 				var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //鍚庡浘鏍囩偣鍑诲洖璋� 				var onSuffixClickEvent = item.bind.onSuffixClickEvent; //鍚庡浘鏍囩偣鍑讳簨浠� 
 				if (!onSuffixClickCallbackEvent.id) {
-					uni.showModal({
-						title: this.translateSys("tip"),
-						content: this.translate('icon_click_callback_empty'),
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showInfo(this.translate("icon_click_callback_empty"))
 					return;
 				}
 				if (!onSuffixClickEvent.id) {
-					uni.showModal({
-						title: this.translateSys("tip"),
-						content: this.translate('icon_click_event_empty'),
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showInfo(this.translate("icon_click_event_empty"))
+
 					return;
 				}
 				this.popupType = 'right'
 				// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
 				this.$refs.popup.open(this.popupType);
 
-				this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, '', onSuffixClickCallbackEvent.id,
+				this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, onSuffixClickCallbackEvent.id,
 					item);
 			},
-			dataObjRunCustomEvent_Return(eventid, data_attr, button_callback, item) {
+			dataObjRunCustomEvent_Return(eventid, button_callback, item) {
 				const $this = this
-				var enviroment = {
-					'function': '3000', // 鍔熻兘鐐圭紪鍙�-					cls_id: $this.head_styledef.form.clsId, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�-					'button': 'top', // top/bottom
-					button_name: $this.translateSys('add2'),
-					master: {
-						cls_id: $this.head_styledef.form.clsId, // button=bottom鏃�master鐨刢ls_id
-						//obj_id: ''  // button=bottom鏃�master鐨刼bj_id
-					}
-				};
+				showLoading("loading...")
+
 				var obj_attr = $this.head_styledef.form.model;
 				console.log(obj_attr);
 				var req = Object.keys(obj_attr).map((a) => ({
@@ -855,64 +877,192 @@
 				console.log(dataInfo);
 				// return;
 				runCustomEvent(dataInfo).then(data => {
-					if (data.ret != 0&& data.ret != 1) {
-						var tip = data.err_info ? typeof data.err_info == 'string' ? data
-							.err_info :
-							data
-							.err_info.join('<br/>') : '';
+					hideLoading()
+					$this.onFormEventResult(data, button_callback, item,req)
+
+				}).catch(ex => {
+					// console.log(ex);
+					hideLoading()
+					showError(ex, this.translateSys("error") + "5.1")
+				});
+			},
+
+			onEnterChange(item) {
+				console.log("onEnterChange", item);
+				let newVal = item.value
+				if (typeof item.value == "string") {
+					newVal = item.value.trim()
+					if (!newVal)
+						return
+				}
+				if (item.oldvalue != newVal) {
+					item.oldvalue = newVal;
+					var attr = item.fieldId;
+					this.head_styledef.form.model[attr] = newVal;
+					var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�+					if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠�+						this.onChange(onChangeEvent);
+					}
+				}
+
+			},
+			onDetail1EnterChange(item) {
+				//鐮佺洏涓牱寮忓洖杞︿簨浠�+				// console.log(item);
+			},
+			// 鍐呭鍙樺寲鍚庝簨浠�+			async onChange(event) {
+				var eventid = event?.id; //鍐呭鍙樺寲鍚庝簨浠�+				if (eventid) {
+					// self.event_no_sub = 1;
+					var obj_attr = this.head_styledef.form.model;
+					// console.log(obj_attr);
+					var req = Object.keys(obj_attr).map((a) => ({
+						attr: a,
+						value: obj_attr[a] || "",
+					}));
+					var info = {
+						eventid: eventid,
+						edtype: "0",
+						projectid: '',
+						rclsid: '',
+						robjid: '',
+						userlogin: '',
+						clsid: this.head_styledef.form.clsId,
+						objid: "",
+						attr: req,
+					}
+					this.DataObjRunCustomEvent(info);
+				}
+
+			},
+			async onFormEventResult(data, callbackEventId, item,req) {
+				try {
+					const $this = this
+					var enviroment = {
+						'function': '3000', // 鍔熻兘鐐圭紪鍙�+						cls_id: $this.head_styledef.form.clsId, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�+						'button': 'top', // top/bottom
+						button_name: $this.translateSys('add2'),
+						master: {
+							cls_id: $this.head_styledef.form.clsId, // button=bottom鏃�master鐨刢ls_id
+							//obj_id: ''  // button=bottom鏃�master鐨刼bj_id
+						}
+					};
+					if (data.ret != 0 && data.ret != 1) {
+						let cls_name = data.event_info?.cls_name
+						let event_name = data.event_info?.event_name
+						tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+							.join('\n') : ''
 						if (data.ret == 801) {
-							if ($this.param.Only_Script_Error) {
+							if (this.param.Only_Script_Error) {
 								let pos = tip.indexOf("锛�);
 								if (pos > -1) tip = tip.substring(pos + 1);
 							}
-							uni.showModal({
-								title: $this.translateSys("tip"),
-								content: tip,
-								showCancel: false,
-								confirmText: $this.translateSys('close')
-							});
-						} else uni.showModal({
-							title: $this.translateSys("tip"),
-							content: tip + ',' + $this.translateSys('tip') + ':' + data
-								.ret,
-							showCancel: false,
-							confirmText: $this.translateSys('close')
-						});
+						}
+						if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+						if (data.ret == 801) showInfo(tip)
+						else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+						this.saving = false
 						return false
 					} else {
-						var tip = data.info ? typeof data.info == 'string' ? data.info : data
-							.info
-							.join(
-								'<br/>') : '';
+						var tip = data.info ? typeof data.info == 'string' ? data.info :
+							data.info.join('\n') : '';
 						tip = tip || data.err_info
-						if (tip) uni.showModal({
-							title: $this.translateSys("tip"),
-							content: tip,
-							showCancel: false,
-							confirmText: $this.translateSys('close')
-						});
+						let time = data.info_time || 0
+						if (time)
+							showError(tip, this.translateSys('tip'))
+						else
+							showInfo(tip)
 						if ([0, 2, 3, 4, -1].includes(data.result_type)) {
 							if (data.result_type == 2) {
+								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;
+													}
+												}
+											});
+										}
+
+									}
+
+									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')
-									});
-								}
+								showInfo(data.result)
+
 							}
 							try {
-								var actions = data.action || []
-								for (var i = 0; i < actions.length; i++) {
-									var action = actions[i];
-									console.log(action)
-									var val = action.value;
-									var enviroment = JSON.stringify(enviroment);
-
-									if (action.action_type == 'open_panel') {
+								var enviroment = JSON.stringify(enviroment);
+								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;
+										$this.setFormValues($this.head_styledef, result)
+									} 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_dlg_current_edit_attr"
+									) {
+										if ($this
+											.focusOldFieldId ==
+											action.value) {
+											$this.setData({
+												focusFieldId: ""
+											})
+										} else {
+											$this.setData({
+												focusFieldId: $this
+													.focusOldFieldId
+											})
+										}
+										$this.$nextTick(() => {
+											$this.setData({
+												focusFieldId: action
+													.value
+											})
+										});
+									} else if (action.action_type == 'set_global_attr') {
+										$this.global_attr = action.value || [];
+									} else if (action.action_type == 'open_panel') {
 										var d = dialog({
 											title: '<i class="ace-icon fa fa-info-circle"></i> ' +
 												$this.translateSys("tip"),
@@ -1065,103 +1215,25 @@
 												}
 											}
 										});
-									} 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')
-										});
 									}
+
 								}
 
 							} 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)
+								showError(tip, this.translateSys('tip'))
 								return
 							}
 						}
-
 					}
 
-				}).catch(ex => {
-					// console.log(ex);
-					let exStr = JSON.stringify(ex)
-					if (exStr == "{}")
-						exStr = ex
-					let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
-					uni.showModal({
-						title: $this.translateSys('tip') + "5.1",
-						content: exStr,
-						showCancel: false,
-						confirmText: $this.translateSys('close')
-					});
-				});
-			},
 
-			onEnterChange(item) {
-				console.log("onEnterChange", item);
-				let newVal = item.value
-				if (typeof item.value == "string") {
-					newVal = item.value.trim()
-					if (!newVal)
-						return
+				} catch (ex) {
+					showError(ex, this.translateSys("error") + "10.1")
 				}
-				if (item.oldvalue != newVal) {
-					item.oldvalue = newVal;
-					var attr = item.fieldId;
-					this.head_styledef.form.model[attr] = newVal;
-					var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�-					if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠�-						this.onChange(onChangeEvent);
-					}
-				}
-
 			},
-			onDetail1EnterChange(item) {
-				//鐮佺洏涓牱寮忓洖杞︿簨浠�-				// console.log(item);
-			},
-			// 鍐呭鍙樺寲鍚庝簨浠�-			async onChange(event) {
-				var eventid = event?.id; //鍐呭鍙樺寲鍚庝簨浠�-				if (eventid) {
-					// self.event_no_sub = 1;
-					var obj_attr = this.head_styledef.form.model;
-					// console.log(obj_attr);
-					var req = Object.keys(obj_attr).map((a) => ({
-						attr: a,
-						value: obj_attr[a] || "",
-					}));
-					var info = {
-						eventid: eventid,
-						edtype: "0",
-						projectid: '',
-						rclsid: '',
-						robjid: '',
-						userlogin: '',
-						clsid: this.head_styledef.form.clsId,
-						objid: "",
-						attr: req,
-					}
-					this.DataObjRunCustomEvent(info);
-				}
-
-			},
-
 			scan_ontap(e) { //鎵爜鍖烘壂鐮佸姛鑳� 				//console.log(e.target)
 				getApp().onScan((result) => {
@@ -1297,22 +1369,13 @@
 						uni.hideLoading();
 
 						$this.subPanelList.splice(index, 1);
-						uni.showModal({
-							title: this.translateSys("tip"),
-							content: this.translate("delete_success"),
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						showInfo(this.translate("delete_success"))
+
 
 					}).catch(ex => {
 						console.log(ex);
 						uni.hideLoading();
-						uni.showModal({
-							title: this.translateSys('tip') + "9.1",
-							content: ex.errMsg,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						showError(ex, this.translateSys("error") + "9.1")
 					});
 				}
 			},
@@ -1320,12 +1383,8 @@
 				var $this = this;
 				var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event;
 				if (!Before_Select_Event) {
-					uni.showModal({
-						title: this.translateSys("tip"),
-						content: this.translate("before_select_event_empty"),
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showInfo(this.translate("before_select_event_empty"))
+
 					return;
 				}
 				var obj_attr = this.head_styledef.form.model;
@@ -1420,12 +1479,8 @@
 				var $this = this;
 				var After_Select_Event = $this.param.Scan_Code.After_Select_Event;
 				if (!After_Select_Event) {
-					uni.showModal({
-						title: this.translateSys("tip"),
-						content: this.translate("after_select_event_empty"),
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showInfo(this.translate("after_select_event_empty"))
+
 					return;
 				}
 				var items = $this.check_list.items;
@@ -1443,12 +1498,8 @@
 					}
 				}
 				if (data.length == 0) {
-					uni.showModal({
-						title: this.translateSys("tip"),
-						content: this.translate("tip_no_select_data"),
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					showInfo(this.translate("tip_no_select_data"))
+
 					return;
 				}
 				var obj_attr = this.head_styledef.form.model;
@@ -1490,6 +1541,9 @@
 
 			DataObjRunCustomEvent(info, data_attr) {
 				var $this = this;
+				if (!info.eventid)
+					return
+				showLoading("loading...")
 				var enviroment = {
 					'function': '3000', // 鍔熻兘鐐圭紪鍙� 					cls_id: this.param.Master_Cls.ID, // 鍔熻兘鐐逛富鏁版嵁绫绘爣璇�@@ -1552,206 +1606,97 @@
 				// return;
 				runCustomEvent(dataInfo).then(data => {
 					console.log(data);
-					if (data.ret != 0&& data.ret != 1) {
-						var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
-							.err_info.join('<br/>') : '';
-						if (data.ret == 801) {
-							if (this.param.Only_Script_Error) {
-								let pos = tip.indexOf("锛�);
-								if (pos > -1) tip = tip.substring(pos + 1);
-							}
-							uni.showModal({
-								title: this.translateSys("tip"),
-								content: tip,
-								showCancel: false,
-								confirmText: this.translateSys('close')
-							});
-						} else uni.showModal({
-							title: this.translateSys("tip"),
-							content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
-						return false
-					} 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 || []
-
-								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) {
-														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 || [];
-									}
-
-								}
-
-							} 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
-							}
-						}
-					}
+					hideLoading()
+					$this.onFormEventResult(data, "")
 
 				}).catch(ex => {
 					// console.log(ex);
-					uni.showModal({
-						title: this.translateSys("error") + "3.1",
-						content: ex.errMsg,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					hideLoading()
+					showError(ex, this.translateSys("error") + "3.1")
 				});
+			},
+			setFormValues(styledef, attrs) {
+				if (!Array.isArray(attrs)) {
+					return
+				}
+				for (var i = 0; i < attrs.length; i++) {
+					if (attrs[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 == attrs[i].attr) {
+									var dictItemList = [];
+									for (var d in attrs[i].choice_list) {
+										var val = attrs[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 == attrs[i].attr) {
+											var dictItemList = [];
+											for (var d in attrs[i]
+													.choice_list) {
+												var val = attrs[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+'=='+attrs[i].attr);
+						//鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�+						if (styledef.form.model[attrs[i].attr] ==
+							undefined) {
+							styledef.form.model[attrs[i].attr] = attrs[i]
+								.value;
+						}
+						//鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�+						if (attr.name != 'Layout') {
+							if (attr.fieldId == attrs[i].attr) {
+								attr.value = '';
+								attr.oldvalue = '';
+								attr.value = attrs[i].value;
+								attr.oldvalue = attrs[i].value;
+								styledef.form.model[attr.fieldId] = attrs[
+									i].value;
+							}
+						} else if (attr.name == 'Layout') {
+							attr.setting.colList.forEach(col => {
+								if (col) {
+									if (col.fieldId == attrs[i].attr) {
+										col.value = '';
+										col.oldvalue = '';
+										col.value = attrs[i].value;
+										col.oldvalue = attrs[i].value;
+										styledef.form.model[col
+											.fieldId] = attrs[i].value;
+									}
+								}
+							});
+						}
+					}
+
+				}
 			},
 			setFormItemVisible(attrs) {
 				if (!Array.isArray(attrs)) {
@@ -1776,6 +1721,7 @@
 			},
 			scan_DataObjRunCustomEvent(info, data_attr) {
 				var $this = this;
+				showLoading("loading...")
 				var obj_attr = {};
 				info.attr.forEach(item => {
 					obj_attr[item.attr] = item.value;
@@ -1837,39 +1783,32 @@
 				// return;
 				runCustomEvent(dataInfo).then(data => {
 					console.log(data);
-
-					if (data.ret != 0&& data.ret != 1) {
-						var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
-							.err_info.join('<br/>') : '';
+					hideLoading()
+					if (data.ret != 0 && data.ret != 1) {
+						let cls_name = data.event_info?.cls_name
+						let event_name = data.event_info?.event_name
+						tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+							.join('\n') : ''
 						if (data.ret == 801) {
 							if (this.param.Only_Script_Error) {
 								let pos = tip.indexOf("锛�);
 								if (pos > -1) tip = tip.substring(pos + 1);
 							}
-							uni.showModal({
-								title: this.translateSys("tip"),
-								content: tip,
-								showCancel: false,
-								confirmText: this.translateSys('close')
-							});
-						} else uni.showModal({
-							title: this.translateSys("tip"),
-							content: tip + this.translateSys('comma') + this.translate('result') + this
-								.translateSys('colon') + data.ret,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						}
+						if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+						if (data.ret == 801) showInfo(tip)
+						else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
+						this.saving = false
 						return false
 					} else {
-						var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
-							'<br/>') : '';
+						var tip = data.info ? typeof data.info == 'string' ? data.info :
+							data.info.join('\n') : '';
 						tip = tip || data.err_info
-						if (tip) uni.showModal({
-							title: this.translateSys("tip"),
-							content: tip,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						let time = data.info_time || 0
+						if (time)
+							showError(tip, this.translateSys('tip'))
+						else
+							showInfo(tip)
 						if ([0, 2, 3, 4, -1].includes(data.result_type)) {
 							if (data.result_type == 2) {
 								if (data.result) {
@@ -1934,14 +1873,8 @@
 								}
 
 							} else if (typeof data.result == 'string') {
-								if (data.result) {
-									uni.showModal({
-										title: this.translateSys('tip'),
-										content: data.result,
-										showCancel: false,
-										confirmText: this.translateSys('close')
-									});
-								}
+								showInfo(data.result)
+
 							}
 							try {
 								var actionlist = data.action || []
@@ -2077,15 +2010,11 @@
 											}
 										}
 									} 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')
-										});
+										showInfo(this.translateSys("quotation_mark_left") + action
+											.action_type + this.translateSys(
+												"quotation_mark_right") + this.translate(
+												"tip_action_unprocessed"))
+
 									}
 								}
 
@@ -2094,13 +2023,7 @@
 								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)
+								showError(tip, this.translateSys('tip'))
 								return
 							}
 						}
@@ -2108,12 +2031,8 @@
 
 				}).catch(ex => {
 					// console.log(ex);
-					uni.showModal({
-						title: this.translateSys("error") + "7.1",
-						content: ex.errMsg,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					hideLoading()
+					showError(ex, this.translateSys("error") + "7.1")
 				});
 			},
 			onSave() {
@@ -2137,10 +2056,8 @@
 			},
 			scan_OKDataObjRunCustomEvent(eventID) {
 				this.saving = true
-				uni.showLoading({
-					title: this.translateSys("loading"),
-					mask: true
-				});
+				showLoading("loading...")
+
 				var $this = this;
 				//鑾峰彇琛ㄥご灞炴�
 				var obj_attr = this.head_styledef.form.model;
@@ -2212,40 +2129,49 @@
 				// 	return;
 				runCustomEvent(dataInfo).then(data => {
 					console.log(data);
-					uni.hideLoading();
-					if (data.ret != 0) {
-						var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
-							.err_info.join('<br/>') : '';
+					hideLoading()
+					if (data.ret != 0 && data.ret != 1) {
+						let cls_name = data.event_info?.cls_name
+						let event_name = data.event_info?.event_name
+						tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info
+							.join('\n') : ''
 						if (data.ret == 801) {
 							if (this.param.Only_Script_Error) {
 								let pos = tip.indexOf("锛�);
 								if (pos > -1) tip = tip.substring(pos + 1);
 							}
-							uni.showModal({
-								title: this.translateSys("tip"),
-								content: tip,
-								showCancel: false,
-								confirmText: this.translateSys('close')
-							});
-						} else uni.showModal({
-							title: this.translateSys("tip"),
-							content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						}
+						if (cls_name && event_name) tip = `鎵ц鈥�{cls_name}鈥濇暟鎹被鐨勨�${event_name}鈥濊剼鏈椂杩斿洖閿欒锛�{tip}`
+						if (data.ret == 801) showInfo(tip)
+						else showError(`${tip}锛屾彁绀猴細${data.ret}`, this.translateSys('tip'))
 						this.saving = false
 						return false
 					} else {
-						var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
-							'<br/>') : '';
+						var tip = data.info ? typeof data.info == 'string' ? data.info :
+							data.info.join('\n') : '';
 						tip = tip || data.err_info
-						if (tip) uni.showModal({
-							title: this.translateSys("tip"),
-							content: tip,
-							showCancel: false,
-							confirmText: this.translateSys('close')
-						});
+						let time = data.info_time || 0
+						if (time)
+							showError(tip, this.translateSys('tip'))
+						else
+							showInfo(tip)
+						if ([0, 2, 3, 4, -1].includes(data.result_type)) {
+							if (data.result_type == 2) {
 
+							} else if (typeof data.result == 'string') {
+								showInfo(data.result)
+							}
+							var actionlist = data.action || []
+							for (var i = 0; i < actionlist.length; i++) {
+								var action = actionlist[i];
+								if (action.action_type == "goback_to_pre_page") {
+									//杩斿洖涓婁竴椤�+									uni.navigateBack({
+										delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉
+									});
+								}
+							}
+						}
 						// var result = data.result;
 						if (eventID != $this.param.After_OK_Event.ID)
 							$this.scan_OKDataObjRunCustomEvent($this.param.After_OK_Event.ID);
@@ -2262,13 +2188,8 @@
 				}).catch(ex => {
 					// console.log(ex);
 					this.saving = false
-					uni.hideLoading();
-					uni.showModal({
-						title: this.translateSys("error") + "8.1",
-						content: ex.errMsg,
-						showCancel: false,
-						confirmText: this.translateSys('close')
-					});
+					hideLoading()
+					showError(ex, this.translateSys("error") + "8.1")
 				});
 			},
 

--
Gitblit v1.9.1