cyy
2025-09-28 0f7bec66f05f5265b8c04e2d3d8157f318f80645
pages/modal/ms_classAttr.vue
@@ -1,5 +1,5 @@
<template>
   <view class="content">
   <view class="content" :class="largeMode?'large-mode':''">
      <!-- 主数据 -->
      <view class="v-area" v-for="(classattr,index) in classAttrList">
         <div class="class_attr_title" style="display: none;">
@@ -662,13 +662,16 @@
      dataObjDelele,
      dataObjRunCustomEvent
   } from "@/api/index.js"
   import {showInfo,
      showError,
      showLoading} from "@/js/Page.js"
   export default {
      components: {
         pickerAddress
      },
      data() {
         return {
               largeMode: getApp().globalData.largeMode || false,
            title: '新增',
            param: {},
            focusField: "",
@@ -707,21 +710,13 @@
         this.title = param.Add_BtnName ? param.Add_BtnName : options.titlename; //设置按钮文字
         console.log(param);
         if (!param.Master_Cls.View_Style) {
            uni.showModal({
               title: "提示",
               content: "该功能点未配置界面窗口,请重新配置!",
               showCancel: false,
               confirmText: "取消"
            });
            showInfo( "该功能点未配置界面窗口,请重新配置!")
            return;
         }
         if (!param.Master_Cls.View_Style.Name) {
            uni.showModal({
               title: "提示",
               content: "该功能点未配置窗口样式,请重新配置!",
               showCancel: false,
               confirmText: "取消"
            });
            showInfo( "该功能点未配置窗口样式,请重新配置!")
            return;
         }
         this.param = param;
@@ -771,25 +766,16 @@
               this.subClass_attr_init();
            } catch (ex) {
               console.log(ex)
               uni.showModal({
                  title: "错误1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误1")
            }
         },
         scan_classAttr_extButton(e) { //选择按钮前
            var $this = this;
            var Before_Select_Event = $this.param.Scan_Code.Before_Select_Event;
            if (!Before_Select_Event) {
               uni.showModal({
                  title: "提示",
                  content: "选择前事件为空!",
                  showCancel: false,
                  confirmText: "取消"
               });
               showInfo("选择前事件为空!")
               return;
            }
            var mast_attr = [];
@@ -799,12 +785,8 @@
               for (var j = 0; j < attr.length; j++) {
                  var ar = attr[j];
                  if (ar.Value == '请选择') {
                     uni.showModal({
                        title: "提示",
                        content: ar.DispName + "未选择数据!",
                        showCancel: false,
                        confirmText: "取消"
                     });
                     showInfo(ar.DispName + "未选择数据!")
                     return;
                  }
                  if (ar.Type == '引用对象(多个)')
@@ -859,13 +841,7 @@
                     if (ar.notempty == true && !ar.Value) {
                        // if(ar.NotEmpty=='1'){
                        uni.hideLoading();
                        // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000});
                        uni.showModal({
                           title: "提示",
                           content: ar.DispName + '不能为空!',
                           showCancel: false,
                           confirmText: "取消"
                        });
                        showInfo( ar.DispName + '不能为空!');
                        return;
                     }
                  }
@@ -951,12 +927,8 @@
            var $this = this;
            var After_Select_Event = $this.param.Scan_Code.After_Select_Event;
            if (!After_Select_Event) {
               uni.showModal({
                  title: "提示",
                  content: "选择后事件为空!",
                  showCancel: false,
                  confirmText: "取消"
               });
               showInfo("选择后事件为空!")
               return;
            }
            var items = $this.check_list.items;
@@ -974,12 +946,8 @@
               }
            }
            if (data.length == 0) {
               uni.showModal({
                  title: "提示",
                  content: "未选择数据!",
                  showCancel: false,
                  confirmText: "取消"
               });
               showInfo("未选择数据!")
               return;
            }
            var mast_attr = [];
@@ -989,12 +957,8 @@
               for (var j = 0; j < attr.length; j++) {
                  var ar = attr[j];
                  if (ar.Value == '请选择') {
                     uni.showModal({
                        title: "提示",
                        content: ar.DispName + "未选择数据!",
                        showCancel: false,
                        confirmText: "取消"
                     });
                     showInfo( ar.DispName + "未选择数据!")
                     return;
                  }
                  mast_attr.push(this.formatAttr(ar))
@@ -1048,22 +1012,13 @@
               dataObjDelele(dataInfo).then(success => {
                  uni.hideLoading();
                  $this.subPanelList.splice(index, 1);
                  uni.showModal({
                     title: "提示",
                     content: "删除成功!",
                     showCancel: false,
                     confirmText: "取消"
                  });
                  showInfo("删除成功!")
               }).catch(ex => {
                  console.log(ex);
                  uni.hideLoading();
                  uni.showModal({
                     title: "提示9.1",
                     content: ex.errMsg,
                     showCancel: false,
                     confirmText: "取消"
                  });
                  showError(ex,   "错误9.1")
               });
            }
         },
@@ -1079,16 +1034,7 @@
               return result
            } 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: "错误1.1",
                  content: tip,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误1.1")
               return []
            };
         },
@@ -1108,16 +1054,7 @@
            } 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: "错误1.2",
                  content: tip,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误1.2")
               return {}
            };
         },
@@ -1131,19 +1068,19 @@
            //console.log(e.target)
            this.focusOldField = `${e.target.dataset['index']}-${e.target.dataset['iindex']}`
            getApp().onScan((result) => {
               //console.log(result.decodedata);
               //console.log(result);
               var isVal = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
                  'iindex']].Value;
               // if(!isVal){
               //    this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result.decodedata;
               //    this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=result;
               //    var isVald =this.subPanelList[e.target.dataset['iiindex']].subClassAttr[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value;
               //    return;
               // }
               //主数据类扫码查询数据
               if (isVal != result.decodedata) {
               if (isVal != result) {
                  this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
                        'iindex']]
                     .Value = result.decodedata;
                     .Value = result;
                  uni.hideKeyboard();
                  //子数据类扫码区事件脚本
                  var eventid = this.param.Scan_Code.Input_Change_Event.ID;
@@ -1171,13 +1108,13 @@
                        mast_attr: req,
                        inputParamter: [{
                           attr: 'mast_input_3037',
                           value: result.decodedata
                           value: result
                        }]
                     }
                     this.scan_DataObjRunCustomEvent(info, "");
                  }
                  if (result.decodedata) { //第一个输入框不为空
                  if (result) { //第一个输入框不为空
                     //初始化,下个输入框focus属性
                     const attrs = this.classAttrList[e.target.dataset['index']].Attr || []
                     var findd = false
@@ -1256,15 +1193,15 @@
         subontap(e) { //扫码功能
            //console.log(e.target)
            getApp().onScan((result) => {
               //console.log(result.decodedata);
               //console.log(result);
               var isVal = this.subClassAttrList[e.target.dataset['index']].Attr[e.target
                  .dataset[
                     'iindex']].Value;
               //主数据类扫码查询数据
               if (isVal != result.decodedata) {
               if (isVal != result) {
                  this.subClassAttrList[e.target.dataset['index']].Attr[e.target.dataset[
                        'iindex']]
                     .Value = result.decodedata;
                     .Value = result;
                  uni.hideKeyboard();
                  //子数据类扫码区事件脚本
                  var eventid = this.param.Scan_Code.Input_Change_Event.ID;
@@ -1291,7 +1228,7 @@
                        mast_attr: [],
                        inputParamter: [{
                           attr: 'mast_input_3037',
                           value: result.decodedata
                           value: result
                        }]
                     }
@@ -1303,16 +1240,16 @@
         scan_ontap(e) { //扫码区扫码功能
            //console.log(e.target)
            getApp().onScan((result) => {
               console.log(result.decodedata);
               console.log(result);
               var isflag = true;
               for (var i in this.subPanelList) {
                  if (this.subPanelList[i].scanCodeVal == result.decodedata)
                  if (this.subPanelList[i].scanCodeVal == result)
                     isflag = false;
               }
               //子数据类扫码查询数据
               if (isflag) {
                  uni.hideKeyboard();
                  this.scanCodeVal = result.decodedata;
                  this.scanCodeVal = result;
                  var eventid = this.param.Scan_Code.Input_Change_Event.ID;
                  if (eventid) {
                     var mast_req = [];
@@ -1787,21 +1724,13 @@
            var before_click_button = $this.classAttrList[index].Attr[iindex].before_click_button;
            var button_callback = $this.classAttrList[index].Attr[iindex].button_callback;
            if (!before_click_button) {
               uni.showModal({
                  title: "提示",
                  content: "before_click_button-event_id为空!",
                  showCancel: false,
                  confirmText: "取消"
               });
               showInfo( "before_click_button-event_id为空!")
               return;
            }
            if (!button_callback) {
               uni.showModal({
                  title: "提示",
                  content: "button_callback-event_id为空!",
                  showCancel: false,
                  confirmText: "取消"
               });
               showInfo("button_callback-event_id为空!")
               return;
            }
            var data_attr = this.classAttrList[index].Attr[iindex];
@@ -1850,12 +1779,8 @@
         },
         classAttr_AddRef(e) {
            console.log(e.target);
            uni.showModal({
               title: "提示",
               content: "此功能还未实现!",
               showCancel: false,
               confirmText: "取消"
            });
            showInfo("此功能还未实现!")
            // var value=this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.detail.value];
            // this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value;
         },
@@ -1960,13 +1885,7 @@
                  if (ar.notempty == true && !ar.Value) {
                     // if(ar.NotEmpty=='1'){
                     uni.hideLoading();
                     // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000});
                     uni.showModal({
                        title: "提示",
                        content: ar.DispName + '不能为空!',
                        showCancel: false,
                        confirmText: "取消"
                     });
                     showInfo( ar.DispName + '不能为空!');
                     return;
                  }
               }
@@ -2002,11 +1921,8 @@
               var action = JSON.parse(data.Action);
               if (action.ret == '0') {
                  if (action.result_type == '0') {
                     uni.showToast({
                        title: action.result,
                        icon: "success",
                        duration: 3000
                     });
                     showInfo( action.result)
                  }
                  // "{"ret":0, "result_type":0, "result":"创建成功123123123","info":""}"
               }
@@ -2020,12 +1936,7 @@
            }).catch(ex => {
               console.log(ex);
               uni.hideLoading();
               uni.showModal({
                  title: "提示",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
            showError(ex,   )
            });
         },
         class_attr_init() {
@@ -2194,12 +2105,8 @@
               // console.log(this.classAttrList);
            } else {
               uni.showModal({
                  title: "提示",
                  content: "未找到可显示的的属性",
                  showCancel: false,
                  confirmText: "取消"
               });
               showInfo( "未找到可显示的的属性")
            }
         },
         subClass_attr_init() {
@@ -2353,12 +2260,8 @@
               console.log(this.subClassAttrList);
            } else {
               uni.showModal({
                  title: "提示",
                  content: "未找到可显示的的属性",
                  showCancel: false,
                  confirmText: "取消"
               });
               showInfo( "未找到可显示的的属性")
            }
         },
         ini_DataObjRunCustomEvent(info) {
@@ -2454,12 +2357,8 @@
                           }
                        }
                     } else if (action_type == 'open_select_userdlg') {
                        uni.showModal({
                           title: "错误2.2",
                           content: "open_select_userdlg这个action_type还未处理!",
                           showCancel: false,
                           confirmText: "取消"
                        });
                        showInfo("open_select_userdlg这个action_type还未处理!")
                     }
                  }
               }
@@ -2467,12 +2366,7 @@
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
                  title: "错误2.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误2.1")
            });
         },
         DataObjRunCustomEvent(info, data_attr) {
@@ -2613,12 +2507,7 @@
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
                  title: "错误3.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误3.1")
            });
         },
         OKDataObjRunCustomEvent() {
@@ -2710,12 +2599,7 @@
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
                  title: "错误4.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误4.1")
            });
         },
         DataObjRunCustomEvent_Return(eventid, data_attr, button_callback, index, iindex) {
@@ -2914,22 +2798,13 @@
                     }
                  }
               } else {
                  uni.showModal({
                     title: "提示5.2",
                     content: '调用 before_click_button 脚本返回空,event_id' + eventid,
                     showCancel: false,
                     confirmText: "取消"
                  });
                  showError('调用 before_click_button 脚本返回空,event_id' + eventid,   "错误5.2")
               }
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
                  title: "提示5.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误5.1")
            });
         },
         scan_ini_DataObjRunCustomEvent(info) {
@@ -3025,13 +2900,10 @@
                              }
                           }
                        }
                     } else if (action_type == 'open_select_userdlg') {
                        uni.showModal({
                           title: "错误6.2",
                           content: "open_select_userdlg这个action_type还未处理!",
                           showCancel: false,
                           confirmText: "取消"
                        });
                     }
                     else if (action_type == 'open_select_userdlg') {
                        showInfo("open_select_userdlg这个action_type还未处理!")
                     }
                  }
               }
@@ -3039,12 +2911,7 @@
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
                  title: "错误6.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误6.1")
            });
         },
         scan_DataObjRunCustomEvent(info, data_attr) {
@@ -3278,12 +3145,7 @@
            }).catch(ex => {
               // console.log(ex);
               uni.showModal({
                  title: "错误7.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误7.1")
            });
         },
         scan_OKDataObjRunCustomEvent(eventID) {
@@ -3323,13 +3185,7 @@
                  if (ar.notempty == true && !ar.Value) {
                     // if(ar.NotEmpty=='1'){
                     uni.hideLoading();
                     // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000});
                     uni.showModal({
                        title: "提示",
                        content: ar.DispName + '不能为空!',
                        showCancel: false,
                        confirmText: "取消"
                     });
                     showInfo(ar.DispName + '不能为空!')
                     return;
                  }
               }
@@ -3366,13 +3222,7 @@
                     if (ar.notempty == true && !ar.Value) {
                        // if(ar.NotEmpty=='1'){
                        uni.hideLoading();
                        // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000});
                        uni.showModal({
                           title: "提示",
                           content: ar.DispName + '不能为空!',
                           showCancel: false,
                           confirmText: "取消"
                        });
                        showInfo(ar.DispName + '不能为空!')
                        return;
                     }
                  }
@@ -3429,12 +3279,8 @@
            }).catch(ex => {
               // console.log(ex);
               uni.hideLoading();
               uni.showModal({
                  title: "错误8.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误8.1")
            });
         },
         scan_TriggerDataObjRunCustomEvent(eventID) {
@@ -3473,13 +3319,7 @@
                  if (ar.notempty == true && !ar.Value) {
                     // if(ar.NotEmpty=='1'){
                     uni.hideLoading();
                     // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000});
                     uni.showModal({
                        title: "提示",
                        content: ar.DispName + '不能为空!',
                        showCancel: false,
                        confirmText: "取消"
                     });
                     showInfo(ar.DispName + '不能为空!')
                     return;
                  }
               }
@@ -3516,13 +3356,8 @@
                     if (ar.notempty == true && !ar.Value) {
                        // if(ar.NotEmpty=='1'){
                        uni.hideLoading();
                        // uni.showToast({title:ar.DispName+'不能为空!',icon:"success",duration:3000});
                        uni.showModal({
                           title: "提示",
                           content: ar.DispName + '不能为空!',
                           showCancel: false,
                           confirmText: "取消"
                        });
                        showInfo(ar.DispName + '不能为空!')
                        return;
                     }
                  }
@@ -3579,12 +3414,7 @@
            }).catch(ex => {
               // console.log(ex);
               uni.hideLoading();
               uni.showModal({
                  title: "错误8.1",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: "取消"
               });
               showError(ex,   "错误8.1")
            });
         },
         formatAttr(attr) {