<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta charset="utf-8">
|
<title>入库退货单据</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport"
|
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
|
<link rel="stylesheet" href="../../css/public.css" media="all">
|
|
<style type="text/css">
|
.layui-table-view .layui-table[lay-size=sm] .layui-table-cell {
|
height: auto;
|
line-height: 23px;
|
}
|
.layui-table-tool-panel{
|
top: auto;
|
bottom: 29px;
|
}
|
.layui-table-tool{
|
padding-left: 5px;
|
}
|
/* 表格下拉小箭头隐藏 */
|
.layui-table-grid-down {
|
display: none;
|
}
|
</style>
|
<script>
|
// 这里是需要在页面渲染之前执行的代码
|
document.addEventListener("DOMContentLoaded", function() {
|
//获取table默认显示数
|
pageCntFirst();
|
console.log(pageCnt)
|
//判断是否开启table列表列宽调整功能。
|
GetIsSetColW();
|
});
|
</script>
|
</head>
|
|
<body id="body">
|
<div class="layui-fluid" style="padding-bottom: 0;">
|
<div class="layui-card">
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto" id="top">
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label">入库单号</label>
|
<div class="layui-input-inline">
|
<input type="text" id="ASNNo" name="ASNNo" placeholder="入库单号"
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">执行状态</label>
|
<div class="layui-input-inline">
|
<select name="Status" id="Status" lay-filter="Status" lay-search>
|
<option value=""></option>
|
<option value="0">等待执行</option>
|
<option value="1">正在执行</option>
|
<option value="2">执行完成</option>
|
<option value="3">订单关闭</option>
|
<option value="4">上传完毕</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">批次号</label>
|
<div class="layui-input-inline">
|
<input type="text" id="LotNo" name="LotNo" placeholder="批次号" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">物料编码</label>
|
<div class="layui-input-inline">
|
<input type="text" id="SkuNo" name="SkuNo" placeholder="物料编码" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">物料名称</label>
|
<div class="layui-input-inline">
|
<input type="text" id="SkuName" name="SkuName" placeholder="物料名称" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">客户名称</label>
|
<div class="layui-input-inline">
|
<input type="text" id="CustomerName" name="CustomerName" placeholder="客户名称" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">开始日期</label>
|
<div class="layui-input-inline">
|
<input type="text" autocomplete="off" name="StartTime" id="StartTime" class="layui-input"
|
placeholder="开始日期">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">结束日期</label>
|
<div class="layui-input-inline">
|
<input type="text" autocomplete="off" name="EndTime" id="EndTime" class="layui-input"
|
placeholder="结束日期">
|
</div>
|
</div>
|
<div class="layui-inline" id="divReason" style="display: none; padding-top: 10px;">
|
<label class="layui-form-label">撤销原因</label>
|
<div class="layui-input-inline">
|
<textarea id="Reason" name="Reason" placeholder="请输入内容" class="layui-textarea"></textarea>
|
|
</div>
|
</div>
|
<div class="layui-inline">
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit
|
lay-filter="LAY-app-contlist-search">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索
|
</button>
|
</div>
|
|
<!-- 维护备注弹框 -->
|
<div class="layui-inline" id="divEditDemo" style="display: none; padding-top: 10px;">
|
<label class="layui-form-label">备注</label>
|
<div class="layui-input-inline" style="width: 300px;height: 100%;">
|
<textarea placeholder="请输入内容" id="NoticeDemo" name="NoticeDemo" class="layui-textarea"></textarea>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<div id="center">
|
</div>
|
|
<div class="layui-card-body">
|
<div class="position-relative"><!-- class="position-relative" --><!-- 自定义表头加上 -->
|
<table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
|
<!-- #region 自定义表头 -->
|
<div class="headerSetIcon">
|
<button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols">
|
<i class="layui-icon"></i>
|
</button>
|
</div>
|
<!-- #endregion -->
|
|
<script type="text/html" id="toolbarDemo1">
|
{{# function GetBtn1(d){
|
var html = '';
|
if (d.Status == '0' && d.Origin == '录入') {
|
html += `<a class="layui-btn layui-btn-normal layui-btn-xs editClass" lay-event="edit">
|
<i class="layui-icon layui-icon-edit"></i>编辑</a>`;
|
}
|
switch (d.Status) {
|
case "0" :
|
html += `<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del">
|
<i class="layui-icon layui-icon-delete"></i>删除</a>`;
|
break;
|
case "1" :
|
html += `<a class="layui-btn layui-btn-normal layui-btn-xs clossClass" lay-event="closs"> <i class="layui-icon layui-icon-ok"></i>关单</a>
|
<a class="layui-btn layui-btn-danger layui-btn-xs cheXiaoClass" lay-event="chexiao"> <i class="layui-icon layui-icon-delete"></i>撤销</a>`;
|
break;
|
case "2" :
|
html += `<a class="layui-btn layui-btn-normal layui-btn-xs clossClass" lay-event="closs"> <i class="layui-icon layui-icon-ok"></i>关单</a>
|
<a class="layui-btn layui-btn-danger layui-btn-xs cheXiaoClass" lay-event="chexiao"> <i class="layui-icon layui-icon-delete"></i>撤销</a>`;
|
break;
|
case "3" :
|
html += `<a class="layui-btn layui-btn-normal layui-btn-xs checkClass" lay-event="check"> <i class="layui-icon layui-icon-ok"></i>复核</a>`;
|
break;
|
default :
|
break;
|
}
|
html += `<a class="layui-btn layui-btn-normal layui-btn-xs editDemoClass" lay-event="editDemo">
|
<i class="layui-icon layui-icon-edit"></i>备注</a>`;
|
return html;
|
}
|
}}
|
{{ GetBtn1(d) }}
|
</script>
|
|
<!-- #region 自定义表头 -->
|
<script type="text/html" id="buttonTpl">
|
{{# function GetBtn3(d){
|
var html = ``;
|
if(d.Status=='0'){
|
html = `<button class="layui-btn layui-btn-radius layui-btn-xs">等待执行</button>`;
|
} else if(d.Status=='1') {
|
html = `<button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">正在执行</button>`;
|
} else if(d.Status=='2') {
|
html = `<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">执行完毕</button>`;
|
} else if(d.Status=='3') {
|
html = `<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">订单关闭</button>`;
|
} else if(d.Status=='4') {
|
html = `<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">上传完毕</button>`;
|
} else {
|
|
}
|
return html;
|
}
|
}}
|
{{ GetBtn3(d) }}
|
</script>
|
|
<script type="text/html" id="templetType">
|
{{# function GetBtn4(d){
|
var html = ``;
|
if(d.Type=='0'){
|
html = `成品入库`;
|
} else if(d.Type=='1') {
|
html = `采购入库`;
|
} else if(d.Type=='2') {
|
html = `中间品入库`;
|
}else if(d.Type=='3') {
|
html = `退货入库`;
|
}else if(d.Type=='4') {
|
html = `车间余料退回入库`;
|
}else if(d.Type=='5') {
|
html = `其它入库`;
|
}else if(d.Type=='6') {
|
html = `代储入库`;
|
}else if(d.Type=='7') {
|
html = `寄存入库`;
|
}else {
|
|
}
|
return html;
|
}
|
}}
|
{{ GetBtn4(d) }}
|
</script>
|
|
<script type="text/html" id="templetCompleteTime">
|
{{# function GetBtn5(d){
|
return formatDate2(d.CompleteTime);
|
}
|
}}
|
{{ GetBtn5(d) }}
|
</script>
|
|
<script type="text/html" id="templetCreateTime">
|
{{# function GetBtn6(d){
|
return formatDate(d.CreateTime);
|
}
|
}}
|
{{ GetBtn6(d) }}
|
</script>
|
|
<script type="text/html" id="templetUpdateTime">
|
{{# function GetBtn7(d){
|
return formatDate(d.UpdateTime);
|
}
|
}}
|
{{ GetBtn7(d) }}
|
</script>
|
|
<script type="text/html" id="templetCheckTime">
|
{{# function GetBtn11(d){
|
return formatDate(d.CheckTime);
|
}
|
}}
|
{{ GetBtn11(d) }}
|
</script>
|
<!-- #endregion -->
|
</div>
|
<div class="position-relative"><!-- class="position-relative" --><!-- 自定义表头加上 -->
|
<table id="LAY-app-content-list2" lay-filter="LAY-app-content-list2"></table>
|
<!--#region 自定义表头 -->
|
<div class="headerSetIcon">
|
<button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols2">
|
<i class="layui-icon"></i>
|
</button>
|
</div>
|
<!-- #endregion -->
|
|
<script type="text/html" id="toolbarDemo">
|
<button style="margin-right: 5px;" class="layui-btn layui-btn-sm layuiadmin-btn-list addClass" lay-event="add" >
|
<i class="layui-icon"></i>添加
|
</button>
|
</script>
|
|
<script type="text/html" id="toolbarDemoList">
|
{{# function GetBtn2(d){
|
console.log(d);
|
var html = ``;
|
if(d.Status == "0"){
|
html = `<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del">
|
<i class="layui-icon layui-icon-delete"></i>删除</a>`;
|
}
|
if(d.AsnType =="1" && (d.Status == "0" || d.Status == "1")){
|
html += `<a class="layui-btn layui-btn-normal layui-btn-xs addLabelClass" lay-event="Addlabel">
|
<i class="layui-icon layui-icon-edit"></i>生成标签</a>`;
|
}
|
if(d.AsnType == "4"&& (d.Status == "0" || d.Status == "1")){
|
html += `<a class="layui-btn layui-btn-normal layui-btn-xs addLabelClass" lay-event="Addlabel2">
|
<i class="layui-icon layui-icon-edit"></i>生成标签</a>`;
|
}
|
return html;
|
}
|
}}
|
{{ GetBtn2(d) }}
|
</script>
|
|
<!-- #region 自定义表头-->
|
<script type="text/html" id="templetCompleteTime2">
|
{{# function GetBtn8(d){
|
return formatDate(d.CompleteTime);
|
}
|
}}
|
{{ GetBtn8(d) }}
|
</script>
|
|
<script type="text/html" id="templetCreateTime2">
|
{{# function GetBtn9(d){
|
return formatDate(d.CreateTime);
|
}
|
}}
|
{{ GetBtn9(d) }}
|
</script>
|
|
<script type="text/html" id="templetUpdateTime3">
|
{{# function GetBtn10(d){
|
return formatDate(d.UpdateTime);
|
}
|
}}
|
{{ GetBtn10(d) }}
|
</script>
|
|
<script type="text/html" id="templetUDF5">
|
{{# function GetBtn11(d){
|
var html = ``;
|
if(d.UDF5=='1'){
|
html = `值1`;
|
} else if(d.UDF5=='2') {
|
html = `值2`;
|
} else if(d.UDF5=='3') {
|
html = `值3`;
|
}
|
return html;
|
}
|
}}
|
{{ GetBtn11(d) }}
|
</script>
|
<!-- #endregion -->
|
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<script src="../../layuiadmin/layui/layui.js"></script>
|
<script src="../../js/jquery-3.5.1.min.js"></script>
|
<script src="../../js/jquery.cookie.js"></script>
|
<script src="../../js/public.js"></script>
|
|
<script>
|
var uid = $.cookie('userId');
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'table', 'laypage', 'layer', 'laydate'], function () {
|
|
var doing = true;
|
|
var table = layui.table,
|
form = layui.form,
|
laypage = layui.laypage,
|
layer = layui.layer;
|
|
laydate = layui.laydate;
|
|
laydate.render({
|
elem: '#StartTime'
|
, format: 'yyyy-MM-dd', //可任意组合
|
});
|
laydate.render({
|
elem: '#EndTime'
|
, format: 'yyyy-MM-dd' //可任意组合
|
});
|
|
var h1 = GetTableTopHeight();
|
var h2 = GetTableBottomHeight();
|
|
|
refreshTable();
|
refreshTablemx("单号");
|
//渲染总单
|
//#region 自定义表头
|
var TotalColsArr = [[
|
{field: '',title: '序号',type:'numbers',width: 50,align: 'center',fixed: 'left', "disabled": true},
|
{field: 'ASNNo',title: '入库单号',align: 'center',fixed: 'left',sort: true,width: 180, "disabled": true},
|
{field: 'Status',title: '执行状态',align: 'center',templet: '#buttonTpl'},
|
{field: 'Origin',title: '来源',align: 'center',width: 80},
|
{field: 'CustomerName',title: '客户名称',align: 'center'},
|
{field: 'Type',title: '单据类型',align: 'center',templet: '#templetType'},
|
{field: 'CompleteTime',title: '完成时间',align: 'center',templet: '#templetCompleteTime'},
|
{field: 'Demo',title: '备注',align: 'center',width: 180},
|
{field: 'CreateUserName',title: '创建人',align: 'center',width: 110},
|
{field: 'CreateTime',title: '创建时间',align: 'center',templet: '#templetCreateTime'},
|
{field: 'UpdateUserName',title: '修改人',align: 'center',width: 110},
|
{field: 'UpdateTime',title: '修改时间',align: 'center',templet: '#templetUpdateTime'},
|
{field: 'CheckUserName',title: '复核人',align: 'center',width: 110},
|
{field: 'CheckTime',title: '复核时间',align: 'center',templet: '#templetCheckTime'},
|
{field: 'caozuo',title: '操作',fixed: 'right',width: 280,align: 'center',toolbar: '#toolbarDemo1', "disabled": true}
|
]];
|
var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码
|
//#endregion
|
function refreshTable() {
|
//#region 原始非自定义列
|
// var param = {
|
// ASNNo: $("#ASNNo").val(),
|
// Type: $("#Type").val(),
|
// Status: $("#Status").val(),
|
// CustomerName: $("#CustomerName").val(),
|
// LotNo: $("#LotNo").val(),
|
// SkuNo: $("#SkuNo").val(),
|
// SkuName: $("#SkuName").val(),
|
// StartTime:$("#StartTime").val(),
|
// EndTime: $("#EndTime").val()
|
// };
|
// table.render({
|
// elem: '#LAY-app-content-list',
|
// url: IP + "/BllAsn/GetArrivalNoticeList",
|
// method: 'POST',
|
// height: h1,
|
// id: 'LAY-app-content-list',
|
// where: param,
|
// contentType: 'application/json',
|
// headers:{ToKen:$.cookie('token')},
|
// page: true,
|
// even: true,
|
// limit: pageCnt,
|
// limits: pageLimits,
|
// cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
// done: function(res) {
|
// setRight();
|
|
// //aaa = $('#LAY-app-content-list').next().find('.layui-table-main').find('tr[data-index="0"]').find('td[data-field="ASNNo"]');
|
// // refreshTablemx(res.data[0].ASNNo);
|
// },
|
// cols: [
|
// [{
|
|
// title: '序号',
|
// type: 'numbers',
|
// width: 50,
|
// align: 'center',
|
// fixed: 'left'
|
// },
|
// {
|
// field: 'ASNNo',
|
// title: '入库单号',
|
// align: 'center',
|
// fixed: 'left',
|
// sort: true,
|
// width: 180
|
// },
|
// {
|
// field: 'Status',
|
// title: '执行状态',
|
// align: 'center',
|
// templet: function (d) {
|
// switch (d.Status) {
|
// case "0" : return '<button class="layui-btn layui-btn-radius layui-btn-xs">等待执行</button>';
|
// case "1" : return '<button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">正在执行</button>';
|
// case "2" : return '<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">执行完毕</button>';
|
// case "3" : return '<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">订单关闭</button>';
|
// default : return "";
|
// }
|
// }
|
// },
|
// {
|
// field: 'Origin',
|
// title: '来源',
|
// align: 'center',
|
// width: 80
|
// },
|
// {
|
// field: 'CustomerName',
|
// title: '客户名称',
|
// align: 'center'
|
// },
|
// {
|
// field: 'Type',
|
// title: '单据类型',
|
// align: 'center',
|
// templet: function (d) {
|
// switch (d.Type) {
|
// case "0" : return "标准产品入库";
|
// case "1" : return "非标产品入库";
|
// default : return "";
|
// }
|
// // JC08
|
// // switch (d.Status) {
|
// // case "0" : return "成品入库";
|
// // case "1" : return "原料入库";
|
// // case "2" : return "退货入库";
|
// // default : return "";
|
// // }
|
// }
|
// },
|
// {
|
// field: 'CompleteTime',
|
// title: '完成时间',
|
// align: 'center',
|
// hide:true,
|
// templet: function (d) {
|
// return formatDate2(d.CompleteTime);
|
// }
|
// },
|
// {
|
// field: 'CreateUserName',
|
// title: '创建人',
|
// align: 'center',
|
// width: 110
|
// },
|
// {
|
// field: 'CreateTime',
|
// title: '创建时间',
|
// align: 'center',
|
// templet: function (d) {
|
// return formatDate(d.CreateTime);
|
// }
|
// },
|
// {
|
// field: 'UpdateUserName',
|
// title: '修改人',
|
// align: 'center',
|
// hide:false,
|
// width: 110
|
// },
|
// {
|
// field: 'UpdateTime',
|
// title: '修改时间',
|
// align: 'center',
|
// hide:false,
|
// templet: function (d) {
|
// return formatDate(d.UpdateTime);
|
// }
|
// }, {
|
// title: '操作',
|
// fixed: 'right',
|
// width: 240,
|
// align: 'center',
|
// toolbar: '#toolbarDemo1'
|
// }]
|
// ]
|
// });
|
//#endregion
|
|
//#region 自定义表头
|
var colsJson
|
var param1={
|
Href:'BllAsn/GetArrivalNoticeList1'
|
};
|
sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function(res) {
|
if (res.code == 0){
|
if(res.data=='' || res.data==undefined || res.data==null){
|
colsJson=TotalColsArr
|
}else{
|
colsJson= eval(res.data);
|
}
|
}else{
|
colsJson=TotalColsArr
|
}
|
var param = {
|
ASNNo: $("#ASNNo").val(),
|
Type: '3',
|
Status: $("#Status").val(),
|
CustomerName: $("#CustomerName").val(),
|
LotNo: $("#LotNo").val(),
|
SkuNo: $("#SkuNo").val(),
|
SkuName: $("#SkuName").val(),
|
StartTime:$("#StartTime").val(),
|
EndTime: $("#EndTime").val()
|
};
|
table.render({
|
elem: '#LAY-app-content-list',
|
url: IP + "/BllAsn/GetArrivalNoticeList",
|
method: 'POST',
|
height: h1,
|
id: 'LAY-app-content-list',
|
where: param,
|
contentType: 'application/json',
|
headers:{ToKen:$.cookie('token')},
|
page: true,
|
even: true,
|
limit: pageCnt,
|
limits: pageLimits,
|
cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
done: function(res) {
|
setRight();
|
//自定义列宽
|
SetTableColW('LAY-app-content-list','BllAsn/GetArrivalNoticeList1',TotalColsSysArr);
|
},
|
cols: colsJson
|
});
|
});
|
//#endregion
|
}
|
// 入库单table单机事件
|
table.on('row(LAY-app-content-list)', function(obj) {
|
refreshTablemx(obj.data.ASNNo);
|
});
|
//渲染明细
|
//#region 自定义表头
|
var DetailColsArr = [[
|
{field: '',title: '序号',type:'numbers',width: 50,align: 'center',fixed: 'left', "disabled": true},
|
{field: 'ASNNo',title: '入库单号',align: 'center',fixed: 'left',sort: true,width: 180, "disabled": true},
|
{field: 'SkuNo',title: '物料编码',align: 'center',width: 100},
|
{field: 'SkuName',title: '物料名称',align: 'center',width: 200},
|
{field: 'Standard',title: '物料规格',align: 'center',width: 130},
|
{field: 'LotNo',title: '批次号',align: 'center',width: 100},
|
{field: 'SupplierLot',title: '供货批次',align: 'center',width: 100},
|
{field: 'Qty',title: '数量',align: 'center',width: 70},
|
{field: 'FactQty',title: '已组数量',align: 'center',width: 90},
|
{field: 'CompleteQty',title: '完成数量',align: 'center',width: 90},
|
{field: 'CompleteTime',title: '完成时间',align: 'center', width: 160,templet: '#templetCompleteTime2'},
|
{field: 'UnitName',title: '计量单位',align: 'center',width: 90},
|
{field: 'Price',title: '单价',align: 'center',width: 65},
|
{field: 'Money',title: '金额',align: 'center',width: 65},
|
{field: 'LotText',title: '批次描述',align: 'center',width: 120},
|
{field: 'PackagName',title: '包装名称',align: 'center',width: 110,},
|
{field: 'IsBale',title: '是否裹包',align: 'center',width: 150},
|
{field: 'IsBelt',title: '是否打带',align: 'center',width: 150},
|
{field: 'UDF1',title: '自定义列1',align: 'center',width: 140},
|
{field: 'UDF2',title: '自定义列2',align: 'center',width: 140},
|
{field: 'UDF3',title: '自定义列3',align: 'center',width: 140},
|
{field: 'UDF4',title: '自定义列4',align: 'center',width: 140},
|
{field: 'UDF5',title: '自定义列5',align: 'center',width: 140,templet:'#templetUDF5'},
|
{field: 'CreateUserName',title: '创建人',align: 'center',width: 100},
|
{field: 'CreateTime',title: '创建时间',align: 'center',width: 160,templet: '#templetCreateTime2'},
|
{field: 'UpdateUserName',title: '修改人',align: 'center',width: 150,},
|
{field: 'UpdateTime',title: '修改时间',align: 'center',width: 150,templet: '#templetUpdateTime3'},
|
{field: 'caozuo',title: '操作',fixed: 'right',width: 150,align: 'left',toolbar: '#toolbarDemoList', "disabled": true}
|
]];
|
var DetailColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(DetailColsArr)))//将表头数据进行url编码
|
//#endregion
|
function refreshTablemx(asnNo) {
|
//#region 原始非自定义列
|
// var param = {
|
// ASNNo:asnNo
|
// };
|
// table.render({
|
// elem: '#LAY-app-content-list2',
|
// url: IP + "/BllAsn/GetArrivalNoticeDetailList",
|
// method: 'POST',
|
// height: h2,
|
// id: 'LAY-app-content-list2',
|
// where: param,
|
// contentType: 'application/json',
|
// toolbar:'#toolbarDemo',
|
// defaultToolbar: ['filter'], //'print', 'exports'
|
// headers:{ToKen:$.cookie('token')},
|
// page: true,
|
// limit: pageCnt,
|
// limits: pageLimits,
|
// cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
// done: function() {
|
// setRight()
|
// },
|
// cols: [
|
// [{
|
|
// title: '序号',
|
// type: 'numbers',
|
// width: 50,
|
// align: 'center',
|
// fixed: 'left'
|
// },
|
// {
|
// field: 'ASNNo',
|
// title: '入库单号',
|
// align: 'center',
|
// fixed: 'left',
|
// sort: true,
|
// width: 180
|
// },
|
// {
|
// field: 'SkuNo',
|
// title: '物料编码',
|
// align: 'center',
|
// width: 100
|
// }, {
|
// field: 'SkuName',
|
// title: '物料名称',
|
// align: 'center',
|
// width: 200
|
// }, {
|
// field: 'Standard',
|
// title: '物料规格',
|
// align: 'center',
|
// width: 130
|
// }, {
|
// field: 'LotNo',
|
// title: '批次号',
|
// align: 'center',
|
// width: 100
|
// },{
|
// field: 'SupplierLot',
|
// title: '供货批次',
|
// align: 'center',
|
// fixed: 'right',
|
// width: 100,
|
// hide:true
|
// }, {
|
// field: 'Qty',
|
// title: '数量',
|
// align: 'center',
|
// width: 70
|
// }, {
|
// field: 'FactQty',
|
// title: '已组数量',
|
// align: 'center',
|
// width: 90
|
// }, {
|
// field: 'CompleteQty',
|
// title: '完成数量',
|
// align: 'center',
|
// width: 90
|
// },
|
// {
|
// field: 'CompleteTime',
|
// title: '完成时间',
|
// align: 'center',
|
// width: 160,
|
// templet: function (d) {
|
// return formatDate(d.CompleteTime);
|
// }
|
// },
|
// {
|
// field: 'UnitName',
|
// title: '计量单位',
|
// align: 'center',
|
// width: 90
|
// },
|
// {
|
// field: 'Price',
|
// title: '单价',
|
// align: 'center',
|
// width: 65,
|
// hide:true
|
// }, {
|
// field: 'Money',
|
// title: '金额',
|
// align: 'center',
|
// width: 65,
|
// hide:true
|
// },
|
// {
|
// field: 'LotText',
|
// title: '批次描述',
|
// align: 'center',
|
// width: 120
|
// },{
|
// field: 'PackagName',
|
// title: '包装名称',
|
// align: 'center',
|
// width: 110,
|
// }, {
|
// field: 'IsBale',
|
// title: '是否裹包',
|
// align: 'center',
|
// width: 150,
|
// hide:true
|
// }, {
|
// field: 'IsBelt',
|
// title: '是否打带',
|
// align: 'center',
|
// width: 150,
|
// hide:true
|
// },{
|
// field: 'CreateUserName',
|
// title: '创建人',
|
// align: 'center',
|
// width: 100
|
// },
|
// {
|
// field: 'CreateTime',
|
// title: '创建时间',
|
// align: 'center',
|
// width: 160,
|
// templet: function (d) {
|
// return formatDate(d.CreateTime);
|
// }
|
// },
|
// // {
|
// // field: 'Id',
|
// // title: '入库明细Id',
|
// // align: 'center',
|
// // hide: true,
|
// // width: 150,
|
// // },
|
// {
|
// field: 'UpdateUserName',
|
// title: '修改人',
|
// align: 'center',
|
// hide:true,
|
// width: 150,
|
// },
|
// {
|
// field: 'UpdateTime',
|
// title: '修改时间',
|
// align: 'center',
|
// hide:true,
|
// width: 150,
|
// templet: function (d) {
|
// return formatDate(d.UpdateTime);
|
// }
|
// }, {
|
// title: '操作',
|
// fixed: 'right',
|
// width: 100,
|
// align: 'left',
|
// toolbar: '#toolbarDemoList'
|
// }]
|
// ]
|
// });
|
//#endregion
|
|
//#region 自定义表头
|
var colsJson2
|
var param1={
|
Href:'BllAsn/GetArrivalNoticeDetailList1'
|
};
|
sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function(res) {
|
if (res.code == 0){
|
if(res.data=='' || res.data==undefined || res.data==null){
|
colsJson2=DetailColsArr
|
}else{
|
colsJson2= eval(res.data);
|
}
|
}else{
|
colsJson2=DetailColsArr
|
}
|
var param = {
|
ASNNo:asnNo
|
};
|
table.render({
|
elem: '#LAY-app-content-list2',
|
url: IP + "/BllAsn/GetArrivalNoticeDetailList",
|
method: 'POST',
|
height: h2,
|
id: 'LAY-app-content-list2',
|
where: param,
|
contentType: 'application/json',
|
toolbar:'#toolbarDemo',
|
defaultToolbar: [], //'filter','print', 'exports'
|
headers:{ToKen:$.cookie('token')},
|
page: true,
|
limit: pageCnt,
|
limits: pageLimits,
|
cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
done: function() {
|
setRight()
|
//自定义列宽
|
SetTableColW('LAY-app-content-list2','BllAsn/GetArrivalNoticeDetailList1',DetailColsSysArr);
|
},
|
cols: colsJson2
|
});
|
});
|
//#endregion
|
}
|
|
function setRight()
|
{
|
$(function() {
|
$(".addClass").hide();
|
$(".editClass").hide();
|
$(".delClass").hide();
|
$(".cheXiaoClass").hide();
|
$(".clossClass").hide();
|
$(".editDemoClass").hide();//备注
|
$(".checkClass").hide(); //复核
|
$(".addLabelClass").hide(); //复核
|
|
});
|
sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function(res) {
|
if (res.code == 0) { //成功
|
for (var k = 0; k < res.data.length; k++) {
|
if (res.data[k].MenuName == "添加入库单") {
|
$(function() {
|
$(".addClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "编辑入库单") {
|
$(function() {
|
$(".editClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "删除入库单") {
|
$(function() {
|
$(".delClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "撤销入库单") {
|
$(function() {
|
$(".cheXiaoClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "关闭入库单") {
|
$(function() {
|
$(".clossClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "维护入库单备注") {
|
$(function() {
|
$(".editDemoClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "复核入库单") {
|
$(function() {
|
$(".checkClass").show();
|
});
|
}
|
if (res.data[k].MenuName == "生成标签") {
|
$(function() {
|
$(".addLabelClass").show();
|
});
|
}
|
}
|
} else { //不成功
|
layer.msg('获取权限信息失败', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
});
|
}
|
|
// 页面监控,点击查询加载入库总单
|
form.on('submit(LAY-app-contlist-search)', function (data) {
|
refreshTable();
|
refreshTablemx("单号");
|
});
|
|
table.on('toolbar(LAY-app-content-list2)', function(obj){
|
if (obj.event == "add") {
|
layer.open({
|
type: 2,
|
title: '添加入库单据',
|
content: 'ArrivalReturnsNoticeDetail.html',
|
maxmin: true,
|
area: ['70%', '90%']
|
});
|
}
|
});
|
|
|
var ImportId = 0;
|
table.on('tool(LAY-app-content-list)', function (obj) {
|
var data = obj.data;
|
switch(obj.event)
|
{
|
case "edit" :
|
// 代码区域
|
var id = data.ASNNo;
|
layer.open({
|
type: 2,
|
title: '编辑入库单',
|
content: 'ArrivalReturnsNoticeDetail.html?id=' + id,
|
maxmin: true,
|
area: ['70%', '90%']
|
});
|
break;
|
case "del" :
|
layer.confirm('确定删除此单据吗?', function(index) {
|
// 代码区域
|
var param = {
|
ASNNo:data.ASNNo,
|
};
|
sendData(IP + "/BllAsn/DelArrivalNotice", param, 'post', function (res) {
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
refreshTable();
|
refreshTablemx("单号");
|
doing = true
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { doing = true });
|
}
|
});
|
});
|
break;
|
case "closs" :
|
// 代码区域
|
layer.confirm('确定关闭此单据吗?', function(index) {
|
// 代码区域
|
var param = {
|
Id:data.Id,
|
};
|
sendData(IP + "/UpApi/CloseAsn", param, 'post', function (res) {
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
refreshTable();
|
doing = true
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { doing = true });
|
}
|
});
|
});
|
|
break;
|
case "check" :
|
// 代码区域
|
layer.confirm('确定复核此单据吗?', function(index) {
|
// 代码区域
|
var param = {
|
Id:data.Id,
|
};
|
sendData(IP + "/UpApi/FinishAsn", param, 'post', function (res) {
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
refreshTable();
|
doing = true
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { doing = true });
|
}
|
});
|
});
|
|
break;
|
case "chexiao" :
|
layer.open({
|
type: 1,
|
title: '撤销申请',
|
content: $('#divReason'),
|
maxmin: true,
|
area: ['300px','265px'],
|
btn: ['确定', '取消'],
|
yes: function(index, layero) {
|
var pa = $('#Reason').val();
|
if (doing== true) {
|
doing= false;
|
|
var param = {
|
Id: data.Id,
|
Reason: pa,
|
};
|
console.log(param);
|
sendData(IP + "/BllAsn/CancelOrder", param, 'get', function(res) {
|
console.log(res);
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 3000 //1秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
refreshTable();
|
doing= true;
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 3000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
refreshTable();
|
doing= true;
|
});
|
}
|
layer.close(index);
|
});
|
}else{
|
layer.msg("请勿重复点击", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
}
|
|
}
|
});
|
|
break;
|
case "editDemo" :
|
$('#NoticeDemo').val(data.Demo);
|
layer.open({
|
type: 1,
|
title: '维护备注',
|
content: $('#divEditDemo'),
|
maxmin: false,
|
area: ['420px','260px'],
|
btn: ['确定', '取消'],
|
yes: function(index, layero) {
|
var demo = $('#NoticeDemo').val();
|
var param = {
|
id: data.Id,
|
demo: demo,
|
};
|
sendData(IP + "/BllAsn/EditNoticeDemo", param, 'get', function(res) {
|
if (res.code == 0) { //成功
|
refreshTable();
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 1500 //1秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 3000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {
|
refreshTable();
|
});
|
}
|
layer.close(index);
|
});
|
}
|
});
|
break;
|
default:break;
|
}
|
});
|
//明细表操作栏事件
|
table.on('tool(LAY-app-content-list2)', function (obj) {
|
var data = obj.data;
|
var id = data.Id;
|
switch(obj.event)
|
{
|
case "del" :
|
layer.confirm('确定删除入库单明细吗?', function(index) {
|
// 代码区域
|
var param = {
|
ASNNo:data.ASNNo,
|
Id:data.Id,
|
};
|
sendData(IP + "/BllAsn/DelArrivalNoticeDetail", param, 'post', function (res) {
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
refreshTable();
|
refreshTablemx(data.ASNNo);
|
doing = true
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { doing = true });
|
}
|
});
|
});
|
|
break;
|
case "Addlabel" :
|
layer.open({
|
type: 2,
|
title: '生成标签',
|
content: 'LabelPrintSelect.html?Id='+id+'&SupplierLot='+data.SupplierLot,
|
maxmin: true,
|
area: ['480px', '615px'],
|
btn: ['确定','取消'],
|
yes: function(index, layero){
|
var iframeWindow = window['layui-layer-iframe'+ index]
|
,submitID = 'layuiadmin-app-form-edit'
|
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
//监听提交
|
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
var field = data.field; //获取提交的字段
|
console.log(field);
|
//提交 Ajax 成功后,静态更新表格中的数据
|
//"&Level="+field.level+"&Type="+field.type+"&BoxType="+field.boxType+"&Qty="+field.qty+
|
var str = "Id="+id+"&IsReset="+field.reset+"&ArriveQty="+field.arriveQty+"&ProductionTime="+field.productionTime+"&ExpirationTime="+field.expirationTime+"&StoreTime="+field.storeTime+"&SupplierLot="+field.SupplierLot;
|
|
layer.open({
|
type: 2,
|
title: '生成标签',
|
content: 'LabelPrint.html?'+str,
|
maxmin: true,
|
area: ['660px', '660px'],
|
btn: ['取消'],
|
|
|
});
|
});
|
submit.trigger('click');
|
}
|
|
});
|
|
break;
|
case "Addlabel2" :
|
layer.open({
|
type: 2,
|
title: '生成标签',
|
content: 'LabelPrintSelect.html?Id='+id+'&Type=4',
|
maxmin: true,
|
area: ['480px', '615px'],
|
btn: ['确定','取消'],
|
yes: function(index, layero){
|
var iframeWindow = window['layui-layer-iframe'+ index]
|
,submitID = 'layuiadmin-app-form-edit'
|
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
//监听提交
|
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
var field = data.field; //获取提交的字段
|
console.log(field);
|
//提交 Ajax 成功后,静态更新表格中的数据
|
//"&Level="+field.level+"&Type="+field.type+"&BoxType="+field.boxType+"&Qty="+field.qty+
|
var str = "Id="+id+"&IsReset="+field.reset+"&ArriveQty="+field.arriveQty+"&ProductionTime="+field.productionTime+"&ExpirationTime="+field.expirationTime+"&StoreTime="+field.storeTime;
|
|
layer.open({
|
type: 2,
|
title: '生成标签',
|
content: 'LabelPrint.html?'+str,
|
maxmin: true,
|
area: ['660px', '660px'],
|
btn: ['取消'],
|
|
|
});
|
});
|
submit.trigger('click');
|
}
|
|
});
|
|
break;
|
default:break;
|
}
|
});
|
|
//#region 自定义表头
|
//自定义表头
|
active = {
|
customCols: function(){
|
layer.open({
|
type: 2,
|
title: '自定义列',
|
content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetArrivalNoticeList1&ColsSysArr='+TotalColsSysArr,
|
maxmin: false,
|
resize: false,
|
area: ['970px', '650px']
|
});
|
},
|
customCols2: function(){
|
layer.open({
|
type: 2,
|
title: '自定义列',
|
content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetArrivalNoticeDetailList1&ColsSysArr='+DetailColsSysArr,
|
maxmin: false,
|
resize: false,
|
area: ['970px', '650px']
|
});
|
}
|
|
};
|
$('.layui-btn').on('click', function() {
|
var type = $(this).data('type');
|
active[type] ? active[type].call(this) : '';
|
});
|
//#endregion
|
});
|
</script>
|
</body>
|
|
</html>
|