| | |
| | | right: -10px; |
| | | z-index: 100; |
| | | } |
| | | |
| | | .view-popup{ |
| | | position:relative; |
| | | } |
| | | .popup-content { |
| | | @include flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 30rpx; |
| | | background-color: #fff; |
| | | /* height: 150px; */ |
| | | /* border: 1px solid red; */ |
| | | } |
| | | .popup-cont { |
| | | overflow-y: auto; |
| | | /* border: 1px solid red; */ |
| | | } |
| | | .popup-height { |
| | | @include height; |
| | | /* width: 200px; */ |
| | | } |
| | | .popup-header{ |
| | | font-size: 42rpx; |
| | | font-weight: bold; |
| | | margin:20rpx 20rpx 0px 20rpx; |
| | | } |
| | | .view_popup_CheckList{ |
| | | margin-bottom: 20rpx; |
| | | } |
| | | .popup-footer{ |
| | | float: right; |
| | | position:absolute; |
| | | bottom:0; |
| | | right:20rpx; |
| | | } |
| | | button.btn_popup_add { |
| | | width:180rpx; |
| | | margin-top: 50rpx; |
| | | margin-right: 20rpx; |
| | | padding: 15rpx; |
| | | line-height: 1.5; |
| | | background: #27A6E1; |
| | | border: none; |
| | | color: #fff; |
| | | font-size: 38rpx; |
| | | font-weight: bold; |
| | | /* float: left; */ |
| | | display: inline-block; |
| | | } |
| | | button.btn_popup_cancel { |
| | | width:180rpx; |
| | | margin-top: 50rpx; |
| | | padding: 15rpx; |
| | | line-height: 1.5; |
| | | background: #27A6E1; |
| | | border: none; |
| | | color: #fff; |
| | | font-size: 38rpx; |
| | | font-weight: bold; |
| | | /* float: right; */ |
| | | display: inline-block; |
| | | } |
| | | </style> |
| | | |
| | | <template> |
| | |
| | | <button type="default" @tap="cancel" class="btn_cancel" v-if="param.Sub_Cls.Can_Add_Delete == true">取消</button> |
| | | <button type="default" @tap="sava" class="btn_add" 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> |
| | | |
| | | <!-- 普通弹窗 top bottom center left right --> |
| | | <view> |
| | | <uni-popup class="view-popup" ref="popup" background-color="#fff" @change="popupChange"> |
| | | <view class="popup-header">{{check_list.title}}</view> |
| | | <view class="popup-content" :class="{ 'popup-height': popupType === 'left' || popupType === 'right' }" |
| | | :style="{'width':check_list.width?check_list.width+'px':'200px','height':check_list.height?check_list.height+'px':'88%'}"> |
| | | <view class="popup-cont" :style="{'height':check_list.height?check_list.height-45+'px':'415px'}"> |
| | | <view class="view_popup_CheckList" v-for="(item,index) in check_list.items"> |
| | | <checkbox-group class="check_list" @change="checkChange" :data-ischeck="item.check" :data-index="index" :style="{'margin-left': '10rpx'}"> |
| | | <label> |
| | | <checkbox :value="item.check" :checked="item.check"/> |
| | | <text>{{item.name}}</text> |
| | | </label> |
| | | </checkbox-group> |
| | | </view> |
| | | </view> |
| | | <view class="popup-footer"> |
| | | <button type="default" @tap="popup_sava" class="btn_popup_add">确定</button> |
| | | <button type="default" @tap="popup_cancel" class="btn_popup_cancel">取消</button> |
| | | </view> |
| | | </view> |
| | | </uni-popup> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | subClassAttrList:[], |
| | | subPanelList:[], |
| | | subClassGridStyle:[], |
| | | popupType:"center", |
| | | check_list:{}, |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | |
| | | } |
| | | }, |
| | | class_attr_init(){ |
| | | var attrlist = this.$data.classGridStyle.StyleDef.show_style |
| | | var attrlist = this.$data.classGridStyle.StyleDef.show_style; |
| | | var newattrlist = []; |
| | | if (this.$data.classAttrList.length > 0) { |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | |
| | | var attrs = attrlist[i].attrs; |
| | | for (var s = 0; s < this.$data.classAttrList.length; s++) { |
| | | var clsattr = this.$data.classAttrList[s]; |
| | | if (name == clsattr.Name) { |
| | | // if (name == clsattr.Name) { |
| | | var attr = []; |
| | | for (var j = 0; j < attrs.length; j++) { |
| | | for (var l = 0; l < clsattr.Attr.length; l++) { |
| | |
| | | Font:this.$data.classGridStyle.StyleDef.Font?this.$data.classGridStyle.StyleDef.Font:{}, |
| | | Bk_Color:this.$data.classGridStyle.StyleDef.Bk_Color?this.$data.classGridStyle.StyleDef.Bk_Color:'#FFFFFF', |
| | | Text_Color:this.$data.classGridStyle.StyleDef.Text_Color?this.$data.classGridStyle.StyleDef.Text_Color:'#000000' |
| | | }) |
| | | } |
| | | }); |
| | | // } |
| | | } |
| | | } |
| | | if (newattrlist.length > 0) { |
| | |
| | | } |
| | | }, |
| | | subClass_attr_init(){ |
| | | var attrlist = this.$data.subClassGridStyle.StyleDef.show_style |
| | | var attrlist = this.$data.subClassGridStyle.StyleDef.show_style; |
| | | var newattrlist = []; |
| | | if (this.$data.subClassAttrList.length > 0) { |
| | | for (var i = 0; i < attrlist.length; i++) { |
| | |
| | | var attrs = attrlist[i].attrs; |
| | | for (var s = 0; s < this.$data.subClassAttrList.length; s++) { |
| | | var clsattr = this.$data.subClassAttrList[s]; |
| | | if (name == clsattr.Name) { |
| | | // if (name == clsattr.Name) { |
| | | var attr = []; |
| | | for (var j = 0; j < attrs.length; j++) { |
| | | for (var l = 0; l < clsattr.Attr.length; l++) { |
| | |
| | | Font:this.$data.subClassGridStyle.StyleDef.Font?this.$data.subClassGridStyle.StyleDef.Font:{}, |
| | | Bk_Color:this.$data.subClassGridStyle.StyleDef.Bk_Color?this.$data.subClassGridStyle.StyleDef.Bk_Color:'#FFFFFF', |
| | | Text_Color:this.$data.subClassGridStyle.StyleDef.Text_Color?this.$data.subClassGridStyle.StyleDef.Text_Color:'#000000' |
| | | }) |
| | | } |
| | | }); |
| | | // } |
| | | } |
| | | } |
| | | if (newattrlist.length > 0) { |
| | |
| | | } else { |
| | | uni.showModal({title:"提示",content:"未找到可显示的的属性",showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }, |
| | | scan_classAttr_extButton(e){ //选择按钮前 |
| | | var $this = this; |
| | | var Before_Select_Event = $this.$data.param.Scan_Code.Before_Select_Event; |
| | | if(!Before_Select_Event){ |
| | | uni.showModal({title:"提示",content:"选择前事件为空!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | var mast_attr=[]; |
| | | 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=='请选择'){ |
| | | uni.showModal({title:"提示",content:ar.DispName+"未选择数据!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | mast_attr.push({ attr: ar.Name, value: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | mast_attr.push({ attr: ar.Name, value: ar.Value?'1':'0'}); |
| | | else |
| | | mast_attr.push({ attr: ar.Name, value: ar.Value ?ar.Value :''}); |
| | | } |
| | | } |
| | | |
| | | 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 enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: 'MBOX', //this.$data.param.Sub_Cls.ID, // 功能点从数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | edit_dlg: { |
| | | type: 'small', //小窗口 |
| | | class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//当前数据类id |
| | | }, |
| | | master_cls: { |
| | | cls_name: 'MBOX', //$this.$data.param.Master_Cls.Name, |
| | | obj_attrs: req |
| | | }, |
| | | sub_cls: { |
| | | cls_name: 'MBOX', //$this.$data.param.Sub_Cls.Name, |
| | | objects: objects |
| | | } |
| | | |
| | | }; |
| | | var req = []; |
| | | var req=[]; |
| | | // var attrlist = this.$data.subClassAttrList; |
| | | // var msg=''; |
| | | // 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: Before_Select_Event.ID, |
| | | edtype: "7",//"0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: 'MBOX',//this.$data.param.Sub_Cls.ID, |
| | | objid: "", |
| | | attr: [], |
| | | global_attr: req, |
| | | mast_attr: mast_attr, |
| | | inputParamter: mast_attr, |
| | | enviroment: enviroment |
| | | } |
| | | // console.log(info); |
| | | this.scan_DataObjRunCustomEvent(info, ""); |
| | | }, |
| | | popupChange(e) { |
| | | console.log('当前模式:' + e.type + ',状态:' + e.show); |
| | | }, |
| | | checkChange(e){ //弹框check选择 |
| | | // console.log(e.target.dataset); |
| | | var index = e.target.dataset.index; |
| | | var ischeck = e.target.dataset.ischeck; |
| | | var data = this.$data.check_list.items; |
| | | // this.$data.check_list.items=[]; |
| | | if(this.$data.check_list.multiple_choice=="0"){ //判断时单选还是多选 |
| | | for(var i in data){ |
| | | data[i].check=false; |
| | | } |
| | | } |
| | | data[index].check=ischeck?false:true; |
| | | this.$data.check_list.items=data; |
| | | |
| | | }, |
| | | popup_cancel(e){ //弹框取消 |
| | | this.$refs.popup.close(); |
| | | }, |
| | | popup_sava(e){ //弹框确定 选择按钮后 |
| | | var $this = this; |
| | | var After_Select_Event = $this.$data.param.Scan_Code.After_Select_Event; |
| | | if(!After_Select_Event){ |
| | | uni.showModal({title:"提示",content:"选择后事件为空!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | var items = $this.$data.check_list.items; |
| | | var data=[]; |
| | | var name=""; |
| | | for (var i = 0; i < items.length; i++) { |
| | | if(items[i].check==true){ |
| | | if(name) |
| | | name+=';'; |
| | | name+=items[i].name; |
| | | data.push({id:items[i].id,name:items[i].name}); |
| | | } |
| | | } |
| | | if(data.length==0){ |
| | | uni.showModal({title:"提示",content:"未选择数据!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | var mast_attr=[]; |
| | | 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=='请选择'){ |
| | | uni.showModal({title:"提示",content:ar.DispName+"未选择数据!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | if(ar.Type=='引用对象(多个)') |
| | | if(ar.Value=='请') ar.Value=''; |
| | | if(ar.Type=='引用人员' || ar.Type=='引用项目') |
| | | mast_attr.push({ attr: ar.Name, value: ar.ValID ?ar.ValID :'' }); |
| | | else if(ar.Type=='布尔值') |
| | | mast_attr.push({ attr: ar.Name, value: ar.Value?'1':'0'}); |
| | | else |
| | | mast_attr.push({ attr: ar.Name, value: ar.Value ?ar.Value :''}); |
| | | } |
| | | } |
| | | |
| | | $this.$data.scanCodeVal=name; |
| | | var info = { |
| | | eventid: After_Select_Event.ID, |
| | | edtype: "7", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: 'MBOX', |
| | | objid: "", |
| | | attr: [{attr: 'mast_input_3037',value: name}], |
| | | global_attr: mast_attr, |
| | | inputParamter: data, |
| | | enviroment: '' |
| | | } |
| | | // console.log(info); |
| | | this.scan_DataObjRunCustomEvent(info, ""); |
| | | this.$refs.popup.close(); |
| | | }, |
| | | |
| | | cancel(e){ |
| | |
| | | var data_attr = this.$data.classAttrList[index].Attr[iindex]; |
| | | this.DataObjRunCustomEvent_Return(before_click_button, data_attr, button_callback, index,iindex); |
| | | }, |
| | | scan_classAttr_extButton(e){ //---------未完成----------- |
| | | var $this = this; |
| | | var Before_Select_Event = $this.$data.param.Scan_Code.Before_Select_Event.ID; |
| | | var After_Select_Event = $this.$data.param.Scan_Code.After_Select_Event.ID; |
| | | if(!Before_Select_Event){ |
| | | uni.showModal({title:"提示",content:"选择按钮前事件为空!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | if(!After_Select_Event){ |
| | | uni.showModal({title:"提示",content:"新增按钮后事件为空!",showCancel:false,confirmText:"取消"}); |
| | | return; |
| | | } |
| | | // var data_attr = this.$data.classAttrList[index].Attr[iindex]; |
| | | this.DataObjRunCustomEvent_Return(Before_Select_Event, '', After_Select_Event, '', ''); |
| | | }, |
| | | classAttr_AddPer(index,iindex){ |
| | | var param={index:index,iindex:iindex}; |
| | | var $this = this; |
| | |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | if(data.action){ |
| | | var actionlist = data.action; |
| | | if (actionlist) { |
| | | for (var j = 0; j < actionlist.length; j++) { |
| | | var action = actionlist[j] |
| | | var action_type = action.action_type; |
| | | var value = action.value; |
| | | if (action_type == 'set_dlg_attr') { |
| | | if (value) { |
| | | var val = value; |
| | | if (typeof value == 'string') { |
| | | val = JSON.parse(value); |
| | | } |
| | | console.log(val); |
| | | for (var i = 0; i < val.length; i++) { |
| | | for (var a = 0; a < this.$data.classAttrList.length; a++) { |
| | | for (var l = 0; l < this.$data.classAttrList[a].Attr.length; l++) { |
| | | var ca = this.$data.classAttrList[a].Attr[l]; |
| | | if (val[i].attr == ca.Name) { |
| | | if(ca.Type=='字典' || ca.Type=='字典-字符串' || ca.Type=='字典-整数'){ |
| | | var dictItemList=[]; |
| | | for(var d in val[i].choice_list){ |
| | | var val =val[i].choice_list[d]; |
| | | dictItemList.push({"CN_S_NAME":val,"Name":val,"label":val,"value":val}); |
| | | |
| | | 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 == 801) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | else uni.showModal({title:'提示',content:tip+',提示:'+data.ret,showCancel:false,confirmText:"取消"}); |
| | | return false |
| | | }else{ |
| | | let tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join('<br/>') : ''; |
| | | if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | |
| | | if(data.action){ |
| | | var actionlist = data.action; |
| | | if (actionlist) { |
| | | for (var j = 0; j < actionlist.length; j++) { |
| | | var action = actionlist[j] |
| | | var action_type = action.action_type; |
| | | var value = action.value; |
| | | if (action_type == 'set_dlg_attr') { |
| | | if (value) { |
| | | var val = value; |
| | | if (typeof value == 'string') { |
| | | val = JSON.parse(value); |
| | | } |
| | | console.log(val); |
| | | for (var i = 0; i < val.length; i++) { |
| | | for (var a = 0; a < this.$data.classAttrList.length; a++) { |
| | | for (var l = 0; l < this.$data.classAttrList[a].Attr.length; l++) { |
| | | var ca = this.$data.classAttrList[a].Attr[l]; |
| | | if (val[i].attr == ca.Name) { |
| | | if(ca.Type=='字典' || ca.Type=='字典-字符串' || ca.Type=='字典-整数'){ |
| | | var dictItemList=[]; |
| | | for(var d in val[i].choice_list){ |
| | | var val =val[i].choice_list[d]; |
| | | dictItemList.push({"CN_S_NAME":val,"Name":val,"label":val,"value":val}); |
| | | |
| | | } |
| | | ca.dictitem = dictItemList; |
| | | // attr[j].dictitem = val[i].choice_list; |
| | | }else{ |
| | | // ca.value = val[i].value; |
| | | } |
| | | ca.dictitem = dictItemList; |
| | | // attr[j].dictitem = val[i].choice_list; |
| | | }else{ |
| | | // ca.value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!this.$data.refdatastore.filter(function (s) { |
| | | return val[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | this.$data.refdatastore.push(val[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < this.$data.refdatastore.length; j++) { |
| | | if (this.$data.refdatastore[j].attr == val[i].attr) { |
| | | this.$data.refdatastore[j].value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!this.$data.refdatastore.filter(function (s) { |
| | | return val[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | this.$data.refdatastore.push(val[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < this.$data.refdatastore.length; j++) { |
| | | if (this.$data.refdatastore[j].attr == val[i].attr) { |
| | | this.$data.refdatastore[j].value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (action_type == 'open_select_userdlg') { |
| | | uni.showModal({title:"错误2.2",content:"open_select_userdlg这个action_type还未处理!",showCancel:false,confirmText:"取消"}); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (action_type == 'open_select_userdlg') { |
| | | uni.showModal({title:"错误2.2",content:"open_select_userdlg这个action_type还未处理!",showCancel:false,confirmText:"取消"}); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | var actionlist = data.action; |
| | | |
| | | if (actionlist) { |
| | | console.log(actionlist); |
| | | for (var i = 0; i < actionlist.length; i++) { |
| | | var action = actionlist[i]; |
| | | if (action.action_type == 'set_dlg_attr') { |
| | | var result = action.value; |
| | | for (var i = 0; i < result.length; i++) { |
| | | if (result[i].choice_list) { |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if(attr[j].Name==result[i].attr){ |
| | | if(attr[j].Type=='字典' || attr[j].Type=='字典-字符串' || attr[j].Type=='字典-整数'){ |
| | | var dictItemList=[]; |
| | | for(var d in result[i].choice_list){ |
| | | var val =result[i].choice_list[d]; |
| | | dictItemList.push({"CN_S_NAME":val,"Name":val,"label":val,"value":val}); |
| | | 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 == 801) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | else uni.showModal({title:'提示',content:tip+',提示:'+data.ret,showCancel:false,confirmText:"取消"}); |
| | | return false |
| | | }else{ |
| | | let tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join('<br/>') : ''; |
| | | if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | |
| | | var actionlist = data.action; |
| | | if (actionlist) { |
| | | console.log(actionlist); |
| | | for (var i = 0; i < actionlist.length; i++) { |
| | | var action = actionlist[i]; |
| | | if (action.action_type == 'set_dlg_attr') { |
| | | var result = action.value; |
| | | for (var i = 0; i < result.length; i++) { |
| | | if (result[i].choice_list) { |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if(attr[j].Name==result[i].attr){ |
| | | if(attr[j].Type=='字典' || attr[j].Type=='字典-字符串' || attr[j].Type=='字典-整数'){ |
| | | var dictItemList=[]; |
| | | for(var d in result[i].choice_list){ |
| | | var val =result[i].choice_list[d]; |
| | | dictItemList.push({"CN_S_NAME":val,"Name":val,"label":val,"value":val}); |
| | | } |
| | | attr[j].dictitem = dictItemList; |
| | | // attr[j].dictitem = result[i].choice_list; |
| | | } |
| | | attr[j].dictitem = dictItemList; |
| | | // attr[j].dictitem = result[i].choice_list; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | console.log(attr[j].Name+'=='+result[i].attr); |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i].attr) { |
| | | $this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if (data.action[i].action_type == 'set_global_attr') { |
| | | $this.$data.global_attr = data.action[i].value || []; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (data.result) { |
| | | var result = data.result; |
| | | for (var i = 0; i < result.length; i++) { |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i].attr) { |
| | | $this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | console.log(attr[j].Name+'=='+result[i].attr); |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i].attr) { |
| | | $this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if (data.action[i].action_type == 'set_global_attr') { |
| | | $this.$data.global_attr = data.action[i].value || []; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (data.result) { |
| | | var result = data.result; |
| | | for (var i = 0; i < result.length; i++) { |
| | | for (var c = 0; c < $this.$data.classAttrList.length; c++) { |
| | | var attr = $this.$data.classAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i].attr) { |
| | | $this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误3",content:success.err_msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | |
| | | this.$store.dispatch('runCustomEvent',dataInfo).then(success=>{ |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | var result = data.result; |
| | | for (var i = 0; i < result.length; i++) { |
| | | // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value); |
| | | var length = 0; |
| | | if (!this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < this.$data.refdatastore.length; j++) { |
| | | if (this.$data.refdatastore[j].attr == result[i].attr) { |
| | | this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var data = success.result; |
| | | 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 == 801) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | else uni.showModal({title:'提示',content:tip+',提示:'+data.ret,showCancel:false,confirmText:"取消"}); |
| | | return false |
| | | }else{ |
| | | let tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join('<br/>') : ''; |
| | | if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | |
| | | this.add(); |
| | | var result = data.result; |
| | | for (var i = 0; i < result.length; i++) { |
| | | // self.class_attr_ele.find('.attr_field[data-field="' + result[i].attr + '"]').val(result[i].value).data('val', result[i].value); |
| | | var length = 0; |
| | | if (!this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < this.$data.refdatastore.length; j++) { |
| | | if (this.$data.refdatastore[j].attr == result[i].attr) { |
| | | this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.add(); |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误4",content:success.err_msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | if (data != "") { |
| | | |
| | | var actions = data.action; |
| | | console.log(actions); |
| | | if (actions) { |
| | | for (var i = 0; i < actions.length; i++) { |
| | | var action = actions[i]; |
| | | var val = action.value; |
| | | var enviroment = JSON.stringify(enviroment); |
| | | |
| | | if (action.action_type == 'open_panel') { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } |
| | | else if (action.action_type == 'open_select_userdlg') { |
| | | var style = val.style; |
| | | // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : '' |
| | | var $this = this; |
| | | var param={ |
| | | index: index, |
| | | iindex:iindex, |
| | | button_callback:button_callback, |
| | | req:req, |
| | | data_attr:data_attr |
| | | 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 == 801) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | else uni.showModal({title:'提示',content:tip+',提示:'+data.ret,showCancel:false,confirmText:"取消"}); |
| | | return false |
| | | }else{ |
| | | let tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join('<br/>') : ''; |
| | | if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | |
| | | if (data != "") { |
| | | var actions = data.action; |
| | | console.log(actions); |
| | | if (actions) { |
| | | for (var i = 0; i < actions.length; i++) { |
| | | var action = actions[i]; |
| | | var val = action.value; |
| | | var enviroment = JSON.stringify(enviroment); |
| | | |
| | | if (action.action_type == 'open_panel') { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } |
| | | uni.navigateTo({ |
| | | url:'../selpsn/index?mulit=false¶m='+JSON.stringify(param), |
| | | events:{ |
| | | AddPer(data,param){ |
| | | // console.log(param); |
| | | console.log(data); |
| | | var callback_eventid = param.button_callback.trim(); |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: $this.$data.param.Master_Cls.ID, |
| | | objid: "", |
| | | attr: param.req, |
| | | inputparameter: data |
| | | } |
| | | $this.DataObjRunCustomEvent(info, param.data_attr); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | else if (action.action_type == 'open_data_query_dlg') { |
| | | |
| | | } |
| | | else if (action.action_type == 'open_common_dlg') { |
| | | var value = action.value; |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } |
| | | else if (action.action_type == 'open_project_query_dlg') { |
| | | //console.log(action.value.select_range); |
| | | //console.log(action.value.mulit_select); |
| | | var priRel = '-1'; |
| | | if (action.value.select_range == '全部相关') |
| | | priRel = '0'; |
| | | else if (action.value.select_range == '我负责的项目') |
| | | priRel = '1'; |
| | | else if (action.value.select_range == '我创建的') |
| | | priRel = '2'; |
| | | else if (action.value.select_range == '我参与的' || action.value.select_range == '我参加的') |
| | | priRel = '3'; |
| | | else if (action.value.select_range == '我关注的') |
| | | priRel = '4'; |
| | | else if (action.value.select_range == '我下属的项目') |
| | | priRel = '5'; |
| | | |
| | | var $this = this; |
| | | var param_={ |
| | | index: index, |
| | | iindex:iindex, |
| | | button_callback:button_callback, |
| | | req:req |
| | | } |
| | | uni.navigateTo({ |
| | | url:'../selPrj/index?relation='+priRel+'¶m='+JSON.stringify(param_), |
| | | events:{ |
| | | AddPer(data,param){ |
| | | $this.$data.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; |
| | | $this.$data.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; |
| | | var callback_eventid = param.button_callback.trim(); |
| | | if (callback_eventid) { |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "2", |
| | | projectid: data[0].ID, |
| | | rclsid: "", |
| | | robjid: "", |
| | | userlogin: "", |
| | | clsid: $this.$data.param.Master_Cls.ID, |
| | | objid: "", |
| | | attr: param.req, |
| | | } |
| | | |
| | | $this.DataObjRunCustomEvent(info); |
| | | else if (action.action_type == 'open_select_userdlg') { |
| | | var style = val.style; |
| | | // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : '' |
| | | var $this = this; |
| | | var param={ |
| | | index: index, |
| | | iindex:iindex, |
| | | button_callback:button_callback, |
| | | req:req, |
| | | data_attr:data_attr |
| | | } |
| | | uni.navigateTo({ |
| | | url:'../selpsn/index?mulit=false¶m='+JSON.stringify(param), |
| | | events:{ |
| | | AddPer(data,param){ |
| | | // console.log(param); |
| | | console.log(data); |
| | | var callback_eventid = param.button_callback.trim(); |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "0", |
| | | projectid: '', |
| | | rclsid: '', |
| | | robjid: '', |
| | | userlogin: '', |
| | | clsid: $this.$data.param.Master_Cls.ID, |
| | | objid: "", |
| | | attr: param.req, |
| | | inputparameter: data |
| | | } |
| | | $this.DataObjRunCustomEvent(info, param.data_attr); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | else if (action.action_type == 'open_data_query_dlg') { |
| | | |
| | | } |
| | | else if (action.action_type == 'open_common_dlg') { |
| | | var value = action.value; |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } |
| | | else if (action.action_type == 'open_project_query_dlg') { |
| | | //console.log(action.value.select_range); |
| | | //console.log(action.value.mulit_select); |
| | | var priRel = '-1'; |
| | | if (action.value.select_range == '全部相关') |
| | | priRel = '0'; |
| | | else if (action.value.select_range == '我负责的项目') |
| | | priRel = '1'; |
| | | else if (action.value.select_range == '我创建的') |
| | | priRel = '2'; |
| | | else if (action.value.select_range == '我参与的' || action.value.select_range == '我参加的') |
| | | priRel = '3'; |
| | | else if (action.value.select_range == '我关注的') |
| | | priRel = '4'; |
| | | else if (action.value.select_range == '我下属的项目') |
| | | priRel = '5'; |
| | | |
| | | var $this = this; |
| | | var param_={ |
| | | index: index, |
| | | iindex:iindex, |
| | | button_callback:button_callback, |
| | | req:req |
| | | } |
| | | }); |
| | | } else { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | uni.navigateTo({ |
| | | url:'../selPrj/index?relation='+priRel+'¶m='+JSON.stringify(param_), |
| | | events:{ |
| | | AddPer(data,param){ |
| | | $this.$data.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name; |
| | | $this.$data.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name; |
| | | var callback_eventid = param.button_callback.trim(); |
| | | if (callback_eventid) { |
| | | var info = { |
| | | eventid: callback_eventid, |
| | | edtype: "2", |
| | | projectid: data[0].ID, |
| | | rclsid: "", |
| | | robjid: "", |
| | | userlogin: "", |
| | | clsid: $this.$data.param.Master_Cls.ID, |
| | | objid: "", |
| | | attr: param.req, |
| | | } |
| | | |
| | | $this.DataObjRunCustomEvent(info); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | var d = dialog({ |
| | | title: '<i class="ace-icon fa fa-info-circle"></i> ' + '提示', |
| | | content: action.action_type + '此action尚未处理!' |
| | | }); |
| | | d.show(); |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"提示5.2",content: '调用 before_click_button 脚本返回空,event_id' + eventid,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误5",content:success.err_msg,showCancel:false,confirmText:"取消"}); |
| | |
| | | this.$store.dispatch('runCustomEvent',dataInfo).then(success=>{ |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | var actionlist = data.action; |
| | | if (actionlist) { |
| | | for (var j = 0; j < actionlist.length; j++) { |
| | | var action = actionlist[j] |
| | | var action_type = action.action_type; |
| | | var value = action.value; |
| | | if (action_type == 'set_dlg_attr') { |
| | | if (value) { |
| | | var val = value; |
| | | if (typeof value == 'string') { |
| | | val = JSON.parse(value); |
| | | } |
| | | console.log(val); |
| | | for (var i = 0; i < val.length; i++) { |
| | | for (var a = 0; a < this.$data.subClassAttrList.length; a++) { |
| | | for (var l = 0; l < this.$data.subClassAttrList[a].Attr.length; l++) { |
| | | var ca = this.$data.subClassAttrList[a].Attr[l]; |
| | | if (val[i].attr == ca.Name) { |
| | | if(ca.Type=='字典' || ca.Type=='字典-字符串' || ca.Type=='字典-整数'){ |
| | | var dictItemList=[]; |
| | | for(var d in val[i].choice_list){ |
| | | var val =val[i].choice_list[d]; |
| | | dictItemList.push({"CN_S_NAME":val,"Name":val,"label":val,"value":val}); |
| | | |
| | | } |
| | | ca.dictitem = dictItemList; |
| | | // attr[j].dictitem = val[i].choice_list; |
| | | }else{ |
| | | // ca.value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!this.$data.refdatastore.filter(function (s) { |
| | | return val[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | this.$data.refdatastore.push(val[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < this.$data.refdatastore.length; j++) { |
| | | if (this.$data.refdatastore[j].attr == val[i].attr) { |
| | | this.$data.refdatastore[j].value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (action_type == 'open_select_userdlg') { |
| | | uni.showModal({title:"错误6.2",content:"open_select_userdlg这个action_type还未处理!",showCancel:false,confirmText:"取消"}); |
| | | } |
| | | } |
| | | } |
| | | |
| | | var data = success.result; |
| | | 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 == 801) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | else uni.showModal({title:'提示',content:tip+',提示:'+data.ret,showCancel:false,confirmText:"取消"}); |
| | | return false |
| | | }else{ |
| | | let tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join('<br/>') : ''; |
| | | if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | |
| | | var actionlist = data.action; |
| | | if (actionlist) { |
| | | for (var j = 0; j < actionlist.length; j++) { |
| | | var action = actionlist[j] |
| | | var action_type = action.action_type; |
| | | var value = action.value; |
| | | if (action_type == 'set_dlg_attr') { |
| | | if (value) { |
| | | var val = value; |
| | | if (typeof value == 'string') { |
| | | val = JSON.parse(value); |
| | | } |
| | | console.log(val); |
| | | for (var i = 0; i < val.length; i++) { |
| | | for (var a = 0; a < this.$data.subClassAttrList.length; a++) { |
| | | for (var l = 0; l < this.$data.subClassAttrList[a].Attr.length; l++) { |
| | | var ca = this.$data.subClassAttrList[a].Attr[l]; |
| | | if (val[i].attr == ca.Name) { |
| | | if(ca.Type=='字典' || ca.Type=='字典-字符串' || ca.Type=='字典-整数'){ |
| | | var dictItemList=[]; |
| | | for(var d in val[i].choice_list){ |
| | | var val =val[i].choice_list[d]; |
| | | dictItemList.push({"CN_S_NAME":val,"Name":val,"label":val,"value":val}); |
| | | |
| | | } |
| | | ca.dictitem = dictItemList; |
| | | // attr[j].dictitem = val[i].choice_list; |
| | | }else{ |
| | | // ca.value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!this.$data.refdatastore.filter(function (s) { |
| | | return val[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | this.$data.refdatastore.push(val[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < this.$data.refdatastore.length; j++) { |
| | | if (this.$data.refdatastore[j].attr == val[i].attr) { |
| | | this.$data.refdatastore[j].value = val[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (action_type == 'open_select_userdlg') { |
| | | uni.showModal({title:"错误6.2",content:"open_select_userdlg这个action_type还未处理!",showCancel:false,confirmText:"取消"}); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误6",content:success.err_msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | |
| | | }, |
| | | scan_DataObjRunCustomEvent(info,data_attr){ |
| | | var $this = this; |
| | | var enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: 'MBOX',//this.$data.param.Sub_Cls.ID, // 功能点从数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | master: { |
| | | cls_id: 'MBOX',//this.$data.param.Sub_Cls.ID, // button=bottom时 master的cls_id |
| | | attr: info.mast_attr //主数据类属性 |
| | | //obj_id: '' // button=bottom时 master的obj_id |
| | | } |
| | | }; |
| | | enviroment.edit_dlg = { |
| | | type: 'small',//小窗口 |
| | | class_id: 'MBOX',//this.$data.param.Sub_Cls.ID,//当前数据类id |
| | | var enviroment = {}; |
| | | if(info.enviroment){ |
| | | enviroment = info.enviroment; |
| | | } else { |
| | | enviroment = { |
| | | 'function': '3000', // 功能点编号 |
| | | cls_id: 'MBOX', //this.$data.param.Sub_Cls.ID, // 功能点从数据类标识 |
| | | 'button': 'top', // top/bottom |
| | | button_name: '新增', |
| | | edit_dlg: { |
| | | type: 'small', //小窗口 |
| | | class_id: 'MBOX', //this.$data.param.Sub_Cls.ID,//当前数据类id |
| | | }, |
| | | }; |
| | | |
| | | } |
| | | if (data_attr) { |
| | | enviroment.edit_dlg.form_control = {//所属的表单控件 |
| | | name: data_attr.Name,//字段属性 |
| | | text: data_attr.DispName,//显示文本 |
| | | group_name: data_attr.GroupName,//属性组 |
| | | type: data_attr.Type,//字段类型 |
| | | readonly: data_attr.ReadOnly,//是否只读 |
| | | button_img: data_attr.button_img,//引用按钮的图标 |
| | | button_tooltip: data_attr.button_tooltip//引用按钮的tooltip |
| | | } |
| | | var global_attr = this.$data.global_attr; |
| | | if (info.global_attr) { |
| | | global_attr = info.global_attr; |
| | | } |
| | | |
| | | // var dataInfo = { |
| | | // edtype: info.edtype, eventid: info.eventid, projectid: info.projectid.replace('{','').replace('}',''), |
| | | // rclsid: info.rclsid, robjid: info.robjid, userlogin: info.userlogin, clsid: info.clsid, objid: info.objid, |
| | | // attr: JSON.stringify(info.attr), extinfo: JSON.stringify(enviroment), inputparameter: JSON.stringify(info.inputParamter), global_attr: JSON.stringify(this.$data.global_attr) |
| | | // } |
| | | |
| | | enviroment = Base64.encode(JSON.stringify(enviroment));//将字符串转换为base64编码 |
| | | var inputParamter=info.inputParamter; |
| | | if(info.inputParamter){ |
| | | info.inputParamter = Base64.encode(JSON.stringify(info.inputParamter));//将字符串转换为base64编码 |
| | | } |
| | |
| | | this.$store.dispatch('runCustomEvent',dataInfo).then(success=>{ |
| | | console.log(success); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | var actionlist = data.action; |
| | | |
| | | if (actionlist) { |
| | | console.log(actionlist); |
| | | 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++) { |
| | | if (result[i].choice_list) { |
| | | for (var s = 0; s < $this.$data.subPanelList.length; s++) { |
| | | for (var c = 0; c < $this.$data.subPanelList[s].subClassAttrList.length; c++) { |
| | | var attr = $this.$data.subPanelList[s].subClassAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if(attr[j].Name==result[i].attr){ |
| | | if(attr[j].Type=='字典' || attr[j].Type=='字典-字符串' || attr[j].Type=='字典-整数'){ |
| | | var dictItemList=[]; |
| | | for(var d in result[i].choice_list){ |
| | | var val =result[i].choice_list[d]; |
| | | dictItemList.push({"CN_S_NAME":val,"Name":val,"label":val,"value":val}); |
| | | var data = success.result; |
| | | 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 == 801) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | else uni.showModal({title:'提示',content:tip+',提示:'+data.ret,showCancel:false,confirmText:"取消"}); |
| | | return false |
| | | }else{ |
| | | let tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join('<br/>') : ''; |
| | | if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | |
| | | var actionlist = data.action; |
| | | if (actionlist) { |
| | | console.log(actionlist); |
| | | 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++) { |
| | | if (result[i].choice_list) { |
| | | for (var s = 0; s < $this.$data.subPanelList.length; s++) { |
| | | for (var c = 0; c < $this.$data.subPanelList[s].subClassAttrList.length; c++) { |
| | | var attr = $this.$data.subPanelList[s].subClassAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | if(attr[j].Name==result[i].attr){ |
| | | if(attr[j].Type=='字典' || attr[j].Type=='字典-字符串' || attr[j].Type=='字典-整数'){ |
| | | var dictItemList=[]; |
| | | for(var d in result[i].choice_list){ |
| | | var val =result[i].choice_list[d]; |
| | | dictItemList.push({"CN_S_NAME":val,"Name":val,"label":val,"value":val}); |
| | | } |
| | | attr[j].dictitem = dictItemList; |
| | | // attr[j].dictitem = result[i].choice_list; |
| | | } |
| | | attr[j].dictitem = dictItemList; |
| | | // attr[j].dictitem = result[i].choice_list; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | for (var s = 0; s < $this.$data.subPanelList.length; s++) { |
| | | for (var c = 0; c < $this.$data.subPanelList[s].subClassAttrList.length; c++) { |
| | | var attr = $this.$data.subPanelList[s].subClassAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | console.log(attr[j].Name+'=='+result[i].attr); |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i].attr) { |
| | | $this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } 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: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 == scanCodeVal){ |
| | | if(result[i].attr=="S_ID") |
| | | $this.$data.subPanelList[s].ObjID=result[i].value; |
| | | var _subClassAttr = $this.$data.subPanelList[s].subClassAttr; |
| | | for (var c = 0; c < _subClassAttr.length; c++) { |
| | | var attr = _subClassAttr[c].Attr; |
| | | } |
| | | for (var s = 0; s < $this.$data.subPanelList.length; s++) { |
| | | for (var c = 0; c < $this.$data.subPanelList[s].subClassAttrList.length; c++) { |
| | | var attr = $this.$data.subPanelList[s].subClassAttrList[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | // console.log(attr[j].Name+'=='+result[i].attr); |
| | | console.log(attr[j].Name+'=='+result[i].attr); |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // $this.$data.subPanelList[s].subClassAttr=list_1; |
| | | } |
| | | } |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i].attr) { |
| | | $this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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: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 == scanCodeVal){ |
| | | if(result[i].attr=="S_ID") |
| | | $this.$data.subPanelList[s].ObjID=result[i].value; |
| | | var _subClassAttr = $this.$data.subPanelList[s].subClassAttr; |
| | | for (var c = 0; c < _subClassAttr.length; c++) { |
| | | var attr = _subClassAttr[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | // console.log(attr[j].Name+'=='+result[i].attr); |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = result[i].value; |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i].attr) { |
| | | $this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i].attr) { |
| | | $this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | } else if (action.action_type == 'set_global_attr') { |
| | | $this.$actiontr = action.value || []; |
| | | } else if (action.action_type == 'open_common_dlg') { //打开侧滑弹框 |
| | | var $this = this; |
| | | if(action.value.common_dlg_id == 'check_list'){ |
| | | $this.$data.check_list= action.value.config; |
| | | if(action.value.config.appear_style == 'sideslip') //判断是否是侧滑 |
| | | $this.$data.popupType = 'right'; |
| | | else |
| | | $this.$data.popupType = 'center' |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | $this.$refs.popup.open($this.$data.popupType); |
| | | } |
| | | } else if (action.action_type == 'add_subcls_panel') { //主从数据类扫码查询数据 |
| | | var result = action.value; |
| | | var $this = this; |
| | | let list_1 = JSON.parse(JSON.stringify(this.$data.subClassAttrList)); |
| | | var scanCodeVal = $this.$data.scanCodeVal; |
| | | var rand = ''; |
| | | for (var i = 0; i < 5; i++) { //生成5位随机数 |
| | | rand += Math.floor(Math.random() * 10); |
| | | } |
| | | if (inputParamter[0].attr) { |
| | | if (inputParamter[0].attr == "mast_input_3037") //判断是主数据类扫码查询数据 |
| | | scanCodeVal = "mast_input_3037-" + rand; |
| | | } |
| | | if (info.attr[0].attr) { |
| | | if (info.attr[0].attr == "mast_input_3037") //判断是主数据类扫码查询数据 |
| | | scanCodeVal = "mast_input_3037-" + rand; |
| | | } |
| | | $this.$data.subPanelList.push({ |
| | | 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 == scanCodeVal){ |
| | | if(result[i].attr=="S_ID") |
| | | $this.$data.subPanelList[s].ObjID=result[i].value; |
| | | var _subClassAttr = $this.$data.subPanelList[s].subClassAttr; |
| | | for (var c = 0; c < _subClassAttr.length; c++) { |
| | | var attr = _subClassAttr[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | // console.log(attr[j].Name+'=='+result[i].attr); |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // $this.$data.subPanelList[s].subClassAttr=list_1; |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i].attr) { |
| | | $this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (data.result) { |
| | | let list_1 = JSON.parse(JSON.stringify(this.$data.subClassAttrList)); |
| | | var scanCodeVal = $this.$data.scanCodeVal; |
| | | var rand = ''; |
| | | for (var i = 0; i < 5; i++) { //生成5位随机数 |
| | | rand += Math.floor(Math.random() * 10); |
| | | } |
| | | if (inputParamter[0].attr) { |
| | | if (inputParamter[0].attr == "mast_input_3037") //判断是主数据类扫码查询数据 |
| | | scanCodeVal = "mast_input_3037-" + rand; |
| | | } |
| | | if (info.attr[0].attr) { |
| | | if (info.attr[0].attr == "mast_input_3037") //判断是主数据类扫码查询数据 |
| | | scanCodeVal = "mast_input_3037-" + rand; |
| | | } |
| | | $this.$data.subPanelList.push({ |
| | | 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 == scanCodeVal){ |
| | | if(result[i].attr=="S_ID") |
| | | $this.$data.subPanelList[s].ObjID=result[i].value; |
| | | var _subClassAttr = $this.$data.subPanelList[s].subClassAttr; |
| | | for (var c = 0; c < _subClassAttr.length; c++) { |
| | | var attr = _subClassAttr[c].Attr; |
| | | for (var j = 0; j < attr.length; j++) { |
| | | // console.log(attr[j].Name+'=='+result[i].attr); |
| | | if(attr[j].Name==result[i].attr){ |
| | | attr[j].Value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var length = 0; |
| | | if (!$this.$data.refdatastore.filter(function (s) { |
| | | return result[i].attr == s.attr |
| | | }).length) { |
| | | length = 1; |
| | | $this.$data.refdatastore.push(result[i]); |
| | | } |
| | | if (length == 0) { |
| | | for (var j = 0; j < $this.$data.refdatastore.length; j++) { |
| | | if ($this.$data.refdatastore[j].attr == result[i].attr) { |
| | | $this.$data.refdatastore[j].value = result[i].value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误7",content:success.err_msg,showCancel:false,confirmText:"取消"}); |
| | | } |
| | | }).catch(ex=>{ |
| | |
| | | console.log(success); |
| | | uni.hideLoading(); |
| | | if (success.err_code == 0) { |
| | | var data = success.result; |
| | | var result = data.result; |
| | | if(eventID != $this.$data.param.After_OK_Event.ID) |
| | | $this.scan_OKDataObjRunCustomEvent($this.$data.param.After_OK_Event.ID); |
| | | else{ |
| | | //刷新 |
| | | uni.redirectTo({ |
| | | url:'../modal/3037?param='+JSON.stringify($this.$data.param)+"&titlename="+$this.$data.title |
| | | }); |
| | | var data = success.result; |
| | | 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 == 801) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | else uni.showModal({title:'提示',content:tip+',提示:'+data.ret,showCancel:false,confirmText:"取消"}); |
| | | return false |
| | | }else{ |
| | | let tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join('<br/>') : ''; |
| | | if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"}); |
| | | |
| | | var result = data.result; |
| | | if(eventID != $this.$data.param.After_OK_Event.ID) |
| | | $this.scan_OKDataObjRunCustomEvent($this.$data.param.After_OK_Event.ID); |
| | | else{ |
| | | //刷新 |
| | | uni.redirectTo({ |
| | | url:'../modal/3037?param='+JSON.stringify($this.$data.param)+"&titlename="+$this.$data.title |
| | | }); |
| | | } |
| | | } |
| | | }else{ |
| | | uni.showModal({title:"错误8",content:success.err_msg,showCancel:false,confirmText:"取消"}); |