123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- @{
- ViewBag.Title = "Detail";
- Layout = "~/Views/Shared/_Layout.cshtml";
- }
- @using MES.Production.Service;
- @using Central.Control.Domain;
- @using Ant.Service.Common;
- @using Ant.Service.Common.Enums;
- @model SYS_MSG
- @{
- var attach = ViewData["Attach"] == null ? "" : ViewData["Attach"] as dynamic;
- }
- <style>
- body{background-color: #FFFFFF;}
- .changeicon{float: right;margin-right: -15px;position: absolute;right: -7px;top: 0px;border: none;background-color: #18a689;color: #FFFFFF;line-height: 40px;height: 40px;}
- .col-lg-3{width: 12% !important;}
- .f-hafl .col-hafl .col-lg-3{width: 24% !important;}
- .col-lg-8 ul{width: 100%;margin-top: 4px;padding: 0px;}
- .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;}
- .col-lg-8 ul li img{width: 100px;height: 75px;margin-top: 0px;vertical-align: top;}
- .col-lg-8 ul li span{height: 25px;line-height: 25px;background-color: #f8ac59;float: left;width: 100px !important;margin-top: -25px;}
- .col-lg-8 ul li span .remove{margin-right: 5px;color: #ffffff;float: right;}
- .col-lg-8 ul li span .set{margin-left: 5px;color: #ffffff;float: left;}
- .imgactive{color: #1ab394 !important;}
- .col-lg-8 ul li span a:hover{text-decoration: underline;color: #1ab394;}
- #tab_attach thead tr th{font-size: 14px;font-weight: bold;border: 1px solid #1ab394;text-align: center;}
- #tab_attach tbody tr td{border: 1px solid #1ab394;padding: 5px;}
- #tab_attach tbody tr td span{cursor: pointer;}
- #tab_attach tbody tr td span:hover{cursor: pointer;text-decoration: underline;}
- #tab_attach tbody tr td:first-child, #tab_attach tbody tr td:last-child{text-align: center;}
- </style>
- @using (Ajax.BeginForm("Save", null, new AjaxOptions()
- {
- HttpMethod = "Post",
- OnBegin = "SubInfo.Loading",
- OnComplete = "SubInfo.Complate",
- OnFailure = "SubInfo.Failure",
- OnSuccess = "SubInfo.Success",
- }, new { @class = "form-horizontal dig-from" }))
- {
- <div class="wrapper-content">
- <div class="panel-body">
- <div class="tab-content">
- <div id="tab-1" class="tab-pane active">
- <div class="form-group">
- <label class="col-lg-3 control-label">标题:</label>
- <div class="col-sm-10">
- @Html.TextBoxFor(p => p.MSGNAME, new { @class = "form-control", @placeholder = "请输入标题", @maxlength = "200", @datatype = "*1-200", @nullmsg = "请输入标题!", @errormsg = "请输入标题!最长不能超过200个字符" })
- </div>
- </div>
- <div class="form-group">
- <label class="col-lg-3 control-label">接收人:</label>
- <div class="col-sm-10">
- @{
- var fromuser = ViewData["userid"] as string;
- }
- <span id="readuser" class="form-control" style="padding:5px 5px;min-height:40px; height:auto; font-size:14px;">
- @if (!string.IsNullOrEmpty(fromuser))
- {
- @Html.Raw(fromuser.Split('|')[1]);
- }
- </span>
- @Html.Hidden("hidsendUserid", (!string.IsNullOrEmpty(fromuser)?fromuser.Split('|')[0]:""))
- <button class="changeicon" id="changesendUser" type="button">
- 选择
- </button>
- </div>
- </div>
- <div class="form-group">
- <label class="col-lg-3 control-label">正文:</label>
- <div class="col-sm-10">
- @Html.TextAreaFor(p => p.MSGCONTENT, new { @rows = "3", @cols = "5" })
- </div>
- </div>
- <div class="form-group">
- <label class="col-lg-3 control-label">定时发送:</label>
- <div class="col-lg-8">
- @Html.TextBox("SendTimer", null, new { @class = "form-control", @maxlength = "12", @onclick = "ldate('SendTimer','YYYY-MM-DD hh:mm:ss')", @style = "width:240px;float:left;" })
- <label class="checkbox-inline" style="margin-left:25px;">
- <input type="checkbox" class="i-check" id="ismsg" />短信通知审批人
- </label>
- </div>
- </div>
- <div class="form-group">
- <label class="col-lg-3 control-label">附件:</label>
- <div class="col-sm-10">
- <span class="input-group-btn"><button type="button" class="btn btn-sm btn-primary" id="upattch"><i class="im-plus"></i> 添加附件 </button> </span>
- <table id="tab_attach" cellpadding="0" width="100%" style="border: 1px solid #65CEA7; margin-top: 10px; ">
- <thead>
- <tr>
- <th style="width:50px;">操作</th>
- <th>名称</th>
- <th style="width:70px;">大小</th>
- </tr>
- </thead>
- <tbody id="tbAttch">
- @{
- //处理附件
- if (attach != null)
- {
- foreach (var item in attach)
- {
- <tr>
- <td></td>
- <td>
- <a href="@item.UPFILEPATH" target="_blank">@item.UPOLDNAME</a>
- <input type="hidden" name="attchs" value="@item.UPFILEPATH" />
- </td>
- <td>@item.UPFILESIZE.ToString()@item.UPFILEUNIT</td>
- </tr>
- }
- }
- }
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="hr-line-dashed">
- <div class="form-group m20">
- <div class="col-sm-2 col-sm-offset-2">
- <button class="btn btn-primary btn-save" type="submit"><i class="fa fa-check"></i> <span>确认发送</span></button>
- <button class="btn btn-warning" id="btn-dig-close" type="button"><i class="im-undo2"></i> 取消返回</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- }
- <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
- <script type="text/javascript" src="/ueditor/ueditor.all.min.js"></script>
- <script type="text/javascript">
- var ue = UE.ui.Editor({
- initialFrameHeight: 300, autoFloatEnabled: false, toolbars: [[ 'source', '|', 'undo', 'redo', '|',
- 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
- 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
- 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
- 'directionalityltr', 'directionalityrtl', 'indent', '|',
- 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
- 'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
- 'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
- 'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
- 'preview']]
- });
- ue.render('MSGCONTENT');
- </script>
- @section scripts{
- <script type="text/javascript">
- var dialog = top.dialog.get(window);
- $(function () {
- $('.form-horizontal').initValidform();
- })
- $('#changesendUser').click(function () {
- var vals = $('#hidsendUserid').val();
- dig.addModel('选择用户', '/Sys/User/SelectUser?userid=' + vals, 900, 500, function () {
- if (this.returnValue != 'no') {
- $('#hidsendUserid').val(this.returnValue.split('|')[0]);
- $('#readuser').html(this.returnValue.split('|')[1]);
- }
- });
- });
- //移除
- function removeimg(t) {
- $('#' + t).parent().parent().remove();
- };
- //上传附件
- $('#upattch').click(function () {
- dig.upload('', function () {
- var retval = this.returnValue;
- if (retval != '') {
- json = JSON.parse(retval);
- var num = $('#upattch').find('tr').length;
- //自动增加附件记录
- var html = '<tr>';
- html += '<td><span id="attch"' + num + ' onclick="javascript:removeimg(this.id)">移除</span></td>';
- html += '<td><a href="' + json.path + '" target="_blank">' + json.oldname + '</a><input type="hidden" name="attchs" value="' + json.path + '"/>';
- html += ' <td>' + json.unitsize + '</td></tr>';
- $('#tbAttch').append(html);
- }
- });
- });
- //提交
- var SubInfo = {
- Loading: function () {
- $(".btn-save").attr("disabled", "disabled").find("span").html("正在发送中...")
- },
- Success: function (result) {
- if (result.Status == undefined) {
- document.writeln(result);
- } else if (result.Status == "y") {
- dig.alertSuccess('提示', result.Msg, function () {
- dialog.close('yes').remove();
- });
- } else {
- dig.alertError("错误提示:", result.Msg);
- }
- SubInfo.Complete();
- },
- Failure: function () {
- dig.alertError("错误提示:", "网络超时,请稍后再试...");
- SubInfo.Complete();
- },
- Complete: function () {
- $(".btn-save").attr("disabled", false).find("span").html("确认发送");
- }
- };
- </script>
- }
|