From c9ecd7684e6ada47de4669885e66dc564128e89b Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 15 八月 2025 18:45:05 +0800
Subject: [PATCH] test

---
 pages/modal/5600.vue |  127 ++++++++++++++++++++++++++++++++----------
 1 files changed, 96 insertions(+), 31 deletions(-)

diff --git a/pages/modal/5600.vue b/pages/modal/5600.vue
index 4918b6d..b67894c 100644
--- a/pages/modal/5600.vue
+++ b/pages/modal/5600.vue
@@ -1,5 +1,5 @@
 <template>
-	<view class="uni-page-modal-5600">
+	<view class="uni-page-modal-5600" :class="largeMode?'large-mode':''">
 		<!-- 琛ㄥご鏍峰紡 -->
 		<view class="view-header">
 			<view class="v-headStyle" v-for="(item,index) in head_styledef.form.items">
@@ -132,7 +132,7 @@
 										</div>
 										<div class="dv-panel-button">
 											<checkbox v-if="param.Sub_Page[1].Select_Button==true" :value="ii"
-											:checked="style.SelBut_Checked" />
+												:checked="style.SelBut_Checked" />
 											<!-- <text></text> -->
 
 											<!-- <button type="primary" @click="savaDataObj(style,ii)" v-if="param.Sub_Page[1].OK_Button==true">淇濆瓨</Button> -->
@@ -194,12 +194,13 @@
 <script>
 	import {
 		Base64
-	} from  '@/js/Base64.js';
+	} from '@/js/Base64.js';
 	import {
 		appGetInfo,
 		dictGetInfo
 	} from "@/api/mobox.js"
 	import {
+		basisver_get,
 		getUIStyleInfo,
 		runCustomEvent,
 		dataObjCreate,
@@ -209,6 +210,7 @@
 	export default {
 		data() {
 			return {
+				largeMode: getApp().globalData.largeMode || false,
 				title: this.translateSys("coding_disk"),
 				ClsID: 'CG_Detail',
 				param: {},
@@ -253,7 +255,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: {
@@ -278,32 +281,27 @@
 					});
 				});
 			},
+			async getBasisVer() {
+				try {
+					const res = await basisver_get();
+					const basisver = (res.ver || "").toLowerCase();
+					return basisver;
+				} catch (ex) {
+					return "";
+				}
+			},
 			async loadData(paramValue) {
+				let clsDetailId = "CG_Detail";
+				const basisver = await this.getBasisVer();
+				if (basisver >= "v16.5") {
+					clsDetailId = "INV_Detail";
+				}
+				this.ClsID = clsDetailId;
 				//鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁� 				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)
 				}
 
 				//鍔犺浇鍒濆鐣岄潰
@@ -565,8 +563,8 @@
 				//console.log(e.target)
 				this.focusOldFieldId = item.fieldId
 				getApp().onScan((result) => {
-					console.log(result.decodedata);
-					item.value = result.decodedata;
+					console.log(result);
+					item.value = result;
 					// uni.hideKeyboard();
 					var $this = this;
 					if (item.oldvalue != item.value && item.value.trim() != "") {
@@ -1096,6 +1094,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) {
@@ -1866,8 +1932,8 @@
 						}
 						console.log($this.head_styledef);
 						if (data.result) {
-							$this.setFormValues( data.result)
-							}
+							$this.setFormValues(data.result)
+						}
 					}
 
 				}).catch(ex => {
@@ -1902,7 +1968,7 @@
 					attr: a,
 					value: obj_attr[a] || "",
 				}));
-				
+
 				var extinfo = enviroment;
 				extinfo.edit_dlg = {
 					type: 'small', //灏忕獥鍙�@@ -2189,7 +2255,6 @@
 					});
 				});
 			},
-
 
 			//纭畾
 			ok() {

--
Gitblit v1.9.1