admin管理员组

文章数量:815885

MVC北京络捷斯特第三方物流系统技术解析(八)返单

 MVC北京络捷斯特第三方物流系统技术解析(八)返单

在“订单录入”部分如果客服人员选择了“签单返回”中的“运单”和“客户单据”,当完成运输任务后,客服人员必须在运单管理中完成“返单”操作客服使用返单模块对客户要求返还的单据进行监控。点击返单,此时返单界面分为两个列表:上面的列表为返单监控,下面的列表为返单处理。返单监控列表中列出的运单是从本站始发的货物的运单,监控目的站是否把要求签单返还的单据寄出、返单时间及单据的返单状态。当目的站更改返单状态时,此记录的返单状态、返单人和返。单时间字段将显示相应的数据,当返单状态为“目的站已发回”时,点击“提交”,表示客户收到单据。此时该运单在此列表中消失。

返单处理列表列出的是需要本站寄出的运单,本站为目的站,把始发站要求返单的单据返给始发站。列表中自动列出的是所有要求返单的运单,也可输入运单号,查询某一票运单进行返单操作。录入返单人和返单时间,点击“提交”,系统更改运单状态为“目的站待返单”,此时始发站的返单监控列表中相应记录的返单人和返单时间将显示出相应的变化。在返单列表中再点击“提交 ”,此时系统更改运单状态为“目的站已发回”。当始发站客服确认收到返单时,该运单在此列表中消失。

界面效果图:

 

2.7.1.3(图1)

第一步:数据库

1、表和表关系

                             

2.7.1.3(图2)

 

表1:运输订单表(PWOrderForTransportationList)

用于存放运输订单的信息

PrimaryKey(s):  OrderForTransportationID

 

列名

数据类型

主键/外键

说明

OrderForTransportationID

int

主键

订单运输信息ID

OrderForGoodsNumber

nchar (50)

 

订单号

VocationalTypeID

int

外键

业务类型ID

HeadstreamID

int

外键

始发地ID

DestinationID

int

外键

目的地ID

TakeDeliveryTime

datetime

 

取货时间

ArriveTime

datetime

 

到货时间

TakeDeliveryID

int

外键

取货ID

DeliverGoodsID

int

外键

签单ID

WrittenPermissionID

int

外键

返回ID

ClientContractsConsignID

int

外键

合同托运客户ID

ShipperName

nchar (50)

 

托运人姓名

ShipperPhoneNumber

nchar (50)

 

托运人电话

ShipperUnitsID

int

外键

托运人单位ID

ShipperLocation

nchar (50)

 

托运人地址

ShipperAccount

nchar (50)

 

托运帐号

ShipperPostcode

nchar (50)

 

托运人邮编

ClientManager

nchar (50)

 

客户经理

StorePickupPersonID

int

外键

取货人ID

StorePickupPersonName

nchar (50)

 

取货联系人

StorePickupPersonPhoneNumber

nchar (50)

 

取货联系人电话

StorePickupPersonAddress

nchar (50)

 

取货地址

ProjectID

int

外键

项目ID

ConsigneeName

nchar (10)

 

收货人姓名

ConsigneePhoneNumber

nchar (50)

 

收货人电话

ConsigneeUnit

nchar (50)

 

收货人单位

ConsigneeAddress

nchar (50)

 

收货人地址

ConsigneeAccount

nchar (50)

 

收货人帐号

ConsigneePostcode

nchar (50)

 

收货人邮编

ConsigneeID

int

外键

收货人ID

CarriageFare

decimal (18, 2)

 

运费

IncidentalExpenses

decimal (18, 2)

 

杂费

CostSumUp

decimal (18, 2)

 

费用小计

WhetherOrNotInsureDeclare

bit

 

保声明否

SettleAccountsWayID

int

外键

保险费

AdvanceReceipts

decimal (18, 2)

 

结算方式ID

InsureExpenses

decimal (18, 2)

 

预收款

PayNumber

nchar (50)

 

付费帐号

Remarks

nchar (100)

 

备注

FabricationOrderFormID

int

外键

制单人ID

AcceptanceTime

datetime

 

受理时间

AcceptanceUnitID

int

外键

受理单位ID

Receiver

nchar (10)

 

签收人

SignForTime

datetime

 

签收时间

WhetherOrNotSignFor

bit

 

签收否

RepeatOrderStateID

int

外键

返单状态ID

RepeatOrderPeopleID

int

外键

返单人ID

RepeatOrderTime

datetime

 

返单时间

RepeatOrderReceive

bit

 

返单时间

BeforeOneTime

nchar (100)

 

当前地点

CheckEmploy

bit

 

复核否

ClientID

int

外键

客户ID

ClientAgreementInformationID

int

外键

客户合同ID

TongZhiCiShu

int

外键

 

QuHuoFou

bit

 

 

ShengChenJiHuaDan

nchar (30)

 

生成计划单号

ShengChenFou

bit

 

生成否

DingDanZhuangTai

bit

 

订单状态

ZongTiJi

decimal (18, 3)

 

总体积

ZongShuLiang

decimal (18, 3)

 

总数量

ZongZhongLiang

decimal (18, 3)

 

总重量

RouteID

int

外键

路由ID

ZhanCunFou

bit

 

暂存否

HuoWeiID

int

外键

货位ID

HuoWeiHao

nchar (50)

 

货位号

YiQuHuo

bit

 

已取否

YiPaiHuo

bit

 

已派否

QuPaiLeiXingFou

bit

 

取派类型否

LunLiID

int

外键

运力ID

ShuaiHuoFou

bit

 

甩货否

YouYongFou

bit

 

有否否

ShengChengZhanDanFou

bit

 

生成账单否

 

 

表2:属性明细表(SYSAttributeDetailList)

用于存放集合信息

 

列名

数据类型

主键/外键

说明

AttributeDetailID

int

主键

属性明细ID

AttributeGatherID

int

外键

属性集合ID

AttributeDetailName

nchar (10)

 

属性明细名称

YouYongFou

bit

 

有效否

 

表3:站点信息表(SYSSiteInformationList)

用于存放站点信息

 

列名

数据类型

主键/外键

说明

SiteInformationID

int

主键

站点信息ID

SiteTypeID

int

外键

站点类型ID

SiteNumber

nchar (50)

 

站点编号

SiteDesignation

nchar (50)

 

站点名称

SiteAddress

nchar (50)

 

站点详细地址

SiteTelephone

nchar (50)

 

站点电话

SitePortraiture

nchar (50)

 

站点传真

ZipCode

nchar (50)

 

邮编

FenJianQu

nchar (50)

 

分拣区

ChuCunQu

nchar (50)

 

储存区

Contacts

nchar (10)

 

Contacts

Remarks

nchar (100)

 

备注

PlaceArea

decimal (18)

 

场地面积

CarparkArea

decimal (18)

 

停车场面积

Quantity

decimal (18)

 

车位数量

YouYongFou

bit

 

有效否

 

表4:所属单位表(SYSSubsidiaryUnitList)

用于存放单位信息

 

 

列名

数据类型

主键/外键

说明

SubsidiaryUnitID

int

主键

所属单位ID

InstitutionID

int

外键

机构ID

SubsidiaryUnitDesignation

nchar (50)

 

所属单位名称

YouYongFou

bit

 

有效否

 

表5:项目表(SYSProjectList)

用于存放项目信息

 

 

列名

数据类型

主键/外键

说明

ProjectID

int

主键

项目ID

WhetherProjectSpecialtype

bit

 

项目特殊类型否

ProjectNumber

nchar (100)

 

项目代码

ProjectDesignation

nchar (100)

 

项目名称

ProjectDescribe

nchar (100)

 

项目描述

YouYongFou

bit

 

有效否

 

表6:员工表(SYSPersonnelList)

用于存放员工信息

 

 

列名

数据类型

主键/外键

说明

PersonnelID

int

主键

员工ID

DepartmentID

int

外键

部门ID

UseOrganization

int

外键

使用机构ID

OrganizationID

int

外键

所属机构ID

GenreID

int

外键

所属类型ID

SubsidiaryUnitID

int

外键

所属单位ID

SexID

int

外键

性别ID

CredentialsGenreID

int

外键

证件类型ID

StateID

int

外键

状态ID

Birthday

date

 

人员编码

WorkDate

date

 

区别码

PersonnelCode

nchar (50)

 

姓名

DifferenceCode

nchar (50)

 

出生日期

Name

nchar (10)

 

工作日期

Duties

nchar (50)

 

职务

CredentialsNumber

nchar (50)

 

证件号码

Address

nchar (50)

 

住址

PhoneNumber

nchar (50)

 

电话

MobilePhone

nchar (50)

 

手机

Email

nchar (50)

 

Email

Remarks

nchar (50)

 

备注

YouYongFou

bit

 

有效否

 

表6:客户表(SYSClientList)

用于存放客户信息

 

 

列名

数据类型

主键/外键

说明

ClientID

int

主键

客户ID

ClientNumber

nchar (50)

 

客户帐号

ClientEncoded

nchar (50)

 

客户码

ClientUnitDesignation

nchar (50)

 

客户单位名称

ClientAbbreviation1

nchar (50)

 

客户简称1

ClientAbbreviation2

nchar (50)

 

客户简称2

ClientManager

nchar (50)

 

客户经理

ClientManagerBelephoneLdentification

nchar (50)

 

客户经理电话

Contacts

nchar (50)

 

联系人

ContactsTelephone

nchar (50)

 

联系人电话

ContactsEmail

nchar (50)

 

联系人Email

ContactsVIP

nchar (50)

 

联系人VIP

ContactsJAI

nchar (50)

 

联系人JAI

ContactsRankID

int

外键

客户级别ID

ContactsZipCode

nchar (50)

 

客户邮编

ProjectID

int

外键

项目ID

ContactsFacsimile

nchar (50)

 

客户传真

EnglishAbbreviation

nchar (50)

 

英文缩写

EnglishDesignation

nchar (50)

 

英文名称

ContactsAddress

nchar (50)

 

客户地址

ClientCompanyID

int

外键

客户公司ID

IndustryAttributeID

int

外键

行业属性ID

EnterpriseScaleID

int

外键

企业规模ID

MemberDeputy

nchar (50)

 

会员代表

AgreementGrandfatherAddress

nchar (50)

 

合同存档地

BankOfDeposit

nchar (30)

 

开户行

ClientAgreementID

int

外键

客户合同ID

BankofdepositAccountNumber

nchar (50)

 

开户行帐号

DutyParagraph

nchar (50)

 

税号

YouYongFou

bit

 

有效否

TongBuFou

bit

 

同步否

 

表7:客户合同表(SYSClientList)

用于存放客户合同信息

 

列名

数据类型

主键/外键

说明

ClientAgreementInformationID

int

主键

客户合同信息ID

AgreementNumber

nchar (30)

 

合同编号

AgreementDesignation

nchar (30)

 

合同名称

Agreement数据类型ID

int

 

合同类型ID

ClientID

int

 

客户ID

ProjectID

int

 

项目ID

VocationalPersonDeputy

nchar (30)

 

业务代表人

VocationalPersonDeputyFashion

nchar (30)

 

业务代表联系方式

EndDate

datetime

 

截止日期

CarriageFareValue

decimal (18, 2)

 

运费单价

InsuranceCompanyID

int

 

保险公司ID

SettleAccountsWayID

int

 

结算方式ID

AgreementGrandfatherAddress

nchar (30)

 

合同存档地

Oursignatory

nchar (30)

 

我方签署人

TheguestsSigntory

nchar (30)

 

客方签署人

Remarks

nchar (100)

 

备注

WhetherCheck

bit

 

复核否

YouYongFou

bit

 

有用否

InsuranceRate

decimal (18, 3)

 

保险费率

 

表8:保险公司表(SYSInsuranceCompanyList)

用于存放保险公司信息

 

列名

数据类型

主键/外键

说明

InsuranceCompanyID

int

主键

保险公司ID

InsuranceCompanyDesignation

nchar (50)

 

保险公司名称

InsuranceDesignationNumber

nchar (50)

 

保险公司编号

InsuranceRate

nchar (50)

 

保险费率

AmountInsured

nchar (50)

 

投保金额

YouYongFou

bit

 

有用否

 

 

第二步:控制器controllers)

1.     查询返单监控

#region 运输管理public ActionResult SelectYunShuGuanLi(){//DiaryList 是 RK.PWOrderForTransportationList 表的已个别名//通个ID对应将所有的表连关系var OrderForGoodsTransportinformationList = from OrderForGoodsTransportinformation in YS.PWOrderForTransportationList//订单运输信息表orderby OrderForGoodsTransportinformation.OrderForTransportationID descending //排序,新的数据在上面//查询判断条件where (OrderForGoodsTransportinformation.PeturnID != 0 && OrderForGoodsTransportinformation.WrittenPermissionID != 0) &&(OrderForGoodsTransportinformation.RepeatOrderStateID != 125 || OrderForGoodsTransportinformation.RepeatOrderStateID == null) &&(OrderForGoodsTransportinformation.QuHuoFou != true) && OrderForGoodsTransportinformation.YiPaiHuo==trueselect new{OrderForTransportationID = OrderForGoodsTransportinformation.OrderForTransportationID,OrderForGoodsNumber = OrderForGoodsTransportinformation.OrderForGoodsNumber,ArriveTime = OrderForGoodsTransportinformation.ArriveTime,ShipperName = OrderForGoodsTransportinformation.ShipperName,ConsigneeName = OrderForGoodsTransportinformation.ConsigneeName,ConsigneePhoneNumber = OrderForGoodsTransportinformation.ConsigneePhoneNumber,RepeatOrderStateID = OrderForGoodsTransportinformation.RepeatOrderStateID,BeforeOneTime = OrderForGoodsTransportinformation.BeforeOneTime,RepeatOrderPeopleID = OrderForGoodsTransportinformation.RepeatOrderPeopleID,RepeatOrderTime = OrderForGoodsTransportinformation.RepeatOrderTime,};List<Dictionary<string, object>> DDitem = new List<Dictionary<string, object>>();foreach (var item in OrderForGoodsTransportinformationList){Dictionary<string, object> DingDanItem = new Dictionary<string, object>();string ArriveTime1 = item.ArriveTime.ToString();DingDanItem.Add("ArriveTime2", ArriveTime1);string RepeatOrderTime1 = item.RepeatOrderTime.ToString();DingDanItem.Add("RepeatOrderTime2", RepeatOrderTime1);string RepeatOrderStateID1 = item.RepeatOrderStateID.ToString();if (RepeatOrderStateID1 == "125"){
//满足条件就替换值
//将数据放到数据字典中DingDanItem.Add("RepeatOrderStateID2", "目的站已发回");}
//如果满足那个条件就执行那个方法else if (RepeatOrderStateID1 == "126"){DingDanItem.Add("RepeatOrderStateID2", "目的站待返单");}
//如果等于78就执行“已返回”else if (RepeatOrderStateID1 == "78"){DingDanItem.Add("RepeatOrderStateID2", "已返回");}else{DingDanItem.Add("RepeatOrderStateID2", "");}string RepeatOrderPeopleID1 = item.RepeatOrderPeopleID.ToString();if (RepeatOrderPeopleID1 == "12"){
//如果等于78就执行“已返回”DingDanItem.Add("RepeatOrderPeopleID2", "老大");}else if (RepeatOrderPeopleID1 == "18"){DingDanItem.Add("RepeatOrderPeopleID2", "小青");}else if (RepeatOrderPeopleID1 == "25"){DingDanItem.Add("RepeatOrderPeopleID2", "坏人");}foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties()){DingDanItem.Add(p.Name, p.GetValue(item, null));}DDitem.Add(DingDanItem);}
//放入到这些数据字典中return Json(DDitem, JsonRequestBehavior.AllowGet);}


2..     查询返单列表

#region 返单管理运输管理public ActionResult SelectYunShuGuanLi1(){//DiaryList 是 RK.PWOrderForTransportationList 表的已个别名//通个ID对应将所有的表连关系var OrderForGoodsTransportinformationList = from OrderForGoodsTransportinformation in YS.PWOrderForTransportationList//订单运输信息表orderby OrderForGoodsTransportinformation.OrderForTransportationID descending where (OrderForGoodsTransportinformation.PeturnID != 0 && OrderForGoodsTransportinformation.WrittenPermissionID != 0) && (OrderForGoodsTransportinformation.RepeatOrderReceive != false || OrderForGoodsTransportinformation.RepeatOrderReceive == null)select new{OrderForTransportationID = OrderForGoodsTransportinformation.OrderForTransportationID,OrderForGoodsNumber = OrderForGoodsTransportinformation.OrderForGoodsNumber,ArriveTime = OrderForGoodsTransportinformation.ArriveTime,ShipperName = OrderForGoodsTransportinformation.ShipperName,ConsigneeName = OrderForGoodsTransportinformation.ConsigneeName,ConsigneePhoneNumber = OrderForGoodsTransportinformation.ConsigneePhoneNumber,RepeatOrderStateID = OrderForGoodsTransportinformation.RepeatOrderStateID,BeforeOneTime = OrderForGoodsTransportinformation.BeforeOneTime,RepeatOrderPeopleID = OrderForGoodsTransportinformation.RepeatOrderPeopleID,RepeatOrderTime = OrderForGoodsTransportinformation.RepeatOrderTime,};List<Dictionary<string, object>> DDitem = new List<Dictionary<string, object>>();foreach (var item in OrderForGoodsTransportinformationList){Dictionary<string, object> DingDanItem = new Dictionary<string, object>();string ArriveTime1 = item.ArriveTime.ToString();DingDanItem.Add("ArriveTime2", ArriveTime1);string RepeatOrderTime1 = item.RepeatOrderTime.ToString();DingDanItem.Add("RepeatOrderTime2", RepeatOrderTime1);string RepeatOrderStateID1 = item.RepeatOrderStateID.ToString();if (RepeatOrderStateID1 == "125"){DingDanItem.Add("RepeatOrderStateID2", "目的站已发回");}else if (RepeatOrderStateID1 == "126"){DingDanItem.Add("RepeatOrderStateID2", "目的站待返单");}else if (RepeatOrderStateID1 == "78"){DingDanItem.Add("RepeatOrderStateID2", "已返回");}else{DingDanItem.Add("RepeatOrderStateID2", "");}string RepeatOrderPeopleID1 = item.RepeatOrderPeopleID.ToString();if (RepeatOrderPeopleID1 == "12"){DingDanItem.Add("RepeatOrderPeopleID2", "老大");}else if (RepeatOrderPeopleID1 == "18"){DingDanItem.Add("RepeatOrderPeopleID2", "小青");}else if (RepeatOrderPeopleID1 == "25"){DingDanItem.Add("RepeatOrderPeopleID2", "坏人");}foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties()){DingDanItem.Add(p.Name, p.GetValue(item, null));}DDitem.Add(DingDanItem);}return Json(DDitem, JsonRequestBehavior.AllowGet);}#endregion


3.     提交返单监控

#region 返单监控public int UpdateRepeatOrderPeopleList(int OrderForTransportationID, int RepeatOrderStateID, int RepeatOrderPeopleID, DateTime RepeatOrderTime, string BeforeOneTime){//PWOrderForTransportationList 订单运输信息表Models.PWOrderForTransportationList Transportation = (from tb in YS.PWOrderForTransportationList //要监控的那一张列表where tb.OrderForTransportationID == OrderForTransportationID select tb).Single<Models.PWOrderForTransportationList>();Transportation.RepeatOrderStateID = RepeatOrderStateID;//返单状态Transportation.RepeatOrderPeopleID = RepeatOrderPeopleID;//返单人Transportation.RepeatOrderTime = RepeatOrderTime;//返单时间Transportation.BeforeOneTime = BeforeOneTime;//返单地点Transportation.RepeatOrderReceive = true;int i = YS.SaveChanges();if (i > 0){return i;}else{return 0;}}#endregion


4.提交返单列表

#region 返单监控public int UpdateRepeatOrderPeopleList(int OrderForTransportationID, int RepeatOrderStateID, int RepeatOrderPeopleID, DateTime RepeatOrderTime, string BeforeOneTime){//PWOrderForTransportationList 订单运输信息表Models.PWOrderForTransportationList Transportation = (from tb in YS.PWOrderForTransportationList //要监控的那一张列表where tb.OrderForTransportationID == OrderForTransportationID select tb).Single<Models.PWOrderForTransportationList>();Transportation.RepeatOrderStateID = RepeatOrderStateID;//返单状态Transportation.RepeatOrderPeopleID = RepeatOrderPeopleID;//返单人Transportation.RepeatOrderTime = RepeatOrderTime;//返单时间Transportation.BeforeOneTime = BeforeOneTime;//返单地点Transportation.RepeatOrderReceive = true;int i = YS.SaveChanges();if (i > 0){return i;}else{return 0;}}#endregion

第三步:界面

2.7.1.3(图3)

2.7.1.3(图4)

Html代码:

(1).返单监控

<table id="tbRepeatOrderPeopleList" class="easyui-datagrid" style=" width:auto; height:200px;" data-options="onClickRow:onClickRow,rownumbers:true,singleSelect:true,rowStyler:function(index,row){if (index%2==0){}}"><thead>  <tr><th data-options="field:'ok',align:'center',checkbox:true"></th><th data-options="field:'OrderForTransportationID',width:130,align:'center',hidden:true">订单号ID</th><th data-options="field:'OrderForGoodsNumber',width:130,align:'center'">订单号</th><th data-options="field:'ShipperName',width:118,align:'center',hidden:true">托运人姓名</th><th data-options="field:'ConsigneeName',width:118,align:'center'"> 收货人姓名</th><th data-options="field:'ConsigneePhoneNumber',width:118,align:'center'"> 收货人电话</th><th data-options="field:'ArriveTime2',width:118,align:'center'">要求到货时间</th><th data-options="field:'RepeatOrderStateID',width:118,align:'center',hidden:true">返单状态ID</th><th data-options="field:'RepeatOrderStateID2',width:118,align:'center',editor:'combobox',formatter:function(value,row){return row.text;},editor:{type:'combobox',options:{onSelect:onSelectROW1,idField:'id',valueField:'id',textField:'text',url:'/XiaLaKuang/ChaXunShuXingMingXiXinXi?ShuXingJiHeID=67',}}">返单状态</th><th data-options="field:'RepeatOrderPeopleID',width:118,align:'center',hidden:true">返单人ID</th><th data-options="field:'BeforeOneTime',width:100,align:'center',editor:'text'">当前地点</th><th data-options="field:'RepeatOrderPeopleID2',width:100,align:'center',formatter:function(value,row){return row.text1;},editor:{type:'combobox',options:{onSelect:onSelectROW,idField:'id',valueField:'id1',textField:'text1',url:'/XiaLaKuang/ChaXunFanDanYuanGongBiao'}}">返单人</th><th data-options="field:'RepeatOrderTime2',width:118,align:'center',editor:'datebox'">返单时间</th><th data-options="field:'TiJiaoFanDan',width:80,align:'center',formatter:myformatter3">提交</th></tr></thead></table><div>  <table><tr style=" width:10px; height:10px;"></tr><tr><td style="font-family: 楷体; font-size: 18px;">返单处理(目的站是本站):</td></tr><tr><td style="font-family: 楷体; font-size: 18px;">   输入运单号:</td><td><input id="DingDanHaoChaXun" style=" width:180px; height:25px;" /></td><td><button οnclick="ChaXunCaiGouDingDan()"class="btn blue" style="font-family: 楷体;">查询</button></td></tr></table></div>

 

(2)返单处理

<table id="tbFanDanJianKong" class="easyui-datagrid" style=" width:auto; height:200px;" data-options="onClickRow:onClickRow1,rownumbers:true,singleSelect:true,rowStyler:function(index,row){if (index%2==0){}}"><thead>  <tr><th data-options="field:'ok',align:'center',checkbox:true"></th><th data-options="field:'OrderForTransportationID',width:130,align:'center',hidden:true">订单号ID</th><th data-options="field:'OrderForGoodsNumber',width:130,align:'center'">订单号</th><th data-options="field:'ShipperName',width:118,align:'center'">托运人姓名</th><th data-options="field:'ConsigneeName',width:118,align:'center',hidden:true"> 收货人姓名</th><th data-options="field:'ConsigneePhoneNumber',width:118,align:'center'"> 收货人电话</th><th data-options="field:'ArriveTime2',width:118,align:'center'">要求到货时间</th><th data-options="field:'RepeatOrderStateID',width:118,align:'center',hidden:true">返单状态ID</th><th data-options="field:'RepeatOrderStateID2',width:118,align:'center'">返单状态</th><th data-options="field:'RepeatOrderPeopleID',width:100,align:'center',hidden:true">返单人ID</th><th data-options="field:'BeforeOneTime',width:100,align:'center',editor:'text'">当前地点</th><th data-options="field:'RepeatOrderPeopleID2',width:100,align:'center',formatter:function(value,row){return row.text1;},editor:{type:'combobox',options:{onSelect:onSelectROW2,idField:'id',valueField:'id1',textField:'text1',url:'/XiaLaKuang/ChaXunFanDanYuanGongBiao'}}">返单人</th><th data-options="field:'RepeatOrderTime2',width:118,align:'center',editor:'datebox'">返单时间</th><th data-options="field:'TiJiaoFanDan1',width:80,align:'center',formatter:myformatter1">提交</th></tr></thead></table>


 

JavaScript代码:

(1).查询返单监控

//查询返单监控function FanDanJianKong() {$.getJSON("/YunShuGuanLi/SelectYunShuGuanLi1", function (data) {$("#tbFanDanJianKong").datagrid('loadData', data);var dt = $("#tbFanDanJianKong").datagrid('getData');for (var i = 0; i < dt.rows.length; i++) {//显示下拉框的值$("#tbFanDanJianKong").datagrid('getRows')[i]["text1"] = data[i]["RepeatOrderPeopleID2"];//结束编辑后在楷书编辑$("#tbFanDanJianKong").datagrid('beginEdit', i);$("#tbFanDanJianKong").datagrid('endEdit', i);}});}

(1).查询返单处理

 //查询返单处理function sahd() {//$.getJSON("/YunShuGuanLi/SelectYunShuGuanLi", function (data) {$("#tbRepeatOrderPeopleList").datagrid('loadData', data);var dt = $("#tbRepeatOrderPeopleList").datagrid('getData');for (var i = 0; i < dt.rows.length; i++) {//显示下拉框的值$("#tbRepeatOrderPeopleList").datagrid('getRows')[i]["text"] = data[i]["RepeatOrderStateID2"];$("#tbRepeatOrderPeopleList").datagrid('getRows')[i]["text1"] = data[i]["RepeatOrderPeopleID2"];//结束编辑后在楷书编辑$("#tbRepeatOrderPeopleList").datagrid('beginEdit', i);$("#tbRepeatOrderPeopleList").datagrid('endEdit', i);}});}

(2)onclickrow(触发事件)

//单选datagrid的一行触发的时间function onClickRow(index) {if (editIndex != index) {if (endEditing(false)) {//结束编辑$('#tbRepeatOrderPeopleList').datagrid('beginEdit', index);$('#tbRepeatOrderPeopleList').datagrid('endEdit', editIndex);editIndex = index;} else {//选择那一行来编辑$('#tbRepeatOrderPeopleList').datagrid('selectRow', editIndex);}}}


 

(3).点击下拉框触发方法

Html代码:

formatter:function(value,row){return row.text;},editor:{ type:'combobox',options:{//按下下拉框触发的方法onSelect:onSelectROW1,idField:'id',valueField:'id',textField:'text',url:'/XiaLaKuang/ChaXunShuXingMingXiXinXi?ShuXingJiHeID=67',}}

(4).点击下拉框触发的方法

 //点击下拉款触发方法function onSelectROW1() {var edCangKu = $('#tbRepeatOrderPeopleList').datagrid('getEditor', 
{ index: editIndex, field: 'RepeatOrderStateID2' }); //设置仓库下拉框编辑器var cangKuMingCheng = $(edCangKu.target)bobox('getValue'); 		
//获取仓库名称值ID = cangKuMingCheng;}


 

(5)提交返单监控

function TiJiaoFanDan() {var ROW = $("#tbRepeatOrderPeopleList").datagrid('getSelected');//获取选中的一行var OrderForTransportationID = ROW.OrderForTransportationID; //把选中的一行赋值给方法里的变量OrderForTransportationIDif (confirm("是否确定提交")) {//这是一个系统的提醒方法endEditing(false);//这是调用上面的方法,如果不清楚就看上面解析if (ROW.RepeatOrderPeopleID2 != null) {//这是一个判断,不为空就执行这个方法if (ID == 0) {//返单监控中可以多次提交,如果第二次,//不选择下拉款是会找不到那个ID,而用这个方法可以获取那个IDID = ROW.RepeatOrderStateID;} else {//ID为0,就是还没有选择那个IDID;}if (ID1 == 0) {//有两个combobox要有两个ID,ID1 = ROW.RepeatOrderPeopleID;} else {ID1;}//保存提交返单监控信息$.getJSON("/YunShuGuanLi/UpdateRepeatOrderPeopleList?OrderForTransportationID=" + OrderForTransportationID + "&"+ "RepeatOrderStateID=" + ID + "&"+ "RepeatOrderPeopleID=" + ID1 + "&"+ "RepeatOrderTime=" + ROW.RepeatOrderTime2 + "&"+ "BeforeOneTime=" + ROW.BeforeOneTime,function (data) {if (data > 0) {alert("提交成功");ID=0;ID1 = 0;sahd();} else {alert("提交失败");}});} else {//为空时正常提交方法$.getJSON("/YunShuGuanLi/UpdateRepeatOrderPeopleList?OrderForTransportationID=" + OrderForTransportationID + "&"+ "RepeatOrderStateID=" + ROW.RepeatOrderStateID2 + "&"+ "RepeatOrderPeopleID=" + ROW.RepeatOrderPeopleID2 + "&"+ "RepeatOrderTime=" + ROW.RepeatOrderTime2 + "&"+ "BeforeOneTime=" + ROW.BeforeOneTime,function (data) {if (data > 0) {alert("提交成功");$("#tbRepeatOrderPeopleList").datagrid('reload');$("#tbRepeatOrderPeopleList").datagrid('loadData', data);$("#tbRepeatOrderPeopleList").datagrid('reload');} else {alert("提交失败");}});}}}


 

(6).编辑器

 var editIndex1 = undefined; 		//编辑索引function endEditing1(flag) {			//结束编辑状态if (editIndex1 == undefined) { return true }
if ($('#tbFanDanJianKong').datagrid('validateRow', editIndex1)) {		
//判定行状态var edChanPin = $('#tbFanDanJianKong').datagrid('getEditor', 
{ index: editIndex1, field: 'RepeatOrderPeopleID2' }); //设置产品datagrid编辑器var chanPinBianMa = $(edChanPin.target)bobox('getText'); //获取cobogrid值chanPinBianMaID = $(edChanPin.target)bobox('getValue'); //获取cobogrid值$('#tbFanDanJianKong').datagrid('getRows')[editIndex1]['text1'] = chanPinBianMa; 
//设置产品编码值$('#tbFanDanJianKong').datagrid('endEdit', editIndex1); 
//结束编辑editIndex1 = undefined; 								
//清空行索引return true;} else {return false;}}


仅供学习,禁止用于商业用途

 



 

 

 

 

本文标签: MVC北京络捷斯特第三方物流系统技术解析(八)返单