出车确认
出车确认是对已经装车完毕准备发车的车次进行单据确认,出车前记录异动的单据
出车确认界面:
逐单据出车确认界面:
Datagrid中下拉框的加载:
界面html代码:
<th data-options="field:'DrawOutUnusualID',width:130,align:'center',formatter:formatterDrawOutUnusualName,editor:{
type:'combobox',
options:{
onSelect:DrawOutonChange,
valueField:'DrawOutUnusualID',
textField:'DrawOutUnusualName',
url:'/DrawOutAndReturnCar/SelectDrawOutUnusual',
}
}" >出车异常</th>
<th data-options="field:'DrawOutUnusualReasonID',width:160,align:'center',formatter:formatterDrawOutUnusualReason,editor:{
type:'combobox',
options:{
valueField:'MX_AttributeDetailedID',
textField:'AttributeDetailedName',
}
}" >异常原因</th>
<th data-options="field:'MX_AttributeDetailedID',width:130,align:'center',formatter:formatterDeliveryWayName,editor:{
type:'combobox',
options:{
onSelect:DrawOutonChange2,
valueField:'MX_AttributeDetailedID',
textField:'AttributeDetailedName',
url:'/DeliveryFieldAddress/SelectAttributeGather?AttributeGatherID=1'
}
}" >配送方式</th>
脚本代码:
//点击窗体出车确认中的datagrid中的出车异常下拉框时触发此方法
function DrawOutonChange(){
var seasion = $('#dgrd_DeliveryCarTimesReceipts').datagrid('getEditor', { index: MyIndex, field: 'DrawOutUnusualID' });
$.getJSON("/DrawOutAndReturnCar/SelectDrawOutUnusualReason?DrawOutUnusualID=" + $(seasion.target).combobox("getValue")//获取编辑中的出车异常下拉框的值
, function (data) {//将出车异常明细绑定到出车异常原因下拉框中
var edCangKu = $('#dgrd_DeliveryCarTimesReceipts').datagrid('getEditor', { index: MyIndex, field: 'DrawOutUnusualReasonID' });
$(edCangKu.target).combobox({ data: data, valueField: 'MX_DrawOutUnusualDetailID', textField: 'DrawOutUnusualName' });
});
}
出车确认涉及的表和表的关系
出车确认用到的表有:配送车次维护表(DeliveryCarTimesServiceList)、配送车次维护明细表
(MX_DeliveryCarTimesServiceList)、物流地点表(LogisticsPlaceList)、属性明细表(MX_AttributeDetailedList)、出车异常表(DrawOutUnusualList)、出车异常明细(MX_DrawOutUnusualDetailList)、客户表(ClientList)、公司表(CompanyList)、货运单表(FreightReceiptsList)、发车单据表(DeliverReceiptsList)、员工表(StaffList)、配送领域维护表(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、物流地点名称、地址
属性明细表的字段:属性明细ID、属性明细名称、属性集合ID
列名 | 数据类型 | 主键/外键 | 说明 |
MX_AttributeDetailedID | Int | 主键 | 属性明细ID |
AttributeDetailedName | Char |
| 属性明细名称 |
AttributeGatherID | 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 |
| 客户编号 |
员工表主要字段有:员工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(CompanyID)、公司简称(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、配送等级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代码:
<body>
<table id="dgrd_DeliveryCarTimesService" class="easyui-datagrid" title="出车确认" style="width:1100px;height:360px;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:'MX_DeliveryCarTimesServiceID',width:8,hidden:true, align:'center'" bgcolor="#3333CC">车次ID</th>
<th data-options="field:'AttributeDetailedName',width:150,align:'center'">配送方式</th>
<th data-options="field:'CarTimes',width:150,align:'center',formatter:myFormatterCarTimes">车次</th>
<th data-options="field:'SendClasses',width:150,align:'center'" style="color: #FF3300; font-size: 17px; font-family: 华文行楷">配送班次</th>
<th data-options="field:'ServiceField',width:365,align:'center'" style="color: #FF3300; font-size: 17px; font-family: 华文行楷">运交领域</th>
<th data-options="field:'CarTimesDate',width:100,align:'center'" style="color: #FF3300; font-size: 17px; font-family: 华文行楷">车次日期</th>
<th data-options="field:'PredictDrawOutTime',width:150,align:'center'" style="color: #FF3300; font-size: 17px; font-family: 华文行楷">预出车时间</th>
<th data-options="field:'LinkAddress',width:100,align:'center',formatter:myFormatterDelete">出车确认</th>
</tr>
</thead>
</table>
<center><input " type="submit"οnclick="btn_Allcancel()" value="全部取消" style="width:100px;color: #FF0000; font-size: 17px" />
<input " type="submit" οnclick="btn_SelectAll()" value="全部勾选" style="width:100px;color: #FF0000; font-size: 17px" />
<input " type="submit" οnclick="btn_Confirm()" value="确认" style="width:100px;color: #FF0000; font-size: 17px;" />
</center>
</body>
//出车逐单据确认界面的Html代码:
@* //出车单据确认*@
<div class="easyui-window" id="Wnd_CarTimesReceipts" style="width:1200px; height:650px; top:2px; left:2px; background-color: #CCCCFF;" title="出车确认">
<div style="width:1300px;height:100px; top: 5px;">
<table >
<tr>
<td style="width:40px;"></td> <td align="right" dir="ltr" style="font-family: 华文行楷; font-size: 19px; color: #000000;">运交领域:</td><td> <input id="txt_SendField" readonly style="width:350px; border-style: hidden; background-color: #CCCCFF; font-size: 18px; font-family: 华文楷体;" > </td><td style="width:50px;height:20px"></td><td style="width:100px;height:20px"></td>
<td align="right"style="font-family: 华文行楷; font-size: 19px; color: #000000;">功能选择:</td><td> <input id="txt_GongNeng" readonly style="border-style: hidden; width:140px; font-family: 华文楷体; font-size: 20px; background-color: #CCCCFF;" /> </td><td style="width:100px;height:20px"></td>
<td align="right"style="font-family: 华文行楷; font-size: 19px; color: #000000;">车次:</td><td> <input id="txt_CarTimes" readonly style="border-style: hidden; width:140px; font-family: 华文楷体; font-size: 20px; background-color: #CCCCFF;" /> </td>
</tr>
<tr style="height:10px"> </tr>
<tr> <td style="width:40px;"></td><td align="right"style="font-family: 华文行楷; font-size: 19px; color: #000000;">车次日期:</td><td> <input id="txt_CarTimesDate" readonly style="border-style: hidden; width:140px; background-color: #CCCCFF; font-size: 20px; font-family: 华文楷体;" /> </td><td style="width:100px;height:20px"></td> <td style="width:100px;height:20px"></td>
<td align="right"style="font-family: 华文行楷; font-size: 19px; color: #000000;">配送方式:</td><td> <input id="txt_Sendway" readonly style="border-style: hidden; width:140px; font-family: 华文楷体; font-size: 20px; background-color: #CCCCFF;" /> </td><td style="width:100px;height:20px"></td>
<td ><input type="submit" οnclick="Affirm()" value="确认" style="width:60px;color: #FF0000; font-size: 17px" /></td>
</tr>
<tr style="height:10px"> </tr>
<tr>
<td style="width:40px;"></td> <td align="right"style="font-family: 华文行楷; font-size: 19px; color: #00FF00;">行数:</td><td> <input id="txt_Number" readonly style="border-style: hidden; width:140px; font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 20px; background-color: #CCCCFF;" /> </td><td style="width:100px;height:20px"></td>
</tr>
</table>
</div>
<table class="easyui-datagrid" id="dgrd_DeliveryCarTimesReceipts" style="width:1200px; height:420px" title="出车单据确认" data-options="
singleSelect: true,rownumbers:true,onClickRow:myonClickRow
">
<thead>
<tr>
<th data-options="field:'MX_FreightReceiptsID',width:130,hidden:true,align:'center'">ID</th>
<th data-options="field:'XiangsShu',width:70,align:'center',hidden:true"></th>
<th data-options="field:'OpenCarAffirm',width:30,align:'center',formatter:ChuCheQueren">确认</th>
<th data-options="field:'DrawOutUnusualID',width:130,align:'center',formatter:formatterDrawOutUnusualName,editor:{
type:'combobox',
options:{
onSelect:DrawOutonChange,
valueField:'DrawOutUnusualID',
textField:'DrawOutUnusualName',
url:'/DrawOutAndReturnCar/SelectDrawOutUnusual',
}
}" >出车异常</th>
<th data-options="field:'DrawOutUnusualReasonID',width:160,align:'center',formatter:formatterDrawOutUnusualReason,editor:{
type:'combobox',
options:{
valueField:'MX_AttributeDetailedID',
textField:'AttributeDetailedName',
}
}" >异常原因</th>
<th data-options="field:'MX_AttributeDetailedID',width:130,align:'center',formatter:formatterDeliveryWayName,editor:{
type:'combobox',
options:{
onSelect:DrawOutonChange2,
valueField:'MX_AttributeDetailedID',
textField:'AttributeDetailedName',
url:'/DeliveryFieldAddress/SelectAttributeGather?AttributeGatherID=1'
}
}" >配送方式</th>
<th data-options="field:'SendNumber',width:130,align:'center'">取送单号</th>
<th data-options="field:'CollectFieldWord',width:130,align:'center'">运交领域</th>
<th data-options="field:'AttributeDetailedName',width:70,align:'center'">类别</th>
<th data-options="field:'ClientName1',width:130,align:'center'">取送客户</th>
<th data-options="field:'CompanyName',width:130,align:'center'">公司</th>
<th data-options="field:'CarTimes',width:130,align:'center'>车次</th>
<th data-options="field:'BoxCount',width:130,align:'center'">箱数</th>
</tr>
</thead>
</table>
<div class="easyui-window" id="Wnd_ClientAddress" style="width:630px; height:370px; top:100px; left:250px;" title="车次信息">
<table style="width:550px;"><tr><td>车次日期:<input class="easyui-datebox" id="Date_CheCi" style="width:110px;"/></td><td> 配送方式:<input id="cbo_SelectDeliveryWay2"data-options="valueField:'MX_AttributeDetailedID',textField:'AttributeDetailedName',url:'/DeliveryFieldAddress/SelectAttributeGather?AttributeGatherID=1'" class="easyui-combobox" style="width:110px; font-family: 宋体, Arial, Helvetica, sans-serif; font-size: 15px;"></td>
<td> <input type="submit" οnclick="Select1()" value="查询" style="width:50px;color: #FF0000; font-size: 17px" /> <input type="submit" οnclick="QueRen()" value="确认" style="width:50px;color: #FF0000; font-size: 17px" /></td> </tr></table>
<table class="easyui-datagrid" id="dgrd_ClientAddress" style="width:600px; height:380px"data-options="
singleSelect: true
">
@*<td><input type="submit" οnclick="Selete()" value="查询" style="width:50px;color: #FF0000; font-size: 17px" /></td>*@
<thead>
<tr>
<th data-options="field:'DeliveryFieldServiceID',width:130,hidden:true,align:'center'">ID</th>
<th data-options="field:'CarTimes',width:120,align:'center'">车次</th>
<th data-options="field:'AttributeDetailedName',width:120,align:'center'">配送方式</th>
<th data-options="field:'CarTimesDate',width:135,align:'center'">车次日期</th>
<th data-options="field:'ServiceField',width:135,align:'center'">运交领域</th>
<th data-options="field:'DeliveryWay',width:120,align:'center',formatter:WeiChuChe">出车状态</th>
</tr>
</thead>
</table>
</div>
</div>
//出车界面脚本代码:
<script type="text/javascript">
$(document).ready(function () {
BinDingDatagrid();
});
function BinDingDatagrid() {
if (parent.PanDuan() == 0) {//parent.PanDuan()是调用父网页区中的方法判断从父网页区是否有值传过来
$.getJSON("/DrawOutAndReturnCar/SelecteDeliveryCarTimesService",
function (data) { //加载车次信息到datagrid中
$("#dgrd_DeliveryCarTimesService").datagrid('loadData', data);
});
}
else {//父网页区有值传过来时执行else里面的方法
parent.PredictDrawOutTime();//获取预出车时间
$.getJSON("/DrawOutAndReturnCar/MuchConditionSelecteDrawOutInformation?intLogisticsPlaceID=" + parent.LogisticsPlaceID() +
"&strCarTimes=" + parent.CarTimes() + "&intDeliveryWayID=" + parent.DeliveryWayID() + "&intClassID=" + parent.ClassID() + "&strPredictDrawOutTime=" + parent.PredictDrawOutTime() + "&intChuFanChe=1" + "&",
function (data) {
$("#dgrd_DeliveryCarTimesService").datagrid('loadData', data);
});
}
}
//当datagrid加载每一行数据时触发此方法
function myFormatterDelete(data, row, Index) {
//返回选择框到列名为删除的单元格中
return '<input style="width:20px;height:20px" id="' + Index + '" type="checkbox" />';
}
//当datagrid加载每一行数据时触发此方法
function myFormatterCarTimes(data, row, Index) {
//返回按钮到列名为车次的单元格中
return ' <input type="button" value="' + data + '" style="width:140px;color: #FF0000; font-family: 微软雅黑; font-size: 17px; background-color: #99CCFF;" />';
}
//点击datagrid中的单元格时触发此方法
function myonClickCell(rowIndex, field){
if (field == "CarTimes") {//判断点击的单元格的列是否为CarTimes
var Rows = $("#dgrd_DeliveryCarTimesService").datagrid("getRows");//获取datagrid中的所有数据
$.getJSON("/DrawOutAndReturnCar/SelecteCarTimesReceipts?intMX_DeliveryCarServiceID=" + Rows[rowIndex].MX_DeliveryCarTimesServiceID,
function (data) {
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);
parent.LoalData(data, Rows[rowIndex], strDate, data.length);// parent.LoalData是调用父网页区中的方法把值传回父网页区
});
}
}
//点击‘全部勾选’按钮时触发此方法
function btn_SelectAll() {
var rows = $("#dgrd_DeliveryCarTimesService").datagrid("getRows");//获取datagrid中的所有数据
for (i = 0; i < rows.length; i++) { //遍历循环datagrid中的所有数据
document.getElementById(i).checked = true; //在选择框中打上勾
}
}
//点击‘全部取消’按钮时触发此方法
function btn_Allcancel() {
var rows = $("#dgrd_DeliveryCarTimesService").datagrid("getRows");
for (i = 0; i < rows.length; i++) {
document.getElementById(i).checked = false;//去掉打上勾的选择框中的勾
}
}
//点击确认按钮时触发此方法
function btn_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 CarTimeRows = $("#dgrd_DeliveryCarTimesService").datagrid("getRows");
for (var i = 0; i < CarTimeRows.length; i++) {
if(document.getElementById(i).checked == true){
$.getJSON("/DrawOutAndReturnCar/AllOpenCarAffirm?intMX_DeliveryCarServiceID=" + CarTimeRows[i].MX_DeliveryCarTimesServiceID);//作出车确认
$.getJSON("/DrawOutAndReturnCar/FactDrawOutTime?intMX_DeliveryCarTimesServiceID=" + CarTimeRows[i].MX_DeliveryCarTimesServiceID + "&strFactDrawOutTime=" + strDate);//记录出车时间
$.getJSON("/DrawOutAndReturnCar/SelecteCarTimesReceipts?intMX_DeliveryCarServiceID=" + CarTimeRows[i].MX_DeliveryCarTimesServiceID,
function (data) {
for (var v = 0; v < data.length; v++) {
$.getJSON("/DrawOutAndReturnCar/updateFreightReceiptsState?intFreightReceiptsStateID=41" + "&intFreightReceiptsID=" + data[v].FreightReceiptsID + "&");
$.getJSON("/DrawOutAndReturnCar/OpenCarAffirm?intDeliverReceiptsID=" + data[v].DeliverReceiptsID); //41为主键对应属性明细表中的送货中
}
});
alert("已经成功记录出车信息");
}
}
}
</script>
//出车逐单据确认界面脚本代码:
//加载车辆对应的单据
var carRow = 0;
function LoalData(data, row, strDate, Number) { //参数data, row, strDate, Number是从另一个界面(出车界面)传过来的参数值
carRow = row;
$('#Wnd_CarTimesReceipts').window("open");//打开出车单据确认窗体
$("#dgrd_DeliveryCarTimesReceipts").datagrid('loadData', data);//加载数据到datagrid中
$("#txt_CarTimesDate").val(strDate); $("#txt_CarTimes").val(row.CarTimes); $("#txt_GongNeng").val("出车确认");
$("#txt_Sendway").val(row.AttributeDetailedName); $("#txt_SendField").val(row.ServiceField);
$("#txt_Number").val(Number);
}
//当datagrid加载每一行数据时触发此方法
function ChuCheQueren(BuZhi, Row, Index) {
var Row2 = $("#dgrd_DeliveryCarTimesReceipts").datagrid("getRows");
Row2[Index].XiangsShu = Index;
return '<input style="width:20px;height:20px" id="' + Index + '" type="checkbox" />'; //返回一个文本框到datagrid的单元格中
}
// function dd() {
// $('#dgrd_DeliveryCarTimesReceipts').datagrid('endEdit', 0);
// }
//点击窗体出车确认中的datagrid中的出车异常下拉框时触发此方法
function DrawOutonChange(){
var seasion = $('#dgrd_DeliveryCarTimesReceipts').datagrid('getEditor', { index: MyIndex, field: 'DrawOutUnusualID' });
$.getJSON("/DrawOutAndReturnCar/SelectDrawOutUnusualReason?DrawOutUnusualID=" + $(seasion.target).combobox("getValue")//获取编辑中的出车异常下拉框的值
, function (data) {//将出车异常明细绑定到出车异常原因下拉框中
var edCangKu = $('#dgrd_DeliveryCarTimesReceipts').datagrid('getEditor', { index: MyIndex, field: 'DrawOutUnusualReasonID' });
$(edCangKu.target).combobox({ data: data, valueField: 'MX_DrawOutUnusualDetailID', textField: 'DrawOutUnusualName' });
});
}
var shu = 0;
var EdIndex = -1;
var MyIndex = "";
var Chebox = "";
var sendWayText = "";
var DrawOut = null;
var DrawOutReasonText = "";
//点击出车确认窗体中的datagrid的行时触发此方法
function myonClickRow(index, row) {
grifar = 1;
shu = shu + 1;
MyIndex = index;
if (EdIndex != index){
if (shu != 1){
var edCangKu = $('#dgrd_DeliveryCarTimesReceipts').datagrid('getEditor', { index: EdIndex, field: 'MX_AttributeDetailedID' });
sendWayText = $(edCangKu.target).combobox("getText"); //获取datagrid中配送方式下拉框的文本值赋值给全局变量sendWayText
var ed = $('#dgrd_DeliveryCarTimesReceipts').datagrid('getEditor', { index: EdIndex, field: 'DrawOutUnusualID' });
DrawOut = $(ed.target).combobox("getText"); //获取datagrid中出车异常下拉框的文本值赋值给全局变量DrawOut
var edf = $('#dgrd_DeliveryCarTimesReceipts').datagrid('getEditor', { index: EdIndex, field: 'DrawOutUnusualReasonID' });
DrawOutReasonText = $(edf.target).combobox("getText"); //获取datagrid中出车异常原因下拉框的文本值赋值给全局变量DrawOutReasonText
$('#dgrd_DeliveryCarTimesReceipts').datagrid('endEdit', EdIndex);//结束编辑
sendWayText = ""; var DrawOutUnusual = ""; var DrawOutUnusualReasonText = "";
if (Chebox == true) { //如果编辑的那一行的选择框被选上,结束编辑后再打上勾
document.getElementById(EdIndex).defaultChecked = true;
}
if (DrawOut.trim().length > 0) {
document.getElementById(EdIndex).defaultChecked = false;
} //出车异常取消打钩
}
}
if (index != null) {
if (EdIndex != index) {
$('#dgrd_DeliveryCarTimesReceipts').datagrid('beginEdit', index);//开始编辑
var seasion = $('#dgrd_DeliveryCarTimesReceipts').datagrid('getEditor', { index: MyIndex, field: 'DrawOutUnusualID' });
$.getJSON("/DrawOutAndReturnCar/SelectDrawOutUnusualReason?DrawOutUnusualID=" + $(seasion.target).combobox("getValue"), function (data) {
//查询出车异常明细绑定到出车异常原因下拉框中
var edCangKu = $('#dgrd_DeliveryCarTimesReceipts').datagrid('getEditor', { index: MyIndex, field: 'DrawOutUnusualReasonID' });
$(edCangKu.target).combobox({ data: data, valueField: 'MX_DrawOutUnusualDetailID', textField: 'DrawOutUnusualName' });
var Rows = $("#dgrd_DeliveryCarTimesReceipts").datagrid("getRows");
$(edCangKu.target).combobox("setValue", Rows[MyIndex].DrawOutUnusualReasonID);//设置下拉框的值
});
}
EdIndex = index;
Chebox = document.getElementById(index).checked; //获取选择框的选择状态,如果被选上Chebox的值为TRUE否则为FALSE
}
}
function formatterDeliveryWayName(indxt, row) {
if (sendWayText != "") {
return sendWayText;
}else{
return row.DeliveryWayName;
}
}
function formatterDrawOutUnusualName(indxt, row) {
if (DrawOut != null) {
return DrawOut;
} else {
return row.DrawOutUnusualName;
}
}
function formatterDrawOutUnusualReason(indxt, row) {
if (DrawOutReasonText != "") {
return DrawOutReasonText;
} else {
return row.DrawOutUnusualReason;
}
}
</script>
<script type="text/javascript">
//点击功能下拉框时触发此方法
function selectfunction() {
if ($("#SelectGongnen").val() == "1") {//如果选中‘出车确认’网页区就加载出车确认界面
panduan = 0; $('#f网页区').attr("src", "../DrawOutAndReturnCar/DrawOut1");
}
if ($("#SelectGongnen").val() == "2") {
panduan = 0; $('#f网页区').attr("src", "../DrawOutAndReturnCar/ReturnCarAffirm1");
}
if ($("#SelectGongnen").val() == "4") {
panduan = 0; $('#f网页区').attr("src", "../DrawOutAndReturnCar/ReceiptsRestore");
}
if ($("#SelectGongnen").val() == "3") {
panduan = 0; $('#f网页区').attr("src", "../DrawOutAndReturnCar/SpecialSendCar");
}
}
//在出车单据确认窗体中点击‘确认’按钮时触发此方法
function Affirm() {
$.getJSON("/DrawOutAndReturnCar/FactDrawOutTime?intMX_DeliveryCarTimesServiceID=" + carRow.MX_DeliveryCarTimesServiceID + "&strFactDrawOutTime=" + $("#txt_CarTimesDate").val());//记录实际出车时间
myonClickRow(null, null); //调用myonClickRow方法
if (Chebox == true) {//判断选择框是否被选中,如果选中结束编辑时重新选上
document.getElementById(EdIndex).defaultChecked = true;
}
var rows = $("#dgrd_DeliveryCarTimesReceipts").datagrid("getRows");//获取datagrid中所有数据
for (i = 0; i < rows.length; i++) {
if (rows[i].CarTimes.trim() != $("#txt_CarTimes").val()) {//判断是否改派
}
else {
if (document.getElementById(rows[i].XiangsShu).checked == true) {
$.getJSON("/DrawOutAndReturnCar/updateFreightReceiptsState?intFreightReceiptsStateID=41" + "&intFreightReceiptsID=" + rows[i].FreightReceiptsID + "&"); //传值给控制器,DrawOutAndReturnCar为控制器名,updateFreightReceiptsState为控制器中的方法名
$.getJSON("/DrawOutAndReturnCar/OpenCarAffirm?intDeliverReceiptsID=" + rows[i].DeliverReceiptsID);
}
else {
if (rows[i].DrawOutUnusualID==1) {$.getJSON("/DrawOutAndReturnCar/updatesate?intFreightReceiptsID=" + rows[i].FreightReceiptsID);}
$.getJSON("/DrawOutAndReturnCar/DrawOutUnusualCondition?intDeliverReceiptsID=" + rows[i].DeliverReceiptsID + "&intDrawOutUnusualID=" + rows[i].DrawOutUnusualID + "&intDrawOutUnusualIReasonID=" + rows[i].DrawOutUnusualReasonID + "&intFreightReceiptsID=" + rows[i].FreightReceiptsID);
}
}
}
alert("已记录好数据");
}
var panduan = 0;
//点击‘查询’按钮时触发此方法
function btn_Select() {
if ($("#cbo_SelectLogisticsPlace").combobox("getValue") != "" || $("#cbo_SelectCarTimes").val().trim().length > 0 || $("#cbo_SelectDeliveryWay").combobox("getValue") != "" || $("#cbo_SelectCompany").combobox("getValue") != ""
|| $("#cbo_Classse").combobox("getValue") != "" || $("#date_SelectCarTimesDate").datebox("getValue").trim().length > 0 || $("#txt_SelectSendNumber").val().trim().length > 0) { //判断查询的条件是否被选中
if ($("#SelectGongnen").val() == "2" && $("#txt_SelectSendNumber").val().trim().length > 0) {
$.getJSON("/DrawOutAndReturnCar/MuchConditionSelecteReturnCarInformation?strCarTimes=" + CarTimes() + "&intDeliveryWayID=" + DeliveryWayID() //获取查询的条件传值给控制器
+ "&strSendNumber=" + $("#txt_SelectSendNumber").val() + "&intClassID=" + ClassID() + "&strPredictDrawOutTime=" + PredictDrawOutTime() + "&",
function (data) {
$('#Wnd_ReturnCarAffirm').window("open"); //打开返车确认窗体
$("#dgrd_ReturnCarAffirm").datagrid('loadData', data);//加载数据到datagrid
});
} else {
if ($("#SelectGongnen").val() == "1") {//判断功能选择框是否选中出车确认
panduan = 1;
StaffInformation();//加载出车确认界面的方法
}
}
if ($("#SelectGongnen").val() == "2") { //判断功能选择框是否选中返车确认
panduan = 1;
FanChe(); //加载返车确认界面的方法
}
if ($("#SelectGongnen").val() == "4") { //判断功能选择框是否选中单据还原
panduan = 1;
ReceiptsRetore(); //加载单据还原界面的方法
}
}
else {
alert("请输入查询内容");
}
}
function PanDuan() {
return panduan;
}
//公司
function CompanyID() {
if ($("#cbo_SelectCompany").combobox("getValue") != "") {
return $("#cbo_SelectCompany").combobox("getValue");
}
else { return "0"; }
}
//取送单号
function SendNumber() {
if ($("#txt_SelectSendNumber").val().trim().length > 0) {
return $("#txt_SelectSendNumber").val().trim();
}
else { return ""; }
}
//返回物流地点ID
function LogisticsPlaceID() {
if ($("#cbo_SelectLogisticsPlace").combobox("getValue") != "") {
return $("#cbo_SelectLogisticsPlace").combobox("getValue");
}
else {return "0"; }
}
//返回车次
function CarTimes() {
if ($("#cbo_SelectCarTimes").val().length > 0) {
return $("#cbo_SelectCarTimes").val();
}
else { return ""; }
}
//返回配送方式ID
function DeliveryWayID() {
if ($("#cbo_SelectDeliveryWay").combobox("getValue") != "") {
return $("#cbo_SelectDeliveryWay").combobox("getValue");
}
else { return "0"; }
}
//返回班次
function ClassID(){
if ($("#cbo_Classse").combobox("getValue") != "") {
return $("#cbo_Classse").combobox("getValue");
}
else { return "0"; }
}
//预出车时间
function PredictDrawOutTime() {
if ($("#date_SelectCarTimesDate").datebox("getValue").trim().length > 0) {
return $("#date_SelectCarTimesDate").datebox("getValue");
}
else { return ""; }
}
//日期格式的转换
function CarTimesDateformatter(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 DrawOutonChange2(w) {
if (confirm("是否要将单据改派到其他车次")) {
$("#Wnd_ClientAddress").window("open");
var GetID = $('#dgrd_DeliveryCarTimesReceipts').datagrid('getEditor', { index: MyIndex, field: 'MX_AttributeDetailedID' });
var ID = $(GetID.target).combobox("getValue");
$("#cbo_SelectDeliveryWay2").combobox("setValue", ID);
$.getJSON("/DrawOutAndReturnCar/selectChangeCarTimes?strCarTimesDate=" + "" + "&intDeliveryWayID=" + ID, function (data) {
$("#dgrd_ClientAddress").datagrid('loadData', data);
});
}
}
//返车时将货物改派到其他车次时触发此方法
function DrawOutonChange3(){
if(confirm("是否要将单据改派到其他车次")){
$("#Wnd_ClientAddress").window("open");
var GetID = $('#dgrd_ReturnCarAffirm').datagrid('getEditor', { index: ReturnIndex, field: 'MX_AttributeDetailedID' });
var ID = $(GetID.target).combobox("getValue"); //获取编辑中的下拉框的值
$("#cbo_SelectDeliveryWay2").combobox("setValue", ID);
$.getJSON("/DrawOutAndReturnCar/selectChangeCarTimes?strCarTimesDate=" + "" + "&intDeliveryWayID=" + ID, function (data) {
$("#dgrd_ClientAddress").datagrid('loadData', data);
});
}
}
//datagrid中加载每一行数据时触发 此方法
function WeiChuChe(index, row) {
if (row.FactDrawOutTime != null) {
return "已出车"
} else {
return "未出车";
}
}
//在改派车次窗体中点击查询按钮时触发此方法
function Select1() {
$.getJSON("/DrawOutAndReturnCar/selectChangeCarTimes?strCarTimesDate=" + $("#Date_CheCi").datebox("getValue") + "&intDeliveryWayID=" + $("#cbo_SelectDeliveryWay2").combobox("getValue"), function (data) {
$("#dgrd_ClientAddress").datagrid('loadData', data);
});
}
var grifar = 0;
//出车改派
function QueRen() {
if (grifar == 1) {
grifar = 0;
var row = $("#dgrd_ClientAddress").datagrid('getSelected');
var rowd = $("#dgrd_DeliveryCarTimesReceipts").datagrid('getSelected');
if (row.FactDrawOutTime == null) {//判断该车次是否已经出车
$.getJSON("/DrawOutAndReturnCar/insertGaiPaiReceipts?intFreightReceiptsID=" + rowd.FreightReceiptsID + "&intMX_DeliveryCarServiceID=" + row.MX_DeliveryCarTimesServiceID, function (i) {
if (i == 1) {
$.getJSON("/DrawOutAndReturnCar/insertGaiPeiRemark?intDeliverReceiptsID=" + rowd.DeliverReceiptsID + "&strRemark=" + "出车时改派到车次:" + row.CarTimes.trim(), function (dt) {//记录出车改派信息
$('#dgrd_DeliveryCarTimesReceipts').datagrid("deleteRow", MyIndex); //删除datagrid中的一行数据
shu = 0;
EdIndex = 0;
MyIndex = "";
alert("成功改派到车次" + row.CarTimes);
});
}
});
}
}
if (grifar == 2) {
grifar = 0;
var row = $("#dgrd_ClientAddress").datagrid('getSelected'); //获取datagrid中被选择行的数据
var rowd = $("#dgrd_ReturnCarAffirm").datagrid('getSelected');
if (row.FactDrawOutTime == null) {
$.getJSON("/DrawOutAndReturnCar/insertGaiPaiReceipts?intFreightReceiptsID=" + rowd.FreightReceiptsID + "&intMX_DeliveryCarServiceID=" + row.MX_DeliveryCarTimesServiceID, function (i) {
if (i == 1) {//判断该车次是否已经出车
$('#dgrd_ReturnCarAffirm').datagrid("getRows")[ReturnIndex].CarTimes = row.CarTimes;
$.getJSON("/DrawOutAndReturnCar/insertGaiPeiRemark?intDeliverReceiptsID=" + rowd.DeliverReceiptsID + "&strRemark=" + "返车时改派到车次:" + row.CarTimes.trim(), function (dt) {//记录返车改派信息
$('#dgrd_ReturnCarAffirm').datagrid("deleteRow", ReturnIndex);
shu = 0;
EdIndex = 0;
MyIndex = "";
alert("成功改派到车次" + row.CarTimes);
});
}
});
}
else { alert("无法改派到该车次已出车,因为该车已经出车"); }
}
}
</script>
//下面是接收从界面传值的控制器的代码:
//查询车次出车信息
public ActionResult SelecteDeliveryCarTimesService()
{
DataTable dt = myDrawOutAndReturnCar.SelecteDeliveryCarTimesService();
List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);
return Json(listReturn, JsonRequestBehavior.AllowGet);
}
//查询出车车次单据信息
public ActionResult SelecteCarTimesReceipts(int intMX_DeliveryCarServiceID)
{//参数intMX_DeliveryCarServiceID是车次明细id
DataTable dt = myDrawOutAndReturnCar.SelecteCarTimesReceipts(intMX_DeliveryCarServiceID);
StringBuilder stringbuilder = new StringBuilder();
DataView dv = new DataView(dt);
dv.RowFilter ="Remark is NULL";//过滤出备注为空的数据
DataTable dtChild = dv.ToTable();//将数据视图转化为数据列表
List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dtChild);
return Json(listReturn, JsonRequestBehavior.AllowGet);
}
//查询返车车次单据信息
public ActionResult SelecteReturnCarTimesReceipts(int intMX_DeliveryCarServiceID)
{
DataTable dt = myDrawOutAndReturnCar.SelecteCarTimesReceipts(intMX_DeliveryCarServiceID);
StringBuilder stringbuilder = new StringBuilder();
DataView dv = new DataView(dt);
dv.RowFilter = "OpenCarAffirm=1 and " + "Remark is NULL";
DataTable dtChild = dv.ToTable();
List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dtChild);
return Json(listReturn, JsonRequestBehavior.AllowGet);
}
//查询出车异常
public ActionResult SelectDrawOutUnusual()
{
DataTable dt = myDrawOutAndReturnCar.SelectDrawOutUnusual();
List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);
return Json(listReturn, JsonRequestBehavior.AllowGet);
}
//查询出车异常原因
public ActionResult SelectDrawOutUnusualReason(int DrawOutUnusualID)
{//参数DrawOutUnusualID为出车异常id
DataTable dt = myDrawOutAndReturnCar.SelectDrawOutUnusualReason(DrawOutUnusualID);
List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);
return Json(listReturn, JsonRequestBehavior.AllowGet);
}
//修改货运单状态
public ActionResult updateFreightReceiptsState(int intFreightReceiptsStateID, int intFreightReceiptsID)//参数intFreightReceiptsStateID为货运单状态id
{
int i = myDrawOutAndReturnCar.updateFreightReceiptsState(intFreightReceiptsStateID, intFreightReceiptsID);
return Json(i,JsonRequestBehavior.AllowGet);
}
//部分出车确认
public ActionResult OpenCarAffirm(int intDeliverReceiptsID)
{//参数intDeliverReceiptsID为发车单据id
int i = myDrawOutAndReturnCar.OpenCarAffirm(intDeliverReceiptsID);
return Json(i, JsonRequestBehavior.AllowGet);
}
//出车时间
public ActionResult FactDrawOutTime(int intMX_DeliveryCarTimesServiceID, string strFactDrawOutTime)//参数strFactDrawOutTime为实际出车时间
{
DateTime FactDrawOutTime = Convert.ToDateTime(strFactDrawOutTime);
int i = myDrawOutAndReturnCar.FactDrawOutTime(intMX_DeliveryCarTimesServiceID,FactDrawOutTime);
return Json(i, JsonRequestBehavior.AllowGet);
}
//出车异常情况记录
public ActionResult DrawOutUnusualCondition(int intDeliverReceiptsID, int intDrawOutUnusualID, int intDrawOutUnusualIReasonID,int intFreightReceiptsID)
{//参数intDrawOutUnusualIReasonID为出车异常原因id
int i = myDrawOutAndReturnCar.DrawOutUnusualCondition(intDeliverReceiptsID, intDrawOutUnusualID, intDrawOutUnusualIReasonID, intFreightReceiptsID);
return Json(i, JsonRequestBehavior.AllowGet);
}
//全部出车确认
public ActionResult AllOpenCarAffirm(int intMX_DeliveryCarServiceID)
{
int i = myDrawOutAndReturnCar.AllOpenCarAffirm(intMX_DeliveryCarServiceID);
return Json(i, JsonRequestBehavior.AllowGet);
}
//多条件查询出车确认信息
public ActionResult MuchConditionSelecteDrawOutInformation(int intLogisticsPlaceID, string strCarTimes, int intDeliveryWayID, int intClassID, string strPredictDrawOutTime, int intChuFanChe)
{//参数intLogisticsPlaceID为物流地点id、strCarTimes为车次时间、intDeliveryWayID为配送方式、intClassID为类别、strPredictDrawOutTime为预出车时间
DataTable dt = myDrawOutAndReturnCar.MuchConditionSelecteDrawOutInformation(intLogisticsPlaceID, strCarTimes, intDeliveryWayID, intClassID, strPredictDrawOutTime,intChuFanChe);
List<Dictionary<string, object>> listReturn = ConvertHelper.DtToList(dt);
return Json(listReturn, JsonRequestBehavior.AllowGet);
}
//下面是接收从控制器传值的逻辑层的代码:
DALPublic.DALMethod myDALMethod = new DALPublic.DALMethod();
//查询车次出车信息
public DataTable SelecteDeliveryCarTimesService()
{
SqlParameter[] SQL ={
new SqlParameter("@type",SqlDbType.Char),
};
SQL[0].Value = "SelecteDeliveryCarTimesService";
DataTable dt = myDALMethod.DAL_SelectDB_Par("SendCar", SQL);
return dt;
}
//查询车次单据信息
public DataTable SelecteCarTimesReceipts(int intMX_DeliveryCarServiceID)
{
SqlParameter[] SQL ={
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@MX_DeliveryCarServiceID",SqlDbType.Int),
};
SQL[0].Value = "SelecteCarTimesReceipts";
SQL[1].Value = intMX_DeliveryCarServiceID;
DataTable dt = myDALMethod.DAL_SelectDB_Par("SendCar", SQL);
return dt;
}
//查询出车异常CBO绑定
public DataTable SelectDrawOutUnusual()
{
SqlParameter[] SQL ={
new SqlParameter("@type",SqlDbType.Char),
};
SQL[0].Value = "SelectDrawOutUnusual";
DataTable dt = myDALMethod.DAL_SelectDB_Par("SendCar", SQL);
return dt;
}
//查询出车异常原因CBO绑定
public DataTable SelectDrawOutUnusualReason(int DrawOutUnusualID)
{
SqlParameter[] SQL ={
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@DrawOutUnusualID",SqlDbType.Int),
};
SQL[0].Value = "SelectDrawOutUnusualReason";
SQL[1].Value = DrawOutUnusualID;
DataTable dt = myDALMethod.DAL_SelectDB_Par("SendCar", SQL);
return dt;
}
//修改货运单状态
public int updateFreightReceiptsState(int intFreightReceiptsStateID, int intFreightReceiptsID)
{
SqlParameter[] SQL ={
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@FreightReceiptsStateID",SqlDbType.Int),
new SqlParameter("@FreightReceiptsID",SqlDbType.Char),
};
SQL[0].Value = "updateFreightReceiptsState";
SQL[1].Value = intFreightReceiptsStateID;
SQL[2].Value = intFreightReceiptsID;
int i = myDALMethod.DAL_OPTableDB_Par("SendCar", SQL);
return i;
}
//部分出车确认
public int OpenCarAffirm(int intDeliverReceiptsID)
{
SqlParameter[] SQL ={
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@DeliverReceiptsID",SqlDbType.Int),
};
SQL[0].Value = "OpenCarAffirm";
SQL[1].Value = intDeliverReceiptsID;
int i = myDALMethod.DAL_OPTableDB_Par("SendCar", SQL);
return i;
}
//出车时间
public int FactDrawOutTime(int intMX_DeliveryCarTimesServiceID, DateTime FactDrawOutTime)
{
SqlParameter[] SQL ={
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@MX_DeliveryCarTimesServiceID",SqlDbType.Int),
new SqlParameter("@FactDrawOutTime",SqlDbType.DateTime),
};
SQL[0].Value = "FactDrawOutTime";
SQL[1].Value = intMX_DeliveryCarTimesServiceID;
SQL[2].Value = FactDrawOutTime;
int i = myDALMethod.DAL_OPTableDB_Par("SendCar", SQL);
return i;
}
//出车异常情况记录
public int DrawOutUnusualCondition(int intDeliverReceiptsID, int intDrawOutUnusualID, int intDrawOutUnusualIReasonID, int intFreightReceiptsID)
{
SqlParameter[] SQL ={
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@DeliverReceiptsID",SqlDbType.Int),
new SqlParameter("@DrawOutUnusualID",SqlDbType.Int),
new SqlParameter("@DrawOutUnusualIReasonID",SqlDbType.Int),
new SqlParameter("@FreightReceiptsID",SqlDbType.Int),
};
SQL[0].Value = "DrawOutUnusualCondition";
SQL[1].Value = intDeliverReceiptsID;
SQL[2].Value = intDrawOutUnusualID;
SQL[3].Value = intDrawOutUnusualIReasonID;
SQL[4].Value = intFreightReceiptsID;
int i = myDALMethod.DAL_OPTableDB_Par("SendCar", SQL);
return i;
}
//全部出车确认
public int AllOpenCarAffirm(int intMX_DeliveryCarServiceID)
{
SqlParameter[] SQL ={
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@MX_DeliveryCarServiceID",SqlDbType.Int),
};
SQL[0].Value = "AllOpenCarAffirm";
SQL[1].Value = intMX_DeliveryCarServiceID;
int i = myDALMethod.DAL_OPTableDB_Par("SendCar", SQL);
return i;
}
//多条件查询出车确认信息
public DataTable MuchConditionSelecteDrawOutInformation(int intLogisticsPlaceID, string strCarTimes, int intDeliveryWayID, int intClassID, string strPredictDrawOutTime, int intChuFanChe)
{
SqlParameter[] SQL ={
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@LogisticsPlaceID",SqlDbType.Int),
new SqlParameter("@CarTimes",SqlDbType.Char),
new SqlParameter("@DeliveryWayID",SqlDbType.Int),
new SqlParameter("@ClassID",SqlDbType.Int),
new SqlParameter("@PredictDrawOutTime",SqlDbType.Char),
new SqlParameter("@ChuFanChe",SqlDbType.Int),
};
SQL[0].Value = "MuchConditionSelecteDrawOutInformation";
SQL[1].Value = intLogisticsPlaceID;
SQL[2].Value = strCarTimes;
SQL[3].Value = intDeliveryWayID;
SQL[4].Value = intClassID;
SQL[5].Value = strPredictDrawOutTime;
SQL[6].Value = intChuFanChe;
DataTable data = myDALMethod.DAL_SelectDB_Par("SendCar", SQL);
return data;
}
//下面是存储过程的代码:
--查询车次出车信息
if @type='SelecteDeliveryCarTimesService'
begin
SELECT RTRIM(MX_DeliveryCarTimesServiceList.CarTimes) AS CarTimes, MX_DeliveryCarTimesServiceList.CarNumber, MX_DeliveryCarTimesServiceList.MX_GetSendID, CONVERT(varchar(20),
MX_DeliveryCarTimesServiceList.PredictDrawOutTime, 120) AS PredictDrawOutTime, MX_DeliveryCarTimesServiceList.ReceiptsStopTime,
MX_DeliveryCarTimesServiceList.LogisticsServeDelegateID, MX_DeliveryCarTimesServiceList.Personnel_OneID, MX_DeliveryCarTimesServiceList.Personnel_TwoID,
MX_DeliveryCarTimesServiceList.ServiceField, MX_DeliveryCarTimesServiceList.SendCarStateID,
MX_DeliveryCarTimesServiceList.FactDrawOutTime, MX_DeliveryCarTimesServiceList.FactReturnCarTime, MX_DeliveryCarTimesServiceList.MX_DeliveryCarTimesServiceID,
MX_DeliveryCarTimesServiceList.DeliveryCarTimeServiceID, MX_AttributeDetailedList.AttributeDetailedName, LogisticsPlaceList.LogisticsPlaceName,
DeliveryCarTimesServiceList.LogisticsPlaceID, DeliveryCarTimesServiceList.ClassesID, MX_AttributeDetailedList_1.AttributeDetailedName AS SendClasses,
CONVERT(varchar(20),DeliveryCarTimesServiceList.CarTimesDate,120)as CarTimesDate
FROM MX_DeliveryCarTimesServiceList INNER JOIN
DeliveryCarTimesServiceList ON MX_DeliveryCarTimesServiceList.DeliveryCarTimeServiceID = DeliveryCarTimesServiceList.DeliveryCarTimesServiceID INNER JOIN
MX_AttributeDetailedList ON DeliveryCarTimesServiceList.DeliveryWayID = MX_AttributeDetailedList.MX_AttributeDetailedID INNER JOIN
LogisticsPlaceList ON DeliveryCarTimesServiceList.LogisticsPlaceID = LogisticsPlaceList.LogisticsPlaceID INNER JOIN
MX_AttributeDetailedList AS MX_AttributeDetailedList_1 ON DeliveryCarTimesServiceList.ClassesID = MX_AttributeDetailedList_1.MX_AttributeDetailedID
where MX_DeliveryCarTimesServiceList.FactDrawOutTime IS NULL
end
if @type='SelecteCarTimesReceipts'
begin
SELECT MX_AttributeDetailedList.AttributeDetailedName, DeliverReceiptsList.MX_DeliveryCarServiceID, DeliverReceiptsList.HandleManID, StaffList.StaffName,
ReturnCarUnusualIList.ReturnCarUnusualIName, DeliverReceiptsList.ReturnCarUnusualIReasonID, MX_ReturnCarUnusualIList.MX_ReturnCarUnusualIIName,
DrawOutUnusualList.DrawOutUnusualName, DeliverReceiptsList.DrawOutUnusualIReasonID, MX_DrawOutUnusualDetailList.DrawOutUnusualName AS DrawOutUnusualReason,
DeliverReceiptsList.DeliverReceiptsID, DeliverReceiptsList.BoxCount, DeliverReceiptsList.FreightReceiptsID, DeliverReceiptsList.DrawOutUnusualID, DeliverReceiptsList.ReturnCarUnusualIID,
DeliverReceiptsList.OpenCarAffirm, DeliverReceiptsList.ReturnCarAffirm, DeliverReceiptsList.HandleTime, FreightReceiptsList.SendNumber, MX_DeliveryCarTimesServiceList.CarTimes,
MX_DeliveryCarTimesServiceList.DeliveryCarTimeServiceID, MX_AttributeDetailedList_1.AttributeDetailedName AS DeliveryWayName, FreightReceiptsList.CompanyID,
CompanyList.CompanyName, FreightReceiptsList.SendClientID, ClientList.ClientName, ClientList.ClientAbbreviation, ClientList.LinkMan, ClientList.LinkPhone, ClientList.ClientNumber,
ClientList_1.ClientAbbreviation AS ClientAbbreviation1, ClientList_1.LinkMan AS LinkMan1, ClientList_1.LinkPhone AS LinkPhone1, ClientList_1.ClientNumber AS ClientNumber1,
ClientList_1.ClientID, FreightReceiptsList.SendFieldWord, ClientList_1.ClientName AS ClientName1, MX_AttributeDetailedList_1.MX_AttributeDetailedID,
MX_AttributeDetailedList_2.AttributeDetailedName AS SignForState, FreightReceiptsList.SignForStateID, MX_DeliveryCarTimesServiceList.PredictDrawOutTime,
DeliveryCarTimesServiceList.DeliveryWayID, FreightReceiptsList.ClassesID, DeliverReceiptsList.Remark, DeliveryFieldServiceList.FieldWord AS CollectFieldWord
FROM CompanyList INNER JOIN
MX_AttributeDetailedList INNER JOIN
FreightReceiptsList ON MX_AttributeDetailedList.MX_AttributeDetailedID = FreightReceiptsList.ClassesID ON CompanyList.CompanyID = FreightReceiptsList.CompanyID INNER JOIN
ClientList ON FreightReceiptsList.SendClientID = ClientList.ClientID INNER JOIN
ClientList AS ClientList_1 ON FreightReceiptsList.CollectClientID = ClientList_1.ClientID INNER JOIN
MX_AttributeDetailedList AS MX_AttributeDetailedList_2 ON FreightReceiptsList.SignForStateID = MX_AttributeDetailedList_2.MX_AttributeDetailedID INNER JOIN
DeliveryFieldServiceList ON FreightReceiptsList.DeliveryFieldServiceID = DeliveryFieldServiceList.DeliveryFieldServiceID RIGHT OUTER JOIN
MX_DeliveryCarTimesServiceList INNER JOIN
DeliveryCarTimesServiceList ON MX_DeliveryCarTimesServiceList.DeliveryCarTimeServiceID = DeliveryCarTimesServiceList.DeliveryCarTimesServiceID INNER JOIN
MX_AttributeDetailedList AS MX_AttributeDetailedList_1 ON DeliveryCarTimesServiceList.DeliveryWayID = MX_AttributeDetailedList_1.MX_AttributeDetailedID RIGHT OUTER JOIN
DeliverReceiptsList ON MX_DeliveryCarTimesServiceList.MX_DeliveryCarTimesServiceID = DeliverReceiptsList.MX_DeliveryCarServiceID LEFT OUTER JOIN
StaffList ON DeliverReceiptsList.HandleManID = StaffList.StaffID ON FreightReceiptsList.FreightReceiptsID = DeliverReceiptsList.FreightReceiptsID LEFT OUTER JOIN
MX_ReturnCarUnusualIList ON DeliverReceiptsList.ReturnCarUnusualIReasonID = MX_ReturnCarUnusualIList.MX_ReturnCarUnusualIID LEFT OUTER JOIN
ReturnCarUnusualIList ON DeliverReceiptsList.ReturnCarUnusualIID = ReturnCarUnusualIList.ReturnCarUnusualIID LEFT OUTER JOIN
MX_DrawOutUnusualDetailList ON DeliverReceiptsList.DrawOutUnusualIReasonID = MX_DrawOutUnusualDetailList.MX_DrawOutUnusualDetailID LEFT OUTER JOIN
DrawOutUnusualList ON DeliverReceiptsList.DrawOutUnusualID = DrawOutUnusualList.DrawOutUnusualID
where MX_DeliveryCarServiceID=@MX_DeliveryCarServiceID
end
--查询车次返车信息
if @type='SelecteDeliveryCarTimesServiceReturn'
begin
SELECT RTRIM(MX_DeliveryCarTimesServiceList.CarTimes) AS CarTimes, MX_DeliveryCarTimesServiceList.CarNumber, MX_DeliveryCarTimesServiceList.MX_GetSendID,
CONVERT(varchar(20), MX_DeliveryCarTimesServiceList.PredictDrawOutTime, 120)as PredictDrawOutTime, MX_DeliveryCarTimesServiceList.ReceiptsStopTime, MX_DeliveryCarTimesServiceList.LogisticsServeDelegateID,
MX_DeliveryCarTimesServiceList.Personnel_OneID, MX_DeliveryCarTimesServiceList.Personnel_TwoID, MX_DeliveryCarTimesServiceList.ServiceField,
MX_DeliveryCarTimesServiceList.SendCarStateID,
MX_DeliveryCarTimesServiceList.FactDrawOutTime,
MX_DeliveryCarTimesServiceList.FactReturnCarTime, MX_DeliveryCarTimesServiceList.MX_DeliveryCarTimesServiceID, MX_DeliveryCarTimesServiceList.DeliveryCarTimeServiceID,
MX_AttributeDetailedList.AttributeDetailedName, LogisticsPlaceList.LogisticsPlaceName, DeliveryCarTimesServiceList.LogisticsPlaceID, DeliveryCarTimesServiceList.ClassesID,
MX_AttributeDetailedList_1.AttributeDetailedName AS SendClasses
FROM MX_DeliveryCarTimesServiceList INNER JOIN
DeliveryCarTimesServiceList ON MX_DeliveryCarTimesServiceList.DeliveryCarTimeServiceID = DeliveryCarTimesServiceList.DeliveryCarTimesServiceID INNER JOIN
MX_AttributeDetailedList ON DeliveryCarTimesServiceList.DeliveryWayID = MX_AttributeDetailedList.MX_AttributeDetailedID INNER JOIN
LogisticsPlaceList ON DeliveryCarTimesServiceList.LogisticsPlaceID = LogisticsPlaceList.LogisticsPlaceID INNER JOIN
MX_AttributeDetailedList AS MX_AttributeDetailedList_1 ON DeliveryCarTimesServiceList.ClassesID = MX_AttributeDetailedList_1.MX_AttributeDetailedID
where MX_DeliveryCarTimesServiceList.FactReturnCarTime IS NULL
and MX_DeliveryCarTimesServiceList.FactDrawOutTime is not null
end
-- 查询出车异常
if @type='SelectDrawOutUnusual'
begin
SELECT DrawOutUnusualID, DrawOutUnusualName
FROM DrawOutUnusualList
--where DrawOutUnusualID!=4
end
-- 查询出车异常原因
if @type='SelectDrawOutUnusualReason'
begin
SELECT MX_DrawOutUnusualDetailID, DrawOutUnusualName
FROM MX_DrawOutUnusualDetailList
where DrawOutUnusualID=@DrawOutUnusualID
end
--修改货运单状态
if @type='updateFreightReceiptsState'
begin
update FreightReceiptsList set FreightReceiptsStateID=@FreightReceiptsStateID
where FreightReceiptsList.FreightReceiptsID=@FreightReceiptsID
end
--作全部出车确认
if @type='AllOpenCarAffirm'
begin
update DeliverReceiptsList set OpenCarAffirm=1
where MX_DeliveryCarServiceID=@MX_DeliveryCarServiceID
end
--作部分出车确认
if @type='OpenCarAffirm'
begin
update DeliverReceiptsList set OpenCarAffirm=1
where DeliverReceiptsID=@DeliverReceiptsID
end
--出车时间
if @type='FactDrawOutTime'
begin
update MX_DeliveryCarTimesServiceList set FactDrawOutTime=@FactDrawOutTime,SendCarStateID=47
where MX_DeliveryCarTimesServiceID=@MX_DeliveryCarTimesServiceID
end
--记录出车异常情况记录
if @type='DrawOutUnusualCondition'
begin
update DeliverReceiptsList set DrawOutUnusualID=@DrawOutUnusualID,DrawOutUnusualIReasonID=@DrawOutUnusualIReasonID
where DeliverReceiptsID=@DeliverReceiptsID
if @DrawOutUnusualID=2
begin
update FreightReceiptsList set FreightReceiptsStateID=46
where FreightReceiptsList.FreightReceiptsID=@FreightReceiptsID
end
end
--多条件查询出车确认信息
if @Type='MuchConditionSelecteDrawOutInformation'
begin
declare @sql varchar(1000)
if @CarTimes!=''
begin
set @sql=' where MX_DeliveryCarTimesServiceList.CarTimes='''+LTRIM(RTRIM(@CarTimes))+''''
end
if @LogisticsPlaceID !=0
begin
if @sql !=''
set @sql=@sql+' and DeliveryCarTimesServiceList.LogisticsPlaceID='''+LTRIM(RTRIM(@LogisticsPlaceID))+''''
else set @sql=' where DeliveryCarTimesServiceList.LogisticsPlaceID='''+LTRIM(RTRIM(@LogisticsPlaceID))+''''
end
if @DeliveryWayID!=0
begin
if @sql !=''
set @sql=@sql+' and DeliveryCarTimesServiceList.DeliveryWayID='''+LTRIM(RTRIM(@DeliveryWayID))+''''
else set @sql=' where DeliveryCarTimesServiceList.DeliveryWayID='''+LTRIM(RTRIM(@DeliveryWayID))+''''
end
if @ClassID!=0
begin
if @sql !=''
set @sql=@sql+' and DeliveryCarTimesServiceList.ClassesID='''+LTRIM(RTRIM(@ClassID))+''''
else set @sql=' where DeliveryCarTimesServiceList.ClassesID='''+LTRIM(RTRIM(@ClassID))+''''
end
if @PredictDrawOutTime !=''
begin
if @sql !=''
set @sql=@sql+' and DeliveryCarTimesServiceList.CarTimesDate between '''+LTRIM(RTRIM(@PredictDrawOutTime))+''''+' and '''+LTRIM(RTRIM(@PredictDrawOutTime))+''''
else set @sql=' where DeliveryCarTimesServiceList.CarTimesDate between '''+LTRIM(RTRIM(@PredictDrawOutTime))+''''+' and '''+LTRIM(RTRIM(@PredictDrawOutTime))+''''
end
if @ChuFanChe=1
begin
if @sql !=''
set @sql=@sql+' and MX_DeliveryCarTimesServiceList.FactDrawOutTime IS NULL '
else set @sql=' where MX_DeliveryCarTimesServiceList.FactDrawOutTime IS NULL '
end
if @ChuFanChe=2
begin
if @sql !=''
set @sql=@sql+' and MX_DeliveryCarTimesServiceList.FactReturnCarTime IS NULL and MX_DeliveryCarTimesServiceList.FactDrawOutTime is not null'
else set @sql=' where MX_DeliveryCarTimesServiceList.FactReturnCarTime IS NULL and MX_DeliveryCarTimesServiceList.FactDrawOutTime is not null'
end
exec('SELECT RTRIM(MX_DeliveryCarTimesServiceList.CarTimes) AS CarTimes, MX_DeliveryCarTimesServiceList.CarNumber, MX_DeliveryCarTimesServiceList.MX_GetSendID, CONVERT(varchar(20),
MX_DeliveryCarTimesServiceList.PredictDrawOutTime, 120) AS PredictDrawOutTime, MX_DeliveryCarTimesServiceList.ReceiptsStopTime,
MX_DeliveryCarTimesServiceList.LogisticsServeDelegateID, MX_DeliveryCarTimesServiceList.Personnel_OneID, MX_DeliveryCarTimesServiceList.Personnel_TwoID,
MX_DeliveryCarTimesServiceList.ServiceField, MX_DeliveryCarTimesServiceList.SendCarStateID,
MX_DeliveryCarTimesServiceList.FactDrawOutTime, MX_DeliveryCarTimesServiceList.FactReturnCarTime, MX_DeliveryCarTimesServiceList.MX_DeliveryCarTimesServiceID,
MX_DeliveryCarTimesServiceList.DeliveryCarTimeServiceID, MX_AttributeDetailedList.AttributeDetailedName, LogisticsPlaceList.LogisticsPlaceName,
DeliveryCarTimesServiceList.LogisticsPlaceID, DeliveryCarTimesServiceList.ClassesID, MX_AttributeDetailedList_1.AttributeDetailedName AS SendClasses,
DeliveryCarTimesServiceList.DeliveryWayID, CONVERT(varchar(20),DeliveryCarTimesServiceList.CarTimesDate,120)as CarTimesDate
FROM MX_DeliveryCarTimesServiceList INNER JOIN
DeliveryCarTimesServiceList ON MX_DeliveryCarTimesServiceList.DeliveryCarTimeServiceID = DeliveryCarTimesServiceList.DeliveryCarTimesServiceID INNER JOIN
MX_AttributeDetailedList ON DeliveryCarTimesServiceList.DeliveryWayID = MX_AttributeDetailedList.MX_AttributeDetailedID INNER JOIN
LogisticsPlaceList ON DeliveryCarTimesServiceList.LogisticsPlaceID = LogisticsPlaceList.LogisticsPlaceID INNER JOIN
MX_AttributeDetailedList AS MX_AttributeDetailedList_1 ON DeliveryCarTimesServiceList.ClassesID = MX_AttributeDetailedList_1.MX_AttributeDetailedID
'+@sql)
return
end
仅供学习,禁止商业用途