From 98cd7063d9b9a1570dcfbac92f5c2b35d904868b Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期一, 05 七月 2021 15:41:29 +0800 Subject: [PATCH] 修改修改 --- zhengcaioa/zhengcaioa/Views/Liaotian/Edit.cshtml | 87 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 85 insertions(+), 2 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Views/Liaotian/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/Liaotian/Edit.cshtml index 2576ec2..7eb43f8 100644 --- a/zhengcaioa/zhengcaioa/Views/Liaotian/Edit.cshtml +++ b/zhengcaioa/zhengcaioa/Views/Liaotian/Edit.cshtml @@ -5,6 +5,20 @@ List<SysCodeDtl> questiontype = ViewData["questiontype"] as List<SysCodeDtl>; //闂绫诲瀷 List<DTO.PageEntity> pageEntities = ViewData["pageEntities"] as List<DTO.PageEntity>; //闂绫诲瀷 + var shenhesto = pageEntities.Where(x => x.PageName == "瀹℃牳").FirstOrDefault(); + string shenhe = ""; + if (shenhesto != null) + { + shenhe = shenhesto.PageName; + } + var tijiaobingshenhesto = pageEntities.Where(x => x.PageName == "鎻愪氦骞跺鏍�").FirstOrDefault(); + string tijiaobingshenhe = ""; + if (tijiaobingshenhesto != null) + { + tijiaobingshenhe = tijiaobingshenhesto.PageName; + } + + } <!DOCTYPE html> <html> @@ -178,6 +192,10 @@ <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" id="tijiaobingshenhebtn" href="javascript:void(0)" onclick="tijiaobingshenhePosition();" style="margin-left:4px; border-radius:4px;"> + <i class="glyphicon glyphicon-ok"></i> <span class="bold">鎻愪氦骞跺鏍�</span> + </a> + <a class="btn btn-success" href="javascript:void(0)" onclick="delPosition();" style="margin-left:4px; border-radius:4px;"> <i class="glyphicon glyphicon-remove"></i> <span class="bold">鍒犻櫎</span> </a> @@ -210,15 +228,23 @@ $("#div_content").height(hh); var id = '@Model.Id'; - var pageEntities = @pageEntities.Count; + var shenhe = '@shenhe'; + var tijiaobingshenhe = '@tijiaobingshenhe'; var Clientid = '@Model.Clientid'; if (id == null || id == '') { $("#shenhebtn").hide(); - } else if (pageEntities <= 0 || Clientid == "A") { + } else if (shenhe == "" || Clientid == "A") { $("#shenhebtn").hide(); } else { $("#shenhebtn").show(); } + + if (tijiaobingshenhe == "") { + $("#tijiaobingshenhebtn").hide(); + } else { + $("#tijiaobingshenhebtn").show(); + } + toastr.options = { "closeButton": true, "debug": false, @@ -375,6 +401,63 @@ + // 淇濆瓨宀椾綅淇℃伅 + var tijiaobingshenhePosition = function () { + if (Verify.isNull($("#Questiontype").val())) { + toastr.warning("闂绫诲埆涓嶈兘涓虹┖"); + return; + } + if (Verify.isNull($("#Problemtype").val())) { + toastr.warning("棰樼洰绫诲埆涓嶈兘涓虹┖"); + return; + } + if (Verify.isNull($("#Question").val())) { + toastr.warning("闂涓嶈兘涓虹┖"); + return; + } + + if (Verify.isNull($("#Anwser").val())) { + toastr.warning("绛旀涓嶈兘涓虹┖"); + return; + } + + imgLoad = parent.layer.load(2, { shade: [0.2, '#fff'] }); + $.ajax({ + type: "POST", + url: "/Liaotian/Tijiaobingshenhe", + dataType: "json", + global: false, + data: { Id: id, Question: $("#Question").val(), Anwser: $("#Anwser").val(), Questiontype: $("#Questiontype").val(), Problemtype: $("#Problemtype").val(), Shiyongfatiao: $("#Shiyongfatiao").val() }, + success: function (data) { + + + if (data.Result) { + // parent._afterSave(true); + parent.layer.msg('淇濆瓨鎴愬姛', { icon: 6 }); + _pageAutoClose();//鑷姩鍏抽棴椤甸潰鏂规硶 + } + else { + if ($.isNumber(imgLoad)) { + parent.layer.close(imgLoad); + } + // toastr.error(""); + parent.layer.msg(data.Message, { icon: 5 }); + } + + }, + error: function () { + if ($.isNumber(imgLoad)) { + parent.layer.close(imgLoad); + } + //toastr.error("淇濆瓨澶辫触"); + + parent.layer.msg('淇濆瓨澶辫触', { icon: 5 }); + } + }); + } + + + $("#Questiontype").change(function () { -- Gitblit v1.9.1