username@email.com
2025-05-20 10cada58c5ea2aa95b8eaaa1731b543582d618dc
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<%@ 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="保存" /> &nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btn_submit" runat="server" OnClick="btn_submit_form" Text="提交" />&nbsp;&nbsp;&nbsp;
 
                     <asp:Button ID="Button2" runat="server" OnClick="btn_jixu_form" Text="继续报销" /> &nbsp;&nbsp;&nbsp;
                    
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>