|
|
<!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="../../layuiadmin/layui/css/style-self.css" media="all">
|
<style type="text/css">
|
.layui-input-block {
|
width: 190px;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="layui-fluid">
|
<div class="layui-row layui-col-space15">
|
<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-colla-title layui-inline">
|
<div class="layui-inline">
|
<span>更多</span>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">单据号</label>
|
<div class="layui-input-block" style="width:150px;">
|
<input type="text" class="layui-input" name="HBillNo" id="HBillNo">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">采购订单号</label>
|
<div class="layui-input-block" style="width:150px;">
|
<input type="text" class="layui-input" name="HBillNoFrom" id="HBillNoFrom">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">开始日期</label>
|
<div class="layui-input-block" style="width:120px;">
|
<input type="text" class="layui-input" name="HDate1" id="HDate1">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">结束日期</label>
|
<div class="layui-input-block" style="width:120px;">
|
<input type="text" class="layui-input" name="HDate2" id="HDate2">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">单据状态</label>
|
<div class="layui-input-block">
|
<select id="HClStatus" name="HClStatus" lay-filter="">
|
<option value="" selected="">全部</option>
|
<option value="未审核">未审核</option>
|
<option value="已审核">已审核</option>
|
<option value="未关闭">未关闭</option>
|
<option value="已关闭">已关闭</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">物料编码</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">物料名称</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HName" id="HName">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">供应商</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HSupName" id="HSupName">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
<div class="layui-colla-content" style="padding-left:82px">
|
<div class="layui-inline">
|
<label class="layui-form-label">旧物料编码</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HOldMaterNumber" id="HOldMaterNumber">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">规格型号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HModel" id="HModel">
|
</div>
|
</div>
|
<div class="layui-inline" style="display:none">
|
<label class="layui-form-label">订单状态</label>
|
<div class="layui-input-block">
|
<select name="HStatus" id="HStatus" lay-filter="">
|
<option value="" selected="">全部</option>
|
<option value="未打印">未打印</option>
|
<option value="未到货">未到货</option>
|
<option value="已到货">已到货</option>
|
<option value="未生成条码">未生成条码</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline" style="display:none">
|
<label class="layui-form-label">送货单号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HInnerBillNo" id="HInnerBillNo">
|
</div>
|
</div>
|
<div class="layui-inline" style="display:none;">
|
<label class="layui-form-label">物料代码</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HNumber" id="HNumber">
|
</div>
|
</div>
|
</div>
|
|
</div>
|
</div>
|
</form>
|
</div>
|
<table class="layui-hide" 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-getCheckData"><i class="layui-icon layui-icon-tips"></i>预览</button>-->
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>审核</button>
|
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm"><i class="layui-icon layui-icon-ok-circle"></i>确认</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back"><i class="layui-icon layui-icon-close-fill"></i>驳回</button>-->
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>详情</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-changebg"><i class="layui-icon layui-icon-form"></i>变更</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印送货单</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print-Convenient"><i class="layui-icon layui-icon-print"></i>一键打印</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>生成条码</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-HideColumn"><i class="layui-icon layui-icon-return"></i>隐藏列设置</button>
|
</div>
|
</script>
|
</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="../CreateControl.js"></script>
|
<script src="../GRInstall.js"></script>
|
<script src="../GRUtility.js"></script>
|
<script src="../../../../Scripts/webConfig.js"></script>
|
<script>
|
var _cur_page = 1;
|
var sql = "";
|
var options = document.getElementById('HStatus').children;
|
function getUrlVars() {
|
var vars = [], hash;
|
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
for (var i = 0; i < hashes.length; i++) {
|
hash = hashes[i].split('=');
|
vars.push(hash[0]);
|
vars[hash[0]] = hash[1];
|
}
|
return vars;
|
}
|
function f_alert(sMsg) {
|
layer.alert(sMsg, { icon: 5 });
|
//layer.open({
|
// type: 1
|
// , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
|
// , id: 'layerDemo' //防止重复弹出
|
// , content: '<div style="padding: 20px 100px;">' + sMsg + '</div>'
|
// , shade: 0 //不显示遮罩
|
// , yes: function () {
|
// layer.closeAll();
|
// }
|
//});
|
}
|
var params = getUrlVars();
|
var type = params[params[0]];
|
switch (type) {
|
case "UnPrint":
|
options[1].selected = true;
|
sql += " and 状态 like ^^%未打印%^^";
|
break;
|
case "UnArrival":
|
options[2].selected = true;
|
sql += " and 状态 like ^^%未到货%^^";
|
break;
|
case "ReArrival":
|
options[3].selected = true;
|
sql += " and 状态 like ^^%已到货%^^";
|
break;
|
case "UnBarCode":
|
options[4].selected = true;
|
sql += " and 状态 like ^^%未生成条码%^^";
|
break;
|
}
|
//CreateReport("Report"); //打印
|
//Report.LoadFromURL("送货单(A4纸).grf");//打印
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer'], function () {
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, laydate = layui.laydate
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element;
|
//常规用法
|
laydate.render({
|
elem: '#HDate1'
|
});
|
laydate.render({
|
elem: '#HDate2'
|
});
|
var option = [];
|
var HModName = "SRM_POInStockBillList";
|
//不需要显示的字段 可扩展
|
var titleData = ["HItemID", "HParentID", "hmainid","hsubid","F_xbkf_Combo","FSHDD","HPrintId"];
|
//#region 进入页面既加载
|
set_ClearBill();
|
//#region 此页面所有方法
|
function set_ClearBill() {
|
//初始化表格
|
set_InitGrid();
|
//显示列数据
|
DisPlay_HideColumn();
|
//直接执行列表筛选 加载数据到网格
|
get_FastQuery(table, option)
|
}
|
function set_InitGrid() {
|
var columns = [
|
{ checkbox: true, fixed: 'left', totalRowText: '合计'/*, fixed: true*/ }
|
, { field: 'sorderid', title: '序号', width: 80/*, fixed: true*/ }
|
, { field: 'hmainid', title: 'hmainid', sort: true/*, fixed: true*/, hide: true }
|
, { field: 'hsubid', title: 'hsubid', sort: true/*, fixed: true*/, hide: true }
|
, { field: '状态', title: '状态', width: 100, sort: true/*, fixed: true*/ }
|
, { field: '单据状态', title: '单据状态', sort: true/*, fixed: true*/ }
|
, { field: '单据号', title: '单据号', width: 135, sort: true/*, fixed: true*/ }
|
, { field: '送货单号', title: '送货单号', width: 135, sort: true/*, fixed: true*/ }
|
, { field: 'F_xbkf_Combo', title: '自定义标识', width: 135 }
|
, { field: '源单单号', title: '源单单号', width: 135 }
|
, { field: '包装标识', title: '包装标识', width: 135 }
|
//, { field: '物流单号', title: '物流单号', width: 150, sort: true/*, fixed: true*/ }
|
, { field: '物料编码', title: '物料编码', width: 120, sort: true }
|
, { field: '旧物料编码', title: '旧物料编码', width: 120, sort: true }
|
, { field: '物料代码', title: '物料代码', width: 120, sort: true }
|
, { field: '物料名称', title: '物料名称', width: 120, sort: true }
|
, { field: '规格型号', title: '规格型号', width: 120, sort: true }
|
, { field: '计量单位', title: '计量单位', width: 80, sort: true }
|
, { field: '数量', title: '订货数量', width: 100, sort: true, totalRow: true }
|
, { field: '未生成条码数量', title: '未生成条码数量', width: 100, sort: true, totalRow: true }
|
, { field: '合格数量', title: '合格数量', width: 100, sort: true, totalRow: true }
|
, { field: '不合格数量', title: '不合格数量', width: 100, sort: true, totalRow: true }
|
, { field: '含税单价', title: '含税单价', width: 100, sort: true, hide: true }
|
, { field: '金额', title: '金额', width: 100, sort: true, hide: true }
|
, { field: '日期', title: '日期', width: 150, sort: true }
|
, { field: '批次', title: '批次', width: 150, sort: true }
|
, { field: '生产日期', title: '生产日期', width: 150, sort: true, hide: true }
|
, { field: '预计到货日期', title: '预计到货日期', width: 150, sort: true, hide: true }
|
, { field: '源单主内码', title: '源单主ID', width: 100, hide: true }
|
, { field: '源单子内码', title: '源单子ID', width: 100, hide: true }
|
, { field: 'FSHDD', title: '送货地点', width: 120 }
|
, { field: '源单类型', title: '源单类型', width: 80, hide: true }
|
, { field: '采购订单号', title: '采购订单号', width: 180, sort: true, hide: true }
|
, { field: '委外订单号', title: '委外订单号', width: 180, sort: true, hide: true }
|
, { field: '变更状态', title: '变更状态', sort: true }
|
, { field: '收料组织', title: '收料组织', sort: true, hide: true }
|
, { field: '采购组织', title: '采购组织', sort: true, hide: true }
|
, { field: '需求组织', title: '需求组织', sort: true, hide: true }
|
];
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, page: true
|
//, cellMinWidth: 120
|
, totalRow: true
|
, limit: 500
|
, height: 'full-50'
|
, cols: [columns]
|
, limits: [500, 5000, 20000]
|
, done: function (res, curr, count) {
|
|
}
|
};
|
}
|
//隐藏列设置
|
function get_HideColumn() {
|
var colName = "";
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
colName += option.cols[0][i]["title"] + ",";
|
}
|
|
colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "隐藏列设置" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["50%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ['../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
//显示列数据
|
function DisPlay_HideColumn() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
type: "GET",
|
data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
var dataCol = [];//数据库查询出的列数据
|
var titleData = ["HItemID", "HParentID", "hmainid", "hsubid", "F_xbkf_Combo", "FSHDD", "HPrintId"];//不需要显示的字段 可扩展
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < dataCol.length; i++) {
|
var dataCols = dataCol[i].split('|');
|
//隐藏列
|
if (dataCols[1] == 1) {
|
option.cols[0][i + 1]["hide"] = true;
|
}
|
//设置列宽
|
if (dataCols[3] > 0) {
|
option.cols[0][i + 1]["width"] = dataCols[3];
|
}
|
//设置内容字体大小
|
if (data1.data[0].HFontSize != 0) {
|
option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
|
} else {
|
option.cols[0][i + 1]["style"] = "font-size:100%";
|
}
|
////设置列宽
|
//if (data1.data[0].HColumnWidth != 0) {
|
// option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
|
//} else {
|
// option.cols[0][i + 1]["width"] = "";
|
//}
|
//显示列
|
if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
|
option.cols[0][i + 1]["hide"] = false;
|
}
|
//字体所在位置(左 居中 右)
|
switch (dataCols[2]) {
|
case "L":
|
option.cols[0][i + 1]["align"] = "left";
|
break;
|
case "M":
|
option.cols[0][i + 1]["align"] = "center";
|
break;
|
case "R":
|
option.cols[0][i + 1]["align"] = "right";
|
break;
|
}
|
}
|
|
//取消冻结列
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
if (option.cols[0][i]["fixed"] != null) {
|
option.cols[0][i]["fixed"] = null;
|
}
|
else {
|
break;
|
}
|
}
|
//冻结列
|
if (data1.data[0].HFixCols != 0) {
|
for (var i = 0; i < data1.data[0].HFixCols; i++) {
|
if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
|
data1.data[0].HFixCols += 1;
|
}
|
option.cols[0][i + 1]["fixed"] = "left";
|
}
|
}
|
table.render(option);
|
} else {
|
table.render(option);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
})
|
}
|
///加载显示数据
|
function get_Display(sqlWhere) {
|
var wait = layer.load();//遮罩
|
//$.ajax({
|
// type: "POST",
|
// url: GetWEBURL() + "GetPOInStockBill",
|
// async: false,
|
// data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere },
|
// success: function (result) {
|
// if (result.Message == "获取成功") {
|
// option.data = result.data;
|
// table.render(option);
|
// layer.close(wait);
|
// } else {
|
// layer.close(wait);
|
// layer.alert(result.Message, { icon: 5 });
|
// }
|
// },
|
// error: function (result) {
|
// layer.close(wait);
|
// layer.alert(result.Message, { icon: 5 });
|
// }
|
//});
|
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "GetPOInStockBill",
|
async: true,
|
data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere },
|
success: function (data1) {
|
if (data1.Message == "获取成功") {
|
var data = [];
|
var col = [];
|
//给空的数组赋值
|
for (var key in data1.list) {
|
data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
|
}
|
//在列表左边添加勾选框
|
col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计' });
|
for (var i = 0; i < data.length; i++) {
|
// if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
|
if ($.inArray(data[i].name, titleData) > -1) {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
|
}
|
else if (data[i].name.indexOf('id') > -1) {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //id列
|
}
|
else {
|
switch (data[i].Type) {
|
//int
|
case 'DateTime':
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
|
break;
|
default:
|
if (data[i].name == '订单数量' || data[i].name == '已发货数量' || data[i].name == '未发货数量') {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, totalRow: true });
|
} else if (data[i].name == '回复交期') {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: 'HSupSendGoodsDateRemark' });
|
} else {
|
col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
|
}
|
}
|
}
|
}
|
//动态显示列名
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, cols: [col]
|
, data: data1.data
|
, height: 'full-80'
|
, totalRow: true
|
, page: true
|
, cellMinWidth: 90
|
, limit: 500
|
, limits: [50, 500, 5000, 20000]
|
}
|
table.render(option);
|
//刷新表格数据
|
DisPlay_HideColumn();
|
layer.close(wait);
|
} else {
|
layer.close(wait);
|
layer.alert(data1.Message, { icon: 5 });
|
}
|
},
|
error: function (result) {
|
layer.close(wait);
|
layer.alert(result.Message, { icon: 5 });
|
}
|
});
|
};
|
//查询按钮
|
form.on('submit(btnSearch)', function (data) {//查询
|
get_FastQuery(table, option);
|
});
|
//查询条件
|
function get_FastQuery(table, option) {
|
var sqlWhere = "";
|
if ($("#HStatus").val() != "")
|
if ($("#HStatus").val() == "未生成条码") {
|
sqlWhere += " and 未生成条码数量 > 0";
|
}
|
else {
|
sqlWhere += " and 状态 like ^^%" + $("#HStatus").val() + "%^^";
|
}
|
|
if ($("#HBillNo").val() != "")
|
sqlWhere += " and 单据号 like ^^%" + $("#HBillNo").val() + "%^^";
|
if ($("#HBillNoFrom").val() != "")
|
sqlWhere += " and 源单单号 like ^^%" + $("#HBillNoFrom").val() + "%^^";
|
if ($("#HInnerBillNo").val() != "")
|
sqlWhere += " and 送货单号 like ^^%" + $("#HInnerBillNo").val() + "%^^";
|
if ($("#HOldMaterNumber").val() != "")
|
sqlWhere += " and 旧物料编码 like ^^%" + $("#HOldMaterNumber").val() + "%^^";
|
if ($("#HSupName").val() != "")
|
sqlWhere += " and 供应商 like ^^%" + $("#HSupName").val() + "%^^";
|
if ($("#HMaterNumber").val() != "")
|
sqlWhere += " and 物料编码 like ^^%" + $("#HMaterNumber").val() + "%^^";
|
if ($("#HNumber").val() != "")
|
sqlWhere += " and 物料代码 like ^^%" + $("#HNumber").val() + "%^^";
|
if ($("#HName").val() != "")
|
sqlWhere += " and 物料名称 like ^^%" + $("#HName").val() + "%^^";
|
if ($("#HModel").val() != "")
|
sqlWhere += " and 规格型号 like ^^%" + $("#HModel").val() + "%^^";
|
if ($("#HClStatus").val() != "")
|
sqlWhere += " and 单据状态 like ^^%" + $("#HClStatus").val() + "%^^";
|
if ($("#HDate1").val() != "") {
|
sqlWhere += " and 日期 >= ^^" + $("#HDate1").val() + "^^";
|
}
|
if ($("#HDate2").val() != "") {
|
sqlWhere += " and 日期 <= ^^" + $("#HDate2").val() + "^^";
|
}
|
sql = sqlWhere;
|
_cur_page = 1;
|
get_Display(sqlWhere);
|
}
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
var checkStatus = table.checkStatus(obj.config.id);
|
switch (obj.event) {
|
case 'btn-getCheckData':
|
var data = checkStatus.data;
|
layer.alert(JSON.stringify(data));
|
break;
|
//case 'getCheckLength':
|
// var data = checkStatus.data;
|
// layer.msg('选中了:' + data.length + ' 个');
|
// break;
|
//case 'isAll':
|
// layer.msg(checkStatus.isAll ? '全选' : '未全选');
|
// break;
|
//审核
|
case 'btn-Audit':
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
var InterID = "";
|
if (checkStatus.data.length > 0) {
|
for (var i = 0; i < checkStatus.data.length; i++) {
|
InterID += data[i].hmainid.toString() + ",";
|
}
|
InterID = InterID.substring(0, InterID.length - 1);
|
|
var HBillNo = data[0].单据号;
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/AuditPOInStockBill",
|
data: { "HInterID": InterID, "CurUserName": sessionStorage["HUserName"], "HBillNo": HBillNo },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
//修改为功后刷新界面
|
get_Display(sql);
|
});
|
|
} else {
|
layer.alert(result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择数据!');
|
}
|
//自定义头工具栏右侧图标 - 提示
|
case 'btn-reload':
|
_cur_page = $(".layui-laypage-em").next().html();
|
get_Display(sql);
|
// });
|
break;
|
case 'btn-HideColumn':
|
get_HideColumn();
|
break;
|
case 'btn-details':
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
|
var linterid = data[0].hmainid.toString();
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '送货单'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: '../../../src/views/SRM/SRM_POInStockBill.html?linterid=' + linterid
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
break;
|
case 'btn-changebg':
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
|
var linterid = data[0].hmainid.toString();
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '送货单'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: '../../../src/views/SRM/SRM_POInStockBill.html?linterid=' + linterid + '&type =changebg'
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
break;
|
case 'btn-Delete':
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
var InterID = "";
|
for (i = 0; i < data.length; i++) {
|
InterID += data[i].hmainid.toString() + ",";
|
}
|
InterID = InterID.substring(0, InterID.length - 1)
|
//逻辑删除方法
|
layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/DeltetPOInStockBill", //方法所在页面和方法名
|
data: { "HInterID": InterID, "HUserName": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
//修改为功后刷新界面
|
window.location.reload();
|
});
|
|
} else {
|
layer.alert(result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
})
|
break;
|
case 'btn-print':
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (data.length != 1) {
|
layer.msg("请选择一条数据", { icon: 5 });
|
return;
|
}
|
if (data[0].单据状态 != '已审核') {
|
layer.msg("请审核送货单后在进行打印( ´◔︎ ‸◔︎`)", { icon: 5 });
|
return;
|
}
|
//for (var i = 0; i < data.length; i++) {
|
// if (data[i].单据状态 != "审核") {
|
// layer.msg("选中行未审核", { icon: 5 });
|
// return;
|
// }
|
//}
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '打印模版选择'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: false //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../views/BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=SRM_POInStockBillList', 'yes']
|
, resize: false
|
//, cancel: function () {
|
// $(".layui-btn").removeClass("layui-btn-disabled");
|
//}
|
})
|
|
break;
|
case 'btn-print-Convenient':
|
convenientPrint();
|
break;
|
case 'btn-generate':
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (data[0].未生成条码数量 <= 0) {
|
layer.msg("选中行已生成条码!", { icon: 5 });
|
}
|
else {
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '条码生成'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: false //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../views/SRM/SRM_BarCodeBill.html?linterid=' + data[0].hmainid + '&lentryid=' + data[0].hsubid, 'yes']
|
, resize: false
|
, cancel: function () {
|
$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
}
|
break;
|
case 'btn-exit':
|
//var index = parent.layer.getFrameIndex(window.name);
|
//element.tabDelete('layadmin-layout-tabs', this);
|
parent.layui.admin.events.closeThisTabs();
|
//parent.layer.close(index);
|
break;
|
};
|
});
|
|
//行监听事件
|
table.on('row(mainTable)', function (obj) {
|
var flag = !obj.tr.find(':checkbox:first').prop('checked');
|
obj.tr.find(':checkbox').prop('checked', flag);
|
if (flag) {
|
obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked'); //设置复选框选中样式
|
$(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//改变当前tr背景颜色和字体颜色
|
} else {
|
obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//取消复选框选中样式
|
$(obj.tr.selector).attr({ "style": "background:" });//取消当前tr颜色
|
}
|
//mainTable 为表格ID 注意此处如果ID不正确将导致你在监听复选框时获取不到你选择的数据,前面的只是添加或删除选中未选中样式以及设置背景色,字体颜色
|
layui.each(table.cache.mainTable, function (i, l) {
|
if (obj.tr.index() == l.LAY_TABLE_INDEX) {
|
l.LAY_CHECKED = flag;
|
}
|
});
|
});
|
|
//一键打印
|
function convenientPrint() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (data.length != 1) {
|
layer.msg("请选择一条数据", { icon: 5 });
|
return;
|
}
|
if (data[0].单据状态 != '已审核') {
|
layer.msg("请审核送货单后在进行打印( ´◔︎ ‸◔︎`)", { icon: 5 });
|
return;
|
}
|
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + "/Open_PrintTem/GetDefaultOpenTmp_Json",
|
async: true,
|
data: { "HNumber": 'SRM_POInStockBillList' },
|
//data: { "Value": Value },
|
success: function (result) {
|
if (result.count == 1) {
|
var OpenTmp = result.data[0].模板名称
|
window.open("../../views/SRM/HBarPlanPrint.html?linterid=" + data[0].hmainid.toString() + "&Type=SRM_POInStockBillList" + "&OpenTmp=" + OpenTmp.toString());
|
} else {
|
layer.msg(result.Message);
|
}
|
},
|
error: function (result) {
|
console.log(result);
|
}
|
});
|
}
|
|
});
|
</script>
|
</body>
|
</html>
|