From fe10cf437b17a2ea0ef63373cae2e5790ebc3930 Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期四, 31 七月 2025 18:22:52 +0800 Subject: [PATCH] action 处理 --- pages/modal/3037.vue | 53 ++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 38 insertions(+), 15 deletions(-) diff --git a/pages/modal/3037.vue b/pages/modal/3037.vue index 8705578..74b983c 100644 --- a/pages/modal/3037.vue +++ b/pages/modal/3037.vue @@ -679,7 +679,7 @@ }, data() { return { - largeMode: getApp().globalData.largeMode || false, + largeMode: getApp().globalData.largeMode || false, title: '鏂板', param: {}, classAttrList: [], @@ -1552,18 +1552,18 @@ ontap(e) { //鎵爜鍔熻兘 //console.log(e.target) getApp().onScan((result) => { - //console.log(result.decodedata); + //console.log(result); var isVal = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ 'iindex']].Value; // if(!isVal){ - // this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata; + // this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result; // var isVald =this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value; // return; // } //涓绘暟鎹被鎵爜鏌ヨ鏁版嵁 - if (isVal != result.decodedata) { + if (isVal != result) { this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ - 'iindex']].Value = result.decodedata; + 'iindex']].Value = result; uni.hideKeyboard(); //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈� var eventid = this.param.Scan_Code.Input_Change_Event.ID; @@ -1590,7 +1590,7 @@ mast_attr: [], inputParamter: [{ attr: 'mast_input_3037', - value: result.decodedata + value: result }] } @@ -1602,13 +1602,13 @@ subontap(e) { //鎵爜鍔熻兘 //console.log(e.target) getApp().onScan((result) => { - //console.log(result.decodedata); + //console.log(result); var isVal = this.subClassAttrList[e.target.dataset['index']].Attr[e .target.dataset['iindex']].Value; //涓绘暟鎹被鎵爜鏌ヨ鏁版嵁 - if (isVal != result.decodedata) { + if (isVal != result) { this.subClassAttrList[e.target.dataset['index']].Attr[e.target - .dataset['iindex']].Value = result.decodedata; + .dataset['iindex']].Value = result; uni.hideKeyboard(); //瀛愭暟鎹被鎵爜鍖轰簨浠惰剼鏈� var eventid = this.param.Scan_Code.Input_Change_Event.ID; @@ -1635,7 +1635,7 @@ mast_attr: [], inputParamter: [{ attr: 'mast_input_3037', - value: result.decodedata + value: result }] } @@ -1647,16 +1647,16 @@ scan_ontap(e) { //鎵爜鍖烘壂鐮佸姛鑳� //console.log(e.target) getApp().onScan((result) => { - console.log(result.decodedata); + console.log(result); var isflag = true; for (var i in this.subPanelList) { - if (this.subPanelList[i].scanCodeVal == result.decodedata) + if (this.subPanelList[i].scanCodeVal == result) isflag = false; } //瀛愭暟鎹被鎵爜鏌ヨ鏁版嵁 if (isflag) { uni.hideKeyboard(); - this.scanCodeVal = result.decodedata; + this.scanCodeVal = result; var eventid = this.param.Scan_Code.Input_Change_Event.ID; if (eventid) { var mast_req = []; @@ -2627,10 +2627,21 @@ showCancel: false, confirmText: this.translateSys('close') }); + if (data.result_type == 2) { - if (data.action) { + } 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; + data.action || [] if (actionlist) { for (var j = 0; j < @@ -2750,6 +2761,18 @@ } } } + } 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 } } -- Gitblit v1.9.1