Files
zszq-trs/YLErpWeb/Views/clientbalance/TradeMarketDescSet.cshtml
T

136 lines
5.0 KiB
Plaintext

@{
ViewBag.Title = "编辑描述";
Layout = "~/Views/Shared/_InfoLayout.cshtml";
var otherUsers = AppManager.SmtpConfig.OtherUsers;
var defaultUser = AppManager.SmtpConfig;
}
@section CSS{
<style>
#container {
min-height: 280px;
}
.send-content-item {
display: block;
margin-top: 20px;
}
.check-input {
margin: 0 50px 0 10px !important;
}
</style>
}
@section JS{
<script type="text/javascript" src="/Scripts/ueditor/ueditor.config.js?v=@(HtmlUtil.JsVersion)"></script>
<script type="text/javascript" src="/Scripts/ueditor/ueditor.all.min.js?v=@(HtmlUtil.JsVersion)"></script>
<script type="text/javascript">
var isShenWan = "@YLErp.PS.Config.Is申万" == "True";
$(document).ready(function () {
var ue = makeUeEditor('container');
changeTemplate();
});
function savedesc(template) {
var selectcontent = [];
$("input[name='sendcontent']").each(function (i, d) {
if (d.checked) {
selectcontent.push(d.value);
}
});
if (selectcontent.length == 0 && !isShenWan) {
main.message("报告内容不能设置为空");
return false;
}
var ue = UE.getEditor('container');
var sendUser = $("#sendUser").val();
template = $("#setTemplate").val();
if (template) {
main.post("/clientbalance/savedstext", { data: ue.getContent(), sheets: selectcontent.join(','), sendUser: sendUser, template: template }).done(function (res) {
});
}
else {
main.post("/clientbalance/savedstext", { data: ue.getContent(), sheets: selectcontent.join(','), sendUser: sendUser }).done(function (res) {
});
}
}
function makeUeEditor(id) {
UE.delEditor(id);
var ue = UE.getEditor(id, {
autoHeight: false,
wordCount: false,
});
return ue;
}
function setTemplate(sendUser, desc, sheets) {
var ue = UE.getEditor('container');
if (desc) {
ue.ready(function () {//编辑器初始化完成再赋值
let html = main.decodeHtmlEntity(desc);
ue.setContent(html); //赋值给UEditor
});
}
if (sendUser) {
$("#sendUser").val(sendUser);
}
!sheets && (sheets = '');
$("[name=sendcontent]").each(function () {
let val = $(this).val();
$(this).prop('checked', sheets.indexOf(val) >= 0);
});
}
function changeTemplate() {
template = $("#setTemplate").val();
main.post("/clientbalance/GetClientBalanceTemplate", { template: template }).done(function (res) {
if (res) {
setTemplate(res.sendUser, res.DingShiDesc, res.TradeMarketSheets)
}
});
}
</script>
}
<div class="toolbarDiv">
<h3>模板:</h3>
<div id="selectTemplate">
@Html.MyAceDropdownInput2("setTemplate", "模板名:&nbsp; ", YLErp.Web.Controllers.clientbalanceController.GetAllClientBalanceTemplate(), false, "", true, new { onchange = "changeTemplate()" })
</div>
@* <h3>发件人:</h3> *@
@* <select id="sendUser"> *@
@* <option value="@defaultUser.From">@defaultUser.UserName</option> *@
@* @if (otherUsers != null) *@
@* { *@
@* foreach (var user in otherUsers) *@
@* { *@
@* <option value="@user.From">@user.UserName</option> *@
@* } *@
@* } *@
@* </select> *@
@if (!PS.Config.Is申万)
{
<div class="form-group">
<h3>报告内容:</h3>
<span class="send-content-item">
<lable>账户状况:</lable><input class="check-input" type="checkbox" name="sendcontent" value="账户状况" />
<lable>互换估值:</lable><input class="check-input" type="checkbox" name="sendcontent" value="互换估值" />
<lable>互换交易流水:</lable><input class="check-input" type="checkbox" name="sendcontent" value="互换交易流水" />
<lable>资金明细:</lable><input class="check-input" type="checkbox" name="sendcontent" value="资金明细" />
</span>
</div>
}
<div class="form-group">
<h3>报告备注:</h3>
<div style="margin-top: 20px;">
<script id="container" type="text/plain">
</script>
</div>
</div>
<input type="button" class="btn btn-primary" style="margin-top: 20px;" value="保存说明" onclick="savedesc()" />
<input type="button" class="btn btn-primary" style="margin-top: 20px;" value="关闭" onclick="window.parent.layer.closeAll();" />
</div>