| | |
| | | <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%>
|
| | |
| | | FromHQ2_is = SafeRequest(Request.form("FromHQ2_is")) '广州总部推送任务标记
|
| | | OrderPrice_Auto = SafeRequest(Request.form("OrderPrice_Auto")) '订单自动报价参考值
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | Call RequestForm(Origin)
|
| | | session("Origin")=Origin
|
| | | 'response.write Origin
|
| | |
| | | rs.close()
|
| | | ServiceOrdNo = ServiceOrdClass& year(now())&Right("0"&month(now()),2)&Right("0"&day(now()),2) & "-"&Right("00"&ServiceOrdNo,3)
|
| | |
|
| | | '保存开单人及提成比例的函数
|
| | | SaveOpenerCommission ServiceOrdID
|
| | | SaveFollowers ServiceOrdID
|
| | | '咨询单转为服务单('自动审核)
|
| | | If ServiceOrdState="2" then
|
| | | sql="update ServiceOrder set ServiceOrd_NS_ID="&session("adminID")&",ServiceOrd_NS_Time=getdate(),ServiceOrd_AP_Check=1,ServiceOrd_AP_Time=getdate(),ServiceOrd_AP_ID="&session("adminID")&" where ServiceOrdID="&ServiceOrdID
|
| | |
| | |
|
| | | ServiceOrd_Check = SafeRequest(Request.form("ServiceOrd_Check")) '当前审核操作
|
| | | EditDataForm = SafeRequest(Request.form("EditDataForm")) '当前修改项目
|
| | | '保存开单人及提成比例的函数
|
| | | SaveOpenerCommission ServiceOrdID
|
| | | SaveFollowers ServiceOrdID
|
| | |
|
| | | Call RequestForm(Origin)
|
| | | session("Origin")=Origin
|
| | |
| | | If ServiceOrdPtOutHospID_New="" Then ServiceOrdPtOutHospID_New=0
|
| | | If ServiceOrdPtInHospID_New="" Then ServiceOrdPtInHospID_New=0
|
| | | If ServiceOrdVIP="" Then ServiceOrdVIP=0
|
| | | If ServiceOrdOperationRemarks<>"" Then ServiceOrdOperationRemarks=replace(ServiceOrdOperationRemarks,"[客户未正式提交需求,可不联系]","")
|
| | | If ServiceOrdOperationRemarks<>"" Then ServiceOrdOperationRemarks=replace(replace(ServiceOrdOperationRemarks,"[客户未正式提交需求,可不联系]",""),"[客户未正式提交需求]","")
|
| | | If ServiceOrdVisit<>"" And ServiceOrdVisit_old<>ServiceOrdVisit Then
|
| | | RV_Point=0
|
| | | sql="select id from DispatchOrd_Entourage,DispatchOrd where EntourageState<>4 and DispatchOrdIDDt=DispatchOrdID and ServiceOrdIDDt="&ServiceOrdID
|
| | |
| | | End If
|
| | | End If
|
| | | End If
|
| | |
|
| | |
|
| | | Response.Redirect ReturnURL&"&SystemMessageType=3&SMT="&SMT
|
| | | Response.End%>
|
| | |
| | | ServiceOrdTraVia = SafeRequest(Request.form("ServiceOrdTraVia")) '转出地址
|
| | | ServiceOrdTraEnd = SafeRequest(Request.form("ServiceOrdTraEnd")) '转入地址
|
| | | EditDataForm = SafeRequest(Request.form("EditDataForm")) '当前修改项目
|
| | |
|
| | |
|
| | |
|
| | | If ServiceOrdTraStreet<>"" Then DispatchOrdTraStreet=ServiceOrdTraStreet
|
| | | If ServiceOrdTraVia<>"" Then DispatchOrdTraVia=ServiceOrdTraVia
|
| | | If ServiceOrdTraEnd<>"" Then DispatchOrdTraEnd=ServiceOrdTraEnd
|