| <div class="layui-fluid layui-anim febs-anim" id="hlm-voucher-button" lay-title="一键卖出"> | 
|     <div class="layui-row layui-col-space8 febs-container"> | 
|         <form class="layui-form" action="" lay-filter="hlm-voucher-button-form"> | 
|             <div class="layui-card"> | 
|                 <div class="layui-card-body"> | 
|                     <blockquote class="layui-elem-quote blue-border">绿色积分凭证</blockquote> | 
|                     <div class="layui-form-item"> | 
|                         <div class="layui-inline"> | 
|                             <label class="layui-form-label febs-form-item-require">价格:</label> | 
|                             <div class="layui-form-mid layui-word-aux">当前价格:</div> | 
|                             <div class="layui-input-inline"> | 
|                                 <input type="text" name="scorePrice" lay-verify="required" placeholder="请输入数字" autocomplete="off" class="layui-input"> | 
|                             </div> | 
|                         </div> | 
|                     </div> | 
|                     <blockquote class="layui-elem-quote blue-border">提现设置,提现时,是否需要凭证</blockquote> | 
|                     <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="是"  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"> | 
|                         <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="hlm-voucher-button-submit" id="submit">保存</button> | 
|                             <div class="layui-btn layui-btn-warm table-action" id="voucherButton"> | 
|                                 确认一键卖出 | 
|                             </div> | 
|                     </div> | 
|                     <div class="layui-card-footer"> | 
|                     </div> | 
|                 </div> | 
|             </div> | 
|         </form> | 
|     </div> | 
| </div> | 
| <style> | 
|     .layui-form-label { | 
|         width: 120px; | 
|     } | 
|   | 
|     .layui-form-item .layui-input-block { | 
|         margin-left: 150px; | 
|     } | 
|   | 
|     .layui-table-form .layui-form-item { | 
|         margin-bottom: 20px !important; | 
|     } | 
| </style> | 
|   | 
| <script data-th-inline="javascript" type="text/javascript"> | 
|     layui.use(['dropdown', 'jquery', 'febs', 'form', 'eleTree'], function () { | 
|         var $ = layui.jquery, | 
|             febs = layui.febs, | 
|             form = layui.form, | 
|             $view = $('#hlm-voucher-button'), | 
|             hlmVoucherButton = [[${hlmVoucherButtonDto}]], | 
|             $voucherButton = $view.find('#voucherButton'), | 
|             $view = $('#hlm-voucher-button'); | 
|   | 
|         form.verify({ | 
|             integer: [ | 
|                 /^[1-9]\d*$/ | 
|                 , '只能输入正整数' | 
|             ] | 
|         }); | 
|   | 
|         initHlmVoucherButtonValue(); | 
|   | 
|         $voucherButton.on('click', function () { | 
|             febs.modal.confirm('确认一键卖出', '点击【确定】,即强制卖出所有账户的一半积分凭证?', function () { | 
|                 selaHalfVoucher(); | 
|             }); | 
|         }); | 
|   | 
|   | 
|         function selaHalfVoucher() { | 
|             febs.post(ctx + 'admin/system/selaHalfVoucher', null, function (res) { | 
|                 febs.alert.success('设置成功'); | 
|                 return ; | 
|             }); | 
|         } | 
|   | 
|         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) { | 
|             febs.post(ctx + 'admin/system/hlmVoucherButton', data.field, function (res) { | 
|                 febs.alert.success('设置成功'); | 
|                 return ; | 
|             }); | 
|             return false; | 
|         }); | 
|     }); | 
| </script> |