Transpond.cshtml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. @{
  2. ViewBag.Title = "Transpond";
  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. .changeicon {
  15. float: right;
  16. margin-right: -15px;
  17. position: absolute;
  18. right: -7px;
  19. top: 0px;
  20. border: none;
  21. background-color: #18a689;
  22. color: #FFFFFF;
  23. line-height: 40px;
  24. height: 40px;
  25. }
  26. .col-lg-3 {
  27. width: 12% !important;
  28. }
  29. .f-hafl .col-hafl .col-lg-3 {
  30. width: 24% !important;
  31. }
  32. .col-lg-8 ul {
  33. width: 100%;
  34. margin-top: 4px;
  35. padding: 0px;
  36. }
  37. .col-lg-8 ul li {
  38. width: 100px;
  39. height: 100px;
  40. float: left;
  41. list-style: none;
  42. line-height: 100px;
  43. margin-bottom: 10px;
  44. margin-right: 10px;
  45. border: 1px solid #f8ac59;
  46. }
  47. .col-lg-8 ul li img {
  48. width: 100px;
  49. height: 75px;
  50. margin-top: 0px;
  51. vertical-align: top;
  52. }
  53. .col-lg-8 ul li span {
  54. height: 25px;
  55. line-height: 25px;
  56. background-color: #f8ac59;
  57. float: left;
  58. width: 100px !important;
  59. margin-top: -25px;
  60. }
  61. .col-lg-8 ul li span .remove {
  62. margin-right: 5px;
  63. color: #ffffff;
  64. float: right;
  65. }
  66. .col-lg-8 ul li span .set {
  67. margin-left: 5px;
  68. color: #ffffff;
  69. float: left;
  70. }
  71. .imgactive {
  72. color: #1ab394 !important;
  73. }
  74. .col-lg-8 ul li span a:hover {
  75. text-decoration: underline;
  76. color: #1ab394;
  77. }
  78. #tab_attach thead tr th {
  79. font-size: 14px;
  80. font-weight: bold;
  81. border: 1px solid #1ab394;
  82. text-align: center;
  83. }
  84. #tab_attach tbody tr td {
  85. border: 1px solid #1ab394;
  86. padding: 5px;
  87. }
  88. #tab_attach tbody tr td span {
  89. cursor: pointer;
  90. }
  91. #tab_attach tbody tr td span:hover {
  92. cursor: pointer;
  93. text-decoration: underline;
  94. }
  95. #tab_attach tbody tr td:first-child, #tab_attach tbody tr td:last-child {
  96. text-align: center;
  97. }
  98. </style>
  99. @using (Ajax.BeginForm("Save", null, new AjaxOptions()
  100. {
  101. HttpMethod = "Post",
  102. OnBegin = "SubInfo.Loading",
  103. OnComplete = "SubInfo.Complate",
  104. OnFailure = "SubInfo.Failure",
  105. OnSuccess = "SubInfo.Success",
  106. }, new { @class = "form-horizontal dig-from" }))
  107. {
  108. <div class="row white-bg animated fadeInRight">
  109. <div class="wrapper-content">
  110. <div class="col-sm-12" style="padding:5px 5px 10px 0px;">
  111. <ol class="breadcrumb" style="float:right;color:#ffffff;">
  112. <li><button class="btn btn-primary p310" type="submit" action="save"><i class=" fa fa-check"></i> <span>发送</span></button></li>
  113. <li style="float:right; margin-right:5px; margin-left:5px;" id="btn-dig-close"><a class="btn btn-warning p310"><i class="im-undo2"></i> 返回</a></li>
  114. </ol>
  115. </div>
  116. <div class="panel-body">
  117. <div class="tab-content">
  118. <div id="tab-1" class="tab-pane active">
  119. <div class="form-group">
  120. <label class="col-lg-3 control-label">标题:</label>
  121. <div class="col-lg-8">
  122. @Html.TextBox("MSGNAME", Model.MSGNAME, new { @class = "form-control", @placeholder = "请输入标题", @maxlength = "200", @datatype = "*1-200", @nullmsg = "请输入标题!", @errormsg = "请输入标题!最长不能超过200个字符" })
  123. </div>
  124. </div>
  125. <div class="form-group">
  126. <label class="col-lg-3 control-label">接收人员:</label>
  127. <div class="col-lg-8">
  128. <span id="senduser" class="form-control" style="padding:5px 5px;min-height:40px; height:auto; font-size:14px;">
  129. </span>
  130. @Html.Hidden("hidsendUserid", null)
  131. <button class="changeicon" id="changesendUser" type="button">
  132. 选择
  133. </button>
  134. </div>
  135. </div>
  136. <div class="form-group">
  137. <label class="col-lg-3 control-label">内容:</label>
  138. <div class="col-sm-10">
  139. @Html.TextArea("MSGCONTENT", (Model.MSGCONTENT == null ? Model.MSGCONTENT : Model.MSGCONTENT), new { @rows = "3", @cols = "5" })
  140. </div>
  141. </div>
  142. <div class="form-group">
  143. <label class="col-lg-3 control-label">定时发送:</label>
  144. <div class="col-lg-8">
  145. @Html.TextBox("SendTimer", null, new { @class = "form-control", @maxlength = "12", @onclick = "ldate('SendTimer','YYYY-MM-DD hh:mm:ss')", @style = "width:240px;float:left;" })
  146. <label class="checkbox-inline" style="margin-left:25px;">
  147. <input type="checkbox" class="i-check" id="ismsg" />短信通知审批人
  148. </label>
  149. </div>
  150. </div>
  151. <div class="form-group">
  152. <label class="col-lg-3 control-label">附件 :</label>
  153. <div class="col-lg-8">
  154. <span class="input-group-btn"><button type="button" class="btn btn-sm btn-primary" id="upattch"><i class="im-plus"></i> 添加附件 </button> </span>
  155. <table id="tab_attach" cellpadding="0" width="100%" style="border: 1px solid #65CEA7; margin-top: 10px; ">
  156. <thead>
  157. <tr>
  158. <th style="width:50px;">操作</th>
  159. <th style="width:150px;">上传时间</th>
  160. <th style="width:80px;">上传者</th>
  161. <th>名称</th>
  162. <th style="width:70px;">大小</th>
  163. </tr>
  164. </thead>
  165. <tbody id="tbAttch">
  166. @{
  167. //处理附件
  168. if (attach != null)
  169. {
  170. foreach (var item in attach)
  171. {
  172. <tr>
  173. <td></td>
  174. <td>@item.UPTIME</td>
  175. <td>@item.UPOPEATOR</td>
  176. <td>
  177. <a href="@item.UPFILEPATH" target="_blank">@item.UPOLDNAME</a>
  178. <input type="hidden" name="attchs" value="@item.UPFILEPATH" />
  179. </td>
  180. <td>@item.UPFILESIZE.ToString()@item.UPFILEUNIT</td>
  181. </tr>
  182. }
  183. }
  184. }
  185. </tbody>
  186. </table>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. }
  195. <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
  196. <script type="text/javascript" src="/ueditor/ueditor.all.min.js"></script>
  197. <script type="text/javascript">
  198. var ue = UE.ui.Editor({ initialFrameHeight: 500 });
  199. ue.render('MSGCONTENT');
  200. </script>
  201. @section scripts{
  202. <script type="text/javascript">
  203. $('#changesendUser').click(function () {
  204. var vals = $('#hidUserid').val();
  205. dig.addModel('添加/编辑用户', '/Sys/User/SelectUser?userid=' + vals, 900, 500, function () {
  206. if (this.returnValue != 'no') {
  207. $('#hidsendUserid').val(this.returnValue.split('|')[0]);
  208. $('#senduser').html(this.returnValue.split('|')[1]);
  209. }
  210. });
  211. });
  212. //移除
  213. function removeimg(t) {
  214. $('#' + t).parent().parent().remove();
  215. };
  216. //上传附件
  217. $('#upattch').click(function () {
  218. dig.upload('', function () {
  219. var retval = this.returnValue;
  220. if (retval != '') {
  221. json = JSON.parse(retval);
  222. var num = $('#upattch').find('tr').length;
  223. //自动增加附件记录
  224. var html = '<tr>';
  225. html += '<td><span id="attch"' + num + ' onclick="javascript:removeimg(this.id)">移除</span></td>';
  226. html += '<td>' + json.uptime + '</td>';
  227. html += '<td>' + json.operator + '</td>';
  228. html += '<td><a href="' + json.path + '" target="_blank">' + json.oldname + '</a>';
  229. html += '<input type="hidden" name="attchs" value="' + json.path + '"/></td>';
  230. html += ' <td>' + json.unitsize + '</td></tr>';
  231. $('#tbAttch').append(html);
  232. }
  233. });
  234. });
  235. //提交
  236. var SubInfo = {
  237. Loading: function () {
  238. $(".btn-save").attr("disabled", "disabled").find("span").html("正在发送中...")
  239. },
  240. Success: function (result) {
  241. if (result.Status == undefined) {
  242. document.writeln(result);
  243. } else if (result.Status == "y") {
  244. dig.alertSuccess('提示', result.Msg, function () {
  245. location.href = "/Sys/Msg/Index";
  246. });
  247. } else {
  248. dig.alertError("错误提示:", result.Msg);
  249. }
  250. SubInfo.Complete();
  251. },
  252. Failure: function () {
  253. dig.alertError("错误提示:", "网络超时,请稍后再试...");
  254. SubInfo.Complete();
  255. },
  256. Complete: function () {
  257. $(".btn-save").attr("disabled", false).find("span").html("确认发送");
  258. }
  259. };
  260. </script>
  261. }