| | |
| | | if (this.$data.subPanelList[index].scanCodeVal == this.$data.scanCodeVal) { |
| | | this.$data.scanCodeVal=''; |
| | | } |
| | | this.$data.subPanelList.splice(index, 1); |
| | | if (this.$data.param.Sub_Cls.Slave_Change_Event) { //判断从数据是否有从处理事件 |
| | | var eventid = this.$data.param.Sub_Cls.Slave_Change_Event.ID; |
| | | if (eventid) { |
| | | var mast_req=[]; |
| | | //主数据类属性 |
| | | var classattrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < classattrlist.length; i++) { |
| | | var attr = classattrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | mast_req.push({ attr: ar.Name, val: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | mast_req.push({ attr: ar.Name, val: ar.Value?'1':'0'}); |
| | | else |
| | | mast_req.push({ attr: ar.Name, val: ar.Value ?ar.Value :''}); |
| | | } |
| | | } |
| | | var req=[]; |
| | | //子数据类属性 |
| | | var attrlist = this.$data.subClassAttrList; |
| | | 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.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 |
| | | req.push({ attr: ar.Name, value: ar.Value ?ar.Value :''}); |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.Sub_Cls.ID, |
| | | objid: "", |
| | | attr: req, |
| | | mast_attr: mast_req, |
| | | inputParamter:[{ attr: 'input_3037', value: this.$data.scanCodeVal }], |
| | | delIndex:index |
| | | } |
| | | |
| | | this.scan_DataObjRunCustomEvent(info, ""); |
| | | } |
| | | }else{ |
| | | this.$data.subPanelList.splice(index, 1); |
| | | } |
| | | }, |
| | | async classGridStyleInfo(clsid,styleName,clsType){ |
| | | var $this = this; |
| | |
| | | //console.log(e.target) |
| | | getApp().onScan((result)=>{ |
| | | //console.log(result.decodedata); |
| | | this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata; |
| | | var isVal =this.$data.classAttrList[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; |
| | | //子数据类扫码区事件脚本 |
| | | var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; |
| | | if (eventid) { |
| | | 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.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | req.push({ attr: ar.Name, val: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | req.push({ attr: ar.Name, val: ar.Value?'1':'0'}); |
| | | else |
| | | req.push({ attr: ar.Name, val: ar.Value ?ar.Value :''}); |
| | | } |
| | | } |
| | | var info = { |
| | | eventid: eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: this.$data.param.Sub_Cls.ID, |
| | | objid: "", |
| | | attr: req, |
| | | mast_attr: [], |
| | | inputParamter:[{ attr: 'mast_input_3037', value: result.decodedata }] |
| | | } |
| | | |
| | | this.scan_DataObjRunCustomEvent(info, ""); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | scan_ontap(e){ //扫码区扫码功能 |
| | |
| | | if(this.$data.subPanelList[i].scanCodeVal == result.decodedata) |
| | | isflag=false; |
| | | } |
| | | |
| | | //子数据类扫码查询数据 |
| | | if (isflag) { |
| | | this.$data.scanCodeVal=result.decodedata; |
| | | var eventid = this.$data.param.Scan_Code.Input_Change_Event.ID; |
| | | if (eventid) { |
| | | var mast_req=[]; |
| | | //主数据类属性 |
| | | var classattrlist = this.$data.classAttrList; |
| | | for (var i = 0; i < classattrlist.length; i++) { |
| | | var attr = classattrlist[i].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | var ar = attr[j]; |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | mast_req.push({ attr: ar.Name, val: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | mast_req.push({ attr: ar.Name, val: ar.Value?'1':'0'}); |
| | | else |
| | | mast_req.push({ attr: ar.Name, val: ar.Value ?ar.Value :''}); |
| | | } |
| | | } |
| | | var req=[]; |
| | | var attrlist = this.$data.subClassAttrList; |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | | //子数据类属性 |
| | | var attrlist = this.$data.subClassAttrList; |
| | | 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]; |
| | |
| | | clsid: this.$data.param.Sub_Cls.ID, |
| | | objid: "", |
| | | attr: req, |
| | | mast_attr: mast_req, |
| | | inputParamter:[{ attr: 'input_3037', value: this.$data.scanCodeVal }] |
| | | } |
| | | |
| | |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: this.$data.param.Sub_Cls.ID, // button=bottom时 master的cls_id |
| | | attr: info.mast_attr //主数据类属性 |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | |
| | | if (success.code=='00000') { |
| | | var data = JSON.parse(success.data); |
| | | var actionlist = data.action; |
| | | |
| | | |
| | | if (actionlist) { |
| | | console.log(actionlist); |
| | | for (var i = 0; i < actionlist.length; i++) { |
| | | var action = actionlist[i]; |
| | | 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++) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } else if (data.action[i].action_type == 'set_global_attr') { |
| | | $this.$data.global_attr = data.action[i].value || []; |
| | | } else if (data.action[i].action_type == 'add_subcls_panel') { |
| | | } else if (action.action_type == 'set_global_attr') { |
| | | $this.$actiontr = action.value || []; |
| | | } else if (action.action_type == 'add_subcls_panel') { //主从数据类扫码查询数据 |
| | | var result = action.value; |
| | | let list_1 = JSON.parse(JSON.stringify(this.$data.subClassAttrList)); |
| | | var scanCodeVal = $this.$data.scanCodeVal; |
| | | if(info.inputParamter[0].attr=="mast_input_3037") //判断是主数据类扫码查询数据 |
| | | scanCodeVal = "mast_input_3037-"+ii; |
| | | $this.$data.subPanelList.push({ |
| | | scanCodeVal:$this.$data.scanCodeVal, |
| | | scanCodeVal:scanCodeVal, |
| | | subClassAttr:list_1 |
| | | }); |
| | | for (var i = 0; i < result.length; i++) { |
| | | for (var s = 0; s < $this.$data.subPanelList.length; s++) { |
| | | if($this.$data.subPanelList[s].scanCodeVal == $this.$data.scanCodeVal){ |
| | | if($this.$data.subPanelList[s].scanCodeVal == scanCodeVal){ |
| | | var _subClassAttr = $this.$data.subPanelList[s].subClassAttr; |
| | | for (var c = 0; c < _subClassAttr.length; c++) { |
| | | var attr = _subClassAttr[c].Attr; |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if (action.action_type == 'del_subcls_panel') { |
| | | |
| | | $this.$data.subPanelList.splice(info.delIndex, 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (data.result) { |
| | | let list_1 = JSON.parse(JSON.stringify(this.$data.subClassAttrList)); |
| | | var scanCodeVal = $this.$data.scanCodeVal; |
| | | if(info.inputParamter[0].attr=="mast_input_3037") |
| | | scanCodeVal = "mast_input_3037-"+ii; |
| | | $this.$data.subPanelList.push({ |
| | | scanCodeVal:$this.$data.scanCodeVal, |
| | | scanCodeVal:scanCodeVal, |
| | | subClassAttr:list_1 |
| | | }); |
| | | var result = data.result; |
| | | for (var i = 0; i < result.length; i++) { |
| | | for (var s = 0; s < $this.$data.subPanelList.length; s++) { |
| | | if($this.$data.subPanelList[s].scanCodeVal == $this.$data.scanCodeVal){ |
| | | if($this.$data.subPanelList[s].scanCodeVal == scanCodeVal){ |
| | | var _subClassAttr = $this.$data.subPanelList[s].subClassAttr; |
| | | for (var c = 0; c < _subClassAttr.length; c++) { |
| | | var attr = _subClassAttr[c].Attr; |