| | |
| | |
|
| | |
|
| | | <!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">
|
| | | <style type="text/css">
|
| | | .layui-input-block {
|
| | | width: 200px;
|
| | | }
|
| | | </style>
|
| | | </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">
|
| | | <form class="layui-form" action="">
|
| | | <div class="layui-form-item">
|
| | |
|
| | | <div class="layui-inline">
|
| | | <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">
|
| | | <label class="layui-form-label">单据号</label>
|
| | | <div class="layui-input-block">
|
| | | <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">
|
| | | <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">
|
| | | <input type="text" class="layui-input" name="HInnerBillNo" id="HInnerBillNo">
|
| | | </div>
|
| | | </div>
|
| | | <!--<div class="layui-inline">
|
| | | <label class="layui-form-label">物料编码</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" class="layui-input" name="HShortNumber" id="HShortNumber">
|
| | | </div>
|
| | | </div>-->
|
| | | <div class="layui-inline">
|
| | | <label class="layui-form-label">物料代码</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" class="layui-input" name="HNumber" id="HNumber">
|
| | | </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="HModel" id="HModel">
|
| | | </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="">全部</option>
|
| | | <option value="审核">审核</option>
|
| | | <option value="审核">反审核</option>
|
| | | <option value="未关闭" selected="">未关闭</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="HDate1" id="HDate1">
|
| | | </div>
|
| | | </div>-->
|
| | | <!--<div class="layui-inline">
|
| | | <label class="layui-form-label">结束日期</label>
|
| | | <div class="layui-input-block">
|
| | | <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 name="HStatus" id="HStatus" lay-filter="">
|
| | | <option value="">全部</option>
|
| | | <option value="未打印" selected="">未打印</option>
|
| | | <option value="已打印">已打印</option>
|
| | | </select>
|
| | | </div>
|
| | | </div>-->
|
| | |
|
| | | <!--<div class="layui-inline">
|
| | | <label class="layui-form-label">采购组织</label>
|
| | | <div class="layui-input-block">
|
| | | <select id="HPURCHASEORGID" name="HPURCHASEORGID" lay-filter="">
|
| | | <option value="">组织1</option>
|
| | | <option value="">组织2</option>
|
| | | </select>
|
| | | </div>
|
| | | </div>-->
|
| | | <div class="layui-inline">
|
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="f_Query">
|
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
| | | </button>
|
| | | </div>
|
| | | </div>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | </form>
|
| | | <!--</div>-->
|
| | | </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-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>
|
| | |
|
| | | </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 = " and 1=1";
|
| | | 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'
|
| | | });
|
| | | //layui.code();
|
| | | RoadHBillNo(sql);
|
| | | layer.load(3)
|
| | | //方法级渲染
|
| | | table.render({
|
| | | elem: '#mainTable'
|
| | | , dateType: 'json'
|
| | | , colFilterRecord: true//是否开启字段筛选的记忆功能
|
| | | , data: []
|
| | | // , url: GetWEBURL()+'/GetPOInStockBill'
|
| | | , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
|
| | | , defaultToolbar: ['filter', 'exports', 'print']
|
| | | // , where: { msg: "", NowPage: 1, OnePage: 10 }
|
| | | , cellMinWidth: 100
|
| | | , cols: [[
|
| | | { checkbox: true/*, 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: 150, sort: true/*, fixed: true*/ }
|
| | | , { field: '送货单号', title: '送货单号', width: 150, sort: true/*, fixed: true*/ }
|
| | | , { field: 'F_xbkf_Combo', title: '自定义标识', width: 120 }
, { field: '源单单号', title: '源单单号', width: 180 }
|
| | | , { field: '包装标识', title: '包装标识', width: 180 }
|
| | | //, { 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: 80, sort: true }
|
| | | , { field: '数量', title: '订货数量', width: 100, sort: true }
|
| | | , { field: '未生成条码数量', title: '未生成条码数量', width: 100, sort: true }
|
| | | , { field: '合格数量', title: '合格数量', width: 100, sort: true }
|
| | | , { field: '不合格数量', title: '不合格数量', width: 100, sort: 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 }
|
| | | ]]
|
| | | , page: true //是否显示分页
|
| | | , limits: [10, 20, 50, 100, 500, 1000, 5000, 10000]
|
| | | , limit: 50 //每页默认显示的数量
|
| | | //, height: 500
|
| | | , done: function (res, curr, count) {
|
| | | _cur_page = curr;
|
| | | layer.closeAll("loading");
|
| | | }
|
| | |
|
| | | });
|
| | |
|
| | | //头工具栏事件
|
| | | 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);
|
| | | //逻辑审核方法
|
| | | $.ajax({
|
| | | type: "GET",
|
| | | // var WEBURL = ""; //章紫柔本地配置
|
| | | //url: "http://localhost:8082/LuBaoAPI//AuditPOInStockBill", //方法所在页面和方法名
|
| | | url: GetWEBURL() + "/AuditPOInStockBill",
|
| | | data: { "HInterID": InterID, "CurUserName": sessionStorage["HUserName"], "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);
|
| | | //修改为功后刷新界面
|
| | | $("#btnSearch").trigger('click');
|
| | | });
|
| | |
|
| | | } 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();
|
| | | RoadHBillNo(sql);
|
| | | // });
|
| | | 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;
|
| | | if (checkStatus.data.length === 1) {
|
| | | var InterID = data[0].hmainid.toString();
|
| | | //逻辑删除方法
|
| | | layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
| | | $.ajax({
|
| | | type: "GET",
|
| | | url: GetWEBURL() + "/DeltetPOInStockBill", //方法所在页面和方法名
|
| | | data: { "HInterID": InterID, "HUserName": sessionStorage["HUserName"], "HBillNo": data[0].单据号.toString()},
|
| | | 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.code + result.Message, { icon: 5 });
|
| | | }
|
| | | }, error: function () {
|
| | | layer.alert("接口请求失败!", { icon: 5 });
|
| | | }
|
| | | });
|
| | | })
|
| | | }
|
| | | else {
|
| | | layer.msg('请选择一行数据删除!');
|
| | | }
|
| | | break;
|
| | | case 'btn-print':
|
| | | var checkStatus = table.checkStatus('mainTable')
|
| | | , data = checkStatus.data;
|
| | | if (data.length == 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: ['50%', '50%']
|
| | | , 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-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;
|
| | | };
|
| | | });
|
| | |
|
| | |
|
| | |
|
| | | ///加载显示数据
|
| | | function RoadHBillNo(sqlWhere) {
|
| | | where = sqlWhere;
|
| | | $.ajax({
|
| | | type: "get",
|
| | | url: GetWEBURL() + "/GetPOInStockBill",
|
| | | async: true,
|
| | | data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere },
|
| | | success: function (result) {
|
| | | ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
|
| | | table.reload('mainTable', {
|
| | | data: ajaxReturnData
|
| | | , height: 'full-10'
|
| | | , page: {
|
| | | curr: _cur_page //必须从第 1 页开始
|
| | | }
|
| | | , loading: false
|
| | | , done: function (index, res) {
|
| | |
|
| | | }
|
| | | });
|
| | | },
|
| | | error: function (result) {
|
| | | console.log(result);
|
| | | //layer.msg('获取送货单出现异常', { icon: 2, time: 2000 });
|
| | | }
|
| | | });
|
| | | };
|
| | | form.on('submit(f_Query)', function (data) {//查询
|
| | | var sqlWhere = " and 1=1 ";
|
| | | 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 ($("#HShortNumber").val() != "")
|
| | | // sqlWhere += " and 物料编码 like ^^%" + $("#HShortNumber").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 ($("#HPURCHASEORGID").val() != "")
|
| | | // sqlWhere += " and 采购组织 like ^^%" + $("#HPURCHASEORGID").val() + "%^^";
|
| | | //if ($("#HDate1").val() != "") {
|
| | | // sqlWhere += " and 日期 >= ^^" + $("#HDate1").val() + "^^";
|
| | | //}
|
| | | //if ($("#HDate2").val() != "") {
|
| | | // sqlWhere += " and 日期 <= ^^" + $("#HDate2").val() + "^^";
|
| | | //}
|
| | |
|
| | | sql = sqlWhere;
|
| | | //从第一页开始
|
| | | _cur_page = 1;
|
| | | RoadHBillNo(sqlWhere);
|
| | | });
|
| | | //定义事件集合
|
| | | var $ = layui.$, active = {
|
| | | //reload: function () {
|
| | | // var demoReload = $('#test-table-demoReload');
|
| | | // //执行重载
|
| | | // 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_SHD: function () {
|
| | | // var checkStatus = table.checkStatus('test-table-reload')
|
| | | // , data = checkStatus.data;
|
| | | // window.open("../../views/WarM/HBarPlanPrint.html?linterid=" + data[0].hmainid + "&Type=HPOInStockBill");
|
| | | // // CreateDisplayViewerEx("100%", "100%", "../../views/grf/送货单(A4纸).grf", "../../views/WarM/xmlK3_POInStockBill.aspx?linterid=" + data[0].hmainid, true, "");
|
| | | // // AjaxReportRun(Report, "../../views/WarM/xmlK3_POInStockBill.aspx?linterid=" + data[0].hmainid, Report.PrintPreview(true));
|
| | | //},
|
| | | f_HBarCode: function () {//生成条码
|
| | | // var checkStatus = table.checkStatus('test-table-reload')
|
| | | //, data = checkStatus.data;
|
| | | // layer.open({
|
| | | // type: 2
|
| | | // , area: ['100%', '100%']
|
| | | // , title: '送货单'
|
| | | // , shade: 0.6 //遮罩透明度
|
| | | // , maxmin: false //允许全屏最小化
|
| | | // , anim: 0 //0-6的动画形式,-1不开启
|
| | | // , content: ['../../views/WarM/Web_BarCodeBill.html?linterid=' + data[0].hmainid + '&lentryid=' + data[0].hmainid, '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");
|
| | | // }
|
| | | // })
|
| | | }
|
| | | };
|
| | | $('.test-table-reload-btn .layui-btn').on('click', function () {
|
| | | var type = $(this).data('type');
|
| | | active[type] ? active[type].call(this) : '';
|
| | | });
|
| | | });
|
| | | </script>
|
| | | </body>
|
| | | |
| | | |
| | | <!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"> |
| | | <style type="text/css"> |
| | | .layui-input-block { |
| | | width: 200px; |
| | | } |
| | | </style> |
| | | </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"> |
| | | <form class="layui-form" action=""> |
| | | <div class="layui-form-item"> |
| | | |
| | | <div class="layui-inline"> |
| | | <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"> |
| | | <label class="layui-form-label">单据号</label> |
| | | <div class="layui-input-block"> |
| | | <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"> |
| | | <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"> |
| | | <input type="text" class="layui-input" name="HInnerBillNo" id="HInnerBillNo"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">物料代码</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HNumber" id="HNumber"> |
| | | </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="HModel" id="HModel"> |
| | | </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="">全部</option> |
| | | <option value="审核">审核</option> |
| | | <option value="审核">反审核</option> |
| | | <option value="未关闭" selected="">未关闭</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="HDate1" id="HDate1"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">结束日期</label> |
| | | <div class="layui-input-block"> |
| | | <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"> |
| | | <input type="text" class="layui-input" name="HQty" id="HQty"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">变更状态</label> |
| | | <div class="layui-input-block"> |
| | | <select name="HBGStatus" id="HBGStatus" lay-filter=""> |
| | | <option value="">全部</option> |
| | | <option value="未变更" selected="">未变更</option> |
| | | <option value="已变更">已变更</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="f_Query"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <!--</div>--> |
| | | </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-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> |
| | | |
| | | </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 = " and 1=1"; |
| | | 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' |
| | | }); |
| | | //layui.code(); |
| | | RoadHBillNo(sql); |
| | | layer.load(3) |
| | | //方法级渲染 |
| | | table.render({ |
| | | elem: '#mainTable' |
| | | , dateType: 'json' |
| | | , colFilterRecord: true//是否开启字段筛选的记忆功能 |
| | | , data: [] |
| | | // , url: GetWEBURL()+'/GetPOInStockBill' |
| | | , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板 |
| | | , defaultToolbar: ['filter', 'exports', 'print'] |
| | | // , where: { msg: "", NowPage: 1, OnePage: 10 } |
| | | , cellMinWidth: 100 |
| | | , cols: [[ |
| | | { checkbox: true/*, 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: 150, sort: true/*, fixed: true*/ } |
| | | , { field: '送货单号', title: '送货单号', width: 150, sort: true/*, fixed: true*/ } |
| | | , { field: 'F_xbkf_Combo', title: '自定义标识', width: 120 } |
| | | , { field: '源单单号', title: '源单单号', width: 180 } |
| | | , { field: '包装标识', title: '包装标识', width: 180 } |
| | | //, { 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: 80, sort: true } |
| | | , { field: '数量', title: '订货数量', width: 100, sort: true } |
| | | , { field: '未生成条码数量', title: '未生成条码数量', width: 100, sort: true } |
| | | , { field: '合格数量', title: '合格数量', width: 100, sort: true } |
| | | , { field: '不合格数量', title: '不合格数量', width: 100, sort: 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 } |
| | | ]] |
| | | , page: true //是否显示分页 |
| | | , limits: [10, 20, 50, 100, 500, 1000, 5000, 10000] |
| | | , limit: 50 //每页默认显示的数量 |
| | | //, height: 500 |
| | | , done: function (res, curr, count) { |
| | | _cur_page = curr; |
| | | layer.closeAll("loading"); |
| | | } |
| | | |
| | | }); |
| | | |
| | | //头工具栏事件 |
| | | 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); |
| | | //逻辑审核方法 |
| | | $.ajax({ |
| | | type: "GET", |
| | | // var WEBURL = ""; //章紫柔本地配置 |
| | | //url: "http://localhost:8082/LuBaoAPI//AuditPOInStockBill", //方法所在页面和方法名 |
| | | url: GetWEBURL() + "/AuditPOInStockBill", |
| | | data: { "HInterID": InterID, "CurUserName": sessionStorage["HUserName"], "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); |
| | | //修改为功后刷新界面 |
| | | $("#btnSearch").trigger('click'); |
| | | }); |
| | | |
| | | } 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(); |
| | | RoadHBillNo(sql); |
| | | // }); |
| | | 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; |
| | | if (checkStatus.data.length === 1) { |
| | | var InterID = data[0].hmainid.toString(); |
| | | //逻辑删除方法 |
| | | layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) { |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/DeltetPOInStockBill", //方法所在页面和方法名 |
| | | data: { "HInterID": InterID, "HUserName": sessionStorage["HUserName"], "HBillNo": data[0].单据号.toString() }, |
| | | 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.code + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("接口请求失败!", { icon: 5 }); |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | else { |
| | | layer.msg('请选择一行数据删除!'); |
| | | } |
| | | break; |
| | | case 'btn-print': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | if (data.length == 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: ['50%', '50%'] |
| | | , 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-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; |
| | | }; |
| | | }); |
| | | |
| | | |
| | | |
| | | ///加载显示数据 |
| | | function RoadHBillNo(sqlWhere) { |
| | | where = sqlWhere; |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL() + "/GetPOInStockBill", |
| | | async: true, |
| | | data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere }, |
| | | success: function (result) { |
| | | ajaxReturnData = JSON.parse(JSON.stringify(result)).data; |
| | | table.reload('mainTable', { |
| | | data: ajaxReturnData |
| | | , height: 'full-10' |
| | | , page: { |
| | | curr: _cur_page //必须从第 1 页开始 |
| | | } |
| | | , loading: false |
| | | , done: function (index, res) { |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | error: function (result) { |
| | | console.log(result); |
| | | //layer.msg('获取送货单出现异常', { icon: 2, time: 2000 }); |
| | | } |
| | | }); |
| | | }; |
| | | form.on('submit(f_Query)', function (data) {//查询 |
| | | var sqlWhere = " and 1=1 "; |
| | | if ($("#HStatus").val() != "") |
| | | if ($("#HStatus").val() == "未生成条码") { |
| | | sqlWhere += " and 未生成条码数量 > 0"; |
| | | } |
| | | else { |
| | | sqlWhere += " and 状态 like ^^%" + $("#HStatus").val() + "%^^"; |
| | | } |
| | | if ($("#HBGStatus").val() != "") { |
| | | sqlWhere += " and 变更状态 like ^^%" + $("#HBGStatus").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 ($("#HShortNumber").val() != "") |
| | | // sqlWhere += " and 物料编码 like ^^%" + $("#HShortNumber").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 ($("#HPURCHASEORGID").val() != "") |
| | | // sqlWhere += " and 采购组织 like ^^%" + $("#HPURCHASEORGID").val() + "%^^"; |
| | | if ($("#HDate1").val() != "") { |
| | | sqlWhere += " and 日期 >= ^^" + $("#HDate1").val() + "^^"; |
| | | } |
| | | if ($("#HDate2").val() != "") { |
| | | sqlWhere += " and 日期 <= ^^" + $("#HDate2").val() + "^^"; |
| | | } |
| | | if ($("#HQty").val() != "") { |
| | | sqlWhere += " and 数量 = ^^" + $("#HQty").val() + "^^"; |
| | | } |
| | | |
| | | sql = sqlWhere; |
| | | //从第一页开始 |
| | | _cur_page = 1; |
| | | RoadHBillNo(sqlWhere); |
| | | }); |
| | | //定义事件集合 |
| | | var $ = layui.$, active = { |
| | | //reload: function () { |
| | | // var demoReload = $('#test-table-demoReload'); |
| | | // //执行重载 |
| | | // 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_SHD: function () { |
| | | // var checkStatus = table.checkStatus('test-table-reload') |
| | | // , data = checkStatus.data; |
| | | // window.open("../../views/WarM/HBarPlanPrint.html?linterid=" + data[0].hmainid + "&Type=HPOInStockBill"); |
| | | // // CreateDisplayViewerEx("100%", "100%", "../../views/grf/送货单(A4纸).grf", "../../views/WarM/xmlK3_POInStockBill.aspx?linterid=" + data[0].hmainid, true, ""); |
| | | // // AjaxReportRun(Report, "../../views/WarM/xmlK3_POInStockBill.aspx?linterid=" + data[0].hmainid, Report.PrintPreview(true)); |
| | | //}, |
| | | f_HBarCode: function () {//生成条码 |
| | | // var checkStatus = table.checkStatus('test-table-reload') |
| | | //, data = checkStatus.data; |
| | | // layer.open({ |
| | | // type: 2 |
| | | // , area: ['100%', '100%'] |
| | | // , title: '送货单' |
| | | // , shade: 0.6 //遮罩透明度 |
| | | // , maxmin: false //允许全屏最小化 |
| | | // , anim: 0 //0-6的动画形式,-1不开启 |
| | | // , content: ['../../views/WarM/Web_BarCodeBill.html?linterid=' + data[0].hmainid + '&lentryid=' + data[0].hmainid, '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"); |
| | | // } |
| | | // }) |
| | | } |
| | | }; |
| | | $('.test-table-reload-btn .layui-btn').on('click', function () { |
| | | var type = $(this).data('type'); |
| | | active[type] ? active[type].call(this) : ''; |
| | | }); |
| | | }); |
| | | </script> |
| | | </body> |
| | | </html> |