From 3ddb7987b031a152309c58dabd949e23d3419a72 Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期五, 01 八月 2025 15:33:50 +0800 Subject: [PATCH] test --- pages/modal/3037.vue | 2443 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 1,217 insertions(+), 1,226 deletions(-) diff --git a/pages/modal/3037.vue b/pages/modal/3037.vue index 60422cc..ebdda44 100644 --- a/pages/modal/3037.vue +++ b/pages/modal/3037.vue @@ -1,5 +1,5 @@ <template> - <view class="content"> + <view class="content" :class="largeMode?'large-mode':''"> <!-- 涓绘暟鎹�--> <view class="v-area" v-for="(classattr,index) in classAttrList"> <div class="class_attr_title" style="display: none;"> @@ -652,7 +652,7 @@ <script> import { Base64 - } from '@/js/Base64.js'; + } from '@/js/Base64.js'; import pickerAddress from '../../js/pickerAddress/pickerAddress.vue' import utils from "@/js/utils.js" import { @@ -679,6 +679,7 @@ }, data() { return { + largeMode: getApp().globalData.largeMode || false, title: '鏂板', param: {}, classAttrList: [], @@ -1054,8 +1055,8 @@ .Font : {}, Bk_Color: this.classGridStyle.StyleDef.Bk_Color ? this.classGridStyle .StyleDef.Bk_Color : '#FFFFFF', - Text_Color: this.classGridStyle.StyleDef.Text_Color ? this.$data - .classGridStyle.StyleDef.Text_Color : '#000000' + Text_Color: this.classGridStyle.StyleDef.Text_Color ? this.classGridStyle.StyleDef + .Text_Color : '#000000' }); // } } @@ -1207,10 +1208,10 @@ title_p_wdith: this.subClassGridStyle.StyleDef.title_p_wdith, Font: this.subClassGridStyle.StyleDef.Font ? this.subClassGridStyle .StyleDef.Font : {}, - Bk_Color: this.subClassGridStyle.StyleDef.Bk_Color ? this.$data - .subClassGridStyle.StyleDef.Bk_Color : '#FFFFFF', - Text_Color: this.subClassGridStyle.StyleDef.Text_Color ? this.$data - .subClassGridStyle.StyleDef.Text_Color : '#000000' + Bk_Color: this.subClassGridStyle.StyleDef.Bk_Color ? this.subClassGridStyle + .StyleDef.Bk_Color : '#FFFFFF', + Text_Color: this.subClassGridStyle.StyleDef.Text_Color ? this.subClassGridStyle + .StyleDef.Text_Color : '#000000' }); // } } @@ -1551,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; @@ -1589,7 +1590,7 @@ mast_attr: [], inputParamter: [{ attr: 'mast_input_3037', - value: result.decodedata + value: result }] } @@ -1601,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; @@ -1634,7 +1635,7 @@ mast_attr: [], inputParamter: [{ attr: 'mast_input_3037', - value: result.decodedata + value: result }] } @@ -1646,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 = []; @@ -1841,8 +1842,7 @@ for (var i in this.classAttrList) { for (var j in this.classAttrList[i] .Attr) { - if (delvalue[0].attr == this.$data - .classAttrList[i].Attr[j].Name) { + if (delvalue[0].attr == this.classAttrList[i].Attr[j].Name) { this.classAttrList[i].Attr[j] .Value = ""; } @@ -1855,8 +1855,7 @@ for (var i in this.classAttrList) { for (var j in this.classAttrList[i] .Attr) { - if (item[v].attr == this.$data - .classAttrList[i].Attr[j].Name) { + if (item[v].attr == this.classAttrList[i].Attr[j].Name) { index = i; iindex = j; } @@ -1876,8 +1875,7 @@ if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data - .classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist .length; i++) { var attr = attrlist[i].Attr; @@ -1942,9 +1940,8 @@ if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data - .subPanelList[e.target.dataset[ - 'iiindex']].subClassAttr; + var attrlist = this.subPanelList[e.target.dataset[ + 'iiindex']].subClassAttr; for (var i = 0; i < attrlist .length; i++) { var attr = attrlist[i].Attr; @@ -2093,8 +2090,7 @@ if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data - .classAttrList; //涓绘暟鎹被灞炴� + var attrlist = this.classAttrList; //涓绘暟鎹被灞炴� for (var i = 0; i < attrlist .length; i++) { var attr = attrlist[i].Attr; @@ -2159,8 +2155,7 @@ if (eventid) { // self.event_no_sub = 1; var req = []; - var attrlist = this.$data - .classAttrList; + var attrlist = this.classAttrList; for (var i = 0; i < attrlist .length; i++) { var attr = attrlist[i].Attr; @@ -2199,11 +2194,9 @@ }, classAttr_extButton(index, iindex) { var $this = this; - var before_click_button = $this.$data - .classAttrList[index].Attr[iindex] + var before_click_button = $this.classAttrList[index].Attr[iindex] .before_click_button; - var button_callback = $this.$data - .classAttrList[index].Attr[iindex] + var button_callback = $this.classAttrList[index].Attr[iindex] .button_callback; if (!before_click_button) { uni.showModal({ @@ -2242,23 +2235,19 @@ AddPer(data, param) { // console.log(param); console.log(data); - $this.$data - .classAttrList[ + $this.classAttrList[ param.index] .Attr[param.iindex] .Value = data[0] .Name; - $this.$data - .classAttrList[ + $this.classAttrList[ param.index] .Attr[param.iindex] .ValID = data[0] .Login + ';' + data[0].Name; - var eventid = $this - .$data - .classAttrList[ + var eventid = $this.classAttrList[ param.index] .Attr[param.iindex] .action; @@ -2276,9 +2265,7 @@ 0 ] .Login, - clsid: $this - .$data - .param + clsid: $this.param .Master_Cls .ID, objid: "", @@ -2319,23 +2306,19 @@ AddPer(data, param) { // console.log(param); // console.log(data); - $this.$data - .classAttrList[ + $this.classAttrList[ param.index] .Attr[param.iindex] .Value = data[0] .Name; - $this.$data - .classAttrList[ + $this.classAttrList[ param.index] .Attr[param.iindex] .ValID = data[0] .ID + ';' + data[0] .Name; - var eventid = $this - .$data - .classAttrList[ + var eventid = $this.classAttrList[ param.index] .Attr[param.iindex] .action; @@ -2353,9 +2336,7 @@ rclsid: "", robjid: "", userlogin: "", - clsid: $this - .$data - .param + clsid: $this.param .Master_Cls .ID, objid: "", @@ -2383,12 +2364,10 @@ sava() { if (this.param .Before_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍓嶈剼鏈�- this.scan_OKDataObjRunCustomEvent(this - .$data.param.Before_OK_Event.ID); + this.scan_OKDataObjRunCustomEvent(this.param.Before_OK_Event.ID); else if (this.param .After_OK_Event) //鍒ゆ柇鍔熻兘鐐瑰弬鏁版槸鍚︽湁纭畾鍚庤剼鏈�- this.scan_OKDataObjRunCustomEvent(this - .$data.param.After_OK_Event.ID); + this.scan_OKDataObjRunCustomEvent(this.param.After_OK_Event.ID); else uni.navigateBack({ delta: 1 @@ -2527,13 +2506,10 @@ url: '../modal/3037?param=' + JSON .stringify( - this - .$data - .param + this.param ) + "&titlename=" + - this.$data - .title + this.title }); // this.class_attr_init(); @@ -2644,6 +2620,7 @@ .info : data.info .join('<br/>') : ''; + tip = tip || data.err_info if (tip) uni .showModal({ title: this.translateSys('tip'), @@ -2651,134 +2628,153 @@ showCancel: false, confirmText: this.translateSys('close') }); + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - if (data.action) { - var actionlist = - data.action; - if (actionlist) { - for (var j = - 0; j < - actionlist - .length; j++ - ) { - var action = - actionlist[ - j] - var action_type = - action - .action_type; - var value = - action - .value; - if (action_type == - 'set_dlg_attr' + } 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 || [] + if (actionlist) { + for (var j = + 0; j < + actionlist + .length; j++ ) { - if ( - value) { - var val = - value; - if (typeof value == - 'string' - ) { - val = - JSON - .parse( - value + var action = + actionlist[ + j] + var action_type = + action + .action_type; + var value = + action + .value; + if (action_type == + 'set_dlg_attr' + ) { + if ( + value) { + var val = + value; + if (typeof value == + 'string' + ) { + val = + JSON + .parse( + value + ); + } + console + .log( + val ); - } - console - .log( - val - ); - for ( - var i = - 0; i < - val - .length; i++ - ) { for ( - var a = - 0; a < - this - .$data - .classAttrList - .length; a++ + var i = + 0; i < + val + .length; i++ ) { for ( - var l = - 0; l < - this - .$data - .classAttrList[ - a - ] - .Attr - .length; l++ + var a = + 0; a < + this.classAttrList + .length; a++ ) { - var ca = - this - .$data - .classAttrList[ + for ( + var l = + 0; l < + this.classAttrList[ a ] - .Attr[ - l - ]; - if (val[ - i] - .attr == - ca - .Name + .Attr + .length; l++ ) { - if (utils.classUtils.attrTypeIsDict(ca.Type)) { - var - dictItemList = []; - for ( - var d in - val[ - i] - .choice_list - ) { - var val = - val[ - i] - .choice_list[ - d - ]; - dictItemList - .push({ - "CN_S_NAME": val, - "CN_S_VALUE": val, - "Name": val, - "label": val, - "value": val - }); + var ca = + this.classAttrList[ + a + ] + .Attr[ + l + ]; + if (val[ + i] + .attr == + ca + .Name + ) { + if (utils.classUtils.attrTypeIsDict(ca.Type)) { + var + dictItemList = []; + for ( + var d in + val[ + i] + .choice_list + ) { + var val = + val[ + i] + .choice_list[ + d + ]; + dictItemList + .push({ + "CN_S_NAME": val, + "CN_S_VALUE": val, + "Name": val, + "label": val, + "value": val + }); + } + ca.dictitem = + dictItemList; + // attr[j].dictitem = val[i].choice_list; + } else { + // ca.value = val[i].value; } - ca.dictitem = - dictItemList; - // attr[j].dictitem = val[i].choice_list; - } else { - // ca.value = val[i].value; } } } - } + } } } - } - if (action_type == - 'open_select_userdlg' - ) { - uni.showModal({ - title: this.translateSys('error') + " 2.2", - content: "open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�, - showCancel: false, - confirmText: this.translateSys('close') - }); + if (action_type == + 'open_select_userdlg' + ) { + uni.showModal({ + title: this.translateSys('error') + " 2.2", + content: "open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�, + showCancel: false, + confirmText: this.translateSys('close') + }); + } } } + } 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 } } } @@ -2914,47 +2910,208 @@ showCancel: false, confirmText: this.translateSys('close') }); - - var actionlist = data - .action; - if (actionlist) { - console.log( - actionlist); - for (var i = 0; i < - actionlist - .length; i++) { - var action = - actionlist[ - i]; - if (action - .action_type == - 'set_dlg_attr' - ) { - var result = - action - .value; - for (var i = - 0; i < - result - .length; i++ + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { + var result = data + .result || [] + for (var i = 0; i < + result + .length; i++) { + for (var c = + 0; c < + $this.classAttrList + .length; c++ ) { - if (result[ - i - ] - .choice_list + var attr = + $this + .classAttrList[ + c] + .Attr; + for (var j = + 0; j < + attr + .length; j++ ) { + if (attr[ + j + ] + .Name == + result[ + i + ] + .attr + ) { + attr[ + j] + .Value = + result[ + i + ] + .value; + } + } + } + + var length = 0; + if (!$this + .refdatastore + .filter( + function( + s + ) { + return result[ + i + ] + .attr == + s + .attr + }) + .length) { + length = 1; + $this.refdatastore + .push( + result[ + i + ] + ); + } + if (length == + 0) { + for (var j = + 0; j < + $this + .refdatastore + .length; j++ + ) { + if ($this + .refdatastore[ + j + ] + .attr == + result[ + i + ] + .attr + ) { + $this + .refdatastore[ + j + ] + .value = + result[ + i + ] + .value; + } + } + } + } + + } 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 || [] + for (var i = 0; i < + actionlist + .length; i++) { + 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.classAttrList + .length; c++ + ) { + var attr = + $this.classAttrList[ + c + ] + .Attr; + for ( + var j = + 0; j < + attr + .length; j++ + ) { + if (attr[ + j + ] + .Name == + result[ + i + ] + .attr + ) { + if (utils.classUtils.attrTypeIsDict(attr[j].Type)) { + 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, + "Name": val, + "label": val, + "value": val + }); + } + attr[ + j] + .dictitem = + dictItemList; + // attr[j].dictitem = result[i].choice_list; + } + } + } + } + } for ( var c = 0; c < - $this - .$data - .classAttrList + $this.classAttrList .length; c++ ) { var attr = - $this - .$data - .classAttrList[ + $this.classAttrList[ c ] .Attr; @@ -2964,6 +3121,18 @@ attr .length; j++ ) { + console + .log( + attr[ + j + ] + .Name + + '==' + + result[ + i + ] + .attr + ); if (attr[ j ] @@ -2973,213 +3142,105 @@ ] .attr ) { - if (utils.classUtils.attrTypeIsDict(attr[j].Type)) { - 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, - "Name": val, - "label": val, - "value": val - }); - } - attr[ - j] - .dictitem = - dictItemList; - // attr[j].dictitem = result[i].choice_list; - } + attr[ + j] + .Value = + result[ + i + ] + .value; } } } - } - for ( - var c = - 0; c < - $this - .$data - .classAttrList - .length; c++ - ) { - var attr = - $this - .$data - .classAttrList[ - c - ] - .Attr; - for ( - var j = - 0; j < - attr - .length; j++ + 0; + if (! + $this.refdatastore + .filter( + function( + s + ) { + return result[ + i + ] + .attr == + s + .attr + } + ) + .length ) { - console - .log( - attr[ + length + = + 1; + $this + .refdatastore + .push( + result[ + i + ] + ); + } + if (length == + 0 + ) { + for ( + var j = + 0; j < + $this + .refdatastore + .length; j++ + ) { + if ($this + .refdatastore[ j ] - .Name + - '==' + + .attr == result[ i ] .attr - ); - if (attr[ - j - ] - .Name == - result[ - i - ] - .attr - ) { - attr[ - j] - .Value = - result[ - i - ] - .value; + ) { + $this + .refdatastore[ + j + ] + .value = + result[ + i + ] + .value; + } } } } - } - } else if (data - .action[i] - .action_type == - 'set_global_attr' - ) { - $this.$data - .global_attr = - data - .action[ - i] - .value || []; - } - } - } - - if (data.result) { - var result = data - .result; - for (var i = 0; i < - result - .length; i++) { - for (var c = - 0; c < - $this.$data - .classAttrList - .length; c++ - ) { - var attr = - $this - .$data - .classAttrList[ - c] - .Attr; - for (var j = - 0; j < - attr - .length; j++ + } else if (data + .action[i] + .action_type == + 'set_global_attr' ) { - if (attr[ - j - ] - .Name == - result[ - i - ] - .attr - ) { - attr[ - j] - .Value = - result[ - i - ] - .value; - } + $this.global_attr = + data + .action[ + i] + .value || []; } } - var length = 0; - if (!$this - .$data - .refdatastore - .filter( - function( - s - ) { - return result[ - i - ] - .attr == - s - .attr - }) - .length) { - length = 1; - $this.$data - .refdatastore - .push( - result[ - i - ] - ); - } - if (length == - 0) { - for (var j = - 0; j < - $this - .$data - .refdatastore - .length; j++ - ) { - if ($this - .$data - .refdatastore[ - j - ] - .attr == - result[ - i - ] - .attr - ) { - $this - .$data - .refdatastore[ - j - ] - .value = - result[ - i - ] - .value; - } - } - } + } 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 } } + } }).catch(ex => { @@ -3223,21 +3284,17 @@ } } if (this.refdatastore.length > 0) { - for (var i = 0; i < this.$data - .refdatastore.length; i++) { + for (var i = 0; i < this.refdatastore.length; i++) { if (!req.filter(function(s) { - return this.$data - .refdatastore[i] + return this.refdatastore[i] .attr == s.name }).length) { length = 1; req.push({ - 'attr': this.$data - .refdatastore[ - i].attr, - 'value': this.$data - .refdatastore[ - i].value + 'attr': this.refdatastore[ + i].attr, + 'value': this.refdatastore[ + i].value }); } } @@ -3327,72 +3384,79 @@ .info : data.info .join('<br/>') : ''; - if (tip) uni - .showModal({ + tip = tip || data.err_info + if (tip) + uni.showModal({ title: this.translateSys('tip'), content: tip, showCancel: false, confirmText: this.translateSys('close') }); - if (data.result) { - var result = data - .result; - for (var i = 0; i < - result.length; i++ - ) { - // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value); - var length = 0; - if (!this.$data - .refdatastore - .filter( - function( - s) { - return result[ - i - ] - .attr == - s - .attr - }).length + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { + var result = data.result || [] + for (var i = 0; i < + result.length; i++ ) { - length = 1; - this.$data - .refdatastore.push( + // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value); + var length = 0; + if (!this.refdatastore + .filter( + function( + s) { + return result[ + i + ] + .attr == + s + .attr + }).length + ) { + length = 1; + this.refdatastore.push( result[ i] ); - } - if (length == 0) { - for (var j = - 0; j < this - .$data - .refdatastore - .length; j++ - ) { - if (this - .$data - .refdatastore[ - j] - .attr == - result[ - i] - .attr + } + if (length == 0) { + for (var j = + 0; j < this + .refdatastore + .length; j++ ) { - this.$data + if (this .refdatastore[ - j - ] - .value = + j] + .attr == result[ - i - ] - .value; + i] + .attr + ) { + this.refdatastore[ + j + ] + .value = + result[ + i + ] + .value; + } } } } - } - this.add(); + this.add(); + + } else if (typeof data.result == 'string') { + if (data.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: data.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } } } @@ -3432,21 +3496,17 @@ } } if (this.refdatastore.length > 0) { - for (var i = 0; i < this.$data - .refdatastore.length; i++) { + for (var i = 0; i < this.refdatastore.length; i++) { if (!req.filter(function(s) { - return this.$data - .refdatastore[i] + return this.refdatastore[i] .attr == s.name }).length) { length = 1; req.push({ - 'attr': this.$data - .refdatastore[ - i].attr, - 'value': this.$data - .refdatastore[ - i].value + 'attr': this.refdatastore[ + i].attr, + 'value': this.refdatastore[ + i].value }); } } @@ -3546,6 +3606,7 @@ .info : data.info .join('<br/>') : ''; + tip = tip || data.err_info if (tip) uni .showModal({ title: this.translateSys('tip'), @@ -3553,13 +3614,21 @@ showCancel: false, confirmText: this.translateSys('close') }); + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - if (data != "") { - var actions = data - .action; - console.log( - actions); - if (actions) { + } 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 actions = data.action || [] for (var i = 0; i < actions @@ -3637,7 +3706,6 @@ robjid: '', userlogin: '', clsid: $this - .$data .param .Master_Cls .ID, @@ -3762,7 +3830,6 @@ param ) { $this - .$data .classAttrList[ param .index @@ -3777,7 +3844,6 @@ ] .Name; $this - .$data .classAttrList[ param .index @@ -3813,7 +3879,6 @@ robjid: "", userlogin: "", clsid: $this - .$data .param .Master_Cls .ID, @@ -3843,15 +3908,20 @@ .show(); } } + + } 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 } - } else { - uni.showModal({ - title: this.translateSys('tip') + "5.2", - content: '璋冪敤 before_click_button 鑴氭湰杩斿洖绌猴紝event_id' + - eventid, - showCancel: false, - confirmText: this.translateSys('close') - }); } } @@ -3926,280 +3996,431 @@ console.log(dataInfo); // return; runCustomEvent(dataInfo).then(data => { - console.log(data); - if (data.ret != 0) { - var tip = data - .err_info ? - typeof data - .err_info == - 'string' ? data - .err_info : data - .err_info.join( - '<br/>') : ''; - if (data.ret == 801) - uni.showModal({ + console.log(data); + if (data.ret != 0) { + var tip = data + .err_info ? + typeof data + .err_info == + 'string' ? data + .err_info : data + .err_info.join( + '<br/>') : ''; + if (data.ret == 801) + uni.showModal({ + title: this.translateSys('tip'), + content: tip, + showCancel: false, + confirmText: this.translateSys('close') + }); + else uni.showModal({ title: this.translateSys('tip'), - content: tip, + content: tip + + ',鎻愮ず:' + + data + .ret, showCancel: false, confirmText: this.translateSys('close') }); - else uni.showModal({ - title: this.translateSys('tip'), - content: tip + - ',鎻愮ず:' + - data - .ret, - showCancel: false, - confirmText: this.translateSys('close') - }); - return false - } else { - var tip = data.info ? - typeof data.info == - 'string' ? data - .info : data.info - .join('<br/>') : - ''; - if (tip) uni - .showModal({ - title: this.translateSys('tip'), - content: tip, - showCancel: false, - confirmText: this.translateSys('close') - }); + return false + } else { + var tip = data.info ? + typeof data.info == + 'string' ? data + .info : data.info + .join('<br/>') : + ''; + tip = tip || data.err_info + if (tip) uni + .showModal({ + title: this.translateSys('tip'), + content: tip, + showCancel: false, + confirmText: this.translateSys('close') + }); + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - var actionlist = data - .action; - if (actionlist) { - for (var j = 0; j < - actionlist - .length; j++) { - var action = - actionlist[ - j] - var action_type = - action - .action_type; - var value = - action - .value; - if (action_type == - 'set_dlg_attr' - ) { - if (value) { - var val = value; - if (typeof value == 'string') { - val = JSON.parse(value); - } - console.log(val); - for (var i = 0; i < val.length; i++) { - for (var a = 0; a < this.$data.subClassAttrList.length; a++) { - for ( - var l = - 0; l < - this - .$data - .subClassAttrList[ - a - ] - .Attr - .length; l++ - ) { - var ca = - this - .$data - .subClassAttrList[ - a - ] - .Attr[ - l - ]; - if (val[ - i] - .attr == - ca - .Name - ) { - if (utils.classUtils.attrTypeIsDict(ca.Type)) { - var - dictItemList = []; - for ( - var d in - val[ - i] - .choice_list - ) { - var val = - val[ - i] - .choice_list[ - d - ]; - dictItemList - .push({ - "CN_S_NAME": val, - "CN_S_VALUE": val, - "Name": val, - "label": val, - "value": val - }); + } 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 || [] + for (var j = 0; j < actionlist.length; j++) { + var action = actionlist[j] + var action_type = action.action_type; + var value = action.value; + if (action_type == 'set_dlg_attr') { + if (value) { + var val = value; + if (typeof value == 'string') { + val = JSON.parse(value); + } + console.log(val); + + for (var i = 0; i < val.length; i++) { + for (var a = 0; a < this.subClassAttrList.length; a++) { + for (var l = 0; l < this.subClassAttrList[a].Attr + .length; l++) { + var ca = this.subClassAttrList[a].Attr[l]; + if (val[i].attr == .Name) { + if (utils.classUtils.attrTypeIsDict(ca.Type)) { + var dictItemList = []; + for (var d in val[i].choice_list) { + var val = val[i].choice_list[d]; + dictItemList.push({ + "CN_S_NAME": val, + "CN_S_VALUE": val, + "Name": val, + "label": val, + "value": val + }); + + } + ca.dictitem = dictItemList; + } } - ca.dictitem = - dictItemList; - // attr[j].dictitem = val[i].choice_list; - } else { - // ca.value = val[i].value; } } } } - } } - } - if (action_type == - 'open_select_userdlg' - ) { + } 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('error') + " 6.2", - content: "open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�, + title: this.translateSys('tip'), + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } } } } }).catch(ex => { - // console.log(ex); - uni.showModal({ - title: this.translateSys('error') + " 6.1", - content: ex.errMsg, - showCancel: false, - confirmText: this.translateSys('close') - }); + // console.log(ex); + uni.showModal({ + title: this.translateSys('error') + " 6.1", + content: ex.errMsg, + showCancel: false, + confirmText: this.translateSys('close') }); - }, - scan_DataObjRunCustomEvent(info, data_attr) { - var $this = this; - var obj_attr = {}; - info.attr.forEach(item => { - obj_attr[item.attr] = item - .value; - }); - var enviroment = {}; - if (info.enviroment) { - enviroment = info.enviroment; - } else { - enviroment = { - 'function': '3000', // 鍔熻兘鐐圭紪鍙�- cls_id: 'MBOX', //this.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�- 'button': 'top', // top/bottom - button_name: '鏂板', - edit_dlg: { - type: 'small', //灏忕獥鍙�- class_id: 'MBOX', //this.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d - }, - master: { - cls_id: info - .clsid, // button=bottom鏃�master鐨刢ls_id - //obj_id: '' // button=bottom鏃�master鐨刼bj_id - obj_attrs: obj_attr, - } - }; - - } - var global_attr = this.global_attr; - if (info.global_attr) { - global_attr = info.global_attr; - } - - enviroment = Base64.encode(JSON.stringify( - enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var inputParamter = info.inputParamter; - if (info.inputParamter) { - info.inputParamter = Base64.encode(JSON - .stringify(info.inputParamter) - ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - } - var global_attr = Base64.encode(JSON - .stringify(this.global_attr) - ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - - if (!info.eventid.includes('{')) info - .eventid = '{' + info.eventid + '}'; - var dataInfo = { - ed_type: info.edtype, - start_transaction: '', - class_id: info.clsid, - class_name: '', - event_id: info.eventid, - event_name: '', - data_obj_id: info.objid, - obj_attr: obj_attr, - prj_id: info.projectid.replace('{', - '').replace('}', ''), - ref_cls_id: info.rclsid, - rel_obj_id: info.robjid, - user_login: info.userlogin, - data_json: '', - compose_info: '', - ext_info: enviroment, - global_attr: global_attr, - input_param: info.inputParamter, + }); + }, + scan_DataObjRunCustomEvent(info, data_attr) { + var $this = this; + var obj_attr = {}; + info.attr.forEach(item => { + obj_attr[item.attr] = item + .value; + }); + var enviroment = {}; + if (info.enviroment) { + enviroment = info.enviroment; + } else { + enviroment = { + 'function': '3000', // 鍔熻兘鐐圭紪鍙�+ cls_id: 'MBOX', //this.param.Sub_Cls.ID, // 鍔熻兘鐐逛粠鏁版嵁绫绘爣璇�+ 'button': 'top', // top/bottom + button_name: '鏂板', + edit_dlg: { + type: 'small', //灏忕獥鍙�+ class_id: 'MBOX', //this.param.Sub_Cls.ID,//褰撳墠鏁版嵁绫籭d + }, + master: { + cls_id: info + .clsid, // button=bottom鏃�master鐨刢ls_id + //obj_id: '' // button=bottom鏃�master鐨刼bj_id + obj_attrs: obj_attr, + } }; - console.log(dataInfo); - // return; - runCustomEvent(dataInfo).then(data => { - console.log(data); - if (data.ret != 0) { - var tip = data - .err_info ? - typeof data - .err_info == - 'string' ? data - .err_info : data - .err_info.join( - '<br/>') : ''; - if (data.ret == 801) - uni.showModal({ - title: this.translateSys('tip'), - content: tip, - showCancel: false, - confirmText: this.translateSys('close') - }); - else uni.showModal({ + + } + var global_attr = this.global_attr; + if (info.global_attr) { + global_attr = info.global_attr; + } + + enviroment = Base64.encode(JSON.stringify( + enviroment)); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var inputParamter = info.inputParamter; + if (info.inputParamter) { + info.inputParamter = Base64.encode(JSON + .stringify(info.inputParamter) + ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + } + var global_attr = Base64.encode(JSON + .stringify(this.global_attr) + ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + + if (!info.eventid.includes('{')) info + .eventid = '{' + info.eventid + '}'; + var dataInfo = { + ed_type: info.edtype, + start_transaction: '', + class_id: info.clsid, + class_name: '', + event_id: info.eventid, + event_name: '', + data_obj_id: info.objid, + obj_attr: obj_attr, + prj_id: info.projectid.replace('{', + '').replace('}', ''), + ref_cls_id: info.rclsid, + rel_obj_id: info.robjid, + user_login: info.userlogin, + data_json: '', + compose_info: '', + ext_info: enviroment, + global_attr: global_attr, + input_param: info.inputParamter, + }; + console.log(dataInfo); + // return; + runCustomEvent(dataInfo).then(data => { + console.log(data); + if (data.ret != 0) { + var tip = data + .err_info ? + typeof data + .err_info == + 'string' ? data + .err_info : data + .err_info.join( + '<br/>') : ''; + if (data.ret == 801) + uni.showModal({ title: this.translateSys('tip'), - content: tip + - ',鎻愮ず:' + - data - .ret, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); - return false - } else { - var tip = data.info ? - typeof data.info == - 'string' ? data - .info : data.info - .join('<br/>') : - ''; - if (tip) uni - .showModal({ - title: this.translateSys('tip'), - content: tip, - showCancel: false, - confirmText: this.translateSys('close') - }); + else uni.showModal({ + title: this.translateSys('tip'), + content: tip + + ',鎻愮ず:' + + data + .ret, + showCancel: false, + confirmText: this.translateSys('close') + }); + return false + } else { + var tip = data.info ? + typeof data.info == + 'string' ? data + .info : data.info + .join('<br/>') : + ''; + tip = tip || data.err_info + if (tip) + uni.showModal({ + title: this.translateSys('tip'), + content: tip, + showCancel: false, + confirmText: this.translateSys('close') + }); + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { + if (data.result) { + var list_1 = JSON + .parse(JSON + .stringify( + this.subClassAttrList + )); + var scanCodeVal = + $this.scanCodeVal; + var rand = ''; + for (var i = 0; i < + 5; i++ + ) { //鐢熸垚5浣嶉殢鏈烘暟 + rand += Math + .floor(Math + .random() * + 10); + } + if (inputParamter[ + 0].attr) { + if (inputParamter[ + 0] + .attr == + "mast_input_3037" + ) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�+ scanCodeVal = + "mast_input_3037-" + + rand; + } + if (info.attr[0] + .attr) { + if (info.attr[ + 0] + .attr == + "mast_input_3037" + ) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�+ scanCodeVal = + "mast_input_3037-" + + rand; + } + $this.subPanelList + .push({ + scanCodeVal: scanCodeVal, + subClassAttr: list_1 + }); + var result = data + .result; + for (var i = 0; i < + result + .length; i++) { + for (var s = + 0; s < + $this.subPanelList + .length; s++ + ) { + if ($this.subPanelList[ + s] + .scanCodeVal == + scanCodeVal + ) { + if (result[ + i + ] + .attr == + "S_ID" + ) + $this.subPanelList[ + s + ] + .ObjID = + result[ + i + ] + .value; + var _subClassAttr = + $this.subPanelList[ + s + ] + .subClassAttr; + for ( + var c = + 0; c < + _subClassAttr + .length; c++ + ) { + var attr = + _subClassAttr[ + c + ] + .Attr; + for ( + var j = + 0; j < + attr + .length; j++ + ) { + // console.log(attr[j].Name+'=='+result[i].attr); + if (attr[ + j + ] + .Name == + result[ + i + ] + .attr + ) { + attr[ + j] + .Value = + result[ + i + ] + .value; + } + } + } + } + } - var actionlist = data - .action; - if (actionlist) { - console.log( - actionlist); + var length = 0; + if (!$this.refdatastore + .filter( + function( + s + ) { + return result[ + i + ] + .attr == + s + .attr + }) + .length) { + length = 1; + $this.refdatastore + .push( + result[ + i + ] + ); + } + if (length == + 0) { + for (var j = + 0; j < + $this + .refdatastore + .length; j++ + ) { + if ($this + .refdatastore[ + j + ] + .attr == + result[ + i + ] + .attr + ) { + $this + .refdatastore[ + j + ] + .value = + result[ + i + ] + .value; + } + } + } + } + } + + } 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 || [] for (var ii = 0; ii < actionlist @@ -4228,26 +4449,13 @@ for ( var s = 0; s < - $this - .$data - .subPanelList + $this.subPanelList .length; s++ ) { - for ( - var c = - 0; c < - $this - .$data - .subPanelList[ - s - ] - .subClassAttrList - .length; c++ - ) { + for (var c = 0; c < $this.subPanelList[s].subClassAttrList + .length; c++) { var attr = - $this - .$data - .subPanelList[ + $this.subPanelList[ s ] .subClassAttrList[ @@ -4311,7 +4519,6 @@ var s = 0; s < $this - .$data .subPanelList .length; s++ ) { @@ -4319,7 +4526,6 @@ var c = 0; c < $this - .$data .subPanelList[ s ] @@ -4328,7 +4534,6 @@ ) { var attr = $this - .$data .subPanelList[ s ] @@ -4374,7 +4579,7 @@ } } } - } + } } else if ( action .action_type == @@ -4396,9 +4601,7 @@ .common_dlg_id == 'check_list' ) { - $this - .$data - .check_list = + $this.check_list = action .value .config; @@ -4409,13 +4612,10 @@ 'sideslip' ) //鍒ゆ柇鏄惁鏄晶婊� $this - .$data .popupType = 'right'; else - $this - .$data - .popupType = + $this.popupType = 'center' // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� $this @@ -4423,7 +4623,6 @@ .popup .open( $this - .$data .popupType ); } @@ -4442,15 +4641,11 @@ .parse( JSON .stringify( - this - .$data - .subClassAttrList + this.subClassAttrList ) ); var scanCodeVal = - $this - .$data - .scanCodeVal; + $this.scanCodeVal; var rand = ''; for (var i = @@ -4495,8 +4690,7 @@ "mast_input_3037-" + rand; } - $this.$data - .subPanelList + $this.subPanelList .push({ scanCodeVal: scanCodeVal, subClassAttr: list_1 @@ -4509,14 +4703,10 @@ for ( var s = 0; s < - $this - .$data - .subPanelList + $this.subPanelList .length; s++ ) { - if ($this - .$data - .subPanelList[ + if ($this.subPanelList[ s ] .scanCodeVal == @@ -4528,9 +4718,7 @@ .attr == "S_ID" ) - $this - .$data - .subPanelList[ + $this.subPanelList[ s ] .ObjID = @@ -4539,9 +4727,7 @@ ] .value; var _subClassAttr = - $this - .$data - .subPanelList[ + $this.subPanelList[ s ] .subClassAttr; @@ -4590,9 +4776,7 @@ var length = 0; if (! - $this - .$data - .refdatastore + $this.refdatastore .filter( function( s @@ -4610,9 +4794,7 @@ length = 1; - $this - .$data - .refdatastore + $this.refdatastore .push( result[ i @@ -4625,14 +4807,10 @@ for ( var j = 0; j < - $this - .$data - .refdatastore + $this.refdatastore .length; j++ ) { - if ($this - .$data - .refdatastore[ + if ($this.refdatastore[ j ] .attr == @@ -4641,9 +4819,7 @@ ] .attr ) { - $this - .$data - .refdatastore[ + $this.refdatastore[ j ] .value = @@ -4657,244 +4833,125 @@ } } } - } - if (data.result) { - var list_1 = JSON - .parse(JSON - .stringify( - this - .$data - .subClassAttrList - )); - var scanCodeVal = - $this.$data - .scanCodeVal; - var rand = ''; - for (var i = 0; i < - 5; i++ - ) { //鐢熸垚5浣嶉殢鏈烘暟 - rand += Math - .floor(Math - .random() * - 10); - } - if (inputParamter[ - 0].attr) { - if (inputParamter[ - 0] - .attr == - "mast_input_3037" - ) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�- scanCodeVal = - "mast_input_3037-" + - rand; - } - if (info.attr[0] - .attr) { - if (info.attr[ - 0] - .attr == - "mast_input_3037" - ) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�- scanCodeVal = - "mast_input_3037-" + - rand; - } - $this.$data - .subPanelList - .push({ - scanCodeVal: scanCodeVal, - subClassAttr: list_1 - }); - var result = data - .result; - for (var i = 0; i < - result - .length; i++) { - for (var s = - 0; s < - $this.$data - .subPanelList - .length; s++ - ) { - if ($this - .$data - .subPanelList[ - s] - .scanCodeVal == - scanCodeVal - ) { - if (result[ - i - ] - .attr == - "S_ID" - ) - $this - .$data - .subPanelList[ - s - ] - .ObjID = - result[ - i - ] - .value; - var _subClassAttr = - $this - .$data - .subPanelList[ - s - ] - .subClassAttr; - for ( - var c = - 0; c < - _subClassAttr - .length; c++ - ) { - var attr = - _subClassAttr[ - c - ] - .Attr; - for ( - var j = - 0; j < - attr - .length; j++ - ) { - // console.log(attr[j].Name+'=='+result[i].attr); - if (attr[ - j - ] - .Name == - result[ - i - ] - .attr - ) { - attr[ - j] - .Value = - result[ - i - ] - .value; - } - } - } - } - } - - var length = 0; - if (!$this - .$data - .refdatastore - .filter( - function( - s - ) { - return result[ - i - ] - .attr == - s - .attr - }) - .length) { - length = 1; - $this.$data - .refdatastore - .push( - result[ - i - ] - ); - } - if (length == - 0) { - for (var j = - 0; j < - $this - .$data - .refdatastore - .length; j++ - ) { - if ($this - .$data - .refdatastore[ - j - ] - .attr == - result[ - i - ] - .attr - ) { - $this - .$data - .refdatastore[ - j - ] - .value = - result[ - i - ] - .value; - } - } - } - } + } 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 } } - }).catch(ex => { - // console.log(ex); - uni.showModal({ - title: this.translateSys('error') + " 7.1", - content: ex.errMsg, - showCancel: false, - confirmText: this.translateSys('close') - }); + } + + }).catch(ex => { + // console.log(ex); + uni.showModal({ + title: this.translateSys('error') + " 7.1", + content: ex.errMsg, + showCancel: false, + confirmText: this.translateSys('close') }); - }, - scan_OKDataObjRunCustomEvent(eventID) { - uni.showLoading({ - title: "鍔犺浇涓�..", - mask: true - }); - var $this = this; - var req = []; - var attrlist = $this.classAttrList; - for (var i = 0; i < attrlist.length; i++) { - var attr = attrlist[i].Attr; - for (var j = 0; j < attr.length; j++) { + }); + }, + scan_OKDataObjRunCustomEvent(eventID) { + uni.showLoading({ + title: "鍔犺浇涓�..", + mask: true + }); + var $this = this; + var req = []; + var attrlist = $this.classAttrList; + for (var i = 0; i < attrlist.length; i++) { + var attr = attrlist[i].Attr; + for (var j = 0; j < attr.length; j++) { + var ar = attr[j]; + if (ar.Value == '璇烽�鎷� || ar + .Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = + ''; + if (utils.classUtils.attrTypeIsDict(ar.Type)) { + if (ar.select == + true) { //鍒ゆ柇涓嬫媺鏄惁澶氶� + var valStr = ""; + for (var v in ar.Value) { + if (valStr) + valStr += ";"; + valStr += ar.Value[v]; + } + req.push({ + attr: ar.Name, + value: valStr + }); + } else + req.push({ + attr: ar.Name, + value: ar.Value + }); + } else + req.push(this.formatAttr(ar)); + + if (ar.notempty == true && !ar + .Value) { + // if(ar.NotEmpty=='1'){ + uni.hideLoading(); + // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000}); + uni.showModal({ + title: this.translateSys('tip') + "", + content: ar + .DispName + + '涓嶈兘涓虹┖锛�, + showCancel: false, + confirmText: this.translateSys('close') + }); + return; + } + } + } + var objects = []; + var subPanelList = $this.subPanelList; + for (var s = 0; s < subPanelList + .length; s++) { + var sub_req = []; + for (var i = 0; i < subPanelList[s] + .subClassAttr.length; i++) { + var attr = subPanelList[s] + .subClassAttr[i].Attr; + for (var j = 0; j < attr + .length; j++) { var ar = attr[j]; if (ar.Value == '璇烽�鎷� || ar - .Value == '鈥斺�璇烽�鎷┾�鈥�) ar.Value = - ''; + .Value == '鈥斺�璇烽�鎷┾�鈥�) ar + .Value = ''; if (utils.classUtils.attrTypeIsDict(ar.Type)) { if (ar.select == true) { //鍒ゆ柇涓嬫媺鏄惁澶氶� var valStr = ""; - for (var v in ar.Value) { + for (var v in ar + .Value) { if (valStr) valStr += ";"; - valStr += ar.Value[v]; + valStr += ar.Value[ + v]; } - req.push({ - attr: ar.Name, + sub_req.push({ + attr: ar + .Name, value: valStr }); } else - req.push({ + sub_req.push({ attr: ar.Name, value: ar.Value }); } else - req.push(this.formatAttr(ar)); + sub_req.push(this.formatAttr(ar)); if (ar.notempty == true && !ar .Value) { @@ -4913,233 +4970,167 @@ } } } - var objects = []; - var subPanelList = $this.$data - .subPanelList; - for (var s = 0; s < subPanelList - .length; s++) { - var sub_req = []; - for (var i = 0; i < subPanelList[s] - .subClassAttr.length; i++) { - var attr = subPanelList[s] - .subClassAttr[i].Attr; - for (var j = 0; j < attr - .length; j++) { - var ar = attr[j]; - if (ar.Value == '璇烽�鎷� || ar - .Value == '鈥斺�璇烽�鎷┾�鈥�) ar - .Value = ''; - if (utils.classUtils.attrTypeIsDict(ar.Type)) { - if (ar.select == - true) { //鍒ゆ柇涓嬫媺鏄惁澶氶� - var valStr = ""; - for (var v in ar - .Value) { - if (valStr) - valStr += ";"; - valStr += ar.Value[ - v]; - } - sub_req.push({ - attr: ar - .Name, - value: valStr - }); - } else - sub_req.push({ - attr: ar.Name, - value: ar.Value - }); - } else - sub_req.push(this.formatAttr(ar)); - - if (ar.notempty == true && !ar - .Value) { - // if(ar.NotEmpty=='1'){ - uni.hideLoading(); - // uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000}); - uni.showModal({ - title: this.translateSys('tip') + "", - content: ar - .DispName + - '涓嶈兘涓虹┖锛�, - showCancel: false, - confirmText: this.translateSys('close') - }); - return; - } - } - } - objects.push({ - obj_id: subPanelList[s] - .scanCodeVal, - obj_attrs: sub_req - }); + objects.push({ + obj_id: subPanelList[s] + .scanCodeVal, + obj_attrs: sub_req + }); + } + var dataJson = { + master_cls: { + cls_name: 'MBOX', //$this.param.Master_Cls.Name, + obj_attrs: req + }, + input_3037: $this.scanCodeVal, //鎵爜鍐呭 + op_type: $this.param + .OperationType, //浣滀笟绫诲瀷瀹氫箟 + sub_cls: { + cls_name: 'MBOX', //$this.param.Sub_Cls.Name, + objects: objects } - var dataJson = { - master_cls: { - cls_name: 'MBOX', //$this.param.Master_Cls.Name, - obj_attrs: req - }, - input_3037: $this.$data - .scanCodeVal, //鎵爜鍐呭 - op_type: $this.param - .OperationType, //浣滀笟绫诲瀷瀹氫箟 - sub_cls: { - cls_name: 'MBOX', //$this.param.Sub_Cls.Name, - objects: objects - } - }; - // console.log(JSON.stringify(dataJson)); - // var dataInfo = { - // edtype: "7", eventid: eventID, projectid: '',rclsid: '', robjid: '', userlogin: '', - // clsid: 'MBOX', objid: '',attr: JSON.stringify([]), extinfo: JSON.stringify([]), - // global_attr: JSON.stringify($this.global_attr),dataJson:JSON.stringify(dataJson) - // } - // console.log(JSON.stringify(dataInfo)); - var dataJson = Base64.encode(JSON - .stringify(dataJson) - ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - var global_attr = Base64.encode(JSON - .stringify(this.global_attr) - ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 - if (!eventID.includes('{')) eventID = '{' + - eventID + '}'; - var dataInfo = { - ed_type: "7", - start_transaction: '', - class_id: 'MBOX', - class_name: '', - event_id: eventID, - event_name: '', - data_obj_id: '', - obj_attr: '', - prj_id: '', - ref_cls_id: '', - rel_obj_id: '', - user_login: '', - data_json: dataJson, - compose_info: '', - ext_info: '', - global_attr: global_attr, - input_param: '', - }; - console.log(dataInfo); - // return; - runCustomEvent(dataInfo).then(data => { - console.log(data); - uni.hideLoading(); - if (data.ret != 0) { - var tip = data - .err_info ? - typeof data - .err_info == - 'string' ? data - .err_info : data - .err_info.join( - '<br/>') : ''; - if (data.ret == 801) - uni.showModal({ - title: this.translateSys('tip'), - content: tip, - showCancel: false, - confirmText: this.translateSys('close') - }); - else uni.showModal({ + }; + // console.log(JSON.stringify(dataJson)); + // var dataInfo = { + // edtype: "7", eventid: eventID, projectid: '',rclsid: '', robjid: '', userlogin: '', + // clsid: 'MBOX', objid: '',attr: JSON.stringify([]), extinfo: JSON.stringify([]), + // global_attr: JSON.stringify($this.global_attr),dataJson:JSON.stringify(dataJson) + // } + // console.log(JSON.stringify(dataInfo)); + var dataJson = Base64.encode(JSON + .stringify(dataJson) + ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + var global_attr = Base64.encode(JSON + .stringify(this.global_attr) + ); //灏嗗瓧绗︿覆杞崲涓篵ase64缂栫爜 + if (!eventID.includes('{')) eventID = '{' + + eventID + '}'; + var dataInfo = { + ed_type: "7", + start_transaction: '', + class_id: 'MBOX', + class_name: '', + event_id: eventID, + event_name: '', + data_obj_id: '', + obj_attr: '', + prj_id: '', + ref_cls_id: '', + rel_obj_id: '', + user_login: '', + data_json: dataJson, + compose_info: '', + ext_info: '', + global_attr: global_attr, + input_param: '', + }; + console.log(dataInfo); + // return; + runCustomEvent(dataInfo).then(data => { + console.log(data); + uni.hideLoading(); + if (data.ret != 0) { + var tip = data + .err_info ? + typeof data + .err_info == + 'string' ? data + .err_info : data + .err_info.join( + '<br/>') : ''; + if (data.ret == 801) + uni.showModal({ title: this.translateSys('tip'), - content: tip + - ',鎻愮ず:' + - data - .ret, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); - return false - } else { - var tip = data.info ? - typeof data.info == - 'string' ? data - .info : data.info - .join('<br/>') : - ''; - if (tip) uni - .showModal({ - title: this.translateSys('tip'), - content: tip, - showCancel: false, - confirmText: this.translateSys('close') - }); - - var result = data - .result; - if (eventID != $this - .$data.param - .After_OK_Event.ID) - $this - .scan_OKDataObjRunCustomEvent( - $this.$data - .param - .After_OK_Event - .ID); - else { - //鍒锋柊 - uni.redirectTo({ - url: '../modal/3037?param=' + - JSON - .stringify( - $this - .$data - .param - ) + - "&titlename=" + - $this - .$data - .title - }); - } - } - - }).catch(ex => { - // console.log(ex); - uni.hideLoading(); - uni.showModal({ - title: this.translateSys('error') + " 8.1", - content: ex.errMsg, + else uni.showModal({ + title: this.translateSys('tip'), + content: tip + + ',鎻愮ず:' + + data + .ret, showCancel: false, confirmText: this.translateSys('close') }); - }); - }, + return false + } else { + var tip = data.info ? + typeof data.info == + 'string' ? data + .info : data.info + .join('<br/>') : + ''; + tip = tip || data.err_info + if (tip) + uni.showModal({ + title: this.translateSys('tip'), + content: tip, + showCancel: false, + confirmText: this.translateSys('close') + }); - formatAttr(attr) { - if (utils.classUtils.attrTypeIsObjRefMulti(attr.Type)) //if(ar.Type=='寮曠敤瀵硅薄(澶氫釜)') - if (attr.Value == '璇�) ar.Value = ''; - if (utils.classUtils.attrTypeIsUser(attr.Type) || utils.classUtils.attrTypeIsProject(attr - .Type)) //if(ar.Type=='寮曠敤浜哄憳' || ar.Type=='寮曠敤椤圭洰') - return { - attr: attr.Name, - value: attr.ValID ? attr.ValID : '' - }; - else if (utils.classUtils.attrTypeIsBool(attr.Type)) //if(ar.Type=='甯冨皵鍊�) - return { - attr: attr.Name, - value: attr.Value ? '1' : '0' - }; - else - return { - attr: attr.Name, - value: attr.Value ? attr.Value : '' - }; - }, - translate(t) { - if (typeof this.$t == "function") return this.$t(`page.${t}`) - else return t; - }, - translateSys(t) { - if (typeof this.$t == "function") return this.$t(`sys.${t}`) - else return t; - }, - } + // var result = data.result; + if (eventID != $this.param.After_OK_Event.ID) + $this.scan_OKDataObjRunCustomEvent( + $this.param + .After_OK_Event + .ID); + else { + //鍒锋柊 + uni.redirectTo({ + url: '../modal/3037?param=' + + JSON + .stringify( + $this.param + ) + + "&titlename=" + + $this.title + }); + } + } + + }).catch(ex => { + // console.log(ex); + uni.hideLoading(); + uni.showModal({ + title: this.translateSys('error') + " 8.1", + content: ex.errMsg, + showCancel: false, + confirmText: this.translateSys('close') + }); + }); + }, + + formatAttr(attr) { + if (utils.classUtils.attrTypeIsObjRefMulti(attr.Type)) //if(ar.Type=='寮曠敤瀵硅薄(澶氫釜)') + if (attr.Value == '璇�) ar.Value = ''; + if (utils.classUtils.attrTypeIsUser(attr.Type) || utils.classUtils.attrTypeIsProject(attr + .Type)) //if(ar.Type=='寮曠敤浜哄憳' || ar.Type=='寮曠敤椤圭洰') + return { + attr: attr.Name, + value: attr.ValID ? attr.ValID : '' + }; + else if (utils.classUtils.attrTypeIsBool(attr.Type)) //if(ar.Type=='甯冨皵鍊�) + return { + attr: attr.Name, + value: attr.Value ? '1' : '0' + }; + else + return { + attr: attr.Name, + value: attr.Value ? attr.Value : '' + }; + }, + translate(t) { + if (typeof this.$t == "function") return this.$t(`page.${t}`) + else return t; + }, + translateSys(t) { + if (typeof this.$t == "function") return this.$t(`sys.${t}`) + else return t; + }, + } } </script> <style> -- Gitblit v1.9.1