From 946dae0a8885b529e7755788ba7872503d9f9d9d Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期二, 20 八月 2024 18:09:31 +0800 Subject: [PATCH] 按钮点击操作成功再有效 --- pages/modal/5601.vue | 85 +++++++++++++++++++++++++++++++++++++++--- 1 files changed, 78 insertions(+), 7 deletions(-) diff --git a/pages/modal/5601.vue b/pages/modal/5601.vue index f9e3e05..824013f 100644 --- a/pages/modal/5601.vue +++ b/pages/modal/5601.vue @@ -117,7 +117,7 @@ <button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button> <button type="primary" @tap="ok(pageData)" - class="btn_add">{{translateSys('ok')}}</button> + class="btn_add" :class="pageData.okLoading?'btn_disabled':''" :disabled="pageData.okLoading? true:false">{{translateSys('ok')}}</button> </view> </view> </swiper-item> @@ -522,7 +522,7 @@ console.log(result.decodedata); item.value = result.decodedata; var $this = this; - if (item.oldvalue != item.value) { + if (item.oldvalue != item.value&& item.value.trim() != "") { item.oldvalue = item.value; var attr = item.fieldId; this.head_styledef.form.model[attr] = item.value; @@ -610,7 +610,7 @@ onEnterChange(item) { //鍥炶溅锛岀偣鍑绘寜閽紝鍙栨秷鑺傜偣浜嬩欢 console.log(item); - if (item.oldvalue != item.value) { + if (item.oldvalue != item.value&& item.value.trim() != "") { item.oldvalue = item.value; var attr = item.fieldId; this.head_styledef.form.model[attr] = item.value; @@ -834,7 +834,7 @@ .page_name + this .translateSys( - "sys.quotation_mark_right" + "quotation_mark_right" ) + this .translate( @@ -1069,6 +1069,35 @@ ele2 .attr ) { + if (ele.name == + 'Select' && + ele2 + .choice_list + ) { + const + dictItemList = []; + const + choiceList = + ele2 + .choice_list || + []; + for (let d in + choiceList) { + const + val = + choiceList[ + d + ]; + dictItemList + .push({ + text: val, + value: val + }); + } + ele.dict = + dictItemList; + } + ele.value = ele2 .value; @@ -1092,6 +1121,38 @@ ele2 .attr ) { + if (col + .name == + 'Select' && + ele2 + .choice_list + ) { + const + dictItemList = []; + const + choiceList = + ele2 + .choice_list || + []; + for ( + let d in + choiceList + ) { + const + val = + choiceList[ + d + ]; + dictItemList + .push({ + text: val, + value: val + }); + } + col.dict = + dictItemList; + } + col.value = ele2 .value; @@ -1525,19 +1586,20 @@ uni.showModal({ title: this.translateSys("tip"), content: this.translate( - "page.tip_no_data_first") + + "tip_no_data_first") + this.translateSys( "quotation_mark_left") + pageData.Name + this .translateSys( - "sys.quotation_mark_right") + + "quotation_mark_right") + this.translate( - "page.tip_no_data_last"), + "tip_no_data_last"), showCancel: false, confirmText: this.translateSys("cancel") }); return false; } //鑾峰彇琛ㄥご灞炴� + pageData.okLoading = true var head_attr = {}; this.$data.head_styledef.form.items.forEach(item => { if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�@@ -1618,6 +1680,7 @@ }); }); if (jsonlist.length == 0) { + pageData.okLoading = false uni.showModal({ title: this.translateSys("tip"), content: this.translate("tip_no_select_data"), @@ -1909,7 +1972,9 @@ "cancel") }); } + pageParam.okLoading = false }).catch(ex => { + pageParam.okLoading = false var tip = typeof ex == "string" ? ex : ex.errMsg; uni.showModal({ title: this.translateSys("error") + "8.1", @@ -2143,8 +2208,14 @@ font-size: 38rpx; font-weight: bold; float: right; + color: #fff; display: inline-block; } + .btn_disabled { + background-color: #ddd; + color: #888; + } + } } -- Gitblit v1.9.1