智云SRM-LAYUI(夏宝服务器版本)
王 垚
2021-10-27 b637e820b335d909dbc0dda4a9c5af8d30e8a144
采购订单 内外箱条码
3个文件已修改
1039 ■■■■ 已修改文件
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_BarCodeBill.html 1015 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill_Edit.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POOrderBillList.html 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_BarCodeBill.html
@@ -102,7 +102,7 @@
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                                    <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-normal">普通条码</button>-->
@@ -112,11 +112,11 @@
                                    </script>
                                </div>
                            </div>
                        </div>
                        </div>
                        <!--<blockquote class="layui-elem-quote">条码</blockquote>-->
                    </form>
            </div>
                </div>
            </div>
        </div>
    </div>
@@ -140,7 +140,7 @@
            //  }
            //});
        }
        function isPositiveIntegerTimes(x,y){
        function isPositiveIntegerTimes(x, y) {
            if (x > y) {
                var flag = x;
                x = y;
@@ -150,14 +150,11 @@
            if (x == 0) {
                return true;
            }
            else
           {
                if (z == 0)
                {
            else {
                if (z == 0) {
                    return true;
                }
                else
                {
                else {
                    return false;
                }
            }
@@ -172,7 +169,7 @@
            var day = date.getDate();
            var mm = "'" + month + "'";
            var dd = "'" + day + "'";
            //单位数前面加0
            if (mm.length == 3) {
                month = "0" + month;
@@ -197,44 +194,50 @@
        var params = getUrlVars();
        var linterid = params[params[0]];
        var lentryid = params[params[1]];
      // debugger;
        $.ajax({
            url: GetWEBURL()+"GetHBarCodeShowBillMain",
            type: "GET",
            data: { "sMsg": linterid },
            success: function (d) {
                console.log(d.data);
                //$("#HDate").val(d.)
                $("#HInterID").val(d.data[0].HInterID);
                $("#HBillNo").val(d.data[0].HBillNo);
                $("#HRemark").val(d.data[0].HRemark);
                $("#HDate").val(d.data[0].HDateForWeb);
                //$("#HMaker").val(d.data[0].HMaker);
                $("#HMakerDate").val(d.data[0].HMakerDate)
                $("#HChecker").val(d.data[0].HChecker);
                $("#HCheckDate").val(d.data[0].HCheckDate);
                $("#HSupID").val(d.data[0].HSupID);
                $("#HSupName").val(d.data[0].HSupName);
                $("#HEmpID").val(d.data[0].HEmpID);
                $("#HEmpName").val(d.data[0].HEmpName);
                $("#HManagerID").val(d.data[0].HManagerID);
                $("#HManagerName").val(d.data[0].HManagerName);
                $("#HMaker").val(sessionStorage["HUserName"]);
            }
        });
        var type = params[params[2]];
        var mainUrl = "GetHBarCodeShowBillMain";
        var subUrl = "GetHBarCodeShowBillSub";
        if (type == 'SRM_POOrderBillList') {
            mainUrl = 'GetHBarCodeShowBillMainBycg';
            subUrl = "GetHBarCodeShowBillSubBycg";
        }
        // debugger;
            $.ajax({
                url: GetWEBURL() + mainUrl,
                type: "GET",
                data: { "sMsg": linterid },
                success: function (d) {
                    console.log(d.data);
                    //$("#HDate").val(d.)
                    $("#HInterID").val(d.data[0].HInterID);
                    $("#HBillNo").val(d.data[0].HBillNo);
                    $("#HRemark").val(d.data[0].HRemark);
                    $("#HDate").val(d.data[0].HDateForWeb);
                    //$("#HMaker").val(d.data[0].HMaker);
                    $("#HMakerDate").val(d.data[0].HMakerDate)
                    $("#HChecker").val(d.data[0].HChecker);
                    $("#HCheckDate").val(d.data[0].HCheckDate);
                    $("#HSupID").val(d.data[0].HSupID);
                    $("#HSupName").val(d.data[0].HSupName);
                    $("#HEmpID").val(d.data[0].HEmpID);
                    $("#HEmpName").val(d.data[0].HEmpName);
                    $("#HManagerID").val(d.data[0].HManagerID);
                    $("#HManagerName").val(d.data[0].HManagerName);
                    $("#HMaker").val(sessionStorage["HUserName"]);
                }
            });
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'table', 'form', 'element', 'layer', 'laydate'], function () {
            var table = layui.table
            ,$ = layui.$
            , form = layui.form
            , layer = layui.layer
            , laydate = layui.laydate
            , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块
                , $ = layui.$
                , form = layui.form
                , layer = layui.layer
                , laydate = layui.laydate
                , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块
            //生成品种码
            form.on('submit(HBarcodeSaverPZ)', function (data) {//保存
@@ -246,64 +249,64 @@
                var sMainSub = sMainStr + ';' + sSubStr;
                layer.load(3)
                $.ajax(
                {
                    type: "POST",
                    url: GetWEBURL()+"GetBarcodeSaveBillVarieties", //方法所在页面和方法名
                    async: true,
                    data: { "msg": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // 说明验证成功了,
                            layer.msg(data.Message, { icon: 1 });
                            element.tabDelete('tabDemo', '2'); //删除
                            element.tabAdd('tabDemo', {
                                title: '条码信息'
                              , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                              , id: '2' //选项卡标题的lay-id属性值
                            });
                             table.render({
                                 elem: '#subTable'
                              , url:  GetWEBURL()+'GetHBarCodeShowBillSub2'
                              //, toolbar: '#toolbarDemo1'
                              , defaultToolbar: ['filter', 'exports']
                              , where: { sMsg: linterid }
                              , cols: [[
                                 // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                               , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                               , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                               , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                               , { field: 'HMaterName', title: '物料名称', width: 200 }
                               , { field: 'HMaterModel', title: '规格型号', width: 200 }
                               , { field: 'HBarCode', title: '条码编号', width: 200 }
                               , { field: 'HUnitName', title: '计量单位', width: 100 }
                               , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                               , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                               , { field: 'HQty', title: '数量', width: 100 }
                               , { field: 'HBatchNo', title: '批次', width: 100 }
                               , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                               , { field: 'HKFDate', title: '生产日期', width: 100 }
                               , { field: 'HKFPeriod', title: '保质期', width: 100 }
                               , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                              ]]
                                // , data: [linterid]
                            //  , page: true
                              , done: function () {
                                  layer.closeAll("loading");
                              }
                             });
                             element.tabChange('tabDemo', '2');
                    {
                        type: "POST",
                        url: GetWEBURL() + "GetBarcodeSaveBillVarieties", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // 说明验证成功了,
                                layer.msg(data.Message, { icon: 1 });
                                element.tabDelete('tabDemo', '2'); //删除
                                element.tabAdd('tabDemo', {
                                    title: '条码信息'
                                    , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                                    , id: '2' //选项卡标题的lay-id属性值
                                });
                                table.render({
                                    elem: '#subTable'
                                    , url: GetWEBURL() + 'GetHBarCodeShowBillSub2'
                                    //, toolbar: '#toolbarDemo1'
                                    , defaultToolbar: ['filter', 'exports']
                                    , where: { sMsg: linterid }
                                    , cols: [[
                                        // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                                        , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                                        , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                        , { field: 'HBarCode', title: '条码编号', width: 200 }
                                        , { field: 'HUnitName', title: '计量单位', width: 100 }
                                        , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                        , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                        , { field: 'HQty', title: '数量', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                                        , { field: 'HKFDate', title: '生产日期', width: 100 }
                                        , { field: 'HKFPeriod', title: '保质期', width: 100 }
                                        , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                                    ]]
                                    // , data: [linterid]
                                    //  , page: true
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                                element.tabChange('tabDemo', '2');
                            }
                            else {
                                // $("#verifycode").click();
                                layer.msg(data.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                        }
                        else {
                            // $("#verifycode").click();
                            layer.msg(data.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        f_alert("错误:" + err);
                    }
                });
                    });
                return false;
            });
            //生成唯一码
@@ -316,64 +319,64 @@
                var sMainSub = sMainStr + ';' + sSubStr;
                layer.load(3)
                $.ajax(
                {
                    type: "POST",
                    url: GetWEBURL()+"GetBarcodeSaveBillOnly", //方法所在页面和方法名
                    async: true,
                    data: { "msg": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // 说明验证成功了,
                            layer.msg(data.Message, { icon: 1 });
                            element.tabDelete('tabDemo', '2'); //删除
                            element.tabAdd('tabDemo', {
                                title: '条码信息'
                              , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                              , id: '2' //选项卡标题的lay-id属性值
                            });
                            table.render({
                                elem: '#subTable'
                             , url:  GetWEBURL()+'GetHBarCodeShowBillSub2'
                             , toolbar: '#toolbarDemo1'
                             , defaultToolbar: ['filter', 'exports']
                             , where: { sMsg: linterid }
                             , cols: [[
                                 // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                               , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                               , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                               , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                               , { field: 'HMaterName', title: '物料名称', width: 200 }
                               , { field: 'HMaterModel', title: '规格型号', width: 200 }
                               , { field: 'HBarCode', title: '条码编号', width: 200}
                               , { field: 'HUnitName', title: '计量单位', width: 100 }
                               , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                               , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                               , { field: 'HQty', title: '数量', width: 100 }
                               , { field: 'HBatchNo', title: '批次', width: 100 }
                               , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                               , { field: 'HKFDate', title: '生产日期', width: 100 }
                               , { field: 'HKFPeriod', title: '保质期', width: 100 }
                               , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                    {
                        type: "POST",
                        url: GetWEBURL() + "GetBarcodeSaveBillOnly", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // 说明验证成功了,
                                layer.msg(data.Message, { icon: 1 });
                                element.tabDelete('tabDemo', '2'); //删除
                                element.tabAdd('tabDemo', {
                                    title: '条码信息'
                                    , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                                    , id: '2' //选项卡标题的lay-id属性值
                                });
                                table.render({
                                    elem: '#subTable'
                                    , url: GetWEBURL() + 'GetHBarCodeShowBillSub2'
                                    , toolbar: '#toolbarDemo1'
                                    , defaultToolbar: ['filter', 'exports']
                                    , where: { sMsg: linterid }
                                    , cols: [[
                                        // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                                        , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                                        , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                        , { field: 'HBarCode', title: '条码编号', width: 200 }
                                        , { field: 'HUnitName', title: '计量单位', width: 100 }
                                        , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                        , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                        , { field: 'HQty', title: '数量', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                                        , { field: 'HKFDate', title: '生产日期', width: 100 }
                                        , { field: 'HKFPeriod', title: '保质期', width: 100 }
                                        , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                             ]]
                                // , data: [linterid]
                                //  , page: true
                             , done: function () {
                                 layer.closeAll("loading");
                             }
                            });
                            element.tabChange('tabDemo', '2');
                                    ]]
                                    // , data: [linterid]
                                    //  , page: true
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                                element.tabChange('tabDemo', '2');
                            }
                            else {
                                // $("#verifycode").click();
                                layer.msg(data.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                        }
                        else {
                            // $("#verifycode").click();
                            layer.msg(data.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        f_alert("错误:" + err);
                    }
                });
                    });
                return false;
            });
            //生成内外箱码
@@ -386,138 +389,138 @@
                var sMainSub = sMainStr + ';' + sSubStr;
                layer.load(3)
                $.ajax(
                {
                    type: "POST",
                    url: GetWEBURL()+"GetBarcodeSaveBillBox", //方法所在页面和方法名
                    async: true,
                    data: { "msg": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // 说明验证成功了,
                            layer.msg(data.Message, { icon: 1 });
                            element.tabDelete('tabDemo', '2'); //删除
                            element.tabDelete('tabDemo', '3'); //删除
                            element.tabAdd('tabDemo', {
                                title: '外箱条码'
                              , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                              , id: '2' //选项卡标题的lay-id属性值
                            });
                            table.render({
                                elem: '#subTable'
                             , url:  GetWEBURL()+'GetHBarCodeShowBillSub3'
                             , toolbar: '#toolbarDemo1'
                             , defaultToolbar: ['filter', 'exports']
                             , where: { sMsg: linterid }
                             , cols: [[
                                 // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                               , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                               , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                               , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                               , { field: 'HMaterName', title: '物料名称', width: 200 }
                               , { field: 'HMaterModel', title: '规格型号', width: 200 }
                               , { field: 'HBarCode', title: '条码编号', width: 200 }
                               , { field: 'HUnitName', title: '计量单位', width: 100 }
                               , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                               , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                               , { field: 'HQty', title: '数量', width: 100 }
                               , { field: 'HBatchNo', title: '批次', width: 100 }
                               , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                               , { field: 'HKFDate', title: '生产日期', width: 100 }
                               , { field: 'HKFPeriod', title: '保质期', width: 100 }
                               , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                    {
                        type: "POST",
                        url: GetWEBURL() + "GetBarcodeSaveBillBox", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // 说明验证成功了,
                                layer.msg(data.Message, { icon: 1 });
                                element.tabDelete('tabDemo', '2'); //删除
                                element.tabDelete('tabDemo', '3'); //删除
                                element.tabAdd('tabDemo', {
                                    title: '外箱条码'
                                    , content: '<table class="layui-hide" id="subTable" lay-filter="subTable"></table>' //支持传入(html代码)不持支直接传入html页面
                                    , id: '2' //选项卡标题的lay-id属性值
                                });
                                table.render({
                                    elem: '#subTable'
                                    , url: GetWEBURL() + 'GetHBarCodeShowBillSub3'
                                    , toolbar: '#toolbarDemo1'
                                    , defaultToolbar: ['filter', 'exports']
                                    , where: { sMsg: linterid }
                                    , cols: [[
                                        // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                                        , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                                        , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                        , { field: 'HBarCode', title: '条码编号', width: 200 }
                                        , { field: 'HUnitName', title: '计量单位', width: 100 }
                                        , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                        , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                        , { field: 'HQty', title: '数量', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                                        , { field: 'HKFDate', title: '生产日期', width: 100 }
                                        , { field: 'HKFPeriod', title: '保质期', width: 100 }
                                        , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                             ]]
                                // , data: [linterid]
                                //  , page: true
                             , done: function () {
                                 layer.closeAll("loading");
                             }
                            });
                            element.tabAdd('tabDemo', {
                                title: '内箱条码'
                                , content: '<table class="layui-hide" id="subTable2" lay-filter="subTable2"></table>' //支持传入(html代码)不持支直接传入html页面
                                , id: '3' //选项卡标题的lay-id属性值
                            });
                            table.render({
                                elem: '#subTable2'
                             , url:  GetWEBURL()+'GetHBarCodeShowBillSub4'
                             , toolbar: '#toolbarDemo2'
                             , defaultToolbar: ['filter', 'exports']
                             , where: { sMsg: linterid }
                             , cols: [[
                                 // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                               , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                               , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                               , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                               , { field: 'HMaterName', title: '物料名称', width: 200 }
                               , { field: 'HMaterModel', title: '规格型号', width: 200 }
                               , { field: 'HBarCode', title: '条码编号', width: 200 }
                               , { field: 'HUnitName', title: '计量单位', width: 100 }
                               , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                               , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                               , { field: 'HQty', title: '数量', width: 100 }
                               , { field: 'HBatchNo', title: '批次', width: 100 }
                               , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                               , { field: 'HKFDate', title: '生产日期', width: 100 }
                               , { field: 'HKFPeriod', title: '保质期', width: 100}
                               , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                                    ]]
                                    // , data: [linterid]
                                    //  , page: true
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                                element.tabAdd('tabDemo', {
                                    title: '内箱条码'
                                    , content: '<table class="layui-hide" id="subTable2" lay-filter="subTable2"></table>' //支持传入(html代码)不持支直接传入html页面
                                    , id: '3' //选项卡标题的lay-id属性值
                                });
                                table.render({
                                    elem: '#subTable2'
                                    , url: GetWEBURL() + 'GetHBarCodeShowBillSub4'
                                    , toolbar: '#toolbarDemo2'
                                    , defaultToolbar: ['filter', 'exports']
                                    , where: { sMsg: linterid }
                                    , cols: [[
                                        // , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true edit: 'text', hide: true }
                                        , { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
                                        , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 200 }
                                        , { field: 'HMaterName', title: '物料名称', width: 200 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                        , { field: 'HBarCode', title: '条码编号', width: 200 }
                                        , { field: 'HUnitName', title: '计量单位', width: 100 }
                                        , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                        , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                        , { field: 'HQty', title: '数量', width: 100 }
                                        , { field: 'HBatchNo', title: '批次', width: 100 }
                                        , { field: 'HEndQty', title: '是否尾箱', width: 100 }
                                        , { field: 'HKFDate', title: '生产日期', width: 100 }
                                        , { field: 'HKFPeriod', title: '保质期', width: 100 }
                                        , { field: 'HKFDQDate', title: '到期日期', width: 100 }
                             ]]
                                // , data: [linterid]
                                //  , page: true
                             , done: function () {
                                 layer.closeAll("loading");
                             }
                            });
                            element.tabChange('tabDemo', '2');
                                    ]]
                                    // , data: [linterid]
                                    //  , page: true
                                    , done: function () {
                                        layer.closeAll("loading");
                                    }
                                });
                                element.tabChange('tabDemo', '2');
                            }
                            else {
                                // $("#verifycode").click();
                                layer.msg(data.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                        }
                        else {
                            // $("#verifycode").click();
                            layer.msg(data.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        f_alert("错误:" + err);
                    }
                });
                    });
                return false;
            });
      form.on('submit(Print)', function (data) {//打印
        var data1 = layui.table.cache["subTable"]
        , data2 = layui.table.cache["subTable2"];
        var rows = '';
        var rows2 = '';
        for (var i = 0; i < data1.length; i++) {
            rows += data1[i].HItemID.toString() + ',';
            rows2 += data1[i].HBarCode.toString() + ',';
        }
        for (var j = 0; j < data2.length; j++) {
            rows += data2[j].HItemID.toString() + ',';
            rows2 += data2[j].HBarCode.toString() + ',';
        }
        rows = rows.substring(rows.length - 1, 0);
        rows2 = rows2.substring(rows2.length - 1, 0);
        if (rows == "") {
            layer.msg("至少选择一行记录!")
        }
        else {
            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=' + rows.toString() + '&HBarcode=' + rows2.toString() + '&Type=HBarCodePrint', 'yes']
                , resize: false
                //, cancel: function () {
                //    $(".layui-btn").removeClass("layui-btn-disabled");
                //}
            })
        }
        });
            form.on('submit(Print)', function (data) {//打印
                var data1 = layui.table.cache["subTable"]
                    , data2 = layui.table.cache["subTable2"];
                var rows = '';
                var rows2 = '';
                for (var i = 0; i < data1.length; i++) {
                    rows += data1[i].HItemID.toString() + ',';
                    rows2 += data1[i].HBarCode.toString() + ',';
                }
                for (var j = 0; j < data2.length; j++) {
                    rows += data2[j].HItemID.toString() + ',';
                    rows2 += data2[j].HBarCode.toString() + ',';
                }
                rows = rows.substring(rows.length - 1, 0);
                rows2 = rows2.substring(rows2.length - 1, 0);
                if (rows == "") {
                    layer.msg("至少选择一行记录!")
                }
                else {
                    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=' + rows.toString() + '&HBarcode=' + rows2.toString() + '&Type=HBarCodePrint', 'yes']
                        , resize: false
                        //, cancel: function () {
                        //    $(".layui-btn").removeClass("layui-btn-disabled");
                        //}
                    })
                }
            });
            form.on('submit(Exit)', function (data) {//退出
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
@@ -534,51 +537,52 @@
                }
            });
            layer.load(3)
            table.render({
                elem: '#mainTable'
              , url:  GetWEBURL()+'GetHBarCodeShowBillSub'
              , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
              , defaultToolbar: ['filter', 'exports']
              , where: { sMsg: linterid, sMsg2: lentryid }
              , cols: [[
              , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
              , { field: 'HMaterNumber', title: '物料代码', width: 100 }
              , { field: 'HMaterName', title: '物料名称', width: 200 }
              , { field: 'HMaterModel', title: '规格型号', width: 200 }
              , { field: 'HUnitName', title: '计量单位', width: 100 }
              , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
              , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
              , { field: 'HQty', title: '数量', width: 100 }
              , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text' }
              , { field: 'HBQty', title: '内箱数', width: 100 }
              , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text' }
              , { field: 'HWBQty', title: '外箱数', width: 100 }
              , { field: 'HPrice', title: '单价', width: 100, hide: true }
              , { field: 'HMoney', title: '金额', width: 100, hide: true }
              , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
              , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
              , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150 }//, data_field: 'HKFDate', event: "chooseHKFDate"
              , { field: 'HKFPeriod', title: '保质期', width: 100 }//, edit: 'text', event: "inputHKFPeriod"
              , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150 }//, data_field: 'HKFDQDate', event: "chooseHKFDQDate"
              //, { field: 'HDate', title: '要求交货日期', width: 150 }
              , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
              , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
              , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
              , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
              , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
              , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
              , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
              , { field: 'HSourceBillType', title: '源单类型', width: 100 }
              , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
              , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
              , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
              , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                , url: GetWEBURL() + subUrl
                , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                , defaultToolbar: ['filter', 'exports']
                , where: { sMsg: linterid, sMsg2: lentryid }
                , cols: [[
                    , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', width: 200 }
                    , { field: 'HMaterModel', title: '规格型号', width: 200 }
                    , { field: 'HUnitName', title: '计量单位', width: 100 }
                    , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                    , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text' }
                    , { field: 'HBQty', title: '内箱数', width: 100 }
                    , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text' }
                    , { field: 'HWBQty', title: '外箱数', width: 100 }
                    , { field: 'HPrice', title: '单价', width: 100, hide: true }
                    , { field: 'HMoney', title: '金额', width: 100, hide: true }
                    , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                    , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
                    , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150 }//, data_field: 'HKFDate', event: "chooseHKFDate"
                    , { field: 'HKFPeriod', title: '保质期', width: 100 }//, edit: 'text', event: "inputHKFPeriod"
                    , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150 }//, data_field: 'HKFDQDate', event: "chooseHKFDQDate"
                    //, { field: 'HDate', title: '要求交货日期', width: 150 }
                    , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                    , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                    , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                    , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                    , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                    , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
                    , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                    , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                    , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
              ]]
              // , data: [linterid]
             // , page: true
                ]]
                // , data: [linterid]
                // , page: true
                //, height: 500
                , done: function (res, curr, count) {
                    //日期控件
                    //$(".layui-input-date").each(function (i) {
@@ -605,95 +609,95 @@
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                        //自定义头工具栏
                    //自定义头工具栏
                    case 'btn-normal':
                        table.render({
                            elem: '#mainTable'
                          , url:  GetWEBURL()+'GetHBarCodeShowBillSub'
                          , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                          , defaultToolbar: ['filter', 'exports']
                          , where: { sMsg: linterid, sMsg2: lentryid }
                          , cols: [[
                            , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                            , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                            , { field: 'HMaterName', title: '物料名称', width: 200 }
                            , { field: 'HMaterModel', title: '规格型号', width: 200 }
                            , { field: 'HUnitName', title: '计量单位', width: 100 }
                            , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                            , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                            , { field: 'HQty', title: '数量', width: 100 }
                            , { field: 'HMinQty', title: '最小包装数', width: 100, edit: 'text' }
                            , { field: 'HBQty', title: '条码张数', width: 100 }
                            , { field: 'HPrice', title: '单价', width: 100, hide: true }
                            , { field: 'HMoney', title: '金额', width: 100, hide: true }
                            , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                            , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
                            , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                            , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod" }
                            , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate" }
                            //, { field: 'HDate', title: '要求交货日期', width: 150 }
                            , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                            , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                            , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                            , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                            , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                            , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
                            , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
                            , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                            , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                            , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                            , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                            , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                          ]]
                          , done: function () {
                              layer.closeAll("loading");
                          }
                            , url: GetWEBURL() + 'GetHBarCodeShowBillSub'
                            , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                            , defaultToolbar: ['filter', 'exports']
                            , where: { sMsg: linterid, sMsg2: lentryid }
                            , cols: [[
                                , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                                , { field: 'HMaterName', title: '物料名称', width: 200 }
                                , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                , { field: 'HUnitName', title: '计量单位', width: 100 }
                                , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                , { field: 'HQty', title: '数量', width: 100 }
                                , { field: 'HMinQty', title: '最小包装数', width: 100, edit: 'text' }
                                , { field: 'HBQty', title: '条码张数', width: 100 }
                                , { field: 'HPrice', title: '单价', width: 100, hide: true }
                                , { field: 'HMoney', title: '金额', width: 100, hide: true }
                                , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                                , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
                                , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                                , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod" }
                                , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate" }
                                //, { field: 'HDate', title: '要求交货日期', width: 150 }
                                , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                                , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                                , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                                , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                                , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                                , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
                                , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
                                , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                                , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                                , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                                , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                                , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                            ]]
                            , done: function () {
                                layer.closeAll("loading");
                            }
                        });
                        break;
                    case "btn-box":
                        table.render({
                            elem: '#mainTable'
                          , url:  GetWEBURL()+'GetHBarCodeShowBillSub'
                          , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                          , defaultToolbar: ['filter', 'exports']
                          , where: { sMsg: linterid, sMsg2: lentryid }
                          , cols: [[
                            , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                            , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                            , { field: 'HMaterName', title: '物料名称', width: 200 }
                            , { field: 'HMaterModel', title: '规格型号', width: 200 }
                            , { field: 'HUnitName', title: '计量单位', width: 100 }
                            , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                            , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                            , { field: 'HQty', title: '数量', width: 100 }
                            , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text' }
                            , { field: 'HBQty', title: '内箱数', width: 100 }
                            , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text' }
                            , { field: 'HWBQty', title: '外箱数', width: 100 }
                            , { field: 'HPrice', title: '单价', width: 100, hide: true }
                            , { field: 'HMoney', title: '金额', width: 100, hide: true }
                            , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                            , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
                            , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                            , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod" }
                            , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate" }
                            //, { field: 'HDate', title: '要求交货日期', width: 150 }
                            , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                            , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                            , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                            , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                            , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                            , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
                            , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
                            , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                            , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                            , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                            , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                            , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                          ]]
                          , done: function () {
                              layer.closeAll("loading");
                          }
                            , url: GetWEBURL() + 'GetHBarCodeShowBillSub'
                            , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                            , defaultToolbar: ['filter', 'exports']
                            , where: { sMsg: linterid, sMsg2: lentryid }
                            , cols: [[
                                , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                                , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                                , { field: 'HMaterName', title: '物料名称', width: 200 }
                                , { field: 'HMaterModel', title: '规格型号', width: 200 }
                                , { field: 'HUnitName', title: '计量单位', width: 100 }
                                , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true }
                                , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
                                , { field: 'HQty', title: '数量', width: 100 }
                                , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text' }
                                , { field: 'HBQty', title: '内箱数', width: 100 }
                                , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text' }
                                , { field: 'HWBQty', title: '外箱数', width: 100 }
                                , { field: 'HPrice', title: '单价', width: 100, hide: true }
                                , { field: 'HMoney', title: '金额', width: 100, hide: true }
                                , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                                , { field: 'HBatchNo', title: '批次', width: 100, edit: 'text' }
                                , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                                , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod" }
                                , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate" }
                                //, { field: 'HDate', title: '要求交货日期', width: 150 }
                                , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                                , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                                , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                                , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                                , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                                , { field: 'HWWOrderDetaiLID    ', title: '委外订单明细内码', width: 150, hide: true }
                                , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200 }
                                , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                                , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                                , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                                , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                                , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                            ]]
                            , done: function () {
                                layer.closeAll("loading");
                            }
                        });
                        break;
@@ -703,35 +707,36 @@
            //监听行工具事件
            table.on('tool(mainTable)', function (obj) {
                var data = obj.data;
                if(obj.event === 'chooseHKFDate'){
                if (obj.event === 'chooseHKFDate') {
                    var field = $(this).data('field');
                    laydate.render({
                        elem: this.firstChild
                      , show: true //直接显示
                      , closeStop: this
                      , done: function (value, date) {
                          data[field] = value;
                          obj.update(data);
                          if (parseInt(obj.data.HKFPeriod) >= 0) {
                              var sKFDQDate = addDate(value, parseInt(obj.data.HKFPeriod));
                              obj.update({
                                  HKFDQDate: sKFDQDate,
                              });
                          }
                      }
                        , show: true //直接显示
                        , closeStop: this
                        , done: function (value, date) {
                            data[field] = value;
                            obj.update(data);
                            if (parseInt(obj.data.HKFPeriod) >= 0) {
                                var sKFDQDate = addDate(value, parseInt(obj.data.HKFPeriod));
                                obj.update({
                                    HKFDQDate: sKFDQDate,
                                });
                            }
                        }
                    });
                }
                else if (obj.event == 'chooseHKFDQDate') {
                    var field = $(this).data('field');
                    laydate.render({
                        elem: this.firstChild
                      , show: true //直接显示
                      , closeStop: this
                      , done: function (value, date) {
                          data[field] = value;
                          obj.update(data);
                        , show: true //直接显示
                        , closeStop: this
                        , done: function (value, date) {
                            data[field] = value;
                            obj.update(data);
                      }});
                        }
                    });
                }
                else if (obj.event == 'inputHKFPeriod') {
                    $(obj.tr).find(".layui-table-edit").keyup(function () {
@@ -753,81 +758,79 @@
            //    }
            //});
            table.on('edit(mainTable)', function (obj) { //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值"
               var value = obj.value //得到修改后的值
                  ,data = obj.data //得到所在行所有键值
                  , field = obj.field; //得到字段
               var HMinQty = 0;
               var HWXQty = 0;
               var HKFPeriod = 0;
               if (obj.data.HMinQty != undefined)
               {
                   HMinQty = parseFloat(obj.data.HMinQty);
               }
               if (obj.data.HWXQty != undefined) {
                   HWXQty = parseFloat(obj.data.HWXQty);
               }
               if (obj.data.HKFPeriod != undefined) {
                   HKFPeriod = parseFloat(obj.data.HKFPeriod);
               }
               HKFPeriod
               switch(field){
                   case "HMinQty":
                       if (HMinQty>0){
                           if (HWXQty >= 0) {
                               if (isPositiveIntegerTimes(parseFloat(obj.value), HWXQty)) //外箱包装数能被内箱包装数整除
                               {
                                   obj.update({
                                       HBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                   });
                               }
                               else {
                                   //obj.update({
                                   //    HMinQty: 0,
                                   //});
                                   f_alert("外箱包装数必须是内箱包装数的整数倍!");
                               }
                           }
                       }
                       else
                       {
                           //obj.update({
                           //    HMinQty: 0,
                           //});
                           f_alert("内箱包装数不能为负数!");
                       }
                       break;
                   case "HWXQty":
                       if (HWXQty > 0) {
                           if (HMinQty >= 0) {
                               if (isPositiveIntegerTimes(HMinQty, parseFloat(obj.value))) //外箱包装数能被内箱包装数整除
                               {
                                   obj.update({
                                       HWBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                   });
                               }
                               else {
                                   //obj.update({
                                   //    HWXQty: 0,
                                   //});
                                   f_alert("外箱包装数必须是内箱包装数的整数倍!");
                               }
                           }
                       }
                       else {
                           //obj.update({
                           //    HWXQty: 0,
                           //});
                           f_alert("外箱包装数不能为负数!");
                       }
                       break;
                   case "HKFPeriod":
                       if (HKFPeriod >= 0) {
                           var sKFDQDate = addDate(obj.data.HKFDate, HKFPeriod);
                           obj.update({
                               HKFDQDate: sKFDQDate,
                           });
                       }
         }
                var value = obj.value //得到修改后的值
                    , data = obj.data //得到所在行所有键值
                    , field = obj.field; //得到字段
                var HMinQty = 0;
                var HWXQty = 0;
                var HKFPeriod = 0;
                if (obj.data.HMinQty != undefined) {
                    HMinQty = parseFloat(obj.data.HMinQty);
                }
                if (obj.data.HWXQty != undefined) {
                    HWXQty = parseFloat(obj.data.HWXQty);
                }
                if (obj.data.HKFPeriod != undefined) {
                    HKFPeriod = parseFloat(obj.data.HKFPeriod);
                }
                HKFPeriod
                switch (field) {
                    case "HMinQty":
                        if (HMinQty > 0) {
                            if (HWXQty >= 0) {
                                if (isPositiveIntegerTimes(parseFloat(obj.value), HWXQty)) //外箱包装数能被内箱包装数整除
                                {
                                    obj.update({
                                        HBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                    });
                                }
                                else {
                                    //obj.update({
                                    //    HMinQty: 0,
                                    //});
                                    f_alert("外箱包装数必须是内箱包装数的整数倍!");
                                }
                            }
                        }
                        else {
                            //obj.update({
                            //    HMinQty: 0,
                            //});
                            f_alert("内箱包装数不能为负数!");
                        }
                        break;
                    case "HWXQty":
                        if (HWXQty > 0) {
                            if (HMinQty >= 0) {
                                if (isPositiveIntegerTimes(HMinQty, parseFloat(obj.value))) //外箱包装数能被内箱包装数整除
                                {
                                    obj.update({
                                        HWBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                    });
                                }
                                else {
                                    //obj.update({
                                    //    HWXQty: 0,
                                    //});
                                    f_alert("外箱包装数必须是内箱包装数的整数倍!");
                                }
                            }
                        }
                        else {
                            //obj.update({
                            //    HWXQty: 0,
                            //});
                            f_alert("外箱包装数不能为负数!");
                        }
                        break;
                    case "HKFPeriod":
                        if (HKFPeriod >= 0) {
                            var sKFDQDate = addDate(obj.data.HKFDate, HKFPeriod);
                            obj.update({
                                HKFDQDate: sKFDQDate,
                            });
                        }
                }
            });
@@ -839,20 +842,20 @@
                        page: {
                            curr: 1 //重新从第 1 页开始
                        }
                      , where: {
                          key: {
                              id: demoReload.val()
                          }
                      }
                        , where: {
                            key: {
                                id: demoReload.val()
                            }
                        }
                    });
                }
            };
            $('.test-table-reload-btn .layui-btn').on('click', function () {
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
           });
        });
    </script>
</body>
</html>
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill_Edit.html
@@ -277,7 +277,7 @@
                elem: '#mainTable'
              //, url: GetWEBURL()+'GetNewPOInStockShowBillSub'
              , toolbar: '#toolbarDemo'
              //, where: { sMsg: linterid, sMsg2: lentryid, sMsg3: lSourceBillType }
             //, where: { sMsg: linterid, sMsg2: lentryid, sMsg3: lSourceBillType }
             // , where: { sMsg: '28', sMsg2: '28,5;' }
              , cols: [[
                  { type: 'checkbox', fixed: 'left' }
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POOrderBillList.html
@@ -142,6 +142,7 @@
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-report" id="btn_report"><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-generate"><i class="layui-icon layui-icon-file"></i>生成送货单</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-barcode"><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>
@@ -422,6 +423,27 @@
                            })
                        }
                        break;
                        btn - barcode
                    case 'btn-barcode':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        //if (data[0].未生成条码数量 <= 0) {
                        //    layer.msg("选中行已生成条码!", { icon: 5 });
                        //}
                        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 + '&type =SRM_POOrderBillList', '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);