You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
475 lines
22 KiB
475 lines
22 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
|
|
|
|
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
|
|
<script>
|
|
$(document).ready(function () {
|
|
$("input.cell").keyup(function (e) {
|
|
switch (e.keyCode) {
|
|
// up arrow
|
|
case 40:
|
|
$(this).parent()
|
|
.parent()
|
|
.next()
|
|
.children("td")
|
|
.children("input.cell[name="
|
|
+ $(this).attr("name") + "]")
|
|
.focus();
|
|
break;
|
|
|
|
// down arrow
|
|
case 38:
|
|
$(this).parent()
|
|
.parent()
|
|
.prev()
|
|
.children("td")
|
|
.children("input.cell[name="
|
|
+ $(this).attr("name") + "]")
|
|
.focus();
|
|
break;
|
|
}
|
|
});
|
|
});</script>
|
|
|
|
<script>
|
|
// 001出库 002退货
|
|
var moduleType = $.request("Type");
|
|
$("#F_AuditStatus").val("2");
|
|
$("#F_SdnQty").val("2");
|
|
|
|
var _Clos = new Array();
|
|
$(function () {
|
|
SetCols();
|
|
gridList();
|
|
if (moduleType == "002") {
|
|
$(".td_SdnQty").css('display', 'none');
|
|
}
|
|
})
|
|
|
|
function SetCols() {
|
|
$.ajax({
|
|
url: "/Print/SelectColumnName?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
var cols = new Array();
|
|
|
|
var collast = { label: "主键", name: "ID", hidden: true, key: true };
|
|
cols.push(collast);
|
|
var collast = { label: '工单ID', name: 'SDNCode', width: 120, align: 'left' };
|
|
cols.push(collast);
|
|
|
|
if (data != null && data.length > 0) {
|
|
DateList = data;
|
|
for (var i = 0; i < data.length; i++) {
|
|
var ColName = data[i].ColName;
|
|
var ColCode = data[i].ColCode;
|
|
var obj = new Array();
|
|
obj = {
|
|
label: ColName,
|
|
name: ColCode,
|
|
width: 80,
|
|
align: "left"
|
|
}
|
|
cols.push(obj);
|
|
}
|
|
}
|
|
$.ajax({
|
|
url: "/Print/SelectTableColumnName?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
if (data != null && data.length > 0) {
|
|
DateList = data;
|
|
for (var i = 0; i < data.length; i++) {
|
|
var TableCode = data[i].TableCode;
|
|
if (TableCode == "ICSSDN") {
|
|
var Code = data[i].Code;
|
|
var Name = data[i].Name;
|
|
var obj = new Array();
|
|
obj = {
|
|
label: Name,
|
|
name: Code,
|
|
width: 80,
|
|
align: "left"
|
|
}
|
|
cols.push(obj);
|
|
}
|
|
if (TableCode == "ICSInventory") {
|
|
var Code = data[i].Code;
|
|
var Name = data[i].Name;
|
|
var obj = new Array();
|
|
obj = {
|
|
label: Name,
|
|
name: Code,
|
|
width: 80,
|
|
align: "left"
|
|
}
|
|
cols.push(obj);
|
|
//cols1.push(obj);
|
|
}
|
|
}
|
|
}
|
|
_Clos = cols;
|
|
//_Clos1 = cols1;
|
|
}
|
|
|
|
});
|
|
_Clos = cols;
|
|
}
|
|
});
|
|
}
|
|
|
|
function gridList() {
|
|
var $gridList = $("#gridList");
|
|
var queryJson = {
|
|
POCode: $("#txt_POCode").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
InvName: $("#txt_InvName").val(),
|
|
WHCode: $("#txt_WHCode").val(),
|
|
WHName: $("#txt_WHName").val(),
|
|
//BatchCode: $("#txt_BatchCode").val(),
|
|
FromTime: $("#FromTime").val(),
|
|
ToTime: $("#ToTime").val(),
|
|
AuditStatus: $("#F_AuditStatus").val(),
|
|
SDNQtyFlag: $("#F_SdnQty").val(),
|
|
}
|
|
$gridList.dataGrid({
|
|
url: "/MFWMS/ICSSSD/GetSDNBackApplyNeg?Type=" + moduleType + "&" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
height: $(window).height() - 200,
|
|
width: $(window).width() - 300,
|
|
colModel: [
|
|
{ label: '出库单号', name: 'SDNCode', width: 120, align: 'left' },
|
|
//{ label: '仓库代码', name: 'WHCode', width: 150, align: 'left' },
|
|
//{ label: '仓库名称', name: 'WarehouseName', width: 150, align: 'left' },
|
|
//{
|
|
// label: "状态", name: "Status", width: 80, align: "left",
|
|
// formatter: function (cellvalue) {
|
|
// if (cellvalue == "1") {
|
|
// return "开立";
|
|
// } else if (cellvalue == "2") {
|
|
// return "审核";
|
|
// } else if (cellvalue == "3") {
|
|
// return "关闭";
|
|
// }
|
|
// else { return ""; }
|
|
// }
|
|
//},
|
|
{
|
|
label: "状态", name: "AccomplishFlag", width: 80, align: "left",
|
|
formatter: function (cellvalue) {
|
|
if (cellvalue == "0") {
|
|
return "待审核";
|
|
}
|
|
else {
|
|
return "已审核";
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: "类型", name: "Type", width: 80, align: "left",
|
|
formatter: function (cellvalue) {
|
|
if (cellvalue == "1") {
|
|
return "发货";
|
|
} else if (cellvalue == "2") {
|
|
return "退货";
|
|
}
|
|
else { return "销售订单"; }
|
|
}
|
|
},
|
|
{ label: '操作人', name: 'MUSERName', width: 150, align: 'left' },
|
|
{ label: '操作时间', name: 'MTIME', width: 150, align: 'left' },
|
|
|
|
],
|
|
shrinkToFit: true,//宽度自适应
|
|
autoWidth: true,
|
|
gridComplete: function () {
|
|
},
|
|
pager: "#gridPager",
|
|
sortorder: "desc",
|
|
sortname: 'MTIME',
|
|
viewrecords: true,
|
|
multiselect: true,
|
|
//beforeSelectRow: function (rowid, e) {
|
|
// $("#gridList").jqGrid('resetSelection');
|
|
// return (true);
|
|
//},
|
|
subGrid: true, // (1)开启子表格支持
|
|
subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
bindSubGrid(subgrid_id, rowid)
|
|
}
|
|
});
|
|
$("#warehouse a.btn-default").click(function () {
|
|
$("#warehouse a.btn-default").removeClass("active");
|
|
$(this).addClass("active");
|
|
$('#btn_search').trigger("click");
|
|
});
|
|
$("#btn_search").click(function () {
|
|
var warehouse = $("#warehouse a.active").attr('data-value');
|
|
var queryJson = {
|
|
POCode: $("#txt_POCode").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
InvName: $("#txt_InvName").val(),
|
|
WHCode: $("#txt_WHCode").val(),
|
|
WHName: $("#txt_WHName").val(),
|
|
//BatchCode: $("#txt_BatchCode").val(),
|
|
FromTime: $("#FromTime").val(),
|
|
ToTime: $("#ToTime").val(),
|
|
AuditStatus: $("#F_AuditStatus").val(),
|
|
SDNQtyFlag: $("#F_SdnQty").val(),
|
|
}
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
}).trigger('reloadGrid');
|
|
});
|
|
}
|
|
function bindSubGrid(subgrid_id, rowid) {
|
|
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
var subgrid_table_id;
|
|
subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
|
|
|
|
var subgrid_pager_id;
|
|
subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
|
|
|
|
// (5)动态添加子报表的table和pager
|
|
$("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
|
|
var SDNCode = $("#gridList").jqGrid('getRowData', rowid).SDNCode;
|
|
// (6)创建jqGrid对象
|
|
$("#" + subgrid_table_id).dataGrid({
|
|
cellEdit: true,
|
|
url: "/MFWMS/ICSSSD/GetSDNApplyNegDetail?SDNCode=" + SDNCode + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
|
|
colModel: [
|
|
{ label: "主键", name: "ID", hidden: true, key: true },
|
|
{ label: '行号', name: 'Sequence', width: 120, align: 'left' },
|
|
{ label: '销售订单号', name: 'SOCode', width: 180, align: 'left' },
|
|
{ label: '销售订单行号', name: 'SOSequence', width: 180, align: 'left' },
|
|
{ label: '客户代码', name: 'CusCode', width: 180, align: 'left', hidden: true },
|
|
{ label: '客户名称', name: 'CusName', width: 180, align: 'left' },
|
|
{ label: '物料代码', name: 'InvCode', width: 120, align: 'left' },
|
|
{ label: '物料名称', name: 'InvName', width: 120, align: 'left', },
|
|
{ label: '物料规格', name: 'InvStd', width: 120, align: 'left', },
|
|
{ label: '数量', name: 'Quantity', width: 120, align: 'left' },
|
|
{ label: '发货日期', name: 'ArriveDate', width: 120, align: 'left' },
|
|
{ label: '已发数量', name: 'SDNQuantity', width: 120, align: 'left', hidden: true },
|
|
{ label: '仓库名称', name: 'WHName', width: 120, align: 'left' },
|
|
{ label: '仓库代码', name: 'WHCode', width: 120, align: 'left', hidden: true },
|
|
{ label: '辅计量', name: 'Amount', width: 120, align: 'left', hidden: true },
|
|
{ label: '创建人', name: 'CreatePerson', width: 120, align: 'left' },
|
|
{ label: '创建时间', name: 'CreateDateTime', width: 120, align: 'left' },
|
|
{ label: '操作人', name: 'MUSER', width: 150, align: 'left' },
|
|
{ label: '操作人名称', name: 'MUSERName', width: 150, align: 'left' },
|
|
{ label: '操作时间', name: 'MTIME', width: 150, align: 'left' },
|
|
],
|
|
sortname: 'Sequence',
|
|
shrinkToFit: true,//宽度自适应
|
|
//multiselect: true,
|
|
prmNames: { search: "search" },
|
|
viewrecords: true,
|
|
height: "100%",
|
|
rowNum: 20,
|
|
pager: subgrid_pager_id,
|
|
});
|
|
}
|
|
|
|
function btn_Audit() {
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
var SDNCodeArr = '';
|
|
if (ids.length < 1) {
|
|
$.modalAlertNew("WMS00087");
|
|
return;
|
|
}
|
|
//卡控 已审核
|
|
|
|
|
|
for (var i in ids) {
|
|
SDNCode = $("#gridList").jqGrid('getRowData', ids[i]).SDNCode;
|
|
AccomplishFlag = $("#gridList").jqGrid('getRowData', ids[i]).AccomplishFlag;
|
|
if (AccomplishFlag != '待审核') {
|
|
$.modalAlertNew("WMS00088");
|
|
return;
|
|
}
|
|
SDNCodeArr = SDNCodeArr == '' ? "'" + SDNCode + "'" : SDNCodeArr + ",'" + SDNCode + "'";
|
|
}
|
|
//若为退货 则打开仓库弹出框 选择仓库
|
|
if(moduleType == '002'){
|
|
$.modalOpen({
|
|
id: "CloneButton",
|
|
title: "目标库位",
|
|
url: "/MFWMS/ICSSSD/ICSWarehouseSelection?SDNCodeArr=" + SDNCodeArr + "&" + Math.random(),
|
|
width: "400px",
|
|
height: "450px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}else{
|
|
var RoleEnCode = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode'
|
|
var WorkPoint = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
|
|
var date = new Date();
|
|
|
|
$.submitForm({
|
|
url: "/MFWMS/ICSSSD/AuditSDN?keyValue=" + SDNCodeArr + "&Type=1&" + Math.random(),
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
</script>
|
|
<iframe id="ifrm" src="" width="0" height="0"></iframe>
|
|
<script>
|
|
|
|
</script>
|
|
<div class="topPanel" style="height: 100px">
|
|
<div class="toolbar">
|
|
<div class="btn-group">
|
|
<a id="NF-Audit" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Audit()"><i class="fa fa-pencil-square-o"></i>审核</a>
|
|
@*<a id="NF-Delete" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Delete()"><i class="fa fa-trash-o"></i>删除</a>*@
|
|
<a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
|
|
</div>
|
|
@*<div class="btn-group" style="display:block;padding-left:2px;">
|
|
<a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
|
|
<a id="NF-Import" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Import()"><i class="fa fa-pencil-square-o"></i>导入</a>
|
|
<a id="NF-Rebind" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_Rebind()"><i class="fa fa-pencil-square-o"></i>重新绑定</a>
|
|
<a id="NF-Looks" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreateLook()"><i class="fa fa-pencil-square-o"></i>查看子件信息</a>
|
|
</div>*@
|
|
<script>$('.toolbar').authorizeButton()</script>
|
|
</div>
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td class="POCodeShow" style="text-align:right;"><label class="lglabel HideItems" id="POCodeShowLable" for="txt_POCode"> 单据号</label>:</td>
|
|
<td class="POCodeShow">
|
|
<div class="input-group HideItems">
|
|
<input id="txt_POCode" type="text" class="form-control" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
@*<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode"> 供应商代码</label>:</td>
|
|
<td class="HideItems">
|
|
<div class="input-group HideItems">
|
|
<input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
|
|
<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName"> 供应商名称</label>:</td>
|
|
<td class="HideItems">
|
|
<div class="input-group HideItems">
|
|
<input id="txt_VenName" type="text" class="form-control HideItems" style="width: 130px;">
|
|
</div>
|
|
</td>*@
|
|
|
|
<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_WHCode"> 仓库编码</label>:</td>
|
|
<td>
|
|
<div class="input-group HideItems">
|
|
<input id="txt_WHCode" type="text" class="form-control HideItems" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_WHName"> 仓库名称</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_WHName" type="text" class="form-control" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
@*<td class="HideItems2" style="text-align:right;"><label class="lglabel HideItems2" for="txt_VenName"> 源头单据号</label>:</td>
|
|
<td class="HideItems2">
|
|
<div class="input-group HideItems2">
|
|
<input id="txt_SCode" type="text" class="form-control HideItems2" style="width: 130px;">
|
|
</div>
|
|
</td>*@
|
|
<td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName"> 发货日期(从)</label>:</td>
|
|
<td class="HideItemsTime">
|
|
<div class="input-group HideItemsTime">
|
|
<input id="FromTime" name="FromTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="发货日期(从)" />
|
|
</div>
|
|
</td>
|
|
<td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName"> 发货日期(到)</label>:</td>
|
|
<td class="HideItemsTime">
|
|
<div class="input-group HideItemsTime">
|
|
<input id="ToTime" name="ToTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="发货日期(到)" />
|
|
</div>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_InvCode"> 物料编码</label>:</td>
|
|
<td>
|
|
<div class="input-group HideItems">
|
|
<input id="txt_InvCode" type="text" class="form-control HideItems" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_InvName"> 物料名称</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_InvName" type="text" class="form-control" style="width: 130px;">
|
|
</div>
|
|
</td>
|
|
<td class="td_SdnQty">
|
|
<label > 是否全部出库: </label>
|
|
</td>
|
|
<td class="td_SdnQty">
|
|
<div class="input-group">
|
|
<select id="F_SdnQty" name="F_SdnQty" class="form-control" style="width: 130px;">
|
|
<option value="0">显示全部</option>
|
|
<option value="1">已全部出库</option>
|
|
<option value="2" selected="selected">未全部出库</option>
|
|
</select>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<label> 是否审核: </label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<select id="F_AuditStatus" name="F_AuditStatus" class="form-control" style="width: 130px;">
|
|
<option value="0">显示全部</option>
|
|
<option value="1">已审核</option>
|
|
<option value="2" selected="selected">未审核</option>
|
|
</select>
|
|
</div>
|
|
</td>
|
|
@*<td id="GDLX">
|
|
<label> 工单类型: </label>
|
|
</td>
|
|
<td id="GDLX2">
|
|
<div class="input-group">
|
|
<select id="SelGDLX" name="SelShow" class="form-control" style="width: 130px;">
|
|
</select>
|
|
</div>
|
|
</td>
|
|
<td class="GDLX" style="display:none">
|
|
<label> 工单类型: </label>
|
|
</td>
|
|
<td class="GDLX" style="display:none">
|
|
<div class="input-group">
|
|
<select id="selShow" name="F_Target" class="form-control" style="width: 100px;">
|
|
<option value="0">显示全部</option>
|
|
<option value="1">已全部生成</option>
|
|
<option value="2" selected="selected">未全部生成</option>
|
|
</select>
|
|
</div>
|
|
</td>*@
|
|
<td>
|
|
<span class="input-group-btn">
|
|
<button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
|
|
</span>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="gridPanel">
|
|
<table id="gridList"></table>
|
|
<div id="gridPager"></div>
|
|
</div>
|