jt
2024-03-14 db95b21bd883df9cbbad97d86bb8e94709ffa312
pages/modal/3200.vue
@@ -189,7 +189,7 @@
  background-color: #D6FCB2;
}
.uni-padding-wrap{
  margin-top: 14rpx;
  margin-top: 20rpx;
  background-color: #98DAEA;
  width: 104rpx;
  height: 80rpx;
@@ -260,7 +260,7 @@
            :class="item.disabled?'input-disabled':''"
            v-model="item.value"
            :localdata="item.dict"
            @change="onchange(item)"
            @change="onChange(item)"
            :disabled="item.disabled"
            :clear="false"
         ></uni-data-select>
@@ -314,7 +314,7 @@
                    <text v-if="item.setting.prefix" 
                       class="uni-icon" 
                       :class="[item.setting.prefix]"
                       @change="onchange(item)">&#xe568;</text>
                       @change="onChange(item)">&#xe568;</text>
                    <input class="uni-input" :class="item.disabled?'input-disabled':''" 
                       :type="item.name=='Input'?'text':item.name=='InputNumber'?'number':'text'" 
                       v-model="item.value"
@@ -328,14 +328,14 @@
                    <text v-if="item.setting.suffix" 
                       class="uni-icon" 
                       :class="[item.setting.suffix]"
                       @click="onchange(item)">&#xe568;</text>
                       @click="onChange(item)">&#xe568;</text>
                 </view>
                 <!-- 下拉框-单选 item.useDict?item.dict:item.selections-->
                 <uni-data-select id="dv_select" v-if="item.name=='Select' && !item.disabled"
                    :class="item.disabled?'input-disabled':''" 
                    v-model="item.value"
                    :localdata="item.dict"
                    @change="onchange(item)"
                    @change="onChange(item)"
                    :disabled="item.disabled"
                    :clear="false"
                 ></uni-data-select>
@@ -390,7 +390,7 @@
                          <text v-if="cols.setting.prefix" 
                             class="uni-icon" 
                             :class="[cols.setting.prefix]"
                             @change="onchange(cols)">&#xe568;</text>
                             @change="onChange(cols)">&#xe568;</text>
                          <input class="uni-input" :class="cols.disabled?'input-disabled':''" 
                             :type="cols.name=='Input'?'text':cols.name=='InputNumber'?'number':'text'" 
                             v-model="cols.value"
@@ -404,14 +404,14 @@
                          <text v-if="cols.setting.suffix" 
                             class="uni-icon" 
                             :class="[cols.setting.suffix]"
                             @click="onchange(cols)">&#xe568;</text>
                             @click="onChange(cols)">&#xe568;</text>
                       </view>
                       <!-- 下拉框-单选 cols.useDict?cols.dict:cols.selections-->
                       <uni-data-select id="dv_select" v-if="cols.name=='Select' && !cols.disabled"
                          :class="cols.disabled?'input-disabled':''" 
                          v-model="cols.value"
                          :localdata="cols.dict"
                          @change="onchange(cols)"
                          @change="onChange(cols)"
                          :disabled="cols.disabled"
                          :clear="false"
                       ></uni-data-select>
@@ -477,10 +477,10 @@
      
     <view class="view-floor">
        <button type="default" @click="cancel" class="btn_cancel" 
        :style="{'width':param.ListPage.Page_Button?'39.5%':'49.5%'}">关闭</button>
        :style="{'width':param.ListPage.Page_Button.length>0?'39.5%':'48.5%'}">关闭</button>
        <button type="default" @click="Refresh" class="btn_refresh" 
        :style="{'width':param.ListPage.Page_Button?'39.5%':'49.5%'}">刷新</button>
      <view class="uni-padding-wrap" v-if="param.ListPage.Page_Button">
        :style="{'width':param.ListPage.Page_Button.length>0?'39.5%':'48.5%'}">刷新</button>
      <view class="uni-padding-wrap" v-if="param.ListPage.Page_Button.length>0">
         <view class="uni-btn-v">
            <a @tap="actionSheetTap"><Icon class="mobox-normal-more"/></a>
         </view>
@@ -603,7 +603,7 @@
                 if(!ret.result.style_def.includes('"')) styledef = Base64.decode(ret.result.style_def);
            }
            $this.$data.detail1_styledef = ret.result.style_def? JSON.parse(styledef): {};
            $this.$data.detail1_styledef.SelBut_Checked = true;
            $this.$data.detail1_styledef.SelBut_Checked = false;
            // console.log($this.$data.detail1_styledef);
            // $this.$data.detail1StyleDefList.push($this.$data.detail1_styledef);
            // var aa = JSON.stringify(this.detail1_styledef);
@@ -648,8 +648,9 @@
                  $this.head_styledef.form.model[attr] = itemName;
               }
               $this.head_styledef.form.items[index].dict=list;
               // $this.head_styledef.form.items[index].dictitem=success.result;
               // this.$store.commit("classAttrList", $this.$data.classAttrList);
               var head_styledef = JSON.parse(JSON.stringify($this.head_styledef));
               $this.head_styledef=[];
               $this.head_styledef = head_styledef;
            }else{
               // $this.$data.subClassAttrList[index].attr_list[key].dictitem=success.result;
               // this.$store.commit("subClassAttrList", $this.$data.subClassAttrList);
@@ -663,6 +664,7 @@
         uni.showModal({title:"错误3",content:ex.errMsg,showCancel:false,confirmText:"取消"});
      });
   },
   // 执行查询事件
   async onSearChange(clsid,eventid) {
    try {
@@ -670,6 +672,7 @@
         var $this = this;
         var dataInfo={
           ed_type: 0,
            start_transaction: true,
          class_id: clsid,
         event_id: eventid,
         };
@@ -681,7 +684,7 @@
                 var tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info.join('<br/>') : '';
                 if (result.ret == 801) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"});
                 else uni.showModal({title:'提示',content:tip+',提示:'+result.ret,showCancel:false,confirmText:"取消"});
                return false
                return false;
             }else{
                var tip = result.info ? typeof result.info == 'string' ? result.info : result.info.join('<br/>') : '';
                if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"});
@@ -800,7 +803,7 @@
        url:'../modal/3200?param='+JSON.stringify(this.$data.param)+"&titlename="+this.$data.title
     });
   },
   //点击显示浏览对象显示页面定义
   //点击显示浏览对象显示页面
   async onViewPageClick(style){
     if(this.param.ViewPage){
        if(this.param.ViewPage.View_UIDef){
@@ -816,15 +819,16 @@
                 var eventid = $this.param.ViewPage.Exit_View_Event?.id;
                 if(eventid){
                   try {
                     var obj_attr = [{attr: 'S_ID',value:$this.styledef.form.objId}];
                    var obj_attr = {'S_ID':$this.styledef.form.objId};
                     $this.styledef.form.attrs.forEach((attr) => {
                         obj_attr.push({attr: attr.name,value: attr.value});
                      obj_attr[attr.name]=attr.value;
                     });
                     // console.log(obj_attr);
                     var input_param = Base64.encode(JSON.stringify(obj_attr));
                     this.runCustomEvent({
                     $this.runCustomEvent({
                         ed_type: 0,
                         class_id: this.param.DataCls.id,
                       start_transaction: true,
                         class_id: $this.param.DataCls.id,
                         event_id: eventid,
                         obj_attr,
                         input_param,
@@ -986,6 +990,7 @@
         //执行后处理事件
         await this.runCustomEvent({
               ed_type: 0,
            start_transaction: true,
               class_id: clsId,
               event_id: afterProcess_Event.ID,
           });
@@ -1085,7 +1090,7 @@
           var $this = this;
           var dataInfo={
               ed_type: 0,
            start_transaction: '',
            start_transaction: true,
               class_id: this.$data.head_styledef.form.clsId,
            class_name: '',
               event_id: event.id,
@@ -1110,75 +1115,14 @@
                   var tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info.join('<br/>') : '';
                   if (result.ret == 801) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"});
                   else uni.showModal({title:'提示',content:tip+',提示:'+result.ret,showCancel:false,confirmText:"取消"});
                  return false
                  return false;
               }else{
                  var tip = result.info ? typeof result.info == 'string' ? result.info : result.info.join('<br/>') : '';
                  if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"});
               
                  if(result.result_type == 0 && result.action){
                     result.action.forEach(item=>{
                        if(item.action_type == "insert_subtable_page_row"){ //分拣中
                           $this.$data.param.Show_Welcom_Page=false;
                           var value = item.value;
                           $this.viewAceionRow(value);
                        }
                        else if(item.action_type == "set_subtable_page_content"){  //已分拣
                           $this.$data.param.Show_Welcom_Page=false;
                           var value = item.value;
                           if(value.clear == true && $this.$data.detail1StyleDefList.length>0){ //判断是否清空页签内容,正在分拣是否有数据
                              uni.showModal({
                                 title: '提示',
                                 content: '系统检测到有待分拣中的货品,继续操作会清空,是否继续?',
                                 success: function (res) {
                                    if (res.confirm) {
                                      $this.$data.detail1StyleDefList=[];
                                      $this.$data.detail2StyleDefList=[];
                                      $this.viewAceionContent(value);
                                    } else if (res.cancel) {
                                      if(value.page_name == $this.$data.param.Sub_Page[0].Name){ //判断返回的action的page_name是否是待分拣
                                       $this.$data.detail1StyleDefList=[];
                                      }else{
                                       $this.$data.detail2StyleDefList=[];
                                      }
                                      $this.viewAceionContent(value);
                                    }
                                 }
                              });
                           } else {
                              if(value.page_name == $this.$data.param.Sub_Page[0].Name){ //判断返回的action的page_name是否是待分拣
                                $this.$data.detail1StyleDefList=[];
                              }else{
                                $this.$data.detail2StyleDefList=[];
                              }
                              $this.viewAceionContent(value);
                           }
                        }
                        else if(item.action_type == "select_subtable_page_row"){
                           // value = {"page_name":"码盘中", "row":{"id":"xx"}}
                           var value = item.value;
                           $this.detail1StyleDefList.forEach((ele,index)=>{
                             $this.activelist[index].active = false;
                             if(ele.form.objId == value.row.id){
                              ele.SelBut_Checked = true;
                              $this.active_id = ele.form.htmlobjId;
                              //自动滚动到指定元素
                              uni.createSelectorQuery()
                                  .select("#tabpanel")//对应外层节点
                                  .boundingClientRect((container) => {
                                      uni.createSelectorQuery()
                                      .select("#tabpanel"+ele.form.htmlobjId)//目标节点
                                      .boundingClientRect((target) => {
                                          uni.pageScrollTo({
                                          scrollTop: target.top - container.top,//滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
                                          });
                                      })
                                      .exec();
                                  })
                                 .exec();
                             }
                           });
                        }
                        else if(item.action_type == "set_dlg_attr"){
                        if(item.action_type == "set_dlg_attr"){
                          // value = {"attr":"xxx", "value":"xxx"}
                          var data = item.value;
                          $this.$data.head_styledef.form.items.forEach(async (ele,index) => {
@@ -1226,25 +1170,38 @@
       try {
         var $this = this;
         this.$store.dispatch('runCustomEvent',dataInfo).then(ret=>{
              // console.log(ret);
              console.log(ret);
              if (ret.err_code == 0) {
               var result = ret.result; 
               if (result.ret != 0) {
                   var tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info.join('<br/>') : '';
                   if (result.ret == 801) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"});
                   else uni.showModal({title:'提示',content:tip+',提示:'+result.ret,showCancel:false,confirmText:"取消"});
                  return false
                  return false;
               }else{
                  var tip = result.info ? typeof result.info == 'string' ? result.info : result.info.join('<br/>') : '';
                  if (tip) uni.showModal({title:'提示',content:tip,showCancel:false,confirmText:"取消"});
               
                  if(result.result_type == 0 && result.action){
                     result.action.forEach(item=>{
                        // if(item.action_type == "insert_subtable_page_row"){
                        if(item.action_type == "goback_to_pre_page"){ //返回上一页
                           var value = item.value;
                           uni.navigateBack({
                              delta:1 ,//返回层数,2则上上页
                           });
                        } else if(item.action_type == "hidden_button"){ //隐藏按钮
                           var value = item.value;
                           value.forEach(btn => {
                               var index = $this.param.ListPage.Page_Button.findIndex(button => button.ShowName == btn)
                               if (index > -1)
                                 $this.param.ListPage.Page_Button.splice(index, 1)
                           })
                        // } else if(item.action_type == "refresh_cur_row"){ //
                        //    var value = item.value;
                        // }
                        uni.showModal({title:"提示",content:"当前action_type:"+item.action_type+"未处理",showCancel:false,confirmText:"取消"});
                        } else{
                           uni.showModal({title:"提示",content:"当前action_type:"+item.action_type+"未处理",showCancel:false,confirmText:"取消"});
                        }
                     });
                  }else{
                     // this.detail2StyleDefList=[];