pages/modal/5600.vue
@@ -555,40 +555,50 @@
              // console.log(ret);
              if (ret.err_code == 0) {
               var result = ret.result; 
                 if(result.result_type == 0 && result.action){
                     result.action.forEach(item=>{
                         if(item.action_type == "insert_subtable_page_row"){ //码盘中
                             var value = item.value;
                             $this.viewAceionRow(value);
                         } else if(item.action_type == "set_subtable_page_content"){  //已码盘
                             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) {
                                   $this.$data.detail2StyleDefList=[];
                                   $this.viewAceionContent(value);
               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
               }else{
                  let 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"){ //码盘中
                           var value = item.value;
                           $this.viewAceionRow(value);
                        } else if(item.action_type == "set_subtable_page_content"){  //已码盘
                           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) {
                                      $this.$data.detail2StyleDefList=[];
                                      $this.viewAceionContent(value);
                                    }
                                 }
                              }
                           });
                             } else {
                                 $this.$data.detail2StyleDefList=[];
                                 $this.viewAceionContent(value);
                             }
                         }
                     });
                 }else{
                  // this.detail2StyleDefList=[];
                     if(result.info){
                     uni.showModal({title:"错误4.3",content:result.info,showCancel:false,confirmText:"取消"});
                              });
                           } else {
                              $this.$data.detail2StyleDefList=[];
                              $this.viewAceionContent(value);
                           }
                        }
                     });
                  }else{
                     // this.detail2StyleDefList=[];
                     if(result.info){
                        uni.showModal({title:"错误4.3",content:result.info,showCancel:false,confirmText:"取消"});
                     }
                  }
                 }
               }
                 
              }else{
                 uni.showModal({title:"错误4",content:ret.err_msg,showCancel:false,confirmText:"取消"});
@@ -630,8 +640,9 @@
          this.$data.detail2StyleDefList.push(detailStyle);
          // console.log(this.$data.detail2StyleDefList);
      }else{
         detailStyle.form.attrs = data.row.attrs;
         this.$data.detail1StyleDefList.push(detailStyle);
       // console.log(this.$data.detail1StyleDefList);
         // console.log(this.$data.detail1StyleDefList);
      }
   },
   //加载已码盘内容
@@ -741,7 +752,23 @@
         detailAttrList.push(detail_attr);
       });
       // console.log(detailAttrList);
      //获取正在码盘里没有显示的字段
      this.$data.detail1StyleDefList.forEach(style=>{
        style.form.attrs.forEach(attr => {
          for(var key in detailAttrList){
            let keys = Object.keys(detailAttrList[key]);
            let isflag = true;
            keys.forEach((ele) => {
              if(ele == attr.attr) isflag = false;
            });
            if(isflag) {
              detailAttrList[attr.attr] = attr.value;
            }
          }
        });
      });
      // console.log(detailAttrList);
    //    return;
      var input_param = Base64.encode(
          JSON.stringify(
            Object.keys(head_attr).map((a) => ({
@@ -764,60 +791,6 @@
      jsonlist.forEach(async (json,key)=>{
         await $this.runCustomEvent(event,input_param,json);
      });
        //       var data_json = Base64.encode(
        //           JSON.stringify(jsonlist)
        //       );
            // var $this = this;
            // var dataInfo={
            //   ed_type: 0,
            //   start_transaction: '',
            //   class_id: this.$data.head_styledef.form.clsId,
            //   class_name: '',
            //   event_id: this.$data.param.After_OK_Event.ID,
            //   event_name: '',
            //   data_obj_id: '',
            //   obj_attr: '',
            //   prj_id: '',
            //   ref_cls_id: '',
            //   rel_obj_id: '',
            //   user_login: '',
            //   data_json: data_json,
            //   compose_info: '',
            //   ext_info: '',
            //   global_attr: '',
            //   input_param: input_param,
            // };
        //       // console.log(dataInfo);
            // this.$store.dispatch('runCustomEvent',dataInfo).then(res=>{
            //    console.log(res);
            //    if (res.err_code == 0) {
            //       var result = res.result;
            //       if(result.result_type == 0){
            //           $this.$data.head_styledef.form.items.forEach((item,index) => {
            //            if(item.fieldId != "S_CNTR_CODE"){
            //               item.value = '';
            //               item.oldvalue = '';
            //               $this.$data.head_styledef.form.model[item.fieldId] = '';
            //            }
            //           });
            //           $this.$data.detail1StyleDefList=[];
            //           // $this.$data.detail2StyleDefList=[];
            //           uni.showModal({title:"提示",content:"码盘成功",showCancel:false,confirmText:"取消"});
            //       }else{
            //          // $this.$data.detail2StyleDefList=[];
            //           if(result.info){
            //            uni.showModal({title:"提示",content:result.info,showCancel:false,confirmText:"取消"});
            //          }
            //       }
            //    }else{
            //       uni.showModal({title:"错误8",content:res.err_msg,showCancel:false,confirmText:"取消"});
            //    }
            // }).catch(ex=>{
            //    // console.log(ex);
            //    uni.showModal({title:"错误8.1",content:ex.errMsg,showCancel:false,confirmText:"取消"});
            // });
   },
    //执行确定脚本
    async runCustomEvent(event,input_param,json){
@@ -849,41 +822,51 @@
         console.log(res);
         if (res.err_code == 0) {
            var result = res.result; 
            if(result.result_type == 0){
              if(result.action){
               result.action.forEach(item=>{
                 if(item.action_type == "insert_subtable_page_row"){ //码盘中
                   var value = item.value;
                   //加载已经码盘数据
                    $this.viewAceionRow(value,'add');
                     //清空条码内容
                  $this.$data.head_styledef.form.items.forEach((item,index) => {
                     if(item.fieldId != "S_CNTR_CODE"){
                       item.value = '';
                         item.oldvalue = '';
                       $this.$data.head_styledef.form.model[item.fieldId] = '';
                     }
                  });
                  //清除正在码盘中成功的数据
                  $this.$data.detail1StyleDefList.forEach((style,index)=>{
                    if(style.form.items[0].fieldId == json.attrs[0].attr && style.form.items[0].value == json.attrs[0].value){
                     $this.$data.detail1StyleDefList.splice(index,1);
                     return;
            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
            }else{
               let 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){
                 if(result.action){
                  result.action.forEach(item=>{
                    if(item.action_type == "insert_subtable_page_row"){ //码盘中
                     var value = item.value;
                     //加载已经码盘数据
                     $this.viewAceionRow(value,'add');
                     //清空条码内容
                     $this.$data.head_styledef.form.items.forEach((item,index) => {
                        if(item.fieldId != "S_CNTR_CODE"){
                          item.value = '';
                          item.oldvalue = '';
                          $this.$data.head_styledef.form.model[item.fieldId] = '';
                        }
                     });
                     //清除正在码盘中成功的数据
                     $this.$data.detail1StyleDefList.forEach((style,index)=>{
                       if(style.form.items[0].fieldId == json.attrs[0].attr && style.form.items[0].value == json.attrs[0].value){
                        $this.$data.detail1StyleDefList.splice(index,1);
                        return;
                       }
                     });
                     // this.detail2StyleDefList=[];
                     uni.showModal({title:"提示",content:"码盘成功",showCancel:false,confirmText:"取消"});
                    }
                  });
                   // this.detail2StyleDefList=[];
                  uni.showModal({title:"提示",content:"码盘成功",showCancel:false,confirmText:"取消"});
                 }else{
                  if($this.$data.param.After_OK_Event.ID != event.ID){ //判断当前事件是否是确定后事件
                     $this.sava($this.$data.param.After_OK_Event); //执行确定后事件
                  }
                 }
               });
              }else{
               if($this.$data.param.After_OK_Event.ID != event.ID){ //判断当前事件是否是确定后事件
                   $this.sava($this.$data.param.After_OK_Event); //执行确定后事件
               }
              }
            }else{
               // $this.$data.detail2StyleDefList=[];
                if(result.info){
                 uni.showModal({title:"提示",content:result.info,showCancel:false,confirmText:"取消"});
               }else{
                  // $this.$data.detail2StyleDefList=[];
                  if(result.info){
                    uni.showModal({title:"提示",content:result.info,showCancel:false,confirmText:"取消"});
                  }
               }
            }
         }else{