jquery获取id绑定click点击事件并弹窗

41 阅读1分钟
$(document).on('click','#roleId',function(e){
            console.log('eeeeeeeeeeeeeee=:',e)
            dialog.modal({
                title: "审批",
                content: `<form id="approvalOpinion" style="margin-left:79px"><div class="flow-input">
                            <div class="form-inline" style="margin-top:15px;">
                                <div class="form-group">
                                <label class="form-label" style="display:inline-block;vertical-align: baseline;width:110px;line-height:28px;text-align:right;color:#666666;width:200px">审核处理:
                                <label><input name="seqFlowId" type="radio" value="1" data-val="通过" class="input-radio" checked/>通过</label>
                                <label><input name="seqFlowId" type="radio" value="0" data-val="驳回" class="input-radio"/>驳回</label>
                                </label></div></div>
                                </div>
                                <div class="form-inline mt15"><div class="form-group">
                                    <label class="form-label" style="width:100px;">
                                        <span style="color:#CC0000;">*</span>意见:
                                    </label>
                                    <textarea class="form-textarea textInput" name="comment" width="600" height="70" style="margin-left:6px;" placeholder="请输入意见"></textarea>
                                </div>
                            </div>
                        </form>`,
                type: "red",
                width: "600",
                height: "300",
                btn: ['确定', '取消']
            }, function (index) {
                $('textarea[name=comment]').attr('required')
                if ($('textarea[name=comment]').val() == '') {
                    layer.msg('请输入审批意见')
                    return
                } else {
                    layer.close(index);
                }
            }, function (index) {
            }, function () {
            });
        })