From 64a5025c1633a676c0393fd08f842ba33fe87b37 Mon Sep 17 00:00:00 2001
From: jt <jt@activesoft.com>
Date: 星期三, 15 二月 2023 12:46:02 +0800
Subject: [PATCH] test

---
 pages/modal/classAttr.vue |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/pages/modal/classAttr.vue b/pages/modal/classAttr.vue
index 56a1c62..71812eb 100644
--- a/pages/modal/classAttr.vue
+++ b/pages/modal/classAttr.vue
@@ -485,10 +485,13 @@
 				}
 			},
 			ontap(e){ //鎵爜鍔熻兘
+				var $ele = e;
 				//console.log(e.target)
 				getApp().onScan((result)=>{
 					//console.log(result.decodedata);
 					this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata;
+					uni.hideKeyboard();
+					this.onevent($ele,result.decodedata);
 				})
 			},
 			onarrow(index,open){
@@ -616,12 +619,12 @@
 				
 				
 			},
-			onevent(e){
+			onevent(e,decodedata){
 				// console.log(e.target);
 				var data_attr = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']];
-				// console.log(data_attr);
+				// console.log(decodedata);
 				if (e.target.value != data_attr.Value) {
-					this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=e.target.value;
+					this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=decodedata?decodedata:e.target.value;
 					var eventid = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action;
 					if (eventid) {
 				        // self.event_no_sub = 1;
@@ -867,8 +870,8 @@
 					not_trigger_sys_event: ''
 				};
 				
-				// return
 				console.log(dataInfo);
+				// return
 				this.$store.dispatch('addclassattr',dataInfo).then(success=>{
 					console.log(success);
 					uni.hideLoading();
@@ -922,15 +925,17 @@
 				                            ca.select = attrs[j].select==undefined?false:attrs[j].select;
 											ca.Value ="";
 											if(ca.dictitem){
-												var dictitemlist=[];
-												for (var d = 0; d < ca.dictitem.length; d++) {
-													ca.dictitem[d].label=ca.dictitem[d].CN_S_NAME;
-													ca.dictitem[d].value=ca.dictitem[d].CN_S_NAME;
-												}
 												if(ca.select == true)
 													ca.Value = [];//ca.dictitem[0].CN_S_NAME;
 												else 
 													ca.Value = '璇烽�鎷�;//ca.dictitem[0].CN_S_NAME;
+												var dictitemlist=[];
+												for (var d = 0; d < ca.dictitem.length; d++) {
+													ca.dictitem[d].label=ca.dictitem[d].CN_S_NAME;
+													ca.dictitem[d].value=ca.dictitem[d].CN_S_NAME;
+													if(ca.dictitem[d].CN_C_IS_DEFAULT=='1')
+														ca.Value=ca.dictitem[d].CN_S_NAME;
+												}
 											}
 											if(ca.Type=='鏃ユ湡' || ca.Type=='鏃堕棿'){
 												var nowDate = new Date();

--
Gitblit v1.9.1