| | |
| | | uni.scanCode({ |
| | | scanType: ["qrCode", 'barCode'], |
| | | success: function(res) { |
| | | |
| | | console.log(res) |
| | | if ($this.focusFieldId) { |
| | | const items = $this.head_styledef.form.items || [] |
| | | for (let i in items) { |
| | |
| | | this.loadData() |
| | | } |
| | | }, |
| | | onReady() { |
| | | uni.setNavigationBarTitle({ |
| | | title: this.title |
| | | }); //设置顶部标题 |
| | | }, |
| | | onLoad(options) { |
| | | // console.log(options); |
| | | uni.setNavigationBarTitle({ |
| | | title: options.titlename |
| | | }); //设置顶部标题 |
| | | |
| | | this.param = JSON.parse(options.param); |
| | | this.title = this.param.Add_BtnName ? this.param.Add_BtnName : options |
| | | .titlename; //设置按钮文字 |
| | | this.title = options.titlename; //设置按钮文字 this.param.Add_BtnName ? this.param.Add_BtnName : |
| | | this.btnName = this.param.Add_BtnName || "" |
| | | const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined |
| | | this.loadData(paramValue) |
| | |
| | | }) |
| | | }); |
| | | } else { |
| | | showInfo(this.translate( |
| | | showInfo($this.translate( |
| | | 'execute_init_event_failed') + |
| | | this.translateSys("full_stop") + |
| | | this.translate('reason') + this |
| | | $this.translateSys("full_stop") + |
| | | $this.translate('reason') + $this |
| | | .translateSys( |
| | | "colon") + |
| | | this.translateSys("quotation_mark_left") + |
| | | $this.translateSys("quotation_mark_left") + |
| | | action |
| | | .action_type + this.translateSys( |
| | | "quotation_mark_right") + this |
| | | .action_type + $this.translateSys( |
| | | "quotation_mark_right") + $this |
| | | .translate('tip_action_unprocessed')) |
| | | |
| | | } |
| | |
| | | }, |
| | | onScanValue(item, value) { |
| | | const $this = this; |
| | | //console.log("onScanValue", item); |
| | | console.log("onScanValue", value); |
| | | item.value = value |
| | | let newVal = item.value |
| | | if (typeof item.value == "string") { |
| | |
| | | } |
| | | |
| | | }, |
| | | async onFormEventResult(data, callbackEventId, item) { |
| | | async onFormEventResult( data, callbackEventId, item,req) { |
| | | try { |
| | | const $this = this |
| | | var enviroment = { |
| | |
| | | userlogin: '', |
| | | clsid: $this.param.DataCls.id, |
| | | objid: "", |
| | | attr: $this.popupParam.req, |
| | | attr: $this.popupParam.req || [], |
| | | dataJson: data |
| | | } |
| | | $this.DataObjRunCustomEvent(info, $this.popupParam.data_attr); |
| | |
| | | } |
| | | } |
| | | enviroment = Base64.encode(JSON.stringify(enviroment)); //将字符串转换为base64编码 |
| | | var input_param = Base64.encode(JSON.stringify(info.attr)); //将字符串转换为base64编码 |
| | | var input_param = info.attr ? Base64.encode(JSON.stringify(info.attr)):"" //将字符串转换为base64编码 |
| | | var global_attr = Base64.encode(JSON.stringify(this |
| | | .global_attr)); //将字符串转换为base64编码 |
| | | if (info.dataJson) |
| | | info.dataJson = Base64.encode(JSON.stringify(info.dataJson)); //将字符串转换为base64编码 |
| | | var obj_attr = {}; |
| | | info.attr.forEach(item => { |
| | | (info.attr || []).forEach(item => { |
| | | obj_attr[item.attr] = item.value; |
| | | }); |
| | | if (!info.eventid.includes('{')) info.eventid = '{' + info.eventid + '}'; |
| | |
| | | // return; |
| | | runCustomEvent(dataInfo).then(data => { |
| | | hideLoading() |
| | | $this.onFormEventResult(data, button_callback, item) |
| | | $this.onFormEventResult( data, button_callback,item,req) |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |