cuiqian2004
2025-05-20 a94f1b73dce878f7102081aae0d796c233a4699f
pages/modal/5601.vue
@@ -24,7 +24,6 @@
                        </image>
                        <checkbox-group @change="checkboxChange">
                           <div class="dv-panel" v-for="(style,ii) in pageData.DefList" :key="ii"
                           <div class="dv-panel" v-for="(style,ii) in pageData.DefList" :key="ii"
                              @tap="onPanelClick(ii,style.form.htmlobjId)"
                              :id="'dvpanel'+style.form.htmlobjId"
                              :class="style.form.htmlobjId==active_id?'bk-active':''">
@@ -366,21 +365,18 @@
                        Name: page.After_Delete?.Name
                     };
                  }
                  if (evt.ID) {
                     return [{
                        Cls_Name: this.param?.master_cls?.name || "",
                        Cls_ID: this.param?.master_cls?.id || "",
                        FunCode: "Delete",
                        ShowName: this.$t("sys.delete"),
                        Style: "text",
                        Prompt: false,
                        NotTriggerSYSEvent: false,
                        DataStateVerify: false,
                        AttrVerify: false,
                        AfterProcess_Event: evt,
                     }];
                  }
                  return [{
                     Cls_Name: this.param?.master_cls?.name || "",
                     Cls_ID: this.param?.master_cls?.id || "",
                     FunCode: "Delete",
                     ShowName: this.$t("sys.delete"),
                     Style: "text",
                     Prompt: false,
                     NotTriggerSYSEvent: false,
                     DataStateVerify: false,
                     AttrVerify: false,
                     AfterProcess_Event: evt,
                  }];
               }
               return [];
            }
@@ -494,7 +490,25 @@
                        }
                     }
                  }
                  const app = getApp()
                  if (app.globalData.bindClasses) {
                     styledefHead.form.items.push({
                        name: "Input",
                        label: this.translate("classes"),
                        labelWidth: 100,
                        disabled: true,
                        value: app.globalData.classes,
                        setting: {
                           width: 100,
                           height: 50,
                        },
                        bind: {
                           attr: "",
                        },
                        fieldId: "S_CLASSES",
                     })
                     styledefHead.form.model["S_CLASSES"] = app.globalData.classes
                  }
               }
               this.setData({
                  head_styledef: styledefHead
@@ -628,7 +642,7 @@
            // var $ele = e;
            //console.log(e.target)
            this.focusOldFieldId = item.fieldId
            getApp().onScan((result) => {
            getApp().onScan(async (result) => {
               console.log(result.decodedata);
               item.value = result.decodedata;
               var $this = this;
@@ -638,16 +652,14 @@
                  var attr = item.fieldId;
                  this.head_styledef.form.model[attr] = newVal;
                  var onChangeEvent = item.bind.onChangeEvent; //内容变化后事件
                  var onSuffixClickCallbackEvent = item.bind
                     .onSuffixClickCallbackEvent; //后图标点击事件
                  var onSuffixClickEvent = item.bind
                     .onSuffixClickEvent; //后图标点击回调
                  var isflag = false;
                  if (item.changeEventRunding)
                     return
                  item.changeEventRunding = true
                  if (onChangeEvent?.id) { //内容变化后事件
                     $this.onChange(onChangeEvent);
                     await this.onChange(onChangeEvent);
                  }
                  item.changeEventRunding = false
                  //初始化,下个输入框focus属性
                  var findd = false
                  for (let i in $this.head_styledef.form.items) {
@@ -717,7 +729,7 @@
            })
         },
         onEnterChange(item) { //回车,点击按钮,取消节点事件
         async onEnterChange(item) { //回车,点击按钮,取消节点事件
            console.log(item);
            let newVal = item.value
            if (typeof item.value == "string") {
@@ -736,7 +748,7 @@
               this.head_styledef.form.model[attr] = newVal;
               var onChangeEvent = item.bind.onChangeEvent; //内容变化后事件
               if (onChangeEvent?.id) { //内容变化后事件
                  this.onChange(onChangeEvent);
                  await this.onChange(onChangeEvent);
               }
            }
@@ -892,186 +904,176 @@
                     global_attr: '',
                     input_param: input_param,
                  };
                  runCustomEvent(dataInfo).then(result => {
                     console.log(result);
                     if (result.ret != 0) {
                        var tip = result.err_info ? typeof result
                           .err_info == 'string' ? result
                           .err_info : result.err_info.join('<br/>') :
                           '';
                        if (result.ret == 801) {
                           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(
                                 'close')
                           });
                        } else uni.showModal({
                           title: this.translateSys('tip'),
                           content: tip + ',' + this
                              .translateSys('tip') + ':' +
                              result
                              .ret,
                           showCancel: false,
                           confirmText: this.translateSys(
                              'close')
                        });
                        return false;
                     } else {
                        var tip = result.info ? typeof result.info ==
                           'string' ? result.info :
                           result.info.join('<br/>') : '';
                        if (tip) uni.showModal({
                           title: this.translateSys('tip'),
                  const result = await runCustomEvent(dataInfo)
                  console.log(result);
                  if (result.ret != 0) {
                     var tip = result.err_info ? typeof result
                        .err_info == 'string' ? result
                        .err_info : result.err_info.join('<br/>') :
                        '';
                     if (result.ret == 801) {
                        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(
                              'close')
                        });
                        if (result.result_type == 0 && result.action) {
                           result.action.forEach(item => {
                              if (item.action_type == "insert_subtable_page_row") { //码盘中
                                 $this.param.Show_Welcom_Page = false;
                                 var value = item.value;
                                 $this.viewAceionRow(value);
                              } else if (item.action_type ==
                                 "set_subtable_page_content") { //已码盘
                                 $this.param.Show_Welcom_Page = false;
                                 var value = item.value;
                                 const pageData = $this.pageDetail.find((page) => {
                                    return value.page_name == page.Name;
                                 });
                                 if (value.clear_confirm != false && value.clear == true &&
                                    pageData && pageData.DefList.length > 0
                                 ) { //判断是否清空页签内容,正在码盘是否有数据
                                    uni.showModal({
                                       title: this.translateSys('tip'),
                                       content: this.translate(
                                             "are_you_sure_clear_first") +
                                          this.translateSys(
                                             "quotation_mark_left") +
                                          value.page_name +
                                          this.translateSys(
                                             "quotation_mark_right") +
                                          this.translate(
                                             "are_you_sure_clear_last"),
                                       cancelText: $this.translateSys('ok'),
                                       confirmText: $this.translateSys('cancel'),
                                       success: function(res) {
                                          if (res.cancel) {
                                             if (pageData)
                                                pageData.DefList = [];
                                             $this.viewAceionContent(value);
                                          } else if (res.confirm) {
                                             if (pageData)
                                                pageData.DefList = [];
                                             $this.viewAceionContent(value);
                                          }
                                       }
                                    });
                                 } else {
                                    if (pageData)
                                       pageData.DefList = [];
                                    $this.viewAceionContent(value);
                                 }
                              } else if (item.action_type == "select_subtable_page") {
                                 var value = item.value;
                                 const pageIndex = $this.pageDetail.findIndex((page) => {
                                    return value.page_name == page.Name;
                                 });
                                 if (pageIndex > -1) {
                                    $this.setData({
                                       current: pageIndex
                                    })
                                 }
                              } else if (item.action_type == "select_subtable_page_row") {
                                 // value = {"page_name":"码盘中", "row":{"id":"xx"}}
                                 var value = item.value;
                                 $this.viewActionSelectRow(value)
                              } else if (item.action_type ==
                                 "remove_subtable_page_row") { //清除面板中指定id的数据
                                 var value = item.value;
                                 $this.viewActionRemoveRow(value)
                              } else if (item.action_type == "set_subtable_page_row") {
                                 $this.viewActionSetRow(item.value)
                              } else if (item.action_type == "set_subtable_page_ext_data") {
                                 var value = item.value;
                                 const pageData = $this.pageDetail.find((page) => {
                                    return value.page_name == page.Name;
                                 });
                                 if (pageData)
                                    pageData.ExtData = value.ext_data
                              } else if (item.action_type == "clear_subpage_rows") {
                                 var value = item.value;
                                 const pageIndex = $this.pageDetail.findIndex((page) => {
                                    return value.page_name == page.Name;
                                 });
                                 if (pageIndex > -1) {
                                    const pageData = $this.pageDetail[pageIndex]
                                    pageData.DefList = []
                                    pageData.ExtData = {}
                                    $this.$set(this.pageDetail, pageIndex, pageData)
                                 }
                              } else if (item.action_type == "set_dlg_current_edit_attr") {
                                 if ($this.focusOldFieldId == item.value) {
                                    $this.setData({
                                       focusFieldId: ""
                                    })
                                 } else {
                                    $this.setData({
                                       focusFieldId: $this.focusOldFieldId
                                    })
                                 }
                                 $this.$nextTick(() => {
                                    $this.setData({
                                       focusFieldId: item.value
                                    })
                                 });
                              } else if (item.action_type == "set_dlg_attr") {
                                 // value = {"attr":"xxx", "value":"xxx"}
                                 var data = item.value;
                                 $this.setFormValues(data)
                              }
                           });
                        } else {
                           if (result.info) {
                              uni.showModal({
                                 title: this.translateSys(
                                    "error") + "4.3",
                                 content: result.info,
                                 showCancel: false,
                                 confirmText: this
                                    .translateSys('close')
                              });
                           }
                        }
                     }
                  }).catch(ex => {
                     // console.log(ex);
                     let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
                     uni.showModal({
                        title: this.translateSys("error") + "4.1",
                     } else uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip + ',' + this
                           .translateSys('tip') + ':' +
                           result
                           .ret,
                        showCancel: false,
                        confirmText: this.translateSys(
                           'close')
                     });
                     return false;
                  } else {
                     var tip = result.info ? typeof result.info ==
                        'string' ? result.info :
                        result.info.join('<br/>') : '';
                     if (tip) uni.showModal({
                        title: this.translateSys('tip'),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                        confirmText: this.translateSys(
                           'close')
                     });
                  });
                     if (result.result_type == 0 && result.action) {
                        result.action.forEach(item => {
                           if (item.action_type == "insert_subtable_page_row") { //码盘中
                              $this.param.Show_Welcom_Page = false;
                              var value = item.value;
                              $this.viewAceionRow(value);
                           } else if (item.action_type ==
                              "set_subtable_page_content") { //已码盘
                              $this.param.Show_Welcom_Page = false;
                              var value = item.value;
                              const pageData = $this.pageDetail.find((page) => {
                                 return value.page_name == page.Name;
                              });
                              if (value.clear_confirm != false && value.clear == true &&
                                 pageData && pageData.DefList.length > 0
                              ) { //判断是否清空页签内容,正在码盘是否有数据
                                 uni.showModal({
                                    title: this.translateSys('tip'),
                                    content: this.translate(
                                          "are_you_sure_clear_first") +
                                       this.translateSys(
                                          "quotation_mark_left") +
                                       value.page_name +
                                       this.translateSys(
                                          "quotation_mark_right") +
                                       this.translate(
                                          "are_you_sure_clear_last"),
                                    cancelText: $this.translateSys('ok'),
                                    confirmText: $this.translateSys('cancel'),
                                    success: function(res) {
                                       if (res.cancel) {
                                          if (pageData)
                                             pageData.DefList = [];
                                          $this.viewAceionContent(value);
                                       } else if (res.confirm) {
                                          if (pageData)
                                             pageData.DefList = [];
                                          $this.viewAceionContent(value);
                                       }
                                    }
                                 });
                              } else {
                                 if (pageData)
                                    pageData.DefList = [];
                                 $this.viewAceionContent(value);
                              }
                           } else if (item.action_type == "select_subtable_page") {
                              var value = item.value;
                              const pageIndex = $this.pageDetail.findIndex((page) => {
                                 return value.page_name == page.Name;
                              });
                              if (pageIndex > -1) {
                                 $this.setData({
                                    current: pageIndex
                                 })
                              }
                           } else if (item.action_type == "select_subtable_page_row") {
                              // value = {"page_name":"码盘中", "row":{"id":"xx"}}
                              var value = item.value;
                              $this.viewActionSelectRow(value)
                           } else if (item.action_type ==
                              "remove_subtable_page_row") { //清除面板中指定id的数据
                              var value = item.value;
                              $this.viewActionRemoveRow(value)
                           } else if (item.action_type == "set_subtable_page_row") {
                              $this.viewActionSetRow(item.value)
                           } else if (item.action_type == "set_subtable_page_ext_data") {
                              var value = item.value;
                              const pageData = $this.pageDetail.find((page) => {
                                 return value.page_name == page.Name;
                              });
                              if (pageData)
                                 pageData.ExtData = value.ext_data
                           } else if (item.action_type == "clear_subpage_rows") {
                              var value = item.value;
                              const pageIndex = $this.pageDetail.findIndex((page) => {
                                 return value.page_name == page.Name;
                              });
                              if (pageIndex > -1) {
                                 const pageData = $this.pageDetail[pageIndex]
                                 pageData.DefList = []
                                 pageData.ExtData = {}
                                 $this.$set(this.pageDetail, pageIndex, pageData)
                              }
                           } else if (item.action_type == "set_dlg_current_edit_attr") {
                              if ($this.focusOldFieldId == item.value) {
                                 $this.setData({
                                    focusFieldId: ""
                                 })
                              } else {
                                 $this.setData({
                                    focusFieldId: $this.focusOldFieldId
                                 })
                              }
                              $this.$nextTick(() => {
                                 $this.setData({
                                    focusFieldId: item.value
                                 })
                              });
                           } else if (item.action_type == "set_dlg_attr") {
                              // value = {"attr":"xxx", "value":"xxx"}
                              var data = item.value;
                              $this.setFormValues(data)
                           }
                        });
                     } else {
                        if (result.info) {
                           uni.showModal({
                              title: this.translateSys(
                                 "error") + "4.3",
                              content: result.info,
                              showCancel: false,
                              confirmText: this
                                 .translateSys('close')
                           });
                        }
                     }
                  }
               }
            } catch (ex) {
               var tip = typeof ex == "string" ? ex : ex.message;
@@ -1292,25 +1294,16 @@
                                       attr.value,
                                       attr.operation
                                    )
                              if (ele2.name != 'Layout') {
                                 if (ele2.fieldId == attr.attr) {
                                    ele2.value = $this.operationNumber(
                                       ele2.value,
                                       attr.value,
                                       attr.operation
                                    )
                                 }
                              } else if (ele2.name == 'Layout') {
                                 ele2.setting.colList.forEach(col => {
                                    if (col) {
                                       if (col.fieldId == attr
                                          .attr) {
                                       if (col.fieldId == attr.attr) {
                                          col.value = $this
                                             .operationNumber(
                                                col.value,
                                                attr.value,
                                                attr
                                                .operation
                                                attr.operation
                                             )
                                       }
                                    }
@@ -1320,80 +1313,74 @@
                        });
                     }
                  } else if (rowData.condition) {
                     const conditions = rowData.condition || [];
                     if (conditions.length > 0) {
                        let bFindCondition = true;
                        for (let i in conditions) {
                           const condition = conditions[i];
                           let bFind = false;
                           for (let i2 in ele.form.items) {
                              const ele2 = ele.form.items[i2];
                              if (ele2.name != "Layout") {
                                 if (ele2.fieldId == condition.attr) {
                                    if (condition.value == ele2.value) {
                     const conditions = rowData.condition
                     let bFindCondition = true;
                     for (let i in conditions) {
                        const condition = conditions[i];
                        let bFind = false;
                        for (let i2 in ele.form.items) {
                           const ele2 = ele.form.items[i2];
                           if (ele2.name != "Layout") {
                              if (ele2.fieldId == condition.attr) {
                                 if (condition.value == ele2.value) {
                                    bFind = true;
                                 }
                                 break;
                              }
                           } else {
                              const colList = ele2.setting.colList || [];
                              for (let i3 in colList) {
                                 const col = colList[i3];
                                 if (col.fieldId == condition.attr) {
                                    if (condition.value == col.value) {
                                       bFind = true;
                                    }
                                    break;
                                 }
                              } else {
                                 const colList = ele2.setting.colList || [];
                                 for (let i3 in colList) {
                                    const col = colList[i3];
                                    if (col.fieldId == condition.attr) {
                                       if (condition.value == col.value) {
                                          bFind = true;
                                       }
                                       break;
                                    }
                                 }
                                 if (bFind) break;
                              }
                           }
                           if (!bFind) {
                              bFindCondition = false;
                              break;
                              if (bFind) break;
                           }
                        }
                        if (bFindCondition) {
                           rowData.attrs.forEach(attr => {
                              ele.form.items.forEach(ele2 => {
                                 if (ele2.name != 'Layout') {
                                    if (ele2.fieldId == attr.attr) {
                                       ele2.value =
                                          $this.operationNumber(
                                             ele2.value,
                                             attr.value,
                                             attr.operation
                                          )
                                    }
                                 } else if (ele2.name == 'Layout') {
                                    ele2.setting.colList.forEach(col => {
                                       if (col) {
                                          if (col.fieldId == attr
                                             .attr) {
                                             col.value =
                                                $this
                                                .operationNumber(
                                                   col.value,
                                                   attr
                                                   .value,
                                                   attr
                                                   .operation)
                                          }
                                       }
                                    })
                                 }
                              });
                           });
                        if (!bFind) {
                           bFindCondition = false;
                           break;
                        }
                     }
                     if (bFindCondition) {
                        rowData.attrs.forEach(attr => {
                           ele.form.items.forEach(ele2 => {
                              if (ele2.name != 'Layout') {
                                 if (ele2.fieldId == attr.attr) {
                                    ele2.value =
                                       $this.operationNumber(
                                          ele2.value,
                                          attr.value,
                                          attr.operation
                                       )
                                 }
                              } else if (ele2.name == 'Layout') {
                                 ele2.setting.colList.forEach(col => {
                                    if (col) {
                                       if (col.fieldId == attr.attr) {
                                          col.value =
                                             $this.operationNumber(
                                                col.value, attr
                                                .value, attr
                                                .operation)
                                       }
                                    }
                                 })
                              }
                           });
                        });
                     }
                  }
               })
            });
            pageData.DefList = detailStyleDefList
            $this.$set(this.pageDetail, pageIndex, pageData)
         },
         //加载正在码盘内容
         viewAceionRow(data) {
@@ -1424,15 +1411,7 @@
                        if (ele.name != 'Layout') {
                           if (ele.fieldId == attr.attr)
                              ele.value = attr.value;
                           if (ele.fieldId == attr.attr)
                              ele.value = attr.value;
                        } else if (ele.name == 'Layout') {
                           ele.setting.colList.forEach(col => {
                              if (col) {
                                 if (col.fieldId == attr.attr)
                                    col.value = attr.value;
                              }
                           });
                           ele.setting.colList.forEach(col => {
                              if (col) {
                                 if (col.fieldId == attr.attr)
@@ -1499,7 +1478,6 @@
                  if (data.clear == false) {
                     var isflag = true;
                     pageData.DefList.forEach((style, index) => {
                        if (style.form.objId == detailStyle.form.objId) {
                        if (style.form.objId == detailStyle.form.objId) {
                           cont.attrs.forEach(attr => {
                              style.form.items.forEach(ele => {
@@ -1582,6 +1560,13 @@
                     if (ele.fieldId == attr.attr) {
                        ele.value = attr.value;
                        ele.oldvalue = attr.value;
                        if (ele.name == "Input") {
                           if (attr.prompt) ele.placeholder = attr.prompt;
                        }
                        if (attr.enable !== undefined) {
                           if (attr.enable) ele.disabled = false;
                           else ele.disabled = true;
                        }
                     }
                  } else if (ele.name == "Layout") {
                     ele.setting.colList.forEach((col) => {
@@ -1589,6 +1574,13 @@
                           if (col.fieldId == attr.attr) {
                              col.value = attr.value;
                              col.oldvalue = attr.value;
                              if (col.name == "Input") {
                                 if (attr.prompt) col.placeholder = attr.prompt;
                              }
                              if (attr.enable !== undefined) {
                                 if (attr.enable) col.disabled = false;
                                 else col.disabled = true;
                              }
                           }
                        }
                     });
@@ -2360,7 +2352,8 @@
                  const style = pageData.DefList[index];
                  //删除码盘中样式面板
                  pageData.DefList.splice(index, 1);
                  this.del(pageData, style, btn.AfterProcess_Event);
                  if (btn.AfterProcess_Event.ID)
                     this.del(pageData, style, btn.AfterProcess_Event);
                  this.$set(this.pageDetail, pageIndex, pageData)
               }
            } else if (btn.FunCode == "Modify") {
@@ -2508,22 +2501,22 @@
         },
         sava(pageData, event) {
            var $this = this;
            if (pageData.DefList.length == 0) {
               uni.showModal({
                  title: this.translateSys("tip"),
                  content: this.translate(
                        "tip_no_data_first") +
                     this.translateSys(
                        "quotation_mark_left") + pageData.Name + this
                     .translateSys(
                        "quotation_mark_right") +
                     this.translate(
                        "tip_no_data_last"),
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               return false;
            }
            // if (pageData.DefList.length == 0) {
            //    uni.showModal({
            //       title: this.translateSys("tip"),
            //       content: this.translate(
            //             "tip_no_data_first") +
            //          this.translateSys(
            //             "quotation_mark_left") + pageData.Name + this
            //          .translateSys(
            //             "quotation_mark_right") +
            //          this.translate(
            //             "tip_no_data_last"),
            //       showCancel: false,
            //       confirmText: this.translateSys('close')
            //    });
            //    return false;
            // }
            //获取表头属性
            var head_attr = {};
            this.head_styledef.form.items.forEach(item => {
@@ -2928,38 +2921,6 @@
         flex-direction: column;
      }
      .v-head-style {
         width: 98%;
         .uni-forms-item {
            margin-bottom: 11rpx;
         }
         .input-wrapper {
            border: 1px solid #d5d5d5;
            width: 100%;
            display: flex;
            flex-direction: row;
            .uni-input {
               flex: 1;
               padding: 12rpx 8rpx;
               color: #2d8cf0;
               // height: 40rpx;
               // line-height: 40rpx;
            }
            .uni-icon {
               padding: 10rpx 5rpx;
               font-size: 32rpx;
               color: rgb(192, 196, 204);
            }
         }
         .input-wrapper:hover {
            border: 1px solid rgb(41, 121, 255);
         }
      }
      .view-content {
         display: flex;
@@ -3102,7 +3063,6 @@
            padding: 0px;
            margin: 0;
            .uni-forms-item {
               padding-bottom: 5rpx;
               margin-bottom: 0;
@@ -3111,28 +3071,7 @@
                  height: 20px !important;
                  padding: 0 10rpx 0 0 !important;
               }
               .uni-input {
                  width: calc(100% - 12rpx);
                  padding: 5rpx;
                  border: 1px solid #d5d5d5;
                  color: #2d8cf0;
                  height: 20px;
                  background: #FFF;
                  line-height: 20px;
                  border-radius: 6px !important;
                  font-size: 14px;
                  font-family: inherit;
                  box-shadow: none !important;
                  transition-duration: 0.1s;
                  vertical-align: middle;
               }
               .uni-input:hover {
                  border: 1px solid rgb(41, 121, 255);
               }
            }
         }
@@ -3254,14 +3193,6 @@
      .input-disabled {
         background-color: #f3f3f3 !important;
      }
      // ::v-deep .uni-row {
      //    margin-bottom: 0px;
      // }
      // .view-tabpage ::v-deep .uni-row {
      //    margin-bottom: 5px;
      // }
      .demo-uni-col {
         height: 36px;