ch
2023-03-03 f165878ca583d1d9ee22fb2ae81ce98b3070dc85
WebTM/views/ÑéÊÕÈë¿â/Í⹺Èë¿â/Kf_POStockInBill_FastList.html
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>外购入库单缓存列表</title>
    <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">
@@ -36,10 +36,12 @@
                    </div>-->
                    <div class="layui-tab" lay-filter="tab-POStockInBillList">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1">单据列表</li>
                            <li lay-id="2">源单生单</li>
                            <li lay-id="1">缓存列表</li>
                            <li lay-id="2">已上传列表</li>
                            <li lay-id="3">已上传查询</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item  layui-show">
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
@@ -51,6 +53,28 @@
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <table class="layui-hide" id="yd-table" lay-filter="yd-table"></table>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <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="HSourceBillNo" id="HSourceBillNo">
                                    </div>
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdQuery">查询</button>
                                </div>
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <table class="layui-hide" id="sy-table" lay-filter="sy-table"></table>
                                    </div>
                                </div>
                            </div>
@@ -98,6 +122,7 @@
        , table = layui.table
        , form = layui.form
        , element = layui.element;
        var sBillType = '1201'
        //清空界面  new
        //动态加载源单类型列表 new
@@ -105,13 +130,16 @@
        //加载源单类型
        //读取单据列表
        //
        form.on('submit(Cancel)', function () {
            parent.location.href = "../../../views/index.html"
        //退出
        form.on('submit(cmdCancel)', function () {
            layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                parent.location.href = "../../../views/index.html";
            });
            //parent.location.href = "../../../views/index.html"
            //window.close();//关闭当前页
        })
        //编辑
        form.on('submit(cmdModify)', function () {
            var checkStatus = table.checkStatus('dj-table')
                     , data = checkStatus.data;
@@ -131,7 +159,7 @@
                }
            })
        });
        //刷新
        form.on('submit(cmdRefresh)', function () {//
            var sBillType = '1201'
            table.render({
@@ -140,14 +168,14 @@
                    ,toolbar: '#toolbarDemo'
                    , where: { HBillType: sBillType,sWhere:''}
                    , cols: [[
                          { type: 'radio' }
                        , { field: 'HInterID', title: '单据内码', width: 80 }
                        , { field: 'HBillNo', title: '单据号', width: 80 }
                        , { field: 'HMaker', title: '制单人', width: 100 }
                        , { field: 'HMakeDate', title: '制单日期', width: 100 }
                        { type: 'radio' }
                        , { field: 'HInterID', title: '单据内码', width: 120 }
                        , { field: 'HBillNo', title: '单据号', width: 150 }
                        , { field: 'HMaker', title: '制单人', width: 120 }
                        , { field: 'HMakeDate', title: '制单日期', width: 150 }
                        , { field: 'HQty', title: '数量', width: 100 }
                        , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                        , { field: 'HRedBlueFlag', title: '红蓝字', width: 100 }
                        , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                        , { field: 'HRedBlueFlag', title: '红蓝字', width: 120 }
                        , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                    ]]
                      , height: 500
@@ -155,13 +183,45 @@
                          layer.closeAll("loading");
                      }
            });
            table.render({
                elem: '#yd-table'
                , url: GetWEBURL() + '/Web/DisBillUpdateLoad_Json'
                , toolbar: '#toolbarDemo'
                , where: { HBillType: sBillType, HMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
                , page: true  // å¼€å¯åˆ†é¡µ
                , limits: [20, 40, 80, 100]
                , limit: 20
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HInterID', title: '单据内码', width: 120 }
                    , { field: 'HBillNo', title: '单据号', width: 150 }
                    , { field: 'HMaker', title: '制单人', width: 120 }
                    , { field: 'HMakeDate', title: '制单日期', width: 150 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HOrgID', title: '组织', width: 120 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            })
        });
        //撤销功能
        form.on('submit(cmdRescind)', function () {
            var checkStatus = table.checkStatus('yd-table')
                , data = checkStatus.data;
            var checkStatus = table.checkStatus('yd-table');
            var checkStatus2 = table.checkStatus('sy-table');
            var data = "";
            if (checkStatus.data.length != 0) {
                data = checkStatus.data;
            } else if (checkStatus2.data.length != 0) {
                data = checkStatus2.data;
            } else {
                return layer.msg("请选择一条数据");
            }
            var sInterID = data[0].HInterID
            var sBillNo = data[0].HBillNo
            var sBillType = '1201'
@@ -197,48 +257,80 @@
                    }
                });
        });
        form.on('submit(cmdDelete)', function () {//删除
        //删除
        form.on('submit(cmdDelete)', function () {
            var checkStatus = table.checkStatus('dj-table')
            , data = checkStatus.data;
            var sInterID = data[0].HInterID
            $.ajax(
               {
                   type: "Get",
                   url: GetWEBURL() + "/Web/Delete_Json",
                   async: true,
                   data: { "sHInterID": sInterID },
                   dataType: "json",
                   success: function (data) {
                       if (data.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.msg(data.Message, { icon: 2 });
                       }
                   },
                   error: function (err) {
                       layer.msg('错误' + err, {
                           icon: 5,
                           time: 20000
                       }, function () {
                           //do something
                       });
                   }
               });
                , data = checkStatus.data;
            if (checkStatus.data.length === 1) {
                var sInterID = data[0].HInterID
                //逻辑删除方法
                layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                    $.ajax(
                        {
                            type: "Get",
                            url: GetWEBURL() + "/Web/Delete_Json",
                            async: true,
                            data: { "sHInterID": sInterID },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                    layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        // å¾—到frame索引
                                        var index = layer.getFrameIndex(window.name);
                                        //关闭当前frame
                                        layer.close(index);
                                        //修改为功后刷新界面
                                        window.location.reload();
                                    });
                                }
                                else {
                                    layer.msg(data.Message, { icon: 2 });
                                }
                            },
                            error: function (err) {
                                layer.msg('错误' + err, {
                                    icon: 5,
                                    time: 20000
                                }, function () {
                                    //do something
                                });
                            }
                        });
                })
            }
            else {
                layer.msg('请选择一行数据删除!');
            }
        });
        //查询
        form.on('submit(cmdQuery)', function () {
            var HBillNo = $("#HBillNo").val();
            var HSourceBillNo = $("#HSourceBillNo").val();
            var index = layer.load();//遮罩
            //进入页面显示的缓存列表
            $.ajax({
                url: GetWEBURL() + '/Web/QueryBillUpdateLoad_Json',
                type: "GET",
                data: { "BillType":sBillType,"HBillNo": HBillNo, "HSourceBillNo": HSourceBillNo},
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        table.render(option);
                        layer.close(index);
                    } else {
                        layer.close(index);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(index);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        });
        
        
        var sBillType = '1201'
        //缓存列表
        table.render({
            elem: '#dj-table'
            , url: GetWEBURL() + '/Web/chanpinruk'
@@ -246,13 +338,13 @@
            , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
            , cols: [[
                { type: 'radio' }
                , { field: 'HInterID', title: '单据内码', width: 80 }
                , { field: 'HBillNo', title: '单据号', width: 80 }
                , { field: 'HMaker', title: '制单人', width: 100 }
                , { field: 'HMakeDate', title: '制单日期', width: 100 }
                , { field: 'HInterID', title: '单据内码', width: 120 }
                , { field: 'HBillNo', title: '单据号', width: 150 }
                , { field: 'HMaker', title: '制单人', width: 120 }
                , { field: 'HMakeDate', title: '制单日期', width: 150 }
                , { field: 'HQty', title: '数量', width: 100 }
                , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                , { field: 'HRedBlueFlag', title: '红蓝字', width: 100 }
                , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                , { field: 'HRedBlueFlag', title: '红蓝字', width: 120 }
                , { field: 'HSourceBillType', title: '源单类型', width: 100 }
            ]]
            , height: 500
@@ -260,31 +352,53 @@
                layer.closeAll("loading");
            }
        })
        //已上传列表
            table.render({
        table.render({
                elem: '#yd-table'
                , url: GetWEBURL() + '/Web/DisBillUpdateLoad_Json'
                , toolbar: '#toolbarDemo'
                , where: { HBillType: sBillType, HMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
                , page: true  // å¼€å¯åˆ†é¡µ
                , limits: [20, 40, 80, 100]
                , limit: 20
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HInterID', title: '单据内码', width: 80 }
                    , { field: 'HBillNo', title: '单据号', width: 80 }
                    , { field: 'HMaker', title: '制单人', width: 100 }
                    , { field: 'HMakeDate', title: '制单日期', width: 100 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', width: 100 }
                    , { field: 'HMaterModel', title: '规格型号', width: 100 }
                    , { field: 'HInterID', title: '单据内码', width: 120 }
                    , { field: 'HBillNo', title: '单据号', width: 150 }
                    , { field: 'HMaker', title: '制单人', width: 120 }
                    , { field: 'HMakeDate', title: '制单日期', width: 150 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                    , { field: 'HOrgID', title: '组织', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HOrgID', title: '组织', width: 120 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            })
        })
        //已上传查询
        table.render({
            elem: '#sy-table'
            , toolbar: '#toolbarDemo'
            , cols: [[
                { type: 'radio' }
                , { field: 'HInterID', title: '单据内码', width: 120 }
                , { field: 'HBillNo', title: '单据号', width: 150 }
                , { field: 'HMaker', title: '制单人', width: 120 }
                , { field: 'HMakeDate', title: '制单日期', width: 150 }
                , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                , { field: 'HMaterName', title: '物料名称', width: 150 }
                , { field: 'HMaterModel', title: '规格型号', width: 150 }
                , { field: 'HQty', title: '数量', width: 100 }
                , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                , { field: 'HOrgID', title: '组织', width: 120 }
            ]]
            , height: 500
        })
        //刷新明细页签
        table.render({
            elem: '#mx-table'