From 41e6159cfa12416155adcd6747e48fab28ffc534 Mon Sep 17 00:00:00 2001 From: cyy <cuiqian2004@163.com> Date: 星期一, 26 八月 2024 22:45:17 +0800 Subject: [PATCH] test --- pages/modal/3200.vue | 156 ++++++++++++++++++++++++++++++++++----------------- 1 files changed, 103 insertions(+), 53 deletions(-) diff --git a/pages/modal/3200.vue b/pages/modal/3200.vue index 1df943b..d794f70 100644 --- a/pages/modal/3200.vue +++ b/pages/modal/3200.vue @@ -400,6 +400,7 @@ this.pageindex = 1; this.page_size = 3; this.query_id = ""; + this.detail1StyleDefList = []; await this.loadDataGetList(); } @@ -562,45 +563,34 @@ dict_id: dict.id, dict_name: dict.name }; - // console.log(dataInfo); - this.$store.dispatch('DictGetInfo', dataInfo).then(async (success) => { - console.log(success); - if (success.err_code == 0) { - if (type == 'mast') { - var list = []; - var itemName = ''; - success.result.dict_item_list.forEach((item) => { - if (item.is_default == '1') - itemName = item.name; - list.push({ - text: item.value, - value: item.name, - }); + try { + const success = await this.getDictInfo(dataInfo) + if (type == 'mast') { + var list = []; + var itemName = ''; + success.result.dict_item_list.forEach((item) => { + if (item.is_default == '1') + itemName = item.name; + list.push({ + text: item.value, + value: item.name, }); - //鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ� - if (itemName) { - $this.head_styledef.form.items[index].value = itemName; - var attr = $this.head_styledef.form.items[index].fieldId; - $this.head_styledef.form.model[attr] = itemName; - } - $this.head_styledef.form.items[index].dict = list; - var head_styledef = JSON.parse(JSON.stringify($this.head_styledef)); - $this.head_styledef = []; - $this.head_styledef = head_styledef; - } else { - // $this.$data.subClassAttrList[index].attr_list[key].dictitem=success.result; - // this.$store.commit("subClassAttrList", $this.$data.subClassAttrList); - } - - } else { - uni.showModal({ - title: this.translateSys("error") + "3.1", - content: success.err_msg, - showCancel: false, - confirmText: this.translateSys("cancel") }); + //鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ� + if (itemName) { + $this.head_styledef.form.items[index].value = itemName; + var attr = $this.head_styledef.form.items[index].fieldId; + $this.head_styledef.form.model[attr] = itemName; + } + $this.head_styledef.form.items[index].dict = list; + var head_styledef = JSON.parse(JSON.stringify($this.head_styledef)); + $this.head_styledef = []; + $this.head_styledef = head_styledef; + } else { + // $this.$data.subClassAttrList[index].attr_list[key].dictitem=success.result; + // this.$store.commit("subClassAttrList", $this.$data.subClassAttrList); } - }).catch(ex => { + } catch (ex) { // console.log(ex); uni.showModal({ title: this.translateSys("error") + "3", @@ -608,7 +598,66 @@ 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); + } + }) + + }) + + }, +getUIStyleInfo(info) { //Mobox3鏁版嵁绫荤晫闈㈡牱寮�+ const loginInfo = this.$store.getters.loginid + const dataSApi = this.$store.getters.getDataSApi + return new Promise((resolve, reject) => { + uni.request({ + url: dataSApi + 'api/class/uistyle/GetInfo?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); + } + }) + + }) + }, // 鎵ц鏌ヨ浜嬩欢 @@ -1226,31 +1275,32 @@ }, //璺宠浆 async RelatedFunction(btn, style, enviroment) { - + const defCode = btn.Related_Function?.Def_Code + var $this = this; if ( - btn.Related_Function?.Def_Code == "3018" || - btn.Related_Function?.Def_Code == "3037" || - btn.Related_Function?.Def_Code == "3200" || - btn.Related_Function?.Def_Code == "3201" || - btn.Related_Function?.Def_Code == "5600" || - btn.Related_Function?.Def_Code == "5601" || - btn.Related_Function?.Def_Code == "5602" + defCode == "3018" || + defCode == "3037" || + defCode == "3200" || + defCode == "3201" || + defCode == "5600" || + defCode == "5601" || + defCode == "5602" ) { - let name = btn.Related_Function?.Def_Code - if (btn.Related_Function?.Def_Code == "3018" || btn.Related_Function?.Def_Code == "3037") - name = btn.Related_Function?.Def_Code + "_2" - var $this = this; + let name = defCode + if (defCode == "3018" || defCode == "3037") + name = defCode + "_2" var json = { - app_id: appId, + app_id: [btn.Related_Function.ID], }; + console.log("RelatedFunction2", json); this.$store.dispatch('appGetInfo', json).then(success => { - // console.log(success); + console.log(success); if (success.err_code == 0) { if ((success.result || []).length > 0) { const app = success.result[0] var param = ""; - var appName = app.list_name || app.name + var appName = app.list_name || app.name .Name; var paramStr = app.param if (paramStr) { @@ -1298,7 +1348,7 @@ }); } }).catch(ex => { - // console.log(ex); + console.log(ex); uni.showModal({ title: this.translateSys("error"), content: ex.errMsg, -- Gitblit v1.9.1