TG.WXCRM.V4/WEB/Views/WeiXin/SzzyPrepayment/PrepaymentUpload.cshtml

104 lines
3.6 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@model WX.CRM.Model.Entity.WX_SZZYPREPAYMENT
@using WX.CRM.WebHelper;
@{
ViewBag.Title = "定金上传";
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}
<script src="/Scripts/jquery-ui-1.8.24.min.js" type="text/javascript"></script>
<script src="/Scripts/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="/Scripts/op/main_op.js" type="text/javascript"></script>
<link href="/Scripts/uploadify/uploadify.css" rel="stylesheet" type="text/css" />
<div class="mvctool bgb">
@Html.ToolButtonPlain("btnSave", "icon-save", "上传", false, "")
</div>
@using (Html.BeginForm("Upload", "SzzyPrepayment", null, FormMethod.Post, new { Id = "CreateForm" }))
{
@Html.ValidationSummary(true)
<table class="fromEditTable ">
<tr>
<td style="width:120px;">
</td>
<td style="width:310px">
<div class="bas_datagrid">
<div id="divUpload">
<p><input id="distributefile" name="distributefile" type="file" /></p>
<p style="margin-top:5px;font-size:14px;font-weight:bold;"><span id="result"></span></p>
</div>
<div id="divView" style="display:none;">
@Html.Raw(ViewBag.gridTable)
</div>
</div>
</td>
<td width="120px">
</td>
</tr>
<tr>
<td style="width:120px;">
文件格式
</td>
<td style="width:310px">
<img src="~/Content/Images/arrival.png" width="310"/>
</td>
<td width="120px"><span style="color:red">请严格按照excel格式填写数据否则数据将上传不成功。请下载范例文件然后填写数据后上传。</span></td>
</tr>
<tr>
<td style="width:120px;">
范例文件
</td>
<td style="width:310px"><a href="~/Content/Images/dzje.rar" target="_blank">下载</a></td>
<td width="120px"></td>
</tr>
</table>
}
<script type="text/javascript">
$(function () {
//上传
$('#distributefile').uploadify({
//debug: true,
'auto': false,
'buttonText': '请选择上传文件',
'swf': '/Scripts/uploadify/uploadify.swf',
'uploader': '/WeiXin/SzzyPrepayment/Upload',
//'cancelImg': '/Scripts/uploadify/uploadify-cancel.png',
//'button_image_url': '/res',
'fileTypeDesc': 'excel文件',
'fileTypeExts': ' *.xls; *.xlsx',
'sizeLimit': 1024 * 1024 * 4, //4M
'multi': false,
'onUploadSuccess': function (file, data, response) {
//$('#' + file.id).find('.data').html(' 上传完毕');
eval("data=" + data);
//alert('文件 ' + file.name + ' 已经上传成功,并返回 ' + response + ' 保存文件名称为 ' + data.SaveName);
if (data.Success) {
window.parent.frameReturnByMes('上传成功');
window.parent.frameReturnByReload(true);
} else {
$.messager.alert("警告", data.Message, "error");
}
}
});
$('#btnSave').click(function () {
Upload();
});
});
function Upload() {
$('#distributefile').uploadify('upload');
}
</script>