_MainHeader.cshtml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. @using ShwasherSys
  2. @using ShwasherSys.Models.Modal
  3. @using ShwasherSys.NotificationInfo
  4. @model ShwasherSys.Models.Layout.MainHeaderViewModel
  5. @{
  6. var userImagePath = string.IsNullOrEmpty(ViewBag.UserImage) ?"../../Content/Images/logo.png" : ViewBag.UserImage;
  7. string userName = "";
  8. ViewBag.UserName = ViewBag.UserName??"";
  9. List<BulletinInfo> bulletinInfos = (List<BulletinInfo>)ViewBag.BulletinInfos;
  10. int noticeCount = bulletinInfos.Count;
  11. }
  12. <style type="text/css">a.valid {color:inherit}</style>
  13. <header class="main-header">
  14. <!-- Logo -->
  15. @*<a href="http://v.youku.com/v_show/id_XMzk2OTY3NjEwNA==.html?spm=a2h4v.8841035.uerCenter.5!2~5~5!2~5~DL~DD~A" target="_blank" class="logo">*@
  16. <a href="/" target="_blank" class="logo">
  17. <!-- mini logo for sidebar mini 50x50 pixels -->
  18. <span class="logo-mini">
  19. <img src="~/Content/Images/logo.jpg" class="img-circle" style="height: 40px" />
  20. </span>
  21. <!-- logo for regular state and mobile devices -->
  22. <span class="logo-lg">@ViewBag.SystemName</span>
  23. </a>
  24. <!-- Header Navbar: style can be found in header.less -->
  25. <nav class="navbar navbar-static-top">
  26. <!-- Sidebar toggle button-->
  27. <div class="navbar-custom-menu" style="width: 100%">
  28. <ul class="nav navbar-nav pull-left">
  29. <li>
  30. <a href="#" class="sidebar-toggle iconfont" data-toggle="push-menu" role="button" style="width: 50px; text-align: center;border-right:1px solid #eee ">
  31. <span class="sr-only">Toggle navigation</span>
  32. </a>
  33. </li>
  34. </ul>
  35. <ul class="nav navbar-nav pull-left">
  36. <ol class="breadcrumb" id="pageName"></ol>
  37. </ul>
  38. <ul class="nav navbar-nav pull-right pr">
  39. <li class="dropdown notifications-menu">
  40. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  41. <i class="iconfont icon-icon-notice"></i>
  42. <span class="label label-warning " id="alarmCount">0</span>
  43. </a>
  44. <ul class="dropdown-menu" id="alarmInfo">
  45. </ul>
  46. </li>
  47. <li class="dropdown notifications-menu">
  48. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  49. <i class="iconfont icon-gonggao"></i>
  50. <span class="label label-warning noticeCount">@noticeCount</span>
  51. </a>
  52. <ul class="dropdown-menu">
  53. <li>
  54. <!-- inner menu: contains the actual data -->
  55. <ul class="menu">
  56. @{
  57. if (bulletinInfos.Any())
  58. {
  59. foreach (var b in bulletinInfos)
  60. {
  61. string lcLevel = "color:{0}";
  62. switch (b.BulletinType)
  63. {
  64. case "1":
  65. lcLevel = string.Format(lcLevel, "blue");
  66. break;
  67. case "2":
  68. lcLevel = string.Format(lcLevel, "yellow");
  69. break;
  70. case "3":
  71. lcLevel = string.Format(lcLevel, "red");
  72. break;
  73. default:
  74. lcLevel = string.Format(lcLevel, "blue");
  75. break;
  76. }
  77. <li onclick="ShowNotice(@b.Id);">
  78. <a href="#">
  79. <i class="iconfont icon-tixing" style="@lcLevel"></i> @b.Title
  80. </a>
  81. </li>
  82. }
  83. }
  84. }
  85. </ul>
  86. </li>
  87. @*<li class="footer"><a href="#">View all</a></li>*@
  88. </ul>
  89. </li>
  90. @{
  91. if (Model != null && Model.UserInfos != null)
  92. {
  93. userName = Model.UserInfos.UserName;
  94. <!-- User Account: style can be found in dropdown.less -->
  95. <li class="dropdown user user-menu">
  96. <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="height: 50px">
  97. <img src="@userImagePath" class="user-image">
  98. <span class="hidden-xs">@Model.UserInfos.RealName</span>
  99. </a>
  100. <ul class="dropdown-menu">
  101. <!-- User image -->
  102. <li class="user-header">
  103. <img src="@userImagePath" class="img-circle">
  104. <p>
  105. @Html.Raw(userName)<small>@Model.UserInfos.EmailAddress</small>
  106. </p>
  107. </li>
  108. <!-- Menu Footer-->
  109. <li class="user-footer">
  110. <div class="pull-left">
  111. <span id="ChangePwd" class="btn btn-info btn-flat" onclick="ChangePassword()">@L("AccountChangePassword")</span>
  112. </div>
  113. <div class="pull-right">
  114. <span id="LoginOut" class="btn btn-danger btn-flat" onclick="LoginOut();">@L("Logout")</span>
  115. </div>
  116. </li>
  117. </ul>
  118. </li>
  119. @*@Html.Action("LanguageSelection", "Layout")*@
  120. <!-- Control Sidebar Toggle Button -->
  121. @*<li>
  122. <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
  123. </li>*@
  124. }
  125. else
  126. {
  127. <li>
  128. <a href="/"><i class="fa fa-home"></i>游客,欢迎您</a>
  129. </li>
  130. }
  131. }
  132. <li>
  133. <a title="帮助工具" href="#" id="showLeft" style="padding: 0 8px;"><i class="iconfont icon-tab" style="font-size: 20px;line-height: 50px"></i></a>
  134. </li>
  135. </ul>
  136. </div>
  137. </nav>
  138. </header>
  139. <style>
  140. #left-hidden .head_right {
  141. position: absolute;
  142. width: 25px;
  143. height: 25px;
  144. top: 0px;
  145. right: 0px;
  146. background: #ccc;
  147. border: 1px #000080 solid;
  148. border-radius: 15px;
  149. padding: 2px 5px;
  150. cursor: pointer;
  151. }
  152. #left-hidden .head_right:hover {
  153. background: #add8e6;
  154. }
  155. #left-hidden .content-wrapper {
  156. position: absolute;
  157. width: 98%;
  158. height: 97%;
  159. top: 26px;
  160. right: 3px;
  161. background: #eeeeee;
  162. border: 1px #000080 solid;
  163. border-radius: 10px;
  164. }
  165. .content-wrapper .head {
  166. font-size: 25px;
  167. color: #000080;
  168. border-bottom: 1px solid #000080;
  169. }
  170. .content-wrapper [type="radio"]:not(:checked) + label, [type="radio"]:checked + label {
  171. padding-left: 25px;
  172. font-size: 1.5rem;
  173. color: #dad9db;
  174. }
  175. .content-wrapper [type="radio"]:not(:checked) + label::before, .content-wrapper [type="radio"]:not(:checked) + label::after {
  176. border: 2px solid #fff;
  177. }
  178. .line-horization {
  179. width: 100%;
  180. height: 5px;
  181. background: linear-gradient(to right,#27ae60,#2980b9,#2c3e50);
  182. margin: 20px 1px;
  183. border-radius: 5px;
  184. }
  185. </style>
  186. <div id="left-hidden">
  187. <div class="head_right">
  188. <i class="iconfont icon-close"></i>
  189. </div>
  190. <div class="content-wrapper">
  191. <div class="head">
  192. 重量计算
  193. </div>
  194. <div class="body">
  195. <form id="left_form">
  196. <div class="form-group">
  197. <label>外径</label>
  198. <input type="number" class="form-control " min="0" id="length" value="1" placeholder="外径" />
  199. </div>
  200. <div class="form-group">
  201. <label>内径</label>
  202. <input type="number" class="form-control" min="0" id="width" value="1" placeholder="内径" />
  203. </div>
  204. <div class="form-group">
  205. <label>厚度</label>
  206. <input type="number" class="form-control" min="0" id="height" value="1" placeholder="厚度" />
  207. </div>
  208. <div class="form-group">
  209. <label>计算公式:</label><br />
  210. <input type="radio" name="formula" id="formula1" value="1" checked="checked" /> <label for="formula1" style="color: #000080">(R1^2 – R2^2)×(π/4)×7.85×h÷1000</label>
  211. <input type="radio" name="formula" id="formula2" value="2" /><label for="formula2" style="color: #000080">(R1^2 – R2^2)×(π/4)×8.5×h÷1000</label>
  212. </div>
  213. <div class="input-group">
  214. <div class="input-group-btn">
  215. <button type="button" class="btn btn-info" onclick="Formula()">计算</button>
  216. </div>
  217. <!-- /btn-group -->
  218. <input type="number" class="form-control" id="weight" readonly="readonly">
  219. </div>
  220. <div class="line-horization"></div>
  221. <div class="form-group">
  222. <label>零件号</label>
  223. <input type="text" class="form-control " id="left_partNo" placeholder="零件号" />
  224. </div>
  225. <div class="form-group">
  226. <label>客户</label>
  227. <div class="input-group">
  228. <input type="hidden" class="form-control" id="left_customerId" placeholder="客户" />
  229. <input type="text" class="form-control" id="left_customerName" placeholder="客户" />
  230. <div class="input-group-addon" onclick="ShowQueryModal('query_left_customer_modal', 'left_form');">
  231. <i class="iconfont icon-search"></i>
  232. </div>
  233. </div>
  234. </div>
  235. <div class="input-group">
  236. <div class="input-group-btn">
  237. <button type="button" class="btn btn-info" onclick="QueryProductByCustomerAndPartNo()">查询</button>
  238. </div>
  239. <!-- /btn-group -->
  240. <input type="text" class="form-control" id="left_productNo" readonly="readonly">
  241. </div>
  242. </form>
  243. </div>
  244. </div>
  245. </div>
  246. <section>
  247. @Html.Partial("Modals/Query/_CustomerEx", new QueryParamModel( modalId: "query_left_customer_modal", targetDom: "left_customerId,left_customerName"))
  248. </section>
  249. @using (Html.BeginScripts())
  250. {
  251. <script type="text/javascript">
  252. function LoginOut() {
  253. abp.message.confirm("@L("AccountLoginOutConfirmMsg")","@L("AccountLoginOutConfirmTitle")", function() {
  254. window.location.href = "@Url.Action("LogOut", "Account")";
  255. });
  256. }
  257. function ChangePassword() {
  258. $("#modal_Pwd").on('show.bs.modal',
  259. function() {
  260. $("#form_Pwd").find("label.error").remove();
  261. $("#form_Pwd input").val("").removeClass("error valid");
  262. $('#LoginName').val("@userName").prop("readonly",true);
  263. $("#form_Pwd").validate();
  264. });
  265. $("#modal_Pwd").modal("show");
  266. $("#Save_Pwd").off("click").on("click",
  267. function() {
  268. SaveAjax("@Url.Action("UpdatePassword", "Account")",
  269. { form: $("#form_Pwd"), modal: $("#modal_Pwd"),success: function() {
  270. $("#modal_Pwd").modal("hide");
  271. }
  272. });
  273. });
  274. }
  275. function ShowNotice(id) {
  276. SaveAjax(window.appUrl +"Query/GetBulletinInfo",
  277. {
  278. modal: $("#modal_tongzhi"),
  279. data: { Id: id },
  280. isValidate: false,
  281. isAlert:false,
  282. success: function (res) {
  283. if (res) {
  284. var color = "blue";
  285. if (res.bulletinType === "2") {
  286. color = "yellow";
  287. } else if (res.bulletinType === "3") {
  288. color = "red";
  289. }
  290. $(".box.box-primary").css("border-top-color", color);
  291. $("#bulletinTitle").html(res.title);
  292. $("#publicPerson").html(res.promulgator);
  293. $("#promulgatDate").html(res.promulgatTime);
  294. $("#bulletinContent").html(res.content);
  295. $("#modal_tongzhi").modal("show");
  296. }
  297. }
  298. });
  299. //$("#modal_tongzhi").modal("show");
  300. }
  301. function ShowMsg(id,detailId) {
  302. SaveAjax(window.appUrl +"Query/GetShortMsgDetailInfo",
  303. {
  304. modal: $("#modal_alarm"),
  305. data: { Id: detailId, MsgID:id },
  306. isValidate: false,
  307. isAlert:false,
  308. success: function (res) {
  309. if (res) {
  310. $("#msgTitle").html(res.title);
  311. $("#sendPerson").html(res.sendUserID);
  312. $("#sendDatetime").html(res.sendTime);
  313. $("#msgContent").html(res.content);
  314. $("#modal_alarm").modal("show");
  315. //QueryShortMsg();
  316. $("#modal_alarm .setMsgRead").off('click.setMsgRead').on('click.setMsgRead', function () {
  317. SaveAjax(window.appUrl + "Query/ReadShortMsgDetailInfo", {
  318. data: { Id: detailId, MsgID: id },
  319. isValidate: false,
  320. isAlert: false,
  321. success: function (res) {
  322. $("#modal_alarm").modal("hide");
  323. }
  324. })
  325. })
  326. }
  327. }
  328. });
  329. //$("#modal_tongzhi").modal("show");
  330. }
  331. $(function() {
  332. $("#pageName").empty().append(window.pageTitle);
  333. QueryShortMsg();
  334. $('#left-hidden').scrollBar({
  335. barWidth: 3, //滚动条的宽度(这里根据需要写数值即可,不设置是10,即默认10px)
  336. position: "x,y", //写“x”代表只出水平滚动条,写“y”表示只出垂直滚动条,写“x,y”则出水平和垂直滚动条(只有在内容超出容器时才出现滚动条)
  337. wheelDis: 15 //滚轮滚动一次向下或向上滚动的距离,默认是15,可根据需要修改数值
  338. });
  339. $("#showLeft").on('click',
  340. function(e) {
  341. var rightPosition = $('#left-hidden').css("right");
  342. if (rightPosition === "0px") {
  343. hideLeft();
  344. } else {
  345. showLeft();
  346. }
  347. });
  348. $("#left-hidden .head_right").on('click',
  349. function (e) {
  350. hideLeft();
  351. });
  352. });
  353. function showLeft() {
  354. $('#left-hidden').animate({
  355. right: '0'
  356. },
  357. 100);
  358. $('#left-hidden').after('<div class="m-quick-sidebar-overlay" onclick="hideLeft(this)"></div>');
  359. }
  360. function hideLeft() {
  361. $('#left-hidden').animate({
  362. right: '-450px'
  363. },
  364. 100);
  365. $('.m-quick-sidebar-overlay').remove();
  366. }
  367. function Formula() {
  368. var length = Number($("#length").val());
  369. var width = Number($("#width").val());
  370. var height = Number($("#height").val());
  371. length = length ? length : 0;
  372. width = width ? width : 0;
  373. height = height ? height : 0;
  374. var formula = $('input[name="formula"]:checked').val();
  375. var v;
  376. if (formula == "1") {
  377. v = ((Math.pow(length, 2) - Math.pow(width, 2)) * (Math.PI / 4) * 7.85 * height) / 1000;
  378. $("#weight").val(v);
  379. } else {
  380. v = ((Math.pow(length, 2) - Math.pow(width, 2)) * (Math.PI / 4) * 8.5 * height) / 1000;
  381. $("#weight").val(v); ;
  382. }
  383. }
  384. function QueryProductByCustomerAndPartNo() {
  385. var partNo = $("#left_partNo").val();
  386. var customerId = $("#left_customerId").val();
  387. //var width = $("#left_productNo").val();
  388. $("#left_productNo").val('');
  389. if (partNo && customerId) {
  390. SaveAjax({
  391. url: window.appUrl + `Query/QueryProductByCustomerAndPartNo?partNo=${partNo}&customerId=${customerId}`,
  392. isValidate: false,
  393. isAlert: false,
  394. dataType: "json",
  395. success: function(res) {
  396. //console.log(res);
  397. if (res) {
  398. $("#left_productNo").val(res);
  399. }
  400. }
  401. });
  402. }
  403. }
  404. </script>
  405. }