<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; 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, maximum-scale=1">
|
<!--引用layui样式文件-->
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
<!--引用layui js文件-->
|
<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>
|
<style>
|
.layui-col-xs4 {
|
width: 12.333333%
|
}
|
|
.layui-col-xs8 {
|
width: 55.666667%;
|
}
|
</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">
|
<table class="" id="mainTable" lay-filter="mainTable"></table>
|
</form>
|
</div>
|
</div>
|
<div class="layer-footer" style="z-index: 10; position: fixed; text-align: center; bottom: 0; width:100%; height:50px">
|
<div class="layui-row">
|
<!--<div class="layui-col-xs3">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="cmdLoadData" id="cmdLoadData">提交</button>
|
</div>
|
<div class="layui-col-xs3">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">删除</button>
|
</div>-->
|
<div class="layui-col-xs3">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="cmdCancel">退出</button>
|
</div>
|
<div class="layui-col-xs3">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="cmdExport">导出</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script>
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element'], function () {
|
|
//#region 公共变量
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element;
|
var HBillType = '9999'
|
var HMaker = sessionStorage["HUserName"]
|
var HStockOrgID = sessionStorage["OrganizationID"]
|
var option = [];
|
|
var ins; //用于导出excel
|
//#endregion
|
|
//#region 判断是否登录 未登录则跳到登录页
|
if (sessionStorage.login != "login") {
|
layer.confirm("登录失效,请重新登录!", {
|
icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
|
}, function () { window.location.href = "../../../user/login.html"; });
|
}
|
//#endregion
|
|
//#region 初始化界面
|
set_ClearBill();
|
//#endregion
|
|
|
|
//#region 扫描客户物料条码
|
//#region 显示客户物料条码列表信息
|
function DisBillEntryList() {
|
var ajaxLoad = layer.load();
|
|
var colList = []; //获取列信息
|
var finalData = [];
|
var returnCode = false;
|
var errorMessage = "";
|
//获取
|
var initData = getUrlVars_JSON().data;
|
for (var t = 0; t < initData.length; t++) {
|
var HInterID = initData[t].HInterID_Temp;
|
var HBillNo = decodeURIComponent(initData[t].HBillNo_Temp);
|
var HBillNo_Temp = HBillNo;
|
HBillNo += "' and HInterID = '" + HInterID;
|
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + '/WEBSController/Gy_getCusBarCodeBill_rushedBarCodeList_CodeList',
|
async: false,
|
data: { "HInterID": HInterID, "HBillNo": HBillNo, "HBillType": HBillType, "HOrgID": HStockOrgID },
|
success: function (data1) {
|
if (data1.count == 1) {
|
for (var i = 0; i < data1.data.length; i++) {
|
if (data1.data[i].HBillNo == HBillNo_Temp) {
|
finalData.push(data1.data[i]);
|
}
|
}
|
} else {
|
returnCode = true;
|
errorMessage = "内码[" + HInterID + "]-单据号[" + HBillNo_Temp + "]:" + data1.Message + ";";
|
}
|
},
|
complete: function (XHR, TS) { XHR = null },//回收资源
|
error: function (e) {
|
returnCode = true;
|
errorMessage = "内码[" + HInterID + "]-单据号[" + HBillNo_Temp + "]:接口请求失败!";
|
}
|
});
|
|
if (returnCode) {
|
layer.alert(errorMessage, { icon: 5 });
|
layer.close(ajaxLoad);
|
return;
|
}
|
}
|
|
option.data = finalData;
|
ins = table.render(option);
|
layer.close(ajaxLoad);
|
}
|
//#endregion
|
//#endregion
|
|
//#region 功能控件
|
//#region 退出功能控件
|
form.on('submit(cmdCancel)', function () {
|
layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
|
Pub_Close(1);
|
});
|
})
|
//#endregion
|
|
//#region 导出功能控件
|
form.on('submit(cmdExport)', function () {
|
get_Export();
|
})
|
//#endregion
|
//#endregion
|
|
//#region 页面其它方法
|
//#region 页面初始化方法
|
function set_ClearBill() {
|
set_InitGrid(); //初始化表格
|
|
//查询数据
|
DisBillEntryList();
|
}
|
//#endregion
|
|
//#region 初始化表格方法
|
function set_InitGrid() {
|
option = {
|
elem: '#mainTable'
|
, height: 'full-50'
|
//, page: true
|
, cellMinWidth: 90
|
, limit: 10000000
|
//, limits: [50, 500, 5000, 20000]
|
, toolbar: '#toolbarDemo'
|
, data: []
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
, { type: 'numbers', title: '序号', width: 100 }
|
, { field: 'HItemID', title: 'HItemID', hide: true }
|
, { field: 'HInterID', title: 'HInterID', hide: true }
|
, { field: 'HBillNo', title: '单据号', width: 125, sort: true }
|
, { field: 'HBillType', title: '单据类型', width: 125, sort: true, hide: true }
|
, { field: 'HBarCode', title: '条码编号', width: 125, sort: true }
|
, { field: 'HQty', title: '数量', width: 125, sort: true, hide: true }
|
, { field: 'HOrgID', title: 'HOrgID', sort: true, hide: true }
|
, { field: 'HDate', title: '日期', width: 125, sort: true }
|
, { field: 'HRelationInterID', title: 'HRelationInterID', width: 125, sort: true, hide: true }
|
, { field: 'HMaker', title: '扫码人', width: 125, sort: true }
|
]]
|
};
|
|
table.render(option);
|
}
|
//#endregion
|
|
//#region 获取参数_传递的JSON格式参数
|
function getUrlVars_JSON() {
|
var datajson;
|
var str = window.location.search; //获取链接中传递的参数
|
var arr = str.substring(str.lastIndexOf("=") + 1);
|
datajson = $.parseJSON(decodeURI(arr));
|
return datajson;
|
}
|
//#endregion
|
|
//#region 导出Execel
|
function get_Export() {
|
table.exportFile(ins.config.id, option.data, "xls");
|
|
//var ModRightNameCheck = "Xs_SeOrderBillList_ExportExcel";
|
|
////逻辑审核方法
|
//$.ajax({
|
// type: "GET",
|
// url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //方法所在页面和方法名
|
// data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
|
// success: function (result) {
|
// if (result.count == 1) {
|
// table.exportFile(ins.config.id, option.data, "xls");
|
// } else {
|
// layer.alert("当前模块没有导出权限!", { icon: 5 });
|
// }
|
// }, error: function () {
|
// layer.alert("接口请求失败!", { icon: 5 });
|
// }
|
//});
|
}
|
//#endregion
|
//#endregion
|
});
|
|
</script>
|
|
</body>
|
</html>
|