| | |
| | | } from '@/js/Base64.js'; |
| | | import utils from "@/js/utils.js" |
| | | import { |
| | | showInfo, |
| | | showError |
| | | } from "@/js/Page.js" |
| | | import { |
| | | appGetInfo, |
| | | dictGetInfo |
| | | } from "@/api/mobox.js" |
| | |
| | | //页面初始化获取焦点 |
| | | // this.focusMateria=true; |
| | | }, |
| | | initialEvent() { |
| | | let event = (this.head_styledef.event || []).find((e) => e.event_id == "initial"); |
| | | return { |
| | | id: event?.scrip_id || "", |
| | | name: event?.scrip_name || "", |
| | | }; |
| | | }, |
| | | methods: { |
| | | setData: function(obj) { |
| | | let that = this; |
| | |
| | | await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID); |
| | | //传入参数值 |
| | | if (paramValue) { |
| | | this.setFormItemVisible(this.head_styledef,paramValue) |
| | | this.setFormValues(this.head_styledef, paramValue) |
| | | // const attrs = paramValue.attrs || []; |
| | | // (this.head_styledef?.form?.items || []).forEach(async (ele, index) => { |
| | | // if (ele.name != "Layout") { |
| | |
| | | } |
| | | |
| | | await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.param.Sub_Cls?.UI_Style?.ID); |
| | | await this.loadInitialEvent(); |
| | | }, |
| | | async loadInitialEvent() { |
| | | try { |
| | | if (this.initialEvent.id) { |
| | | this.onChange(this.initialEvent) |
| | | } |
| | | } catch (ex) { |
| | | showError(ex, this.translateSys('error')) |
| | | |
| | | |
| | | } |
| | | }, |
| | | async Head_UIStyleGetInfo(class_id, style_id) { //获取自定义表单样式 |
| | | var $this = this; |
| | |
| | | } |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "1.1", |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('error') + " 1.1") |
| | | } |
| | | |
| | | }, |
| | |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "2.1", |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('error') + " 2.1") |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } catch (ex) { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "1.3", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('error') + " 1.3") |
| | | } |
| | | |
| | | }, |
| | |
| | | console.log(data); |
| | | |
| | | if (data.ret != 0 && data.ret != 1) { |
| | | var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data |
| | | .err_info.join('<br/>') : ''; |
| | | let cls_name = data.event_info?.cls_name |
| | | let event_name = data.event_info?.event_name |
| | | tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info |
| | | .join('\n') : '' |
| | | if (data.ret == 801) { |
| | | if (this.param.Only_Script_Error) { |
| | | let pos = tip.indexOf(":"); |
| | | if (pos > -1) tip = tip.substring(pos + 1); |
| | | } |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } else uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip + ',' + this.translateSys('tip') + ':' + data.ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | if (cls_name && event_name) tip = `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}` |
| | | if (data.ret == 801) showInfo(tip) |
| | | else showError(`${tip},提示:${data.ret}`, this.translateSys('tip')) |
| | | this.saving = false |
| | | return false |
| | | } else { |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join( |
| | | '<br/>') : ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | let time = data.info_time || 0 |
| | | if (time) |
| | | showError(tip, this.translateSys('tip')) |
| | | else |
| | | showInfo(tip) |
| | | 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') |
| | | }); |
| | | } |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var actionlist = data.action || [] |
| | |
| | | // 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') |
| | | }); |
| | | showInfo(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')) |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | | tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}` |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | console.log(ex) |
| | | showError(tip, this.translateSys('tip')) |
| | | return |
| | | } |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "3.1", |
| | | content: this.translate('execute_init_event_failed') + |
| | | this.translateSys("full_stop") + |
| | | this.translate('reason') + this.translateSys("colon") + ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys('error') + "3.1") |
| | | }); |
| | | }, |
| | | |
| | |
| | | var onSuffixClickEvent = item.bind.onSuffixClickEvent; //后图标点击事件 |
| | | |
| | | if (!onSuffixClickCallbackEvent.id) { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translate('icon_click_callback_empty'), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(this.translate("icon_click_callback_empty")) |
| | | return; |
| | | } |
| | | if (!onSuffixClickEvent.id) { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translate('icon_click_event_empty'), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(this.translate("icon_click_event_empty")) |
| | | |
| | | return; |
| | | } |
| | | this.popupType = 'right' |
| | |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | if (data.ret != 0 && data.ret != 1) { |
| | | var tip = data.err_info ? typeof data.err_info == 'string' ? data |
| | | .err_info : |
| | | data |
| | | .err_info.join('<br/>') : ''; |
| | | let cls_name = data.event_info?.cls_name |
| | | let event_name = data.event_info?.event_name |
| | | tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info |
| | | .join('\n') : '' |
| | | if (data.ret == 801) { |
| | | if ($this.param.Only_Script_Error) { |
| | | if (this.param.Only_Script_Error) { |
| | | let pos = tip.indexOf(":"); |
| | | if (pos > -1) tip = tip.substring(pos + 1); |
| | | } |
| | | uni.showModal({ |
| | | title: $this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: $this.translateSys('close') |
| | | }); |
| | | } else uni.showModal({ |
| | | title: $this.translateSys("tip"), |
| | | content: tip + ',' + $this.translateSys('tip') + ':' + data |
| | | .ret, |
| | | showCancel: false, |
| | | confirmText: $this.translateSys('close') |
| | | }); |
| | | } |
| | | if (cls_name && event_name) tip = `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}` |
| | | if (data.ret == 801) showInfo(tip) |
| | | else showError(`${tip},提示:${data.ret}`, this.translateSys('tip')) |
| | | this.saving = false |
| | | return false |
| | | } else { |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : data |
| | | .info |
| | | .join( |
| | | '<br/>') : ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) uni.showModal({ |
| | | title: $this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: $this.translateSys('close') |
| | | }); |
| | | let time = data.info_time || 0 |
| | | if (time) |
| | | showError(tip, this.translateSys('tip')) |
| | | else |
| | | showInfo(tip) |
| | | 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') |
| | | }); |
| | | } |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var actions = data.action || [] |
| | |
| | | } |
| | | }); |
| | | } 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') |
| | | }); |
| | | showInfo($this.translateSys( |
| | | "quotation_mark_left") + |
| | | action.action_type + $this.translateSys( |
| | | "quotation_mark_right") + $this |
| | | .translate( |
| | | "tip_action_unprocessed")) |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | | tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}` |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | console.log(ex) |
| | | showError(tip, this.translateSys('tip')) |
| | | return |
| | | } |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr |
| | | uni.showModal({ |
| | | title: $this.translateSys('tip') + "5.1", |
| | | content: exStr, |
| | | showCancel: false, |
| | | confirmText: $this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys("error") + "5.1") |
| | | }); |
| | | }, |
| | | |
| | |
| | | uni.hideLoading(); |
| | | |
| | | $this.subPanelList.splice(index, 1); |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translate("delete_success"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(this.translate("delete_success")) |
| | | |
| | | |
| | | }).catch(ex => { |
| | | console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: this.translateSys('tip') + "9.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys("error") + "9.1") |
| | | }); |
| | | } |
| | | }, |
| | |
| | | var $this = this; |
| | | var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event; |
| | | if (!Before_Select_Event) { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translate("before_select_event_empty"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(this.translate("before_select_event_empty")) |
| | | |
| | | return; |
| | | } |
| | | var obj_attr = this.head_styledef.form.model; |
| | |
| | | var $this = this; |
| | | var After_Select_Event = $this.param.Scan_Code.After_Select_Event; |
| | | if (!After_Select_Event) { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translate("after_select_event_empty"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(this.translate("after_select_event_empty")) |
| | | |
| | | return; |
| | | } |
| | | var items = $this.check_list.items; |
| | |
| | | } |
| | | } |
| | | if (data.length == 0) { |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: this.translate("tip_no_select_data"), |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showInfo(this.translate("tip_no_select_data")) |
| | | |
| | | return; |
| | | } |
| | | var obj_attr = this.head_styledef.form.model; |
| | |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | if (data.ret != 0 && data.ret != 1) { |
| | | var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data |
| | | .err_info.join('<br/>') : ''; |
| | | let cls_name = data.event_info?.cls_name |
| | | let event_name = data.event_info?.event_name |
| | | tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info |
| | | .join('\n') : '' |
| | | if (data.ret == 801) { |
| | | if (this.param.Only_Script_Error) { |
| | | let pos = tip.indexOf(":"); |
| | | if (pos > -1) tip = tip.substring(pos + 1); |
| | | } |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } else uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip + ',' + this.translateSys('tip') + ':' + data.ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | if (cls_name && event_name) tip = `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}` |
| | | if (data.ret == 801) showInfo(tip) |
| | | else showError(`${tip},提示:${data.ret}`, this.translateSys('tip')) |
| | | this.saving = false |
| | | return false |
| | | } else { |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join( |
| | | '<br/>') : ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | let time = data.info_time || 0 |
| | | if (time) |
| | | showError(tip, this.translateSys('tip')) |
| | | else |
| | | showInfo(tip) |
| | | if ([0, 2, 3, 4, -1].includes(data.result_type)) { |
| | | if (data.result_type == 2) { |
| | | var result = 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') |
| | | }); |
| | | } |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var actionlist = data.action || [] |
| | |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | | tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}` |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | console.log(ex) |
| | | showError(tip, this.translateSys('tip')) |
| | | return |
| | | } |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "3.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys("error") + "3.1") |
| | | }); |
| | | }, |
| | | setFormValues(styledef, attrs) { |
| | |
| | | console.log(data); |
| | | |
| | | if (data.ret != 0 && data.ret != 1) { |
| | | var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data |
| | | .err_info.join('<br/>') : ''; |
| | | let cls_name = data.event_info?.cls_name |
| | | let event_name = data.event_info?.event_name |
| | | tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info |
| | | .join('\n') : '' |
| | | if (data.ret == 801) { |
| | | if (this.param.Only_Script_Error) { |
| | | let pos = tip.indexOf(":"); |
| | | if (pos > -1) tip = tip.substring(pos + 1); |
| | | } |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } else uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip + this.translateSys('comma') + this.translate('result') + this |
| | | .translateSys('colon') + data.ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | if (cls_name && event_name) tip = `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}` |
| | | if (data.ret == 801) showInfo(tip) |
| | | else showError(`${tip},提示:${data.ret}`, this.translateSys('tip')) |
| | | this.saving = false |
| | | return false |
| | | } else { |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join( |
| | | '<br/>') : ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | let time = data.info_time || 0 |
| | | if (time) |
| | | showError(tip, this.translateSys('tip')) |
| | | else |
| | | showInfo(tip) |
| | | if ([0, 2, 3, 4, -1].includes(data.result_type)) { |
| | | if (data.result_type == 2) { |
| | | 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') |
| | | }); |
| | | } |
| | | showInfo(data.result) |
| | | |
| | | } |
| | | try { |
| | | var actionlist = data.action || [] |
| | |
| | | } |
| | | } |
| | | } 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') |
| | | }); |
| | | showInfo(this.translateSys("quotation_mark_left") + action |
| | | .action_type + this.translateSys( |
| | | "quotation_mark_right") + this.translate( |
| | | "tip_action_unprocessed")) |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | | tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}` |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | console.log(ex) |
| | | showError(tip, this.translateSys('tip')) |
| | | return |
| | | } |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "7.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys("error") + "7.1") |
| | | }); |
| | | }, |
| | | onSave() { |
| | |
| | | runCustomEvent(dataInfo).then(data => { |
| | | console.log(data); |
| | | uni.hideLoading(); |
| | | if (data.ret != 0) { |
| | | var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data |
| | | .err_info.join('<br/>') : ''; |
| | | if (data.ret != 0 && data.ret != 1) { |
| | | let cls_name = data.event_info?.cls_name |
| | | let event_name = data.event_info?.event_name |
| | | tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data.err_info |
| | | .join('\n') : '' |
| | | if (data.ret == 801) { |
| | | if (this.param.Only_Script_Error) { |
| | | let pos = tip.indexOf(":"); |
| | | if (pos > -1) tip = tip.substring(pos + 1); |
| | | } |
| | | uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } else uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip + ',' + this.translateSys('tip') + ':' + data.ret, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | if (cls_name && event_name) tip = `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}` |
| | | if (data.ret == 801) showInfo(tip) |
| | | else showError(`${tip},提示:${data.ret}`, this.translateSys('tip')) |
| | | this.saving = false |
| | | return false |
| | | } else { |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join( |
| | | '<br/>') : ''; |
| | | var tip = data.info ? typeof data.info == 'string' ? data.info : |
| | | data.info.join('\n') : ''; |
| | | tip = tip || data.err_info |
| | | if (tip) uni.showModal({ |
| | | title: this.translateSys("tip"), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | let time = data.info_time || 0 |
| | | if (time) |
| | | showError(tip, this.translateSys('tip')) |
| | | else |
| | | showInfo(tip) |
| | | if ([0, 2, 3, 4, -1].includes(data.result_type)) { |
| | | if (data.result_type == 2) { |
| | | |
| | | } else if (typeof data.result == 'string') { |
| | | showInfo(data.result) |
| | | } |
| | | var actionlist = data.action || [] |
| | | for (var i = 0; i < actionlist.length; i++) { |
| | | var action = actionlist[i]; |
| | | if (action.action_type == "goback_to_pre_page") { |
| | | //返回上一页 |
| | | uni.navigateBack({ |
| | | delta: 1, //返回层数,2则上上页 |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | // var result = data.result; |
| | | if (eventID != $this.param.After_OK_Event.ID) |
| | | $this.scan_OKDataObjRunCustomEvent($this.param.After_OK_Event.ID); |
| | |
| | | // console.log(ex); |
| | | this.saving = false |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: this.translateSys("error") + "8.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | showError(ex, this.translateSys("error") + "8.1") |
| | | }); |
| | | }, |
| | | |