From e540e5b44f56ce8e8edc377dfa4c5b343b1a9eef Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期四, 14 八月 2025 16:12:15 +0800
Subject: [PATCH] paramvalue

---
 pages/modal/3018_2.vue       |   49 ++-
 components/oi-form/index.vue |    1 
 pages/modal/5602.vue         |   32 --
 pages/modal/5601.vue         |  164 +++++++++--
 pages/modal/3037_2.vue       |  284 ++++++++-------------
 pages/modal/3202.vue         |   44 ++
 pages/modal/3200.vue         |   63 ++--
 pages/modal/5600.vue         |   95 +++++-
 8 files changed, 409 insertions(+), 323 deletions(-)

diff --git a/components/oi-form/index.vue b/components/oi-form/index.vue
index a288a41..61cd9f3 100644
--- a/components/oi-form/index.vue
+++ b/components/oi-form/index.vue
@@ -82,6 +82,7 @@
 				this.form.model[attr] = item.value;
 				this.$emit("on-change", item)
 			},
+
 			onClick(item) {
 				this.$emit("on-click", item)
 			},
diff --git a/pages/modal/3018_2.vue b/pages/modal/3018_2.vue
index 7733ae2..626ea5c 100644
--- a/pages/modal/3018_2.vue
+++ b/pages/modal/3018_2.vue
@@ -219,27 +219,30 @@
 				await this.Head_UIStyleGetInfo(this.param.DataCls?.id, this.param.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;
-										}
-									});
-								}
-							});
-						}
-					})
+				
+					this.setFormValues(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;
+				// 						}
+				// 					});
+				// 				}
+				// 			});
+				// 		}
+				// 	})
+				
 				}
 
 
@@ -1563,6 +1566,10 @@
 			setFormValues(data) {
 				const $this = this
 				const head_styledef = this.head_styledef
+				if( !Array.isArray(data))
+				{
+					return
+				}
 				for (var i = 0; i < data.length; i++) {
 					const attr = data[i]
 					if (attr.choice_list) {
diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue
index 8b4cd76..1d4d857 100644
--- a/pages/modal/3037_2.vue
+++ b/pages/modal/3037_2.vue
@@ -173,7 +173,7 @@
 			}); //璁剧疆椤堕儴鏍囬 
 			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)
 
 			//椤甸潰鍒濆鍖栬幏鍙栫劍鐐�@@ -207,28 +207,29 @@
 				await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
 				//浼犲叆鍙傛暟鍊� 				if (paramValue) {
-					const attrs = paramValue.attrs || [];
+					this.setFormItemVisible(this.head_styledef,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;
+					// 						}
+					// 					});
+					// 				}
+					// 			});
+					// 		}
+					// 	})
 
-					(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;
-										}
-									});
-								}
-							});
-						}
-					})
 				}
 
 				await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.param.Sub_Cls?.UI_Style?.ID);
@@ -441,7 +442,7 @@
 				runCustomEvent(dataInfo).then(data => {
 					console.log(data);
 
-					if (data.ret != 0&& data.ret != 1) {
+					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) {
@@ -491,84 +492,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') {
@@ -855,7 +780,7 @@
 				console.log(dataInfo);
 				// return;
 				runCustomEvent(dataInfo).then(data => {
-					if (data.ret != 0&& data.ret != 1) {
+					if (data.ret != 0 && data.ret != 1) {
 						var tip = data.err_info ? typeof data.err_info == 'string' ? data
 							.err_info :
 							data
@@ -1552,7 +1477,7 @@
 				// return;
 				runCustomEvent(dataInfo).then(data => {
 					console.log(data);
-					if (data.ret != 0&& data.ret != 1) {
+					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) {
@@ -1648,75 +1573,7 @@
 									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;
-															}
-														}
-													});
-												}
-
-											}
-
-										}
+										$this.setFormValues($this.head_styledef, result)
 									} else if (action.action_type == 'set_dlg_attr_show') {
 										var data = action.value;
 										$this.setFormItemVisible(data)
@@ -1752,6 +1609,89 @@
 						confirmText: this.translateSys('close')
 					});
 				});
+			},
+			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)) {
@@ -1838,7 +1778,7 @@
 				runCustomEvent(dataInfo).then(data => {
 					console.log(data);
 
-					if (data.ret != 0&& data.ret != 1) {
+					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) {
diff --git a/pages/modal/3200.vue b/pages/modal/3200.vue
index 543fc25..31c4f3a 100644
--- a/pages/modal/3200.vue
+++ b/pages/modal/3200.vue
@@ -178,16 +178,17 @@
 			this.active_id = '';
 			this.activeItem = {};
 			//this.activelist = [];
+			const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
 
 			if (this.param.ListPage.ListItem_UIDef?.ui_type == "HTML椤甸潰") {
 				// HTML椤甸潰
 				//鑾峰彇鏁版嵁绫荤殑HTML椤甸潰
-				await this.Html_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id, options
-					.paramValue);
+				await this.Html_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id,
+					paramValue);
 			} else {
 				await this.Detail1_UIstyleGetInfo(this.param.DataCls.id, this.param.ListPage.ListItem_UIDef.id);
 
-				await this.initial(options.paramValue);
+				await this.initial(paramValue);
 			}
 			// this.isFilter=true;
 			// if(this.param.ShowFilter)
@@ -252,27 +253,7 @@
 					await this.Head_UIStyleGetInfo(this.param.DataCls.id, this.param.Query_Panel.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;
-											}
-										});
-									}
-								});
-							}
-						})
+						this.setFormValues(paramValue)
 					}
 				}
 				this.orderby = this.param.Order ? this.param.Order : 'T_CREATE Desc';
@@ -508,7 +489,7 @@
 						var result = await runCustomEvent(dataInfo)
 						// console.log(result);
 
-						if (result.ret != 0&& result.ret != 1) {
+						if (result.ret != 0 && result.ret != 1) {
 							var tip = result.err_info ? typeof result.err_info == 'string' ? result
 								.err_info : result.err_info.join('<br/>') : '';
 							if (result.ret == 801) {
@@ -1125,6 +1106,7 @@
 						defCode == "3037" ||
 						defCode == "3200" ||
 						defCode == "3201" ||
+						defCode == "3202" ||
 						defCode == "5600" ||
 						defCode == "5601" ||
 						defCode == "5602"
@@ -1136,7 +1118,7 @@
 						var json = {
 							app_id: [btn.Related_Function.ID],
 						};
-						console.log("RelatedFunction2", json);
+
 						const result = await appGetInfo(json)
 						if ((result || []).length > 0) {
 							var app = result[0];
@@ -1162,14 +1144,31 @@
 								});
 								return;
 							}
+							const attrValues = []
 
+							style.form.items.forEach(item => {
+								if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�+									item.setting.colList.forEach(col => {
+										if (col != null) {
+											attrValues.push({
+												attr: col.fieldId,
+												value: col.value || ""
+											})
+										}
+
+									});
+								} else
+									attrValues.push({
+										attr: item.fieldId,
+										value: item.value || ""
+									})
+							});
 							uni.navigateTo({
 								url: '../modal/' + name + '?param=' +
 									param + "&titlename=" +
 									appName +
 									"&type=relatedFunction&paramValue=" +
-									JSON.stringify(style
-										.form),
+									JSON.stringify(attrValues),
 								events: {
 									relatedFunction: function(data) {
 										console.log(data);
@@ -1353,7 +1352,7 @@
 						};
 						runCustomEvent(dataInfo).then(result => {
 							// console.log(result);
-							if (result.ret != 0&& result.ret != 1) {
+							if (result.ret != 0 && result.ret != 1) {
 								var tip = result.err_info ? typeof result
 									.err_info ==
 									'string' ?
@@ -1499,8 +1498,8 @@
 			},
 			setFormValues(attrs) {
 				const head_styledef = this.head_styledef
-				if (JSON.stringify(attrs) == '{}') {
-					return;
+				if (!Array.isArray(attrs)) {
+					return
 				}
 				attrs.forEach(async (attr, key) => {
 					if (attr.choice_list) {
@@ -1670,7 +1669,7 @@
 					runCustomEvent(dataInfo).then(result => {
 						console.log(result);
 
-						if (result.ret != 0&& result.ret != 1) {
+						if (result.ret != 0 && result.ret != 1) {
 							var tip = result.err_info ? typeof result
 								.err_info ==
 								'string' ?
diff --git a/pages/modal/3202.vue b/pages/modal/3202.vue
index 5ac47af..9a13d72 100644
--- a/pages/modal/3202.vue
+++ b/pages/modal/3202.vue
@@ -18,7 +18,7 @@
 									<button size="mini" v-for="(btn,btnIndex) in rowButtons" :key="btnIndex"
 										type="primary" @click="onRowBtnClick(btn, ii)">
 										<text v-if="btn.Style == 'img' || btn.Style == 'img_text'" class="img"></text>
-										{{btn.ShowName}}
+										{{btn.ShowName || ""}}
 									</button>
 								</div>
 							</div>
@@ -111,6 +111,7 @@
 			}); //璁剧疆椤堕儴鏍囬 
 			this.title = options.titlename;
 			this.param = JSON.parse(options.param);
+			const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
 			this.styledef = {};
 			this.head_styledef = {
 				form: {
@@ -126,7 +127,7 @@
 			if (this.param?.ClickItem_Event?.id)
 				this.click_item_view = true
 			await this.Detail1_UIstyleGetInfo(this.param.ClsID, this.param.ListItem_Panel.id);
-			this.initial()
+			this.initial(paramValue)
 
 		},
 		methods: {
@@ -153,7 +154,7 @@
 				});
 			},
 			//鍒濆鍖�-			async initial() {
+			async initial(paramValue) {
 				this.refreshing = true
 				await this.Head_UIStyleGetInfo(this.param.ClsID, this.param.Input_Panel.id);
 				this.wheres = '';
@@ -162,6 +163,10 @@
 				this.query_id = "";
 				this.detail1StyleDefList = [];
 				this.refreshing = false
+				if (paramValue) {
+
+					this.setFormValues(paramValue)
+				}
 
 			},
 
@@ -821,6 +826,7 @@
 						defCode == "3037" ||
 						defCode == "3200" ||
 						defCode == "3201" ||
+						defCode == "3202" ||
 						defCode == "5600" ||
 						defCode == "5601" ||
 						defCode == "5602"
@@ -857,19 +863,33 @@
 								});
 								return;
 							}
+							const attrValues = []
 
+							style.form.items.forEach(item => {
+								if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�+									item.setting.colList.forEach(col => {
+										if (col != null) {
+											attrValues.push({
+												attr: col.fieldId,
+												value: col.value || ""
+											})
+										}
+
+									});
+								} else
+									attrValues.push({
+										attr: item.fieldId,
+										value: item.value || ""
+									})
+							});
 							uni.navigateTo({
 								url: '../modal/' + name + '?param=' +
 									param + "&titlename=" +
 									appName +
 									"&type=relatedFunction&paramValue=" +
-									JSON.stringify(style
-										.form),
+									JSON.stringify(attrValues),
 								events: {
-									relatedFunction: function(data) {
-										console.log(data);
-										$this.Refresh();
-									},
+
 								}
 							});
 						} else {
@@ -1162,8 +1182,8 @@
 			},
 			setFormValues(attrs) {
 				const head_styledef = this.head_styledef
-				if (JSON.stringify(attrs) == '{}') {
-					return;
+				if (!Array.isArray(attrs)) {
+					return
 				}
 				console.log(attrs)
 				attrs.forEach(async (attr, key) => {
@@ -1807,7 +1827,7 @@
 			// justify-content: right;
 
 			button {
-				 line-height:1.6;
+				line-height: 1.6;
 				// border: none;
 				// margin-right: 10rpx;
 				// text-align: center;
diff --git a/pages/modal/5600.vue b/pages/modal/5600.vue
index 86bba78..e25414e 100644
--- a/pages/modal/5600.vue
+++ b/pages/modal/5600.vue
@@ -301,28 +301,8 @@
 				await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_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;
-										}
-									});
-								}
-							});
-						}
-					})
-				}
+					this.setFormValues(paramValue)
+					}
 
 				//鍔犺浇鍒濆鐣岄潰
 				if (this.param.Show_Welcom_Page) {
@@ -1114,7 +1094,75 @@
 					return 0;
 				}
 			},
+setFormValues(attrs) {
+				const head_styledef = this.head_styledef
+				if (JSON.stringify(attrs) == '{}') {
+					return;
+				}
+				console.log(attrs)
+				attrs.forEach(async (attr, key) => {
+					if (attr.choice_list) {
+						var dictItemList = [];
+						attr.choice_list.forEach(async (val, index) => {
+							dictItemList.push({
+								text: val,
+								value: val
+							});
+						});
 
+						head_styledef.form.items.forEach(async (attr_item, index) => {
+							if (attr_item.name != "Layout") {
+								if (attr_item.fieldId == attr.attr) {
+									if (attr_item.useDict) {
+										attr_item.dict = dictItemList;
+									} else {
+										attr_item.selections = dictItemList;
+									}
+								}
+							} else if (attr_item.name == "Layout") {
+								attr_item.setting.colList.forEach((col) => {
+									if (col) {
+										if (col.fieldId == attr.attr) {
+											if (col.useDict) {
+												col.dict = dictItemList;
+											} else {
+												col.selections = dictItemList;
+											}
+										}
+									}
+								});
+							}
+						});
+					}
+					if (!head_styledef.form.model[attr.attr]) {
+						head_styledef.form.model[attr.attr] = attr.value;
+					}
+					head_styledef.form.items.forEach(async (ele) => {
+						if (ele.name != "Layout") {
+							if (ele.fieldId == attr.attr) {
+								ele.value = attr.value;
+								ele.oldvalue = attr.value;
+							}
+						} else if (ele.name == "Layout") {
+							ele.setting.colList.forEach((col) => {
+								if (col) {
+									if (col.fieldId == attr.attr) {
+										col.value = attr.value;
+										col.oldvalue = attr.value;
+									}
+								}
+							});
+						}
+
+					})
+					//鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�+				})
+				console.log(head_styledef)
+				this.setData({
+					head_styledef: head_styledef
+				})
+			}, //鏇存柊鍒嗛〉绛句腑鐨勫垪琛ㄩ」鍐呭
+			
 			//鏇存柊鍒嗛〉绛句腑鐨勫垪琛ㄩ」鍐呭
 			viewActionSetRow(value) {
 				const $this = this
@@ -2207,8 +2255,7 @@
 					});
 				});
 			},
-
-
+			
 			//纭畾
 			ok() {
 				this.Before_OK_Event = this.param.Sub_Page[0].Before_ok;
diff --git a/pages/modal/5601.vue b/pages/modal/5601.vue
index ac406c8..4a71e24 100644
--- a/pages/modal/5601.vue
+++ b/pages/modal/5601.vue
@@ -44,8 +44,8 @@
 												:class="btn.FunCode == 'Delete' ? 'btn-warn' : 'btn-primary'"
 												@click="onRowBtnClick(btn, pageData,ii)">
 												<text v-if="btn.Style == 'img' || btn.Style == 'img_text'"
-													class="Img"></text>
-												{{(btn.Style == 'text'|| btn.Style == 'img_text') ? btn.ShowName :""}}
+													class="img"></text>
+												{{btn.ShowName ||"" }}
 											</button>
 										</div>
 
@@ -60,8 +60,8 @@
 										'btn-left':(btnIndex < pageData.Button.length - 1),
 										'btn-right': btnIndex > 0 && btnIndex == pageData.Button.length - 1 ,
 										'width-50':(pageData.Button.length == 2),'width-32':(pageData.Button.length == 3),'width-30':(pageData.DropDownButton.length> 0)}" @click="onBtnClick(btn, pageData)">
-									<text v-if="btn.Style == 'img' || btn.Style == 'img_text'" class="Img"></text>
-									{{(btn.Style == 'text'|| btn.Style == 'img_text') ? btn.ShowName :""}}
+									<text v-if="btn.Style == 'img' || btn.Style == 'img_text'" class="img"></text>
+									{{btn.ShowName ||""}}
 								</button>
 								<view class="btn-right" v-if="pageData.DropDownButton.length >0 ">
 									<a @click="clickDropdownBtns(pageData)">
@@ -117,7 +117,8 @@
 		Base64
 	} from '@/js/Base64.js';
 	import {
-		dictGetInfo
+		dictGetInfo,
+		appGetInfo,
 	} from "@/api/mobox.js"
 	import {
 		getUIStyleInfo,
@@ -185,7 +186,7 @@
 			//鑾峰彇涓绘暟鎹被ID
 			this.ClsID = this.param.master_cls?.id;
 			if (this.ClsID) {
-				const  paramValue = options.paramValue ?JSON.parse(options.paramValue) :undefined
+				const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
 				this.loadData(paramValue)
 			} else {
 				uni.showModal({
@@ -227,27 +228,7 @@
 				//浼犲叆鍙傛暟鍊� 				console.log(paramValue)
 				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;
-										}
-									});
-								}
-							});
-						}
-					})
+					this.setFormValues(paramValue)
 				}
 				//鍔犺浇鍒濆鐣岄潰
 				if (this.param.Show_Welcom_Page) {
@@ -867,7 +848,7 @@
 					};
 					const result = await runCustomEvent(dataInfo)
 					console.log(result)
-					if (result.ret != 0&& result.ret != 1) {
+					if (result.ret != 0 && result.ret != 1) {
 						var tip = result.err_info ? typeof result
 							.err_info == 'string' ? result
 							.err_info : result.err_info.join('<br/>') :
@@ -1092,7 +1073,7 @@
 						};
 						const result = await runCustomEvent(dataInfo)
 						console.log(result);
-						if (result.ret != 0&& result.ret != 1) {
+						if (result.ret != 0 && result.ret != 1) {
 							var tip = result.err_info ? typeof result
 								.err_info == 'string' ? result
 								.err_info : result.err_info.join('<br/>') :
@@ -2153,7 +2134,7 @@
 				console.log(dataInfo);
 				// return;
 				runCustomEvent(dataInfo).then(data => {
-					if (data.ret != 0&& data.ret != 1) {
+					if (data.ret != 0 && data.ret != 1) {
 						var tip = data.err_info ? typeof data.err_info == 'string' ? data
 							.err_info :
 							data
@@ -2326,7 +2307,7 @@
 				console.log(dataInfo);
 				// return;
 				runCustomEvent(dataInfo).then(data => {
-					if (data.ret != 0&& data.ret != 1) {
+					if (data.ret != 0 && data.ret != 1) {
 						var tip = data.err_info ? typeof data.err_info == 'string' ? data
 							.err_info :
 							data
@@ -2710,10 +2691,121 @@
 						}
 					}
 
+				} else if (btn.FunCode == "RelatedFunction") {
+					if (index > -1) {
+						const style = pageData.DefList[index];
+						this.relatedFunction(btn, style, enviroment, pageData);
+					}
 				} else {
 					this.$Message.warning(this.$t("sys.unrealized"));
 				}
 			},
+			async relatedFunction(btn, style, enviroment, pageData) {
+				//璺宠浆鍔熻兘鐐�+				try {
+					const defCode = btn.Related_Function?.Def_Code
+					var $this = this;
+					if (
+						defCode == "3018" ||
+						defCode == "3037" ||
+						defCode == "3200" ||
+						defCode == "3201" ||
+						defCode == "3202" ||
+						defCode == "5600" ||
+						defCode == "5601" ||
+						defCode == "5602"
+					) {
+
+						let name = defCode
+						if (defCode == "3018" || defCode == "3037")
+							name = defCode + "_2"
+						var json = {
+							app_id: [btn.Related_Function.ID],
+						};
+						const result = await appGetInfo(json)
+						if ((result || []).length > 0) {
+							var app = result[0];
+							var param = "";
+							var appName = app.list_name || app.name
+								.Name;
+							var paramStr = app.param
+							if (paramStr) {
+								//mobox2鐨刾aram鏄痡son瀛楃涓�+								param = paramStr.replace(/\\/g, "");
+								//mobox3鐨刾aram鏄痓ase64瀛楃涓�+								if (!paramStr.includes('"')) param = Base64.decode(
+									paramStr);
+							}
+							if (!param) {
+								uni.showModal({
+									title: this.translateSys("tip"),
+									content: this.translate(
+										'tip_no_app_param'),
+									showCancel: false,
+									confirmText: this.translateSys(
+										'close')
+								});
+								return;
+							}
+							const attrValues = []
+
+							style.form.items.forEach(item => {
+								if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�+									item.setting.colList.forEach(col => {
+										if (col != null) {
+											attrValues.push({
+												attr: col.fieldId,
+												value: col.value || ""
+											})
+										}
+
+									});
+								} else
+									attrValues.push({
+										attr: item.fieldId,
+										value: item.value || ""
+									})
+							});
+							uni.navigateTo({
+								url: '../modal/' + name + '?param=' +
+									param + "&titlename=" + appName +
+									"&type=relatedFunction&paramValue=" + JSON.stringify(attrValues),
+							});
+						} else {
+							uni.showModal({
+								title: this.translateSys("error"),
+								content: this.translate(
+									"function_not_exist"),
+								showCancel: false,
+								confirmText: this.translateSys('close')
+							});
+						}
+
+					} else {
+						uni.showModal({
+							title: this.translateSys("error"),
+							content: this.translate("cannot_related_function"),
+							showCancel: false,
+							confirmText: this.translateSys('close')
+						});
+
+					}
+				} 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("error"),
+						content: tip,
+						showCancel: false,
+						confirmText: this.translateSys('close')
+					});
+					return undefined
+				}
+			},
+
 			//淇敼灏忕獥鍙f暟鎹� 			showSmallDialog(btn, row, enviroment, pageData) {
 				var data = {
@@ -2984,7 +3076,7 @@
 				console.log(dataInfo);
 				runCustomEvent(dataInfo).then(result => {
 					console.log(result);
-					if (result.ret != 0&& result.ret != 1) {
+					if (result.ret != 0 && result.ret != 1) {
 						var tip = result.err_info ? typeof result
 							.err_info == 'string' ? result.err_info :
 							result.err_info.join('<br/>') : '';
@@ -3226,10 +3318,10 @@
 
 				}).catch(ex => {
 					console.log(ex);
-				let exStr = JSON.stringify(ex)
-				if (exStr == "{}")
-					exStr = ex
-				let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
+					let exStr = JSON.stringify(ex)
+					if (exStr == "{}")
+						exStr = ex
+					let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
 					uni.showModal({
 						title: this.translateSys("error") + "8.1",
 						content: this.translate("execute_after_ok_event_failed") +
diff --git a/pages/modal/5602.vue b/pages/modal/5602.vue
index 17903b6..bd0ddce 100644
--- a/pages/modal/5602.vue
+++ b/pages/modal/5602.vue
@@ -199,7 +199,7 @@
 <script>
 	import {
 		Base64
-	} from  '@/js/Base64.js';
+	} from '@/js/Base64.js';
 	import {
 		appGetInfo,
 		dictGetInfo
@@ -214,7 +214,7 @@
 	export default {
 		data() {
 			return {
-					largeMode: getApp().globalData.largeMode || false,
+				largeMode: getApp().globalData.largeMode || false,
 				title: this.translateSys("sorting"),
 				ClsID: "Distribution_CNTR_Detail",
 				ClsID2: "Picking_Result",
@@ -259,7 +259,7 @@
 			this.title = options.titlename;
 			this.param = JSON.parse(options.param);
 			// console.log(this.param);
-			const  paramValue = options.paramValue ?JSON.parse(options.paramValue) :undefined
+			const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
 			this.loadData(paramValue)
 		},
 		methods: {
@@ -290,27 +290,7 @@
 				await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_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;
-										}
-									});
-								}
-							});
-						}
-					})
+					this.setFormValues(paramValue)
 				}
 
 				//鍔犺浇鍒濆鐣岄潰
@@ -846,7 +826,7 @@
 								var tip = result.info ? typeof result.info == 'string' ? result.info :
 									result.info.join('<br/>') : '';
 								tip = tip || result.err_info
-	
+
 								if (tip) uni.showModal({
 									title: this.translateSys("tip"),
 									content: tip,
@@ -2518,7 +2498,7 @@
 					} else {
 						var tip = result.info ? typeof result.info == 'string' ? result.info : result.info
 							.join('<br/>') : '';
-								tip = tip || result.err_info
+						tip = tip || result.err_info
 						if (tip) uni.showModal({
 							title: this.translateSys("tip"),
 							content: tip,

--
Gitblit v1.9.1