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/pub/Views/Booking/Order.cshtml

1444 lines
66 KiB
Plaintext

2 years ago
@using BookingJieFeng.Models
@model OrderEditViewModel
@{
/**/
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 logList = ViewBag.LogList as List<LogListDisplayModel>;
}
<div class="top-navigation">
<div class="row">
<nav class="navbar">
<div class="navbar-collapse navbar-bottom collapse">
<ul class="nav navbar-nav orderlist-nav">
<li>
<a class="tabs" data-url="@Url.Action("Order")" data-title="新建"><i></i>新建</a>
<span></span>
</li>
@if (!string.IsNullOrEmpty(Model.ORDNO))
{
<li><a class="tabs" data-url="@Url.Action("Copy")?srcORDNO=@Model.ORDNO" data-title="复制订舱"><i></i>复制</a><span></span></li>
}
else
{
<li><a class="disabled" href="#"><i></i>复制</a><span></span></li>
}
@if (Model.BSSTATUS == OrderStatus.Create.ToString())
{
<li><a href="#" id="btnSave"><i></i>保存</a><span></span></li>
}
else
{
<li><a class="disabled"><i></i>保存</a><span></span></li>
}
@if (ViewBag.ShowConfirmBtn != null && ViewBag.ShowConfirmBtn)
{
<li><a class="tabs" data-url="@Url.Action("Confirm")?ordno=@Model.ORDNO" data-title="@Model.MBLNO 截单"><i></i>转换截单</a><span></span></li>
}
else
{
<li><a class="disabled"><i></i>转换截单</a><span></span></li>
}
@if (Model.BSSTATUS == OrderStatus.Create.ToString())
{
<li><a id="btnSaveTemplate"><i></i>存为模板</a><span></span></li>
<li><a id="btnLoadTemplate"><i></i>引入模板</a><span></span></li>
<li><a id="btnSubmit"><i></i>提交</a><span></span></li>
}
else
{
<li><a class="disabled"><i></i>存为模板</a><span></span></li>
<li><a class="disabled"><i></i>引入模板</a><span></span></li>
<li><a class="disabled"><i></i>提交</a><span></span></li>
}
<li><a onclick="window.print();"><i></i>打印中心</a><span></span></li>
@if (Model.BSSTATUS == OrderStatus.Create.ToString())
{
<li><a id="btnUpAttach"><i></i>上传附件</a><span></span></li>
}
else
{
<li><a class="disabled"><i></i>上传附件</a><span></span></li>
}
@if (ViewBag.Attach != null)
{
<div class="file-link"><img src="~/Content/img/download.png" /><a href="@Url.Action("DownAttach",new { attId=ViewBag.Attach.GID})">@ViewBag.Attach.TITLE</a></div>
}
</ul>
</div>
</nav>
</div>
</div>
<div class="wrapper-content J_mainContent gray-bg-right">
<!--第一种样式开始-->
<div class="order-status row-margin">
<div class="col-lg-2 col-md-2 col-sm-12 @(ViewBag.StaOrderSave!=null&&ViewBag.StaOrderSave?"active":"")">
<div class="circle">1</div>
<div class="status-b"></div>
<label>未提交</label>
<div class="time">@ViewBag.StaOrderSaveTime</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-12 @(ViewBag.StaOrderSubmit!=null&&ViewBag.StaOrderSubmit?"active":"")">
<span class="circle">2</span>
<div class="status-b"></div>
<label>已提交订单</label>
<div class="time">@ViewBag.StaOrderSubmitTime</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-12 @(ViewBag.StaOrderConfirm!=null&&ViewBag.StaOrderConfirm?"active":"")">
<span class="circle">3</span>
<div class="status-b"></div>
<label>订单已确认</label>
<div class="time">@ViewBag.StaOrderConfirmTime</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-12 @(ViewBag.StaConfirmSave!=null&&ViewBag.StaConfirmSave?"active":"")">
<span class="circle">4</span>
<div class="status-b"></div>
<label>待截单</label>
<div class="time">@ViewBag.StaConfirmSaveTime</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-12 @(ViewBag.StaConfirmSubmit!=null&&ViewBag.StaConfirmSubmit?"active":"")">
<span class="circle">5</span>
<div class="status-b"></div>
<label>已提交截单</label>
<div class="time">@ViewBag.StaConfirmSubmitTime</div>
</div>
<div class="col-lg-2 col-md-2 col-sm-12 @(ViewBag.StaConfirmConfirm!=null&&ViewBag.StaConfirmConfirm?"active":"")">
<span class="circle">6</span>
<div class="status-b"></div>
<label>截单已确认</label>
<div class="time">@ViewBag.StaConfirmConfirmTime</div>
</div>
</div>
<!--第一种样式结束-->
<form class="form-horizontal clearfix" id="formEdit" method="post">
@Html.HiddenFor(m => m.ORDNO)
@Html.HiddenFor(m => m.BSSTATUS)
@Html.HiddenFor(m => m.MODIFYTIME)
<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 col-sm-12">
<div class="col-lg-12">
<label class="col-lg-2 col-md-3 control-label">货物标识:</label>
<div class="col-lg-9 col-md-8">
@Html.DropDownListFor(m => m.CARGOID, seleteItemsCARGO, new { @class = "select form-control" })
</div>
</div>
</div>
<div class="form-group col-lg-6 col-md-6 col-sm-12">
<label class="col-lg-2 col-md-3 control-label">销售代码:</label>
<div class="col-lg-9 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.SALECODE, 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>
@if (ViewBag.RemainTimeClosing != null)
{
<div class="form-group col-lg-3 col-md-3 col-sm-12 red text-right">@ViewBag.RemainTimeClosing</div>
}
</div>
</div>
</div>
<div class="row row-bg goods">
<div class="ibox-title">
<h5></h5>
</div>
<div class="ibox-content">
<div class="col-lg-7 col-md-7">
<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 class="col-lg-12">
<label class="col-lg-2 col-md-3 control-label">发货人:</label>
<div class="col-lg-10 col-md-9 form-group position-r">
@Html.TextAreaFor(m => m.SHIPPER, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="show-number">
<ul></ul>
</div>
</div>
</div>
<div 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 class="col-lg-12">
<label class="col-lg-2 col-md-3 control-label">收货人:</label>
<div class="col-lg-10 col-md-9 form-group position-r">
@Html.TextAreaFor(m => m.CONSIGNEE, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="show-number">
<ul></ul>
</div>
</div>
</div>
<div 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 class="col-lg-12">
<label class="col-lg-2 col-md-3 control-label">通知人:</label>
<div class="col-lg-10 col-md-9 form-group position-r">
@Html.TextAreaFor(m => m.NOTIFYPARTY, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="show-number">
<ul></ul>
</div>
</div>
</div>
<div class="col-lg-12">
<label class="col-lg-2 col-md-3 control-label">第二通知人:</label>
<div class="col-lg-10 col-md-9 form-group position-r">
@Html.TextAreaFor(m => m.NOTIFYPARTY2, new { @class = "form-control text-area-show-number", rows = "5", wrap = "off" })
<div class="show-number">
<ul></ul>
</div>
</div>
</div>
</div>
<div class="col-lg-5 col-md-5">
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">PO NO.</label>
<div class="col-lg-9 col-md-8">
@Html.TextBoxFor(m => m.PONO, new { @class = "form-control" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">约号:</label>
<div class="col-lg-9 col-md-8">
@Html.TextBoxFor(m => m.CONTRACTNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">提单号:</label>
<div class="col-lg-9 col-md-8">
@Html.TextBoxFor(m => m.MBLNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">船公司:</label>
<div class="col-lg-9 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.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 date-form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">ETD</label>
<div class="col-lg-9 col-md-8">
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
@Html.TextBoxFor(m => m.ETD, new { @class = "form-control", autocomplete = "off" })
</div>
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">船名:</label>
<div class="col-lg-9 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 clearfix">
<label class="col-lg-2 col-md-3 control-label">航次:</label>
<div class="col-lg-9 col-md-8">
@Html.TextBoxFor(m => m.VOYNO, new { @class = "form-control" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">装货港:</label>
<div class="col-lg-5 col-md-4 col-m">
<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-4">
@Html.TextBoxFor(m => m.PORTLOAD, new { @class = "form-control" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">卸货港:</label>
<div class="col-lg-5 col-md-4 col-m">
<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 clearfix">
<label class="col-lg-2 col-md-3 control-label">目的地:</label>
<div class="col-lg-5 col-md-4 col-m">
<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 class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">付费方式:</label>
<div class="col-lg-9 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.BLFRT, new { @class = "form-control", autocomplete = "off" })
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">付费地点:</label>
<div class="col-lg-9 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.PREPARDAT, new { @class = "form-control", autocomplete = "off" })
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">签单方式:</label>
<div class="col-lg-9 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.ISSUETYPE, new { @class = "form-control", autocomplete = "off" })
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-2 col-md-3 control-label">运输条款:</label>
<div class="col-lg-9 col-md-8">
<div class="input-group">
@Html.TextBoxFor(m => m.SERVICE, new { @class = "form-control", autocomplete = "off" })
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row row-bottom quantity h-15 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-3 col-md-3">
<label class="col-lg-4 col-md-4 h-6">箱型箱量:</label>
<div class="col-lg-7 col-md-7">
@Html.TextBoxFor(m => m.CNTRTOTAL, new { @class = "form-control disable", @readonly = "readonly" })
</div>
</div>
<div class="form-group col-lg-2 col-md-3 h-6">
@Html.CheckBoxFor(m => m.ISCONTAINERSOC) SOC箱
</div>
<div class="form-group col-lg-2 col-md-2 col-m">
<select class="select choose form-control">
<option>超限</option>
<option>未超限</option>
</select>
</div>
<div class="form-group col-lg-2 col-md-2">
@Html.TextBoxFor(m => m.OVERFLOWDESCRIP, new { @class = "form-control", placeholder = "超限尺寸" })
</div>
</div>
</div>
</div>
<div class="row row-bottom" id="ctrn-btn-group">
<div class="col-lg-11 navbar-i">
<a href="javascript:void(0);" class="ctrn-add-new">增加</a>
<a href="javascript:void(0);" class="ctrn-add-del">删除</a>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-sm-12">
<table class="table" id="ctrnTable">
<thead>
<tr>
<th class="bs-checkbox"><input type="checkbox" /></th>
<th data-field="CTNALL">箱型</th>
<th data-field="CTNNUM">箱量</th>
</tr>
</thead>
</table>
</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="col-lg-5 col-md-5">
<div class="col-lg-12 form-group">
<label class="col-lg-3 col-md-4 control-label">唛头:</label>
<div class="col-lg-9 col-md-8 form-group">
@Html.TextAreaFor(m => m.MARKS, new { @class = "form-control height-sm", rows = "5" })
</div>
</div>
<div class="col-lg-12 form-group">
<label class="col-lg-4 col-md-5 control-label">HS CODE</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.HSCODE, new { @class = "form-control" })
</div>
<div class="clearfix"></div>
<span class="red-sm col-lg-11 col-md-11">此处HS CODE不显示提单如需显示请添加货描处</span>
</div>
<div class="col-lg-12 form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">中文品名:</label>
<div class="col-lg-9 col-md-8">
<input type="text" class="form-control" />
</div>
</div>
</div>
<div class="col-lg-4 col-md-4">
<label class="col-lg-3 col-md-4 control-label">货物描述:</label>
<div class="col-lg-9 col-md-8 form-group">
@Html.TextAreaFor(m => m.DESCRIPTION, new { @class = "form-control height-lg", rows = "5" })
</div>
</div>
<div class="col-lg-3 col-md-3">
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">总件数:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.PKGS, new { @class = "form-control" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">包装:</label>
<div class="col-lg-8 col-md-7">
<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 clearfix">
<label class="col-lg-3 col-md-4 control-label">总重量:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.KGS, new { @class = "form-control" })
</div>
</div>
<div class="form-group clearfix">
<label class="col-lg-3 col-md-4 control-label">总尺码:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.CBM, new { @class = "form-control" })
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row h-15">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5></h5>
</div>
<div class="ibox-content">
<div class="col-lg-4 col-md-4 form-group hdn-temp">
<label class="col-lg-3 col-md-4 control-label">温度:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.TEMPSET, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-temp">
<label class="col-lg-3 col-md-4 control-label">通风:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.REEFERF, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-temp">
<label class="col-lg-3 col-md-4 control-label">湿度:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.HUMIDITY, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">CLASS</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.DCLASS, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">UN NO</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.DUNNO, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">副危:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.FUWEI, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-4 col-md-4 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">闪点:</label>
<div class="col-lg-8 col-md-7">
@Html.TextBoxFor(m => m.SHANDIAN, new { @class = "form-control" })
</div>
</div>
<div class="col-lg-5 col-md-5 form-group hdn-danger">
<label class="col-lg-3 col-md-4 control-label">海洋污染物:</label>
<div class="col-lg-3 col-md-3">
@Html.DropDownListFor(m => m.HAIYANGWURANWU, seleteItemsHYWRW, new { @class = "select form-control" })
</div>
</div>
</div>
</div>
</div>
<div class="row h-15 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-12">
<label class="col-lg-1 col-md-3 control-label">SO备注</label>
<div class="col-lg-11 col-md-9">
@Html.TextAreaFor(m => m.EDIREMARK, new { @class = "form-control", rows = "5" })
</div>
</div>
</div>
</div>
</div>
</form>
<!--订单更改日志-->
<div class="row">
<div class="ibox float-e-margins modify-summary">
<div class="col-lg-12">
<div class="ibox-title">
<h5>修改汇总</h5>
</div>
<div class="clearfix"></div>
<ul class="modify-column">
@if (logList != null)
{
foreach (var item in logList)
{
<li>
<span>修改人:@item.OpUserName</span>
<span>修改时间:@item.OpTime</span>
<span>
展开 / 折叠内容<i class="open-arrow"></i>
@if (item.ChangeList.Count == 0)
{
<b>(未做任何修改)</b>
}
</span>
</li>
<table>
<tbody>
@if (item.ChangeList.Count > 0)
{
foreach (var chg in item.ChangeList)
{
<tr>
<td>@chg.Title@chg.SrcValue</td>
<td class="modify-border">改为&nbsp;&nbsp;</td>
<td>@chg.Title@chg.DestValue</td>
</tr>
}
}
else
{
<tr>
<td>未作任何更改</td>
</tr>
}
</tbody>
</table>
}
}
</ul>
</div>
</div>
</div>
</div>
<div class="modal fade" id="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">集装箱</h4>
</div>
<div class="modal-body">
<form id="formCtrn" class="form-horizontal">
<div class="form-group">
<label for="recipient-name" class="control-label">箱型</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">箱量</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">关闭</button>
<button type="button" class="btn btn-primary" id="modelBtnSave">保存</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="upFileModel" tabindex="-1" role="dialog" aria-labelledby="upFileModelLabel">
<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="upFileModelLabel">上传附件</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>请选择要上传的文件</h5>
</div>
<div class="ibox-content">
<div class="page-container">
<p>您可以尝试文件拖拽,或者点击选择文件按钮,来选择要上传的文件.</p>
<div id="uploader" class="wu-example">
<div class="queueList">
<div id="dndArea" class="placeholder">
<div id="filePicker"></div>
<p>或将文件拖到这里即可</p>
</div>
</div>
<div class="statusBar" style="display:none;">
<div class="progress">
<span class="text">0%</span>
<span class="percentage"></span>
</div>
<div class="info"></div>
<div class="btns">
<div id="filePicker2"></div>
<div class="uploadBtn">开始上传</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</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" />
<link rel="stylesheet" type="text/css" href="~/Content/hplus/css/plugins/webuploader/webuploader.css">
<link type="text/css" rel="stylesheet" href="~/Content/css/webuploader-demo.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/hplus/js/plugins/webuploader/webuploader.min.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 src="~/Content/js/webuploader-demo.js"></script>
<script type="text/javascript">
/*判断input是否可用*/
$(document).ready(function () {
$("input").each(function () {
if ($(this).attr("readonly") == "readonly") {
$("input").addClass("except");
}
})
})
$(function () {
$(".modify-column li").click(function () {
$(this).children(".open-arrow").toggleClass("close-arrow").siblings("close-arrow").removeClass("open-arrow");
$(this).next(".modify-column table").show().siblings(".modify-column table").hide();
})
})
</script>
<script>
var ctrnData = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model.CtrnList));
var templateData = [];
var employeeJson=@Html.Raw(ViewBag.EmployeeJson)
$(function () {
$("#formCtrn").validate({
rules: {
CTNALL: "required",
CTNNUM: {
required: true,
digits: true
}
},
messages: {
CTNALL: errIcon + "箱型不能为空",
CTNNUM: {
required: errIcon + "箱量不能为空",
digits: errIcon + "箱量必须为数字"
}
}
});
$("#formTemp").validate({
rules: {
NAME: "required"
},
messages: {
NAME: errIcon + "模板名称不能为空"
}
});
//销售代码
$("#SALECODE").bsSuggest({
idField: "name",
keyField: "name",
clearable: true,
data: { value: employeeJson }
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//船公司
$("#CARRIER").bsSuggest({
url: "@Url.Action("SuggestCarrier", "Common")?keyword=",
idField: "CODENAME",
keyField: "SHORTNAME",
getDataMethod: 'url',
clearable: true
}).on('onSetSelectValue', function (e, model) {
console.log('onSetSelectValue: ', model);
});
//签单方式
$("#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);
});
//装货港
$("#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);
});
//付费地点
$("#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 () {
location.reload();
})
}
})
});
//删除
$("#btnDelete").click(function () {
layer.confirm('确认删除吗e', {
btn: ['确定', '取消'] //按钮
}, function () {
$.ajax({
method: 'POST',
url: '@Url.Action("OrderDelete")?ordno=@Model.ORDNO',
success: function (data) {
layer.alert(data.Message, function () {
if (data.Success) {
$(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-tools").next().find("textarea.text-area-show-number");
var arr = $(area).val().split("\n");
var result = [];
var strResult = '';
for (idx in arr) {
var str = arr[idx];
if (str.length > len) {
while (str.length > 0) {
result.push(str.substr(0, len));
strResult += str.substr(0, len) + '\n'
str = str.substr(len);
}
} else {
result.push(str);
strResult += str + '\n';
}
}
$(area).val(strResult)
$(area).change()
});
$("textarea.text-area-show-number").scroll(function () {
var $this = $(this);
var top = $this.scrollTop();
console.log(top)
var numContainer = $($this.parent().find("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.show-number ul"));
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('<li>' + arrNum[idx] + '</li>');
}
})
//货物类型
$("#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"
});
//上传文件
$("#btnUpAttach").click(function () {
//$("#upFileModel").modal('show')
var ordno = '@Model.ORDNO';
if (ordno == "") {
layer.alert('请先保存订单');
return;
}
layer.open({
type: 2,
title: '上传附件',
area: ['800px', '500px'],
fixed: false, //不固定
content: '@Url.Action("UpAttach")?ordno=' + ordno,
end: function () {
location.reload();
}
});
})
});
function saveOrSubmit(submit) {
if (submit) {
validSubmit();
$("#BSSTATUS").val('@OrderStatus.Submit');
if (!$("#formEdit").valid()) {
layer.alert('表单验证失败,请修改后再试')
return;
}
} else {
validSave();
if (!$("#formEdit").valid()) {
layer.alert('表单验证失败,请修改后再试')
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) {
var msgLayer= layer.alert(data.Message, function () {
if (submit) {
lastIndex=layer.open({
type: 2,
title: '发送邮件',
shade: 0.8,
area: ['600px', '650px'],
content: '@Url.Action("SendMailAfterOrderSubmit")?ordno=' + data.Id,
end: function () {
if (data.Url.length > 0) {
location.href = data.Url;
}
}
});
layer.close(msgLayer)
} else {
if (data.Url.length > 0) {
location.href = data.Url;
}
}
})
} else {
layer.alert(data.Message)
}
}
})
}
function getEditJson() {
var obj = $("#formEdit").toJson();
obj.ISCONTAINERSOC = $("#ISCONTAINERSOC").prop('checked');
obj.CtrnList = ctrnData;
return obj;
}
function validSave() {
$("#formEdit").validate({
rules: {
PKGS: { digits: true },
KGS: { number: true },
CBM: { number: true }
},
messages: {
PKGS: { digits: errIcon + '件数必须为整数' },
KGS: { number: errIcon + '重量必须为数字' },
CBM: { number: errIcon + '尺码必须为数字' }
}
});
}
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"
},
messages: {
CARRIER: errIcon + "船公司必须录入",
ETD: errIcon + "请选择开船日期",
SHIPPER: errIcon + "发货人不能为空",
CONSIGNEE: errIcon + "收货人不能为空",
NOTIFYPARTY: errIcon + "通知人不能为空",
MARKS:errIcon+"唛头不能为空",
DESCRIPTION:errIcon+"货物描述不能为空",
PKGS: {
required: errIcon + "件数不能为空",
digits: errIcon + "件数必须为整数"
},
KGS: {
required: errIcon+"毛重不能为空",
number: errIcon + '毛重必须为数字'
},
KINDPKGS: errIcon + "包装不能为空",
CBM: {
required: errIcon+"尺码不能为空",
number: errIcon + '尺码必须为数字'
},
PORTLOADID:errIcon+"请选择装货港",
PORTDISCHARGEID:errIcon+"请选择卸货港",
ISSUETYPE:errIcon+"请选择签单方式",
SERVICE:errIcon+"请选择运输条款",
BLFRT: errIcon + "请选择付费方式"
}
});
}
var lastIndex
function closeLayer() {
layer.close(lastIndex)
}
</script>
@if (Model.BSSTATUS != OrderStatus.Create.ToString())
{
<script>
$(function () {
$("input,select,textarea").prop("readonly", "readonly").prop("disabled", "disabled");
$("#ctrn-btn-group").hide();
})
</script>
}
}