cuiqian2004
2024-09-05 b217ec6d467ef11448dbcfa56f236ebe94f4be65
pages/modal/3037_2.vue
@@ -213,10 +213,10 @@
      <view class="view-floor">
         <button type="default" @tap="cancel" class="btn_cancel"
            v-if="param.Sub_Cls.Can_Add_Delete == true">{{translateSys('cancel')}}</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>
         <button type="default" @tap="sava" class="btn_add" v-if="param.Sub_Cls.Can_Add_Delete == true"
            :class="saving?'btn_disabled':''" :disabled="saving">{{title}}</button>
         <button type="default" @tap="sava" class="btn_sava" v-else-if="param.Sub_Cls.Can_Add_Delete == false"
            :class="saving?'btn_disabled':''" :disabled="saving">{{title}}</button>
      </view>
      <!-- 普通弹窗 top bottom center left right -->
      <view>
@@ -249,6 +249,17 @@
<script>
   import Base64 from '../../components/js-base64/base64.js'
   import utils from "@/js/utils.js"
   import {
      appGetInfo,
      dictGetInfo
   } from "@/api/mobox.js"
   import {
      getUIStyleInfo,
      runCustomEvent,
      dataObjCreate,
      dataObjDel
   } from "@/api/data.js"
   export default {
      modules: {
         Base64,
@@ -279,6 +290,7 @@
            detail1_styledef: {},
            detail1StyleDefList: [],
            activelist: [],
            saving: false,
         };
      },
      onLoad(options) {
@@ -288,65 +300,109 @@
         }); //设置顶部标题 
         this.$data.title = options.titlename;
         this.$data.param = JSON.parse(options.param);
         console.log(this.$data.param);
         //获取数据类的自定义表单参数
         this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
         this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.$data.param.Sub_Cls?.UI_Style?.ID);
         this.loadData(options.paramValue)
         //页面初始化获取焦点
         // this.focusMateria=true; 
      },
      methods: {
         setData: function(obj) {
            let that = this;
            let keys = [];
            let val, data;
            Object.keys(obj).forEach(function(key) {
               keys = key.split(".");
               val = obj[key];
               data = that.$data;
               keys.forEach(function(key2, index) {
                  if (index + 1 == keys.length) {
                     that.$set(data, key2, val);
                  } else {
                     if (!data[key2]) {
                        that.$set(data, key2, {});
                     }
                  }
                  data = data[key2];
               });
            });
         },
         async loadData(paramValue) {
            console.log(this.$data.param);
            //获取数据类的自定义表单参数
            await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
            //传入参数值
            if (paramValue) {
               const attrs = paramValue.attrs || [];
               (this.$data.head_styledef?.form?.items || []).forEach(async (ele, index) => {
                  if (ele.name != "Layout") {
                     attrs.forEach(async (ele2, index2) => {
                        if (ele.fieldId == ele2.name) {
                           ele.value = ele2.value;
                        }
                     });
                  } else {
                     ele.setting.colList.forEach(async (col) => {
                        if (col) {
                           attrs.forEach(async (ele2,
                              index2) => {
                              if (col.fieldId == ele2.name) {
                                 col.value = ele2.value;
                              }
                           });
                        }
                     });
                  }
               })
            }
            await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.$data.param.Sub_Cls?.UI_Style?.ID);
         },
         async Head_UIStyleGetInfo(class_id, style_id) { //获取自定义表单样式
            var $this = this;
            var dataInfo = {
               class_id: class_id,
               ui_style_id: style_id,
            };
            this.$store.dispatch('UIStyleGetInfo', dataInfo).then(ret => {
               // console.log(ret);
               if (ret.err_code == 0) {
                  var styledef = "";
                  if (ret.result.style_def) {
                     //mobox2的style_def是json字符串
                     styledef = ret.result.style_def.replace(/\\/g, "");
                     //mobox3的style_def是base64字符串
                     if (!ret.result.style_def.includes('"')) styledef = Base64.decode(ret.result
                        .style_def);
                  }
                  $this.$data.head_styledef = ret.result.style_def ? JSON.parse(styledef) : {};
                  // console.log($this.$data.head_styledef);
            try {
               const result = await getUIStyleInfo(dataInfo)
               var styledef = "";
               if (result.style_def) {
                  //mobox2的style_def是json字符串
                  styledef = result.style_def.replace(/\\/g, "");
                  //mobox3的style_def是base64字符串
                  if (!result.style_def.includes('"')) styledef = Base64.decode(result
                     .style_def);
               }
               $this.$data.head_styledef = result.style_def ? JSON.parse(styledef) : {};
               // console.log($this.$data.head_styledef);
               if ($this.head_styledef.form?.items) {
                  $this.head_styledef.form.items.forEach(async (ele, index) => {
                     ele.show = true;
                     if (ele.useDict == true) { //判断useDict是否使用字典
                        await this.DictGetInfo(ele.bind.dict, index, 'mast');
                     }
                  });
                  if ($this.head_styledef.event?.length > 0) {
                     $this.head_styledef.event.forEach(async (a) => { //判断是否是初始化事件
                        if (a.event_id == "initial") {
                           await this.loadInitEvent(a.scrip_id, 'head');
                        }
                     });
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys("error") + "1",
                     content: ret.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
               }
               if ($this.head_styledef.event?.length > 0) {
                  $this.head_styledef.event.forEach(async (a) => { //判断是否是初始化事件
                     if (a.event_id == "initial") {
                        await this.loadInitEvent(a.scrip_id, 'head');
                     }
                  });
               }
            }).catch(ex => {
            } catch (ex) {
               // console.log(ex);
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
               uni.showModal({
                  title: this.translateSys("error") + "1.1",
                  content: ex.errMsg,
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys("cancel")
               });
            });
            }
         },
         async Detail1_UIstyleGetInfo(class_id, style_id) { //获取自定义表单样式
@@ -355,52 +411,43 @@
               class_id: class_id,
               ui_style_id: style_id,
            };
            this.$store.dispatch('UIStyleGetInfo', dataInfo).then(ret => {
               // console.log(ret);
               if (ret.err_code == 0) {
                  var styledef = "";
                  if (ret.result.style_def) {
                     //mobox2的style_def是json字符串
                     styledef = ret.result.style_def.replace(/\\/g, "");
                     //mobox3的style_def是base64字符串
                     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;
            try {
               const result = await getUIStyleInfo(dataInfo)
               var styledef = "";
               if (result.style_def) {
                  //mobox2的style_def是json字符串
                  styledef = result.style_def.replace(/\\/g, "");
                  //mobox3的style_def是base64字符串
                  if (!result.style_def.includes('"')) styledef = Base64.decode(result
                     .style_def);
               }
               $this.$data.detail1_styledef = result.style_def ? JSON.parse(styledef) : {};
               $this.$data.detail1_styledef.SelBut_Checked = true;
               if ($this.detail1_styledef.form?.items) {
                  $this.detail1_styledef.form.items.forEach(async (ele, index) => {
                     if (ele.useDict == true) { //判断useDict是否使用字典
                        await this.DictGetInfo(ele.bind.dict, index, 'sub');
                     }
                  });
                  if ($this.detail1_styledef.event?.length > 0) {
                     $detail1_styledefforEach(async (a) => { //判断是否是初始化事件
                        if (a.event_id == "initial") {
                           await this.loadInitEvent(a.scrip_id, 'detail');
                        }
                     });
                  }
                  // var aa = JSON.stringify(this.detail1_styledef);
                  // $this.$data.detail1StyleDefList.push(JSON.parse(aa));
                  // console.log($this.$data.detail1StyleDefList);
               } else {
                  uni.showModal({
                     title: this.translateSys("error") + "2",
                     content: ret.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
               }
               if ($this.detail1_styledef.event?.length > 0) {
                  $detail1_styledefforEach(async (a) => { //判断是否是初始化事件
                     if (a.event_id == "initial") {
                        await this.loadInitEvent(a.scrip_id, 'detail');
                     }
                  });
               }
            }).catch(ex => {
            } catch (ex) {
               // console.log(ex);
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
               uni.showModal({
                  title: this.translateSys("error") + "2.1",
                  content: ex.errMsg,
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys("cancel")
               });
            });
            }
         },
         async DictGetInfo(dict, index, type) { //Mobox3得到得到字典信息字典项列表
@@ -410,48 +457,38 @@
               dict_id: dict.id,
               dict_name: dict.name
            };
            // console.log(dataInfo);
            this.$store.dispatch('DictGetInfo', dataInfo).then(async (success) => {
               // console.log(success);
               if (success.err_code == 0) {
                  var list = [];
                  var itemName = '';
                  success.result.dict_item_list.forEach((item) => {
                     if (item.is_default == '1')
                        itemName = item.name;
                     list.push({
                        text: item.value,
                        value: item.name,
                     });
            try {
               const result = await dictGetInfo(dataInfo)
               var list = [];
               var itemName = '';
               (result.dict_item_list || []).forEach((item) => {
                  if (item.is_default == '1')
                     itemName = item.name;
                  list.push({
                     text: item.value,
                     value: item.name,
                  });
               });
                  if (type == 'mast') { //有默认值,显示默认值
                     if (itemName) {
                        $this.head_styledef.form.items[index].value = itemName;
                        var attr = $this.head_styledef.form.items[index].fieldId;
                        $this.head_styledef.form.model[attr] = itemName;
                     }
                     $this.head_styledef.form.items[index].dict = list;
                     // console.log($this.$data.detail1StyleDefList);
                  } else {
                     if (itemName) {
                        $this.detail1_styledef.form.items[index].value = itemName;
                        var attr = $this.detail1_styledef.form.items[index].fieldId;
                        $this.detail1_styledef.form.model[attr] = itemName;
                     }
                     $this.detail1_styledef.form.items[index].dict = list;
                     console.log($this.$data.detail1_styledef);
               if (type == 'mast') { //有默认值,显示默认值
                  if (itemName) {
                     $this.head_styledef.form.items[index].value = itemName;
                     var attr = $this.head_styledef.form.items[index].fieldId;
                     $this.head_styledef.form.model[attr] = itemName;
                  }
                  $this.head_styledef.form.items[index].dict = list;
                  // console.log($this.$data.detail1StyleDefList);
               } else {
                  uni.showModal({
                     title: this.translateSys("error") + "1.2",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
                  if (itemName) {
                     $this.detail1_styledef.form.items[index].value = itemName;
                     var attr = $this.detail1_styledef.form.items[index].fieldId;
                     $this.detail1_styledef.form.model[attr] = itemName;
                  }
                  $this.detail1_styledef.form.items[index].dict = list;
                  console.log($this.$data.detail1_styledef);
               }
            }).catch(ex => {
            } catch (ex) {
               // console.log(ex);
               uni.showModal({
                  title: this.translateSys("error") + "1.3",
@@ -459,7 +496,8 @@
                  showCancel: false,
                  confirmText: this.translateSys("cancel")
               });
            });
            }
         },
         async loadInitEvent(eventid, type) {
            var $this = this;
@@ -473,195 +511,189 @@
            };
            console.log(dataInfo);
            // return;
            this.$store.dispatch('runCustomEvent', dataInfo).then(success => {
               console.log(success);
               if (success.err_code == 0) {
                  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({
            runCustomEvent(dataInfo).then(data => {
               console.log(data);
               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) {
                     if (this.param.Only_Script_Error) {
                        let pos = tip.indexOf(":");
                        if (pos > -1) tip = tip.substring(pos + 1);
                     }
                     uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                     else uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                     return false
                  } else {
                     var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
                        '<br/>') : '';
                     if (tip) uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                  } else uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
                  return false
               } else {
                  var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
                     '<br/>') : '';
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
                     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 < styledef.form.items.length; c++) {
                                       var attr = styledef.form.items[c];
                                       if (attr.name != 'Layout') {
                                          if (attr.fieldId == result[i].attr) {
                                             var dictItemList = [];
                                             for (var d in result[i].choice_list) {
                                                var val = result[i].choice_list[d];
                                                dictItemList.push({
                                                   "CN_S_NAME": val,
                                                   "CN_S_VALUE": val,
                                                   "text": val,
                                                   "value": val
                                                });
                                             }
                                             attr.dict = dictItemList;
                                          }
                                       } else if (attr.name == 'Layout') {
                                          attr.setting.colList.forEach(col => {
                                             if (col) {
                                                if (col.fieldId == result[i].attr) {
                                                   var dictItemList = [];
                                                   for (var d in result[i]
                                                         .choice_list) {
                                                      var val = result[i]
                                                         .choice_list[d];
                                                      dictItemList.push({
                                                         "CN_S_NAME": val,
                                                         "CN_S_VALUE": val,
                                                         "text": val,
                                                         "value": val
                                                      });
                                                   }
                                                   col.dict = dictItemList;
                                                }
                                             }
                                          });
                                       }
                                    }
                                 }
                  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 < styledef.form.items.length; c++) {
                                    var attr = styledef.form.items[c];
                                    // console.log(attr[j].Name+'=='+result[i].attr);
                                    //判断表单里是否有返回字段,没有就装载到model里,点击确定提交的时候带上这些数据
                                    if ($this.head_styledef.form.model[result[i].attr] ==
                                       undefined) {
                                       $this.head_styledef.form.model[result[i].attr] = result[i]
                                          .value;
                                    }
                                    //判断是否是栅格表单
                                    if (attr.name != 'Layout') {
                                       if (attr.fieldId == result[i].attr) {
                                          attr.value = '';
                                          attr.oldvalue = '';
                                          attr.value = result[i].value;
                                          attr.oldvalue = result[i].value;
                                          $this.head_styledef.form.model[attr.fieldId] = result[
                                             i].value;
                                          var dictItemList = [];
                                          for (var d in result[i].choice_list) {
                                             var val = result[i].choice_list[d];
                                             dictItemList.push({
                                                "CN_S_NAME": val,
                                                "CN_S_VALUE": val,
                                                "text": val,
                                                "value": val
                                             });
                                          }
                                          attr.dict = dictItemList;
                                       }
                                    } else if (attr.name == 'Layout') {
                                       attr.setting.colList.forEach(col => {
                                          if (col) {
                                             if (col.fieldId == result[i].attr) {
                                                col.value = '';
                                                col.oldvalue = '';
                                                col.value = result[i].value;
                                                col.oldvalue = result[i].value;
                                                $this.head_styledef.form.model[col
                                                   .fieldId] = result[i].value;
                                                var dictItemList = [];
                                                for (var d in result[i]
                                                      .choice_list) {
                                                   var val = result[i]
                                                      .choice_list[d];
                                                   dictItemList.push({
                                                      "CN_S_NAME": val,
                                                      "CN_S_VALUE": val,
                                                      "text": val,
                                                      "value": val
                                                   });
                                                }
                                                col.dict = dictItemList;
                                             }
                                          }
                                       });
                                    }
                                 }
                                 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]);
                              }
                              for (var c = 0; c < styledef.form.items.length; c++) {
                                 var attr = styledef.form.items[c];
                                 // console.log(attr[j].Name+'=='+result[i].attr);
                                 //判断表单里是否有返回字段,没有就装载到model里,点击确定提交的时候带上这些数据
                                 if ($this.head_styledef.form.model[result[i].attr] ==
                                    undefined) {
                                    $this.head_styledef.form.model[result[i].attr] = result[i]
                                       .value;
                                 }
                                 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 (attr.name != 'Layout') {
                                    if (attr.fieldId == result[i].attr) {
                                       attr.value = '';
                                       attr.oldvalue = '';
                                       attr.value = result[i].value;
                                       attr.oldvalue = result[i].value;
                                       $this.head_styledef.form.model[attr.fieldId] = result[
                                          i].value;
                                    }
                                 } else if (attr.name == 'Layout') {
                                    attr.setting.colList.forEach(col => {
                                       if (col) {
                                          if (col.fieldId == result[i].attr) {
                                             col.value = '';
                                             col.oldvalue = '';
                                             col.value = result[i].value;
                                             col.oldvalue = result[i].value;
                                             $this.head_styledef.form.model[col
                                                .fieldId] = 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_dlg_attr_show') {
                              var result = action.value;
                              result.forEach(async (attr, key) => {
                                 styledef.form.items.forEach(async (ele, index) => {
                                    //判断是否是栅格表单
                                    if (ele.name != 'Layout') {
                                       if (ele.fieldId == attr.attr) {
                                          ele.show = attr.show;
                                       }
                                    } else if (ele.name == 'Layout') {
                                       ele.setting.colList.forEach(
                                          col => {
                                             if (col) {
                                                if (col.fieldId ==
                                                   attr.attr) {
                                                   col.show = attr
                                                      .show;
                                                }
                                             }
                                          });
                                    }
                                 });
                              });
                              var style_def = JSON.parse(JSON.stringify(styledef));
                              if (type == 'head') {
                                 $this.$data.head_styledef = [];
                                 $this.$data.head_styledef = style_def;
                                 // console.log($this.$data.head_styledef);
                              } else {
                                 $this.$data.detail1_styledef = [];
                                 $this.$data.detail1_styledef = style_def;
                                 // console.log($this.$data.detail1_styledef);
                              }
                           } else {
                              uni.showModal({
                                 title: this.translateSys("tip"),
                                 content: this.translate('execute_init_event_failed') +
                                    this.translateSys("full_stop") +
                                    this.translate('reason') + this.translateSys("colon") +
                                    this.translateSys("quotation_mark_left") + action
                                    .action_type + this.translateSys(
                                       "quotation_mark_right") + this
                                    .translate('tip_action_unprocessed'),
                                 showCancel: false,
                                 confirmText: this.translateSys("cancel")
                              });
                           }
                        } else if (data.action[i].action_type == 'set_dlg_attr_show') {
                           var result = action.value;
                           result.forEach(async (attr, key) => {
                              styledef.form.items.forEach(async (ele, index) => {
                                 //判断是否是栅格表单
                                 if (ele.name != 'Layout') {
                                    if (ele.fieldId == attr.attr) {
                                       ele.show = attr.show;
                                    }
                                 } else if (ele.name == 'Layout') {
                                    ele.setting.colList.forEach(
                                       col => {
                                          if (col) {
                                             if (col.fieldId ==
                                                attr.attr) {
                                                col.show = attr
                                                   .show;
                                             }
                                          }
                                       });
                                 }
                              });
                           });
                           var style_def = JSON.parse(JSON.stringify(styledef));
                           if (type == 'head') {
                              $this.$data.head_styledef = [];
                              $this.$data.head_styledef = style_def;
                              // console.log($this.$data.head_styledef);
                           } else {
                              $this.$data.detail1_styledef = [];
                              $this.$data.detail1_styledef = style_def;
                              // console.log($this.$data.detail1_styledef);
                           }
                        } else {
                           uni.showModal({
                              title: this.translateSys("tip"),
                              content: this.translate('execute_init_event_failed') +
                                 this.translateSys("full_stop") +
                                 this.translate('reason') + this.translateSys("colon") +
                                 this.translateSys("quotation_mark_left") + action
                                 .action_type + this.translateSys(
                                    "quotation_mark_right") + this
                                 .translate('tip_action_unprocessed'),
                              showCancel: false,
                              confirmText: this.translateSys("cancel")
                           });
                        }
                     }
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys("error") + "3",
                     content: this.translate('execute_init_event_failed') +
                        this.translateSys("full_stop") +
                        this.translate('reason') + this.translateSys("colon") + success
                        .err_msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
               }
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
@@ -731,7 +763,7 @@
            // console.log(e.target);
            var $this = this;
            console.log(item);
            if (item.oldvalue != item.value) {
            if (item.oldvalue != item.value && item.value.trim() != "") {
               item.oldvalue = item.value;
               var attr = item.fieldId;
               $this.head_styledef.form.model[attr] = item.value;
@@ -770,7 +802,7 @@
            console.log(item);
            var $this = this;
            console.log(item);
            if (item.oldvalue != item.value) {
            if (item.oldvalue != item.value && item.value.trim() != "") {
               item.oldvalue = item.value;
               var attr = item.fieldId;
               $this.head_styledef.form.model[attr] = item.value;
@@ -928,25 +960,18 @@
               uni.showLoading({
                  title: this.translateSys("loading")
               });
               this.$store.dispatch('dataObjDel', dataInfo).then(success => {
               dataObjDel(dataInfo).then(success => {
                  // console.log(success);
                  uni.hideLoading();
                  if (ret.err_code == 0) {
                     $this.$data.subPanelList.splice(index, 1);
                     uni.showModal({
                        title: this.translateSys("tip"),
                        content: this.translate("delete_success"),
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                  } else {
                     uni.showModal({
                        title: this.translateSys("error") + "9",
                        content: success.msg,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                  }
                  $this.$data.subPanelList.splice(index, 1);
                  uni.showModal({
                     title: this.translateSys("tip"),
                     content: this.translate("delete_success"),
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
               }).catch(ex => {
                  console.log(ex);
                  uni.hideLoading();
@@ -1193,20 +1218,23 @@
            };
            console.log(dataInfo);
            // return;
            this.$store.dispatch('runCustomEvent', dataInfo).then(success => {
               console.log(success);
               if (success.err_code == 0) {
                  var data = success.result;
            runCustomEvent(dataInfo).then(data => {
               console.log(data);
                  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: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                     else uni.showModal({
                     if (data.ret == 801) {
                        if (this.param.Only_Script_Error) {
                           let pos = tip.indexOf(":");
                           if (pos > -1) tip = tip.substring(pos + 1);
                        }
                        uni.showModal({
                           title: this.translateSys("tip"),
                           content: tip,
                           showCancel: false,
                           confirmText: this.translateSys("cancel")
                        });
                     } else uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
                        showCancel: false,
@@ -1402,14 +1430,7 @@
                        }
                     }
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys("error") + "3",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
               }
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
@@ -1481,22 +1502,27 @@
            };
            console.log(dataInfo);
            // return;
            this.$store.dispatch('runCustomEvent', dataInfo).then(success => {
               console.log(success);
               if (success.err_code == 0) {
                  var data = success.result;
            runCustomEvent(dataInfo).then(data => {
               console.log(data);
                  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({
                     if (data.ret == 801) {
                        if (this.param.Only_Script_Error) {
                           let pos = tip.indexOf(":");
                           if (pos > -1) tip = tip.substring(pos + 1);
                        }
                        uni.showModal({
                           title: this.translateSys("tip"),
                           content: tip,
                           showCancel: false,
                           confirmText: this.translateSys("cancel")
                        });
                     } else uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                     else uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip + this.translateSys('comma')  + this.translate('result') +this.translateSys('colon')  + data.ret,
                        content: tip + this.translateSys('comma') + this.translate('result') + this
                           .translateSys('colon') + data.ret,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
@@ -1528,7 +1554,7 @@
                                          for (var j = 0; j < attr.length; j++) {
                                             if (attr[j].Name == result[i].attr) {
                                                if (utils.classUtils.attrTypeIsDict(attr[j]
                                                   .Type)) {
                                                      .Type)) {
                                                   var dictItemList = [];
                                                   for (var d in result[i].choice_list) {
                                                      var val = result[i].choice_list[d];
@@ -1731,14 +1757,7 @@
                        }
                     }
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys("error") + "7",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
               }
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
@@ -1762,6 +1781,7 @@
               }); //返回层数,2则上上页
         },
         scan_OKDataObjRunCustomEvent(eventID) {
            this.saving = true
            uni.showLoading({
               title: this.translateSys("loading"),
               mask: true
@@ -1835,58 +1855,57 @@
            console.log(dataInfo);
            // uni.hideLoading();
            //    return;
            this.$store.dispatch('runCustomEvent', dataInfo).then(success => {
               console.log(success);
            runCustomEvent(dataInfo).then(data => {
               console.log(data);
               uni.hideLoading();
               if (success.err_code == 0) {
                  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: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                     else uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                     return false
                  } else {
                     var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
                        '<br/>') : '';
                     if (tip) uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                     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_2?param=' + JSON.stringify($this.$data.param) +
                              "&titlename=" + $this.$data.title
                        });
               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) {
                     if (this.param.Only_Script_Error) {
                        let pos = tip.indexOf(":");
                        if (pos > -1) tip = tip.substring(pos + 1);
                     }
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys("error") + "8",
                     content: success.err_msg,
                     uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
                  } else uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
                  this.saving = false
                  return false
               } else {
                  var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
                     '<br/>') : '';
                  if (tip) uni.showModal({
                     title: this.translateSys("tip"),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
                  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_2?param=' + JSON.stringify($this.$data.param) +
                           "&titlename=" + $this.$data.title
                     });
                  }
               }
               this.saving = false
            }).catch(ex => {
               // console.log(ex);
               this.saving = false
               uni.hideLoading();
               uni.showModal({
                  title: this.translateSys("error") + "8.1",
@@ -2187,6 +2206,11 @@
         display: inline-block;
      }
      button.btn_disabled {
         background-color: #ddd;
         color: #888;
      }
      .class_attr_body .form-group {
         margin: 20rpx 30rpx;
         /* margin-left: -12px;