物流运交管理系统 派车记录查询

派车记录查询

派车记录是对所有车次和单据信息的查询

派车记录查询界面:

隐藏datagrid中的列:

界面html代码:

<tr align="center"> 
                        <th data-options="field:'CompanyAbbreviation',width:150,align:'center'">公司</th>
                        <th data-options="field:'SendNumber',width:150,align:'center'">取送单号<input id="SendNumber" type="button" οnclick='CarTimes("SendNumber","DductTime","DductTime","DductTime","DductTime","DductTime")' value=">>" style="background-color: #FFFFFF" /></th>
                        <th data-options="field:'DductTime',width:150,align:'center'">扣帐时间</th> 
                        <th data-options="field:'LogisticsPlaceName',width:80,align:'center'">物流地点</th>
                        <th data-options="field:'collectClientName',width:180,align:'center'" style="color: #FF3300; font-size: 17px; font-family: 华文行楷">取送客户<input id="collectClientName" type="button" οnclick='CarTimes("collectClientName","SendClientName","CollectFieldWord","CollectAddress","CollectAddress","CollectAddress")' value=">>" style="background-color: #FFFFFF" /></th>
                        <th data-options="field:'SendClientName',width:180,align:'center'" style="color: #FF3300; font-size: 17px; font-family: 华文行楷">下单客户</th>
                        <th data-options="field:'CollectFieldWord',width:70,align:'center'">运交领域</th>

脚本代码:

<span style="color:#000000;"></span><pre class="javascript" name="code">function CarTimes(ID,FieldName1, FieldName2, FieldName3, FieldName4, FieldName5) {
         if (g == 0) {
             $('#dgrd_SelectSendCarRecord').datagrid('hideColumn', FieldName1); // 隐藏单元格,参数FieldName1为datagrid中的列名
             $('#dgrd_SelectSendCarRecord').datagrid('hideColumn', FieldName2);
             $('#dgrd_SelectSendCarRecord').datagrid('hideColumn', FieldName3); 
             $('#dgrd_SelectSendCarRecord').datagrid('hideColumn', FieldName4);
             $('#dgrd_SelectSendCarRecord').datagrid('hideColumn', FieldName5);
             $("#"+ID).val(">>");
             g = 1;
         }
         else {
             $('#dgrd_SelectSendCarRecord').datagrid('showColumn', FieldName1); //显示单元格
             $('#dgrd_SelectSendCarRecord').datagrid('showColumn', FieldName2);
             $('#dgrd_SelectSendCarRecord').datagrid('showColumn', FieldName3); 
             $('#dgrd_SelectSendCarRecord').datagrid('showColumn', FieldName4);
             $('#dgrd_SelectSendCarRecord').datagrid('showColumn', FieldName5);
             $("#"+ID).val("<<");
             g = 0;
         }
     }
 

派车记录查询涉及的表和表的关系

派车记录查询用到的表有:配送车次维护表(DeliveryCarTimesServiceList)、配送车次维护明细表

MX_DeliveryCarTimesServiceList)、物流地点表(LogisticsPlaceList)、属性明细表(MX_AttributeDetailedList)、返车异常表(ReturnCarUnusualIList)、返车异常明细表(MX_ReturnCarUnusualIList)、出车异常表(DrawOutUnusualList)、出车异常明细表(MX_DrawOutUnusualDetailList)、客户表(ClientList)、公司表(CompanyList)、货运单表(FreightReceiptsList)、发车单据表(DeliverReceiptsList)、员工表StaffList)、配送领域维护表(DeliveryFieldServiceList)、配送领域维护表(DeliveryFieldServiceList

 

配送车次表的字段有:配送车次维护ID、车次日期、物流地点ID、配送方式ID、配送属性ID、班次ID

列名

数据类型

主键/外键

说明

DeliveryCarTimesServiceID

Int

主键

配送车次维护ID

CarTimesDate

Datetime

 

车次日期

LogisticsPlaceID

Int

外键

物流地点ID

DeliveryWayID

Int

外键

配送方式ID

SXMX_AttributeID

Int

外键

配送属性ID

ClassesID

Int

外键

班次ID

 

配送车次维护明细表的字段有:配送车次维护明细ID、车次、运交车号、取/送件ID、预出车时间、单据截止时间、物流服务代表ID随车人员1ID、随车人员2ID、运交领域、派车状态ID、实际出车时间、实际返车时间、配送车次维护ID、派车时间

列名

数据类型

主键/外键

说明

MX_DeliveryCarTimesServiceID

Int

主键

配送车次维护明细ID

CarTimes

Char

 

车次

CarNumber

Char

 

运交车号

MX_GetSendID

Int

外键

/送件ID

PredictDrawOutTime

DateTime

 

预出车时间

PredictDrawOutTime

DateTime

 

单据截止时间

LogisticsServeDelegateID

Int

外键

物流服务代表ID

Personnel_OneID

Int

外键

随车人员1ID

Personnel_TwoID

Int

外键

随车人员2ID

ServiceFile

Char

 

运交领域

SendCarStateID

Int

外键

派车状态ID

FactDrawOutTime

DateTime

 

实际出车时间

FactReturnCarTime

DateTime

 

FactReturnCarTime

DeliveryCarTimeServiceID

Int

外键

配送车次维护ID

SendCarTime

DateTime

 

派车时间

 

物流地点表的字段:物流地点ID、物流地点名称、地址

列名

数据类型

主键/外键

说明

LogisticsPlaceID

Int

主键

物流地点ID

LogisticsPlaceName

Char

 

物流地点名称

Address

Char

 

地址

属性明细表的字段:属性明细ID、属性明细名称、属性集合ID

列名

数据类型

主键/外键

说明

MX_AttributeDetailedID           

Int

主键

属性明细ID

AttributeDetailedName   

Char

 

属性明细名称

AttributeGatherID

Int

外键

属性集合ID

车异常表的字段有:返车异常ID、返车异常名称

列名

数据类型

主键/外键

说明

ReturnCarUnusualIID

Int

主键

返车异常ID

ReturnCarUnusualIName

Char

 

返车异常名称

 

车异常明细表的字段有:车异常明细ID车异常明细名称、返车异常ID

 

列名

数据类型

主键/外键

说明

MX_ReturnCarUnusualIID

Int

主键

车异常明细ID

MX_ReturnCarUnusualIINameme

Char

 

返车异常原因

ReturnCarUnusualIID

Int

外键

返车异常ID

出车异常表的字段有:出车异常ID、出车异常名称

列名

数据类型

主键/外键

说明

DrawOutUnusualID

Int

主键

出车异常ID

DrawOutUnusualName

Char

 

出车异常名称

 

出车异常明细表的字段有:出车异常明细ID、出车异常明细名称、出车异常ID

 

列名

数据类型

主键/外键

说明

MX_DrawOutUnusualDetailID

Int

主键

出车异常明细ID

DrawOutUnusualName

Char

 

出车异常明细名称

DrawOutUnusualID

Int

外键

出车异常ID

 

客户表主要字段有客户ID、客户名称、客户简称、联系人、联系电话、客户编号

 

列名

数据类型

主键/外键

说明

ClientID

Int

主键

客户ID

ClientName

Char

 

客户名称

ClientAbbreviation

Char

 

客户简称

LinkMan

Char

 

联系人

LinkPhone

Char

 

联系电话

ClientNumber

Char

 

客户编号

 

公司表的字段有:公司IDCompanyID)、公司简称(CompanyAbbreviation)、公司名称(CompanyName)、地址(Address)、联系人(LinkMan)、联系电话(LinkPhone

列名

数据类型

主键/外键

说明

CompanyID

Int

主键

公司ID

CompanyAbbreviation

Char

 

公司简称

CompanyName

Char

 

公司名称

Address

Char

 

地址

LinkMan

Char

 

联系人

LinkPhone

 

 

联系电话

货运单表的字段有:货运单ID、取送单号、公司ID、寄件客户ID  收件客户ID、接单时间、要求送达时间、寄件地址、审核否、收件地址、付款条件ID、货运单状态ID、签收确认ID、备注、开单人ID、寄件领域、领域属性维护ID签收单状态    类别、配送方式、扣帐时间

表名

数据类型

主键/外键

说明

FreightReceiptsID

Int

主键

货运单ID

SendNumber

Char

 

取送单号

CompanyID

Int

外键

公司ID

SendClientID

Int

外键

寄件客户ID

CollectClientID

Int

外键

收件客户ID

ConnectTime

datetime

 

接单时间

RequireServiceTime

datetime

 

要求送达时间

SendAddress

char

 

寄件地址

CheckNo

bit

 

审核否

DeliveryFieldServiceID

Int

外键

领域属性维护ID

PayCondition

Int

外键

付款条件ID

FreightReceiptsStateID

Int

外键

货运单状态ID

SignForStateID

Int

外键

签收确认ID

Remark

Char

 

备注

StaffID

Int

外键

开单人ID

SendFieldWord

Char

 

寄件领域

DeliveryFieldServiceID

Int

外键

领域属性维护ID

SignFor

Int

外键

签收单状态ID

ClassesID

Int

外键

类别

DeliveryWayID

Int

外键

配送方式

DductTime

datetime

 

扣帐时间

发车单据表的字段有:发车单据ID、货运单ID、箱数、出车异常ID、出车异常原因、返车异常ID、返车异常原因、出车确认、返车确认、处理人ID、处理时间、配送车次维护明细ID

表名

数据类型

主键/外键

说明

DeliverReceiptsID

Int

主键

发车单据ID

FreightReceiptsID

Int

外键

货运单ID

BoxCount

decimal(18, 0)

 

箱数

DrawOutUnusualID

Int

外键

出车异常ID

DrawOutUnusualIReasonID

Int

外键

出车异常原因

ReturnCarUnusualIID

Int

外键

返车异常ID

ReturnCarUnusualIReasonID

Int

外键

返车异常原因

OpenCarAffirm

bit

 

出车确认

ReturnCarAffirm

bit

 

返车确认

HandleManID

Int

外键

处理人ID

HandleTime

datetime

 

处理时间

MX_DeliveryCarServiceID

Int

外键

配送车次维护明细ID

Remark

Char

 

备注

 

员工表主要字段有员工ID、员工姓名、员工编号、身份证号码、联系电话、联系地址、物流地点ID、部门ID、备注

 

列名

数据类型

主键/外键

说明

StaffID

Int

主键

员工ID

StaffName

Char

 

员工姓名

StaffNumber

Char

 

员工编号

IdentityCardNumber

Char

 

身份证号码

LinkPhone

Char

 

联系电话

LinkAddress

Char

 

联系地址

LogisticsPlaceID

Int

外键

物流地点ID

Remark

Char

 

备注

DepartmentID

Int

外键

部门ID

 

 

配送领域维护表的字段配送领域维护ID物流地点ID、领域代码、配送属性ID、配送等级ID、配送方式ID、默认否、预计送达天数、删除否

列名

数据类型

主键/外键

说明

DeliveryFieldServiceID

Int

主键

配送领域维护ID

LogisticsPlaceID

Int

外键

物流地点ID

FieldWord

Char

 

领域代码

SXMX_AttributeID

Int

外键

配送属性ID

DeliveryGradeID

Int

外键

配送等级ID

DeliveryWayID

Int

外键

配送方式ID

AdmitNO

 

Bit

外键

默认否

PredictServiceDay

Char

 

预计送达天数

DeleteNo

Bit

 

删除否

配送领域维护表的字段配送领域维护ID物流地点ID、领域代码、配送属性ID、配送等级ID、配送方式ID、默认否、预计送达天数、删除否

列名

数据类型

主键/外键

说明

DeliveryFieldServiceID

Int

主键

配送领域维护ID

LogisticsPlaceID

Int

外键

物流地点ID

FieldWord

Char

 

领域代码

SXMX_AttributeID

Int

外键

配送属性ID

DeliveryGradeID

Int

外键

配送等级ID

DeliveryWayID

Int

外键

配送方式ID

AdmitNO

 

Bit

外键

默认否

PredictServiceDay

Char

 

预计送达天数

DeleteNo

Bit

 

删除否

 

关系图:


模块功能的具体实现

//派车记录查询界面的Html代码:

<div class="easyui-window"  id="Wnd_CarTimesReceipts" style="width:1200px; height:650px; top:1px;  background-color: #CCCCFF;" title="派车记录查询">
          <div  id="koko" style="width:1200px;height:100px; top: 5px;">
            <center>
        <table>                                    
           <tr>  
           
                <td align="right" style="font-family: 微软雅黑; font-size: 15px">物流地点:</td><td> <input  id="cbo_SelectLogisticsPlace" data-options="valueField:'LogisticsPlaceID',textField:'LogisticsPlaceName',url:'/DeliveryFieldAddress/LogisticsPlace'"class="easyui-combobox" style="width:140px"></input></td><td style="width:50px;height:20px"></td>
                <td align="right"" style="font-family: 微软雅黑; font-size: 15px">配送方式:</td><td> <input data-options="valueField:'MX_AttributeDetailedID',textField:'AttributeDetailedName',url:'/DeliveryFieldAddress/SelectAttributeGather?AttributeGatherID=1'"id="cbo_SelectDeliveryWay" class="easyui-combobox" style="width:140px;font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 15px;"></input></td><td style="width:50px;height:20px"></td> 
			  <td align="right"style="font-family: 微软雅黑; font-size: 15px">下单客户:</td><td> <input id="cbogrid_SendClient" class="easyui-combogrid" style="width:140px;font-family: 微软雅黑; font-size: 21px; color: #FF0000;"data-options="
			panelWidth: 500,
			idField: 'ClientID',
			textField: 'ClientName',
           url: '/FreightReceiptsManage/SelecteClientInformation',
			columns: [[
				{field:'ClientID',title:'客户ID',width:80,hidden:true},
                {field:'ClientNumber',title:'客户编号',width:60,align:'center'},
				{field:'ClientName',title:'客户名称',width:180},
				{field:'ClientAbbreviation',title:'客服简称',width:80,align:'right'},
				{field:'LinkMan',title:'联系人',width:80,align:'right'},
				{field:'LinkPhone',title:'联系电话',width:100}
			 ]],
			fitColumns: true
		"/></td><td style="width:50px;height:10px"></td> 
                <td align="right"style="font-family: 微软雅黑; font-size: 15px">配送状态 :</td><td>
                     <select id="cbo_SendState"style="width:140px;">
                     <option  value="所有">所有</option>
                     <option  value="未派车">未派车</option>
                     <option  value="未结案">未结案</option>
                     <option  value="正常结案">正常结案</option>
                     <option  value="异常结案">异常结案</option>
                     </select></td>
                 </tr> 
                <tr style="height:5px"> </tr>
                <tr>  
                <td align="right"style="font-family: 微软雅黑; font-size: 15px">公司:</td><td><input id="cbo_SelectDeliveryGrade"data-options="valueField:'CompanyID',textField:'CompanyName',url:'/FreightReceiptsManage/SelecteCompanyInformation'" class="easyui-combobox" style="width:140px; font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 15px;"></input></td><td style="width:50px;height:10px"></td>
                <td align="right"" style="font-family: 微软雅黑; font-size: 15px">车次:</td><td> <input id="SelectCarTimes"  style="width:140px;font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 15px;"></input></td><td style="width:50px;height:20px"></td> 
                <td align="right"style="font-family: 微软雅黑; font-size: 15px">取送客户:</td><td> <input id="cbogrid_CollectClient" class="easyui-combogrid" style="width:140px;font-family: 微软雅黑; font-size: 21px; color: #FF0000;"data-options="
			panelWidth: 500,
			idField: 'ClientID',
			textField: 'ClientName',
           url: '/FreightReceiptsManage/SelecteClientInformation',
			columns: [[
				{field:'ClientID',title:'客户ID',width:80,hidden:true},
                {field:'ClientNumber',title:'客户编号',width:60,align:'center'},
				{field:'ClientName',title:'客户名称',width:180},
				{field:'ClientAbbreviation',title:'客服简称',width:80,align:'right'},
				{field:'LinkMan',title:'联系人',width:80,align:'right'},
				{field:'LinkPhone',title:'联系电话',width:100}
			 ]],
			fitColumns: true
		"></td><td style="width:50px;height:10px"></td>
                <td align="right"style="font-family: 微软雅黑; font-size: 15px">取送单号:</td><td> <input id="txt_SelectSendNumber" style="width:140px"></input></td><td style="width:20px;height:20px"></td>
                 </tr> 
                <tr style="height:5px"> </tr>
                <tr> 
               <td align="right"style="font-family: 微软雅黑; font-size: 15px">车次日期:</td><td> <input id="date_SelectCarTimesDate"  class="easyui-datebox" style="width:140px; font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 15px;"data-options="formatter:myformatter"></input></td> <td style="width:50px;height:20px"></td>
                <td align="right"style="font-family: 微软雅黑; font-size: 15px">  至   </td><td  ><input id="dat_EndTime" class="easyui-datebox" style="width:140px; font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 15px;"data-options="formatter:myformatter1"></input></td><td style="width:50px;height:20px"></td> 
                <td> <input  " type="submit" οnclick="SelectSendCarInformation()" value="查询" style="width:80px;color: #FF0000; font-size: 17px" /></td>  
                </tr> 
                 <tr style="height:10px"></tr>
           </table>
         </center>
            <table id="dgrd_SelectSendCarRecord"  class="easyui-datagrid"  style="width:1170px;height:400px;background-color: #CCCCCC;"
              data-options="rownumbers:true,singleSelect:true,onClickCell:myonClickCell 
              ,rowStyler:function(index,row){
        		if (index%2==0){
         		    return 'background-color:#D1EEEE';
          		 }
    		   } " frame="border">
		       <thead>                            
                        <tr align="center"> 
                        <th data-options="field:'CompanyAbbreviation',width:150,align:'center'">公司</th>
                        <th data-options="field:'SendNumber',width:150,align:'center'">取送单号<input id="SendNumber" type="button" οnclick='CarTimes("SendNumber","DductTime","DductTime","DductTime","DductTime","DductTime")' value=">>" style="background-color: #FFFFFF" /></th>
                        <th data-options="field:'DductTime',width:150,align:'center'">扣帐时间</th> 
                        <th data-options="field:'LogisticsPlaceName',width:80,align:'center'">物流地点</th>
                        <th data-options="field:'collectClientName',width:180,align:'center'" style="color: #FF3300; font-size: 17px; font-family: 华文行楷">取送客户<input id="collectClientName" type="button" οnclick='CarTimes("collectClientName","SendClientName","CollectFieldWord","CollectAddress","CollectAddress","CollectAddress")' value=">>" style="background-color: #FFFFFF" /></th>
                        <th data-options="field:'SendClientName',width:180,align:'center'" style="color: #FF3300; font-size: 17px; font-family: 华文行楷">下单客户</th>
                        <th data-options="field:'CollectFieldWord',width:70,align:'center'">运交领域</th>
                        <th data-options="field:'CollectAddress',width:170,align:'center'">地址</th> 
                        <th data-options="field:'DeliveryWay',width:100,align:'center'">配送方式</th> 
                        <th data-options="field:'PeiSongShuXing',width:100,align:'center'@*,formatter:farmatterPeiSongShuXing*@">配送属性</th> 
                        <th data-options="field:'CarTimes',width:70,align:'center'">车次<input id="CarTimes" type="button" οnclick='CarTimes("CarTimes","CarTimesDate","CarNumber","DriverName","StaffName2","StaffName3")' value=">>" style="background-color: #FFFFFF" /></th>
                        <th data-options="field:'CarTimesDate',width:100,align:'center'">车次日期</th> 
                        <th data-options="field:'CarNumber',width:70,align:'center'">车号</th> 
                        <th data-options="field:'DriverName',width:100,align:'center'">物流服务代表</th> 
                        <th data-options="field:'StaffName2',width:70,align:'center'">随车人员1</th> 
                        <th data-options="field:'StaffName3',width:70,align:'center'">随车人员2</th> 
                        <th data-options="field:'SendCarState',width:70,align:'center',formatter:SendCarStateformatter">派车<input id="SendCarState" type="button" οnclick='CarTimes("SendCarState","SendCarTime","SendCarTime","SendCarTime","SendCarTime","SendCarTime")' value=">>" style="background-color: #FFFFFF" /></th>
                        <th data-options="field:'SendCarTime',width:140,align:'center'">派车时间</th> 
                        <th data-options="field:'OpenCarAffirm',width:70,align:'center',formatter:OpenCarformatter">出车<input id="OpenCarAffirm" type="button" οnclick='CarTimes("OpenCarAffirm","FactDrawOutTime","FactDrawOutTime","FactDrawOutTime","FactDrawOutTime","FactDrawOutTime")' value=">>" style="background-color: #FFFFFF" /></th> 
                        <th data-options="field:'FactDrawOutTime',width:130,align:'center'">出车时间</th> 
                        <th data-options="field:'ReturnCarAffirm',width:70,align:'center',formatter:ReturnCarformatter">返车<input id="ReturnCarAffirm" type="button" οnclick='CarTimes("ReturnCarAffirm","FactReturnCarTime","FactReturnCarTime","FactReturnCarTime","FactReturnCarTime","FactReturnCarTime")' value=">>" style="background-color: #FFFFFF" /></th>  
                        <th data-options="field:'FactReturnCarTime',width:130,align:'center'">返车时间</th> 
                        <th data-options="field:'UnusualReason',width:100,align:'center',formatter:Unusualformatter">异常说明@*<input id="UnusualReason" type="button" οnclick='CarTimes("UnusualReason","HandleManName","HandleTime","HandleManName","HandleManName","HandleManName")' value=">>" style="background-color: #FFFFFF" />*@</th>
                        <th data-options="field:'HandleManName',width:70,align:'center',hidden:true">处理人员</th> 
                        <th data-options="field:'HandleTime',width:130,align:'center',hidden:true">处理时间</th> 
                        <th data-options="field:'SignForState',width:130,align:'center'">签收单确认</th> 
                        <th data-options="field:'SignFor',width:90,align:'center',formatter:SignForformatter">签收单状态<input id="SignFor" type="button" οnclick='CarTimes("SignFor","Remark","Remark","Remark","Remark","Remark")' value=">>" style="background-color: #FFFFFF" /></th>
                        <th data-options="field:'Remark',width:600,align:'center',formatter:formatter4">历史记录</th> 
                         </tr>
		        </thead>
                </table>
        </div>
  <div class="easyui-window" id="Wnd_ClientAddress" style="width:300px; height:200px; top:190px; right:200px; background-color: #CCCCFF;" title="结案确认">
      <center> <table>
       <tr>
       <td style="color: #FF3300; font-size: 15px">未结案原因:</td> <td> <input id="txt_weijianan" type="text" style="border-style: hidden; font-size: 15px"  readonly="readonly" /></td>
        </tr>
             <tr style="height:10px"> </tr> 
          <tr> 
          <td  style="color: #FF3300; font-size: 15px"><input id="txt_wer" type="text" style="border-style: hidden;width:90px; font-size: 14px;background-color: #CCCCFF;color: #FF0000;"  readonly="readonly" /></td> <td> <input id="txt_jieanreason" type="text" style="border-style: hidden; font-size: 15px;"  /></td>
        </tr>
         </table>
        <table>
         <tr style="height:10px"></tr> 
         <tr><td >  <input  type="submit" οnclick="$('#txt_wer').val('正常结案原因:')" value="正常结案" style="width:100px;color: #FF0000; font-size: 17px" /></td>  <td><input  type="submit" οnclick="$('#txt_wer').val('异常结案原因:')" value="特批异常结案" style="width:110px;color: #FF0000; font-size: 17px" /> </td></tr>  
    </table>
     <table>
         <tr style="height:20px"></tr>  
     </table>
    </center>
      <center>
     
      <input  type="submit" οnclick="Confirm()" value="确认" style="width:100px;color: #FF0000; font-size: 17px" /> 
     
     </center>
 </div>

//脚本代码:

<script type="text/javascript">
    $(document).ready(function () {
        $("#Wnd_CarTimesReceipts").fadeOut(100);//隐藏窗体
        $("#Wnd_CarTimesReceipts").show(1500);//显示窗体
         $("#Wnd_ClientAddress").window("close");
        BanDing();
        CarTimes("", "DductTime", "SendClientName", "CollectFieldWord", "CollectAddress", "SendCarTime"); //调用方法,"DductTime"参数为列名
        g = 0;
        CarTimes("", "CarTimesDate", "SendClientName", "DriverName", "StaffName2", "StaffName3");
        g = 0;
        CarTimes("", "FactReturnCarTime", "FactDrawOutTime", "HandleManName", "HandleTime", "Remark");
      });
    //加载数据到派车记录查询的datagrid中
    function BanDing(){                                     
        $.getJSON("/DrawOutAndReturnCar/SelectSendCarRecord?intLogisticsPlaceID=0"+"&intDeliveryWayID=0"+"&strSendNumber="+""+"&intSendClientID=0"+"&intCollectClientID=0"+"&intCompanyID=0"+
        "&strCarTimes="+""+"&strPredictDrawOutTime="+""+"&strCarTimesDate="+""+"&strSignFor="+""+"&intSendCarStateID=0"+"&",
              function (data) { //&为分隔符号,它将参数分隔开来                                                               
                  $("#dgrd_SelectSendCarRecord").datagrid('loadData', data); //loadData是加载数据到datagrid中
              });
           }
     //当datagrid加载每一行数据时触发此方法
    function OpenCarformatter(coulm, row) {
        if (row.DrawOutUnusualName != null) {//判断出车异常是否为null
            return '<span style="color: #FF3399; font-size: 15px">' + row.DrawOutUnusualName + '</span>';
                 }
               else {
                   if (coulm == 1) {//判断出车确认是否为true
                       return '<span style="color: #CC3300; font-size: 13px">已出车</span>'; 
                   }
                   else {
                       if (row.DeliveryWayID == 30 && row.MX_DeliveryCarServiceID == null) {//判断配送方式是否为客户取送
                           return "";
                       } 
                       else {
                           return "未出车"
                       };
                      } 
               }
           }
    //当datagrid加载每一行数据时触发此方法
           function ReturnCarformatter(coulm, row) {//coulm为datagrid中单元格的值,row行数据
        if (row.ReturnCarUnusualIName != null) { //判断返车异常是否为null
            return '<span style="color: #FF3399; font-size: 15px">' + row.ReturnCarUnusualIName + '</span>'; 
        }
        else {
            if (coulm == 1) {//判断返车确认是否为true
                return '<span style="color: #CC3300; font-size: 13px">已返车</span>';
              }
            else {
                if (row.DeliveryWayID == 30 && row.MX_DeliveryCarServiceID == null) {//判断配送方式是否为客户取送,客户取送的属性明细id为30
                return "";
                } else {
                    return "未返车";
                } 
              } 
        }
    }
    //当datagrid加载每一行数据时触发此方法
    function SendCarStateformatter(coulm, row) {
        if (coulm == null) {//判断派车状态是否为空 
            if (row.DeliveryWayID == 30) { //判断配送方式是否为客户取送
                return ""; 
             }
            else {
                return "未派车" 
            };     
        }
        else {
            return '<span style="color: #CC3300; font-size: 13px">已派车</span>';
         }
    }
    //当datagrid加载每一行数据时触发此方法
    function Unusualformatter(coulm, row){
        if (row.DrawOutUnusualNameReason != "" && row.DrawOutUnusualNameReason != null){//如果出车异常原因有值就返回出车异常原因的值
            return row.DrawOutUnusualNameReason;
        }
        else { //如果返车异常原因有值就返回返车异常原因的值
            return row.MX_ReturnCarUnusualIIName;
         }
    }

    function SignForformatter(coulm, row) {
        if (coulm.trim() == "未结案" && row.SignForState != "未签收") {//判断客户签收货物是否规范,如果不规范就返回一个按钮
            return '<input id="" type="button" value="' + coulm + '"style="width:75px;color: #FF0000;font-size: 17px" />';
        }
        else {
            return coulm.trim(); 
        }
    }
    var Eindex = -1;
    function myonClickCell(index, zhi, row){ //参数index为行索引,zhi为行数据,row为点击的那一行的单元格的值
        var rows = $("#dgrd_SelectSendCarRecord").datagrid("getRows");//获取datagrid中的所有数据
        if (row != null) {//判断点击的那一行的单元格的值是否为空 
          if (zhi == "SignFor" & row.trim() == "未结案" & rows[index].SignForState.trim() != "未签收") {
              Eindex =index; 
            $("#Wnd_ClientAddress").window("open");//打开结案窗体
            $("#txt_weijianan").val(rows[index].SignForState); 
         }
    }
}
    //点击结案窗体中的‘确认’按钮时触发此方法
    function Confirm() {
        var curr_time = new Date();//获取当前日期
        var strDate = curr_time.getFullYear() + "-"; //获取年份
        var vMon = curr_time.getMonth() + 1; //获取月份
        var vDay = curr_time.getUTCDate();
        var vMinutes = curr_time.getMinutes();
        var time = curr_time.getHours();
        strDate += (vMon < 10 ? "0" + vMon : vMon) + "-";  //并接字符串
        strDate += (vDay < 10 ? "0" + vDay : vDay) + " ";
        strDate += (time < 10 ? "0" + time : time) + ":";
        strDate += (vMinutes < 10 ? "0" + vMinutes : vMinutes);
        var rows = $("#dgrd_SelectSendCarRecord").datagrid("getRows");
        if ($('#txt_wer').val() == "正常结案原因:") {//判断是否点击‘正常结案’按钮
        var record= "签收单确认时:" + $("#txt_weijianan").val() + ",于" + strDate + "作正常结案,结案原因:" + $("#txt_jieanreason").val().trim();//记录正常结案原因
            rows[Eindex].SignForState = "正常"; rows[Eindex].SignFor = "正常结案";
            rows[Eindex].Remark =record;
            $("#dgrd_SelectSendCarRecord").datagrid("refreshRow", Eindex); //刷新行索引为Eindex的那一行数据
            $.getJSON("/DrawOutAndReturnCar/UpdateFreightReceiptsSignFor?intFreightReceiptsID=" + rows[Eindex].FreightReceiptsID + "&intSignForStateID=21" + "&strSignFor=" + "正常结案" + "&strRemark=" + record); //21对应明细表的签收单‘正常’
             $("#txt_jieanreason").val("");//清空结案原因的文本值
             $("#Wnd_ClientAddress").window("close");//关闭结案窗体
        }
         if ($('#txt_wer').val() == "异常结案原因:") {//判断是否点击‘异常结案’按钮
             var record1 = "签收单确认时:" + $("#txt_weijianan").val() + ",于" + strDate + "作异常结案,结案原因:" + $("#txt_jieanreason").val().trim(); //记录异常结案原因
         rows[Eindex].SignFor = "异常结案"; rows[Eindex].Remark = record1;
            $("#dgrd_SelectSendCarRecord").datagrid("refreshRow", Eindex);//刷新行数据
            $.getJSON("/DrawOutAndReturnCar/UpdateFreightReceiptsSignFor?intFreightReceiptsID=" + rows[Eindex].FreightReceiptsID + "&intSignForStateID=" + rows[Eindex].SignForStateID + "&strSignFor=" + "异常结案" + "&strRemark=" + record1);
            $("#txt_jieanreason").val("");
            $("#Wnd_ClientAddress").window("close");//关闭结案窗体
         }
    }
    //在方法外面定义全局变量
    var wuliudidianID = 0; var peisongfanshi = 0; var qusongdanhao = ""; var jijiankehu = 0; var shoujiankehu = 0; var gongsiID = 0; var checi = "";
    var checishijian = "";var jiezhishijian = "";var qianshoudanzhuangtai = "";var paichezhuangtai = 0; 
    //在派车记录查询窗体中点击‘查询’按钮时触发此方法
    function SelectSendCarInformation() {
        if ($("#cbo_SelectLogisticsPlace").combobox("getValue").trim().length > 0) {wuliudidianID = $("#cbo_SelectLogisticsPlace").combobox("getValue"); }//判断下拉框是否选中,如果选中就获取下拉框的值,不选中就传0给存储过程做模糊查询
        if ($("#cbo_SelectDeliveryWay").combobox("getValue").trim().length > 0) { peisongfanshi = $("#cbo_SelectDeliveryWay").combobox("getValue"); }  
        if ($("#txt_SelectSendNumber").val().trim().length > 0) { qusongdanhao = $("#txt_SelectSendNumber").val(); } //判断文本框是否选中,如果选中就获取文本框的值,不选中就传""给存储过程做模糊查询
        if ($("#cbogrid_SendClient").combogrid("getValue").trim().length > 0) { jijiankehu = $("#cbogrid_SendClient").combogrid("getValue"); } 
        if ($("#cbogrid_CollectClient").combogrid("getValue").trim().length > 0) { shoujiankehu = $("#cbogrid_CollectClient").combogrid("getValue"); } //判断下拉列表是否选中,如果选中就获取下拉列表的值,不选中就传0给存储过程做模糊查询
        if ($("#cbo_SelectDeliveryGrade").combobox("getValue").trim().length > 0) { gongsiID = $("#cbo_SelectDeliveryGrade").combobox("getValue"); } 
        if ($("#SelectCarTimes").val().trim().length > 0) { checi = $("#SelectCarTimes").val(); } 
        if ($("#date_SelectCarTimesDate").datebox("getValue").trim().length > 0) { checishijian = $("#date_SelectCarTimesDate").datebox("getValue"); } //判断日期框是否选中,如果选中就获取下拉框的值,不选中就传""给存储过程做模糊查询
        if ($("#dat_EndTime").datebox("getValue").trim().length > 0) { jiezhishijian = $("#dat_EndTime").datebox("getValue"); } 
        if ($("#cbo_SendState").val() == "未派车") { paichezhuangtai = 45; } else { if ($("#cbo_SendState").val() == "所有") { } else {qianshoudanzhuangtai = $("#cbo_SendState").val(); } }
        $.getJSON("/DrawOutAndReturnCar/SelectSendCarRecord?intLogisticsPlaceID=" + wuliudidianID + "&intDeliveryWayID=" + peisongfanshi + "&strSendNumber=" + qusongdanhao + "&intSendClientID=" + jijiankehu + "&intCollectClientID=" + shoujiankehu + "&intCompanyID="+gongsiID +
        "&strCarTimes=" + checi + "&strPredictDrawOutTime=" + checishijian + "&strCarTimesDate=" + jiezhishijian + "&strSignFor=" + qianshoudanzhuangtai + "&intSendCarStateID=" + paichezhuangtai + "&",
              function (data) {
                  $("#dgrd_SelectSendCarRecord").datagrid('loadData', data); //将模糊查询出来的数据加载到datagrid中
                  wuliudidianID = 0; peisongfanshi = 0; qusongdanhao = ""; jijiankehu = 0; shoujiankehu = 0; gongsiID = 0;  checi = "";  checishijian = "";  jiezhishijian = "";  qianshoudanzhuangtai = "";  paichezhuangtai = 0; 
              });

          }
     //日期文本框中的日期格式转换
    function myformatter(date) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        var d = date.getDate();
        return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);//返回转换后的日期格式
    }
    //日期文本框中的日期格式转换
    function myformatter1(date) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        var d = date.getDate();
        return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
    }
    var g = 0;
      function CarTimes(ID,FieldName1, FieldName2, FieldName3, FieldName4, FieldName5) {
         if (g == 0) {
             $('#dgrd_SelectSendCarRecord').datagrid('hideColumn', FieldName1); // 隐藏单元格,参数FieldName1为datagrid中的列名
             $('#dgrd_SelectSendCarRecord').datagrid('hideColumn', FieldName2);
             $('#dgrd_SelectSendCarRecord').datagrid('hideColumn', FieldName3); 
             $('#dgrd_SelectSendCarRecord').datagrid('hideColumn', FieldName4);
             $('#dgrd_SelectSendCarRecord').datagrid('hideColumn', FieldName5);
             $("#"+ID).val(">>");
             g = 1;
         }
         else {
             $('#dgrd_SelectSendCarRecord').datagrid('showColumn', FieldName1); //显示单元格
             $('#dgrd_SelectSendCarRecord').datagrid('showColumn', FieldName2);
             $('#dgrd_SelectSendCarRecord').datagrid('showColumn', FieldName3); 
             $('#dgrd_SelectSendCarRecord').datagrid('showColumn', FieldName4);
             $('#dgrd_SelectSendCarRecord').datagrid('showColumn', FieldName5);
             $("#"+ID).val("<<");
             g = 0;
         }
     }
     var BZ = ""; 
     //返回历史记录数据
     function formatter4(coulm, row) {
         BZ = "";
         if (row.Remark2 != null) {
             if (row.Remark != null) { BZ = row.Remark }
             return row.Remark2.trim() + "  " + BZ;//将所有历史记录并接后的返回
         }
         else {return row.Remark; }

     }
</script>


 

//下面是接收从界面传值的控制器的代码:

   //修改货运单状态和记录信息
        public ActionResult UpdateFreightReceiptsSignFor(int intFreightReceiptsID, int intSignForStateID, string strSignFor, string strRemark)
        {//参数intFreightReceiptsID为货运单ID、intSignForStateID为签收状态ID、strSignFor为签收确认、strRemark为备注
            int i = myDrawOutAndReturnCar.UpdateFreightReceiptsSignFor(intFreightReceiptsID, intSignForStateID, strSignFor, strRemark);
            return Json(i, JsonRequestBehavior.AllowGet);
        }
        public ActionResult UpdateCarTimes(int intMX_DeliveryCarServiceID, int intDeliverReceiptsID)
        {
            int i = myDrawOutAndReturnCar.UpdateCarTimes(intMX_DeliveryCarServiceID, intDeliverReceiptsID);
            return Json(i, JsonRequestBehavior.AllowGet);    
        }
//派车记录查询
        public ActionResult SelectSendCarRecord(int intLogisticsPlaceID, int intDeliveryWayID, string strSendNumber,
            int intSendClientID, int intCollectClientID, int intCompanyID, string strCarTimes,
       string strPredictDrawOutTime, string strCarTimesDate, string strSignFor, int intSendCarStateID)
        {//参数intLogisticsPlaceID为物流地点、intDeliveryWayID为配送方式、strSendNumber为取送单号、intSendClientID为寄件客户ID、intCollectClientID为收件客户ID、intCompanyID为公司ID、strPredictDrawOutTime为预出车时间、strCarTimesDate为车次日期、strSignFor为签收确认、intSendCarStateID为签收状态
            DataTable dt = myDrawOutAndReturnCar.SelectSendCarRecord( intLogisticsPlaceID,  intDeliveryWayID, strSendNumber, intSendClientID, intCollectClientID, intCompanyID, strCarTimes, strPredictDrawOutTime, strCarTimesDate, strSignFor, intSendCarStateID);
            StringBuilder stringbuilder = new StringBuilder();
            DataView dv = new DataView(dt);
            var y = "";
            if (intLogisticsPlaceID != 0) { 
                y = "LogisticsPlaceID=" + intLogisticsPlaceID; //过滤出符合条件的单据
            }
            if (intDeliveryWayID != 0) {
                    if (y != "") { y = y + " and DeliveryWayID=" + intDeliveryWayID; }
                    else { y = y + " DeliveryWayID=" + intDeliveryWayID; }
            }
            if (strSendNumber != "") { 
                    if (y != "") { y = y + " and SendNumber='" + strSendNumber + "'"; }
                    else { y =y+ " SendNumber='" + strSendNumber + "'"; }
            }
            if (intSendClientID != 0) { 
                if (y != "") { y = y + " and SendClientID=" + intSendClientID; } 
                else {
                y = y + " SendClientID=" + intSendClientID; 
                 }
            }
            if (intCollectClientID != 0)
            {
                if (y != "") { y = y + " and CollectClientID=" + intCollectClientID; }
                else { y = y + " CollectClientID=" + intCollectClientID; }
            }
            if (intCompanyID != 0)
            {
                if (y != "") { y = y + " and CompanyID=" + intCompanyID; }
                else { y = y + " CompanyID=" + intCompanyID; }
            }
            if (strCarTimes != "")
            {
                if (y != "") { y = y + " and CarTimes='" + strCarTimes + "'"; }
                else { y = y + " CarTimes='" + strCarTimes + "'"; }
            }
            if (strPredictDrawOutTime != "" && strCarTimesDate != "")
            {
                if (y != "") { y = y + " and CarTimesDate >= '" +strPredictDrawOutTime + "' and " + "CarTimesDate <='"+strCarTimesDate + "'"; }
                else { y = y +" CarTimesDate >= '" +strPredictDrawOutTime + "' and " + "CarTimesDate <='"+strCarTimesDate+ "'"; }
            }
            if (strSignFor != "")
            {
                if (y != "") { y = y + " and SignFor='" + strSignFor + "'"; }
                else { y = y + " SignFor='" + strSignFor + "'"; }
            }
            if (intSendCarStateID != 0)
            {
                if (y != "") { y = y + " and FreightReceiptsStateID= 43" + " and DeliveryWayID<>30 "; }
                else { y = y + " FreightReceiptsStateID= 43" + " and DeliveryWayID<>30 "; }
            }
             dv.RowFilter = y;
            DataTable dtChild = dv.ToTable();
            List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dtChild);
            return Json(listReturn, JsonRequestBehavior.AllowGet);
        }


 

//下面是接收从控制器传值的逻辑层的代码:

//修改货运单状态和记录信息
       public int UpdateFreightReceiptsSignFor(int intFreightReceiptsID,int intSignForStateID,string strSignFor,string strRemark)
       {
           SqlParameter[] SQL ={
                                  new SqlParameter("@type",SqlDbType.Char),
                                   new SqlParameter("@FreightReceiptsID",SqlDbType.Int),
                                   new SqlParameter("@SignForStateID",SqlDbType.Int),
                                   new SqlParameter("@SignFor",SqlDbType.Char),
                                   new SqlParameter("@Remark",SqlDbType.Char),
                               };
           SQL[0].Value = "UpdateFreightReceiptsSignFor";
           SQL[1].Value = intFreightReceiptsID;
           SQL[2].Value =intSignForStateID ;
           SQL[3].Value =strSignFor ;
           SQL[4].Value = strRemark;
           int i = myDALMethod.DAL_OPTableDB_Par("SendCar", SQL);
           return i;
       }

     //派车记录查询
       public DataTable SelectSendCarRecord(int intLogisticsPlaceID, int intDeliveryWayID, string strSendNumber, int intSendClientID, int intCollectClientID, int intCompanyID, string strCarTimes,
       string strPredictDrawOutTime, string strCarTimesDate, string strSignFor, int intSendCarStateID)
       {
           SqlParameter[] SQL ={
                                  new SqlParameter("@type",SqlDbType.Char),
                               };
            SQL[0].Value = "SelectSendCarRecord";
            DataTable dt = myDALMethod.DAL_SelectDB_Par("SendCar", SQL);
           return dt;
       }


 

//下面是存储过程的代码:

--修改货运单状态和签收单状态
  if @type='UpdateReturnCarFreightReceiptsState'  
   begin
   update FreightReceiptsList set FreightReceiptsList.FreightReceiptsStateID=@FreightReceiptsStateID,
   FreightReceiptsList.SignForStateID=@SignForStateID,SignFor=@SignFor
   where  FreightReceiptsList.FreightReceiptsID=@FreightReceiptsID
   end 
  --查询记录派车信息
 if @type='SelectSendCarRecord'
    begin
 
SELECT     FreightReceiptsList.FreightReceiptsID, RTRIM(FreightReceiptsList.SendFieldWord) AS SendFieldWord, RTRIM(FreightReceiptsList.CheckNo) AS CheckNo, RTRIM(FreightReceiptsList.Remark) 
                      AS Remark, RTRIM(DeliveryFieldServiceList.FieldWord) AS CollectFieldWord, RTRIM(FreightReceiptsList.PayCondition) AS PayCondition, RTRIM(FreightReceiptsList.CollectAddress) 
                      AS CollectAddress, RTRIM(FreightReceiptsList.SendAddress) AS SendAddress, RTRIM(FreightReceiptsList.RequireServiceTime) AS RequireServiceTime, RTRIM(FreightReceiptsList.ConnectTime) 
                      AS ConnectTime, RTRIM(DeliverReceiptsList.OpenCarAffirm) AS OpenCarAffirm, RTRIM(DeliverReceiptsList.ReturnCarAffirm) AS ReturnCarAffirm, RTRIM(DeliverReceiptsList.HandleTime) 
                      AS HandleTime, RTRIM(DeliverReceiptsList.BoxCount) AS BoxCount, RTRIM(CompanyList.CompanyID) AS CompanyID, RTRIM(CompanyList.CompanyAbbreviation) AS CompanyAbbreviation, 
                      RTRIM(CompanyList.CompanyName) AS CompanyName, RTRIM(CompanyList.Address) AS Address, RTRIM(CompanyList.LinkPhone) AS LinkPhone, RTRIM(CompanyList.LinkMan) AS LinkMan, 
                      RTRIM(FreightReceiptsList.SendClientID) AS SendClientID, RTRIM(ClientList_1.ClientName) AS ClientName, RTRIM(ClientList_1.ClientAbbreviation) AS ClientAbbreviation, 
                      RTRIM(ClientList_1.LinkMan) AS LinkMan1, RTRIM(FreightReceiptsList.CollectClientID) AS CollectClientID, RTRIM(ClientList.ClientName) AS ClientName1, RTRIM(ClientList.ClientAbbreviation) 
                      AS ClientAbbreviation1, RTRIM(ClientList.LinkMan) AS LinkMan1, RTRIM(DeliverReceiptsList.MX_DeliveryCarServiceID) AS MX_DeliveryCarServiceID, 
                      RTRIM(MX_DeliveryCarTimesServiceList.CarTimes) AS CarTimes, RTRIM(MX_DeliveryCarTimesServiceList.CarNumber) AS CarNumber, 
                      RTRIM(MX_DeliveryCarTimesServiceList.PredictDrawOutTime) AS PredictDrawOutTime, RTRIM(MX_DeliveryCarTimesServiceList.ReceiptsStopTime) AS ReceiptsStopTime, 
                      RTRIM(MX_DeliveryCarTimesServiceList.ServiceField) AS ServiceField, CONVERT(varchar(20), MX_DeliveryCarTimesServiceList.FactDrawOutTime, 120) AS FactDrawOutTime, 
                      CONVERT(varchar(20), MX_DeliveryCarTimesServiceList.FactReturnCarTime, 120) AS FactReturnCarTime, RTRIM(MX_DeliveryCarTimesServiceList.MX_GetSendID) AS MX_GetSendID, 
                      RTRIM(MX_AttributeDetailedList.AttributeDetailedName) AS AttributeDetailedName, RTRIM(MX_DeliveryCarTimesServiceList.Personnel_OneID) AS Personnel_OneID, RTRIM(StaffList_3.StaffName) 
                      AS StaffName, RTRIM(StaffList_3.StaffNumber) AS StaffNumber, RTRIM(MX_DeliveryCarTimesServiceList.Personnel_TwoID) AS Personnel_TwoID, RTRIM(StaffList_1.StaffName) AS StaffName1, 
                      RTRIM(StaffList_1.StaffNumber) AS StaffNumber1, RTRIM(FreightReceiptsList.SendNumber) AS SendNumber, ClientList_1.ClientName AS SendClientName, 
                      ClientList_1.ClientAbbreviation AS SendClientAbbreviation, ClientList_1.LinkMan AS sendLinkMan, ClientList.ClientName AS collectClientName, 
                      ClientList.ClientAbbreviation AS collectClientAbbreviation, ClientList.LinkMan AS collectLinkMan, ClientList.LinkPhone AS collectLinkPhone, ClientList.ClientNumber AS collectClientNumber, 
                      StaffList_3.StaffName AS StaffName2, StaffList_3.StaffNumber AS StaffNumber2, StaffList_1.StaffName AS StaffName3, StaffList_1.StaffNumber AS StaffNumber3, 
                      MX_DeliveryCarTimesServiceList.PredictDrawOutTime AS PredictDrawOutTime2, MX_DeliveryCarTimesServiceList.DeliveryCarTimeServiceID, 
                      MX_AttributeDetailedList_1.AttributeDetailedName AS DeliveryWay, MX_DeliveryCarTimesServiceList.LogisticsServeDelegateID, DriverList.Driver_Number, DriverList.DriverName, 
                      MX_DeliveryCarTimesServiceList.SendCarStateID, MX_AttributeDetailedList_2.AttributeDetailedName AS SendCarState, FreightReceiptsList.SignForStateID, 
                      RTRIM(MX_AttributeDetailedList_3.AttributeDetailedName) AS SignForState, RTRIM(DrawOutUnusualList.DrawOutUnusualName) AS DrawOutUnusualName, DeliverReceiptsList.DrawOutUnusualID, 
                      DeliverReceiptsList.DrawOutUnusualIReasonID, RTRIM(MX_DrawOutUnusualDetailList.DrawOutUnusualName) AS DrawOutUnusualNameReason, DeliverReceiptsList.ReturnCarUnusualIID, 
                      RTRIM(ReturnCarUnusualIList.ReturnCarUnusualIName) AS ReturnCarUnusualIName, DeliverReceiptsList.ReturnCarUnusualIReasonID, 
                      RTRIM(MX_ReturnCarUnusualIList.MX_ReturnCarUnusualIIName) AS MX_ReturnCarUnusualIIName, FreightReceiptsList.SignFor, LogisticsPlaceList.LogisticsPlaceID, 
                      LogisticsPlaceList.LogisticsPlaceName, CONVERT(varchar(20), MX_DeliveryCarTimesServiceList.SendCarTime, 120) AS SendCarTime, DeliverReceiptsList.HandleManID, 
                      StaffList_2.StaffName AS HandleManName, DeliverReceiptsList.MX_DeliveryCarServiceID AS MX_DeliveryCarServiceID1, CONVERT(varchar(20), FreightReceiptsList.DductTime, 120) AS DductTime, 
                      FreightReceiptsList.StaffID, StaffList.StaffName AS kaiDanRen, MX_AttributeDetailedList_4.MX_AttributeDetailedID, MX_AttributeDetailedList_4.AttributeDetailedName AS PeiSongShuXing, 
                      DeliverReceiptsList.Remark AS Remark2, FreightReceiptsList.FreightReceiptsStateID, CONVERT(varchar(20), DeliveryCarTimesServiceList.CarTimesDate, 120) AS CarTimesDate, 
                      DeliveryFieldServiceList.DeliveryWayID
FROM         MX_DrawOutUnusualDetailList RIGHT OUTER JOIN
                      MX_AttributeDetailedList AS MX_AttributeDetailedList_2 INNER JOIN
                      MX_AttributeDetailedList INNER JOIN
                      MX_DeliveryCarTimesServiceList ON MX_AttributeDetailedList.MX_AttributeDetailedID = MX_DeliveryCarTimesServiceList.MX_GetSendID INNER JOIN
                      DeliveryCarTimesServiceList ON MX_DeliveryCarTimesServiceList.DeliveryCarTimeServiceID = DeliveryCarTimesServiceList.DeliveryCarTimesServiceID INNER JOIN
                      DriverList ON MX_DeliveryCarTimesServiceList.LogisticsServeDelegateID = DriverList.DriverID ON 
                      MX_AttributeDetailedList_2.MX_AttributeDetailedID = MX_DeliveryCarTimesServiceList.SendCarStateID INNER JOIN
                      StaffList AS StaffList_2 INNER JOIN
                      DeliverReceiptsList ON StaffList_2.StaffID = DeliverReceiptsList.HandleManID ON 
                      MX_DeliveryCarTimesServiceList.MX_DeliveryCarTimesServiceID = DeliverReceiptsList.MX_DeliveryCarServiceID LEFT OUTER JOIN
                      MX_ReturnCarUnusualIList ON DeliverReceiptsList.ReturnCarUnusualIReasonID = MX_ReturnCarUnusualIList.MX_ReturnCarUnusualIID LEFT OUTER JOIN
                      ReturnCarUnusualIList ON DeliverReceiptsList.ReturnCarUnusualIID = ReturnCarUnusualIList.ReturnCarUnusualIID ON 
                      MX_DrawOutUnusualDetailList.MX_DrawOutUnusualDetailID = DeliverReceiptsList.DrawOutUnusualIReasonID LEFT OUTER JOIN
                      DrawOutUnusualList ON DeliverReceiptsList.DrawOutUnusualID = DrawOutUnusualList.DrawOutUnusualID LEFT OUTER JOIN
                      StaffList AS StaffList_3 ON MX_DeliveryCarTimesServiceList.Personnel_OneID = StaffList_3.StaffID LEFT OUTER JOIN
                      StaffList AS StaffList_1 ON MX_DeliveryCarTimesServiceList.Personnel_TwoID = StaffList_1.StaffID RIGHT OUTER JOIN
                      LogisticsPlaceList INNER JOIN
                      MX_AttributeDetailedList AS MX_AttributeDetailedList_4 INNER JOIN
                      DeliveryFieldServiceList INNER JOIN
                      MX_AttributeDetailedList AS MX_AttributeDetailedList_3 INNER JOIN
                      FreightReceiptsList INNER JOIN
                      CompanyList ON FreightReceiptsList.CompanyID = CompanyList.CompanyID INNER JOIN
                      ClientList AS ClientList_1 ON FreightReceiptsList.SendClientID = ClientList_1.ClientID INNER JOIN
                      ClientList ON FreightReceiptsList.CollectClientID = ClientList.ClientID ON MX_AttributeDetailedList_3.MX_AttributeDetailedID = FreightReceiptsList.SignForStateID INNER JOIN
                      StaffList ON FreightReceiptsList.StaffID = StaffList.StaffID ON DeliveryFieldServiceList.DeliveryFieldServiceID = FreightReceiptsList.DeliveryFieldServiceID INNER JOIN
                      MX_AttributeDetailedList AS MX_AttributeDetailedList_1 ON DeliveryFieldServiceList.DeliveryWayID = MX_AttributeDetailedList_1.MX_AttributeDetailedID ON 
                      MX_AttributeDetailedList_4.MX_AttributeDetailedID = DeliveryFieldServiceList.SXMX_AttributeID ON LogisticsPlaceList.LogisticsPlaceID = DeliveryFieldServiceList.LogisticsPlaceID ON 
                      DeliverReceiptsList.FreightReceiptsID = FreightReceiptsList.FreightReceiptsID         
                    end
                
  if @type='UpdateCarTimes'
  begin
  update DeliverReceiptsList set  MX_DeliveryCarServiceID=@MX_DeliveryCarServiceID
  where DeliverReceiptsID=@DeliverReceiptsID      
  end
 

仅供学习,禁止商业用途

 

 

 

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值