您的位置:首页 > Web前端 > JavaScript

北京络捷斯特物流系统(四)

2015-06-22 11:57 555 查看


二、商务结算管理

 
1、复核管理

界面复核视图



复核管理是对运单、合同、还有费用等进行复核、核销确认的一个程序

数据库表关系图(运力费用复核)



表1:运力费用表(SYS_TransportCostTable)

列名
数据类型
主键/外键
说明
TransportCostID
int
主键
运力费用ID
TransportID
int
外键
运力ID
TruePayPayment
decimal(18, 1)
 
实付账款
UpExpectShiftToNo
bit
 
上期转入否
ReviewNo
bit
 
复核否
VerificationNo
bit
 
核销否
PayableCost
decimal(18, 0)
 
应付费用

 

表2:运力表(SYS_TransportTable)

列名
数据类型
主键/外键
说明
TransportID
int
主键
运力ID
TransportNumber
nchar(30)
 
运力编号
TransportSourceID
int
外键
运力来源ID
MiscellaneousFees
decimal(18, 2)
 
杂费
CarPlateNumber
nchar(50)
 
车牌号
GrossVolume
decimal(18, 2)
 
总容积
MaximumSingleSize
decimal(18, 2)
 
最大单项尺寸
OccupyNo
bit
 
占用否
TransportTypeID
int
外键
运力类型ID
StartLandID
int
外键
起始地ID
ObjectiveLandID
int
外键
目的地ID
Offer
decimal(18, 2)
 
报价
SupplierID
int
外键
分供方ID
Driver
nchar(10)
 
司机
GrossMeasure
decimal(18, 2)
 
总裁量
ElseRestrictions
nchar(50)
 
其他限制
AcceptUnitID
int
外键
受理单位ID
BorrowedTime
datetime
 
集货时间
DeliverGoodsTime
datetime
 
送货时间
StartTime
datetime
 
发车时间
ArriveGoodsTime
datetime
 
到货时间
CarryGoodsTime
datetime
 
提货时间
ArriveGoodsNo
bit
 
到货否
表3:供应商表(SupplierTable)

列名
数据类型
主键/外键
说明
SupplierID
int
主键
供应商ID
SupplierNumber
nchar(100)
 
供应商编号
SupplierName
nchar(100)
 
供应商名称
SupplierAbbreviation
nchar(100)
 
供应商简称
SupplierModeSettlementID
int
外键
供应商结算方式ID
SupplierTypeID
int
外键
供应商类型ID
BusinessTypeID
int
外键
业务种类
Linkman
nchar(100)
 
联系人
LinkmanPhone
nchar(100)
 
联系人电话
Fax
nchar(100)
 
传真
SupplierAddress
nchar(100)
 
供应商地址
Postcode
nchar(100)
 
邮编
TreatyNumber
nchar(100)
 
协议编号
Bank
nchar(100)
 
开户行
BankAccountNumber
nchar(100)
 
开户行帐号
DutyParagraph
nchar(100)
 
税号
LegalDelegate
nchar(100)
 
法人代表
MobilePhone
nchar(100)
 
手机
Email、
nchar(100)
 
电子邮件
EnterpriseCode
nchar(100)
 
企业代码
BusinessLicenseNumber
nchar(100)
 
营业执照号
GovernmentRentCertificateNumber
nchar(100)
 
地税登证号码
NationalTaxCertificateNumber
nchar(100)
 
国税登证号码
SetUpTime
datetime
 
成立时间
RegisteredCapital
nchar(100)
 
注册资本
RoadTransportLicenseNumber
nchar(100)
 
道路运输许可证编号
DangerousGoodsTransportLicense
nchar(100)
 
危险品运输许可证号
Agent
nchar(100)
 
经办人
AgentContactPhone
nchar(100)
 
经办人联系电话
CompanyAffiliation
nchar(100)
 
所属公司
Note
nchar(100)
 
备注
表4:已选运单表(SYS_SelectedWaybillTable)

列名
数据类型
主键/外键
说明
SelectedWaybillID
int
主键/
 
TakeSendSchedulingOneID
int
外键
 
TakeSendType
nchar(10)
 
 
ReturnSingleNo
bit
 
 
GatheringNo
bit
 
 
Freight
decimal(18, 1)
 
 
SupplierID
int
外键
 
Incidentals
decimal(18, 1)
 
 
<span style="font-family:宋体;color:#000000;">

</span><p style="margin: 0cm 0cm 10pt;"><span style="font-family: 宋体; font-size: 14pt; mso-ascii-theme-font: major-fareast; mso-fareast-theme-font: major-fareast; mso-hansi-theme-font: major-fareast;"><span style="color:#000000;">控制器代码</span></span></p><span style="font-family:宋体;color:#000000;"></span><p style="margin: 0cm 0cm 10pt;">
</p><p style="margin: 0cm 0cm 0pt; -ms-layout-grid-mode: both; -ms-text-autospace:; mso-pagination: none;"><span lang="EN-US" style="font-family: 新宋体; font-size: 9.5pt; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 新宋体; mso-hansi-font-family: Calibri;"><span style="mso-spacerun: yes;">   </span></span><span lang="EN-US" style="font-family: 新宋体; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 新宋体; mso-hansi-font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><span style="color: green;">//</span></span><span style="color: green; font-family: 新宋体; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 新宋体; mso-hansi-font-family: Calibri;">查询界面所以字段数据</span></p>
<pre class="csharp" name="code">     public ActionResult SelectAll1()
{
var dtYunLiFuHe = from tbYunLiFuHe in myEF.SYS_TransportCostTable
join tbYunLi in myEF.SYS_TransportTable on tbYunLiFuHe.TransportID equals tbYunLi.TransportID
join tbFenGong in myEF.SYS_SupplierTable on tbYunLi.SupplierID equals tbFenGong.SupplierID
join tbYiXuanYunDan in myEF.SYS_SelectedWaybillTable on tbFenGong.SupplierID equals tbYiXuanYunDan.SupplierID

select new
{
YunLiFeiYong1ID = tbYunLiFuHe.TransportCostID,
YunLiID = tbYunLi.TransportID,
YunLiBianHao = tbYunLi.TransportNumber,
FenGongFangID = tbFenGong.SupplierID,
FengGongFangBianHao = tbFenGong.SupplierNumber,
YiXuanYunDanID = tbYiXuanYunDan.SelectedWaybillID,
YunFei = tbYiXuanYunDan.Freight,
ShiFuZhangKuan = tbYunLiFuHe.TruePayPayment,
YingFuFeiYong=tbYunLiFuHe.PayableCost,
ShangQiZhuanRuFou=tbYunLiFuHe.UpExpectShiftToNo,
FuHeFou=tbYunLiFuHe.ReviewNo,
HeXiaoFou=tbYunLiFuHe.VerificationNo,

};
List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();

foreach (var item in dtYunLiFuHe)
{

Dictionary<string, object> itemYunLiFuHe = new Dictionary<string, object>();
//遍历反射方式获取属性名和属性值
foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
{
itemYunLiFuHe.Add(p.Name, p.GetValue(item, null));
}
ListReturn.Add(itemYunLiFuHe);
}
return Json(ListReturn, JsonRequestBehavior.AllowGet);

}

 

Jquery代码 var BangDing = 0;
$(document).ready(function () {
$.getJSON("/FuHeGuanLi/SelectAll1",
function (data) {
$('#tb运力费用复核').datagrid("loadData", data);
BangDing++;
});

})

Html代码

<div title="运力费用复核">
<div class="easyui-panel" style="width:auto; height:auto; border-radius:15px 15px 0px 0px;">
<div data-options="region:'north'" border="false" style="height:80px">
<fieldset>
输入运力编号:<input id="txtYunDanBianHao" style="width:300px;"/>
<input type="button" value="确 定" onclick="MoHuChaXun()" style="font-size: 18px; width:100px; font-family:仿宋体; color:#33CCFF"/>
</fieldset>
</div>
<table class="easyui-datagrid" id="tb运力费用复核" style="width:auto; height:auto;">
<thead>
<tr>
<th data-options="field:'ck',checkbox:true"></th>
<th data-options="field:'YunLiFeiYong1ID',width:100,hidden:true">运力费用ID</th>
<th data-options="field:'YunLiID',width:100,hidden:true">运力ID</th>
<th data-options="field:'YunLiBianHao',width:100,align:'center'">运力编号</th>
<th data-options="field:'FengGongFangBianHao',width:100,align:'center'">分供方编号</th>
<th data-options="field:'YunFei',width:100,align:'center'">运费</th>
<th data-options="field:'ShiFuZhangKuan',width:100,align:'center'">实付账款</th>
<th data-options="field:'YingFuFeiYong',width:100,align:'center'">应付费用</th>
<th data-options="field:'ShangQiZhuanRuFou',width:100,align:'center'">是否上期转入</th>
<th data-options="field:'FuHeFou',width:100,align:'center',formatter:returnFuHe">复核否</th>
<th data-options="field:'HeXiaoFou',width:100,align:'center',formatter:returnHeXiao">核销否</th>
</tr>
</thead>
</table>
</div>

复核代码方法
function returnFuHe(FuHeFou, row, rowIndex) {
return "<a href='javascript:FuHe(" + rowIndex + ")'>"+FuHeFou+"</a>";
}

function FuHe(FuHeFou, rowIndex) {
var row = $("#tb运力费用复核").datagrid('getSelected');
window.location.href = "/FuHeGuanLi/YuLiFeiYongFuHe?YunLiFeiYongID=" + row.YunLiFeiYong1ID;
}

复核界面视图







绑定数据和复核方法

<pre class="plain" name="code">function BangDingYunLiFuHe() {

$.getJSON("/FuHeGuanLi/ChaXunbyID1?YunLiFeiYongID="+@Session["YunLiFeiYongID"],

function(data){
YunLiFeiYong1ID=data[0].YunLiFeiYong1ID;
YunLiID1=data[0].YunLiID;
$('#txtYunLiBianHao').attr('value',data[0].YunLiBianHao);
FenGongFangID=data[0].FenGongFangID;
$('#txtFenGongFangBianHao').attr('value',data[0].FengGongFangBianHao);
$('#txtYunFei').attr('value',data[0].YunFei);
$('#txtShiFuZhangKuan').attr('value',data[0].ShiFuZhangKuan);
$('#txtYingFuZhangKuan').attr('value',data[0].YingFuFeiYong);
$('#cboShangQiZhuanRuFou').combobox('setValue',data[0].ShangQiZhuanRuFou);
$('#cboFuHeFou').combobox('setValue',data[0].FuHeFou1);
$('#cboHeXiaoFou').combobox('setValue',data[0].HeXiaoFou);

} );

}

function FuHe(){
if(confirm('是否复核?')){
$.getJSON("/FuHeGuanLi/FuHeFeiYong?FuHeFou="+$('#cboFuHeFou').combobox('getValue')+"&",
function(data){
if(data="false"){
alert("复核成功");
window.location.href="/FuHeGuanLi/FuHeGuanLi";
}
else{
alert("已复核");
}
});

}
}



<span style="font-family:宋体;font-size:14px;">
</span>
<p style="margin: 0cm 0cm 10pt;"><span style="font-family: 宋体; font-size: 10.5pt; mso-ascii-theme-font: major-fareast; mso-fareast-theme-font: major-fareast; mso-hansi-theme-font: major-fareast;">控制器代码</span></p><span style="font-family:宋体;font-size:14px;">

</span><p style="margin: 0cm 0cm 0pt; text-indent: 21pt; -ms-layout-grid-mode: both; -ms-text-autospace:; mso-pagination: none;"><span style="font-family: 新宋体; font-size: 10.5pt; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 新宋体; mso-hansi-font-family: Calibri;">控制器绑定和复核代码</span></p><span style="font-family:宋体;font-size:14px;"></span><pre class="csharp" name="code"> public ActionResult ChaXunbyID1(int YunLiFeiYongID)
{
var dtYunLiFuHe = from tbYunLiFuHe in myEF.SYS_TransportCostTable
join tbYunLi in myEF.SYS_TransportTable on tbYunLiFuHe.TransportID equals tbYunLi.TransportID
join tbFenGong in myEF.SYS_SupplierTable on tbYunLi.SupplierID equals tbFenGong.SupplierID
join tbYiXuanYunDan in myEF.SYS_SelectedWaybillTable on tbFenGong.SupplierID equals tbYiXuanYunDan.SupplierID
where tbYunLiFuHe.TransportCostID == YunLiFeiYongID

select new
{
YunLiFeiYong1ID = tbYunLiFuHe.TransportCostID,
YunLiID = tbYunLi.TransportID,
YunLiBianHao = tbYunLi.TransportNumber,
FenGongFangID = tbFenGong.SupplierID,
FengGongFangBianHao = tbFenGong.SupplierNumber,
YiXuanYunDanID = tbYiXuanYunDan.SelectedWaybillID,
YunFei = tbYiXuanYunDan.Freight,
ShiFuZhangKuan = tbYunLiFuHe.TruePayPayment,
YingFuFeiYong = tbYunLiFuHe.PayableCost,
ShangQiZhuanRuFou = tbYunLiFuHe.UpExpectShiftToNo,
FuHeFou = tbYunLiFuHe.ReviewNo,
HeXiaoFou = tbYunLiFuHe.VerificationNo,

};
List<Dictionary<string, object>> ListReturn = new List<Dictionary<string, object>>();

foreach (var item in dtYunLiFuHe)
{

Dictionary<string, object> itemYunLiFuHe = new Dictionary<string, object>();
//遍历反射方式获取属性名和属性值
foreach (System.Reflection.PropertyInfo p in item.GetType().GetProperties())
{
itemYunLiFuHe.Add(p.Name, p.GetValue(item, null));
}
//if (item.ShangQiZhuanRuFou == true)
//{
//    itemYunLiFuHe.Add("ShangQiZhuanRuFou1", "true");
//}
//else
//{
//    itemYunLiFuHe.Add("ShangQiZhuanRuFou1", "false");
//}
//ListReturn.Add(itemYunLiFuHe);
if (item.FuHeFou == true)
{
itemYunLiFuHe.Add("FuHeFou1", "true");
}
else
{
itemYunLiFuHe.Add("FuHeFou1", "false");
}

if (item.HeXiaoFou == true)
{
itemYunLiFuHe.Add("HeXiaoFou1", "true");
}
else
{
itemYunLiFuHe.Add("HeXiaoFou1", "false");
}
ListReturn.Add(itemYunLiFuHe);
}
return Json(ListReturn, JsonRequestBehavior.AllowGet);

}

public ActionResult FuHeFeiYong(string FuHeFou)
{
int intWuLiaoID = Convert.ToInt32(Session["YunLiFeiYongID"]);
var mySYS_TransportCostTable = (from tb in myEF.SYS_TransportCostTable where tb.TransportCostID == intWuLiaoID select tb).Single<Models.SYS_TransportCostTable>();

mySYS_TransportCostTable.ReviewNo = Convert.ToBoolean(FuHeFou);
int i = myEF.SaveChanges();

if (i > 0)
{
return Json("false", JsonRequestBehavior.AllowGet);
}
else
{
return Json("true", JsonRequestBehavior.AllowGet);
}
}

核销方法

function returnHeXiao(HeXiaoFou, row, rowIndex) {
return "<a href='javascript:HeXiao(" + rowIndex + ")'>" + HeXiaoFou + "</a>";
}

function HeXiao(HeXiaoFou, rowIndex) {
var row = $("#tb运力费用复核").datagrid('getSelected');
window.location.href = "/FuHeGuanLi/YunLiFeiYongHeXiao?YunLiFeiYongID=" + row.YunLiFeiYong1ID;
}

界面视图





绑定数据和核销方法

function BangDingYunLiFuHe() {

$.getJSON("/FuHeGuanLi/ChaXunbyID1?YunLiFeiYongID="+@Session["YunLiFeiYongID"],

function(data){
YunLiFeiYong1ID=data[0].YunLiFeiYong1ID;
YunLiID1=data[0].YunLiID;
$('#txtYunLiBianHao').attr('value',data[0].YunLiBianHao);
FenGongFangID=data[0].FenGongFangID;
$('#txtFenGongFangBianHao').attr('value',data[0].FengGongFangBianHao);
$('#txtYunFei').attr('value',data[0].YunFei);
$('#txtShiFuZhangKuan').attr('value',data[0].ShiFuZhangKuan);
$('#txtYingFuZhangKuan').attr('value',data[0].YingFuFeiYong);
$('#cboShangQiZhuanRuFou').combobox('setValue',data[0].ShangQiZhuanRuFou);
$('#cboFuHeFou').combobox('setValue',data[0].FuHeFou);
$('#cboHeXiaoFou').combobox('setValue',data[0].HeXiaoFou1);

} );

}

function HeXiao(){
if(confirm('是否核销?')){
$.getJSON("/FuHeGuanLi/HeXiaoFeiYong?HeXiaoFeiYong="+$('#cboHeXiaoFou').combobox('getValue')+"&",
function(data){
if(data="false"){
alert("核销成功");
window.location.href="/FuHeGuanLi/FuHeGuanLi";
}
else{
alert("已核销");
}
} );

}
}


Html代码

<div title="运力费用核销" style="padding:10px; width:auto; height:300px; border-style:none;">
<table>
<tr>
<td align="right"><strong style="font-size: medium" >运力编号:</strong><input type="text" id="txtYunLiBianHao" onclick="getYunLi()" style="width:300px; height:30px;border-width: thin; border-style: none none outset none" /></td>
<td align="right"><strong style="font-size: medium" >分供方编号:</strong><input type="text" id="txtFenGongFangBianHao" onclick="getFenGongFang()" style="width:300px; height:30px;border-width: thin; border-style: none none outset none" /></td>
</tr>

<tr>
<td align="right"><strong style="font-size: medium" >运费:</strong><input type="text" id="txtYunFei" style="width:300px; height:30px;border-width: thin; border-style: none none outset none" /></td>
<td align="right"><strong style="font-size: medium" >实付账款:</strong><input type="text" id="txtShiFuZhangKuan" style="width:300px; height:30px;border-width: thin; border-style: none none outset none" /></td>
</tr>

<tr>
<td align="right"><strong style="font-size: medium" >应付费用:</strong><input type="text" id="txtYingFuZhangKuan" style="width:300px; height:30px;border-width: thin; border-style: none none outset none" /></td>
<td align="right"><strong style="font-size: medium" >是否上期转入:</strong><select class="easyui-combobox" id="cboShangQiZhuanRuFou" style="width:300px; height:30px;border-width: thin; border-style: none none outset none;">
<option value="true">true</option>
<option value="false">false</option>
</select>
</td>
</tr>

<tr>
<td align="right"><strong style="font-size: medium" >复核否:</strong><select class
a214
="easyui-combobox" id="cboFuHeFou" style="width:300px; height:30px;border-width: thin; border-style: none none outset none;">
<option value="true">true</option>
<option value="false">false</option>
</select>
</td>
<td align="right"><strong style="font-size: medium" >核销否:</strong><select class="easyui-combobox" id="cboHeXiaoFou" style="width:300px; height:30px;border-width: thin; border-style: none none outset none;" >
<option value="true">true</option>
<option value="false">false</option>
</select>
</td>
</tr>

<tr>
<td style="height:50px" colspan=4 align="center">
<a id="btnHeXiao" onclick="HeXiao()" class="easyui-linkbutton" data-options="iconCls:'icon-核销'">确定</a>
<a onclick="TianJiaGuanBi()" class="easyui-linkbutton" data-options="iconCls:'icon-back'">退出</a>
</td>
</tr>
</table>
</div>



控制器代码
核销代码
public ActionResult YunLiFeiYongHeXiao(int YunLiFeiYongID)
{
Session["YunLiFeiYongID"] = Convert.ToInt32(YunLiFeiYongID);
return View();
}

public ActionResult HeXiaoFeiYong(string HeXiaoFeiYong)
{
int intWuLiaoId = Convert.ToInt32(Session["YunLiFeiYongID"]);
var mySYS_TransportCostTable = (from tb in myEF.SYS_TransportCostTable where tb.TransportCostID == intWuLiaoId select tb).Single<Models.SYS_TransportCostTable>();

mySYS_TransportCostTable.VerificationNo = Convert.ToBoolean(HeXiaoFeiYong);
int i = myEF.SaveChanges();

if (i > 0)
{
return Json("false", JsonRequestBehavior.AllowGet);
}
else
{
return Json("true", JsonRequestBehavior.AllowGet);
}
}

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息