You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/BookingJieFeng/Views/Booking/Confirm.cshtml

1894 lines
84 KiB
Plaintext

2 years ago
@using BookingJieFeng.Models
@model ConfirmEditViewModel
@{
/**/
var seleteItemsCARGO = new List<SelectListItem>();
seleteItemsCARGO.Add(new SelectListItem() { Value = "S", Text = "S普通货" });
seleteItemsCARGO.Add(new SelectListItem() { Value = "R", Text = "R冻柜" });
seleteItemsCARGO.Add(new SelectListItem() { Value = "D", Text = "D危险品" });
var seleteItemsHYWRW = new List<SelectListItem>();
seleteItemsHYWRW.Add(new SelectListItem() { Value = "1", Text = "是" });
seleteItemsHYWRW.Add(new SelectListItem() { Value = "0", Text = "否" });
var seleteItemsDangerType = new List<SelectListItem>();
seleteItemsDangerType.Add(new SelectListItem() { Value = "0", Text = "无" });
seleteItemsDangerType.Add(new SelectListItem() { Value = "1", Text = "危险品+普货" });
seleteItemsDangerType.Add(new SelectListItem() { Value = "2", Text = "危险品+化工品" });
seleteItemsDangerType.Add(new SelectListItem() { Value = "3", Text = "危险品+危险品" });
var logList = ViewBag.LogList as List<LogListDisplayModel>;
}
<div class="top-navigation">
<div class="row">
<nav class="navbar">
<div class="navbar-collapse navbar-bottom collapse">
<ul class="nav navbar-nav orderlist-nav">
<li><a class="tabs" data-url="@Url.Action("Confirm")?ordno=@Model.ORDNO" data-title="新建截单"><i></i>新建</a><span></span></li>
@if (!string.IsNullOrEmpty(Model.SINO))
{
<li><a class="tabs" data-url="@Url.Action("ConfirmCopy")?srcSINO=@Model.SINO" data-title="复制截单"><i></i>复制</a><span></span></li>
}
else
{
<li><a class="disabled"><i></i>复制</a><span></span></li>
}
@if (Model.BSSTATUS == OrderConfirmStatus.Create.ToString() || Model.BSSTATUS == OrderConfirmStatus.Reject.ToString())
{
<li><a id="btnSave"><i></i>保存</a><span></span></li>
}
else
{
<li><a class="disabled"><i></i>保存</a><span></span></li>
}
@*@if (Model.BSSTATUS == OrderConfirmStatus.Confirm.ToString())
{
<li><a class="tabs" data-url="@Url.Action("Shipping")?sino=@Model.SINO" data-title="转换舱单"><i></i>转换舱单</a><span></span></li>
}
else
{
<li><a class="disabled"><i></i>转换舱单</a><span></span></li>
}*@
@if (Model.BSSTATUS == OrderConfirmStatus.Create.ToString() || Model.BSSTATUS == OrderConfirmStatus.Reject.ToString())
{
<li><a id="btnSaveTemplate"><i></i>存为模板</a><span></span></li>
<li><a id="btnLoadTemplate"><i></i>引入模板</a><span></span></li>
<li><a id="btnSubmit"><i></i>提交</a><span></span></li>
}
else if (Model.BSSTATUS == OrderConfirmStatus.Submit.ToString())
{
<li><a class="disabled"><i></i>存为模板</a><span></span></li>
<li><a class="disabled"><i></i>引入模板</a><span></span></li>
<li><a id="btnCancel" data-expire="@ViewBag.ClosingDateExpire"><i></i>撤销提交</a><span></span></li>
}
else
{
<li><a class="disabled"><i></i>存为模板</a><span></span></li>
<li><a class="disabled"><i></i>引入模板</a><span></span></li>
<li><a class="disabled"><i></i>提交</a><span></span></li>
}
<li><a onclick="window.print();"><i></i>打印中心</a><span></span></li>
</ul>
</div>
</nav>
</div>
</div>
<div class="wrapper-content J_mainContent gray-bg-right">
<form class="form-horizontal clearfix row-margin" id="formEdit">
@Html.HiddenFor(m => m.SINO)
@Html.HiddenFor(m => m.ORDNO)
@Html.HiddenFor(m => m.BSSTATUS)
@Html.HiddenFor(m => m.MODIFYTIME)
@Html.HiddenFor(m => m.BSNO)
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="form-group col-lg-3 col-md-4 col-sm-12">
<label class="col-lg-4 col-md-4 control-label">货物标识:</label>
<div class="col-lg-7 col-md-7">
@Html.DropDownListFor(m => m.CARGOID, seleteItemsCARGO, new { @class = "select form-control" })
</div>
</div>
<div class="form-group col-lg-3 col-md-4 col-sm-12">
<label class="col-lg-4 col-md-4 control-label">销售代码:</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.SALECODE, new { @class = "form-control", autocomplete = "off" })
</div>
</div>
@if (ViewBag.RemainTimeClosing != null)
{
<div class="form-group col-lg-4 col-md-4 col-sm-12 red">@ViewBag.RemainTimeClosing</div>
}
</div>
</div>
</div>
</div>
<div class="row-b"></div>
<div class="row goods">
<div class="col-lg-5 col-md-5">
<div class="ibox float-e-margins">
<div class="ibox-tools">
<i class="magnifier edit-large" data-areaid="SHIPPER" data-title="发货人"><img width="17" src="~/Content/img/magnifier_icon.png" /></i>
<a class="format-text-len" data-len="35">35</a>
</div>
<div class="ibox-content">
<div class="col-lg-12">
<label class="col-lg-2 col-md-3 control-label">发货人:</label>
<div class="col-lg-10 col-md-9 form-group position-r">
@Html.TextAreaFor(m => m.SHIPPER, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="show-number">
<ul></ul>
</div>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-tools">
<i class="magnifier edit-large" data-areaid="CONSIGNEE" data-title="收货人"><img width="17" src="~/Content/img/magnifier_icon.png" /></i>
<a class="format-text-len" data-len="35">35</a>
</div>
<div class="ibox-content">
<div class="col-lg-12">
<label class="col-lg-2 col-md-3 control-label">收货人:</label>
<div class="col-lg-10 col-md-9 form-group position-r">
@Html.TextAreaFor(m => m.CONSIGNEE, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="show-number">
<ul></ul>
</div>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-tools">
<i class="magnifier edit-large" data-areaid="NOTIFYPARTY" data-title="通知人"><img width="17" src="~/Content/img/magnifier_icon.png" /></i>
<a class="format-text-len" data-len="35">35</a>
</div>
<div class="ibox-content">
<div class="col-lg-12">
<label class="col-lg-2 col-md-3 control-label">通知人:</label>
<div class="col-lg-10 col-md-9 form-group position-r">
@Html.TextAreaFor(m => m.NOTIFYPARTY, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="show-number">
<ul></ul>
</div>
</div>
</div>
</div>
</div>
<div class="ibox float-e-margins">
<div class="ibox-tools">
<i class="magnifier edit-large" data-areaid="NOTIFYPARTY2" data-title="第二通知人"><img width="17" src="~/Content/img/magnifier_icon.png" /></i>
<a class="format-text-len" data-len="35">35</a>
</div>
<div class="ibox-content">
<div class="col-lg-12">
<label class="col-lg-2 col-md-3 control-label">第二通知人:</label>
<div class="col-lg-10 col-md-9 form-group position-r">
@Html.TextAreaFor(m => m.NOTIFYPARTY2, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="show-number">
<ul></ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-3">
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">业务编号:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.BusinessNO, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">PO NO.</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.PONO, new { @class = "form-control" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">约号:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.CONTRACTNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">提单号:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.MBLNO, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">船公司:</label>
<div class="col-lg-8 col-md-7">
<div class="input-group">
@Html.TextBoxFor(m => m.CARRIER, new { @class = "form-control", autocomplete = "off" })
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">ETD</label>
<div class="col-lg-8 col-md-7">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
@Html.TextBoxFor(m => m.ETD, new { @class = "form-control", autocomplete = "off" })
</div>
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">船名:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.VESSEL, new { @class = "form-control", autocomplete = "off", @readonly = "readonly" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">航次:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.VOYNO, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
</div>
<div class="col-lg-4 col-md-4">
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">装货港:</label>
<div class="col-lg-5 col-md-4">
@Html.TextBoxFor(m => m.PORTLOADID, new { @class = "form-control", autocomplete = "off", @readonly = "readonly", @title = "港口如果需要修改请填写在SI备注里 " })
</div>
<div class="col-lg-5 col-md-4">
@Html.TextBoxFor(m => m.PORTLOAD, new { @class = "form-control", @readonly = "readonly", @title = "港口如果需要修改请填写在SI备注里 " })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">卸货港:</label>
<div class="col-lg-5 col-md-4">
@Html.TextBoxFor(m => m.PORTDISCHARGEID, new { @class = "form-control", autocomplete = "off", @readonly = "readonly", @title = "港口如果需要修改请填写在SI备注里 " })
</div>
<div class="col-lg-5 col-md-4">
@Html.TextBoxFor(m => m.PORTDISCHARGE, new { @class = "form-control", @readonly = "readonly", @title = "港口如果需要修改请填写在SI备注里 " })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">目的地:</label>
<div class="col-lg-5 col-md-4">
@Html.TextBoxFor(m => m.DESTINATIONID, new { @class = "form-control", autocomplete = "off", @readonly = "readonly", @title = "港口如果需要修改请填写在SI备注里 " })
</div>
<div class="col-lg-5 col-md-4">
@Html.TextBoxFor(m => m.DESTINATION, new { @class = "form-control", @readonly = "readonly", @title = "港口如果需要修改请填写在SI备注里 " })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">付费方式:</label>
<div class="col-lg-9 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.BLFRT, new { @class = "form-control", autocomplete = "off" })
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">付费地点:</label>
<div class="col-lg-9 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.PREPARDAT, new { @class = "form-control", autocomplete = "off" })
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">签单方式:</label>
<div class="col-lg-9 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.ISSUETYPE, new { @class = "form-control", autocomplete = "off" })
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">运输条款:</label>
<div class="col-lg-9 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.SERVICE, new { @class = "form-control", autocomplete = "off" })
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row-b"></div>
<div class="row">
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-content">
<label class="col-lg-3 col-md-4 control-label left-15 blue">代录VGM</label>
<div class="col-lg-8 col-md-9 top-5">
@*@Html.CheckBoxFor(m => m.DAILU)*@
<input class="vgm-check" type="checkbox" id="DAILU" name="DAILU" @(Model.DAILU ? "checked" : "") />
<p class="red vgm-check-tip">如需我司代录VGM请在此处挑勾</p>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-content">
<label class="col-lg-3 col-md-4 control-label left-15 blue">代录舱单:</label>
<div class="col-lg-8 col-md-9 top-5">
@*@Html.CheckBoxFor(m => m.DAILU)*@
<input class="vgm-check" type="checkbox" id="DAILU_CANGDAN" name="DAILU_CANGDAN" @(Model.DAILU_CANGDAN ? "checked" : "") />
<p class="red vgm-check-tip">如需我司代录舱单,请在此处挑勾</p>
</div>
</div>
</div>
</div>
</div>
<div class="row hdn-dailu-cangdan">
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-content">
<label class="col-lg-4 col-md-4 control-label left-15">发货人国家代码:</label>
<div class="col-lg-7 col-md-9 top-5">
@Html.TextBoxFor(m => m.SHIPPERCOUNTRY, new { @class = "form-control", autocomplete = "off" })
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-content">
<label class="col-lg-4 col-md-4 control-label left-15">收货人国家代码:</label>
<div class="col-lg-7 col-md-9 top-5">
@Html.TextBoxFor(m => m.CONSIGNEERCOUNTRY, new { @class = "form-control", autocomplete = "off" })
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-content">
<label class="col-lg-4 col-md-4 control-label left-15">通知人国家代码:</label>
<div class="col-lg-7 col-md-9 top-5">
@Html.TextBoxFor(m => m.NOTIFYPARTYCOUNTRY, new { @class = "form-control", autocomplete = "off" })
</div>
</div>
</div>
</div>
</div>
<div class="row hdn-dailu-cangdan" style="margin-bottom:10px;">
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-content">
<label class="col-lg-4 col-md-4 control-label left-15">发货人联系方式:</label>
<div class="col-lg-7 col-md-9 top-5">
@Html.TextBoxFor(m => m.SHIPPERTEL, new { @class = "form-control", autocomplete = "off" })
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-content">
<label class="col-lg-4 col-md-4 control-label left-15">收货人联系方式:</label>
<div class="col-lg-7 col-md-9 top-5">
@Html.TextBoxFor(m => m.CONSIGNEETEL, new { @class = "form-control", autocomplete = "off" })
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="ibox float-e-margins">
<div class="ibox-content">
<label class="col-lg-4 col-md-4 control-label left-15">通知人联系方式:</label>
<div class="col-lg-7 col-md-9 top-5">
@Html.TextBoxFor(m => m.NOTIFYPARTYTEL, new { @class = "form-control", autocomplete = "off" })
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<label class="col-lg-2 col-md-2 left-15 h-10 w-10">实际装箱明细:</label>
<div class="col-lg-9 navbar-i" id="ctrn-btn-group">
<a class="ctrn-add-new">增加</a>
<a class="ctrn-del">删除</a>
<a class="ctrn-multi">多品名维护</a>
<a class="ctrn-yard-data">引入场站数据</a>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<table id="ctrnTable" class="table" style="margin-top:10px !important;">
<thead>
<tr>
<th data-checkbox="true"></th>
<th data-field="Index">序号</th>
<th data-field="CTNALL">箱型</th>
<th data-field="CNTRNO">箱号</th>
<th data-field="SEALNO">封号</th>
<th data-field="PKGS" data-footer-formatter="pkgsFormatter">件数</th>
<th data-field="KINDPKGS">包装</th>
<th data-field="KGS" data-footer-formatter="kgsFormatter">毛重(KGS)</th>
<th data-field="CBM" data-footer-formatter="cbmFormatter">尺码(M2)</th>
<th data-field="WEIGHKGS" data-footer-formatter="wkgsFormatter">VGM(KGS)</th>
<th data-field="VGMCONNCOM">公司名</th>
<th data-field="WEIGHATTN">联系人</th>
<th data-field="WEIGHTEL">电话</th>
<th data-field="VGMEMAIL">邮箱</th>
<th data-field="WEIGHTYPE">称重方式</th>
</tr>
</thead>
</table>
</div>
<div class="row-b"></div>
<div class="row">
<div class="col-lg-3 col-md-3">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="col-lg-12 form-group">
<label class="col-lg-3 col-md-4 control-label">唛头:</label>
<div class="col-lg-9 col-md-8 form-group">
@Html.TextAreaFor(m => m.MARKS, new { @class = "form-control", rows = "5" })
</div>
</div>
<div class="form-group">
<label class="col-lg-4 col-md-5 control-label left-15">HS CODE</label>
<div class="col-lg-7 col-md-6">
@Html.TextBoxFor(m => m.HSCODE, new { @class = "form-control" })
</div>
<div class="clearfix"></div>
<span class="red-sm col-lg-11">此处HS CODE不显示提单如需显示请添加货描处</span>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="ibox float-e-margins">
<div class="ibox-content">
<label class="col-lg-2 col-md-3 control-label">货物描述:</label>
<div class="col-lg-10 col-md-9 form-group">
@Html.TextAreaFor(m => m.DESCRIPTION, new { @class = "form-control", rows = "5" })
</div>
</div>
<div class="ibox-content">
<label class="col-lg-2 col-md-3 control-label">SI备注</label>
<div class="col-lg-10 col-md-9 form-group">
@Html.TextAreaFor(m => m.SIREMARK, new { @class = "form-control", rows = "5" })
</div>
</div>
</div>
</div>
</div>
<div class="row left-15">
<div class="col-lg-4 col-md-4 form-group hdn-temp">
<label class="col-lg-3 col-md-4 control-label">温度:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.TEMPSET, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-temp">
<label class="col-lg-3 col-md-4 control-label">通风:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.REEFERF, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-temp">
<label class="col-lg-3 col-md-4 control-label">湿度:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.HUMIDITY, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">CLASS</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.DCLASS, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">UN NO</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.DUNNO, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">副危:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.FUWEI, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">闪点:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.SHANDIAN, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">海洋污染物:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.HAIYANGWURANWU, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">混装危险品类型:</label>
<div class="col-lg-8 col-md-7">
@Html.DropDownListFor(m => m.DangerType, seleteItemsDangerType, new { @class = "select form-control" })
</div>
</div>
</div>
<div class="row-b"></div>
<!--<div class="row h-15 left-15">
<div class="ibox float-e-margins">
</div>
</div>-->
</form>
<!--订单更改日志-->
<div class="row">
<div class="ibox float-e-margins modify-summary">
<div class="col-lg-12">
<div class="ibox-title">
<h5>修改汇总</h5>
</div>
<div class="clearfix"></div>
<ul class="modify-column">
@if (logList != null)
{
foreach (var item in logList)
{
<li>
<span>修改人:@item.OpUserName</span>
<span>修改时间:@item.OpTime</span>
<span>
展开 / 折叠内容<i class="open-arrow"></i>
@if (item.ChangeList.Count == 0)
{
<b>(未做任何修改)</b>
}
</span>
</li>
<table>
<tbody>
@if (item.ChangeList.Count > 0)
{
foreach (var chg in item.ChangeList)
{
<tr>
<td>@chg.Title@chg.SrcValue</td>
<td class="modify-border">改为&nbsp;&nbsp;</td>
<td>@chg.Title@chg.DestValue</td>
</tr>
}
}
else
{
<tr>
<td>未作任何更改</td>
</tr>
}
</tbody>
</table>
}
}
</ul>
</div>
</div>
</div>
</div>
<!--收发通弹出框-->
<div class="modal fade" id="modalSFT" tabindex="-1" role="dialog" aria-labelledby="sftModelLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="sftModelLabel">发货人</h4>
</div>
<div class="modal-body">
<form class="form-horizontal form-people">
<div class="ibox-tools">
<a class="format-text-len" data-len="35">35</a>
</div>
<div class="form-group">
<textarea id="textSFTModal" class="form-control text-area-show-number" rows="10"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="sftModelBtnSave">保存</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="ctrnModal" tabindex="-1" role="dialog" aria-labelledby="ctrnModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="ctrnModalLabel">集装箱</h4>
</div>
<div class="modal-body cleafix">
<button type="button" class="btn btn-primary" id="btnCtrnModalAdd">新增</button>
<form id="formCtrn" class="form-horizontal">
<input type="hidden" id="modelCtrnIndex" name="Index">
<div class="form-group col-md-3">
<label for="recipient-name" class="control-label">箱型</label>
<div class="input-group">
<input type="text" class="form-control" id="modelCtrnType" name="CTNALL" autocomplete="off">
<div class="input-group-btn" style="position:unset">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">箱号</label>
<input type="text" class="form-control" id="modelCtrnCNTRNO" name="CNTRNO">
</div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">封号</label>
<input type="text" class="form-control" id="modelCtrnSEALNO" name="SEALNO">
</div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">件数</label>
<input type="text" class="form-control" id="modelCtrnPKGS" name="PKGS">
</div>
<div class="clearfix"></div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">包装</label>
<div class="input-group">
<input type="text" class="form-control" id="modelCtrnKINDPKGS" name="KINDPKGS" autocomplete="off">
<div class="input-group-btn" style="position:unset">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">毛重(KGS)</label>
<input type="text" class="form-control" id="modelCtrnKGS" name="KGS">
</div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">尺码(M2)</label>
<input type="text" class="form-control" id="modelCtrnCBM" name="CBM">
</div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">称重方式</label>
<select id="modelCtrnWEIGHTYPE" name="WEIGHTYPE" class="form-control">
<option value="累加">累加</option>
<option value="总重">总重</option>
</select>
</div>
<div class="clearfix"></div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">VGM(KGS)</label>
<input type="text" class="form-control" id="modelCtrnWEIGHKGS" name="WEIGHKGS">
</div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">公司名</label>
<input type="text" class="form-control" id="modelCtrnVGMCONNCOM" name="VGMCONNCOM">
</div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">联系人</label>
<input type="text" class="form-control" id="modelCtrnWEIGHATTN" name="WEIGHATTN">
</div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">电话</label>
<input type="text" class="form-control" id="modelCtrnWEIGHTEL" name="WEIGHTEL">
</div>
<div class="clearfix"></div>
<div class="form-group col-md-3">
<label for="message-text" class="control-label">邮箱</label>
<input type="text" class="form-control" id="modelCtrnVGMEMAIL" name="VGMEMAIL">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">@Resources.LangAll.BtnClose</button>
<button type="button" class="btn btn-primary" id="modelBtnSave">@Resources.LangAll.BtnSave</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="tempModel" tabindex="-1" role="dialog" aria-labelledby="tempModelLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="tempModelLabel">@Resources.LangAll.LabelTemplate</h4>
</div>
<div class="modal-body">
<form id="formTemp" class="form-horizontal">
<div class="form-group">
<label for="message-text" class="control-label">@Resources.LangAll.LabelTempName</label>
<input type="text" class="form-control" id="modelTempName" name="NAME">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">@Resources.LangAll.BtnClose</button>
<button type="button" class="btn btn-primary" id="tempModelBtnSave">@Resources.LangAll.BtnSave</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="loadTempModel" tabindex="-1" role="dialog" aria-labelledby="loadTempModelLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="loadTempModelLabel">@Resources.LangAll.LabelLoadTemplate</h4>
</div>
<div class="modal-body">
<form id="formLoadTemp" class="form-horizontal">
<div class="form-group">
<label for="message-text" class="control-label">@Resources.LangAll.LabelTempName</label>
<select class="form-control" id="modelLoadTempName"></select>
@*<div class="input-group">
<input type="text" class="form-control" id="modelLoadTempName" name="NAME" autocomplete="off">
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>*@
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">@Resources.LangAll.BtnClose</button>
<button type="button" class="btn btn-primary" id="loadTempModelBtn">@Resources.LangAll.BtnOK</button>
</div>
</div>
</div>
</div>
<form id="formUpXls" method="post" enctype="multipart/form-data" action="@Url.Action("CtrnFromExcel")" style="display:none;">
<input type="file" id="fileUpXls" name="file" />
</form>
@section styles
{
<link type="text/css" rel="stylesheet" href="~/Content/hplus/css/plugins/datapicker/datepicker3.css" />
<link type="text/css" rel="stylesheet" href="~/Content/css/confirm.css" />
}
@section scripts{
<script src="~/Content/hplus/js/plugins/validate/jquery.validate.min.js"></script>
<script src="~/Content/hplus/js/plugins/suggest/bootstrap-suggest.min.js"></script>
<script src="~/Content/hplus/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="~/Content/js/validatorConfig.js"></script>
<script src="~/Content/js/jquery.form.js"></script>
<script src="~/Content/js/common.js"></script>
<script type="text/javascript">
$(function () {
$(".modify-column li").click(function () {
$(this).children(".open-arrow").toggleClass("close-arrow").siblings("close-arrow").removeClass("open-arrow");
$(this).next(".modify-column table").show().siblings(".modify-column table").hide();
})
})
</script>
<script>
var ctrnData = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model.CtrnList));
var templateData = [];
var changed = false;
var isCreate=@string.IsNullOrEmpty(Model.SINO).ToString().ToLower();
var employeeJson=@Html.Raw(ViewBag.EmployeeJson)
$(function () {
$("#formCtrn").validate({
rules: {
CTNALL: "required",
PKGS: "digits",
KGS: "number",
CBM: "number",
WEIGHKGS: "number",
CNTRNO: 'required',
SEALNO: 'required'
},
messages: {
CTNALL: errIcon + "@Resources.LangOrder.ValidInputCtrnType",
PKGS:errIcon + "@Resources.LangAll.ValidMustInteger",
KGS:errIcon + "@Resources.LangAll.ValidMustNumber",
CBM:errIcon + "@Resources.LangAll.ValidMustNumber",
WEIGHKGS: errIcon + "@Resources.LangAll.ValidMustNumber",
CNTRNO: errIcon + "@Resources.LangAll.ValidRequired",
SEALNO: errIcon + "@Resources.LangAll.ValidRequired"
}
});
$("#formTemp").validate({
rules: {
NAME: "required"
},
messages: {
NAME: errIcon + "@Resources.LangOrder.ValidInputTempName"
}
});
////销售代码
//$("#SALECODE").bsSuggest({
// idField: "name",
// keyField: "name",
// clearable: true,
// data: { value: employeeJson }
//}).on('onSetSelectValue', function (e, model) {
// console.log('onSetSelectValue: ', model);
//});
//船公司
$("#CARRIER").bsSuggest({
url: "@Url.Action("SuggestCarrier", "Common")?keyword=",
idField: "CODENAME",
keyField: "SHORTNAME",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//场站
$("#YARD").bsSuggest({
url: "@Url.Action("SuggestYard", "Common")?keyword=",
idField: "CODENAME",
keyField: "SHORTNAME",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//签单方式
$("#ISSUETYPE").bsSuggest({
url: "@Url.Action("SuggestIssuType", "Common")?keyword=",
idField: "GID",
keyField: "BLTYPE",
getDataMethod: 'url',
effectiveFields: ["BLTYPE"],
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//付费方式
$("#BLFRT").bsSuggest({
url: "@Url.Action("SuggestFRT", "Common")?keyword=",
idField: "FRT",
keyField: "FRT",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
//选择预付后,赋值付费地点
if (model.key === 'FREIGHT COLLECT') {
$("#PREPARDAT").val($("#DESTINATION").val())
}
});
//包装
$("#KINDPKGS").bsSuggest({
url: "@Url.Action("SuggestPackage", "Common")?keyword=",
idField: "FRT",
keyField: "PKGS",
getDataMethod: 'url',
effectiveFields: ["PKGS"],
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//收货地
$("#PLACERECEIPTID").bsSuggest({
url: "@Url.Action("SuggestLoadport", "Common")?keyword=",
idField: "PORT",
keyField: "EDICODE",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
$("#PLACERECEIPT").val(model.id);
if ($("#PORTLOADID").val().length == 0) {
$("#PORTLOADID").val($("#PLACERECEIPTID").val())
$("#PORTLOAD").val(model.id);
}
});
@*//装货港
$("#PORTLOADID").bsSuggest({
url: "@Url.Action("SuggestLoadport", "Common")?keyword=",
idField: "PORT",
keyField: "EDICODE",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
$("#PORTLOAD").val(model.id);
});
//卸货港
$("#PORTDISCHARGEID").bsSuggest({
url: "@Url.Action("SuggestDisport", "Common")?keyword=",
idField: "PORT",
keyField: "EDICODE",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
$("#PORTDISCHARGE").val(model.id);
if ($("#DESTINATIONID").val().length == 0) {
$("#DESTINATIONID").val($("#PORTDISCHARGEID").val())
$("#DESTINATION").val(model.id);
}
if ($("#PLACEDELIVERYID").val().length == 0) {
$("#PLACEDELIVERYID").val($("#PORTDISCHARGEID").val())
$("#PLACEDELIVERY").val(model.id);
}
});
//目的地
$("#DESTINATIONID").bsSuggest({
url: "@Url.Action("SuggestDisport", "Common")?keyword=",
idField: "PORT",
keyField: "EDICODE",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
$("#DESTINATION").val(model.id);
});*@
@*//交货地
$("#PLACEDELIVERYID").bsSuggest({
url: "@Url.Action("SuggestDisport", "Common")?keyword=",
idField: "PORT",
keyField: "EDICODE",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
$("#PLACEDELIVERY").val(model.id);
});*@
//付费地点
$("#PREPARDAT").bsSuggest({
url: "@Url.Action("SuggestDisport", "Common")?keyword=",
idField: "EDICODE",
keyField: "PORT",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//运输条款
$("#SERVICE").bsSuggest({
url: "@Url.Action("SuggestService", "Common")?keyword=",
idField: "GID",
keyField: "SERVICE",
getDataMethod: 'url',
effectiveFields: ["SERVICE"],
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//船名
$("#VESSEL").bsSuggest({
url: "@Url.Action("SuggestVESSEL", "Common")?keyword=",
idField: "VSID",
keyField: "VESSEL",
getDataMethod: 'url',
effectiveFields: ["VESSEL"],
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//保存
$("#btnSave").click(function () {
saveOrSubmit(false)
});
//提交
$("#btnSubmit").click(function () {
saveOrSubmit(true);
});
//取消
$("#btnCancel").click(function () {
if ($("#btnCancel").data('expire') == 'True') {
var idx = layer.alert("@Resources.LangConfirm.MsgClosingDateExpire", function () {
$.ajax({
method: 'POST',
url: '@Url.Action("ConfirmCancel")?sino=@Model.SINO',
success: function (data) {
layer.alert(data.Message, function () {
location.reload();
})
}
})
})
} else {
$.ajax({
method: 'POST',
url: '@Url.Action("ConfirmCancel")?sino=@Model.SINO',
success: function (data) {
layer.alert(data.Message, function () {
location.reload();
})
}
})
}
});
//删除
$("#btnDelete").click(function () {
var idx= layer.confirm('确认删除吗?', {
btn: ['确定', '取消'] //按钮
}, function () {
$.ajax({
method: 'POST',
url: '@Url.Action("ConfirmDelete")?sino=@Model.SINO',
success: function (data) {
var subIdx= layer.alert(data.Message, function () {
if (data.Success) {
$(parent.document).find('.J_menuTab.active i').click()
}
layer.close(subIdx)
})
}
})
}, function () {
});
});
//集装箱信息
$("#ctrnTable").bootstrapTable({ "showFooter": true })
$("#ctrnTable").bootstrapTable('load', ctrnData)
//集装箱新增删除
var ctrnTypeIsChoose = false;
$("#modelCtrnType").bsSuggest({
url: "@Url.Action("SuggestCTN")?keyword=",
idField: "CTNID",
keyField: "CTN",
getDataMethod: 'url',
effectiveFields: ["CTN"],
fnPreprocessKeyword: function (keyword, options) {
//debugger
var obj = {
ord: $('#ORDNO').val(),
ctn: keyword
}
keyword = JSON.stringify(obj)
//console.log(keyword)
return keyword
}
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
ctrnTypeIsChoose = true;
}).on('onUnsetSelectValue', function () {
console.log('onUnsetSelectValue');
ctrnTypeIsChoose = false;
}).on('blur', function () {
if (!ctrnTypeIsChoose) {
$("#modelCtrnType").val("")
}
});
$("a.ctrn-add-new").click(function () {
$("#ctrnModal").modal('show')
$("#ctrnTable").bootstrapTable('uncheckAll')
$("#formCtrn").resetForm();
if (ctrnData.length > 0) {
$("#formCtrn").loadData(ctrnData[ctrnData.length - 1]);
$("#modelCtrnCNTRNO").val("");
$("#modelCtrnSEALNO").val("");
}
var dailu = $("#DAILU").prop("checked");
if (dailu) {
$("#modelCtrnWEIGHKGS").prop("readonly", "");
$("#modelCtrnWEIGHKGS").prop("title", "");
} else {
$("#modelCtrnWEIGHKGS").prop("readonly", "readonly");
$("#modelCtrnWEIGHKGS").prop("title", "请先选中“是否代录”,才可编辑此项");
}
});
//删除集装箱信息
$("a.ctrn-del").click(function () {
var ids = $.map($("#ctrnTable").bootstrapTable('getSelections'), function (row) {
return row.Index
})
if (ids.length > 0) {
changed = true;
$("#ctrnTable").bootstrapTable('remove', { field: 'Index', values: ids });
reorderCtns();
$("#ctrnTable").bootstrapTable('load', ctrnData)
}
});
//多品名维护
$("a.ctrn-multi").click(function () {
if (changed || isCreate) {
layer.alert("@Resources.LangConfirm.MsgNeedSave");
return;
}
layer.open({
type: 2,
title: '@Resources.LangConfirm.BtnMulti',
shadeClose: true,
shade: 0.8,
area: ['90%', '90%'],
content: '@Url.Action("CtnDetail",new { sino= Model.SINO })'
});
});
//展开集装箱
$("a.ctrn-expand").click(function () {
if (changed) {
layer.alert("@Resources.LangConfirm.MsgNeedSave");
return;
}
var ctrnDataNew = [];
$.each(ctrnData, function (idx, item) {
if (item.CTNNUM == 1) {
ctrnDataNew.push(item);
} else if (item.CTNNUM > 1) {
var count = item.CTNNUM;
for (var m = 0; m < count; m++) {
var newItem = {
CTN_ID: ctrnDataNew.length + 1,
CTNALL: item.CTNALL,
CTNNUM: 1,
TEU: item.TEU,
CNTRNO: item.CNTRNO,
SEALNO: item.SEALNO,
PKGS: item.PKGS,
KINDPKGS: item.KINDPKGS,
KGS: item.KGS,
CBM: item.CBM,
TAREWEIGHT: item.TAREWEIGHT,
CTNSTATUS: item.CTNSTATUS,
WEIGHTYPE: item.WEIGHTYPE,
WEIGHKGS: item.WEIGHKGS,
WEIGHATTN: item.WEIGHATTN,
VGMCONNCOM: item.VGMCONNCOM,
WEIGHTEL: item.WEIGHTEL,
WEIGHDATE: item.WEIGHDATE,
VGMADDR: item.VGMADDR,
VGMEMAIL: item.VGMEMAIL,
REMARK: item.REMARK
};
ctrnDataNew.push(newItem);
}
}
})
ctrnData = ctrnDataNew;
$("#ctrnTable").bootstrapTable('load', ctrnData)
});
//双击编辑集装箱
$("#ctrnTable").on('dbl-click-row.bs.table', function (row, $element, field) {
$("#ctrnModal").modal('show')
$("#ctrnTable").bootstrapTable('uncheckAll')
$("#ctrnTable").bootstrapTable('checkBy', { field: 'Index', values: [$element.Index] })
$("#formCtrn").loadData($element);
var dailu = $("#DAILU").prop("checked");
if (dailu) {
$("#modelCtrnWEIGHKGS").prop("readonly", "");
$("#modelCtrnWEIGHKGS").prop("title", "");
} else {
$("#modelCtrnWEIGHKGS").prop("readonly", "readonly");
$("#modelCtrnWEIGHKGS").prop("title", "请先选中“是否代录”,才可编辑此项");
}
})
//保存集装箱
$("#modelBtnSave").click(function () {
if ($("#formCtrn").valid()) {
changed = true;
var selList = $("#ctrnTable").bootstrapTable('getSelections');
var isAdd = false;
if (selList.length > 0) {
var json = $("#formCtrn").toJson();
selList[0].CTNALL = json.CTNALL;
selList[0].CTNNUM = json.CTNNUM;
selList[0].CNTRNO = json.CNTRNO;
selList[0].SEALNO = json.SEALNO;
selList[0].PKGS = json.PKGS;
selList[0].KINDPKGS = json.KINDPKGS;
selList[0].KGS = json.KGS;
selList[0].CBM = json.CBM;
selList[0].TAREWEIGHT = json.TAREWEIGHT;
selList[0].CTNSTATUS = json.CTNSTATUS;
selList[0].WEIGHTYPE = json.WEIGHTYPE;
selList[0].WEIGHKGS = json.WEIGHKGS;
selList[0].WEIGHATTN = json.WEIGHATTN;
selList[0].VGMCONNCOM = json.VGMCONNCOM;
selList[0].WEIGHTEL = json.WEIGHTEL;
selList[0].WEIGHDATE = json.WEIGHDATE;
selList[0].VGMADDR = json.VGMADDR;
selList[0].VGMEMAIL = json.VGMEMAIL;
selList[0].REMARK = json.REMARK;
} else {
isAdd = true;
ctrnData.push({
Index: ctrnData.length + 1,
CTN_ID: '',
CTNALL: $("#modelCtrnType").val(),
CTNNUM: parseInt($("#modelCtrnNum").val()),
TEU: 0,
CNTRNO: $("#modelCtrnCNTRNO").val(),
SEALNO: $("#modelCtrnSEALNO").val(),
PKGS: $("#modelCtrnPKGS").val(),
KINDPKGS: $("#modelCtrnKINDPKGS").val(),
KGS: $("#modelCtrnKGS").val(),
CBM: $("#modelCtrnCBM").val(),
TAREWEIGHT: $("#modelCtrnTAREWEIGHT").val(),
CTNSTATUS: $("#modelCtrnCTNSTATUS").val(),
WEIGHTYPE: $("#modelCtrnWEIGHTYPE").val(),
WEIGHKGS: $("#modelCtrnWEIGHKGS").val(),
WEIGHATTN: $("#modelCtrnWEIGHATTN").val(),
VGMCONNCOM: $("#modelCtrnVGMCONNCOM").val(),
WEIGHTEL: $("#modelCtrnWEIGHTEL").val(),
WEIGHDATE: $("#modelCtrnWEIGHDATE").val(),
VGMADDR: $("#modelCtrnVGMADDR").val(),
VGMEMAIL: $("#modelCtrnVGMEMAIL").val(),
REMARK: $("#modelCtrnREMARK").val()
})
}
reorderCtns();
$("#ctrnTable").bootstrapTable('load', ctrnData)
if (isAdd) {
$("#ctrnTable").bootstrapTable('checkBy', { field: 'Index', values: [ctrnData[ctrnData.length-1].Index] })
}
}
});
$("#btnCtrnModalAdd").click(function () {
$("#modelBtnSave").click();
$("#ctrnTable").bootstrapTable('uncheckAll')
$("#formCtrn").resetForm();
if (ctrnData.length > 0) {
$("#formCtrn").loadData(ctrnData[ctrnData.length - 1]);
$("#modelCtrnCNTRNO").val("");
$("#modelCtrnSEALNO").val("");
}
});
$("#modelCtrnKINDPKGS").bsSuggest({
url: "@Url.Action("SuggestPackage", "Common")?keyword=",
idField: "FRT",
keyField: "PKGS",
getDataMethod: 'url',
effectiveFields: ["PKGS"]
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//引入场站数据
$("a.ctrn-yard-data").click(function () {
var layerIdx = layer.load(0, {
shade: [0.2, '#000'] //0.1透明度的白色背景
});
$.ajax({
method: 'POST',
url: '@Url.Action("GetYardData")?ordno=@Model.ORDNO',
dataType:'json',
success: function (data) {
if (data.Success) {
updateCtrnData(data.List);
} else {
layer.alert(data.Message)
}
layer.close(layerIdx);
}
})
});
//引入excel数据
$("a.ctrn-import").click(function () {
$("#fileUpXls").click();
});
$("#fileUpXls").change(function () {
$("#formUpXls").ajaxSubmit(
{
dataType: 'json',
success: function (data)
{
if (data.Success) {
updateCtrnData(data.List);
} else {
layer.alert(data.Message);
}
}
});
})
//发货 收货 通知人格式化
$("a.format-text-len").click(function () {
var len = parseInt($(this).data('len'));
var area = $(this).parents("div.ibox-tools").next().find("textarea.text-area-show-number");
//var arr = $(area).val().split("\n");
//var result = [];
//var strResult = '';
//for (idx in arr) {
// var str = arr[idx];
// if (str.length > len) {
// while (str.length > 0) {
// result.push(str.substr(0, len));
// strResult += str.substr(0, len) + '\n'
// str = str.substr(len);
// }
// } else {
// result.push(str);
// strResult += str + '\n';
// }
//}
//$(area).val(strResult)
//$(area).change()
formatTextarea(len, area.attr('id'))
});
$("textarea.text-area-show-number").scroll(function () {
var $this = $(this);
var top = $this.scrollTop();
console.log(top)
var numContainer = $($this.parent().find("div.div-show-number"));
numContainer.scrollTop(top);
numContainer.height($this.parent().height())
})
$("textarea.text-area-show-number").keyup(function () {
var $this = $(this);
$this.change();
});
$("textarea.text-area-show-number").change(function () {
var $this = $(this);
var numContainer = $($this.parent().find("div.div-show-number"));
var arr = $this.val().split("\n");
var arrNum = [];
for (idx in arr) {
arrNum.push(arr[idx].length);
}
numContainer.empty();
for (idx in arrNum) {
numContainer.append('<div>' + arrNum[idx] + '</div>');
}
})
//货物类型
$("#CARGOID").change(function () {
var val = $("#CARGOID").val();
if (val == "R") {
$("div.hdn-temp").show();
$("div.hdn-danger").hide();
} else if (val == "D") {
$("div.hdn-danger").show();
$("div.hdn-temp").hide();
} else {
$("div.hdn-temp,div.hdn-danger").hide();
}
});
//页面加载时显示
$("#CARGOID").change();
//模板
$("#btnSaveTemplate").click(function () {
$("#tempModel").modal('show')
$("#modelTempName").val('');
});
$("#tempModelBtnSave").click(function () {
if ($("#formTemp").valid()) {
var obj = getEditJson();
var tempObj = {
NAME: $("#modelTempName").val(),
CATE: '@TemplateCate.Confirm.ToString()',
CONTENT: JSON.stringify(obj)
}
$.ajax({
method: 'POST',
url: '@Url.Action("SaveTemplate", "Template")',
dataType: 'json',
data: JSON.stringify(tempObj),
contentType: "application/json",
success: function (data) {
layer.alert(data.Message)
}
})
$("#tempModel").modal('hide')
}
});
//模板
$("#btnLoadTemplate").click(function () {
$("#loadTempModel").modal('show')
$("#modelLoadTempName").val('');
});
$.ajax({
method: 'GET',
url: '@Url.Action("GetTemplates", "Template")?cate=@TemplateCate.Confirm.ToString()',
success: function (data) {
console.log(data)
for (var idx in data) {
$("#modelLoadTempName").append('<option value="' + idx + '">' + data[idx].NAME + '</option>')
}
templateData = data;
}
})
$("#loadTempModelBtn").click(function () {
var val = $("#modelLoadTempName").val();
debugger;
if (val.length > 0) {
var idx = parseInt(val);
var content = templateData[idx].CONTENT;
var json = JSON.parse(content);
$("#formEdit").loadData(json);
ctrnData = json.CtrnList;
$("#ctrnTable").bootstrapTable('load', ctrnData);
$("#ORDNO").val('');
}
$("#loadTempModel").modal('hide')
})
$("#PKGS").on('blur', function () {
var regExp = /[0-9]+/gi
var val = $("#PKGS").val();
var find = regExp.exec(val);
if (find.length > 0) {
$("#PKGS").val(find);
$("#KINDPKGS").val(val.replace(find, ''))
}
})
$("textarea.text-area-show-number").change();
$("#ETD").datepicker({
autoclose: true,
format: "yyyy-mm-dd"
});
$("#modelCtrnWEIGHDATE").datepicker({
autoclose: true,
format: "yyyy-mm-dd"
});
$("#DAILU_CANGDAN").change(function () {
dailuCangdanChange()
})
dailuCangdanChange()
//2020-11-10不显示字数
$("div.show-number").hide()
//弹出编辑框
$("i.edit-large").click(function () {
var areaid = $(this).data('areaid')
var title = $(this).data('title')
$("#sftModelLabel").html(title)
$("#textSFTModal").val($('#' + areaid).val())
$("#textSFTModal").data('areaid', areaid)
$("#modalSFT").modal('show')
})
//收发通编辑对话框保存
$("#sftModelBtnSave").click(function () {
var areaid = $("#textSFTModal").data('areaid')
$('#' + areaid).val($("#textSFTModal").val())
$("#modalSFT").modal('hide')
})
});
function dailuCangdanChange() {
var chk = $("#DAILU_CANGDAN").prop("checked");
if (chk) {
$(".hdn-dailu-cangdan").show();
} else {
$(".hdn-dailu-cangdan").hide();
}
}
function saveOrSubmit(submit) {
if (submit) {
validSubmit();
$("#BSSTATUS").val('@OrderStatus.Submit');
if (!$("#formEdit").valid()) {
layer.alert('@Resources.LangAll.ValidFormHasError')
return;
}
} else {
validSave();
if (!$("#formEdit").valid()) {
layer.alert('@Resources.LangAll.ValidFormHasError')
return;
}
$("#BSSTATUS").val('@OrderStatus.Create');
}
var obj = getEditJson();
var dailu = $("#DAILU").prop("checked");
obj.DAILU = dailu
var dailu_cangdan = $("#DAILU_CANGDAN").prop("checked");
obj.DAILU_CANGDAN = dailu_cangdan
$.ajax({
method: 'POST',
url: '@Url.Action("ConfirmSave")',
dataType: 'json',
data: JSON.stringify(obj),
contentType: "application/json",
success: function (data) {
if (data.Success) {
var msgLayer= layer.alert(data.Message, function () {
if (submit) {
lastIndex=layer.open({
type: 2,
title: '发送邮件',
shade: 0.8,
area: ['600px', '650px'],
content: '@Url.Action("SendMailAfterConfirmSubmit")?sino=' + data.Id,
end: function () {
if (data.Url.length > 0) {
location.href = data.Url;
}
}
});
layer.close(msgLayer)
} else {
if (data.Url.length > 0) {
location.href = data.Url;
}
}
})
} else {
layer.alert(data.Message)
}
}
})
}
function getEditJson() {
var obj = $("#formEdit").toJson();
obj.ISCONTAINERSOC = $("#ISCONTAINERSOC").prop('checked');
obj.CtrnList = ctrnData;
return obj;
}
function validSave() {
$("#formEdit").validate({
rules: {
PKGS: { digits: true },
KGS: { number: true },
CBM: { number: true }
},
messages: {
PKGS: { digits: errIcon + '@Resources.LangAll.ValidMustInteger' },
KGS: { number: errIcon + '@Resources.LangAll.ValidMustNumber' },
CBM: { number: errIcon + '@Resources.LangAll.ValidMustNumber' }
}
});
}
function validSubmit() {
$("#formEdit").validate({
rules: {
CARRIER: "required",
ETD: "required",
SHIPPER: {
required: true,
hasCnWords: true,
sft_check_rows_len: true
},
CONSIGNEE: {
required: true,
hasCnWords: true,
sft_check_rows_len: true
},
NOTIFYPARTY: {
required: true,
hasCnWords: true,
sft_check_rows_len: true
},
NOTIFYPARTY2: {
hasCnWords: true,
sft_check_rows_len: true
},
MARKS: "required",
DESCRIPTION: "required",
PKGS: {
required: true,
digits: true
},
KGS: {
required: true,
number: true
},
KINDPKGS: "required",
CBM: {
required: true,
number: true
},
PORTLOADID: "required",
PORTDISCHARGEID: "required",
PLACEDELIVERYID: "required",
ISSUETYPE: "required",
SERVICE: "required",
BLFRT: "required",
TEMPSET: {
required: function (ele) {
return $("#CARGOID").val() == 'R'
},
number: true,
tempset_chk: true
}
},
messages: {
CARRIER: errIcon + "船公司必须录入",
ETD: errIcon + "请选择开船日期",
SHIPPER: {
required: errIcon + "发货人不能为空"
},
CONSIGNEE: {
required: errIcon + "收货人不能为空"
},
NOTIFYPARTY: {
required: errIcon + "通知人不能为空"
},
MARKS:errIcon+"唛头不能为空",
DESCRIPTION:errIcon+"货物描述不能为空",
PKGS: {
required: errIcon + "件数不能为空",
digits: errIcon + "件数必须为整数"
},
KGS: {
required: errIcon+"毛重不能为空",
number: errIcon + '毛重必须为数字'
},
KINDPKGS: errIcon + "包装不能为空",
CBM: {
required: errIcon+"尺码不能为空",
number: errIcon + '尺码必须为数字'
},
PORTLOADID:errIcon+"请选择装货港",
PORTDISCHARGEID:errIcon+"请选择卸货港",
PLACEDELIVERYID:errIcon+"请选择交货地",
ISSUETYPE:errIcon+"请选择签单方式",
SERVICE:errIcon+"请选择运输条款",
BLFRT: errIcon + "请选择付费方式",
TEMPSET: {
required: errIcon + "温度不能为空",
number: errIcon + "只能是数字"
}
}
});
}
fmtCTNSTATUS= function(value, row, index) {
if (row.CTNSTATUS == "F") {
return '@Resources.LangConfirm.TextCtnStatusF';
}
else if (row.CTNSTATUS == "E")
{
return '@Resources.LangConfirm.TextCtnStatusE';
}
else if (row.CTNSTATUS == "L") {
return '@Resources.LangConfirm.TextCtnStatusL';
}
return '';
}
function reorderCtns() {
for (var idx = 0; idx < ctrnData.length; idx++) {
ctrnData[idx].Index = idx + 1;
}
}
function updateCtrnData(list) {
$.each(list, function (idx, item) {
var findItem = null;
$.each(ctrnData, function (i, o) {
if (o.CNTRNO == item.CNTRNO) {
findItem = o;
return true;
}
})
if (findItem == null) {
findItem = {
Index: ctrnData.length + 1,
CTN_ID: '',
CTNNUM: 1
};
ctrnData.push(findItem);
}
findItem.CTNALL = item.CTNALL;
findItem.TEU = item.TEU;
findItem.CNTRNO = item.CNTRNO;
findItem.SEALNO = item.SEALNO;
findItem.PKGS = item.PKGS;
findItem.KINDPKGS = item.KINDPKGS;
findItem.KGS = item.KGS;
findItem.CBM = item.CBM;
findItem.TAREWEIGHT = item.TAREWEIGHT;
//findItem.CTNSTATUS=item.CTNSTATUS;
//findItem.WEIGHTYPE=item.WEIGHTYPE;
//findItem.WEIGHKGS=item.WEIGHKGS;
//findItem.WEIGHATTN=item.WEIGHATTN;
//findItem.VGMCONNCOM=item.VGMCONNCOM;
//findItem.WEIGHTEL=item.WEIGHTEL;
//findItem.WEIGHDATE=item.WEIGHDATE;
//findItem.VGMADDR=item.VGMADDR;
//findItem.VGMEMAIL=item.VGMEMAIL;
//findItem.REMARK=item.REMARK
})
$("#ctrnTable").bootstrapTable('load', ctrnData)
}
function pkgsFormatter() {
var sum = 0;
$.each(ctrnData, function (idx, obj) {
sum += parseInt(obj.PKGS)
})
if (isNaN(sum)) {
return ''
}
return sum
}
function kgsFormatter() {
var sum = 0;
$.each(ctrnData, function (idx, obj) {
sum += parseFloat(obj.KGS)
})
if (isNaN(sum)) {
return ''
}
return sum
}
function cbmFormatter() {
var sum = 0;
$.each(ctrnData, function (idx, obj) {
sum += parseFloat(obj.CBM)
})
if (isNaN(sum)) {
return ''
}
return sum
}
function wkgsFormatter() {
var sum = 0;
$.each(ctrnData, function (idx, obj) {
sum += parseFloat(obj.WEIGHKGS)
})
if (isNaN(sum)) {
return ''
}
return sum
}
var lastIndex
function closeLayer() {
layer.close(lastIndex)
}
</script>
@if (Model.BSSTATUS != OrderConfirmStatus.Create.ToString() && Model.BSSTATUS != OrderConfirmStatus.Reject.ToString())
{
<script>
$(function () {
$("input,select,textarea").prop("readonly", "readonly").prop("disabled", "disabled");
$("#ctrn-btn-group").hide();
})
</script>
}
}