username@email.com
2025-05-15 6fe02a16e55f17e45a3997171e1b2284d45af25b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Waixiefukuanshenqing.aspx.cs" Inherits="CY.WebForm.Pages.business.Waixiefukuanshenqing" %>
 
<!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 runat="server">
        <uc:CMSHead ID="CMSHead1" runat="server" />
    </head>
    <body style="padding:10px">
        <form runat="server">
            <table class="tableStyle" >
                
                 <tr>
                    <td class="ali03">收款单位:</td>
                    <td> <%--<select keepdefaultstyle='true' id='selSuppliers' runat="server"  datatextfield='Name' datavaluefield='Keyid'  onchange='custormerChange(this)' class='Sreq' sign="" selinputhtml="True"  style=" width:183px;"  >
                        </select>--%>
                        <input id='txtSupplierName' runat="server" maxlength='50' placeholder="请输入收款单位"  style="width:200px;" readonly="readonly" />
                        <input type="hidden" id='selSuppliersss' runat="server" />
                    </td>
                </tr>
                 <tr>
                    <td class="ali03">金额:</td>
                    <td> <input id='txtZengjianmoney' runat="server" maxlength='18' onblur="validateAmount(event)" placeholder="请输入金额"   readonly="readonly"  /></td>
                </tr>
                 <tr>
                    <td class="ali03">户名:</td>
                    <td> <input id='txtHuming' runat="server" maxlength='50' placeholder="请输入户名"  style="width:200px;" /></td>
                </tr>
                 <tr>
                    <td class="ali03">开户行:</td>
                    <td> <input id='txtBank' runat="server" maxlength='50' placeholder="请输入开户行"  style="width:200px;" /></td>
                </tr>
                  <tr>
                    <td class="ali03">账号:</td>
                    <td> <input id='txtAccountID' runat="server" maxlength='50'  placeholder="请输入账号" style="width:200px;" /></td>
                </tr>
                 <tr>
                    <td class="ali03">订单:</td>
                    <td> <span id="ordernos" runat="server" ></span></td>
                </tr>
                  <tr style="display:none;">
                    <td class="ali03">订单金额:</td>
                    <td> <span id="ordernjine" runat="server" ></span></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();" /> 
                </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>
                <tr>
                    <td colspan="2"></td>
                </tr>
                 <tr id="trbtn" runat="server">
                    <td class="ali02" colspan="2">
                        <asp:Button ID="btn_Submit" Text="提交申请" runat="server" OnClick="btn_Submit_form" />
                        <span style="margin-left:10px"></span>
                        <input type="button" value="取消 " onclick="top.Dialog.close()" />
                    </td>
                </tr>
            </table>
        </form>
    </body>
    <script type="text/javascript" language="javascript">
        function custormerChange(sel) {
 
          
 
 
            window.submitUrl = '/Pages/business/Waixiefukuanshenqing.aspx';
 
            CallServer({ Target: "GetSuplier", id: sel.value }, function (data, textStatus) {
                var jobj = false;
                try {
                    jobj = eval('[' + data + ']')[0];
                } catch (ex) {
                    global.DealDataException(ex); return;
                }
                if (jobj != '-2') {
                    document.getElementById('txtBank').value = jobj.Bank;
                    document.getElementById('txtAccountID').value = jobj.AccountID;
                    if (jobj.Huming == "") {
                        document.getElementById('txtHuming').value = jobj.Name;
                    } else {
                        document.getElementById('txtHuming').value = jobj.Huming;
                    }
                   
                } else {
                    document.getElementById('txtBank').value = "";
                    document.getElementById('txtAccountID').value = "";
                    document.getElementById('txtHuming').value = "";
                }
               
                  
               
            });
        }
 
        ///新增客户
        function showCustomer() {
            top.Dialog.open({ URL: "/Pages/procurement/SuppliersEdit.aspx?Keyid='0'&&flasss=ddfffff", Title: "新增供应商", Width: 950, Height: 650 });
        }
 
 
        //为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 () {
            SelectAddSearch();
        });
 
        function validateAmount(event) {
            var input = event.target;
            var value = input.value;
            var regex = /^\d+(\.\d+)?$/;
 
            if (!regex.test(value)) {
                // 输入无效,重置值并将焦点设回文本框
                input.value = '0';
                input.focus();
                alert('请输入有效的正负金额,例如  45.67');
            }
        }
 
 
 
        //查看
        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>
</html>