From 402f9568e48e6e1a9d29d37dcda46737047425d5 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期四, 25 十一月 2021 10:49:10 +0800 Subject: [PATCH] 专家通讯录优化 --- zhengcaioa/zhengcaioa/Views/Expert/Edit.cshtml | 214 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 191 insertions(+), 23 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Views/Expert/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/Expert/Edit.cshtml index df77998..f18f271 100644 --- a/zhengcaioa/zhengcaioa/Views/Expert/Edit.cshtml +++ b/zhengcaioa/zhengcaioa/Views/Expert/Edit.cshtml @@ -9,10 +9,10 @@ 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; + Layout = null; } <!DOCTYPE html> @@ -184,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> } @@ -213,7 +213,7 @@ </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> + <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> @@ -272,12 +272,38 @@ <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> <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">鑰冭瘯鏃堕棿</label> + <div class="col-sm-2 col-md-2" grouptype="Vdata"> + <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> @@ -875,7 +901,7 @@ // 淇濆瓨宀椾綅淇℃伅 var saveExpert = function () { if ($("#InfoSource").val() == '') { - toastr.warning("瀹㈡埛鏉ユ簮涓嶈兘涓虹┖"); + toastr.warning("淇℃伅鏉ユ簮涓嶈兘涓虹┖"); return; } if ($("#ExpertType").val() == '') { @@ -886,21 +912,21 @@ toastr.warning("涓撳濮撳悕涓嶈兘涓虹┖"); return; }; - if (Verify.isNull($("#Province").val()) || Verify.isNull($("#City").val()) ) { - toastr.warning("鍖哄煙涓嶈兘涓虹┖"); - return; - } - if ($("#IdCard").val() == '') { - toastr.warning("韬唤璇佸彿涓嶈兘涓虹┖"); - return; - } + //if (Verify.isNull($("#Province").val()) || Verify.isNull($("#City").val()) ) { + // toastr.warning("鍖哄煙涓嶈兘涓虹┖"); + // return; + //} + //if ($("#IdCard").val() == '') { + // 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 != "" } @@ -924,7 +950,9 @@ _pageAutoClose();//鑷姩鍏抽棴椤甸潰鏂规硶 } catch (err) { - parent._CloseTab1("/Expert/Edit/"); + window.location = "/Expert/Edit?Province=" + $("#Province").val() + "&City=" + $("#City").val(); + + //parent._CloseTab1("/Expert/Edit/"); } } @@ -983,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() == '') { @@ -1000,6 +1028,146 @@ 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 ($("#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> \ No newline at end of file -- Gitblit v1.9.1