【调度系统】广东民航医疗快线调度系统源代码
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
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>
<!--#include virtual="/inc/chkadmin.gds"-->
<!--#include virtual="/inc/function.gds"-->
<%
ServiceOrdID=SafeRequest(Request("ServiceOrdID"))
Phone=SafeRequest(Request("Phone"))
OrdClass=SafeRequest(Request("OrdClass"))
admin_save=SafeRequest(Request("admin_save"))
 
OrdClassList=SafeRequest(Request("OrdClassList"))
OrdDateType=SafeRequest(Request("OrdDateType"))
NEWOrder=SafeRequest(Request("NEWOrder"))
'各种返回信息
SystemMessageType=trim(Request("SystemMessageType"))
SMT=trim(Request("SMT"))
error=trim(Request("error"))
if SystemMessageType<>"" then
  if SMT="1" then
    SystemMessageTXT="数据不完整!!"
  elseif SMT="2" then
    SystemMessageTXT="请不要重复提交单据!!"
  elseif SMT="3" then
    SystemMessageTXT="保存完成!!"
  elseif SMT="4" then
    SystemMessageTXT="数据不足,请按要求填写或先保存为[咨询单]!!"
  elseif SMT="5" then
    SystemMessageTXT="服务单审核完成!!"
  elseif SMT="6" then
    SystemMessageTXT="服务单反审核完成!!"
  elseif SMT="7" then
    SystemMessageTXT="生成服务单完成!!"
  elseif SMT="8" then
    SystemMessageTXT="取消服务单完成!!"
  elseif SMT="9" then
    SystemMessageTXT="作废咨询单完成!!"
  elseif SMT="10" then
    SystemMessageTXT="还原服务单完成!!"
  elseif SMT="11" then
    SystemMessageTXT="短信已发送!!"
  elseif SMT="22" then
    SystemMessageTXT="请选择需要操作的单据"
  elseif SMT="23" then
    SystemMessageTXT="费用单审核完成!!"
  elseif SMT="24" then
    SystemMessageTXT="费用单反审核完成!!"
  elseif SMT="25" then
    SystemMessageTXT="费用单作废完成!!"
  elseif SMT="35" then
    SystemMessageTXT="费用单新建完成!!"
  elseif SMT="40" then
    SystemMessageTXT="操作留言保存完成!!"
  elseif SMT="41" then
    SystemMessageTXT="操作留言删除完成!!"
  Else
    SystemMessageTXT=SMT
  end if
end If
 
If session("Origin")<>"" Then
'保存错误返回字段
    Origin    = session("Origin")
    session("Origin")=""
    OriginSP    = SPLIT(Origin,"|")
    For i=1 to UBOUND(OriginSP)
    OriginSPv=SPLIT(OriginSP(i),"=")
    If UBOUND(OriginSPv)=1 then
        v=OriginSPv(0)
        t=OriginSPv(1)
        Execute( v & "= """&t&""" ")
    End If
    Next
End if
 
OrderLevel=0
Set rs = Server.CreateObject("ADODB.Recordset")
If (ServiceOrdID<>"" Or Phone<>"") And NEWOrder="" Then
    If ServiceOrdID<>"" then
    sql="select * from ServiceOrder where ServiceOrdID="&ServiceOrdID
    Else
    '来电的7天内咨询单或处理中的服务单或完成后3天内的服务单
    sql="select top 1 * from ServiceOrder where ServiceOrdCoPhone='"&Phone&"' and ((ServiceOrdState=1 and datediff(dd,ServiceOrdStartDate,getdate())<7) or ServiceOrdState=2 or (ServiceOrdState=3 and datediff(dd,ServiceOrdApptDate,getdate())<=3)) order by ServiceOrdID desc"
    End If
    rs.open sql,objConn,1,1
    If not rs.Eof then
        ServiceOrdID        = rs("ServiceOrdID")
        ServiceOrdClass        = rs("ServiceOrdClass")
        ServiceOrdState        = rs("ServiceOrdState")
        ServiceOrdType        = rs("ServiceOrdType")
        ServiceOrdStartDate    = rs("ServiceOrdStartDate")
        ServiceOrd_CC_ID    = rs("ServiceOrd_CC_ID")        '服务单客服人员ID
        ServiceOrd_Sale_ID    = rs("ServiceOrd_Sale_ID")        '服务单销售人员ID
        ServiceOrdIntroducer= rs("ServiceOrdIntroducer")    '服务单介绍人
        ServiceOrdCancelReason= rs("ServiceOrdCancelReason")
        ServiceOrdCancelReasonTXT= rs("ServiceOrdCancelReasonTXT")
        ServiceOrdUnitID    = rs("ServiceOrdUnitID")        '第三方ID
        ServiceOrdUnitRemarks=rs("ServiceOrdUnitRemarks")    '第三方订单备注
        ServiceOrdSource    = rs("ServiceOrdSource")
        OrderLevel            = rs("OrderLevel")                '查看等级
        ServiceOrd_AP_Check    = rs("ServiceOrd_AP_Check")
        ServiceOrdNo            = ServiceOrdClass& year(rs("ServiceOrd_CC_Time"))&Right("0"&month(rs("ServiceOrd_CC_Time")),2)&Right("0"&day(rs("ServiceOrd_CC_Time")),2) & "-"&Right("00"&rs("ServiceOrdNo"),3)
        If InStr(session("admin_OrderClass"),ServiceOrdClass)>0 Or isDepartment("070109")=1 Then 
            Call OA_Running("打开服务单:"&ServiceOrdNo&" ID:"&ServiceOrdID)
        Else
            Call OA_Running("打开服务单失败:"&ServiceOrdNo&" ID:"&ServiceOrdID)
            Response.Redirect "/"
            Response.End()
        End If
    End If
    rs.close()
End If
 
'默认字段
If ServiceOrdStartDate="" Then ServiceOrdStartDate=now()
If ServiceOrdClass="" Then
    If session("admin_OrderClass")<>"" Then
        OA_OrderClassIDSP    = SPLIT(session("admin_OrderClass"),",")
        for i = 0 to UBOUND(OA_OrderClassIDSP)
            sql="select vID,vtext,vOrder2 from dictionary where vType=1 and vtitle='OrderClass' and vOrder2='"&Trim(OA_OrderClassIDSP(i))&"' order by vOrder"
            rs.open sql,objConn,1,1
            if not rs.Eof Then
                ServiceOrdClass=rs("vOrder2")
            End If
            rs.close()
            if ServiceOrdClass<>"" Then Exit For
        next
    Else
        ServiceOrdClass="BF"
    End If
End If
If ServiceOrdState="" Or (ServiceOrdState="2" And ServiceOrdID="") Then ServiceOrdState=1
If OrdClass<>""  Then
    ServiceOrdClass=OrdClass
    OrdClassName=OrderClassA(OrdClass)
Else
    OrdClass=ServiceOrdClass
    OrdClassName=OrderClassA(OrdClass)
End If
If ServiceOrdID="" Then
    ServiceOrdID_TXT="[系统自动生成]"
Else
    ServiceOrdID_TXT=ServiceOrdNo
End If
ServiceOrdStateTXT=ServiceOrdStateA(ServiceOrdState)
 
is_User=session("is_User")
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title><%=LindemanAdmin%></title>
        <!--#include virtual="/inc/ccs.gds"-->
        <!-- scripts (custom) -->
        <script src="resources/scripts/smooth.js" type="text/javascript"></script>
        <script src="resources/scripts/smooth.menu.js" type="text/javascript"></script>
        <script src="resources/scripts/smooth.table.js" type="text/javascript"></script>
        <script src="resources/scripts/smooth.form.js" type="text/javascript"></script>
        <script src="resources/scripts/smooth.dialog.js" type="text/javascript"></script>
        <script src="resources/scripts/smooth.autocomplete.js" type="text/javascript"></script>
        <script src="resources/scripts/Menu.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                style_path = "resources/css/colors";
 
                //$("#date-picker").datepicker();
 
                //$("#box-tabs, #box-left-tabs").tabs();
            });
        </script>
    </head>
    <body onkeydown="xKeyEvent(event)">
        <!--#INCLUDE FILE="menu_header.gds" -->
        <!-- content -->
        <div id="content">
            <%If is_User="1" then%>
            <!--#INCLUDE FILE="User_menu_left.gds" -->
            <%elseIf NEWOrder="2" Then
                OrdClassName="新建调度单 - 信息采集表"
                ServiceOrdStateTXT="新建调度单"%>
            <!--#INCLUDE FILE="Dispatch_menu_left.gds" -->
            <%else%>
            <!--#INCLUDE FILE="ServiceCenter_menu_left.gds" -->
            <%End if%>
            <!-- content / right -->
            <div id="right">
                <!-- messages -->
            <%If OrderLevel<>1 Or isDepartment("020111")=1 Then%>
                <%If ServiceOrdID<>"" Then
                 sql="select * from CallRecord where CallRecord_OrdID="&ServiceOrdID&" order by CallRecord_StartTime"
                rs.open sql,objConn,1,1
                If not rs.Eof then
                %>
                <div class="box">
                    <!-- box / title -->
                    <div class="title">
                        <h5>来电记录</h5>
                    </div>
                    <!-- end box / title -->
                    <div class="table">
                        <table>
                            <thead>
                                <tr>
                                    <th>来电时间</th>
                                    <th>来电号码</th>
                                    <th>话务员</th>
                                    <th>来电备注</th>
                                    <th>通话时长</th>
                                    <th class="selected last"><input type="checkbox" class="checkall"></th>
                                </tr>
                            </thead>
                            <tbody>
                            <%
                              i=0
                              do while not rs.Eof
                              i=i+1
                              CallRecord_Phine        = rs("CallRecord_Phine")
                              CallRecord_OAUserID    = rs("CallRecord_OAUserID")
                              CallRecord_StartTime    = rs("CallRecord_StartTime")
                              CallRecord_EndTime    = rs("CallRecord_EndTime")
                              CallRecord_Type        = rs("CallRecord_Type")
                              CallRecord_OrdClass    = rs("CallRecord_OrdClass")
                              CallRecord_OrdID        = rs("CallRecord_OrdID")
                              CallRecord_Record        = rs("CallRecord_Record")
 
                              CallRecord_Time    = SplitTime(DateDiff("s",CallRecord_StartTime,CallRecord_EndTime))
                              
                              'AcceptMoneyyudxl=UserMoney&"元 "&mono&" "&TVadminUser(Operation,"cname")&"("&formatdatetime(time1,vbshortdate)&")"
                              %>
                              <tr>
                                    <td class="category"><%=CallRecord_StartTime%></td>
                                    <td class="category"><%=CallRecord_Phine%></td>
                                    <td class="category"><%=OAUser(CallRecord_OAUserID,"UserName")%></td>
                                    <td class="category"><%=CallRecord_Record%></td>
                                    <td class="category"><%=CallRecord_Time%></td>
                                    <td class="selected last"><input type="checkbox"></td>
                                </tr>
                            <%rs.movenext
                            loop 
                            
                            %>
                            <%for j=i to 3%>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td class="selected last">&nbsp;</td>
                                    </tr>
                                <%next%>
                            </tbody>
                        </table>
                    </div>
                    <%End If
                    rs.close()
                    End if%>
 
                <%If Phone<>"" Then
                 sql="select top 4 * from dbo.ServiceOrder where ServiceOrdCoPhone='"&Phone&"' order by ServiceOrdID desc"
                rs.open sql,objConn,1,1
                If not rs.Eof then
                %>
                <div class="box">
                    <!-- box / title -->
                    <div class="title">
                        <h5>相关服务单</h5>
                    </div>
                    <!-- end box / title -->
                    <div class="table">
                        <table>
                            <thead>
                                <tr>
                                    <th>服务单号</th>
                                    <th>状态</th>
                                    <th>日期</th>
                                    <th>价钱</th>
                                    <th>目的地</th>
                                    <th>介绍人</th>
                                    <th class="last">操作备注</th>
                                </tr>
                            </thead>
                            <tbody>
                            <%
                              i=0
                              do while not rs.Eof
                              i=i+1
                                History_ServiceOrdID        = rs("ServiceOrdID")            '服务单号
                                History_ServiceOrdClass        = rs("ServiceOrdClass")            '单据类型
                                History_ServiceOrdType        = rs("ServiceOrdType")            '服务单类型
                                History_ServiceOrdState        = rs("ServiceOrdState")            '服务单状态
                                History_ServiceOrdStartDate    = rs("ServiceOrdStartDate")        '开单日期
                                History_ServiceOrdApptDate    = rs("ServiceOrdApptDate")        '预约日期
                                History_ServiceOrdCoName    = rs("ServiceOrdCoName")        '联系人姓名
                                History_ServiceOrdCoPhone    = rs("ServiceOrdCoPhone")        '联系人电话
                                History_ServiceOrdTraStreet    = rs("ServiceOrdTraStreet")        '出发地
                                History_ServiceOrdTraEnd        = rs("ServiceOrdTraEnd")        '目的地
                                History_ServiceOrdTraVia        = rs("ServiceOrdTraVia")        '途经地(计划)
                                History_ServiceOrdTraTxnPrice    = rs("ServiceOrdTraTxnPrice")    '成交价
                                History_ServiceOrdVIP            = rs("ServiceOrdVIP")
                                History_ServiceOrdUnitID        = rs("ServiceOrdUnitID")        '第三方ID
                                History_ServiceOrdUnitRemarks    = rs("ServiceOrdUnitRemarks")    '第三方订单备注
                                History_ServiceOrdOperationRemarks    = rs("ServiceOrdOperationRemarks")    '操作备注
                                History_ServiceOrdIntroducer    = rs("ServiceOrdIntroducer")    '介绍人
                                History_ServiceOrdNo            = History_ServiceOrdClass& year(rs("ServiceOrd_CC_Time"))&Right("0"&month(rs("ServiceOrd_CC_Time")),2)&Right("0"&day(rs("ServiceOrd_CC_Time")),2) & "-"&Right("00"&rs("ServiceOrdNo"),3)
 
                                'VIP客户订单
                                  If History_ServiceOrdVIP="1" Then
                                    History_ServiceOrdVIPTXT="[<span style='color: #E91E63;font-weight: bold;'>VIP</span>]"
                                  Else
                                    History_ServiceOrdVIPTXT=""
                                  End If
                                '出发地
                                  If History_ServiceOrdTraVia<>"" Then
                                    OrdTraVia=History_ServiceOrdTraVia
                                  Else
                                    OrdTraVia=History_ServiceOrdTraStreet
                                  End If
                              %>
                              <tr>
                                    <td class="category"><A HREF="ServiceOrder.gds?ServiceOrdID=<%=History_ServiceOrdID%>&OrdDateType=<%=OrdDateType%>&OrdClassList=<%=OrdClassList%>&h_menu1_1=1&Phone=<%=Phone%>"<%If History_ServiceOrdUnitID<>"0" Then Response.Write("  style='color: #F44336;'")%>><%=History_ServiceOrdNo%><%=History_ServiceOrdVIPTXT%></A></td>
                                    <td class="category"><%=ServiceOrdStateA(History_ServiceOrdState)%></td>
                                    <td class="category"><%=DateFormat(History_ServiceOrdStartDate)%></td>
                                    <td class="category"><%=FormatCurrency(History_ServiceOrdTraTxnPrice,0)%></td>
                                    <td class="category"><span style='color: #E91E63;'><%=OrdTraVia%></span><br><span style='color: #4CAF50;'><%=History_ServiceOrdTraEnd%></span></td>
                                    <td class="category"><%=History_ServiceOrdIntroducer%></td>
                                    <td class="last"><%=History_ServiceOrdOperationRemarks%></td>
                                </tr>
                            <%rs.movenext
                            loop 
                            
                            %>
                            <%for j=i to 3%>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td class="selected last">&nbsp;</td>
                                    </tr>
                                <%next%>
                            </tbody>
                        </table>
                    </div>
                    <%End If
                    rs.close()
                    End if%>
                <%End If%>
                <!-- forms -->
                <div class="box">
                    <!-- box / title -->
                    <div class="title<%If NEWOrder="2" then%> title4<%ElseIf ServiceOrdState="1" And NEWOrder<>"1" then%> title1<%ElseIf OrdClass="AB" then%> title2<%Else%> title3<%End if%>">
                        <h5><%=OrdClassName%>&nbsp;&nbsp;<%=UnitUser(ServiceOrdUnitID,"UnitShort")%>&nbsp;<%=OrderLevelA(OrderLevel)%></h5>
                        <ul class="links">
                            <%If ServiceOrdID="" Then%>
                            <li>
                                <div class="search">
                                <div id="OrdClass_container" class="select-container" style="overflow: hidden;cursor:pointer" onclick="JS_OrdClassType()">
                                    <span class="select-content" style="width: 46px;">单据类型:<%=OrderClassB(ServiceOrdClass,"vtext")%></span><span class="arrow" id="OrdClass_arrow"></span>
                                </div>
                                <div id="OrdClass_list" class="select-list scroll-pane" style="overflow: hidden; position: absolute; background-color: white; width: 130px; display: none;background-position: initial initial; background-repeat: initial initial;margin-left: 69px;">
                                    <div class="jspContainer" style="width: 130px;">
                                        <div style="padding: 0px; top: 0px; width: 130px;">
                                        <%admin_OrderClassPS=SPLIT(admin_OrderClass,",")
                                        OrdClassType=""
                                        for z = 0 to UBOUND(admin_OrderClassPS)
                                            If OrderClassB(admin_OrderClassPS(z),"vType")="1" Then
                                            OrdClassType=OrdClassType&","&admin_OrderClassPS(z)
                                            %>
                                              <span title="<%=vtext%>" onmouseover="JS_OrdClassTypeMouseover('OrdClassType_<%=admin_OrderClassPS(z)%>')" onclick="form1_OrdClass('<%=admin_OrderClassPS(z)%>')" id="OrdClassType_<%=admin_OrderClassPS(z)%>" class="list-option<%if admin_OrderClassPS(z)=OrdClassName then Response.Write "  option"%>"><%=OrderClassB(admin_OrderClassPS(z),"vtext")%></span>
                                            <%End If
                                        Next
                                        OrdClassTypePS=SPLIT(OrdClassType,",")
                                        %>
                                        </div>
                                    </div>
                                </div>
                                </div>
                            </li>
                            <script LANGUAGE="javascript">
                            //单据类型显示下拉菜单
                            function JS_OrdClassType(){
                              if (OrdClass_container.className!="select-container select-container-show-list"){
                                OrdClass_container.className="select-container select-container-show-list";
                                OrdClass_arrow.className="arrow arrow-up";
                                OrdClass_list.style.display="block";
                                Date_arrow.className="arrow";
                                Date_list.style.display="none";
                                OrdDateTypeCreate.style.display="none";
                              }
                              else {
                                OrdClass_container.className="select-container";
                                OrdClass_arrow.className="arrow";
                                OrdClass_list.style.display="none";
                              }
                            }
                            //单据类型指针移动到下拉菜单
                            function JS_OrdClassTypeMouseover(id){
                              var d=document.getElementById(id);
                              <%for z = 1 to UBOUND(OrdClassTypePS)
                              %>
                              document.getElementById("OrdClassType_<%=OrdClassTypePS(z)%>").className="list-option";
                              <%next%>
                              d.className="list-option option";
                            }
                            </script>
                            <%End If%>
                          <%If NEWOrder<>"2" then%>
                            <%If isDepartment("020101")=1 then%><li><a href="ServiceOrder.gds?Phone=<%=Phone%>&NEWOrder=1">新服务单</a></li><%End if%>
                            <%If ServiceOrdID<>"" Then%>
                            <!--发送短信-->
                            <%
                            '短信模板
                            sql="select vtext,vOrder2 from dictionary where vtitle in ('SMS') and vType=1 order by id desc"
                            rs.open sql,objConn,1,1
                            SMS_dictionary="短信模板:<br>"
                            do while not rs.Eof
                              vtext        = rs("vtext")
                              vOrder2    = rs("vOrder2")
                              vOrder2    = Replace(vOrder2," ","")
                              SMS_dictionary=SMS_dictionary&"&nbsp;<a onclick=JavaScript:document.getElementById('New_Send_Text').value='"&vOrder2&"';JS_SendText_Len();>"&vtext&"</a><br>"
                             rs.movenext
                            Loop
                            SMS_dictionary=SMS_dictionary&"<br>"
                            rs.close()
                            %>
                            <li><a onclick="JS_smsTosend('','')">短信发送</a></li>
                            <li><a href="SMS_List.gds?searchTXT=ServiceOrdID:<%=ServiceOrdID%>" target="_blank">相关短信记录</a></li>
                            <script LANGUAGE="javascript">
                                //新建短信发送-关闭上传窗口
                                function JS_SMSCreateClose()
                                {
                                SMSCreate.style.display="none";
                                }
                                //短信发送
                                function JS_SMSCreateSave()
                                {
                                formSMS.submit();
                                }
                                //显示发送短信窗口
                                function JS_smsTosend(Send_Phone,Send_Text)
                                {
                                    var sTop=document.documentElement.scrollTop;
                                        if (sTop==0) {sTop=document.body.scrollTop;}
                                    var sLeft= document.documentElement.scrollLeft;
                                        if (sLeft==0) {sLeft=document.body.scrollLeft;}
                                    var dTop = document.getElementById("form1").getBoundingClientRect().top;
                                    var dLeft = document.getElementById("form1").getBoundingClientRect().right;
                                    if (dTop<200) {dTop=400;}
                                    if (dLeft<120) {dLeft=500;}
                                    SMSCreate.style.display="block";
                                    SMSCreate.style.right="100px";
                                    SMSCreate.style.top=(sTop+dTop-200)+"px";
                                    Send_Phone=document.getElementById("ServiceOrdCoPhone").value;
                                    document.getElementById('New_Send_Phone').innerHTML = Send_Phone; 
                                    document.getElementById('New_Send_Text').innerHTML = Send_Text;
                                    JS_SendText_Len();
                                    document.formSMS.admin_save.value='96';
                                }
                                //输入字符数量
                                function JS_SendText_Len()
                                {
                                    var smsAutograph=document.getElementById('smsAutograph').innerHTML;
                                    var Send_Text=document.getElementById('New_Send_Text').value;
                                    document.getElementById('Send_Text_Len').innerHTML = "<%=SMS_dictionary%>内容:"+Send_Text.length+"个字符 + 签名"+smsAutograph.length+"个字符<br>共计:"+(Send_Text.length+smsAutograph.length)+"个字符"
                                }
 
                            </script>
                            <div class="dialogJ  dialogJfix dialogJshadow" id="SMSCreate" style="width:500px; right: 300px; top: 150px;display:none;z-index: 10;">
                            
                                <div class="dialogJtitle">
                                    <a href="javascript:JS_SMSCreateClose();" class="dialogJclose" title="关闭本窗口">&nbsp;</a>
                                    <span class="dialogJtxt" id="EditPhotoTXT">短信发送</span>
                                </div>
                                <form id="formSMS" name="formSMS" action="admin_save.gds" method="post">
                                <input name="admin_save" type="hidden" value="96">
                                <%Send_Remarks="ServiceOrdID:"&ServiceOrdID%>
                                <input name="Send_Remarks" type="hidden" value="<%=Send_Remarks%>">
                                <input name="ReturnURL" type="hidden" value="ServiceOrder">
                                <input name="searchTXT" type="hidden" value="<%=searchTXT%>">
                                <input name="page" type="hidden" value="<%=request("page")%>">
                                <div class="dialogJcontent">
                                    <div class="dialogJbody" id="dialogJbody">
                                        <div class="modify-album-name" style="border-bottom: 1px solid #cdcdcd;padding: 10px 21px;">
                                            <span>手机号码:</span>
                                            <textarea name="Send_Phone" id="New_Send_Phone" style="width:200px;height:130px;"></textarea>
                                                <span>同时对多个手机进行发送,<br>
                                                    每个手机号码占一行<br>
                                                    例如:<br>
                                                    13195606061<br>
                                                    13119560607</span>
                                        </div>
                                        <div class="modify-album-name" style="border-bottom: 1px solid #cdcdcd;padding: 0px 21px;">
                                            <span>短信内容:</span>
                                            <textarea name="Send_Text" id="New_Send_Text" style="width:200px;height:200px;" onKeyDown="JS_SendText_Len()" onKeyUp="JS_SendText_Len()"></textarea>
                                            <span id="Send_Text_Len"><%=SMS_dictionary%>内容:4个字符 + 签名6个字符<br>共计:10个字符</span>
                                        </div>
                                        <div class="modify-album-name" style="border-bottom: 1px solid #cdcdcd;padding: 0px 21px;">
                                            <span>使用签名:</span>
                                            <span id="smsAutograph">【医疗快线】</span>
                                            
                                        </div>
                                    </div>
                                </div>
                                </form>
                                <div class="dialogJanswers" style="padding: 10px 20px 13px 18px;">
                                    <input type="button" id="formSMS_submit" class="dialogJbtn first-child" onclick="JS_SMSCreateSave()" value="发送"> 
                                    <input type="button" class="dialogJbtn" onclick="JS_SMSCreateClose()" value="取消">
                                </div>
                            </div>
 
                            <script LANGUAGE="javascript">
                                //微信服务通知-关闭窗口
                                function JS_WXSMSCreateClose()
                                {
                                WXSMSCreate.style.display="none";
                                }
                                //微信服务通知发送
                                function JS_WXSMSCreateSave()
                                {
                                formWXSMS.submit();
                                }
                                //显示发送微信服务通知窗口
                                function JS_WXSMSTosend(wx_APPID,wx_openid,wx_UserID,wx_template_id,wx_form_id,wx_page,wx_keyword1,wx_keyword2,wx_keyword3,wx_keyword4,wx_keyword5,wx_keyword6)
                                {
                                    var sTop=document.documentElement.scrollTop;
                                        if (sTop==0) {sTop=document.body.scrollTop;}
                                    var sLeft= document.documentElement.scrollLeft;
                                        if (sLeft==0) {sLeft=document.body.scrollLeft;}
                                    var dTop = document.getElementById("form1").getBoundingClientRect().top;
                                    var dLeft = document.getElementById("form1").getBoundingClientRect().right;
                                    if (dTop<200) {dTop=400;}
                                    if (dLeft<120) {dLeft=500;}
                                    WXSMSCreate.style.display="block";
                                    WXSMSCreate.style.right="100px";
                                    WXSMSCreate.style.top=(sTop+dTop-200)+"px";
                                    document.getElementById('wx_APPID').value = wx_APPID; 
                                    document.getElementById('wx_openid').value = wx_openid;
                                    document.getElementById('wx_UserID').value = wx_UserID;
                                    document.getElementById('wx_template_id').value = wx_template_id;
                                    document.getElementById('wx_form_id').value = wx_form_id;
                                    document.getElementById('wx_page').value = wx_page;
                                    document.getElementById('wx_keyword1').value = wx_keyword1;
                                    document.getElementById('wx_keyword2').value = wx_keyword2;
                                    document.getElementById('wx_keyword3').value = wx_keyword3;
                                    document.getElementById('wx_keyword4').value = wx_keyword4;
                                    document.getElementById('wx_keyword5').value = wx_keyword5;
                                    document.getElementById('wx_keyword6').value = wx_keyword6;
 
                                    document.formWXSMS.admin_save.value='109';
                                }
 
                            </script>
                            <div class="dialogJ  dialogJfix dialogJshadow" id="WXSMSCreate" style="width:500px; right: 300px; top: 150px;display:none;z-index: 10;">
                                <div class="dialogJtitle">
                                    <a href="javascript:JS_WXSMSCreateClose();" class="dialogJclose" title="关闭本窗口">&nbsp;</a>
                                    <span class="dialogJtxt" id="EditPhotoTXT">微信服务通知发送</span>
                                </div>
                                <form id="formWXSMS" name="formWXSMS" action="admin_save.gds" method="post">
                                <input name="admin_save" type="hidden" value="109">
                                <%Send_Remarks="ServiceOrdID:"&ServiceOrdID%>
                                <input name="Send_Remarks" type="hidden" value="<%=Send_Remarks%>">
                                <input name="ReturnURL" type="hidden" value="ServiceOrder">
                                <input name="searchTXT" type="hidden" value="<%=searchTXT%>">
                                <input name="APPID" id="wx_APPID" type="hidden" value="">
                                <input name="openid" id="wx_openid" type="hidden" value="">
                                <input name="UserID" id="wx_UserID" type="hidden" value="">
                                <input name="template_id" id="wx_template_id" type="hidden" value="">
                                <input name="form_id" id="wx_form_id" type="hidden" value="">
                                <input name="page" id="wx_page" type="hidden" value="">
 
                                <div class="dialogJcontent">
                                    <div class="dialogJbody" id="dialogJbody">
                                        <div class="modify-album-name">
                                            <span>服务名称:</span>
                                            <input id="wx_keyword1" name="keyword1" type="text" value="" maxlength="99/">
                                        </div>
                                        <div class="modify-album-name">
                                            <span>起始地:</span>
                                            <input id="wx_keyword2" name="keyword2" type="text" value="" maxlength="99/">
                                        </div>
                                        <div class="modify-album-name">
                                            <span>目的地:</span>
                                            <input id="wx_keyword3" name="keyword3" type="text" value="" maxlength="99/">
                                        </div>
                                        <div class="modify-album-name">
                                            <span>订单价格:</span>
                                            <input id="wx_keyword4" name="keyword4" type="text" value="" maxlength="99/">
                                        </div>
                                        <div class="modify-album-name">
                                            <span>定金金额:</span>
                                            <input id="wx_keyword5" name="keyword5" type="text" value="" maxlength="99/">
                                        </div>
                                        <div class="modify-album-name">
                                            <span>支付提醒:</span>
                                            <input id="wx_keyword6" name="keyword6" type="text" value="" maxlength="99/">
                                        </div>
                                    </div>
                                </div>
                                </form>
                                <div class="dialogJanswers" style="padding: 10px 20px 13px 18px;">
                                    <input type="button" id="formWXSMS_submit" class="dialogJbtn first-child" onclick="JS_WXSMSCreateSave()" value="发送"> 
                                    <input type="button" class="dialogJbtn" onclick="JS_WXSMSCreateClose()" value="取消">
                                </div>
                            </div>
                            <!--发送短信  end-->
                            <%End If%>
                          <%End if%>
                            <%
                            if PositionURLID="1" then PositionURLID=11
                            ReturnURL=session("PositionURL"&PositionURLID)
                            if InStr(ReturnURL,"?")<1 then
                              ReturnURL=ReturnURL&"?ReturnURLID="&(PositionURLID)
                            else
                              ReturnURL=ReturnURL&"&ReturnURLID="&(PositionURLID)
                            end if
                            %>
                            <li><a href="<%=ReturnURL%>">返回</a></li>
                        </ul>
                    </div>
                    <!-- end box / title -->
                    <!--#include virtual="/inc/SystemMessages.gds" -->
 
                    <form id="form1" name="form1" action="admin_save.gds" method="post" style="min-width: 1110px;">
                    <input name="admin_save" type="hidden" value="19">
                    <input name="ServiceOrdID" type="hidden" value="<%=ServiceOrdID%>">
                    <input name="Phone" type="hidden" value="<%=Phone%>">
                    <input name="ServiceOrdState" type="hidden" value="<%=ServiceOrdState%>">
                    <input name="ServiceOrd_Check" type="hidden" value="">
                    <input name="NEWOrder" type="hidden" value="<%=NEWOrder%>">
                    <div class="form">
                        <div class="fields">
                            <div class="field  field-first">
                                <div class="label" style="float: left;margin-left: 0px;">
                                    <label for="input-small">单据编号:</label>
                                </div>
                                <div class="input" style="float:left;margin-left: 70px;">
                                    <input type="text" id="ServiceOrdID_TXT" name="ServiceOrdID_TXT" class="small <%If ServiceOrdState=4 then%>error<%else%>valid<%End if%>" style="width:138px;" value="<%=ServiceOrdID_TXT%>" readonly="true">
                                </div>
                                <div class="label" style="float: left;margin-left: 231px;">
                                    <label for="input-small">单据类型:</label>
                                </div>
                                <div class="input" style="float:left;margin-left: 75px;">
                                    <select name="ServiceOrdType" id="ServiceOrdType" style="width:50px;height:28px;" class="select">
                                        <%If ServiceOrdClass="AB" Then OrdClassSql=" and vID=5 "
                                        sql="select vID,vtext from dictionary where vtitle='ServiceOrderType'"&OrdClassSql&" order by vOrder"
                                        rs.open Sql,objConn,1,1
                                        do while not rs.Eof%>
                                        <option value="<%=rs("vID")%>"<%if ServiceOrdType=rs("vID") then Response.Write " selected"%>><%=rs("vtext")%></option>
                                        <%rs.movenext
                                          Loop
                                          rs.close()%>
                                    </select>
                                    <%If ServiceOrdID="" Or ServiceOrdUnitID<>"0" Then%>
                                    <select name="ServiceOrdClass" id="ServiceOrdClass" style="width:90px;height:28px;" class="select">
                                         <%admin_OrderClassPS=SPLIT(admin_OrderClass,",")
                                            isOrderClass=0
                                            for z = 0 to UBOUND(admin_OrderClassPS)
                                                If OrderClassB(admin_OrderClassPS(z),"vType")="1" Then
                                                    If ServiceOrdClass=admin_OrderClassPS(z) Then isOrderClass=1%>
                                                  <option value="<%=admin_OrderClassPS(z)%>"<%if ServiceOrdClass=admin_OrderClassPS(z) then Response.Write " selected"%>><%=OrderClassB(admin_OrderClassPS(z),"vtext")%></option>
                                                <%End If
                                            Next
                                            If isOrderClass=0 Then%>
                                            <option value="<%=ServiceOrdClass%>" selected><%=OrderClassB(ServiceOrdClass,"vtext")%></option>
                                            <%
                                            End If
                                            %>
                                    </select>
                                    <%else%>
                                    <input name="ServiceOrdClass" type="hidden" value="<%=ServiceOrdClass%>">
                                    <input type="text" name="ServiceOrdClassTXT" class="small valid" style="width:84px;float:none;" value="<%=OrderClassB(ServiceOrdClass,"vtext")%>" readonly="true">
                                    <%End If%>
                                </div>
                                <div class="label" style="float: left;margin-left: 455px;">
                                    <label for="input-small">单据状态:</label>
                                </div>
                                <div class="input" style="float:left;margin-left: 75px;">
                                    <input type="text" id="ServiceOrdStateTXT" name="ServiceOrdStateTXT" class="small <%If ServiceOrdState=4 then%>error<%else%>valid<%End if%>" style="width:132px;" value="<%=ServiceOrdStateTXT%>" readonly="true">
                                </div>
 
                                <div class="label" style="float: left;margin-left:673px;">
                                    <label for="input-small">开单时间:</label>
                                </div>
                                <div class="input" style="float:left;margin-left: 65px;">
                                    <input type="text" id="ServiceOrdStartDate" name="ServiceOrdStartDate" class="small valid" style="width:138px;" value="<%=ServiceOrdStartDate%>" readonly="true">
                                </div>
                            
                            </div>
 
                            <%'取消原因
                            If ServiceOrdCancelReason<>"" And ServiceOrdCancelReason<>"0" then%>
                            <div class="field">
                                        <div class="label" style="float: left;margin-left: 0px;"><label for="input-small">取消原因:</label></div>
                                        <div class="input" style="float:left;margin-left: 70px;">
                                            <input type="text" id="ServiceOrdCancelReason" name="ServiceOrdCancelReason" class="small error" style="width:132px;" value="<%=CancelReasonA(ServiceOrdCancelReason)%>" readonly="true">
                                        </div>
                                        <div class="label" style="float: left;margin-left: 247px;"><label for="input-small">备注:</label></div>
                                        <div class="input" style="float:left;margin-left: 70px;">
                                            <input type="text" id="ServiceOrdCancelReasonTXT" name="ServiceOrdCancelReasonTXT" class="small error" style="width:432px;" value="<%=ServiceOrdCancelReasonTXT%>" readonly="true">
                                        </div>
                            </div>
                            <%End if%>
 
                            <div class="field">
                                        <%'客服人员
                                        If ServiceOrd_CC_ID="" Then ServiceOrd_CC_ID=session("adminID")
                                        If ServiceOrd_CC_ID<>"" Then ServiceOrd_CC_Name=OAUser(ServiceOrd_CC_ID,"UserName")
                                        EntourageID="-1"
                                        departmentID="9"
                                        %>
                                        <div class="label" style="float: left;margin-left: 0px;"><label for="input-small">客服:</label></div>
                                        <div class="input" style="float:left;margin-left: 70px;">
                                            <input id="Entourage_<%=EntourageID%>" name="ServiceOrd_CC_ID" type="hidden" value="<%=ServiceOrd_CC_ID%>">
                                            <input type="text" id="EntourageName_<%=EntourageID%>" name="ServiceOrd_CC_Name" class="small" onclick="javascript:JS_EntourageOpen('<%=EntourageID%>','-<%=departmentID%>');" style="width:138px;" value="<%=ServiceOrd_CC_Name%>" readonly="true">
                                        </div>
 
                                        <%'销售人员
                                        If ServiceOrd_Sale_ID<>"" Then ServiceOrd_Sale_Name=OAUser(ServiceOrd_Sale_ID,"UserName")
                                        EntourageID="-3"
                                        departmentID="10"
                                        %>
                                        <div class="label" style="float: left;margin-left: 226px;"><label for="input-small">销售:</label></div>
                                        <div class="input" style="float:left;margin-left: 76px;">
                                            <input id="Entourage_<%=EntourageID%>" name="ServiceOrd_Sale_ID" type="hidden" value="<%=ServiceOrd_Sale_ID%>">
                                            <input type="text" id="EntourageName_<%=EntourageID%>" name="ServiceOrd_Sale_Name" class="small<%If InStr(error,",ServiceOrd_Sale_Name,")>0 Or ServiceOrd_Sale_Name="" Then Response.Write " error"%>" onclick="javascript:JS_EntourageOpen('<%=EntourageID%>','-<%=departmentID%>');" style="width:136px;" value="<%=ServiceOrd_Sale_Name%>" readonly="true">
                                        </div>
 
                                        <div class="label" style="float: left;margin-left: 452px;"><label for="input-small">介绍人:</label></div>
                                        <div class="input" style="float:left;margin-left: 70px;">
                                            <input id="Entourage_ServiceOrdIntroducer" name="ServiceOrdIntroducer" type="hidden" value="<%=ServiceOrdIntroducer%>">
                                            <input type="text" id="EntourageName_ServiceOrdIntroducer" name="ServiceOrdIntroducerName" class="small<%If InStr(error,",ServiceOrdIntroducer,")>0 Then Response.Write " error"%>" onclick="javascript:JS_EntourageOpen('ServiceOrdIntroducer','ServiceOrdIntroducer');" style="width:133px;" value="<%=UnitIntroducer(ServiceOrdIntroducer,"UnitName")%>" readonly="true">
 
                                        </div>
 
                                        <div class="label" style="float: left;margin-left: 682px;"><label for="input-small">电话来源:</label></div>
                                        <div class="input" style="float:left;margin-left: 72px;">
                                        <select name="ServiceOrdSource" id="ServiceOrdSource" <%If InStr(error,",ServiceOrdSource,")>0 Or ServiceOrdSource="" Or ServiceOrdSource="0" Then Response.Write " style=""width:138px;height:30px;background-color:#FBE3E4;border:1px solid #FBC2C4;""" Else Response.Write  " style=""width:138px;"" class=""select1""" %>>
                                            <option value="">无指定</option>
                                            <%
                                            If ServiceOrdSource="" Then ServiceOrdSource=0
                                            sql="select vID,vtext from dictionary where vtitle in ('OrdSource') and vType=1 order by vOrder"
                                            rs.open sql,objConn,1,1
                                            do while not rs.Eof
                                              vID    = rs("vID")
                                              vtext    = rs("vtext")
                                              %>
                                              <option value="<%=vID%>"<%if Clng(ServiceOrdSource)=Clng(vID) then Response.Write " selected"%>><%=vtext%></option>
                                              <%
                                             rs.movenext
                                            Loop
                                            rs.close()%>
                                        </select>
                                        
                                        </div>
                            </div>
                            
                <%If OrderLevel<>1 Or isDepartment("020111")=1 Then%>
                        <!-- 服务单数据 -->
                        <!--#INCLUDE FILE="ServiceOrder_Data_9.9.gds" -->
                <%End If%>
                        <%If NEWOrder="2" Then%>
                            <div class="field" style="height: 25px;">
                                <div class="label" style="float: left;margin-left:0px;">
                                    <label for="input-small">绩效计价:</label>
                                </div>
                                <div class="input" style="float:left;margin-left: 70px;">
                                    <input type="text" id="DispatchOrdPerfomance" name="DispatchOrdPerfomance" class="small<%If DispatchOrd_AP_Check=1 Or isDepartment("030112")=0 Then Response.Write " valid"%>" style="width:138px;" value="<%=DispatchOrdPerfomance%>"<%If DispatchOrd_AP_Check=1 Or isDepartment("030112")=0 Then Response.Write " readonly=""true""" %>>
                                </div>
                                <div class="label" style="float: left;margin-left:242px;">
                                    <label for="input-small">担架费:</label>
                                </div>
                                <div class="input" style="float:left;margin-left: 70px;">
                                    <input type="text" id="StretcherMoney" name="StretcherMoney" class="small<%If DispatchOrd_AP_Check=1 Or isDepartment("030112")=0 Then Response.Write " valid"%>" style="width:138px;" value="<%=StretcherMoney%>"<%If DispatchOrd_AP_Check=1 Or isDepartment("030112")=0 Then Response.Write " readonly=""true""" %>>
                                </div>
                            </div>
                        <%End if%>
                        <style>
                        .closeimg  
                        {  
                            position : absolute;  
                            width : 20px;  
                            height : 20px;  
                            margin-left: -25px;
                            z-index: 100;
                        } 
                        </style>
                        <%
                        If ServiceOrdID<>"" Then
                        sql="select * from ImageData where SOrdIDDt="&ServiceOrdID&" and ImageDel=0 order by ImageType,UpImageTime"
                        rs.open sql,objConn,1,1
                        ImageTypeOld=0
                        i=0
                        do while not rs.Eof
                            ImageID        = rs("id")
                            ImageType    = rs("ImageType")
                            ImageUrl    = rs("ImageUrl")
                            ImageUrls    = rs("ImageUrls")
                            ImageDeg    = rs("ImageDeg")
                            UpImageTime    = rs("UpImageTime")
                            UpImageOAid    = rs("UpImageOAid")
                            If Len(ImageUrls)>0 Then
                                strPICUrl=ImageUrls
                            Else
                                strPICUrl=ImageUrl
                            End If
                              
                            If ImageTypeOld<>ImageType Then
                            ImageTypeOld=ImageType
                            If i>0 Then Response.Write "</div>"%>
                                <div style=" margin:10px 10px;border-bottom: 1px solid #f1f1f1;"><%=ImageTypeA(ImageType)%><br>
                            <%End If%>
                                        <a href="/Image.gds?ImageID=<%=ImageID%>" target="_blank"><img src="<%=strPICUrl%>" width="80" border="0" style="margin: 10px;transform: rotate(<%=ImageDeg%>deg);-ms-transform:rotate(<%=ImageDeg%>deg);-moz-transform:rotate(<%=ImageDeg%>deg);-webkit-transform:rotate(<%=ImageDeg%>deg);-o-transform:rotate(<%=ImageDeg%>deg);"></a>
                                        <a href="javascript:DelImage_JS('<%=ImageID%>')" ><img src="/resources/images/xx.png" class="closeimg" alt="删除文档" width="20px" height="20px" /></a><br><%=OAUser(UpImageOAid,"UserName")%><br><%=UpImageTime%>
                        <%i=i+1
                        rs.movenext
                        loop
                        rs.close()
                        If ImageID<>"" Then Response.Write "</div>"
                        End If
                        %>
                <%If OrderLevel<>1 Or isDepartment("020111")=1 Then%>
                        <span id="buttonDivHeight"></span>
                            <div class="field" id="buttonDiv" style="height: 45px;border-bottom: initial;position: fixed;width: 79.5%;left: 290px;bottom: 0px;background-color:white;padding: 0 20px 10px 20px;min-width: 1110px;">
                                <div class="buttons">
                                <div class="highlight" id="addSave">
                                  <%If ServiceOrdID="" And NEWOrder="2" And isDepartment("030101")=1 then%>
                                    <%If SystemMessageType="4" then%><input type="button" name="submit48_2" value="保存咨询单" class="ui-state-default" onclick="form1_submit19_1();">&nbsp;&nbsp;<%End if%>
                                    <input type="button" name="submit48_1" value="下一步" class="ui-state-default" onclick="form1_submit19_2();">&nbsp;&nbsp;
                                  <%else%>
                                    <%If (ServiceOrdID="" Or ServiceOrdState="1") And (isDepartment("020101")=1 Or isDepartment("020102")=1) then%><input type="button" name="submit48_2" value="保存咨询单" class="ui-state-default" onclick="<%If ServiceOrdID="" then%>form1_submit19_1();<%else%>form1_submit20_1();<%End if%>">&nbsp;&nbsp;<%End if%>
                                    <%If (ServiceOrdID="" Or ServiceOrdID="" Or ServiceOrdState="1") And (isDepartment("020101")=1 Or isDepartment("020102")=1) then%><input type="button" name="submit48_1" value="生成服务单" class="ui-state-default" onclick="<%If ServiceOrdID="" then%>form1_submit19_2();<%else%>form1_submit20_2();<%End if%>">&nbsp;&nbsp;<%End if%>
                                    
                                    <%If ServiceOrdID<>"" And (ServiceOrdState="2" Or (ServiceOrdState="3")) And isDepartment("020102")=1 then%><input type="button" name="submit48_1" value="保存服务单" class="ui-state-default" onclick="form1_submit20_2();">&nbsp;&nbsp;<%End if%>
                                    <%If ServiceOrdID<>"" And ServiceOrdState="2" And ServiceOrd_AP_Check="0" And isDepartment("020105")=1 then%><input type="button" name="submit48_1" value="审核" class="ui-state-default" onclick="form1_submit20_3();">&nbsp;&nbsp;<%End if%>
                                    <%If ServiceOrdID<>"" And ServiceOrdState="2" And ServiceOrd_AP_Check="1" And isDepartment("020105")=1 then%><input type="button" name="submit48_1" value="反审核" class="ui-state-default" onclick="form1_submit20_5();">&nbsp;&nbsp;<%End if%>
                                    <%If ServiceOrdID<>"" And ServiceOrdState="2" And ServiceOrd_AP_Check="0" And isDepartment("020107")=1 then%><input type="button" name="submit48_1" value="取消服务单" class="ui-state-default" onclick="JS_CancelOpen('5');">&nbsp;&nbsp;<%End if%>
                                    <%If ServiceOrdID<>"" And (ServiceOrdState="2" Or ServiceOrdState="3") And ServiceOrd_AP_Check="1" And isDepartment("030101")=1 then%>
                                    <input type="button" id="form_Dispatch" name="submit48_1" value="生成调度单" class="ui-state-default" onclick="form1_Dispatch();">&nbsp;&nbsp;
                                    <!--<input type="button" name="submit48_1" value="生成居家ICU调度单" class="ui-state-default" onclick="form1_Dispatch();">&nbsp;&nbsp;
                                    <input type="button" name="submit48_1" value="生成大型活动保障调度单" class="ui-state-default" onclick="form1_Dispatch();">&nbsp;&nbsp;-->
                                    <%End if%>
                                    <%If ServiceOrdID="" And isDepartment("020101")=1 then%><input type="button" name="submit48_2" value="无效电话" class="ui-state-default" onclick="JS_CancelOpen('4_1');">&nbsp;&nbsp;<%End if%>
                                    <%If ServiceOrdID<>"" And ServiceOrdState="1" And isDepartment("020101")=1 then%><input type="button" name="submit48_2" value="作废咨询单" class="ui-state-default" onclick="JS_CancelOpen('5');">&nbsp;&nbsp;<%End if%>
                                    <%If ServiceOrdID<>"" And ServiceOrdState="4" And isDepartment("020101")=1 then%><input type="button" name="submit48_2" value="还原服务单" class="ui-state-default" onclick="form1_submit20_2();">&nbsp;&nbsp;<%End if%>
                                    <%If ServiceOrdID<>"" And ServiceOrdState>=2 And isDepartment("020107")=1 And 1=2 then%><input type="button" name="submit48_2" value="打印服务单" class="ui-state-default" onclick="form1_submit48_2();">&nbsp;&nbsp;<%End if%>
                                    <%If isDepartment("020109")=0 And session("Power_"&ServiceOrdID)<>"1" And DispatchOrdID="" And ServiceOrdID<>"" Then%><input type="button" name="submit51" id="OrdSendOAOpen" value="订单通知推送" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" onclick="javascript:JS_OrdSendOAOpen()">&nbsp;&nbsp;<%End If%>
                                  <%End if%>
                                  <span id="vic"></span>
                                </div>
                                </div>
                            </div>
                        <script LANGUAGE="javascript">
                        var oTop = $("#buttonDivHeight").offset().top-document.body.offsetHeight+75;//默认上边距离
                        window.onscroll=function(){
                            if(document.documentElement.scrollTop > oTop ){
                                document.getElementById("buttonDiv").style.cssText="height: 45px;border-bottom: initial;"
                            }else{
                                document.getElementById("buttonDiv").style.cssText="height: 45px;border-bottom: initial;position: fixed;width: 79.5%;left: 290px;bottom: 0px;background-color:white;padding: 0 20px 10px 20px;min-width: 1110px;"
                            }
                        }
                        </script>
                <%End If%>
                        </div>
                    </div>
                    
 
                    <%If (ServiceOrdID<>"" And ((ServiceOrdState="2" And ServiceOrd_AP_Check="0" And isDepartment("020107")=1) or (ServiceOrdState="1" And isDepartment("020101")=1))) Or (ServiceOrdID="" And isDepartment("020101")=1) then%>
                            <!--取消调用单-->
                            <script LANGUAGE="javascript">
                                //打开取消窗口
                                function JS_CancelOpen(ServiceOrdState)
                                {
                                var sTop=document.documentElement.scrollTop;
                                    if (sTop==0) {sTop=document.body.scrollTop;}
                                var sLeft= document.documentElement.scrollLeft;
                                    if (sLeft==0) {sLeft=document.body.scrollLeft;}
                                var dTop = document.getElementById("addSave").getBoundingClientRect().top;
                                var dLeft = document.getElementById("addSave").getBoundingClientRect().left;
                                if (dTop<200) {dTop=200;}
                                if (dLeft<120) {dLeft=120;}
                                CancelCreate.style.display="block";
                                CancelCreate.style.left=(dLeft-230)+"px";
                                CancelCreate.style.top=(sTop+dTop-350)+"px";
                                CancelCreate.style.display='block';
                                if (ServiceOrdState=='4_1')
                                {
                                    document.form1.admin_save.value = "19";
                                    document.form1.NEWOrder.value = "";
                                    document.form1.ServiceOrdState.value = "4";
                                }
                                else
                                {
                                    document.form1.ServiceOrdState.value=ServiceOrdState
                                    document.form1.admin_save.value = "20";
                                }
                                }
 
                                //取消调用单-关闭上传窗口
                                function JS_CancelCreateClose()
                                {
                                CancelCreate.style.display="none";
                                }
                                //取消调用单-保存
                                function JS_CancelCreateSave()
                                {
                                    var a = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/
                                    var b = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2})$/
 
                                    if(document.form1.CancelReason.value=='' || document.form1.CancelReason.value=='0') {
                                        alert('请选择取消原因!!');
                                        return false;
                                    }
                                    if(confirm("确定取消服务单?"))
                                    {
                                        document.form1.action = "admin_save.gds";
                                        document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                                        form1.submit();
                                    }
                                }
                            </script>
                            <!--取消调用单-->
                            <div class="dialogJ  dialogJfix dialogJshadow" id="CancelCreate" style="width: 370px; right: 300px; top: 150px;display:none;">
                                <div class="dialogJtitle">
                                    <a href="javascript:JS_CancelCreateClose();" class="dialogJclose" title="关闭本窗口">&nbsp;</a>
                                    <span class="dialogJtxt" id="EditPhotoTXT">取消服务单</span>
                                </div>
                                <div class="dialogJcontent">
                                    <div class="dialogJbody" id="dialogJbody" style="height: 210px;">
                                        <div class="modify-album-name">
                                            <span>取消原因:</span>
                                            <select name="CancelReason" id="CancelReason" style="padding: 5px 0 5px 8px;">
                                                <option value="">请选择</option>
                                                <%sql="select vID,vtext from dictionary where vtitle='CancelReason' and vType>=1 order by vOrder"
                                                rs.open Sql,objConn,1,1
                                                do while not rs.Eof%>
                                                <option value="<%=rs("vID")%>"><%=rs("vtext")%></option>
                                                <%rs.movenext
                                                Loop
                                                rs.close()%>
                                            </select>
                                        </div>
                                        <div class="modify-album-name">
                                            <span>备注:</span>
                                            <input id="CancelReasonTXT" name="CancelReasonTXT" class="text" type="text" value="<%=CancelReason%>" style="width: 165px;" maxlength="99/">
                                        </div>
                                    </div>
                                </div>
                                <div class="dialogJanswers">
                                    <input type="button" class="dialogJbtn first-child" onclick="JS_CancelCreateSave()" value="确定"> 
                                    <input type="button" class="dialogJbtn" onclick="JS_CancelCreateClose()" value="取消">
                                </div>
                            </div>
                            <!--取消调用单 end-->
                        <%End if%>
 
                    </form>
                    <script LANGUAGE="javascript">
                        //生成咨询单(新增)
                        function form1_submit19_1(){
                        document.form1.action = "admin_save.gds";
                        document.form1.admin_save.value = "19";
                        document.form1.NEWOrder.value = "";
                        document.form1.ServiceOrdState.value = "1";
                        document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                        form1.submit();
                        }
                        //生成服务单(新增)
                        function form1_submit19_2(){
                        document.form1.action = "admin_save.gds";
                        document.form1.admin_save.value = "19";
                        document.form1.ServiceOrdState.value = "2";
                        document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                        form1.submit();
                        }
                        //生成无效电话(新增)
                        function form1_submit19_4(){
                            if(confirm("确定来电设为无效?"))
                            {
                                document.form1.action = "admin_save.gds";
                                document.form1.admin_save.value = "19";
                                document.form1.NEWOrder.value = "";
                                document.form1.ServiceOrdState.value = "4";
                                document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                                form1.submit();
                            }
                        }
                        
                        //保存咨询单(修改)
                        function form1_submit20_1(){
                        document.form1.action = "admin_save.gds";
                        document.form1.admin_save.value = "20";
                        document.form1.NEWOrder.value = "";
                        document.form1.ServiceOrdState.value = "1";
                        document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                        form1.submit();
                        }
                        //生成/保存服务单(修改)
                        function form1_submit20_2(){
                        document.form1.action = "admin_save.gds";
                        document.form1.admin_save.value = "20";
                        document.form1.ServiceOrdState.value = "2";
                        document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                        form1.submit();
                        }
                        //审核服务单(修改)
                        function form1_submit20_3(){
                        if(confirm("确定审核服务单?"))
                            {
                                document.form1.action = "admin_save.gds";
                                document.form1.admin_save.value = "20";
                                document.form1.ServiceOrd_Check.value = "1";
                                document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                                form1.submit();
                            }
                        }
                        //反审核服务单(修改)
                        function form1_submit20_5(){
                        if(confirm("确定反审核服务单?"))
                            {
                                document.form1.action = "admin_save.gds";
                                document.form1.admin_save.value = "20";
                                document.form1.ServiceOrd_Check.value = "0";
                                document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                                form1.submit();
                            }
                        }
                        //取消服务单(修改并还原为咨询单)
                        function form1_submit20_4(){
                            if(confirm("确定取消服务单,还原为咨询单吗?"))
                            {
                                document.form1.action = "admin_save.gds";
                                document.form1.admin_save.value = "20";
                                document.form1.ServiceOrdState.value = "4";
                                document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                                form1.submit();
                            }
                        }
                        //作废咨询单(新增)
                        function form1_submit20_6(){
                            if(confirm("确定咨询单设为无效?"))
                            {
                                document.form1.action = "admin_save.gds";
                                document.form1.admin_save.value = "20";
                                document.form1.ServiceOrdState.value = "5";
                                document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                                form1.submit();
                            }
                        }
                        
                        //修改单据类型
                        function form1_OrdClass(OrdClass){
                        document.form1.action = "ServiceOrder.gds?NEWOrder=<%=NEWOrder%>&OrdClass="+OrdClass;  
                        document.getElementById("zhezhao").style.display="block"; 
                        document.getElementById("login").style.display="block";
                        form1.submit();
                        }
                        //地图-关闭窗口
                        function JS_BaiduCalCreateClose()
                        {
                        BaiduCalCreate.style.display="none";
                        //document.getElementById("frm_street").value="";
                        //document.getElementById("frm_end").value="";
                        }
                        //地图-清空计价
                        function JS_BaiduCalCreateEmpty()
                        {
                            document.getElementById('ServiceOrdTraDuration').value='';
                            document.getElementById('ServiceOrdTraDistance').value='';
                            document.getElementById('ServiceOrdTraOfferPrice').value=0;
                            document.getElementById('ServiceOrdTraTxnPrice').value=0;
                        }
                        //地图-确定地址
                        function JS_BaiduCalCreateSave()
                        {
                            //服务单地址
                            document.getElementById('ServiceOrdTraStreet').value=document.getElementById('search0').value; //出发地
                            document.getElementById('ServiceOrdTraEnd').value=document.getElementById('search1').value;    //目的地
                            //途经地
                            var OrdTraVia="";
                            var frmTxt="";
                            for(var i=2;i<=7;i++){
                                frmTxt=document.getElementById("search"+i).value;
                                if (frmTxt!=''){OrdTraVia +=" => "+frmTxt;}
                            }
                            if (OrdTraVia!=''){OrdTraVia=OrdTraVia.substring(4);document.getElementById('OrdTraVia').style.display='block';}
                            else {document.getElementById('OrdTraVia').style.display='none';}
                            document.getElementById('ServiceOrdTraVia').value=OrdTraVia;
 
                            //计算标准报价
                            document.getElementById('ServiceOrdTraDuration').value=document.getElementById('frm_Duration').value; //获取时间
                            document.getElementById('ServiceOrdTraDistance').value=document.getElementById('frm_Distance').value; //获取距离
                            if (document.getElementById('ServiceOrdTraOfferPrice_A').value=="0" || document.getElementById('ServiceOrdTraOfferPrice_A').value=="") {document.getElementById('ServiceOrdTraOfferPrice').value=document.getElementById('frm_OfferPrice').value;}
                            document.getElementById('ServiceOrdTraTxnPrice').value=document.getElementById('frm_OfferPrice').value;
                            <%If NEWOrder="2" Then%>document.getElementById('DispatchOrdPerfomance').value=document.getElementById('frm_OfferPrice').value;<%end if%>
                            JS_BaiduCalCreateClose();
                            MapDel_JS()
                        }
 
                        //地图-确定地址_旧
                        function JS_BaiduCalCreateSave_old(sw,Lu,ret1,ret,transfer)
                        {
                            //服务单地址
                            document.getElementById('ServiceOrdTraStreet').value=document.getElementById('hidden_street').value; //出发地
                            document.getElementById('ServiceOrdTraEnd').value=document.getElementById('hidden_end').value;    //目的地
                            document.getElementById('ServiceOrdTraStreetCoo').value=sw; //起点坐标
                            document.getElementById('ServiceOrdTraEndCoo').value=Lu; //起点坐标
                            
                            //计算标准报价
                            var TraUnitPrice=document.getElementById('ServiceOrdTraUnitPrice').value;
                            var km="";
                            if (ret.indexOf("公里")>=1) {km=ret.replace(/公里/, "");}
                            else {km=ret.replace(/米/, "");km=parseFloat(km)/1000;}
                            km=parseFloat(km);
                            OfferPrice=parseFloat(document.getElementById('ServiceOrdTraOfferPrice').value)
 
                            if (transfer==1 && OfferPrice>60)
                            {    //A-B-C报价
                                document.getElementById('ServiceOrdTraDuration').value=document.getElementById('ServiceOrdTraDuration').value+"+"+ret1; //获取时间
                                document.getElementById('ServiceOrdTraDistance').value=document.getElementById('ServiceOrdTraDistance').value+"+"+ret; //获取距离
                                if (TraUnitPrice!='')
                                {
                                    
                                    TraUnitPrice=parseFloat(TraUnitPrice);
                                    document.getElementById('ServiceOrdTraOfferPrice').value=parseFloat(document.getElementById('ServiceOrdTraOfferPrice').value)+TraUnitPrice*km;
                                    document.getElementById('ServiceOrdTraTxnPrice').value=parseFloat(document.getElementById('ServiceOrdTraTxnPrice').value)+TraUnitPrice*km;
                                }
                            }
                            else
                            {    //A-B报价
                                document.getElementById('ServiceOrdTraDuration').value=ret1; //获取时间
                                document.getElementById('ServiceOrdTraDistance').value=ret; //获取距离
                                if (TraUnitPrice!='')
                                {
                                    TraUnitPrice=parseFloat(TraUnitPrice);
                                    document.getElementById('ServiceOrdTraOfferPrice').value=TraUnitPrice*km;
                                    document.getElementById('ServiceOrdTraTxnPrice').value=TraUnitPrice*km;
                                }
                            }
                        }
                    </script>
                    <div class="dialogJ  dialogJfix dialogJshadow" id="BaiduCalCreate" style="width: 1215px;left: 80px; top: 110px;height:696px ;display:none;">
                        <div class="dialogJtitle">
                            <a href="javascript:JS_BaiduCalCreateClose();" class="dialogJclose" title="关闭本窗口">&nbsp;</a>
                            <span class="dialogJtxt" id="EditPhotoTXT">选择路线</span>
                        </div>
                        <div class="dialogJcontent" style="margin-left: 5px;margin-right:5px;">
                        <!--#include virtual="/inc/baidu_cal1.gds" -->
                        </div>
                    </div>
 
                    <div class="dialogJ  dialogJfix dialogJshadow" id="window_Entourage" style="z-index: 50007; width: 350px; left: 0px; top: 0px;display:none;">
                    <div class="dialogJtitle">
                        <a href="javascript:JS_EntourageClose();" class="dialogJclose" title="关闭本窗口">&nbsp;</a>
                        <span class="dialogJtxt">选择人员</span>&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="EntourageSearchTXT" name="EntourageSearchTXT" value="<%=EntourageSearchTXT%>" style="width: 100px;" onkeyup="JS_EntourageSearch();"/>&nbsp;<input type="button" name="button3" value="查询" onclick="JS_EntourageSearch();">&nbsp;<input type="button" name="button3" value="清空" onclick="JS_EntourageDel();">
                    </div>
                    <div class="dialogJcontent">
                        <div class="box">
                                <div class="table" style="padding: 0px;">
                                    <input name="window_EntourageID" type="hidden" value="">
                                    <input name="window_OA_CompetencyID" type="hidden" value="">
                                    <table>
                                        <thead>
                                            <tr>
                                                <th class="selected left">&nbsp;</th>
                                                <th class="category" style="text-align: center;">姓名</th>
                                                <th class="category last" style="text-align: center;">手机</th>
                                            </tr>
                                        </thead>
                                        <tbody id="EntourageList">
                                            <%for j=0 to 6%>
                                                <tr>
                                                    <td class="selected">&nbsp;</td>
                                                    <td class="category">&nbsp;</td>
                                                    <td class="category last">&nbsp;</td>
                                                </tr>
                                            <%next%>
                                        </tbody>
                                    </table>
                            </div>
                    </div>
                    </div>
                </div>
                <script LANGUAGE="javascript">
                //打开选择人员窗口
                function JS_EntourageOpen(id,OA_CompetencyID)
                {
                var sTop=document.documentElement.scrollTop;
                    if (sTop==0) {sTop=document.body.scrollTop;}
                var sLeft= document.documentElement.scrollLeft;
                    if (sLeft==0) {sLeft=document.body.scrollLeft;}
 
                var dTop = document.getElementById("EntourageName_"+id).getBoundingClientRect().top;
                if (dTop<200) {dTop=110;}
                var dLeft = document.getElementById("EntourageName_"+id).getBoundingClientRect().left;
                if (dLeft<200) {dLeft=200;}
                window_Entourage.style.display="block";
                window_Entourage.style.left=(dLeft-100)+"px";
                window_Entourage.style.top=(sTop+dTop+30)+"px";
                document.all.window_EntourageID.value=id;
                document.all.window_OA_CompetencyID.value=OA_CompetencyID;
                if (OA_CompetencyID!=0){window.HiddenFrame.location.replace('AdminUserSearch.gds?OrdClass=<%=ServiceOrdClass%>&OA_CompetencyID='+OA_CompetencyID);}
                document.getElementById('EntourageSearchTXT').focus();
                }
                //关闭选择人员窗口
                function JS_EntourageClose()
                {
                document.all.EntourageSearchTXT.value='';
                document.all.window_EntourageID.value="";
                window_Entourage.style.display="none";
                }
                //选择人员查询
                function JS_EntourageSearch()
                {
                EntourageSearchTXT=document.all.EntourageSearchTXT.value;
                OA_CompetencyID=document.all.window_OA_CompetencyID.value;
                window.HiddenFrame.location.replace('AdminUserSearch.gds?OrdClass=<%=ServiceOrdClass%>&OA_CompetencyID='+OA_CompetencyID+'&EntourageSearchTXT='+EntourageSearchTXT);
                }
                function EnterPress(e){ //传入 event 
                var e = e || window.event; 
                if(e.keyCode == 13){JS_EntourageSearch();} 
                } 
                //选择人员
                function JS_EntourageSave(OA_UserID,OA_UserName)
                {
                    id=document.all.window_EntourageID.value;
                    if (id=="OrdSendOAid")
                    {
                        OA_UserID_old=document.getElementById("Entourage_"+id).value;
                        OA_UserName_old=document.getElementById("EntourageName_"+id).value;
                        if (OA_UserID_old=='') {
                            document.getElementById("Entourage_"+id).value=OA_UserID;
                            document.getElementById("EntourageName_"+id).value=OA_UserName;
                        }else{
                            if (OA_UserName_old.indexOf(OA_UserName) == -1)
                            {
                                document.getElementById("Entourage_"+id).value=document.getElementById("Entourage_"+id).value+","+OA_UserID;
                                document.getElementById("EntourageName_"+id).value=document.getElementById("EntourageName_"+id).value+","+OA_UserName;
                            }
                        }
                        document.getElementById("EntourageName_"+id).className='small';
                    }else{
                        document.getElementById("Entourage_"+id).value=OA_UserID;
                        document.getElementById("EntourageName_"+id).value=OA_UserName;
                        document.getElementById("EntourageName_"+id).className='small';
                        document.all.window_EntourageID.value="";
                        JS_EntourageClose();
                    }
                }
                //选择人员清空
                function JS_EntourageDel()
                {
                    id=document.all.window_EntourageID.value;
                    document.getElementById("Entourage_"+id).value='';
                    document.getElementById("EntourageName_"+id).value='';
                    document.getElementById("EntourageName_"+id).className='small';
                    document.all.window_EntourageID.value="";
                    JS_EntourageClose();
                }
                //显示人员列表窗口
                function JS_EntourageList(EntourageListArray,acc1,acc2,EntourageSearchTXT,OA_CompetencyID,OA_CompetencyName)
                {
                    var EntourageListHTML = "";
                    var i = 0;
                    if (EntourageListArray.length>0)
                    {
                        for (var i=0;i<EntourageListArray.length;i++)
                        {
                            EntourageListHTML = EntourageListHTML+"<tr onclick='JS_EntourageSave("+EntourageListArray[i][0]+",\""+EntourageListArray[i][1]+"\")' style='cursor:pointer'><td class='selected'><img src='"+EntourageListArray[i][3]+"' style='max-width:29px;max-height: 29px;'></td><td class='category'>"+EntourageListArray[i][1]+"</td><td class='selected last1'>"+EntourageListArray[i][2]+"</td></tr>";
                        }
                    }
                    if (acc2>1)
                    {
                        i=i+1;
                        EntourageListHTML = EntourageListHTML+"<tr><td class='selected'>&nbsp;</td><td colspan='2' style='text-align:center;'>";
                        if (acc1>1){EntourageListHTML = EntourageListHTML+"<a href='javascript:window.HiddenFrame.location.replace(\"AdminUserSearch.gds?OrdClass=<%=ServiceOrdClass%>&OA_CompetencyID="+OA_CompetencyID+"&EntourageSearchTXT="+EntourageSearchTXT+"&page="+(acc1-1)+"\");'>上一页</a>";}else{EntourageListHTML = EntourageListHTML+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";}
                        if (acc1<acc2){EntourageListHTML = EntourageListHTML+"&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:window.HiddenFrame.location.replace(\"AdminUserSearch.gds?OrdClass=<%=ServiceOrdClass%>&OA_CompetencyID="+OA_CompetencyID+"&EntourageSearchTXT="+EntourageSearchTXT+"&page="+(acc1+1)+"\");'>下一页</a></td></tr>";}
                    }
                    
                    for (var j=i;j<=6;j++)
                    {
                        EntourageListHTML = EntourageListHTML+"<tr><td class='selected'>&nbsp;</td><td class='price'>&nbsp;</td><td class='selected last1'>&nbsp;</td></tr>";
                    }
                    document.getElementById("EntourageList").innerHTML=EntourageListHTML;
                    
                }
                </script>
                <!-- end forms -->    
                </div>
                <!-- end forms -->    
                
 
 
                <%If ServiceOrdID<>"" And ServiceOrd_AP_Check="1" And isDepartment("03")=1 Then%>
                <!-- forms -->
                <div class="box">
                    <!-- box / title -->
                    <div class="title">
                        <h5>派车调度单</h5>
                    </div>
                    <!-- end box / title -->
                    <!-- end box / title -->
                    <div class="table">
                        <table>
                            <thead>
                                <tr style="white-space: nowrap;">
                                    <th>单据编号</th>
                                    <th>开单日期</th>
                                    <th>车牌号码</th>
                                    <%sql="select vID,vtext from dictionary where vType=1 and vtitle='DispatchOrdEntourage' order by vOrder"
                                    rs.open sql,objConn,1,1
                                    i=0
                                    EntourageIDs=""
                                    do while not rs.Eof
                                        EntourageID    = rs("vID")
                                        EntourageName= rs("vtext")
                                        EntourageIDs=EntourageIDs&","&EntourageID
                                        %>
                                        <th><%=EntourageName%></th>
                                        <%i=i+1
                                        rs.movenext
                                    loop
                                    rs.close()
                                    EntourageIDPS    = SPLIT(EntourageIDs,",")
                                    %>
                                    <th>出车时间</th>
                                    <th>行程</th>
                                    <th class="last">状态</th>
                                </tr>
                            </thead>
                            <tbody>
                            <%
                              sql="select * from DispatchOrd LEFT JOIN ServiceOrder on ServiceOrdIDDt=ServiceOrdID where ServiceOrdIDDt="&ServiceOrdID&" and DispatchOrdState>=0 order by DispatchOrdID"
                                'Response.Write sql
                                rs.open sql,objConn,1,1
                                i=0
                                StretcherMoney=0
                                do while not rs.Eof
                                  DispatchOrdID            = rs("DispatchOrdID")            '调度单号
                                  DispatchOrdClass        = rs("DispatchOrdClass")        '调度单单据类型
                                  ServiceOrdID            = rs("ServiceOrdID")            '受理单号
                                  ServiceOrdClass        = rs("ServiceOrdClass")            '受理单单据类型
                                  DispatchOrdState        = rs("DispatchOrdState")        '服务单状态
                                  DispatchOrd_NS_Time    = rs("DispatchOrd_NS_Time")    '开单日期
                                  DispatchOrdCarID        = rs("DispatchOrdCarID")        '调度车辆ID
                                  ServiceOrdApptDate    = rs("ServiceOrdApptDate")        '预约日期
                                  ServiceOrdCoName        = rs("ServiceOrdCoName")        '联系人姓名
                                  ServiceOrdCoPhone        = rs("ServiceOrdCoPhone")        '联系人电话
                                  ServiceOrdTraProvince    = rs("ServiceOrdTraProvince")    '出发地省份
                                  ServiceOrdTraCity        = rs("ServiceOrdTraCity")        '出发地城市
                                  ServiceOrdTraStreet    = rs("ServiceOrdTraStreet")        '出发地
                                  ServiceOrdTraEnd        = rs("ServiceOrdTraEnd")        '目的地
                                  ServiceOrdTraSDTime    = rs("ServiceOrdTraSDTime")        '拟出发时间
                                  DispatchOrd_AP_Check    = rs("ServiceOrd_AP_Check")        '审核状态(0未审核,1已审核)
                                  DispatchOrd_AP_ID        = rs("DispatchOrd_AP_ID")        '审核人员ID
                                  DispatchOrd_AP_Time    = rs("DispatchOrd_AP_Time")        '审核时间
                                  StretcherMoney        = StretcherMoney+rs("StretcherMoney")        '担架费
                                  DispatchOrdNo            = DispatchOrdClass& year(rs("DispatchOrd_NS_Time"))&Right("0"&month(rs("DispatchOrd_NS_Time")),2)&Right("0"&day(rs("DispatchOrd_NS_Time")),2) & "-"&Right("00"&rs("DispatchOrdNo"),3)    '调度单编号
 
                                  If DispatchOrdState<>10 Then i=i+1
 
                                  If ServiceOrdTraSDTime<>"" Then
                                    ServiceOrdTraSDTime=FORMATDATETIME(ServiceOrdTraSDTime,vbShortDate) &" "& Right("0"&Hour(ServiceOrdTraSDTime),2) &":"& Right("0"&Minute(ServiceOrdTraSDTime),2)
                                  End If
                                  If ServiceOrdApptDate<>"" Then
                                    ServiceOrdApptDate=FORMATDATETIME(ServiceOrdApptDate,vbShortDate) &" "& Right("0"&Hour(ServiceOrdApptDate),2) &":"& Right("0"&Minute(ServiceOrdApptDate),2)
                                  End If
                                  If DispatchOrdState<>10 Then Response.Write "<script LANGUAGE=""javascript"">document.getElementById(""form_Dispatch"").style.display='none';</script>"
                                  %>
                                  <tr style="white-space: nowrap;">
                                    <td class="category"><A HREF="DispatchOrder.gds?DispatchOrdID=<%=DispatchOrdID%>&OrdDateType=<%=OrdDateType%>&OrdClassList=<%=OrdClassList%>&h_menu1_1=1"><%=DispatchOrdNo%></A></td>
                                    <td class="category"><A HREF="DispatchOrder.gds?DispatchOrdID=<%=DispatchOrdID%>&OrdDateType=<%=OrdDateType%>&OrdClassList=<%=OrdClassList%>&h_menu1_1=1"><%=FORMATDATETIME(DispatchOrd_NS_Time,vbShortDate)%></A></td>
                                    <td class="selected"><%=DispatchOrdCarLicense%></td>
                                    <%
                                    for j = 1 to UBOUND(EntourageIDPS)
                                        EntourageID    = EntourageIDPS(j)
                                        %>
                                        <td class="category"><%=EntourageOANameA(EntourageID,DispatchOrdID,"UserName")%></td>
                                    <%Next%>
 
                                    <td class="category"><%=ServiceOrdTraSDTime%></td>
                                    <td class="category"><%=ServiceOrdTraStreet%>~<%=ServiceOrdTraEnd%></td>
                                    <td class="category last"><%=DispatchOrdStateA(DispatchOrdState)%></td>
                                  </tr>
                                <%rs.movenext
                                loop
                                rs.close()
                                %>
                            <%for j=i to 1%>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td class="last">&nbsp;</td>
                                    </tr>
                                <%next%>
                            </tbody>
                        </table>
                    </div>
                </div>
                <script LANGUAGE="javascript">
                        //生成调度单
                        <%if i>=1 then%>
                        
                        function form1_Dispatch(){
                        if(confirm("本受理单已有调度单正在进行中,确定再生成新的调度单?"))
                            {
                                window.location.href='/DispatchOrder.gds?ServiceOrdID=<%=ServiceOrdID%>&OrdDateType=1&OrdClassList=0&h_menu1_1=1';
                            }
                        }
                        <%else%>
                        function form1_Dispatch(){
                            window.location.href='/DispatchOrder.gds?ServiceOrdID=<%=ServiceOrdID%>&OrdDateType=1&OrdClassList=0&h_menu1_1=1';
                        }
                        <%end if%>
                        
                    </script>
                <!-- end forms -->    
                <%End if%>
                
                
                <%If ServiceOrdID<>""  Then%>
                <!-- forms -->
                <div class="box">
                    <!-- box / title -->
                    <div class="title">
                        <h5>收款记录</h5>
                    </div>
                    <!-- end box / title -->
                    <!-- end box / title -->
                    <div class="table">
                        <table>
                            <thead>
                                <tr style="white-space: nowrap;">
                                    <th>收款编号</th>
                                    <th>收款日期</th>
                                    <th>收款方式</th>
                                    <th>收款金额</th>
                                    <th>收款人</th>
                                    <th>状态</th>
                                    <th>备注</th>
                                    <th class="selected last"><input type="checkbox" class="checkall" /></th>
                                </tr>
                            </thead>
                            <form id="form3" name="form3" action="" method="post">
                            <input name="admin_save" type="hidden" value="34">
                            <input name="PaidMoney_Check" type="hidden" value="">
                            <input name="ServiceOrdID" type="hidden" value="<%=ServiceOrdID%>">
                            <tbody>
                            <%
                              sql="select PaidMoney.id,vtext,PaidMoney,PaidMoneyType,PaidMoneyTime,PaidMoneyOaID,PaidMoney_AP_Check,PaidMoney_AP_ID,PaidMoney_AP_Time,PaidMoneyMono from PaidMoney,dictionary where vtitle='PaidMoneyType' and vType>=1 and vID=PaidMoneyType and PaidMoney<>0 and ServiceOrdIDDt="&ServiceOrdID&" order by PaidMoneyTime"
                                rs.open sql,objConn,1,1
                                i=0
                                PaidMoney_Check=0
                                sunPaidMoney=0
                                do while not rs.Eof
                                  PaidMoneyID        = rs("ID")                        '收款单号
                                  PaidMoneyName        = rs("vtext")                    '收款方式名称
                                  PaidMoneyType        = rs("PaidMoneyType")            '收款方式ID
                                  PaidMoney            = rs("PaidMoney")                '收款金额
                                  PaidMoneyTime        = rs("PaidMoneyTime")            '收款时间
                                  PaidMoneyOaID        = rs("PaidMoneyOaID")            '收款操作人员ID
                                  PaidMoney_AP_Check= rs("PaidMoney_AP_Check")        '审核状态(0未审核,1已审核)
                                  PaidMoney_AP_ID        = rs("PaidMoney_AP_ID")        '审核人员ID
                                  PaidMoney_AP_Time    = rs("PaidMoney_AP_Time")        '审核时间
                                  PaidMoneyMono        = rs("PaidMoneyMono")            '结算备注
 
                                  If PaidMoney_AP_Check>=0 Then sunPaidMoney=sunPaidMoney+PaidMoney
                                  If PaidMoney_AP_Check=0 Then PaidMoney_Check=1
                                  %>
                                  <tr style="white-space: nowrap;">
                                    <td class="category"><%=PaidMoneyID%></td>
                                    <td class="category"><%=PaidMoneyTime%></td>
                                    <td class="category"><%=PaidMoneyName%></td>
 
                                    <td class="category"><%=FormatCurrency(PaidMoney,-1,-1)%></td>
                                    <td class="category"><%=OAUser(PaidMoneyOaID,"UserName")%></td>
                                    <td class="category"><%=AP_Check_A(PaidMoney_AP_Check)%></td>
                                    <td class="category"><%=PaidMoneyMono%></td>
                                    <td class="selected last"><%If PaidMoney_AP_Check=0 then%><input type="checkbox" id="PaidMoneyID_<%=PaidMoneyID%>" name="PaidMoneyID" value="<%=PaidMoneyID%>"/><%End if%></th>
                                    
                                  </tr>
                                <%rs.movenext
                                loop
                                rs.close()
                                %>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td style="text-align: right;">总收款:</td>
                                        <td style="text-align: center;"><%=FormatCurrency(sunPaidMoney,-1,-1)%></td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td class="last">&nbsp;</td>
                                    </tr>
                                    <%If ServiceOrdTraTxnPrice-sunPaidMoney>0 then%>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td style="text-align: right;">未支付:</td>
                                        <td style="text-align: center;"><%=FormatCurrency(ServiceOrdTraTxnPrice+StretcherMoney-sunPaidMoney,-1,-1)%></td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td class="last">&nbsp;</td>
                                    </tr>
                                    <%End if%>
 
                            </tbody>
                            </form>
                        </table>
                        <%If (PaidMoney_Check=1 And isDepartment("030204")=1) Or isDepartment("030202")=1 then%>
                        <div class="action">
                            <div class="button">
                                
                                <%If isDepartment("030202")=1 Then%><input type="button" name="submit51" id="PaidMoneyAdd" value="新建费用单" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" onclick="javascript:JS_PaidMoneyCreateOpen()">&nbsp;&nbsp;<%End If%>
                                <%If PaidMoney_Check=1 And isDepartment("030204")=1 then%><input type="button" name="submit51" id="PaidMoneyAP_1" value="审核费用单" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" onclick="javascript:form1_AP_1();">&nbsp;&nbsp;<%End If%>
                                <%If PaidMoney_Check=1 And isDepartment("030203")=1 then%><input type="button" name="submit51" id="PaidMoneyAP_1" value="作废费用单" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" onclick="javascript:form1_AP_2();">&nbsp;&nbsp;<%End If%>
 
                            </div>
                            <script LANGUAGE="javascript">
                                //审核
                                function form1_AP_1(){
                                if(confirm("确定审核所选费用单?"))
                                    {
                                        document.form3.action = "admin_save.gds";
                                        document.form3.admin_save.value="34"
                                        document.form3.PaidMoney_Check.value="1"
                                        form3.submit();
                                    }
                                }
                                //反审核
                                function form1_AP_0(){
                                if(confirm("确定反审核所选费用单?"))
                                    {
                                        document.form3.action = "admin_save.gds";
                                        document.form3.admin_save.value="34"
                                        document.form3.PaidMoney_Check.value="0"
                                        form3.submit();
                                    }
                                }
                                //作废
                                function form1_AP_2(){
                                if(confirm("确定作废所选费用单?"))
                                    {
                                        document.form3.action = "admin_save.gds";
                                        document.form3.admin_save.value="34"
                                        document.form3.PaidMoney_Check.value="-1"
                                        form3.submit();
                                    }
                                }
                                //打开窗口
                                function JS_PaidMoneyCreateOpen()
                                {
                                var sTop=document.documentElement.scrollTop;
                                    if (sTop==0) {sTop=document.body.scrollTop;}
                                var sLeft= document.documentElement.scrollLeft;
                                    if (sLeft==0) {sLeft=document.body.scrollLeft;}
                                var dTop = document.getElementById("PaidMoneyAdd").getBoundingClientRect().top;
                                var dLeft = document.getElementById("PaidMoneyAdd").getBoundingClientRect().left;
                                if (dTop<200) {dTop=200;}
                                if (dLeft<120) {dLeft=120;}
                                PaidMoneyCreate.style.display="block";
                                PaidMoneyCreate.style.left=(dLeft-230)+"px";
                                PaidMoneyCreate.style.top=(sTop+dTop-200)+"px";
                                PaidMoneyCreate.style.display='block';
                                JS_PaidMoneySearch();
                                }
 
                                //新建字典-关闭上传窗口
                                function JS_PaidMoneyCreateClose()
                                {
                                PaidMoneyCreate.style.display="none";
                                }
                                //新建字典-保存
                                function JS_PaidMoneyCreateSave()
                                {
                                form2.submit();
                                }
                                //受理单调单查询
                                function JS_PaidMoneySearch()
                                {
                                ServiceOrdNo=document.form2.ServiceOrdNo.value;
                                window.HiddenFrame.location.replace('Search_ServiceOrd.gds?ServiceOrdNo='+ServiceOrdNo);
                                }
                                //显示受理单数据
                                function JS_PaidMoneyData(ServiceOrdID,ServiceOrdPtName,PaidMoney)
                                {
                                    document.form2.ServiceOrdPtName.value=ServiceOrdPtName;
                                    document.form2.PaidMoney.value=PaidMoney;
                                    document.form2.ServiceOrdID.value=ServiceOrdID;
                                }
                                //显示支付二维码
                                 function JS_PaidMoneyPay(){
 
                                    PaidMoney=document.getElementById('PaidMoney').value
                                    PaidMoneyType=document.getElementById('PaidMoneyType').value
                                    PaidMoneyTimestamp=document.getElementById('PaidMoneyTimestamp').value
                                    if (PaidMoney==''){PaidMoney=0}
                                    if (isNaN(PaidMoney)){alert("收款金额请输入数字");return false;}
                                    if (PaidMoney<=0){alert("收款金额不可为0");return false;}
                                    if (PaidMoneyType=='3')
                                        {
                                            window.location.replace('/weixin_pay_QR.asp?pc=1&ServiceOrdID=<%=ServiceOrdID%>&total_fee='+PaidMoney);
                                        }
                                    else if (PaidMoneyType=='4')
                                        {
                                            window.location.replace('/alipay_pay_QR.php?pc=1&ServiceOrdID=<%=ServiceOrdID%>&total_fee='+PaidMoney);
                                        }
                                    else
                                        {alert("只支持结算方式为微信支付或支付宝");}
                                 }
                            </script>
                            <!--新建费用单-->
                            <div class="dialogJ  dialogJfix dialogJshadow" id="PaidMoneyCreate" style="width: 370px; right: 300px; top: 150px;display:none;">
                            
                                <div class="dialogJtitle">
                                    <a href="javascript:JS_PaidMoneyCreateClose();" class="dialogJclose" title="关闭本窗口">&nbsp;</a>
                                    <span class="dialogJtxt" id="EditPhotoTXT">新建费用单</span>
                                </div>
                                <form id="form2" name="form2" action="admin_save.gds" method="post">
                                <input name="admin_save" type="hidden" value="35">
                                <input name="searchTXT" type="hidden" value="<%=searchTXT%>">
                                <input name="ServiceOrdID" type="hidden" value="<%=ServiceOrdID%>">
                                <input name="page" type="hidden" value="<%=acc1%>">
                                <input name="OrdState" type="hidden" value="<%=OrdState%>">
                                <input name="OrdClassList" type="hidden" value="<%=OrdClassList%>">
                                <input name="OrdDateType" type="hidden" value="<%=OrdDateType%>">
                                <input name="PaidMoneyTimestamp" id="PaidMoneyTimestamp" type="hidden" value="<%=ToUnixTime(now(),+8)%>">
                                <input name="ReturnID" type="hidden" value="ServiceOrder">
                                <div class="dialogJcontent">
                                    <div class="dialogJbody" id="dialogJbody" style="height: 210px;">
                                        <div class="modify-album-name">
                                            <span>受理单号:</span>
                                            <input id="ServiceOrdNo" name="ServiceOrdNo" type="text" value="<%=ServiceOrdID_TXT%>" style="width: 165px;" maxlength="99/"><input type="button" style="text-indent:initial;" class="dialogJbtn first-child" onclick="JS_PaidMoneySearch()" value="调单"> 
                                        </div>
                                        <div class="modify-album-name">
                                            <span>患者姓名:</span>
                                            <input id="ServiceOrdPtName" name="ServiceOrdPtName" class="valid" type="text" value="" maxlength="99/" readonly="true">
                                        </div>
                                        <div class="modify-album-name">
                                            <span>结算方式:</span>
                                            <select name="PaidMoneyType" id="PaidMoneyType" style="padding: 5px 0 5px 8px;">
                                                <option value="">请选择</option>
                                                <%sql="select vID,vtext from dictionary where vtitle='PaidMoneyType' and vType>=1 order by vOrder"
                                                rs.open Sql,objConn,1,1
                                                do while not rs.Eof%>
                                                <option value="<%=rs("vID")%>"><%=rs("vtext")%></option>
                                                <%rs.movenext
                                                Loop
                                                rs.close()%>
                                            </select>
                                            &nbsp;<span><a onclick="JS_PaidMoneyPay()">显示支付二维码</a></span>
                                            
                                        </div>
                                        <div class="modify-album-name">
                                            <span>结算金额:</span>
                                            <input id="PaidMoney" name="PaidMoney" type="text" value="" maxlength="99/">
                                        </div>
                                        <div class="modify-album-name">
                                            <span>结算备注:</span>
                                            <input id="PaidMoneyMono" name="PaidMoneyMono" type="text" value="" maxlength="99/">
                                        </div>
                                    </div>
                                </div>
                                </form>
                                <div class="dialogJanswers">
                                    <input type="button" class="dialogJbtn first-child" onclick="JS_PaidMoneyCreateSave()" value="确定"> 
                                    <input type="button" class="dialogJbtn" onclick="JS_PaidMoneyCreateClose()" value="取消">
                                </div>
                            </div>
                            <!--新建费用单 end-->
                        </div>
                        <%End if%>
                    
                        
 
                    </div>
                </div>
                <!-- end forms -->    
                <%End if%>
 
 
                <%If ServiceOrdID<>""  Then%>
                <!-- forms -->
                <div class="box">
                    <!-- box / title -->
                    <div class="title">
                        <h5>操作留言</h5>
                    </div>
                    <!-- forms -->
 
                    <div class="form">
                        <div class="fields">
 
                    <ul class="links">
                    
                    <form id="formMessage" name="formMessage" action="admin_save.gds" method="post" style="min-width: 1110px;">
                    <input name="admin_save" type="hidden" value="107">
                    <input name="ServiceOrdID" type="hidden" value="<%=ServiceOrdID%>">
                    <input name="UrlType" type="hidden" value="ServiceOrder">
                        <div class="buttons" style="margin: 10px 0 0 100px;">
                            <div class="highlight" id="addSave">
                              <input type="button" name="submit107" value="提交留言" class="ui-state-default ui-button ui-widget ui-corner-all" onclick="formMessage_submit107();" role="button" aria-disabled="false">&nbsp;&nbsp;
                              <!--
                              <input type="button" name="submit48_1" value="上传图片" class="ui-state-default ui-button ui-widget ui-corner-all" onclick="formMessage_submit2();" role="button" aria-disabled="false">&nbsp;&nbsp;
                              <input type="button" name="submit48_1" value="微信推送" class="ui-state-default ui-button ui-widget ui-corner-all" onclick="formMessage_submit3();" role="button" aria-disabled="false">&nbsp;&nbsp;
                              -->
                            </div>
                        </div>
                        <div class="field" style="min-height: 44px;">
                            <div class="label" style="float: left;margin-left: 0px;width: 100px;">
                                <label for="input-small">留言:</label>
                            </div>
                            <div class="input" style="float:left;margin-left: 100px;">
                                <textarea id="MessageContents" name="MessageContents" cols="50" rows="4" style="width:600px;"><%=ServiceOrdVisit%></textarea>
                            </div>
                        </div>
                    </form>
 
                        <%'------------------- 留言显示 ---------------------
                        sql="select * from ServiceOrd_Message where ServiceOrdIDDt="&ServiceOrdID&" and MessageState>0 order by MID desc"
                        rs.open sql,objConn,1,1
                        do while not rs.Eof  
                            ID            = rs("MID")        '留言ID
                            MessageOAid    = rs("MessageOAid")    '留言者
                            MessageDate    = rs("MessageDate")    '留言时间
                            MessageHeadline    = rs("MessageHeadline")    '留言标题
                            MessageContents    = rs("MessageContents")    '留言内容
                            MessageToOAid    = rs("MessageToOAid")    '接收人员ID
                            MessageToState    = rs("MessageToState")    '已读状态
                            MessageToStateTime= rs("MessageToStateTime")    '已读时间
                            If MessageContents<>"" Then MessageContents=DealInput3(MessageContents)
                            If MessageHeadline<>"" Then MessageContents=MessageHeadline&","&MessageContents
                            %>
                            <div class="field" style="min-height: 50px;">
                                <div class="label" style="float: left;margin-left: 0px;width: 100px;">
                                    <label for="input-small"><%=OAUser(MessageOAid,"UserName")%>:</label>
                                </div>
                                <div class="input" style="float:left;margin-left: 100px;line-height: 20px;">
                                    <%=MessageDate%>
                                    <%If MessageToOAid<>"0" Then
                                        If MessageToState="0" Then
                                            'Response.Write "&nbsp;&nbsp;未阅&nbsp;[<a onclick='JS_SendPhone("""&MessageToOAid&""")'>发送电话强提醒</a>]"
                                            Response.Write "&nbsp;&nbsp;未阅"
                                        Else
                                            Response.Write "&nbsp;&nbsp;[已阅&nbsp;"&MessageToStateTime&"]"
                                        End If
                                    End If%>
                                    <%If MessageOAid=session("adminID") Then%>&nbsp;&nbsp;&nbsp;&nbsp;[<a href="/admin_save.gds?admin_save=108&DispatchOrdID=<%=DispatchOrdID%>&ServiceOrdID=<%=ServiceOrdID%>&MID=<%=ID%>&UrlType=ServiceOrder">删除</a>]<%End If%><br>
                                    <%=MessageContents%>
                                </div>
                            </div>
                            <%
                            rs.movenext
                        loop 
                        rs.close()%>
 
                    </ul>
                    </div>
                </div>
                <!-- end forms -->    
                <script LANGUAGE="javascript">
                        //提交留言(新增)
                        function formMessage_submit107(){
                        document.formMessage.action = "admin_save.gds";
                        document.formMessage.admin_save.value = "107";
                        formMessage.submit();
                        }
                </script>
                <script LANGUAGE="javascript">
                //打开窗口(通知推送)
                function JS_OrdSendOAOpen()
                {
                var sTop=document.documentElement.scrollTop;
                    if (sTop==0) {sTop=document.body.scrollTop;}
                var sLeft= document.documentElement.scrollLeft;
                    if (sLeft==0) {sLeft=document.body.scrollLeft;}
                var dTop = document.getElementById("vic").getBoundingClientRect().top;
                var dLeft = document.getElementById("vic").getBoundingClientRect().left;
                if (dTop<200) {dTop=200;}
                if (dLeft<120) {dLeft=120;}
                OrdSendOA.style.display="block";
                OrdSendOA.style.left=(dLeft+200)+"px";
                OrdSendOA.style.top=(sTop+dTop-450)+"px";
                OrdSendOA.style.display='block';
                document.all.OrdSendOARemarks.value=document.all.ServiceOrdOperationRemarks.value;
                //JS_PaidMoneySearch();
                }
                //关闭窗口(通知推送)
                function JS_OrdSendOAClose()
                {
                    OrdSendOA.style.display="none";
                }
                //发起通知推送
                function JS_OrdSendOA() {
                    OrdSendOAid=document.all.Entourage_OrdSendOAid.value;
                    OrdSendOARemarks=document.all.OrdSendOARemarks.value;
                    OrdSendisPhone=0;
                    //if(document.getElementsByName("OrdSendisPhone")[0].checked == true){OrdSendisPhone=1;}
                    if (OrdSendOAid!="")
                    {
                        $.ajax({
                            type: "post",  
                            url: "/weixin/message_send_OrderOA.gds",//需要跳转到的界面 the page you want to post data  
                            data: {  
                                ServiceOrdID: '<%=ServiceOrdID%>',//要传给后台的数据 the data you should send to background  
                                OAid: OrdSendOAid,
                                OrdSendOARemarks: OrdSendOARemarks,
                                isPhone: OrdSendisPhone
                            }, 
                            success:function(data){
                                if(data == '1'){
                                    JS_OrdSendOAClose();
                                    alert("发送成功");
                                    return false;
                                }else{
                                    alert("提交失败,请重试!"+data);
                                    return false;
                                }
                            }
                        });
                    }
                    else {
                        alert("请先选择收件人!");
                        return false;
                    }
                }
                //发起电话通知
                function JS_SendPhone(ToOAid) {
                    if (ToOAid!="")
                    {
                        $.ajax({
                            type: "post",  
                            url: "/weixin/message_send_Phone.gds",//需要跳转到的界面 the page you want to post data  
                            data: { 
                                OAid: ToOAid
                            }, 
                            success:function(data){
                                if(data == '1'){
                                    JS_OrdSendOAClose();
                                    alert("电话通知成功");
                                    return false;
                                }else{
                                    alert("提交失败,请重试!"+data);
                                    return false;
                                }
                            }
                        });
                    }
                    else {
                        alert("请先选择收件人!");
                        return false;
                    }
                }
            </script>
            <!--新建费用单-->
            <div class="dialogJ  dialogJfix dialogJshadow" id="OrdSendOA" style="width: 370px; right: 300px; top: 150px;display:none;">
            
                <div class="dialogJtitle">
                    <a href="javascript:JS_OrdSendOAClose();" class="dialogJclose" title="关闭本窗口">&nbsp;</a>
                    <span class="dialogJtxt" id="EditPhotoTXT">发送订单通知</span>
                </div>
                <form id="formOrdSendOA" name="formOrdSendOA" action="admin_save.gds" method="post">
                
                <input id="Entourage_OrdSendOAid" name="OrdSendOAid" type="hidden" value="<%=OrdSendOAid%>">
                <div class="dialogJcontent">
                    <div class="dialogJbody" id="dialogJbody" style="height: 210px;">
                        <div class="modify-album-name">
                            <span>通知人员:</span>
                            <input type="text" id="EntourageName_OrdSendOAid" name="OrdSendOAName" class="small" onclick="javascript:JS_EntourageOpen('OrdSendOAid','OrdSendOA');" style="width:258px;" value="<%=UnitIntroducer(OrdSendOAid,"UnitName")%>" readonly="true">
                        </div>
                        <div class="modify-album-name">
                            <span>留言:</span>
                            <textarea id="OrdSendOARemarks" name="OrdSendOARemarks" cols="50" rows="5" style="width:322px;"></textarea>
                        </div>
                        <!--
                        <div class="modify-album-name">
                            <span>电话强提醒:</span>
                            <input type="checkbox" name="OrdSendisPhone" id="OrdSendisPhone" style="width: 20px;">
                        </div>
                        -->
                    </div>
                </div>
                </form>
                <div class="dialogJanswers">
                    <input type="button" class="dialogJbtn first-child" onclick="JS_OrdSendOA()" value="发送"> 
                    <input type="button" class="dialogJbtn" onclick="JS_OrdSendOAClose()" value="取消">
                </div>
            </div>
            <!--新建费用单 end-->
                <%End if%>
                
 
 
            </div>
            <!-- end content / right -->
        </div>
        <!-- end content -->
        <!--#include FILE="vicgame.asp"-->
        <IFRAME id="HiddenFrame" name="HiddenFrame" WIDTH=0 HEIGHT=0 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR=#ffffff></IFRAME>
    </body>
</html>