From fa73abee6209cd6f7c62c61c271826f7d413035d Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期五, 01 八月 2025 11:32:17 +0800 Subject: [PATCH] event result_type --- pages/modal/3018_2.vue | 873 +++--- pages/modal/3018.vue | 637 ++-- pages/modal/3200_view.vue | 94 pages/modal/5601.vue | 1182 ++++---- pages/modal/3037_2.vue | 1277 ++++---- pages/modal/3202.vue | 298 +- pages/modal/3037.vue | 2517 +++++++++--------- pages/modal/3200.vue | 371 +- pages/modal/3202_view.vue | 110 pages/modal/form/index.vue | 690 ++-- pages/modal/3201.vue | 61 11 files changed, 4,087 insertions(+), 4,023 deletions(-) diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue index 5701d19..6ce37fb 100644 --- a/pages/modal/3018.vue +++ b/pages/modal/3018.vue @@ -1706,61 +1706,62 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } 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) { - this.setFormValues(value) - } - } - if (action_type == 'open_select_userdlg') { + } else if (typeof data.result == 'string') { + if (data.result) { uni.showModal({ - title: this.translateSys('error') + " 2.2", - content: this.translateSys( - "quotation_mark_left") + - action_type + this.translateSys( - "quotation_mark_right") + this - .translate( - "tip_action_unprocessed"), + title: this.translateSys('tip'), + content: data.result, showCancel: false, confirmText: this.translateSys('close') }); } - // else if (action_type == 'tip_dlg') { - - // } } + 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) { + this.setFormValues(value) + } + } + if (action_type == 'open_select_userdlg') { + uni.showModal({ + title: this.translateSys('error') + " 2.2", + content: this.translateSys( + "quotation_mark_left") + + action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed"), + showCancel: false, + confirmText: this.translateSys('close') + }); + } + // else if (action_type == 'tip_dlg') { - } 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) { + 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 => { @@ -1877,74 +1878,75 @@ showCancel: false, confirmText: this.translateSys('close') }); - 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++) { - 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; + 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++) { + 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; + } + } + } + console.log($this.refdatastore) + 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; + } } } } - console.log($this.refdatastore) - 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') + }); } } - - } else if (typeof data.result == 'string') { - if (data.result) { + try { + 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; + this.setFormValues(action.value) + } else if (data.action[i].action_type == 'set_global_attr') { + $this.global_attr = data.action[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: data.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } } - try { - 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; - this.setFormValues(action.value) - } else if (data.action[i].action_type == 'set_global_attr') { - $this.global_attr = data.action[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 => { @@ -2070,40 +2072,42 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { - var result = data.result || []; - console.log(this.refdatastore) - 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.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; + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { + var result = data.result || []; + console.log(this.refdatastore) + 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.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') + }); + } } - } else if (typeof data.result == 'string') { - if (data.result) { - uni.showModal({ - title: this.translateSys('tip'), - content: data.result, - showCancel: false, - confirmText: this.translateSys('close') - }); - } + + this.add(); } - - - this.add(); } }).catch(ex => { @@ -2246,213 +2250,214 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } else if (typeof data.result == 'string') { - if (data.result) { - uni.showModal({ - title: this.translateSys('tip'), - content: data.result, - showCancel: false, - confirmText: this.translateSys('close') - }); + } 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.length; i++) { - var action = actions[i]; - var val = action.value; - var enviroment = JSON.stringify(enviroment); + try { + var actions = data.action || [] + for (var i = 0; i < actions.length; i++) { + var action = actions[i]; + var val = action.value; + var enviroment = JSON.stringify(enviroment); - if (action.action_type == 'open_panel') { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - this.translateSys('tip'), - content: this.translateSys( - "quotation_mark_left") + - action - .action_type + this.translateSys( - "quotation_mark_right") + this - .translate( - "tip_action_unprocessed") - }); - d.show(); - } else if (action.action_type == 'open_select_userdlg') { - var style = val.style; - // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' - var $this = this; - var param = { - index: index, - iindex: iindex, - button_callback: button_callback, - req: req, - data_attr: data_attr - } - uni.navigateTo({ - url: '../selpsn/index?mulit=false¶m=' + - JSON - .stringify( - param), - events: { - AddPer(data, param) { - // console.log(param); - console.log(data); - var callback_eventid = param - .button_callback - .trim(); - var info = { - eventid: callback_eventid, - edtype: "0", - projectid: '', - rclsid: '', - robjid: '', - userlogin: '', - clsid: $this.param - .clsid, - objid: "", - attr: param.req, - inputparameter: data, - dataJson: [], - } - $this.DataObjRunCustomEvent(info, - param - .data_attr); - } - } - }); - } else if (action.action_type == 'open_data_query_dlg') { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - this.translateSys('tip'), - content: this.translateSys( - "quotation_mark_left") + - action - .action_type + this.translateSys( - "quotation_mark_right") + this - .translate( - "tip_action_unprocessed") - }); - d.show(); - } else if (action.action_type == 'open_common_dlg') { - var $this = this; - if (val.common_dlg_id == 'check_list') { - $this.check_list = val.config; - if (val.config.appear_style == - 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.popupType = 'right'; - else - $this.popupType = 'center' - // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this.$refs.popup.open($this.popupType); - var popupParam = { + if (action.action_type == 'open_panel') { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + this.translateSys('tip'), + content: this.translateSys( + "quotation_mark_left") + + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed") + }); + d.show(); + } else if (action.action_type == 'open_select_userdlg') { + var style = val.style; + // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' + var $this = this; + var param = { index: index, iindex: iindex, button_callback: button_callback, req: req, data_attr: data_attr } - $this.popupParam = popupParam; - } - } else if (action.action_type == - 'open_project_query_dlg') { - //console.log(action.value.select_range); - //console.log(action.value.mulit_select); - var priRel = '-1'; - if (action.value.select_range == '鍏ㄩ儴鐩稿叧') - priRel = '0'; - else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰') - priRel = '1'; - else if (action.value.select_range == '鎴戝垱寤虹殑') - priRel = '2'; - else if (action.value.select_range == '鎴戝弬涓庣殑' || action - .value - .select_range == '鎴戝弬鍔犵殑') - priRel = '3'; - else if (action.value.select_range == '鎴戝叧娉ㄧ殑') - priRel = '4'; - else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰') - priRel = '5'; - - var $this = this; - var param_ = { - index: index, - iindex: iindex, - button_callback: button_callback, - req: req - } - uni.navigateTo({ - url: '../selPrj/index?relation=' + priRel + - '¶m=' + - JSON.stringify(param_), - events: { - AddPer(data, param) { - $this.classAttrList[param - .index] - .Attr[param - .iindex].Value = data[0] - .Name; - $this.classAttrList[param - .index] - .Attr[param - .iindex].ValID = data[0] - .ID + ';' + - data[0] - .Name; - var callback_eventid = param - .button_callback - .trim(); - if (callback_eventid) { + uni.navigateTo({ + url: '../selpsn/index?mulit=false¶m=' + + JSON + .stringify( + param), + events: { + AddPer(data, param) { + // console.log(param); + console.log(data); + var callback_eventid = param + .button_callback + .trim(); var info = { eventid: callback_eventid, - edtype: "2", - projectid: data[0].ID, - rclsid: "", - robjid: "", - userlogin: "", - clsid: $this.$data - .param.clsid, + edtype: "0", + projectid: '', + rclsid: '', + robjid: '', + userlogin: '', + clsid: $this.param + .clsid, objid: "", attr: param.req, + inputparameter: data, dataJson: [], } - - $this.DataObjRunCustomEvent( - info); + $this.DataObjRunCustomEvent(info, + param + .data_attr); } } + }); + } else if (action.action_type == 'open_data_query_dlg') { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + this.translateSys('tip'), + content: this.translateSys( + "quotation_mark_left") + + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed") + }); + d.show(); + } else if (action.action_type == 'open_common_dlg') { + var $this = this; + if (val.common_dlg_id == 'check_list') { + $this.check_list = val.config; + if (val.config.appear_style == + 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ $this.popupType = 'right'; + else + $this.popupType = 'center' + // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� + $this.$refs.popup.open($this.popupType); + var popupParam = { + index: index, + iindex: iindex, + button_callback: button_callback, + req: req, + data_attr: data_attr + } + $this.popupParam = popupParam; } - }); - } else { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - this.translateSys('tip'), - content: this.translateSys( - "quotation_mark_left") + - action - .action_type + this.translateSys( - "quotation_mark_right") + this - .translate( - "tip_action_unprocessed") - }); - d.show(); + } else if (action.action_type == + 'open_project_query_dlg') { + //console.log(action.value.select_range); + //console.log(action.value.mulit_select); + var priRel = '-1'; + if (action.value.select_range == '鍏ㄩ儴鐩稿叧') + priRel = '0'; + else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰') + priRel = '1'; + else if (action.value.select_range == '鎴戝垱寤虹殑') + priRel = '2'; + else if (action.value.select_range == '鎴戝弬涓庣殑' || action + .value + .select_range == '鎴戝弬鍔犵殑') + priRel = '3'; + else if (action.value.select_range == '鎴戝叧娉ㄧ殑') + priRel = '4'; + else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰') + priRel = '5'; + + var $this = this; + var param_ = { + index: index, + iindex: iindex, + button_callback: button_callback, + req: req + } + uni.navigateTo({ + url: '../selPrj/index?relation=' + priRel + + '¶m=' + + JSON.stringify(param_), + events: { + AddPer(data, param) { + $this.classAttrList[param + .index] + .Attr[param + .iindex].Value = data[0] + .Name; + $this.classAttrList[param + .index] + .Attr[param + .iindex].ValID = data[0] + .ID + ';' + + data[0] + .Name; + var callback_eventid = param + .button_callback + .trim(); + if (callback_eventid) { + var info = { + eventid: callback_eventid, + edtype: "2", + projectid: data[0].ID, + rclsid: "", + robjid: "", + userlogin: "", + clsid: $this.$data + .param.clsid, + objid: "", + attr: param.req, + dataJson: [], + } + + $this.DataObjRunCustomEvent( + info); + } + } + } + }); + } else { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + this.translateSys('tip'), + content: this.translateSys( + "quotation_mark_left") + + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed") + }); + d.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 } - - } 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 => { diff --git a/pages/modal/3018_2.vue b/pages/modal/3018_2.vue index 31b8b2e..0895112 100644 --- a/pages/modal/3018_2.vue +++ b/pages/modal/3018_2.vue @@ -474,82 +474,84 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { - } 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; - $this.setFormValues(result) - } else if (action.action_type == 'set_dlg_attr_show') { - var result = action.value; - $this.hideFormItems(result) - // console.log($this.head_styledef); - } else if (action.action_type == - "set_dlg_current_edit_attr" - ) { - if ($this.focusOldFieldId == action.value) { - $this.setData({ - focusFieldId: "" - }) - } else { - $this.setData({ - focusFieldId: $this - .focusOldFieldId - }) - } - $this.$nextTick(() => { - $this.setData({ - focusFieldId: action - .value - }) - }); - } else { + if (data.result_type == 2) { + + } else if (typeof data.result == 'string') { + if (data.result) { uni.showModal({ - title: this.translateSys("tip"), - content: this.translate( - 'execute_init_event_failed') + - this.translateSys("full_stop") + - this.translate('reason') + this - .translateSys( - "colon") + - this.translateSys("quotation_mark_left") + - action - .action_type + this.translateSys( - "quotation_mark_right") + this - .translate('tip_action_unprocessed'), + 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; + $this.setFormValues(result) + } else if (action.action_type == 'set_dlg_attr_show') { + var result = action.value; + $this.hideFormItems(result) + // console.log($this.head_styledef); + } else if (action.action_type == + "set_dlg_current_edit_attr" + ) { + if ($this.focusOldFieldId == action.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: action + .value + }) + }); + } else { + uni.showModal({ + title: this.translateSys("tip"), + content: this.translate( + 'execute_init_event_failed') + + this.translateSys("full_stop") + + this.translate('reason') + this + .translateSys( + "colon") + + this.translateSys("quotation_mark_left") + + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate('tip_action_unprocessed'), + 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 + } 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); @@ -936,79 +938,80 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { - $this.setFormValues(data.result || []) - } 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; - $this.setFormValues(result) - } else if (action.action_type == 'set_dlg_attr_show') { - var result = action.value; - $this.hideFormItems(result) - // console.log($this.head_styledef); - } else if (action.action_type == 'set_global_attr') { - $this.global_attr = action.value || []; - } else if (action.action_type == - "set_dlg_current_edit_attr" - ) { - if ($this.focusOldFieldId == action.value) { - $this.setData({ - focusFieldId: "" - }) - } else { - $this.setData({ - focusFieldId: $this.focusOldFieldId - }) - } - $this.$nextTick(() => { - $this.setData({ - focusFieldId: action.value - }) - }); - } else { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { + $this.setFormValues(data.result || []) + } else if (typeof data.result == 'string') { + if (data.result) { uni.showModal({ - title: this.translateSys("tip"), - content: this.translateSys( - "quotation_mark_left") + - action - .action_type + this.translateSys( - "quotation_mark_right") + this - .translate( - "tip_action_unprocessed"), + 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; + $this.setFormValues(result) + } else if (action.action_type == 'set_dlg_attr_show') { + var result = action.value; + $this.hideFormItems(result) + // console.log($this.head_styledef); + } else if (action.action_type == 'set_global_attr') { + $this.global_attr = action.value || []; + } else if (action.action_type == + "set_dlg_current_edit_attr" + ) { + if ($this.focusOldFieldId == action.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this.focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: action.value + }) + }); + } else { + uni.showModal({ + title: this.translateSys("tip"), + content: this.translateSys( + "quotation_mark_left") + + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed"), + 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 + } 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 => { @@ -1126,223 +1129,224 @@ showCancel: false, confirmText: $this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } else if (typeof data.result == 'string') { - if (data.result) { - uni.showModal({ - title: this.translateSys('tip'), - content: data.result, - showCancel: false, - confirmText: this.translateSys('close') - }); + } 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.length; i++) { - var action = actions[i]; - console.log(action) - var val = action.value; - var enviroment = JSON.stringify(enviroment); + try { + var actions = data.action || [] + for (var i = 0; i < actions.length; i++) { + var action = actions[i]; + console.log(action) + var val = action.value; + var enviroment = JSON.stringify(enviroment); - if (action.action_type == 'open_panel') { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action.action_type + $this - .translateSys( - "quotation_mark_right") + - $this.translate( - "tip_action_unprocessed") - }); - d.show(); - } else if (action.action_type == - 'open_select_userdlg') { - var style = val.style; - // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' - var param = { - item: item, - button_callback: button_callback, - req: req, - data_attr: data_attr - } - uni.navigateTo({ - url: '../selpsn/index?mulit=false¶m=' + - JSON - .stringify( - param), - events: { - AddPer(data, param) { - // console.log(param); - console.log(data); - var callback_eventid = param - .button_callback - .trim(); - var info = { - eventid: callback_eventid, - edtype: "0", - projectid: '', - rclsid: '', - robjid: '', - userlogin: '', - clsid: $this.param - .DataCls - .id, - objid: "", - attr: param.req, - inputparameter: data, - dataJson: [], - } - $this.DataObjRunCustomEvent( - info, - param - .data_attr); - } - } - }); - } else if (action.action_type == - 'open_data_query_dlg') { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action - .action_type + $this.translateSys( - "quotation_mark_right") + $this - .translate( - "tip_action_unprocessed") - }); - d.show(); - } else if (action.action_type == 'open_common_dlg') { - - if (val.common_dlg_id == 'check_list') { - - $this.setData({ - check_list: val.config - }) - if (val.config.appear_style == - 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.setData({ - popupType: "right" - }) - else - $this.setData({ - popupType: "center" - }) - // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this.$refs.popup.open($this.popupType); - var popupParam = { + if (action.action_type == 'open_panel') { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action.action_type + $this + .translateSys( + "quotation_mark_right") + + $this.translate( + "tip_action_unprocessed") + }); + d.show(); + } else if (action.action_type == + 'open_select_userdlg') { + var style = val.style; + // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' + var param = { item: item, button_callback: button_callback, req: req, data_attr: data_attr } - $this.setData({ - popupParam: popupParam - }) - } - } else if (action.action_type == - 'open_project_query_dlg') { - //console.log(action.value.select_range); - //console.log(action.value.mulit_select); - var priRel = '-1'; - if (action.value.select_range == '鍏ㄩ儴鐩稿叧') - priRel = '0'; - else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰') - priRel = '1'; - else if (action.value.select_range == '鎴戝垱寤虹殑') - priRel = '2'; - else if (action.value.select_range == '鎴戝弬涓庣殑' || - action - .value - .select_range == '鎴戝弬鍔犵殑') - priRel = '3'; - else if (action.value.select_range == '鎴戝叧娉ㄧ殑') - priRel = '4'; - else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰') - priRel = '5'; - var param_ = { - item: item, - button_callback: button_callback, - req: req - } - uni.navigateTo({ - url: '../selPrj/index?relation=' + - priRel + - '¶m=' + - JSON.stringify(param_), - events: { - AddPer(data, param) { - var attr = param.item.fieldId; - $this.head_styledef.form.model[ - attr] = - data[0].ID + - ';' + data[0].Name; - - // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; - // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; - var callback_eventid = param - .button_callback - .trim(); - if (callback_eventid) { + uni.navigateTo({ + url: '../selpsn/index?mulit=false¶m=' + + JSON + .stringify( + param), + events: { + AddPer(data, param) { + // console.log(param); + console.log(data); + var callback_eventid = param + .button_callback + .trim(); var info = { eventid: callback_eventid, - edtype: "2", - projectid: data[0] - .ID, - rclsid: "", - robjid: "", - userlogin: "", - clsid: $this.$data - .param - .DataCls.id, + edtype: "0", + projectid: '', + rclsid: '', + robjid: '', + userlogin: '', + clsid: $this.param + .DataCls + .id, objid: "", attr: param.req, + inputparameter: data, dataJson: [], } - - $this - .DataObjRunCustomEvent( - info); + $this.DataObjRunCustomEvent( + info, + param + .data_attr); } } + }); + } else if (action.action_type == + 'open_data_query_dlg') { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action + .action_type + $this.translateSys( + "quotation_mark_right") + $this + .translate( + "tip_action_unprocessed") + }); + d.show(); + } else if (action.action_type == 'open_common_dlg') { + + if (val.common_dlg_id == 'check_list') { + + $this.setData({ + check_list: val.config + }) + if (val.config.appear_style == + 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ $this.setData({ + popupType: "right" + }) + else + $this.setData({ + popupType: "center" + }) + // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� + $this.$refs.popup.open($this.popupType); + var popupParam = { + item: item, + button_callback: button_callback, + req: req, + data_attr: data_attr + } + $this.setData({ + popupParam: popupParam + }) } - }); - } else { - uni.showModal({ - title: $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action.action_type + $this - .translateSys( - "quotation_mark_right") + $this - .translate( - "tip_action_unprocessed"), - showCancel: false, - confirmText: $this.translateSys( - 'close') - }); + } else if (action.action_type == + 'open_project_query_dlg') { + //console.log(action.value.select_range); + //console.log(action.value.mulit_select); + var priRel = '-1'; + if (action.value.select_range == '鍏ㄩ儴鐩稿叧') + priRel = '0'; + else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰') + priRel = '1'; + else if (action.value.select_range == '鎴戝垱寤虹殑') + priRel = '2'; + else if (action.value.select_range == '鎴戝弬涓庣殑' || + action + .value + .select_range == '鎴戝弬鍔犵殑') + priRel = '3'; + else if (action.value.select_range == '鎴戝叧娉ㄧ殑') + priRel = '4'; + else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰') + priRel = '5'; + var param_ = { + item: item, + button_callback: button_callback, + req: req + } + uni.navigateTo({ + url: '../selPrj/index?relation=' + + priRel + + '¶m=' + + JSON.stringify(param_), + events: { + AddPer(data, param) { + var attr = param.item.fieldId; + $this.head_styledef.form.model[ + attr] = + data[0].ID + + ';' + data[0].Name; + + // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; + var callback_eventid = param + .button_callback + .trim(); + if (callback_eventid) { + var info = { + eventid: callback_eventid, + edtype: "2", + projectid: data[0] + .ID, + rclsid: "", + robjid: "", + userlogin: "", + clsid: $this.$data + .param + .DataCls.id, + objid: "", + attr: param.req, + dataJson: [], + } + + $this + .DataObjRunCustomEvent( + info); + } + } + } + }); + } else { + uni.showModal({ + title: $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action.action_type + $this + .translateSys( + "quotation_mark_right") + $this + .translate( + "tip_action_unprocessed"), + 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 } - - } 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 => { @@ -1729,64 +1733,66 @@ "&titlename=" + this.title }); } else { - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } else if (typeof data.result == 'string') { - if (data.result) { + } 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') { + $this.setFormValues(action.value) + } else if (action.action_type == 'set_dlg_attr_show') { + var result = action.value; + $this.hideFormItems(result) + } else if (action.action_type == + "set_dlg_current_edit_attr" + ) { + if ($this + .focusOldFieldId == + action.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: action + .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: data.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - var actionlist = data.action || [] - for (var i = 0; i < actionlist.length; i++) { - var action = actionlist[i]; - if (action.action_type == 'set_dlg_attr') { - $this.setFormValues(action.value) - } else if (action.action_type == 'set_dlg_attr_show') { - var result = action.value; - $this.hideFormItems(result) - } else if (action.action_type == - "set_dlg_current_edit_attr" - ) { - if ($this - .focusOldFieldId == - action.value) { - $this.setData({ - focusFieldId: "" - }) - } else { - $this.setData({ - focusFieldId: $this - .focusOldFieldId - }) - } - $this.$nextTick(() => { - $this.setData({ - focusFieldId: action - .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 } } @@ -1930,67 +1936,68 @@ "&titlename=" + this.title }); } else { - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } else if (typeof data.result == 'string') { - if (data.result) { + } 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') { + $this.setFormValues(action.value) + } else if (action.action_type == 'set_dlg_attr_show') { + var result = action.value; + $this.hideFormItems(result) + } else if (action.action_type == + "set_dlg_current_edit_attr" + ) { + if ($this + .focusOldFieldId == + action.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: action + .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: data.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } } - try { - var actionlist = data.action || [] - for (var i = 0; i < actionlist.length; i++) { - var action = actionlist[i]; - if (action.action_type == 'set_dlg_attr') { - $this.setFormValues(action.value) - } else if (action.action_type == 'set_dlg_attr_show') { - var result = action.value; - $this.hideFormItems(result) - } else if (action.action_type == - "set_dlg_current_edit_attr" - ) { - if ($this - .focusOldFieldId == - action.value) { - $this.setData({ - focusFieldId: "" - }) - } else { - $this.setData({ - focusFieldId: $this - .focusOldFieldId - }) - } - $this.$nextTick(() => { - $this.setData({ - focusFieldId: action - .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 - } - } } diff --git a/pages/modal/3037.vue b/pages/modal/3037.vue index bb8df8a..ebdda44 100644 --- a/pages/modal/3037.vue +++ b/pages/modal/3037.vue @@ -2628,152 +2628,154 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } else if (typeof data.result == 'string') { - if (data.result) { - uni.showModal({ - title: this.translateSys('tip'), - content: data.result, - showCancel: false, - confirmText: this.translateSys('close') - }); + } 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++ - ) { - var action = - actionlist[ - j] - var action_type = - action - .action_type; - var value = - action - .value; - if (action_type == - 'set_dlg_attr' + 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.classAttrList - .length; a++ + var i = + 0; i < + val + .length; i++ ) { for ( - var l = - 0; l < - this.classAttrList[ - a - ] - .Attr - .length; l++ + var a = + 0; a < + this.classAttrList + .length; a++ ) { - var ca = + 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 } - } 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 } } @@ -2908,137 +2910,200 @@ showCancel: false, confirmText: this.translateSys('close') }); - 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++ - ) { - var attr = - $this - .classAttrList[ - c] - .Attr; - for (var j = - 0; j < - attr - .length; j++ + 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 (attr[ - j - ] - .Name == - result[ - i - ] - .attr + var attr = + $this + .classAttrList[ + c] + .Attr; + for (var j = + 0; j < + attr + .length; j++ ) { - attr[ - j] - .Value = + if (attr[ + j + ] + .Name == result[ i ] - .value; + .attr + ) { + attr[ + j] + .Value = + result[ + i + ] + .value; + } } } - } - var length = 0; - if (!$this - .refdatastore - .filter( - function( - s - ) { - return result[ + var length = 0; + if (!$this + .refdatastore + .filter( + function( + s + ) { + return result[ + i + ] + .attr == + s + .attr + }) + .length) { + length = 1; + $this.refdatastore + .push( + 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 - ) { + ); + } + if (length == + 0) { + for (var j = + 0; j < $this + .refdatastore + .length; j++ + ) { + if ($this .refdatastore[ j ] - .value = + .attr == result[ i ] - .value; + .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') - }); + } 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++ + try { + var actionlist = data.action || [] + for (var i = 0; i < + actionlist + .length; i++) { + var action = + actionlist[ + i]; + if (action + .action_type == + 'set_dlg_attr' ) { - if (result[ - i - ] - .choice_list + 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 < @@ -3056,6 +3121,18 @@ attr .length; j++ ) { + console + .log( + attr[ + j + ] + .Name + + '==' + + result[ + i + ] + .attr + ); if (attr[ j ] @@ -3065,178 +3142,104 @@ ] .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; + } + } + } + 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; } } } } - for ( - var c = - 0; c < - $this.classAttrList - .length; c++ - ) { - var attr = - $this.classAttrList[ - 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; - } - } - } - 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 (data + .action[i] + .action_type == + 'set_global_attr' + ) { + $this.global_attr = + data + .action[ + i] + .value || []; } - } else if (data - .action[i] - .action_type == - 'set_global_attr' - ) { - $this.global_attr = - data - .action[ - 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) { - 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 } - } @@ -3389,71 +3392,72 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { - 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.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.refdatastore.push( - result[ - i] - ); - } - if (length == 0) { - for (var j = - 0; j < this - .refdatastore - .length; j++ + // 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 ) { - if (this - .refdatastore[ - j] - .attr == + length = 1; + this.refdatastore.push( result[ i] - .attr + ); + } + if (length == 0) { + for (var j = + 0; j < this + .refdatastore + .length; j++ ) { - this.refdatastore[ - j - ] - .value = + if (this + .refdatastore[ + 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') - }); + } else if (typeof data.result == 'string') { + if (data.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: data.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } } } - } }).catch(ex => { @@ -3610,269 +3614,97 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } 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 - .length; i++ - ) { - var action = - actions[ - i]; - var val = - action - .value; - var enviroment = - JSON - .stringify( - enviroment - ); - - if (action - .action_type == - 'open_panel' - ) { - var d = - dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - this.translateSys('tip'), - content: action - .action_type + - '姝ction灏氭湭澶勭悊锛� - }); - d - .show(); - } else if ( - action - .action_type == - 'open_select_userdlg' - ) { - var style = - val - .style; - // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' - var $this = - this; - var param = { - index: index, - iindex: iindex, - button_callback: button_callback, - req: req, - data_attr: data_attr - } - uni.navigateTo({ - url: '../selpsn/index?mulit=false¶m=' + - JSON - .stringify( - param - ), - events: { - AddPer( - data, - param - ) { - // console.log(param); - console - .log( - data - ); - var callback_eventid = - param - .button_callback - .trim(); - var info = { - eventid: callback_eventid, - edtype: "0", - projectid: '', - rclsid: '', - robjid: '', - userlogin: '', - clsid: $this - .param - .Master_Cls - .ID, - objid: "", - attr: param - .req, - inputparameter: data - } - $this - .DataObjRunCustomEvent( - info, - param - .data_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') }); - } else if ( - action - .action_type == - 'open_data_query_dlg' + } + } + try { + var actions = data.action || [] + for (var i = + 0; i < + actions + .length; i++ ) { - - } else if ( - action - .action_type == - 'open_common_dlg' - ) { - var value = + var action = + actions[ + i]; + var val = action .value; - var d = - dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - this.translateSys('tip'), - content: action - .action_type + - '姝ction灏氭湭澶勭悊锛� - }); - d - .show(); - } else if ( - action - .action_type == - 'open_project_query_dlg' - ) { - //console.log(action.value.select_range); - //console.log(action.value.mulit_select); - var priRel = - '-1'; - if (action - .value - .select_range == - '鍏ㄩ儴鐩稿叧' - ) - priRel = - '0'; - else if ( - action - .value - .select_range == - '鎴戣礋璐g殑椤圭洰' - ) - priRel = - '1'; - else if ( - action - .value - .select_range == - '鎴戝垱寤虹殑' - ) - priRel = - '2'; - else if ( - action - .value - .select_range == - '鎴戝弬涓庣殑' || - action - .value - .select_range == - '鎴戝弬鍔犵殑' - ) - priRel = - '3'; - else if ( - action - .value - .select_range == - '鎴戝叧娉ㄧ殑' - ) - priRel = - '4'; - else if ( - action - .value - .select_range == - '鎴戜笅灞炵殑椤圭洰' - ) - priRel = - '5'; + var enviroment = + JSON + .stringify( + enviroment + ); - var $this = - this; - var param_ = { - index: index, - iindex: iindex, - button_callback: button_callback, - req: req - } - uni.navigateTo({ - url: '../selPrj/index?relation=' + - priRel + - '¶m=' + - JSON - .stringify( - param_ - ), - events: { - AddPer( - data, - param - ) { - $this - .classAttrList[ - param - .index - ] - .Attr[ - param - .iindex - ] - .Value = - data[ - 0 - ] - .Name; - $this - .classAttrList[ - param - .index - ] - .Attr[ - param - .iindex - ] - .ValID = - data[ - 0 - ] - .ID + - ';' + - data[ - 0 - ] - .Name; - var callback_eventid = + if (action + .action_type == + 'open_panel' + ) { + var d = + dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + this.translateSys('tip'), + content: action + .action_type + + '姝ction灏氭湭澶勭悊锛� + }); + d + .show(); + } else if ( + action + .action_type == + 'open_select_userdlg' + ) { + var style = + val + .style; + // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' + var $this = + this; + var param = { + index: index, + iindex: iindex, + button_callback: button_callback, + req: req, + data_attr: data_attr + } + uni.navigateTo({ + url: '../selpsn/index?mulit=false¶m=' + + JSON + .stringify( param - .button_callback - .trim(); - if ( - callback_eventid) { + ), + events: { + AddPer( + data, + param + ) { + // console.log(param); + console + .log( + data + ); + var callback_eventid = + param + .button_callback + .trim(); var info = { eventid: callback_eventid, - edtype: "2", - projectid: data[ - 0 - ] - .ID, - rclsid: "", - robjid: "", - userlogin: "", + edtype: "0", + projectid: '', + rclsid: '', + robjid: '', + userlogin: '', clsid: $this .param .Master_Cls @@ -3880,44 +3712,217 @@ objid: "", attr: param .req, + inputparameter: data } - $this .DataObjRunCustomEvent( - info + info, + param + .data_attr ); } } - } - }); - } else { - var d = - dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - this.translateSys('tip'), - content: action - .action_type + - '姝ction灏氭湭澶勭悊锛� }); - d - .show(); + } else if ( + action + .action_type == + 'open_data_query_dlg' + ) { + + } else if ( + action + .action_type == + 'open_common_dlg' + ) { + var value = + action + .value; + var d = + dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + this.translateSys('tip'), + content: action + .action_type + + '姝ction灏氭湭澶勭悊锛� + }); + d + .show(); + } else if ( + action + .action_type == + 'open_project_query_dlg' + ) { + //console.log(action.value.select_range); + //console.log(action.value.mulit_select); + var priRel = + '-1'; + if (action + .value + .select_range == + '鍏ㄩ儴鐩稿叧' + ) + priRel = + '0'; + else if ( + action + .value + .select_range == + '鎴戣礋璐g殑椤圭洰' + ) + priRel = + '1'; + else if ( + action + .value + .select_range == + '鎴戝垱寤虹殑' + ) + priRel = + '2'; + else if ( + action + .value + .select_range == + '鎴戝弬涓庣殑' || + action + .value + .select_range == + '鎴戝弬鍔犵殑' + ) + priRel = + '3'; + else if ( + action + .value + .select_range == + '鎴戝叧娉ㄧ殑' + ) + priRel = + '4'; + else if ( + action + .value + .select_range == + '鎴戜笅灞炵殑椤圭洰' + ) + priRel = + '5'; + + var $this = + this; + var param_ = { + index: index, + iindex: iindex, + button_callback: button_callback, + req: req + } + uni.navigateTo({ + url: '../selPrj/index?relation=' + + priRel + + '¶m=' + + JSON + .stringify( + param_ + ), + events: { + AddPer( + data, + param + ) { + $this + .classAttrList[ + param + .index + ] + .Attr[ + param + .iindex + ] + .Value = + data[ + 0 + ] + .Name; + $this + .classAttrList[ + param + .index + ] + .Attr[ + param + .iindex + ] + .ValID = + data[ + 0 + ] + .ID + + ';' + + data[ + 0 + ] + .Name; + var callback_eventid = + param + .button_callback + .trim(); + if ( + callback_eventid) { + var info = { + eventid: callback_eventid, + edtype: "2", + projectid: data[ + 0 + ] + .ID, + rclsid: "", + robjid: "", + userlogin: "", + clsid: $this + .param + .Master_Cls + .ID, + objid: "", + attr: param + .req, + } + + $this + .DataObjRunCustomEvent( + info + ); + } + } + } + }); + } else { + var d = + dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + this.translateSys('tip'), + content: action + .action_type + + '姝ction灏氭湭澶勭悊锛� + }); + d + .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 } - - } 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 => { @@ -4033,74 +4038,76 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } else if (typeof data.result == 'string') { - if (data.result) { - uni.showModal({ - title: this.translateSys('tip'), - content: data.result, - showCancel: false, - confirmText: this.translateSys('close') - }); + } 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); + 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 - }); + 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; - } + } } } } } } } + } 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) { - 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 } - } } @@ -4227,438 +4234,29 @@ showCancel: false, confirmText: this.translateSys('close') }); - 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 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 - .length; ii++ - ) { - var action = - actionlist[ - ii]; - 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 s = - 0; s < - $this.subPanelList - .length; s++ - ) { - for (var c = 0; c < $this.subPanelList[s].subClassAttrList - .length; c++) { - var attr = - $this.subPanelList[ - s - ] - .subClassAttrList[ - 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 s = - 0; s < - $this - .subPanelList - .length; s++ - ) { - for ( - var c = - 0; c < - $this - .subPanelList[ - s - ] - .subClassAttrList - .length; c++ - ) { - var attr = - $this - .subPanelList[ - s - ] - .subClassAttrList[ - 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; - } - } - } - } - } - } else if ( - action - .action_type == - 'set_global_attr' - ) { - $this - .$actiontr = - action - .value || []; - } else if ( - action - .action_type == - 'open_common_dlg' - ) { //鎵撳紑渚ф粦寮规 - var $this = - this; - if (action - .value - .common_dlg_id == - 'check_list' - ) { - $this.check_list = - action - .value - .config; - if (action - .value - .config - .appear_style == - 'sideslip' - ) //鍒ゆ柇鏄惁鏄晶婊�- $this - .popupType = - 'right'; - else - $this.popupType = - 'center' - // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this - .$refs - .popup - .open( - $this - .popupType - ); - } - } else if ( - action - .action_type == - 'add_subcls_panel' - ) { //涓讳粠鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�- var result = - action - .value; - var $this = - this; - var list_1 = - JSON - .parse( - JSON + 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 < + var rand = ''; + for (var i = 0; i < 5; i++ ) { //鐢熸垚5浣嶉殢鏈烘暟 - rand += - Math - .floor( - Math + rand += Math + .floor(Math .random() * - 10 - ); + 10); } if (inputParamter[ - 0] - .attr - ) { + 0].attr) { if (inputParamter[ - 0 - ] + 0] .attr == "mast_input_3037" ) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�@@ -4666,15 +4264,10 @@ "mast_input_3037-" + rand; } - if (info - .attr[ - 0] - .attr - ) { - if (info - .attr[ - 0 - ] + if (info.attr[0] + .attr) { + if (info.attr[ + 0] .attr == "mast_input_3037" ) //鍒ゆ柇鏄富鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�@@ -4687,20 +4280,18 @@ scanCodeVal: scanCodeVal, subClassAttr: list_1 }); - for (var i = - 0; i < + var result = data + .result; + for (var i = 0; i < result - .length; i++ - ) { - for ( - var s = + .length; i++) { + for (var s = 0; s < $this.subPanelList .length; s++ ) { if ($this.subPanelList[ - s - ] + s] .scanCodeVal == scanCodeVal ) { @@ -4760,15 +4351,11 @@ } } } - - // $this.subPanelList[s].subClassAttr=list_1; } } - var length = - 0; - if (! - $this.refdatastore + var length = 0; + if (!$this.refdatastore .filter( function( s @@ -4779,13 +4366,9 @@ .attr == s .attr - } - ) - .length - ) { - length - = - 1; + }) + .length) { + length = 1; $this.refdatastore .push( result[ @@ -4794,15 +4377,15 @@ ); } if (length == - 0 - ) { - for ( - var j = + 0) { + for (var j = 0; j < - $this.refdatastore + $this + .refdatastore .length; j++ ) { - if ($this.refdatastore[ + if ($this + .refdatastore[ j ] .attr == @@ -4811,7 +4394,8 @@ ] .attr ) { - $this.refdatastore[ + $this + .refdatastore[ j ] .value = @@ -4824,20 +4408,445 @@ } } } - } - } 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 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 + .length; ii++ + ) { + var action = + actionlist[ + ii]; + 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 s = + 0; s < + $this.subPanelList + .length; s++ + ) { + for (var c = 0; c < $this.subPanelList[s].subClassAttrList + .length; c++) { + var attr = + $this.subPanelList[ + s + ] + .subClassAttrList[ + 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 s = + 0; s < + $this + .subPanelList + .length; s++ + ) { + for ( + var c = + 0; c < + $this + .subPanelList[ + s + ] + .subClassAttrList + .length; c++ + ) { + var attr = + $this + .subPanelList[ + s + ] + .subClassAttrList[ + 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; + } + } + } + } + } + } else if ( + action + .action_type == + 'set_global_attr' + ) { + $this + .$actiontr = + action + .value || []; + } else if ( + action + .action_type == + 'open_common_dlg' + ) { //鎵撳紑渚ф粦寮规 + var $this = + this; + if (action + .value + .common_dlg_id == + 'check_list' + ) { + $this.check_list = + action + .value + .config; + if (action + .value + .config + .appear_style == + 'sideslip' + ) //鍒ゆ柇鏄惁鏄晶婊�+ $this + .popupType = + 'right'; + else + $this.popupType = + 'center' + // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� + $this + .$refs + .popup + .open( + $this + .popupType + ); + } + } else if ( + action + .action_type == + 'add_subcls_panel' + ) { //涓讳粠鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�+ var result = + action + .value; + var $this = + this; + 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 + }); + 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; + } + } + } + + // $this.subPanelList[s].subClassAttr=list_1; + } + } + + 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; + } + } + } + } + } + } + + } 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 + } } } diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue index 34e9a39..388c9b1 100644 --- a/pages/modal/3037_2.vue +++ b/pages/modal/3037_2.vue @@ -471,166 +471,170 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } 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 < styledef.form.items.length; c++) { - var attr = styledef.form.items[c]; - if (attr.name != 'Layout') { - if (attr.fieldId == result[i].attr) { - 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, - "text": val, - "value": val - }); - } - attr.dict = dictItemList; - } - } else if (attr.name == 'Layout') { - attr.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == result[i].attr) { - 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, - "text": val, - "value": val - }); - } - col.dict = dictItemList; - } - } - }); - } - - } - } - for (var c = 0; c < styledef.form.items.length; c++) { - var attr = styledef.form.items[c]; - // console.log(attr[j].Name+'=='+result[i].attr); - //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�- if ($this.head_styledef.form.model[result[i].attr] == - undefined) { - $this.head_styledef.form.model[result[i].attr] = result[i] - .value; - } - //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (attr.name != 'Layout') { - if (attr.fieldId == result[i].attr) { - attr.value = ''; - attr.oldvalue = ''; - attr.value = result[i].value; - attr.oldvalue = result[i].value; - $this.head_styledef.form.model[attr.fieldId] = result[ - i].value; - } - } else if (attr.name == 'Layout') { - attr.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == result[i].attr) { - col.value = ''; - col.oldvalue = ''; - col.value = result[i].value; - col.oldvalue = result[i].value; - $this.head_styledef.form.model[col - .fieldId] = result[i].value; - } - } - }); - } - } - - } - } else if (data.action[i].action_type == 'set_dlg_attr_show') { - var result = action.value; - if (type == 'head') { - $this.setFormItemVisible(result) - // console.log($this.head_styledef); - } else { - result.forEach(async (attr, key) => { - styledef.form.items.forEach(async (ele, index) => { - //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�- if (ele.name != 'Layout') { - if (ele.fieldId == attr.attr) { - ele.show = attr.show; - } - } else if (ele.name == 'Layout') { - ele.setting.colList.forEach( - col => { - if (col) { - if (col.fieldId == - attr.attr) { - col.show = attr - .show; - } - } - }); - } - }); - }); - var style_def = JSON.parse(JSON.stringify(styledef)); - - - $this.detail1_styledef = []; - $this.detail1_styledef = style_def; - // console.log($this.detail1_styledef); - } - } else { + } else if (typeof data.result == 'string') { + if (data.result) { uni.showModal({ - title: this.translateSys("tip"), - content: this.translate('execute_init_event_failed') + - this.translateSys("full_stop") + - this.translate('reason') + this.translateSys("colon") + - this.translateSys("quotation_mark_left") + action - .action_type + this.translateSys( - "quotation_mark_right") + this - .translate('tip_action_unprocessed'), + 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 < styledef.form.items.length; c++) { + var attr = styledef.form.items[c]; + if (attr.name != 'Layout') { + if (attr.fieldId == result[i].attr) { + 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, + "text": val, + "value": val + }); + } + attr.dict = dictItemList; + } + } else if (attr.name == 'Layout') { + attr.setting.colList.forEach(col => { + if (col) { + if (col.fieldId == result[i].attr) { + 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, + "text": val, + "value": val + }); + } + col.dict = dictItemList; + } + } + }); + } - } 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 + } + } + for (var c = 0; c < styledef.form.items.length; c++) { + var attr = styledef.form.items[c]; + // console.log(attr[j].Name+'=='+result[i].attr); + //鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�+ if ($this.head_styledef.form.model[result[i].attr] == + undefined) { + $this.head_styledef.form.model[result[i].attr] = result[i] + .value; + } + //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�+ if (attr.name != 'Layout') { + if (attr.fieldId == result[i].attr) { + attr.value = ''; + attr.oldvalue = ''; + attr.value = result[i].value; + attr.oldvalue = result[i].value; + $this.head_styledef.form.model[attr.fieldId] = result[ + i].value; + } + } else if (attr.name == 'Layout') { + attr.setting.colList.forEach(col => { + if (col) { + if (col.fieldId == result[i].attr) { + col.value = ''; + col.oldvalue = ''; + col.value = result[i].value; + col.oldvalue = result[i].value; + $this.head_styledef.form.model[col + .fieldId] = result[i].value; + } + } + }); + } + } + + } + } else if (data.action[i].action_type == 'set_dlg_attr_show') { + var result = action.value; + if (type == 'head') { + $this.setFormItemVisible(result) + // console.log($this.head_styledef); + } else { + result.forEach(async (attr, key) => { + styledef.form.items.forEach(async (ele, index) => { + //鍒ゆ柇鏄惁鏄爡鏍艰〃鍗�+ if (ele.name != 'Layout') { + if (ele.fieldId == attr.attr) { + ele.show = attr.show; + } + } else if (ele.name == 'Layout') { + ele.setting.colList.forEach( + col => { + if (col) { + if (col + .fieldId == + attr.attr + ) { + col.show = + attr + .show; + } + } + }); + } + }); + }); + var style_def = JSON.parse(JSON.stringify(styledef)); + + + $this.detail1_styledef = []; + $this.detail1_styledef = style_def; + // console.log($this.detail1_styledef); + } + } else { + uni.showModal({ + title: this.translateSys("tip"), + content: this.translate('execute_init_event_failed') + + this.translateSys("full_stop") + + this.translate('reason') + this.translateSys("colon") + + this.translateSys("quotation_mark_left") + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate('tip_action_unprocessed'), + 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 + } } - } }).catch(ex => { @@ -886,206 +890,208 @@ showCancel: false, confirmText: $this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } else if (typeof data.result == 'string') { - if (data.result) { - uni.showModal({ - title: this.translateSys('tip'), - content: data.result, - showCancel: false, - confirmText: this.translateSys('close') - }); + } 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.length; i++) { - var action = actions[i]; - console.log(action) - var val = action.value; - var enviroment = JSON.stringify(enviroment); + try { + var actions = data.action || [] + for (var i = 0; i < actions.length; i++) { + var action = actions[i]; + console.log(action) + var val = action.value; + var enviroment = JSON.stringify(enviroment); - if (action.action_type == 'open_panel') { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - $this.translateSys("tip"), - content: $this.translateSys("quotation_mark_left") + - action.action_type + $this.translateSys( - "quotation_mark_right") + - $this.translate("tip_action_unprocessed") - }); - d.show(); - } else if (action.action_type == 'open_select_userdlg') { - var style = val.style; - // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' - var param = { - item: item, - button_callback: button_callback, - req: req, - data_attr: data_attr - } - uni.navigateTo({ - url: '../selpsn/index?mulit=false¶m=' + - JSON - .stringify( - param), - events: { - AddPer(data, param) { - // console.log(param); - console.log(data); - var callback_eventid = param - .button_callback - .trim(); - var info = { - eventid: callback_eventid, - edtype: "0", - projectid: '', - rclsid: '', - robjid: '', - userlogin: '', - clsid: $this.param - .DataCls - .id, - objid: "", - attr: param.req, - inputparameter: data, - dataJson: [], - } - $this.DataObjRunCustomEvent(info, - param - .data_attr); - } - } - }); - } else if (action.action_type == 'open_data_query_dlg') { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action - .action_type + $this.translateSys( - "quotation_mark_right") + $this - .translate( - "tip_action_unprocessed") - }); - d.show(); - } else if (action.action_type == 'open_common_dlg') { - - if (val.common_dlg_id == 'check_list') { - - $this.setData({ - check_list: val.config - }) - if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.setData({ - popupType: "right" - }) - else - $this.setData({ - popupType: "center" - }) - // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this.$refs.popup.open($this.popupType); - var popupParam = { + if (action.action_type == 'open_panel') { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + $this.translateSys("tip"), + content: $this.translateSys("quotation_mark_left") + + action.action_type + $this.translateSys( + "quotation_mark_right") + + $this.translate("tip_action_unprocessed") + }); + d.show(); + } else if (action.action_type == 'open_select_userdlg') { + var style = val.style; + // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' + var param = { item: item, button_callback: button_callback, req: req, data_attr: data_attr } - $this.setData({ - popupParam: popupParam - }) - } - } else if (action.action_type == 'open_project_query_dlg') { - //console.log(action.value.select_range); - //console.log(action.value.mulit_select); - var priRel = '-1'; - if (action.value.select_range == '鍏ㄩ儴鐩稿叧') - priRel = '0'; - else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰') - priRel = '1'; - else if (action.value.select_range == '鎴戝垱寤虹殑') - priRel = '2'; - else if (action.value.select_range == '鎴戝弬涓庣殑' || action - .value - .select_range == '鎴戝弬鍔犵殑') - priRel = '3'; - else if (action.value.select_range == '鎴戝叧娉ㄧ殑') - priRel = '4'; - else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰') - priRel = '5'; - var param_ = { - item: item, - button_callback: button_callback, - req: req - } - uni.navigateTo({ - url: '../selPrj/index?relation=' + priRel + - '¶m=' + - JSON.stringify(param_), - events: { - AddPer(data, param) { - var attr = param.item.fieldId; - $this.head_styledef.form.model[ - attr] = - data[0].ID + - ';' + data[0].Name; - - // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; - // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; - var callback_eventid = param - .button_callback - .trim(); - if (callback_eventid) { + uni.navigateTo({ + url: '../selpsn/index?mulit=false¶m=' + + JSON + .stringify( + param), + events: { + AddPer(data, param) { + // console.log(param); + console.log(data); + var callback_eventid = param + .button_callback + .trim(); var info = { eventid: callback_eventid, - edtype: "2", - projectid: data[0].ID, - rclsid: "", - robjid: "", - userlogin: "", + edtype: "0", + projectid: '', + rclsid: '', + robjid: '', + userlogin: '', clsid: $this.param - .DataCls.id, + .DataCls + .id, objid: "", attr: param.req, + inputparameter: data, dataJson: [], } - - $this.DataObjRunCustomEvent( - info); + $this.DataObjRunCustomEvent(info, + param + .data_attr); } } - } - }); - } else { - uni.showModal({ - title: $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action.action_type + $this.translateSys( - "quotation_mark_right") + $this - .translate( - "tip_action_unprocessed"), - showCancel: false, - confirmText: $this.translateSys('close') - }); - } - } + }); + } else if (action.action_type == 'open_data_query_dlg') { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action + .action_type + $this.translateSys( + "quotation_mark_right") + $this + .translate( + "tip_action_unprocessed") + }); + d.show(); + } else if (action.action_type == 'open_common_dlg') { - } 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 + if (val.common_dlg_id == 'check_list') { + + $this.setData({ + check_list: val.config + }) + if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ $this.setData({ + popupType: "right" + }) + else + $this.setData({ + popupType: "center" + }) + // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� + $this.$refs.popup.open($this.popupType); + var popupParam = { + item: item, + button_callback: button_callback, + req: req, + data_attr: data_attr + } + $this.setData({ + popupParam: popupParam + }) + } + } else if (action.action_type == 'open_project_query_dlg') { + //console.log(action.value.select_range); + //console.log(action.value.mulit_select); + var priRel = '-1'; + if (action.value.select_range == '鍏ㄩ儴鐩稿叧') + priRel = '0'; + else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰') + priRel = '1'; + else if (action.value.select_range == '鎴戝垱寤虹殑') + priRel = '2'; + else if (action.value.select_range == '鎴戝弬涓庣殑' || action + .value + .select_range == '鎴戝弬鍔犵殑') + priRel = '3'; + else if (action.value.select_range == '鎴戝叧娉ㄧ殑') + priRel = '4'; + else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰') + priRel = '5'; + var param_ = { + item: item, + button_callback: button_callback, + req: req + } + uni.navigateTo({ + url: '../selPrj/index?relation=' + priRel + + '¶m=' + + JSON.stringify(param_), + events: { + AddPer(data, param) { + var attr = param.item.fieldId; + $this.head_styledef.form.model[ + attr] = + data[0].ID + + ';' + data[0].Name; + + // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; + var callback_eventid = param + .button_callback + .trim(); + if (callback_eventid) { + var info = { + eventid: callback_eventid, + edtype: "2", + projectid: data[0].ID, + rclsid: "", + robjid: "", + userlogin: "", + clsid: $this.param + .DataCls.id, + objid: "", + attr: param.req, + dataJson: [], + } + + $this.DataObjRunCustomEvent( + info); + } + } + } + }); + } else { + uni.showModal({ + title: $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action.action_type + $this.translateSys( + "quotation_mark_right") + $this + .translate( + "tip_action_unprocessed"), + 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 + } } } @@ -1576,163 +1582,164 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { - var result = data.result || [] + 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.head_styledef.form.items.length; c++) { - var attr = $this.head_styledef.form.items[c]; - if (attr.name != 'Layout') { - if (attr.fieldId == result[i].attr) { - attr.value = ''; - attr.oldvalue = ''; - attr.value = result[i].value; - attr.oldvalue = result[i].value; - $this.head_styledef.form.model[attr.fieldId] = result[i].value; + for (var i = 0; i < result.length; i++) { + for (var c = 0; c < $this.head_styledef.form.items.length; c++) { + var attr = $this.head_styledef.form.items[c]; + if (attr.name != 'Layout') { + if (attr.fieldId == result[i].attr) { + attr.value = ''; + attr.oldvalue = ''; + attr.value = result[i].value; + attr.oldvalue = result[i].value; + $this.head_styledef.form.model[attr.fieldId] = result[i].value; + } + } else if (attr.name == 'Layout') { + attr.setting.colList.forEach(col => { + if (col) { + if (col.fieldId == result[i].attr) { + col.value = ''; + col.oldvalue = ''; + col.value = result[i].value; + col.oldvalue = result[i].value; + $this.head_styledef.form.model[col.fieldId] = + result[i].value; + } + } + }); } - } else if (attr.name == 'Layout') { - attr.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == result[i].attr) { - col.value = ''; - col.oldvalue = ''; - col.value = result[i].value; - col.oldvalue = result[i].value; - $this.head_styledef.form.model[col.fieldId] = - 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.head_styledef.form.items.length; c++) { + var attr = $this.head_styledef.form.items[c]; + if (attr.name != 'Layout') { + if (attr.fieldId == result[i].attr) { + 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, + "text": val, + "value": val + }); + } + attr.dict = dictItemList; + } + } else if (attr.name == 'Layout') { + attr.setting.colList.forEach(col => { + if (col) { + if (col.fieldId == result[i].attr) { + 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, + "text": val, + "value": val + }); + } + col.dict = dictItemList; + } + } + }); + } } } - }); - } - - } - - 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.head_styledef.form.items.length; c++) { var attr = $this.head_styledef.form.items[c]; + // console.log(attr[j].Name+'=='+result[i].attr); if (attr.name != 'Layout') { if (attr.fieldId == result[i].attr) { - 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, - "text": val, - "value": val - }); - } - attr.dict = dictItemList; + attr.value = ''; + attr.oldvalue = ''; + attr.value = result[i].value; + attr.oldvalue = result[i].value; + $this.head_styledef.form.model[attr.fieldId] = result[i] + .value; } } else if (attr.name == 'Layout') { attr.setting.colList.forEach(col => { if (col) { if (col.fieldId == result[i].attr) { - 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, - "text": val, - "value": val - }); - } - col.dict = dictItemList; + col.value = ''; + col.oldvalue = ''; + col.value = result[i].value; + col.oldvalue = result[i].value; + $this.head_styledef.form.model[col + .fieldId] = result[i].value; } } }); } - } - } - for (var c = 0; c < $this.head_styledef.form.items.length; c++) { - var attr = $this.head_styledef.form.items[c]; - // console.log(attr[j].Name+'=='+result[i].attr); - if (attr.name != 'Layout') { - if (attr.fieldId == result[i].attr) { - attr.value = ''; - attr.oldvalue = ''; - attr.value = result[i].value; - attr.oldvalue = result[i].value; - $this.head_styledef.form.model[attr.fieldId] = result[i] - .value; - } - } else if (attr.name == 'Layout') { - attr.setting.colList.forEach(col => { - if (col) { - if (col.fieldId == result[i].attr) { - col.value = ''; - col.oldvalue = ''; - col.value = result[i].value; - col.oldvalue = result[i].value; - $this.head_styledef.form.model[col - .fieldId] = result[i].value; - } - } - }); + } } - + } else if (action.action_type == 'set_dlg_attr_show') { + var data = action.value; + $this.setFormItemVisible(data) + // console.log($this.head_styledef); + } else if (action.action_type == 'set_global_attr') { + $this.global_attr = action.value || []; } - } else if (action.action_type == 'set_dlg_attr_show') { - var data = action.value; - $this.setFormItemVisible(data) - // console.log($this.head_styledef); - } else if (action.action_type == 'set_global_attr') { - $this.global_attr = action.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) { - 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 => { @@ -1862,150 +1869,10 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { - if (data.result) { + 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.detail1_styledef)); - 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.form - .items; - for (var c = 0; c < _subClassAttr.length; c++) { - if (_subClassAttr[c].name != 'Layout') { - if (_subClassAttr[c].fieldId == result[i].attr) - _subClassAttr[c].value = result[i].value; - } else if (_subClassAttr[c].name == 'Layout') { - _subClassAttr[c].setting.colList.forEach(col => { - if (col) { - if (col.fieldId == result[i].attr) - col.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 ii = 0; ii < actionlist.length; ii++) { - var action = actionlist[ii]; - 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 s = 0; s < $this.subPanelList.length; s++) { - for (var c = 0; c < $this.subPanelList[s] - .subClassAttrList.length; c++) { - var attr = $this.subPanelList[s].subClassAttrList[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 s = 0; s < $this.subPanelList.length; s++) { - for (var c = 0; c < $this.subPanelList[s].subClassAttrList - .length; c++) { - var attr = $this.subPanelList[s].subClassAttrList[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; - // attr.value = ''; - // attr.oldvalue = ''; - // attr.value = result[i].value; - // attr.oldvalue = result[i].value; - } - } - } - } - var length = 0; - - } - } else if (action.action_type == 'set_global_attr') { - $this.$actiontr = action.value || []; - } else if (action.action_type == 'open_common_dlg') { //鎵撳紑渚ф粦寮规 - var $this = this; - if (action.value.common_dlg_id == 'check_list') { - $this.check_list = action.value.config; - if (action.value.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.popupType = 'right'; - else - $this.popupType = 'center' - // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this.$refs.popup.open($this.popupType); - } - } else if (action.action_type == 'add_subcls_panel') { //涓讳粠鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�- var result = action.value; - var $this = this; var list_1 = JSON.parse(JSON.stringify(this.detail1_styledef)); var scanCodeVal = $this.scanCodeVal; var rand = ''; @@ -2024,16 +1891,14 @@ scanCodeVal: scanCodeVal, subClassAttr: list_1 }); - $this.activelist.push({ - active: false - }); + 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 - .form.items; + var _subClassAttr = $this.subPanelList[s].subClassAttr.form + .items; for (var c = 0; c < _subClassAttr.length; c++) { if (_subClassAttr[c].name != 'Layout') { if (_subClassAttr[c].fieldId == result[i].attr) @@ -2047,11 +1912,9 @@ }); } } - - // $this.subPanelList[s].subClassAttr=list_1; } } - // console.log($this.subPanelList); + var length = 0; if (!$this.refdatastore.filter(function(s) { return result[i].attr == s.attr @@ -2067,32 +1930,178 @@ } } } - } else { + } + + } else if (typeof data.result == 'string') { + if (data.result) { uni.showModal({ - title: this.translateSys("tip"), - content: this.translateSys("quotation_mark_left") + action - .action_type + this.translateSys( - "quotation_mark_right") + this.translate( - "tip_action_unprocessed"), + title: this.translateSys('tip'), + content: data.result, showCancel: false, confirmText: this.translateSys('close') }); } } + try { + var actionlist = data.action || [] + for (var ii = 0; ii < actionlist.length; ii++) { + var action = actionlist[ii]; + 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 s = 0; s < $this.subPanelList.length; s++) { + for (var c = 0; c < $this.subPanelList[s] + .subClassAttrList.length; c++) { + var attr = $this.subPanelList[s].subClassAttrList[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 s = 0; s < $this.subPanelList.length; s++) { + for (var c = 0; c < $this.subPanelList[s].subClassAttrList + .length; c++) { + var attr = $this.subPanelList[s].subClassAttrList[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; + // attr.value = ''; + // attr.oldvalue = ''; + // attr.value = result[i].value; + // attr.oldvalue = result[i].value; + } + } + } + } + var length = 0; + + } + } else if (action.action_type == 'set_global_attr') { + $this.$actiontr = action.value || []; + } else if (action.action_type == 'open_common_dlg') { //鎵撳紑渚ф粦寮规 + var $this = this; + if (action.value.common_dlg_id == 'check_list') { + $this.check_list = action.value.config; + if (action.value.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ $this.popupType = 'right'; + else + $this.popupType = 'center' + // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� + $this.$refs.popup.open($this.popupType); + } + } else if (action.action_type == 'add_subcls_panel') { //涓讳粠鏁版嵁绫绘壂鐮佹煡璇㈡暟鎹�+ var result = action.value; + var $this = this; + var list_1 = JSON.parse(JSON.stringify(this.detail1_styledef)); + 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 + }); + $this.activelist.push({ + active: false + }); + 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 + .form.items; + for (var c = 0; c < _subClassAttr.length; c++) { + if (_subClassAttr[c].name != 'Layout') { + if (_subClassAttr[c].fieldId == result[i].attr) + _subClassAttr[c].value = result[i].value; + } else if (_subClassAttr[c].name == 'Layout') { + _subClassAttr[c].setting.colList.forEach(col => { + if (col) { + if (col.fieldId == result[i].attr) + col.value = result[i].value; + } + }); + } + } + + // $this.subPanelList[s].subClassAttr=list_1; + } + } + // console.log($this.subPanelList); + 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 { + uni.showModal({ + title: this.translateSys("tip"), + content: this.translateSys("quotation_mark_left") + action + .action_type + this.translateSys( + "quotation_mark_right") + this.translate( + "tip_action_unprocessed"), + 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 + } 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 + } } } diff --git a/pages/modal/3200.vue b/pages/modal/3200.vue index 78e4726..49a8ae3 100644 --- a/pages/modal/3200.vue +++ b/pages/modal/3200.vue @@ -540,47 +540,48 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionList = result.action || [] + actionList.forEach(item => { + if (item.action_type == "set_query_condition") { + var value = item.value; + $this.wheres = value.condition; + $this.orderby = value.order ? value.order : $this + .orderby; + $this.pageindex = 1; + $this.query_id = ""; + $this.detail1StyleDefList = []; + $this.loadDataGetList(); + } + + }); + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } } - try { - var actionList = result.action || [] - actionList.forEach(item => { - if (item.action_type == "set_query_condition") { - var value = item.value; - $this.wheres = value.condition; - $this.orderby = value.order ? value.order : $this - .orderby; - $this.pageindex = 1; - $this.query_id = ""; - $this.detail1StyleDefList = []; - $this.loadDataGetList(); - } - - }); - } catch (ex) { - let actionList = (result.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) { @@ -1400,66 +1401,70 @@ confirmText: this.translateSys( 'close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionlist = result.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) { + this.setFormValues(value) + } + } else if (action_type == "set_subtable_page_content") { + if (value.clear_confirm != false && value.clear == true && + $this.detail1StyleDefList.length > 0 + ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�+ uni.showModal({ + title: this.translateSys('tip'), + content: this.translate( + "are_you_sure_clear_data"), + cancelText: $this.translateSys('ok'), + confirmText: $this.translateSys('cancel'), + success: function(res) { + if (res.cancel) { + $this.detail1StyleDefList = []; + $this.viewAceionContent(value); + } else if (res.confirm) { + $this.detail1StyleDefList = []; + $this.viewAceionContent(value); + } + } + }); + } else { + $this.detail1StyleDefList = []; + $this.viewAceionContent(value); + } + } + } + + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - var actionlist = result.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) { - this.setFormValues(value) - } - } else if (action_type == "set_subtable_page_content") { - if (value.clear_confirm != false && value.clear == true && - $this.detail1StyleDefList.length > 0 - ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�- uni.showModal({ - title: this.translateSys('tip'), - content: this.translate("are_you_sure_clear_data"), - cancelText: $this.translateSys('ok'), - confirmText: $this.translateSys('cancel'), - success: function(res) { - if (res.cancel) { - $this.detail1StyleDefList = []; - $this.viewAceionContent(value); - } else if (res.confirm) { - $this.detail1StyleDefList = []; - $this.viewAceionContent(value); - } - } - }); - } else { - $this.detail1StyleDefList = []; - $this.viewAceionContent(value); - } - } - } - - } catch (ex) { - let actionList = (result.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 } } @@ -1712,109 +1717,111 @@ confirmText: this.translateSys( 'close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionList = result.action || [] + actionList.forEach(item => { + if (item.action_type == + "goback_to_pre_page" + ) { //杩斿洖涓婁竴椤�+ var value = item.value; + uni.navigateBack({ + delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 + }); + } else if (item + .action_type == + "hidden_button" + ) { //闅愯棌鎸夐挳 + var value = item.value; + value.forEach(btn => { + var index = + $this + .param + .ListPage + .Page_Button + .findIndex( + button => + button + .ShowName == + btn + ) + if (index > + -1) + $this + .param + .ListPage + .Page_Button + .splice( + index, + 1) + }) + // } else if(item.action_type == "refresh_cur_row"){ // + // var value = item.value; + } else if (item + .action_type == + "set_panel_html" + ) { //鏄剧ずHtml椤甸潰 + // var value = item.value; + $this.ListHtml_Panel = + item.value; + // $this.detail1StyleDefList.forEach((ele,index)=>{ + // ele.ListHtml_Panel = item.value[index]; + // }); + + } else { + uni.showModal({ + title: this + .translateSys( + "tip" + ), + content: this + .translateSys( + "quotation_mark_left" + ) + + item + .action_type + + this + .translateSys( + "quotation_mark_right" + ) + + this + .translate( + "tip_action_unprocessed" + ), + showCancel: false, + confirmText: this + .translateSys( + 'close' + ) + }); + } + }); + + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - var actionList = result.action || [] - actionList.forEach(item => { - if (item.action_type == - "goback_to_pre_page" - ) { //杩斿洖涓婁竴椤�- var value = item.value; - uni.navigateBack({ - delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 - }); - } else if (item - .action_type == - "hidden_button" - ) { //闅愯棌鎸夐挳 - var value = item.value; - value.forEach(btn => { - var index = - $this - .param - .ListPage - .Page_Button - .findIndex( - button => - button - .ShowName == - btn - ) - if (index > - -1) - $this - .param - .ListPage - .Page_Button - .splice( - index, - 1) - }) - // } else if(item.action_type == "refresh_cur_row"){ // - // var value = item.value; - } else if (item - .action_type == - "set_panel_html" - ) { //鏄剧ずHtml椤甸潰 - // var value = item.value; - $this.ListHtml_Panel = - item.value; - // $this.detail1StyleDefList.forEach((ele,index)=>{ - // ele.ListHtml_Panel = item.value[index]; - // }); - - } else { - uni.showModal({ - title: this - .translateSys( - "tip" - ), - content: this - .translateSys( - "quotation_mark_left" - ) + - item - .action_type + - this - .translateSys( - "quotation_mark_right" - ) + - this - .translate( - "tip_action_unprocessed" - ), - showCancel: false, - confirmText: this - .translateSys( - 'close' - ) - }); - } - }); - - } catch (ex) { - let actionList = (result.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 } } diff --git a/pages/modal/3200_view.vue b/pages/modal/3200_view.vue index 28c8e74..f845360 100644 --- a/pages/modal/3200_view.vue +++ b/pages/modal/3200_view.vue @@ -492,59 +492,61 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionList = result.action || [] + actionList.forEach(item => { + if (item.action_type == "goback_to_pre_page") { //杩斿洖涓婁竴椤�+ var value = item.value; + // const eventChannel = this.getOpenerEventChannel(); + // // const eventChannel = this.getOpenerEventChannel(); + // eventChannel.emit('ExitViewEvent',""); + uni.navigateBack({ + delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 + }); + } else if (item.action_type == "hidden_button") { //闅愯棌鎸夐挳 + var value = item.value; + value.forEach(btn => { + var index = $this.param.ViewPage.Page_Button + .findIndex(button => button.ShowName == + btn) + if (index > -1) + $this.param.ViewPage.Page_Button.splice( + index, 1) + }) + } else if (item.action_type == "set_panel_html") { //鏄剧ずHtml椤甸潰 + // var value = item.value; + $this.ViewHtml_Panel = item.value; + + } + + }); + + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - var actionList = result.action || [] - actionList.forEach(item => { - if (item.action_type == "goback_to_pre_page") { //杩斿洖涓婁竴椤�- var value = item.value; - // const eventChannel = this.getOpenerEventChannel(); - // // const eventChannel = this.getOpenerEventChannel(); - // eventChannel.emit('ExitViewEvent',""); - uni.navigateBack({ - delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 - }); - } else if (item.action_type == "hidden_button") { //闅愯棌鎸夐挳 - var value = item.value; - value.forEach(btn => { - var index = $this.param.ViewPage.Page_Button - .findIndex(button => button.ShowName == - btn) - if (index > -1) - $this.param.ViewPage.Page_Button.splice( - index, 1) - }) - } else if (item.action_type == "set_panel_html") { //鏄剧ずHtml椤甸潰 - // var value = item.value; - $this.ViewHtml_Panel = item.value; - - } - - }); - - } catch (ex) { - let actionList = (result.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 } } diff --git a/pages/modal/3201.vue b/pages/modal/3201.vue index cd3e95b..cf709cb 100644 --- a/pages/modal/3201.vue +++ b/pages/modal/3201.vue @@ -248,42 +248,45 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionList = result.action || [] + actionList.forEach(item => { + if (item.action_type == "set_query_condition") { + var value = item.value; + $this.wheres = value.condition; + $this.orderby = value.order ? value.order : $this + .orderby; + $this.loadDataGetList(clsid, index); + } + + }); + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - var actionList = result.action || [] - actionList.forEach(item => { - if (item.action_type == "set_query_condition") { - var value = item.value; - $this.wheres = value.condition; - $this.orderby = value.order ? value.order : $this - .orderby; - $this.loadDataGetList(clsid, index); - } - - }); - } catch (ex) { - let actionList = (result.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 } } diff --git a/pages/modal/3202.vue b/pages/modal/3202.vue index 8b09391..1925510 100644 --- a/pages/modal/3202.vue +++ b/pages/modal/3202.vue @@ -537,48 +537,50 @@ confirmText: this.translateSys( 'close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionList = result.action || [] + actionList.forEach(item => { + if (item.action_type == "jump_pda_page") { + // value = {"attr":"xxx", "value":"xxx"} + var data = item.value; + uni.navigateTo({ + url: `../modal/3202_view?param=${JSON.stringify($this.param)}&titlename=${data.page?.page_name || ""}&dataObj=${JSON.stringify(data)}`, + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁 + ExitViewEvent: function(data) { + console.log(data); + this.runCustomEvent(data); + } + } + }); + } + }) + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - var actionList = result.action || [] - actionList.forEach(item => { - if (item.action_type == "jump_pda_page") { - // value = {"attr":"xxx", "value":"xxx"} - var data = item.value; - uni.navigateTo({ - url: `../modal/3202_view?param=${JSON.stringify($this.param)}&titlename=${data.page?.page_name || ""}&dataObj=${JSON.stringify(data)}`, - events: { - // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁 - ExitViewEvent: function(data) { - console.log(data); - this.runCustomEvent(data); - } - } - }); - } - }) - } catch (ex) { - let actionList = (result.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 } } @@ -753,69 +755,73 @@ confirmText: this.translateSys( 'close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionlist = result.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_query_condition") { + $this.wheres = value.condition; + $this.orderby = value.order ? value.order : "" + $this.pageindex = 1; + $this.query_id = ""; + $this.detail1StyleDefList = []; + $this.loadDataGetList(); + } else if (action_type == "set_subtable_page_content") { + if (value.clear_confirm != false && value.clear == true && + $this.detail1StyleDefList.length > 0 + ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�+ uni.showModal({ + title: this.translateSys('tip'), + content: this.translate( + "are_you_sure_clear_data"), + cancelText: $this.translateSys('ok'), + confirmText: $this.translateSys('cancel'), + success: function(res) { + if (res.cancel) { + $this.detail1StyleDefList = []; + $this.viewAceionContent(value); + } else if (res.confirm) { + $this.detail1StyleDefList = []; + $this.viewAceionContent(value); + } + } + }); + } else { + $this.detail1StyleDefList = []; + $this.viewAceionContent(value); + } + } + } + + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - var actionlist = result.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_query_condition") { - $this.wheres = value.condition; - $this.orderby = value.order ? value.order : "" - $this.pageindex = 1; - $this.query_id = ""; - $this.detail1StyleDefList = []; - $this.loadDataGetList(); - } else if (action_type == "set_subtable_page_content") { - if (value.clear_confirm != false && value.clear == true && - $this.detail1StyleDefList.length > 0 - ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�- uni.showModal({ - title: this.translateSys('tip'), - content: this.translate("are_you_sure_clear_data"), - cancelText: $this.translateSys('ok'), - confirmText: $this.translateSys('cancel'), - success: function(res) { - if (res.cancel) { - $this.detail1StyleDefList = []; - $this.viewAceionContent(value); - } else if (res.confirm) { - $this.detail1StyleDefList = []; - $this.viewAceionContent(value); - } - } - }); - } else { - $this.detail1StyleDefList = []; - $this.viewAceionContent(value); - } - } - } - - } catch (ex) { - let actionList = (result.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 } } @@ -1075,67 +1081,69 @@ confirmText: this.translateSys( 'close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionList = result.action || [] + actionList.forEach(item => { + if (item.action_type == + "goback_to_pre_page") { //杩斿洖涓婁竴椤�+ var value = item.value; + uni.navigateBack({ + delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 + }); + } else { + uni.showModal({ + title: this + .translateSys( + "tip" + ), + content: this + .translateSys( + "quotation_mark_left" + ) + + item + .action_type + + this + .translateSys( + "quotation_mark_right" + ) + + this + .translate( + "tip_action_unprocessed" + ), + showCancel: false, + confirmText: this + .translateSys( + 'close' + ) + }); + } + }); + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - var actionList = result.action || [] - actionList.forEach(item => { - if (item.action_type == - "goback_to_pre_page") { //杩斿洖涓婁竴椤�- var value = item.value; - uni.navigateBack({ - delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 - }); - } else { - uni.showModal({ - title: this - .translateSys( - "tip" - ), - content: this - .translateSys( - "quotation_mark_left" - ) + - item - .action_type + - this - .translateSys( - "quotation_mark_right" - ) + - this - .translate( - "tip_action_unprocessed" - ), - showCancel: false, - confirmText: this - .translateSys( - 'close' - ) - }); - } - }); - } catch (ex) { - let actionList = (result.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 } } diff --git a/pages/modal/3202_view.vue b/pages/modal/3202_view.vue index bb1e2f7..2c8d702 100644 --- a/pages/modal/3202_view.vue +++ b/pages/modal/3202_view.vue @@ -455,67 +455,69 @@ confirmText: this.translateSys( 'close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionList = result.action || [] + actionList.forEach(item => { + if (item.action_type == "goback_to_pre_page") { //杩斿洖涓婁竴椤�+ var value = item.value; + uni.navigateBack({ + delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 + }); + } else { + uni.showModal({ + title: this + .translateSys( + "tip" + ), + content: this + .translateSys( + "quotation_mark_left" + ) + + item + .action_type + + this + .translateSys( + "quotation_mark_right" + ) + + this + .translate( + "tip_action_unprocessed" + ), + showCancel: false, + confirmText: this + .translateSys( + 'close' + ) + }); + } + }); + + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - var actionList = result.action || [] - actionList.forEach(item => { - if (item.action_type == "goback_to_pre_page") { //杩斿洖涓婁竴椤�- var value = item.value; - uni.navigateBack({ - delta: 1, //杩斿洖灞傛暟锛�鍒欎笂涓婇〉 - }); - } else { - uni.showModal({ - title: this - .translateSys( - "tip" - ), - content: this - .translateSys( - "quotation_mark_left" - ) + - item - .action_type + - this - .translateSys( - "quotation_mark_right" - ) + - this - .translate( - "tip_action_unprocessed" - ), - showCancel: false, - confirmText: this - .translateSys( - 'close' - ) - }); - } - }); - - } catch (ex) { - let actionList = (result.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 } } diff --git a/pages/modal/5601.vue b/pages/modal/5601.vue index 2d5a5eb..924be99 100644 --- a/pages/modal/5601.vue +++ b/pages/modal/5601.vue @@ -894,44 +894,45 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionList = result.action || [] + actionList.forEach(item => { + if (item.action_type == "set_dlg_attr") { + // value = {"attr":"xxx", "value":"xxx"} + var data = item.value; + this.setDetailFormValues(data, style, pageIndex) + } else if (item.action_type == 'set_dlg_attr_show') { + var data = item.value; + this.setDetailFormItemVisible(data, style, pageIndex) + } + }); + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } } - try { - var actionList = result.action || [] - actionList.forEach(item => { - if (item.action_type == "set_dlg_attr") { - // value = {"attr":"xxx", "value":"xxx"} - var data = item.value; - this.setDetailFormValues(data, style, pageIndex) - } else if (item.action_type == 'set_dlg_attr_show') { - var data = item.value; - this.setDetailFormItemVisible(data, style, pageIndex) - } - }); - } catch (ex) { - let actionList = (result.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 - } - } @@ -1116,147 +1117,148 @@ confirmText: this.translateSys( 'close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + let actionList = result.action || [] + actionList.forEach(item => { + if (item.action_type == "insert_subtable_page_row") { //鐮佺洏涓�+ $this.param.Show_Welcom_Page = false; + var value = item.value; + $this.viewAceionRow(value); + } else if (item.action_type == + "set_subtable_page_content") { //宸茬爜鐩�+ $this.param.Show_Welcom_Page = false; + var value = item.value; + const pageData = $this.pageDetail.find((page) => { + return value.page_name == page.Name; + }); + if (value.clear_confirm != false && value.clear == true && + pageData && pageData.DefList.length > 0 + ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�+ uni.showModal({ + title: this.translateSys('tip'), + content: this.translate( + "are_you_sure_clear_first") + + this.translateSys( + "quotation_mark_left") + + value.page_name + + this.translateSys( + "quotation_mark_right") + + this.translate( + "are_you_sure_clear_last"), + cancelText: $this.translateSys('ok'), + confirmText: $this.translateSys('cancel'), + success: function(res) { + if (res.cancel) { + if (pageData) + pageData.DefList = []; + $this.viewAceionContent(value); + } else if (res.confirm) { + if (pageData) + pageData.DefList = []; + $this.viewAceionContent(value); + } + } + }); + } else { + if (pageData) + pageData.DefList = []; + $this.viewAceionContent(value); + } + } else if (item.action_type == "select_subtable_page") { + var value = item.value; + const pageIndex = $this.pageDetail.findIndex((page) => { + return value.page_name == page.Name; + }); + if (pageIndex > -1) { + $this.setData({ + current: pageIndex + }) + } + } else if (item.action_type == "select_subtable_page_row") { + // value = {"page_name":"鐮佺洏涓�, "row":{"id":"xx"}} + var value = item.value; + $this.viewActionSelectRow(value) + } else if (item.action_type == + "remove_subtable_page_row") { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹�+ var value = item.value; + $this.viewActionRemoveRow(value) + } else if (item.action_type == "set_subtable_page_row") { + $this.viewActionSetRow(item.value) + + } else if (item.action_type == "set_subtable_page_ext_data") { + var value = item.value; + const pageData = $this.pageDetail.find((page) => { + return value.page_name == page.Name; + }); + if (pageData) + pageData.ExtData = value.ext_data + + } else if (item.action_type == "clear_subpage_rows") { + var value = item.value; + const pageIndex = $this.pageDetail.findIndex((page) => { + return value.page_name == page.Name; + }); + if (pageIndex > -1) { + const pageData = $this.pageDetail[pageIndex] + pageData.DefList = [] + pageData.ExtData = {} + + $this.$set(this.pageDetail, pageIndex, pageData) + } + + } else if (item.action_type == "set_dlg_current_edit_attr") { + + if ($this.focusOldFieldId == item.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this.focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: item.value + }) + }); + } else if (item.action_type == "set_dlg_attr") { + // value = {"attr":"xxx", "value":"xxx"} + var data = item.value; + $this.setFormValues(data) + } else if (item.action_type == 'set_dlg_attr_show') { + var data = item.value; + $this.setFormItemVisible(data) + } + }); + + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } } - try { - let actionList = result.action || [] - actionList.forEach(item => { - if (item.action_type == "insert_subtable_page_row") { //鐮佺洏涓�- $this.param.Show_Welcom_Page = false; - var value = item.value; - $this.viewAceionRow(value); - } else if (item.action_type == - "set_subtable_page_content") { //宸茬爜鐩�- $this.param.Show_Welcom_Page = false; - var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; - }); - if (value.clear_confirm != false && value.clear == true && - pageData && pageData.DefList.length > 0 - ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�- uni.showModal({ - title: this.translateSys('tip'), - content: this.translate( - "are_you_sure_clear_first") + - this.translateSys( - "quotation_mark_left") + - value.page_name + - this.translateSys( - "quotation_mark_right") + - this.translate( - "are_you_sure_clear_last"), - cancelText: $this.translateSys('ok'), - confirmText: $this.translateSys('cancel'), - success: function(res) { - if (res.cancel) { - if (pageData) - pageData.DefList = []; - $this.viewAceionContent(value); - } else if (res.confirm) { - if (pageData) - pageData.DefList = []; - $this.viewAceionContent(value); - } - } - }); - } else { - if (pageData) - pageData.DefList = []; - $this.viewAceionContent(value); - } - } else if (item.action_type == "select_subtable_page") { - var value = item.value; - const pageIndex = $this.pageDetail.findIndex((page) => { - return value.page_name == page.Name; - }); - if (pageIndex > -1) { - $this.setData({ - current: pageIndex - }) - } - } else if (item.action_type == "select_subtable_page_row") { - // value = {"page_name":"鐮佺洏涓�, "row":{"id":"xx"}} - var value = item.value; - $this.viewActionSelectRow(value) - } else if (item.action_type == - "remove_subtable_page_row") { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹�- var value = item.value; - $this.viewActionRemoveRow(value) - } else if (item.action_type == "set_subtable_page_row") { - $this.viewActionSetRow(item.value) - - } else if (item.action_type == "set_subtable_page_ext_data") { - var value = item.value; - const pageData = $this.pageDetail.find((page) => { - return value.page_name == page.Name; - }); - if (pageData) - pageData.ExtData = value.ext_data - - } else if (item.action_type == "clear_subpage_rows") { - var value = item.value; - const pageIndex = $this.pageDetail.findIndex((page) => { - return value.page_name == page.Name; - }); - if (pageIndex > -1) { - const pageData = $this.pageDetail[pageIndex] - pageData.DefList = [] - pageData.ExtData = {} - - $this.$set(this.pageDetail, pageIndex, pageData) - } - - } else if (item.action_type == "set_dlg_current_edit_attr") { - - if ($this.focusOldFieldId == item.value) { - $this.setData({ - focusFieldId: "" - }) - } else { - $this.setData({ - focusFieldId: $this.focusOldFieldId - }) - } - $this.$nextTick(() => { - $this.setData({ - focusFieldId: item.value - }) - }); - } else if (item.action_type == "set_dlg_attr") { - // value = {"attr":"xxx", "value":"xxx"} - var data = item.value; - $this.setFormValues(data) - } else if (item.action_type == 'set_dlg_attr_show') { - var data = item.value; - $this.setFormItemVisible(data) - } - }); - - } catch (ex) { - let actionList = (result.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 - } - } @@ -2166,63 +2168,64 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { - $this.setFormValues(data.result || []) - } 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; - $this.setFormValues(result) - } else if (action.action_type == 'set_dlg_attr_show') { - var result = action.value; - $this.setFormItemVisible(result) - - // console.log($this.head_styledef); - } else if (action.action_type == 'set_global_attr') { - $this.global_attr = action.value || []; - } else { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { + $this.setFormValues(data.result || []) + } else if (typeof data.result == 'string') { + if (data.result) { uni.showModal({ - title: this.translateSys("tip"), - content: this.translateSys( - "quotation_mark_left") + - action - .action_type + this.translateSys( - "quotation_mark_right") + this - .translate( - "tip_action_unprocessed"), + 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; + $this.setFormValues(result) + } else if (action.action_type == 'set_dlg_attr_show') { + var result = action.value; + $this.setFormItemVisible(result) + + // console.log($this.head_styledef); + } else if (action.action_type == 'set_global_attr') { + $this.global_attr = action.value || []; + } else { + uni.showModal({ + title: this.translateSys("tip"), + content: this.translateSys( + "quotation_mark_left") + + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed"), + 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 + } 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 => { @@ -2338,210 +2341,212 @@ showCancel: false, confirmText: $this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } else if (typeof data.result == 'string') { - if (data.result) { - uni.showModal({ - title: this.translateSys('tip'), - content: data.result, - showCancel: false, - confirmText: this.translateSys('close') - }); + } 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.length; i++) { - var action = actions[i]; - console.log(action) - var val = action.value; - var enviroment = JSON.stringify(enviroment); + try { + var actions = data.action || [] + for (var i = 0; i < actions.length; i++) { + var action = actions[i]; + console.log(action) + var val = action.value; + var enviroment = JSON.stringify(enviroment); - if (action.action_type == 'open_panel') { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action - .action_type + $this.translateSys( - "quotation_mark_right") + $this - .translate( - "tip_action_unprocessed") - }); - d.show(); - } else if (action.action_type == 'open_select_userdlg') { - var style = val.style; - // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' - var param = { - item: item, - button_callback: button_callback, - req: req, - data_attr: data_attr - } - uni.navigateTo({ - url: '../selpsn/index?mulit=false¶m=' + - JSON - .stringify( - param), - events: { - AddPer(data, param) { - // console.log(param); - console.log(data); - var callback_eventid = param - .button_callback - .trim(); - var info = { - eventid: callback_eventid, - edtype: "0", - projectid: '', - rclsid: '', - robjid: '', - userlogin: '', - clsid: $this.param - .DataCls - .id, - objid: "", - attr: param.req, - inputparameter: data, - dataJson: [], - } - $this.DataObjRunCustomEvent(info, - param - .data_attr); - } - } - }); - } else if (action.action_type == 'open_data_query_dlg') { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action - .action_type + $this.translateSys( - "quotation_mark_right") + $this - .translate( - "tip_action_unprocessed") - }); - d.show(); - } else if (action.action_type == 'open_common_dlg') { - - if (val.common_dlg_id == 'check_list') { - $this.setData({ - check_list: val.config - }) - console.log($this.check_list) - if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.setData({ - popupType: "right" - }) - else - $this.setData({ - popupType: "center" - }) - // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this.$refs.popup.open($this.popupType); - var popupParam = { + if (action.action_type == 'open_panel') { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action + .action_type + $this.translateSys( + "quotation_mark_right") + $this + .translate( + "tip_action_unprocessed") + }); + d.show(); + } else if (action.action_type == 'open_select_userdlg') { + var style = val.style; + // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' + var param = { item: item, button_callback: button_callback, req: req, data_attr: data_attr } - $this.setData({ - popupParam: popupParam - }) - } - } else if (action.action_type == 'open_project_query_dlg') { - //console.log(action.value.select_range); - //console.log(action.value.mulit_select); - var priRel = '-1'; - if (action.value.select_range == '鍏ㄩ儴鐩稿叧') - priRel = '0'; - else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰') - priRel = '1'; - else if (action.value.select_range == '鎴戝垱寤虹殑') - priRel = '2'; - else if (action.value.select_range == '鎴戝弬涓庣殑' || action - .value - .select_range == '鎴戝弬鍔犵殑') - priRel = '3'; - else if (action.value.select_range == '鎴戝叧娉ㄧ殑') - priRel = '4'; - else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰') - priRel = '5'; - var param_ = { - item: item, - button_callback: button_callback, - req: req - } - uni.navigateTo({ - url: '../selPrj/index?relation=' + priRel + - '¶m=' + - JSON.stringify(param_), - events: { - AddPer(data, param) { - var attr = param.item.fieldId; - $this.head_styledef.form.model[ - attr] = - data[0].ID + - ';' + data[0].Name; - - // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; - // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; - var callback_eventid = param - .button_callback - .trim(); - if (callback_eventid) { + uni.navigateTo({ + url: '../selpsn/index?mulit=false¶m=' + + JSON + .stringify( + param), + events: { + AddPer(data, param) { + // console.log(param); + console.log(data); + var callback_eventid = param + .button_callback + .trim(); var info = { eventid: callback_eventid, - edtype: "2", - projectid: data[0].ID, - rclsid: "", - robjid: "", - userlogin: "", - clsid: $this.$data - .param - .DataCls.id, + edtype: "0", + projectid: '', + rclsid: '', + robjid: '', + userlogin: '', + clsid: $this.param + .DataCls + .id, objid: "", attr: param.req, + inputparameter: data, dataJson: [], } - - $this.DataObjRunCustomEvent( - info); + $this.DataObjRunCustomEvent(info, + param + .data_attr); } } - } - }); - } else { - uni.showModal({ - title: $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action.action_type + $this.translateSys( - "quotation_mark_right") + $this - .translate( - "tip_action_unprocessed"), - showCancel: false, - confirmText: $this.translateSys('close') - }); - } - } + }); + } else if (action.action_type == 'open_data_query_dlg') { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action + .action_type + $this.translateSys( + "quotation_mark_right") + $this + .translate( + "tip_action_unprocessed") + }); + d.show(); + } else if (action.action_type == 'open_common_dlg') { - } 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 + if (val.common_dlg_id == 'check_list') { + $this.setData({ + check_list: val.config + }) + console.log($this.check_list) + if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ $this.setData({ + popupType: "right" + }) + else + $this.setData({ + popupType: "center" + }) + // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� + $this.$refs.popup.open($this.popupType); + var popupParam = { + item: item, + button_callback: button_callback, + req: req, + data_attr: data_attr + } + $this.setData({ + popupParam: popupParam + }) + } + } else if (action.action_type == 'open_project_query_dlg') { + //console.log(action.value.select_range); + //console.log(action.value.mulit_select); + var priRel = '-1'; + if (action.value.select_range == '鍏ㄩ儴鐩稿叧') + priRel = '0'; + else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰') + priRel = '1'; + else if (action.value.select_range == '鎴戝垱寤虹殑') + priRel = '2'; + else if (action.value.select_range == '鎴戝弬涓庣殑' || action + .value + .select_range == '鎴戝弬鍔犵殑') + priRel = '3'; + else if (action.value.select_range == '鎴戝叧娉ㄧ殑') + priRel = '4'; + else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰') + priRel = '5'; + var param_ = { + item: item, + button_callback: button_callback, + req: req + } + uni.navigateTo({ + url: '../selPrj/index?relation=' + priRel + + '¶m=' + + JSON.stringify(param_), + events: { + AddPer(data, param) { + var attr = param.item.fieldId; + $this.head_styledef.form.model[ + attr] = + data[0].ID + + ';' + data[0].Name; + + // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; + var callback_eventid = param + .button_callback + .trim(); + if (callback_eventid) { + var info = { + eventid: callback_eventid, + edtype: "2", + projectid: data[0].ID, + rclsid: "", + robjid: "", + userlogin: "", + clsid: $this.$data + .param + .DataCls.id, + objid: "", + attr: param.req, + dataJson: [], + } + + $this.DataObjRunCustomEvent( + info); + } + } + } + }); + } else { + uni.showModal({ + title: $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action.action_type + $this.translateSys( + "quotation_mark_right") + $this + .translate( + "tip_action_unprocessed"), + 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 + } } } @@ -2998,203 +3003,204 @@ confirmText: this.translateSys( 'close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + let actionList = result.action || [] + actionList.forEach(item => { + if (item.action_type == + "insert_subtable_page_row") { //鐮佺洏涓�+ var value = item.value; + //鍔犺浇宸茬粡鐮佺洏鏁版嵁 + $this.viewAceionRow(value); + //娓呯┖鏉$爜鍐呭 + $this.head_styledef.form.items.forEach((item, + index) => { + if (item.fieldId != + "S_CNTR_CODE") { + item.value = ''; + item.oldvalue = ''; + $this.head_styledef.form.model[ + item + .fieldId] = ''; + } + }); + + uni.showModal({ + title: $this.translateSys("tip"), + content: $this.translate( + 'execute_event_success'), + showCancel: false, + confirmText: $this.translateSys( + 'close') + }); + } else if (item.action_type == + "set_subtable_page_content" + ) { //宸茬爜鐩�+ $this.param.Show_Welcom_Page = false; + var value = item.value; + const pageData = $this.pageDetail.find(( + page) => { + return value.page_name == page + .Name; + }); + if (value.clear_confirm != false && value + .clear == true && + pageData && pageData.DefList.length > 0 + ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�+ uni.showModal({ + title: $this.translateSys( + 'tip'), + content: $this.translate( + "are_you_sure_clear_first" + ) + + $this.translateSys( + "quotation_mark_left" + ) + + value.page_name + + $this.translateSys( + "quotation_mark_right" + ) + + $this.translate( + "are_you_sure_clear_last" + ), + cancelText: $this.translateSys( + 'ok'), + confirmText: $this + .translateSys('cancel'), + success: function(res) { + if (res.cancel) { + if (pageData) + pageData + .DefList = []; + $this + .viewAceionContent( + value); + } else if (res + .confirm) { + if (pageData) + pageData + .DefList = []; + $this + .viewAceionContent( + value); + } + } + }); + } else { + if (pageData) + pageData.DefList = []; + $this.viewAceionContent(value); + } + } else if (item.action_type == + "select_subtable_page") { + var value = item.value; + const pageIndex = $this.pageDetail.findIndex(( + page) => { + return value.page_name == page + .Name; + }); + if (pageIndex > -1) { + $this.setData({ + current: pageIndex + }) + } + } else if (item.action_type == + "remove_subtable_page_row") { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹�+ let value = item.value; + $this.viewActionRemoveRow(value) + } else if (item.action_type == + "set_subtable_page_row") { + $this.viewActionSetRow(item.value) + } else if (item.action_type == + "set_subtable_page_ext_data") { + let value = item.value; + const pageData = $this.pageDetail.find(( + page) => { + return value.page_name == page + .Name; + }); + if (pageData) { + pageData.ExtData = value.ext_data + } + + } else if (item.action_type == + "clear_subpage_rows") { + var value = item.value; + const pageIndex = $this.pageDetail.findIndex(( + page) => { + return value.page_name == page + .Name; + }); + if (pageIndex > -1) { + const pageData = $this.pageDetail[ + pageIndex] + pageData.DefList = [] + pageData.ExtData = {} + + $this.$set(this.pageDetail, pageIndex, + pageData) + } + } else if (item.action_type == + "set_dlg_current_edit_attr") { + if ($this.focusOldFieldId == item.value) + $this.setData({ + focusFieldId: "" + }) + else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: item + .value + }) + }); + } else if (item.action_type == + "set_dlg_attr") { + // value = {"attr":"xxx", "value":"xxx"} + var data = item.value; + $this.setFormValues(data) + } else if (item.action_type == 'set_dlg_attr_show') { + var data = item.value; + $this.setFormItemVisible(data) + } + + }); + + if ($this.After_OK_Event?.ID && $this.After_OK_Event.ID != event + .ID) { //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢 + $this.sava(pageParam, $this.After_OK_Event); //鎵ц纭畾鍚庝簨浠�+ + } + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - let actionList = result.action || [] - actionList.forEach(item => { - if (item.action_type == - "insert_subtable_page_row") { //鐮佺洏涓�- var value = item.value; - //鍔犺浇宸茬粡鐮佺洏鏁版嵁 - $this.viewAceionRow(value); - //娓呯┖鏉$爜鍐呭 - $this.head_styledef.form.items.forEach((item, - index) => { - if (item.fieldId != - "S_CNTR_CODE") { - item.value = ''; - item.oldvalue = ''; - $this.head_styledef.form.model[ - item - .fieldId] = ''; - } - }); - - uni.showModal({ - title: $this.translateSys("tip"), - content: $this.translate( - 'execute_event_success'), - showCancel: false, - confirmText: $this.translateSys( - 'close') - }); - } else if (item.action_type == - "set_subtable_page_content" - ) { //宸茬爜鐩�- $this.param.Show_Welcom_Page = false; - var value = item.value; - const pageData = $this.pageDetail.find(( - page) => { - return value.page_name == page - .Name; - }); - if (value.clear_confirm != false && value - .clear == true && - pageData && pageData.DefList.length > 0 - ) { //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鐮佺洏鏄惁鏈夋暟鎹�- uni.showModal({ - title: $this.translateSys( - 'tip'), - content: $this.translate( - "are_you_sure_clear_first" - ) + - $this.translateSys( - "quotation_mark_left" - ) + - value.page_name + - $this.translateSys( - "quotation_mark_right" - ) + - $this.translate( - "are_you_sure_clear_last" - ), - cancelText: $this.translateSys( - 'ok'), - confirmText: $this - .translateSys('cancel'), - success: function(res) { - if (res.cancel) { - if (pageData) - pageData - .DefList = []; - $this - .viewAceionContent( - value); - } else if (res - .confirm) { - if (pageData) - pageData - .DefList = []; - $this - .viewAceionContent( - value); - } - } - }); - } else { - if (pageData) - pageData.DefList = []; - $this.viewAceionContent(value); - } - } else if (item.action_type == - "select_subtable_page") { - var value = item.value; - const pageIndex = $this.pageDetail.findIndex(( - page) => { - return value.page_name == page - .Name; - }); - if (pageIndex > -1) { - $this.setData({ - current: pageIndex - }) - } - } else if (item.action_type == - "remove_subtable_page_row") { //娓呴櫎闈㈡澘涓寚瀹歩d鐨勬暟鎹�- let value = item.value; - $this.viewActionRemoveRow(value) - } else if (item.action_type == - "set_subtable_page_row") { - $this.viewActionSetRow(item.value) - } else if (item.action_type == - "set_subtable_page_ext_data") { - let value = item.value; - const pageData = $this.pageDetail.find(( - page) => { - return value.page_name == page - .Name; - }); - if (pageData) { - pageData.ExtData = value.ext_data - } - - } else if (item.action_type == - "clear_subpage_rows") { - var value = item.value; - const pageIndex = $this.pageDetail.findIndex(( - page) => { - return value.page_name == page - .Name; - }); - if (pageIndex > -1) { - const pageData = $this.pageDetail[ - pageIndex] - pageData.DefList = [] - pageData.ExtData = {} - - $this.$set(this.pageDetail, pageIndex, - pageData) - } - } else if (item.action_type == - "set_dlg_current_edit_attr") { - if ($this.focusOldFieldId == item.value) - $this.setData({ - focusFieldId: "" - }) - else { - $this.setData({ - focusFieldId: $this - .focusOldFieldId - }) - } - $this.$nextTick(() => { - $this.setData({ - focusFieldId: item - .value - }) - }); - } else if (item.action_type == - "set_dlg_attr") { - // value = {"attr":"xxx", "value":"xxx"} - var data = item.value; - $this.setFormValues(data) - } else if (item.action_type == 'set_dlg_attr_show') { - var data = item.value; - $this.setFormItemVisible(data) - } - - }); - - if ($this.After_OK_Event?.ID && $this.After_OK_Event.ID != event - .ID) { //鍒ゆ柇褰撳墠浜嬩欢鏄惁鏄‘瀹氬悗浜嬩欢 - $this.sava(pageParam, $this.After_OK_Event); //鎵ц纭畾鍚庝簨浠�- - } - } catch (ex) { - let actionList = (result.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 - } - + }if ([0, 2, 3, 4, -1].includes(result.result_type)) { } }).catch(ex => { diff --git a/pages/modal/form/index.vue b/pages/modal/form/index.vue index efb6e0c..18eb702 100644 --- a/pages/modal/form/index.vue +++ b/pages/modal/form/index.vue @@ -480,68 +480,70 @@ confirmText: this.translateSys( 'close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionList = result.action || [] + actionList.forEach(item => { + + if (item.action_type == + "set_dlg_current_edit_attr" + ) { + + if ($this + .focusOldFieldId == + item.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: item + .value + }) + }); + } else if (item.action_type == + "set_dlg_attr") { + // value = {"attr":"xxx", "value":"xxx"} + var data = item.value; + $this.setFormValues(data) + } else if (action.action_type == 'set_dlg_attr_show') { + var data = action.value; + + $this.setFormItemVisible(data) + } + }); + + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } - } - try { - var actionList = result.action || [] - actionList.forEach(item => { - - if (item.action_type == - "set_dlg_current_edit_attr" - ) { - - if ($this - .focusOldFieldId == - item.value) { - $this.setData({ - focusFieldId: "" - }) - } else { - $this.setData({ - focusFieldId: $this - .focusOldFieldId - }) - } - $this.$nextTick(() => { - $this.setData({ - focusFieldId: item - .value - }) - }); - } else if (item.action_type == - "set_dlg_attr") { - // value = {"attr":"xxx", "value":"xxx"} - var data = item.value; - $this.setFormValues(data) - } else if (action.action_type == 'set_dlg_attr_show') { - var data = action.value; - - $this.setFormItemVisible(data) - } - }); - - } catch (ex) { - let actionList = (result.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 } } @@ -802,72 +804,73 @@ confirmText: this.translateSys( 'close') }); - if (result.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(result.result_type)) { + if (result.result_type == 2) { - } else if (typeof result.result == 'string') { - if (result.result) { + } else if (typeof result.result == 'string') { + if (result.result) { + uni.showModal({ + title: this.translateSys('tip'), + content: result.result, + showCancel: false, + confirmText: this.translateSys('close') + }); + } + } + try { + var actionList = result.action || [] + actionList.forEach(item => { + + if (item.action_type == + "set_dlg_current_edit_attr" + ) { + + if ($this + .focusOldFieldId == + item.value) { + $this.setData({ + focusFieldId: "" + }) + } else { + $this.setData({ + focusFieldId: $this + .focusOldFieldId + }) + } + $this.$nextTick(() => { + $this.setData({ + focusFieldId: item + .value + }) + }); + } else if (item.action_type == + "set_dlg_attr") { + // value = {"attr":"xxx", "value":"xxx"} + var data = item.value; + $this.setFormValues(data) + } else if (action.action_type == + 'set_dlg_attr_show') { + var data = action.value; + + $this.setFormItemVisible(data) + } + }); + + } catch (ex) { + let actionList = (result.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: result.result, + content: tip, showCancel: false, confirmText: this.translateSys('close') }); + console.log(ex) + return } } - try { - var actionList = result.action || [] - actionList.forEach(item => { - - if (item.action_type == - "set_dlg_current_edit_attr" - ) { - - if ($this - .focusOldFieldId == - item.value) { - $this.setData({ - focusFieldId: "" - }) - } else { - $this.setData({ - focusFieldId: $this - .focusOldFieldId - }) - } - $this.$nextTick(() => { - $this.setData({ - focusFieldId: item - .value - }) - }); - } else if (item.action_type == - "set_dlg_attr") { - // value = {"attr":"xxx", "value":"xxx"} - var data = item.value; - $this.setFormValues(data) - } else if (action.action_type == - 'set_dlg_attr_show') { - var data = action.value; - - $this.setFormItemVisible(data) - } - }); - - } catch (ex) { - let actionList = (result.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 - } - } @@ -1158,59 +1161,61 @@ showCancel: false, confirmText: this.translateSys('close') }); - if (data.result_type == 2) { - $this.setFormValues(data.result || []) - } 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; - $this.setFormValues(result) - } else if (action.action_type == 'set_dlg_attr_show') { - var result = action.value; - - $this.setFormItemVisible(result) - } else if (action.action_type == 'set_global_attr') { - $this.global_attr = action.value || []; - } else { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { + $this.setFormValues(data.result || []) + } else if (typeof data.result == 'string') { + if (data.result) { uni.showModal({ - title: this.translateSys("tip"), - content: this.translateSys( - "quotation_mark_left") + - action - .action_type + this.translateSys( - "quotation_mark_right") + this - .translate( - "tip_action_unprocessed"), + 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; + $this.setFormValues(result) + } else if (action.action_type == 'set_dlg_attr_show') { + var result = action.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 + $this.setFormItemVisible(result) + } else if (action.action_type == 'set_global_attr') { + $this.global_attr = action.value || []; + } else { + uni.showModal({ + title: this.translateSys("tip"), + content: this.translateSys( + "quotation_mark_left") + + action + .action_type + this.translateSys( + "quotation_mark_right") + this + .translate( + "tip_action_unprocessed"), + 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 + } } @@ -1324,210 +1329,211 @@ showCancel: false, confirmText: $this.translateSys('close') }); - if (data.result_type == 2) { + if ([0, 2, 3, 4, -1].includes(data.result_type)) { + if (data.result_type == 2) { - } else if (typeof data.result == 'string') { - if (data.result) { - uni.showModal({ - title: this.translateSys('tip'), - content: data.result, - showCancel: false, - confirmText: this.translateSys('close') - }); + } 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.length; i++) { - var action = actions[i]; - console.log(action) - var val = action.value; - var enviroment = JSON.stringify(enviroment); + try { + var actions = data.action || [] + for (var i = 0; i < actions.length; i++) { + var action = actions[i]; + console.log(action) + var val = action.value; + var enviroment = JSON.stringify(enviroment); - if (action.action_type == 'open_panel') { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action - .action_type + $this.translateSys( - "quotation_mark_right") + $this - .translate( - "tip_action_unprocessed") - }); - d.show(); - } else if (action.action_type == 'open_select_userdlg') { - var style = val.style; - // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' - var param = { - item: item, - button_callback: button_callback, - req: req, - data_attr: data_attr - } - uni.navigateTo({ - url: '../selpsn/index?mulit=false¶m=' + - JSON - .stringify( - param), - events: { - AddPer(data, param) { - // console.log(param); - console.log(data); - var callback_eventid = param - .button_callback - .trim(); - var info = { - eventid: callback_eventid, - edtype: "0", - projectid: '', - rclsid: '', - robjid: '', - userlogin: '', - clsid: $this.clsId, - objid: "", - attr: param.req, - inputparameter: data, - dataJson: [], - } - $this.DataObjRunCustomEvent(info, - param - .data_attr); - } - } - }); - } else if (action.action_type == 'open_data_query_dlg') { - var d = dialog({ - title: '<i class="ace-icon fa fa-info-circle"></i> ' + - $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action - .action_type + $this.translateSys( - "quotation_mark_right") + $this - .translate( - "tip_action_unprocessed") - }); - d.show(); - } else if (action.action_type == 'open_common_dlg') { - - if (val.common_dlg_id == 'check_list') { - $this.setData({ - check_list: val.config - }) - if (val.config.appear_style == - 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�- $this.setData({ - popupType: "right" - }) - else - $this.setData({ - popupType: "center" - }) - // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� - $this.$refs.popup.open($this.popupType); - var popupParam = { + if (action.action_type == 'open_panel') { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action + .action_type + $this.translateSys( + "quotation_mark_right") + $this + .translate( + "tip_action_unprocessed") + }); + d.show(); + } else if (action.action_type == 'open_select_userdlg') { + var style = val.style; + // style == 'user' ? '閫夋嫨浜哄憳' : style == 'department' ? '閫夋嫨閮ㄩ棬' : style == 'role' ? '閫夋嫨瑙掕壊' : '' + var param = { item: item, button_callback: button_callback, req: req, data_attr: data_attr } - $this.setData({ - popupParam: popupParam - }) - } - } else if (action.action_type == - 'open_project_query_dlg') { - //console.log(action.value.select_range); - //console.log(action.value.mulit_select); - var priRel = '-1'; - if (action.value.select_range == '鍏ㄩ儴鐩稿叧') - priRel = '0'; - else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰') - priRel = '1'; - else if (action.value.select_range == '鎴戝垱寤虹殑') - priRel = '2'; - else if (action.value.select_range == '鎴戝弬涓庣殑' || action - .value - .select_range == '鎴戝弬鍔犵殑') - priRel = '3'; - else if (action.value.select_range == '鎴戝叧娉ㄧ殑') - priRel = '4'; - else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰') - priRel = '5'; - var param_ = { - item: item, - button_callback: button_callback, - req: req - } - uni.navigateTo({ - url: '../selPrj/index?relation=' + priRel + - '¶m=' + - JSON.stringify(param_), - events: { - AddPer(data, param) { - var attr = param.item.fieldId; - $this.head_styledef.form.model[ - attr] = - data[0].ID + - ';' + data[0].Name; - - // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; - // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; - var callback_eventid = param - .button_callback - .trim(); - if (callback_eventid) { + uni.navigateTo({ + url: '../selpsn/index?mulit=false¶m=' + + JSON + .stringify( + param), + events: { + AddPer(data, param) { + // console.log(param); + console.log(data); + var callback_eventid = param + .button_callback + .trim(); var info = { eventid: callback_eventid, - edtype: "2", - projectid: data[0].ID, - rclsid: "", - robjid: "", - userlogin: "", + edtype: "0", + projectid: '', + rclsid: '', + robjid: '', + userlogin: '', clsid: $this.clsId, objid: "", attr: param.req, + inputparameter: data, dataJson: [], } - - $this.DataObjRunCustomEvent( - info); + $this.DataObjRunCustomEvent(info, + param + .data_attr); } } + }); + } else if (action.action_type == 'open_data_query_dlg') { + var d = dialog({ + title: '<i class="ace-icon fa fa-info-circle"></i> ' + + $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action + .action_type + $this.translateSys( + "quotation_mark_right") + $this + .translate( + "tip_action_unprocessed") + }); + d.show(); + } else if (action.action_type == 'open_common_dlg') { + + if (val.common_dlg_id == 'check_list') { + $this.setData({ + check_list: val.config + }) + if (val.config.appear_style == + 'sideslip') //鍒ゆ柇鏄惁鏄晶婊�+ $this.setData({ + popupType: "right" + }) + else + $this.setData({ + popupType: "center" + }) + // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴� + $this.$refs.popup.open($this.popupType); + var popupParam = { + item: item, + button_callback: button_callback, + req: req, + data_attr: data_attr + } + $this.setData({ + popupParam: popupParam + }) } - }); - } else { - uni.showModal({ - title: $this.translateSys("tip"), - content: $this.translateSys( - "quotation_mark_left") + - action.action_type + $this - .translateSys( - "quotation_mark_right") + $this - .translate( - "tip_action_unprocessed"), - showCancel: false, - confirmText: $this.translateSys('close') - }); + } else if (action.action_type == + 'open_project_query_dlg') { + //console.log(action.value.select_range); + //console.log(action.value.mulit_select); + var priRel = '-1'; + if (action.value.select_range == '鍏ㄩ儴鐩稿叧') + priRel = '0'; + else if (action.value.select_range == '鎴戣礋璐g殑椤圭洰') + priRel = '1'; + else if (action.value.select_range == '鎴戝垱寤虹殑') + priRel = '2'; + else if (action.value.select_range == '鎴戝弬涓庣殑' || action + .value + .select_range == '鎴戝弬鍔犵殑') + priRel = '3'; + else if (action.value.select_range == '鎴戝叧娉ㄧ殑') + priRel = '4'; + else if (action.value.select_range == '鎴戜笅灞炵殑椤圭洰') + priRel = '5'; + var param_ = { + item: item, + button_callback: button_callback, + req: req + } + uni.navigateTo({ + url: '../selPrj/index?relation=' + priRel + + '¶m=' + + JSON.stringify(param_), + events: { + AddPer(data, param) { + var attr = param.item.fieldId; + $this.head_styledef.form.model[ + attr] = + data[0].ID + + ';' + data[0].Name; + + // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; + // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; + var callback_eventid = param + .button_callback + .trim(); + if (callback_eventid) { + var info = { + eventid: callback_eventid, + edtype: "2", + projectid: data[0].ID, + rclsid: "", + robjid: "", + userlogin: "", + clsid: $this.clsId, + objid: "", + attr: param.req, + dataJson: [], + } + + $this.DataObjRunCustomEvent( + info); + } + } + } + }); + } else { + uni.showModal({ + title: $this.translateSys("tip"), + content: $this.translateSys( + "quotation_mark_left") + + action.action_type + $this + .translateSys( + "quotation_mark_right") + $this + .translate( + "tip_action_unprocessed"), + 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 } - - } 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 => { -- Gitblit v1.9.1