【调度系统】广东民航医疗快线调度系统源代码
wanglizhong
2025-04-22 72c0df785d4838d35dc694071c61e3f9a54e7e81
admin_save.gds
@@ -20,6 +20,66 @@
<title>记录中..</title>
</head>
<%End If%>
<%
Function delFollower(ServiceOrderID)
   sql = "DELETE FROM ServiceOrderCommissionDetails WHERE ServiceOrderID = " & ServiceOrderID & " AND PersonType = 'Follower'"
   objConn.Execute sql
End Function
Function SaveFollower(ServiceOrderID,userId,userName,userRatio)
   if userId<>"" and userName<>"" and userRatio<>"" then
      ' 如果不存在,则插入新记录
      sql = "INSERT INTO ServiceOrderCommissionDetails (ServiceOrderID, PersonID, PersonName, CommissionRatio, PersonType) VALUES (" & ServiceOrderID & ", " & userId & ", '" & userName & "', " & userRatio & ", 'Follower')"
      objConn.Execute sql
   End if
End Function
Function SaveFollowers(ServiceOrderID)
   ' 先删除所有跟单人记录
   followerCount = SafeRequest(Request.form("FollowersCount"))
   If Trim(followerCount)<>"" and IsNumeric(followerCount) then
      numericFollowerCount = CInt(Trim(followerCount))
      if numericFollowerCount>0 then
         delFollower ServiceOrderID
         for i=1 to numericFollowerCount
            userId = SafeRequest(Request.form("FollowerId_" & i ))
            userName = SafeRequest(Request.form("FollowerName_" & i))
            userRatio = SafeRequest(Request.form("FollowerRatio_" & i))
            SaveFollower ServiceOrderID, userId, userName, userRatio
         next
      end if
   end if
End Function
' 保存开单人及提成比例的函数
Function SaveOpenerCommission(ServiceOrderID)
    OpenerID         = SafeRequest(Request.form("OpenUserID"))            '开单人ID
   OpenerName         = SafeRequest(Request.form("OpenUserName"))            '开单人名称
   OpenerRatio         = SafeRequest(Request.form("OpenUserRatio"))         '开单人提成比例
   if OpenerID<>"" and OpenerName<>"" and OpenerRatio<>"" then
      ' 先检查是否已经存在该服务单的开单人记录
      sql = "SELECT ID FROM ServiceOrderCommissionDetails WHERE ServiceOrderID = " & ServiceOrderID & " AND PersonType = 'Opener'"
      rs.Open sql, objConn, 1, 1
      If rs.EOF Then
         ' 如果不存在,则插入新记录
         sql = "INSERT INTO ServiceOrderCommissionDetails (ServiceOrderID, PersonID, PersonName, CommissionRatio, PersonType) VALUES (" & ServiceOrderID & ", " & OpenerID & ", '" & OpenerName & "', " & OpenerRatio & ", 'Opener')"
      Else
         ' 如果存在,则更新记录
         sql = "UPDATE ServiceOrderCommissionDetails SET PersonID = " & OpenerID & ", PersonName = '" & OpenerName & "', " &"CommissionRatio = " & OpenerRatio & " WHERE ID = " & rs("ID")
      End If
      'response.write sql
      rs.Close
      objConn.Execute sql
   End if
End Function
%>
<%
if cint(session("admin_execLevel"))<1 and admin_save<>"1" and admin_save<>"47" and admin_save<>"48" and admin_save<>"49" then%>
@@ -773,6 +833,9 @@
FromHQ2_is            = SafeRequest(Request.form("FromHQ2_is"))            '广州总部推送任务标记  
OrderPrice_Auto         = SafeRequest(Request.form("OrderPrice_Auto"))         '订单自动报价参考值
Call RequestForm(Origin)
session("Origin")=Origin
'response.write  Origin
@@ -986,6 +1049,8 @@
ServiceOrdID = rs(0)
rs.close()
ServiceOrdNo   = ServiceOrdClass& year(now())&Right("0"&month(now()),2)&Right("0"&day(now()),2) & "-"&Right("00"&ServiceOrdNo,3)
'咨询单转为服务单('自动审核)
If ServiceOrdState="2" then
@@ -1249,6 +1314,7 @@
ServiceOrd_Check      = SafeRequest(Request.form("ServiceOrd_Check"))      '当前审核操作
EditDataForm         = SafeRequest(Request.form("EditDataForm"))         '当前修改项目
Call RequestForm(Origin)
session("Origin")=Origin
@@ -1997,6 +2063,8 @@
sql="update DispatchOrd set DispatchOrdTraSDTime='"&DispatchOrdTraSDTime&"' where DispatchOrdID="&DispatchOrdID
objConn.Execute sql
End If
SaveOpenerCommission DispatchOrdID
SaveFollowers DispatchOrdID
'写入附加项目费用
If AddMoneyType<>"" And AddMoneyType<>"0" And AddMoney>0 And StretcherMoney>0 Then
@@ -2340,6 +2408,10 @@
ServiceOrdTraVia      = SafeRequest(Request.form("ServiceOrdTraVia"))      '转出地址
ServiceOrdTraEnd      = SafeRequest(Request.form("ServiceOrdTraEnd"))      '转入地址
EditDataForm         = SafeRequest(Request.form("EditDataForm"))         '当前修改项目
SaveOpenerCommission DispatchOrdID
SaveFollowers DispatchOrdID
If ServiceOrdTraStreet<>"" Then DispatchOrdTraStreet=ServiceOrdTraStreet
If ServiceOrdTraVia<>"" Then DispatchOrdTraVia=ServiceOrdTraVia
If ServiceOrdTraEnd<>"" Then DispatchOrdTraEnd=ServiceOrdTraEnd