cuiqian2004
2025-08-01 fa73abee6209cd6f7c62c61c271826f7d413035d
pages/modal/3037_2.vue
@@ -471,166 +471,170 @@
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  if (data.result_type == 2) {
                  if ([0, 2, 3, 4, -1].includes(data.result_type)) {
                     if (data.result_type == 2) {
                  } else if (typeof data.result == 'string') {
                     if (data.result) {
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: data.result,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                     }
                  }
                  try {
                     var actionlist = data.action || []
                     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;
                                             }
                                          }
                                       });
                                    }
                                 }
                              }
                              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;
                                    }
                                 } 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;
                                          }
                                       }
                                    });
                                 }
                              }
                           }
                        } else if (data.action[i].action_type == 'set_dlg_attr_show') {
                           var result = action.value;
                           if (type == 'head') {
                              $this.setFormItemVisible(result)
                              // console.log($this.head_styledef);
                           } else {
                              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));
                              $this.detail1_styledef = [];
                              $this.detail1_styledef = style_def;
                              // console.log($this.detail1_styledef);
                           }
                        } else {
                     } else if (typeof data.result == 'string') {
                        if (data.result) {
                           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'),
                              title: this.translateSys('tip'),
                              content: data.result,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                        }
                     }
                     try {
                        var actionlist = data.action || []
                        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;
                                                }
                                             }
                                          });
                                       }
                  } catch (ex) {
                     let actionList = (data.action || []).map(a => a.action_type).join(';')
                     let tip = typeof ex == 'string' ? ex : ex.message
                     tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                     uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                     console.log(ex)
                     return
                                    }
                                 }
                                 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;
                                       }
                                    } 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;
                                             }
                                          }
                                       });
                                    }
                                 }
                              }
                           } else if (data.action[i].action_type == 'set_dlg_attr_show') {
                              var result = action.value;
                              if (type == 'head') {
                                 $this.setFormItemVisible(result)
                                 // console.log($this.head_styledef);
                              } else {
                                 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));
                                 $this.detail1_styledef = [];
                                 $this.detail1_styledef = style_def;
                                 // console.log($this.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('close')
                              });
                           }
                        }
                     } catch (ex) {
                        let actionList = (data.action || []).map(a => a.action_type).join(';')
                        let tip = typeof ex == 'string' ? ex : ex.message
                        tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: tip,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                        console.log(ex)
                        return
                     }
                  }
               }
            }).catch(ex => {
@@ -886,206 +890,208 @@
                     showCancel: false,
                     confirmText: $this.translateSys('close')
                  });
                  if (data.result_type == 2) {
                  if ([0, 2, 3, 4, -1].includes(data.result_type)) {
                     if (data.result_type == 2) {
                  } else if (typeof data.result == 'string') {
                     if (data.result) {
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: data.result,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                     } else if (typeof data.result == 'string') {
                        if (data.result) {
                           uni.showModal({
                              title: this.translateSys('tip'),
                              content: data.result,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                        }
                     }
                  }
                  try {
                     var actions = data.action || []
                     for (var i = 0; i < actions.length; i++) {
                        var action = actions[i];
                        console.log(action)
                        var val = action.value;
                        var enviroment = JSON.stringify(enviroment);
                     try {
                        var actions = data.action || []
                        for (var i = 0; i < actions.length; i++) {
                           var action = actions[i];
                           console.log(action)
                           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> ' +
                                 $this.translateSys("tip"),
                              content: $this.translateSys("quotation_mark_left") +
                                 action.action_type + $this.translateSys(
                                    "quotation_mark_right") +
                                 $this.translate("tip_action_unprocessed")
                           });
                           d.show();
                        } else if (action.action_type == 'open_select_userdlg') {
                           var style = val.style;
                           // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : ''
                           var param = {
                              item: item,
                              button_callback: button_callback,
                              req: req,
                              data_attr: data_attr
                           }
                           uni.navigateTo({
                              url: '../selpsn/index?mulit=false&param=' +
                                 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.param
                                          .DataCls
                                          .id,
                                       objid: "",
                                       attr: param.req,
                                       inputparameter: data,
                                       dataJson: [],
                                    }
                                    $this.DataObjRunCustomEvent(info,
                                       param
                                       .data_attr);
                                 }
                              }
                           });
                        } else if (action.action_type == 'open_data_query_dlg') {
                           var d = dialog({
                              title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                 $this.translateSys("tip"),
                              content: $this.translateSys(
                                    "quotation_mark_left") +
                                 action
                                 .action_type + $this.translateSys(
                                    "quotation_mark_right") + $this
                                 .translate(
                                    "tip_action_unprocessed")
                           });
                           d.show();
                        } else if (action.action_type == 'open_common_dlg') {
                           if (val.common_dlg_id == 'check_list') {
                              $this.setData({
                                 check_list: val.config
                              })
                              if (val.config.appear_style == 'sideslip') //判断是否是侧滑
                                 $this.setData({
                                    popupType: "right"
                                 })
                              else
                                 $this.setData({
                                    popupType: "center"
                                 })
                              // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
                              $this.$refs.popup.open($this.popupType);
                              var popupParam = {
                           if (action.action_type == 'open_panel') {
                              var d = dialog({
                                 title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                    $this.translateSys("tip"),
                                 content: $this.translateSys("quotation_mark_left") +
                                    action.action_type + $this.translateSys(
                                       "quotation_mark_right") +
                                    $this.translate("tip_action_unprocessed")
                              });
                              d.show();
                           } else if (action.action_type == 'open_select_userdlg') {
                              var style = val.style;
                              // style == 'user' ? '选择人员' : style == 'department' ? '选择部门' : style == 'role' ? '选择角色' : ''
                              var param = {
                                 item: item,
                                 button_callback: button_callback,
                                 req: req,
                                 data_attr: data_attr
                              }
                              $this.setData({
                                 popupParam: popupParam
                              })
                           }
                        } 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 param_ = {
                              item: item,
                              button_callback: button_callback,
                              req: req
                           }
                           uni.navigateTo({
                              url: '../selPrj/index?relation=' + priRel +
                                 '&param=' +
                                 JSON.stringify(param_),
                              events: {
                                 AddPer(data, param) {
                                    var attr = param.item.fieldId;
                                    $this.head_styledef.form.model[
                                          attr] =
                                       data[0].ID +
                                       ';' + data[0].Name;
                                    // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name;
                                    // $this.classAttrList[param.index].Attr[param.iindex].ValID=data[0].ID+';'+data[0].Name;
                                    var callback_eventid = param
                                       .button_callback
                                       .trim();
                                    if (callback_eventid) {
                              uni.navigateTo({
                                 url: '../selpsn/index?mulit=false&param=' +
                                    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: "2",
                                          projectid: data[0].ID,
                                          rclsid: "",
                                          robjid: "",
                                          userlogin: "",
                                          edtype: "0",
                                          projectid: '',
                                          rclsid: '',
                                          robjid: '',
                                          userlogin: '',
                                          clsid: $this.param
                                             .DataCls.id,
                                             .DataCls
                                             .id,
                                          objid: "",
                                          attr: param.req,
                                          inputparameter: data,
                                          dataJson: [],
                                       }
                                       $this.DataObjRunCustomEvent(
                                          info);
                                       $this.DataObjRunCustomEvent(info,
                                          param
                                          .data_attr);
                                    }
                                 }
                              }
                           });
                        } else {
                           uni.showModal({
                              title: $this.translateSys("tip"),
                              content: $this.translateSys(
                                    "quotation_mark_left") +
                                 action.action_type + $this.translateSys(
                                    "quotation_mark_right") + $this
                                 .translate(
                                    "tip_action_unprocessed"),
                              showCancel: false,
                              confirmText: $this.translateSys('close')
                           });
                        }
                     }
                              });
                           } else if (action.action_type == 'open_data_query_dlg') {
                              var d = dialog({
                                 title: '<i class="ace-icon fa fa-info-circle"></i> ' +
                                    $this.translateSys("tip"),
                                 content: $this.translateSys(
                                       "quotation_mark_left") +
                                    action
                                    .action_type + $this.translateSys(
                                       "quotation_mark_right") + $this
                                    .translate(
                                       "tip_action_unprocessed")
                              });
                              d.show();
                           } else if (action.action_type == 'open_common_dlg') {
                  } catch (ex) {
                     let actionList = (data.action || []).map(a => a.action_type).join(';')
                     let tip = typeof ex == 'string' ? ex : ex.message
                     tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                     uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                     console.log(ex)
                     return
                              if (val.common_dlg_id == 'check_list') {
                                 $this.setData({
                                    check_list: val.config
                                 })
                                 if (val.config.appear_style == 'sideslip') //判断是否是侧滑
                                    $this.setData({
                                       popupType: "right"
                                    })
                                 else
                                    $this.setData({
                                       popupType: "center"
                                    })
                                 // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
                                 $this.$refs.popup.open($this.popupType);
                                 var popupParam = {
                                    item: item,
                                    button_callback: button_callback,
                                    req: req,
                                    data_attr: data_attr
                                 }
                                 $this.setData({
                                    popupParam: popupParam
                                 })
                              }
                           } 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 param_ = {
                                 item: item,
                                 button_callback: button_callback,
                                 req: req
                              }
                              uni.navigateTo({
                                 url: '../selPrj/index?relation=' + priRel +
                                    '&param=' +
                                    JSON.stringify(param_),
                                 events: {
                                    AddPer(data, param) {
                                       var attr = param.item.fieldId;
                                       $this.head_styledef.form.model[
                                             attr] =
                                          data[0].ID +
                                          ';' + data[0].Name;
                                       // $this.classAttrList[param.index].Attr[param.iindex].Value=data[0].Name;
                                       // $this.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.param
                                                .DataCls.id,
                                             objid: "",
                                             attr: param.req,
                                             dataJson: [],
                                          }
                                          $this.DataObjRunCustomEvent(
                                             info);
                                       }
                                    }
                                 }
                              });
                           } else {
                              uni.showModal({
                                 title: $this.translateSys("tip"),
                                 content: $this.translateSys(
                                       "quotation_mark_left") +
                                    action.action_type + $this.translateSys(
                                       "quotation_mark_right") + $this
                                    .translate(
                                       "tip_action_unprocessed"),
                                 showCancel: false,
                                 confirmText: $this.translateSys('close')
                              });
                           }
                        }
                     } catch (ex) {
                        let actionList = (data.action || []).map(a => a.action_type).join(';')
                        let tip = typeof ex == 'string' ? ex : ex.message
                        tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: tip,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                        console.log(ex)
                        return
                     }
                  }
               }
@@ -1576,163 +1582,164 @@
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  if (data.result_type == 2) {
                     var result = data.result || []
                  if ([0, 2, 3, 4, -1].includes(data.result_type)) {
                     if (data.result_type == 2) {
                        var result = data.result || []
                     for (var i = 0; i < result.length; i++) {
                        for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
                           var attr = $this.head_styledef.form.items[c];
                           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;
                        for (var i = 0; i < result.length; i++) {
                           for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
                              var attr = $this.head_styledef.form.items[c];
                              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;
                                       }
                                    }
                                 });
                              }
                           } 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.refdatastore.filter(function(s) {
                                 return result[i].attr == s.attr
                              }).length) {
                              length = 1;
                              $this.refdatastore.push(result[i]);
                           }
                           if (length == 0) {
                              for (var j = 0; j < $this.refdatastore.length; j++) {
                                 if ($this.refdatastore[j].attr == result[i].attr) {
                                    $this.refdatastore[j].value = result[i].value;
                                 }
                              }
                           }
                        }
                     } else if (typeof data.result == 'string') {
                        if (data.result) {
                           uni.showModal({
                              title: this.translateSys('tip'),
                              content: data.result,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                        }
                     }
                     try {
                        var actionlist = data.action || []
                        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.head_styledef.form.items.length; c++) {
                                       var attr = $this.head_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 length = 0;
                        if (!$this.refdatastore.filter(function(s) {
                              return result[i].attr == s.attr
                           }).length) {
                           length = 1;
                           $this.refdatastore.push(result[i]);
                        }
                        if (length == 0) {
                           for (var j = 0; j < $this.refdatastore.length; j++) {
                              if ($this.refdatastore[j].attr == result[i].attr) {
                                 $this.refdatastore[j].value = result[i].value;
                              }
                           }
                        }
                     }
                  } else if (typeof data.result == 'string') {
                     if (data.result) {
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: data.result,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                     }
                  }
                  try {
                     var actionlist = data.action || []
                     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.head_styledef.form.items.length; c++) {
                                    var attr = $this.head_styledef.form.items[c];
                                    // console.log(attr[j].Name+'=='+result[i].attr);
                                    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;
                                          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) {
                                                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;
                                                col.value = '';
                                                col.oldvalue = '';
                                                col.value = result[i].value;
                                                col.oldvalue = result[i].value;
                                                $this.head_styledef.form.model[col
                                                   .fieldId] = result[i].value;
                                             }
                                          }
                                       });
                                    }
                                 }
                              }
                              for (var c = 0; c < $this.head_styledef.form.items.length; c++) {
                                 var attr = $this.head_styledef.form.items[c];
                                 // console.log(attr[j].Name+'=='+result[i].attr);
                                 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;
                                          }
                                       }
                                    });
                                 }
                              }
                           } else if (action.action_type == 'set_dlg_attr_show') {
                              var data = action.value;
                              $this.setFormItemVisible(data)
                              // console.log($this.head_styledef);
                           } else if (action.action_type == 'set_global_attr') {
                              $this.global_attr = action.value || [];
                           }
                        } else if (action.action_type == 'set_dlg_attr_show') {
                           var data = action.value;
                           $this.setFormItemVisible(data)
                           // console.log($this.head_styledef);
                        } else if (action.action_type == 'set_global_attr') {
                           $this.global_attr = action.value || [];
                        }
                     } catch (ex) {
                        let actionList = (data.action || []).map(a => a.action_type).join(';')
                        let tip = typeof ex == 'string' ? ex : ex.message
                        tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: tip,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                        console.log(ex)
                        return
                     }
                  } catch (ex) {
                     let actionList = (data.action || []).map(a => a.action_type).join(';')
                     let tip = typeof ex == 'string' ? ex : ex.message
                     tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                     uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                     console.log(ex)
                     return
                  }
               }
            }).catch(ex => {
@@ -1862,150 +1869,10 @@
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  if (data.result_type == 2) {
                     if (data.result) {
                  if ([0, 2, 3, 4, -1].includes(data.result_type)) {
                     if (data.result_type == 2) {
                        if (data.result) {
                        var list_1 = JSON.parse(JSON.stringify(this.detail1_styledef));
                        var scanCodeVal = $this.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.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.subPanelList.length; s++) {
                              if ($this.subPanelList[s].scanCodeVal == scanCodeVal) {
                                 if (result[i].attr == "S_ID")
                                    $this.subPanelList[s].ObjID = result[i].value;
                                 var _subClassAttr = $this.subPanelList[s].subClassAttr.form
                                    .items;
                                 for (var c = 0; c < _subClassAttr.length; c++) {
                                    if (_subClassAttr[c].name != 'Layout') {
                                       if (_subClassAttr[c].fieldId == result[i].attr)
                                          _subClassAttr[c].value = result[i].value;
                                    } else if (_subClassAttr[c].name == 'Layout') {
                                       _subClassAttr[c].setting.colList.forEach(col => {
                                          if (col) {
                                             if (col.fieldId == result[i].attr)
                                                col.value = result[i].value;
                                          }
                                       });
                                    }
                                 }
                              }
                           }
                           var length = 0;
                           if (!$this.refdatastore.filter(function(s) {
                                 return result[i].attr == s.attr
                              }).length) {
                              length = 1;
                              $this.refdatastore.push(result[i]);
                           }
                           if (length == 0) {
                              for (var j = 0; j < $this.refdatastore.length; j++) {
                                 if ($this.refdatastore[j].attr == result[i].attr) {
                                    $this.refdatastore[j].value = result[i].value;
                                 }
                              }
                           }
                        }
                     }
                  } else if (typeof data.result == 'string') {
                     if (data.result) {
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: data.result,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                     }
                  }
                  try {
                     var actionlist = data.action || []
                     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.subPanelList.length; s++) {
                                    for (var c = 0; c < $this.subPanelList[s]
                                       .subClassAttrList.length; c++) {
                                       var attr = $this.subPanelList[s].subClassAttrList[c]
                                          .Attr;
                                       for (var j = 0; j < attr.length; j++) {
                                          if (attr[j].Name == result[i].attr) {
                                             if (utils.classUtils.attrTypeIsDict(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,
                                                      "CN_S_VALUE": val,
                                                      "Name": val,
                                                      "label": val,
                                                      "value": val
                                                   });
                                                }
                                                attr[j].dictitem = dictItemList;
                                                // attr[j].dictitem = result[i].choice_list;
                                             }
                                          }
                                       }
                                    }
                                 }
                              }
                              for (var s = 0; s < $this.subPanelList.length; s++) {
                                 for (var c = 0; c < $this.subPanelList[s].subClassAttrList
                                    .length; c++) {
                                    var attr = $this.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;
                                          // attr.value = '';
                                          // attr.oldvalue = '';
                                          // attr.value = result[i].value;
                                          // attr.oldvalue = result[i].value;
                                       }
                                    }
                                 }
                              }
                              var length = 0;
                           }
                        } 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.check_list = action.value.config;
                              if (action.value.config.appear_style == 'sideslip') //判断是否是侧滑
                                 $this.popupType = 'right';
                              else
                                 $this.popupType = 'center'
                              // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
                              $this.$refs.popup.open($this.popupType);
                           }
                        } else if (action.action_type == 'add_subcls_panel') { //主从数据类扫码查询数据
                           var result = action.value;
                           var $this = this;
                           var list_1 = JSON.parse(JSON.stringify(this.detail1_styledef));
                           var scanCodeVal = $this.scanCodeVal;
                           var rand = '';
@@ -2024,16 +1891,14 @@
                              scanCodeVal: scanCodeVal,
                              subClassAttr: list_1
                           });
                           $this.activelist.push({
                              active: false
                           });
                           var result = data.result || []
                           for (var i = 0; i < result.length; i++) {
                              for (var s = 0; s < $this.subPanelList.length; s++) {
                                 if ($this.subPanelList[s].scanCodeVal == scanCodeVal) {
                                    if (result[i].attr == "S_ID")
                                       $this.subPanelList[s].ObjID = result[i].value;
                                    var _subClassAttr = $this.subPanelList[s].subClassAttr
                                       .form.items;
                                    var _subClassAttr = $this.subPanelList[s].subClassAttr.form
                                       .items;
                                    for (var c = 0; c < _subClassAttr.length; c++) {
                                       if (_subClassAttr[c].name != 'Layout') {
                                          if (_subClassAttr[c].fieldId == result[i].attr)
@@ -2047,11 +1912,9 @@
                                          });
                                       }
                                    }
                                    // $this.subPanelList[s].subClassAttr=list_1;
                                 }
                              }
                              // console.log($this.subPanelList);
                              var length = 0;
                              if (!$this.refdatastore.filter(function(s) {
                                    return result[i].attr == s.attr
@@ -2067,32 +1930,178 @@
                                 }
                              }
                           }
                        } else {
                        }
                     } else if (typeof data.result == 'string') {
                        if (data.result) {
                           uni.showModal({
                              title: this.translateSys("tip"),
                              content: this.translateSys("quotation_mark_left") + action
                                 .action_type + this.translateSys(
                                    "quotation_mark_right") + this.translate(
                                    "tip_action_unprocessed"),
                              title: this.translateSys('tip'),
                              content: data.result,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                        }
                     }
                     try {
                        var actionlist = data.action || []
                        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.subPanelList.length; s++) {
                                       for (var c = 0; c < $this.subPanelList[s]
                                          .subClassAttrList.length; c++) {
                                          var attr = $this.subPanelList[s].subClassAttrList[c]
                                             .Attr;
                                          for (var j = 0; j < attr.length; j++) {
                                             if (attr[j].Name == result[i].attr) {
                                                if (utils.classUtils.attrTypeIsDict(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,
                                                         "CN_S_VALUE": val,
                                                         "Name": val,
                                                         "label": val,
                                                         "value": val
                                                      });
                                                   }
                                                   attr[j].dictitem = dictItemList;
                                                   // attr[j].dictitem = result[i].choice_list;
                                                }
                                             }
                                          }
                                       }
                                    }
                                 }
                                 for (var s = 0; s < $this.subPanelList.length; s++) {
                                    for (var c = 0; c < $this.subPanelList[s].subClassAttrList
                                       .length; c++) {
                                       var attr = $this.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;
                                             // attr.value = '';
                                             // attr.oldvalue = '';
                                             // attr.value = result[i].value;
                                             // attr.oldvalue = result[i].value;
                                          }
                                       }
                                    }
                                 }
                                 var length = 0;
                              }
                           } 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.check_list = action.value.config;
                                 if (action.value.config.appear_style == 'sideslip') //判断是否是侧滑
                                    $this.popupType = 'right';
                                 else
                                    $this.popupType = 'center'
                                 // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
                                 $this.$refs.popup.open($this.popupType);
                              }
                           } else if (action.action_type == 'add_subcls_panel') { //主从数据类扫码查询数据
                              var result = action.value;
                              var $this = this;
                              var list_1 = JSON.parse(JSON.stringify(this.detail1_styledef));
                              var scanCodeVal = $this.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.subPanelList.push({
                                 scanCodeVal: scanCodeVal,
                                 subClassAttr: list_1
                              });
                              $this.activelist.push({
                                 active: false
                              });
                              for (var i = 0; i < result.length; i++) {
                                 for (var s = 0; s < $this.subPanelList.length; s++) {
                                    if ($this.subPanelList[s].scanCodeVal == scanCodeVal) {
                                       if (result[i].attr == "S_ID")
                                          $this.subPanelList[s].ObjID = result[i].value;
                                       var _subClassAttr = $this.subPanelList[s].subClassAttr
                                          .form.items;
                                       for (var c = 0; c < _subClassAttr.length; c++) {
                                          if (_subClassAttr[c].name != 'Layout') {
                                             if (_subClassAttr[c].fieldId == result[i].attr)
                                                _subClassAttr[c].value = result[i].value;
                                          } else if (_subClassAttr[c].name == 'Layout') {
                                             _subClassAttr[c].setting.colList.forEach(col => {
                                                if (col) {
                                                   if (col.fieldId == result[i].attr)
                                                      col.value = result[i].value;
                                                }
                                             });
                                          }
                                       }
                                       // $this.subPanelList[s].subClassAttr=list_1;
                                    }
                                 }
                                 // console.log($this.subPanelList);
                                 var length = 0;
                                 if (!$this.refdatastore.filter(function(s) {
                                       return result[i].attr == s.attr
                                    }).length) {
                                    length = 1;
                                    $this.refdatastore.push(result[i]);
                                 }
                                 if (length == 0) {
                                    for (var j = 0; j < $this.refdatastore.length; j++) {
                                       if ($this.refdatastore[j].attr == result[i].attr) {
                                          $this.refdatastore[j].value = result[i].value;
                                       }
                                    }
                                 }
                              }
                           } else {
                              uni.showModal({
                                 title: this.translateSys("tip"),
                                 content: this.translateSys("quotation_mark_left") + action
                                    .action_type + this.translateSys(
                                       "quotation_mark_right") + this.translate(
                                       "tip_action_unprocessed"),
                                 showCancel: false,
                                 confirmText: this.translateSys('close')
                              });
                           }
                        }
                  } catch (ex) {
                     let actionList = (data.action || []).map(a => a.action_type).join(';')
                     let tip = typeof ex == 'string' ? ex : ex.message
                     tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                     uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                     console.log(ex)
                     return
                     } catch (ex) {
                        let actionList = (data.action || []).map(a => a.action_type).join(';')
                        let tip = typeof ex == 'string' ? ex : ex.message
                        tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                        uni.showModal({
                           title: this.translateSys('tip'),
                           content: tip,
                           showCancel: false,
                           confirmText: this.translateSys('close')
                        });
                        console.log(ex)
                        return
                     }
                  }
               }