<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyBaoxiaoAdd.aspx.cs" Inherits="CY.WebForm.Pages.work.MyBaoxiaoAdd" %>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head id="Head1" runat="server">
|
<title>新增请示</title>
|
<uc:CMSHead ID="CMSHead1" runat="server" />
|
<script type="text/javascript">
|
|
//查看
|
function checkSelFile(obj) {
|
if (obj == 1) {
|
var oFile = document.getElementById('file1');
|
if (oFile.value == "") {
|
alertMsg('没有选择文件');
|
return ;
|
|
}
|
|
|
|
var formData = new FormData();
|
formData.append('file', oFile.files[0]); // this.files[0]是文件对象
|
|
|
$.ajax({
|
url: 'https://yocaisim.51zhengcai.com/api/UpFile/UpdateFile', // 替换为你的服务器端点
|
type: 'POST',
|
data: formData,
|
contentType: false,
|
processData: false,
|
async: false, // 设置为同步
|
success: function (response) {
|
console.log('File uploaded successfully:', response);
|
if (response.code == 1) {
|
|
$(".AddTab").last().after($(".AddTab").last().clone(true));
|
$(".AddTab").last().show();
|
$("input[name='HideKeyidFapiao']").last().val("");
|
$("input[name='HideAttachmentFapiao']").last().val(response.data);
|
$('a[name="HrefAttachmentFapiao"]').last().attr("href", response.data);
|
$('a[name="HrefAttachmentFapiao"]').last().text('发票');
|
alertMsg('上传成功');
|
} else {
|
alertMsg('上传失败');
|
}
|
|
|
},
|
error: function (xhr, status, error) {
|
console.error('File upload failed:', status, error);
|
alertMsg('上传失败');
|
}
|
});
|
|
|
}
|
if (obj == 2) {
|
var oFile = document.getElementById('filesel');
|
if (oFile.value == "") {
|
alertMsg('没有选择文件');
|
return;
|
|
}
|
|
var formData = new FormData();
|
formData.append('file', oFile.files[0]); // this.files[0]是文件对象
|
|
$.ajax({
|
url: 'https://yocaisim.51zhengcai.com/api/UpFile/UpdateFile', // 替换为你的服务器端点
|
type: 'POST',
|
data: formData,
|
contentType: false,
|
processData: false,
|
async: false, // 设置为同步
|
success: function (response) {
|
console.log('File uploaded successfully:', response);
|
if (response.code == 1) {
|
|
$(".AddTabfujian").last().after($(".AddTabfujian").last().clone(true));
|
$(".AddTabfujian").last().show();
|
$("input[name='HideKeyidFujian']").last().val("");
|
$("input[name='HideAttachmentFujian']").last().val(response.data);
|
$('a[name="HrefAttachmentFujian"]').last().attr("href", response.data);
|
$('a[name="HrefAttachmentFujian"]').last().text('附件');
|
alertMsg('上传成功');
|
} else {
|
alertMsg('上传失败');
|
}
|
},
|
error: function (xhr, status, error) {
|
console.error('File upload failed:', status, error);
|
alertMsg('上传失败');
|
}
|
});
|
}
|
|
|
|
|
}
|
|
|
|
|
function deletefujian(obj) {
|
if (confirm("是否删除选中数据?")) {
|
$(obj).parent().parent().remove()
|
}
|
}
|
|
|
</script>
|
</head>
|
<body>
|
<form id="form1" class="form2" runat="server">
|
<div>
|
<table class="tableStyle" style="margin: 10px auto;" cellpadding="0" cellspacing="0">
|
<tr>
|
<td class="ali03">
|
部门:
|
</td>
|
<td>
|
<input id="txtDepart" type="text" runat="server" style=" width:180px;" readonly="readonly" />
|
</td>
|
</tr>
|
<tr>
|
<td class="ali03">
|
姓名:
|
</td>
|
<td>
|
<input id="txtStaff" type="text" runat="server" style=" width:180px;" readonly="readonly" />
|
</td>
|
</tr>
|
<tr>
|
<td class="ali03">
|
金额(元):
|
</td>
|
<td>
|
<input id="txtPlanMoney" type="text" class="float req" runat="server" style=" width:180px;" />
|
</td>
|
</tr>
|
|
<tr>
|
<td class="ali03 ">
|
科目:
|
</td>
|
<td>
|
<select id="selSubject" class="Sreq" runat="server" datatextfield="SubjectName" datavaluefield="Keyid" keepdefaultstyle="true" msg="请选择科目名称" onchange="ChangeThisSubject(this);" >
|
</select>
|
</td>
|
</tr>
|
<tr>
|
<td class="ali03">
|
摘要:
|
</td>
|
<td >
|
<textarea id="txtPlanContent" runat="server" style="width: 390px; height: 50px;" class="req" msg="请输入摘要" MaxLength="200" ></textarea>
|
</td>
|
</tr>
|
<tr>
|
<td class="ali03 w100px">
|
上传发票:
|
</td>
|
<td>
|
<input type="file" id="file1" name="__hetongFile" keepdefaultstyle="true" runat="server" text="请选择文件" />
|
<input type="button" value="上传发票" onclick="checkSelFile(1);" />
|
</td>
|
|
</tr>
|
|
<tr class="AddTab" style="display:none;" >
|
<td class="ali03 w100px">
|
|
</td>
|
<td>
|
<input type="hidden" name="HideKeyidFapiao" value="0" />
|
<input type="hidden" name="HideAttachmentFapiao" value="" />
|
<a title="查看发票" name="HrefAttachmentFapiao" target="view_window" href="0">
|
发票
|
</a>
|
<a name="shanchuAttachmentFapiao" href="#" onclick="deletefujian(this);" >
|
X
|
</a>
|
</td>
|
</tr>
|
|
<asp:Repeater ID="RepClientList" runat="server">
|
<ItemTemplate>
|
<tr class="AddTab" >
|
<td class="ali03 w100px">
|
|
</td>
|
<td>
|
<input type="hidden" name="HideKeyidFapiao" value="<%#Eval("Keyid")%>" />
|
<input type="hidden" name="HideAttachmentFapiao" value="<%#Eval("PlanAttachment")%>" />
|
<a title="查看发票" name="HrefAttachmentFapiao" target="view_window" href="<%#Eval("PlanAttachment")%>">
|
发票 <%#Container.ItemIndex + 1 %>
|
</a>
|
<a name="shanchuAttachmentFapiao" href="#" onclick="deletefujian(this);" >
|
X
|
</a>
|
</td>
|
</tr>
|
</ItemTemplate>
|
</asp:Repeater>
|
|
<tr>
|
<td class="ali03 w100px">
|
上传附件:
|
</td>
|
<td>
|
<input type="file" id="filesel" name="__hetongFile" keepdefaultstyle="true" runat="server" text="请选择文件" />
|
<input type="button" value="上传附件" onclick="checkSelFile(2);" />
|
</td>
|
|
</tr>
|
<tr class="AddTabfujian" style="display:none;" >
|
<td class="ali03 w100px">
|
|
</td>
|
<td>
|
<input type="hidden" name="HideKeyidFujian" value="0" />
|
<input type="hidden" name="HideAttachmentFujian" value="" />
|
<a title="查看附件" name="HrefAttachmentFujian" target="view_window" href="0">
|
附件
|
</a>
|
<a name="shanchuAttachmentFujian" href="#" onclick="deletefujian(this);" >
|
X
|
</a>
|
</td>
|
</tr>
|
|
<asp:Repeater ID="Repeater1" runat="server">
|
<ItemTemplate>
|
<tr class="AddTabfujian" >
|
<td class="ali03 w100px">
|
|
</td>
|
<td>
|
<input type="hidden" name="HideKeyidFujian" value="<%#Eval("Keyid")%>" />
|
<input type="hidden" name="HideAttachmentFujian" value="<%#Eval("PlanAttachment")%>" />
|
<a title="查看附件" name="HrefAttachmentFujian" target="view_window" href="<%#Eval("PlanAttachment")%>">
|
附件 <%#Container.ItemIndex + 1 %>
|
</a>
|
<a name="shanchuAttachmentFujian" href="#" onclick="deletefujian(this);" >
|
X
|
</a>
|
</td>
|
</tr>
|
</ItemTemplate>
|
</asp:Repeater>
|
|
<tr>
|
<td class="ali03 w100px">
|
后补发票:
|
</td>
|
<td>
|
<select id="selHoubufapiaoStatus" runat="server" keepdefaultstyle="true" style=" width:100px;">
|
<option value="1">有发票</option>
|
<option value="2">后补发票</option>
|
<option value="3">无发票</option>
|
|
</select>
|
</td>
|
|
</tr>
|
|
|
<tr>
|
<td colspan="2" style="text-align: center;">
|
<asp:Button ID="Button1" runat="server" OnClick="btn_baocun_form" Text="保存" />
|
<asp:Button ID="btn_submit" runat="server" OnClick="btn_submit_form" Text="提交" />
|
|
<asp:Button ID="Button2" runat="server" OnClick="btn_jixu_form" Text="继续报销" />
|
|
</td>
|
</tr>
|
</table>
|
</div>
|
</form>
|
</body>
|
</html>
|