|
|
<!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">
|
</head>
|
<body>
|
|
<div class="layui-card layadmin-header">
|
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
<a lay-href="">主页</a>
|
<a><cite>组件</cite></a>
|
<a><cite>数据表格</cite></a>
|
<a><cite>数据表格的重载</cite></a>
|
</div>
|
</div>
|
|
<div class="layui-fluid">
|
<div class="layui-row layui-col-space15">
|
<div class="layui-col-md12">
|
<div class="layui-card">
|
<div class="layui-card-header">送货单列表</div>
|
<div class="layui-card-body">
|
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
单据号:
|
<div class="layui-inline">
|
<input class="layui-input" name="HBillNo" id="HBillNo" autocomplete="off">
|
</div>
|
<button class="layui-btn" data-type="f_Query">查询</button>
|
<button class="layui-btn" data-type="f_Qrjq">确认交期</button>
|
<button class="layui-btn" data-type="f_Bhjq">驳回交期</button>
|
<button class="layui-btn" data-type="f_Jumppage">生成送货单</button>
|
</div>
|
<table class="layui-hide" id="test-table-reload" lay-filter="user"></table>
|
<blockquote class="layui-elem-quote">要货通知单列表</blockquote>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<!--<script src="../../layuiadmin/layui/lay/modules/mobile/jquery-3.3.1.min.js"></script>-->
|
<script src="../../layuiadmin/layui/layui.js"></script>
|
<!--<script src="../../layuiadmin/layui/JavaScript1.js"></script>-->
|
<script>
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'table'], function () {
|
var table = layui.table;
|
var $ = layui.$;
|
var layer = layui.layer;
|
RoadHBillNo("and 1=1");
|
layer.load(3)
|
//方法级渲染
|
table.render({
|
elem: '#test-table-reload'
|
, dateType: 'json'
|
, colFilterRecord: true//是否开启字段筛选的记忆功能
|
, data: []
|
// , url: 'http://localhost:8083/Web/GetSup_PODemandPlanBilList'
|
, toolbar: '#toolbarDemo'
|
//, where: { msg: "", NowPage: 1, OnePage: 10 }
|
// , where: { sqlWhere: "178070" }
|
, cols: [[
|
{ checkbox: true, fixed: true }
|
, { field: 'HState', title: '单据状态', width: 100, edit: 'text', sort: true, fixed: true }
|
, { field: 'HBillno', title: '单据号', width: 200, sort: true, edit: 'text', sort: true, fixed: true }
|
, { field: 'HMTONO', title: '计划跟踪单号', width: 100, edit: 'text', hide: true }
|
, { field: 'HSupName', title: '供应商', width: 150, edit: 'text' }
|
, { field: 'HMaterNumber', title: '物料代码', width: 200, edit: 'text' }
|
, { field: 'HMaterName', title: '物料名称', width: 200, edit: 'text' }
|
, { field: 'HMaterModel', title: '规格型号', width: 200, edit: 'text' }
|
, { field: 'HUnitName', title: '计量单位', width: 100, edit: 'text' }
|
, { field: 'HQty', title: '数量', width: 100, edit: 'text' }
|
// , { field: '日期', title: '单据日期', width: 150, edit: 'text' }
|
, { field: 'HDate', title: '单据日期', width: 130, edit: 'text' }
|
, { field: 'HJHDate', title: '交货日期', width: 150, edit: 'text' }
|
, { field: 'HUnitID', title: '单位ID', width: 150, edit: 'text', hide: true }
|
, { field: 'HSupID', title: '供应商ID', width: 150, edit: 'text', hide: true }
|
, { field: 'hmainid', title: '主键', width: 150, edit: 'text', hide: true }
|
, { field: 'hsubid', title: '子表主键', width: 150, edit: 'text', hide: true }
|
, { field: 'HManagerID', title: '主管ID', width: 100, edit: 'text', hide: true }
|
, { field: 'hmanagerName', title: '主管', width: 100, edit: 'text', hide: true }
|
, { field: 'HEmpID', title: '职员ID', width: 100, edit: 'text', hide: true }
|
, { field: 'HRemark', title: '表头备注', width: 150, edit: 'text', hide: true }
|
, { field: 'HMaker', title: '制单人', width: 100, edit: 'text', hide: true }
|
, { field: 'HMakedate', title: '制单日期', width: 100, edit: 'text', hide: true }
|
, { field: 'HChecker', title: '审核人', width: 100, edit: 'text', hide: true }
|
, { field: 'HCheckdate', title: '审核日期', width: 100, edit: 'text', hide: true }
|
//, { field: 'hmanagerName', title: '主管', width: 100, edit: 'text', hide: true }
|
//, { field: 'HRemark', title: '备注', width: 100, edit: 'text', hide: true }
|
//, { field: 'HChecker', title: '审核人', width: 100, edit: 'text', hide: true }
|
//, { field: 'HCheckdate', title: '审核日期', width: 100, edit: 'text', hide: true }
|
//, { field: 'HMaker', title: '制单人', width: 100, edit: 'text', hide: true }
|
//, { field: 'HMakedate', title: '制单日期', width: 100, edit: 'text', hide: true }
|
//, { field: 'hmainid', title: '主键', width: 100, edit: 'text' }
|
//, { field: 'hsubid', title: '子表主键', width: 100, edit: 'text' }
|
]]
|
, page: true
|
, height: 500
|
, done: function () {
|
layer.closeAll("loading");
|
}
|
});
|
///加载显示数据
|
function RoadHBillNo (sqlWhere) {
|
where = sqlWhere;
|
$.ajax({
|
type: "get",
|
url: "http://localhost:8083/Web/GetSup_PODemandPlanBilList",
|
async: true,
|
data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere },
|
success: function (result) {
|
ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
|
table.reload('test-table-reload', {
|
data: ajaxReturnData
|
, height: 'full-10'
|
, loading: false
|
, done: function (index, res) {
|
|
}
|
});
|
},
|
error: function (result) {
|
console.log(result);
|
//layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 });
|
}
|
});
|
};
|
//定义事件集合
|
var $ = layui.$, active = {
|
reload: function () {
|
var demoReload = $('#HBillNo');
|
//执行重载
|
table.reload('test-table-reload', {
|
page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
, where: {
|
key: {
|
id: demoReload.val()
|
}
|
}
|
});
|
},
|
//快速查询
|
f_Query:function(){ //查询
|
var sqlWhere = " and 1=1 ";
|
if ($("#HBillNo").val() != "")
|
sqlWhere += " and 单据号 like ''%" + $("#HBillNo").val() + "%''";
|
RoadHBillNo(sqlWhere);
|
},
|
f_Qrjq: function () { //确认交期
|
var checkStatus = table.checkStatus('test-table-reload')
|
, data = checkStatus.data;
|
for (var i = 0; i < data.length; i++) {
|
// rows += data[i].hmainid.toString() + ',' + data[i].hsubid.toString() + ';';
|
if (data[i].HState == "未确认")
|
{
|
$.ajax({
|
type: "get",
|
url: "http://localhost:8083/Web/UpdateBill",
|
data: { "HInterID": data[i].hmainid.toString(), "HEntryID": data[i].hsubid.toString(), "HState": "2" },
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
layer.msg(result.Message, { icon: 1 });
|
RoadHBillNo("and 1=1");
|
}
|
else {
|
// $("#verifycode").click();
|
layer.msg(result.Message, { icon: 5 });
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
else
|
{
|
layer.msg("必须是未确认单据才能进行确认操作!", { icon: 5 });
|
}
|
}
|
},
|
f_Bhjq: function () { //驳回交期
|
var checkStatus = table.checkStatus('test-table-reload')
|
, data = checkStatus.data;
|
for (var i = 0; i < data.length; i++) {
|
// rows += data[i].hmainid.toString() + ',' + data[i].hsubid.toString() + ';';
|
if (data[i].HState == "未确认")
|
{
|
$.ajax({
|
type: "get",
|
url: "http://localhost:8083/Web/UpdateBill",
|
data: { "HInterID": data[i].hmainid.toString(), "HEntryID": data[i].hsubid.toString(), "HState": "1" },
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
layer.msg("驳回成功!", { icon: 1 });
|
RoadHBillNo("and 1=1");
|
}
|
else {
|
// $("#verifycode").click();
|
layer.msg(result.Message, { icon: 5 });
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
else
|
{
|
layer.msg("必须是未确认单据才能进行驳回操作!", { icon: 5 });
|
}
|
|
}
|
},
|
f_Jumppage: function () {//送货单
|
var checkStatus = table.checkStatus('test-table-reload')
|
, data = checkStatus.data;
|
ajaxLabelData = data;
|
var rows = '';
|
var HEntry = '';
|
for (var i = 0; i < data.length; i++) {
|
if (data[i].HState == "已确认")
|
{
|
rows += data[i].hmainid.toString() + ',' + data[i].hsubid.toString() + ';';
|
}
|
else
|
{
|
HEntry += i + ',';
|
}
|
}
|
if (HEntry != '')
|
{
|
layer.msg("第" + HEntry + "行未确认!", { icon: 5 });
|
}
|
//layer.alert(rows);
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '送货单'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: false //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../views/WarM/KF_POInStockBill.html?linterid=' + data[0].hmainid + '&lentryid=' + rows.toString(), 'yes']
|
// , content: ['../../views/WarM/KF_POInStockBill.html?linterid=' + JSON.stringify(data), 'yes']
|
// , content: ['../../views/WarM/KF_POInStockBill.html?linterid=' + rows, 'yes']
|
, resize: false
|
, cancel: function () {
|
$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
},
|
f_Jumppages: function () {//送货单
|
var checkStatus = table.checkStatus('test-table-reload')
|
, data = checkStatus.data;
|
ajaxSHDData = data;
|
window.open('../../views/WarM/KF_POInStockBill.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no');
|
}
|
};
|
$('.test-table-reload-btn .layui-btn').on('click', function () {
|
var type = $(this).data('type');
|
active[type] ? active[type].call(this) : '';
|
});
|
});
|
</script>
|
</body>
|
</html>
|