<div class="layui-form-item">
<label class="layui-form-label">是否通过</label>
<div class="layui-input-block">
<input type="radio" name="state" value="1" title="通过" checked lay-filter="tongguo">
<input type="text" name="quota" style="width: 60%;"
placeholder="请输入发放额度" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-block">
<input type="radio" name="state" value="2" title="驳回" lay-filter="tongguo">
<input type="text" name="reason" style="width: 60%;"
placeholder="请输入拒绝理由" autocomplete="off" class="layui-input">
</div>
</div>
<div id="bohui">
<div class="layui-form-item layui-form-text kindeditor">
<label class="layui-form-label">有效期</label>
<div class="layui-inline">
<input type="text" class="layui-input"
name="expiresDate" id="expiresDate"
value=""
>
</div>
</div>
</div>
layui.use('form', function () {
var form = layui.form;
form.on('radio(tongguo)', function (data) {
// console.log(data.elem);
// alert(data.value);//判断单选框的选中值
//alert(data.othis);
// layer.tips('开关checked:' + (this.checked ? 'true' : 'false'), data.othis);
console.log(data.value);
if (data.value == 2) { // 驳回
$("#bohui").attr("class", "layui-hide");
} else if (data.value == 1) {
$("#bohui").attr("class", "");
}
});
});