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

315 lines
13 KiB
Plaintext

2 years ago
@using BookingJieFeng.DB.Model
@{
var cfgData = ViewBag.ColumnConfigData;
var dicColMap = ViewBag.ColDic as Dictionary<string, string>;
}
<style type="text/css">
.table tbody tr td:first-child {
padding-left: 29px !important;
}
.table tbody tr td a.audit:last-child {
float: none;
margin: 0 auto;
}
</style>
<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("Shipping")" data-title="新建舱单"><i></i>新建舱单</a><span></span></li>
@*<li><a id="btnCopy"><i></i>复制舱单</a><span></span></li>*@
<li><a id="btnCopySub"><i></i>复制分单</a><span></span></li>
<li class="import"><a id="btnImport"><i></i>导入舱单</a><span></span></li>
<li><a id="btnSubmit"><i></i>提交</a><span></span></li>
</ul>
<div class="set-column">
<a href="@Url.Content("/Content/ShippingTemplate.xlsx")">下载导入模板</a>
<a id="btnSetCol">设置列</a>
</div>
</div>
</nav>
</div>
</div>
<div class="wrapper-content J_mainContent gray-bg-right">
<div class="row row-margin">
<div class="ibox">
<div class="ibox-title">
<h5>舱单台账</h5>
</div>
<div class="ibox-content">
<form class="form-horizontal" id="formCond">
<div class="col-lg-2 col-md-3 form-group">
<input type="text" class="form-control" name="MBLNO" placeholder="主提单号" />
</div>
<div class="col-lg-2 col-md-3 form-group">
<input type="text" class="form-control" name="HBLNO" placeholder="分提单号" />
</div>
<div class="col-lg-2 col-md-3 form-group">
<input type="text" class="form-control date" name="ETD_START" id="ETD_START" placeholder="起始时间" />
</div>
<div class="col-lg-2 col-md-3 form-group">
<input type="text" class="form-control date" name="ETD_END" id="ETD_END" placeholder="结束时间" />
</div>
<div class="col-lg-2 col-md-3 form-group">
<input type="text" class="form-control" name="PORTDISCHARGE" placeholder="卸货港" />
</div>
<div class="col-lg-2 col-md-3 col-sm-12 form-group">
<a class="btn btn-resect" id="btn-reset">重置</a>
<a class="btn btn-query" id="btnSearch">搜索</a>
</div>
</form>
<!--状态-->
<div class="col-lg-12 col-md-12 state-tips">
<div class="col-lg-1 col-md-2 tit">状态:</div>
<div class="col-lg-1 col-md-2 nosubmit">
<i></i>创建
</div>
<div class="col-lg-1 col-md-2 yessubmit">
<i></i>提交
</div>
</div>
<!--
创建 class='nosubmit'
提交 class='yessubmit'
-->
<table id="table"
data-toggle="table"
data-show-refresh="false"
data-show-toggle="false"
data-show-columns="false"
data-url="@Url.Action("ShippingList")"
data-content-type="application/x-www-form-urlencoded"
data-pagination="true"
data-side-pagination="server"
data-total-field="Total"
data-data-field="DataList"
data-page-number="1"
data-page-size="10"
data-query-params="queryParams"
data-method="post">
<thead>
<tr>
<th data-checkbox="true"></th>
@if (cfgData == null)
{
<th data-field="MBLNO" data-sortable="true">主提单号</th>
<th data-field="HBLNO" data-sortable="true">分提单号</th>
<th data-field="ETD" data-sortable="true">开船日期</th>
<th data-field="CHUANDAI" data-sortable="true">船代</th>
<th data-field="PORTLOAD" data-sortable="true">装货港</th>
<th data-field="PORTDISCHARGE" data-sortable="true">卸货港</th>
<th data-field="BSSTATUS_NAME" data-formatter="fmtStatus" data-sortable="true">状态</th>
<th data-field="SENDSTATUS" data-sortable="true">发送状态</th>
}
else
{
foreach (var item in cfgData)
{
var vis = Convert.ToBoolean(item.visible);
string colName = item.colName.ToString();
string colTitle = dicColMap[colName];
if (vis)
{
<th data-field="@colName" data-sortable="true" @Html.Raw(colName == "BSSTATUS_NAME" ? "data-formatter='fmtStatus'" : "") @Html.Raw((item.width > 0 ? "data-width='" + item.width + "'" : ""))>
@colTitle
</th>
}
}
}
<th data-field="ORDNO" data-formatter="operateFormatter">操作</th>
</tr>
</thead>
</table>
</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("ImportShippingFromExcel")">
<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>
@section styles
{
<link type="text/css" rel="stylesheet" href="~/Content/css/orderlist.css" />
<link type="text/css" rel="stylesheet" href="~/Content/css/shippinglist.css" />
<link type="text/css" rel="stylesheet" href="~/Content/hplus/css/plugins/footable/footable.core.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>
$(function () {
$("#btn-reset").click(function () {
$(".form-horizontal input").val('');
});
$('#table').bootstrapTable({ height: $(window).height() - 150 });
$("#btnSearch").click(function () {
$('#table').bootstrapTable('refresh')
})
$('#ETD_START,#ETD_END').datepicker({
autoclose: true,
format: "yyyy-mm-dd"
});
$("#btnCopy").click(function () {
var sel = $('#table').bootstrapTable('getSelections')
if (sel.length != 1) {
layer.alert('@Resources.LangOrder.MsgChooseOneToCopy');
return;
}
parent.addMenuTab("@Url.Action("ShippingCopy")?shipid=" + sel[0].SHIPPINGNO, '@Resources.LangOrder.BtnCopy', 0)
})
$("#btnCopySub").click(function () {
var sel = $('#table').bootstrapTable('getSelections')
if (sel.length != 1) {
layer.alert('@Resources.LangOrder.MsgChooseOneToCopy');
return;
}
parent.addMenuTab("@Url.Action("ShippingCopy")?subFlag=True&shipid=" + sel[0].SHIPPINGNO, '复制分单', 0)
})
$("#btnSetCol").click(function () {
layerIndex = layer.open({
type: 2,
title: '设置列',
area: ['800px', '700px'],
content: '@Url.Action("ColumnConfig")?module=@ConfigData.ModuleShipping&cate=@ConfigData.CateListColumn'
});
})
//导入舱单
$("#btnImport").click(function () {
$("#importModal").modal('show')
})
$("#importModalBtnOk").click(function () {
if ($("#modalImportFile").val().length == 0) {
layer.alert('请选择要上传的文件');
return
}
$("#formImportShipping").ajaxSubmit({
success: function (data) {
layer.alert(data.Message, function () {
location.reload()
})
}
})
})
//提交
$("#btnSubmit").click(function () {
var sel = $('#table').bootstrapTable('getSelections')
if (sel.length < 1) {
layer.alert('请选择要提交的数据');
return;
}
var strId = ''
$(sel).each(function (i, v) {
if (strId.length > 0) {
strId += ','
}
strId += v.SHIPPINGNO
})
$.ajax({
type: 'POST',
url: '@Url.Action("SubmitBatch")',
data: { idStr: strId },
success: function (data) {
layer.alert(data.Message)
}
})
})
});
function queryParams(params) {
var cond = $("#formCond").serializeObject();
params.MBLNO = cond.MBLNO;
params.HBLNO = cond.HBLNO;
params.ETD_START = cond.ETD_START;
params.ETD_END = cond.ETD_END;
params.PORTDISCHARGE = cond.PORTDISCHARGE;
params.VESSEL = cond.VESSEL;
return params
}
function operateFormatter(value, row, index) {
var titleNO = row.MBLNO;
if (titleNO == null || titleNO.length == 0) {
titleNO = '编辑';
}
if (row.BSSTATUS == "@ShippingStatus.Create") {
return [
'<a class="audit tabs" data-url="@Url.Action("ShippingEdit")?shipid=' + row.SHIPPINGNO + '" data-title="' + titleNO+'舱单">',
'<i class="fa fa-edit"></i>编辑',
'</a>'
].join('');
} else if (row.BSSTATUS == "@ShippingStatus.Submit") {
return [
'<a class="audit tabs" data-url="@Url.Action("ShippingEdit")?shipid=' + row.SHIPPINGNO + '" data-title="' + titleNO+'舱单">',
'<i class="fa fa-eye"></i>查看',
'</a>'
].join('');
}
return '';
}
function fmtStatus(value, row, index) {
if (row.BSSTATUS == '@ShippingStatus.Create') {
return '<div class="nosubmit">' + row.BSSTATUS_NAME + '</div>'
}
else if (row.BSSTATUS == '@ShippingStatus.Submit') {
return '<div class="yessubmit">' + row.BSSTATUS_NAME + '</div>'
}
}
</script>
}