<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8" />
|
<title>条码出入库记录表</title>
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/PubCustom.js"></script>
|
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
|
<style type="text/css">
|
input.layui-input.layui-unselect {
|
padding-right: 0;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="layui-fluid">
|
<div class="layui-col-md12">
|
<div class="layui-card" style="padding: 1px">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="component-form-group">
|
<div class="layui-collapse">
|
<div class="layui-colla-item">
|
<div class="layui-inline">
|
<label class="layui-form-label">单据内码</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" id="HInterID" style="width:190px;" disabled="disabled">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">单据号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" id="HBillNo" style="width:190px;" disabled="disabled">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">单据类型</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" id="HBillType" style="width:190px;" disabled="disabled">
|
</div>
|
</div>
|
<!--
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
|
-->
|
<div class="layui-colla-content">
|
<!--
|
<div class="layui-inline">
|
<label class="layui-form-label">条形码</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HBarCode" id="HBarCode" style="width:190px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">物料名称</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="MaterialName" id="MaterialName" style="width:190px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">仓库</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="sWH" id="sWH" style="width:190px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">仓位</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="sSP" id="sSP" style="width:190px;">
|
</div>
|
</div>
|
<hr />
|
<div class="layui-inline">
|
<label class="layui-form-label">批号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="sBatchNo" id="sBatchNo" style="width:190px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">单据号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="BillNo" id="BillNo" style="width:190px;">
|
</div>
|
</div>
|
-->
|
<!--<div class="layui-inline">
|
<label class="layui-form-label">制单人</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="Hmaker" id="Hmaker" style="width:190px;">
|
</div>
|
</div>-->
|
</div>
|
</div>
|
</div>
|
<table class="" id="mainTable" lay-filter="mainTable"></table>
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
|
</div>
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<script>
|
var cols_arr = []; //存储表格头的数组
|
var table = null;
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index', //主入口模块
|
}).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
|
//#region 公共变量
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element
|
, laypage = layui.laypage
|
, laydate = layui.laydate
|
, util = layui.util
|
|
var resultTableHead = []; //获取列表头字段自定义列数组
|
//获取传递的参数
|
var params = get_UrlVars();
|
var HInterID = params.HInterID; //单据内码
|
var HBillType = params.HBillType; //单据类型
|
var HBillNo = params.HBillNo; //单据号
|
var sWhere = HInterID + ",'" + HBillType + "','" + HBillNo + "'"; //拼接传递的参数
|
//#endregion
|
|
//#region 进入页面加载
|
|
//初始化表单插件
|
set_InitFrom();
|
//初始化界面
|
set_ClearBill( sWhere);
|
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
//// 查询按钮
|
//form.on('submit(btnSearch)', function (data) {
|
// /*get_FastQuery();*/
|
//});
|
|
//// 重置按钮
|
//form.on('submit(btnReSearch)', function (data) {
|
// //清空过滤条件
|
// /*set_ClearQuery();*/
|
//});
|
|
//#endregion
|
|
//#region 此页面所有的方法
|
|
// 初始化界面
|
function set_ClearBill(sWhere) {
|
//给页面上侧便签赋值
|
$("#HInterID").val(HInterID);
|
$("#HBillNo").val(HBillNo);
|
switch (HBillType)
|
{
|
case "1201":
|
$("#HBillType").val("外购入库单");
|
break;
|
case "1202":
|
$("#HBillType").val("产品入库单");
|
break;
|
case "1203":
|
$("#HBillType").val("其它入库单");
|
break;
|
case "1204":
|
$("#HBillType").val("生产领料");
|
break;
|
case "1206":
|
$("#HBillType").val("其它出库单");
|
break;
|
case "1207":
|
$("#HBillType").val("直接调拨单");
|
break;
|
case "1210":
|
$("#HBillType").val("委外加工入库单");
|
break;
|
case "1211":
|
$("#HBillType").val("委外加工出库单");
|
break;
|
}
|
resultTableHead = []; //清空表头列,防止重复渲染
|
//初始查询
|
get_Display( sWhere);
|
}
|
|
// 初始化表单
|
function set_InitFrom() {
|
//laydate.render({
|
// elem: '#HStartDate'
|
//});
|
//laydate.render({
|
// elem: '#HEndDate'
|
//});
|
//$("#HStartDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
|
//$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
|
}
|
|
//region 初始化表格方法
|
function set_InitGrid( sWhere) {
|
//填充表格头数组
|
var data = resultTableHead;
|
|
cols_arr[0] = [];
|
cols_arr[0][0] = { checkbox: true, fixed: true, totalRowText: '合计' };
|
for (var i = 0; i < data.length; i++) {
|
if (data[i].name == 'HItemID') {
|
cols_arr[0][i + 1] = { field: data[i].id, title: data[i].name, align: 'center', hide: true }; //隐藏id列
|
}
|
else {
|
switch (data[i].name) {
|
//int
|
case '数量':
|
cols_arr[0][i + 1] = { field: data[i].id, title: data[i].name, align: 'center', totalRow: true, sort: true };
|
break;
|
//Decimal
|
//case 'Decimal':
|
// cols_arr[0][i + 1] = { field: data[i].id, title: data[i].name, align: 'center', totalRow: true, sort: true };
|
// break;
|
default:
|
cols_arr[0][i + 1] = { field: data[i].id, title: data[i].name, align: 'center', sort: true };
|
}
|
}
|
}
|
|
//填充表格数据
|
table.render({
|
elem: '#mainTable',
|
url: GetWEBURL() + '/Kf_ICStockInOutBill/Kf_BarCodeDetailQuery',
|
toolbar: '#toolbarDemo', //开启头部工具栏,并为其绑定左侧模板
|
title: '出入口单据条码明细',
|
cols: cols_arr, //填充表格头数据,
|
id: 'mainTable', //表格id
|
where: { "sWhere": sWhere }, //扩展参数,可以传数据到后台
|
page: false, //关闭分页
|
totalRow: true, //开启合计
|
limit: 50, //一页能够显示的最大数目
|
limits: [50, 500, 5000, 20000], //控制多少行一页(默认五条一页)
|
method: 'get', //提交方式
|
layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
|
parseData: function (res) { //res 为返回的数据
|
if (res.code == "0") {
|
return {
|
"msg": res.Message
|
}
|
}
|
},
|
response: {
|
statusCode: 1 //重新规定成功的状态码为 1,table 组件默认为 0
|
},
|
done: function (res) { //返回数据执行回调函数
|
layer.close(layer.index); //返回数据关闭loading
|
}
|
});
|
sWhere = {};
|
}
|
|
|
//进入页面显示的缓存列表
|
function get_Display( sWhere) {
|
var ajaxLoad = layer.load();
|
//sWhere = JSON.stringify(sWhere);
|
$.ajax({
|
//url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
|
url: GetWEBURL() + '/Kf_ICStockInOutBill/Kf_BarCodeDetailQuery',
|
type: "GET",
|
data: { "sWhere": sWhere },
|
async: false,
|
dataType: "json",//数据类型可以为 text xml json script jsonp
|
success: function (data1) {
|
for (var key in data1.list) {
|
resultTableHead.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
|
}
|
set_InitGrid( sWhere);
|
}, error: function (err) {
|
layer.alert(err.Message, { icon: 5 });
|
}
|
});
|
}
|
|
//// 重置过滤条件
|
//function set_ClearQuery() {
|
// //$("#HStartDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
|
// //$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
|
// //$("#BillNo").val("");//单据号
|
// //$("#HBarCode").val("");//条形码
|
// //$("#BillType").val("全部");//单据类型
|
// //$("#MaterialName").val("");//物料名称
|
// //$("#sBatchNo").val("");//批号
|
// //$("#sSP").val("");//仓位
|
// //$("#sWH").val("");//仓库
|
|
// //form.render();
|
// ////$("#Hmaker").val();//制单人
|
// //sWhere = {};
|
// //get_FastQuery();
|
//}
|
|
//// 快速过滤
|
//function get_FastQuery() {
|
|
// var HStartDate = $("#HStartDate").val();
|
// var HEndDate = $("#HEndDate").val();
|
// var BillNo = $("#BillNo").val();//单据号
|
// var HBarCode = $("#HBarCode").val();//条形码
|
// var BillType = $("#BillType").val();//单据类型
|
// var MaterialName = $("#MaterialName").val();//物料名称
|
// var sBatchNo = $("#sBatchNo").val();//批号
|
// var sSP = $("#sSP").val();//仓位
|
// var sWH = $("#sWH").val();//仓库
|
// //存储为JSON字符串
|
// var sWhere = {
|
// "HStartDate": HStartDate,
|
// "HEndDate": HEndDate,
|
// "BillNo": BillNo,
|
// "HBarCode": HBarCode,
|
// "BillType": BillType,
|
// "MaterialName": MaterialName,
|
// "sBatchNo": sBatchNo,
|
// "sSP": sSP,
|
// "sWH": sWH,
|
// };
|
// //alert(JSON.stringify(sWhere));
|
// set_ClearBill( sWhere);
|
//}
|
//#endregion
|
|
//以上是layui模块
|
});
|
|
</script>
|
</body>
|
</html>
|