cuiqian2004
2025-08-14 e540e5b44f56ce8e8edc377dfa4c5b343b1a9eef
pages/modal/5601.vue
@@ -44,8 +44,8 @@
                                    :class="btn.FunCode == 'Delete' ? 'btn-warn' : 'btn-primary'"
                                    @click="onRowBtnClick(btn, pageData,ii)">
                                    <text v-if="btn.Style == 'img' || btn.Style == 'img_text'"
                                       class="Img"></text>
                                    {{(btn.Style == 'text'|| btn.Style == 'img_text') ? btn.ShowName :""}}
                                       class="img"></text>
                                    {{btn.ShowName ||"" }}
                                 </button>
                              </div>
@@ -60,8 +60,8 @@
                              'btn-left':(btnIndex < pageData.Button.length - 1),
                              'btn-right': btnIndex > 0 && btnIndex == pageData.Button.length - 1 ,
                              'width-50':(pageData.Button.length == 2),'width-32':(pageData.Button.length == 3),'width-30':(pageData.DropDownButton.length> 0)}" @click="onBtnClick(btn, pageData)">
                           <text v-if="btn.Style == 'img' || btn.Style == 'img_text'" class="Img"></text>
                           {{(btn.Style == 'text'|| btn.Style == 'img_text') ? btn.ShowName :""}}
                           <text v-if="btn.Style == 'img' || btn.Style == 'img_text'" class="img"></text>
                           {{btn.ShowName ||""}}
                        </button>
                        <view class="btn-right" v-if="pageData.DropDownButton.length >0 ">
                           <a @click="clickDropdownBtns(pageData)">
@@ -117,7 +117,8 @@
      Base64
   } from '@/js/Base64.js';
   import {
      dictGetInfo
      dictGetInfo,
      appGetInfo,
   } from "@/api/mobox.js"
   import {
      getUIStyleInfo,
@@ -185,7 +186,7 @@
         //获取主数据类ID
         this.ClsID = this.param.master_cls?.id;
         if (this.ClsID) {
            const  paramValue = options.paramValue ?JSON.parse(options.paramValue) :undefined
            const paramValue = options.paramValue ? JSON.parse(options.paramValue) : undefined
            this.loadData(paramValue)
         } else {
            uni.showModal({
@@ -227,27 +228,7 @@
            //传入参数值
            console.log(paramValue)
            if (paramValue) {
               const attrs = paramValue.attrs || [];
               (this.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;
                              }
                           });
                        }
                     });
                  }
               })
               this.setFormValues(paramValue)
            }
            //加载初始界面
            if (this.param.Show_Welcom_Page) {
@@ -867,7 +848,7 @@
               };
               const result = await runCustomEvent(dataInfo)
               console.log(result)
               if (result.ret != 0&& result.ret != 1) {
               if (result.ret != 0 && result.ret != 1) {
                  var tip = result.err_info ? typeof result
                     .err_info == 'string' ? result
                     .err_info : result.err_info.join('<br/>') :
@@ -1092,7 +1073,7 @@
                  };
                  const result = await runCustomEvent(dataInfo)
                  console.log(result);
                  if (result.ret != 0&& result.ret != 1) {
                  if (result.ret != 0 && result.ret != 1) {
                     var tip = result.err_info ? typeof result
                        .err_info == 'string' ? result
                        .err_info : result.err_info.join('<br/>') :
@@ -2153,7 +2134,7 @@
            console.log(dataInfo);
            // return;
            runCustomEvent(dataInfo).then(data => {
               if (data.ret != 0&& data.ret != 1) {
               if (data.ret != 0 && data.ret != 1) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
@@ -2326,7 +2307,7 @@
            console.log(dataInfo);
            // return;
            runCustomEvent(dataInfo).then(data => {
               if (data.ret != 0&& data.ret != 1) {
               if (data.ret != 0 && data.ret != 1) {
                  var tip = data.err_info ? typeof data.err_info == 'string' ? data
                     .err_info :
                     data
@@ -2710,10 +2691,121 @@
                  }
               }
            } else if (btn.FunCode == "RelatedFunction") {
               if (index > -1) {
                  const style = pageData.DefList[index];
                  this.relatedFunction(btn, style, enviroment, pageData);
               }
            } else {
               this.$Message.warning(this.$t("sys.unrealized"));
            }
         },
         async relatedFunction(btn, style, enviroment, pageData) {
            //跳转功能点
            try {
               const defCode = btn.Related_Function?.Def_Code
               var $this = this;
               if (
                  defCode == "3018" ||
                  defCode == "3037" ||
                  defCode == "3200" ||
                  defCode == "3201" ||
                  defCode == "3202" ||
                  defCode == "5600" ||
                  defCode == "5601" ||
                  defCode == "5602"
               ) {
                  let name = defCode
                  if (defCode == "3018" || defCode == "3037")
                     name = defCode + "_2"
                  var json = {
                     app_id: [btn.Related_Function.ID],
                  };
                  const result = await appGetInfo(json)
                  if ((result || []).length > 0) {
                     var app = result[0];
                     var param = "";
                     var appName = app.list_name || app.name
                        .Name;
                     var paramStr = app.param
                     if (paramStr) {
                        //mobox2的param是json字符串
                        param = paramStr.replace(/\\/g, "");
                        //mobox3的param是base64字符串
                        if (!paramStr.includes('"')) param = Base64.decode(
                           paramStr);
                     }
                     if (!param) {
                        uni.showModal({
                           title: this.translateSys("tip"),
                           content: this.translate(
                              'tip_no_app_param'),
                           showCancel: false,
                           confirmText: this.translateSys(
                              'close')
                        });
                        return;
                     }
                     const attrValues = []
                     style.form.items.forEach(item => {
                        if (item.name == "Layout") { //判断是否是栅栏格式
                           item.setting.colList.forEach(col => {
                              if (col != null) {
                                 attrValues.push({
                                    attr: col.fieldId,
                                    value: col.value || ""
                                 })
                              }
                           });
                        } else
                           attrValues.push({
                              attr: item.fieldId,
                              value: item.value || ""
                           })
                     });
                     uni.navigateTo({
                        url: '../modal/' + name + '?param=' +
                           param + "&titlename=" + appName +
                           "&type=relatedFunction&paramValue=" + JSON.stringify(attrValues),
                     });
                  } else {
                     uni.showModal({
                        title: this.translateSys("error"),
                        content: this.translate(
                           "function_not_exist"),
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys("error"),
                     content: this.translate("cannot_related_function"),
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
               }
            } catch (ex) {
               console.log(ex);
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: this.translateSys("error"),
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               return undefined
            }
         },
         //修改小窗口数据
         showSmallDialog(btn, row, enviroment, pageData) {
            var data = {
@@ -2984,7 +3076,7 @@
            console.log(dataInfo);
            runCustomEvent(dataInfo).then(result => {
               console.log(result);
               if (result.ret != 0&& result.ret != 1) {
               if (result.ret != 0 && result.ret != 1) {
                  var tip = result.err_info ? typeof result
                     .err_info == 'string' ? result.err_info :
                     result.err_info.join('<br/>') : '';
@@ -3226,10 +3318,10 @@
            }).catch(ex => {
               console.log(ex);
            let exStr = JSON.stringify(ex)
            if (exStr == "{}")
               exStr = ex
            let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               let exStr = JSON.stringify(ex)
               if (exStr == "{}")
                  exStr = ex
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : exStr
               uni.showModal({
                  title: this.translateSys("error") + "8.1",
                  content: this.translate("execute_after_ok_event_failed") +