From 7662665a4f88da0f8afa804bd4a34dfbefc1fb56 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 29 八月 2025 15:17:59 +0800
Subject: [PATCH] get_pre_page_subtable_next_row

---
 pages/modal/5600.vue |  116 ++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 76 insertions(+), 40 deletions(-)

diff --git a/pages/modal/5600.vue b/pages/modal/5600.vue
index c5a26f2..7002a5c 100644
--- a/pages/modal/5600.vue
+++ b/pages/modal/5600.vue
@@ -33,7 +33,7 @@
 				<!-- 椤电 -->
 				<view class="dv-tab">
 					<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"
-						styleType="button">
+						styleType="text">
 					</uni-segmented-control>
 				</view>
 				<swiper class="view-tabpage" :current="current" @change="changeSwiper">
@@ -206,7 +206,8 @@
 		dataObjCreate,
 		dataObjDel
 	} from "@/api/data.js"
-
+import {showInfo,
+		showError} from "@/js/Page.js"
 	export default {
 		data() {
 			return {
@@ -255,7 +256,8 @@
 			this.title = options.titlename;
 			this.param = JSON.parse(options.param);
 			// console.log(this.param);
-			this.loadData(options.paramValue)
+			const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
+			this.loadData(paramValue)
 		},
 		//椤甸潰鍒濆鍖栬幏鍙栫劍鐐� 		methods: {
@@ -300,27 +302,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)
 				}
 
 				//鍔犺浇鍒濆鐣岄潰
@@ -1113,6 +1095,74 @@
 					return 0;
 				}
 			},
+			setFormValues(attrs) {
+				const head_styledef = this.head_styledef
+				if (!Array.isArray(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) {
@@ -2207,7 +2257,6 @@
 				});
 			},
 
-
 			//纭畾
 			ok() {
 				this.Before_OK_Event = this.param.Sub_Page[0].Before_ok;
@@ -2719,21 +2768,8 @@
 					else if (type == "2")
 						this.ok2Loading = false
 				}).catch(ex => {
-					let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
-
-					// var tip = typeof ex == "string" ? ex : ex.errMsg;
-					if (type == "1")
-						this.okLoading = false
-					else if (type == "2")
-						this.ok2Loading = false
-					uni.showModal({
-						title: this.translateSys("error") + "8.1",
-						content: this.translate("execute_after_ok_event_failed") + this.translateSys(
-								"comma") +
-							tip,
-						showCancel: false,
-						confirmText: this.translateSys("cancel")
-					});
+					showError(ex, this.translateSys("error") + "8.1")
+				
 				});
 			},
 

--
Gitblit v1.9.1