cuiqian2004
2024-08-12 792a7de9550294e9ab2df42402402ef966153ff2
pages/modal/5602.vue
@@ -466,12 +466,11 @@
               dict_name: dict.name
            };
            // console.log(dataInfo);
            this.$store.dispatch('DictGetInfo', dataInfo).then(async (success) => {
               // console.log(success);
               if (success.err_code == 0) {
            try {
               const res = await this.getDictInfo(dataInfo)
                  var list = [];
                  var itemName = '';
                  success.result.dict_item_list.forEach((item) => {
               res.result.dict_item_list.forEach((item) => {
                     if (item.is_default == '1')
                        itemName = item.name;
                     list.push({
@@ -479,7 +478,7 @@
                        value: item.name,
                     });
                  });
               //有默认值,显示默认值
                  if (type == 'mast') { //有默认值,显示默认值
                     if (itemName) {
                        $this.head_styledef.form.items[index].value = itemName;
@@ -490,7 +489,7 @@
                     var head_styledef = JSON.parse(JSON.stringify($this.head_styledef));
                     $this.head_styledef = [];
                     $this.head_styledef = head_styledef;
                     // console.log($this.$data.detail1StyleDefList);
                  // console.log($this.head_styledef);
                  } else {
                     if (itemName) {
                        $this.detail1_styledef.form.items[index].value = itemName;
@@ -504,15 +503,10 @@
                     // console.log($this.$data.detail1_styledef);
                  }
               } else {
                  uni.showModal({
                     title: this.translateSys("error") + "9.1",
                     content: success.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
               }
            }).catch(ex => {
               // $this.head_styledef.form.items[index].dictitem=success.result;
               // this.$store.commit("classAttrList", $this.$data.classAttrList);
            } catch (ex) {
               // console.log(ex);
               uni.showModal({
                  title: this.translateSys("error") + "9",
@@ -520,8 +514,38 @@
                  showCancel: false,
                  confirmText: this.translateSys("cancel")
               });
            });
            }
         },
         getDictInfo(info) { //Mobox3得到得到字典信息字典项列表
            const loginInfo = this.$store.getters.loginid
            const mobxoSApi = this.$store.getters.getMobxoSApi
            return new Promise((resolve, reject) => {
               uni.request({
                  url: mobxoSApi + 'api/dict/GetInfo2?sessionid=' + loginInfo.result.session_id,
                  data: info,
                  method: 'POST',
                  dataType: "json",
                  success: (_res) => {
                     // console.log(_res);
                     const ret = _res.data
                     if (ret.err_code == 0) {
                        resolve(ret);
                     } else {
                        reject({
                           "errMsg": ret.err_msg
                        });
                     }
                  },
                  fail: (err) => {
                     // console.log(err);
                     reject(err);
                  }
               })
            })
         },
         onClick(item) {
            this.focusFieldId = item.fieldId
         },