【调度系统】广东民航医疗快线调度系统源代码
wzp
2024-12-06 0df39a8c5a45c6ff25411eace15d40a606f9769c
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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>
<%
'Response.Cookies("OA")("adminID")=""
'Response.end
searchTXT=Request("searchTXT")
ReportType=SafeRequest(Request("ReportType"))
state=request("state")
UnitIDCookies=request("UnitIDCookies")
If UnitIDCookies<>"" Then 
    Response.Cookies("UnitIDCookies")=UnitIDCookies
End If
If state<>"" Then
    stateSP=split(state,"|")
    for i = 0 to UBOUND(stateSP)
        If InStr(stateSP(i),"searchTXT=")=1 Then
            searchTXT=Replace(stateSP(i),"searchTXT=","")
        ElseIf InStr(stateSP(i),"ReportType=")=1 Then
            ReportType=Replace(stateSP(i),"ReportType=","")
        End If
    Next
End If
'if OrdState="" then Response.Redirect "/"
state=OrdState%>
<!--#include virtual="/weixin/OAuth2.gds"-->
<!--#include virtual="/inc/function.gds"-->
<!--#include virtual="/weixin/sha1.gds"-->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
'session("adminID")=85
'个人信息
sql="select * from OA_User where OA_User_ID="&session("adminID")
rs.open sql,objConn,1,1
If not rs.Eof then
OA_weixinUserID    = rs("OA_weixinUserID")
OA_Name            = rs("OA_Name")
OA_weixinAvatar    = rs("OA_weixinAvatar")
OA_DepartmentID    = rs("OA_DepartmentID")
session("admin_Power")=rs("OA_Power")
admin_Power=session("admin_Power")
End If
rs.close()
If isDepartment("0702")=0 Then Response.Redirect "/m_logout.html"
If OA_weixinAvatar="" Then OA_weixinAvatar="/resources/images/icon_avatar_default.png"
Call OA_Running("手机端打开订单报表")
 
'公司列表
UnitNameName=""
UnitNames = ""
sql="select vID,vtext from dictionary where vType>=1 and vtitle='UnitName' order by vOrder"
rs.open Sql,objConn,1,1
do while not rs.Eof
    UnitNames = UnitNames & rs("vID") &","& rs("vtext") & "|"
    If UnitNameID=CStr(rs("vID")) Then UnitNameName    = rs("vtext")
rs.movenext
Loop
rs.close()
UnitNames = left(UnitNames,len(UnitNames)-1)
UnitNamesPS = SPLIT(UnitNames,"|")
 
'显示相关公司
If UnitIDCookies<>"" Then
    sql="SELECT OrderClassIDs = STUFF((select ','+vOrder2 from dictionary where vType>=1 and vtitle='UnitName' and vID in ("&UnitIDCookies&") FOR XML PATH('')), 1, 1, '')"
    rs.open Sql,objConn,1,1
    If not rs.Eof Then
        OrderClassIDs = rs(0)
    End If
    rs.close()
    If OrderClassIDs<>"" Then
        OrdClassListSql=""
        sql="select vOrder2 from dictionary where vType>=1 and vtitle='OrderClass' and vID in ("&OrderClassIDs&") order by vOrder"
        rs.open Sql,objConn,1,1
        do while not rs.Eof
            OrdClassListSql = OrdClassListSql &"','"& rs("vOrder2")
        rs.movenext
        Loop
        rs.close()
        If OrdClassListSql<>"" Then OrdClassListSql=Mid(OrdClassListSql,4)
    Else
        UnitIDCookies=""
    End If
End If
%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no">  
<title>行程订单</title>
<link href="css/main.css" type="text/css" rel="stylesheet">
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/layout.css" rel="stylesheet">
<style>
*{margin:0;padding:0;}
li{list-style:none;}
a{text-decoration:none;}
.clear{zoom:1;}
.clear:after{content:'';display:block;clear:both;}
.fl{float:left;}
.fr{float:right;}
 
body{ font-size:16px;}
section .title{padding-left:20px;background:#F3F3F3;line-height:40px;font-size:16px;}
section .wrap{background:#fff;padding:0 0 20px 0;position:relative;}
.wrap .left .time{padding-left:20px;line-height:40px;background-size:6%;height:40px;font-weight: 700;}
.wrap .add_wrap{/* padding-left:40px;background:url(/resources/images/20160527shoujiye02.png) no-repeat 14px 14px;background-size:3%; */}
.wrap .address{line-height:42px;font-size:16px;padding-left:40px;width:280px;overflow:hidden;height:42px;font-weight: 700;}
.bg-t{background:url(/resources/images/20160527shoujiye04.png) no-repeat 14px 14px;}
.bg-b{background:url(/resources/images/20160527shoujiye06.png) no-repeat 14px -22px;}
.bg-c{background:url(/resources/images/20160527shoujiye05.png) no-repeat 14px -22px;}
 
.wrap .right{position:absolute;right:8px;top:10px;color:#000000;font-size:16px;font-weight: 700;}
 
 
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  flex-flow: row nowrap;
  justify-content: center;
  align-items: center;
  background: none repeat scroll 0 0 #FFFFFF;
}
 
.spinner {
  border: 1px solid transparent;
  border-radius: 5px;
  position: relative;
}
 
.spinner {
  content: '';
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 45px;
  height: 45px;
  margin-top: -10px;
  margin-left: -23px;
  border-radius: 50%;
  border: 1px solid #959595;
  border-top-color: #FFFFFF;
  animation: spinner .9s linear infinite;
}
 
@keyframes spinner {
  to {transform: rotate(360deg);}
}
 
.fa {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
        color: #141313;
}
</style>
 
</head>
<body>
<section id="div2" class="preloader">
    <div class="spinner">
        <span class="sk-inner-circle"></span>
    </div>
</section>
<DIV id="div1" style="display:none">
<%
If searchTXT="" Then
  searchDate="getdate()"
Else
  searchDate="'"&searchTXT&"'"
End If
If ReportType="1" then        '日
  SqlDate=" between dateadd(ms,0,DATEDIFF(d,0,"&searchDate&")) and dateadd(ms,3,DATEDIFF(d,-1,"&searchDate&")) "
  DateFF="h"
  DateDD="d"
ElseIf ReportType="2" Then    '周
  SqlDate=" between dateadd(ms,0,DATEDIFF(d,6,"&searchDate&")) and dateadd(ms,-3,DATEDIFF(d,-1,"&searchDate&")) "
  DateFF="d"
  DateDD="ww"
ElseIf ReportType="3" Then    '月
  SqlDate=" between dateadd(ms,0,DATEDIFF(m,1,"&searchDate&")) and dateadd(ms,-3,DATEDIFF(d,-1,"&searchDate&")) "
  DateFF="d"
  DateDD="m"
ElseIf ReportType="4" Then    '年
  SqlDate=" between dateadd(mm,-12,DATEADD(mm, DATEDIFF(m,0,"&searchDate&")+1,0)) and dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,"&searchDate&")+1,0)) "
  DateFF="d"
  DateDD="yyyy"
End if
'SqlDate=" between dateadd(ms,0,DATEDIFF(d,86,getdate())) and dateadd(ms,0,DATEDIFF(d,79,getdate())) "
sql=Replace(Replace(SqlDate," between","select ")," and ",",")
'Response.Write sql
rs.open sql,objConn,1,1
DateA=rs(0)
DateB=rs(1)
DateB=dateadd(DateFF,-1,DateB)
DateC=DateA
rs.close()
If ReportType="1" then        '日
  DateH2 = Year(DateA) &"年"& Month(DateA) &"月"& Day(DateA) &"日"
ElseIf ReportType="2" Then    '周
  DateH2 = Month(DateA) &"月"& Day(DateA) &"日~"
  If Month(DateA)<>Month(DateB) Then
    DateH2 = DateH2 & Month(DateB) &"月"& Day(DateB) &"日"
  Else
    DateH2 = DateH2 & Day(DateB) &"日"
  End If
ElseIf ReportType="3" Then    '月
  DateH2 = Month(DateA) &"月"& Day(DateA) &"日~"
  If Month(DateA)<>Month(DateB) Then
    DateH2 = DateH2 & Month(DateB) &"月"& Day(DateB) &"日"
  Else
    DateH2 = DateH2 & Day(DateB) &"日"
  End If
ElseIf ReportType="4" Then    '年
  DateH2 = Right(Year(DateA),2) &"年"& Month(DateA) &"月~"
  If Year(DateA)<>Year(DateB) Then
    DateH2 = DateH2 & Right(Year(DateB),2) &"年"& Month(DateB) &"月"
  Else
    DateH2 = DateH2 & Month(DateB) &"月"
  End If
End if
%>
 
<a href="?ReportType=<%=ReportType%>&searchTXT=<%=dateadd(DateDD,-1,DateB)%>"><div style="float:left;margin-top: 5%;margin-left: 4%;width: 6%;margin-bottom: 4%;position:absolute;top:0;left:0;"><img src="/resources/images/xiangleft.png" width="100%"></div></a>
<div class="container">
    <h1 class="text-center h2"><%=DateH2%></h1>
</div>
<a href="?ReportType=<%=ReportType%>&searchTXT=<%=dateadd(DateDD,1,DateB)%>"><div style="float:right;margin-top: 5%;margin-left: 90%;width: 6%;margin-bottom: 4%;position:absolute;top:0;left:0;"><img src="/resources/images/xiangright.png" width="100%"></div></a>
 
<%
'默认显示字段
'If OrdState="" Then OrdState=2                '默认显示未出车单据
If OrdClassList="" Then OrdClassList="0"    '默认显示全部类型单据
If OrdClassList="0" Then
    OrdClassName="全部"
Else
    sql="select vID,vtext from dictionary where vType>=1 and vtitle='OrderClass' and vOrder2='"&OrdClassList&"'"
    rs.open Sql,objConn,1,1
    If not rs.Eof Then OrdClassName    = rs("vtext")
    rs.close()
End if
 
 
 
 
'时间段列表
sql="select vID,vtext from dictionary where vType>=1 and vtitle='OrdDateType' order by vOrder"
rs.open Sql,objConn,1,1
do while not rs.Eof
    OrdDateTypes = OrdDateTypes & rs("vID") &","& rs("vtext") & "|"
rs.movenext
Loop
rs.close()
OrdDateTypes = left(OrdDateTypes,len(OrdDateTypes)-1)
OrdDateTypesPS = SPLIT(OrdDateTypes,"|")
 
'单据类型表列
OrdClassTypes = "0,全部|"
sql="select vID,vtext,vOrder2 from dictionary where vType=1 and vtitle='OrderClass' order by vOrder"
rs.open Sql,objConn,1,1
do while not rs.Eof
    OrdClassTypes = OrdClassTypes & rs("vOrder2") &","& rs("vtext") & "|"
rs.movenext
Loop
rs.close()
OrdClassTypes = left(OrdClassTypes,len(OrdClassTypes)-1)
OrdClassTypesPS = SPLIT(OrdClassTypes,"|")
 
page_URL="&OrdState="&OrdState&"&OrdClassList="&OrdClassList&"&OrdDateType="&OrdDateType&"&OrdDateStart="&OrdDateStart&"&OrdDateEnd="&OrdDateEnd&"&searchTXT="&searchTXT&"&h_menu1_1=1"
 
 
 
acc1=clng(request("page"))
if acc1=empty then acc1=clng(1)
QuantityInt = 200
acc2=0
acc3=0
 
'sql="select case when isnull(ServiceOrdTraTxnPrice,0)=0 or DispatchOrdPerfomance=0 then 0 else ServiceOrdTraTxnPrice/((select SUM(DispatchOrdPerfomance) from DispatchOrd where ServiceOrdIDDt=ServiceOrdID and DispatchOrdState not in (0,10,14))/DispatchOrdPerfomance) END as DispatchOrdTraTxnPrice,,DispatchOrdID,DispatchOrdClass,DispatchOrdState,DispatchOrdStartDate,DispatchOrdCarID,DispatchOrdTraStreet,DispatchOrdTraEnd,DispatchOrdTraVia,DispatchOrd_NS_Time,DispatchOrdReturnDate,DispatchOrd_AP_Check,DispatchOrd_AP_ID,DispatchOrd_AP_Time,ServiceOrdTraTxnPrice,StretcherMoney,DispatchOrdPerfomance,ServiceOrdPtOutHospID,ServiceOrdPtOutHosp,ServiceOrdPtInHospID,ServiceOrdPtInHosp from DispatchOrd LEFT JOIN ServiceOrder on ServiceOrdIDDt=ServiceOrdID where DispatchOrd_NS_Time between dateadd(ms,0,DATEDIFF(d,0,"&searchDate&")) and dateadd(ms,-3,DATEDIFF(d,-1,"&searchDate&"))  and DispatchOrdState not in (0,10,14) and (ServiceOrdClass in ('"&OrdClassListSql&"') or DispatchOrdClass in ('"&OrdClassListSql&"')) order by DispatchOrd_NS_Time desc"
 
sql="select DOrdID,DOrdClass,DOrdState,调度单号,车牌,转出医院,转入医院,调度时间,成交价 from OrdData where 调度时间 between dateadd(ms,0,DATEDIFF(d,0,"&searchDate&")) and dateadd(ms,-3,DATEDIFF(d,-1,"&searchDate&"))  and DOrdState not in (0,10,14) and (SOrdClass in ('"&OrdClassListSql&"') or DOrdClass in ('"&OrdClassListSql&"')) order by 调度时间 desc"
'Response.Write sql
rs.open sql,objConn,1,1
%>
 
 
<article>
 
    <%if isDepartment("070109")=1 Then
    If UnitIDCookies<>"" Then
        UnitIDCookiesPS=SPLIT(UnitIDCookies,",")
        UnitIDCookies=""
        for z = 0 to UBOUND(UnitIDCookiesPS)
            UnitIDCookies=UnitIDCookies&","&right("00"&Trim(UnitIDCookiesPS(z)),3)
        next
    End If
    %>
        
        <div style="margin-left: 40px;<%If request("UnitDiv")<>"1" Then Response.Write "display:none;"%>" id="UnitDiv1">
            <form name="Unitform" id="Unitform" action="?ReportType=<%=ReportType%>&searchTXT=<%=searchTXT%>&UnitDiv=1" method="POST"> 
            <div style="height: 30px;">
                <button type="button" onclick="selectAll()" style="width: 100px;font-weight: 700;">全选</button>
                <button type="button" onclick="unSelectAll()" style="width: 100px;font-weight: 700;">全不选</button>
                <button type="button" onclick="converSelectAll()" style="width: 100px;font-weight: 700;">反选</button>
                <img src="/resources/images/xiangright.png" style="transform: rotate(270deg);float:right;margin-top: 6px;margin-right: 15px;" onclick="document.getElementById('UnitDiv1').style.display='none';document.getElementById('UnitDiv2').style.display='';">
            </div>
            <div class="row">
                <div class="col-xs-12">
                    <%UnitNameCookies=""
                    UnitCookies=0
                    for z = 0 to UBOUND(UnitNamesPS)
                      UnitNamesPS1=SPLIT(UnitNamesPS(z),",")
                      vID=UnitNamesPS1(0)
                      vtext=UnitNamesPS1(1)
                      If UnitIDCookies="" Or InStr(UnitIDCookies,right("00"&vID,3))>0 Then
                        UnitCookies=UnitCookies+1
                        UnitNameCookies=UnitNameCookies&","&vtext
                      End If
                      %>
                      <input type="checkbox" name="UnitIDCookies" value="<%=vID%>" onclick="checkboxOnclick(this)" id="UnitID_<%=vID%>"<%If UnitIDCookies="" Or InStr(UnitIDCookies,right("00"&vID,3))>0 Then Response.Write " checked"%>><label for="UnitID_<%=vID%>"><%=vtext%></label>&nbsp;&nbsp;&nbsp;&nbsp;
                      <%If z=1 Or z=3 Or z=5 Or z=7 Or z=9 Or z=11 Or z=13 Or z=15 Or z=17 Or z=19 Or z=21 Or z=23 Then Response.Write "<BR>"%>
                    <%next%>
                </div>
            </div>
            </form>
        </div>
        <div style="margin-left: 20px;font-weight: 700;line-height: 40px;<%If request("UnitDiv")="1" Then Response.Write "display:none;"%>" id="UnitDiv2">
            <%If UnitCookies>0 Then%>
                已选择:<%If UnitCookies<=3 Then Response.Write Left(Mid(UnitNameCookies,2),18) Else Response.Write UnitCookies&"家公司" End If%>
            <%else%>
                未选择查询分公司
            <%End If%>
            <img src="/resources/images/xiangright.png" style="transform: rotate(90deg);float:right;margin-top: 6px;margin-right: 15px;" onclick="document.getElementById('UnitDiv2').style.display='none';document.getElementById('UnitDiv1').style.display='';">
        </div>
            
             <script type="text/javascript">
                function checkboxOnclick(checkbox){
                    Unitform.submit();
               }
                var inputs =  document.getElementsByName("UnitIDCookies");
                function selectAll(){
                    for(var i = 0;i<inputs.length;i++){
                        inputs[i].checked = true;
                    }
                    Unitform.submit();
                }
                function unSelectAll(){
                    for(var i = 0;i<inputs.length;i++){
                        inputs[i].checked = false;
                    }
                }
                function converSelectAll(){
                    var j=0;
                    for(var i = 0;i<inputs.length;i++){
                        if(inputs[i].checked){
                            inputs[i].checked = false;
                        }else{
                            j++;
                            inputs[i].checked = true;
                        }
                    }
                    if (j>0)
                    {
                        Unitform.submit();
                    }
                }
            </script>
        <%End If%>
<%i=1
OrdDate_old=""
      do while not rs.Eof
              DispatchOrdID            = rs("DOrdID")            '调度单号
              DispatchOrdClass        = rs("DOrdClass")        '调度单单据类型
              DispatchOrdState        = rs("DOrdState")        '服务单状态(0未下发,1.2等待确认,3等待出车,4.5.6.7服务中,8已完成,9跑空单,10取消)
              DispatchOrdCar        = rs("车牌")            '调度车辆
              DispatchOrd_NS_Time    = rs("调度时间")        '开单时间
              OrdPrice                = int(rs("成交价"))        '成交价
              OrdPtOutHosp    = rs("转出医院")        '转出医院
              OrdPtInHosp    = rs("转入医院")        '转入医院
              DispatchOrdNo            = rs("调度单号")        '调度单编号
 
              OrdDate=Right("0"&month(DispatchOrd_NS_Time),2)&Right("0"&day(DispatchOrd_NS_Time),2)
 
              If DispatchOrdState=0 Then
              DURL="###"
              else
              DURL="m_DispatchOrder.gds?DispatchOrdID="&DispatchOrdID
              End If
      %>
    
    <section>
        <%If OrdDate<>OrdDate_old Then
        OrdDate_old=OrdDate
        Sum_TraTxnPrice=0
        %><p class="title" id="Day_<%=Right("0"&month(DispatchOrd_NS_Time),2)&Right("0"&day(DispatchOrd_NS_Time),2)%>" style="font-weight: 700;color: #000000;"><%=Right("0"&month(DispatchOrd_NS_Time),2)%>月<%=Right("0"&day(DispatchOrd_NS_Time),2)%>日</p>
        <%else%>
        <p class="title" style="line-height: 10px;">&nbsp;</p>
        <%End if%>
    
 
        <a href="<%=DURL%>" class="detailed">
        <div class="wrap">
            <div class="left">
                <p class="time"><%=Right("0"&Hour(DispatchOrd_NS_Time),2) &":"& Right("0"&Minute(DispatchOrd_NS_Time),2)%>&nbsp;&nbsp;<%=DispatchOrdNo%></p>
                <div class="add_wrap">
                    <p class="address bg-t"><%=OrdPtOutHosp%></p>
                    <p class="address bg-b"><%=OrdPtInHosp%></p>
                </div>
            </div>
 
                <%If DispatchOrdState=0 Or DispatchOrdState=14 then%>
                <p class="right"><%=DispatchOrdStateA(DispatchOrdState)%></p>
                <%ElseIf DispatchOrdState<=3 Then
                    Sum_TraTxnPrice=Sum_TraTxnPrice+OrdPrice%>
                    <p class="right">¥<%=OrdPrice%>(未出车)</p>
                <%Else
                    Sum_TraTxnPrice=Sum_TraTxnPrice+OrdPrice%>
                    <p class="right">¥<%=OrdPrice%></p>
                <%End If%>
 
        </div>
        </a>
    </section>
 
 
          <% i=i+1
      rs.movenext
      Loop
      rs.close()%>
      <%if i=1 then%>
      <div class="massage">
        <a href="#" class="detailed">
            <ul>
                <li><p class="mas">数据库中无数据!</p></li>
            </ul>
        </a>
      </div> 
      <%end if%>
 
</article>
</div>
<script>
document.getElementById('Day_<%=Right("0"&month(DispatchOrd_NS_Time),2)&Right("0"&day(DispatchOrd_NS_Time),2)%>').innerHTML="<%=Right("0"&month(DispatchOrd_NS_Time),2)%>月<%=Right("0"&day(DispatchOrd_NS_Time),2)%>日      汇总:¥<%=Sum_TraTxnPrice%>"
</script>
<!--#include virtual="/m_Report_footer.gds"-->
<input name="OA_latitude" type="hidden" value="">
<input name="OA_longitude" type="hidden" value="">
<input name="OA_address" type="hidden" value="<%=OA_address%>">
    <%
    '微信JS-SDK
     timestamp = ToUnixTime(now(),+8)
     wxnonceStr = "5P1QYH5OEW6BCXTo"
     wxticket = Getjsapi_ticket()
     wxurl = WEBURL&Request.ServerVariables("URL")
     if Request.ServerVariables("QUERY_STRING")<>"" then wxurl=wxurl&"?"&Request.ServerVariables("QUERY_STRING")
     wxOri = "jsapi_ticket="&wxticket&"&noncestr="&wxnonceStr&"&timestamp="&timestamp&"&url="&wxurl
     wxSha1 = hex_sha1(wxOri)
    %>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script>
      wx.config({
          debug: false,
          appId: '<%=corpid%>',
          timestamp: <%=timestamp%>,
          nonceStr: '<%=wxnonceStr%>',
          signature: '<%=wxSha1%>',
          jsApiList: [
            'checkJsApi',
            'openLocation',
            'getLocation',
            'closeWindow'
          ]
      });
      
    </script>
    <script src="/js/zepto.min.js"></script>
 
 
    <script>
    wx.ready(function () { 
            wx.getLocation({
            success: function (res) {
                document.all.OA_latitude.value = JSON.stringify(res.latitude);
                document.all.OA_longitude.value = JSON.stringify(res.longitude);
            },
            cancel: function (res) {
                alert('用户拒绝授权获取地理位置');
                //document.getElementById('div1').style.display='none';
                return false;
            }
            });
        })
    wx.ready(function () {
                var add_url;
                var formatted_address;
                var cuan;
                wx.getLocation({
                    type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
                    success: function (res) {
                        document.getElementById('div2').style.display='none';
                        document.getElementById('div1').style.display='';
                        var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
                        var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
                        var speed = res.speed; // 速度,以米/每秒计
                        var accuracy = res.accuracy; // 位置精度
                        var point_url = "http://restapi.amap.com/v3/geocode/regeo?output=JSON&location="+longitude+","+latitude+"&key=fc226a9479cdd12eed4ab6acbc692fca&coordsys=gps";
 
                        $.get(point_url, function(result){
                            cuan = result.regeocode.addressComponent.township+result.regeocode.addressComponent.streetNumber.street+result.regeocode.addressComponent.streetNumber.number+result.regeocode.addressComponent.neighborhood.name;
                            formatted_address = "实时定位:"+result.regeocode.formatted_address;
                            $('.xqP2').html(formatted_address);
                            document.all.OA_address.value = result.regeocode.formatted_address;
                            document.all.OA_latitude.value = JSON.stringify(res.latitude);
                            document.all.OA_longitude.value = JSON.stringify(res.longitude);
                            Running_address(JSON.stringify(res.latitude),JSON.stringify(res.longitude),result.regeocode.formatted_address);
                        });
                        
                    },
                    fail: function (res) {
                        //alert('获取地理位置失败');
                        //document.getElementById('div1').style.display='none';
                        $('.xqP2').html('获取地理位置失败');
                        return false;
                    },
                    cancel: function (res) {
                        alert('用户拒绝授权获取地理位置');
                        //document.getElementById('div1').style.display='none';
                        $('.xqP2').html('用户拒绝授权获取地理位置');
                        return false;
                    }
                });
              function lbs_GPS(addressname,address,lat,lng) {
                wx.openLocation({ 
                  latitude: lat,
                  longitude: lng,
                  name: addressname,
                  address: address,
                  scale: 14,
                  infoUrl: 'http://weixin.qq.com'
                });
              };
 
        });
    function Running_address(latitude,longitude,address) {
            //alert(address);
            $.ajax({
                type: "POST",  
                url: "/Running_address.gds",//需要跳转到的界面 the page you want to post data  
                data: {  
                        address: address//要传给后台的数据 the data you should send to background  
                    }
            })
        };
 
    </script>
</body>
</html>