username@email.com
2022-08-27 6e2b929cf381e2320ba6e7dec56c0371124d2b51
zhengcaioa/zhengcaioa/Views/SysCode/Editlaw.cshtml
@@ -6,12 +6,12 @@
    List<SysCodeDtl> falv = ViewData["falv"] as List<SysCodeDtl>; //法律
    List<SysCodeDtl> question = ViewData["question"] as List<SysCodeDtl>; //法律
    List<SysCodeDtlEntity> sysCodeDtlEntities = ViewData["sysCodeDtlEntities"] as List<SysCodeDtlEntity>; //法律
    List<PageEntity> ActionInfo2 = ViewData["ActionInfo2"] as List<PageEntity>;
}
@{
@@ -105,34 +105,16 @@
                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                    <div class="clearfix layer-area" style="padding-bottom:15px;">
                                        <label class="text-right col-sm-1 col-md-1 control-label">编码</label>
                                        <div class="col-sm-2 col-md-2" style="width:5%;">
                                            <input class="form-control" label="编码" id="CodeSn" name="CodeSn" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="@Model.CodeSn">
                                            <input type="hidden" name="Id" value="@Model.Id" />
                                            <input type="hidden" name="CodeId" value="@Model.CodeId" />
                                        </div>
                                    </div>
                                    <div class="clearfix layer-area" style="padding-bottom:15px;">
                                        <label class="text-right col-sm-1 col-md-1 control-label">法律名称</label>
                                        <label class="text-right col-sm-1 col-md-1 control-label">质疑事项</label>
                                        <div class="col-sm-10 col-md-10">
                                            @*<input class="form-control" label="法律名称" id="Comments" name="Comments" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="100" ismust="true" type="text" value="@Model.Comments">*@
                                            <select id="Comments" class="form-control" name="Comments" data-placeholder="选择 序列 ...">
                                            <select id="Classify1" class="form-control" name="Classify1" data-placeholder="选择 序列 ...">
                                                <option value="" hassubinfo="true">请选择</option>
                                                @foreach (var item in falv)
                                                @foreach (var item in question)
                                                {
                                                    @if (!item.CodeSn.Equals(Model.Comments))
                                                    @if (!item.CodeSn.Equals(Model.Classify1))
                                                    {
                                                        <option value="@item.CodeSn" hassubinfo="true">
                                                            @item.Comments
@@ -148,44 +130,119 @@
                                                }
                                                }
                                            </select>
                                            <input type="hidden" name="CodeId" value="@Model.CodeId" />
                                        </div>
                                    </div>
                                    <div class="clearfix layer-area" style="padding-bottom:15px;display:none;">
                                        <label class="text-right col-sm-1 col-md-1 control-label">排序</label>
                                        <div class="col-sm-2 col-md-2" style="width:5%;">
                                            <input class="form-control" label="排序" id="Sort" name="Sort" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="flase" type="text" value="@Model.Sort" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                        </div>
                                    <div id="addlist_2">
                                        @for (int i = 0; i < sysCodeDtlEntities.Count; i++)
                                        {
                                            <div class="fatiaomeirong">
                                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                                    <label class="text-right col-sm-1 col-md-1 control-label">编码</label>
                                                    <div class="col-sm-2 col-md-2" style="width:5%;">
                                                        <input class="form-control" label="编码" name="CodeSns" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="@sysCodeDtlEntities[i].CodeSn">
                                                        <input type="hidden" name="Id" value="@Model.Id" />
                                                    </div>
                                                </div>
                                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                                    <label class="text-right col-sm-1 col-md-1 control-label">法律名称</label>
                                                    <div class="col-sm-10 col-md-10">
                                                        @*<input class="form-control" label="法律名称" id="Comments" name="Comments" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="100" ismust="true" type="text" value="@Model.Comments">*@
                                                        <select class="form-control" name="Commentss" data-placeholder="选择 序列 ...">
                                                            <option value="" hassubinfo="true">请选择</option>
                                                            @foreach (var item in falv)
                                                            {
                                                                @if (!item.CodeSn.Equals(sysCodeDtlEntities[i].Comments))
                                                                {
                                                                    <option value="@item.CodeSn" hassubinfo="true">
                                                                        @item.Comments
                                                                    </option>
                                                                }
                                                                else
                                                                {
                                                                    <option value="@item.CodeSn" hassubinfo="true" selected="selected">
                                                                        @item.Comments
                                                                    </option>
                                                                }
                                                            }
                                                            }
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                                    <label class="text-right col-sm-1 col-md-1 control-label">法条</label>
                                                    <div class="col-sm-2 col-md-2">
                                                        <input class="form-control" label="法条" name="Classify2s" labtype="txt" addvisible="true" editvisible="true" maxlength="50" reg="" ismust="flase" type="text" value="@sysCodeDtlEntities[i].Classify2">
                                                    </div>
                                                </div>
                                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                                    <label class="text-right col-sm-1 col-md-1 control-label">内容</label>
                                                    <div class="col-sm-10 col-md-10">
                                                        @*<input class="form-control" label="内容" id="Contents" name="Contents" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="300" ismust="true" type="text" value="@Model.Contents">*@
                                                        <textarea class="form-control bt" name="Contentss" title="内容" isempty="" maxlength="300" length="long" style="resize:none;overflow-y:hidden; min-height:60px;" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'">@sysCodeDtlEntities[i].Contents</textarea>
                                                    </div>
                                                </div>
                                                <div class="clearfix layer-area" style="padding-bottom:15px;display:none;">
                                                    <label class="text-right col-sm-1 col-md-1 control-label">排序</label>
                                                    <div class="col-sm-2 col-md-2" style="width:5%;">
                                                        <input class="form-control" label="排序" name="Sorts" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="flase" type="text" value="@sysCodeDtlEntities[i].Sort" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                                    </div>
                                                </div>
                                            </div>
                                        }
                                    </div>
                                    <div class="clearfix layer-area" style="padding-bottom:15px;">
                                        <label class="text-right col-sm-1 col-md-1 control-label">内容</label>
                                        <div class="col-sm-10 col-md-10">
                                            @*<input class="form-control" label="内容" id="Contents" name="Contents" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="300" ismust="true" type="text" value="@Model.Contents">*@
                                            <textarea class="form-control bt" id="Contents" name="Contents" title="内容" isempty="" maxlength="450" length="long" style="resize:none;overflow-y:hidden; min-height:60px;" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'">@Model.Contents</textarea>
                                        <div class="col-sm-1 col-md-1">
                                            <button type="button" class="addBtn" onclick="addBtn(this)" data-type="2" style="width:32px">+</button>
                                            <button type="button" class="delBtn" onclick="delBtn(this)" data-type="2" style="width:32px">-</button>
                                        </div>
                                    </div>
                                    </div>
                                </div>
                                    </div>
@@ -198,15 +255,15 @@
        <div class="wrapper wrapper-content" style="margin-top:0px"></div>
        <div class="ibox-content" id="top" style="z-index:100; position:fixed; height:50px; width:100%;bottom:0; text-align: right; padding-top:8px ">
            <div class="" style="float:right;" data-bootstro-width="500px" data-bootstro-content="功能按钮:“保存”,“删除”">
                <a class="btn btn-success" href="javascript:void(0)" onclick="delPosition();" style="margin-left:4px; border-radius:4px;">
                @*<a class="btn btn-success" href="javascript:void(0)" onclick="delPosition();" style="margin-left:4px; border-radius:4px;">
                    <i class="glyphicon glyphicon-remove"></i>&nbsp;&nbsp;<span class="bold">删除</span>
                </a>
                </a>*@
                <a class="btn btn-success" href="javascript:void(0)" onclick="savePosition();" style="margin-left:4px; border-radius:4px;">
                <a class="btn btn-success Delete" href="javascript:void(0)" onclick="savePosition();" style="margin-left:4px; border-radius:4px;display:none;">
                    <i class="glyphicon glyphicon-ok"></i>&nbsp;&nbsp;<span class="bold">提交</span>
                </a>
                <a class="btn btn-success" href="javascript:void(0)" onclick="closepage();" style="margin-left:4px; border-radius:4px;">
                <a class="btn btn-success Update" href="javascript:void(0)" onclick="closepage();" style="margin-left: 4px; border-radius: 4px; display: none;">
                    <i class="glyphicon glyphicon-remove"></i>&nbsp;&nbsp;<span class="bold">关闭</span>
                </a>
            </div>
@@ -220,9 +277,14 @@
        var hh = document.body.clientHeight - $('.ibox-title').height() - $("#top").height() * 2;
        $("#div_content").height(hh);
        var Contents = document.getElementById("Contents");
        Contents.style.height = Contents.scrollHeight + 'px';
        var Contentss = document.getElementsByName("Contentss");
        for (var a = 0; a < Contentss.length; a++) {
            Contentss[a].style.height = Contentss[a].scrollHeight + 'px';
        }
        toastr.options = {
            "closeButton": true,
@@ -298,25 +360,28 @@
            if ($.trim($("#CodeSn").val()) == '') {
                toastr.warning("编码不能为空");
            //if ($.trim($("#CodeSn").val()) == '') {
            //    toastr.warning("编码不能为空");
            //    return;
            //}
            //if ($.trim($("#Comments").val()) == '') {
            //    toastr.warning("法律名称不能为空");
            //    return;
            //}
            if ($.trim($("#Classify1").val()) == '') {
                toastr.warning("质疑事项不能为空");
                return;
            }
            if ($.trim($("#Comments").val()) == '') {
                toastr.warning("法律名称不能为空");
                return;
            }
           // var data = { id: $("#Id").val(), DocType: $("#DocType").val(), DocDept: $("#DocDept").val(), PublishTime: $("#PublishTime").val(), DocNo: $("#DocNo").val(), DocTitle: $("#DocTitle").val(), DocContent: ueue, DocZtc: $("#DocZtc").val(), Printtimes: $("#Printtimes").val(), DocCsdw: $("#DocCsdw").val(), PrintStatus: $("#PrintStatus").val()}
            $.ajax({
                type: "POST",
                url: "/SysCode/Savequestiontype",
                url: "/SysCode/Savequestiontypes",
                dataType: "json",
                global: false,
                data: $('form').serializeArray(),
@@ -366,6 +431,98 @@
        }
         function addBtn(obj) {
            var oTr = document.createElement('div');
            var num = $(obj).data().type;
            console.log(num)
            if (num == 2) {
                $('#addlist_2').append(oTr);
                $(oTr).html(` <div class="fatiaomeirong" >
  <div class="clearfix layer-area" style="padding-bottom:15px;">
                                                <label class="text-right col-sm-1 col-md-1 control-label">编码</label>
                                                <div class="col-sm-2 col-md-2" style="width:5%;">
                                                    <input class="form-control" label="编码"  name="CodeSns" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="">
                                                    <input type="hidden" name="Id" value="" />
                                                </div>
                                            </div>
                                            <div class="clearfix layer-area" style="padding-bottom:15px;">
                                                <label class="text-right col-sm-1 col-md-1 control-label">法律名称</label>
                                                <div class="col-sm-10 col-md-10">
                                                    <select  class="form-control" name="Commentss" data-placeholder="选择 序列 ...">
                                                        <option value="" hassubinfo="true">请选择</option>
                                                        @foreach (var item in falv)
                                                        {
                                                                <option value="@item.CodeSn" hassubinfo="true">
                                                                    @item.Comments
                                                                </option>
                                                        }
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="clearfix layer-area" style="padding-bottom:15px;">
                                                <label class="text-right col-sm-1 col-md-1 control-label">法条</label>
                                                <div class="col-sm-2 col-md-2">
                                                    <input class="form-control" label="法条" name="Classify2s" labtype="txt" addvisible="true" editvisible="true" maxlength="50" reg="" ismust="flase" type="text" value="">
                                                </div>
                                            </div>
                                            <div class="clearfix layer-area" style="padding-bottom:15px;">
                                                <label class="text-right col-sm-1 col-md-1 control-label">内容</label>
                                                <div class="col-sm-10 col-md-10">
                                                    <textarea class="form-control bt"  name="Contentss" title="内容" isempty="" maxlength="500" length="long" style="resize:none;overflow-y:hidden; min-height:60px;" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'"></textarea>
                                                </div>
                                            </div>
                                            <div class="clearfix layer-area" style="padding-bottom:15px;display:none;">
                                                <label class="text-right col-sm-1 col-md-1 control-label">排序</label>
                                                <div class="col-sm-2 col-md-2" style="width:5%;">
                                                    <input class="form-control" label="排序"  name="Sorts" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="flase" type="text" value="1" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                                </div>
                                            </div>
   </div>
`);
            }
        }
        function delBtn(obj) {
            var num = $(obj).data().type;
            console.log(num)
             if (num == 2) {
                if ($('#addlist_2').find('.fatiaomeirong').length > 1) {
                    $('#addlist_2').find('.fatiaomeirong:last').remove();
                }
            }
        }
         var ActionInfo22 = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ActionInfo2))';
        $(function () {
            var data = JSON.parse(ActionInfo22);
            for (var o in data) {
                $("." + data[o].PageShortcut).show();
            }
        });
    </script>
</body>
</html>