| | |
| | | float: left; |
| | | display: inline-block; |
| | | } |
| | | |
| | | button.btn_trigger { |
| | | width: 100%; |
| | | margin-top: 20rpx; |
| | | padding: 20rpx; |
| | | line-height: 1.5; |
| | | background: #27A6E1; |
| | | border: none; |
| | | color: #fff; |
| | | font-size: 38rpx; |
| | | font-weight: bold; |
| | | float: left; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .i_tishi { |
| | | color: red; |
| | |
| | | v-if="param.Sub_Cls.Can_Add_Delete == true">{{title}}</button> |
| | | <button type="default" @tap="sava" class="btn_sava" |
| | | v-else-if="param.Sub_Cls.Can_Add_Delete == false">{{title}}</button> |
| | | |
| | | <button type="default" @tap="trigger" class="btn_trigger" |
| | | v-if="param.After_Trigger_Event">纯分拣</button> |
| | | |
| | | |
| | | <!-- 普通弹窗 top bottom center left right --> |
| | | <view> |
| | |
| | | //console.log(e.target) |
| | | getApp().onScan((result) => { |
| | | //console.log(result.decodedata); |
| | | var isVal = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[ |
| | | 'iindex']].Value; |
| | | var isVal = this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value; |
| | | // if(!isVal){ |
| | | // this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata; |
| | | // var isVald =this.$data.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value; |
| | |
| | | // } |
| | | //主数据类扫码查询数据 |
| | | if (isVal != result.decodedata) { |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] |
| | | .Value = result.decodedata; |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = result.decodedata; |
| | | uni.hideKeyboard(); |
| | | //子数据类扫码区事件脚本 |
| | | var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; |
| | |
| | | clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, |
| | | objid: "", |
| | | attr: req, |
| | | mast_attr: [], |
| | | mast_attr: req, |
| | | inputParamter: [{ |
| | | attr: 'mast_input_3037', |
| | | value: result.decodedata |
| | |
| | | //console.log(e.target) |
| | | getApp().onScan((result) => { |
| | | //console.log(result.decodedata); |
| | | var isVal = this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset[ |
| | | 'iindex']].Value; |
| | | var isVal = this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value; |
| | | //主数据类扫码查询数据 |
| | | if (isVal != result.decodedata) { |
| | | this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']] |
| | | .Value = result.decodedata; |
| | | this.$data.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = result.decodedata; |
| | | uni.hideKeyboard(); |
| | | //子数据类扫码区事件脚本 |
| | | var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; |
| | |
| | | clsid: 'MBOX', //this.$data.param.Sub_Cls.ID, |
| | | objid: "", |
| | | attr: req, |
| | | mast_attr: [], |
| | | mast_attr: req, |
| | | inputParamter: [{ |
| | | attr: 'mast_input_3037', |
| | | value: e.target.value |
| | |
| | | else if (this.$data.param.After_OK_Event) //判断功能点参数是否有确定后脚本 |
| | | this.scan_OKDataObjRunCustomEvent(this.$data.param.After_OK_Event.ID); |
| | | else |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); //返回层数,2则上上页 |
| | | }, |
| | | trigger() { |
| | | if (this.$data.param.Before_Trigger_Event) //判断功能点参数是否有触发前脚本 |
| | | this.scan_TriggerDataObjRunCustomEvent(this.$data.param.Before_Trigger_Event.ID); |
| | | else if (this.$data.param.After_Trigger_Event) //判断功能点参数是否有触发后脚本 |
| | | this.scan_TriggerDataObjRunCustomEvent(this.$data.param.After_Trigger_Event.ID); |
| | | elsess |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); //返回层数,2则上上页 |
| | |
| | | edit_dlg: { |
| | | type: 'small', //小窗口 |
| | | class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//当前数据类id |
| | | }, |
| | | }, |
| | | master: { |
| | | cls_id: 'MBOX',//self.options.ExtParam.Sub_Cls.ID, // button=bottom时 master的cls_id |
| | | attr: info.mast_attr //主数据类属性 |
| | | //objs_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | |
| | | } |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | scan_TriggerDataObjRunCustomEvent(eventID) { |
| | | uni.showLoading({title: "加载中...",mask: true}); |
| | | var $this = this; |
| | | var req = []; |
| | | var attrlist = $this.$data.classAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | var attr = attrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (ar.Value == '请选择' || ar.Value == '——请选择——') ar.Value = ''; |
| | | if (ar.Type == '引用对象(多个)') |
| | | if (ar.Value == '请') ar.Value = ''; |
| | | if (ar.Type == '引用人员' || ar.Type == '引用项目') |
| | | req.push({ |
| | | attr: ar.Name, |
| | | value: ar.ValID ? ar.ValID : '' |
| | | }); |
| | | else if (ar.Type == '布尔值') |
| | | req.push({ |
| | | attr: ar.Name, |
| | | value: ar.Value ? '1' : '0' |
| | | }); |
| | | else if (ar.Type == '字典' || ar.Type == '字典-字符串' || ar.Type == '字典-整数') { |
| | | if (ar.select == true) { //判断下拉是否多选 |
| | | var valStr = ""; |
| | | for (var v in ar.Value) { |
| | | if (valStr) |
| | | valStr += ";"; |
| | | valStr += ar.Value[v]; |
| | | } |
| | | req.push({ |
| | | attr: ar.Name, |
| | | value: valStr |
| | | }); |
| | | } else |
| | | req.push({ |
| | | attr: ar.Name, |
| | | value: ar.Value |
| | | }); |
| | | } else |
| | | req.push({ |
| | | attr: ar.Name, |
| | | value: ar.Value ? ar.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: "取消" |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var objects = []; |
| | | var subPanelList = $this.$data.subPanelList; |
| | | for (var s = 0; s < subPanelList.length; s++) { |
| | | var sub_req = []; |
| | | for (var i = 0; i < subPanelList[s].subClassAttr.length; i++) { |
| | | var attr = subPanelList[s].subClassAttr[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if (ar.Value == '请选择' || ar.Value == '——请选择——') ar.Value = ''; |
| | | if (ar.Type == '引用对象(多个)') |
| | | if (ar.Value == '请') ar.Value = ''; |
| | | if (ar.Type == '引用人员' || ar.Type == '引用项目') |
| | | sub_req.push({ |
| | | attr: ar.Name, |
| | | value: ar.ValID ? ar.ValID : '' |
| | | }); |
| | | else if (ar.Type == '布尔值') |
| | | sub_req.push({ |
| | | attr: ar.Name, |
| | | value: ar.Value ? '1' : '0' |
| | | }); |
| | | else if (ar.Type == '字典' || ar.Type == '字典-字符串' || ar.Type == '字典-整数') { |
| | | if (ar.select == true) { //判断下拉是否多选 |
| | | var valStr = ""; |
| | | for (var v in ar.Value) { |
| | | if (valStr) |
| | | valStr += ";"; |
| | | valStr += ar.Value[v]; |
| | | } |
| | | sub_req.push({ |
| | | attr: ar.Name, |
| | | value: valStr |
| | | }); |
| | | } else |
| | | sub_req.push({ |
| | | attr: ar.Name, |
| | | value: ar.Value |
| | | }); |
| | | } else |
| | | sub_req.push({ |
| | | attr: ar.Name, |
| | | value: ar.Value ? ar.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: "取消" |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | objects.push({ |
| | | obj_id: subPanelList[s].scanCodeVal, |
| | | obj_attrs: sub_req |
| | | }); |
| | | } |
| | | var dataJson = { |
| | | master_cls: { |
| | | cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name, |
| | | obj_attrs: req |
| | | }, |
| | | input_3037: $this.$data.scanCodeVal, //扫码内容 |
| | | op_type: $this.$data.param.OperationType, //作业类型定义 |
| | | sub_cls: { |
| | | cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name, |
| | | objects: objects |
| | | } |
| | | }; |
| | | // console.log(JSON.stringify(dataJson)); |
| | | var dataInfo = { |
| | | edtype: "7", |
| | | eventid: eventID, |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: 'MBOX', |
| | | objid: '', |
| | | attr: JSON.stringify([]), |
| | | extinfo: JSON.stringify([]), |
| | | global_attr: JSON.stringify($this.$data.global_attr), |
| | | dataJson: JSON.stringify(dataJson) |
| | | } |
| | | // console.log(JSON.stringify(dataInfo)); |
| | | console.log(dataInfo); |
| | | this.$store.dispatch('DataObjRunCustomEventInfo', dataInfo).then(success => { |
| | | console.log(success); |
| | | uni.hideLoading(); |
| | | if (success.code == '00000') { |
| | | var data = JSON.parse(success.data); |
| | | var result = data.result; |
| | | if (eventID != $this.$data.param.After_Trigger_Event.ID) |
| | | $this.scan_TriggerDataObjRunCustomEvent($this.$data.param.After_Trigger_Event.ID); |
| | | else { |
| | | //刷新 |
| | | uni.redirectTo({ |
| | | url: '../modal/ms_classAttr?param=' + JSON.stringify($this.$data.param) + |
| | | "&titlename=" + $this.$data.title |
| | | }); |
| | | } |
| | | } else { |
| | | uni.showModal({ |
| | | title: "错误8", |
| | | content: success.msg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | } |
| | | }).catch(ex => { |
| | | // console.log(ex); |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: "错误8.1", |
| | | content: ex.errMsg, |
| | | showCancel: false, |
| | | confirmText: "取消" |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | |
| | | } |