<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyRequestAdd.aspx.cs" Inherits="CY.WebForm.Pages.work.MyRequestAdd" %>
|
|
<!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 () {
|
$("#selPlanDataType").change(function () {
|
if ($(this).val() == "7") {
|
$("#trCarNo").css("display", "none");
|
$("#trCarYes").css("display", "table-row");
|
} else {
|
$("#trCarNo").css("display", "table-row");
|
$("#trCarYes").css("display", "none");
|
}
|
if ($(this).val() == "15") {
|
|
$(".trShoukuandanwei").css("display", "table-row");
|
|
$(".shangchanfujian").show();
|
} else {
|
|
$(".trShoukuandanwei").css("display", "none");
|
|
$(".shangchanfujian").hide();
|
}
|
|
|
});
|
|
if ($("#selPlanDataType").val() == "7") {
|
$("#trCarNo").css("display", "none");
|
$("#trCarYes").css("display", "table-row");
|
} else {
|
$("#trCarNo").css("display", "table-row");
|
$("#trCarYes").css("display", "none");
|
}
|
if ($("#selPlanDataType").val() == "15") {
|
|
$(".trShoukuandanwei").css("display", "table-row");
|
$(".shangchanfujian").show();
|
} else {
|
|
$(".trShoukuandanwei").css("display", "none");
|
$(".shangchanfujian").hide();
|
}
|
|
SelectAddSearch();
|
});
|
|
|
function custormerChange(sel) {
|
// var selectedValue = $('#selectId').val();
|
var selectedText = $('#selSuppliers option:selected').text();
|
$("#txtShoukuandanwei").val(selectedText);
|
}
|
|
//为Select新增过滤功能
|
function SelectAddSearch() {
|
$("select[SelInputHtml='True']").each(function (i, v) {
|
$(this).unbind("blur");
|
var old = $(this).html();
|
var oldObject = $(this).clone();
|
var sign = "selectS" + i;
|
$(v).attr("sign", sign);
|
|
var inputClass = "input_" + sign;
|
var html = "<span style='margin-left:10px'>过滤:</span><input type='text' class='" + inputClass + "' style='width:80px;height:18px;line-height:18px;'/>";//<span onclick='showCustomer()' style=\"padding-left:10px;\" class=\"a_under\">新增供应商</span>
|
$(v).after(html);
|
$("." + inputClass).blur(function () {
|
var nowval = $(this).val().trim();
|
var output = "";
|
if (nowval == "" || nowval == null) {
|
output = old;
|
} else {
|
output += "<option value=''>请选择</option>";
|
var valueArr = new Array();
|
oldObject.find("option").each(function (ii, vv) {
|
|
var value = $.trim($(vv).attr("value"));
|
var text = $.trim($(vv).text());
|
|
if (text.indexOf(nowval) >= 0)
|
valueArr.push(value + "|||" + text);
|
});
|
for (var ss in valueArr) {
|
var s = valueArr[ss];
|
if (s.split("|||").length == 2) {
|
var value1 = s.split("|||")[0];
|
var text1 = s.split("|||")[1];
|
output += "<option value='" + value1 + "'>" + text1 + "</option>";
|
}
|
}
|
}
|
$(v).html(output);
|
});
|
});
|
}
|
|
|
|
|
//查看
|
function checkSelFile() {
|
|
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: '/Pages/business/FileUploadHandler.ashx', // 替换为你的服务器端点
|
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().html('<img src="' + response.data + '" width="20" height="20" />');
|
alertMsg('上传成功');
|
} else {
|
alertMsg(response.message);
|
}
|
|
|
},
|
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 w100px">
|
请示类别:
|
</td>
|
<td>
|
<select id="selPlanDataType" runat="server" keepdefaultstyle="true" style=" width:100px;">
|
<option value="5">请假</option>
|
<option value="6">出差</option>
|
<option value="8">采购申请</option>
|
<option value="9">物品领用</option>
|
<option value="7">用车</option>
|
<option value="10">业务经费</option>
|
<option value="11">客户联谊</option>
|
<option value="15">付款申请</option>
|
<option value="12">其他</option>
|
</select>
|
</td>
|
<td class="ali03">
|
申请费用(元):
|
</td>
|
<td>
|
<input id="txtPlanMoney" type="text" class="float" runat="server" style=" width:180px;"/>
|
</td>
|
</tr>
|
<tr id="trCarNo">
|
<td class="ali03">
|
请示主题:
|
</td>
|
<td colspan="3">
|
<input id="txtPlanTitle" type="text" style=" width:400px;" class="" runat="server" msg="请输入请示主题" />
|
</td>
|
</tr>
|
<tr id="trCarYes" style=" display:none;">
|
<td class="ali03">
|
车辆用途:
|
</td>
|
<td colspan="3">
|
<select id="selPlanTitle" runat="server" keepdefaultstyle="true" style=" width:100px;"></select>
|
</td>
|
</tr>
|
<tr class="trShoukuandanwei" style=" display:none;">
|
<td class="ali03">
|
收款单位:
|
</td>
|
<td colspan="3">
|
<input id="txtShoukuandanwei" type="text" style=" width:400px;" class="" runat="server" msg="请输入收款单位" maxlength="50" />
|
</td>
|
</tr>
|
<tr class="trShoukuandanwei" style=" display:none;">
|
<td class="ali03">选择供应商:</td>
|
<td colspan="3"> <select keepdefaultstyle='true' id='selSuppliers' runat="server" datatextfield='Name' datavaluefield='Keyid' onchange='custormerChange(this)' sign="" selinputhtml="True" style=" width:183px;" >
|
</select></td>
|
</tr>
|
<tr>
|
<td class="ali03">
|
请示内容:
|
</td>
|
<td colspan="3">
|
<textarea id="txtPlanContent" runat="server" style="width: 390px; height: 50px;" class="req" msg="请输入请示内容" MaxLength="200" ></textarea>
|
</td>
|
</tr>
|
<tr>
|
<td class="ali03">
|
备注:
|
</td>
|
<td colspan="3">
|
<textarea id="txtPlanRemark" runat="server" style="width: 390px; height: 50px;" MaxLength="100" ></textarea>
|
</td>
|
</tr>
|
<tr class="shangchanfujian">
|
<td class="ali03 w100px">
|
审批证明:
|
</td>
|
<td colspan="3">
|
<input type="file" id="file1" name="__hetongFile" keepdefaultstyle="true" runat="server" text="请选择文件" />
|
<input type="button" value="上传图片" onclick="checkSelFile();" />
|
</td>
|
|
</tr>
|
<tr class="AddTab" style="display:none;" >
|
<td class="ali03 w100px">
|
|
</td>
|
<td colspan="3">
|
<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 shangchanfujian" >
|
<td class="ali03 w100px">
|
|
</td>
|
<td colspan="3">
|
<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")%>">
|
<img src="<%#Eval("PlanAttachment")%>" width="20" height="20" />
|
</a>
|
<a name="shanchuAttachmentFapiao" href="#" onclick="deletefujian(this);" >
|
X
|
</a>
|
</td>
|
</tr>
|
</ItemTemplate>
|
</asp:Repeater>
|
<tr>
|
<td colspan="4" style="text-align: center;">
|
<asp:Button ID="btn_submit" runat="server" OnClick="btn_submit_form" Text="提交" />
|
</td>
|
</tr>
|
</table>
|
</div>
|
</form>
|
</body>
|
</html>
|