118 lines
4.4 KiB
Plaintext
118 lines
4.4 KiB
Plaintext
@model ConfirmsTemplate
|
|
@{
|
|
ViewBag.Title = "客户确认书模板 | 编辑";
|
|
Layout = "~/Views/Shared/_InfoLayout.cshtml";
|
|
}
|
|
@section CSS{
|
|
<link href="~/Statics/libs/selectize/css/selectize.bootstrap.css" rel="stylesheet" />
|
|
<style>
|
|
.selectize-control {
|
|
display: inline-block;
|
|
width: 152px;
|
|
}
|
|
|
|
.selectize-input {
|
|
height: auto !important;
|
|
min-height: 28px;
|
|
padding: 5px;
|
|
}
|
|
|
|
.selectize-input.input-active {
|
|
background-color: #ffe !important;
|
|
}
|
|
</style>
|
|
}
|
|
@section JS{
|
|
<script src="@HtmlUtil.BasicDataJs("客户")"></script>
|
|
<script src="~/Statics/libs/selectize/js/selectize.min.js?v=@(HtmlUtil.JsVersion)"></script>
|
|
<script type="text/javascript">
|
|
var files;
|
|
var mailTemplates;
|
|
$(function () {
|
|
$s = $("#ClientIds");
|
|
$s.selectize({
|
|
options: ylotc.clients,
|
|
valueField: 'id',
|
|
labelField: 'Name',
|
|
searchField: ['Name', 'PinYin'],
|
|
items: @Json.Serialize(Model.Clients),
|
|
plugins: ['remove_button']
|
|
});
|
|
files = @Json.Serialize(YLErp.Web.Controllers.ClientController.GetConfirmTemplates());
|
|
mailTemplates = @Json.Serialize(YLErp.Web.Controllers.clientbalanceController.GetAllClientBalanceTemplate());
|
|
$f = $("#fileName");
|
|
$f.selectize({
|
|
options: ylotc.clients,
|
|
valueField: 'Value',
|
|
labelField: 'Text',
|
|
searchField: ['Text'],
|
|
items:[],
|
|
plugins: ['remove_button']
|
|
});
|
|
$("#fileType").prop("disabled", true);
|
|
$("#ClientName").prop("disabled", true);
|
|
changeFileType();
|
|
$("#fileType").bind("change", changeFileType);
|
|
$f[0].selectize.setValue("@Model.fileName")
|
|
})
|
|
|
|
function saveTemplate() {
|
|
var setting = {};
|
|
setting.meta_id = $("#meta_id").val();
|
|
setting.Clients = $("#ClientIds").val();
|
|
setting.fileType = $("#fileType").val();
|
|
setting.fileName = $("#fileName").val();
|
|
main.post("/client/ClientConfirmTemplateEditJson", setting).done(function (res) {
|
|
window.parent.reload();
|
|
layer.closeMe();
|
|
});
|
|
}
|
|
|
|
function changeFileType() {
|
|
var fileType = $("#fileType").val();
|
|
$s = $("#fileName");
|
|
if (fileType == "邮件模板") {
|
|
$s[0].selectize.clearOptions()
|
|
$s[0].selectize.addOption(mailTemplates);
|
|
} else {
|
|
$s[0].selectize.clearOptions()
|
|
$s[0].selectize.addOption(files);
|
|
}
|
|
}
|
|
</script>
|
|
}
|
|
|
|
|
|
<form id="TemplateEditForm" method="post" autocomplete="off">
|
|
<div class="form-layout">
|
|
@Html.HiddenFor(model => model.meta_id)
|
|
@if (Model.Clients != null && Model.Clients.Count > 0)
|
|
{
|
|
<div hidden>
|
|
<select name="ClientIds" class="form-input" id="ClientIds" multiple></select>
|
|
</div>
|
|
@Html.HiddenFor(model => model.ClientId)
|
|
@Html.MyTextFor(model => model.ClientName)
|
|
@Html.MyTextFor(model => model.fileType)
|
|
}
|
|
else
|
|
{
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">客户</label>
|
|
<select name="ClientIds" class="form-input" id="ClientIds" multiple></select>
|
|
</div>
|
|
@Html.MyDropdownFor(model => model.fileType, new List<SelectListItem>() {new SelectListItem{ Text = "交易确认书",Value = "交易确认书"}
|
|
,new SelectListItem{ Text = "结算确认书",Value = "结算确认书" }
|
|
,new SelectListItem{ Text = "邮件模板",Value = "邮件模板" } }, appendBlank: false)
|
|
}
|
|
<div class="form-group col-md-6">
|
|
<label class="formlabel">模板名</label>
|
|
<select name="fileName" class="form-input" id="fileName"></select>
|
|
</div>
|
|
</div>
|
|
<div class="form-buttons">
|
|
@MyControls.Btn("保存", "saveTemplate()")
|
|
@MyControls.Btn("关闭", "layer.closeMe()")
|
|
</div>
|
|
</form>
|