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/Shipping.cshtml

1684 lines
79 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

@using BookingJieFeng.Models
@model ShippingEditViewModel
@{
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 seleteItemsChuandai = new List<SelectListItem>();
var strarr = new string[] { "外代", "中远", "外运", "海丰", "联代", "振华", "中创", "青港", "华港" };
seleteItemsChuandai.Add(new SelectListItem() { Value = "", Text = "" });
foreach (var s in strarr)
{
seleteItemsChuandai.Add(new SelectListItem() { Value = s, Text = s });
}
var seleteItemsTemp = new List<SelectListItem>();
seleteItemsTemp.Add(new SelectListItem() { Value = "C", Text = "C摄氏度" });
seleteItemsTemp.Add(new SelectListItem() { Value = "F", Text = "F华氏度" });
}
<div class="top-navigation">
<div class="row">
<nav class="navbar">
<div class="navbar-collapse navbar-bottom collapse">
<ul class="nav navbar-nav orderlist-nav">
@if (Model.BSSTATUS == ShippingStatus.Create.ToString())
{
<li><a id="btnSave"><i></i>保存</a><span></span></li>
<li><a id="btnSubmit"><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>
}
@if (!string.IsNullOrEmpty(Model.SHIPPINGNO))
{
<li><a class="tabs" data-url="@Url.Action("ShippingCopy")?shipid=@Model.SHIPPINGNO" data-title="复制舱单"><i></i>复制新建</a><span></span></li>
if (!Model.SUB_FLAG)
{
<li><a class="tabs" data-url="@Url.Action("ShippingCopy")?subFlag=True&shipid=@Model.SHIPPINGNO" data-title="生成分单"><i></i>生成分单</a><span></span></li>
}
else
{
<li><a class="disabled"><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>
}
@*@if (Model.BSSTATUS == ShippingStatus.Create.ToString())
{
<li><a id="btnSaveTemplate"><i></i>存为模板</a><span></span></li>
<li><a id="btnLoadTemplate"><i></i>引入模板</a><span></span></li>
}
else if (Model.BSSTATUS == ShippingStatus.Submit.ToString())
{
<li><a class="disabled"><i></i>存为模板</a><span></span></li>
<li><a class="disabled"><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>
}*@
</ul>
</div>
</nav>
</div>
</div>
<div class="wrapper-content J_mainContent gray-bg-right">
<form class="form-horizontal clearfix" id="formEdit">
@Html.HiddenFor(m => m.SHIPPINGNO)
@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)
@Html.HiddenFor(m => m.SUB_FLAG)
<div class="row row-margin row-bg">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>基本信息</h5>
</div>
<div class="ibox-content">
<div class="form-group col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-3 col-md-3 control-label">主提单号:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.MBLNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-3 col-md-3 control-label">分提单号:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.HBLNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-3 col-md-3 control-label">船公司:</label>
<div class="col-lg-8 col-md-8">
<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 col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-3 col-md-3 control-label">ETD</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.ETD, new { @class = "form-control", autocomplete = "off" })
</div>
</div>
<div class="form-group col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-3 col-md-3 control-label">船名:</label>
<div class="col-lg-8 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.VESSEL, 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 col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-3 col-md-3 control-label">航次:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.VOYNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-3 col-md-3 control-label">船舶呼号:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.VESSELID, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-3 col-md-3 control-label">船代:</label>
<div class="col-lg-8 col-md-8">
@Html.DropDownListFor(m => m.CHUANDAI, seleteItemsChuandai, new { @class = "select form-control" })
</div>
</div>
<div class="form-group col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-3 col-md-3 control-label">发送状态:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.SENDSTATUS, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
</div>
</div>
</div>
<div class="row row-bg">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>发货人信息</h5>
</div>
<div class="ibox-content">
<div class="lg-4 col-lg-4 col-md-4 col-sm-12">
<div class="form-group col-lg-10 col-md-10 select-template">
<label class="col-lg-4 col-md-4 control-label">选择模板:</label>
<div class="col-lg-7 col-md-7">
<select class="select form-control" id="selShipperTemplate"></select>
</div>
</div>
<div class="save-template">
<a id="btnShipperTemplateSave">保存模板</a>
</div>
<div class="clearfix"></div>
<div class="form-group">
<label class="col-lg-3 col-md-3 control-label">发货人:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.SHIPPERNAME, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
<label class="col-lg-3 col-md-3 control-label">地址:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.SHIPPERADDR1, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
<label class="col-lg-3 col-md-3 control-label">国家:</label>
<div class="col-lg-8 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.SHIPPERCOUNTRY, 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">
<label class="col-lg-3 col-md-3 control-label">电话:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.SHIPPERTEL, new { @class = "form-control" })
</div>
</div>
</div>
<div class="lg-4 col-lg-4 col-md-4 col-sm-12">
<div class="form-group col-lg-10 col-md-10 select-template">
<label class="col-lg-4 col-md-4 control-label">选择模板:</label>
<div class="col-lg-7 col-md-7">
<select class="select form-control" id="selConsigneeTemplate"></select>
</div>
</div>
<div class="save-template">
<a id="btnConsigneeTemplateSave">保存模板</a>
</div>
<div class="clearfix"></div>
<div class="form-group">
<label class="col-lg-3 col-md-3 control-label">收货人:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.CONSIGNEENAME, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
<label class="col-lg-3 col-md-3 control-label">地址:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.CONSIGNEEADDR1, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
<label class="col-lg-3 col-md-3 control-label">国家:</label>
<div class="col-lg-8 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.CONSIGNEERCOUNTRY, 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">
<label class="col-lg-3 col-md-3 control-label">电话:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.CONSIGNEETEL, new { @class = "form-control" })
</div>
</div>
</div>
<div class="lg-4 col-lg-4 col-md-4 col-sm-12">
<div class="form-group col-lg-10 col-md-10 select-template">
<label class="col-lg-4 col-md-4 control-label">选择模板:</label>
<div class="col-lg-7 col-md-7">
<select class="select form-control" id="selNotifyTemplate"></select>
</div>
</div>
<div class="save-template">
<a id="btnNotifyTemplateSave">保存模板</a>
</div>
<div class="clearfix"></div>
<div class="form-group">
<label class="col-lg-3 col-md-3 control-label">通知人:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.NOTIFYPARTYNAME, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
<label class="col-lg-3 col-md-3 control-label">地址:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.NOTIFYPARTYADDR1, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
<label class="col-lg-3 col-md-3 control-label">国家:</label>
<div class="col-lg-8 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.NOTIFYPARTYCOUNTRY, 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">
<label class="col-lg-3 col-md-3 control-label">电话:</label>
<div class="col-lg-8 col-md-8">
@Html.TextBoxFor(m => m.NOTIFYPARTYTEL, new { @class = "form-control" })
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row row-bg">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>港口信息</h5>
</div>
<div class="ibox-content">
<div class="form-group col-lg-6 col-md-6">
<label class="col-lg-2 col-md-2 control-label">装货港:</label>
<div class="col-lg-5 col-md-5">
<div class="input-group">
@Html.TextBoxFor(m => m.PORTLOADID, 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 class="col-lg-4 col-md-3">
@Html.TextBoxFor(m => m.PORTLOAD, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6">
<label class="col-lg-2 col-md-2 control-label">卸货港:</label>
<div class="col-lg-5 col-md-5">
<div class="input-group">
@Html.TextBoxFor(m => m.PORTDISCHARGEID, 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 class="col-lg-4 col-md-4">
@Html.TextBoxFor(m => m.PORTDISCHARGE, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6">
<label class="col-lg-2 col-md-2 control-label">收货地:</label>
<div class="col-lg-5 col-md-5">
<div class="input-group">
@Html.TextBoxFor(m => m.PLACERECEIPTID, 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 class="col-lg-4 col-md-4">
@Html.TextBoxFor(m => m.PLACERECEIPT, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6">
<label class="col-lg-2 col-md-2 control-label">目的地:</label>
<div class="col-lg-5 col-md-5">
<div class="input-group">
@Html.TextBoxFor(m => m.DESTINATIONID, 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 class="col-lg-4 col-md-4">
@Html.TextBoxFor(m => m.DESTINATION, new { @class = "form-control" })
</div>
</div>
</div>
</div>
</div>
<div class="row row-bottom row-bg">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>货物信息</h5>
</div>
<div class="ibox-content">
<div class="lg-12 col-lg-4 col-md-4">
<div class="ibox float-e-margins">
<div class="form-group">
<label class="control-label">唛头:</label>
@Html.TextAreaFor(m => m.MARKS, new { @class = "form-control", rows = "5" })
</div>
<div class="form-group">
<label class="control-label">货物描述:</label>
@Html.TextAreaFor(m => m.DESCRIPTION, new { @class = "form-control", rows = "5" })
</div>
</div>
</div>
<div class="lg-12 lg-m-20 col-lg-8 col-md-8 m-35">
<div class="form-group col-lg-6 col-md-6">
<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-6 col-md-6">
<label class="col-lg-4 col-md-4 control-label">总件数:</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.PKGS, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6">
<label class="col-lg-4 col-md-4 control-label">包装:</label>
<div class="col-lg-7 col-md-7" style="margin-bottom:-5px;">
<div class="input-group">
@Html.TextBoxFor(m => m.KINDPKGS, 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 col-lg-6 col-md-6">
<label class="col-lg-4 col-md-4 control-label">总重量:</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.KGS, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6">
<label class="col-lg-4 col-md-4 control-label">总尺码:</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.CBM, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6">
<label class="col-lg-4 col-md-4 control-label">箱型箱量:</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.CNTRTOTAL, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6">
<label class="col-lg-4 col-md-4 control-label">运输条款:</label>
<div class="col-lg-7 col-md-7">
<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 class="form-group col-lg-6 col-md-6">
<label class="col-lg-4 col-md-4 control-label">付费方式:</label>
<div class="col-lg-7 col-md-7">
<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 col-lg-6 col-md-6">
<label class="col-lg-4 col-md-4 control-label">签单地点:</label>
<div class="col-lg-7 col-md-7">
<div class="input-group">
@Html.TextBoxFor(m => m.ISSUEPLACE, 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 col-lg-6 col-md-6 hdn-temp">
<label class="col-lg-4 col-md-4 control-label">温度:</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.TEMPSET, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6 hdn-temp">
<label class="col-lg-4 col-md-4 control-label">温度单位:</label>
<div class="col-lg-7 col-md-7">
@Html.DropDownListFor(m => m.TEMPID, seleteItemsTemp, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6 hdn-temp">
<label class="col-lg-4 col-md-4 control-label">通风:</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.REEFERF, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6 hdn-danger">
<label class="col-lg-4 col-md-4 control-label">CLASS</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.DCLASS, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6 hdn-danger">
<label class="col-lg-4 col-md-4 control-label">UN NO</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.DUNNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6 hdn-danger">
<label class="col-lg-4 col-md-4 control-label">联系人:</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.LINKMAN, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-6 col-md-6 hdn-danger">
<label class="col-lg-4 col-md-4 control-label">联系电话:</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.LINKMAN_TEL, new { @class = "form-control" })
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row-b"></div>
<div class="row row-bg">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title -left15">
<h5>集装箱信息</h5>
</div>
<div class="navbar-i" id="ctrn-btn-group">
<a class="ctrn-add-new">增加</a>
<a class="ctrn-del">删除</a>
<a class="ctrn-yard-data">引入场站数据</a>
<a class="ctrn-excel-data">引入EXCEL数据</a>
<a style="background:none;color:#33a3dc;" href="@Url.Content("/Content/ShippingCtrnTemplate.xlsx")"><i class="glyphicon glyphicon-arrow-down"></i>下载模板</a>
</div>
</div>
<table id="ctrnTable" class="table">
<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">件数</th>
<th data-field="KINDPKGS">包装</th>
<th data-field="KGS">重量</th>
<th data-field="CBM">尺码</th>
</tr>
</thead>
</table>
</div>
</div>
</form>
</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" style="clear:both;height:225px;overflow:unset;">
<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">重量</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">尺码</label>
<input type="text" class="form-control" id="modelCtrnCBM" name="CBM">
</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">保存模板</h4>
</div>
<div class="modal-body">
<form id="formTemp" class="form-horizontal">
<div class="form-group">
<label for="message-text" class="control-label">模板名称</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">关闭</button>
<button type="button" class="btn btn-primary" id="tempModelBtnSave">保存</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">引入模板</h4>
</div>
<div class="modal-body">
<form id="formLoadTemp" class="form-horizontal">
<div class="form-group">
<label for="message-text" class="control-label">模板名称</label>
<select class="form-control select" 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">关闭</button>
<button type="button" class="btn btn-primary" id="loadTempModelBtn">确定</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-labelledby="importModalLabel">
<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="importModalLabel">导入数据</h4>
</div>
<div class="modal-body">
<form id="formImportShipping" class="form-horizontal" method="post" enctype="multipart/form-data" action="@Url.Action("CtrnFromExcel")">
<div class="form-group">
<label for="message-text" class="control-label">选择文件</label>
<input type="file" class="form-control" id="modalImportFile" name="file">
</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="importModalBtnOk">导入</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="sftModal" tabindex="-1" role="dialog" aria-labelledby="sftModalLabel">
<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="sftModalLabel">保存模板</h4>
</div>
<div class="modal-body">
<form id="formTemp" class="form-horizontal">
<input type="hidden" id="sftModalHdnType">
<div class="form-group">
<label for="message-text" class="control-label">模板名称</label>
<input type="text" class="form-control" id="sftModalTempName">
</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="sftModalBtnSave">保存</button>
</div>
</div>
</div>
</div>
@section styles
{
<link type="text/css" rel="stylesheet" href="~/Content/css/shipping.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">
/*判断input是否可用
$(document).ready(function () {
$("input").each(function () {
if ($(this).attr("readonly") == "readonly") {
$("input").addClass("except");
$(".except").next(".input-group-btn").css("display", "none");
$(".date .input-group-addon").css("display", "none");
}
})
})*/
</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 arrTemplateShipper, arrTemplateConsignee, arrTemplateNotify;
$(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"
}
});
//包装
$("#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);
}
});
//目的地
$("#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);
});
//国家
$("#SHIPPERCOUNTRY").bsSuggest({
url: "@Url.Action("SuggestCountry", "Common")?keyword=",
idField: "CODE",
keyField: "CODE",
getDataMethod: 'url',
clearable: true
});
$("#CONSIGNEERCOUNTRY").bsSuggest({
url: "@Url.Action("SuggestCountry", "Common")?keyword=",
idField: "CODE",
keyField: "CODE",
getDataMethod: 'url',
clearable: true
});
$("#NOTIFYPARTYCOUNTRY").bsSuggest({
url: "@Url.Action("SuggestCountry", "Common")?keyword=",
idField: "CODE",
keyField: "CODE",
getDataMethod: 'url',
clearable: true
});
//船名
$("#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);
});
//船公司
$("#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);
});
//运输条款
$("#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);
});
//付费方式
$("#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);
});
//签单地点
$("#ISSUEPLACE").bsSuggest({
url: "@Url.Action("SuggestDisport", "Common")?keyword=",
idField: "PORT",
keyField: "EDICODE",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//保存
$("#btnSave").click(function () {
saveOrSubmit(false)
});
//提交
$("#btnSubmit").click(function () {
saveOrSubmit(true);
});
//集装箱信息
$("#ctrnTable").bootstrapTable({ "showFooter": true })
$("#ctrnTable").bootstrapTable('load', ctrnData)
//集装箱新增删除
var ctrnTypeIsChoose = false;
$("#modelCtrnType").bsSuggest({
url: "@Url.Action("SuggestCTN", "Common")?keyword=",
idField: "CTNID",
keyField: "CTN",
getDataMethod: 'url',
effectiveFields: ["CTN"]
}).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("");
}
});
//删除集装箱信息
$("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)
}
});
//双击编辑集装箱
$("#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);
})
//保存集装箱
$("#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);
});
//货物类型
$("#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();
$("#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"
});
//模板
$("#btnSaveTemplate").click(function () {
$("#tempModel").modal('show')
$("#modelTempName").val('');
});
$("#tempModelBtnSave").click(function () {
if ($("#formTemp").valid()) {
var obj = getEditJson();
var tempObj = {
NAME: $("#modelTempName").val(),
CATE: '@TemplateCate.Shipping.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('');
//$(parent.document).find('.J_menuTab.active i').click()
});
$.ajax({
method: 'GET',
url: '@Url.Action("GetTemplates", "Template")?cate=@TemplateCate.Shipping.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')
})
//引入场站数据
$("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);
}
})
});
jQuery.validator.addMethod("hblnoRequire", function (value, element) {
if ($('#SUB_FLAG').val() == 'True') {
if (value == null || value == undefined || value.length == 0) {
return false
}
}
return true
}, "分单的分提单号不能为空");
//导入箱
$("a.ctrn-excel-data").click(function () {
$("#importModal").modal('show')
})
$("#importModalBtnOk").click(function () {
if ($("#modalImportFile").val().length == 0) {
layer.alert('请选择要上传的文件');
return
}
$("#formImportShipping").ajaxSubmit({
success: function (data) {
if (data.Success) {
updateCtrnData(data.List);
}
$("#modalImportFile").val('')
$("#importModal").modal('hide')
}
})
})
//收发通模板
$("#selShipperTemplate").change(function () {
var v = $("#selShipperTemplate").val();
$(arrTemplateShipper).each(function (i, obj) {
if (obj.NAME == v) {
var obj = JSON.parse(obj.CONTENT)
$("#SHIPPERNAME").val(obj.SHIPPERNAME)
$("#SHIPPERADDR1").val(obj.SHIPPERADDR1)
$("#SHIPPERCOUNTRY").val(obj.SHIPPERCOUNTRY)
$("#SHIPPERTEL").val(obj.SHIPPERTEL)
return true;
}
})
$("#selShipperTemplate").val('');
})
$("#selConsigneeTemplate").change(function () {
var v = $("#selConsigneeTemplate").val();
$(arrTemplateConsignee).each(function (i, obj) {
if (obj.NAME == v) {
var obj = JSON.parse(obj.CONTENT)
$("#CONSIGNEENAME").val(obj.CONSIGNEENAME)
$("#CONSIGNEEADDR1").val(obj.CONSIGNEEADDR1)
$("#CONSIGNEERCOUNTRY").val(obj.CONSIGNEERCOUNTRY)
$("#CONSIGNEETEL").val(obj.CONSIGNEETEL)
return true;
}
})
$("#selConsigneeTemplate").val('');
})
$("#selNotifyTemplate").change(function () {
var v = $("#selNotifyTemplate").val();
$(arrTemplateNotify).each(function (i, obj) {
if (obj.NAME == v) {
var obj = JSON.parse(obj.CONTENT)
$("#NOTIFYPARTYNAME").val(obj.NOTIFYPARTYNAME)
$("#NOTIFYPARTYADDR1").val(obj.NOTIFYPARTYADDR1)
$("#NOTIFYPARTYCOUNTRY").val(obj.NOTIFYPARTYCOUNTRY)
$("#NOTIFYPARTYTEL").val(obj.NOTIFYPARTYTEL)
return true;
}
})
$("#selNotifyTemplate").val('');
})
$("#btnShipperTemplateSave").click(function () {
$("#sftModal").modal('show')
$("#sftModalHdnType").val('shipper')
$("#sftModalTempName").val('')
})
$("#btnConsigneeTemplateSave").click(function () {
$("#sftModal").modal('show')
$("#sftModalHdnType").val('consignee')
$("#sftModalTempName").val('')
})
$("#btnNotifyTemplateSave").click(function () {
$("#sftModal").modal('show')
$("#sftModalHdnType").val('notify')
$("#sftModalTempName").val('')
})
$("#sftModalBtnSave").click(function () {
var tempObj = {}
if ($("#sftModalHdnType").val() == 'shipper') {
var obj = {}
obj.SHIPPERNAME = $("#SHIPPERNAME").val()
obj.SHIPPERADDR1 = $("#SHIPPERADDR1").val()
obj.SHIPPERCOUNTRY = $("#SHIPPERCOUNTRY").val()
obj.SHIPPERTEL = $("#SHIPPERTEL").val()
tempObj.NAME = $("#sftModalTempName").val()
tempObj.CATE = '@TemplateCate.ShippingShipper'
tempObj.CONTENT = JSON.stringify(obj)
} else if ($("#sftModalHdnType").val() == 'consignee') {
var obj = {}
obj.CONSIGNEENAME = $("#CONSIGNEENAME").val()
obj.CONSIGNEEADDR1 = $("#CONSIGNEEADDR1").val()
obj.CONSIGNEERCOUNTRY = $("#CONSIGNEERCOUNTRY").val()
obj.CONSIGNEETEL = $("#CONSIGNEETEL").val()
tempObj.NAME= $("#sftModalTempName").val()
tempObj.CATE = '@TemplateCate.ShippingConsignee'
tempObj.CONTENT= JSON.stringify(obj)
} else if ($("#sftModalHdnType").val() == 'notify') {
var obj = {}
obj.NOTIFYPARTYNAME = $("#NOTIFYPARTYNAME").val()
obj.NOTIFYPARTYADDR1 = $("#NOTIFYPARTYADDR1").val()
obj.NOTIFYPARTYCOUNTRY = $("#NOTIFYPARTYCOUNTRY").val()
obj.NOTIFYPARTYTEL = $("#NOTIFYPARTYTEL").val()
tempObj.NAME= $("#sftModalTempName").val()
tempObj.CATE = '@TemplateCate.ShippingNotify'
tempObj.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)
$("#sftModal").modal('hide')
}
})
if ($("#sftModalHdnType").val() == 'shipper') {
loadTemplateShipper();
} else if ($("#sftModalHdnType").val() == 'consignee') {
loadTemplateConsignee();
} else if ($("#sftModalHdnType").val() == 'notify') {
loadTemplateNotify();
}
})
loadTemplateShipper();
loadTemplateConsignee();
loadTemplateNotify();
});
function loadTemplateShipper() {
$.ajax({
method: 'GET',
url: '@Url.Action("GetTemplates", "Template")?cate=@TemplateCate.ShippingShipper',
dataType: 'json',
success: function (data) {
console.log(data)
$("#selShipperTemplate").empty()
$("#selShipperTemplate").append('<option value=""></option>')
for (var idx in data) {
$("#selShipperTemplate").append('<option value="' + data[idx].NAME + '">' + data[idx].NAME + '</option>')
}
arrTemplateShipper = data;
}
})
}
function loadTemplateConsignee() {
$.ajax({
method: 'GET',
url: '@Url.Action("GetTemplates", "Template")?cate=@TemplateCate.ShippingConsignee',
dataType: 'json',
success: function (data) {
console.log(data)
$("#selConsigneeTemplate").empty()
$("#selConsigneeTemplate").append('<option value=""></option>')
for (var idx in data) {
$("#selConsigneeTemplate").append('<option value="' + data[idx].NAME + '">' + data[idx].NAME + '</option>')
}
arrTemplateConsignee = data;
}
})
}
function loadTemplateNotify() {
$.ajax({
method: 'GET',
url: '@Url.Action("GetTemplates", "Template")?cate=@TemplateCate.ShippingNotify',
dataType: 'json',
success: function (data) {
console.log(data)
$("#selNotifyTemplate").empty()
$("#selNotifyTemplate").append('<option value=""></option>')
for (var idx in data) {
$("#selNotifyTemplate").append('<option value="' + data[idx].NAME + '">' + data[idx].NAME + '</option>')
}
arrTemplateNotify = data;
}
})
}
function saveOrSubmit(submit) {
if (submit) {
validSubmit();
$("#BSSTATUS").val('@ShippingStatus.Submit');
if (!$("#formEdit").valid()) {
layer.alert('有必填项未填,无法提交')
return;
}
if (ctrnData.length == 0) {
layer.alert('请录入箱信息')
return;
}
} else {
validSave();
if (!$("#formEdit").valid()) {
layer.alert('有必填项未填,无法保存')
return;
}
$("#BSSTATUS").val('@ShippingStatus.Create');
}
var obj = getEditJson();
$.ajax({
method: 'POST',
url: '@Url.Action("ShippingSave")',
dataType: 'json',
data: JSON.stringify(obj),
contentType: "application/json",
success: function (data) {
if (data.Success) {
layer.alert(data.Message, function () {
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: {
MBLNO: "required",
ETD: "required",
CARRIER: "required",
VESSEL: "required",
VOYNO: "required",
CHUANDAI: "required",
SHIPPERNAME: "required",
SHIPPERADDR1: "required",
SHIPPERCOUNTRY: "required",
SHIPPERTEL: "required",
CONSIGNEENAME: "required",
CONSIGNEEADDR1: "required",
CONSIGNEERCOUNTRY: "required",
CONSIGNEETEL: "required",
NOTIFYPARTYNAME: "required",
NOTIFYPARTYADDR1: "required",
NOTIFYPARTYCOUNTRY: "required",
NOTIFYPARTYTEL: "required",
PLACERECEIPTID: "required",
DESTINATIONID: "required",
SHIPPER: "required",
CONSIGNEE: "required",
NOTIFYPARTY: "required",
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",
HBLNO: {
hblnoRequire:true
}
},
messages: {
ETD: errIcon + "@Resources.LangOrder.ValidInputETD",
SHIPPER: errIcon + "@Resources.LangOrder.ValidInputSHIPPER",
CONSIGNEE: errIcon + "@Resources.LangOrder.ValidInputCONSIGNEE",
NOTIFYPARTY: errIcon + "@Resources.LangOrder.ValidInputNOTIFYPARTY",
MARKS:errIcon+"@Resources.LangOrder.ValidInputMARKS",
DESCRIPTION:errIcon+"@Resources.LangOrder.ValidInputDESCRIPTION",
PKGS: {
required: errIcon + "@Resources.LangOrder.ValidInputPKGS",
digits: errIcon + "@Resources.LangAll.ValidMustInteger"
},
KGS: {
required: errIcon+"@Resources.LangOrder.ValidInputKGS",
number: errIcon + '@Resources.LangAll.ValidMustNumber'
},
KINDPKGS: errIcon + "@Resources.LangOrder.ValidInputKINDPKGS",
CBM: {
required: errIcon+"@Resources.LangOrder.ValidInputCBM",
number: errIcon + '@Resources.LangAll.ValidMustNumber'
},
PORTLOADID:errIcon+"@Resources.LangOrder.ValidInputPORTLOADID",
PORTDISCHARGEID:errIcon+"@Resources.LangOrder.ValidInputPORTDISCHARGEID",
PLACEDELIVERYID: errIcon + "@Resources.LangOrder.ValidInputPLACEDELIVERY",
MBLNO: errIcon + "主提单号不能为空",
CARRIER: errIcon + "船公司不能为空",
VESSEL: errIcon + "船名不能为空",
VOYNO: errIcon + "航次不能为空",
CHUANDAI: errIcon + "船代不能为空",
SHIPPERNAME: errIcon + "发货人不能为空",
SHIPPERADDR1: errIcon + "发货人地址不能为空",
SHIPPERCOUNTRY: errIcon + "发货人国家不能为空",
SHIPPERTEL: errIcon + "发货人不能为空",
CONSIGNEENAME: errIcon + "收货人不能为空",
CONSIGNEEADDR1: errIcon + "收货人地址不能为空",
CONSIGNEERCOUNTRY: errIcon + "收货人国家不能为空",
CONSIGNEETEL: errIcon + "收货人电话不能为空",
NOTIFYPARTYNAME: errIcon + "通知人不能为空",
NOTIFYPARTYADDR1: errIcon + "通知人地址不能为空",
NOTIFYPARTYCOUNTRY: errIcon + "通知人国家不能为空",
NOTIFYPARTYTEL: errIcon + "通知人电话不能为空",
PLACERECEIPTID: errIcon + "请选择收货地",
DESTINATIONID: errIcon + "请选择目的地",
}
});
}
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)
}
</script>
@if (Model.BSSTATUS != ShippingStatus.Create.ToString())
{
<script>
$(function () {
$("input,select,textarea").prop("readonly", "readonly").prop("disabled", "disabled");
$("#ctrn-btn-group").hide();
})
</script>
}
}