| | |
| | | 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) { |
| | |
| | | } 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; |
| | | } |
| | | // 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, '', ''); |
| | | 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 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: req, |
| | | mast_attr: mast_attr, |
| | | inputParamter: mast_attr |
| | | } |
| | | // 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: 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}; |
| | |
| | | } |
| | | } 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; |
| | | if(info.inputParamter[0].attr){ |
| | | if(info.inputParamter[0].attr=="mast_input_3037") //判断是主数据类扫码查询数据 |
| | | scanCodeVal = "mast_input_3037-"+ii; |
| | | } |
| | | $this.$data.subPanelList.push({ |
| | | scanCodeVal:scanCodeVal, |
| | | subClassAttr:list_1 |