112 lines
3.3 KiB
Plaintext
112 lines
3.3 KiB
Plaintext
@model List<ConfirmsTemplate>
|
|
@{
|
|
ViewBag.Title = "客户模板设置";
|
|
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
|
}
|
|
<style>
|
|
col-2 {
|
|
max-width: 16.7% !important
|
|
}
|
|
|
|
col-3 {
|
|
max-width: 25% !important
|
|
}
|
|
</style>
|
|
<script src="~/Statics/libs/upload/js/jquery.fileupload.js?v=@(HtmlUtil.JsVersion)"></script>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
init();
|
|
})
|
|
function init() {
|
|
$('#uploadfile').fileupload({
|
|
dataType: 'json',
|
|
url: "/client/UploadComfirmsTemplate",
|
|
replaceFileInput: false,
|
|
start: function (e) {
|
|
$('#submitBtn').unbind('click');
|
|
},
|
|
singleFileUploads: true,
|
|
add: function (e, data) {
|
|
$('#submitBtn').unbind('click');
|
|
$('#submitBtn').click(function () {
|
|
data.submit();
|
|
|
|
});
|
|
},
|
|
done: function (e, data) {
|
|
if (!data.result.success) {
|
|
main.alert(data.result.msg);
|
|
}
|
|
else {
|
|
main.message(data.result.msg);
|
|
$("#modalFileUpload").modal('hide');
|
|
}
|
|
|
|
}
|
|
});
|
|
$('#uploadfile').bind('fileuploadsubmit', function (e, data) {
|
|
});
|
|
}
|
|
function importFile() {
|
|
$("#modalFileUpload").modal('show');
|
|
uploadfileInit();
|
|
$("#Content").width("680px")
|
|
}
|
|
function chooseTemplate() {
|
|
var url = "/Client/ClientConfirmTemplateEdit";
|
|
main.infopage("设置客户模板", url, { area: ['550px', '50%'] });
|
|
}
|
|
function TemplateEdit(id) {
|
|
var url = "/Client/ClientConfirmTemplateEdit?id=" + id;
|
|
main.infopage("设置客户模板", url, { area: ['550px', '50%'] });
|
|
}
|
|
function TemplateDelete(id) {
|
|
var url = "/Client/ClientConfirmTemplateDelete?id=" + id;
|
|
main.post(url).done(function (res) {
|
|
reload();
|
|
});
|
|
}
|
|
function reload() {
|
|
window.location.replace("/client/ClientTemplateChoose");
|
|
}
|
|
|
|
function showWildcard() {
|
|
window.open("../App_Docs/模板占位符_中金.xlsx");
|
|
}
|
|
</script>
|
|
<div class="searchdiv">
|
|
@MyControls.Btn("上传客户模板", "importFile()")
|
|
@MyControls.Btn("指定模板", "chooseTemplate()")
|
|
@MyControls.Btn("占位符查看", "showWildcard()")
|
|
</div>
|
|
<div>
|
|
<table class="table">
|
|
<tr>
|
|
<td style="width:25%">客户名</td>
|
|
<td style="width:25%">文件模板类型</td>
|
|
<td style="width:25%">文件模板</td>
|
|
<td style="width:25%">操作</td>
|
|
</tr>
|
|
@foreach (var item in Model)
|
|
{
|
|
<tr>
|
|
<td >@item.ClientName</td>
|
|
<td >@item.fileType</td>
|
|
<td >@item.fileName</td>
|
|
<td>@MyControls.Btn("修改", $"TemplateEdit('{item.meta_id}')") @MyControls.Btn("删除", $"TemplateDelete('{item.meta_id}')")</td>
|
|
</tr>
|
|
}
|
|
</table>
|
|
</div>
|
|
|
|
@await Html.PartialAsync("/Views/Common/_importFiles.cshtml", new ImportFileModel()
|
|
{
|
|
Title = "上传模板",
|
|
Accept = ".*",
|
|
Buttons = new Dictionary<string, BtnReq>()
|
|
{
|
|
["上传"] = new BtnReq() { Id = "submitBtn" },
|
|
},
|
|
})
|
|
|