| | |
| | | dataObjDelele, |
| | | dataObjRunCustomEvent |
| | | } from "@/api/index.js" |
| | | |
| | | import {showInfo, |
| | | showError, |
| | | showLoading} from "@/js/Page.js" |
| | | export default { |
| | | components: { |
| | | pickerAddress |
| | |
| | | this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //设置按钮文字 |
| | | console.log(param); |
| | | if (!param.Master_Cls.View_Style) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "该功能点未配置界面窗口,请重新配置!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo( "该功能点未配置界面窗口,请重新配置!") |
| | | |
| | | return; |
| | | } |
| | | if (!param.Master_Cls.View_Style.Name) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "该功能点未配置窗口样式,请重新配置!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo( "该功能点未配置窗口样式,请重新配置!") |
| | | |
| | | return; |
| | | } |
| | | this.param = param; |
| | |
| | | this.subClass_attr_init(); |
| | | |
| | | } catch (ex) { |
| | | console.log(ex) |
| | | uni.showModal({ |
| | | title: "错误1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误1") |
| | | |
| | | } |
| | | }, |
| | | scan_classAttr_extButton(e) { //选择按钮前 |
| | | var $this = this; |
| | | var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event; |
| | | if (!Before_Select_Event) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "选择前事件为空!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo("选择前事件为空!") |
| | | |
| | | return; |
| | | } |
| | | var mast_attr = []; |
| | |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (ar.Value == '请选择') { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ar.DispName + "未选择数据!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo(ar.DispName + "未选择数据!") |
| | | |
| | | return; |
| | | } |
| | | if (ar.Type == '引用对象(多个)') |
| | |
| | | if (ar.notempty == true && !ar.Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ar.DispName + '不能为空!', |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo( ar.DispName + '不能为空!'); |
| | | return; |
| | | } |
| | | } |
| | |
| | | var $this = this; |
| | | var After_Select_Event = $this.param.Scan_Code.After_Select_Event; |
| | | if (!After_Select_Event) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "选择后事件为空!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo("选择后事件为空!") |
| | | |
| | | return; |
| | | } |
| | | var items = $this.check_list.items; |
| | |
| | | } |
| | | } |
| | | if (data.length == 0) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "未选择数据!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo("未选择数据!") |
| | | |
| | | return; |
| | | } |
| | | var mast_attr = []; |
| | |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (ar.Value == '请选择') { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ar.DispName + "未选择数据!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo( ar.DispName + "未选择数据!") |
| | | |
| | | return; |
| | | } |
| | | mast_attr.push(this.formatAttr(ar)) |
| | |
| | | dataObjDelele(dataInfo).then(success => { |
| | | uni.hideLoading(); |
| | | $this.subPanelList.splice(index, 1); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "删除成功!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo("删除成功!") |
| | | |
| | | |
| | | }).catch(ex => { |
| | | console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: "提示9.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误9.1") |
| | | }); |
| | | } |
| | | }, |
| | |
| | | return result |
| | | } 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: "错误1.1", |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误1.1") |
| | | 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: "错误1.2", |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误1.2") |
| | | return {} |
| | | }; |
| | | }, |
| | |
| | | //console.log(e.target) |
| | | this.focusOldField = `${e.target.dataset['index']}-${e.target.dataset['iindex']}` |
| | | getApp().onScan((result) => { |
| | | //console.log(result.decodedata); |
| | | //console.log(result); |
| | | var isVal = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ |
| | | 'iindex']].Value; |
| | | // if(!isVal){ |
| | | // this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata; |
| | | // this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result; |
| | | // var isVald =this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value; |
| | | // return; |
| | | // } |
| | | //主数据类扫码查询数据 |
| | | if (isVal != result.decodedata) { |
| | | if (isVal != result) { |
| | | this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ |
| | | 'iindex']] |
| | | .Value = result.decodedata; |
| | | .Value = result; |
| | | uni.hideKeyboard(); |
| | | //子数据类扫码区事件脚本 |
| | | var eventid = this.param.Scan_Code.Input_Change_Event.ID; |
| | |
| | | mast_attr: req, |
| | | inputParamter: [{ |
| | | attr: 'mast_input_3037', |
| | | value: result.decodedata |
| | | value: result |
| | | }] |
| | | } |
| | | |
| | | this.scan_DataObjRunCustomEvent(info, ""); |
| | | } |
| | | if (result.decodedata) { //第一个输入框不为空 |
| | | if (result) { //第一个输入框不为空 |
| | | //初始化,下个输入框focus属性 |
| | | const attrs = this.classAttrList[e.target.dataset['index']].Attr || [] |
| | | var findd = false |
| | |
| | | subontap(e) { //扫码功能 |
| | | //console.log(e.target) |
| | | getApp().onScan((result) => { |
| | | //console.log(result.decodedata); |
| | | //console.log(result); |
| | | var isVal = this.subClassAttrList[e.target.dataset['index']].Attr[e.target |
| | | .dataset[ |
| | | 'iindex']].Value; |
| | | //主数据类扫码查询数据 |
| | | if (isVal != result.decodedata) { |
| | | if (isVal != result) { |
| | | this.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset[ |
| | | 'iindex']] |
| | | .Value = result.decodedata; |
| | | .Value = result; |
| | | uni.hideKeyboard(); |
| | | //子数据类扫码区事件脚本 |
| | | var eventid = this.param.Scan_Code.Input_Change_Event.ID; |
| | |
| | | mast_attr: [], |
| | | inputParamter: [{ |
| | | attr: 'mast_input_3037', |
| | | value: result.decodedata |
| | | value: result |
| | | }] |
| | | } |
| | | |
| | |
| | | scan_ontap(e) { //扫码区扫码功能 |
| | | //console.log(e.target) |
| | | getApp().onScan((result) => { |
| | | console.log(result.decodedata); |
| | | console.log(result); |
| | | var isflag = true; |
| | | for (var i in this.subPanelList) { |
| | | if (this.subPanelList[i].scanCodeVal == result.decodedata) |
| | | if (this.subPanelList[i].scanCodeVal == result) |
| | | isflag = false; |
| | | } |
| | | //子数据类扫码查询数据 |
| | | if (isflag) { |
| | | uni.hideKeyboard(); |
| | | this.scanCodeVal = result.decodedata; |
| | | this.scanCodeVal = result; |
| | | var eventid = this.param.Scan_Code.Input_Change_Event.ID; |
| | | if (eventid) { |
| | | var mast_req = []; |
| | |
| | | var before_click_button = $this.classAttrList[index].Attr[iindex].before_click_button; |
| | | var button_callback = $this.classAttrList[index].Attr[iindex].button_callback; |
| | | if (!before_click_button) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "before_click_button-event_id为空!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo( "before_click_button-event_id为空!") |
| | | |
| | | return; |
| | | } |
| | | if (!button_callback) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "button_callback-event_id为空!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo("button_callback-event_id为空!") |
| | | |
| | | return; |
| | | } |
| | | var data_attr = this.classAttrList[index].Attr[iindex]; |
| | |
| | | }, |
| | | classAttr_AddRef(e) { |
| | | console.log(e.target); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "此功能还未实现!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo("此功能还未实现!") |
| | | |
| | | // var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value]; |
| | | // this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value; |
| | | }, |
| | |
| | | if (ar.notempty == true && !ar.Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ar.DispName + '不能为空!', |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo( ar.DispName + '不能为空!'); |
| | | return; |
| | | } |
| | | } |
| | |
| | | var action = JSON.parse(data.Action); |
| | | if (action.ret == '0') { |
| | | if (action.result_type == '0') { |
| | | uni.showToast({ |
| | | title: action.result, |
| | | icon: "success", |
| | | duration: 3000 |
| | | }); |
| | | showInfo( action.result) |
| | | |
| | | } |
| | | // "{"ret":0, "result_type":0, "result":"创建成功123123123","info":""}" |
| | | } |
| | |
| | | }).catch(ex => { |
| | | console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, ) |
| | | }); |
| | | }, |
| | | class_attr_init() { |
| | |
| | | // console.log(this.classAttrList); |
| | | |
| | | } else { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "未找到可显示的的属性", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo( "未找到可显示的的属性") |
| | | |
| | | } |
| | | }, |
| | | subClass_attr_init() { |
| | |
| | | console.log(this.subClassAttrList); |
| | | |
| | | } else { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "未找到可显示的的属性", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo( "未找到可显示的的属性") |
| | | |
| | | } |
| | | }, |
| | | ini_DataObjRunCustomEvent(info) { |
| | |
| | | } |
| | | } |
| | | } else if (action_type == 'open_select_userdlg') { |
| | | uni.showModal({ |
| | | title: "错误2.2", |
| | | content: "open_select_userdlg这个action_type还未处理!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo("open_select_userdlg这个action_type还未处理!") |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: "错误2.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误2.1") |
| | | }); |
| | | }, |
| | | DataObjRunCustomEvent(info, data_attr) { |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: "错误3.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误3.1") |
| | | }); |
| | | }, |
| | | OKDataObjRunCustomEvent() { |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: "错误4.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误4.1") |
| | | }); |
| | | }, |
| | | DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, index, iindex) { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | uni.showModal({ |
| | | title: "提示5.2", |
| | | content: '调用 before_click_button 脚本返回空,event_id' + eventid, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError('调用 before_click_button 脚本返回空,event_id' + eventid, "错误5.2") |
| | | |
| | | } |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: "提示5.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误5.1") |
| | | }); |
| | | }, |
| | | scan_ini_DataObjRunCustomEvent(info) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } else if (action_type == 'open_select_userdlg') { |
| | | uni.showModal({ |
| | | title: "错误6.2", |
| | | content: "open_select_userdlg这个action_type还未处理!", |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | } |
| | | else if (action_type == 'open_select_userdlg') { |
| | | showInfo("open_select_userdlg这个action_type还未处理!") |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: "错误6.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误6.1") |
| | | }); |
| | | }, |
| | | scan_DataObjRunCustomEvent(info, data_attr) { |
| | |
| | | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.showModal({ |
| | | title: "错误7.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误7.1") |
| | | }); |
| | | }, |
| | | scan_OKDataObjRunCustomEvent(eventID) { |
| | |
| | | if (ar.notempty == true && !ar.Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ar.DispName + '不能为空!', |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo(ar.DispName + '不能为空!') |
| | | return; |
| | | } |
| | | } |
| | |
| | | if (ar.notempty == true && !ar.Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ar.DispName + '不能为空!', |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo(ar.DispName + '不能为空!') |
| | | return; |
| | | } |
| | | } |
| | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: "错误8.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误8.1") |
| | | |
| | | }); |
| | | }, |
| | | scan_TriggerDataObjRunCustomEvent(eventID) { |
| | |
| | | if (ar.notempty == true && !ar.Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ar.DispName + '不能为空!', |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo(ar.DispName + '不能为空!') |
| | | return; |
| | | } |
| | | } |
| | |
| | | if (ar.notempty == true && !ar.Value) { |
| | | // if(ar.NotEmpty=='1'){ |
| | | uni.hideLoading(); |
| | | // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000}); |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: ar.DispName + '不能为空!', |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showInfo(ar.DispName + '不能为空!') |
| | | |
| | | return; |
| | | } |
| | | } |
| | |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: "错误8.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | showError(ex, "错误8.1") |
| | | }); |
| | | }, |
| | | formatAttr(attr) { |