Detail.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. @{
  2. ViewBag.Title = "Detail";
  3. Layout = "~/Views/Shared/_Layout.cshtml";
  4. }
  5. @using MES.Production.Service;
  6. @using Central.Control.Domain;
  7. @using Ant.Service.Common;
  8. @using Ant.Service.Common.Enums;
  9. @model SYS_MSG
  10. @{
  11. var attach = ViewData["Attach"] == null ? "" : ViewData["Attach"] as dynamic;
  12. }
  13. <style>
  14. body{background-color: #FFFFFF;}
  15. .changeicon{float: right;margin-right: -15px;position: absolute;right: -7px;top: 0px;border: none;background-color: #18a689;color: #FFFFFF;line-height: 40px;height: 40px;}
  16. .col-lg-3{width: 12% !important;}
  17. .f-hafl .col-hafl .col-lg-3{width: 24% !important;}
  18. .col-lg-8 ul{width: 100%;margin-top: 4px;padding: 0px;}
  19. .col-lg-8 ul li{width: 100px;height: 100px;float: left;list-style: none;line-height: 100px;margin-bottom: 10px;margin-right: 10px;border: 1px solid #f8ac59;}
  20. .col-lg-8 ul li img{width: 100px;height: 75px;margin-top: 0px;vertical-align: top;}
  21. .col-lg-8 ul li span{height: 25px;line-height: 25px;background-color: #f8ac59;float: left;width: 100px !important;margin-top: -25px;}
  22. .col-lg-8 ul li span .remove{margin-right: 5px;color: #ffffff;float: right;}
  23. .col-lg-8 ul li span .set{margin-left: 5px;color: #ffffff;float: left;}
  24. .imgactive{color: #1ab394 !important;}
  25. .col-lg-8 ul li span a:hover{text-decoration: underline;color: #1ab394;}
  26. #tab_attach thead tr th{font-size: 14px;font-weight: bold;border: 1px solid #1ab394;text-align: center;}
  27. #tab_attach tbody tr td{border: 1px solid #1ab394;padding: 5px;}
  28. #tab_attach tbody tr td span{cursor: pointer;}
  29. #tab_attach tbody tr td span:hover{cursor: pointer;text-decoration: underline;}
  30. #tab_attach tbody tr td:first-child, #tab_attach tbody tr td:last-child{text-align: center;}
  31. </style>
  32. @using (Ajax.BeginForm("Save", null, new AjaxOptions()
  33. {
  34. HttpMethod = "Post",
  35. OnBegin = "SubInfo.Loading",
  36. OnComplete = "SubInfo.Complate",
  37. OnFailure = "SubInfo.Failure",
  38. OnSuccess = "SubInfo.Success",
  39. }, new { @class = "form-horizontal dig-from" }))
  40. {
  41. <div class="wrapper-content">
  42. <div class="panel-body">
  43. <div class="tab-content">
  44. <div id="tab-1" class="tab-pane active">
  45. <div class="form-group">
  46. <label class="col-lg-3 control-label">标题:</label>
  47. <div class="col-sm-10">
  48. @Html.TextBoxFor(p => p.MSGNAME, new { @class = "form-control", @placeholder = "请输入标题", @maxlength = "200", @datatype = "*1-200", @nullmsg = "请输入标题!", @errormsg = "请输入标题!最长不能超过200个字符" })
  49. </div>
  50. </div>
  51. <div class="form-group">
  52. <label class="col-lg-3 control-label">接收人:</label>
  53. <div class="col-sm-10">
  54. @{
  55. var fromuser = ViewData["userid"] as string;
  56. }
  57. <span id="readuser" class="form-control" style="padding:5px 5px;min-height:40px; height:auto; font-size:14px;">
  58. @if (!string.IsNullOrEmpty(fromuser))
  59. {
  60. @Html.Raw(fromuser.Split('|')[1]);
  61. }
  62. </span>
  63. @Html.Hidden("hidsendUserid", (!string.IsNullOrEmpty(fromuser)?fromuser.Split('|')[0]:""))
  64. <button class="changeicon" id="changesendUser" type="button">
  65. 选择
  66. </button>
  67. </div>
  68. </div>
  69. <div class="form-group">
  70. <label class="col-lg-3 control-label">正文:</label>
  71. <div class="col-sm-10">
  72. @Html.TextAreaFor(p => p.MSGCONTENT, new { @rows = "3", @cols = "5" })
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <label class="col-lg-3 control-label">定时发送:</label>
  77. <div class="col-lg-8">
  78. @Html.TextBox("SendTimer", null, new { @class = "form-control", @maxlength = "12", @onclick = "ldate('SendTimer','YYYY-MM-DD hh:mm:ss')", @style = "width:240px;float:left;" })
  79. <label class="checkbox-inline" style="margin-left:25px;">
  80. <input type="checkbox" class="i-check" id="ismsg" />短信通知审批人
  81. </label>
  82. </div>
  83. </div>
  84. <div class="form-group">
  85. <label class="col-lg-3 control-label">附件:</label>
  86. <div class="col-sm-10">
  87. <span class="input-group-btn"><button type="button" class="btn btn-sm btn-primary" id="upattch"><i class="im-plus"></i> 添加附件 </button> </span>
  88. <table id="tab_attach" cellpadding="0" width="100%" style="border: 1px solid #65CEA7; margin-top: 10px; ">
  89. <thead>
  90. <tr>
  91. <th style="width:50px;">操作</th>
  92. <th>名称</th>
  93. <th style="width:70px;">大小</th>
  94. </tr>
  95. </thead>
  96. <tbody id="tbAttch">
  97. @{
  98. //处理附件
  99. if (attach != null)
  100. {
  101. foreach (var item in attach)
  102. {
  103. <tr>
  104. <td></td>
  105. <td>
  106. <a href="@item.UPFILEPATH" target="_blank">@item.UPOLDNAME</a>
  107. <input type="hidden" name="attchs" value="@item.UPFILEPATH" />
  108. </td>
  109. <td>@item.UPFILESIZE.ToString()@item.UPFILEUNIT</td>
  110. </tr>
  111. }
  112. }
  113. }
  114. </tbody>
  115. </table>
  116. </div>
  117. </div>
  118. </div>
  119. <div class="hr-line-dashed">
  120. <div class="form-group m20">
  121. <div class="col-sm-2 col-sm-offset-2">
  122. <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确认发送</span></button>
  123. <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="im-undo2"></i> 取消返回</button>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. }
  131. <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
  132. <script type="text/javascript" src="/ueditor/ueditor.all.min.js"></script>
  133. <script type="text/javascript">
  134. var ue = UE.ui.Editor({
  135. initialFrameHeight: 300, autoFloatEnabled: false, toolbars: [[ 'source', '|', 'undo', 'redo', '|',
  136. 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
  137. 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
  138. 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
  139. 'directionalityltr', 'directionalityrtl', 'indent', '|',
  140. 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
  141. 'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
  142. 'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
  143. 'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
  144. 'preview']]
  145. });
  146. ue.render('MSGCONTENT');
  147. </script>
  148. @section scripts{
  149. <script type="text/javascript">
  150. var dialog = top.dialog.get(window);
  151. $(function () {
  152. $('.form-horizontal').initValidform();
  153. })
  154. $('#changesendUser').click(function () {
  155. var vals = $('#hidsendUserid').val();
  156. dig.addModel('选择用户', '/Sys/User/SelectUser?userid=' + vals, 900, 500, function () {
  157. if (this.returnValue != 'no') {
  158. $('#hidsendUserid').val(this.returnValue.split('|')[0]);
  159. $('#readuser').html(this.returnValue.split('|')[1]);
  160. }
  161. });
  162. });
  163. //移除
  164. function removeimg(t) {
  165. $('#' + t).parent().parent().remove();
  166. };
  167. //上传附件
  168. $('#upattch').click(function () {
  169. dig.upload('', function () {
  170. var retval = this.returnValue;
  171. if (retval != '') {
  172. json = JSON.parse(retval);
  173. var num = $('#upattch').find('tr').length;
  174. //自动增加附件记录
  175. var html = '<tr>';
  176. html += '<td><span id="attch"' + num + ' onclick="javascript:removeimg(this.id)">移除</span></td>';
  177. html += '<td><a href="' + json.path + '" target="_blank">' + json.oldname + '</a><input type="hidden" name="attchs" value="' + json.path + '"/>';
  178. html += ' <td>' + json.unitsize + '</td></tr>';
  179. $('#tbAttch').append(html);
  180. }
  181. });
  182. });
  183. //提交
  184. var SubInfo = {
  185. Loading: function () {
  186. $(".btn-save").attr("disabled", "disabled").find("span").html("正在发送中...")
  187. },
  188. Success: function (result) {
  189. if (result.Status == undefined) {
  190. document.writeln(result);
  191. } else if (result.Status == "y") {
  192. dig.alertSuccess('提示', result.Msg, function () {
  193. dialog.close('yes').remove();
  194. });
  195. } else {
  196. dig.alertError("错误提示:", result.Msg);
  197. }
  198. SubInfo.Complete();
  199. },
  200. Failure: function () {
  201. dig.alertError("错误提示:", "网络超时,请稍后再试...");
  202. SubInfo.Complete();
  203. },
  204. Complete: function () {
  205. $(".btn-save").attr("disabled", false).find("span").html("确认发送");
  206. }
  207. };
  208. </script>
  209. }