username@email.com
2021-12-07 e5d50b0415bef5e93c10b2bfbca98d377d3cad04
zhengcaioa/zhengcaioa/Views/Expert/Edit.cshtml
@@ -8,6 +8,8 @@
    List<SysCodeDtl> InfoSource = ViewData["InfoSource"] as List<SysCodeDtl>; //客户来源
    List<SysCodeDtl> expertType = ViewData["expertType"] as List<SysCodeDtl>; //专家类型
    List<SysCodeDtl> level = ViewData["level"] as List<SysCodeDtl>; //专家等级
    List<SysCodeDtl> ReviewItem = ViewData["ReviewItem"] as List<SysCodeDtl>; //评审品目
    List<SysCodeDtl> YearJiou = ViewData["YearJiou"] as List<SysCodeDtl>; //考试时间
}
@{
    Layout = null;
@@ -27,7 +29,7 @@
    @*<link href="~/css/plugins/iCheck/custom.css" rel="stylesheet">*@
    <link href="~/css/style.min.css" rel="stylesheet">
    <link href="~/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="~/css/plugins/chosen/chosen.css?v=7" rel="stylesheet">
    @*<link href="~/js/plugins/layer/skin/layer.css" rel="stylesheet">*@
    @*<link href="~/css/plugins/datapicker/datepicker3.css" rel="stylesheet">*@
    <link href="~/css/style.min.css" rel="stylesheet">
@@ -99,7 +101,7 @@
    @*<script language="javascript" src="~/js/datehelper.js" type="text/javascript"></script>*@
    @*<script language="javascript" src="~/js/plugins/query/jquery.query-object.js" type="text/javascript"></script>*@
    @*<script language="javascript" src="~/js/plugins/iCheck/icheck.min.js" type="text/javascript"></script>*@
    <script language="javascript" src="~/js/plugins/chosen/chosen.jquery.js" type="text/javascript"></script>
    <script language="javascript" src="~/js/chosen_v1.8.7/chosen.jquery.js" type="text/javascript"></script>
    @*<script language="javascript" src="~/js/plugins/datapicker/bootstrap-datepicker.js" type="text/javascript"></script>*@
    <script language="javascript" src="~/js/plugins/layer/layer.js" type="text/javascript"></script>
    @*<script src="~/js/plugins/jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script>*@
@@ -182,21 +184,21 @@
                                    <div class="col-sm-2 col-md-2">
                                        <input class="form-control" label="详细地址" name="Name" id="Name" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="true" type="text" value="@Model.Name" autocomplete="off">
                                    </div>
                                    <label class="text-right col-sm-1 col-md-1 control-label">性别<i class="red">*</i></label>
                                    <label class="text-right col-sm-1 col-md-1 control-label">性别</label>
                                    <div class="col-sm-2 col-sm-2" grouptype="Vdata">
                                        <select id="Sex" class="form-control" name="Sex" data-placeholder="选择 序列 ..." style="font-weight:normal;">
                                            <option value="" hassubinfo="true">请选择</option>
                                            @foreach (var item in Sex)
                                            {
                                                @if (!item.CodeId.Equals(Model.Sex))
                                                @if (!item.CodeSn.Equals(Model.Sex))
                                                {
                                                    <option value="@item.CodeId" hassubinfo="true">
                                                    <option value="@item.CodeSn" hassubinfo="true">
                                                        @item.Comments
                                                    </option>
                                                }
                                                else
                                                {
                                                    <option value="@item.CodeId" hassubinfo="true" selected="selected">
                                                    <option value="@item.CodeSn" hassubinfo="true" selected="selected">
                                                        @item.Comments
                                                    </option>
                                                }
@@ -210,7 +212,36 @@
                                </div>
                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                    <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">评审品目</label>
                                    <div class="col-sm-11 col-md-11" grouptype="Vdata">
                                        <select id="ReviewItem" class="form-control" name="ReviewItem" multiple data-placeholder="选择 序列 ...">
                                            <option value="" hassubinfo="true">请选择</option>
                                            @foreach (var item in ReviewItem)
                                            {
                                                @if (Model.ReviewItem != null && Model.ReviewItem.Split(',').Contains(item.CodeSn))
                                                {
                                                    <option value="@item.CodeSn" hassubinfo="true" selected="selected">
                                                        @item.Comments
                                                    </option>
                                                }
                                                else
                                                {
                                                    <option value="@item.CodeSn" hassubinfo="true">
                                                        @item.Comments
                                                    </option>
                                                }
                                            }
                                        </select>
                                    </div>
                                </div>
                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                    <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">专家级别<i class="red">*</i></label>
@@ -233,7 +264,7 @@
                                                }
                                            }
                                            }
                                        </select>
@@ -241,20 +272,43 @@
                                    <label class="text-right col-sm-1 col-md-1 control-label">身份证号</label>
                                    <div class="col-sm-2 col-md-2" grouptype="Vdata">
                                        <input class="form-control" label="身份证号" name="IdCard" id="IdCard" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="true" type="text" value="@Model.IdCard" autocomplete="off">
                                        <input class="form-control" label="身份证号" name="IdCard" id="IdCard" labtype="txt" addvisible="true" editvisible="true" maxlength="18" reg="" ismust="true" type="text" value="@Model.IdCard" autocomplete="off">
                                    </div>
                                    <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">专家证号<i class="red">*</i></label>
                                    <div class="col-sm-2 col-md-2" grouptype="Vdata">
                                        <input class="form-control" label="专家证号" name="CertiNumber" id="CertiNumber" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="true" type="text" value="@Model.CertiNumber">
                                    </div>
                                    <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">评审品目<i class="red">*</i></label>
                                    <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">考试时间</label>
                                    <div class="col-sm-2 col-md-2" grouptype="Vdata">
                                        <input class="form-control" label="评审品目" name="ReviewItem" id="ReviewItem" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="true" type="text" value="@Model.ReviewItem" autocomplete="off">
                                        <select id="YearJiou" class="form-control" name="YearJiou" data-placeholder="选择 序列 ...">
                                            <option value="" hassubinfo="true">请选择</option>
                                            @foreach (var item in YearJiou)
                                            {
                                                @if (!item.CodeSn.Equals(Model.YearJiou))
                                                {
                                                    <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;">
@@ -265,7 +319,7 @@
                                    <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">所属区域</label>
                                    <div class="col-sm-2 col-md-2">
                                        <div style="width:120px;float:left;">
                                        <div style="width:110px;float:left;">
                                            <select id="Province" class="form-control" name="Province" data-placeholder="选择 序列 ..." style="font-weight:normal;">
                                                <option value="" hassubinfo="true">请选择</option>
                                                @foreach (var item in Province)
@@ -288,7 +342,7 @@
                                            </select>
                                        </div>
                                        <div style="width:120px;float:left;">
                                        <div style="width:110px;float:left;">
                                            <select id="City" class="form-control" name="City" data-placeholder="选择 序列 ..." style="font-weight:normal;">
                                                <option value="" hassubinfo="true">请选择</option>
                                                @foreach (var item in City)
@@ -323,14 +377,14 @@
                                </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">联系电话1<i class="red">*</i></label>
                                    <div class="col-sm-2 col-md-2">
                                        <input class="form-control" label="联系电话" name="Phone1" id="Phone1" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="true" type="text" value="@Model.Phone1" autocomplete="off">
                                        <input class="form-control" label="联系电话1" name="Phone1" id="Phone1" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="true" type="text" value="@Model.Phone1" autocomplete="off">
                                    </div>
                                    <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">联系电话2</label>
                                    <div class="col-sm-2 col-md-2">
                                        <input class="form-control" label="联系电话" name="Phone2" id="Phone2" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="true" type="text" value="@Model.Phone2" autocomplete="off">
                                        <input class="form-control" label="联系电话2" name="Phone2" id="Phone2" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="true" type="text" value="@Model.Phone2" autocomplete="off">
                                    </div>
                                    <label class="text-right col-sm-1 col-md-1 control-label">QQ</label>
@@ -406,10 +460,10 @@
                                        <p>上传职称证书</p>
                                    </div>
                                    @*</div>
        <div class="clearfix layer-area" style="padding-bottom:15px;">
            <div class="col-sm-1 col-md-1 img-row">
            <div class="clearfix layer-area" style="padding-bottom:15px;">
                <div class="col-sm-1 col-md-1 img-row">
            </div>*@
                </div>*@
                                    <div class="col-sm-2 col-md-2 img-box">
                                        <div id="TitileImg5" class="TitileImg5"></div>
                                        <input type="hidden" id="TitileCerti5" name="TitileCerti5" value="@Model.TitileCerti5" />
@@ -447,9 +501,9 @@
                                <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-6 col-md-6">
                                        <textarea id="Remark" name="Remark" style="overflow-y:hidden" cols="100" rows="10">@Model.Remark </textarea>
                                    <label class="text-right col-sm-1 col-md-1 control-label">专家简介</label>
                                    <div class="col-sm-11 col-md-11">
                                        <textarea id="Remark" name="Remark" class="form-control bt" style="resize:none;overflow-y:hidden; min-height:80px;" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'">@Model.Remark </textarea>
                                    </div>
                                </div>
@@ -511,7 +565,9 @@
        }
        var Remark = document.getElementById("Remark");
        Remark.style.height = Remark.scrollHeight + 'px';
        var imgPath = "@Url.Content("~/UploadFile/")";
@@ -537,6 +593,7 @@
                imgs.TitileImg = imgUploadCallback(files);
                if (imgs.TitileImg !== "") {
                    $("#TitileCerti").val(imgPath + imgs.TitileImg);
                    $("#TitileCerti1").parent().show();
                }
            }
@@ -544,8 +601,9 @@
        new DragImgUpload("#TitileImg1", {
            callback: function (files) {
                imgs.TitileImg1 = imgUploadCallback(files);
                if (imgs.TitileImg1!== "") {
                if (imgs.TitileImg1 !== "") {
                    $("#TitileCerti1").val(imgPath + imgs.TitileImg1);
                    $("#TitileCerti2").parent().show();
                }
            }
@@ -555,6 +613,7 @@
                imgs.TitileImg2 = imgUploadCallback(files);
                if (imgs.TitileImg2 !== "") {
                    $("#TitileCerti2").val(imgPath + imgs.TitileImg2);
                    $("#TitileCerti3").parent().show();
                }
            }
@@ -564,6 +623,7 @@
                imgs.TitileImg3 = imgUploadCallback(files);
                if (imgs.TitileImg3 !== "") {
                    $("#TitileCerti3").val(imgPath + imgs.TitileImg3);
                    $("#TitileCerti4").parent().show();
                }
            }
@@ -573,6 +633,7 @@
                imgs.TitileImg4 = imgUploadCallback(files);
                if (imgs.TitileImg4 !== "") {
                    $("#TitileCerti4").val(imgPath + imgs.TitileImg4);
                    $("#TitileCerti5").parent().show();
                }
            }
@@ -582,6 +643,7 @@
                imgs.TitileImg5 = imgUploadCallback(files);
                if (imgs.TitileImg5 !== "") {
                    $("#TitileCerti5").val(imgPath + imgs.TitileImg5);
                    $("#TitileCerti6").parent().show();
                }
            }
@@ -591,6 +653,7 @@
                imgs.TitileImg6 = imgUploadCallback(files);
                if (imgs.TitileImg6 !== "") {
                    $("#TitileCerti6").val(imgPath + imgs.TitileImg6);
                    $("#TitileCerti7").parent().show();
                }
            }
@@ -600,6 +663,7 @@
                imgs.TitileImg7 = imgUploadCallback(files);
                if (imgs.TitileImg7 !== "") {
                    $("#TitileCerti7").val(imgPath + imgs.TitileImg7);
                    $("#TitileCerti8").parent().show();
                }
            }
@@ -609,6 +673,7 @@
                imgs.TitileImg8 = imgUploadCallback(files);
                if (imgs.TitileImg8 !== "") {
                    $("#TitileCerti8").val(imgPath + imgs.TitileImg8);
                    $("#TitileCerti9").parent().show();
                }
            }
@@ -618,6 +683,7 @@
                imgs.TitileImg9 = imgUploadCallback(files);
                if (imgs.TitileImg9 !== "") {
                    $("#TitileCerti9").val(imgPath + imgs.TitileImg9);
                    $("#TitileCerti10").parent().show();
                }
            }
@@ -633,7 +699,16 @@
        });
        $(function () {
            $("#TitileCerti1").parent().hide();
            $("#TitileCerti2").parent().hide();
            $("#TitileCerti3").parent().hide();
            $("#TitileCerti4").parent().hide();
            $("#TitileCerti5").parent().hide();
            $("#TitileCerti6").parent().hide();
            $("#TitileCerti7").parent().hide();
            $("#TitileCerti8").parent().hide();
            $("#TitileCerti9").parent().hide();
            $("#TitileCerti10").parent().hide();
            imgs.frontImg = $.trim( $("#CertiFont").val() );
            imgs.BackImg = $.trim( $("#CertiBack").val());
@@ -666,60 +741,70 @@
                $("#TitileImg img").each(function (i) {
                    $(this).attr("src", imgs.TitileImg);
                });
                $("#TitileCerti1").parent().show();
            }
            if (imgs.TitileImg1 !== "") {
                $("#TitileImg1 img").each(function (i) {
                    $(this).attr("src", imgs.TitileImg1);
                });
                $("#TitileCerti2").parent().show();
            }
            if (imgs.TitileImg2 !== "") {
                $("#TitileImg2 img").each(function (i) {
                    $(this).attr("src", imgs.TitileImg2);
                });
                $("#TitileCerti3").parent().show();
            }
            if (imgs.TitileImg3 !== "") {
                $("#TitileImg3 img").each(function (i) {
                    $(this).attr("src", imgs.TitileImg3);
                });
                $("#TitileCerti4").parent().show();
            }
            if (imgs.TitileImg4 !== "") {
                $("#TitileImg4 img").each(function (i) {
                    $(this).attr("src", imgs.TitileImg4);
                });
                $("#TitileCerti5").parent().show();
            }
            if (imgs.TitileImg5 !== "") {
                $("#TitileImg5 img").each(function (i) {
                    $(this).attr("src", imgs.TitileImg5);
                });
                $("#TitileCerti6").parent().show();
            }
            if (imgs.TitileImg6 !== "") {
                $("#TitileImg6 img").each(function (i) {
                    $(this).attr("src", imgs.TitileImg6);
                });
                $("#TitileCerti7").parent().show();
            }
            if (imgs.TitileImg7 !== "") {
                $("#TitileImg7 img").each(function (i) {
                    $(this).attr("src", imgs.TitileImg7);
                });
                $("#TitileCerti8").parent().show();
            }
            if (imgs.TitileImg8 !== "") {
                $("#TitileImg8 img").each(function (i) {
                    $(this).attr("src", imgs.TitileImg8);
                });
                $("#TitileCerti9").parent().show();
            }
            if (imgs.TitileImg9 !== "") {
                $("#TitileImg9 img").each(function (i) {
                    $(this).attr("src", imgs.TitileImg9);
                });
                $("#TitileCerti10").parent().show();
            }
            if (imgs.TitileImg10 !== "") {
@@ -728,7 +813,13 @@
                });
            }
            $("#ReviewItem").chosen({
                hide_results_on_select: false
            });
        });
@@ -810,7 +901,7 @@
        // 保存岗位信息
        var saveExpert = function () {
            if ($("#InfoSource").val() == '') {
                toastr.warning("客户来源不能为空");
                toastr.warning("信息来源不能为空");
                return;
            }
            if ($("#ExpertType").val() == '') {
@@ -821,27 +912,27 @@
                toastr.warning("专家姓名不能为空");
                return;
            };
            if (Verify.isNull($("#Province").val()) || Verify.isNull($("#City").val()) ) {
                toastr.warning("区域不能为空");
            if ($.trim($("#Phone1").val()) == '') {
                toastr.warning("联系电话不能为空");
                return;
            }
            if ($("#IdCard").val() == '') {
                toastr.warning("身份证号不能为空");
            if ($.trim($("#CertiNumber").val()) == '' || $.trim($("#CertiNumber").val()) == 'SC') {
                toastr.warning("专家证号不能为空");
                return;
            }
            if ($.trim($("#ReviewItem").val()) == '') {
                toastr.warning("评审项目不能为空");
                return;
            }
            //if ($.trim($("#ReviewItem").val()) == '') {
            //    toastr.warning("评审项目不能为空");
            //    return;
            //}
           
            //var data = { id: $("#Id").val(), StartTime:$("#StartTime").val(), Sheng: $("#Sheng").val(), job_level: $("#Job_level").val().toString(), ExistsAttachment: fileId != "" }
            $.ajax({
                type: "POST",
                url: "/Expert/Save",
                url: "/Expert/Save?ReviewItemSelect=" + $("#ReviewItem").val(),
                dataType: "json",
                global: false,
                data: $('form').serializeArray(),
@@ -859,7 +950,9 @@
                                _pageAutoClose();//自动关闭页面方法
                            }
                            catch (err) {
                                parent._CloseTab1("/Expert/Edit/");
                                window.location = "/Expert/Edit?Province=" + $("#Province").val() + "&City=" + $("#City").val();
                                //parent._CloseTab1("/Expert/Edit/");
                            }
                        }
@@ -918,7 +1011,7 @@
            var city = $.trim($("#City").find("option:selected").text());
            var Address = $("#Address");
            Address.val(sheng + city + AreaId.replace("请选择", ""));
            Address.val(sheng + city );
        }
        if ($("#Id").val() == '') {
@@ -935,6 +1028,149 @@
            parent.layer.close(index);
            return false;
        }
        $("#IdCard").change(function () {
            var IdCard = $.trim($("#IdCard").val());
            if (IdCard == "") {
                return;
            }
            var Id = $("#Id").val();
            $.ajax({
                type: "GET",
                url: "/Expert/IdCardChongfu?IdCard=" + IdCard + "&Id=" + Id,
                dataType: "json",
                global: false,
                data: "",
                success: function (data) {
                    if (data.Result) {
                    }
                    else {
                        // toastr.error("失败");
                        parent.layer.msg(data.Message, { icon: 5 });
                    }
                },
                error: function () {
                    parent.layer.msg('失败', { icon: 5 });
                }
            });
        });
        $("#Phone1").change(function () {
            var Phone1 = $.trim($("#Phone1").val());
            if (Phone1 == "") {
                return;
            }
            var Id = $("#Id").val();
            $.ajax({
                type: "GET",
                url: "/Expert/Phone1Chongfu?Phone1=" + Phone1 + "&Id=" + Id,
                dataType: "json",
                global: false,
                data: "",
                success: function (data) {
                    if (data.Result) {
                    }
                    else {
                        // toastr.error("失败");
                        parent.layer.msg(data.Message, { icon: 5 });
                    }
                },
                error: function () {
                    parent.layer.msg('失败', { icon: 5 });
                }
            });
        });
        $("#CertiNumber").change(function () {
            var CertiNumber = $.trim($("#CertiNumber").val());
            if (CertiNumber == "") {
                return;
            }
            var Id = $("#Id").val();
            $.ajax({
                type: "GET",
                url: "/Expert/CertiNumberChongfu?CertiNumber=" + CertiNumber + "&Id=" + Id,
                dataType: "json",
                global: false,
                data: "",
                success: function (data) {
                    if (data.Result) {
                        if (data.Remark == null || data.Remark == "") {
                            return;
                        }
                        if ($("#Province").val() != data.Remark ) {
                            $("#Province").val(data.Remark);
                            var sheng = $("#Province").val();
                            var shi = data.Message;
                            $.ajax({
                                type: "GET",
                                url: "/Project/getCity?shengid=" + sheng,
                                dataType: "json",
                                global: false,
                                async: false,
                                data: "",
                                success: function (data) {
                                    var city = $("#City");
                                    city.find('option').remove();
                                    var aaa = '<option value="" hassubinfo="true">请选择</option>';
                                    city.append(aaa);
                                    if (data.length > 0) {
                                        for (var i = 0; i < data.length; i++) {
                                            var o = '<option value="' + data[i].CodeId + '" hassubinfo="true">' + data[i].Name + '</option>';
                                            if (data[i].CodeId == shi) {
                                                o = '<option value="' + data[i].CodeId + '" hassubinfo="true" selected="selected" >' + data[i].Name + '</option>';
                                            }
                                            city.append(o);
                                        }
                                    }
                                },
                                error: function () {
                                    parent.layer.msg('失败', { icon: 5 });
                                }
                            });
                        } else {
                            $("#City").val(data.Message);
                        }
                    }
                    else {
                        // toastr.error("失败");
                        parent.layer.msg(data.Message, { icon: 5 });
                    }
                },
                error: function () {
                    parent.layer.msg('失败', { icon: 5 });
                }
            });
        });
    </script>
</body>
</html>