From e970047c7a4537810b17db3ee3c5d0a7ab4a87df Mon Sep 17 00:00:00 2001 From: Hentua <wangdoubleone@gmail.com> Date: Mon, 24 Apr 2023 10:50:19 +0800 Subject: [PATCH] fix --- src/main/resources/templates/febs/views/modules/system/hlmVoucherButton.html | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/febs/views/modules/system/hlmVoucherButton.html b/src/main/resources/templates/febs/views/modules/system/hlmVoucherButton.html index 5f441f9..bb73368 100644 --- a/src/main/resources/templates/febs/views/modules/system/hlmVoucherButton.html +++ b/src/main/resources/templates/febs/views/modules/system/hlmVoucherButton.html @@ -17,8 +17,15 @@ <div class="layui-col-lg6"> <label class="layui-form-label febs-form-item-require">需要凭证:</label> <div class="layui-input-block"> - <input type="radio" name="voucherOnOff" value="1" title="是" /> - <input type="radio" name="voucherOnOff" value="2" title="否" checked /> + <input type="radio" name="voucherOnOff" value="1" title="是" lay-filter="hasVoucher"/> + <input type="radio" name="voucherOnOff" value="2" title="否" lay-filter="hasVoucher" checked /> + </div> + </div> + + <div class="layui-form-item voucher-percent-input febs-hide"> + <label class="layui-form-label">凭证比例:</label> + <div class="layui-input-block"> + <input type="text" name="voucherPercent" placeholder="" autocomplete="off" class="layui-input"> </div> </div> <div class="layui-card-footer"> @@ -81,13 +88,26 @@ }); } + form.on('radio(hasVoucher)', function(data){ + if (data.value == 2) { + $('.voucher-percent-input').hide(); + } else { + $('.voucher-percent-input').show(); + } + }); + form.render(); function initHlmVoucherButtonValue() { form.val("hlm-voucher-button-form", { "scorePrice": hlmVoucherButton.scorePrice, "voucherOnOff": hlmVoucherButton.voucherOnOff, + "voucherPercent": hlmVoucherButton.voucherPercent, }); + + if (hlmVoucherButton.voucherOnOff == 1) { + $(".voucher-percent-input").show(); + } } form.on('submit(hlm-voucher-button-submit)', function (data) { -- Gitblit v1.9.1