【调度系统】广东民航医疗快线调度系统源代码
wlzboy
2025-09-06 2decf5219e3476e30095fd9dbf6e49c55e105563
ServiceOrder_List.gds
@@ -3,6 +3,7 @@
<!--#include virtual="/inc/chkadmin.gds"-->
<!--#include virtual="/inc/function.gds"-->
<%
searchTXT=SafeRequest(trim(Request("searchTXT")))
searchTXTMore=SafeRequest(Request("searchTXTMore"))
If InStr(searchTXT,",")>0 Then
@@ -268,6 +269,102 @@
If CoopUnitID<>"" Then page_URL=page_URL&"&CoopUnitID="&CoopUnitID
%>
<%
' 记录管理员操作日志,谁访问了这个页面,写在了logs/目录下面
Dim adminName
adminName = Session("adminName")
' 检查 adminName 是否为空
If adminName = "" Then
    Response.Write("管理员名称未设置!")
    Response.End()
End If
' 获取当前日期并格式化为 YYYY-MM-DD
Dim currentDate
currentDate = Year(Now()) & "-" & Right("0" & Month(Now()), 2) & "-" & Right("0" & Day(Now()), 2)
' 定义文件路径和文件名
Dim fileName, filePath
fileName = "log_" & currentDate & ".txt" ' 例如:log_2023-10-05.txt
filePath = Server.MapPath("logs/" & fileName)
' 创建文件系统对象
Dim fs, f
Set fs = Server.CreateObject("Scripting.FileSystemObject")
' 检查 logs 目录是否存在,如果不存在则创建
Dim logsFolderPath
logsFolderPath = Server.MapPath("logs")
If Not fs.FolderExists(logsFolderPath) Then
    fs.CreateFolder(logsFolderPath)
End If
' 检查文件是否存在,如果不存在则创建
If Not fs.FileExists(filePath) Then
    Set f = fs.CreateTextFile(filePath, True)
    f.Close
End If
Dim isDepartmentStr
if isDepartment("020114")=1 Then
   isDepartmentStr="查看全部订单权限"
ElseIf isDepartment("020103")=1 Or isDepartment("020115")=1 Then
   isDepartmentStr="服务单查询权限"
Else
   isDepartmentStr="无权限"
End If
' 打开文件并写入内容
On Error Resume Next ' 启用错误处理
Set f = fs.OpenTextFile(filePath, 8, True) ' 8 表示追加模式
If Err.Number = 0 Then ' 如果未发生错误
    f.WriteLine(Now() & " - " & adminName & " - 访问了[ServiceOrder_List 页面] - 用户权限:" & isDepartmentStr) ' 写入当前时间和管理员名称
   f.Close
Else
    ' 如果打开文件失败,忽略错误
End If
' 释放对象
Set f = Nothing
Set fs = Nothing
On Error GoTo 0 ' 关闭错误处理
'如果isDepartmentStr="无权限"
If isDepartmentStr = "无权限" Then
   ' 打开文件并写入内容
   On Error Resume Next ' 启用错误处理
   Set f = fs.OpenTextFile(filePath, 8, True) ' 8 表示追加模式
   If Err.Number = 0 Then ' 如果未发生错误
      f.WriteLine(Now() & " - " & adminName & " - 尝试访问[ServiceOrder_List 页面] - " & isDepartmentStr) ' 写入当前时间和管理员名称
      f.Close
   Else
      ' 如果打开文件失败,忽略错误
   End If
   ' 释放对象
   Set f = Nothing
   Set fs = Nothing
   On Error GoTo 0 ' 关闭错误处理
   Response.Write("Access not allowed, no permission!")
   Response.End()
End If
%>
<!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>
@@ -662,9 +759,11 @@
            searchSql=" CONVERT(VARCHAR(10),ServiceOrd_CC_Time,120)=CONVERT(VARCHAR(10),'"&Year(now())&"-"&Right("0"&Month(now()),2)&"-"&Mid(searchTXT,1,2)&"',120) and Right('00'+convert(varchar(3),ServiceOrdNo),3)='"&Right(searchTXT,3)&"' "
           ElseIf Len(searchTXT)=14 And Not IsNumeric(Left(searchTXT,2)) And IsNumeric(Mid(searchTXT,3,8)) And IsNumeric(Right(searchTXT,3)) And Mid(searchTXT,11,1)="-" Then
            searchSql=" ServiceOrdClass='"&Left(searchTXT,2)&"' and CONVERT(VARCHAR(10),ServiceOrd_CC_Time,120)=CONVERT(VARCHAR(10),'"&Mid(searchTXT,3,4)&"-"&Mid(searchTXT,7,2)&"-"&Mid(searchTXT,9,2)&"',120) and Right('00'+convert(varchar(3),ServiceOrdNo),3)='"&Right(searchTXT,3)&"' "
           ElseIf Len(searchTXT)=10 And IsNumeric(searchTXT) Then
            searchSql=" ServiceOrdID="&Right(searchTXT,10)&" "
           ElseIf Mid(searchTXT,1,4)="out|" Then   ' and DispatchOrdState in (8)
           ElseIf Len(searchTXT)=14 And Mid(searchTXT,11,1)="-" Then
    searchSql=" Old_ServiceOrdID_TXT='"&searchTXT&"' "
  ElseIf Len(searchTXT)=10 And IsNumeric(searchTXT) Then
    searchSql=" ServiceOrdID="&Right(searchTXT,10)&" "
  ElseIf Mid(searchTXT,1,4)="out|" Then   ' and DispatchOrdState in (8)
            searchSql=" (ServiceOrdPtOutHosp in (select vid from dictionary where vType=1 and vtitle='HospName' and vtext='"&Mid(searchTXT,5)&"')) and ServiceOrd_CC_Time "&SqlOrdDateType
           ElseIf Mid(searchTXT,1,3)="in|" Then
            searchSql=" (ServiceOrdPtInHosp in (select vid from dictionary where vType=1 and vtitle='HospName' and vtext='"&Mid(searchTXT,4)&"')) and ServiceOrd_CC_Time "&SqlOrdDateType
@@ -775,7 +874,7 @@
         '组成计算总页数SQL
         total_sql = "select ServiceOrdID "&sqlWhere
         '组成显示结果SQL
         Result_sql = "select ServiceOrdID,ServiceOrdNo,ServiceOrdClass,ServiceOrdAreaType,ServiceOrdType,ServiceOrdState,ServiceOrdStartDate,ServiceOrdApptDate,ServiceOrdCoName,ServiceOrdCoPhone,ServiceOrdPtAge,ServiceOrdPtSex,ServiceOrdTraProvince,ServiceOrdTraCity,ServiceOrdTraStreet,ServiceOrdTraEnd,ServiceOrdTraVia,ServiceOrdTraDistance,ServiceOrdTraSDTime,ServiceOrdTraTxnPrice,ServiceOrd_CC_ID,ServiceOrd_CC_Time,ServiceOrd_NS_ID,ServiceOrd_NS_Time,ServiceOrd_AP_Check,ServiceOrd_AP_ID,ServiceOrd_AP_Time,ServiceOrdVIP,ServiceOrdUnitID,ServiceOrdUnitRemarks,ServiceOrdIntroducer,ServiceOrdOperationRemarks,ServiceOrdPtOutHospID,ServiceOrdPtOutHosp,ServiceOrdPtInHospID,ServiceOrdPtInHosp,ServiceOrdCancelReasonTXT,ServiceOrdCancelReason,FromHQ_is,ServiceOrd_Sale_ID,ServiceOrdPoints,row_number() over (order by ServiceOrdID desc) n  "&sqlWhere
         Result_sql = "select ServiceOrdID,ServiceOrdNo,ServiceOrdClass,ServiceOrdAreaType,ServiceOrdType,ServiceOrdState,ServiceOrdStartDate,ServiceOrdApptDate,ServiceOrdCoName,ServiceOrdCoPhone,ServiceOrdPtAge,ServiceOrdPtSex,ServiceOrdTraProvince,ServiceOrdTraCity,ServiceOrdTraStreet,ServiceOrdTraEnd,ServiceOrdTraVia,ServiceOrdTraDistance,ServiceOrdTraSDTime,ServiceOrdTraTxnPrice,ServiceOrd_CC_ID,ServiceOrd_CC_Time,ServiceOrd_NS_ID,ServiceOrd_NS_Time,ServiceOrd_AP_Check,ServiceOrd_AP_ID,ServiceOrd_AP_Time,ServiceOrdVIP,ServiceOrdUnitID,ServiceOrdUnitRemarks,ServiceOrdIntroducer,ServiceOrdOperationRemarks,ServiceOrdPtOutHospID,ServiceOrdPtOutHosp,ServiceOrdPtInHospID,ServiceOrdPtInHosp,ServiceOrdCancelReasonTXT,ServiceOrdCancelReason,FromHQ_is,ServiceOrd_Sale_ID,ServiceOrdPoints,Old_ServiceOrdID_TXT,row_number() over (order by ServiceOrdID desc) n  "&sqlWhere
         '附加结果SQL
         Additional_sql = ",StretcherMoney=isnull((select sum(StretcherMoney) from DispatchOrd where ServiceOrdIDDt=ServiceOrdID),0),ContractMode_is=isnull((select COUNT(id) from ServiceOrd_TransferMode where ServiceOrdTMID=ServiceOrdID and TransferModeID=7),0),UserPointsCost=isnull((select sum(Points_Score) from UserPoints where Points_State<>4 and Points_Type=1 and ServiceOrdIDDt=ServiceOrdID),0)"
@@ -892,11 +991,12 @@
           ServiceOrdCancelReason= rs("ServiceOrdCancelReason")
           FromHQ_is            = rs("FromHQ_is")            '是否有转内部转发
           ContractMode_is      = rs("ContractMode_is")         '是否承包组任务
           If isDepartment("010401")=0 Then
            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)
           Else
            ServiceOrdNo   = ServiceOrdClass&ServiceOrdID
           End If
           Old_ServiceOrdID_TXT   = rs("Old_ServiceOrdID_TXT")   '旧服务单号
  If isDepartment("010401")=0 Then
   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)
  Else
   ServiceOrdNo   = ServiceOrdClass&ServiceOrdID
  End If
           i=i+1