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.

1502 lines
83 KiB
Plaintext

10 months ago
@using BookingWeb.Models
@model OrderEditViewModel
@{
var seleteItemsCARGO = new List<SelectListItem>();
seleteItemsCARGO.Add(new SelectListItem() { Value = "S", Text = Resources.LangOrder.SelectCARGOID_S });
seleteItemsCARGO.Add(new SelectListItem() { Value = "R", Text = Resources.LangOrder.SelectCARGOID_R });
seleteItemsCARGO.Add(new SelectListItem() { Value = "D", Text = Resources.LangOrder.SelectCARGOID_D });
seleteItemsCARGO.Add(new SelectListItem() { Value = "O", Text = Resources.LangOrder.SelectCARGOID_O });
string[] arrNum = new string[] { "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN" };
var selectItemsNum = new List<SelectListItem>();
foreach (var n in arrNum)
{
selectItemsNum.Add(new SelectListItem() { Value = n, Text = n });
}
var seleteItemsTRANSTYPE = new List<SelectListItem>();
seleteItemsTRANSTYPE.Add(new SelectListItem() { Value = "海运", Text = Resources.LangOrder.SelectTRANSTYPE_S});
seleteItemsTRANSTYPE.Add(new SelectListItem() { Value = "海铁联运", Text = Resources.LangOrder.SelectTRANSTYPE_SR });
}
<div class="top-navigation">
<div id="wrapper">
<div class="gray-bg">
<div class="row border-bottom white-bg nav-fixed">
<nav class="navbar navbar-static-top" role="navigation">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav order-nav">
@if (Model.BSSTATUS == OrderStatus.Create.ToString())
{
<li>
<a aria-expanded="false" role="button" href="#" id="btnLoadTemplate"><i class="fa fa-paste"></i>@Resources.LangOrder.TopBtnLoadTemplate</a>
</li>
<li>
<a aria-expanded="false" role="button" href="#" id="btnSaveTemplate"><i class="fa fa-file-o"></i>@Resources.LangOrder.TopBtnSaveTemplate</a>
</li>
}
else
{
<li>
<a aria-expanded="false" role="button" href="#" class="disabled"><i class="fa fa-paste"></i>@Resources.LangOrder.TopBtnLoadTemplate</a>
</li>
<li>
<a aria-expanded="false" role="button" href="#" class="disabled"><i class="fa fa-file-o"></i>@Resources.LangOrder.TopBtnSaveTemplate</a>
</li>
}
<li>
<a aria-expanded="false" role="button" class="tabs" data-url="@Url.Action("Order")" data-title="@Resources.LangOrder.BtnNew"><i class="fa fa-plus"></i>@Resources.LangAll.BtnCreate</a>
</li>
@if (Model.BSSTATUS == OrderStatus.Create.ToString() || Model.BSSTATUS == OrderStatus.Back.ToString())
{
<li>
<a aria-expanded="false" role="button" href="#" id="btnSave"><i class="fa fa-save"></i>@Resources.LangAll.BtnSave</a>
</li>
<li>
<a aria-expanded="false" role="button" href="#" id="btnSubmit"><i class="fa fa-check-circle"></i>@Resources.LangAll.BtnSubmit</a>
</li>
if (string.IsNullOrEmpty(Model.ORDNO))
{
<li>
<a aria-expanded="false" role="button" href="#" class="disabled"><i class="fa fa-trash"></i>@Resources.LangAll.BtnDel</a>
</li>
}
else
{
<li>
<a aria-expanded="false" role="button" href="#" id="btnDelete"><i class="fa fa-trash"></i>@Resources.LangAll.BtnDel</a>
</li>
}
}
else
{
<li>
<a aria-expanded="false" role="button" href="#" class="disabled"><i class="fa fa-save"></i>@Resources.LangAll.BtnSave</a>
</li>
<li>
<a aria-expanded="false" role="button" href="#" class="disabled"><i class="fa fa-check-circle"></i>@Resources.LangAll.BtnSubmit</a>
</li>
<li>
<a aria-expanded="false" role="button" href="#" class="disabled"><i class="fa fa-trash"></i>@Resources.LangAll.BtnDel</a>
</li>
}
@if (Model.BSSTATUS == OrderStatus.Submit.ToString())
{
<li>
<a aria-expanded="false" role="button" href="#" id="btnCancel"><i class="fa fa-remove"></i>@Resources.LangOrder.TopBtnCancel</a>
</li>
}
else
{
<li>
<a aria-expanded="false" role="button" href="#" class="disabled"><i class="fa fa-remove"></i>@Resources.LangOrder.TopBtnCancel</a>
</li>
}
@if (ViewBag.ShowConfirmBtn != null && ViewBag.ShowConfirmBtn)
{
<li>
<a aria-expanded="false" role="button" href="#" class="tabs" data-url="@Url.Action("Confirm")?ordno=@Model.ORDNO" data-title="@Model.MBLNO @Resources.LangAll.LinkTitleConfirm"><i class="fa fa-remove"></i>@Resources.LangOrder.TopBtnConfirm</a>
</li>
}
else
{
<li>
<a aria-expanded="false" role="button" href="#" class="disabled"><i class="fa fa-remove"></i>@Resources.LangOrder.TopBtnConfirm</a>
</li>
}
@if (ViewBag.RemainTimeClosing != null)
{
<li>
<a style="color:#ff0000 !important;background:none !important;border:none !important">@ViewBag.RemainTimeClosing (@ViewBag.CLOSEDOCDATE)</a>
</li>
}
</ul>
</div>
</nav>
</div>
<div class="wrapper wrapper-content">
<div class="state">
<div class="row">
<div class="col-lg-2 col-md-2">
<div class="img @(ViewBag.StaOrderSave!=null&&ViewBag.StaOrderSave?"active":"")"></div>
<label>@Resources.LangOrder.StatusLogOrderSave</label>
<span class="circle @(ViewBag.StaOrderSave!=null&&ViewBag.StaOrderSave?"active":"")">1</span>
<div class="state-b @(ViewBag.StaOrderSave!=null&&ViewBag.StaOrderSave?"active":"")"></div>
<div class="time">@ViewBag.StaOrderSaveTime</div>
</div>
<div class="col-lg-2 col-md-2">
<div class="img @(ViewBag.StaOrderSubmit!=null&&ViewBag.StaOrderSubmit?"active":"")"></div>
<label>@Resources.LangOrder.StatusLogOrderSubmit</label>
<span class="circle @(ViewBag.StaOrderSubmit!=null&&ViewBag.StaOrderSubmit?"active":"")">2</span>
<div class="state-b @(ViewBag.StaOrderSubmit!=null&&ViewBag.StaOrderSubmit?"active":"")"></div>
<div class="time">@ViewBag.StaOrderSubmitTime</div>
</div>
<div class="col-lg-2 col-md-2">
<div class="img @(ViewBag.StaOrderConfirm!=null&&ViewBag.StaOrderConfirm?"active":"")"></div>
<label>@Resources.LangOrder.StatusLogOrderConfirm</label>
<span class="circle @(ViewBag.StaOrderConfirm!=null&&ViewBag.StaOrderConfirm?"active":"")">3</span>
<div class="state-b @(ViewBag.StaOrderConfirm!=null&&ViewBag.StaOrderConfirm?"active":"")"></div>
<div class="time">@ViewBag.StaOrderConfirmTime</div>
</div>
<div class="col-lg-2 col-md-2">
<div class="img @(ViewBag.StaConfirmSave!=null&&ViewBag.StaConfirmSave?"active":"")"></div>
<label>@Resources.LangOrder.StatusLogConfirmSave</label>
<span class="circle @(ViewBag.StaConfirmSave!=null&&ViewBag.StaConfirmSave?"active":"")">4</span>
<div class="state-b @(ViewBag.StaConfirmSave!=null&&ViewBag.StaConfirmSave?"active":"")"></div>
<div class="time">@ViewBag.StaConfirmSaveTime</div>
</div>
<div class="col-lg-2 col-md-2">
<div class="img @(ViewBag.StaConfirmSubmit!=null&&ViewBag.StaConfirmSubmit?"active":"")"></div>
<label>@Resources.LangOrder.StatusLogConfirmSubmit</label>
<span class="circle @(ViewBag.StaConfirmSubmit!=null&&ViewBag.StaConfirmSubmit?"active":"")">5</span>
<div class="state-b @(ViewBag.StaConfirmSubmit!=null&&ViewBag.StaConfirmSubmit?"active":"")"></div>
<div class="time">@ViewBag.StaConfirmSubmitTime</div>
</div>
<div class="col-lg-2 col-md-2">
<div class="img @(ViewBag.StaConfirmConfirm!=null&&ViewBag.StaConfirmConfirm?"active":"")"></div>
<label>@Resources.LangOrder.StatusLogConfirmConfirm</label>
<span class="circle @(ViewBag.StaConfirmConfirm!=null&&ViewBag.StaConfirmConfirm?"active":"")">6</span>
<div class="state-b @(ViewBag.StaConfirmConfirm!=null&&ViewBag.StaConfirmConfirm?"active":"")"></div>
<div class="time">@ViewBag.StaConfirmConfirmTime</div>
</div>
</div>
</div>
<form action="" id="formEdit">
@Html.HiddenFor(m => m.ORDNO)
@Html.HiddenFor(m => m.BSSTATUS)
@Html.HiddenFor(m => m.MODIFYTIME)
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content ibox-left">
<div class="form-horizontal clearfix">
<div class="form-group col-md-3 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelCARRIER</label>
<div class="col-lg-9 col-md-8 col-sm-10">
<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-md-3 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelMBLNO</label>
<div class="col-lg-9 col-md-8 col-sm-10">
@Html.TextBoxFor(m => m.MBLNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-3 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-2 control-label">@Resources.LangOrder.LabelORDERNO</label>
<div class="col-lg-9 col-md-8 col-sm-10">
@Html.TextBoxFor(m => m.ORDERNO, new { @class = "form-control", placeholder = Resources.LangOrder.PHGenAuto, @readonly = "readonly" })
</div>
</div>
<div class="form-group col-md-3 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelCONTRACTNO</label>
<div class="col-lg-9 col-md-8 col-sm-10">
@Html.TextBoxFor(m => m.CONTRACTNO, new { @class = "form-control" })
</div>
</div>
<div class="both"></div>
<div class="form-group col-md-3 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelETD</label>
<div class="col-lg-9 col-md-8 col-sm-10">
<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 col-md-3 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelVESSEL</label>
<div class="col-lg-9 col-md-8 col-sm-10">
<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-md-3 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelVOYNO</label>
<div class="col-lg-9 col-md-8 col-sm-10">
@Html.TextBoxFor(m => m.VOYNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-3 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelYARD</label>
<div class="col-lg-9 col-md-8 col-sm-10">
<div class="input-group">
@Html.TextBoxFor(m => m.YARD, 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>
</div>
</div>
<div class="row m-row">
<div class="form-group col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>@Resources.LangAll.LabelSHIPPER</h5>
<div class="ibox-tools">
<a class="format-text-len" data-len="30">
30
</a>
<a class="format-text-len" data-len="40">
40
</a>
<a class="format-text-len" data-len="50">
50
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-12 m-left">
@Html.TextAreaFor(m => m.SHIPPER, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="div-show-number"></div>
</div>
</div>
</div>
</div>
</div>
<div class="form-group col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>@Resources.LangAll.LabelCONSIGNEE</h5>
<div class="ibox-tools">
<a class="format-text-len" data-len="30">
30
</a>
<a class="format-text-len" data-len="40">
40
</a>
<a class="format-text-len" data-len="50">
50
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-12 m-left">
@Html.TextAreaFor(m => m.CONSIGNEE, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="div-show-number"></div>
</div>
</div>
</div>
</div>
</div>
<div class="form-group col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>@Resources.LangAll.LabelNOTIFYPARTY</h5>
<div class="ibox-tools">
<a class="format-text-len" data-len="30">
30
</a>
<a class="format-text-len" data-len="40">
40
</a>
<a class="format-text-len" data-len="50">
50
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-12 m-left">
@Html.TextAreaFor(m => m.NOTIFYPARTY, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="div-show-number"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>@Resources.LangAll.LabelMARKS</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="form-group col-sm-12 textarea-m">
@Html.TextAreaFor(m => m.MARKS, new { @class = "form-control", rows = "14" })
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>@Resources.LangAll.LabelDESCRIPTION</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="form-group col-sm-12 textarea-m">
@Html.TextAreaFor(m => m.DESCRIPTION, new { @class = "form-control", rows = "14" })
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="ibox float-e-margins">
<div class="ibox-content ibox-left clearfix">
<div class="form-horizontal">
<div class="form-group col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelHSCODE</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.HSCODE, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-6 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelISCONTAINERSOC</label>
<div class="col-lg-8 col-md-8 col-sm-9">
<div class="checkbox m-checkbox whether">
<label>
@Html.CheckBoxFor(m => m.ISCONTAINERSOC)
</label>
</div>
</div>
</div>
<div class="both"></div>
<div class="form-group col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelCARGOID</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.DropDownListFor(m => m.CARGOID, seleteItemsCARGO, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelCNTRTOTAL</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.CNTRTOTAL, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
<div class="both"></div>
<div class="form-group col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelPKGS</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.PKGS, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelKINDPKGS</label>
<div class="col-lg-9 col-md-8 col-sm-9">
<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="both"></div>
<div class="form-group col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelKGS</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.KGS, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelCBM</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.CBM, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelSaleName</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.SALE_NAME, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelTRANSTYPE</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.DropDownListFor(m => m.TRANSTYPE, seleteItemsTRANSTYPE, new { @class = "form-control" })
</div>
</div>
<div class="form-group hdn-temp col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelTEMPSET</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.TEMPSET, new { @class = "form-control" })
</div>
</div>
<div class="form-group hdn-temp col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelTEMPID</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.TEMPID, new { @class = "form-control", maxlength = "1" })
</div>
</div>
<div class="form-group hdn-temp col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelREEFERF</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.REEFERF, new { @class = "form-control" })
</div>
</div>
<div class="form-group hdn-temp col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelHUMIDITY</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.HUMIDITY, new { @class = "form-control" })
</div>
</div>
<div class="form-group hdn-danger col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelDCLASS</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.DCLASS, new { @class = "form-control" })
</div>
</div>
<div class="form-group hdn-danger col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelDUNNO</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.DUNNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group hdn-danger col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelDPAGE</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.DPAGE, new { @class = "form-control" })
</div>
</div>
<div class="form-group hdn-danger col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelDLABEL</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.DLABEL, new { @class = "form-control" })
</div>
</div>
<div class="form-group hdn-danger col-md-6 col-sm-12">
<label class="col-lg-3 col-md-4 col-sm-3 control-label">@Resources.LangAll.LabelLINKMAN</label>
<div class="col-lg-9 col-md-8 col-sm-9">
@Html.TextBoxFor(m => m.LINKMAN, new { @class = "form-control" })
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content ibox-left clearfix">
<div class="form-horizontal">
<div class="form-group col-md-4 col-sm-6">
<label class="col-lg-2 col-md-2 col-sm-2 control-label">@Resources.LangAll.LabelPLACERECEIPT</label>
<div class="col-lg-5 col-md-5 col-sm-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-5 col-md-5 col-sm-5">
@Html.TextBoxFor(m => m.PLACERECEIPT, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-4 col-sm-6">
<label class="col-lg-2 col-md-2 col-sm-2 control-label">@Resources.LangAll.LabelPORTLOAD</label>
<div class="col-lg-5 col-md-5 col-sm-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-5 col-md-5 col-sm-5">
@Html.TextBoxFor(m => m.PORTLOAD, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-4 col-sm-6">
<label class="col-lg-2 col-md-2 col-sm-2 control-label">@Resources.LangAll.LabelPORTDISCHARGE</label>
<div class="col-lg-5 col-md-5 col-sm-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-5 col-md-5 col-sm-5">
@Html.TextBoxFor(m => m.PORTDISCHARGE, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-4 col-sm-6">
<label class="col-lg-2 col-md-2 col-sm-2 control-label">@Resources.LangAll.LabelDESTINATION</label>
<div class="col-lg-5 col-md-5 col-sm-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-5 col-md-5 col-sm-5">
@Html.TextBoxFor(m => m.DESTINATION, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-md-4 col-sm-6">
<label class="col-lg-2 col-md-2 col-sm-2 control-label">@Resources.LangAll.LabelPLACEDELIVERY</label>
<div class="col-lg-5 col-md-5 col-sm-5">
<div class="input-group">
@Html.TextBoxFor(m => m.PLACEDELIVERYID, 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-5 col-md-5 col-sm-5">
@Html.TextBoxFor(m => m.PLACEDELIVERY, new { @class = "form-control" })
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-sm-4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>@Resources.LangAll.LabelCtrnTypeNum</h5>
</div>
<div class="ibox-content">
<div class="row" id="ctrn-btn-group">
<div class="col-sm-12">
<a href="javascript:void(0);" class="btn btn-primary ctrn-add-new"><i class="fa fa-plus"></i>@Resources.LangAll.BtnNew</a>
<a href="javascript:void(0);" class="btn btn-primary ctrn-add-del"><i class="fa fa-trash"></i>@Resources.LangAll.BtnDel</a>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<table id="ctrnTable" data-toggle="table" data-height="250" data-mobile-responsive="true">
<thead>
<tr>
<th data-checkbox="true"></th>
<th data-field="CTNALL">@Resources.LangAll.LabelCtrnType</th>
<th data-field="CTNNUM">@Resources.LangAll.LabelCtrnNum</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-8 col-sm-8">
<div class="ibox float-e-margins">
<div class="ibox-content clearfix">
<div class="form-horizontal">
<div class="form-group col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelISSUETYPE</label>
<div class="col-lg-8 col-md-8 col-sm-10">
<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 col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelSERVICE</label>
<div class="col-lg-8 col-md-8 col-sm-10">
<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-4 col-md-4 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelBLFRT</label>
<div class="col-lg-8 col-md-8 col-sm-10">
<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-4 col-md-4 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelPREPARDAT</label>
<div class="col-lg-8 col-md-8 col-sm-10">
<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 col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelNOBILL</label>
<div class="col-lg-8 col-md-8 col-sm-10">
@Html.DropDownListFor(m => m.NOBILL, selectItemsNum, new { @class = "form-control" })
</div>
</div>
<div class="form-group col-lg-4 col-md-4 col-sm-12">
<label class="col-lg-4 col-md-4 col-sm-2 control-label">@Resources.LangAll.LabelCOPYNOBILLL</label>
<div class="col-lg-8 col-md-8 col-sm-10">
@Html.DropDownListFor(m => m.COPYNOBILLL, selectItemsNum, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-12 col-sm-12">
<div class="ibox-title">
<h5>@Resources.LangAll.LabelSoRemark</h5>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-12">
@Html.TextAreaFor(m => m.EDIREMARK, new { @class = "form-control", rows = "4" })
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="ctrnModel" tabindex="-1" role="dialog" aria-labelledby="ctrnModelLabel">
<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="ctrnModelLabel">@Resources.LangAll.LabelCtrn</h4>
</div>
<div class="modal-body">
<form id="formCtrn" class="form-horizontal">
<div class="form-group">
<label for="recipient-name" class="control-label">@Resources.LangAll.LabelCtrnType</label>
<div class="input-group">
<input type="text" class="form-control form-w" 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">
<label for="message-text" class="control-label">@Resources.LangAll.LabelCtrnNum</label>
<input type="text" class="form-control" id="modelCtrnNum" name="CTNNUM">
</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>
@section styles
{
<link type="text/css" rel="stylesheet" href="~/Content/css/order.css" />
<link type="text/css" rel="stylesheet" href="~/Content/hplus/css/plugins/datapicker/datepicker3.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>
var ctrnData = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model.CtrnList));
var templateData = [];
$(function () {
$("#formCtrn").validate({
rules: {
CTNALL: "required",
CTNNUM: {
required: true,
digits: true
}
},
messages: {
CTNALL: errIcon + "@Resources.LangOrder.ValidInputCtrnType",
CTNNUM: {
required: errIcon + "@Resources.LangOrder.ValidInputCtrnNum",
digits: errIcon + "@Resources.LangAll.ValidMustInteger"
}
}
});
$("#formTemp").validate({
rules: {
NAME: "required"
},
messages: {
NAME: errIcon + "@Resources.LangOrder.ValidInputTempName"
}
});
//船公司
$("#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);
});
//包装
$("#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: "PORT",
keyField: "EDICODE",
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 () {
$.ajax({
method: 'POST',
url: '@Url.Action("CancelSubmit")?ordno=@Model.ORDNO',
success: function (data) {
layer.alert(data.Message, function () {
window.parent.document.orderRefresh = true;
location.reload();
})
}
})
});
//删除
$("#btnDelete").click(function () {
layer.confirm('@Resources.LangOrder.MsgConfirmDelete', {
btn: ['@Resources.LangAll.BtnOK', '@Resources.LangAll.BtnCancel'] //按钮
}, function () {
$.ajax({
method: 'POST',
url: '@Url.Action("OrderDelete")?ordno=@Model.ORDNO',
success: function (data) {
layer.alert(data.Message, function () {
if (data.Success) {
window.parent.document.orderRefresh = true;
$(parent.document).find('.J_menuTab.active i').click()
}
})
}
})
}, function () {
});
});
//集装箱信息
$("#ctrnTable").bootstrapTable()
$("#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 () {
$("#ctrnModel").modal('show')
$("#ctrnTable").bootstrapTable('uncheckAll')
$("#modelCtrnType").val("");
$("#modelCtrnNum").val("");
});
$("a.ctrn-add-del").click(function () {
var ids = $.map($("#ctrnTable").bootstrapTable('getSelections'), function (row) {
return row.CTN_ID
})
if (ids.length > 0) {
$("#ctrnTable").bootstrapTable('remove', { field: 'CTN_ID', values: ids });
}
});
$("#modelBtnSave").click(function () {
var ctnall = $("#modelCtrnType").val();
var ctnnum = parseInt($("#modelCtrnNum").val());
var findItem=null
if ($("#formCtrn").valid()) {
var selList = $("#ctrnTable").bootstrapTable('getSelections');
if (selList.length > 0) {
var json = $("#formCtrn").toJson();
selList[0].CTNALL = json.CTNALL;
selList[0].CTNNUM = json.CTNNUM;
} else {
for (var idx in ctrnData) {
if (ctrnData[idx].CTNALL == ctnall) {
findItem = ctrnData[idx];
break;
}
}
if (findItem == null) {
ctrnData.push({
CTN_ID: ctrnData.length + 1,
CTNALL: $("#modelCtrnType").val(),
CTNNUM: parseInt($("#modelCtrnNum").val())
})
} else {
findItem.CTNNUM += parseInt(ctnnum);
}
}
$("#ctrnTable").bootstrapTable('load', ctrnData)
$("#ctrnModel").modal('hide')
}
});
$("#ctrnTable").on('dbl-click-row.bs.table', function (row, $element, field) {
$("#ctrnModel").modal('show')
$("#ctrnTable").bootstrapTable('uncheckAll')
$("#ctrnTable").bootstrapTable('checkBy', { field: 'CTN_ID', values: [$element.CTN_ID] })
$("#formCtrn").loadData($element);
})
//发货 收货 通知人格式化
$("a.format-text-len").click(function () {
var len = parseInt($(this).data('len'));
var area = $(this).parents("div.ibox").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';
}
}
if (strResult.endsWith('\n')) {
strResult = strResult.substr(0, strResult.length - 1);
}
$(area).val(strResult)
$(area).change()
});
$("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>');
}
})
$("textarea.text-area-show-number").blur(function () {
var val = $(this).val().toUpperCase();
$(this).val(val)
})
//货物类型
$("#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.Order.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.Order.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",
startDate: new Date()
});
});
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();
$.ajax({
method: 'POST',
url: '@Url.Action("OrderSave")',
dataType: 'json',
data: JSON.stringify(obj),
contentType: "application/json",
success: function (data) {
if (data.Success) {
window.parent.document.orderRefresh = true;
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: {
HSCODE: {
rangelength: [6, 6] //[18, 18]
},
PKGS: { digits: true },
KGS: { number: true },
CBM: { number: true }
},
messages: {
HSCODE: {
rangelength: errIcon + "@Resources.LangOrder.ValidInputHSCODE"
},
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",
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",
PLACEDELIVERYID: "required",
ISSUETYPE: "required",
SERVICE: "required",
BLFRT: "required",
HSCODE: {
rangelength: [6, 6] //[18, 18]
}
},
messages: {
CARRIER: errIcon + "@Resources.LangOrder.ValidInputCARRIER",
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",
ISSUETYPE:errIcon+"@Resources.LangOrder.ValidInputISSUETYPE",
SERVICE:errIcon+"@Resources.LangOrder.ValidInputSERVICE",
BLFRT: errIcon + "@Resources.LangOrder.ValidInputBLFRT",
HSCODE: {
rangelength: errIcon + "@Resources.LangOrder.ValidInputHSCODE"
}
}
});
}
</script>
@if (Model.BSSTATUS != OrderStatus.Create.ToString()&& Model.BSSTATUS != OrderStatus.Back.ToString())
{
<script>
$(function () {
$("input,select,textarea").prop("readonly", "readonly").prop("disabled", "disabled");
$("#ctrn-btn-group").hide();
})
</script>
}
}